Merge remote-tracking branch 'origin/master' into BETA_JAVA9
diff --git a/org.eclipse.jdt.debug.ui/pom.xml b/org.eclipse.jdt.debug.ui/pom.xml
index d3f6b56..4fa381d 100644
--- a/org.eclipse.jdt.debug.ui/pom.xml
+++ b/org.eclipse.jdt.debug.ui/pom.xml
@@ -20,18 +20,7 @@
<artifactId>org.eclipse.jdt.debug.ui</artifactId>
<version>3.7.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-compiler-plugin</artifactId>
- <version>${tycho.version}</version>
- <configuration>
- <compilerArgs>
- <arg>-warn:+resource</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <properties>
+ <code.ignoredWarnings>-warn:+resource,-deprecation,unavoidableGenericProblems</code.ignoredWarnings>
+ </properties>
</project>
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
index 85c0e25..572c616 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -732,7 +732,14 @@
else if(element instanceof IClassFile) {
element = ((IClassFile) element).getElementAt(selection.getOffset());
}
- return element != null && element.getElementType() == IJavaElement.METHOD;
+ if (element != null && element.getElementType() == IJavaElement.METHOD) {
+ IMethod method = (IMethod) element;
+ if (method.getDeclaringType().isAnonymous()) {
+ return false;
+ }
+ return true;
+ }
+
}
catch (JavaModelException e) {return false;}
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugContentAssistProcessor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugContentAssistProcessor.java
index 76ed79a..a95ec9a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugContentAssistProcessor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/contentassist/JavaDebugContentAssistProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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
@@ -21,10 +21,12 @@
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.java.JavaParameterListValidator;
import org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateEngine;
+import org.eclipse.jdt.ui.text.java.AbstractProposalSorter;
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -48,7 +50,9 @@
private char[] fProposalAutoActivationSet;
private CompletionProposalComparator fComparator;
private IJavaDebugContentAssistContext fContext;
-
+ private ContentAssistant fAssistant;
+
+
public JavaDebugContentAssistProcessor(IJavaDebugContentAssistContext context) {
fContext = context;
TemplateContextType contextType= JavaPlugin.getDefault().getTemplateContextRegistry().getContextType(JavaContextType.ID_ALL);
@@ -61,8 +65,13 @@
}
fComparator= new CompletionProposalComparator();
+ fAssistant= null;
}
-
+
+ public void setContentAssistant(ContentAssistant assistant) {
+ fAssistant = assistant;
+ }
+
/**
* @see IContentAssistProcessor#getErrorMessage()
*/
@@ -182,10 +191,21 @@
* Order the given proposals.
*/
private IJavaCompletionProposal[] order(IJavaCompletionProposal[] proposals) {
- Arrays.sort(proposals, fComparator);
- return proposals;
- }
-
+ if (fAssistant == null) {
+ Arrays.sort(proposals, fComparator);
+ return proposals;
+ }
+
+ fAssistant.setSorter(new AbstractProposalSorter() {
+ @Override
+ public int compare(ICompletionProposal p1, ICompletionProposal p2) {
+ return fComparator.compare(p1, p2);
+ }
+
+ });
+ return proposals;
+ }
+
/**
* Configures the display result collection for the current code assist session
*/
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java
index 7e3d120..174413b 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DetailsViewerConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -31,7 +31,10 @@
@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
- assistant.setContentAssistProcessor(new JavaDebugContentAssistProcessor(new CurrentValueContext()),IDocument.DEFAULT_CONTENT_TYPE);
+ assistant.enableColoredLabels(true);
+ JavaDebugContentAssistProcessor contentAssistProcessor = new JavaDebugContentAssistProcessor(new CurrentValueContext());
+ contentAssistProcessor.setContentAssistant(assistant);
+ assistant.setContentAssistProcessor(contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
return assistant;
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java
index ea9cc29..e8c3da4 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/display/DisplayViewerConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -61,8 +61,12 @@
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
- assistant.setContentAssistProcessor(
- getContentAssistantProcessor(),
+ assistant.enableColoredLabels(true);
+ IContentAssistProcessor contentAssistProcessor = getContentAssistantProcessor();
+ if (contentAssistProcessor instanceof JavaDebugContentAssistProcessor) {
+ ((JavaDebugContentAssistProcessor) contentAssistProcessor).setContentAssistant(assistant);
+ }
+ assistant.setContentAssistProcessor(contentAssistProcessor,
IDocument.DEFAULT_CONTENT_TYPE);
JDIContentAssistPreference.configure(assistant, getColorManager());
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetCompletionProcessor.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetCompletionProcessor.java
index 60b6d6d..57fe393 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetCompletionProcessor.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetCompletionProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -19,11 +19,13 @@
import org.eclipse.jdt.internal.ui.text.java.JavaParameterListValidator;
import org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateEngine;
import org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal;
+import org.eclipse.jdt.ui.text.java.AbstractProposalSorter;
import org.eclipse.jdt.ui.text.java.CompletionProposalCollector;
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -44,6 +46,7 @@
private String fErrorMessage;
private char[] fProposalAutoActivationSet;
+ private ContentAssistant fAssistant;
public JavaSnippetCompletionProcessor(JavaSnippetEditor editor) {
fEditor= editor;
@@ -55,6 +58,9 @@
fComparator= new CompletionProposalComparator();
}
+ public void setContentAssistant(ContentAssistant assistant) {
+ fAssistant = assistant;
+ }
/**
* @see IContentAssistProcessor#getErrorMessage()
*/
@@ -138,7 +144,18 @@
* Order the given proposals.
*/
private ICompletionProposal[] order(IJavaCompletionProposal[] proposals) {
- Arrays.sort(proposals, fComparator);
+ if (fAssistant == null) {
+ Arrays.sort(proposals, fComparator);
+ return proposals;
+ }
+
+ fAssistant.setSorter(new AbstractProposalSorter() {
+ @Override
+ public int compare(ICompletionProposal p1, ICompletionProposal p2) {
+ return fComparator.compare(p1, p2);
+ }
+
+ });
return proposals;
}
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java
index 397412c..7bab110 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/JavaSnippetViewerConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -49,8 +49,13 @@
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
ContentAssistant assistant = new ContentAssistant();
+ assistant.enableColoredLabels(true);
+ IContentAssistProcessor contentAssistProcessor = getContentAssistantProcessor();
+ if (contentAssistProcessor instanceof JavaSnippetCompletionProcessor) {
+ ((JavaSnippetCompletionProcessor) contentAssistProcessor).setContentAssistant(assistant);
+ }
assistant.setContentAssistProcessor(
- getContentAssistantProcessor(),
+ contentAssistProcessor,
IDocument.DEFAULT_CONTENT_TYPE);
JDIContentAssistPreference.configure(assistant, getColorManager());
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java
index 739a9b4..28c9c78 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/ValidBreakpointLocationLocator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2014 IBM Corporation and others.
+ * Copyright (c) 2003, 2016 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
@@ -998,6 +998,11 @@
// check if we are on the line which contains the method name
int nameOffset = node.getName().getStartPosition();
if (lineNumber(nameOffset) == fLineNumber) {
+ if (node.getParent() instanceof AnonymousClassDeclaration){
+ fLocationType = LOCATION_NOT_FOUND;
+ fLocationFound = true;
+ return false;
+ }
fMemberOffset = nameOffset;
fLocationType = LOCATION_METHOD;
fLocationFound = true;