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 186177

Summary: [69cat] WorkingCopy.rewrite(Tree,Tree) sometimes generates broken throws for methods
Product: java Reporter: misterm <misterm>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED INCOMPLETE    
Severity: normal CC: hmichel, jkovalsky
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description misterm 2010-05-14 17:01:46 UTC
After performing a project-wide rewrite using the Java Source API, touching several methods per class, in around 3.5k classes, there are exactly 80 methods that get broken, being changed from:

public void method() {
}

to

@SomeAnnotation
public void method() throws  {
}

It doesn't depend on method name nor the generated annotation nor the containing class. I couldn't isolate the cause. It's interesting that there are two spaces after throws in these methods.

It always happens for the same methods in the same classes. I can't come up with a non-proprietary source file that is affected by this issue.

Product Version = NetBeans IDE Dev (Build 100514-3a3dbb12a89f)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_19
Runtime = Java HotSpot(TM) Client VM 16.2-b04
Comment 1 Jan Lahoda 2010-05-14 18:50:42 UTC
Sorry, but without reproducible test case, there is virtually no way to fix this. I tried to look at the diffing code, but there is nothing obviously wrong. I am also removing the random keyword - the bug is unlikely to be random, it only happens under some very specific conditions.