From cc6410a2c65dba28d17f69bff59eff387a2eb80e Mon Sep 17 00:00:00 2001 From: deanhiller Date: Mon, 16 Oct 2006 18:59:13 +0000 Subject: fix the default package stuff for verifydesign. git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@57 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- src/java/net/sf/antcontrib/design/Design.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/java/net/sf/antcontrib/design') diff --git a/src/java/net/sf/antcontrib/design/Design.java b/src/java/net/sf/antcontrib/design/Design.java index e9d0a0d..67f92fa 100644 --- a/src/java/net/sf/antcontrib/design/Design.java +++ b/src/java/net/sf/antcontrib/design/Design.java @@ -24,6 +24,8 @@ import java.util.Map; import java.util.Set; import java.util.Vector; +import net.sf.antcontrib.logic.ProjectDelegate; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Location; import org.apache.tools.ant.Project; @@ -59,6 +61,7 @@ public class Design { Package p = new Package(); p.setIncludeSubpackages(true); p.setName("java"); + p.setUsed(true); p.setNeedDeclarations(false); p.setPackage("java"); addConfiguredPackage(p); @@ -89,10 +92,10 @@ public class Design { if(thePackage == null) throw new IllegalArgumentException("Cannot retrieve null packages"); - Package result = null; String currentPackage = thePackage; + Package result = (Package)packageNameToPackage.get(currentPackage); while(!Package.DEFAULT.equals(currentPackage)) { - result = (Package)packageNameToPackage.get(currentPackage); + log.log("p="+currentPackage+"result="+result, Project.MSG_DEBUG); if(result != null) { if(currentPackage.equals(thePackage)) return result; @@ -101,12 +104,14 @@ public class Design { return null; } currentPackage = VerifyDesignDelegate.getPackageName(currentPackage); + result = (Package)packageNameToPackage.get(currentPackage); } //result must now be default package if(result != null && result.isIncludeSubpackages()) return result; + log.log("returning null", Project.MSG_DEBUG); return null; } -- cgit v1.2.3