Bug 108664 AssertionFailedException when adding serial version UID to anonymous class
M20050831-1200 + ZRH plug-ins from 0902 - have the CU below - note the warning on the anonymous class about the missing serialVersionUID - execute the related quick fix - get the exception below - note: the same works when ArrayList is imported instead of qualified ---------- Anon.java ------------- package junit.framework; public class Anon { void test() { new java.util.ArrayList<Integer>() { }; } } ---------- Exception ------------------ !ENTRY org.eclipse.ui 4 0 2005-09-02 14:17:38.31 !MESSAGE assertion failed; !STACK 0 org.eclipse.jdt.internal.corext.Assert$AssertionFailedException: assertion failed; at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:139) at org.eclipse.jdt.internal.corext.Assert.isTrue(Assert.java:124) at org.eclipse.jdt.internal.ui.text.correction.AbstractSerialVersionProposal.getRewrite(AbstractSerialVersionProposal.java:162) at org.eclipse.jdt.internal.ui.text.correction.ASTRewriteCorrectionProposal.addEdits(ASTRewriteCorrectionProposal.java:61) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.initializeTextChange(CUCorrectionProposal.java:141) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.performChange(CUCorrectionProposal.java:278) at org.eclipse.jdt.internal.ui.text.correction.LinkedCorrectionProposal.performChange(LinkedCorrectionProposal.java:231) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.apply(CUCorrectionProposal.java:309) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:512) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.java:458) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:837) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:630) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:414) at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:55) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1045) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1030) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:900) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5122) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4857) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1045) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1030) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1057) at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:621) at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:1964) at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:560) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1365) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3442) at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:4777) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1067) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1158) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2570) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SerialVersionHashProposal.java
return getAST().newNumberLiteral(serialVersionID + LONG_SUFFIX);
	}
	/**
	 * {@inheritDoc}
	 */
	public String getAdditionalProposalInfo() {
		return CorrectionMessages.SerialVersionHashProposal_message_generated_info;
	}
	/**
	 * Returns the qualified type name of the class declaration.
	 * 
	 * @return the qualified type name of the class
	 */
	private String getQualifiedName() {
		final ASTNode parent= getDeclarationNode();
		ITypeBinding binding= null;
		if (parent instanceof AbstractTypeDeclaration) {
			final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) parent;
			binding= declaration.resolveBinding();
		} else if (parent instanceof AnonymousClassDeclaration) {
			final AnonymousClassDeclaration declaration= (AnonymousClassDeclaration) parent;
			final ClassInstanceCreation creation= (ClassInstanceCreation) declaration.getParent();
			binding= creation.resolveTypeBinding();
		}
		if (binding != null)
			return binding.getBinaryName();
		return null;
	}
}