cvs diff -uw JavaPackageIterator.java (in directory D:\arrowfixes\nb_all\java\src\org\netbeans\modules\java\ui\wizard\) Index: JavaPackageIterator.java =================================================================== RCS file: /cvs/java/src/org/netbeans/modules/java/ui/wizard/JavaPackageIterator.java,v retrieving revision 1.8.58.2 diff -u -w -r1.8.58.2 JavaPackageIterator.java --- JavaPackageIterator.java 20 Feb 2004 09:56:23 -0000 1.8.58.2 +++ JavaPackageIterator.java 9 Jun 2004 10:04:23 -0000 @@ -95,7 +95,7 @@ FileObject fldFO = fld.getPrimaryFile(); String parentPath = fldFO.getPackageNameExt('/', '.'); String parentPkg = parentPath.replace('/', '.'); - if (!Util.isValidPackageName(parentPkg)) { + if (!Util.isValidName(parentPkg)) { throwIllegalName("FMTERR_InvalidPackage", parentPkg); // NOI18N } @@ -103,7 +103,7 @@ if (s == null) { // special handling for "package" s = Util.getString("TXT_DefaultPackageName"); // NOI18N - } else if (!Util.isValidPackageName(s)) { + } else if (!Util.isValidName(s)) { throwIllegalName("FMTERR_InvalidPackage", s); // NOI18N } ***** CVS exited normally with code 1 ***** cvs diff -uw Util.java (in directory D:\arrowfixes\nb_all\java\src\org\netbeans\modules\java\ui\wizard\) Index: Util.java =================================================================== RCS file: /cvs/java/src/org/netbeans/modules/java/ui/wizard/Util.java,v retrieving revision 1.4.58.2 diff -u -w -r1.4.58.2 Util.java --- Util.java 20 Feb 2004 09:56:23 -0000 1.4.58.2 +++ Util.java 9 Jun 2004 10:04:47 -0000 @@ -16,6 +16,7 @@ import java.util.ResourceBundle; import java.util.StringTokenizer; +import java.util.ArrayList; import org.openide.src.*; import org.openide.loaders.TemplateWizard; @@ -72,4 +73,22 @@ packageIt = JavaPackageIterator.create(); return packageIt; } + static boolean isValidName(String str) { + if (str.length() > 0 && str.charAt(0) == '.') return false; + char[] tmp = str.toCharArray(); + String pathItem = ""; + for (int i = 0; i < str.length(); i++) { + if ('.' != tmp[i]) + pathItem = pathItem + tmp[i]; + else { + if (!org.openide.util.Utilities.isJavaIdentifier(pathItem)) + return false; + pathItem = ""; + } + } + if (!org.openide.util.Utilities.isJavaIdentifier(pathItem)) + return false; + return true; + } + } ***** CVS exited normally with code 1 *****