Update of /cvsroot/nice/Nice/src/nice/tools/code
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32389/src/nice/tools/code
Modified Files:
Types.java Import.java
Log Message:
Allow imported java packages to be specified to have non-null argument types
by default.
Index: Types.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** Types.java 11 Feb 2004 12:46:39 -0000 1.55
--- Types.java 19 Feb 2004 08:15:33 -0000 1.56
***************
*** 771,774 ****
--- 771,775 ----
tcToGBType = new HashMap();
TypeImport.stringToReflectClass = new HashMap();
+ Import.reset();
}
}
Index: Import.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Import.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Import.java 23 Jan 2003 22:44:57 -0000 1.2
--- Import.java 19 Feb 2004 08:15:34 -0000 1.3
***************
*** 93,97 ****
boolean strictImport = bossa.modules.Package.currentCompilation.
strictJavaTypes;
! if (strictImport)
{
for (int i = 0; i < paramTypes.length; i++)
--- 93,101 ----
boolean strictImport = bossa.modules.Package.currentCompilation.
strictJavaTypes;
!
! boolean nonNullArgs = strictPackages.contains
! (m.getDeclaringClass().getPackageName());
!
! if (strictImport || nonNullArgs)
{
for (int i = 0; i < paramTypes.length; i++)
***************
*** 174,176 ****
--- 178,193 ----
return res;
}
+
+ /****************************************************************
+ * Retyping policies
+ ****************************************************************/
+
+ private static java.util.HashSet strictPackages = new java.util.HashSet();
+
+ static void reset() { strictPackages.clear(); }
+
+ public static void addStrictPackage(String name)
+ {
+ strictPackages.add(name);
+ }
}
|