Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2013-09-05 12:08:04 +0000
committerManju Mathew2013-10-30 06:47:51 +0000
commit325191c6337bfd0fa68e492b9c65e6df1726bbf7 (patch)
tree7661669fb2fee9b2b43feb23ee7d788804c3cdd8
parent43fc1287fc456f29583a7e917f25630342de9d2e (diff)
downloadeclipse.jdt.ui-325191c6337bfd0fa68e492b9c65e6df1726bbf7.tar.gz
eclipse.jdt.ui-325191c6337bfd0fa68e492b9c65e6df1726bbf7.tar.xz
eclipse.jdt.ui-325191c6337bfd0fa68e492b9c65e6df1726bbf7.zip
Fixed bug 409719: [1.8][refactoring] Incorrect Method signature preview
for default methods
-rw-r--r--org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java6
-rw-r--r--org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java11
2 files changed, 14 insertions, 3 deletions
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java
index ef49b65d9f..5519c4b010 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java
@@ -222,8 +222,12 @@ public class TypeContextChecker {
}
private int appendMethodDeclaration(StringBuffer cuString, String[] types, int parameterCount) throws JavaModelException {
- if (Flags.isStatic(fMethod.getFlags()))
+ int flags= fMethod.getFlags();
+ if (Flags.isStatic(flags)) {
cuString.append("static "); //$NON-NLS-1$
+ } else if (Flags.isDefaultMethod(flags)) {
+ cuString.append("default "); //$NON-NLS-1$
+ }
ITypeParameter[] methodTypeParameters= fMethod.getTypeParameters();
if (methodTypeParameters.length != 0) {
diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java
index 0a61f46694..578bebbdd8 100644
--- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java
+++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java
@@ -895,8 +895,11 @@ public class ChangeSignatureProcessor extends RefactoringProcessor implements ID
int flags= getMethod().getFlags();
buff.append(getVisibilityString(flags));
- if (Flags.isStatic(flags))
+ if (Flags.isStatic(flags)) {
buff.append("static "); //$NON-NLS-1$
+ } else if (Flags.isDefaultMethod(flags)) {
+ buff.append("default "); //$NON-NLS-1$
+ }
if (! getMethod().isConstructor())
buff.append(fReturnTypeInfo.getOldTypeName())
.append(' ');
@@ -917,8 +920,12 @@ public class ChangeSignatureProcessor extends RefactoringProcessor implements ID
StringBuffer buff= new StringBuffer();
buff.append(getVisibilityString(fVisibility));
- if (Flags.isStatic(getMethod().getFlags()))
+ int flags= getMethod().getFlags();
+ if (Flags.isStatic(flags)) {
buff.append("static "); //$NON-NLS-1$
+ } else if (Flags.isDefaultMethod(flags)) {
+ buff.append("default "); //$NON-NLS-1$
+ }
if (! getMethod().isConstructor())
buff.append(getReturnTypeString())
.append(' ');

Back to the top