Remove unneeded dependencies, incl Guava
Fixes https://github.com/spring-projects/spring-shell/issues/95
This commit is contained in:
@@ -44,7 +44,6 @@ dependencies {
|
|||||||
compile "org.springframework:spring-core:$springVersion"
|
compile "org.springframework:spring-core:$springVersion"
|
||||||
compile "org.springframework:spring-context-support:$springVersion"
|
compile "org.springframework:spring-context-support:$springVersion"
|
||||||
compile "commons-io:commons-io:$commonsioVersion"
|
compile "commons-io:commons-io:$commonsioVersion"
|
||||||
compile "com.google.guava:guava:$guavaVersion"
|
|
||||||
compile "jline:jline:$jlineVersion"
|
compile "jline:jline:$jlineVersion"
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +51,6 @@ dependencies {
|
|||||||
testCompile "junit:junit:$junitVersion"
|
testCompile "junit:junit:$junitVersion"
|
||||||
testCompile "org.mockito:mockito-core:$mockitoVersion"
|
testCompile "org.mockito:mockito-core:$mockitoVersion"
|
||||||
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
|
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
|
||||||
testCompile "uk.co.modular-it:hamcrest-date:$hamcrestDateVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = 1.6
|
sourceCompatibility = 1.6
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
slf4jVersion=1.7.13
|
slf4jVersion=1.7.13
|
||||||
guavaVersion=17.0
|
|
||||||
jlineVersion=2.12
|
jlineVersion=2.12
|
||||||
junitVersion=4.12
|
junitVersion=4.12
|
||||||
springVersion=4.2.4.RELEASE
|
springVersion=4.2.4.RELEASE
|
||||||
@@ -7,4 +6,3 @@ commonsioVersion=2.4
|
|||||||
hamcrestVersion=1.3
|
hamcrestVersion=1.3
|
||||||
version=1.2.1.BUILD-SNAPSHOT
|
version=1.2.1.BUILD-SNAPSHOT
|
||||||
mockitoVersion=1.10.19
|
mockitoVersion=1.10.19
|
||||||
hamcrestDateVersion=0.9.3
|
|
||||||
|
|||||||
@@ -16,12 +16,11 @@
|
|||||||
|
|
||||||
package org.springframework.shell.support.table;
|
package org.springframework.shell.support.table;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import com.google.common.base.Splitter;
|
|
||||||
|
|
||||||
import org.springframework.shell.support.util.StringUtils;
|
import org.springframework.shell.support.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,8 +163,7 @@ public final class TableRenderer {
|
|||||||
for (TableHeader header : table.getHeaders().values()) {
|
for (TableHeader header : table.getHeaders().values()) {
|
||||||
|
|
||||||
if (header.getName().length() > header.getWidth()) {
|
if (header.getName().length() > header.getWidth()) {
|
||||||
Iterable<String> chunks = Splitter.fixedLength(
|
Iterable<String> chunks = split(header.getName(), header.getWidth());
|
||||||
header.getWidth()).split(header.getName());
|
|
||||||
int length = headerline.length();
|
int length = headerline.length();
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (String chunk : chunks) {
|
for (String chunk : chunks) {
|
||||||
@@ -205,8 +203,7 @@ public final class TableRenderer {
|
|||||||
.entrySet()) {
|
.entrySet()) {
|
||||||
String value = row.getValue(entry.getKey());
|
String value = row.getValue(entry.getKey());
|
||||||
if (value.length() > entry.getValue().getWidth()) {
|
if (value.length() > entry.getValue().getWidth()) {
|
||||||
Iterable<String> chunks = Splitter.fixedLength(
|
Iterable<String> chunks = split(value, entry.getValue().getWidth());
|
||||||
entry.getValue().getWidth()).split(value);
|
|
||||||
int length = rowLine.length();
|
int length = rowLine.length();
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (String chunk : chunks) {
|
for (String chunk : chunks) {
|
||||||
@@ -265,4 +262,13 @@ public final class TableRenderer {
|
|||||||
|
|
||||||
return headerBorder.toString();
|
return headerBorder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<String> split(String in, int length) {
|
||||||
|
List<String> result = new ArrayList<String>(in.length() / length);
|
||||||
|
for (int i = 0; i < in.length(); i += length) {
|
||||||
|
result.add(in.substring(i, Math.min(in.length(), i + length)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user