http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1124
*** shadow/1124 Mon Mar 26 14:50:46 2001
--- shadow/1124.tmp.15463 Mon Mar 26 14:50:46 2001
***************
*** 0 ****
--- 1,37 ----
+ +============================================================================+
+ | RMIC task breaks if package name starts with ".class" |
+ +----------------------------------------------------------------------------+
+ | Bug #: 1124 Product: Ant |
+ | Status: NEW Version: 1.3 |
+ | Resolution: Platform: PC |
+ | Severity: Normal OS/Version: Windows NT/2K |
+ | Priority: Component: Core tasks |
+ +----------------------------------------------------------------------------+
+ | Assigned To: [EMAIL PROTECTED] |
+ | Reported By: [EMAIL PROTECTED] |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Using the RMIC task, I have a class whose full name
+ is "com.domain.project.classes.FooClass". Ant will incorrectly assume the
name
+ of the class is "com.domain.project" because it searches the filename looking
+ for ".class" and cuts the string there.
+ <p>
+ I Looked at the latest in CVS (Rmic.java), and the culprit code appears to be
+ this:
+ <pre>
+ protected void scanDir(File baseDir, String files[],
+ FileNameMapper mapper) {
+ SourceFileScanner sfs = new SourceFileScanner(this);
+ String[] newFiles = sfs.restrict(files, baseDir, baseDir, mapper);
+ for (int i = 0; i < newFiles.length; i++) {
+ String classname = newFiles[i].replace(File.separatorChar, '.');
+ <font color="red">classname = classname.substring(0,
+ classname.indexOf(".class"));</font>
+ compileList.addElement(classname);
+ }
+ }
+ </pre>
+ It might be better to use the lastIndexOf() method.