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.
Summary: | NullPointerException at org.netbeans.modules.java.source.save.CasualDiff.diffBreak | ||
---|---|---|---|
Product: | java | Reporter: | Max Sauer <msauer> |
Component: | Source | Assignee: | Max Sauer <msauer> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | fommil, sustaining |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=152054 | ||
Issue Type: | DEFECT | Exception Reporter: | 152054 |
Bug Depends on: | |||
Bug Blocks: | 166324 | ||
Attachments: |
stacktrace
proposed fix |
Description
Max Sauer
2009-06-01 10:00:02 UTC
Created attachment 83055 [details]
stacktrace
@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 know. I can certainly look at it, but can't guarantee timescales. I've added org.netbeans.api.java.source.gen.BreakContinueTest.testBreak166327() to cover this. --- http://hg.netbeans.org/jet-main/rev/05c113176b5d Integrated into 'main-golden', will be available in build *200906040201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/05c113176b5d User: Max Sauer <msauer@netbeans.org> Log: #166327: adding test Created attachment 83281 [details]
proposed fix
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. 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. Polished and integrated. Marking as FIXED. --- http://hg.netbeans.org/jet-main/rev/cd0de99b63bb Integrated into 'main-golden', will be available in build *200906110201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/cd0de99b63bb User: Max Sauer <msauer@netbeans.org> Log: #166327: NPE at o.n.m.java.source.save.CasualDiff.diffBreak v. The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/fa32503210b0 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 |