View | Details | Raw Unified | Return to bug 345569
Collapse All | Expand All

(-)eval/org/eclipse/jdt/internal/eval/CodeSnippetToCuMapper.java (-1 / +1 lines)
Lines 143-149 Link Here
143
		}
143
		}
144
	}
144
	}
145
	// run() method declaration
145
	// run() method declaration
146
	if (this.complianceVersion >= ClassFileConstants.JDK1_6) {
146
	if (this.complianceVersion >= ClassFileConstants.JDK1_5) {
147
		buffer.append("@Override "); //$NON-NLS-1$
147
		buffer.append("@Override "); //$NON-NLS-1$
148
	}
148
	}
149
	buffer.append("public void run() throws Throwable {").append(lineSeparator); //$NON-NLS-1$
149
	buffer.append("public void run() throws Throwable {").append(lineSeparator); //$NON-NLS-1$
(-)src/org/eclipse/jdt/core/tests/eval/CodeSnippetTest.java (-2 / +18 lines)
Lines 57-64 Link Here
57
	defaultOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.WARNING);
57
	defaultOptions.put(CompilerOptions.OPTION_ReportLocalVariableHiding, CompilerOptions.WARNING);
58
	defaultOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
58
	defaultOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
59
	defaultOptions.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.WARNING);
59
	defaultOptions.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, CompilerOptions.WARNING);
60
	defaultOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.ERROR);
61
	defaultOptions.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.ERROR);
62
	return defaultOptions;
60
	return defaultOptions;
63
}
61
}
64
/**
62
/**
Lines 911-914 Link Here
911
		this.context.setImports(new char[0][]);
909
		this.context.setImports(new char[0][]);
912
	}
910
	}
913
}
911
}
912
/**
913
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=345334
914
 */
915
public void testBug345334() {
916
	Map options = getCompilerOptions();
917
	if (this.complianceLevel == ClassFileConstants.JDK1_5) {
918
		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.ERROR);
919
	} else if (this.complianceLevel >= ClassFileConstants.JDK1_6) {
920
		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotation, CompilerOptions.ERROR);
921
		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.ERROR);
922
	}
923
	evaluateWithExpectedDisplayString(
924
			options,
925
			buildCharArray(new String[] {
926
			"return \"SUCCESS\";\n",
927
			}),
928
			"SUCCESS".toCharArray());
929
}
914
}
930
}

Return to bug 345569