jaxb-codemodel
jaxb-codemodel copied to clipboard
Extra space in extends clause when inheriting from nested class which enclosing class ends on digit.
Codemodel 2.6 adds an extra space before the dot (EnclosingClass .NestedClass) in extends statement when class is inherited from EnclosingClass.NestedClass and EnclosingClass class name ends on the digit. I.e.: public class EncDefClass1NestedClassChild extends out.EncDefClass1 .NestedClass {} ^^^ This happens both when inheriting from the JDefinedClass and class by reference.
Environment
Windows XP, Netbeans 6.7.1
Affected Versions
[2.6]
Reported by vic123
vic123 said: Rough perl workaround (sorry for now - have posted before finding out that cannot format it well):
use strict; use warnings; use File::Find qw(find); use Cwd; use URI;
my $pwd = cwd()."/"; my $dir = $ARGV[0]; my $pattern = '.*java'; find sub
{removeExtraSpaceFromExtendsFromNestedClass($File::Find::name) if /$pattern/}
, $dir;
sub removeExtraSpaceFromExtendsFromNestedClass
{ undef $/; my ($f_path) = @_; my $f_absuri = URI->new($f_path)->abs($pwd); print $f_absuri."\n"; open(INFI, "<", $f_absuri) || die("can't open ".$f_absuri.": $!"); my $data = <INFI>; $data =~ s/^(\s*)extends\s+([^\s]+)\s.([^\s]+)\s*$/$1extends $2.$3/gxm; close INFI; open(OUTF, ">", $f_absuri) || die("can't open ".$f_absuri.": $!"); print OUTF $data; }
This issue was imported from java.net JIRA CODEMODEL-22