Skip to content

Commit

Permalink
Merge branch '1.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jan 14, 2015
2 parents 0074e9d + 376de01 commit 16cb44f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -308,18 +308,19 @@ private void visitModule(ModuleNode module) {
// We only need to do it at most once
break;
}
// Remove GrabReolvers because all the dependencies are local now
removeGrabResolver(module.getClasses());
removeGrabResolver(module.getImports());
// Disable the addition of a static initializer that calls Grape.addResolver
// because all the dependencies are local now
disableGrabResolvers(module.getClasses());
disableGrabResolvers(module.getImports());
}

private void removeGrabResolver(List<? extends AnnotatedNode> nodes) {
private void disableGrabResolvers(List<? extends AnnotatedNode> nodes) {
for (AnnotatedNode classNode : nodes) {
List<AnnotationNode> annotations = classNode.getAnnotations();
for (AnnotationNode node : new ArrayList<AnnotationNode>(annotations)) {
if (node.getClassNode().getNameWithoutPackage()
.equals("GrabResolver")) {
annotations.remove(node);
node.setMember("initClass", new ConstantExpression(false));
}
}
}
Expand Down

0 comments on commit 16cb44f

Please sign in to comment.