[hg] main-silver: #227108: Prevent from NPE when DataEditorSuppo...

  • From:
  • To:
  • Subject: [hg] main-silver: #227108: Prevent from NPE when DataEditorSuppo...
  • Date: Thu, 07 Mar 2013 13:00:39 -0800

changeset 2d10d6eec219 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/2d10d6eec219
description:
        #227108: Prevent from NPE when DataEditorSupport is not present.

diffstat:

 
debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java
 |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (36 lines):

diff --git 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java
 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java
--- 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java
+++ 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/LineTranslations.java
@@ -420,8 +420,10 @@
             this.dataObject = dataObject;
             lineChangePostProcess.setRepeats(false);
             DataEditorSupport des = 
dataObject.getLookup().lookup(DataEditorSupport.class);
+            if (des != null) {
             des.addPropertyChangeListener(this);
         }
+        }
         
         public synchronized void attach() throws IOException {
             LineCookie lc = dataObject.getLookup().lookup (LineCookie.class);
@@ -577,7 +579,9 @@
             }
             if (LineBreakpoint.PROP_URL.equals(propertyName)) {
                 DataEditorSupport des = 
dataObject.getLookup().lookup(DataEditorSupport.class);
+                if (des != null) {
                 des.removePropertyChangeListener(this);
+                }
 
                 DataObject newDO = getDataObject(lb.getURL());
                 Line newLine;
@@ -606,9 +610,11 @@
                     this.line = newLine;
                 }
                 des = newDO.getLookup().lookup(DataEditorSupport.class);
+                if (des != null) {
                 des.addPropertyChangeListener(this);
             }
         }
+        }
         
         private void lineHasChanged(Line l) {
             if (!lineHasChanged.contains(l)) {

[hg] main-silver: #227108: Prevent from NPE when DataEditorSuppo...

mentlicher 03/07/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close