Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 227576 Details for
Bug 341232
Eclipse is not able to set the simplest of conditional breakpoints and reports that the condition has compilation errors when it doesn't
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix which solves the problem as shown in "Bug.java"
fix.patch (text/plain), 8.43 KB, created by
Jesper Moller
on 2013-02-25 17:23:04 EST
(
hide
)
Description:
Fix which solves the problem as shown in "Bug.java"
Filename:
MIME Type:
Creator:
Jesper Moller
Created:
2013-02-25 17:23:04 EST
Size:
8.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.debug >diff --git eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java >index 165fb7a..f35e2da 100644 >--- eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java >+++ eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java >@@ -1,3 +1,3 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2012 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials >@@ -9,2 +9,3 @@ > * IBM Corporation - initial API and implementation >+ * Jesper Steen Moller - bug 341232 > *******************************************************************************/ >@@ -338,3 +339,3 @@ > unit = parseCompilationUnit( >- mapper.getSource(receivingType, javaProject, >+ mapper.getSource(receivingType, frame.getLineNumber(), javaProject, > frame.isStatic()).toCharArray(), >@@ -430,3 +431,3 @@ > unit = parseCompilationUnit( >- mapper.getSource(recType, getJavaProject(), false) >+ mapper.getSource(recType, -1, getJavaProject(), false) > .toCharArray(), >@@ -495,3 +496,3 @@ > unit = parseCompilationUnit( >- mapper.getSource(type, javaProject, false).toCharArray(), >+ mapper.getSource(type, -1, javaProject, false).toCharArray(), > mapper.getCompilationUnitName(), javaProject); >diff --git eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java >index f21a3b9..d752a0f 100644 >--- eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java >+++ eval/org/eclipse/jdt/internal/debug/eval/ast/engine/EvaluationSourceGenerator.java >@@ -1,3 +1,3 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials >@@ -9,2 +9,3 @@ > * IBM Corporation - initial API and implementation >+ * Jesper Steen Moller - bug 341232 > *******************************************************************************/ >@@ -139,3 +140,3 @@ > private void createEvaluationSourceFromSource(String source, IType type, >- boolean createInAStaticMethod, IJavaProject project) >+ int line, boolean createInAStaticMethod, IJavaProject project) > throws DebugException { >@@ -148,3 +149,3 @@ > SourceBasedSourceGenerator visitor = new SourceBasedSourceGenerator( >- type, createInAStaticMethod, fLocalVariableTypeNames, >+ type, line, createInAStaticMethod, fLocalVariableTypeNames, > fLocalVariableNames, fCodeSnippet, sourceLevel); >@@ -219,3 +220,3 @@ > >- public String getSource(IJavaReferenceType type, IJavaProject javaProject, >+ public String getSource(IJavaReferenceType type, int line, IJavaProject javaProject, > boolean isStatic) throws CoreException { >@@ -232,3 +233,3 @@ > createEvaluationSourceFromSource(baseSource, iType, >- isStatic, javaProject); >+ line, isStatic, javaProject); > } >diff --git eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java >index dbbd7d9..837bac0 100644 >--- eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java >+++ eval/org/eclipse/jdt/internal/debug/eval/ast/engine/SourceBasedSourceGenerator.java >@@ -1,3 +1,3 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials >@@ -9,2 +9,3 @@ > * IBM Corporation - initial API and implementation >+ * Jesper Steen Moller - bug 341232 > *******************************************************************************/ >@@ -12,6 +13,9 @@ > >-import java.util.HashSet; >+import java.util.Collection; >+import java.util.Collections; >+import java.util.HashMap; > import java.util.Iterator; > import java.util.List; >-import java.util.Set; >+import java.util.Map; >+import java.util.Stack; > >@@ -133,2 +137,3 @@ > private IType fType; >+ private int fLine; > >@@ -151,3 +156,8 @@ > >- private Set<String> fTypeParameters = new HashSet<String>(); >+ private Stack<Map<String, String>> fTypeParameterStack = new Stack<Map<String, String>>(); >+ private Map<String, String> fMatchingTypeParameters = null; >+ private CompilationUnit fCompilationUnit; >+ { >+ fTypeParameterStack.push(Collections.<String,String>emptyMap()); >+ } > >@@ -160,2 +170,4 @@ > * the root {@link IType} >+ * @param sourcePosition >+ * the reference position in the type's source > * @param createInAStaticMethod >@@ -172,3 +184,3 @@ > public SourceBasedSourceGenerator(IType type, >- boolean createInAStaticMethod, String[] localTypesNames, >+ int line, boolean createInAStaticMethod, String[] localTypesNames, > String[] localVariables, String codeSnippet, String sourceLevel) { >@@ -176,2 +188,3 @@ > fType = type; >+ fLine = line; > fLocalVariableTypeNames = localTypesNames; >@@ -245,4 +258,5 @@ > if (isSourceLevelGreaterOrEqual(1, 5)) { >- if (!fTypeParameters.isEmpty()) { >- Iterator<String> iterator = fTypeParameters.iterator(); >+ Collection<String> activeTypeParameters = (fMatchingTypeParameters != null ? fMatchingTypeParameters : fTypeParameterStack.peek()).values(); >+ if (!activeTypeParameters.isEmpty()) { >+ Iterator<String> iterator = activeTypeParameters.iterator(); > buffer.append(Signature.C_GENERIC_START); >@@ -742,3 +756,3 @@ > if (!isSourceLevelGreaterOrEqual(1, 5) >- && fTypeParameters.contains(name)) { >+ && fTypeParameterStack.peek().containsKey(name)) { > return "Object"; //$NON-NLS-1$ >@@ -1010,2 +1024,9 @@ > >+ /* (non-Javadoc) >+ * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.MethodDeclaration) >+ */ >+ public void endVisit(MethodDeclaration node) { >+ fTypeParameterStack.pop(); >+ } >+ > /** >@@ -1017,2 +1038,3 @@ > if (hasError()) { >+ fTypeParameterStack.pop(); > return; >@@ -1029,2 +1051,3 @@ > fEvaluateNextEndTypeDeclaration = true; >+ fTypeParameterStack.pop(); > return; >@@ -1062,2 +1085,3 @@ > } >+ fTypeParameterStack.pop(); > } >@@ -1256,2 +1280,3 @@ > public boolean visit(CompilationUnit node) { >+ fCompilationUnit = node; > if (rightTypeFound()) { >@@ -1534,9 +1559,11 @@ > public boolean visit(MethodDeclaration node) { >+ String name = node.getName().toString(); >+ System.out.println(name); >+ int firstLine = fCompilationUnit.getLineNumber(node.getStartPosition()); >+ int lastLine = fCompilationUnit.getLineNumber(node.getStartPosition() + node.getLength()); >+ > List<TypeParameter> typeParameters = node.typeParameters(); >- if (!typeParameters.isEmpty()) { >- Iterator<TypeParameter> iterator = typeParameters.iterator(); >- while (iterator.hasNext()) { >- TypeParameter typeParameter = iterator.next(); >- fTypeParameters.add(typeParameter.toString()); >- } >+ pushTypeParameters(typeParameters); >+ if (isRightType(node.getParent()) && firstLine <= fLine && fLine <= lastLine) { >+ fMatchingTypeParameters = fTypeParameterStack.peek(); > } >@@ -1546,2 +1573,17 @@ > return true; >+ } >+ >+ private void pushTypeParameters(List<TypeParameter> typeParameters) { >+ if (!typeParameters.isEmpty()) { >+ HashMap<String,String> newTypeParameters = new HashMap<String,String>(fTypeParameterStack.peek()); >+ Iterator<TypeParameter> iterator = typeParameters.iterator(); >+ while (iterator.hasNext()) { >+ TypeParameter typeParameter = iterator.next(); >+ String boundName = typeParameter.getName().getIdentifier(); >+ newTypeParameters.put(boundName, typeParameter.toString()); >+ } >+ fTypeParameterStack.push(newTypeParameters); // Push the new "scope" >+ } else { >+ fTypeParameterStack.push(fTypeParameterStack.peek()); // Push the same >+ } > } >@@ -1927,9 +1969,3 @@ > List<TypeParameter> typeParameters = node.typeParameters(); >- if (!typeParameters.isEmpty()) { >- Iterator<TypeParameter> iterator = typeParameters.iterator(); >- while (iterator.hasNext()) { >- TypeParameter typeParameter = iterator.next(); >- fTypeParameters.add(typeParameter.getName().getIdentifier()); >- } >- } >+ pushTypeParameters(typeParameters); > if (rightTypeFound()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
Michael_Rennie
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 341232
:
192090
|
216262
|
224760
|
227463
| 227576 |
227639