[hg] main-silver: #237330: Check if the field is static, before ...

  • From:
  • To:
  • Subject: [hg] main-silver: #237330: Check if the field is static, before ...
  • Date: Thu, 07 Nov 2013 19:58:44 +0000

changeset 37cb2dee10eb in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/37cb2dee10eb
description:
        #237330: Check if the field is static, before getting the value on a 
class type.

diffstat:

 
debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java
 |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff --git 
a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java
 
b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java
--- 
a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java
+++ 
b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/expr/EvaluatorVisitor.java
@@ -2818,6 +2818,10 @@
                 }
                 Field f = clazz.fieldByName(name);
                 if (f != null) {
+                    if (!f.isStatic()) {
+                        Assert.error(arg0, 
"accessInstanceVariableFromStaticContext", name);
+                        return null;
+                    }
                     evaluationContext.putField(arg0, f, null);
                     Value v = clazz.getValue(f);
                     if (v instanceof ObjectReference) {

[hg] main-silver: #237330: Check if the field is static, before ...

mentlicher 11/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