This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 18679 - interface update causes incorrect method decleration to be written
Summary: interface update causes incorrect method decleration to be written
Status: CLOSED DUPLICATE of bug 18584
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-15 10:39 UTC by doozer
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The foo base class (207 bytes, text/plain)
2002-01-09 20:24 UTC, doozer
Details
The bar class that shows the problem (316 bytes, text/plain)
2002-01-09 20:25 UTC, doozer
Details
The foo class after I have changed its arguments (221 bytes, text/plain)
2002-01-09 20:27 UTC, doozer
Details
The bar class after the arguments have been changed in foo (330 bytes, text/plain)
2002-01-09 20:27 UTC, doozer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doozer 2001-12-15 10:39:51 UTC
I modified the interface of a base class to an inner class defined else where. 
The first time I modified it the IDE noticed and correctly updated the 
interface in the subclasses (although it did miss a couple of instances in 
another class). I then realized that I had forgotten to add an argument so I 
went back to the base class and modified the argument list again.
It again noted the change however this time it incorrectly updated the method 
declared. More precisely it added a second public modifier to the start and 
moved the next line up and joined it on the end. Below is a fully diagrammatic 
explanation.

How it started

~~~~~File one~~~~~~~~~~~

public class Foo {
	public abstract List wibble();
} 

~~~~~~File two~~~~~~~~~~~~
public class Bar {
…stuff…

private class FooInner extends Foo {
public abstract List wibble() {
			System.out.print( “flib” );
			..stuff…
}
}
}

How it ended up

~~~~~File one~~~~~~~~~~~

public class Foo {
	public abstract List wibble( List a, String b, Stuff c);
} 

~~~~~~File two~~~~~~~~~~~~
public class Bar {
…stuff…

private class FooInner extends Foo {
		public public abstract List wibble( List a, String b, Stuff c) 
System.out.print( “flib” );
			..stuff…
}
}
}
Comment 1 doozer 2001-12-15 10:45:49 UTC
Sorry accidently hit commit before I had correctly formatted the code 
snippet so here it is in full. NOTE although it looks like the System 
out and the line with public public starting it are seperate they 
have actually been moved up to the same line in the broken version

How it started

~~~~~File one~~~~~~~~~~~

public class Foo {
	public abstract List wibble();
} 

~~~~~~File two~~~~~~~~~~~~
public class Bar {
...stuff...

private class FooInner extends Foo {
   public abstract List wibble() {
      System.out.print( "flib" );
      ...stuff...
   }
 }
}

How it ended up

~~~~~File one~~~~~~~~~~~

public class Foo {
   public abstract List wibble( List a, String b, Stuff c);
} 

~~~~~~File two~~~~~~~~~~~~
public class Bar {
   ...stuff...

private class FooInner extends Foo {
      public public abstract List wibble( List a, String b, stuff c) 
System.out.print( "flib" );
         ...stuff...
      }
}
}
Comment 2 Martin Roskanin 2001-12-15 10:51:52 UTC
It is not editor feature. I think, this is implemented in java module. Reassign if I am wrong.
Comment 3 Svata Dedic 2002-01-07 16:53:32 UTC
Graham, if you can still reproduce the bug on the class "Bar", could
you, please send us (== attach here) the exact source of Bar.java ?
Comment 4 Tomas Hurka 2002-01-09 11:22:30 UTC
I just followed your example, but I was not unable to reproduce it.
Can you attach your two files (Foo.java and Bar.java) before
modification and provide exact steps how to reproduce this it. Thanks.
Comment 5 doozer 2002-01-09 20:24:38 UTC
Created attachment 4050 [details]
The foo base class
Comment 6 doozer 2002-01-09 20:25:14 UTC
Created attachment 4051 [details]
The bar class that shows the problem
Comment 7 doozer 2002-01-09 20:27:18 UTC
Created attachment 4052 [details]
The foo class after I have changed its arguments
Comment 8 doozer 2002-01-09 20:27:54 UTC
Created attachment 4053 [details]
The bar class after the arguments have been changed in foo
Comment 9 doozer 2002-01-09 20:33:31 UTC
To reproduce.
1. Open the Foo.java file (12:24 PST) and the Bar.java file (12:25 
PST)
2. Add an argument to the wibble method of foo. I changed the method 
signature from abstract void wibble( String flib ); to abstract void 
wibble( String flib, String other ); (See foo.java 12:27 PST)
3. Wait a moment for netbeans to detect the change.
4. When asked to update press the 'process all' button.
5. View Bar.java and note the messed up method signature (12:27 PST)

Hope this helps
Comment 10 Tomas Hurka 2002-01-10 10:33:32 UTC
Graham, did you use Beta version of Java module with Javac 1.4 parser?
Comment 11 Tomas Hurka 2002-01-11 13:17:41 UTC

*** This issue has been marked as a duplicate of 18584 ***
Comment 12 Quality Engineering 2003-07-01 13:12:14 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 13 Quality Engineering 2003-07-01 13:21:43 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.
Comment 14 Quality Engineering 2007-09-20 12:05:50 UTC
Reorganization of java component