Re-fix bug 348574 after regression in testAddAbstractMethods2
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java
index 85fa65f..c758757 100644
--- a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/StubUtility2.java
@@ -1,13 +1,12 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
- * Copyright 2007 Technical University Berlin, Germany and others.
+ * Copyright 2007, 2016 Technical University Berlin, Germany 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
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: StubUtility2.java 23438 2010-02-04 20:05:24Z stephan $
*
* Please visit http://www.eclipse.org/objectteams for updates and contact.
*
@@ -31,7 +30,7 @@
* @author stephan
* @since 1.1.2
*/
-@SuppressWarnings({ "unchecked", "rawtypes"/*parameter-less lists from DOM*/, "restriction", "decapsulation"/*final baseclass + callout-decapsulation*/ })
+@SuppressWarnings({ "unchecked", "rawtypes"/*parameter-less lists from DOM*/, "decapsulation"/*final baseclass + callout-decapsulation*/ })
protected class StubUtility2 playedBy StubUtility2
{
@@ -126,7 +125,9 @@
for (int i= 0; i < typeMethods.length; i++) {
IMethodBinding curr= typeMethods[i];
int modifiers= curr.getModifiers();
- if (!curr.isConstructor() && !Modifier.isStatic(modifiers) && !Modifier.isPrivate(modifiers)) {
+ if ((!curr.isConstructor() && !Modifier.isStatic(modifiers) && !Modifier.isPrivate(modifiers))
+ || Modifier.isAbstract(modifiers)) // account for 'abstract static' (partially virtual ;P )
+ {
if (!curr.isCopied()) // new check for OT
if (findMethodBinding(curr, allMethods) == null) {
allMethods.add(curr);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java
index 1acba13..bb302af 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests/src/org/eclipse/objectteams/otdt/ui/tests/core/JavaQuickFixTests.java
@@ -1,7 +1,7 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
- * Copyright 2010 Stephan Herrmann.
+ * Copyright 2010, 2016 Stephan Herrmann.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -26,6 +26,7 @@
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.ui.text.correction.proposals.NewCUUsingWizardProposal;
+import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal;
/**
@@ -67,7 +68,7 @@
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
CompilationUnit astRoot= getASTRoot(cu);
- ArrayList proposals= collectCorrections(cu, astRoot);
+ ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 6);
// create class / interface / enum B
// add type parameter B to R / T1
@@ -99,7 +100,7 @@
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
CompilationUnit astRoot= getASTRoot(cu);
- ArrayList proposals= collectCorrections(cu, astRoot);
+ ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 7);
// create class / interface / enum B
// add type parameter B to R / Mid / T1
@@ -131,7 +132,7 @@
ICompilationUnit cu= pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
CompilationUnit astRoot= getASTRoot(cu);
- ArrayList proposals= collectCorrections(cu, astRoot, 2, 1, null);
+ ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot, 2, 1, null);
assertNumberOfProposals(proposals, 5);
// create class / interface / enum B
// add type parameter B to T1
@@ -170,9 +171,9 @@
pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
CompilationUnit astRoot= getASTRoot(cu1);
- ArrayList proposals1= collectCorrections(cu1, astRoot, 2, 0);
+ ArrayList<IJavaCompletionProposal> proposals1= collectCorrections(cu1, astRoot, 2, 0);
assertNumberOfProposals(proposals1, 0);
- ArrayList proposals2= collectCorrections(cu1, astRoot, 2, 1);
+ ArrayList<IJavaCompletionProposal> proposals2= collectCorrections(cu1, astRoot, 2, 1);
assertNumberOfProposals(proposals2, 2);
assertCorrectLabels(proposals1);
@@ -233,9 +234,9 @@
pack1.createCompilationUnit("T1.java", buf.toString(), false, null);
CompilationUnit astRoot= getASTRoot(cu1);
- ArrayList proposals1= collectCorrections(cu1, astRoot, 2, 0);
+ ArrayList<IJavaCompletionProposal> proposals1= collectCorrections(cu1, astRoot, 2, 0);
assertNumberOfProposals(proposals1, 0);
- ArrayList proposals2= collectCorrections(cu1, astRoot, 2, 1);
+ ArrayList<IJavaCompletionProposal> proposals2= collectCorrections(cu1, astRoot, 2, 1);
assertNumberOfProposals(proposals2, 2);
assertCorrectLabels(proposals1);
@@ -250,6 +251,7 @@
buf.append(" /* (non-Javadoc)\n");
buf.append(" * @see test1.T1.R#foo()\n");
buf.append(" */\n");
+ buf.append(" @Override\n");
buf.append(" static void foo() {\n");
buf.append(" // TODO Auto-generated method stub\n");
buf.append(" \n");