Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 166327 - NullPointerException at
NullPointerException at
Product: java
Classification: Unclassified
Component: Source
All All
: P3 (vote)
: 6.x
Assigned To: Max Sauer
EXCEPTIONS_REPORT 67patch1-verified
Depends on:
Blocks: 166324
  Show dependency treegraph
Reported: 2009-06-01 10:00 UTC by Max Sauer
Modified: 2009-07-20 12:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

stacktrace (4.53 KB, text/plain)
2009-06-01 10:00 UTC, Max Sauer
proposed fix (2.16 KB, text/plain)
2009-06-06 23:24 UTC, fommil

Note You need to log in before you can comment on or make changes to this bug.
Description Max Sauer 2009-06-01 10:00:02 UTC
Build: NetBeans IDE Dev (Build 090529)
VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284
OS: Mac OS X, 10.5.6, i386

User Comments:
msauer: Have following class:

package test;

public class Test {

    public static void test(int y) {
        for (int u = y;;) {
            if (y == 0)

Select whole if-else tree and Introduce method => NPE. This used to work until some fixes had been made on May 22 in CasualDiff and TreeMaker.

Comment 1 Max Sauer 2009-06-01 10:00:07 UTC
Created attachment 83055 [details]
Comment 2 Rastislav Komara 2009-06-03 09:59:01 UTC
@fommil: It is caused by one of patches for diff created by you. Please, try to fix it. If you are unable, please let me
Comment 3 fommil 2009-06-03 12:46:42 UTC
I can certainly look at it, but can't guarantee timescales.
Comment 4 Max Sauer 2009-06-03 13:10:39 UTC
I've added to cover this.

Comment 5 Quality Engineering 2009-06-04 08:58:02 UTC
Integrated into 'main-golden', will be available in build *200906040201* on (upload may still be in progress)
User: Max Sauer <>
Log: #166327: adding test
Comment 6 fommil 2009-06-06 23:24:23 UTC
Created attachment 83281 [details]
proposed fix
Comment 7 fommil 2009-06-06 23:27:59 UTC
Proposed fix is also a fix for 166324.

The existing code assumes that both the old and new trees have a label part. e.g. "break innerLoop;"

The patch does not make this assumption.

However, there are two things about the existing code that I do not like. They are perpetuated in the proposed fix:-

1 - There is an assumption that there is only a single space character of whitespace between the break/continue and the label.
2 - There is a lot of code duplication between diff{Break, Continue}. I thought about using a helper method, but didn't want to obfuscate the proposed fix 
in the process.
Comment 8 Max Sauer 2009-06-08 08:33:06 UTC
OK, I'll apply the fix. As for 1), I think we can live with that, since this is the typical usecase and conforms with formatter. Thanks, Sam.
Comment 9 Max Sauer 2009-06-08 13:02:11 UTC
Polished and integrated. Marking as FIXED.
Comment 10 Quality Engineering 2009-06-11 08:52:19 UTC
Integrated into 'main-golden', will be available in build *200906110201* on (upload may still be in progress)
User: Max Sauer <>
Log: #166327: NPE at
Comment 11 Petr Blaha 2009-07-02 13:23:39 UTC
Comment 12 pgebauer 2009-07-09 09:49:24 UTC
The fix has been ported into the release67_fixes repository.
Comment 13 pribyl 2009-07-16 11:04:15 UTC
Product Version: NetBeans IDE 6.7.1 RC (Build 200907150227)
Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

Verified in 6.7.1 RC

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo