Permalink
Browse files

minimized transitive dependencies

  • Loading branch information...
1 parent 24964cd commit 05af4ca310aff6b811f52b8ff82700ba22f6d863 @groldan groldan committed Jul 31, 2011
View
@@ -1,3 +1,4 @@
target
.classpath
.project
+.settings
View
78 pom.xml
@@ -58,6 +58,37 @@
<dependencyManagement>
<dependencies>
<dependency>
+ <!-- used for LRUMap, can be removed once/if AbstractObjectDatabase uses an alternate/external caching mechanism -->
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vividsolutions</groupId>
+ <artifactId>jts</artifactId>
+ <version>1.12</version>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-opengis</artifactId>
+ <version>${gt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-referencing</artifactId>
+ <version>${gt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-epsg-hsql</artifactId>
+ <version>${gt.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-main</artifactId>
+ <version>${gt.version}</version>
+ </dependency>
+ <dependency>
<!-- Google Common Libraries. Featuring com.google.collect collection classes -->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -112,14 +143,16 @@
<artifactId>bxml-utils</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.gvsig</groupId>
- <artifactId>bxml-geoserver</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
+ <!-- dependency> <groupId>org.gvsig</groupId> <artifactId>bxml-geoserver</artifactId> <version>1.0-SNAPSHOT</version>
+ </dependency -->
<!-- Test scope dependencies -->
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
@@ -139,6 +172,31 @@
<dependencies>
<dependency>
+ <!-- used for LRUMap, can be removed once/if AbstractObjectDatabase uses an alternate/external caching mechanism -->
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.vividsolutions</groupId>
+ <artifactId>jts</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-opengis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-referencing</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-epsg-hsql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.geotools</groupId>
+ <artifactId>gt-main</artifactId>
+ </dependency>
+ <dependency>
<!-- Google Common Libraries. Featuring com.google.collect collection classes -->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -172,13 +230,15 @@
<groupId>org.gvsig</groupId>
<artifactId>bxml-utils</artifactId>
</dependency>
- <dependency>
- <groupId>org.gvsig</groupId>
- <artifactId>bxml-geoserver</artifactId>
- </dependency>
+ <!-- dependency> <groupId>org.gvsig</groupId> <artifactId>bxml-geoserver</artifactId> </dependency -->
<!-- Test scope dependencies -->
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
@@ -9,7 +9,8 @@
import org.geogit.repository.SpatialOps;
import org.opengis.geometry.BoundingBox;
-import org.springframework.util.Assert;
+
+import com.google.common.base.Preconditions;
public class DiffEntry {
@@ -112,7 +113,8 @@ public String toString() {
public static DiffEntry newInstance(final ObjectId fromCommit, final ObjectId toCommit,
final Ref oldObject, final Ref newObject, final List<String> path) {
- Assert.isTrue(oldObject != null || newObject != null);
+ Preconditions.checkArgument(oldObject != null || newObject != null);
+
if (oldObject != null && oldObject.equals(newObject)) {
throw new IllegalArgumentException(
"Trying to create a DiffEntry for the same object id, means the object didn't change: "
@@ -15,8 +15,8 @@
import org.geogit.api.RevObject.TYPE;
import org.geogit.repository.DepthSearch;
import org.geogit.repository.Repository;
-import org.springframework.util.Assert;
+import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Iterators;
@@ -32,9 +32,9 @@
private List<String> basePath;
public DiffTreeWalk(final Repository repo, final ObjectId fromCommit, final ObjectId toCommit) {
- Assert.notNull(repo);
- Assert.notNull(fromCommit);
- Assert.notNull(toCommit);
+ Preconditions.checkNotNull(repo);
+ Preconditions.checkNotNull(fromCommit);
+ Preconditions.checkNotNull(toCommit);
this.repo = repo;
this.fromCommit = fromCommit;
@@ -82,8 +82,8 @@ public void setFilter(final String... path) {
final ObjectId newTreeId = newObject == null ? ObjectId.NULL : newObject.getObjectId();
final RevTree oldTree = repo.getTree(oldTreeId);
final RevTree newTree = repo.getTree(newTreeId);
- Assert.isTrue(oldTree.isNormalized());
- Assert.isTrue(newTree.isNormalized());
+ Preconditions.checkState(oldTree.isNormalized());
+ Preconditions.checkState(newTree.isNormalized());
return new TreeDiffEntryIterator(basePath, fromCommit, toCommit, oldTree, newTree, repo);
@@ -172,7 +172,7 @@ protected DiffEntry computeNext() {
return (DiffEntry) nextObj;
}
- Assert.isTrue(nextObj instanceof Ref);
+ Preconditions.checkState(nextObj instanceof Ref);
final Ref next = (Ref) nextObj;
final List<String> childPath = childPath(next.getName());
@@ -187,7 +187,7 @@ protected DiffEntry computeNext() {
return computeNext();
}
- Assert.isTrue(TYPE.BLOB.equals(next.getType()));
+ Preconditions.checkState(TYPE.BLOB.equals(next.getType()));
Ref oldObject = null;
Ref newObject = null;
@@ -263,8 +263,8 @@ protected DiffEntry computeNext() {
newCommit, newEntries, repo);
return computeNext();
}
- Assert.isTrue(currSubTree == null || !currSubTree.hasNext());
- Assert.isTrue(oldEntries.hasNext() && newEntries.hasNext());
+ Preconditions.checkState(currSubTree == null || !currSubTree.hasNext());
+ Preconditions.checkState(oldEntries.hasNext() && newEntries.hasNext());
Ref nextOld = oldEntries.next();
Ref nextNew = newEntries.next();
@@ -300,7 +300,8 @@ protected DiffEntry computeNext() {
// comparison
final int comparison = ObjectId.forString(oldEntryName).compareTo(
ObjectId.forString(newEntryName));
- Assert.isTrue(comparison != 0, "Comparison can't be 0 if reached this point!");
+ Preconditions.checkState(comparison != 0,
+ "Comparison can't be 0 if reached this point!");
if (comparison < 0) {
// something was deleted in oldVersion, return a delete diff from oldVersion and
@@ -332,7 +333,7 @@ protected DiffEntry computeNext() {
return singleChange;
}
- Assert.isTrue(RevObject.TYPE.TREE.equals(objectType));
+ Preconditions.checkState(RevObject.TYPE.TREE.equals(objectType));
Iterator<DiffEntry> changesIterator;
@@ -346,8 +347,8 @@ protected DiffEntry computeNext() {
break;
}
case MODIFY: {
- Assert.isTrue(RevObject.TYPE.TREE.equals(nextOld.getType()));
- Assert.isTrue(RevObject.TYPE.TREE.equals(nextNew.getType()));
+ Preconditions.checkState(RevObject.TYPE.TREE.equals(nextOld.getType()));
+ Preconditions.checkState(RevObject.TYPE.TREE.equals(nextNew.getType()));
RevTree oldChildTree = repo.getTree(oldRef.getObjectId());
RevTree newChildTree = repo.getTree(newRef.getObjectId());
changesIterator = new TreeDiffEntryIterator(childPath, oldCommit, newCommit,
@@ -11,7 +11,8 @@
import org.opengis.feature.type.Name;
import org.opengis.filter.expression.PropertyName;
import org.opengis.util.ProgressListener;
-import org.springframework.util.Assert;
+
+import com.google.common.base.Preconditions;
/**
* A facade to Geo-GIT operations.
@@ -28,7 +29,7 @@
private final Repository repository;
public GeoGIT(final Repository repository) {
- Assert.notNull(repository, "repository can't be null");
+ Preconditions.checkNotNull(repository, "repository can't be null");
this.repository = repository;
}
@@ -14,8 +14,8 @@
import org.geogit.repository.Repository;
import org.geotools.util.Range;
-import org.springframework.util.Assert;
+import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Throwables;
import com.google.common.collect.AbstractIterator;
@@ -58,7 +58,7 @@ public LogOp(final Repository repository) {
}
public LogOp setLimit(int limit) {
- Assert.isTrue(limit > 0, "limit shall be > 0: " + limit);
+ Preconditions.checkArgument(limit > 0, "limit shall be > 0: " + limit);
this.limit = Integer.valueOf(limit);
return this;
}
@@ -91,7 +91,7 @@ public LogOp setUntil(ObjectId until) {
* @see #addPath(List)
*/
public LogOp addPath(final String... path) {
- Assert.notNull(path);
+ Preconditions.checkNotNull(path);
return addPath(Arrays.asList(path));
}
@@ -102,7 +102,8 @@ public LogOp addPath(final String... path) {
* @return
*/
public LogOp addPath(final List<String> path) {
- Assert.notNull(path);
+ Preconditions.checkNotNull(path);
+
if (this.paths == null) {
this.paths = new HashSet<List<String>>();
}
@@ -186,8 +187,8 @@ protected RevCommit computeNext() {
}
final RevCommit commit = repo.getCommit(nextCommitId);
List<ObjectId> parentIds = commit.getParentIds();
- Assert.notNull(parentIds);
- Assert.isTrue(parentIds.size() > 0);
+ Preconditions.checkNotNull(parentIds);
+ Preconditions.checkState(parentIds.size() > 0);
nextCommitId = commit.getParentIds().get(0);
@@ -215,9 +216,9 @@ protected RevCommit computeNext() {
public LogFilter(final Repository repo, final ObjectId oldestCommitId,
final Range<Long> timeRange, final Set<List<String>> paths) {
- Assert.notNull(repo);
- Assert.notNull(oldestCommitId);
- Assert.notNull(timeRange);
+ Preconditions.checkNotNull(repo);
+ Preconditions.checkNotNull(oldestCommitId);
+ Preconditions.checkNotNull(timeRange);
this.repo = repo;
this.oldestCommitId = oldestCommitId;
Oops, something went wrong.

0 comments on commit 05af4ca

Please sign in to comment.