aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Moller2014-02-24 11:37:23 (EST)
committerMike Rennie2014-02-24 11:37:23 (EST)
commitef4034a07304a2887436cf1396cc989384c23b6f (patch)
tree4efba2f92e1b2936f2f5d4a21b4093d4bff23c0e
parentd06503f2d78ae1cca924c3516c607851685d713e (diff)
downloadeclipse.jdt.debug-ef4034a07304a2887436cf1396cc989384c23b6f.zip
eclipse.jdt.debug-ef4034a07304a2887436cf1396cc989384c23b6f.tar.gz
eclipse.jdt.debug-ef4034a07304a2887436cf1396cc989384c23b6f.tar.bz2
method references Change-Id: I761ce19790a11ee721436c7e1b3c1b9b7823f260 Signed-off-by: Jesper Moller <jesper@selskabet.org>
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java4
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java163
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java4
-rw-r--r--org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties4
4 files changed, 77 insertions, 98 deletions
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java
index c67ed9e..dbe8c5b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Jesper Steen Moller - bug 341232
+ * Jesper Steen Moller - Bugs 341232, 427089
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
@@ -330,7 +330,7 @@ public class ASTEvaluationEngine implements IAstEvaluationEngine {
private CompilationUnit parseCompilationUnit(char[] source,
String unitName, IJavaProject project) {
- ASTParser parser = ASTParser.newParser(AST.JLS4);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setSource(source);
parser.setUnitName(unitName);
parser.setProject(project);
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
index f9e92aa..a1c14b2 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTInstructionCompiler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Jesper Steen Moller - Bug 427089
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
@@ -21,101 +22,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.compiler.IProblem;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.jdt.core.dom.ArrayAccess;
-import org.eclipse.jdt.core.dom.ArrayCreation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.ArrayType;
-import org.eclipse.jdt.core.dom.AssertStatement;
-import org.eclipse.jdt.core.dom.Assignment;
-import org.eclipse.jdt.core.dom.Block;
-import org.eclipse.jdt.core.dom.BlockComment;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.BreakStatement;
-import org.eclipse.jdt.core.dom.CastExpression;
-import org.eclipse.jdt.core.dom.CatchClause;
-import org.eclipse.jdt.core.dom.CharacterLiteral;
-import org.eclipse.jdt.core.dom.ClassInstanceCreation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ConditionalExpression;
-import org.eclipse.jdt.core.dom.ConstructorInvocation;
-import org.eclipse.jdt.core.dom.ContinueStatement;
-import org.eclipse.jdt.core.dom.DoStatement;
-import org.eclipse.jdt.core.dom.EmptyStatement;
-import org.eclipse.jdt.core.dom.EnhancedForStatement;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.ExpressionStatement;
-import org.eclipse.jdt.core.dom.FieldAccess;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ForStatement;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.IPackageBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.IfStatement;
-import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.InfixExpression;
-import org.eclipse.jdt.core.dom.Initializer;
-import org.eclipse.jdt.core.dom.InstanceofExpression;
-import org.eclipse.jdt.core.dom.Javadoc;
-import org.eclipse.jdt.core.dom.LabeledStatement;
-import org.eclipse.jdt.core.dom.LineComment;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberRef;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.MethodInvocation;
-import org.eclipse.jdt.core.dom.MethodRef;
-import org.eclipse.jdt.core.dom.MethodRefParameter;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NullLiteral;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jdt.core.dom.ParameterizedType;
-import org.eclipse.jdt.core.dom.ParenthesizedExpression;
-import org.eclipse.jdt.core.dom.PostfixExpression;
-import org.eclipse.jdt.core.dom.PrefixExpression;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.QualifiedType;
-import org.eclipse.jdt.core.dom.ReturnStatement;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.Statement;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.jdt.core.dom.SuperFieldAccess;
-import org.eclipse.jdt.core.dom.SuperMethodInvocation;
-import org.eclipse.jdt.core.dom.SwitchCase;
-import org.eclipse.jdt.core.dom.SwitchStatement;
-import org.eclipse.jdt.core.dom.SynchronizedStatement;
-import org.eclipse.jdt.core.dom.TagElement;
-import org.eclipse.jdt.core.dom.TextElement;
-import org.eclipse.jdt.core.dom.ThisExpression;
-import org.eclipse.jdt.core.dom.ThrowStatement;
-import org.eclipse.jdt.core.dom.TryStatement;
-import org.eclipse.jdt.core.dom.Type;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jdt.core.dom.TypeParameter;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jdt.core.dom.WhileStatement;
-import org.eclipse.jdt.core.dom.WildcardType;
+import org.eclipse.jdt.core.dom.*;
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.AndAssignmentOperator;
import org.eclipse.jdt.internal.debug.eval.ast.instructions.AndOperator;
@@ -2183,6 +2090,19 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
/**
+ * @see ASTVisitor#visit(CreationReference)
+ */
+ @Override
+ public boolean visit(CreationReference node) {
+ if (!isActive()) {
+ return true;
+ }
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Reference_expressions_cannot_be_used_in_an_evaluation_expression);
+ return false;
+ }
+
+ /**
* @see ASTVisitor#visit(DoStatement)
*/
@Override
@@ -2367,6 +2287,19 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
/**
+ * @see ASTVisitor#visit(ExpressionMethodReference)
+ */
+ @Override
+ public boolean visit(ExpressionMethodReference node) {
+ if (!isActive()) {
+ return true;
+ }
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Reference_expressions_cannot_be_used_in_an_evaluation_expression);
+ return false;
+ }
+
+ /**
* @see ASTVisitor#visit(ExpressionStatement)
*/
@Override
@@ -2864,6 +2797,18 @@ public class ASTInstructionCompiler extends ASTVisitor {
return false;
}
+ /**
+ * @see ASTVisitor#visit(LambdaExpression)
+ */
+ @Override
+ public boolean visit(LambdaExpression node) {
+ if (!isActive()) {
+ return true;
+ }
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Lambda_expressions_cannot_be_used_in_an_evaluation_expression);
+ return false;
+ }
/*
* (non-Javadoc)
*
@@ -3935,6 +3880,19 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
/**
+ * @see ASTVisitor#visit(SuperMethodReference)
+ */
+ @Override
+ public boolean visit(SuperMethodReference node) {
+ if (!isActive()) {
+ return true;
+ }
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Reference_expressions_cannot_be_used_in_an_evaluation_expression);
+ return false;
+ }
+
+ /**
* @see ASTVisitor#visit(SwitchCase)
*/
@Override
@@ -4197,6 +4155,19 @@ public class ASTInstructionCompiler extends ASTVisitor {
}
/**
+ * @see ASTVisitor#visit(TypeMethodReference)
+ */
+ @Override
+ public boolean visit(TypeMethodReference node) {
+ if (!isActive()) {
+ return true;
+ }
+ setHasError(true);
+ addErrorMessage(EvaluationEngineMessages.ASTInstructionCompiler_Reference_expressions_cannot_be_used_in_an_evaluation_expression);
+ return false;
+ }
+
+ /**
* @see ASTVisitor#visit(VariableDeclarationExpression)
*/
@Override
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
index 43a9423..d28624b 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * Jesper Steen Moller - 427089: [1.8] Change value in Variables view with lambda or method reference
*******************************************************************************/
package org.eclipse.jdt.internal.debug.eval.ast.engine;
@@ -56,6 +57,9 @@ public class EvaluationEngineMessages extends NLS {
public static String ASTInstructionCompiler_4;
public static String ASTInstructionCompiler_5;
+ public static String ASTInstructionCompiler_Lambda_expressions_cannot_be_used_in_an_evaluation_expression;
+ public static String ASTInstructionCompiler_Reference_expressions_cannot_be_used_in_an_evaluation_expression;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, EvaluationEngineMessages.class);
diff --git a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties
index d406204..d87bc2e 100644
--- a/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties
+++ b/org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationEngineMessages.properties
@@ -7,6 +7,7 @@
#
# Contributors:
# IBM Corporation - initial API and implementation
+# Jesper Steen Moller - 427089: [1.8] Change value in Variables view with lambda or method reference
###############################################################################
ASTInstructionCompiler_Anonymous_type_declaration_cannot_be_used_in_an_evaluation_expression_2=Anonymous type declaration cannot be used in an evaluation expression
@@ -51,3 +52,6 @@ ASTInstructionCompiler_4=The ASTInstruction compiler failed to store instruction
ASTInstructionCompiler_5=Unable to resolve binding for: {0}
ASTEvaluationEngine_1=Unable to retrieve type for java.lang.Object
ArrayRuntimeContext_0=Unable to retrieve type for java.lang.Object
+
+ASTInstructionCompiler_Lambda_expressions_cannot_be_used_in_an_evaluation_expression=Lambda expressions cannot be used in an evaluation expression
+ASTInstructionCompiler_Reference_expressions_cannot_be_used_in_an_evaluation_expression=Reference expressions cannot be used in an evaluation expression \ No newline at end of file