Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82864 Details for
Bug 206811
Adopt J2SE 5.0 in Transaction Component
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updates from review comments
take2.patch (text/plain), 503.99 KB, created by
Christian Damus
on 2007-11-14 08:16:51 EST
(
hide
)
Description:
Updates from review comments
Filename:
MIME Type:
Creator:
Christian Damus
Created:
2007-11-14 08:16:51 EST
Size:
503.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.transaction.doc >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/doc/org.eclipse.emf.transaction.doc/.classpath,v >retrieving revision 1.3 >diff -u -r1.3 .classpath >--- .classpath 20 Dec 2006 17:06:57 -0000 1.3 >+++ .classpath 14 Nov 2007 13:11:47 -0000 >@@ -1,6 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/doc/org.eclipse.emf.transaction.doc/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:57 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:11:47 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:55:59 EST 2006 >+#Sun Nov 11 13:12:56 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/doc/org.eclipse.emf.transaction.doc/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:30 -0000 1.9 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:11:47 -0000 >@@ -7,4 +7,4 @@ > Bundle-Localization: plugin > Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >#P org.eclipse.emf.workspace.tests >Index: src/org/eclipse/emf/workspace/tests/WorkbenchCommandStackTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/WorkbenchCommandStackTest.java,v >retrieving revision 1.10 >diff -u -r1.10 WorkbenchCommandStackTest.java >--- src/org/eclipse/emf/workspace/tests/WorkbenchCommandStackTest.java 3 Oct 2007 20:16:31 -0000 1.10 >+++ src/org/eclipse/emf/workspace/tests/WorkbenchCommandStackTest.java 14 Nov 2007 13:11:48 -0000 >@@ -232,24 +232,29 @@ > final IUndoContext undoContext = new UndoContext(); > > domain.addResourceSetListener(new ResourceSetListenerImpl() { >+ @Override > public boolean isPrecommitOnly() { > return true; > } > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) > throws RollbackException { > > IUndoableOperation op = new AbstractOperation("") { //$NON-NLS-1$ >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > return Status.OK_STATUS; > } > >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > return Status.OK_STATUS; > } > >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > return Status.OK_STATUS; >@@ -266,6 +271,7 @@ > IUndoContext resCtx = new ResourceUndoContext(domain, r); > > AbstractEMFOperation op = new AbstractEMFOperation(domain, "") { //$NON-NLS-1$ >+ @Override > protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -286,7 +292,7 @@ > } > > assertNotNull(op.getContexts()); >- List opContexts = Arrays.asList(op.getContexts()); >+ List<IUndoContext> opContexts = Arrays.asList(op.getContexts()); > assertTrue(opContexts.contains(resCtx)); > assertTrue(opContexts.contains(undoContext)); > >@@ -315,6 +321,7 @@ > > Command op = new RecordingCommand(domain) { > >+ @Override > protected void doExecute() { > r.getContents().add(EXTLibraryFactory.eINSTANCE.createLibrary()); > >@@ -362,9 +369,11 @@ > final RuntimeException error = new RuntimeException(); > > ResourceSetListener testListener = new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new RecordingCommand(domain, "Error") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > throw error; > }}; > }}; >@@ -376,7 +385,8 @@ > domain.addResourceSetListener(testListener); > > domain.getCommandStack().execute(new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -404,9 +414,11 @@ > final RuntimeException error = new OperationCanceledException(); > > ResourceSetListener testListener = new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new RecordingCommand(domain, "Error") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > throw error; > }}; > }}; >@@ -418,7 +430,8 @@ > domain.addResourceSetListener(testListener); > > domain.getCommandStack().execute(new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -446,9 +459,11 @@ > final RuntimeException error = new RuntimeException(); > > ResourceSetListener testListener = new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new RecordingCommand(domain, "Error") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > throw error; > }}; > }}; >@@ -458,7 +473,8 @@ > > try { > IStatus status = new AbstractEMFOperation(domain, "test") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) { >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -489,9 +505,11 @@ > final RuntimeException error = new OperationCanceledException(); > > ResourceSetListener testListener = new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new RecordingCommand(domain, "Error") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > throw error; > }}; > }}; >@@ -501,7 +519,8 @@ > > try { > IStatus status = new AbstractEMFOperation(domain, "test") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) { >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -531,13 +550,15 @@ > public void test_recordingCommandsAsTriggers_bug157103() { > // one trigger sets default library names > domain.addResourceSetListener(new LibraryDefaultNameTrigger() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > > final Library newLibrary = (Library) notification.getNewValue(); > if ((newLibrary.getName() == null) || (newLibrary.getName().length() == 0)) { > result = new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > newLibrary.setName("New Library"); //$NON-NLS-1$ > }}; > } >@@ -549,7 +570,8 @@ > > IUndoContext ctx = new UndoContext(); > IUndoableOperation operation = new AbstractEMFOperation(domain, "Test") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) { >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) { > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); > root.getBranches().add(newLibrary[0]); > >@@ -679,14 +701,16 @@ > SelfOpeningEMFCompositeOperation operation = new SelfOpeningEMFCompositeOperation( > domain) { > >- protected IStatus doExecute(IOperationHistory history, >+ @Override >+ protected IStatus doExecute(IOperationHistory history, > IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > return history.execute( > new AbstractEMFOperation(domain, "Test") { //$NON-NLS-1$ > >- protected IStatus doExecute(IProgressMonitor monitor, >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, > IAdaptable info) { > root.getBranches().add( > EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -711,12 +735,14 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() throws Exception { > super.doSetUp(); > > defaultContext = ((IWorkspaceCommandStack) getCommandStack()).getDefaultUndoContext(); > } > >+ @Override > protected void doTearDown() throws Exception { > defaultContext = null; > >Index: src/org/eclipse/emf/workspace/tests/AbstractTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/AbstractTest.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractTest.java >--- src/org/eclipse/emf/workspace/tests/AbstractTest.java 3 Oct 2007 20:17:34 -0000 1.4 >+++ src/org/eclipse/emf/workspace/tests/AbstractTest.java 14 Nov 2007 13:11:48 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -44,11 +44,11 @@ > import org.eclipse.emf.examples.extlibrary.Person; > import org.eclipse.emf.examples.extlibrary.Writer; > import org.eclipse.emf.examples.extlibrary.util.EXTLibrarySwitch; >+import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalCommandStack; > import org.eclipse.emf.transaction.TransactionalEditingDomain; >-import org.eclipse.emf.transaction.Transaction; >-import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; > import org.eclipse.emf.transaction.impl.InternalTransaction; >+import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; > import org.eclipse.emf.validation.model.IConstraintStatus; > import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; > import org.osgi.framework.Bundle; >@@ -80,7 +80,8 @@ > > protected static final String TEST_RESOURCE_NAME = "test_model.extlibrary"; //$NON-NLS-1$ > >- private final List transactionStack = new java.util.ArrayList(); >+ private final List<InternalTransaction> transactionStack = >+ new java.util.ArrayList<InternalTransaction>(); > > public AbstractTest() { > super(); >@@ -94,6 +95,7 @@ > // Test configuration methods > // > >+ @Override > protected final void setUp() > throws Exception { > >@@ -141,6 +143,7 @@ > history); > } > >+ @Override > protected final void tearDown() > throws Exception { > >@@ -208,7 +211,7 @@ > file.create(input, true, null); > > result = domain.createResource( >- URI.createPlatformResourceURI(file.getFullPath().toString()).toString()); >+ URI.createPlatformResourceURI(file.getFullPath().toString(), true).toString()); > } catch (Exception e) { > e.printStackTrace(); > fail("Exception creating test resource: " + e.getLocalizedMessage()); //$NON-NLS-1$ >@@ -341,8 +344,8 @@ > String name = names[i]; > result = null; > >- for (Iterator iter = getContents(current).iterator(); iter.hasNext();) { >- EObject child = (EObject) iter.next(); >+ for (Iterator<EObject> iter = getContents(current).iterator(); iter.hasNext();) { >+ EObject child = iter.next(); > > if (name.equals(getName(child))) { > result = child; >@@ -363,7 +366,7 @@ > * @return its name > */ > private String getName(EObject object) { >- return (String) GetName.INSTANCE.doSwitch(object); >+ return GetName.INSTANCE.doSwitch(object); > } > > /** >@@ -372,13 +375,13 @@ > * @param object an object, which may be a resource or an element > * @return its immediate contents (children) > */ >- private List getContents(Object object) { >+ private List<EObject> getContents(Object object) { > if (object instanceof EObject) { > return ((EObject) object).eContents(); > } else if (object instanceof Resource) { > return ((Resource) object).getContents(); > } else { >- return Collections.EMPTY_LIST; >+ return Collections.emptyList(); > } > } > >@@ -397,7 +400,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >- private static final class GetName extends EXTLibrarySwitch { >+ private static final class GetName extends EXTLibrarySwitch<String> { > static final GetName INSTANCE = new GetName(); > > private GetName() { >@@ -408,23 +411,28 @@ > return object.getTitle(); > } > >- public Object caseBook(Book object) { >+ @Override >+ public String caseBook(Book object) { > return object.getTitle(); > } > >- public Object caseLibrary(Library object) { >+ @Override >+ public String caseLibrary(Library object) { > return object.getName(); > } > >- public Object casePeriodical(Periodical object) { >+ @Override >+ public String casePeriodical(Periodical object) { > return object.getTitle(); > } > >- public Object caseWriter(Writer object) { >+ @Override >+ public String caseWriter(Writer object) { > return object.getName(); > } > >- public Object casePerson(Person object) { >+ @Override >+ public String casePerson(Person object) { > if (object.getFirstName() == null) { > if (object.getLastName() == null) { > return ""; //$NON-NLS-1$ >@@ -443,7 +451,8 @@ > } > } > >- public Object defaultCase(EObject object) { >+ @Override >+ public String defaultCase(EObject object) { > return ""; //$NON-NLS-1$ > } > } >@@ -483,7 +492,7 @@ > * > * @param options the options > */ >- protected void startWriting(Map options) { >+ protected void startWriting(Map<?, ?> options) { > try { > transactionStack.add( > ((InternalTransactionalEditingDomain) domain).startTransaction(false, options)); >@@ -518,7 +527,7 @@ > * > * @param options the options > */ >- protected void startReading(Map options) { >+ protected void startReading(Map<?, ?> options) { > try { > transactionStack.add( > ((InternalTransactionalEditingDomain) domain).startTransaction(true, options)); >@@ -567,8 +576,8 @@ > * > * @return the map > */ >- protected Map makeOptions(String option) { >- return makeOptions(option, Boolean.TRUE); >+ protected Map<?, ?> makeOptions(String option) { >+ return makeOptions(option, true); > } > > /** >@@ -579,7 +588,7 @@ > * > * @return the map > */ >- protected Map makeOptions(String option, Object value) { >+ protected Map<?, ?> makeOptions(String option, Object value) { > if (value == null) { > return Collections.EMPTY_MAP; > } >@@ -590,21 +599,19 @@ > /** > * Makes a map from multiple options, as key-value pairs. > * >- * @param options a pairwise list of keys and values >+ * @param option an option >+ * @param value the <tt>option</tt> value >+ * @param options a pairwise list of additional options and values > * > * @return the map > */ >- protected Map makeOptions(Object[] options) { >- Map result; >+ protected Map<?, ?> makeOptions(Object option, Object value, Object... options) { >+ Map<Object, Object> result = new java.util.HashMap<Object, Object>(); > >- if (options == null) { >- result = Collections.EMPTY_MAP; >- } else { >- result = new java.util.HashMap(); >- >- for (int i = 0; i < options.length - 1; i += 2) { >- result.put(options[i], options[i + 1]); >- } >+ result.put(option, value); >+ >+ for (int i = 0; i < options.length - 1; i += 2) { >+ result.put(options[i], options[i + 1]); > } > > return result; >Index: src/org/eclipse/emf/workspace/tests/CompositeEMFOperationTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/CompositeEMFOperationTest.java,v >retrieving revision 1.4 >diff -u -r1.4 CompositeEMFOperationTest.java >--- src/org/eclipse/emf/workspace/tests/CompositeEMFOperationTest.java 7 Jun 2007 14:26:03 -0000 1.4 >+++ src/org/eclipse/emf/workspace/tests/CompositeEMFOperationTest.java 14 Nov 2007 13:11:48 -0000 >@@ -36,6 +36,7 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.ecore.change.ChangeDescription; > import org.eclipse.emf.examples.extlibrary.Book; > import org.eclipse.emf.examples.extlibrary.EXTLibraryFactory; > import org.eclipse.emf.examples.extlibrary.Library; >@@ -151,7 +152,7 @@ > child2.addContext(ctx1); > child3.addContext(ctx3); > >- ListIterator iter = composite.listIterator(); >+ ListIterator<IUndoableOperation> iter = composite.listIterator(); > > // no contexts, yet > assertEquals( >@@ -310,6 +311,7 @@ > CompositeEMFOperation composite = new CompositeEMFOperation(domain, "Composite"); //$NON-NLS-1$ > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > }}); >@@ -317,6 +319,7 @@ > composite.add(new ChangeExternalData(externalData, book)); > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > newAuthor.getBooks().add(book); > }}); >@@ -402,6 +405,7 @@ > CompositeEMFOperation composite = new CompositeEMFOperation(domain, "Composite"); //$NON-NLS-1$ > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > }}); >@@ -415,6 +419,7 @@ > > // EMF change in the nested non-transactional composite > composite2.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > newAuthor.getBooks().add(book); > }}); >@@ -502,6 +507,7 @@ > CompositeEMFOperation composite = new CompositeEMFOperation(domain, "Composite"); //$NON-NLS-1$ > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > newAuthor.getBooks().add(book); > }}); >@@ -515,6 +521,7 @@ > > // EMF change in the nested non-transactional composite > composite2.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(null); // will not pass validation > }}); >@@ -568,6 +575,7 @@ > CompositeEMFOperation composite = new CompositeEMFOperation(domain, "Composite"); //$NON-NLS-1$ > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library. Our triggers will set a default name and book > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); >@@ -592,7 +600,7 @@ > > assertEquals("New Library", newLibrary[0].getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary[0].getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary[0].getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary[0].getBooks().get(0).getTitle()); //$NON-NLS-1$ > assertEquals("New Book", externalData[0]); //$NON-NLS-1$ > > commit(); >@@ -627,7 +635,7 @@ > assertTrue(root.getBranches().contains(newLibrary[0])); > assertEquals("New Library", newLibrary[0].getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary[0].getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary[0].getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary[0].getBooks().get(0).getTitle()); //$NON-NLS-1$ > assertEquals("New Book", externalData[0]); //$NON-NLS-1$ > > commit(); >@@ -654,6 +662,7 @@ > CompositeEMFOperation composite = new CompositeEMFOperation(domain, "Composite"); //$NON-NLS-1$ > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library. Our triggers will set a default name and book > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); >@@ -674,7 +683,7 @@ > > assertEquals("New Library", newLibrary[0].getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary[0].getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary[0].getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary[0].getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > >@@ -707,7 +716,7 @@ > assertTrue(root.getBranches().contains(newLibrary[0])); > assertEquals("New Library", newLibrary[0].getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary[0].getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary[0].getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary[0].getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > } >@@ -738,6 +747,7 @@ > CompositeEMFOperation composite = new CompositeEMFOperation(domain, "Composite"); //$NON-NLS-1$ > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > }}); >@@ -745,6 +755,7 @@ > composite.add(new ChangeExternalData(externalData, book)); > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > newAuthor.getBooks().add(book); > }}); >@@ -1278,6 +1289,7 @@ > composite.setTransactionNestingEnabled(false); > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -1285,11 +1297,13 @@ > > CompositeEMFOperation nestedComposite = new CompositeEMFOperation(domain, "Nested"); //$NON-NLS-1$ > nestedComposite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); > }}); > nestedComposite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -1308,7 +1322,7 @@ > assertNotNull(transaction); > > // only one transaction (contributing one change description to the composite) >- Collection changes = getChanges(transaction); >+ Collection<ChangeDescription> changes = getChanges(transaction); > assertEquals(1, changes.size()); > > capture.clear(); >@@ -1392,6 +1406,7 @@ > composite.setTransactionNestingEnabled(false); > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -1400,11 +1415,13 @@ > CompositeEMFOperation nestedComposite = new CompositeEMFOperation(domain, "Nested"); //$NON-NLS-1$ > nestedComposite.add(new ChangeExternalData(externalData, book)); // non-EMF change > nestedComposite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); > }}); > nestedComposite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -1427,7 +1444,7 @@ > // before the non-EMF changes, one change for the non-EMF changes, > // and one change for everything after. We would have 4 changes > // without the no-nesting hint >- Collection changes = getChanges(transaction); >+ Collection<ChangeDescription> changes = getChanges(transaction); > assertEquals(3, changes.size()); > > capture.clear(); >@@ -1507,6 +1524,7 @@ > composite.setTransactionNestingEnabled(false); > > composite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -1516,16 +1534,19 @@ > nestedComposite.add(new TestOperation(domain, > // this transaction has different options > Collections.singletonMap(Transaction.OPTION_NO_NOTIFICATIONS, Boolean.TRUE)) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); > }}); > nestedComposite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); > }}); > nestedComposite.add(new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library > root.getBranches().add(EXTLibraryFactory.eINSTANCE.createLibrary()); >@@ -1548,7 +1569,7 @@ > // before the different options, one change for the different options, > // and one change for everything after. We would have 4 changes > // without the no-nesting hint >- Collection changes = getChanges(transaction); >+ Collection<ChangeDescription> changes = getChanges(transaction); > assertEquals(3, changes.size()); > > capture.clear(); >@@ -1610,14 +1631,15 @@ > * Does a reflective hack to get the private <tt>changes</tt> field of a > * composite change description. > */ >- private Collection getChanges(Transaction tx) { >- Collection result = null; >+ @SuppressWarnings("unchecked") >+ private Collection<ChangeDescription> getChanges(Transaction tx) { >+ Collection<ChangeDescription> result = null; > CompositeChangeDescription composite = (CompositeChangeDescription) tx.getChangeDescription(); > > try { > Field changes = composite.getClass().getDeclaredField("changes"); //$NON-NLS-1$ > changes.setAccessible(true); >- result = (Collection) changes.get(composite); >+ result = (Collection<ChangeDescription>) changes.get(composite); > } catch (Exception e) { > fail("Could not access private changes field of CompositeChangeDescription: " + e.getLocalizedMessage()); //$NON-NLS-1$ > } >@@ -1644,13 +1666,14 @@ > this.library = library; > } > >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > oldData = externalData[0]; > > // can safely read in the enclosing composite's write transaction > if (book == null) { > // get the book from the new library, then >- book = (Book) library[0].getBooks().get(0); >+ book = library[0].getBooks().get(0); > } > > externalData[0] = book.getTitle(); >@@ -1658,11 +1681,13 @@ > return Status.OK_STATUS; > } > >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > externalData[0] = oldData; > return Status.OK_STATUS; > } > >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > externalData[0] = book.getTitle(); > return Status.OK_STATUS; >@@ -1670,10 +1695,10 @@ > } > > private static class FailCancelOperation extends AbstractOperation { >- private IStatus executeStatus; >- private IStatus undoStatus; >- private IStatus redoStatus; >- private boolean cancelMonitor; >+ private final IStatus executeStatus; >+ private final IStatus undoStatus; >+ private final IStatus redoStatus; >+ private final boolean cancelMonitor; > > FailCancelOperation(IStatus exec, IStatus undo, IStatus redo, boolean cancel) { > super("Fail/Cancel Operation"); //$NON-NLS-1$ >@@ -1683,6 +1708,7 @@ > this.cancelMonitor = cancel; > } > >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > if ((executeStatus.getSeverity() == IStatus.CANCEL) && cancelMonitor) { > monitor.setCanceled(true); >@@ -1692,6 +1718,7 @@ > return executeStatus; > } > >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > if ((undoStatus.getSeverity() == IStatus.CANCEL) && cancelMonitor) { > monitor.setCanceled(true); >@@ -1701,6 +1728,7 @@ > return undoStatus; > } > >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > if ((redoStatus.getSeverity() == IStatus.CANCEL) && cancelMonitor) { > monitor.setCanceled(true); >@@ -1726,18 +1754,21 @@ > wasRedone = false; > } > >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > wasExecuted = true; > return Status.OK_STATUS; > } > >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > wasUndone = true; > return Status.OK_STATUS; > } > >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > wasRedone = true; >@@ -1748,10 +1779,12 @@ > private static class TransactionCapture extends ResourceSetListenerImpl { > private Transaction transaction; > >+ @Override > public boolean isPostcommitOnly() { > return true; > } > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > if (transaction == null) { > transaction = event.getTransaction(); >Index: src/org/eclipse/emf/workspace/tests/UndoContextTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/UndoContextTest.java,v >retrieving revision 1.1 >diff -u -r1.1 UndoContextTest.java >--- src/org/eclipse/emf/workspace/tests/UndoContextTest.java 30 Jan 2006 16:26:01 -0000 1.1 >+++ src/org/eclipse/emf/workspace/tests/UndoContextTest.java 14 Nov 2007 13:11:48 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -71,6 +71,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -83,7 +84,7 @@ > fail(e); > } > >- Set affected = ResourceUndoContext.getAffectedResources(oper); >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources(oper); > > assertNotNull(affected); > assertEquals(Collections.singleton(testResource), affected); >@@ -115,6 +116,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -127,11 +129,11 @@ > fail(e); > } > >- Set affected = ResourceUndoContext.getAffectedResources(oper); >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources(oper); > > assertNotNull(affected); > >- Set expected = new java.util.HashSet(); >+ Set<Resource> expected = new java.util.HashSet<Resource>(); > expected.add(testResource); > expected.add(res2); > >Index: src/org/eclipse/emf/workspace/tests/BasicWorkbenchTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/BasicWorkbenchTest.java,v >retrieving revision 1.3 >diff -u -r1.3 BasicWorkbenchTest.java >--- src/org/eclipse/emf/workspace/tests/BasicWorkbenchTest.java 7 Jun 2007 14:26:03 -0000 1.3 >+++ src/org/eclipse/emf/workspace/tests/BasicWorkbenchTest.java 14 Nov 2007 13:11:48 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.workspace.tests; > > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > > import junit.framework.Test; >@@ -33,9 +32,9 @@ > import org.eclipse.emf.examples.extlibrary.Book; > import org.eclipse.emf.examples.extlibrary.EXTLibraryFactory; > import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; >+import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalCommandStack; > import org.eclipse.emf.transaction.TransactionalEditingDomain; >-import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; > import org.eclipse.emf.workspace.tests.fixtures.TestListener; > >@@ -301,7 +300,7 @@ > > // check that we got the expected events > assertNotNull(listener.postcommit); >- List notifications = listener.postcommit.getNotifications(); >+ List<Notification> notifications = listener.postcommit.getNotifications(); > assertFalse(notifications.isEmpty()); > > // look for an event indicating resource was loaded and one indicating >@@ -309,9 +308,7 @@ > Notification rootAdded = null; > Notification resLoaded = null; > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > if (next.getNotifier() == res) { > if (next.getFeatureID(null) == Resource.RESOURCE__IS_LOADED) { > if (next.getNewBooleanValue()) { >@@ -347,9 +344,7 @@ > Notification rootRemoved = null; > Notification resUnloaded = null; > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > if (next.getNotifier() == res) { > if (next.getFeatureID(null) == Resource.RESOURCE__IS_LOADED) { > if (!next.getNewBooleanValue()) { >Index: src/org/eclipse/emf/workspace/tests/AllTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/AllTests.java,v >retrieving revision 1.3 >diff -u -r1.3 AllTests.java >--- src/org/eclipse/emf/workspace/tests/AllTests.java 13 Jun 2007 12:27:33 -0000 1.3 >+++ src/org/eclipse/emf/workspace/tests/AllTests.java 14 Nov 2007 13:11:48 -0000 >@@ -23,7 +23,8 @@ > import junit.framework.TestSuite; > import junit.textui.TestRunner; > >-import org.eclipse.core.runtime.IPlatformRunnable; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > > /** > * Master JUnit test suite for the <em>EMF Workbench API</em>. >@@ -32,7 +33,7 @@ > */ > public class AllTests > extends TestCase >- implements IPlatformRunnable { >+ implements IApplication { > > public AllTests() { > super(""); //$NON-NLS-1$ >@@ -54,11 +55,15 @@ > return suite; > } > >- public Object run(Object args) >+ public Object start(IApplicationContext context) > throws Exception { > > TestRunner.run(suite()); > return Arrays > .asList(new String[] {"Please see raw test suite output for details."}); //$NON-NLS-1$ > } >+ >+ public void stop() { >+ // nothing to do >+ } > } >Index: src/org/eclipse/emf/workspace/tests/MemoryLeakTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/MemoryLeakTest.java,v >retrieving revision 1.1 >diff -u -r1.1 MemoryLeakTest.java >--- src/org/eclipse/emf/workspace/tests/MemoryLeakTest.java 13 Jun 2007 12:27:33 -0000 1.1 >+++ src/org/eclipse/emf/workspace/tests/MemoryLeakTest.java 14 Nov 2007 13:11:48 -0000 >@@ -32,9 +32,9 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.emf.common.command.Command; > import org.eclipse.emf.common.notify.Notification; >-import org.eclipse.emf.common.util.BasicEList; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EReference; >+import org.eclipse.emf.ecore.change.ChangeDescription; > import org.eclipse.emf.ecore.util.ECrossReferenceAdapter; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.edit.command.CommandParameter; >@@ -95,10 +95,11 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > Command cmd = new RemoveCommand(domain, root, EXTLibraryPackage.Literals.LIBRARY__BRANCHES, level1) { >- public void doDispose() { >+ @Override >+ public void doDispose() { > if (feature instanceof EReference && ((EReference) feature).isContainment()) { >- for (Iterator iter = collection.iterator(); iter.hasNext();) { >- EObject next = (EObject) iter.next(); >+ for (Object o : collection) { >+ EObject next = (EObject) o; > > // clear adapters on the removed object if it is still removed > if (next.eContainer() != owner) { >@@ -158,7 +159,8 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > Command cmd = new RecordingCommand(domain, "Remove Branch") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getBranches().remove(level1); > }}; > >@@ -213,10 +215,11 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > final Command trigger = new RemoveCommand(domain, root, EXTLibraryPackage.Literals.LIBRARY__BRANCHES, level1) { >- public void doDispose() { >+ @Override >+ public void doDispose() { > if (feature instanceof EReference && ((EReference) feature).isContainment()) { >- for (Iterator iter = collection.iterator(); iter.hasNext();) { >- EObject next = (EObject) iter.next(); >+ for (Object o : collection) { >+ EObject next = (EObject) o; > > // clear adapters on the removed object if it is still removed > if (next.eContainer() != owner) { >@@ -229,7 +232,8 @@ > }}; > > domain.addResourceSetListener(new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > // trigger on the name change only > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -291,12 +295,14 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > final Command trigger = new RecordingCommand(domain, "Remove Branch") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getBranches().remove(level1); > }}; > > domain.addResourceSetListener(new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > // trigger on the name change only > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -353,7 +359,8 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > IUndoableOperation oper = new AbstractEMFOperation(domain, "Remove Branch") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > root.getBranches().remove(level1); >@@ -422,12 +429,14 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > final Command trigger = new RecordingCommand(domain, "Remove Branch") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getBranches().remove(level1); > }}; > > domain.addResourceSetListener(new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > // trigger on the name change only > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -438,7 +447,8 @@ > }}); > > IUndoableOperation oper = new AbstractEMFOperation(domain, "Rename Library") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > root.setName("newname"); //$NON-NLS-1$ >@@ -507,7 +517,8 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > IUndoableOperation triggerOper = new AbstractEMFOperation(domain, "Remove Branch") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > root.getBranches().remove(level1); >@@ -517,7 +528,8 @@ > final Command trigger = new EMFOperationCommand(domain, triggerOper); > > domain.addResourceSetListener(new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > // trigger on the name change only > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -528,7 +540,8 @@ > }}); > > IUndoableOperation oper = new AbstractEMFOperation(domain, "Rename Library") { //$NON-NLS-1$ >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > root.setName("newname"); //$NON-NLS-1$ >@@ -579,19 +592,22 @@ > // > > private static class TransactionSniffer extends ResourceSetListenerImpl { >- private TransactionalEditingDomain domain; >- private List changes = new BasicEList.FastCompare(); >+ private final TransactionalEditingDomain domain; >+ private final List<ChangeDescription> changes = >+ new java.util.ArrayList<ChangeDescription>(); > > TransactionSniffer(TransactionalEditingDomain domain) { > this.domain = domain; > domain.addResourceSetListener(this); > } > >- public boolean isPostcommitOnly() { >+ @Override >+ public boolean isPostcommitOnly() { > return true; > } > >- public void resourceSetChanged(ResourceSetChangeEvent event) { >+ @Override >+ public void resourceSetChanged(ResourceSetChangeEvent event) { > Transaction tx = event.getTransaction(); > > if ((tx != null) && (tx.getChangeDescription()) != null) { >@@ -603,8 +619,8 @@ > // stop listening, now > domain.removeResourceSetListener(this); > >- for (Iterator iter = EcoreUtil.getAllContents(changes); iter.hasNext();) { >- EObject next = (EObject) iter.next(); >+ for (Iterator<EObject> iter = EcoreUtil.getAllContents(changes); iter.hasNext();) { >+ EObject next = iter.next(); > assertEquals("Adapters not cleared.", 0, next.eAdapters().size()); //$NON-NLS-1$ > } > } >Index: src/org/eclipse/emf/workspace/tests/AbstractEMFOperationTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/AbstractEMFOperationTest.java,v >retrieving revision 1.7 >diff -u -r1.7 AbstractEMFOperationTest.java >--- src/org/eclipse/emf/workspace/tests/AbstractEMFOperationTest.java 22 Mar 2007 17:27:08 -0000 1.7 >+++ src/org/eclipse/emf/workspace/tests/AbstractEMFOperationTest.java 14 Nov 2007 13:11:48 -0000 >@@ -90,6 +90,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -155,6 +156,7 @@ > // one trigger sets the external data > domain.addResourceSetListener(new TriggerListener() { > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -169,6 +171,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library. Our triggers will set a default name and book > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); >@@ -242,6 +245,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library. Our triggers will set a default name and book > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); >@@ -262,7 +266,7 @@ > > assertEquals("New Library", newLibrary[0].getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary[0].getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary[0].getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary[0].getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > >@@ -293,7 +297,7 @@ > assertTrue(root.getBranches().contains(newLibrary[0])); > assertEquals("New Library", newLibrary[0].getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary[0].getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary[0].getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary[0].getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > } >@@ -314,6 +318,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > // add a new library. Our triggers will set a default name and book > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); >@@ -334,7 +339,7 @@ > > // the book is created by the first trigger > assertEquals(1, newLibrary[0].getBooks().size()); >- Book book = (Book) newLibrary[0].getBooks().get(0); >+ Book book = newLibrary[0].getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > > // the publication date is created by the cascaded trigger >@@ -368,7 +373,7 @@ > // verify that the changes were redone > assertTrue(root.getBranches().contains(newLibrary[0])); > assertEquals(1, newLibrary[0].getBooks().size()); >- book = (Book) newLibrary[0].getBooks().get(0); >+ book = newLibrary[0].getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > assertNotNull(book.getPublicationDate()); > >@@ -395,6 +400,7 @@ > IUndoContext ctx = new TestUndoContext(); > > IUndoableOperation oper = new TestOperation(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -449,11 +455,12 @@ > > IUndoableOperation oper = new TestOperation( > domain, >- makeOptions(new Object[] { >- Transaction.OPTION_NO_NOTIFICATIONS, Boolean.TRUE, >- Transaction.OPTION_NO_TRIGGERS, Boolean.TRUE, >- Transaction.OPTION_NO_VALIDATION, Boolean.TRUE, >- })) { >+ makeOptions( >+ Transaction.OPTION_NO_NOTIFICATIONS, true, >+ Transaction.OPTION_NO_TRIGGERS, true, >+ Transaction.OPTION_NO_VALIDATION, true)) { >+ >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -498,9 +505,11 @@ > public void test_rollbackNestingTransactionOnException_135673() { > CompositeEMFOperation outer = new CompositeEMFOperation(domain, ""); //$NON-NLS-1$ > AbstractEMFOperation inner = new AbstractEMFOperation(domain, "") { //$NON-NLS-1$ >+ @Override > public boolean canExecute() { > return true; > } >+ @Override > protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > // start some nested transactions >@@ -533,10 +542,12 @@ > assertNotNull(book); > > final AbstractEMFOperation emfOperation = new AbstractEMFOperation(domain, "") { //$NON-NLS-1$ >+ @Override > public boolean canExecute() { > return true; > } > >+ @Override > protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -602,10 +613,12 @@ > }; > > AbstractEMFOperation root = new AbstractEMFOperation(domain, "") { //$NON-NLS-1$ >+ @Override > public boolean canExecute() { > return true; > } > >+ @Override > protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -661,7 +674,8 @@ > public void test_nullProgressMonitors_bug150033() { > IUndoableOperation operation = new AbstractEMFOperation(domain, "Test") { //$NON-NLS-1$ > >- protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > monitor.isCanceled(); >@@ -669,7 +683,8 @@ > return super.doUndo(monitor, info); > } > >- protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > monitor.isCanceled(); >@@ -677,7 +692,8 @@ > return super.doRedo(monitor, info); > } > >- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > monitor.isCanceled(); >Index: src/org/eclipse/emf/workspace/tests/EMFOperationCommandTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/EMFOperationCommandTest.java,v >retrieving revision 1.4 >diff -u -r1.4 EMFOperationCommandTest.java >--- src/org/eclipse/emf/workspace/tests/EMFOperationCommandTest.java 7 Jun 2007 14:26:03 -0000 1.4 >+++ src/org/eclipse/emf/workspace/tests/EMFOperationCommandTest.java 14 Nov 2007 13:11:48 -0000 >@@ -161,6 +161,7 @@ > > domain.addResourceSetListener(new TriggerListener() { > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >@@ -252,6 +253,7 @@ > > domain.addResourceSetListener(new TriggerListener() { > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >@@ -315,12 +317,14 @@ > > Command cmd = new RecordingCommand(domain, "Testing") { //$NON-NLS-1$ > >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > }}; > > domain.addResourceSetListener(new TriggerListener() { > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >@@ -391,10 +395,12 @@ > */ > public void test_nonredoableOperation_138287() { > IUndoableOperation operation = new TestOperation(domain) { >+ @Override > protected void doExecute() { > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -412,6 +418,7 @@ > // Test fixtures > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -421,6 +428,7 @@ > validationEnabled = true; > } > >+ @Override > protected void doTearDown() > throws Exception { > >Index: src/org/eclipse/emf/workspace/tests/EMFCommandOperationTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/EMFCommandOperationTest.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFCommandOperationTest.java >--- src/org/eclipse/emf/workspace/tests/EMFCommandOperationTest.java 7 Jun 2007 14:26:03 -0000 1.3 >+++ src/org/eclipse/emf/workspace/tests/EMFCommandOperationTest.java 14 Nov 2007 13:11:48 -0000 >@@ -167,7 +167,7 @@ > > assertEquals("New Library", newLibrary.getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary.getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary.getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary.getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > >@@ -198,7 +198,7 @@ > assertTrue(root.getBranches().contains(newLibrary)); > assertEquals("New Library", newLibrary.getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary.getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary.getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary.getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > } >@@ -237,7 +237,7 @@ > > // the book is created by the first trigger > assertEquals(1, newLibrary.getBooks().size()); >- Book book = (Book) newLibrary.getBooks().get(0); >+ Book book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > > // the publication date is created by the cascaded trigger >@@ -271,7 +271,7 @@ > // verify that the changes were redone > assertTrue(root.getBranches().contains(newLibrary)); > assertEquals(1, newLibrary.getBooks().size()); >- book = (Book) newLibrary.getBooks().get(0); >+ book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > assertNotNull(book.getPublicationDate()); > >@@ -298,6 +298,7 @@ > IUndoContext ctx = new TestUndoContext(); > > Command cmd = new RecordingCommand(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -368,6 +369,7 @@ > > // add a new library. Our triggers will set a default name and book > Command cmd = new RecordingCommand(domain) { >+ @Override > protected void doExecute() { > root.getBranches().add(newLibrary); > }}; >@@ -385,7 +387,7 @@ > > assertEquals("New Library", newLibrary.getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary.getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary.getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary.getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > >@@ -416,7 +418,7 @@ > assertTrue(root.getBranches().contains(newLibrary)); > assertEquals("New Library", newLibrary.getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary.getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary.getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary.getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > } >@@ -489,6 +491,7 @@ > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -509,12 +512,14 @@ > public void test_nonredoableTriggerCommand_138287() { > // add a trigger command that is not redoable > domain.addResourceSetListener(new TriggerListener() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new TestCommand.Redoable() { > public void execute() { > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >Index: src/org/eclipse/emf/workspace/tests/TestsPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/TestsPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 TestsPlugin.java >--- src/org/eclipse/emf/workspace/tests/TestsPlugin.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/TestsPlugin.java 14 Nov 2007 13:11:48 -0000 >@@ -27,12 +27,14 @@ > public class TestsPlugin extends Plugin { > public static TestsPlugin instance; > >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > > instance = this; > } > >+ @Override > public void stop(BundleContext context) throws Exception { > instance = null; > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:34 -0000 1.9 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:11:48 -0000 >@@ -8,11 +8,11 @@ > Require-Bundle: org.junit;bundle-version="[3.8.1,4.0.0)", > org.eclipse.emf.workspace;bundle-version="1.2.0", > org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.emf.examples.library;bundle-version="[2.2.0,3.0.0)" >+ org.eclipse.emf.examples.library;bundle-version="[2.3.0,3.0.0)" > Export-Package: org.eclipse.emf.workspace.tests, > org.eclipse.emf.workspace.tests.constraints, > org.eclipse.emf.workspace.tests.fixtures, > org.eclipse.emf.workspace.util.tests > Eclipse-LazyStart: true > Bundle-Activator: org.eclipse.emf.workspace.tests.TestsPlugin >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: src/org/eclipse/emf/workspace/tests/fixtures/TestCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/TestCommand.java,v >retrieving revision 1.2 >diff -u -r1.2 TestCommand.java >--- src/org/eclipse/emf/workspace/tests/fixtures/TestCommand.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/TestCommand.java 14 Nov 2007 13:11:48 -0000 >@@ -29,10 +29,12 @@ > public abstract class TestCommand > extends AbstractCommand { > >+ @Override > protected boolean prepare() { > return true; > } > >+ @Override > public void undo() { > // do nothing > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/TestListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/TestListener.java,v >retrieving revision 1.2 >diff -u -r1.2 TestListener.java >--- src/org/eclipse/emf/workspace/tests/fixtures/TestListener.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/TestListener.java 14 Nov 2007 13:11:48 -0000 >@@ -43,6 +43,7 @@ > super(filter); > } > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) > throws RollbackException { > >@@ -51,6 +52,7 @@ > return null; > } > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > postcommit = event; > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultNameTrigger.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultNameTrigger.java,v >retrieving revision 1.4 >diff -u -r1.4 LibraryDefaultNameTrigger.java >--- src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultNameTrigger.java 7 Jun 2007 14:26:03 -0000 1.4 >+++ src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultNameTrigger.java 14 Nov 2007 13:11:48 -0000 >@@ -45,6 +45,7 @@ > this.isAggregate = isAggregate; > } > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >@@ -60,6 +61,7 @@ > return result; > } > >+ @Override > public boolean isAggregatePrecommitListener() { > return isAggregate; > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/NonEMFCompositeOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/NonEMFCompositeOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 NonEMFCompositeOperation.java >--- src/org/eclipse/emf/workspace/tests/fixtures/NonEMFCompositeOperation.java 7 Jun 2007 14:26:02 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/NonEMFCompositeOperation.java 14 Nov 2007 13:11:48 -0000 >@@ -16,7 +16,6 @@ > */ > package org.eclipse.emf.workspace.tests.fixtures; > >-import java.util.Iterator; > import java.util.List; > import java.util.ListIterator; > >@@ -40,23 +39,22 @@ > extends AbstractOperation > implements ICompositeOperation { > >- private List children = new java.util.ArrayList(); >+ private final List<IUndoableOperation> children = new java.util.ArrayList<IUndoableOperation>(); > > public NonEMFCompositeOperation() { > super("Non-EMF Composite"); //$NON-NLS-1$ > } > > // Documentation copied from the inherited specification >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > monitor.beginTask(getLabel(), children.size()); > > try { >- for (Iterator iter = children.iterator(); iter.hasNext();) { >- ((IUndoableOperation) iter.next()).execute( >- new SubProgressMonitor(monitor, 1), >- info); >+ for (IUndoableOperation next : children) { >+ next.execute(new SubProgressMonitor(monitor, 1), info); > } > } finally { > monitor.done(); >@@ -66,16 +64,15 @@ > } > > // Documentation copied from the inherited specification >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > monitor.beginTask(getLabel(), children.size()); > > try { >- for (Iterator iter = children.iterator(); iter.hasNext();) { >- ((IUndoableOperation) iter.next()).redo( >- new SubProgressMonitor(monitor, 1), >- info); >+ for (IUndoableOperation next : children) { >+ next.redo(new SubProgressMonitor(monitor, 1), info); > } > } finally { > monitor.done(); >@@ -85,16 +82,16 @@ > } > > // Documentation copied from the inherited specification >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > monitor.beginTask(getLabel(), children.size()); > > try { >- for (ListIterator iter = children.listIterator(children.size()); iter.hasPrevious();) { >- ((IUndoableOperation) iter.previous()).undo( >- new SubProgressMonitor(monitor, 1), >- info); >+ for (ListIterator<IUndoableOperation> iter = children.listIterator(children.size()); >+ iter.hasPrevious();) { >+ iter.previous().undo(new SubProgressMonitor(monitor, 1), info); > } > } finally { > monitor.done(); >Index: src/org/eclipse/emf/workspace/tests/fixtures/NullCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/NullCommand.java,v >retrieving revision 1.2 >diff -u -r1.2 NullCommand.java >--- src/org/eclipse/emf/workspace/tests/fixtures/NullCommand.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/NullCommand.java 14 Nov 2007 13:11:48 -0000 >@@ -25,6 +25,7 @@ > */ > public class NullCommand extends AbstractCommand { > >+ @Override > protected boolean prepare() { > return true; > } >@@ -35,6 +36,7 @@ > } > > /** Does nothing. */ >+ @Override > public void undo() { > // nothing to do > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/SelfOpeningEMFCompositeOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/SelfOpeningEMFCompositeOperation.java,v >retrieving revision 1.1 >diff -u -r1.1 SelfOpeningEMFCompositeOperation.java >--- src/org/eclipse/emf/workspace/tests/fixtures/SelfOpeningEMFCompositeOperation.java 3 Oct 2007 20:16:31 -0000 1.1 >+++ src/org/eclipse/emf/workspace/tests/fixtures/SelfOpeningEMFCompositeOperation.java 14 Nov 2007 13:11:48 -0000 >@@ -16,7 +16,6 @@ > */ > package org.eclipse.emf.workspace.tests.fixtures; > >-import java.util.Iterator; > import java.util.List; > import java.util.Set; > >@@ -44,13 +43,14 @@ > extends AbstractEMFOperation > implements ICompositeOperation { > >- private List children = new java.util.ArrayList(); >+ private final List<IUndoableOperation> children = new java.util.ArrayList<IUndoableOperation>(); > > public SelfOpeningEMFCompositeOperation(TransactionalEditingDomain domain) { > super(domain, "EMF Composite"); //$NON-NLS-1$ > } > >- protected final IStatus doExecute(IProgressMonitor monitor, IAdaptable info) >+ @Override >+ protected final IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > > IStatus result; >@@ -110,7 +110,7 @@ > * > * @return my children > */ >- public List getChildren() { >+ public List<IUndoableOperation> getChildren() { > return children; > } > >@@ -120,12 +120,12 @@ > removeContext(current[i]); > } > >- Set newContexts = new java.util.HashSet(); >- for (Iterator iter = children.iterator(); iter.hasNext();) { >- IUndoContext[] next = ((IUndoableOperation) iter.next()).getContexts(); >- for (int i = 0; i < next.length; i++) { >- if (!newContexts.add(next[i])) { >- addContext(next[i]); >+ Set<IUndoContext> newContexts = new java.util.HashSet<IUndoContext>(); >+ for (IUndoableOperation child : children) { >+ IUndoContext[] next = child.getContexts(); >+ for (IUndoContext ctx : next) { >+ if (!newContexts.add(ctx)) { >+ addContext(ctx); > } > } > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/ItemDefaultPublicationDateTrigger.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/ItemDefaultPublicationDateTrigger.java,v >retrieving revision 1.3 >diff -u -r1.3 ItemDefaultPublicationDateTrigger.java >--- src/org/eclipse/emf/workspace/tests/fixtures/ItemDefaultPublicationDateTrigger.java 7 Jun 2007 14:26:03 -0000 1.3 >+++ src/org/eclipse/emf/workspace/tests/fixtures/ItemDefaultPublicationDateTrigger.java 14 Nov 2007 13:11:48 -0000 >@@ -38,6 +38,7 @@ > Notification.ADD))); > } > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >Index: src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultBookTrigger.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultBookTrigger.java,v >retrieving revision 1.4 >diff -u -r1.4 LibraryDefaultBookTrigger.java >--- src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultBookTrigger.java 7 Jun 2007 14:26:02 -0000 1.4 >+++ src/org/eclipse/emf/workspace/tests/fixtures/LibraryDefaultBookTrigger.java 14 Nov 2007 13:11:48 -0000 >@@ -48,6 +48,7 @@ > this.isAggregate = isAggregate; > } > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >@@ -64,6 +65,7 @@ > return result; > } > >+ @Override > public boolean isAggregatePrecommitListener() { > return isAggregate; > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/NullOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/NullOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 NullOperation.java >--- src/org/eclipse/emf/workspace/tests/fixtures/NullOperation.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/NullOperation.java 14 Nov 2007 13:11:48 -0000 >@@ -53,31 +53,37 @@ > this.isRedoable = isRedoable; > } > >+ @Override > public boolean canExecute() { > return isExecutable; > } > >+ @Override > public boolean canUndo() { > return isUndoable; > } > >+ @Override > public boolean canRedo() { > return isRedoable; > } > > // Documentation copied from the inherited specification >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > return Status.OK_STATUS; > } > > // Documentation copied from the inherited specification >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > return Status.OK_STATUS; > } > > // Documentation copied from the inherited specification >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > return Status.OK_STATUS; >Index: src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 ExternalDataOperation.java >--- src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataOperation.java 7 Jun 2007 14:26:02 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataOperation.java 14 Nov 2007 13:11:48 -0000 >@@ -40,6 +40,7 @@ > this.newValue = newValue; > } > >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) { > // change the external (non-EMF) data > oldValue = externalData[0]; >@@ -48,12 +49,14 @@ > return Status.OK_STATUS; > } > >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) { > externalData[0] = oldValue; > > return Status.OK_STATUS; > } > >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) { > externalData[0] = newValue; > >Index: src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataCommand.java,v >retrieving revision 1.2 >diff -u -r1.2 ExternalDataCommand.java >--- src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataCommand.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/ExternalDataCommand.java 14 Nov 2007 13:11:48 -0000 >@@ -36,6 +36,7 @@ > this.newValue = newValue; > } > >+ @Override > protected boolean prepare() { > return true; > } >@@ -46,6 +47,7 @@ > externalData[0] = newValue; > } > >+ @Override > public void undo() { > externalData[0] = oldValue; > } >Index: src/org/eclipse/emf/workspace/tests/fixtures/LogCapture.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/LogCapture.java,v >retrieving revision 1.2 >diff -u -r1.2 LogCapture.java >--- src/org/eclipse/emf/workspace/tests/fixtures/LogCapture.java 10 Oct 2006 14:31:44 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/LogCapture.java 14 Nov 2007 13:11:48 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -18,7 +18,7 @@ > > import java.util.List; > >-import junit.framework.TestCase; >+import junit.framework.Assert; > > import org.eclipse.core.runtime.ILogListener; > import org.eclipse.core.runtime.IStatus; >@@ -46,7 +46,7 @@ > }}; > private final TransactionalCommandStack stack; > >- private final List logs = new java.util.ArrayList(); >+ private final List<IStatus> logs = new java.util.ArrayList<IStatus>(); > private IStatus lastLog; > > /** >@@ -123,7 +123,7 @@ > * > * @return a list (possibly empty) of {@link IStatus}es > */ >- public List getLogs() { >+ public List<IStatus> getLogs() { > return logs; > } > >@@ -134,9 +134,9 @@ > */ > public void assertLogged(Throwable throwable) { > IStatus log = getLastLog(); >- TestCase.assertNotNull(log); >+ Assert.assertNotNull(log); > log = findStatus(log, throwable); >- TestCase.assertNotNull(log); >+ Assert.assertNotNull(log); > } > > private void record(IStatus log) { >Index: src/org/eclipse/emf/workspace/tests/fixtures/TestOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/fixtures/TestOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 TestOperation.java >--- src/org/eclipse/emf/workspace/tests/fixtures/TestOperation.java 30 Jan 2006 19:47:57 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/fixtures/TestOperation.java 14 Nov 2007 13:11:48 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -38,10 +38,11 @@ > super(domain, "Testing"); //$NON-NLS-1$ > } > >- public TestOperation(TransactionalEditingDomain domain, Map options) { >+ public TestOperation(TransactionalEditingDomain domain, Map<?, ?> options) { > super(domain, "Testing", options); //$NON-NLS-1$ > } > >+ @Override > protected final IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > doExecute(); > >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:26:03 -0000 1.5 >+++ build.properties 14 Nov 2007 13:11:48 -0000 >@@ -20,5 +20,5 @@ > test_models/,\ > about.html > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:32 -0000 1.2 >+++ .classpath 14 Nov 2007 13:11:48 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: src/org/eclipse/emf/workspace/tests/constraints/BookTitleConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/tests/constraints/BookTitleConstraint.java,v >retrieving revision 1.2 >diff -u -r1.2 BookTitleConstraint.java >--- src/org/eclipse/emf/workspace/tests/constraints/BookTitleConstraint.java 7 Jun 2007 14:26:02 -0000 1.2 >+++ src/org/eclipse/emf/workspace/tests/constraints/BookTitleConstraint.java 14 Nov 2007 13:11:48 -0000 >@@ -30,6 +30,7 @@ > public class BookTitleConstraint > extends AbstractModelConstraint { > >+ @Override > public IStatus validate(IValidationContext ctx) { > EMFEventType eType = ctx.getEventType(); > >@@ -38,7 +39,7 @@ > > if (newValue == null > || ((String)newValue).length() == 0) { >- return ctx.createFailureStatus(null); >+ return ctx.createFailureStatus(); > } > } > >Index: src/org/eclipse/emf/workspace/util/tests/WorkspaceSynchronizerTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/util/tests/WorkspaceSynchronizerTest.java,v >retrieving revision 1.7 >diff -u -r1.7 WorkspaceSynchronizerTest.java >--- src/org/eclipse/emf/workspace/util/tests/WorkspaceSynchronizerTest.java 25 Oct 2007 04:00:13 -0000 1.7 >+++ src/org/eclipse/emf/workspace/util/tests/WorkspaceSynchronizerTest.java 14 Nov 2007 13:11:48 -0000 >@@ -188,6 +188,7 @@ > "moveDestination.extlibrary"); //$NON-NLS-1$ > > Job job = new WorkspaceJob("Modify Workspace") { //$NON-NLS-1$ >+ @Override > public IStatus runInWorkspace(IProgressMonitor monitor) > throws CoreException { > // make two copies >@@ -223,6 +224,7 @@ > // make the workspace changes in a single job so that all deltas > // are fired in one batch > job = new WorkspaceJob("Modify Workspace") { //$NON-NLS-1$ >+ @Override > public IStatus runInWorkspace(IProgressMonitor monitor) > throws CoreException { > // delete one file >@@ -531,6 +533,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -540,6 +543,7 @@ > synch = new WorkspaceSynchronizer(domain, delegate); > } > >+ @Override > protected void doTearDown() > throws Exception { > >@@ -563,6 +567,7 @@ > setSystem(true); > } > >+ @Override > protected IStatus run(IProgressMonitor monitor) { > synchronized (lock) { > lock.notify(); >@@ -589,9 +594,9 @@ > * @author Christian W. Damus (cdamus) > */ > static class TestDelegate implements WorkspaceSynchronizer.Delegate { >- final List deletedResources = new java.util.ArrayList(); >- final Map movedResources = new java.util.LinkedHashMap(); >- final List changedResources = new java.util.ArrayList(); >+ final List<Resource> deletedResources = new java.util.ArrayList<Resource>(); >+ final Map<Resource, URI> movedResources = new java.util.LinkedHashMap<Resource, URI>(); >+ final List<Resource> changedResources = new java.util.ArrayList<Resource>(); > > boolean defaultBehaviour = false; > >Index: src/org/eclipse/emf/workspace/util/tests/ValidateEditTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/util/tests/ValidateEditTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidateEditTest.java >--- src/org/eclipse/emf/workspace/util/tests/ValidateEditTest.java 3 Oct 2007 20:17:34 -0000 1.1 >+++ src/org/eclipse/emf/workspace/util/tests/ValidateEditTest.java 14 Nov 2007 13:11:48 -0000 >@@ -45,7 +45,7 @@ > > private Book book; > >- private Command cmd = new TestCommand() { >+ private final Command cmd = new TestCommand() { > public void execute() { > try { > book.setTitle(newTitle); >@@ -102,6 +102,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -118,6 +119,7 @@ > assertNotNull(book); > } > >+ @Override > protected void doTearDown() > throws Exception { > >@@ -138,7 +140,7 @@ > } > > void setValidateEdit() { >- TransactionalEditingDomain.DefaultOptions defaults = (TransactionalEditingDomain.DefaultOptions) TransactionUtil >+ TransactionalEditingDomain.DefaultOptions defaults = TransactionUtil > .getAdapter(domain, TransactionalEditingDomain.DefaultOptions.class); > > defaults.setDefaultTransactionOptions(Collections.singletonMap( >Index: src/org/eclipse/emf/workspace/util/tests/OperationChangeDescriptionTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/util/tests/OperationChangeDescriptionTest.java,v >retrieving revision 1.2 >diff -u -r1.2 OperationChangeDescriptionTest.java >--- src/org/eclipse/emf/workspace/util/tests/OperationChangeDescriptionTest.java 7 Jun 2007 14:26:03 -0000 1.2 >+++ src/org/eclipse/emf/workspace/util/tests/OperationChangeDescriptionTest.java 14 Nov 2007 13:11:48 -0000 >@@ -103,6 +103,7 @@ > // Fixture methods > // > >+ @Override > protected void setUp() > throws Exception { > >@@ -116,6 +117,7 @@ > assertEquals(newValue, externalData[0]); > } > >+ @Override > protected void tearDown() > throws Exception { > >Index: src/org/eclipse/emf/workspace/util/tests/AllTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/util/tests/AllTests.java,v >retrieving revision 1.3 >diff -u -r1.3 AllTests.java >--- src/org/eclipse/emf/workspace/util/tests/AllTests.java 3 Oct 2007 20:17:34 -0000 1.3 >+++ src/org/eclipse/emf/workspace/util/tests/AllTests.java 14 Nov 2007 13:11:48 -0000 >@@ -23,7 +23,8 @@ > import junit.framework.TestSuite; > import junit.textui.TestRunner; > >-import org.eclipse.core.runtime.IPlatformRunnable; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > > /** > * JUnit suite for the <code>org.eclipse.emf.workspace.util</code> package. >@@ -32,7 +33,7 @@ > */ > public class AllTests > extends TestCase >- implements IPlatformRunnable { >+ implements IApplication { > > public AllTests() { > super(""); //$NON-NLS-1$ >@@ -48,11 +49,15 @@ > return suite; > } > >- public Object run(Object args) >+ public Object start(IApplicationContext context) > throws Exception { > > TestRunner.run(suite()); > return Arrays > .asList(new String[] {"Please see raw test suite output for details."}); //$NON-NLS-1$ > } >+ >+ public void stop() { >+ // nothing to do >+ } > } >Index: src/org/eclipse/emf/workspace/util/tests/ResourceUndoContextTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/src/org/eclipse/emf/workspace/util/tests/ResourceUndoContextTest.java,v >retrieving revision 1.3 >diff -u -r1.3 ResourceUndoContextTest.java >--- src/org/eclipse/emf/workspace/util/tests/ResourceUndoContextTest.java 1 Feb 2006 23:12:10 -0000 1.3 >+++ src/org/eclipse/emf/workspace/util/tests/ResourceUndoContextTest.java 14 Nov 2007 13:11:48 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -34,8 +34,8 @@ > import org.eclipse.emf.examples.extlibrary.Book; > import org.eclipse.emf.examples.extlibrary.BookOnTape; > import org.eclipse.emf.examples.extlibrary.EXTLibraryFactory; >+import org.eclipse.emf.examples.extlibrary.Employee; > import org.eclipse.emf.examples.extlibrary.Library; >-import org.eclipse.emf.examples.extlibrary.Person; > import org.eclipse.emf.examples.extlibrary.Writer; > import org.eclipse.emf.transaction.TransactionalEditingDomain; > import org.eclipse.emf.workspace.ResourceUndoContext; >@@ -88,7 +88,7 @@ > > assertFalse(listener.notifications.isEmpty()); > >- Set affected = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources( > listener.notifications); > > assertEquals(Collections.singleton(res1), affected); >@@ -104,7 +104,7 @@ > BookOnTape book = EXTLibraryFactory.eINSTANCE.createBookOnTape(); > library.getStock().add(book); > >- Person person = EXTLibraryFactory.eINSTANCE.createEmployee(); >+ Employee person = EXTLibraryFactory.eINSTANCE.createEmployee(); > library.getEmployees().add(person); > > // forget the events so far >@@ -114,7 +114,7 @@ > > assertFalse(listener.notifications.isEmpty()); > >- Set affected = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources( > listener.notifications); > > assertEquals(Collections.singleton(res1), affected); >@@ -143,10 +143,10 @@ > > assertFalse(listener.notifications.isEmpty()); > >- Set affected = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources( > listener.notifications); > >- Set expected = new java.util.HashSet(); >+ Set<Resource> expected = new java.util.HashSet<Resource>(); > expected.add(res1); > expected.add(res2); > >@@ -166,7 +166,7 @@ > BookOnTape book = EXTLibraryFactory.eINSTANCE.createBookOnTape(); > library1.getStock().add(book); > >- Person person = EXTLibraryFactory.eINSTANCE.createEmployee(); >+ Employee person = EXTLibraryFactory.eINSTANCE.createEmployee(); > library2.getEmployees().add(person); > > // forget the events so far >@@ -176,10 +176,10 @@ > > assertFalse(listener.notifications.isEmpty()); > >- Set affected = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources( > listener.notifications); > >- Set expected = new java.util.HashSet(); >+ Set<Resource> expected = new java.util.HashSet<Resource>(); > expected.add(res1); > expected.add(res2); > >@@ -200,7 +200,7 @@ > BookOnTape book = EXTLibraryFactory.eINSTANCE.createBookOnTape(); > library1.getStock().add(book); > >- Person person = EXTLibraryFactory.eINSTANCE.createEmployee(); >+ Employee person = EXTLibraryFactory.eINSTANCE.createEmployee(); > library2.getEmployees().add(person); > > book.setReader(person); >@@ -213,10 +213,10 @@ > > assertFalse(listener.notifications.isEmpty()); > >- Set affected = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affected = ResourceUndoContext.getAffectedResources( > listener.notifications); > >- Set expected = new java.util.HashSet(); >+ Set<Resource> expected = new java.util.HashSet<Resource>(); > expected.add(res1); > expected.add(res2); > >@@ -228,6 +228,7 @@ > // Fixture methods > // > >+ @Override > protected void setUp() > throws Exception { > >@@ -252,6 +253,7 @@ > rset.eAdapters().add(listener); > } > >+ @Override > protected void tearDown() > throws Exception { > >@@ -277,8 +279,9 @@ > } > > private static class Listener extends EContentAdapter { >- final List notifications = new java.util.ArrayList(); >+ final List<Notification> notifications = new java.util.ArrayList<Notification>(); > >+ @Override > public void notifyChanged(Notification notification) { > notifications.add(notification); > >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.workspace.tests/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:32 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:11:48 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:54:28 EST 2006 >+#Sun Nov 11 17:39:35 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >#P org.eclipse.emf.workspace.examples >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples/META-INF/MANIFEST.MF,v >retrieving revision 1.7 >diff -u -r1.7 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:32 -0000 1.7 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:11:51 -0000 >@@ -6,4 +6,4 @@ > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:25:49 -0000 1.5 >+++ build.properties 14 Nov 2007 13:11:51 -0000 >@@ -20,5 +20,5 @@ > META-INF/,\ > modeling32.png > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >#P org.eclipse.emf.workspace.examples.library.editor >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:25:36 -0000 1.5 >+++ build.properties 14 Nov 2007 13:11:52 -0000 >@@ -20,5 +20,5 @@ > jars.compile.order = . > source.. = src/ > output.. = bin/ >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:47 -0000 1.2 >+++ .classpath 14 Nov 2007 13:11:52 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditor.java,v >retrieving revision 1.6 >diff -u -r1.6 EXTLibraryEditor.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditor.java 3 Oct 2007 20:17:42 -0000 1.6 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditor.java 14 Nov 2007 13:11:52 -0000 >@@ -1,5 +1,15 @@ > /** > * <copyright> >+ * >+ * Copyright (c) 2005, 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * > * </copyright> > * > * $Id: EXTLibraryEditor.java,v 1.6 2007/10/03 20:17:42 cdamus Exp $ >@@ -214,7 +224,8 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected Collection selectionChangedListeners = new ArrayList(); >+ protected Collection<ISelectionChangedListener> selectionChangedListeners = >+ new ArrayList<ISelectionChangedListener>(); > > /** > * This keeps track of the selection of the editor as a whole. >@@ -251,12 +262,16 @@ > } > } > public void partBroughtToTop(IWorkbenchPart p) { >+ // nothing to do > } > public void partClosed(IWorkbenchPart p) { >+ // nothing to do > } > public void partDeactivated(IWorkbenchPart p) { >+ // nothing to do > } > public void partOpened(IWorkbenchPart p) { >+ // nothing to do > } > }; > >@@ -264,32 +279,32 @@ > * Resources that have been removed since last activation. > * @generated > */ >- Collection removedResources = new ArrayList(); >+ Collection<Resource> removedResources = new ArrayList<Resource>(); > > /** > * Resources that have been changed since last activation. > * @generated > */ >- Collection changedResources = new ArrayList(); >+ Collection<Resource> changedResources = new ArrayList<Resource>(); > > /** > * Resources that have been moved since last activation. > * Maps {@link Resource resource} to {@link URI new URI} > */ >- Map movedResources = new HashMap(); >+ Map<Resource, URI> movedResources = new HashMap<Resource, URI>(); > > /** > * Resources that have been saved. > * @generated > */ >- Collection savedResources = new ArrayList(); >+ Collection<Resource> savedResources = new ArrayList<Resource>(); > > private boolean dirty; > >- private IOperationHistoryListener historyListener = new IOperationHistoryListener() { >+ private final IOperationHistoryListener historyListener = new IOperationHistoryListener() { > public void historyNotification(final OperationHistoryEvent event) { > if (event.getEventType() == OperationHistoryEvent.DONE) { >- Set affectedResources = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affectedResources = ResourceUndoContext.getAffectedResources( > event.getOperation()); > > if (affectedResources.contains(getResource())) { >@@ -362,7 +377,7 @@ > getOperationHistory().dispose(undoContext, true, true, true); > > // change saved resource's URI and remove from map >- res.setURI((URI) movedResources.remove(res)); >+ res.setURI(movedResources.remove(res)); > > // must change my editor input > IEditorInput newInput = new FileEditorInput( >@@ -467,7 +482,7 @@ > protected void handleMovedResource() { > if (!isDirty() || handleDirtyConflict()) { > Resource res = getResource(); >- URI newURI = (URI) movedResources.get(res); >+ URI newURI = movedResources.get(res); > > if (newURI != null) { > if (res.isLoaded()) { >@@ -504,7 +519,7 @@ > > // Create an adapter factory that yields item providers. > // >- List factories = new ArrayList(); >+ List<AdapterFactory> factories = new ArrayList<AdapterFactory>(); > factories.add(new ResourceItemProviderAdapterFactory()); > factories.add(new EXTLibraryItemProviderAdapterFactory()); > factories.add(new ReflectiveItemProviderAdapterFactory()); >@@ -527,6 +542,7 @@ > * > * @generated > */ >+ @Override > protected void firePropertyChange(int action) { > super.firePropertyChange(action); > } >@@ -537,8 +553,8 @@ > * > * @generated > */ >- public void setSelectionToViewer(Collection collection) { >- final Collection theSelection = collection; >+ public void setSelectionToViewer(Collection<?> collection) { >+ final Collection<?> theSelection = collection; > // Make sure it's okay. > // > if (theSelection != null && !theSelection.isEmpty()) { >@@ -582,21 +598,25 @@ > super((TransactionalEditingDomain) getEditingDomain(), adapterFactory); > } > >+ @Override > public Object [] getElements(Object object) { > Object parent = super.getParent(object); > return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); > } > >+ @Override > public Object [] getChildren(Object object) { > Object parent = super.getParent(object); > return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); > } > >+ @Override > public boolean hasChildren(Object object) { > Object parent = super.getParent(object); > return parent != null; > } > >+ @Override > public Object getParent(Object object) { > return null; > } >@@ -718,6 +738,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public void createPartControl(Composite parent) { > // Creates the model from the editor input > // >@@ -743,6 +764,8 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override >+ @SuppressWarnings("unchecked") > public Object getAdapter(Class key) { > if (key.equals(IContentOutlinePage.class)) { > return getContentOutlinePage(); >@@ -772,6 +795,7 @@ > // The content outline is just a tree. > // > class MyContentOutlinePage extends ContentOutlinePage { >+ @Override > public void createControl(Composite parent) { > super.createControl(parent); > contentOutlineViewer = getTreeViewer(); >@@ -796,17 +820,19 @@ > if (!editingDomain.getResourceSet().getResources().isEmpty()) { > // Select the root object in the view. > // >- ArrayList selection = new ArrayList(); >+ ArrayList<Object> selection = new ArrayList<Object>(); > selection.add(getResource()); > contentOutlineViewer.setSelection(new StructuredSelection(selection), true); > } > } > >+ @Override > public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { > super.makeContributions(menuManager, toolBarManager, statusLineManager); > contentOutlineStatusLineManager = statusLineManager; > } > >+ @Override > public void setActionBars(IActionBars actionBars) { > super.setActionBars(actionBars); > getActionBarContributor().shareGlobalActions(this, actionBars); >@@ -839,11 +865,13 @@ > if (propertySheetPage == null) { > propertySheetPage = > new ExtendedPropertySheetPage(editingDomain) { >- public void setSelectionToViewer(List selection) { >+ @Override >+ public void setSelectionToViewer(List<?> selection) { > EXTLibraryEditor.this.setSelectionToViewer(selection); > EXTLibraryEditor.this.setFocus(); > } > >+ @Override > public void setActionBars(IActionBars actionBars) { > super.setActionBars(actionBars); > getActionBarContributor().shareGlobalActions(this, actionBars); >@@ -862,13 +890,13 @@ > */ > public void handleContentOutlineSelection(ISelection selection) { > if (!selection.isEmpty() && selection instanceof IStructuredSelection) { >- Iterator selectedElements = ((IStructuredSelection)selection).iterator(); >+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator(); > if (selectedElements.hasNext()) { > // Get the first selected element. > // > Object selectedElement = selectedElements.next(); > >- ArrayList selectionList = new ArrayList(); >+ ArrayList<Object> selectionList = new ArrayList<Object>(); > selectionList.add(selectedElement); > while (selectedElements.hasNext()) { > selectionList.add(selectedElements.next()); >@@ -886,6 +914,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > public boolean isDirty() { > return dirty; > } >@@ -895,6 +924,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > public void doSave(IProgressMonitor progressMonitor) { > // Do the work within an operation because this is a long running activity > // that modifies the workbench. Moreover, we must do this in a read-only >@@ -904,6 +934,7 @@ > new WorkspaceModifyOperation() { > // This is the method that gets invoked when the operation runs. > // >+ @Override > public void execute(IProgressMonitor monitor) { > try { > ((TransactionalEditingDomain) getEditingDomain()).runExclusive(new Runnable() { >@@ -949,6 +980,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public boolean isSaveAsAllowed() { > return true; > } >@@ -959,6 +991,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public void doSaveAs() { > SaveAsDialog saveAsDialog= new SaveAsDialog(getSite().getShell()); > saveAsDialog.open(); >@@ -1038,6 +1071,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > public void init(IEditorSite site, IEditorInput editorInput) { > setSite(site); > setInputWithNotify(editorInput); >@@ -1054,6 +1088,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > public void setFocus() { > selectionViewer.getControl().setFocus(); > } >@@ -1098,8 +1133,7 @@ > public void setSelection(ISelection selection) { > editorSelection = selection; > >- for (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); ) { >- ISelectionChangedListener listener = (ISelectionChangedListener)listeners.next(); >+ for (ISelectionChangedListener listener : selectionChangedListeners) { > listener.selectionChanged(new SelectionChangedEvent(this, selection)); > } > setStatusLineManager(selection); >@@ -1116,7 +1150,7 @@ > > if (statusLineManager != null) { > if (selection instanceof IStructuredSelection) { >- Collection collection = ((IStructuredSelection)selection).toList(); >+ Collection<?> collection = ((IStructuredSelection)selection).toList(); > switch (collection.size()) { > case 0: { > statusLineManager.setMessage(getString("_UI_NoObjectSelected")); //$NON-NLS-1$ >@@ -1204,6 +1238,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > public void dispose() { > workspaceSynchronizer.dispose(); > getOperationHistory().removeOperationHistoryListener(historyListener); >Index: src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditorPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditorPlugin.java,v >retrieving revision 1.1 >diff -u -r1.1 EXTLibraryEditorPlugin.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditorPlugin.java 30 Jan 2006 16:30:09 -0000 1.1 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryEditorPlugin.java 14 Nov 2007 13:11:52 -0000 >@@ -1,5 +1,15 @@ > /** > * <copyright> >+ * >+ * Copyright (c) 2005, 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * > * </copyright> > * > * $Id: EXTLibraryEditorPlugin.java,v 1.1 2006/01/30 16:30:09 cdamus Exp $ >@@ -7,9 +17,7 @@ > package org.eclipse.emf.workspace.examples.extlibrary.presentation; > > import org.eclipse.emf.common.EMFPlugin; >- > import org.eclipse.emf.common.ui.EclipseUIPlugin; >- > import org.eclipse.emf.common.util.ResourceLocator; > > /** >@@ -54,6 +62,7 @@ > * @return the singleton instance. > * @generated > */ >+ @Override > public ResourceLocator getPluginResourceLocator() { > return plugin; > } >Index: src/org/eclipse/emf/workspace/examples/extlibrary/presentation/ResourceLoadedListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/presentation/ResourceLoadedListener.java,v >retrieving revision 1.3 >diff -u -r1.3 ResourceLoadedListener.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/presentation/ResourceLoadedListener.java 7 Jun 2007 14:25:36 -0000 1.3 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/presentation/ResourceLoadedListener.java 14 Nov 2007 13:11:52 -0000 >@@ -46,7 +46,7 @@ > public class ResourceLoadedListener extends DemultiplexingListener { > private static ResourceLoadedListener instance; > >- private final Set ignoredResources = new java.util.HashSet(); >+ private final Set<Resource> ignoredResources = new java.util.HashSet<Resource>(); > > /** > * Initializes me with my filter. >@@ -87,6 +87,7 @@ > ignoredResources.remove(res); > } > >+ @Override > protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > if (ignoredResources.contains(notification.getNotifier())) { > // skip any resource that we are supposed to ignore >Index: src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryActionBarContributor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryActionBarContributor.java,v >retrieving revision 1.2 >diff -u -r1.2 EXTLibraryActionBarContributor.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryActionBarContributor.java 22 Feb 2006 15:17:44 -0000 1.2 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/presentation/EXTLibraryActionBarContributor.java 14 Nov 2007 13:11:52 -0000 >@@ -1,5 +1,15 @@ > /** > * <copyright> >+ * >+ * Copyright (c) 2005, 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * > * </copyright> > * > * $Id: EXTLibraryActionBarContributor.java,v 1.2 2006/02/22 15:17:44 cmcgee Exp $ >@@ -8,7 +18,6 @@ > > import java.util.ArrayList; > import java.util.Collection; >-import java.util.Iterator; > > import org.eclipse.emf.common.ui.viewer.IViewerProvider; > import org.eclipse.emf.edit.domain.EditingDomain; >@@ -84,6 +93,7 @@ > protected IAction showPropertiesViewAction = > new Action(EXTLibraryEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) //$NON-NLS-1$ > { >+ @Override > public void run() { > try { > getPage().showView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$ >@@ -104,10 +114,12 @@ > protected IAction refreshViewerAction = > new Action(EXTLibraryEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) //$NON-NLS-1$ > { >+ @Override > public boolean isEnabled() { > return activeEditorPart instanceof IViewerProvider; > } > >+ @Override > public void run() { > if (activeEditorPart instanceof IViewerProvider) { > Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer(); >@@ -127,7 +139,7 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected Collection createChildActions; >+ protected Collection<IAction> createChildActions; > > /** > * This is the menu manager into which menu contribution items should be added for CreateChild actions. >@@ -144,7 +156,7 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected Collection createSiblingActions; >+ protected Collection<IAction> createSiblingActions; > > /** > * This is the menu manager into which menu contribution items should be added for CreateSibling actions. >@@ -165,6 +177,7 @@ > validateAction = new ValidateAction(); > } > >+ @Override > public void init(IActionBars actionBars) { > super.init(actionBars); > >@@ -186,6 +199,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public void contributeToToolBar(IToolBarManager toolBarManager) { > toolBarManager.add(new Separator("extlibrary-settings")); //$NON-NLS-1$ > toolBarManager.add(new Separator("extlibrary-additions")); //$NON-NLS-1$ >@@ -197,6 +211,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > public void contributeToMenu(IMenuManager menuManager) { > super.contributeToMenu(menuManager); > >@@ -235,6 +250,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public void setActiveEditor(IEditorPart part) { > super.setActiveEditor(part); > activeEditorPart = part; >@@ -259,12 +275,14 @@ > } > } > >+ @Override > public void activate() { > longRunningReadAction.setActiveWorkbenchPart(activeEditor); > > super.activate(); > } > >+ @Override > public void deactivate() { > longRunningReadAction.setActiveWorkbenchPart(null); > >@@ -291,8 +309,8 @@ > > // Query the new selection for appropriate new child/sibling descriptors > // >- Collection newChildDescriptors = null; >- Collection newSiblingDescriptors = null; >+ Collection<?> newChildDescriptors = null; >+ Collection<?> newSiblingDescriptors = null; > > ISelection selection = event.getSelection(); > if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) { >@@ -326,11 +344,11 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { >- Collection actions = new ArrayList(); >+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) { >+ Collection<IAction> actions = new ArrayList<IAction>(); > if (descriptors != null) { >- for (Iterator i = descriptors.iterator(); i.hasNext(); ) { >- actions.add(new CreateChildAction(activeEditorPart, selection, i.next())); >+ for (Object next : descriptors) { >+ actions.add(new CreateChildAction(activeEditorPart, selection, next)); > } > } > return actions; >@@ -343,11 +361,11 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { >- Collection actions = new ArrayList(); >+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) { >+ Collection<IAction> actions = new ArrayList<IAction>(); > if (descriptors != null) { >- for (Iterator i = descriptors.iterator(); i.hasNext(); ) { >- actions.add(new CreateSiblingAction(activeEditorPart, selection, i.next())); >+ for (Object next : descriptors) { >+ actions.add(new CreateSiblingAction(activeEditorPart, selection, next)); > } > } > return actions; >@@ -362,10 +380,11 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { >+ protected void populateManager(IContributionManager manager, >+ Collection<? extends IAction> actions, String contributionID) { >+ > if (actions != null) { >- for (Iterator i = actions.iterator(); i.hasNext(); ) { >- IAction action = (IAction)i.next(); >+ for (IAction action : actions) { > if (contributionID != null) { > manager.insertBefore(contributionID, action); > } >@@ -383,7 +402,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected void depopulateManager(IContributionManager manager, Collection actions) { >+ protected void depopulateManager(IContributionManager manager, >+ Collection<? extends IAction> actions) { >+ > if (actions != null) { > IContributionItem[] items = manager.getItems(); > for (int i = 0; i < items.length; i++) { >@@ -412,6 +433,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public void menuAboutToShow(IMenuManager menuManager) { > super.menuAboutToShow(menuManager); > MenuManager submenuManager = null; >@@ -430,6 +452,7 @@ > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >+ @Override > protected void addGlobalActions(IMenuManager menuManager) { > menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$ > menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$ >@@ -450,6 +473,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > protected boolean removeAllReferencesOnDelete() { > return true; > } >Index: src/org/eclipse/emf/workspace/examples/extlibrary/domain/EXTLibraryEditingDomainFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/domain/EXTLibraryEditingDomainFactory.java,v >retrieving revision 1.4 >diff -u -r1.4 EXTLibraryEditingDomainFactory.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/domain/EXTLibraryEditingDomainFactory.java 3 Oct 2007 20:17:42 -0000 1.4 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/domain/EXTLibraryEditingDomainFactory.java 14 Nov 2007 13:11:52 -0000 >@@ -20,6 +20,7 @@ > import java.util.Map; > > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalCommandStack; >@@ -50,15 +51,16 @@ > ((TransactionalCommandStack) result.getCommandStack()).setExceptionHandler( > new CommandStackExceptionHandler()); > >- DefaultOptions defaults = (DefaultOptions) TransactionUtil.getAdapter( >+ DefaultOptions defaults = TransactionUtil.getAdapter( > result, DefaultOptions.class); > if (defaults != null) { >- Map options = new java.util.HashMap(); >+ Map<Object, Object> options = new java.util.HashMap<Object, Object>(); > > options.put(Transaction.OPTION_VALIDATE_EDIT, > new WorkspaceValidateEditSupport() { >- protected IStatus doValidateEdit(Transaction transaction, >- Collection resources, Object context) { >+ @Override >+ protected IStatus doValidateEdit(Transaction transaction, >+ Collection<? extends Resource> resources, Object context) { > if ((context == null) && (Display.getCurrent() != null)) { > // get the active shell for the context > // when validating on the UI thread >Index: src/org/eclipse/emf/workspace/examples/extlibrary/console/ConsoleUtil.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/console/ConsoleUtil.java,v >retrieving revision 1.2 >diff -u -r1.2 ConsoleUtil.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/console/ConsoleUtil.java 7 Jun 2007 14:25:36 -0000 1.2 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/console/ConsoleUtil.java 14 Nov 2007 13:11:52 -0000 >@@ -42,10 +42,12 @@ > public class ConsoleUtil { > > /** cache for console name to actual console object mapping*/ >- private static Map nameToConsole = new HashMap(); >+ private static Map<String, MessageConsole> nameToConsole = >+ new HashMap<String, MessageConsole>(); > > /** cache for 'console name' to 'stream for that console' mapping */ >- private static Map nameToStream = new HashMap(); >+ private static Map<String, MessageConsoleStream> nameToStream = >+ new HashMap<String, MessageConsoleStream>(); > > /** > * Registers the console with the Eclipse Console Manager. >@@ -64,7 +66,7 @@ > nameToConsole.put(name, console ); > } > >- return (MessageConsole) nameToConsole.get( name); >+ return nameToConsole.get( name); > } > > >@@ -75,7 +77,8 @@ > */ > public synchronized static void unregisterConsole(String name){ > if(nameToConsole.containsKey( name)){ >- ConsolePlugin.getDefault().getConsoleManager().removeConsoles( new IConsole[]{(IConsole)nameToConsole.get(name)}); >+ ConsolePlugin.getDefault().getConsoleManager().removeConsoles( >+ new IConsole[]{nameToConsole.get(name)}); > nameToConsole.remove( name); > } > } >@@ -97,7 +100,7 @@ > > } > >- return (MessageConsoleStream) nameToStream.get(name); >+ return nameToStream.get(name); > > } > >Index: src/org/eclipse/emf/workspace/examples/extlibrary/actions/LongRunningReadAction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/src/org/eclipse/emf/workspace/examples/extlibrary/actions/LongRunningReadAction.java,v >retrieving revision 1.3 >diff -u -r1.3 LongRunningReadAction.java >--- src/org/eclipse/emf/workspace/examples/extlibrary/actions/LongRunningReadAction.java 7 Jun 2007 14:25:36 -0000 1.3 >+++ src/org/eclipse/emf/workspace/examples/extlibrary/actions/LongRunningReadAction.java 14 Nov 2007 13:11:52 -0000 >@@ -23,6 +23,7 @@ > import org.eclipse.emf.edit.domain.IEditingDomainProvider; > import org.eclipse.emf.transaction.RunnableWithResult; > import org.eclipse.emf.transaction.TransactionalEditingDomain; >+import org.eclipse.emf.transaction.util.TransactionUtil; > import org.eclipse.emf.workspace.examples.extlibrary.console.ConsoleUtil; > import org.eclipse.emf.workspace.examples.extlibrary.internal.l10n.Messages; > import org.eclipse.jface.action.Action; >@@ -50,6 +51,7 @@ > super(Messages.readJob_title); > } > >+ @Override > public void run() { > if (domain != null) { > ConsoleUtil.showConsole(CONSOLE); >@@ -92,10 +94,11 @@ > setPriority(Job.LONG); > } > >+ @Override > protected IStatus run(final IProgressMonitor monitor) { > try { >- return (IStatus) domain.runExclusive( >- new RunnableWithResult.Impl() { >+ return TransactionUtil.runExclusive(domain, >+ new RunnableWithResult.Impl<IStatus>() { > public void run() { > setResult(longRunningRead(monitor)); > }}); >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/META-INF/MANIFEST.MF,v >retrieving revision 1.8 >diff -u -r1.8 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:42 -0000 1.8 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:11:52 -0000 >@@ -13,13 +13,13 @@ > org.eclipse.emf.workspace.examples.extlibrary.presentation > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)";visibility:=reexport, >- org.eclipse.emf.examples.library.edit;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, >- org.eclipse.emf.ecore.xmi;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, >- org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, >+ org.eclipse.emf.examples.library.edit;bundle-version="[2.3.0,3.0.0)";visibility:=reexport, >+ org.eclipse.emf.ecore.xmi;bundle-version="[2.3.0,3.0.0)";visibility:=reexport, >+ org.eclipse.emf.edit.ui;bundle-version="[2.3.0,3.0.0)";visibility:=reexport, > org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)";visibility:=reexport, >- org.eclipse.emf.workspace;bundle-version="[1.0.0,2.0.0)", >- org.eclipse.emf.transaction.ui;bundle-version="[1.0.0,2.0.0)", >- org.eclipse.emf.workspace.ui;bundle-version="[1.0.0,2.0.0)", >+ org.eclipse.emf.workspace;bundle-version="[1.2.0,2.0.0)", >+ org.eclipse.emf.transaction.ui;bundle-version="[1.2.0,2.0.0)", >+ org.eclipse.emf.workspace.ui;bundle-version="[1.2.0,2.0.0)", > org.eclipse.ui.console;bundle-version="[3.1.100,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.workspace.examples.library.editor/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:46 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:11:52 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:53:52 EST 2006 >+#Sun Nov 11 17:20:41 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >#P org.eclipse.emf.workspace.doc >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/doc/org.eclipse.emf.workspace.doc/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:52 -0000 1.2 >+++ .classpath 14 Nov 2007 13:11:56 -0000 >@@ -1,6 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/doc/org.eclipse.emf.workspace.doc/META-INF/MANIFEST.MF,v >retrieving revision 1.8 >diff -u -r1.8 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:46 -0000 1.8 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:11:56 -0000 >@@ -7,4 +7,4 @@ > Bundle-Localization: plugin > Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/doc/org.eclipse.emf.workspace.doc/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:52 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:11:56 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:52:13 EST 2006 >+#Sun Nov 11 17:03:45 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >#P org.eclipse.emf.transaction >Index: src/org/eclipse/emf/transaction/impl/TransactionalCommandStackImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/TransactionalCommandStackImpl.java,v >retrieving revision 1.8 >diff -u -r1.8 TransactionalCommandStackImpl.java >--- src/org/eclipse/emf/transaction/impl/TransactionalCommandStackImpl.java 28 Feb 2007 21:53:38 -0000 1.8 >+++ src/org/eclipse/emf/transaction/impl/TransactionalCommandStackImpl.java 14 Nov 2007 13:11:58 -0000 >@@ -54,7 +54,8 @@ > * > * @since 1.1 > */ >- protected void doExecute(Command command, Map options) throws InterruptedException, RollbackException { >+ @Override >+ protected void doExecute(Command command, Map<?, ?> options) throws InterruptedException, RollbackException { > InternalTransaction tx = createTransaction(command, options); > > try { >@@ -98,13 +99,14 @@ > * > * @since 1.1 > */ >- protected void handleRollback(Command command, RollbackException rbe) { >+ @Override >+ protected void handleRollback(Command command, RollbackException rbe) { > if ((command != null) && (top >= 0) && (commandList.get(top) == command)) { > // pop the failed command > commandList.remove(top--); > > if (top >= 0) { >- mostRecentCommand = (Command) commandList.get(top); >+ mostRecentCommand = commandList.get(top); > } else { > mostRecentCommand = null; > } >@@ -118,6 +120,7 @@ > * an undo transaction (a read/write transaction with the > * {@link #getUndoRedoOptions() undo/redo options}). > */ >+ @Override > public void undo() { > if (canUndo()) { > try { >@@ -138,6 +141,7 @@ > * Extends the inherited implementation to consider the redoability of > * {@link ConditionalRedoCommand}s. > */ >+ @Override > public boolean canRedo() { > boolean result = super.canRedo(); > >@@ -158,6 +162,7 @@ > * of a redo transaction (a read/write transaction with the > * {@link #getUndoRedoOptions() undo/redo options}). > */ >+ @Override > public void redo() { > if (canRedo()) { > try { >@@ -175,7 +180,9 @@ > } > > // Documentation copied from the inherited specification >- public EMFCommandTransaction createTransaction(Command command, Map options) throws InterruptedException { >+ public EMFCommandTransaction createTransaction(Command command, Map<?, ?> options) >+ throws InterruptedException { >+ > EMFCommandTransaction result; > > if (command instanceof TriggerCommand) { >@@ -191,7 +198,9 @@ > } > > // Documentation copied from the inherited specification >- public void executeTriggers(Command command, List triggers, Map options) throws InterruptedException, RollbackException { >+ public void executeTriggers(Command command, List<Command> triggers, >+ Map<?, ?> options) throws InterruptedException, RollbackException { >+ > if (!triggers.isEmpty()) { > TriggerCommand trigger = (command == null) > ? new TriggerCommand(triggers) >Index: src/org/eclipse/emf/transaction/impl/FilterManager.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/FilterManager.java,v >retrieving revision 1.4 >diff -u -r1.4 FilterManager.java >--- src/org/eclipse/emf/transaction/impl/FilterManager.java 7 Jun 2007 14:25:59 -0000 1.4 >+++ src/org/eclipse/emf/transaction/impl/FilterManager.java 14 Nov 2007 13:11:58 -0000 >@@ -18,7 +18,6 @@ > > import java.util.ArrayList; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.emf.common.notify.Notification; >@@ -70,8 +69,9 @@ > * > * @see #selectUnbatched(List, NotificationFilter) > */ >- public List select(List notifications, NotificationFilter filter, ArrayList cache) { >- List result; >+ public List<Notification> select(List<Notification> notifications, >+ NotificationFilter filter, ArrayList<Notification> cache) { >+ List<Notification> result; > > if (filter == NotificationFilter.ANY) { > result = notifications; >@@ -84,9 +84,7 @@ > filter = NotificationFilter.NOT_TOUCH; > } > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > if (filter.matches(next)) { > result.add(next); > } >@@ -111,8 +109,9 @@ > * > * @see #selectUnbatched(List, NotificationFilter) > */ >- public List select(List notifications, NotificationFilter filter) { >- return select(notifications, filter, new ArrayList()); >+ public List<Notification> select(List<Notification> notifications, >+ NotificationFilter filter) { >+ return select(notifications, filter, new ArrayList<Notification>()); > } > > /** >@@ -132,18 +131,20 @@ > * > * @see #select(List, NotificationFilter) > */ >- public List selectUnbatched(List notification, NotificationFilter filter) { >- List result; >+ public List<Notification> selectUnbatched(List<Notification> notification, >+ NotificationFilter filter) { >+ >+ List<Notification> result; > > if (filter == null) { > // the default filter > filter = NotificationFilter.NOT_TOUCH; > } > >- if (filter.matches((Notification) notification.get(0))) { >+ if (filter.matches(notification.get(0))) { > result = notification; > } else { >- result = Collections.EMPTY_LIST; >+ result = Collections.emptyList(); > } > > return result; >Index: src/org/eclipse/emf/transaction/impl/PrivilegedRunnable.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/PrivilegedRunnable.java,v >retrieving revision 1.2 >diff -u -r1.2 PrivilegedRunnable.java >--- src/org/eclipse/emf/transaction/impl/PrivilegedRunnable.java 15 Jun 2006 13:33:32 -0000 1.2 >+++ src/org/eclipse/emf/transaction/impl/PrivilegedRunnable.java 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -26,10 +26,12 @@ > /** > * Implementation of the privileged runnable, which allows a thread to lend > * its transaction to another cooperating thread for synchronous execution. >- * >+ * >+ * @param <T> the result type of the runnable >+ * > * @author Christian W. Damus (cdamus) > */ >-public final class PrivilegedRunnable extends RunnableWithResult.Impl { >+public final class PrivilegedRunnable<T> extends RunnableWithResult.Impl<T> { > private final InternalTransaction transaction; > private final Runnable delegate; > private final Thread owner; >@@ -70,8 +72,9 @@ > * Runs my delegate in the context of the transaction that I share. > */ > public void run() { >- final RunnableWithResult rwr = (delegate instanceof RunnableWithResult)? >- (RunnableWithResult) delegate : null; >+ @SuppressWarnings("unchecked") >+ final RunnableWithResult<T> rwr = (delegate instanceof RunnableWithResult)? >+ (RunnableWithResult<T>) delegate : null; > > boolean needPrivilege = transaction.getOwner() != Thread.currentThread(); > if (needPrivilege) { >Index: src/org/eclipse/emf/transaction/impl/AbstractTransactionalCommandStack.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/AbstractTransactionalCommandStack.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractTransactionalCommandStack.java >--- src/org/eclipse/emf/transaction/impl/AbstractTransactionalCommandStack.java 24 May 2007 23:23:53 -0000 1.4 >+++ src/org/eclipse/emf/transaction/impl/AbstractTransactionalCommandStack.java 14 Nov 2007 13:11:58 -0000 >@@ -95,7 +95,8 @@ > * transaction (if any) and passing the exception along to > * the registered exception handler (if any). > */ >- protected void handleError(Exception exception) { >+ @Override >+ protected void handleError(Exception exception) { > InternalTransaction active = getDomain().getActiveTransaction(); > > if ((active != null) && active.isActive()) { >@@ -156,7 +157,7 @@ > * command is rolled back. Note that <code>doExecute()</code> is only > * called if the command is {@linkplain Command#canExecute() executable}. > */ >- public void execute(Command command, Map options) >+ public void execute(Command command, Map<?, ?> options) > throws InterruptedException, RollbackException { > > if ((command != null) && command.canExecute()) { >@@ -184,7 +185,7 @@ > * waiting to start the transaction > * @throws RollbackException if the execution of the command is rolled back > */ >- protected abstract void doExecute(Command command, Map options) >+ protected abstract void doExecute(Command command, Map<?, ?> options) > throws InterruptedException, RollbackException; > > /** >@@ -212,7 +213,8 @@ > * checked exception thrown by that method is handled by > * {@link #handleError(Exception)} but is not propagated. > */ >- public void execute(Command command) { >+ @Override >+ public void execute(Command command) { > try { > execute(command, null); > } catch (InterruptedException e) { >@@ -244,7 +246,7 @@ > * > * @return my editing domain's transaction options for undo/redo > */ >- protected Map getUndoRedoOptions() { >+ protected Map<?, ?> getUndoRedoOptions() { > return domain.getUndoRedoOptions(); > } > >@@ -255,16 +257,16 @@ > * @param options a client-supplied options map > * @return a derived map of options suitable for trigger transactions > */ >- public static final Map makeTriggerTransactionOptions(Map options) { >- Map result; >+ public static final Map<Object, Object> makeTriggerTransactionOptions(Map<?, ?> options) { >+ Map<Object, Object> result; > > if ((options == null) || options.isEmpty()) { >- result = Collections.singletonMap( >- TransactionImpl.OPTION_IS_TRIGGER_TRANSACTION, Boolean.TRUE); >+ result = Collections.<Object, Object>singletonMap( >+ TransactionImpl.OPTION_IS_TRIGGER_TRANSACTION, true); > } else { >- result = new java.util.HashMap(options); >+ result = new java.util.HashMap<Object, Object>(options); > result.put( >- TransactionImpl.OPTION_IS_TRIGGER_TRANSACTION, Boolean.TRUE); >+ TransactionImpl.OPTION_IS_TRIGGER_TRANSACTION, true); > } > > return result; >Index: src/org/eclipse/emf/transaction/impl/TransactionalEditingDomainImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/TransactionalEditingDomainImpl.java,v >retrieving revision 1.15 >diff -u -r1.15 TransactionalEditingDomainImpl.java >--- src/org/eclipse/emf/transaction/impl/TransactionalEditingDomainImpl.java 31 Oct 2007 19:59:58 -0000 1.15 >+++ src/org/eclipse/emf/transaction/impl/TransactionalEditingDomainImpl.java 14 Nov 2007 13:11:58 -0000 >@@ -32,6 +32,7 @@ > import org.eclipse.emf.common.notify.AdapterFactory; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.impl.AdapterImpl; >+import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; >@@ -52,6 +53,7 @@ > import org.eclipse.emf.transaction.internal.l10n.Messages; > import org.eclipse.emf.transaction.util.Adaptable; > import org.eclipse.emf.transaction.util.Lock; >+import org.eclipse.emf.transaction.util.TransactionUtil; > import org.eclipse.osgi.util.NLS; > > /** >@@ -80,24 +82,29 @@ > > private TransactionValidator.Factory validatorFactory = null; > >- private final Map defaultTransactionOptions = new java.util.HashMap(); >- private final Map defaultTransactionOptionsRO = Collections >+ private final Map<Object, Object> defaultTransactionOptions = >+ new java.util.HashMap<Object, Object>(); >+ private final Map<Object, Object> defaultTransactionOptionsRO = Collections > .unmodifiableMap(defaultTransactionOptions); > >- private Lock transactionLock = new Lock(); >- private Lock writeLock = new Lock(); >+ private final Lock transactionLock = new Lock(); >+ private final Lock writeLock = new Lock(); > >- private final List precommitListeners = new java.util.ArrayList(); >- private final List aggregatePrecommitListeners = new java.util.ArrayList(); >- private final List postcommitListeners = new java.util.ArrayList(); >+ private final List<ResourceSetListener> precommitListeners = >+ new java.util.ArrayList<ResourceSetListener>(); >+ private final List<ResourceSetListener> aggregatePrecommitListeners = >+ new java.util.ArrayList<ResourceSetListener>(); >+ private final List<ResourceSetListener> postcommitListeners = >+ new java.util.ArrayList<ResourceSetListener>(); > > // reusable notification list and event for unbatched change events >- private final List unbatchedNotifications = new java.util.ArrayList(1); >+ private final List<Notification> unbatchedNotifications = >+ new java.util.ArrayList<Notification>(1); > private final ResourceSetChangeEvent unbatchedChangeEvent = > new ResourceSetChangeEvent(this, null, unbatchedNotifications); > > // this is editable by clients for backwards compatibility with 1.1 >- private Map undoRedoOptions = new java.util.HashMap( >+ private final Map<Object, Object> undoRedoOptions = new java.util.HashMap<Object, Object>( > TransactionImpl.DEFAULT_UNDO_REDO_OPTIONS); > > /** >@@ -157,7 +164,7 @@ > > // create a map for read-only-resource support. Use a weak map > // to avoid retaining resources in this map >- resourceToReadOnlyMap = new java.util.WeakHashMap(); >+ resourceToReadOnlyMap = new java.util.WeakHashMap<Resource, Boolean>(); > } > > /** >@@ -275,8 +282,8 @@ > tx = startTransaction(true, null); > } > >- final RunnableWithResult rwr = (read instanceof RunnableWithResult)? >- (RunnableWithResult) read : null; >+ final RunnableWithResult<?> rwr = (read instanceof RunnableWithResult)? >+ (RunnableWithResult<?>) read : null; > > try { > read.run(); >@@ -369,7 +376,9 @@ > } > > // Documentation copied from the inherited specification >- public InternalTransaction startTransaction(boolean readOnly, Map options) throws InterruptedException { >+ public InternalTransaction startTransaction(boolean readOnly, Map<?, ?> options) >+ throws InterruptedException { >+ > InternalTransaction result; > > result = new TransactionImpl(this, readOnly, options); >@@ -412,7 +421,7 @@ > */ > protected final ResourceSetListener[] getPrecommitListeners() { > synchronized (precommitListeners) { >- return (ResourceSetListener[]) precommitListeners.toArray( >+ return precommitListeners.toArray( > new ResourceSetListener[precommitListeners.size()]); > } > } >@@ -426,7 +435,7 @@ > */ > protected final ResourceSetListener[] getAggregatePrecommitListeners() { > synchronized (aggregatePrecommitListeners) { >- return (ResourceSetListener[]) aggregatePrecommitListeners.toArray( >+ return aggregatePrecommitListeners.toArray( > new ResourceSetListener[aggregatePrecommitListeners.size()]); > } > } >@@ -439,7 +448,7 @@ > */ > protected final ResourceSetListener[] getPostcommitListeners() { > synchronized (postcommitListeners) { >- return (ResourceSetListener[]) postcommitListeners.toArray( >+ return postcommitListeners.toArray( > new ResourceSetListener[postcommitListeners.size()]); > } > } >@@ -561,20 +570,24 @@ > > // Documentation copied from the inherited specification > public void precommit(final InternalTransaction tx) throws RollbackException { >- class PrecommitRunnable implements Runnable { >- private final List notifications; >+ class PrecommitRunnable extends RunnableWithResult.Impl<List<Command>> { >+ private final List<Notification> notifications; > private final ResourceSetListener[] listeners; >- private final List triggers = new java.util.ArrayList(); > private RollbackException rollback; > >- PrecommitRunnable(ResourceSetListener[] listeners, List notifications) { >+ PrecommitRunnable(ResourceSetListener[] listeners, >+ List<Notification> notifications) { >+ > this.listeners = listeners; > this.notifications = notifications; > } > >- void runExclusive() throws InterruptedException { >+ List<Command> runExclusive() throws InterruptedException { > if ((listeners.length > 0) && !notifications.isEmpty()) { >- TransactionalEditingDomainImpl.this.runExclusive(this); >+ return TransactionUtil.runExclusive( >+ TransactionalEditingDomainImpl.this, this); >+ } else { >+ return Collections.emptyList(); > } > } > >@@ -582,21 +595,22 @@ > return rollback; > } > >- List getTriggers() { >- return triggers; >- } >- > public void run() { >- ArrayList cache = new ArrayList(notifications.size()); >- for (int i = 0; i < listeners.length; i++) { >+ List<Command> triggers = new java.util.ArrayList<Command>(); >+ setResult(triggers); >+ >+ ArrayList<Notification> cache = new ArrayList<Notification>( >+ notifications.size()); >+ >+ for (ResourceSetListener element : listeners) { > try { >- List filtered = FilterManager.getInstance().select( >+ List<Notification> filtered = FilterManager.getInstance().select( > notifications, >- listeners[i].getFilter(), >+ element.getFilter(), > cache); > > if (!filtered.isEmpty()) { >- Command cmd = listeners[i].transactionAboutToCommit( >+ Command cmd = element.transactionAboutToCommit( > new ResourceSetChangeEvent( > TransactionalEditingDomainImpl.this, > tx, >@@ -640,7 +654,7 @@ > // are no more notifications to send to them > while (runnable != null) { > try { >- runnable.runExclusive(); >+ List<Command> triggers = runnable.runExclusive(); > > if (runnable.getRollback() != null) { > Tracing.throwing(TransactionalEditingDomainImpl.class, >@@ -655,10 +669,13 @@ > command = null; > } > >- getTransactionalCommandStack().executeTriggers( >- command, runnable.getTriggers(), tx.getOptions()); >+ if (!triggers.isEmpty()) { >+ getTransactionalCommandStack().executeTriggers( >+ command, triggers, tx.getOptions()); >+ } > >- List notifications = validator.getNotificationsForPrecommit(tx); >+ List<Notification> notifications = validator.getNotificationsForPrecommit( >+ tx); > > if ((notifications == null) || notifications.isEmpty()) { > runnable = null; >@@ -697,11 +714,13 @@ > Tracing.trace(">>> Postcommitting " + getDebugID(tx) + " at " + Tracing.now()); //$NON-NLS-1$ //$NON-NLS-2$ > } > >- final List notifications = validator.getNotificationsForPostcommit(tx); >+ final List<Notification> notifications = validator.getNotificationsForPostcommit( >+ tx); > if ((notifications == null) || notifications.isEmpty()) { > return; > } >- final ArrayList cache = new ArrayList(notifications.size()); >+ final ArrayList<Notification> cache = new ArrayList<Notification>( >+ notifications.size()); > > // dispose the validator now because starting the read-only transaction > // below will replace it with a new validator >@@ -712,15 +731,15 @@ > try { > runExclusive(new Runnable() { > public void run() { >- for (int i = 0; i < listeners.length; i++) { >+ for (ResourceSetListener element : listeners) { > try { >- List filtered = FilterManager.getInstance().select( >+ List<Notification> filtered = FilterManager.getInstance().select( > notifications, >- listeners[i].getFilter(), >+ element.getFilter(), > cache); > > if (!filtered.isEmpty()) { >- listeners[i].resourceSetChanged( >+ element.resourceSetChanged( > new ResourceSetChangeEvent( > TransactionalEditingDomainImpl.this, > tx, >@@ -759,14 +778,14 @@ > try { > runExclusive(new Runnable() { > public void run() { >- for (int i = 0; i < listeners.length; i++) { >+ for (ResourceSetListener element : listeners) { > try { >- List filtered = FilterManager.getInstance().selectUnbatched( >+ List<Notification> filtered = FilterManager.getInstance().selectUnbatched( > unbatchedNotifications, >- listeners[i].getFilter()); >+ element.getFilter()); > > if (!filtered.isEmpty()) { >- listeners[i].resourceSetChanged(unbatchedChangeEvent); >+ element.resourceSetChanged(unbatchedChangeEvent); > } > } catch (Exception e) { > Tracing.catching(TransactionalEditingDomainImpl.class, "broadcastUnbatched", e); //$NON-NLS-1$ >@@ -796,7 +815,7 @@ > } > > // Documentation copied from the inherited specification >- public final RunnableWithResult createPrivilegedRunnable(Runnable runnable) { >+ public final RunnableWithResult<Object> createPrivilegedRunnable(Runnable runnable) { > InternalTransaction tx = getActiveTransaction(); > > if ((tx == null) || (tx.getOwner() != Thread.currentThread())) { >@@ -804,11 +823,11 @@ > "active transaction not owned by caller"); //$NON-NLS-1$ > } > >- return new PrivilegedRunnable(tx, runnable); >+ return new PrivilegedRunnable<Object>(tx, runnable); > } > > // Documentation copied from the inherited specification >- public void startPrivileged(PrivilegedRunnable runnable) { >+ public void startPrivileged(PrivilegedRunnable<?> runnable) { > if (runnable.getTransaction().getEditingDomain() != this) { > throw new IllegalArgumentException( > "runnable has no privileges on this editing domain"); //$NON-NLS-1$ >@@ -822,7 +841,7 @@ > } > > // Documentation copied from the inherited specification >- public void endPrivileged(PrivilegedRunnable runnable) { >+ public void endPrivileged(PrivilegedRunnable<?> runnable) { > if (runnable.getTransaction().getEditingDomain() != this) { > throw new IllegalArgumentException( > "runnable has no privileges on this editing domain"); //$NON-NLS-1$ >@@ -853,6 +872,89 @@ > // disconnect the resource set from the editing domain > ((FactoryImpl) Factory.INSTANCE).unmapResourceSet(this); > } >+ >+ public Map<Object, Object> getUndoRedoOptions() { >+ return undoRedoOptions; >+ } >+ >+ @SuppressWarnings("unchecked") >+ public <T> T getAdapter(Class<? extends T> adapterType) { >+ T result; >+ >+ if (adapterType == DefaultOptions.class) { >+ result = (T) this; >+ } else { >+ result = null; >+ } >+ >+ return result; >+ } >+ >+ public Map<?, ?> getDefaultTransactionOptions() { >+ return defaultTransactionOptionsRO; // return the read-only view >+ } >+ >+ public void setDefaultTransactionOptions(Map<?, ?> options) { >+ synchronized (defaultTransactionOptions) { >+ defaultTransactionOptions.clear(); >+ defaultTransactionOptions.putAll(options); >+ } >+ } >+ >+ /** >+ * Sets the factory to use when creating validators for transaction >+ * validation. >+ * >+ * @since 1.1 >+ * >+ * @param validatorFactory the factory to set >+ */ >+ public void setValidatorFactory(TransactionValidator.Factory validatorFactory) { >+ this.validatorFactory = validatorFactory; >+ } >+ >+ /** >+ * Obtains the factory that this transactional editing domain uses >+ * to create validators for transaction validation. >+ * <p> >+ * If the validator factory has yet to be initialized, it is initialized >+ * using the default validator factory. >+ * </p> >+ * >+ * @since 1.1 >+ * >+ * @return the requested validator factory >+ */ >+ public TransactionValidator.Factory getValidatorFactory() { >+ if (this.validatorFactory == null) { >+ return TransactionValidator.Factory.INSTANCE; >+ } >+ >+ return this.validatorFactory; >+ } >+ >+ /** >+ * Default implementation of the validator factory >+ * >+ * @since 1.1 >+ * >+ * @author David Cummings (dcummin) >+ */ >+ public static class ValidatorFactoryImpl implements TransactionValidator.Factory { >+ /** >+ * {@inheritDoc} >+ */ >+ public TransactionValidator createReadOnlyValidator() { >+ return new ReadOnlyValidatorImpl(); >+ } >+ >+ /** >+ * {@inheritDoc} >+ */ >+ public TransactionValidator createReadWriteValidator() { >+ return new ReadWriteValidatorImpl(); >+ } >+ } > > /** > * Default implementation of a transaction editing domain factory. This >@@ -926,8 +1028,10 @@ > * @param domain the editing domain to remove from the resource set mapping > */ > public synchronized void unmapResourceSet(TransactionalEditingDomain domain) { >- for (Iterator iter = domain.getResourceSet().eAdapters().iterator(); iter.hasNext();) { >- Adapter next = (Adapter) iter.next(); >+ for (Iterator<Adapter> iter = domain.getResourceSet().eAdapters().iterator(); >+ iter.hasNext();) { >+ >+ Adapter next = iter.next(); > > if (next.isAdapterForType(ResourceSetDomainLink.class)) { > iter.remove(); >@@ -944,19 +1048,22 @@ > * > * @author Christian W. Damus (cdamus) > */ >- private static class ResourceSetDomainLink extends AdapterImpl implements IEditingDomainProvider { >- private final Reference domain; >+ private static class ResourceSetDomainLink extends AdapterImpl >+ implements IEditingDomainProvider { >+ >+ private final Reference<TransactionalEditingDomain> domain; > > ResourceSetDomainLink(TransactionalEditingDomain domain) { >- this.domain = new WeakReference(domain); >+ this.domain = new WeakReference<TransactionalEditingDomain>(domain); > } > >+ @Override > public boolean isAdapterForType(Object type) { > return type == ResourceSetDomainLink.class; > } > > final TransactionalEditingDomain getDomain() { >- TransactionalEditingDomain result = (TransactionalEditingDomain) domain.get(); >+ TransactionalEditingDomain result = domain.get(); > > if (result == null) { > // no longer need the adapter >@@ -981,11 +1088,12 @@ > * @author Christian W. Damus (cdamus) > */ > public final static class RegistryImpl implements TransactionalEditingDomain.Registry { >- private final Map domains = new java.util.HashMap(); >+ private final Map<String, TransactionalEditingDomain> domains = >+ new java.util.HashMap<String, TransactionalEditingDomain>(); > > // Documentation copied from the inherited specification > public synchronized TransactionalEditingDomain getEditingDomain(String id) { >- TransactionalEditingDomain result = (TransactionalEditingDomain) domains.get(id); >+ TransactionalEditingDomain result = domains.get(id); > > if (result == null) { > result = EditingDomainManager.getInstance().createEditingDomain(id); >@@ -1034,7 +1142,7 @@ > throw exc; > } > >- TransactionalEditingDomain result = (TransactionalEditingDomain) domains.remove(id); >+ TransactionalEditingDomain result = domains.remove(id); > > if (result != null) { > EditingDomainManager.getInstance().deconfigureListeners(id, result); >@@ -1044,84 +1152,4 @@ > } > > } >- >- public Map getUndoRedoOptions() { >- return undoRedoOptions; >- } >- >- public Object getAdapter(Class adapterType) { >- Object result; >- >- if (adapterType == DefaultOptions.class) { >- result = this; >- } else { >- result = null; >- } >- >- return result; >- } >- >- public Map getDefaultTransactionOptions() { >- return defaultTransactionOptionsRO; // return the read-only view >- } >- >- public void setDefaultTransactionOptions(Map options) { >- defaultTransactionOptions.clear(); >- defaultTransactionOptions.putAll(options); >- } >- >- /** >- * Sets the factory to use when creating validators for transaction >- * validation. >- * >- * @since 1.1 >- * >- * @param validatorFactory the factory to set >- */ >- public void setValidatorFactory(TransactionValidator.Factory validatorFactory) { >- this.validatorFactory = validatorFactory; >- } >- >- /** >- * Obtains the factory that this transactional editing domain uses >- * to create validators for transaction validation. >- * <p> >- * If the validator factory has yet to be initialized, it is initialized >- * using the default validator factory. >- * </p> >- * >- * @since 1.1 >- * >- * @return the requested validator factory >- */ >- public TransactionValidator.Factory getValidatorFactory() { >- if (this.validatorFactory == null) { >- return TransactionValidator.Factory.INSTANCE; >- } >- >- return this.validatorFactory; >- } >- >- /** >- * Default implementation of the validator factory >- * >- * @since 1.1 >- * >- * @author David Cummings (dcummin) >- */ >- public static class ValidatorFactoryImpl implements TransactionValidator.Factory { >- /** >- * {@inheritDoc} >- */ >- public TransactionValidator createReadOnlyValidator() { >- return new ReadOnlyValidatorImpl(); >- } >- >- /** >- * {@inheritDoc} >- */ >- public TransactionValidator createReadWriteValidator() { >- return new ReadWriteValidatorImpl(); >- } >- } > } >Index: src/org/eclipse/emf/transaction/impl/TransactionValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/TransactionValidator.java,v >retrieving revision 1.3 >diff -u -r1.3 TransactionValidator.java >--- src/org/eclipse/emf/transaction/impl/TransactionValidator.java 22 Mar 2007 19:11:49 -0000 1.3 >+++ src/org/eclipse/emf/transaction/impl/TransactionValidator.java 14 Nov 2007 13:11:58 -0000 >@@ -21,6 +21,7 @@ > > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.transaction.RollbackException; > import org.eclipse.emf.transaction.Transaction; > >@@ -57,18 +58,18 @@ > } > > // Documentation copied from the inherited specification >- public List getNotificationsForValidation(Transaction tx) { >- return Collections.EMPTY_LIST; >+ public List<Notification> getNotificationsForValidation(Transaction tx) { >+ return Collections.emptyList(); > } > > // Documentation copied from the inherited specification >- public List getNotificationsForPrecommit(Transaction tx) { >- return Collections.EMPTY_LIST; >+ public List<Notification> getNotificationsForPrecommit(Transaction tx) { >+ return Collections.emptyList(); > } > > // Documentation copied from the inherited specification >- public List getNotificationsForPostcommit(Transaction tx) { >- return Collections.EMPTY_LIST; >+ public List<Notification> getNotificationsForPostcommit(Transaction tx) { >+ return Collections.emptyList(); > } > > // Documentation copied from the inherited specification >@@ -124,7 +125,7 @@ > * @return the transaction's notifications, or <code>null</code> if the > * transaction has not started yet > */ >- List getNotificationsForValidation(Transaction tx); >+ List<Notification> getNotificationsForValidation(Transaction tx); > > /** > * Obtains the notifications that I need to broadcast in a pre-commit >@@ -136,7 +137,7 @@ > * @return those of the transaction's notifications that are eligible to > * be broadcast, or <code>null</code> if the transaction has not started > */ >- List getNotificationsForPrecommit(Transaction tx); >+ List<Notification> getNotificationsForPrecommit(Transaction tx); > > /** > * Obtains the notifications that I need to broadcast in a post-commit >@@ -148,7 +149,7 @@ > * @return those of the transaction's notifications that are eligible to > * be broadcast, or <code>null</code> if the transaction has not started > */ >- List getNotificationsForPostcommit(Transaction tx); >+ List<Notification> getNotificationsForPostcommit(Transaction tx); > > /** > * Disposes me by clearing my state and cleaning up any resources that I >Index: src/org/eclipse/emf/transaction/impl/InternalTransaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/InternalTransaction.java,v >retrieving revision 1.5 >diff -u -r1.5 InternalTransaction.java >--- src/org/eclipse/emf/transaction/impl/InternalTransaction.java 7 Jun 2007 14:25:59 -0000 1.5 >+++ src/org/eclipse/emf/transaction/impl/InternalTransaction.java 14 Nov 2007 13:11:58 -0000 >@@ -99,7 +99,7 @@ > * > * @see #add(Notification) > */ >- List getNotifications(); >+ List<Notification> getNotifications(); > > /** > * Pauses me while a child transaction is active, so that I do not collect >@@ -157,7 +157,7 @@ > * > * @param runnable the runnable whose thread is to borrow me > */ >- void startPrivileged(PrivilegedRunnable runnable); >+ void startPrivileged(PrivilegedRunnable<?> runnable); > > /** > * Returns me to my previous owner, upon completion of the specified >@@ -165,5 +165,5 @@ > * > * @param runnable the runnable whose thread had borrowed me > */ >- void endPrivileged(PrivilegedRunnable runnable); >+ void endPrivileged(PrivilegedRunnable<?> runnable); > } >Index: src/org/eclipse/emf/transaction/impl/TransactionImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/TransactionImpl.java,v >retrieving revision 1.18 >diff -u -r1.18 TransactionImpl.java >--- src/org/eclipse/emf/transaction/impl/TransactionImpl.java 31 Oct 2007 19:59:58 -0000 1.18 >+++ src/org/eclipse/emf/transaction/impl/TransactionImpl.java 14 Nov 2007 13:11:58 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.transaction.impl; > > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > >@@ -86,13 +85,13 @@ > * As of the 1.2 release, this map is immutable. > * </p> > */ >- public static final Map DEFAULT_UNDO_REDO_OPTIONS; >+ public static final Map<Object, Object> DEFAULT_UNDO_REDO_OPTIONS; > static { >- Map map = new java.util.HashMap(); >- map.put(Transaction.OPTION_NO_TRIGGERS, Boolean.TRUE); >- map.put(Transaction.OPTION_NO_UNDO, Boolean.TRUE); >- map.put(Transaction.OPTION_NO_VALIDATION, Boolean.TRUE); >- map.put(Transaction.OPTION_IS_UNDO_REDO_TRANSACTION, Boolean.TRUE); >+ Map<Object, Object> map = new java.util.HashMap<Object, Object>(); >+ map.put(Transaction.OPTION_NO_TRIGGERS, true); >+ map.put(Transaction.OPTION_NO_UNDO, true); >+ map.put(Transaction.OPTION_NO_VALIDATION, true); >+ map.put(Transaction.OPTION_IS_UNDO_REDO_TRANSACTION, true); > DEFAULT_UNDO_REDO_OPTIONS = Collections.unmodifiableMap(map); > } > >@@ -103,8 +102,8 @@ > private final TransactionalEditingDomain domain; > private Thread owner; > private final boolean readOnly; >- private final Map options; >- private final Map mutableOptions; >+ private final Map<Object, Object> options; >+ private final Map<Object, Object> mutableOptions; > > private InternalTransaction parent; > private InternalTransaction root; >@@ -112,7 +111,7 @@ > private boolean active; > private boolean closing; // prevents re-entrant commit/rollback > private boolean rollingBack; >- protected List notifications; >+ protected List<Notification> notifications; > protected final CompositeChangeDescription change; > > private boolean aborted; >@@ -140,12 +139,13 @@ > * if I am read/write > * @param options my options, or <code>null</code> for defaults > */ >- public TransactionImpl(TransactionalEditingDomain domain, boolean readOnly, Map options) { >+ public TransactionImpl(TransactionalEditingDomain domain, boolean readOnly, >+ Map<?, ?> options) { > this.domain = domain; > this.readOnly = readOnly; > this.owner = Thread.currentThread(); > >- this.mutableOptions = new java.util.HashMap(); >+ this.mutableOptions = new java.util.HashMap<Object, Object>(); > this.options = Collections.unmodifiableMap(mutableOptions); > > if (options != null) { >@@ -159,7 +159,7 @@ > change = new CompositeChangeDescription(); > > if (collectsNotifications(this)) { >- notifications = new org.eclipse.emf.common.util.BasicEList.FastCompare(); >+ notifications = new org.eclipse.emf.common.util.BasicEList.FastCompare<Notification>(); > } else { > // no need to collect any notifications if we won't use them > notifications = null; >@@ -265,7 +265,7 @@ > } > > // Documentation copied from the inherited specification >- public final Map getOptions() { >+ public final Map<Object, Object> getOptions() { > return options; > } > >@@ -628,8 +628,8 @@ > // my changes except for certain special cases where we must > // prevent the passing of our changes. > >- if (getOptions().get(BLOCK_CHANGE_PROPAGATION) == Boolean.TRUE >- && parent.getOptions().get(ALLOW_CHANGE_PROPAGATION_BLOCKING) == Boolean.TRUE) { >+ if (hasOption(this, BLOCK_CHANGE_PROPAGATION) >+ && hasOption(parent, ALLOW_CHANGE_PROPAGATION_BLOCKING)) { > parent.resume(null); > } else { > parent.resume(change); >@@ -653,8 +653,9 @@ > } > > // Documentation copied from the inherited specification >- public List getNotifications() { >- return (notifications == null)? Collections.EMPTY_LIST : notifications; >+ public List<Notification> getNotifications() { >+ return (notifications == null)? Collections.<Notification>emptyList() >+ : notifications; > } > > /** >@@ -679,7 +680,7 @@ > // Documentation copied from the inherited specification > public void addTriggers(TriggerCommand triggers) { > // extract out only the triggered commands (exclude the triggering command) >- List triggerCommands = triggers.getTriggers(); >+ List<Command> triggerCommands = triggers.getTriggers(); > Command triggerCommand; > > if (triggerCommands.isEmpty()) { >@@ -689,7 +690,7 @@ > // bug 165026: Must copy the list, because it may be read-only like > // GMF's NOOP_TRIGGER command > triggerCommand = new ConditionalRedoCommand.Compound( >- new java.util.ArrayList(triggerCommands)); >+ new java.util.ArrayList<Command>(triggerCommands)); > > if (this.triggers == null) { > this.triggers = triggerCommand; >@@ -703,7 +704,7 @@ > } > > // Documentation copied from the inherited specification >- public void startPrivileged(PrivilegedRunnable runnable) { >+ public void startPrivileged(PrivilegedRunnable<?> runnable) { > if (runnable.getTransaction() != this) { > throw new IllegalArgumentException( > "runnable has no privileges on this transaction"); //$NON-NLS-1$ >@@ -723,7 +724,7 @@ > } > > // Documentation copied from the inherited specification >- public void endPrivileged(PrivilegedRunnable runnable) { >+ public void endPrivileged(PrivilegedRunnable<?> runnable) { > if (runnable.getTransaction() != this) { > throw new IllegalArgumentException( > "runnable has no privileges on this transaction"); //$NON-NLS-1$ >@@ -746,12 +747,11 @@ > > // if we have no parent transaction, then we are a root and we "inherit" > // the editing domain's default transaction options >- Map parentOptions = (parent == null) ? getDefaultOptions(getEditingDomain()) >- : parent.getOptions(); >+ Map<?, ?> parentOptions = (parent == null) ? >+ getDefaultOptions(getEditingDomain()) : parent.getOptions(); > > if (parentOptions != null) { >- for (Iterator iter = parentOptions.entrySet().iterator(); iter.hasNext();) { >- Map.Entry next = (Map.Entry) iter.next(); >+ for (Map.Entry<?, ?> next : parentOptions.entrySet()) { > Object option = next.getKey(); > > if (ALLOW_CHANGE_PROPAGATION_BLOCKING.equals(option)) { >@@ -770,6 +770,7 @@ > } > } > >+ @Override > public String toString() { > return "Transaction[active=" + isActive() //$NON-NLS-1$ > + ", read-only=" + isReadOnly() //$NON-NLS-1$ >@@ -889,10 +890,13 @@ > * > * @since 1.2 > */ >- protected static Map getDefaultOptions(TransactionalEditingDomain domain) { >- TransactionalEditingDomain.DefaultOptions defaults = (TransactionalEditingDomain.DefaultOptions) TransactionUtil >+ protected static Map<?, ?> getDefaultOptions( >+ TransactionalEditingDomain domain) { >+ >+ TransactionalEditingDomain.DefaultOptions defaults = TransactionUtil > .getAdapter(domain, TransactionalEditingDomain.DefaultOptions.class); > >- return (defaults == null)? Collections.EMPTY_MAP : defaults.getDefaultTransactionOptions(); >+ return (defaults == null)? Collections.EMPTY_MAP >+ : defaults.getDefaultTransactionOptions(); > } > } >Index: src/org/eclipse/emf/transaction/impl/InternalTransactionalCommandStack.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/InternalTransactionalCommandStack.java,v >retrieving revision 1.2 >diff -u -r1.2 InternalTransactionalCommandStack.java >--- src/org/eclipse/emf/transaction/impl/InternalTransactionalCommandStack.java 7 Jun 2007 14:25:59 -0000 1.2 >+++ src/org/eclipse/emf/transaction/impl/InternalTransactionalCommandStack.java 14 Nov 2007 13:11:58 -0000 >@@ -65,7 +65,8 @@ > * > * @see #getDomain() > */ >- EMFCommandTransaction createTransaction(Command command, Map options) throws InterruptedException; >+ EMFCommandTransaction createTransaction(Command command, Map<?, ?> options) >+ throws InterruptedException; > > /** > * Executes the specified list of trigger commands. All of the commands are >@@ -86,7 +87,8 @@ > * @see ResourceSetListener#transactionAboutToCommit(org.eclipse.emf.transaction.ResourceSetChangeEvent) > * @see #createTransaction(Command, Map) > */ >- void executeTriggers(Command command, List triggers, Map options) throws InterruptedException, RollbackException; >+ void executeTriggers(Command command, List<Command> triggers, >+ Map<?, ?> options) throws InterruptedException, RollbackException; > > /** > * Disposes of my state and any additional resources that I may be >Index: src/org/eclipse/emf/transaction/impl/InternalTransactionalEditingDomain.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/InternalTransactionalEditingDomain.java,v >retrieving revision 1.5 >diff -u -r1.5 InternalTransactionalEditingDomain.java >--- src/org/eclipse/emf/transaction/impl/InternalTransactionalEditingDomain.java 7 Jun 2007 14:25:59 -0000 1.5 >+++ src/org/eclipse/emf/transaction/impl/InternalTransactionalEditingDomain.java 14 Nov 2007 13:11:58 -0000 >@@ -22,9 +22,9 @@ > import org.eclipse.emf.transaction.NotificationFilter; > import org.eclipse.emf.transaction.ResourceSetListener; > import org.eclipse.emf.transaction.RollbackException; >+import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalCommandStack; > import org.eclipse.emf.transaction.TransactionalEditingDomain; >-import org.eclipse.emf.transaction.Transaction; > > /** > * Internal interface that must be provided by any implementation of the public >@@ -54,7 +54,8 @@ > * > * @see #activate(InternalTransaction) > */ >- InternalTransaction startTransaction(boolean readOnly, Map options) throws InterruptedException; >+ InternalTransaction startTransaction(boolean readOnly, Map<?, ?> options) >+ throws InterruptedException; > > /** > * Obtains the transaction that currently has access to me, and whose >@@ -185,7 +186,7 @@ > * > * @return A map with undo/redo options. > */ >- Map getUndoRedoOptions(); >+ Map<Object, Object> getUndoRedoOptions(); > > /** > * Transfers ownership of this editing domain to the specified >@@ -193,7 +194,7 @@ > * > * @param runnable the runnable whose thread is to borrow me > */ >- void startPrivileged(PrivilegedRunnable runnable); >+ void startPrivileged(PrivilegedRunnable<?> runnable); > > /** > * Returns me to my previous owner, upon completion of the specified >@@ -201,5 +202,5 @@ > * > * @param runnable the runnable whose thread had borrowed me > */ >- void endPrivileged(PrivilegedRunnable runnable); >+ void endPrivileged(PrivilegedRunnable<?> runnable); > } >Index: src/org/eclipse/emf/transaction/impl/TriggerCommandTransaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/TriggerCommandTransaction.java,v >retrieving revision 1.1 >diff -u -r1.1 TriggerCommandTransaction.java >--- src/org/eclipse/emf/transaction/impl/TriggerCommandTransaction.java 15 Mar 2006 01:40:31 -0000 1.1 >+++ src/org/eclipse/emf/transaction/impl/TriggerCommandTransaction.java 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -39,7 +39,8 @@ > * @param domain the editing domain in which I am active > * @param options my options > */ >- public TriggerCommandTransaction(TriggerCommand command, InternalTransactionalEditingDomain domain, Map options) { >+ public TriggerCommandTransaction(TriggerCommand command, >+ InternalTransactionalEditingDomain domain, Map<?, ?> options) { > super(command, domain, options); > } > >@@ -47,6 +48,7 @@ > * Extends the inherited implementation by first clearing my change > * description, so that I will not propagate these changes upwards. > */ >+ @Override > protected synchronized void close() { > change.clear(); > >@@ -57,6 +59,7 @@ > * Overrides the inherited implementation to simply propagate triggers to > * my parent, because it's the transaction that the outside world can see. > */ >+ @Override > public void addTriggers(TriggerCommand triggers) { > ((InternalTransaction) getParent()).addTriggers(triggers); > } >Index: src/org/eclipse/emf/transaction/impl/EMFCommandTransaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/EMFCommandTransaction.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFCommandTransaction.java >--- src/org/eclipse/emf/transaction/impl/EMFCommandTransaction.java 7 Jun 2007 14:25:59 -0000 1.3 >+++ src/org/eclipse/emf/transaction/impl/EMFCommandTransaction.java 14 Nov 2007 13:11:58 -0000 >@@ -40,7 +40,8 @@ > * @param domain the editing domain in which I am active > * @param options my options > */ >- public EMFCommandTransaction(Command command, InternalTransactionalEditingDomain domain, Map options) { >+ public EMFCommandTransaction(Command command, InternalTransactionalEditingDomain domain, >+ Map<?, ?> options) { > super(domain, false, options); > > this.command = command; >Index: src/org/eclipse/emf/transaction/impl/TransactionChangeRecorder.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/TransactionChangeRecorder.java,v >retrieving revision 1.6 >diff -u -r1.6 TransactionChangeRecorder.java >--- src/org/eclipse/emf/transaction/impl/TransactionChangeRecorder.java 3 Oct 2007 20:17:38 -0000 1.6 >+++ src/org/eclipse/emf/transaction/impl/TransactionChangeRecorder.java 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -108,6 +108,7 @@ > * > * @throws IllegalStateException if I have been {@link #dispose() disposed} > */ >+ @Override > public ChangeDescription endRecording() { > if (disposed) { > throw new IllegalStateException("cannot end a disposed recorder"); //$NON-NLS-1$ >@@ -135,18 +136,22 @@ > * outside of the scope of the editing domain and its resource set</li> > * </ul> > */ >+ @Override > public void setTarget(Notifier target) { > if (!disposed) { >- Iterator contents = target instanceof EObject ? isResolveProxies() ? ((EObject) target).eContents().iterator() >- : ((InternalEList) ((EObject) target).eContents()).basicIterator() >- : target instanceof ResourceSet ? ((ResourceSet) target) >- .getResources().iterator() >- : target instanceof Resource ? ((Resource) target) >- .getContents().iterator() : null; >- >+ Iterator<? extends Notifier> contents = (target instanceof EObject) ? isResolveProxies() ? ((EObject) target) >+ .eContents().iterator() >+ : ((InternalEList<EObject>) ((EObject) target).eContents()) >+ .basicIterator() >+ : target instanceof ResourceSet ? ((ResourceSet) target) >+ .getResources().iterator() >+ : target instanceof Resource ? ((Resource) target) >+ .getContents().iterator() >+ : null; >+ > if (contents != null) { > while (contents.hasNext()) { >- Notifier notifier = (Notifier) contents.next(); >+ Notifier notifier = contents.next(); > addAdapter(notifier); > } > } >@@ -160,6 +165,7 @@ > * currently recording) and passing it along to the domain's current > * transaction (if any). > */ >+ @Override > public void notifyChanged(Notification notification) { > if (disposed) { > // I am disposed, so I should no longer be responding to or even >@@ -385,6 +391,7 @@ > * > * @since 1.1 > */ >+ @Override > public void dispose() { > if (!disposed) { > super.dispose(); >@@ -395,8 +402,10 @@ > if (rset != null) { > removeAdapter(rset); > >- for (Iterator iter = EcoreUtil.getAllProperContents(rset, false); iter.hasNext();) { >- removeAdapter((Notifier) iter.next()); >+ for (Iterator<Notifier> iter = EcoreUtil.getAllProperContents(rset, false); >+ iter.hasNext();) { >+ >+ removeAdapter(iter.next()); > } > } > >Index: src/org/eclipse/emf/transaction/impl/EditingDomainManager.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/EditingDomainManager.java,v >retrieving revision 1.4 >diff -u -r1.4 EditingDomainManager.java >--- src/org/eclipse/emf/transaction/impl/EditingDomainManager.java 7 Jun 2007 14:25:59 -0000 1.4 >+++ src/org/eclipse/emf/transaction/impl/EditingDomainManager.java 14 Nov 2007 13:11:58 -0000 >@@ -16,9 +16,9 @@ > */ > package org.eclipse.emf.transaction.impl; > >+import java.lang.ref.Reference; > import java.lang.ref.WeakReference; > import java.util.Collection; >-import java.util.Iterator; > import java.util.Map; > > import org.eclipse.core.runtime.CoreException; >@@ -55,8 +55,9 @@ > > private static final EditingDomainManager INSTANCE = new EditingDomainManager(); > >- private Collection universalListeners; >- private final Map listeners = new java.util.HashMap(); >+ private Collection<IConfigurationElement> universalListeners; >+ private final Map<String, Reference<ResourceSetListener>> listeners = >+ new java.util.HashMap<String, Reference<ResourceSetListener>>(); > > /** > * Not instantiable by clients. >@@ -152,12 +153,10 @@ > * @param domain the editing domain to which to add the listeners > */ > public void configureListeners(String id, TransactionalEditingDomain domain) { >- Collection configs = getListenerConfigs(id); >+ Collection<IConfigurationElement> configs = getListenerConfigs(id); > >- for (Iterator iter = configs.iterator(); iter.hasNext();) { >- ResourceSetListener listener = getListener( >- (IConfigurationElement) iter.next(), >- true); >+ for (IConfigurationElement next : configs) { >+ ResourceSetListener listener = getListener(next, true); > > if (listener != null) { > domain.addResourceSetListener(listener); >@@ -174,12 +173,10 @@ > * @param domain the editing domain from which to remove the listeners > */ > public void deconfigureListeners(String id, TransactionalEditingDomain domain) { >- Collection configs = getListenerConfigs(id); >+ Collection<IConfigurationElement> configs = getListenerConfigs(id); > >- for (Iterator iter = configs.iterator(); iter.hasNext();) { >- ResourceSetListener listener = getListener( >- (IConfigurationElement) iter.next(), >- false); >+ for (IConfigurationElement next : configs) { >+ ResourceSetListener listener = getListener(next, false); > > if (listener != null) { > domain.removeResourceSetListener(listener); >@@ -219,20 +216,21 @@ > * @param id the domain ID to retrieve > * @return the configuration elements for listeners registered to this ID > */ >- private Collection getListenerConfigs(String id) { >- Collection result = new java.util.ArrayList(); >+ private Collection<IConfigurationElement> getListenerConfigs(String id) { >+ Collection<IConfigurationElement> result = >+ new java.util.ArrayList<IConfigurationElement>(); > > IConfigurationElement[] configs = Platform.getExtensionRegistry().getConfigurationElementsFor( > EMFTransactionPlugin.getPluginId(), > EXT_POINT_LISTENERS); > >- for (int i = 0; i < configs.length; i++) { >- if (E_LISTENER.equals(configs[i].getName())) { >- IConfigurationElement[] domains = configs[i].getChildren(E_DOMAIN); >+ for (IConfigurationElement element : configs) { >+ if (E_LISTENER.equals(element.getName())) { >+ IConfigurationElement[] domains = element.getChildren(E_DOMAIN); > >- for (int j = 0; j < domains.length; j++) { >- if (id.equals(domains[j].getAttribute(A_ID))) { >- result.add(configs[i]); >+ for (IConfigurationElement element2 : domains) { >+ if (id.equals(element2.getAttribute(A_ID))) { >+ result.add(element); > break; > } > } >@@ -250,20 +248,20 @@ > * > * @return the configuration elements for universal listeners > */ >- private Collection getUniversalListenerConfigs() { >+ private Collection<IConfigurationElement> getUniversalListenerConfigs() { > if (universalListeners == null) { >- universalListeners = new java.util.ArrayList(); >+ universalListeners = new java.util.ArrayList<IConfigurationElement>(); > > IConfigurationElement[] configs = Platform.getExtensionRegistry().getConfigurationElementsFor( > EMFTransactionPlugin.getPluginId(), > EXT_POINT_LISTENERS); > >- for (int i = 0; i < configs.length; i++) { >- if (E_LISTENER.equals(configs[i].getName())) { >- IConfigurationElement[] domains = configs[i].getChildren(E_DOMAIN); >+ for (IConfigurationElement element : configs) { >+ if (E_LISTENER.equals(element.getName())) { >+ IConfigurationElement[] domains = element.getChildren(E_DOMAIN); > > if (domains.length == 0) { >- universalListeners.add(configs[i]); >+ universalListeners.add(element); > } > } > } >@@ -286,9 +284,9 @@ > private ResourceSetListener getListener(IConfigurationElement config, boolean create) { > ResourceSetListener result = null; > >- WeakReference ref = (WeakReference) listeners.get(config.getAttribute(A_CLASS)); >+ Reference<ResourceSetListener> ref = listeners.get(config.getAttribute(A_CLASS)); > if (ref != null) { >- result = (ResourceSetListener) ref.get(); >+ result = ref.get(); > } > > if ((result == null) && create) { >@@ -298,7 +296,7 @@ > > if (listener instanceof ResourceSetListener) { > result = (ResourceSetListener) listener; >- ref = new WeakReference(result); >+ ref = new WeakReference<ResourceSetListener>(result); > listeners.put(result.getClass().getName(), ref); > } else { > EMFTransactionPlugin.getPlugin().log( >Index: src/org/eclipse/emf/transaction/impl/ReadWriteValidatorImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/ReadWriteValidatorImpl.java,v >retrieving revision 1.10 >diff -u -r1.10 ReadWriteValidatorImpl.java >--- src/org/eclipse/emf/transaction/impl/ReadWriteValidatorImpl.java 22 Oct 2007 21:27:16 -0000 1.10 >+++ src/org/eclipse/emf/transaction/impl/ReadWriteValidatorImpl.java 14 Nov 2007 13:11:58 -0000 >@@ -74,7 +74,8 @@ > private NotificationTree transactionToPrecommit = null; > > // maps the active transaction and its ancestors to notification tree nodes >- private final Map txToNode = new java.util.HashMap(); >+ private final Map<InternalTransaction, NotificationTree> txToNode = >+ new java.util.HashMap<InternalTransaction, NotificationTree>(); > > /** > * Initializes me. >@@ -143,8 +144,8 @@ > } > > // Documentation copied from the inherited method specification >- public synchronized List getNotificationsForValidation(Transaction tx) { >- List result = null; >+ public synchronized List<Notification> getNotificationsForValidation(Transaction tx) { >+ List<Notification> result = null; > > if (tree != null) { > NotificationTree nested = findTree(tx); >@@ -158,8 +159,8 @@ > } > > // Documentation copied from the inherited method specification >- public synchronized List getNotificationsForPrecommit(Transaction tx) { >- List result = null; >+ public synchronized List<Notification> getNotificationsForPrecommit(Transaction tx) { >+ List<Notification> result = null; > > if ((transactionToPrecommit != null) > && (transactionToPrecommit == findTree(tx))) { >@@ -175,8 +176,8 @@ > } > > // Documentation copied from the inherited method specification >- public synchronized List getNotificationsForPostcommit(Transaction tx) { >- List result = null; >+ public synchronized List<Notification> getNotificationsForPostcommit(Transaction tx) { >+ List<Notification> result = null; > > if (tree != null) { > NotificationTree nested = findTree(tx); >@@ -203,7 +204,7 @@ > NotificationTree result = null; > > if (tree != null) { >- result = (NotificationTree) txToNode.get(tx); >+ result = txToNode.get(tx); > } > > return result; >@@ -215,7 +216,7 @@ > IStatus result; > > try { >- IValidator validator = createValidator(); >+ IValidator<Notification> validator = createValidator(); > > result = validator.validate(getNotificationsForValidation(tx)); > } catch (Exception e) { >@@ -238,7 +239,7 @@ > * > * @return the validator > */ >- protected IValidator createValidator() { >+ protected IValidator<Notification> createValidator() { > return ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > } > >@@ -297,13 +298,14 @@ > * @author Christian W. Damus (cdamus) > */ > private static class NotificationTree { >- private final List children = new org.eclipse.emf.common.util.BasicEList.FastCompare(); >+ private final List<NotificationTree> children = >+ new org.eclipse.emf.common.util.BasicEList.FastCompare<NotificationTree>(); > > // number of notifications in parent before start of child transaction > private int parentNotificationCount; > > private InternalTransaction transaction; >- private List notifications; // stores the notifications >+ private List<Notification> notifications; // stores the notifications > > private final byte notificationMask; > >@@ -355,7 +357,7 @@ > * > * @return my children > */ >- List getChildren() { >+ List<NotificationTree> getChildren() { > return children; > } > >@@ -372,14 +374,14 @@ > * @see ReadWriteValidatorImpl#PRECOMMIT > * @see ReadWriteValidatorImpl#POSTCOMMIT > */ >- List collectNotifications(byte purpose) { >- List result; >+ List<Notification> collectNotifications(byte purpose) { >+ List<Notification> result; > > if ((notificationMask & purpose) == purpose) { >- result = new java.util.ArrayList(); >+ result = new java.util.ArrayList<Notification>(); > collectNotifications(result, purpose); > } else { >- result = Collections.EMPTY_LIST; >+ result = Collections.emptyList(); > } > > return result; >@@ -394,14 +396,12 @@ > * > * @see #collectNotifications() > */ >- private void collectNotifications(List notifications, byte purpose) { >+ private void collectNotifications(List<? super Notification> notifications, byte purpose) { > if ((notificationMask & purpose) == purpose) { > int lastIndex = 0; >- List parentNotifications = getNotifications(); >+ List<Notification> parentNotifications = getNotifications(); > >- for (Iterator iter = children.iterator(); iter.hasNext();) { >- NotificationTree next = (NotificationTree) iter.next(); >- >+ for (NotificationTree next : children) { > // append the parent transaction's notifications from the > // last position to this child's position > notifications.addAll(parentNotifications.subList( >@@ -427,17 +427,17 @@ > * change, etc.). > */ > void setRolledBack() { >- Iterator children = getChildren().iterator(); >+ Iterator<NotificationTree> children = getChildren().iterator(); > boolean inPlace = transaction == null; > >- ListIterator iter; >+ ListIterator<Notification> iter; > if (inPlace) { > // already committed? Some ancestor transaction is rolling back > iter = notifications.listIterator(); > } else { > // transaction has the notifications > iter = transaction.getNotifications().listIterator(); >- notifications = new org.eclipse.emf.common.util.BasicEList.FastCompare(); >+ notifications = new org.eclipse.emf.common.util.BasicEList.FastCompare<Notification>(); > } > > // filter out all undoable notifications, leaving only those that >@@ -446,14 +446,12 @@ > // where in the notification ordering the child transactions fit > // so that we retain correct linear ordering overall > for (int i = 0; children.hasNext();) { >- NotificationTree child = (NotificationTree) children.next(); >+ NotificationTree child = children.next(); > int parentNotificationCount = child.parentNotificationCount; > > if (inPlace) { > for (; (i < parentNotificationCount) && iter.hasNext(); i++) { >- Notification next = (Notification) iter.next(); >- >- if (isUndoableObjectChange(next)) { >+ if (isUndoableObjectChange(iter.next())) { > iter.remove(); > } > } >@@ -464,7 +462,7 @@ > child.parentNotificationCount = iter.nextIndex(); > } else { > for (; (i < parentNotificationCount) && iter.hasNext(); i++) { >- Notification next = (Notification) iter.next(); >+ Notification next = iter.next(); > > if (!isUndoableObjectChange(next)) { > notifications.add(next); >@@ -484,15 +482,13 @@ > // filter the remaining notifications > if (inPlace) { > while (iter.hasNext()) { >- Notification next = (Notification) iter.next(); >- >- if (isUndoableObjectChange(next)) { >+ if (isUndoableObjectChange(iter.next())) { > iter.remove(); > } > } > } else { > while (iter.hasNext()) { >- Notification next = (Notification) iter.next(); >+ Notification next = iter.next(); > > if (!isUndoableObjectChange(next)) { > notifications.add(next); >@@ -522,7 +518,7 @@ > * > * @return my notifications > */ >- List getNotifications() { >+ List<Notification> getNotifications() { > return (notifications != null)? notifications : > transaction.getNotifications(); > } >Index: src/org/eclipse/emf/transaction/impl/ResourceSetManager.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/impl/ResourceSetManager.java,v >retrieving revision 1.2 >diff -u -r1.2 ResourceSetManager.java >--- src/org/eclipse/emf/transaction/impl/ResourceSetManager.java 7 Jun 2007 14:25:59 -0000 1.2 >+++ src/org/eclipse/emf/transaction/impl/ResourceSetManager.java 14 Nov 2007 13:11:58 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.transaction.impl; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.Map; > > import org.eclipse.emf.common.notify.Notification; >@@ -43,9 +42,9 @@ > public final class ResourceSetManager { > private static final ResourceSetManager INSTANCE = new ResourceSetManager(); > >- private final Map loadingResources = new java.util.WeakHashMap(); >- private final Map loadedResources = new java.util.WeakHashMap(); >- private final Map unloadingResources = new java.util.WeakHashMap(); >+ private final Map<Resource, Boolean> loadingResources = new java.util.WeakHashMap<Resource, Boolean>(); >+ private final Map<Resource, Boolean> loadedResources = new java.util.WeakHashMap<Resource, Boolean>(); >+ private final Map<Resource, Boolean> unloadingResources = new java.util.WeakHashMap<Resource, Boolean>(); > > /** > * Not instantiable by clients. >@@ -72,8 +71,8 @@ > * @param rset a resource set > */ > public synchronized void observe(ResourceSet rset) { >- for (Iterator iter = rset.getResources().iterator(); iter.hasNext();) { >- observe((Resource) iter.next()); >+ for (Resource next : rset.getResources()) { >+ observe(next); > } > } > >@@ -112,9 +111,11 @@ > break; > case Notification.ADD_MANY: > if (newValue != null) { >- for (Iterator iter = ((Collection) newValue).iterator(); iter.hasNext();) { >+ @SuppressWarnings("unchecked") >+ Collection<Resource> resources = (Collection<Resource>) newValue; >+ for (Resource next : resources) { > // observe the new resource >- observe((Resource) iter.next()); >+ observe(next); > } > } > break; >@@ -127,10 +128,12 @@ > break; > case Notification.REMOVE_MANY: > if (oldValue != null) { >- for (Iterator iter = ((Collection) oldValue).iterator(); iter.hasNext();) { >+ @SuppressWarnings("unchecked") >+ Collection<Resource> resources = (Collection<Resource>) oldValue; >+ for (Resource next : resources) { > // the old resource is effectively unloaded as far as we are > // concerned because it is no longer in this resource set >- setUnloaded((Resource) iter.next()); >+ setUnloaded(next); > } > } > break; >@@ -229,7 +232,7 @@ > * @param res a loaded resource > */ > private void setLoaded(Resource res) { >- loadedResources.put(res, Boolean.TRUE); >+ loadedResources.put(res, true); > loadingResources.remove(res); > unloadingResources.remove(res); > } >@@ -240,7 +243,7 @@ > * @param res a loading resource > */ > private void setLoading(Resource res) { >- loadingResources.put(res, Boolean.TRUE); >+ loadingResources.put(res, true); > loadedResources.remove(res); > unloadingResources.remove(res); > } >@@ -251,7 +254,7 @@ > * @param res an unloading resource > */ > private void setUnloading(Resource res) { >- unloadingResources.put(res, Boolean.TRUE); >+ unloadingResources.put(res, true); > loadedResources.remove(res); > loadingResources.remove(res); > } >Index: src/org/eclipse/emf/transaction/RunnableWithResult.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/RunnableWithResult.java,v >retrieving revision 1.3 >diff -u -r1.3 RunnableWithResult.java >--- src/org/eclipse/emf/transaction/RunnableWithResult.java 7 Jun 2007 14:25:59 -0000 1.3 >+++ src/org/eclipse/emf/transaction/RunnableWithResult.java 14 Nov 2007 13:11:58 -0000 >@@ -30,11 +30,13 @@ > * or failure of the transaction. > * </p> > * >+ * @param <T> the result type of the runnable >+ * > * @author Christian W. Damus (cdamus) > * > * @see TransactionalEditingDomain#runExclusive(Runnable) > */ >-public interface RunnableWithResult >+public interface RunnableWithResult<T> > extends Runnable { > > /** >@@ -42,7 +44,7 @@ > * > * @return my result, or <code>null</code> if none > */ >- Object getResult(); >+ T getResult(); > > /** > * Sets the commit status after completion of the {@link Runnable#run()} method. >@@ -69,8 +71,8 @@ > * > * @author Christian W. Damus (cdamus) > */ >- static abstract class Impl implements RunnableWithResult { >- private Object result; >+ static abstract class Impl<T> implements RunnableWithResult<T> { >+ private T result; > private IStatus status; > > /** >@@ -78,7 +80,7 @@ > * > * @param result my result > */ >- protected final void setResult(Object result) { >+ protected final void setResult(T result) { > this.result = result; > } > >@@ -88,7 +90,7 @@ > } > > // Documentation copied from interface >- public final Object getResult() { >+ public final T getResult() { > return result; > } > >Index: src/org/eclipse/emf/transaction/NotificationFilter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/NotificationFilter.java,v >retrieving revision 1.2 >diff -u -r1.2 NotificationFilter.java >--- src/org/eclipse/emf/transaction/NotificationFilter.java 2 Feb 2006 16:24:20 -0000 1.2 >+++ src/org/eclipse/emf/transaction/NotificationFilter.java 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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,6 +49,7 @@ > public abstract class NotificationFilter { > /** As its name implies, this filter matches any notification. */ > public static final NotificationFilter ANY = new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return true; > }}; >@@ -59,6 +60,7 @@ > * @see Notification#isTouch() > */ > public static final NotificationFilter NOT_TOUCH = new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return !notification.isTouch(); > }}; >@@ -83,6 +85,7 @@ > * A filter matching "resource loaded" events. > */ > public static final NotificationFilter RESOURCE_LOADED = new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return (notification.getNotifier() instanceof Resource) > && (notification.getFeatureID(Resource.class) >@@ -95,6 +98,7 @@ > * A filter matching "resource unloaded" events. > */ > public static final NotificationFilter RESOURCE_UNLOADED = new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return (notification.getNotifier() instanceof Resource) > && (notification.getFeatureID(Resource.class) >@@ -137,6 +141,7 @@ > */ > public static NotificationFilter createNotifierFilter(final Object notifier) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return notification.getNotifier() == notifier; > }}; >@@ -152,6 +157,7 @@ > */ > public static NotificationFilter createEventTypeFilter(final int eventType) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return notification.getEventType() == eventType; > }}; >@@ -166,6 +172,7 @@ > */ > public static NotificationFilter createFeatureFilter(final EStructuralFeature feature) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return notification.getFeature() == feature; > }}; >@@ -180,8 +187,10 @@ > * > * @return the filter > */ >- public static NotificationFilter createFeatureFilter(final Class ownerType, final int featureId) { >+ public static NotificationFilter createFeatureFilter( >+ final Class<?> ownerType, final int featureId) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return ownerType.isInstance(notification.getNotifier()) > && (notification.getFeatureID(ownerType) == featureId); >@@ -202,6 +211,7 @@ > */ > public static NotificationFilter createFeatureFilter(final EClassifier ownerType, final int featureId) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return ownerType.isInstance(notification.getNotifier()) > && (notification.getFeatureID(ownerType.getInstanceClass()) == featureId); >@@ -217,8 +227,9 @@ > * > * @return the filter > */ >- public static NotificationFilter createNotifierTypeFilter(final Class type) { >+ public static NotificationFilter createNotifierTypeFilter(final Class<?> type) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return type.isInstance(notification.getNotifier()); > }}; >@@ -235,6 +246,7 @@ > */ > public static NotificationFilter createNotifierTypeFilter(final EClassifier type) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return type.isInstance(notification.getNotifier()); > }}; >@@ -251,6 +263,7 @@ > */ > public final NotificationFilter and(final NotificationFilter other) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return NotificationFilter.this.matches(notification) > && other.matches(notification); >@@ -268,6 +281,7 @@ > */ > public final NotificationFilter or(final NotificationFilter other) { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return NotificationFilter.this.matches(notification) > || other.matches(notification); >@@ -281,6 +295,7 @@ > */ > public final NotificationFilter negated() { > return new NotificationFilter() { >+ @Override > public boolean matches(Notification notification) { > return !NotificationFilter.this.matches(notification); > }}; >Index: src/org/eclipse/emf/transaction/TriggerListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/TriggerListener.java,v >retrieving revision 1.4 >diff -u -r1.4 TriggerListener.java >--- src/org/eclipse/emf/transaction/TriggerListener.java 7 Jun 2007 14:25:59 -0000 1.4 >+++ src/org/eclipse/emf/transaction/TriggerListener.java 14 Nov 2007 13:11:58 -0000 >@@ -16,8 +16,6 @@ > */ > package org.eclipse.emf.transaction; > >-import java.util.Iterator; >- > import org.eclipse.emf.common.command.Command; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.transaction.util.ConditionalRedoCommand; >@@ -55,12 +53,11 @@ > * @return a composite of the commands returned by the subclass > * implementation of the {@link #trigger} method > */ >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { > Command result = null; > >- for (Iterator iter = event.getNotifications().iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : event.getNotifications()) { > Command trigger = trigger(event.getEditingDomain(), next); > if (trigger != null) { > if (result == null) { >@@ -96,6 +93,7 @@ > /** > * I want only ppre-commit events, not post-commit events. > */ >+ @Override > public boolean isPrecommitOnly() { > return true; > } >Index: src/org/eclipse/emf/transaction/TransactionalCommandStack.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/TransactionalCommandStack.java,v >retrieving revision 1.2 >diff -u -r1.2 TransactionalCommandStack.java >--- src/org/eclipse/emf/transaction/TransactionalCommandStack.java 7 Jun 2007 14:25:59 -0000 1.2 >+++ src/org/eclipse/emf/transaction/TransactionalCommandStack.java 14 Nov 2007 13:11:58 -0000 >@@ -51,7 +51,7 @@ > * @throws RollbackException if the changes performed by the command are > * rolled back by validation of the transaction > */ >- void execute(Command command, Map options) throws InterruptedException, RollbackException; >+ void execute(Command command, Map<?, ?> options) throws InterruptedException, RollbackException; > > /** > * Sets an exception handler. This object will be notified when exceptions >Index: src/org/eclipse/emf/transaction/RecordingCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/RecordingCommand.java,v >retrieving revision 1.6 >diff -u -r1.6 RecordingCommand.java >--- src/org/eclipse/emf/transaction/RecordingCommand.java 13 Jun 2007 12:27:32 -0000 1.6 >+++ src/org/eclipse/emf/transaction/RecordingCommand.java 14 Nov 2007 13:11:58 -0000 >@@ -93,6 +93,7 @@ > * Subclasses should override this if they have more preparation to do. > * By default, the result is just <code>true</code>. > */ >+ @Override > protected boolean prepare() { > return true; > } >@@ -151,6 +152,7 @@ > * I can be undone if I successfully recorded the changes that I executed. > * Subclasses would not normally need to override this method. > */ >+ @Override > public boolean canUndo() { > return canApplyChange(); > } >@@ -175,6 +177,7 @@ > * Undoes the changes that I recorded. > * Subclasses would not normally need to override this method. > */ >+ @Override > public final void undo() { > if (change != null) { > change.applyAndReverse(); >@@ -199,6 +202,7 @@ > protected abstract void doExecute(); > > // Documentation copied from the inherited specification >+ @Override > public Command chain(Command command) { > return new ConditionalRedoCommand.Compound().chain(this).chain(command); > } >@@ -245,7 +249,8 @@ > * Extends the inherited implementation by disposing my change description, > * if any. > */ >- public void dispose() { >+ @Override >+ public void dispose() { > super.dispose(); > > if (change != null) { >Index: src/org/eclipse/emf/transaction/ReadFilter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/ReadFilter.java,v >retrieving revision 1.5 >diff -u -r1.5 ReadFilter.java >--- src/org/eclipse/emf/transaction/ReadFilter.java 7 Jun 2007 14:26:00 -0000 1.5 >+++ src/org/eclipse/emf/transaction/ReadFilter.java 14 Nov 2007 13:11:58 -0000 >@@ -45,6 +45,7 @@ > } > > // Documentation inherited from the method specification >+ @Override > public boolean matches(Notification notification) { > switch (notification.getEventType()) { > case Notification.RESOLVE: >Index: src/org/eclipse/emf/transaction/DemultiplexingListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/DemultiplexingListener.java,v >retrieving revision 1.3 >diff -u -r1.3 DemultiplexingListener.java >--- src/org/eclipse/emf/transaction/DemultiplexingListener.java 7 Jun 2007 14:26:00 -0000 1.3 >+++ src/org/eclipse/emf/transaction/DemultiplexingListener.java 14 Nov 2007 13:11:58 -0000 >@@ -16,8 +16,6 @@ > */ > package org.eclipse.emf.transaction; > >-import java.util.Iterator; >- > import org.eclipse.emf.common.notify.Notification; > > /** >@@ -50,10 +48,9 @@ > * > * @see #handleNotification(TransactionalEditingDomain, Notification) > */ >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { >- for (Iterator iter = event.getNotifications().iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : event.getNotifications()) { > handleNotification(event.getEditingDomain(), next); > } > } >@@ -71,6 +68,7 @@ > /** > * I want only post-commit events, not pre-commit events. > */ >+ @Override > public boolean isPostcommitOnly() { > return true; > } >Index: src/org/eclipse/emf/transaction/Transaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/Transaction.java,v >retrieving revision 1.6 >diff -u -r1.6 Transaction.java >--- src/org/eclipse/emf/transaction/Transaction.java 3 Oct 2007 20:17:38 -0000 1.6 >+++ src/org/eclipse/emf/transaction/Transaction.java 14 Nov 2007 13:11:58 -0000 >@@ -23,9 +23,9 @@ > > > /** >- * Specification of a transaction in a {@link TransactionalEditingDomain}. All reading and >- * writing of data in a <code>TransactionalEditingDomain</code> is performed in the context >- * of a transaction. >+ * Specification of a transaction in a {@link TransactionalEditingDomain}. All >+ * reading and writing of data in a <code>TransactionalEditingDomain</code> is >+ * performed in the context of a transaction. > * <p> > * This interface is not intended to be implemented by clients. It is used > * internally and by frameworks extending this API. It is mostly of use to >@@ -191,7 +191,7 @@ > * > * @return an unmodifiable view of my options > */ >- Map getOptions(); >+ Map<?, ?> getOptions(); > > /** > * Queries whether I am active. I am active after I have started and >Index: src/org/eclipse/emf/transaction/TransactionalEditingDomain.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/TransactionalEditingDomain.java,v >retrieving revision 1.4 >diff -u -r1.4 TransactionalEditingDomain.java >--- src/org/eclipse/emf/transaction/TransactionalEditingDomain.java 3 Oct 2007 20:17:38 -0000 1.4 >+++ src/org/eclipse/emf/transaction/TransactionalEditingDomain.java 14 Nov 2007 13:11:58 -0000 >@@ -24,6 +24,7 @@ > import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; > import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl; > import org.eclipse.emf.transaction.util.Adaptable; >+import org.eclipse.emf.transaction.util.TransactionUtil; > > /** > * An extension of the {@link EditingDomain} API that applies transactional >@@ -149,6 +150,11 @@ > * safe to call this method on the Eclipse UI thread because special > * precaution is taken to ensure that liveness is maintained (using > * mechanisms built into the Job Manager). >+ * </p><p> >+ * <b>Note</b>: Since the 1.2 release, the >+ * {@link TransactionUtil#runExclusive(TransactionalEditingDomain, RunnableWithResult)} >+ * utility provides type-safe execution of runnables returning results and >+ * should be preferred over this API. > * </p> > * > * @param read a read-only operation to execute >@@ -159,7 +165,8 @@ > * > * @throws InterruptedException if the current thread is interrupted while > * waiting for access to the resource set >- * >+ * >+ * @see TransactionUtil#runExclusive(RunnableWithResult) > * @see Transaction#commit() > */ > Object runExclusive(Runnable read) throws InterruptedException; >@@ -221,8 +228,16 @@ > * active transaction remains active. Any attempt to execute the runnable > * after this transaction has committed or while a nested transaction is > * active will result in an {@link IllegalStateException}. >+ * </p><p> >+ * <b>Note</b>: Since the 1.2 release, the >+ * {@link TransactionUtil#createPrivilegedRunnable(TransactionalEditingDomain, RunnableWithResult)} >+ * utility provides type-safe privileged access for runnables returning >+ * results and should be preferred over this API. > * </p> > * >+ * @param <T> the result type of the {@link RunnableWithResult} if such >+ * is the <tt>read</tt> argument >+ * > * @param runnable a runnable to execute in the context of the active > * transaction, on any thread > * >@@ -235,8 +250,10 @@ > * prevents "theft" of transactions by malicious code. Note also > * that this implies an exception if there is no active transaction at > * the time of this call >+ * >+ * @see TransactionUtil#createPrivilegedRunnable(TransactionalEditingDomain, RunnableWithResult) > */ >- RunnableWithResult createPrivilegedRunnable(Runnable runnable); >+ RunnableWithResult<?> createPrivilegedRunnable(Runnable runnable); > > /** > * Disposes of this editing domain and any resources that it has allocated. >@@ -392,9 +409,9 @@ > * Obtains a read-only view of the editing domain's default transaction > * options. > * >- * @return my read-only transaction options >+ * @return my read-only map of transaction options > */ >- Map getDefaultTransactionOptions(); >+ Map<?, ?> getDefaultTransactionOptions(); > > /** > * Sets the default transaction options. It is probably best to do this >@@ -404,6 +421,6 @@ > * > * @param options the new options. The options are copied from the map > */ >- void setDefaultTransactionOptions(Map options); >+ void setDefaultTransactionOptions(Map<?, ?> options); > } > } >Index: src/org/eclipse/emf/transaction/ResourceSetChangeEvent.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/ResourceSetChangeEvent.java,v >retrieving revision 1.3 >diff -u -r1.3 ResourceSetChangeEvent.java >--- src/org/eclipse/emf/transaction/ResourceSetChangeEvent.java 22 Feb 2006 22:02:36 -0000 1.3 >+++ src/org/eclipse/emf/transaction/ResourceSetChangeEvent.java 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -43,7 +43,7 @@ > private static final long serialVersionUID = -6265603064286194469L; > > private final Transaction transaction; >- private final List notifications; >+ private final List<Notification> notifications; > > /** > * Initializes me with my source editing domain. >@@ -62,7 +62,8 @@ > * @param notifications a list of events (as {@link Notification}s), in the > * order in which they occurred > */ >- public ResourceSetChangeEvent(TransactionalEditingDomain source, Transaction transaction, List notifications) { >+ public ResourceSetChangeEvent(TransactionalEditingDomain source, >+ Transaction transaction, List<Notification> notifications) { > super(source); > > this.transaction = transaction; >@@ -105,7 +106,7 @@ > * > * @see Notification > */ >- public List getNotifications() { >+ public List<Notification> getNotifications() { > return notifications; > } > } >Index: src/org/eclipse/emf/transaction/ResourceContentTypeFilter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/ResourceContentTypeFilter.java,v >retrieving revision 1.2 >diff -u -r1.2 ResourceContentTypeFilter.java >--- src/org/eclipse/emf/transaction/ResourceContentTypeFilter.java 7 Jun 2007 14:25:59 -0000 1.2 >+++ src/org/eclipse/emf/transaction/ResourceContentTypeFilter.java 14 Nov 2007 13:11:58 -0000 >@@ -61,6 +61,7 @@ > } > > // Documentation inherited from the method specification >+ @Override > public boolean matches(Notification notification) { > boolean result = false; > IContentType[] actualTypes = getContentTypes(notification); >@@ -122,10 +123,12 @@ > return contentTypes; > } > >+ @Override > public boolean isAdapterForType(Object type) { > return type == Cache.class; > } > >+ @Override > public void notifyChanged(Notification msg) { > if (!msg.isTouch()) { > // clear the cache >Index: src/org/eclipse/emf/transaction/util/ConditionalRedoCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/ConditionalRedoCommand.java,v >retrieving revision 1.2 >diff -u -r1.2 ConditionalRedoCommand.java >--- src/org/eclipse/emf/transaction/util/ConditionalRedoCommand.java 26 Apr 2006 13:17:13 -0000 1.2 >+++ src/org/eclipse/emf/transaction/util/ConditionalRedoCommand.java 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -16,7 +16,6 @@ > */ > package org.eclipse.emf.transaction.util; > >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.emf.common.command.Command; >@@ -58,16 +57,16 @@ > super(); > } > >- public Compound(int resultIndex, List commandList) { >+ public Compound(int resultIndex, List<Command> commandList) { > super(resultIndex, commandList); > } > >- public Compound(int resultIndex, String label, List commandList) { >+ public Compound(int resultIndex, String label, List<Command> commandList) { > super(resultIndex, label, commandList); > } > > public Compound(int resultIndex, String label, String description, >- List commandList) { >+ List<Command> commandList) { > super(resultIndex, label, description, commandList); > } > >@@ -83,15 +82,15 @@ > super(resultIndex); > } > >- public Compound(List commandList) { >+ public Compound(List<Command> commandList) { > super(commandList); > } > >- public Compound(String label, List commandList) { >+ public Compound(String label, List<Command> commandList) { > super(label, commandList); > } > >- public Compound(String label, String description, List commandList) { >+ public Compound(String label, String description, List<Command> commandList) { > super(label, description, commandList); > } > >@@ -111,9 +110,7 @@ > * <code>true</code>, otherwise > */ > public boolean canRedo() { >- for (Iterator iter = commandList.iterator(); iter.hasNext();) { >- Object next = iter.next(); >- >+ for (Object next : commandList) { > if ((next instanceof ConditionalRedoCommand) > && !((ConditionalRedoCommand) next).canRedo()) { > return false; >@@ -126,6 +123,7 @@ > /** > * I am self-chaining. > */ >+ @Override > public Command chain(Command c) { > append(c); > return this; >Index: src/org/eclipse/emf/transaction/util/TriggerCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/TriggerCommand.java,v >retrieving revision 1.5 >diff -u -r1.5 TriggerCommand.java >--- src/org/eclipse/emf/transaction/util/TriggerCommand.java 13 Jun 2007 12:27:32 -0000 1.5 >+++ src/org/eclipse/emf/transaction/util/TriggerCommand.java 14 Nov 2007 13:11:59 -0000 >@@ -36,7 +36,7 @@ > */ > public class TriggerCommand extends ConditionalRedoCommand.Compound { > private final Command triggeringCommand; >- private final List triggers; >+ private final List<Command> triggers; > > /** > * Initializes me with a list of commands triggered not by the execution of >@@ -47,11 +47,12 @@ > * > * @param triggers the trigger commands that I encapsulate > */ >- public TriggerCommand(List triggers) { >- super(0, "Triggers", "Triggered Changes", triggers); //$NON-NLS-1$ //$NON-NLS-2$ >+ public TriggerCommand(List<? extends Command> triggers) { >+ super(0, "Triggers", "Triggered Changes", //$NON-NLS-1$ //$NON-NLS-2$ >+ new java.util.ArrayList<Command>(triggers)); > > this.triggeringCommand = null; >- this.triggers = triggers; >+ this.triggers = commandList; > } > > /** >@@ -62,11 +63,12 @@ > * @param triggeringCommand the command that triggered further commands > * @param triggers the trigger commands that I encapsulate > */ >- public TriggerCommand(Command triggeringCommand, List triggers) { >- super(0, triggeringCommand.getLabel(), triggeringCommand.getDescription(), triggers); >+ public TriggerCommand(Command triggeringCommand, List<? extends Command> triggers) { >+ super(0, triggeringCommand.getLabel(), triggeringCommand.getDescription(), >+ new java.util.ArrayList<Command>(triggers)); > > this.triggeringCommand = triggeringCommand; >- this.triggers = triggers; >+ this.triggers = commandList; > } > > /** >@@ -85,11 +87,12 @@ > * > * @return my triggers, as a list of {@link Command}s. Will not be empty > */ >- public final List getTriggers() { >+ public final List<Command> getTriggers() { > return triggers; > } > > // Documentation copied from the inherited specification >+ @Override > protected boolean prepare() { > // we will check canExecute() as we go > return !triggers.isEmpty(); >@@ -99,11 +102,12 @@ > * Executes all of my trigger commands, then prepends the original triggering > * command (if any) so that it will be undone/redone with the others. > */ >+ @Override > public void execute() { > // execute just the triggers >- for (ListIterator iter = commandList.listIterator(); iter.hasNext();) { >+ for (ListIterator<Command> iter = commandList.listIterator(); iter.hasNext();) { > try { >- Command command = (Command) iter.next(); >+ Command command = iter.next(); > > if (command.canExecute()) { > command.execute(); >@@ -123,7 +127,7 @@ > // Iterate back over the executed commands to undo them. > // > while (iter.hasPrevious()) { >- Command command = (Command) iter.previous(); >+ Command command = iter.previous(); > if (command.canUndo()) { > command.undo(); > } else { >@@ -147,7 +151,7 @@ > // then replace the command-list with a new list that includes > // the > // originally executed command (for undo/redo) >- commandList = new java.util.ArrayList(triggers.size() + 1); >+ commandList = new java.util.ArrayList<Command>(triggers.size() + 1); > commandList.add(triggeringCommand); > commandList.addAll(triggers); > } >@@ -157,7 +161,8 @@ > * Extends the inherited implementation by disposing my triggering command, > * also (if any). > */ >- public void dispose() { >+ @Override >+ public void dispose() { > super.dispose(); > > if (triggeringCommand != null) { >Index: src/org/eclipse/emf/transaction/util/CommandChangeDescription.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/CommandChangeDescription.java,v >retrieving revision 1.4 >diff -u -r1.4 CommandChangeDescription.java >--- src/org/eclipse/emf/transaction/util/CommandChangeDescription.java 24 May 2007 23:23:53 -0000 1.4 >+++ src/org/eclipse/emf/transaction/util/CommandChangeDescription.java 14 Nov 2007 13:11:58 -0000 >@@ -83,6 +83,7 @@ > * I apply my change by undoing the encapsulated operation. After it is > * undone, I dispose myself. > */ >+ @Override > public void apply() { > try { > command.undo(); >@@ -95,6 +96,7 @@ > * I apply-and-reverse by alternately undoing and redoing the encapsulated > * operation. > */ >+ @Override > public void applyAndReverse() { > if (isRedone) { > command.undo(); >Index: src/org/eclipse/emf/transaction/util/Queue.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/Queue.java,v >retrieving revision 1.2 >diff -u -r1.2 Queue.java >--- src/org/eclipse/emf/transaction/util/Queue.java 13 Jan 2006 21:50:43 -0000 1.2 >+++ src/org/eclipse/emf/transaction/util/Queue.java 14 Nov 2007 13:11:58 -0000 >@@ -1,360 +1,362 @@ >-/** >- * <copyright> >- * >- * Copyright (c) 2005, 2006 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 >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM - Initial API and implementation >- * >- * </copyright> >- * >- * $Id: Queue.java,v 1.2 2006/01/13 21:50:43 cdamus Exp $ >- */ >-package org.eclipse.emf.transaction.util; >- >-import org.eclipse.emf.transaction.internal.Tracing; >- >- >-/** >- * Simplistic implementation of a FIFO wait queue for fair notification of >- * threads that are waiting for a lock. >- * >- * @author Christian W. Damus (cdamus) >- */ >-final class Queue { >- private Wait head; >- private Wait tail; >- private int size; >- private int exclusiveCount; // number of threads waiting for exclusive access >- >- /** >- * Initializes me. >- */ >- public Queue() { >- super(); >- } >- >- /** >- * Queries whether the queue is empty of threads. >- * >- * @return <code>true</code> if I have no threads; <code>false</code>, otherwise >- */ >- public synchronized boolean isEmpty() { >- return size == 0; >- } >- >- /** >- * Queries the number of waiting threads. >- * >- * @return my size >- */ >- public synchronized int size() { >- return size; >- } >- >- /** >- * Queries the number of threads waiting for exclusive access. >- * >- * @return my count of exclusive threads >- */ >- public synchronized int exclusiveCount() { >- return exclusiveCount; >- } >- >- /** >- * Adds the current thread to the queue, blocking until either: >- * <ul> >- * <li>the thread is awakened again by being dequeued</li> >- * <li>the thread times out (if a time-out is specified)</li> >- * <li>the thread is interrupted while it is waiting</li> >- * </ul> >- * >- * @param timeout the time-out interval, in millis, or <code>0L</code> >- * if no time-out is desired (i.e., wait as long as necessary) >- * @param exclusive <code>true</code> if the current thread needs exclusive >- * access (i.e., no other threads may currently be >- * {@link #yield() yielding}); <code>false</code>, otherwise >- * >- * @return the new wait node >- * >- * @throws InterruptedException if the thread was interrupted while >- * waiting for notification. If it is interrupted after it has been >- * notified but before it awakes, no exception is thrown >- */ >- public synchronized Wait put(long timeout, boolean exclusive) throws InterruptedException { >- final Thread current = Thread.currentThread(); >- Wait result; >- >- // first, see whether we can find an existing node that timed out, but >- // that we have not yet dequeued. If found, just re-use it to >- // to preserve seniority. This allows threads to loop with short >- // time-outs for the sake of liveness (e.g., to check for cancellation >- // of progress monitors) >- result = findNode(current); >- >- if (result == null) { >- // must enqueue a new node >- result = new Wait(current); >- >- if (tail == null) { >- tail = result; >- head = tail; >- } else { >- tail.next = result; >- tail = result; >- } >- >- size++; >- >- if (exclusive) { >- exclusiveCount++; >- } >- } else { >- // must keep the count of exclusive waits in sync >- if (exclusive != result.isExclusive()) { >- exclusiveCount += exclusive? 1 : -1; >- } >- } >- >- result.initialize(exclusive); >- >- return result; >- } >- >- /** >- * Dequeues the next eligible (not timed-out or interrupted) >- * thread. If any threads are currently yielding, then we look for the >- * the next eligible non-exclusive thread. >- * >- * @param allowExclusive whether to allow dequeueing of threads waiting >- * for exclusive access >- * >- * @return the next eligible thread, or <code>null</code> if >- * no threads were waiting or they all timed out >- */ >- public synchronized Wait take(boolean allowExclusive) { >- Wait result = null; >- >- Wait prev = null; >- for (Wait node = head; (result == null) && (node != null); node = node.next) { >- if (allowExclusive || !node.isExclusive()) { >- // this is a candidate. Remove it from the list >- if (prev != null) { >- prev.next = node.next; >- } else { >- head = node.next; >- } >- >- if (head == null) { >- tail = null; >- } else if (node == tail) { >- tail = prev; >- } >- >- // help the garbage collector >- node.next = null; >- >- size--; >- >- if (node.isExclusive()) { >- exclusiveCount--; >- } >- >- result = node; >- } else { >- prev = node; >- } >- } >- >- return result; >- } >- >- /** >- * Finds an existing node for the specified <code>thread</code>, to be >- * re-used for another wait following a time-out. This ensures the >- * preservation of ordering for threads that time-out periodically but >- * with the intention of waiting again each time. >- * >- * @param thread a thread to look for in the queue >- * >- * @return the thread's node, or <code>null</code> if it is not found >- */ >- private Wait findNode(Thread thread) { >- Wait result = null; >- >- for (Wait next = head; next != null; next = next.next) { >- if (next.thread == thread) { >- result = next; >- break; >- } >- } >- >- return result; >- } >- >- public String toString() { >- StringBuffer result = new StringBuffer(); >- boolean first = true; >- >- result.append("Queue["); //$NON-NLS-1$ >- for (Wait next = head; head != null; next = next.next) { >- if (first) { >- first = false; >- } else { >- result.append(", "); //$NON-NLS-1$ >- } >- >- result.append(next); >- } >- >- result.append(']'); >- >- return result.toString(); >- } >- >- /** >- * Implementation of a linked node in the wait queue. >- * >- * @author Christian W. Damus (cdamus) >- */ >- static class Wait { >- Wait next; >- private final Thread thread; >- private boolean exclusive; >- private boolean notified; >- private boolean timedOut; >- >- /** >- * Initializes me with the thread that is waiting on me. >- * >- * @param thread my thread >- */ >- Wait(Thread thread) { >- this.thread = thread; >- } >- >- /** >- * Queries whether my thread was successfully notified. >- * >- * @return whether my thread was notified >- */ >- boolean wasNotified() { >- return notified && !timedOut; >- } >- >- /** >- * Queries whether I require exclusive scheduling. >- * >- * @return whether I am exclusive >- */ >- boolean isExclusive() { >- return exclusive; >- } >- >- /** >- * Initializes my state. >- * >- * @param excl <code>true</code> if I should not be dequeue while >- * there are any yielders; <code>false</code>, otherwise >- */ >- void initialize(boolean excl) { >- this.exclusive = excl; >- timedOut = false; >- notified = false; >- } >- >- /** >- * Retrieves that thread that is/was waiting on me. >- * >- * @return my thread >- */ >- Thread getThread() { >- return thread; >- } >- >- /** >- * Attempts to wake my thread. Wake-up can be attempted once only >- * upon dequeueing the thread. It will succeed only if the thread >- * did not already time-out or interrupt. >- * >- * @return <code>true</code> if my thread was awakened; >- * <code>false</code> if it had already been awakened or timed out, >- * or if it had been interrupted >- */ >- synchronized boolean wakeUp() { >- boolean result = false; >- >- if (!(notified || timedOut)) { >- notified = true; >- result = true; >- notify(); // wake me up! >- } >- >- return result; >- } >- >- /** >- * Waits for the specified time-out. >- * >- * @param timeout the time-out, in millis, or <code>0L</code> to wait >- * indefinitely >- * >- * @throws InterruptedException if the waiting thread was interrupted >- */ >- synchronized void waitFor(long timeout) throws InterruptedException { >- // first, check whether perhaps another thread has already awakened >- // me *after* I was put on the queue but *before* calling this >- // method (as there is an unsynchronized gap in the >- // Lock.acquire() method) >- if (notified) { >- return; >- } >- >- long waitTime = timeout; >- long start = System.currentTimeMillis(); >- >- try { >- for (;;) { >- wait(waitTime); >- >- if (notified) { >- break; >- } >- >- if (timeout > 0L) { >- waitTime = timeout - (System.currentTimeMillis() - start); >- >- if (waitTime <= 0L) { >- // giving up waiting >- timedOut = true; >- break; >- } >- } >- } >- } catch (InterruptedException e) { >- Tracing.catching(Wait.class, "waitFor", e); //$NON-NLS-1$ >- if (!notified) { >- // thread was interrupted while it was waiting. >- // Pretend like we timed out (just in case), but >- // propagate the exception >- timedOut = true; >- Tracing.throwing(Wait.class, "waitFor", e); //$NON-NLS-1$ >- throw e; >- } else { >- // the thread was interrupted after notification, but >- // before it woke up from the wait(). Must propagate >- // the interrupt status but not fail this operation >- Thread.currentThread().interrupt(); >- } >- } >- } >- >- public String toString() { >- return thread.getName() + "[" + notified + ", " + timedOut + ']'; //$NON-NLS-1$ //$NON-NLS-2$ >- } >- } >-} >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2005, 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id: Queue.java,v 1.2 2006/01/13 21:50:43 cdamus Exp $ >+ */ >+package org.eclipse.emf.transaction.util; >+ >+import org.eclipse.emf.transaction.internal.Tracing; >+ >+ >+/** >+ * Simplistic implementation of a FIFO wait queue for fair notification of >+ * threads that are waiting for a lock. >+ * >+ * @author Christian W. Damus (cdamus) >+ */ >+final class Queue { >+ private Wait head; >+ private Wait tail; >+ private int size; >+ private int exclusiveCount; // number of threads waiting for exclusive access >+ >+ /** >+ * Initializes me. >+ */ >+ public Queue() { >+ super(); >+ } >+ >+ /** >+ * Queries whether the queue is empty of threads. >+ * >+ * @return <code>true</code> if I have no threads; <code>false</code>, otherwise >+ */ >+ public synchronized boolean isEmpty() { >+ return size == 0; >+ } >+ >+ /** >+ * Queries the number of waiting threads. >+ * >+ * @return my size >+ */ >+ public synchronized int size() { >+ return size; >+ } >+ >+ /** >+ * Queries the number of threads waiting for exclusive access. >+ * >+ * @return my count of exclusive threads >+ */ >+ public synchronized int exclusiveCount() { >+ return exclusiveCount; >+ } >+ >+ /** >+ * Adds the current thread to the queue, blocking until either: >+ * <ul> >+ * <li>the thread is awakened again by being dequeued</li> >+ * <li>the thread times out (if a time-out is specified)</li> >+ * <li>the thread is interrupted while it is waiting</li> >+ * </ul> >+ * >+ * @param timeout the time-out interval, in millis, or <code>0L</code> >+ * if no time-out is desired (i.e., wait as long as necessary) >+ * @param exclusive <code>true</code> if the current thread needs exclusive >+ * access (i.e., no other threads may currently be >+ * {@link #yield() yielding}); <code>false</code>, otherwise >+ * >+ * @return the new wait node >+ * >+ * @throws InterruptedException if the thread was interrupted while >+ * waiting for notification. If it is interrupted after it has been >+ * notified but before it awakes, no exception is thrown >+ */ >+ public synchronized Wait put(long timeout, boolean exclusive) throws InterruptedException { >+ final Thread current = Thread.currentThread(); >+ Wait result; >+ >+ // first, see whether we can find an existing node that timed out, but >+ // that we have not yet dequeued. If found, just re-use it to >+ // to preserve seniority. This allows threads to loop with short >+ // time-outs for the sake of liveness (e.g., to check for cancellation >+ // of progress monitors) >+ result = findNode(current); >+ >+ if (result == null) { >+ // must enqueue a new node >+ result = new Wait(current); >+ >+ if (tail == null) { >+ tail = result; >+ head = tail; >+ } else { >+ tail.next = result; >+ tail = result; >+ } >+ >+ size++; >+ >+ if (exclusive) { >+ exclusiveCount++; >+ } >+ } else { >+ // must keep the count of exclusive waits in sync >+ if (exclusive != result.isExclusive()) { >+ exclusiveCount += exclusive? 1 : -1; >+ } >+ } >+ >+ result.initialize(exclusive); >+ >+ return result; >+ } >+ >+ /** >+ * Dequeues the next eligible (not timed-out or interrupted) >+ * thread. If any threads are currently yielding, then we look for the >+ * the next eligible non-exclusive thread. >+ * >+ * @param allowExclusive whether to allow dequeueing of threads waiting >+ * for exclusive access >+ * >+ * @return the next eligible thread, or <code>null</code> if >+ * no threads were waiting or they all timed out >+ */ >+ public synchronized Wait take(boolean allowExclusive) { >+ Wait result = null; >+ >+ Wait prev = null; >+ for (Wait node = head; (result == null) && (node != null); node = node.next) { >+ if (allowExclusive || !node.isExclusive()) { >+ // this is a candidate. Remove it from the list >+ if (prev != null) { >+ prev.next = node.next; >+ } else { >+ head = node.next; >+ } >+ >+ if (head == null) { >+ tail = null; >+ } else if (node == tail) { >+ tail = prev; >+ } >+ >+ // help the garbage collector >+ node.next = null; >+ >+ size--; >+ >+ if (node.isExclusive()) { >+ exclusiveCount--; >+ } >+ >+ result = node; >+ } else { >+ prev = node; >+ } >+ } >+ >+ return result; >+ } >+ >+ /** >+ * Finds an existing node for the specified <code>thread</code>, to be >+ * re-used for another wait following a time-out. This ensures the >+ * preservation of ordering for threads that time-out periodically but >+ * with the intention of waiting again each time. >+ * >+ * @param thread a thread to look for in the queue >+ * >+ * @return the thread's node, or <code>null</code> if it is not found >+ */ >+ private Wait findNode(Thread thread) { >+ Wait result = null; >+ >+ for (Wait next = head; next != null; next = next.next) { >+ if (next.thread == thread) { >+ result = next; >+ break; >+ } >+ } >+ >+ return result; >+ } >+ >+ @Override >+ public String toString() { >+ StringBuffer result = new StringBuffer(); >+ boolean first = true; >+ >+ result.append("Queue["); //$NON-NLS-1$ >+ for (Wait next = head; head != null; next = next.next) { >+ if (first) { >+ first = false; >+ } else { >+ result.append(", "); //$NON-NLS-1$ >+ } >+ >+ result.append(next); >+ } >+ >+ result.append(']'); >+ >+ return result.toString(); >+ } >+ >+ /** >+ * Implementation of a linked node in the wait queue. >+ * >+ * @author Christian W. Damus (cdamus) >+ */ >+ static class Wait { >+ Wait next; >+ private final Thread thread; >+ private boolean exclusive; >+ private boolean notified; >+ private boolean timedOut; >+ >+ /** >+ * Initializes me with the thread that is waiting on me. >+ * >+ * @param thread my thread >+ */ >+ Wait(Thread thread) { >+ this.thread = thread; >+ } >+ >+ /** >+ * Queries whether my thread was successfully notified. >+ * >+ * @return whether my thread was notified >+ */ >+ boolean wasNotified() { >+ return notified && !timedOut; >+ } >+ >+ /** >+ * Queries whether I require exclusive scheduling. >+ * >+ * @return whether I am exclusive >+ */ >+ boolean isExclusive() { >+ return exclusive; >+ } >+ >+ /** >+ * Initializes my state. >+ * >+ * @param excl <code>true</code> if I should not be dequeue while >+ * there are any yielders; <code>false</code>, otherwise >+ */ >+ void initialize(boolean excl) { >+ this.exclusive = excl; >+ timedOut = false; >+ notified = false; >+ } >+ >+ /** >+ * Retrieves that thread that is/was waiting on me. >+ * >+ * @return my thread >+ */ >+ Thread getThread() { >+ return thread; >+ } >+ >+ /** >+ * Attempts to wake my thread. Wake-up can be attempted once only >+ * upon dequeueing the thread. It will succeed only if the thread >+ * did not already time-out or interrupt. >+ * >+ * @return <code>true</code> if my thread was awakened; >+ * <code>false</code> if it had already been awakened or timed out, >+ * or if it had been interrupted >+ */ >+ synchronized boolean wakeUp() { >+ boolean result = false; >+ >+ if (!(notified || timedOut)) { >+ notified = true; >+ result = true; >+ notify(); // wake me up! >+ } >+ >+ return result; >+ } >+ >+ /** >+ * Waits for the specified time-out. >+ * >+ * @param timeout the time-out, in millis, or <code>0L</code> to wait >+ * indefinitely >+ * >+ * @throws InterruptedException if the waiting thread was interrupted >+ */ >+ synchronized void waitFor(long timeout) throws InterruptedException { >+ // first, check whether perhaps another thread has already awakened >+ // me *after* I was put on the queue but *before* calling this >+ // method (as there is an unsynchronized gap in the >+ // Lock.acquire() method) >+ if (notified) { >+ return; >+ } >+ >+ long waitTime = timeout; >+ long start = System.currentTimeMillis(); >+ >+ try { >+ for (;;) { >+ wait(waitTime); >+ >+ if (notified) { >+ break; >+ } >+ >+ if (timeout > 0L) { >+ waitTime = timeout - (System.currentTimeMillis() - start); >+ >+ if (waitTime <= 0L) { >+ // giving up waiting >+ timedOut = true; >+ break; >+ } >+ } >+ } >+ } catch (InterruptedException e) { >+ Tracing.catching(Wait.class, "waitFor", e); //$NON-NLS-1$ >+ if (!notified) { >+ // thread was interrupted while it was waiting. >+ // Pretend like we timed out (just in case), but >+ // propagate the exception >+ timedOut = true; >+ Tracing.throwing(Wait.class, "waitFor", e); //$NON-NLS-1$ >+ throw e; >+ } else { >+ // the thread was interrupted after notification, but >+ // before it woke up from the wait(). Must propagate >+ // the interrupt status but not fail this operation >+ Thread.currentThread().interrupt(); >+ } >+ } >+ } >+ >+ @Override >+ public String toString() { >+ return thread.getName() + "[" + notified + ", " + timedOut + ']'; //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ } >+} >Index: src/org/eclipse/emf/transaction/util/Lock.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/Lock.java,v >retrieving revision 1.11 >diff -u -r1.11 Lock.java >--- src/org/eclipse/emf/transaction/util/Lock.java 15 Oct 2007 16:20:40 -0000 1.11 >+++ src/org/eclipse/emf/transaction/util/Lock.java 14 Nov 2007 13:11:58 -0000 >@@ -21,7 +21,6 @@ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.OperationCanceledException; >-import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.jobs.IJobManager; > import org.eclipse.core.runtime.jobs.ILock; >@@ -72,7 +71,7 @@ > * @author Christian W. Damus (cdamus) > */ > public class Lock { >- private static final IJobManager jobmgr = Platform.getJobManager(); >+ private static final IJobManager jobmgr = Job.getJobManager(); > > private static long nextId = 0; > >@@ -99,16 +98,18 @@ > > // threads currently yielding read access > // must use identity map because threads can override equals() >- private final Map yielders = new java.util.IdentityHashMap(); >+ private final Map<Thread, Lock> yielders = >+ new java.util.IdentityHashMap<Thread, Lock>(); > > // every thread has its own ILock that it acquires while it owns the > // transaction lock, to ensure that the thread is registered as a > // "lock owner" in the lock table. This ensures that Display.syncExec() > // calls from these threads will use the work queue to communicate > // runnables to a waiting UI thread >- private ThreadLocal threadLock = new ThreadLocal() { >- protected Object initialValue() { >- return Platform.getJobManager().newLock(); >+ private final ThreadLocal<ILock> threadLock = new ThreadLocal<ILock>() { >+ @Override >+ protected ILock initialValue() { >+ return Job.getJobManager().newLock(); > }}; > > /** >@@ -693,7 +694,7 @@ > } else if (current == owner) { > // current thread no longer needs the dummy lock > getThreadLock().release(); >- } // else non-owner is transfering. Shouldn't happen >+ } // else non-owner is transferring. Shouldn't happen > > owner = thread; > } >@@ -705,9 +706,10 @@ > * @return the current thread's thread lock > */ > private ILock getThreadLock() { >- return (ILock) threadLock.get(); >+ return threadLock.get(); > } > >+ @Override > public String toString() { > Thread lastKnownOwner = owner; > >@@ -729,7 +731,7 @@ > private final Thread thread; > private final boolean exclusive; > >- private ILock ilock = jobmgr.newLock(); >+ private final ILock ilock = jobmgr.newLock(); > private IStatus acquireStatus; > > private boolean aborted; >@@ -747,7 +749,8 @@ > /** > * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) > */ >- protected IStatus run(IProgressMonitor monitor) { >+ @Override >+ protected IStatus run(IProgressMonitor monitor) { > try { > ilock.acquire(); > >Index: src/org/eclipse/emf/transaction/util/Adaptable.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/Adaptable.java,v >retrieving revision 1.1 >diff -u -r1.1 Adaptable.java >--- src/org/eclipse/emf/transaction/util/Adaptable.java 3 Oct 2007 20:17:38 -0000 1.1 >+++ src/org/eclipse/emf/transaction/util/Adaptable.java 14 Nov 2007 13:11:58 -0000 >@@ -35,9 +35,11 @@ > /** > * Obtains an instance of the specified adapter type. > * >+ * @param <T> the interface for which to get an adapter >+ * > * @param adapterType the required interface > * @return an instance of the required interface that adapts me, or > * <code>null</code> if I do not supply this interface > */ >- Object getAdapter(Class adapterType); >+ <T> T getAdapter(Class<? extends T> adapterType); > } >Index: src/org/eclipse/emf/transaction/util/CompositeChangeDescription.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/CompositeChangeDescription.java,v >retrieving revision 1.6 >diff -u -r1.6 CompositeChangeDescription.java >--- src/org/eclipse/emf/transaction/util/CompositeChangeDescription.java 13 Jun 2007 12:27:32 -0000 1.6 >+++ src/org/eclipse/emf/transaction/util/CompositeChangeDescription.java 14 Nov 2007 13:11:58 -0000 >@@ -25,7 +25,10 @@ > import org.eclipse.emf.common.util.BasicEMap; > import org.eclipse.emf.common.util.EList; > import org.eclipse.emf.common.util.EMap; >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.change.ChangeDescription; >+import org.eclipse.emf.ecore.change.FeatureChange; >+import org.eclipse.emf.ecore.change.ResourceChange; > import org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl; > import org.eclipse.emf.transaction.TransactionChangeDescription; > >@@ -43,7 +46,8 @@ > extends ChangeDescriptionImpl > implements TransactionChangeDescription { > >- private final List changes = new java.util.ArrayList(); >+ private final List<ChangeDescription> changes = >+ new java.util.ArrayList<ChangeDescription>(); > > /** > * Queries whether I have no composed change descriptions. >@@ -66,8 +70,8 @@ > * Disposes my children, recursively. > */ > void dispose() { >- for (Iterator iter = changes.iterator(); iter.hasNext();) { >- TransactionUtil.dispose((ChangeDescription) iter.next()); >+ for (ChangeDescription next : changes) { >+ TransactionUtil.dispose(next); > } > } > >@@ -77,7 +81,9 @@ > public boolean canApply() { > boolean result = true; > >- for (Iterator iter = changes.iterator(); result && iter.hasNext();) { >+ for (Iterator<ChangeDescription> iter = changes.iterator(); >+ result && iter.hasNext();) { >+ > Object next = iter.next(); > > if (next instanceof TransactionChangeDescription) { >@@ -89,20 +95,26 @@ > } > > // Documentation copied from the inherited method >+ @Override > public void apply() { > // must apply changes in the reverse order that they were added >- for (ListIterator iter = changes.listIterator(changes.size()); iter.hasPrevious();) { >- ((ChangeDescription) iter.previous()).apply(); >+ for (ListIterator<ChangeDescription> iter = changes.listIterator(changes.size()); >+ iter.hasPrevious();) { >+ >+ iter.previous().apply(); > } > > changes.clear(); > } > > // Documentation copied from the inherited method >+ @Override > public void applyAndReverse() { > // must apply changes in the reverse order that they were added >- for (ListIterator iter = changes.listIterator(changes.size()); iter.hasPrevious();) { >- ((ChangeDescription) iter.previous()).applyAndReverse(); >+ for (ListIterator<ChangeDescription> iter = changes.listIterator(changes.size()); >+ iter.hasPrevious();) { >+ >+ iter.previous().applyAndReverse(); > } > > // invert the order of the changes for next apply-and-reverse >@@ -120,8 +132,8 @@ > if (change instanceof CompositeChangeDescription) { > CompositeChangeDescription other = ((CompositeChangeDescription) change); > >- for (Iterator iter = other.changes.iterator(); iter.hasNext();) { >- add((ChangeDescription) iter.next()); >+ for (ChangeDescription next : other.changes) { >+ add(next); > } > } else { > changes.add(change); >@@ -177,12 +189,13 @@ > * My object changes are the concatenation of the changes in my composed > * descriptions. > */ >- public EMap getObjectChanges() { >+ @Override >+ public EMap<EObject, EList<FeatureChange>> getObjectChanges() { > if (objectChanges == null) { >- objectChanges = new BasicEMap(); >+ objectChanges = new BasicEMap<EObject, EList<FeatureChange>>(); > >- for (Iterator iter = changes.iterator(); iter.hasNext();) { >- objectChanges.addAll(((ChangeDescription) iter.next()).getObjectChanges()); >+ for (ChangeDescription next : changes) { >+ objectChanges.addAll(next.getObjectChanges()); > } > } > >@@ -193,12 +206,13 @@ > * My objects to attach are the concatenation of the changes in my composed > * descriptions. > */ >- public EList getObjectsToDetach() { >+ @Override >+ public EList<EObject> getObjectsToDetach() { > if (objectsToDetach == null) { >- objectsToDetach = new BasicEList(); >+ objectsToDetach = new BasicEList<EObject>(); > >- for (Iterator iter = changes.iterator(); iter.hasNext();) { >- objectsToDetach.addAll(((ChangeDescription) iter.next()).getObjectsToDetach()); >+ for (ChangeDescription next : changes) { >+ objectsToDetach.addAll(next.getObjectsToDetach()); > } > } > >@@ -209,12 +223,13 @@ > * My objects to detach are the concatenation of the changes in my composed > * descriptions. > */ >- public EList getObjectsToAttach() { >+ @Override >+ public EList<EObject> getObjectsToAttach() { > if (objectsToAttach == null) { >- objectsToAttach = new BasicEList(); >+ objectsToAttach = new BasicEList<EObject>(); > >- for (Iterator iter = changes.iterator(); iter.hasNext();) { >- objectsToAttach.addAll(((ChangeDescription) iter.next()).getObjectsToAttach()); >+ for (ChangeDescription next : changes) { >+ objectsToAttach.addAll(next.getObjectsToAttach()); > } > } > >@@ -225,18 +240,20 @@ > * My resource changes are the concatenation of the changes in my composed > * descriptions. > */ >- public EList getResourceChanges() { >+ @Override >+ public EList<ResourceChange> getResourceChanges() { > if (resourceChanges == null) { >- resourceChanges = new BasicEList(); >+ resourceChanges = new BasicEList<ResourceChange>(); > >- for (Iterator iter = changes.iterator(); iter.hasNext();) { >- resourceChanges.addAll(((ChangeDescription) iter.next()).getResourceChanges()); >+ for (ChangeDescription next : changes) { >+ resourceChanges.addAll(next.getResourceChanges()); > } > } > > return resourceChanges; > } > >+ @Override > public String toString() { > StringBuffer result = new StringBuffer("CompositeChangeDescription["); //$NON-NLS-1$ > result.append(getObjectChanges().size()).append(", "); //$NON-NLS-1$ >Index: src/org/eclipse/emf/transaction/util/TransactionUtil.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/TransactionUtil.java,v >retrieving revision 1.6 >diff -u -r1.6 TransactionUtil.java >--- src/org/eclipse/emf/transaction/util/TransactionUtil.java 3 Oct 2007 20:17:38 -0000 1.6 >+++ src/org/eclipse/emf/transaction/util/TransactionUtil.java 14 Nov 2007 13:11:59 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.edit.domain.EditingDomain; > import org.eclipse.emf.edit.domain.IEditingDomainProvider; >+import org.eclipse.emf.transaction.RunnableWithResult; > import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalEditingDomain; > import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; >@@ -205,7 +206,7 @@ > * @param notifier the notifier to disconnect > */ > private static void disconnectFromEditingDomain0(Notifier notifier) { >- Set recorders = getExistingChangeRecorders(notifier); >+ Set<TransactionChangeRecorder> recorders = getExistingChangeRecorders(notifier); > > if (!recorders.isEmpty()) { > // this resource is managed by a transactional editing domain >@@ -216,7 +217,7 @@ > throw new IllegalArgumentException("resource is still in the domain's resource set"); //$NON-NLS-1$ > } > >- Iterator iter = EcoreUtil.getAllProperContents(Collections.singleton( >+ Iterator<?> iter = EcoreUtil.getAllProperContents(Collections.singleton( > notifier), false); > while (iter.hasNext()) { > ((Notifier) iter.next()).eAdapters().removeAll(recorders); >@@ -231,17 +232,19 @@ > * @return the currently attached change recorders, which may be an empty > * set if none > */ >- private static Set getExistingChangeRecorders(Notifier notifier) { >- Set result = null; >+ private static Set<TransactionChangeRecorder> getExistingChangeRecorders( >+ Notifier notifier) { >+ >+ Set<TransactionChangeRecorder> result = null; > > Object[] adapters = notifier.eAdapters().toArray(); >- for (int i = 0; i < adapters.length; i++) { >- if (adapters[i] instanceof TransactionChangeRecorder) { >- TransactionChangeRecorder next = (TransactionChangeRecorder) adapters[i]; >+ for (Object element : adapters) { >+ if (element instanceof TransactionChangeRecorder) { >+ TransactionChangeRecorder next = (TransactionChangeRecorder) element; > > if (next.getEditingDomain() != null) { > if (result == null) { >- result = new java.util.HashSet(); >+ result = new java.util.HashSet<TransactionChangeRecorder>(); > } > > result.add(next); >@@ -249,7 +252,8 @@ > } > } > >- return (result == null)? Collections.EMPTY_SET : result; >+ return (result == null)? Collections.<TransactionChangeRecorder>emptySet() >+ : result; > } > > /** >@@ -266,8 +270,8 @@ > } else if (change instanceof CommandChangeDescription) { > ((CommandChangeDescription) change).dispose(); > } else { >- for (Iterator iter = change.eAllContents(); iter.hasNext();) { >- ((EObject) iter.next()).eAdapters().clear(); >+ for (Iterator<EObject> iter = change.eAllContents(); iter.hasNext();) { >+ iter.next().eAdapters().clear(); > } > } > } >@@ -275,14 +279,19 @@ > /** > * Obtains an instance of the specified adapter type for an editing domain. > * >+ * @param <T> the adapter interface that is required >+ * > * @param domain an editing domain to adapt > * @param adapterType the required interface > * > * @return an instance of the required interface that adapts the > * <tt>domain</tt>, or <code>null</code> if it does not supply this interface >+ * >+ * @since 1.2 > */ >- public static Object getAdapter(TransactionalEditingDomain domain, Class adapterType) { >- Object result; >+ public static <T> T getAdapter(TransactionalEditingDomain domain, >+ Class<? extends T> adapterType) { >+ T result; > > if (domain instanceof Adaptable) { > result = ((Adaptable) domain).getAdapter(adapterType); >@@ -292,4 +301,55 @@ > > return result; > } >+ >+ /** >+ * Utility method for executing exclusive runnables that >+ * {@linkplain RunnableWithResult return values}. The advantage of this >+ * method over {@link TransactionalEditingDomain#runExclusive(Runnable)} is >+ * that it provides compile-time type safety. >+ * >+ * @param <T> the result type of the runnable >+ * >+ * @param domain the editing domain in which to run >+ * @param runnable the runnable to execute >+ * >+ * @return the result of the runnable >+ * >+ * @throws InterruptedException if the current thread is interrupted while >+ * waiting for access to the resource set >+ * >+ * @since 1.2 >+ */ >+ @SuppressWarnings("unchecked") >+ public static <T> T runExclusive(TransactionalEditingDomain domain, >+ RunnableWithResult<? extends T> runnable) throws InterruptedException { >+ >+ return (T) domain.runExclusive(runnable); >+ } >+ >+ /** >+ * Utility method for providing privileged access to runnables that >+ * {@linkplain RunnableWithResult return values}. The advantage of this >+ * method over {@link TransactionalEditingDomain#createPrivilegedRunnable(Runnable)} is >+ * that it provides compile-time type safety. >+ * >+ * @param <T> the result type of the runnable >+ * >+ * @param domain the editing domain in which to grant privileged access >+ * @param runnable the runnable to execute >+ * >+ * @return the result of the runnable >+ * >+ * @throws InterruptedException if the current thread is interrupted while >+ * waiting for access to the resource set >+ * >+ * @since 1.2 >+ */ >+ @SuppressWarnings("unchecked") >+ public static <T> RunnableWithResult<T> createPrivilegedRunnable( >+ TransactionalEditingDomain domain, >+ RunnableWithResult<? extends T> runnable) throws InterruptedException { >+ >+ return (RunnableWithResult<T>) domain.createPrivilegedRunnable(runnable); >+ } > } >Index: src/org/eclipse/emf/transaction/util/ValidateEditSupport.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/ValidateEditSupport.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidateEditSupport.java >--- src/org/eclipse/emf/transaction/util/ValidateEditSupport.java 3 Oct 2007 20:17:38 -0000 1.1 >+++ src/org/eclipse/emf/transaction/util/ValidateEditSupport.java 14 Nov 2007 13:11:59 -0000 >@@ -114,7 +114,7 @@ > * @since 1.2 > */ > class Default implements ValidateEditSupport { >- private final Set resourcesToValidate = new java.util.HashSet(); >+ private final Set<Resource> resourcesToValidate = new java.util.HashSet<Resource>(); > > /** > * Initializes me. >@@ -130,7 +130,7 @@ > * > * @return the resources to validate-edit > */ >- protected final Set getResourcesToValidate() { >+ protected final Set<Resource> getResourcesToValidate() { > return resourcesToValidate; > } > >@@ -157,15 +157,15 @@ > * @return the result of the validate-edit attempt > */ > protected IStatus doValidateEdit(Transaction transaction, >- Collection resources, Object context) { >+ Collection<? extends Resource> resources, Object context) { > IStatus result = Status.OK_STATUS; > > EditingDomain domain = transaction.getEditingDomain(); > >- for (Iterator iter = resources.iterator(); result.isOK() >+ for (Iterator<? extends Resource> iter = resources.iterator(); result.isOK() > && iter.hasNext();) { > >- Resource next = (Resource) iter.next(); >+ Resource next = iter.next(); > > if (domain.isReadOnly(next)) { > result = new Status(IStatus.ERROR, EMFTransactionPlugin >@@ -187,12 +187,12 @@ > if (!resourcesToValidate.isEmpty()) { > // protect against concurrent modifications: setting modified > // state to false will trigger removal from the collection >- Resource[] resources = (Resource[]) resourcesToValidate >- .toArray(new Resource[resourcesToValidate.size()]); >+ Resource[] resources = resourcesToValidate.toArray( >+ new Resource[resourcesToValidate.size()]); > >- for (int i = 0; i < resources.length; i++) { >+ for (Resource element : resources) { > // note that this is exempt from the transaction protocol >- resources[i].setModified(false); >+ element.setModified(false); > > // setting modified to false should have removed them > // already, but just in case ... >Index: src/org/eclipse/emf/transaction/internal/EMFTransactionPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/internal/EMFTransactionPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 EMFTransactionPlugin.java >--- src/org/eclipse/emf/transaction/internal/EMFTransactionPlugin.java 7 Jun 2007 14:25:59 -0000 1.2 >+++ src/org/eclipse/emf/transaction/internal/EMFTransactionPlugin.java 14 Nov 2007 13:11:58 -0000 >@@ -39,6 +39,7 @@ > } > > // implements the inherited method >+ @Override > public ResourceLocator getPluginResourceLocator() { > return plugin; > } >@@ -81,6 +82,7 @@ > /** > * This method is called upon plug-in activation > */ >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > } >@@ -88,6 +90,7 @@ > /** > * This method is called when the plug-in is stopped > */ >+ @Override > public void stop(BundleContext context) throws Exception { > super.stop(context); > EMFTransactionPlugin.plugin = null; >Index: src/org/eclipse/emf/transaction/internal/Tracing.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/internal/Tracing.java,v >retrieving revision 1.2 >diff -u -r1.2 Tracing.java >--- src/org/eclipse/emf/transaction/internal/Tracing.java 7 Jun 2007 14:25:59 -0000 1.2 >+++ src/org/eclipse/emf/transaction/internal/Tracing.java 14 Nov 2007 13:11:58 -0000 >@@ -109,7 +109,8 @@ > /** > * The cached debug options (for optimization). > */ >- private static final Map cachedOptions = new HashMap(); >+ private static final Map<String, Boolean> cachedOptions = >+ new HashMap<String, Boolean>(); > > /** > * Retrieves a Boolean value indicating whether tracing is enabled. >@@ -137,13 +138,12 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >- new Boolean( >- Boolean.TRUE.toString().equalsIgnoreCase( >- org.eclipse.core.runtime.Platform.getDebugOption(option))); >+ Boolean.valueOf( >+ org.eclipse.core.runtime.Platform.getDebugOption(option)); > > cachedOptions.put(option, value); > } >@@ -254,7 +254,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -291,7 +291,7 @@ > * > */ > public static void catching( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -322,7 +322,7 @@ > * > */ > public static void throwing( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -343,54 +343,6 @@ > } > > /** >- * Traces the entering into the specified method of the specified class. >- * >- * @param clazz The class whose method is being entered. >- * @param methodName The name of method that is being entered. >- * >- */ >- public static void entering( >- Class clazz, >- String methodName) { >- >- if (shouldTrace(EMFTransactionDebugOptions.METHODS_ENTERING)) { >- >- trace( >- PREFIX_ENTERING >- + clazz.getName() >- + SEPARATOR_METHOD >- + methodName); >- } >- } >- >- /** >- * Traces the entering into the specified method of the specified class, >- * with the specified parameter. >- * >- * @param clazz The class whose method is being entered. >- * @param methodName The name of method that is being entered. >- * @param parameter The parameter to the method being entered. >- * >- */ >- public static void entering( >- Class clazz, >- String methodName, >- Object parameter) { >- >- if (shouldTrace(EMFTransactionDebugOptions.METHODS_ENTERING)) { >- >- trace( >- PREFIX_ENTERING >- + clazz.getName() >- + SEPARATOR_METHOD >- + methodName >- + PARENTHESIS_OPEN >- + getArgumentString(parameter) >- + PARENTHESIS_CLOSE); >- } >- } >- >- /** > * Traces the entering into the specified method of the specified class, > * with the specified parameters. > * >@@ -400,9 +352,9 @@ > * > */ > public static void entering( >- Class clazz, >+ Class<?> clazz, > String methodName, >- Object[] parameters) { >+ Object... parameters) { > > if (shouldTrace(EMFTransactionDebugOptions.METHODS_ENTERING)) { > >@@ -425,7 +377,7 @@ > * > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(EMFTransactionDebugOptions.METHODS_EXITING)) { >@@ -448,7 +400,7 @@ > * > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:38 -0000 1.10 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:11:58 -0000 >@@ -7,13 +7,13 @@ > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)";visibility:=reexport, >- org.eclipse.emf.edit;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, >- org.eclipse.emf.ecore.change;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, >- org.eclipse.emf.validation;bundle-version="[1.0.0,2.0.0)";visibility:=reexport >+ org.eclipse.emf.edit;bundle-version="[2.3.0,3.0.0)";visibility:=reexport, >+ org.eclipse.emf.ecore.change;bundle-version="[2.3.0,3.0.0)";visibility:=reexport, >+ org.eclipse.emf.validation;bundle-version="[1.2.0,2.0.0)";visibility:=reexport > Eclipse-LazyStart: true > Export-Package: org.eclipse.emf.transaction, > org.eclipse.emf.transaction.impl, > org.eclipse.emf.transaction.internal;x-friends:="org.eclipse.emf.transaction.tests", > org.eclipse.emf.transaction.internal.l10n;x-friends:="org.eclipse.emf.transaction.tests", > org.eclipse.emf.transaction.util >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:36 -0000 1.2 >+++ .classpath 14 Nov 2007 13:11:58 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:25:59 -0000 1.5 >+++ build.properties 14 Nov 2007 13:11:58 -0000 >@@ -24,5 +24,5 @@ > plugin.properties,\ > .options > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:36 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:11:58 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:57:53 EST 2006 >+#Sun Nov 11 09:25:14 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >#P org.eclipse.emf.workspace.ui >Index: src/org/eclipse/emf/workspace/ui/actions/UndoActionWrapper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/src/org/eclipse/emf/workspace/ui/actions/UndoActionWrapper.java,v >retrieving revision 1.3 >diff -u -r1.3 UndoActionWrapper.java >--- src/org/eclipse/emf/workspace/ui/actions/UndoActionWrapper.java 7 Jun 2007 14:25:41 -0000 1.3 >+++ src/org/eclipse/emf/workspace/ui/actions/UndoActionWrapper.java 14 Nov 2007 13:12:07 -0000 >@@ -22,7 +22,6 @@ > import org.eclipse.swt.widgets.Event; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchPartSite; >-import org.eclipse.ui.operations.OperationHistoryActionHandler; > import org.eclipse.ui.operations.UndoActionHandler; > > /** >@@ -32,20 +31,21 @@ > * @author Christian W. Damus (cdamus) > */ > public class UndoActionWrapper extends UndoAction { >- private final ActionWrapperHelper delegate; >+ private final ActionWrapperHelper<UndoActionHandler> delegate; > > /** > * Initializes me. > */ > public UndoActionWrapper() { >- delegate = new ActionWrapperHelper(new ActionWrapperHelper.OwnerAccess() { >+ delegate = new ActionWrapperHelper<UndoActionHandler>( >+ new ActionWrapperHelper.OwnerAccess<UndoActionHandler>() { > > public void firePropertyChange(String property, Object oldValue, > Object newValue) { > firePropertyChange0(property, oldValue, newValue); > } > >- public OperationHistoryActionHandler createDelegate( >+ public UndoActionHandler createDelegate( > IWorkbenchPartSite site, IUndoContext context) { > return new UndoActionHandler(site, context); > }}); >@@ -60,6 +60,7 @@ > * Extends the superclass implementation to update the operation history > * undo action handler to which I delegate. > */ >+ @Override > public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart) { > super.setActiveWorkbenchPart(workbenchPart); > delegate.setActiveWorkbenchPart(workbenchPart); >@@ -68,6 +69,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void update() { > if (delegate != null) { > delegate.update(); >@@ -77,6 +79,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getDescription() { > if (delegate != null) { > return delegate.getDescription(); >@@ -88,6 +91,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getText() { > if (delegate != null) { > return delegate.getText(); >@@ -99,6 +103,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getToolTipText() { > if (delegate != null) { > return delegate.getToolTipText(); >@@ -110,6 +115,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public boolean isEnabled() { > if (delegate != null) { > return delegate.isEnabled(); >@@ -121,6 +127,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public boolean isHandled() { > if (delegate != null) { > return delegate.isHandled(); >@@ -132,6 +139,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void run() { > if (delegate != null) { > delegate.run(); >@@ -141,6 +149,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void runWithEvent(Event event) { > if (delegate != null) { > delegate.runWithEvent(event); >@@ -150,6 +159,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setChecked(boolean checked) { > if (delegate != null) { > delegate.setChecked(checked); >@@ -159,6 +169,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setDescription(String text) { > if (delegate != null) { > delegate.setDescription(text); >@@ -168,6 +179,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setEnabled(boolean enabled) { > if (delegate != null) { > delegate.setEnabled(enabled); >@@ -177,6 +189,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setText(String text) { > if (delegate != null) { > delegate.setText(text); >@@ -186,6 +199,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setToolTipText(String toolTipText) { > if (delegate != null) { > delegate.setToolTipText(toolTipText); >Index: src/org/eclipse/emf/workspace/ui/actions/RedoActionWrapper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/src/org/eclipse/emf/workspace/ui/actions/RedoActionWrapper.java,v >retrieving revision 1.3 >diff -u -r1.3 RedoActionWrapper.java >--- src/org/eclipse/emf/workspace/ui/actions/RedoActionWrapper.java 7 Jun 2007 14:25:41 -0000 1.3 >+++ src/org/eclipse/emf/workspace/ui/actions/RedoActionWrapper.java 14 Nov 2007 13:12:07 -0000 >@@ -22,7 +22,6 @@ > import org.eclipse.swt.widgets.Event; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchPartSite; >-import org.eclipse.ui.operations.OperationHistoryActionHandler; > import org.eclipse.ui.operations.RedoActionHandler; > > /** >@@ -32,20 +31,21 @@ > * @author Christian W. Damus (cdamus) > */ > public class RedoActionWrapper extends RedoAction { >- private final ActionWrapperHelper delegate; >+ private final ActionWrapperHelper<RedoActionHandler> delegate; > > /** > * Initializes me. > */ > public RedoActionWrapper() { >- delegate = new ActionWrapperHelper(new ActionWrapperHelper.OwnerAccess() { >+ delegate = new ActionWrapperHelper<RedoActionHandler>( >+ new ActionWrapperHelper.OwnerAccess<RedoActionHandler>() { > > public void firePropertyChange(String property, Object oldValue, > Object newValue) { > firePropertyChange0(property, oldValue, newValue); > } > >- public OperationHistoryActionHandler createDelegate( >+ public RedoActionHandler createDelegate( > IWorkbenchPartSite site, IUndoContext context) { > return new RedoActionHandler(site, context); > }}); >@@ -60,6 +60,7 @@ > * Extends the superclass implementation to update the operation history > * redo action handler to which I delegate. > */ >+ @Override > public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart) { > super.setActiveWorkbenchPart(workbenchPart); > delegate.setActiveWorkbenchPart(workbenchPart); >@@ -68,6 +69,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void update() { > if (delegate != null) { > delegate.update(); >@@ -77,6 +79,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getDescription() { > if (delegate != null) { > return delegate.getDescription(); >@@ -88,6 +91,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getText() { > if (delegate != null) { > return delegate.getText(); >@@ -99,6 +103,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getToolTipText() { > if (delegate != null) { > return delegate.getToolTipText(); >@@ -110,6 +115,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public boolean isEnabled() { > if (delegate != null) { > return delegate.isEnabled(); >@@ -121,6 +127,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public boolean isHandled() { > if (delegate != null) { > return delegate.isHandled(); >@@ -132,6 +139,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void run() { > if (delegate != null) { > delegate.run(); >@@ -141,6 +149,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void runWithEvent(Event event) { > if (delegate != null) { > delegate.runWithEvent(event); >@@ -150,6 +159,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setChecked(boolean checked) { > if (delegate != null) { > delegate.setChecked(checked); >@@ -159,6 +169,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setDescription(String text) { > if (delegate != null) { > delegate.setDescription(text); >@@ -168,6 +179,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setEnabled(boolean enabled) { > if (delegate != null) { > delegate.setEnabled(enabled); >@@ -177,6 +189,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setText(String text) { > if (delegate != null) { > delegate.setText(text); >@@ -186,6 +199,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setToolTipText(String toolTipText) { > if (delegate != null) { > delegate.setToolTipText(toolTipText); >Index: src/org/eclipse/emf/workspace/ui/actions/ActionWrapperHelper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/src/org/eclipse/emf/workspace/ui/actions/ActionWrapperHelper.java,v >retrieving revision 1.1 >diff -u -r1.1 ActionWrapperHelper.java >--- src/org/eclipse/emf/workspace/ui/actions/ActionWrapperHelper.java 7 Dec 2006 23:17:11 -0000 1.1 >+++ src/org/eclipse/emf/workspace/ui/actions/ActionWrapperHelper.java 14 Nov 2007 13:12:07 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -34,15 +34,18 @@ > * that they cannot inherit because they must separately extend the EMF > * action classes. i.e., this is an instance of the "prefer composition over > * inheritance" idiom. >- * >+ * >+ * @param <T> the operation-history action handler type that I support >+ * > * @author Christian W. Damus (cdamus) > */ >-class ActionWrapperHelper extends Action { >- private final OwnerAccess ownerAccess; >+class ActionWrapperHelper<T extends OperationHistoryActionHandler> extends Action { >+ private final OwnerAccess<T> ownerAccess; > >- private OperationHistoryActionHandler delegate; >+ private T delegate; > >- private Map siteToActionHandler = new java.util.HashMap(); >+ private final Map<IWorkbenchPartSite, T> siteToActionHandler = >+ new java.util.HashMap<IWorkbenchPartSite, T>(); > private IPartListener partListener; > > private final IPropertyChangeListener listener = new IPropertyChangeListener() { >@@ -52,7 +55,7 @@ > event.getProperty(), event.getOldValue(), event.getNewValue()); > }}; > >- ActionWrapperHelper(OwnerAccess ownerAccess) { >+ ActionWrapperHelper(OwnerAccess<T> ownerAccess) { > this.ownerAccess = ownerAccess; > } > >@@ -84,9 +87,8 @@ > } > } > >- private OperationHistoryActionHandler getActionHandler(IWorkbenchPartSite site, IUndoContext context) { >- OperationHistoryActionHandler result = >- (OperationHistoryActionHandler) siteToActionHandler.get(site); >+ private T getActionHandler(IWorkbenchPartSite site, IUndoContext context) { >+ T result = siteToActionHandler.get(site); > > if (result == null) { > result = ownerAccess.createDelegate(site, context); >@@ -108,9 +110,7 @@ > partListener = new IPartListener() { > > public void partClosed(IWorkbenchPart part) { >- OperationHistoryActionHandler handler = >- (OperationHistoryActionHandler) siteToActionHandler.get( >- part.getSite()); >+ T handler = siteToActionHandler.get(part.getSite()); > > if (handler != null) { > siteToActionHandler.remove(part.getSite()); >@@ -152,6 +152,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getDescription() { > if (delegate != null) { > return delegate.getDescription(); >@@ -163,6 +164,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getText() { > if (delegate != null) { > return delegate.getText(); >@@ -174,6 +176,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public String getToolTipText() { > if (delegate != null) { > return delegate.getToolTipText(); >@@ -185,6 +188,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public boolean isEnabled() { > if (delegate != null) { > return delegate.isEnabled(); >@@ -196,6 +200,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public boolean isHandled() { > if (delegate != null) { > return delegate.isHandled(); >@@ -207,6 +212,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void run() { > if (delegate != null) { > delegate.run(); >@@ -216,6 +222,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void runWithEvent(Event event) { > if (delegate != null) { > delegate.runWithEvent(event); >@@ -225,6 +232,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setChecked(boolean checked) { > if (delegate != null) { > delegate.setChecked(checked); >@@ -234,6 +242,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setDescription(String text) { > if (delegate != null) { > delegate.setDescription(text); >@@ -243,6 +252,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setEnabled(boolean enabled) { > if (delegate != null) { > delegate.setEnabled(enabled); >@@ -252,6 +262,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setText(String text) { > if (delegate != null) { > delegate.setText(text); >@@ -261,6 +272,7 @@ > /** > * Delegates to the operation framework action handler. > */ >+ @Override > public void setToolTipText(String toolTipText) { > if (delegate != null) { > delegate.setToolTipText(toolTipText); >@@ -273,7 +285,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >- static interface OwnerAccess { >+ static interface OwnerAccess<T extends Action> { > /** > * Fires a property change event on behalf of the owner action wrapper. > * >@@ -292,6 +304,6 @@ > * > * @return the new action handler > */ >- OperationHistoryActionHandler createDelegate(IWorkbenchPartSite site, IUndoContext context); >+ T createDelegate(IWorkbenchPartSite site, IUndoContext context); > } > } >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:53 -0000 1.2 >+++ .classpath 14 Nov 2007 13:12:07 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:25:41 -0000 1.5 >+++ build.properties 14 Nov 2007 13:12:07 -0000 >@@ -17,5 +17,5 @@ > plugin.properties,\ > about.html > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:53 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:12:07 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:55:15 EST 2006 >+#Sun Nov 11 17:04:57 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.6 >diff -u -r1.6 MANIFEST.MF >--- META-INF/MANIFEST.MF 20 Dec 2006 17:06:53 -0000 1.6 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:12:07 -0000 >@@ -2,13 +2,13 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.workspace.ui >-Bundle-Version: 1.0.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Localization: plugin >-Require-Bundle: org.eclipse.emf.workspace;bundle-version="[1.0.0,2.0.0)", >- org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)" >+Require-Bundle: org.eclipse.emf.workspace;bundle-version="[1.2.0,2.0.0)", >+ org.eclipse.emf.edit.ui;bundle-version="[2.3.0,3.0.0)" > Eclipse-LazyStart: true > Bundle-Activator: org.eclipse.emf.workspace.ui.internal.EMFWorkbenchUIPlugin$Implementation > Bundle-Vendor: %Plugin.providerName > Export-Package: org.eclipse.emf.workspace.ui.actions, > org.eclipse.emf.workspace.ui.internal;x-internal:=true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >#P org.eclipse.emf.workspace >Index: src/org/eclipse/emf/workspace/util/MovedSynchRequest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/util/MovedSynchRequest.java,v >retrieving revision 1.2 >diff -u -r1.2 MovedSynchRequest.java >--- src/org/eclipse/emf/workspace/util/MovedSynchRequest.java 7 Jun 2007 14:25:44 -0000 1.2 >+++ src/org/eclipse/emf/workspace/util/MovedSynchRequest.java 14 Nov 2007 13:12:09 -0000 >@@ -41,6 +41,7 @@ > this.newURI = newURI; > } > >+ @Override > protected void doPerform() { > if (!synch.getDelegate().handleResourceMoved(resource, newURI)) { > // note that if our delegate is the default, it >Index: src/org/eclipse/emf/workspace/util/ChangedSynchRequest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/util/ChangedSynchRequest.java,v >retrieving revision 1.2 >diff -u -r1.2 ChangedSynchRequest.java >--- src/org/eclipse/emf/workspace/util/ChangedSynchRequest.java 7 Jun 2007 14:25:44 -0000 1.2 >+++ src/org/eclipse/emf/workspace/util/ChangedSynchRequest.java 14 Nov 2007 13:12:09 -0000 >@@ -35,6 +35,7 @@ > super(synch, resource); > } > >+ @Override > protected void doPerform() { > if (!synch.getDelegate().handleResourceChanged(resource)) { > // note that if our delegate is the default, it >Index: src/org/eclipse/emf/workspace/util/OperationChangeDescription.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/util/OperationChangeDescription.java,v >retrieving revision 1.3 >diff -u -r1.3 OperationChangeDescription.java >--- src/org/eclipse/emf/workspace/util/OperationChangeDescription.java 7 Jun 2007 14:25:44 -0000 1.3 >+++ src/org/eclipse/emf/workspace/util/OperationChangeDescription.java 14 Nov 2007 13:12:09 -0000 >@@ -48,7 +48,7 @@ > implements TransactionChangeDescription { > private boolean isRedone = true; > private IUndoableOperation operation; >- private Reference info; >+ private Reference<IAdaptable> info; > > /** > * Initializes me with the undoable operation that I encapsulate and the >@@ -60,7 +60,7 @@ > public OperationChangeDescription(IUndoableOperation operation, IAdaptable info) { > this.operation = operation; > >- this.info = new WeakReference(info); >+ this.info = new WeakReference<IAdaptable>(info); > } > > /** >@@ -82,9 +82,10 @@ > * I apply my change by undoing the encapsulated operation. After it is > * undone, I dispose myself. > */ >+ @Override > public void apply() { > try { >- operation.undo(new NullProgressMonitor(), (IAdaptable) info.get()); >+ operation.undo(new NullProgressMonitor(), info.get()); > } catch (ExecutionException e) { > EMFWorkspacePlugin.INSTANCE.log(new Status( > IStatus.ERROR, >@@ -101,13 +102,14 @@ > * I apply-and-reverse by alternately undoing and redoing the encapsulated > * operation. > */ >+ @Override > public void applyAndReverse() { > try { > if (isRedone) { >- operation.undo(new NullProgressMonitor(), (IAdaptable) info.get()); >+ operation.undo(new NullProgressMonitor(), info.get()); > isRedone = false; > } else { >- operation.redo(new NullProgressMonitor(), (IAdaptable) info.get()); >+ operation.redo(new NullProgressMonitor(), info.get()); > isRedone = true; > } > } catch (ExecutionException e) { >Index: src/org/eclipse/emf/workspace/util/DeletedSynchRequest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/util/DeletedSynchRequest.java,v >retrieving revision 1.2 >diff -u -r1.2 DeletedSynchRequest.java >--- src/org/eclipse/emf/workspace/util/DeletedSynchRequest.java 7 Jun 2007 14:25:44 -0000 1.2 >+++ src/org/eclipse/emf/workspace/util/DeletedSynchRequest.java 14 Nov 2007 13:12:09 -0000 >@@ -35,6 +35,7 @@ > super(synch, resource); > } > >+ @Override > protected void doPerform() { > if (!synch.getDelegate().handleResourceDeleted(resource)) { > // note that if our delegate is the default, it >Index: src/org/eclipse/emf/workspace/util/WorkspaceSynchronizer.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/util/WorkspaceSynchronizer.java,v >retrieving revision 1.7 >diff -u -r1.7 WorkspaceSynchronizer.java >--- src/org/eclipse/emf/workspace/util/WorkspaceSynchronizer.java 25 Oct 2007 04:00:13 -0000 1.7 >+++ src/org/eclipse/emf/workspace/util/WorkspaceSynchronizer.java 14 Nov 2007 13:12:09 -0000 >@@ -19,7 +19,6 @@ > > import java.io.IOException; > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.core.resources.IFile; >@@ -78,7 +77,8 @@ > private Delegate delegate; > > // we employ a copy-on-write strategy on this collection for thread safety >- private static Collection synchronizers = new java.util.ArrayList(); >+ private static Collection<WorkspaceSynchronizer> synchronizers = >+ new java.util.ArrayList<WorkspaceSynchronizer>(); > > // we use a single listener to serve all synchronizers. > private static IResourceChangeListener workspaceListener = >@@ -163,7 +163,7 @@ > * @param delta the resource change > * @param synchRequests accumulates synch requests for the deltas > */ >- void processDelta(IResourceDelta delta, List synchRequests) { >+ void processDelta(IResourceDelta delta, List<SynchRequest> synchRequests) { > String fullPath = delta.getFullPath().toString(); > URI uri = URI.createPlatformResourceURI(fullPath, false); > ResourceSet rset = getEditingDomain().getResourceSet(); >@@ -274,7 +274,8 @@ > static void startListening(WorkspaceSynchronizer synchronizer) { > // copy-on-write for thread safety > synchronized (synchronizers) { >- Collection newList = new java.util.ArrayList(synchronizers.size() + 1); >+ Collection<WorkspaceSynchronizer> newList = >+ new java.util.ArrayList<WorkspaceSynchronizer>(synchronizers.size() + 1); > newList.addAll(synchronizers); > newList.add(synchronizer); > synchronizers = newList; >@@ -294,7 +295,8 @@ > static void stopListening(WorkspaceSynchronizer synchronizer) { > // copy-on-write for thread safety > synchronized (synchronizers) { >- Collection newList = new java.util.ArrayList(synchronizers); >+ Collection<WorkspaceSynchronizer> newList = >+ new java.util.ArrayList<WorkspaceSynchronizer>(synchronizers); > newList.remove(synchronizer); > synchronizers = newList; > >@@ -311,7 +313,7 @@ > * > * @return the currently active synchronizers > */ >- static Collection getSynchronizers() { >+ static Collection<WorkspaceSynchronizer> getSynchronizers() { > // does not need synchronization because we copy on write > return synchronizers; > } >@@ -388,7 +390,8 @@ > IResourceDelta delta = event.getDelta(); > > try { >- final List synchRequests = new java.util.ArrayList(); >+ final List<SynchRequest> synchRequests = >+ new java.util.ArrayList<SynchRequest>(); > > delta.accept(new IResourceDeltaVisitor() { > public boolean visit(IResourceDelta delta) { >@@ -422,10 +425,9 @@ > * @param delta the delta to process > * @param synchRequests accumulates synch requests for the deltas > */ >- private void processDelta(IResourceDelta delta, List synchRequests) { >- for (Iterator iter = getSynchronizers().iterator(); iter.hasNext();) { >- ((WorkspaceSynchronizer) iter.next()).processDelta( >- delta, synchRequests); >+ private void processDelta(IResourceDelta delta, List<SynchRequest> synchRequests) { >+ for (WorkspaceSynchronizer next : getSynchronizers()) { >+ next.processDelta(delta, synchRequests); > } > } > } >@@ -472,7 +474,7 @@ > * @author Christian W. Damus (cdamus) > */ > private static class ResourceSynchJob extends WorkspaceJob { >- private final List synchRequests; >+ private final List<SynchRequest> synchRequests; > > /** > * Initializes me with the list of resources changes that I am to >@@ -480,7 +482,7 @@ > * > * @param synchRequests the resource synchronization requests > */ >- ResourceSynchJob(List synchRequests) { >+ ResourceSynchJob(List<SynchRequest> synchRequests) { > super(Messages.synchJobName); > > this.synchRequests = synchRequests; >@@ -491,10 +493,11 @@ > /** > * Processes my queued resource synchronization requests. > */ >+ @Override > public IStatus runInWorkspace(IProgressMonitor monitor) { > try { >- for (Iterator iter = synchRequests.iterator(); iter.hasNext();) { >- ((SynchRequest) iter.next()).perform(); >+ for (SynchRequest next : synchRequests) { >+ next.perform(); > } > } catch (InterruptedException e) { > Tracing.catching(ResourceSynchJob.class, "run", e); //$NON-NLS-1$ >Index: src/org/eclipse/emf/workspace/util/WorkspaceValidateEditSupport.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/util/WorkspaceValidateEditSupport.java,v >retrieving revision 1.1 >diff -u -r1.1 WorkspaceValidateEditSupport.java >--- src/org/eclipse/emf/workspace/util/WorkspaceValidateEditSupport.java 3 Oct 2007 20:17:29 -0000 1.1 >+++ src/org/eclipse/emf/workspace/util/WorkspaceValidateEditSupport.java 14 Nov 2007 13:12:09 -0000 >@@ -18,14 +18,12 @@ > package org.eclipse.emf.workspace.util; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IWorkspace; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.emf.common.util.BasicEList; > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.transaction.Transaction; > import org.eclipse.emf.transaction.TransactionalEditingDomain; >@@ -52,24 +50,25 @@ > public class WorkspaceValidateEditSupport > extends ValidateEditSupport.Default { > >- protected IStatus doValidateEdit(Transaction transaction, >- Collection resources, Object context) { >+ @Override >+ protected IStatus doValidateEdit(Transaction transaction, >+ Collection<? extends Resource> resources, Object context) { > > IFile[] files = getFiles(resources); > > return ResourcesPlugin.getWorkspace().validateEdit(files, context); > } > >- protected IFile[] getFiles(Collection resources) { >- List result = new BasicEList(); >- for (Iterator iter = resources.iterator(); iter.hasNext();) { >- IFile file = WorkspaceSynchronizer.getFile((Resource) iter.next()); >+ protected IFile[] getFiles(Collection<? extends Resource> resources) { >+ List<IFile> result = new java.util.ArrayList<IFile>(); >+ for (Resource next : resources) { >+ IFile file = WorkspaceSynchronizer.getFile(next); > > if (file != null) { > result.add(file); > } > } > >- return (IFile[]) result.toArray(new IFile[result.size()]); >+ return result.toArray(new IFile[result.size()]); > } > } >Index: src/org/eclipse/emf/workspace/internal/Tracing.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/internal/Tracing.java,v >retrieving revision 1.3 >diff -u -r1.3 Tracing.java >--- src/org/eclipse/emf/workspace/internal/Tracing.java 7 Jun 2007 14:25:44 -0000 1.3 >+++ src/org/eclipse/emf/workspace/internal/Tracing.java 14 Nov 2007 13:12:09 -0000 >@@ -109,7 +109,8 @@ > /** > * The cached debug options (for optimization). > */ >- private static final Map cachedOptions = new HashMap(); >+ private static final Map<String, Boolean> cachedOptions = >+ new HashMap<String, Boolean>(); > > /** > * Retrieves a Boolean value indicating whether tracing is enabled. >@@ -137,13 +138,12 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >- new Boolean( >- Boolean.TRUE.toString().equalsIgnoreCase( >- org.eclipse.core.runtime.Platform.getDebugOption(option))); >+ Boolean.valueOf( >+ org.eclipse.core.runtime.Platform.getDebugOption(option)); > > cachedOptions.put(option, value); > } >@@ -254,7 +254,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -291,7 +291,7 @@ > * > */ > public static void catching( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -322,7 +322,7 @@ > * > */ > public static void throwing( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -343,54 +343,6 @@ > } > > /** >- * Traces the entering into the specified method of the specified class. >- * >- * @param clazz The class whose method is being entered. >- * @param methodName The name of method that is being entered. >- * >- */ >- public static void entering( >- Class clazz, >- String methodName) { >- >- if (shouldTrace(EMFWorkspaceDebugOptions.METHODS_ENTERING)) { >- >- trace( >- PREFIX_ENTERING >- + clazz.getName() >- + SEPARATOR_METHOD >- + methodName); >- } >- } >- >- /** >- * Traces the entering into the specified method of the specified class, >- * with the specified parameter. >- * >- * @param clazz The class whose method is being entered. >- * @param methodName The name of method that is being entered. >- * @param parameter The parameter to the method being entered. >- * >- */ >- public static void entering( >- Class clazz, >- String methodName, >- Object parameter) { >- >- if (shouldTrace(EMFWorkspaceDebugOptions.METHODS_ENTERING)) { >- >- trace( >- PREFIX_ENTERING >- + clazz.getName() >- + SEPARATOR_METHOD >- + methodName >- + PARENTHESIS_OPEN >- + getArgumentString(parameter) >- + PARENTHESIS_CLOSE); >- } >- } >- >- /** > * Traces the entering into the specified method of the specified class, > * with the specified parameters. > * >@@ -400,9 +352,9 @@ > * > */ > public static void entering( >- Class clazz, >+ Class<?> clazz, > String methodName, >- Object[] parameters) { >+ Object... parameters) { > > if (shouldTrace(EMFWorkspaceDebugOptions.METHODS_ENTERING)) { > >@@ -425,7 +377,7 @@ > * > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(EMFWorkspaceDebugOptions.METHODS_EXITING)) { >@@ -448,7 +400,7 @@ > * > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >Index: src/org/eclipse/emf/workspace/internal/EMFWorkspacePlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/internal/EMFWorkspacePlugin.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFWorkspacePlugin.java >--- src/org/eclipse/emf/workspace/internal/EMFWorkspacePlugin.java 3 Oct 2007 20:16:28 -0000 1.3 >+++ src/org/eclipse/emf/workspace/internal/EMFWorkspacePlugin.java 14 Nov 2007 13:12:09 -0000 >@@ -42,6 +42,7 @@ > } > > // implements the inherited method >+ @Override > public ResourceLocator getPluginResourceLocator() { > return plugin; > } >@@ -84,6 +85,7 @@ > /** > * This method is called upon plug-in activation > */ >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > } >@@ -91,6 +93,7 @@ > /** > * This method is called when the plug-in is stopped > */ >+ @Override > public void stop(BundleContext context) throws Exception { > super.stop(context); > EMFWorkspacePlugin.plugin = null; >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:07:11 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:12:08 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:52:31 EST 2006 >+#Sun Nov 11 14:27:35 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >Index: src/org/eclipse/emf/workspace/ResourceUndoContext.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/ResourceUndoContext.java,v >retrieving revision 1.4 >diff -u -r1.4 ResourceUndoContext.java >--- src/org/eclipse/emf/workspace/ResourceUndoContext.java 2 Feb 2006 16:24:23 -0000 1.4 >+++ src/org/eclipse/emf/workspace/ResourceUndoContext.java 14 Nov 2007 13:12:08 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -18,7 +18,6 @@ > > import java.util.Collection; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > import java.util.Set; > >@@ -82,6 +81,7 @@ > * I am equal to other <code>ResourceUndoContexts</code> on the same > * resource as mine. > */ >+ @Override > public boolean equals(Object o) { > boolean result = false; > >@@ -93,6 +93,7 @@ > } > > // Redefines the inherited method >+ @Override > public int hashCode() { > return resource == null ? 0 : resource.hashCode(); > } >@@ -125,20 +126,21 @@ > * @return the resources affected by the specified notifications. > * The resulting set should be treated as unmodifiable > */ >- public static Set getAffectedResources(List notifications) { >- Set result; >+ public static Set<Resource> getAffectedResources( >+ List<? extends Notification> notifications) { >+ >+ Set<Resource> result; > > if (notifications.isEmpty()) { >- result = Collections.EMPTY_SET; >+ result = Collections.emptySet(); > } else { >- result = new java.util.HashSet(); >+ result = new java.util.HashSet<Resource>(); > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >+ for (Notification next : notifications) { > Object notifier = next.getNotifier(); > > if (notifier instanceof Resource) { >- result.add(notifier); >+ result.add((Resource) notifier); > } else if (notifier instanceof EObject) { > EObject eobj = (EObject) notifier; > Resource resource = eobj.eResource(); >@@ -170,14 +172,14 @@ > * @return the {@link Resource}s that it affects, or an empty set if none. > * The resulting set should be treated as unmodifiable > */ >- public static Set getAffectedResources(IUndoableOperation operation) { >- Set result; >+ public static Set<Resource> getAffectedResources(IUndoableOperation operation) { >+ Set<Resource> result; > IUndoContext[] contexts = operation.getContexts(); > > if (contexts.length == 0) { >- result = Collections.EMPTY_SET; >+ result = Collections.emptySet(); > } else { >- result = new java.util.HashSet(); >+ result = new java.util.HashSet<Resource>(); > > for (int i = 0; i < contexts.length; i++) { > if (contexts[i] instanceof ResourceUndoContext) { >@@ -197,7 +199,7 @@ > * @param notification a potential cross-resource reference change notification > */ > private static void handleCrossResourceReference( >- Set resources, >+ Set<Resource> resources, > Notification notification) { > > Object oldValue = notification.getOldValue(); >@@ -229,15 +231,17 @@ > resources.add(resource); > } > break; >- case Notification.ADD_MANY: >- for (Iterator iter = ((Collection) newValue).iterator(); iter.hasNext();) { >- resource = ((EObject) iter.next()).eResource(); >+ case Notification.ADD_MANY: { >+ @SuppressWarnings("unchecked") >+ Collection<EObject> newReferences = (Collection<EObject>) newValue; >+ for (EObject next : newReferences) { >+ resource = next.eResource(); > > if (resource != null) { > resources.add(resource); > } > } >- break; >+ break;} > case Notification.REMOVE: > resource = ((EObject) oldValue).eResource(); > >@@ -245,15 +249,17 @@ > resources.add(resource); > } > break; >- case Notification.REMOVE_MANY: >- for (Iterator iter = ((Collection) oldValue).iterator(); iter.hasNext();) { >- resource = ((EObject) iter.next()).eResource(); >+ case Notification.REMOVE_MANY: { >+ @SuppressWarnings("unchecked") >+ Collection<EObject> oldReferences = (Collection<EObject>) oldValue; >+ for (EObject next : oldReferences) { >+ resource = next.eResource(); > > if (resource != null) { > resources.add(resource); > } > } >- break; >+ break;} > } > } > } >Index: src/org/eclipse/emf/workspace/EMFCommandOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/EMFCommandOperation.java,v >retrieving revision 1.8 >diff -u -r1.8 EMFCommandOperation.java >--- src/org/eclipse/emf/workspace/EMFCommandOperation.java 13 Jun 2007 12:27:26 -0000 1.8 >+++ src/org/eclipse/emf/workspace/EMFCommandOperation.java 14 Nov 2007 13:12:08 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.workspace; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > >@@ -83,7 +82,9 @@ > * @param command my command > * @param options transaction options, or <code>null</code> for the defaults > */ >- public EMFCommandOperation(TransactionalEditingDomain domain, Command command, Map options) { >+ public EMFCommandOperation(TransactionalEditingDomain domain, Command command, >+ Map<?, ?> options) { >+ > super(domain, command.getLabel(), options); > > this.command = command; >@@ -103,6 +104,7 @@ > /** > * I can execute if my command can execute. > */ >+ @Override > public boolean canExecute() { > return super.canExecute() && command.canExecute(); > } >@@ -110,6 +112,7 @@ > /** > * Executes me by executing my command. > */ >+ @Override > protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -118,6 +121,7 @@ > return Status.OK_STATUS; > } > >+ @Override > protected void didCommit(Transaction transaction) { > super.didCommit(transaction); > >@@ -131,6 +135,7 @@ > /** > * I can undo if my command or (if any) trigger command can undo. > */ >+ @Override > public boolean canUndo() { > return super.canUndo() && > (command.canUndo() && ((triggerCommand == null) || triggerCommand.canUndo())); >@@ -139,6 +144,7 @@ > /** > * Undoes me by undoing my trigger command (if any) and my command. > */ >+ @Override > protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > if (triggerCommand != null) { > triggerCommand.undo(); >@@ -153,6 +159,7 @@ > * I can redo if either my wrapped command is a {@link ConditionalRedoCommand} > * that can undo, or it is not a conditionally redoable command. > */ >+ @Override > public boolean canRedo() { > return super.canRedo() && > (canRedo(command) && ((triggerCommand == null) || canRedo(triggerCommand))); >@@ -166,6 +173,7 @@ > /** > * Redoes me by redoing my command and my trigger command (if any). > */ >+ @Override > protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > command.redo(); > >@@ -180,7 +188,8 @@ > * Extends the inherited implementation to additionally dispose my command > * and my trigger command (if any). > */ >- public void dispose() { >+ @Override >+ public void dispose() { > super.dispose(); > > if (command != null) { >@@ -197,7 +206,8 @@ > * > * @see EMFOperationTransaction > */ >- Transaction createTransaction(Map options) throws InterruptedException { >+ @Override >+ Transaction createTransaction(Map<?, ?> options) throws InterruptedException { > InternalTransactionalCommandStack stack = > (InternalTransactionalCommandStack) getEditingDomain().getCommandStack(); > >@@ -227,9 +237,9 @@ > > if (cmd instanceof CompoundCommand) { > CompoundCommand compound = (CompoundCommand) cmd; >- List nested = compound.getCommandList(); >+ List<Command> nested = compound.getCommandList(); > if (!nested.isEmpty()) { >- improveLabel((Command) nested.get(0)); >+ improveLabel(nested.get(0)); > return; > } > } else if (cmd instanceof SetCommand) { >@@ -265,11 +275,10 @@ > owner, IItemPropertySource.class); > > if (source != null) { >- Collection descriptors = source.getPropertyDescriptors(owner); >+ Collection<IItemPropertyDescriptor> descriptors = >+ source.getPropertyDescriptors(owner); > >- for (Iterator iter = descriptors.iterator(); iter.hasNext();) { >- IItemPropertyDescriptor next = (IItemPropertyDescriptor) iter.next(); >- >+ for (IItemPropertyDescriptor next : descriptors) { > if (next.getFeature(owner) == feature) { > setLabel(NLS.bind(pattern, next.getDisplayName(owner))); > break; >Index: src/org/eclipse/emf/workspace/CompositeEMFOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/CompositeEMFOperation.java,v >retrieving revision 1.4 >diff -u -r1.4 CompositeEMFOperation.java >--- src/org/eclipse/emf/workspace/CompositeEMFOperation.java 19 May 2006 17:19:47 -0000 1.4 >+++ src/org/eclipse/emf/workspace/CompositeEMFOperation.java 14 Nov 2007 13:12:08 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -92,7 +92,7 @@ > */ > public class CompositeEMFOperation extends AbstractEMFOperation { > >- private final List children; >+ private final List<IUndoableOperation> children; > private boolean transactionNestingEnabled = true; > > /** >@@ -114,7 +114,8 @@ > * @param options for the transaction in which I execute myself, or > * <code>null</code> for the default options > */ >- public CompositeEMFOperation(TransactionalEditingDomain domain, String label, Map options) { >+ public CompositeEMFOperation(TransactionalEditingDomain domain, String label, >+ Map<?, ?> options) { > this(domain, label, null, options); > } > >@@ -125,7 +126,8 @@ > * @param label my user-readable label > * @param children a list of operations to compose > */ >- public CompositeEMFOperation(TransactionalEditingDomain domain, String label, List children) { >+ public CompositeEMFOperation(TransactionalEditingDomain domain, String label, >+ List<? extends IUndoableOperation> children) { > this(domain, label, children, null); > } > >@@ -139,13 +141,14 @@ > * @param options for the transaction in which I execute myself, or > * <code>null</code> for the default options > */ >- public CompositeEMFOperation(TransactionalEditingDomain domain, String label, List children, Map options) { >+ public CompositeEMFOperation(TransactionalEditingDomain domain, String label, >+ List<? extends IUndoableOperation> children, Map<?, ?> options) { > super(domain, label, options); > > if (children != null) { >- this.children = new java.util.ArrayList(children); >+ this.children = new java.util.ArrayList<IUndoableOperation>(children); > } else { >- this.children = new java.util.ArrayList(); >+ this.children = new java.util.ArrayList<IUndoableOperation>(); > } > } > >@@ -155,10 +158,11 @@ > * so that they may be correctly rolled back (in sequence) in the event > * of rollback, undo, or redo. > */ >+ @Override > protected final IStatus doExecute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >- final List result = new java.util.ArrayList(size()); >+ final List<IStatus> result = new java.util.ArrayList<IStatus>(size()); > > if (monitor == null) { > monitor = new NullProgressMonitor(); >@@ -167,7 +171,7 @@ > monitor.beginTask(getLabel(), size()); > > try { >- for (ListIterator iter = listIterator(); iter.hasNext();) { >+ for (ListIterator<IUndoableOperation> iter = listIterator(); iter.hasNext();) { > if (monitor.isCanceled()) { > // abort the current transaction so that it will rollback > // any changes already committed by child transactions >@@ -181,7 +185,7 @@ > } > > Transaction childTransaction = null; >- IUndoableOperation next = (IUndoableOperation) iter.next(); >+ IUndoableOperation next = iter.next(); > IStatus status = null; > > if (!(next instanceof AbstractEMFOperation)) { >@@ -262,7 +266,7 @@ > private Transaction createNonEMFTransaction( > IUndoableOperation operation, > IAdaptable info, >- Map options) >+ Map<?, ?> options) > throws InterruptedException { > > InternalTransaction result = new NonEMFTransaction( >@@ -273,6 +277,7 @@ > return result; > } > >+ @Override > protected void didCommit(Transaction transaction) { > super.didCommit(transaction); > >@@ -280,21 +285,25 @@ > if (triggers != null) { > // append a child operation for the triggers > getChildren().add(new AbstractOperation("") { //$NON-NLS-1$ >+ @Override > public boolean canUndo() { > return triggers.canUndo(); > } > >+ @Override > public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > // this method will never be called > triggers.execute(); > return Status.OK_STATUS; > } > >+ @Override > public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > triggers.redo(); > return Status.OK_STATUS; > } > >+ @Override > public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { > triggers.undo(); > return Status.OK_STATUS; >@@ -306,12 +315,13 @@ > /** > * I can execute if all of my children can execute. > */ >+ @Override > public boolean canExecute() { > boolean result = super.canExecute(); > > if (result) { >- for (Iterator iter = iterator(); result && iter.hasNext();) { >- result = ((IUndoableOperation) iter.next()).canExecute(); >+ for (Iterator<IUndoableOperation> iter = iterator(); result && iter.hasNext();) { >+ result = iter.next().canExecute(); > } > } > >@@ -322,12 +332,13 @@ > * I can undo if my transaction successfully completed with changes recorded > * and my children can all be undone. > */ >+ @Override > public boolean canUndo() { > boolean result = (getChange() != null); > > if (result && isTransactionNestingEnabled()) { >- for (Iterator iter = iterator(); result && iter.hasNext();) { >- result = ((IUndoableOperation) iter.next()).canUndo(); >+ for (Iterator<IUndoableOperation> iter = iterator(); result && iter.hasNext();) { >+ result = iter.next().canUndo(); > } > } > >@@ -337,6 +348,7 @@ > /** > * I undo by asking my children to undo, in reverse order. > */ >+ @Override > protected final IStatus doUndo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -347,7 +359,7 @@ > return super.doUndo(monitor, info); > } > >- final List result = new java.util.ArrayList(size()); >+ final List<IStatus> result = new java.util.ArrayList<IStatus>(size()); > > if (monitor == null) { > monitor = new NullProgressMonitor(); >@@ -356,8 +368,10 @@ > ExecutionException caughtException = null; > monitor.beginTask(getLabel(), size()); > >- for (ListIterator iter = listIterator(size()); iter.hasPrevious();) { >- IUndoableOperation prev = (IUndoableOperation) iter.previous(); >+ for (ListIterator<IUndoableOperation> iter = listIterator(size()); >+ iter.hasPrevious();) { >+ >+ IUndoableOperation prev = iter.previous(); > IStatus status = null; > > try { >@@ -392,7 +406,7 @@ > > while (iter.hasNext()) { > // unwind the child operations >- IUndoableOperation next = (IUndoableOperation) iter.next(); >+ IUndoableOperation next = iter.next(); > if (!next.canRedo()) { > // oops! Can't continue unwinding. Oh, well > EMFWorkspacePlugin.INSTANCE.log(new Status( >@@ -435,12 +449,13 @@ > * I can redo if my transaction successfully completed with changes recorded > * and my children can all be redone. > */ >+ @Override > public boolean canRedo() { > boolean result = (getChange() != null); > > if (result && isTransactionNestingEnabled()) { >- for (Iterator iter = iterator(); result && iter.hasNext();) { >- result = ((IUndoableOperation) iter.next()).canRedo(); >+ for (Iterator<IUndoableOperation> iter = iterator(); result && iter.hasNext();) { >+ result = iter.next().canRedo(); > } > } > >@@ -450,6 +465,7 @@ > /** > * I undo by asking my children to redo, in forward order. > */ >+ @Override > protected final IStatus doRedo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -460,7 +476,7 @@ > return super.doRedo(monitor, info); > } > >- final List result = new java.util.ArrayList(size()); >+ final List<IStatus> result = new java.util.ArrayList<IStatus>(size()); > > if (monitor == null) { > monitor = new NullProgressMonitor(); >@@ -469,8 +485,8 @@ > ExecutionException caughtException = null; > monitor.beginTask(getLabel(), size()); > >- for (ListIterator iter = listIterator(); iter.hasNext();) { >- IUndoableOperation next = (IUndoableOperation) iter.next(); >+ for (ListIterator<IUndoableOperation> iter = listIterator(); iter.hasNext();) { >+ IUndoableOperation next = iter.next(); > IStatus status = null; > > try { >@@ -505,7 +521,7 @@ > > while (iter.hasPrevious()) { > // unwind the child operations >- IUndoableOperation prev = (IUndoableOperation) iter.previous(); >+ IUndoableOperation prev = iter.previous(); > if (!prev.canUndo()) { > // oops! Can't continue unwinding. Oh, well > EMFWorkspacePlugin.INSTANCE.log(new Status( >@@ -545,11 +561,14 @@ > /** > * Removes all of my children and disposes them. > */ >+ @Override > public void dispose() { > super.dispose(); > >- for (ListIterator iter = listIterator(size()); iter.hasPrevious();) { >- ((IUndoableOperation) iter.previous()).dispose(); >+ for (ListIterator<IUndoableOperation> iter = listIterator(size()); >+ iter.hasPrevious();) { >+ >+ iter.previous().dispose(); > iter.remove(); > } > } >@@ -569,7 +588,7 @@ > * @see #iterator() > * @see #listIterator(int) > */ >- protected List getChildren() { >+ protected List<IUndoableOperation> getChildren() { > return children; > } > >@@ -665,8 +684,8 @@ > private boolean anyChildHasContext(IUndoContext ctx) { > boolean result = false; > >- for (Iterator iter = iterator(); !result && iter.hasNext();) { >- result = ((IUndoableOperation) iter.next()).hasContext(ctx); >+ for (Iterator<IUndoableOperation> iter = iterator(); !result && iter.hasNext();) { >+ result = iter.next().hasContext(ctx); > } > > return result; >@@ -677,6 +696,7 @@ > * {@link #setTransactionNestingDisabled(boolean) transaction nesting} > * state accordingly. > */ >+ @Override > void setReuseParentTransaction(boolean reuseParentTransaction) { > super.setReuseParentTransaction(reuseParentTransaction); > >@@ -744,7 +764,7 @@ > * > * @return an iterator of my children > */ >- public Iterator iterator() { >+ public Iterator<IUndoableOperation> iterator() { > return new ChildIterator(); > } > >@@ -762,7 +782,7 @@ > * > * @return an iterator of my children > */ >- public ListIterator listIterator() { >+ public ListIterator<IUndoableOperation> listIterator() { > return new ChildListIterator(0); > } > >@@ -783,7 +803,7 @@ > * > * @return an iterator of my children > */ >- public ListIterator listIterator(int index) { >+ public ListIterator<IUndoableOperation> listIterator(int index) { > return new ChildListIterator(index); > } > >@@ -793,9 +813,9 @@ > * > * @author Christian W. Damus (cdamus) > */ >- private class ChildIterator implements Iterator { >- protected Object last; >- protected final ListIterator iter; >+ private class ChildIterator implements Iterator<IUndoableOperation> { >+ protected IUndoableOperation last; >+ protected final ListIterator<IUndoableOperation> iter; > > ChildIterator() { > this(0); >@@ -809,11 +829,11 @@ > assertNotExecuted(); > > iter.remove(); >- didRemove((IUndoableOperation) last); >+ didRemove(last); > last = null; > } > >- public Object next() { >+ public IUndoableOperation next() { > last = iter.next(); > return last; > } >@@ -829,28 +849,30 @@ > * > * @author Christian W. Damus (cdamus) > */ >- private class ChildListIterator extends ChildIterator implements ListIterator { >+ private class ChildListIterator extends ChildIterator >+ implements ListIterator<IUndoableOperation> { >+ > ChildListIterator(int index) { > super(index); > } > >- public void add(Object o) { >+ public void add(IUndoableOperation o) { > assertNotExecuted(); > > if (!getChildren().contains(o)) { > iter.add(o); >- didAdd((IUndoableOperation) o); >+ didAdd(o); > } > } > >- public void set(Object o) { >+ public void set(IUndoableOperation o) { > assertNotExecuted(); > > if (!getChildren().contains(o)) { >- didRemove((IUndoableOperation) last); >+ didRemove(last); > iter.set(o); > last = o; >- didAdd((IUndoableOperation) o); >+ didAdd(o); > } > } > >@@ -862,7 +884,7 @@ > return iter.nextIndex(); > } > >- public Object previous() { >+ public IUndoableOperation previous() { > last = iter.previous(); > return last; > } >Index: src/org/eclipse/emf/workspace/AbstractEMFOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/AbstractEMFOperation.java,v >retrieving revision 1.16 >diff -u -r1.16 AbstractEMFOperation.java >--- src/org/eclipse/emf/workspace/AbstractEMFOperation.java 3 Oct 2007 20:16:28 -0000 1.16 >+++ src/org/eclipse/emf/workspace/AbstractEMFOperation.java 14 Nov 2007 13:12:08 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.workspace; > > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > >@@ -70,7 +69,7 @@ > */ > public abstract class AbstractEMFOperation extends AbstractOperation { > private final InternalTransactionalEditingDomain domain; >- private final Map txOptions; >+ private final Map<Object, Object> txOptions; > > private Transaction transaction; > private TransactionChangeDescription change; >@@ -97,19 +96,25 @@ > * @param options for the transaction in which I execute myself, or > * <code>null</code> for the default options > */ >- public AbstractEMFOperation(TransactionalEditingDomain domain, String label, Map options) { >+ public AbstractEMFOperation(TransactionalEditingDomain domain, String label, >+ Map<?, ?> options) { >+ > super(label); > > this.domain = (InternalTransactionalEditingDomain) domain; >+ > if (options == null) { >- this.txOptions = Collections.singletonMap(TransactionImpl.BLOCK_CHANGE_PROPAGATION, Boolean.TRUE); >+ this.txOptions = Collections.<Object, Object>singletonMap( >+ TransactionImpl.BLOCK_CHANGE_PROPAGATION, Boolean.TRUE); > } else { > // make a defensive copy to > // - avoid modifying client's data > // - guard against client modifying my map > // - avoid exceptions on immutable maps >- this.txOptions = new java.util.HashMap(options); >- this.txOptions.put(TransactionImpl.BLOCK_CHANGE_PROPAGATION, Boolean.TRUE); >+ Map<Object, Object> myOptions = new java.util.HashMap<Object, Object>( >+ options); >+ myOptions.put(TransactionImpl.BLOCK_CHANGE_PROPAGATION, Boolean.TRUE); >+ this.txOptions = Collections.unmodifiableMap(myOptions); > } > } > >@@ -120,6 +125,7 @@ > * > * @see #doExecute(IProgressMonitor, IAdaptable) > */ >+ @Override > public final IStatus execute(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -128,14 +134,15 @@ > } > > transaction = null; >- final List result = new java.util.ArrayList(2); >+ final List<IStatus> result = new java.util.ArrayList<IStatus>(2); > > try { > // add to the transaction a reference to myself for the > // command stack's benefit, unless I would be inheriting > // a reference to a nesting operation >- Map options = new java.util.HashMap(getOptions()); >- Map inherited = inheritedOptions(); >+ Map<Object, Object> options = new java.util.HashMap<Object, Object>( >+ getOptions()); >+ Map<?, ?> inherited = inheritedOptions(); > if (inherited.containsKey(EMFWorkspacePlugin.OPTION_OWNING_OPERATION)) { > options.put(EMFWorkspacePlugin.OPTION_OWNING_OPERATION, > inherited.get(EMFWorkspacePlugin.OPTION_OWNING_OPERATION)); >@@ -195,7 +202,7 @@ > * @return <code>false</code> if either there is an active transaction and it > * has the same options as specified; <code>true</code>, otherwise > */ >- private boolean optionsDiffer(Map options) { >+ private boolean optionsDiffer(Map<?, ?> options) { > boolean result = true; > > Transaction active = >@@ -214,8 +221,8 @@ > * @return options currently in effect that would be inherited by a new > * transaction that I might create > */ >- private Map inheritedOptions() { >- Map result = Collections.EMPTY_MAP; >+ private Map<?, ?> inheritedOptions() { >+ Map<?, ?> result = Collections.EMPTY_MAP; > > Transaction active = > ((InternalTransactionalEditingDomain) getEditingDomain()).getActiveTransaction(); >@@ -237,17 +244,16 @@ > * > * @return the multi-status > */ >- protected IStatus aggregateStatuses(List statuses) { >+ protected IStatus aggregateStatuses(List<? extends IStatus> statuses) { > final IStatus result; > > if (statuses.isEmpty()) { > result = Status.OK_STATUS; > } else if (statuses.size() == 1) { >- result = ((IStatus) statuses.get(0)); >+ result = statuses.get(0); > } else { > // find the most severe status, to use its plug-in, code, and message >- IStatus[] children = (IStatus[]) statuses.toArray( >- new IStatus[statuses.size()]); >+ IStatus[] children = statuses.toArray(new IStatus[statuses.size()]); > > IStatus worst = children[0]; > for (int i = 1; i < children.length; i++) { >@@ -297,9 +303,8 @@ > > private void gatherUndoContextsFromTrigger(Command trigger) { > if (trigger instanceof CompoundCommand) { >- for (Iterator i = ((CompoundCommand) trigger).getCommandList() >- .iterator(); i.hasNext();) { >- gatherUndoContextsFromTrigger((Command)i.next()); >+ for (Command next : ((CompoundCommand) trigger).getCommandList()) { >+ gatherUndoContextsFromTrigger(next); > } > } else if (trigger instanceof EMFOperationCommand) { > IUndoContext[] undoContextsToAdd = ((EMFOperationCommand)trigger).getOperation().getContexts(); >@@ -316,6 +321,7 @@ > * successfully executed. Subclasses would not usually need to override > * this method. > */ >+ @Override > public boolean canUndo() { > return (getChange() == null) || getChange().canApply(); > } >@@ -323,6 +329,7 @@ > /** > * Undoes me by inverting my recorded changes in a transaction. > */ >+ @Override > public final IStatus undo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -384,6 +391,7 @@ > * successfully executed. Subclasses would not usually need to override > * this method. > */ >+ @Override > public boolean canRedo() { > return (getChange() == null) || getChange().canApply(); > } >@@ -391,6 +399,7 @@ > /** > * Redoes me by replaying my recorded changes in a transaction. > */ >+ @Override > public final IStatus redo(IProgressMonitor monitor, IAdaptable info) > throws ExecutionException { > >@@ -461,7 +470,7 @@ > * > * @return my options, or an empty map if none > */ >- public final Map getOptions() { >+ public final Map<?, ?> getOptions() { > return txOptions; > } > >@@ -476,7 +485,7 @@ > * @throws InterruptedException if the current thread was interrupted while > * waiting for the transaction to start > */ >- Transaction createTransaction(Map options) throws InterruptedException { >+ Transaction createTransaction(Map<?, ?> options) throws InterruptedException { > return domain.startTransaction(false, options); > } > >@@ -591,6 +600,7 @@ > /** > * Forgets my transaction and its change description. > */ >+ @Override > public void dispose() { > super.dispose(); > >Index: src/org/eclipse/emf/workspace/WorkspaceEditingDomainFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/WorkspaceEditingDomainFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 WorkspaceEditingDomainFactory.java >--- src/org/eclipse/emf/workspace/WorkspaceEditingDomainFactory.java 7 Jun 2007 14:25:44 -0000 1.3 >+++ src/org/eclipse/emf/workspace/WorkspaceEditingDomainFactory.java 14 Nov 2007 13:12:08 -0000 >@@ -51,6 +51,7 @@ > * > * @return the new editing domain > */ >+ @Override > public TransactionalEditingDomain createEditingDomain() { > return createEditingDomain(OperationHistoryFactory.getOperationHistory()); > } >@@ -63,6 +64,7 @@ > * > * @return the new editing domain > */ >+ @Override > public TransactionalEditingDomain createEditingDomain(ResourceSet rset) { > return createEditingDomain( > rset, >Index: src/org/eclipse/emf/workspace/EMFOperationCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/EMFOperationCommand.java,v >retrieving revision 1.6 >diff -u -r1.6 EMFOperationCommand.java >--- src/org/eclipse/emf/workspace/EMFOperationCommand.java 13 Jun 2007 12:27:26 -0000 1.6 >+++ src/org/eclipse/emf/workspace/EMFOperationCommand.java 14 Nov 2007 13:12:08 -0000 >@@ -20,6 +20,7 @@ > import java.lang.ref.WeakReference; > import java.util.Arrays; > import java.util.Collection; >+import java.util.Collections; > import java.util.Map; > > import org.eclipse.core.commands.ExecutionException; >@@ -62,7 +63,7 @@ > public class EMFOperationCommand implements ConditionalRedoCommand { > private final TransactionalEditingDomain domain; > private IUndoableOperation operation; >- private Reference adaptable; >+ private Reference<IAdaptable> adaptable; > > /** > * Initializes me with the undoable operation that I wrap. >@@ -102,7 +103,7 @@ > this.operation = operation; > > if (adaptable != null) { >- this.adaptable = new WeakReference(adaptable); >+ this.adaptable = new WeakReference<IAdaptable>(adaptable); > } > } > >@@ -188,7 +189,7 @@ > private Transaction createNonEMFTransaction( > IUndoableOperation operation, > IAdaptable info, >- Map options) >+ Map<?, ?> options) > throws InterruptedException { > > InternalTransaction result = new NonEMFTransaction( >@@ -268,16 +269,16 @@ > } > > // Documentation copied from the inherited specification >- public Collection getResult() { >- return null; >+ public Collection<?> getResult() { >+ return Collections.EMPTY_LIST; > } > > /** > * Obtains the affected objects from my wrapped operation, if it is an > * {@link IAdvancedUndoableOperation}. > */ >- public Collection getAffectedObjects() { >- Collection result = null; >+ public Collection<?> getAffectedObjects() { >+ Collection<Object> result = null; > > if (operation instanceof IAdvancedUndoableOperation) { > Object[] affected = ((IAdvancedUndoableOperation) operation).getAffectedObjects(); >@@ -339,7 +340,7 @@ > IAdaptable result = null; > > if (adaptable != null) { >- result = (IAdaptable) adaptable.get(); >+ result = adaptable.get(); > } > > return result; >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:07:11 -0000 1.2 >+++ .classpath 14 Nov 2007 13:12:08 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:25:44 -0000 1.5 >+++ build.properties 14 Nov 2007 13:12:08 -0000 >@@ -22,5 +22,5 @@ > modeling32.png,\ > plugin.properties > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:29 -0000 1.9 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:12:08 -0000 >@@ -16,4 +16,4 @@ > org.eclipse.emf.workspace.internal;x-friends:="org.eclipse.emf.workspace.tests", > org.eclipse.emf.workspace.internal.l10n;x-friends:="org.eclipse.emf.workspace.tests", > org.eclipse.emf.workspace.util >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: src/org/eclipse/emf/workspace/impl/NonEMFTransaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/impl/NonEMFTransaction.java,v >retrieving revision 1.4 >diff -u -r1.4 NonEMFTransaction.java >--- src/org/eclipse/emf/workspace/impl/NonEMFTransaction.java 7 Jun 2007 14:25:44 -0000 1.4 >+++ src/org/eclipse/emf/workspace/impl/NonEMFTransaction.java 14 Nov 2007 13:12:08 -0000 >@@ -64,7 +64,7 @@ > public NonEMFTransaction(TransactionalEditingDomain domain, > IUndoableOperation operation, > IAdaptable info, >- Map options) { >+ Map<?, ?> options) { > super(domain, false, customizeOptions(options)); > > this.operation = operation; >@@ -80,7 +80,7 @@ > * @return A new map of options that should be passed to the superclass to > * become our official set of options. > */ >- private static Map customizeOptions(Map options) { >+ private static Map<?, ?> customizeOptions(Map<?, ?> options) { > // Copy the options and add the special non-change description propagation > // option. We do this because if by any chance that the child operation > // invokes some AbstractEMFOperation again then it will be handling the >@@ -88,15 +88,16 @@ > // transactions by default will propagate all of the change descriptions upward. > // This can cause situations where the same change description object is applied > // and reversed twice. >- options = new HashMap(options); >- options.put(TransactionImpl.ALLOW_CHANGE_PROPAGATION_BLOCKING, Boolean.TRUE); >+ Map<Object, Object> result = new HashMap<Object, Object>(options); >+ result.put(TransactionImpl.ALLOW_CHANGE_PROPAGATION_BLOCKING, true); > >- return options; >+ return result; > } > > /** > * Appends my non-EMF change and commits. > */ >+ @Override > public void commit() throws RollbackException { > change.add(new OperationChangeDescription(operation, info)); > >Index: src/org/eclipse/emf/workspace/impl/EMFOperationTransaction.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/impl/EMFOperationTransaction.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFOperationTransaction.java >--- src/org/eclipse/emf/workspace/impl/EMFOperationTransaction.java 7 Jun 2007 14:25:44 -0000 1.3 >+++ src/org/eclipse/emf/workspace/impl/EMFOperationTransaction.java 14 Nov 2007 13:12:08 -0000 >@@ -41,7 +41,8 @@ > * @param domain my editing domain > * @param options my options > */ >- public EMFOperationTransaction(Command command, InternalTransactionalEditingDomain domain, Map options) { >+ public EMFOperationTransaction(Command command, >+ InternalTransactionalEditingDomain domain, Map<?, ?> options) { > super(command, domain, options); > } > >Index: src/org/eclipse/emf/workspace/impl/WorkspaceCommandStackImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.workspace/src/org/eclipse/emf/workspace/impl/WorkspaceCommandStackImpl.java,v >retrieving revision 1.10 >diff -u -r1.10 WorkspaceCommandStackImpl.java >--- src/org/eclipse/emf/workspace/impl/WorkspaceCommandStackImpl.java 3 Oct 2007 20:16:28 -0000 1.10 >+++ src/org/eclipse/emf/workspace/impl/WorkspaceCommandStackImpl.java 14 Nov 2007 13:12:09 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.workspace.impl; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > import java.util.Set; >@@ -95,6 +94,7 @@ > * Extends the superclass implementation to add/remove listeners on the > * editing domain. > */ >+ @Override > public void setEditingDomain(InternalTransactionalEditingDomain domain) { > InternalTransactionalEditingDomain oldDomain = getDomain(); > >@@ -133,7 +133,8 @@ > * > * @since 1.1 > */ >- protected void doExecute(Command command, Map options) >+ @Override >+ protected void doExecute(Command command, Map<?, ?> options) > throws InterruptedException, RollbackException { > EMFCommandOperation oper = new EMFCommandOperation(getDomain(), command, options); > >@@ -177,6 +178,7 @@ > /** > * Queries whether we can undo my default undo context in my operation history. > */ >+ @Override > public boolean canUndo() { > return getOperationHistory().canUndo(getDefaultUndoContext()); > } >@@ -184,6 +186,7 @@ > /** > * Undoes my default undo context in my operation history. > */ >+ @Override > public void undo() { > try { > getOperationHistory().undo( >@@ -205,6 +208,7 @@ > /** > * Queries whether we can redo my default undo context in my operation history. > */ >+ @Override > public boolean canRedo() { > return getOperationHistory().canRedo(getDefaultUndoContext()); > } >@@ -212,6 +216,7 @@ > /** > * Redoes my default undo context in my operation history. > */ >+ @Override > public void redo() { > try { > getOperationHistory().redo( >@@ -233,6 +238,7 @@ > /** > * Disposes my default undo context in my operation history. > */ >+ @Override > public void flush() { > getOperationHistory().dispose( > getDefaultUndoContext(), >@@ -250,6 +256,7 @@ > * Gets the command from the most recently executed, done, or redone > * operation. > */ >+ @Override > public Command getMostRecentCommand() { > Command result = null; > >@@ -263,6 +270,7 @@ > /** > * Gets the command from the top of the undo history, if any. > */ >+ @Override > public Command getUndoCommand() { > Command result = null; > >@@ -279,6 +287,7 @@ > /** > * Gets the command from the top of the redo history, if any. > */ >+ @Override > public Command getRedoCommand() { > Command result = null; > >@@ -293,7 +302,9 @@ > } > > // Documentation copied from the method specification >- public EMFCommandTransaction createTransaction(Command command, Map options) throws InterruptedException { >+ public EMFCommandTransaction createTransaction(Command command, >+ Map<?, ?> options) throws InterruptedException { >+ > EMFCommandTransaction result; > > if (command instanceof TriggerCommand) { >@@ -309,7 +320,9 @@ > } > > // Documentation copied from the method specification >- public void executeTriggers(Command command, List triggers, Map options) throws InterruptedException, RollbackException { >+ public void executeTriggers(Command command, List<Command> triggers, >+ Map<?, ?> options) throws InterruptedException, RollbackException { >+ > if (!triggers.isEmpty()) { > TriggerCommand trigger = (command == null) > ? new TriggerCommand(triggers) >@@ -390,6 +403,7 @@ > } > } > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > IUndoableOperation operation = null; > >@@ -399,20 +413,18 @@ > EMFWorkspacePlugin.OPTION_OWNING_OPERATION); > } > >- Set affectedResources = ResourceUndoContext.getAffectedResources( >+ Set<Resource> affectedResources = ResourceUndoContext.getAffectedResources( > event.getNotifications()); > >- Set unloaded = getUnloadedResources(event.getNotifications()); >+ Set<Resource> unloaded = getUnloadedResources(event.getNotifications()); > if (unloaded != null) { > // don't add these resources to the operation > affectedResources.removeAll(unloaded); > > // dispose their undo contexts >- for (Iterator iter = unloaded.iterator(); iter.hasNext();) { >+ for (Resource next : unloaded) { > getOperationHistory().dispose( >- new ResourceUndoContext( >- getDomain(), >- (Resource) iter.next()), >+ new ResourceUndoContext(getDomain(), next), > true, true, true); > } > } >@@ -420,10 +432,9 @@ > if ((operation != null) && !affectedResources.isEmpty()) { > // add any resource undo contexts to this operation that are > // not already applied >- for (Iterator iter = affectedResources.iterator(); iter.hasNext();) { >+ for (Resource next : affectedResources) { > ResourceUndoContext ctx = new ResourceUndoContext( >- getDomain(), >- (Resource) iter.next()); >+ getDomain(), next); > > if (!operation.hasContext(ctx)) { > operation.addContext(ctx); >@@ -439,41 +450,43 @@ > * @return a set of resources that the notifications indicate have been > * unloaded, or <code>null</code> if none > */ >- private Set getUnloadedResources(Collection notifications) { >- Set result = null; >+ private Set<Resource> getUnloadedResources(Collection<Notification> notifications) { >+ Set<Resource> result = null; > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > if (NotificationFilter.RESOURCE_UNLOADED.matches(next)) { > if (result == null) { >- result = new java.util.HashSet(); >+ result = new java.util.HashSet<Resource>(); > } > >- result.add(next.getNotifier()); >+ result.add((Resource) next.getNotifier()); > } > } > > return result; > } > >+ @Override > public boolean isPostcommitOnly() { > // only interested in post-commit "resourceSetChanged" event > return true; > } > } > >+ @Override > public boolean isSaveNeeded() { > // We override the execute method and never call the super implementation > // so we have to implement the isSaveNeeded method ourselves. > IUndoableOperation nextUndoableOperation = history.getUndoOperation(getDefaultUndoContext()); > >- if (nextUndoableOperation == null) >+ if (nextUndoableOperation == null) { > return false; >+ } > > return savedContext != null ? !nextUndoableOperation.hasContext(getSavedContext()) : true; > } > >+ @Override > public void saveIsDone() { > // We override the execute method and never call the super implementation > // so we have to implement the saveIsDone method ourselves. >#P org.eclipse.emf.transaction.ui >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 7 Jun 2007 14:26:07 -0000 1.5 >+++ build.properties 14 Nov 2007 13:12:12 -0000 >@@ -17,5 +17,5 @@ > plugin.properties,\ > about.html > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:07:00 -0000 1.2 >+++ .classpath 14 Nov 2007 13:12:12 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryContentProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryContentProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 TransactionalAdapterFactoryContentProvider.java >--- src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryContentProvider.java 7 Jun 2007 14:26:08 -0000 1.2 >+++ src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryContentProvider.java 14 Nov 2007 13:12:12 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.emf.transaction.ui.internal.EMFTransactionUIStatusCodes; > import org.eclipse.emf.transaction.ui.internal.Tracing; > import org.eclipse.emf.transaction.ui.internal.l10n.Messages; >+import org.eclipse.emf.transaction.util.TransactionUtil; > import org.eclipse.jface.viewers.Viewer; > import org.eclipse.ui.views.properties.IPropertySource; > >@@ -61,13 +62,15 @@ > * Runs the specified runnable in the editing domain, with interrupt > * handling. > * >+ * @param <T> the result type of the runnable >+ * > * @param run the runnable to run > * > * @return its result, or <code>null</code> on interrupt > */ >- protected Object run(RunnableWithResult run) { >+ protected <T> T run(RunnableWithResult<? extends T> run) { > try { >- return domain.runExclusive(run); >+ return TransactionUtil.runExclusive(domain, run); > } catch (InterruptedException e) { > Tracing.catching(TransactionalAdapterFactoryContentProvider.class, "run", e); //$NON-NLS-1$ > >@@ -89,8 +92,9 @@ > * Extends the inherited implementation by running in a read-only transaction. > * The returned property source also uses transactions to access properties. > */ >+ @Override > protected IPropertySource createPropertySource(final Object object, final IItemPropertySource itemPropertySource) { >- return wrap((IPropertySource) run(new RunnableWithResult.Impl() { >+ return wrap(run(new RunnableWithResult.Impl<IPropertySource>() { > public void run() { > setResult(TransactionalAdapterFactoryContentProvider.super.createPropertySource(object, itemPropertySource)); > }})); >@@ -99,8 +103,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public Object[] getChildren(final Object object) { >- return (Object[]) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Object[]>() { > public void run() { > setResult(TransactionalAdapterFactoryContentProvider.super.getChildren(object)); > }}); >@@ -109,8 +114,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public Object[] getElements(final Object object) { >- return (Object[]) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Object[]>() { > public void run() { > setResult(TransactionalAdapterFactoryContentProvider.super.getElements(object)); > }}); >@@ -119,8 +125,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public Object getParent(final Object object) { >- return run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Object>() { > public void run() { > setResult(TransactionalAdapterFactoryContentProvider.super.getParent(object)); > }}); >@@ -130,8 +137,9 @@ > * Extends the inherited implementation by running in a read-only transaction. > * The returned property source also uses transactions to access properties. > */ >+ @Override > public IPropertySource getPropertySource(final Object object) { >- return wrap((IPropertySource) run(new RunnableWithResult.Impl() { >+ return wrap(run(new RunnableWithResult.Impl<IPropertySource>() { > public void run() { > setResult(TransactionalAdapterFactoryContentProvider.super.getPropertySource(object)); > }})); >@@ -140,21 +148,20 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public boolean hasChildren(final Object object) { >- Boolean result = (Boolean) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Boolean>() { > public void run() { >- setResult(TransactionalAdapterFactoryContentProvider.super.hasChildren(object) >- ? Boolean.TRUE : Boolean.FALSE); >+ setResult(TransactionalAdapterFactoryContentProvider.super.hasChildren(object)); > }}); >- >- return (result == null) ? false : result.booleanValue(); > } > > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public void inputChanged(final Viewer vwr, final Object oldInput, final Object newInput) { >- run(new RunnableWithResult.Impl() { >+ run(new RunnableWithResult.Impl<Object>() { > public void run() { > TransactionalAdapterFactoryContentProvider.super.inputChanged(vwr, oldInput, newInput); > }}); >Index: src/org/eclipse/emf/transaction/ui/provider/TransactionalPropertySource.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/src/org/eclipse/emf/transaction/ui/provider/TransactionalPropertySource.java,v >retrieving revision 1.1 >diff -u -r1.1 TransactionalPropertySource.java >--- src/org/eclipse/emf/transaction/ui/provider/TransactionalPropertySource.java 30 Jan 2006 19:47:45 -0000 1.1 >+++ src/org/eclipse/emf/transaction/ui/provider/TransactionalPropertySource.java 14 Nov 2007 13:12:12 -0000 >@@ -1,168 +1,168 @@ >-/** >- * <copyright> >- * >- * Copyright (c) 2005, 2006 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 >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM - Initial API and implementation >- * >- * </copyright> >- * >- * $Id: TransactionalPropertySource.java,v 1.1 2006/01/30 19:47:45 cdamus Exp $ >- */ >-package org.eclipse.emf.transaction.ui.provider; >- >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.emf.transaction.RunnableWithResult; >-import org.eclipse.emf.transaction.TransactionalEditingDomain; >-import org.eclipse.emf.transaction.Transaction; >-import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; >-import org.eclipse.emf.transaction.ui.internal.EMFTransactionUIPlugin; >-import org.eclipse.emf.transaction.ui.internal.EMFTransactionUIStatusCodes; >-import org.eclipse.emf.transaction.ui.internal.Tracing; >-import org.eclipse.emf.transaction.ui.internal.l10n.Messages; >-import org.eclipse.ui.views.properties.IPropertyDescriptor; >-import org.eclipse.ui.views.properties.IPropertySource; >-import org.eclipse.ui.views.properties.IPropertySource2; >- >- >-/** >- * A property source wrapper that calls its delegate in transactions of the >- * appropriate kind. Note that transactions are not actually required for >- * methods that do not access model objects. >- * >- * @author Christian W. Damus (cdamus) >- */ >-public class TransactionalPropertySource >- implements IPropertySource2 { >- >- private final TransactionalEditingDomain domain; >- >- private final IPropertySource propertySource; >- private final IPropertySource2 propertySource2; >- >- /** >- * Initializes me with the editing domain in which I create transactions, >- * and the property source that I delegate to. >- * >- * @param domain my editing domain >- * @param propertySource my delegate >- */ >- public TransactionalPropertySource(TransactionalEditingDomain domain, IPropertySource propertySource) { >- this.domain = domain; >- >- this.propertySource = propertySource; >- this.propertySource2 = (propertySource instanceof IPropertySource2) >- ? (IPropertySource2) propertySource >- : null; >- } >- >- /** >- * Runs the specified runnable in the editing domain, with interrupt >- * handling. >- * >- * @param run the runnable to run >- * >- * @return its result, or <code>null</code> on interrupt >- */ >- protected Object run(RunnableWithResult run) { >- try { >- return domain.runExclusive(run); >- } catch (InterruptedException e) { >- Tracing.catching(TransactionalPropertySource.class, "run", e); //$NON-NLS-1$ >- >- // propagate interrupt status because we are not throwing >- Thread.currentThread().interrupt(); >- >- EMFTransactionUIPlugin.INSTANCE.log(new Status( >- IStatus.ERROR, >- EMFTransactionUIPlugin.getPluginId(), >- EMFTransactionUIStatusCodes.PROPERTY_SHEET_INTERRUPTED, >- Messages.propertyInterrupt, >- e)); >- >- return null; >- } >- } >- >- /** >- * Delegates the my wrapped property source in the appropriate transaction. >- */ >- public boolean isPropertyResettable(Object id) { >- return (propertySource2 == null)? false >- : propertySource2.isPropertyResettable(id); >- } >- >- /** >- * Delegates the my wrapped property source in the appropriate transaction. >- */ >- public boolean isPropertySet(final Object id) { >- Boolean result = (Boolean) run(new RunnableWithResult.Impl() { >- public void run() { >- setResult(propertySource.isPropertySet(id) >- ? Boolean.TRUE : Boolean.FALSE); >- }}); >- >- return (result == null) ? false : result.booleanValue(); >- } >- >- /** >- * Delegates the my wrapped property source in the appropriate transaction. >- */ >- public Object getEditableValue() { >- return run(new RunnableWithResult.Impl() { >- public void run() { >- setResult(propertySource.getEditableValue()); >- }}); >- } >- >- /** >- * Delegates the my wrapped property source in the appropriate transaction. >- */ >- public IPropertyDescriptor[] getPropertyDescriptors() { >- return propertySource.getPropertyDescriptors(); >- } >- >- /** >- * Delegates the my wrapped property source in the appropriate transaction. >- */ >- public Object getPropertyValue(final Object id) { >- return run(new RunnableWithResult.Impl() { >- public void run() { >- setResult(propertySource.getPropertyValue(id)); >- }}); >- } >- >- /** >- * Delegates the my wrapped property source in the appropriate transaction. >- */ >- public void resetPropertyValue(final Object id) { >- if (propertySource2 != null) { >- // are we in a read-only context? if so, balk because we cannot upgrade >- // read transaction to write when executing a command >- Transaction tx = ((InternalTransactionalEditingDomain) domain).getActiveTransaction(); >- if ((tx == null) || !tx.isReadOnly()) { >- propertySource2.resetPropertyValue(id); >- } >- } >- } >- >- /** >- * Delegates directly to the wrapper property source, because it will use >- * a command to perform the modification (which implicitly creates a >- * read/write transaction). >- */ >- public void setPropertyValue(final Object id, final Object value) { >- // are we in a read-only context? if so, balk because we cannot upgrade >- // read transaction to write when executing a command >- Transaction tx = ((InternalTransactionalEditingDomain) domain).getActiveTransaction(); >- if ((tx == null) || !tx.isReadOnly()) { >- propertySource.setPropertyValue(id, value); >- } >- } >-} >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2005, 2006 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id: TransactionalPropertySource.java,v 1.1 2006/01/30 19:47:45 cdamus Exp $ >+ */ >+package org.eclipse.emf.transaction.ui.provider; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.transaction.RunnableWithResult; >+import org.eclipse.emf.transaction.Transaction; >+import org.eclipse.emf.transaction.TransactionalEditingDomain; >+import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; >+import org.eclipse.emf.transaction.ui.internal.EMFTransactionUIPlugin; >+import org.eclipse.emf.transaction.ui.internal.EMFTransactionUIStatusCodes; >+import org.eclipse.emf.transaction.ui.internal.Tracing; >+import org.eclipse.emf.transaction.ui.internal.l10n.Messages; >+import org.eclipse.emf.transaction.util.TransactionUtil; >+import org.eclipse.ui.views.properties.IPropertyDescriptor; >+import org.eclipse.ui.views.properties.IPropertySource; >+import org.eclipse.ui.views.properties.IPropertySource2; >+ >+ >+/** >+ * A property source wrapper that calls its delegate in transactions of the >+ * appropriate kind. Note that transactions are not actually required for >+ * methods that do not access model objects. >+ * >+ * @author Christian W. Damus (cdamus) >+ */ >+public class TransactionalPropertySource >+ implements IPropertySource2 { >+ >+ private final TransactionalEditingDomain domain; >+ >+ private final IPropertySource propertySource; >+ private final IPropertySource2 propertySource2; >+ >+ /** >+ * Initializes me with the editing domain in which I create transactions, >+ * and the property source that I delegate to. >+ * >+ * @param domain my editing domain >+ * @param propertySource my delegate >+ */ >+ public TransactionalPropertySource(TransactionalEditingDomain domain, IPropertySource propertySource) { >+ this.domain = domain; >+ >+ this.propertySource = propertySource; >+ this.propertySource2 = (propertySource instanceof IPropertySource2) >+ ? (IPropertySource2) propertySource >+ : null; >+ } >+ >+ /** >+ * Runs the specified runnable in the editing domain, with interrupt >+ * handling. >+ * >+ * @param <T> the result type of the runnable >+ * >+ * @param run the runnable to run >+ * >+ * @return its result, or <code>null</code> on interrupt >+ */ >+ protected <T> T run(RunnableWithResult<? extends T> run) { >+ try { >+ return TransactionUtil.runExclusive(domain, run); >+ } catch (InterruptedException e) { >+ Tracing.catching(TransactionalPropertySource.class, "run", e); //$NON-NLS-1$ >+ >+ // propagate interrupt status because we are not throwing >+ Thread.currentThread().interrupt(); >+ >+ EMFTransactionUIPlugin.INSTANCE.log(new Status( >+ IStatus.ERROR, >+ EMFTransactionUIPlugin.getPluginId(), >+ EMFTransactionUIStatusCodes.PROPERTY_SHEET_INTERRUPTED, >+ Messages.propertyInterrupt, >+ e)); >+ >+ return null; >+ } >+ } >+ >+ /** >+ * Delegates the my wrapped property source in the appropriate transaction. >+ */ >+ public boolean isPropertyResettable(Object id) { >+ return (propertySource2 == null)? false >+ : propertySource2.isPropertyResettable(id); >+ } >+ >+ /** >+ * Delegates the my wrapped property source in the appropriate transaction. >+ */ >+ public boolean isPropertySet(final Object id) { >+ return run(new RunnableWithResult.Impl<Boolean>() { >+ public void run() { >+ setResult(propertySource.isPropertySet(id)); >+ }}); >+ } >+ >+ /** >+ * Delegates the my wrapped property source in the appropriate transaction. >+ */ >+ public Object getEditableValue() { >+ return run(new RunnableWithResult.Impl<Object>() { >+ public void run() { >+ setResult(propertySource.getEditableValue()); >+ }}); >+ } >+ >+ /** >+ * Delegates the my wrapped property source in the appropriate transaction. >+ */ >+ public IPropertyDescriptor[] getPropertyDescriptors() { >+ return propertySource.getPropertyDescriptors(); >+ } >+ >+ /** >+ * Delegates the my wrapped property source in the appropriate transaction. >+ */ >+ public Object getPropertyValue(final Object id) { >+ return run(new RunnableWithResult.Impl<Object>() { >+ public void run() { >+ setResult(propertySource.getPropertyValue(id)); >+ }}); >+ } >+ >+ /** >+ * Delegates the my wrapped property source in the appropriate transaction. >+ */ >+ public void resetPropertyValue(final Object id) { >+ if (propertySource2 != null) { >+ // are we in a read-only context? if so, balk because we cannot upgrade >+ // read transaction to write when executing a command >+ Transaction tx = ((InternalTransactionalEditingDomain) domain).getActiveTransaction(); >+ if ((tx == null) || !tx.isReadOnly()) { >+ propertySource2.resetPropertyValue(id); >+ } >+ } >+ } >+ >+ /** >+ * Delegates directly to the wrapper property source, because it will use >+ * a command to perform the modification (which implicitly creates a >+ * read/write transaction). >+ */ >+ public void setPropertyValue(final Object id, final Object value) { >+ // are we in a read-only context? if so, balk because we cannot upgrade >+ // read transaction to write when executing a command >+ Transaction tx = ((InternalTransactionalEditingDomain) domain).getActiveTransaction(); >+ if ((tx == null) || !tx.isReadOnly()) { >+ propertySource.setPropertyValue(id, value); >+ } >+ } >+} >Index: src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryLabelProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryLabelProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 TransactionalAdapterFactoryLabelProvider.java >--- src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryLabelProvider.java 7 Jun 2007 14:26:08 -0000 1.2 >+++ src/org/eclipse/emf/transaction/ui/provider/TransactionalAdapterFactoryLabelProvider.java 14 Nov 2007 13:12:12 -0000 >@@ -25,6 +25,7 @@ > import org.eclipse.emf.transaction.ui.internal.EMFTransactionUIStatusCodes; > import org.eclipse.emf.transaction.ui.internal.Tracing; > import org.eclipse.emf.transaction.ui.internal.l10n.Messages; >+import org.eclipse.emf.transaction.util.TransactionUtil; > import org.eclipse.swt.graphics.Image; > > >@@ -55,13 +56,15 @@ > * Runs the specified runnable in the editing domain, with interrupt > * handling. > * >+ * @param <T> the result type of the runnable >+ * > * @param run the runnable to run > * > * @return its result, or <code>null</code> on interrupt > */ >- protected Object run(RunnableWithResult run) { >+ protected <T> T run(RunnableWithResult<? extends T> run) { > try { >- return domain.runExclusive(run); >+ return TransactionUtil.runExclusive(domain, run); > } catch (InterruptedException e) { > Tracing.catching(TransactionalAdapterFactoryLabelProvider.class, "run", e); //$NON-NLS-1$ > >@@ -82,8 +85,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public Image getColumnImage(final Object object, final int columnIndex) { >- return (Image) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Image>() { > public void run() { > setResult(TransactionalAdapterFactoryLabelProvider.super.getColumnImage(object, columnIndex)); > }}); >@@ -92,8 +96,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public String getColumnText(final Object object, final int columnIndex) { >- return (String) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<String>() { > public void run() { > setResult(TransactionalAdapterFactoryLabelProvider.super.getColumnText(object, columnIndex)); > }}); >@@ -102,8 +107,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > protected Image getDefaultImage(final Object object) { >- return (Image) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Image>() { > public void run() { > setResult(TransactionalAdapterFactoryLabelProvider.super.getDefaultImage(object)); > }}); >@@ -112,8 +118,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public Image getImage(final Object object) { >- return (Image) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Image>() { > public void run() { > setResult(TransactionalAdapterFactoryLabelProvider.super.getImage(object)); > }}); >@@ -122,8 +129,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > protected Image getImageFromObject(final Object object) { >- return (Image) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Image>() { > public void run() { > setResult(TransactionalAdapterFactoryLabelProvider.super.getImageFromObject(object)); > }}); >@@ -132,8 +140,9 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public String getText(final Object object) { >- return (String) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<String>() { > public void run() { > setResult(TransactionalAdapterFactoryLabelProvider.super.getText(object)); > }}); >@@ -142,13 +151,11 @@ > /** > * Extends the inherited implementation by running in a read-only transaction. > */ >+ @Override > public boolean isLabelProperty(final Object object, final String id) { >- Boolean result = (Boolean) run(new RunnableWithResult.Impl() { >+ return run(new RunnableWithResult.Impl<Boolean>() { > public void run() { >- setResult(TransactionalAdapterFactoryLabelProvider.super.isLabelProperty(object, id) >- ? Boolean.TRUE : Boolean.FALSE); >+ setResult(TransactionalAdapterFactoryLabelProvider.super.isLabelProperty(object, id)); > }}); >- >- return (result == null) ? false : result.booleanValue(); > } > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.7 >diff -u -r1.7 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 May 2007 16:08:54 -0000 1.7 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:12:12 -0000 >@@ -2,15 +2,15 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.transaction.ui >-Bundle-Version: 1.0.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >-Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="[2.2.0,3.0.0)", >- org.eclipse.emf.transaction;bundle-version="[1.0.0,2.0.0)" >+Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="[2.3.0,3.0.0)", >+ org.eclipse.emf.transaction;bundle-version="[1.2.0,2.0.0)" > Eclipse-LazyStart: true > Bundle-Activator: org.eclipse.emf.transaction.ui.internal.EMFTransactionUIPlugin$Implementation > Export-Package: org.eclipse.emf.transaction.ui.internal;x-internal:=true, > org.eclipse.emf.transaction.ui.internal.l10n;x-internal:=true, > org.eclipse.emf.transaction.ui.provider, > org.eclipse.emf.transaction.ui.view >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:07:00 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:12:12 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:59:13 EST 2006 >+#Sun Nov 11 14:10:16 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >Index: src/org/eclipse/emf/transaction/ui/internal/Tracing.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction.ui/src/org/eclipse/emf/transaction/ui/internal/Tracing.java,v >retrieving revision 1.2 >diff -u -r1.2 Tracing.java >--- src/org/eclipse/emf/transaction/ui/internal/Tracing.java 7 Jun 2007 14:26:07 -0000 1.2 >+++ src/org/eclipse/emf/transaction/ui/internal/Tracing.java 14 Nov 2007 13:12:12 -0000 >@@ -109,7 +109,8 @@ > /** > * The cached debug options (for optimization). > */ >- private static final Map cachedOptions = new HashMap(); >+ private static final Map<String, Boolean> cachedOptions = >+ new HashMap<String, Boolean>(); > > /** > * Retrieves a Boolean value indicating whether tracing is enabled. >@@ -137,13 +138,12 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >- new Boolean( >- Boolean.TRUE.toString().equalsIgnoreCase( >- org.eclipse.core.runtime.Platform.getDebugOption(option))); >+ Boolean.valueOf( >+ org.eclipse.core.runtime.Platform.getDebugOption(option)); > > cachedOptions.put(option, value); > } >@@ -254,7 +254,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -291,7 +291,7 @@ > * > */ > public static void catching( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -322,7 +322,7 @@ > * > */ > public static void throwing( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -343,54 +343,6 @@ > } > > /** >- * Traces the entering into the specified method of the specified class. >- * >- * @param clazz The class whose method is being entered. >- * @param methodName The name of method that is being entered. >- * >- */ >- public static void entering( >- Class clazz, >- String methodName) { >- >- if (shouldTrace(EMFTransactionUIDebugOptions.METHODS_ENTERING)) { >- >- trace( >- PREFIX_ENTERING >- + clazz.getName() >- + SEPARATOR_METHOD >- + methodName); >- } >- } >- >- /** >- * Traces the entering into the specified method of the specified class, >- * with the specified parameter. >- * >- * @param clazz The class whose method is being entered. >- * @param methodName The name of method that is being entered. >- * @param parameter The parameter to the method being entered. >- * >- */ >- public static void entering( >- Class clazz, >- String methodName, >- Object parameter) { >- >- if (shouldTrace(EMFTransactionUIDebugOptions.METHODS_ENTERING)) { >- >- trace( >- PREFIX_ENTERING >- + clazz.getName() >- + SEPARATOR_METHOD >- + methodName >- + PARENTHESIS_OPEN >- + getArgumentString(parameter) >- + PARENTHESIS_CLOSE); >- } >- } >- >- /** > * Traces the entering into the specified method of the specified class, > * with the specified parameters. > * >@@ -400,9 +352,9 @@ > * > */ > public static void entering( >- Class clazz, >+ Class<?> clazz, > String methodName, >- Object[] parameters) { >+ Object... parameters) { > > if (shouldTrace(EMFTransactionUIDebugOptions.METHODS_ENTERING)) { > >@@ -425,7 +377,7 @@ > * > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(EMFTransactionUIDebugOptions.METHODS_EXITING)) { >@@ -448,7 +400,7 @@ > * > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >#P org.eclipse.emf.transaction.examples >Index: src/org/eclipse/emf/transaction/examples/internal/wizard/AbstractExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.transaction.examples/src/org/eclipse/emf/transaction/examples/internal/wizard/AbstractExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractExampleWizard.java >--- src/org/eclipse/emf/transaction/examples/internal/wizard/AbstractExampleWizard.java 17 May 2006 17:00:58 -0000 1.4 >+++ src/org/eclipse/emf/transaction/examples/internal/wizard/AbstractExampleWizard.java 14 Nov 2007 13:12:13 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -24,12 +24,11 @@ > import java.lang.reflect.InvocationTargetException; > import java.net.URL; > import java.util.Collection; >-import java.util.Iterator; > import java.util.zip.ZipEntry; > import java.util.zip.ZipInputStream; > >-import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.FileLocator; >@@ -76,9 +75,9 @@ > * when unzipped into the workspace. > */ > public static class ProjectDescriptor { >- private String bundleName; >- private String zipLocation; >- private String projectName; >+ private final String bundleName; >+ private final String zipLocation; >+ private final String projectName; > > /** > * Construct a descriptor that points to a zip file located >@@ -114,8 +113,9 @@ > } > } > >+ @Override > public boolean performFinish() { >- final Collection projectDescriptors = getProjectDescriptors(); >+ final Collection<ProjectDescriptor> projectDescriptors = getProjectDescriptors(); > > try { > getContainer().run(true, false, new IRunnableWithProgress() { >@@ -123,13 +123,14 @@ > throws InvocationTargetException, InterruptedException { > > WorkspaceModifyOperation op = new WorkspaceModifyOperation() { >+ @Override > protected void execute(IProgressMonitor m) > > throws CoreException, InvocationTargetException, InterruptedException { > m.beginTask("Unzipping Projects", projectDescriptors.size()); > >- for (Iterator i = projectDescriptors.iterator(); i.hasNext();) { >- unzipProject((ProjectDescriptor)i.next(), m); >+ for (ProjectDescriptor next : projectDescriptors) { >+ unzipProject(next, m); > m.worked(1); > } > } >@@ -157,7 +158,7 @@ > * @return The collection of project descriptors that should be > * unzipped into the workspace. > */ >- protected abstract Collection getProjectDescriptors(); >+ protected abstract Collection<ProjectDescriptor> getProjectDescriptors(); > > private void unzipProject(ProjectDescriptor descriptor, IProgressMonitor monitor) { > String bundleName = descriptor.getBundleName(); >@@ -230,8 +231,9 @@ > byte[] buffer = new byte[102400]; > while (true) { > int len = zipFileStream.read(buffer); >- if (zipFileStream.available() == 0) >+ if (zipFileStream.available() == 0) { > break; >+ } > os.write(buffer, 0, len); > } > } finally { >@@ -247,7 +249,7 @@ > } > > project.open(monitor); >- project.refreshLocal(IFile.DEPTH_INFINITE, monitor); >+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor); > > // Close and re-open the project to force eclipse to re-evaluate > // any natures that this project has. >Index: src/org/eclipse/emf/transaction/examples/internal/wizard/WorkspaceExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.transaction.examples/src/org/eclipse/emf/transaction/examples/internal/wizard/WorkspaceExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 WorkspaceExampleWizard.java >--- src/org/eclipse/emf/transaction/examples/internal/wizard/WorkspaceExampleWizard.java 17 May 2006 17:00:58 -0000 1.4 >+++ src/org/eclipse/emf/transaction/examples/internal/wizard/WorkspaceExampleWizard.java 14 Nov 2007 13:12:13 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -30,10 +30,11 @@ > public class WorkspaceExampleWizard > extends AbstractExampleWizard { > >- protected Collection getProjectDescriptors() { >+ @Override >+ protected Collection<ProjectDescriptor> getProjectDescriptors() { > // We need the workspace example to be unzipped along with the > // EMF library example model, edit and editor examples >- List projects = new ArrayList(4); >+ List<ProjectDescriptor> projects = new ArrayList<ProjectDescriptor>(4); > projects.add(new ProjectDescriptor("org.eclipse.emf.transaction.examples", "zips/library.zip", "org.eclipse.emf.examples.library")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ > projects.add(new ProjectDescriptor("org.eclipse.emf.transaction.examples", "zips/libraryEdit.zip", "org.eclipse.emf.examples.library.edit")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > projects.add(new ProjectDescriptor("org.eclipse.emf.transaction.examples", "zips/libraryEditor.zip", "org.eclipse.emf.examples.library.editor")); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ >@@ -42,6 +43,7 @@ > return projects; > } > >+ @Override > protected void log(Exception e) { > if (e instanceof CoreException) { > TransactionExamplesPlugin.getDefault().getLog().log(((CoreException)e).getStatus()); >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.transaction.examples/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:40 -0000 1.9 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:12:13 -0000 >@@ -13,4 +13,4 @@ > Bundle-Activator: org.eclipse.emf.transaction.examples.internal.TransactionExamplesPlugin > Export-Package: org.eclipse.emf.transaction.examples.internal;x-internal:=true, > org.eclipse.emf.transaction.examples.internal.wizard;x-internal:=true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.transaction.examples/build.properties,v >retrieving revision 1.7 >diff -u -r1.7 build.properties >--- build.properties 7 Jun 2007 14:25:46 -0000 1.7 >+++ build.properties 14 Nov 2007 13:12:13 -0000 >@@ -25,5 +25,5 @@ > src.includes = about.html > source.. = src/ > output.. = bin/ >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.transaction.examples/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:27 -0000 1.2 >+++ .classpath 14 Nov 2007 13:12:13 -0000 >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/examples/org.eclipse.emf.transaction.examples/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:27 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:12:13 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:58:18 EST 2006 >+#Sun Nov 11 13:14:50 EST 2007 > eclipse.preferences.version=1 > org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.compliance=1.5 > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >#P org.eclipse.emf.transaction.tests >Index: src/org/eclipse/emf/transaction/tests/PrivilegedRunnableTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/PrivilegedRunnableTest.java,v >retrieving revision 1.3 >diff -u -r1.3 PrivilegedRunnableTest.java >--- src/org/eclipse/emf/transaction/tests/PrivilegedRunnableTest.java 1 Nov 2006 19:14:34 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/PrivilegedRunnableTest.java 14 Nov 2007 13:12:14 -0000 >@@ -16,12 +16,15 @@ > */ > package org.eclipse.emf.transaction.tests; > >+import java.util.List; >+ >+import junit.framework.Assert; > import junit.framework.Test; >-import junit.framework.TestCase; > import junit.framework.TestSuite; > > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.examples.extlibrary.Book; > import org.eclipse.emf.transaction.RunnableWithResult; > > >@@ -56,7 +59,7 @@ > * Tests the sharing of a read-only transaction. > */ > public void test_sharingReadOnlyTransaction() { >- RunnableWithResult privileged; >+ RunnableWithResult<?> privileged; > startReading(); > > privileged = domain.createPrivilegedRunnable(read); >@@ -91,7 +94,7 @@ > * Tests the sharing of a read-write transaction. > */ > public void test_sharingReadWriteTransaction() { >- RunnableWithResult privileged; >+ RunnableWithResult<?> privileged; > startWriting(); > > privileged = domain.createPrivilegedRunnable(write); >@@ -147,7 +150,7 @@ > thread2.syncExec(domain.createPrivilegedRunnable(write)); > }}; > >- RunnableWithResult privileged; >+ RunnableWithResult<?> privileged; > startWriting(); > > privileged = domain.createPrivilegedRunnable(nestingRunnable); >@@ -167,7 +170,7 @@ > * a privileged runnable. > */ > public void test_transactionMustBeActive() { >- RunnableWithResult privileged; >+ RunnableWithResult<?> privileged; > startWriting(); > > privileged = domain.createPrivilegedRunnable(write); >@@ -186,7 +189,7 @@ > * transaction when executing a privileged runnable. > */ > public void test_transactionMustBeCurrent() { >- RunnableWithResult privileged; >+ RunnableWithResult<?> privileged; > startWriting(); > > privileged = domain.createPrivilegedRunnable(write); >@@ -213,7 +216,7 @@ > public void test_runtimeExceptionInRunnable_146625() { > final RuntimeException e = new RuntimeException(); > >- RunnableWithResult privileged; >+ RunnableWithResult<?> privileged; > startReading(); > > privileged = domain.createPrivilegedRunnable(new Runnable() { >@@ -299,6 +302,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() throws Exception { > super.doSetUp(); > >@@ -311,6 +315,7 @@ > writeWithResult = new TestWriteWithResult(); > } > >+ @Override > protected void doTearDown() throws Exception { > read = null; > readWithResult = null; >@@ -348,7 +353,7 @@ > try { > wait(); > } catch (InterruptedException e) { >- TestCase.fail("Interrupted while waiting for runnable"); //$NON-NLS-1$ >+ Assert.fail("Interrupted while waiting for runnable"); //$NON-NLS-1$ > } > } > } >@@ -359,6 +364,7 @@ > return result; > } > >+ @Override > public void run() { > for (;;) { > synchronized (this) { >@@ -401,7 +407,7 @@ > } > } > >- class TestReadWithResult extends RunnableWithResult.Impl { >+ class TestReadWithResult extends RunnableWithResult.Impl<List<Book>> { > boolean wasExecuted = false; > > public void run() { >@@ -420,7 +426,7 @@ > } > } > >- class TestWriteWithResult extends RunnableWithResult.Impl { >+ class TestWriteWithResult extends RunnableWithResult.Impl<List<Book>> { > boolean wasExecuted = false; > > public void run() { >Index: src/org/eclipse/emf/transaction/tests/NotificationFilterTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/NotificationFilterTest.java,v >retrieving revision 1.3 >diff -u -r1.3 NotificationFilterTest.java >--- src/org/eclipse/emf/transaction/tests/NotificationFilterTest.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/NotificationFilterTest.java 14 Nov 2007 13:12:14 -0000 >@@ -74,7 +74,7 @@ > > assertNotNull(bookListener.postcommit); > assertEquals(1, bookListener.postcommitNotifications.size()); >- Notification notification = (Notification) bookListener.postcommitNotifications.get(0); >+ Notification notification = bookListener.postcommitNotifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(oldTitle, notification.getOldValue()); >@@ -82,7 +82,7 @@ > > assertNotNull(authorListener.postcommit); > assertEquals(1, authorListener.postcommitNotifications.size()); >- notification = (Notification) authorListener.postcommitNotifications.get(0); >+ notification = authorListener.postcommitNotifications.get(0); > assertSame(newAuthor, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getWriter_Books(), notification.getFeature()); > assertSame(book, notification.getNewValue()); >Index: src/org/eclipse/emf/transaction/tests/TransactionChangeRecorderTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/TransactionChangeRecorderTest.java,v >retrieving revision 1.3 >diff -u -r1.3 TransactionChangeRecorderTest.java >--- src/org/eclipse/emf/transaction/tests/TransactionChangeRecorderTest.java 1 Dec 2006 18:38:33 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/TransactionChangeRecorderTest.java 14 Nov 2007 13:12:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -85,12 +85,12 @@ > EPackage pkg = findPackage("root/nested1", true); //$NON-NLS-1$ > assertSame(recorder, getRecorder(pkg)); > >- Iterator contents = ((InternalEList) pkg.eContents()).basicIterator(); >+ Iterator<EObject> contents = ((InternalEList<EObject>) pkg.eContents()).basicIterator(); > > // check that the EPackage is not yet resolved >- EObject obj = (EObject) contents.next(); >+ EObject obj = contents.next(); > assertTrue(!(obj instanceof EPackage) || obj.eIsProxy()); >- obj = (EObject) contents.next(); >+ obj = contents.next(); > assertTrue(!(obj instanceof EPackage) || obj.eIsProxy()); > > assertFalse(nestedResource1.isLoaded()); >@@ -166,12 +166,12 @@ > EPackage pkg = findPackage("root/nested1", true); //$NON-NLS-1$ > assertSame(recorder, getRecorder(pkg)); > >- Iterator contents = ((InternalEList) pkg.eContents()).basicIterator(); >+ Iterator<EObject> contents = ((InternalEList<EObject>) pkg.eContents()).basicIterator(); > > // check that the EPackage is not yet resolved >- EObject obj = (EObject) contents.next(); >+ EObject obj = contents.next(); > assertTrue(!(obj instanceof EPackage) || obj.eIsProxy()); >- obj = (EObject) contents.next(); >+ obj = contents.next(); > assertTrue(!(obj instanceof EPackage) || obj.eIsProxy()); > > assertFalse(nestedResource1.isLoaded()); >@@ -451,6 +451,7 @@ > // Framework methods > // > >+ @Override > protected void doSetUp() throws Exception { > super.doSetUp(); > >@@ -462,12 +463,12 @@ > "/test_models/test_model.ecore").toString()), //$NON-NLS-1$ > true); > rootResource.setURI(URI.createPlatformResourceURI( >- "/" + PROJECT_NAME + "/test_model.ecore")); //$NON-NLS-1$ //$NON-NLS-2$ >+ "/" + PROJECT_NAME + "/test_model.ecore", true)); //$NON-NLS-1$ //$NON-NLS-2$ > > nestedResource1 = rset.createResource(URI.createPlatformResourceURI( >- "/" + PROJECT_NAME + "/test_model1.ecore")); //$NON-NLS-1$ //$NON-NLS-2$ >+ "/" + PROJECT_NAME + "/test_model1.ecore", true)); //$NON-NLS-1$ //$NON-NLS-2$ > nestedResource2 = rset.createResource(URI.createPlatformResourceURI( >- "/" + PROJECT_NAME + "/test_model2.ecore")); //$NON-NLS-1$ //$NON-NLS-2$ >+ "/" + PROJECT_NAME + "/test_model2.ecore", true)); //$NON-NLS-1$ //$NON-NLS-2$ > > startWriting(); > >@@ -497,6 +498,7 @@ > } > } > >+ @Override > protected void doTearDown() throws Exception { > if (rootResource != null) { > unloadAndRemove(rootResource); >@@ -542,6 +544,7 @@ > * @param object the object > * @return its name > */ >+ @Override > protected String getName(EObject object) { > if (object instanceof ENamedElement) { > return ((ENamedElement) object).getName(); >@@ -562,9 +565,7 @@ > protected TransactionChangeRecorder getRecorder(Notifier notifier) { > TransactionChangeRecorder result = null; > >- for (Iterator iter = notifier.eAdapters().iterator(); iter.hasNext();) { >- Object next = iter.next(); >- >+ for (Object next : notifier.eAdapters()) { > if (next instanceof TransactionChangeRecorder) { > result = (TransactionChangeRecorder) next; > break; >Index: src/org/eclipse/emf/transaction/tests/AllTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/AllTests.java,v >retrieving revision 1.10 >diff -u -r1.10 AllTests.java >--- src/org/eclipse/emf/transaction/tests/AllTests.java 3 Oct 2007 20:17:27 -0000 1.10 >+++ src/org/eclipse/emf/transaction/tests/AllTests.java 14 Nov 2007 13:12:14 -0000 >@@ -23,9 +23,10 @@ > import junit.framework.TestSuite; > import junit.textui.TestRunner; > >-import org.eclipse.core.runtime.IPlatformRunnable; > import org.eclipse.emf.transaction.multithread.tests.AbstractMultithreadTest; > import org.eclipse.emf.transaction.util.tests.InternalUtilTests; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > > /** > * Master JUnit test suite for the <em>EMF-TX API</em>. >@@ -34,7 +35,7 @@ > */ > public class AllTests > extends TestCase >- implements IPlatformRunnable { >+ implements IApplication { > > public AllTests() { > super(""); //$NON-NLS-1$ >@@ -62,11 +63,16 @@ > return suite; > } > >- public Object run(Object args) >+ public Object start(IApplicationContext context) > throws Exception { >- >+ > TestRunner.run(suite()); >- return Arrays >- .asList(new String[] {"Please see raw test suite output for details."}); //$NON-NLS-1$ >+ >+ return Arrays.asList(new String[] { >+ "Please see raw test suite output for details."}); //$NON-NLS-1$ >+ } >+ >+ public void stop() { >+ // nothing to do > } > } >Index: src/org/eclipse/emf/transaction/tests/TestsPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/TestsPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 TestsPlugin.java >--- src/org/eclipse/emf/transaction/tests/TestsPlugin.java 7 Jun 2007 14:26:16 -0000 1.2 >+++ src/org/eclipse/emf/transaction/tests/TestsPlugin.java 14 Nov 2007 13:12:14 -0000 >@@ -27,12 +27,14 @@ > public class TestsPlugin extends Plugin { > public static TestsPlugin instance; > >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > > instance = this; > } > >+ @Override > public void stop(BundleContext context) throws Exception { > instance = null; > >Index: src/org/eclipse/emf/transaction/tests/TransactionOptionsTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/TransactionOptionsTest.java,v >retrieving revision 1.9 >diff -u -r1.9 TransactionOptionsTest.java >--- src/org/eclipse/emf/transaction/tests/TransactionOptionsTest.java 3 Oct 2007 20:17:27 -0000 1.9 >+++ src/org/eclipse/emf/transaction/tests/TransactionOptionsTest.java 14 Nov 2007 13:12:14 -0000 >@@ -166,6 +166,7 @@ > */ > public void test_noUndo_recordingCommand() { > Command cmd = new RecordingCommand(domain) { >+ @Override > protected void doExecute() { > final Book book = (Book) find("root/Root Book"); //$NON-NLS-1$ > assertNotNull(book); >@@ -358,7 +359,7 @@ > fail("Should have rolled back because of outer transaction validation"); //$NON-NLS-1$ > } catch (RollbackException e) { > // expected exception >- Collection errors = findValidationStatuses( >+ Collection<IStatus> errors = findValidationStatuses( > e.getStatus(), IStatus.ERROR); > > // the inner transaction's error was not detected >@@ -367,8 +368,8 @@ > } > > public void test_transactionOptionInheritance_135569() { >- Map options = new java.util.HashMap(); >- Map active; >+ Map<Object, Object> options = new java.util.HashMap<Object, Object>(); >+ Map<?, ?> active; > > // test the inheritance of empty options > startWriting(); >@@ -465,9 +466,9 @@ > * notifications, since they are not needed for anything. > */ > public void test_noNotificationsInSilentUnprotected_152335() { >- Map options = new java.util.HashMap(); >- options.put(Transaction.OPTION_NO_NOTIFICATIONS, Boolean.TRUE); >- options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE); >+ Map<Object, Object> options = new java.util.HashMap<Object, Object>(); >+ options.put(Transaction.OPTION_NO_NOTIFICATIONS, true); >+ options.put(Transaction.OPTION_UNPROTECTED, true); > > startWriting(options); > InternalTransaction tx = getActiveTransaction(); >@@ -508,9 +509,9 @@ > final String newTitle = "New Title"; //$NON-NLS-1$ > book.setTitle(newTitle); > >- Map options = new java.util.HashMap(); >- options.put(Transaction.OPTION_NO_NOTIFICATIONS, Boolean.TRUE); >- options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE); >+ Map<Object, Object> options = new java.util.HashMap<Object, Object>(); >+ options.put(Transaction.OPTION_NO_NOTIFICATIONS, true); >+ options.put(Transaction.OPTION_UNPROTECTED, true); > > // intervening silent-unprotected > startWriting(options); >@@ -537,7 +538,7 @@ > // and only that notification > assertNotNull(listener.postcommitNotifications); > assertEquals(1, listener.postcommitNotifications.size()); >- Notification notification = (Notification) listener.postcommitNotifications.get(0); >+ Notification notification = listener.postcommitNotifications.get(0); > assertSame(EXTLibraryPackage.Literals.BOOK__TITLE, notification.getFeature()); > } > >@@ -601,7 +602,7 @@ > * Tests that default transaction options are applied to new transactions. > */ > public void test_defaultTransactionOptions() { >- TransactionalEditingDomain.DefaultOptions defaults = (TransactionalEditingDomain.DefaultOptions) TransactionUtil >+ TransactionalEditingDomain.DefaultOptions defaults = TransactionUtil > .getAdapter(domain, TransactionalEditingDomain.DefaultOptions.class); > > defaults.setDefaultTransactionOptions(Collections.singletonMap( >@@ -621,6 +622,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -636,6 +638,7 @@ > ValidationRollbackTest.validationEnabled = true; > } > >+ @Override > protected void doTearDown() > throws Exception { > >Index: src/org/eclipse/emf/transaction/tests/EditingDomainValidatorTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/EditingDomainValidatorTest.java,v >retrieving revision 1.1 >diff -u -r1.1 EditingDomainValidatorTest.java >--- src/org/eclipse/emf/transaction/tests/EditingDomainValidatorTest.java 22 Mar 2007 19:11:50 -0000 1.1 >+++ src/org/eclipse/emf/transaction/tests/EditingDomainValidatorTest.java 14 Nov 2007 13:12:14 -0000 >@@ -44,10 +44,12 @@ > } > > /** May be overridden by subclasses to create non-default editing domains. */ >+ @Override > protected TransactionalEditingDomain createEditingDomain(ResourceSet rset) { > return myDomain; > } > >+ @Override > protected ResourceSet createResourceSet() { > return myDomain.getResourceSet(); > } >Index: src/org/eclipse/emf/transaction/tests/EditingDomainRegistryTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/EditingDomainRegistryTest.java,v >retrieving revision 1.5 >diff -u -r1.5 EditingDomainRegistryTest.java >--- src/org/eclipse/emf/transaction/tests/EditingDomainRegistryTest.java 7 Jun 2007 14:26:17 -0000 1.5 >+++ src/org/eclipse/emf/transaction/tests/EditingDomainRegistryTest.java 14 Nov 2007 13:12:14 -0000 >@@ -216,10 +216,10 @@ > > // should have gotten events from the read transaction, above > assertNotNull(TestListener1.getInstance().postcommit); >- List notifications = TestListener1.getInstance().postcommit.getNotifications(); >+ List<Notification> notifications = TestListener1.getInstance().postcommit.getNotifications(); > assertFalse(notifications == null); > assertEquals(1, notifications.size()); >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(domain3.getResourceSet(), notification.getNotifier()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); > assertEquals(Notification.ADD, notification.getEventType()); >@@ -282,10 +282,10 @@ > > // should have gotten events from the read transaction, above > assertNotNull(TestListener2.getInstance().postcommit); >- List notifications = TestListener2.getInstance().postcommitNotifications; >+ List<Notification> notifications = TestListener2.getInstance().postcommitNotifications; > assertFalse(notifications == null); > assertEquals(1, notifications.size()); >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(domain3.getResourceSet(), notification.getNotifier()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); > assertEquals(Notification.ADD, notification.getEventType()); >@@ -308,7 +308,7 @@ > notifications = TestListener2.getInstance().postcommitNotifications; > assertFalse(notifications == null); > assertEquals(1, notifications.size()); >- notification = (Notification) notifications.get(0); >+ notification = notifications.get(0); > assertSame(domain4.getResourceSet(), notification.getNotifier()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); > assertEquals(Notification.ADD, notification.getEventType()); >@@ -365,10 +365,10 @@ > > // should have gotten events from the read transaction, above > assertNotNull(TestListener3.getInstance().postcommit); >- List notifications = TestListener3.getInstance().postcommitNotifications; >+ List<Notification> notifications = TestListener3.getInstance().postcommitNotifications; > assertFalse(notifications == null); > assertEquals(1, notifications.size()); >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(domain3.getResourceSet(), notification.getNotifier()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); > assertEquals(Notification.ADD, notification.getEventType()); >@@ -391,7 +391,7 @@ > notifications = TestListener3.getInstance().postcommitNotifications; > assertFalse(notifications == null); > assertEquals(1, notifications.size()); >- notification = (Notification) notifications.get(0); >+ notification = notifications.get(0); > assertSame(domain4.getResourceSet(), notification.getNotifier()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); > assertEquals(Notification.ADD, notification.getEventType()); >@@ -421,40 +421,40 @@ > > /** Test listener registered against TestDomain3. */ > public static class TestListener1 extends TestListener { >- private static WeakReference instance; >+ private static WeakReference<TestListener1> instance; > > public TestListener1() { >- instance = new WeakReference(this); >+ instance = new WeakReference<TestListener1>(this); > } > > public static TestListener1 getInstance() { >- return instance == null ? null : (TestListener1) instance.get(); >+ return instance == null ? null : instance.get(); > } > } > > /** Test listener registered against TestDomain3. */ > public static class TestListener2 extends TestListener { >- private static WeakReference instance; >+ private static WeakReference<TestListener2> instance; > > public TestListener2() { >- instance = new WeakReference(this); >+ instance = new WeakReference<TestListener2>(this); > } > > public static TestListener2 getInstance() { >- return instance == null ? null : (TestListener2) instance.get(); >+ return instance == null ? null : instance.get(); > } > } > > /** Test listener registered against all domains. */ > public static class TestListener3 extends TestListener { >- private static WeakReference instance; >+ private static WeakReference<TestListener3> instance; > > public TestListener3() { >- instance = new WeakReference(this); >+ instance = new WeakReference<TestListener3>(this); > } > > public static TestListener3 getInstance() { >- return instance == null ? null : (TestListener3) instance.get(); >+ return instance == null ? null : instance.get(); > } > } > >Index: src/org/eclipse/emf/transaction/tests/BasicTransactionTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/BasicTransactionTest.java,v >retrieving revision 1.5 >diff -u -r1.5 BasicTransactionTest.java >--- src/org/eclipse/emf/transaction/tests/BasicTransactionTest.java 7 Jun 2007 14:26:17 -0000 1.5 >+++ src/org/eclipse/emf/transaction/tests/BasicTransactionTest.java 14 Nov 2007 13:12:14 -0000 >@@ -17,7 +17,6 @@ > package org.eclipse.emf.transaction.tests; > > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > > import junit.framework.Test; >@@ -36,8 +35,8 @@ > import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; > import org.eclipse.emf.transaction.RollbackException; > import org.eclipse.emf.transaction.RunnableWithResult; >-import org.eclipse.emf.transaction.TransactionalCommandStack; > import org.eclipse.emf.transaction.Transaction; >+import org.eclipse.emf.transaction.TransactionalCommandStack; > import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; > import org.eclipse.emf.transaction.internal.EMFTransactionStatusCodes; > import org.eclipse.emf.transaction.tests.fixtures.TestListener; >@@ -354,7 +353,7 @@ > > // check that we got the expected events > assertNotNull(listener.postcommit); >- List notifications = listener.postcommitNotifications; >+ List<Notification> notifications = listener.postcommitNotifications; > assertFalse(notifications.isEmpty()); > > // look for an event indicating resource was loaded and one indicating >@@ -362,9 +361,7 @@ > Notification rootAdded = null; > Notification resLoaded = null; > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > if (next.getNotifier() == res) { > if (next.getFeatureID(null) == Resource.RESOURCE__IS_LOADED) { > if (next.getNewBooleanValue()) { >@@ -400,9 +397,7 @@ > Notification rootRemoved = null; > Notification resUnloaded = null; > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > if (next.getNotifier() == res) { > if (next.getFeatureID(null) == Resource.RESOURCE__IS_LOADED) { > if (!next.getNewBooleanValue()) { >@@ -525,7 +520,7 @@ > }}); > > try { >- RunnableWithResult rwr = new RunnableWithResult.Impl() { >+ RunnableWithResult<?> rwr = new RunnableWithResult.Impl<Object>() { > public void run() { > synchronized (monitor) { > t.start(); >Index: src/org/eclipse/emf/transaction/tests/MemoryLeakTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/MemoryLeakTest.java,v >retrieving revision 1.4 >diff -u -r1.4 MemoryLeakTest.java >--- src/org/eclipse/emf/transaction/tests/MemoryLeakTest.java 13 Jun 2007 12:27:27 -0000 1.4 >+++ src/org/eclipse/emf/transaction/tests/MemoryLeakTest.java 14 Nov 2007 13:12:14 -0000 >@@ -25,11 +25,15 @@ > import java.util.List; > import java.util.Map; > >+import junit.framework.Test; >+import junit.framework.TestSuite; >+ > import org.eclipse.emf.common.command.Command; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.util.BasicEList; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EReference; >+import org.eclipse.emf.ecore.change.ChangeDescription; > import org.eclipse.emf.ecore.util.ECrossReferenceAdapter; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.edit.command.CommandParameter; >@@ -44,9 +48,6 @@ > import org.eclipse.emf.transaction.TriggerListener; > import org.eclipse.emf.transaction.util.CompositeChangeDescription; > >-import junit.framework.Test; >-import junit.framework.TestSuite; >- > > /** > * Tests to check for memory leaks. >@@ -66,8 +67,8 @@ > * Tests that unloading a resource allows its root(s) to be reclaimed. > */ > public void test_unloadResource() { >- ReferenceQueue q = new ReferenceQueue(); >- Reference ref = new WeakReference(root, q); >+ ReferenceQueue<EObject> q = new ReferenceQueue<EObject>(); >+ Reference<EObject> ref = new WeakReference<EObject>(root, q); > > // make some change, causing a transaction to record a change description > startWriting(); >@@ -94,8 +95,10 @@ > * to it and its resource set's contents. > */ > public void test_reclaimEditingDomain() { >- ReferenceQueue q = new ReferenceQueue(); >- Reference ref = new WeakReference(domain, q); >+ ReferenceQueue<TransactionalEditingDomain> q = >+ new ReferenceQueue<TransactionalEditingDomain>(); >+ Reference<TransactionalEditingDomain> ref = >+ new WeakReference<TransactionalEditingDomain>(domain, q); > > // make some change, causing a transaction to record a change description > startWriting(); >@@ -133,7 +136,9 @@ > root.setName("foo"); //$NON-NLS-1$ > > // now, create 1000 nested transactions, each doing a change, *but* unrecorded >- Map options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE); >+ Map<Object, Object> options = Collections.<Object, Object>singletonMap( >+ Transaction.OPTION_UNPROTECTED, Boolean.TRUE); >+ > for (int i = 0; i < 1000; i++) { > startWriting(options); > >@@ -152,7 +157,7 @@ > > Transaction tx = commit(); > CompositeChangeDescription change = (CompositeChangeDescription) tx.getChangeDescription(); >- List children = getChildren(change); >+ List<ChangeDescription> children = getChildren(change); > > assertEquals(1, children.size()); > >@@ -197,10 +202,11 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > Command cmd = new RemoveCommand(domain, root, EXTLibraryPackage.Literals.LIBRARY__BRANCHES, level1) { >- public void doDispose() { >+ @Override >+ public void doDispose() { > if (feature instanceof EReference && ((EReference) feature).isContainment()) { >- for (Iterator iter = collection.iterator(); iter.hasNext();) { >- EObject next = (EObject) iter.next(); >+ for (Object o : collection) { >+ EObject next = (EObject) o; > > // clear adapters on the removed object if it is still removed > if (next.eContainer() != owner) { >@@ -253,7 +259,8 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > Command cmd = new RecordingCommand(domain, "Remove Branch") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getBranches().remove(level1); > }}; > >@@ -301,10 +308,11 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > final Command trigger = new RemoveCommand(domain, root, EXTLibraryPackage.Literals.LIBRARY__BRANCHES, level1) { >- public void doDispose() { >+ @Override >+ public void doDispose() { > if (feature instanceof EReference && ((EReference) feature).isContainment()) { >- for (Iterator iter = collection.iterator(); iter.hasNext();) { >- EObject next = (EObject) iter.next(); >+ for (Object o : collection) { >+ EObject next = (EObject) o; > > // clear adapters on the removed object if it is still removed > if (next.eContainer() != owner) { >@@ -317,7 +325,8 @@ > }}; > > domain.addResourceSetListener(new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > // trigger on the name change only > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -372,12 +381,14 @@ > assertTrue(level1.eAdapters().contains(xrefAdapter)); > > final Command trigger = new RecordingCommand(domain, "Remove Branch") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getBranches().remove(level1); > }}; > > domain.addResourceSetListener(new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, > Notification notification) { > // trigger on the name change only > if (notification.getFeature() == EXTLibraryPackage.Literals.LIBRARY__NAME) { >@@ -427,14 +438,15 @@ > return result; > } > >- static List getChildren(CompositeChangeDescription compositeChange) { >- List result = null; >+ @SuppressWarnings("unchecked") >+ static List<ChangeDescription> getChildren(CompositeChangeDescription compositeChange) { >+ List<ChangeDescription> result = null; > > try { > Field children = compositeChange.getClass().getDeclaredField("changes"); //$NON-NLS-1$ > children.setAccessible(true); > >- result = (List) children.get(compositeChange); >+ result = (List<ChangeDescription>) children.get(compositeChange); > } catch (Exception e) { > e.printStackTrace(); > fail(e.getLocalizedMessage()); >@@ -444,19 +456,22 @@ > } > > private static class TransactionSniffer extends ResourceSetListenerImpl { >- private TransactionalEditingDomain domain; >- private List changes = new BasicEList.FastCompare(); >+ private final TransactionalEditingDomain domain; >+ private final List<ChangeDescription> changes = >+ new BasicEList.FastCompare<ChangeDescription>(); > > TransactionSniffer(TransactionalEditingDomain domain) { > this.domain = domain; > domain.addResourceSetListener(this); > } > >- public boolean isPostcommitOnly() { >+ @Override >+ public boolean isPostcommitOnly() { > return true; > } > >- public void resourceSetChanged(ResourceSetChangeEvent event) { >+ @Override >+ public void resourceSetChanged(ResourceSetChangeEvent event) { > Transaction tx = event.getTransaction(); > > if ((tx != null) && (tx.getChangeDescription()) != null) { >@@ -468,8 +483,8 @@ > // stop listening, now > domain.removeResourceSetListener(this); > >- for (Iterator iter = EcoreUtil.getAllContents(changes); iter.hasNext();) { >- EObject next = (EObject) iter.next(); >+ for (Iterator<EObject> iter = EcoreUtil.getAllContents(changes); iter.hasNext();) { >+ EObject next = iter.next(); > assertEquals("Adapters not cleared.", 0, next.eAdapters().size()); //$NON-NLS-1$ > } > } >Index: src/org/eclipse/emf/transaction/tests/PerformanceTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/PerformanceTest.java,v >retrieving revision 1.4 >diff -u -r1.4 PerformanceTest.java >--- src/org/eclipse/emf/transaction/tests/PerformanceTest.java 10 Oct 2006 14:31:40 -0000 1.4 >+++ src/org/eclipse/emf/transaction/tests/PerformanceTest.java 14 Nov 2007 13:12:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -23,6 +23,9 @@ > import java.util.List; > import java.util.Map; > >+import junit.framework.Test; >+import junit.framework.TestSuite; >+ > import org.eclipse.emf.common.command.Command; > import org.eclipse.emf.common.command.CompoundCommand; > import org.eclipse.emf.common.util.EList; >@@ -39,9 +42,6 @@ > import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; > import org.eclipse.emf.transaction.tests.fixtures.TestCommand; > >-import junit.framework.Test; >-import junit.framework.TestSuite; >- > > /** > * Regression tests for performance problems (time and memory). >@@ -52,10 +52,10 @@ > static final int RUNS = 10; > static final int OUTLIERS = 2; // room for 1 high and 1 low outlier > >- private List timings; >+ private List<Long> timings; > private long clock; > >- private int count = RUNS + OUTLIERS; >+ private final int count = RUNS + OUTLIERS; > > public PerformanceTest(String name) { > super(name); >@@ -95,6 +95,7 @@ > > // add a listener to incur the cost of broadcasting pre- and post-commit > ResourceSetListener listener = new ResourceSetListenerImpl() { >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) > throws RollbackException { > CompoundCommand result = null; >@@ -107,21 +108,22 @@ > // only create a command on the first transaction > result = new CompoundCommand(); > >- for (Iterator iter = event.getNotifications().iterator(); iter.hasNext();) { >+ for (Iterator<?> iter = event.getNotifications().iterator(); iter.hasNext();) { > iter.next(); > > precommitEvents[0]++; > > result.append(new TestCommand() { >- public void execute() {}}); >+ public void execute() {/* nothing to do */}}); > } > } > > return result; > } > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { >- for (Iterator iter = event.getNotifications().iterator(); iter.hasNext();) { >+ for (Iterator<?> iter = event.getNotifications().iterator(); iter.hasNext();) { > iter.next(); > > // do a trivial amount of work >@@ -132,7 +134,7 @@ > > domain.addResourceSetListener(listener); > >- Map options = new java.util.HashMap(); >+ Map<Object, Object> options = new java.util.HashMap<Object, Object>(); > // options.put(Transaction.OPTION_NO_NOTIFICATIONS, Boolean.TRUE); > // options.put(Transaction.OPTION_NO_TRIGGERS, Boolean.TRUE); > // options.put(Transaction.OPTION_NO_VALIDATION, Boolean.TRUE); >@@ -190,31 +192,38 @@ > final int[] receivedValidationNotifications = new int[1]; > > ResourceSetListener prePostCommitCollector = new ResourceSetListenerImpl() { >+ @Override > public NotificationFilter getFilter() { > return NotificationFilter.ANY; > } > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { > receivedPrecommitNotifications[0] += event.getNotifications().size(); > return null; > } > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > receivedPostcommitNotifications[0] = event.getNotifications().size(); > }}; > domain.addResourceSetListener(prePostCommitCollector); > ResourceSetListener validationCollector = new ResourceSetListenerImpl() { >+ @Override > public NotificationFilter getFilter() { > return NotificationFilter.ANY; > } > >+ @Override > public boolean isPrecommitOnly() { > return true; > } >+ @Override > public boolean isAggregatePrecommitListener() { > return true; > } > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { > receivedValidationNotifications[0] = > ((InternalTransactionalEditingDomain) domain).getValidator() >@@ -270,15 +279,17 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() throws Exception { > super.doSetUp(); > > System.out.println("Performance test: " + getName()); //$NON-NLS-1$ > System.out.println("==============================="); //$NON-NLS-1$ > >- timings = new java.util.ArrayList(); >+ timings = new java.util.ArrayList<Long>(); > } > >+ @Override > protected void doTearDown() throws Exception { > removeOutliers(); > >@@ -343,11 +354,11 @@ > > protected void addLibraryWithBooks(Date today) { > Library lib = EXTLibraryFactory.eINSTANCE.createLibrary(); >- EList branches = lib.getBranches(); >+ EList<Library> branches = lib.getBranches(); > > for (int j = 0; j < 20; j++) { > Library branch = EXTLibraryFactory.eINSTANCE.createLibrary(); >- EList books = branch.getBooks(); >+ EList<Book> books = branch.getBooks(); > > for (int i = 0; i < 10; i++) { > Book book = EXTLibraryFactory.eINSTANCE.createBook(); >@@ -452,19 +463,22 @@ > root.setName(Long.toString(System.currentTimeMillis() ^ root.getName().hashCode())); > } > >- private static Map allNotifications; >- private static Map noTriggers; >- private static Map validationOnly; >- private static Map noNotifications; >+ private static Map<Object, Object> allNotifications; >+ private static Map<Object, Object> noTriggers; >+ private static Map<Object, Object> validationOnly; >+ private static Map<Object, Object> noNotifications; > static { >- allNotifications = Collections.EMPTY_MAP; >- noTriggers = Collections.singletonMap(Transaction.OPTION_NO_TRIGGERS, Boolean.TRUE); >- validationOnly = new java.util.HashMap(noTriggers); >- validationOnly.put(Transaction.OPTION_NO_NOTIFICATIONS, Boolean.TRUE); >- noNotifications = new java.util.HashMap(validationOnly); >- noNotifications.put(Transaction.OPTION_NO_VALIDATION, Boolean.TRUE); >+ allNotifications = Collections.emptyMap(); >+ noTriggers = Collections.<Object, Object>singletonMap( >+ Transaction.OPTION_NO_TRIGGERS, true); >+ validationOnly = new java.util.HashMap<Object, Object>(noTriggers); >+ validationOnly.put(Transaction.OPTION_NO_NOTIFICATIONS, true); >+ noNotifications = new java.util.HashMap<Object, Object>(validationOnly); >+ noNotifications.put(Transaction.OPTION_NO_VALIDATION, true); > } >- private Map getOptions(boolean trigger, boolean notify, boolean validate) { >+ private Map<Object, Object> getOptions(boolean trigger, boolean notify, >+ boolean validate) { >+ > if (!trigger) { > if (!notify) { > if (!validate) { >@@ -487,7 +501,7 @@ > final long stopClock() { > long result = System.currentTimeMillis() - clock; > >- timings.add(new Long(result)); >+ timings.add(result); > > return result; > } >@@ -506,10 +520,10 @@ > int count = timings.size(); > > for (int i = 0; i < count; i++) { >- result += ((Long) timings.get(i)).doubleValue(); >+ result += timings.get(i).doubleValue(); > } > >- result /= (double) count; >+ result /= count; > > return result; > } >@@ -521,12 +535,12 @@ > int count = timings.size(); > > for (int i = 0; i < count; i++) { >- dev = ((Long) timings.get(i)).doubleValue() - mean; >+ dev = timings.get(i).doubleValue() - mean; > > result += dev * dev; > } > >- result = Math.sqrt(result / (double) count); >+ result = Math.sqrt(result / count); > > return result; > } >Index: src/org/eclipse/emf/transaction/tests/UndoRedoTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/UndoRedoTest.java,v >retrieving revision 1.9 >diff -u -r1.9 UndoRedoTest.java >--- src/org/eclipse/emf/transaction/tests/UndoRedoTest.java 31 Oct 2007 19:59:57 -0000 1.9 >+++ src/org/eclipse/emf/transaction/tests/UndoRedoTest.java 14 Nov 2007 13:12:14 -0000 >@@ -16,7 +16,6 @@ > */ > package org.eclipse.emf.transaction.tests; > >-import java.util.Iterator; > import java.util.Set; > > import junit.framework.Test; >@@ -88,6 +87,7 @@ > commit(); > > Command cmd = new RecordingCommand(domain) { >+ @Override > protected void doExecute() { > book.setTitle(newTitle); > newAuthor.getBooks().add(book); >@@ -157,7 +157,7 @@ > > assertSame(root, newLibrary.eContainer()); > assertEquals(1, newLibrary.getBooks().size()); >- Book book = (Book) newLibrary.getBooks().get(0); >+ Book book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > assertNotNull(book.getPublicationDate()); > >@@ -181,7 +181,7 @@ > > assertSame(root, newLibrary.eContainer()); > assertEquals(1, newLibrary.getBooks().size()); >- book = (Book) newLibrary.getBooks().get(0); >+ book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > assertNotNull(book.getPublicationDate()); > >@@ -202,6 +202,7 @@ > final Library newLibrary = EXTLibraryFactory.eINSTANCE.createLibrary(); > > Command cmd = new RecordingCommand(domain) { >+ @Override > protected void doExecute() { > // add a new library. Our triggers will set a default name and book > root.getBranches().add(newLibrary); >@@ -217,7 +218,7 @@ > > assertSame(root, newLibrary.eContainer()); > assertEquals(1, newLibrary.getBooks().size()); >- Book book = (Book) newLibrary.getBooks().get(0); >+ Book book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > assertNotNull(book.getPublicationDate()); > >@@ -241,7 +242,7 @@ > > assertSame(root, newLibrary.eContainer()); > assertEquals(1, newLibrary.getBooks().size()); >- book = (Book) newLibrary.getBooks().get(0); >+ book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > assertNotNull(book.getPublicationDate()); > >@@ -369,15 +370,19 @@ > void reset() { count = 0; } > > public void execute() { reset(); } >+ @Override > public void undo() { assertEquals(1, ++count); } >+ @Override > public void redo() { assertEquals(1, ++count); } > } > >- final Set countingCommands = new java.util.HashSet(); >+ final Set<CountingCommand> countingCommands = >+ new java.util.HashSet<CountingCommand>(); > > // add the trigger to create a default book in a new library, combined > // with a counting command > domain.addResourceSetListener(new LibraryDefaultBookTrigger() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = super.trigger(domain, notification); > >@@ -393,6 +398,7 @@ > // add another trigger that will set default publication dates for new > // items, combined with a counting command > domain.addResourceSetListener(new ItemDefaultPublicationDateTrigger() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = super.trigger(domain, notification); > >@@ -423,8 +429,8 @@ > > commit(); > >- for (Iterator iter = countingCommands.iterator(); iter.hasNext();) { >- ((CountingCommand) iter.next()).reset(); >+ for (CountingCommand next : countingCommands) { >+ next.reset(); > } > > startWriting(); >@@ -434,8 +440,8 @@ > > commit(); > >- for (Iterator iter = countingCommands.iterator(); iter.hasNext();) { >- ((CountingCommand) iter.next()).reset(); >+ for (CountingCommand next : countingCommands) { >+ next.reset(); > } > > startWriting(); >@@ -445,8 +451,8 @@ > > commit(); > >- for (Iterator iter = countingCommands.iterator(); iter.hasNext();) { >- ((CountingCommand) iter.next()).reset(); >+ for (CountingCommand next : countingCommands) { >+ next.reset(); > } > } > >@@ -459,6 +465,7 @@ > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -479,12 +486,14 @@ > public void test_nonredoableTriggerCommand_138287() { > // add a trigger command that is not redoable > domain.addResourceSetListener(new TriggerListener() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new TestCommand.Redoable() { > public void execute() { > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -520,12 +529,14 @@ > public void test_nonredoableTriggerCommands() { > // add a trigger command that is not redoable > domain.addResourceSetListener(new TriggerListener() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new TestCommand.Redoable() { > public void execute() { > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -533,12 +544,14 @@ > > // add a trigger command that is not redoable > domain.addResourceSetListener(new TriggerListener() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new TestCommand.Redoable() { > public void execute() { > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -570,12 +583,14 @@ > public void test_nonredoableTriggerCommand_RecordingCommand_138287() { > // add a trigger command that is not redoable > domain.addResourceSetListener(new TriggerListener() { >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new TestCommand.Redoable() { > public void execute() { > // nothing to do > } > >+ @Override > public boolean canRedo() { > return false; > }}; >@@ -585,6 +600,7 @@ > > // this command *is* implicitly redoable; it is the trigger that is not > RecordingCommand cmd = new RecordingCommand(domain) { >+ @Override > protected void doExecute() { > // add a new library, just to record some change > root.getBranches().add(newLibrary); >@@ -633,6 +649,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -642,6 +659,7 @@ > ValidationRollbackTest.validationEnabled = true; > } > >+ @Override > protected void doTearDown() > throws Exception { > >Index: src/org/eclipse/emf/transaction/tests/AbstractTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/AbstractTest.java,v >retrieving revision 1.9 >diff -u -r1.9 AbstractTest.java >--- src/org/eclipse/emf/transaction/tests/AbstractTest.java 3 Oct 2007 20:17:27 -0000 1.9 >+++ src/org/eclipse/emf/transaction/tests/AbstractTest.java 14 Nov 2007 13:12:14 -0000 >@@ -20,7 +20,6 @@ > import java.io.InputStream; > import java.util.Collection; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > import java.util.Set; >@@ -73,9 +72,10 @@ > protected static final String PROJECT_NAME = "emftxtests"; //$NON-NLS-1$ > protected static final String RESOURCE_NAME = "/" + PROJECT_NAME + "/testres.extlibrary"; //$NON-NLS-1$//$NON-NLS-2$ > >- private final List transactionStack = new java.util.ArrayList(); >+ private final List<InternalTransaction> transactionStack = >+ new java.util.ArrayList<InternalTransaction>(); > >- private List tearDownActions; >+ private List<Runnable> tearDownActions; > > public AbstractTest() { > super(); >@@ -89,6 +89,7 @@ > // Test configuration methods > // > >+ @Override > protected final void setUp() > throws Exception { > >@@ -115,7 +116,7 @@ > URI.createURI(EmfTransactionTestsBundle.getEntry( > "/test_models/test_model.extlibrary").toString()), //$NON-NLS-1$ > true); >- originalRes.setURI(URI.createPlatformResourceURI(RESOURCE_NAME)); >+ originalRes.setURI(URI.createPlatformResourceURI(RESOURCE_NAME, true)); > originalRes.save(Collections.EMPTY_MAP); > testResource = originalRes; > root = (Library) find("root"); //$NON-NLS-1$ >@@ -146,12 +147,13 @@ > */ > protected final void addTearDownAction(Runnable action) { > if (tearDownActions == null) { >- tearDownActions = new java.util.ArrayList(); >+ tearDownActions = new java.util.ArrayList<Runnable>(); > } > > tearDownActions.add(action); > } > >+ @Override > protected final void tearDown() > throws Exception { > >@@ -165,9 +167,8 @@ > > private void processTearDownActions() { > if (tearDownActions != null) { >- for (Iterator iter = tearDownActions.iterator(); iter.hasNext();) { >+ for (Runnable action : tearDownActions) { > try { >- Runnable action = (Runnable) iter.next(); > action.run(); > } catch (Exception e) { > System.err.println("Exception in tear-down action:"); //$NON-NLS-1$ >@@ -231,7 +232,7 @@ > file.create(input, true, null); > > result = domain.createResource( >- URI.createPlatformResourceURI(file.getFullPath().toString()).toString()); >+ URI.createPlatformResourceURI(file.getFullPath().toString(), true).toString()); > } catch (Exception e) { > e.printStackTrace(); > fail("Exception creating test resource: " + e.getLocalizedMessage()); //$NON-NLS-1$ >@@ -341,9 +342,7 @@ > String name = names[i]; > result = null; > >- for (Iterator iter = getContents(current).iterator(); iter.hasNext();) { >- EObject child = (EObject) iter.next(); >- >+ for (EObject child : getContents(current)) { > if (name.equals(getName(child))) { > result = child; > break; >@@ -363,7 +362,7 @@ > * @return its name > */ > protected String getName(EObject object) { >- return (String) GetName.INSTANCE.doSwitch(object); >+ return GetName.INSTANCE.doSwitch(object); > } > > /** >@@ -372,13 +371,13 @@ > * @param object an object, which may be a resource or an element > * @return its immediate contents (children) > */ >- private List getContents(Object object) { >+ private List<EObject> getContents(Object object) { > if (object instanceof EObject) { > return ((EObject) object).eContents(); > } else if (object instanceof Resource) { > return ((Resource) object).getContents(); > } else { >- return Collections.EMPTY_LIST; >+ return Collections.emptyList(); > } > } > >@@ -397,7 +396,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >- private static final class GetName extends EXTLibrarySwitch { >+ private static final class GetName extends EXTLibrarySwitch<String> { > static final GetName INSTANCE = new GetName(); > > private GetName() { >@@ -408,23 +407,28 @@ > return object.getTitle(); > } > >- public Object caseBook(Book object) { >+ @Override >+ public String caseBook(Book object) { > return object.getTitle(); > } > >- public Object caseLibrary(Library object) { >+ @Override >+ public String caseLibrary(Library object) { > return object.getName(); > } > >- public Object casePeriodical(Periodical object) { >+ @Override >+ public String casePeriodical(Periodical object) { > return object.getTitle(); > } > >- public Object caseWriter(Writer object) { >+ @Override >+ public String caseWriter(Writer object) { > return object.getName(); > } > >- public Object casePerson(Person object) { >+ @Override >+ public String casePerson(Person object) { > if (object.getFirstName() == null) { > if (object.getLastName() == null) { > return ""; //$NON-NLS-1$ >@@ -443,7 +447,8 @@ > } > } > >- public Object defaultCase(EObject object) { >+ @Override >+ public String defaultCase(EObject object) { > return ""; //$NON-NLS-1$ > } > } >@@ -483,7 +488,7 @@ > * > * @param options the options > */ >- protected void startWriting(Map options) { >+ protected void startWriting(Map<?, ?> options) { > try { > transactionStack.add( > ((InternalTransactionalEditingDomain) domain).startTransaction(false, options)); >@@ -518,7 +523,7 @@ > * > * @param options the options > */ >- protected void startReading(Map options) { >+ protected void startReading(Map<?, ?> options) { > try { > transactionStack.add( > ((InternalTransactionalEditingDomain) domain).startTransaction(true, options)); >@@ -534,7 +539,7 @@ > Transaction result = null; > > try { >- result = (Transaction) transactionStack.remove(transactionStack.size() - 1); >+ result = transactionStack.remove(transactionStack.size() - 1); > result.commit(); > } catch (Exception e) { > fail(e); >@@ -550,7 +555,7 @@ > Transaction result = null; > > try { >- result = (Transaction) transactionStack.remove(transactionStack.size() - 1); >+ result = transactionStack.remove(transactionStack.size() - 1); > result.rollback(); > } catch (Exception e) { > fail(e); >@@ -577,8 +582,8 @@ > * > * @return the map > */ >- protected Map makeOptions(String option) { >- return Collections.singletonMap(option, Boolean.TRUE); >+ protected Map<Object, Object> makeOptions(String option) { >+ return Collections.<Object, Object>singletonMap(option, true); > } > > /** >@@ -590,21 +595,21 @@ > * > * @return the matching statuses, or an empty collection if none found > */ >- protected Collection findValidationStatuses(IStatus status, int severity) { >- Set result; >+ protected Collection<IStatus> findValidationStatuses(IStatus status, int severity) { >+ Set<IStatus> result; > > if (status.isMultiStatus()) { >- result = new java.util.HashSet(); >+ result = new java.util.HashSet<IStatus>(); > IStatus[] children = status.getChildren(); > >- for (int i = 0; i < children.length; i++) { >- result.addAll(findValidationStatuses(children[i], severity)); >+ for (IStatus element : children) { >+ result.addAll(findValidationStatuses(element, severity)); > } > } else if ((status instanceof IConstraintStatus) >- && (status.getSeverity() == severity)) { >+ && (status.matches(severity))) { > result = Collections.singleton(status); > } else { >- result = Collections.EMPTY_SET; >+ result = Collections.emptySet(); > } > > return result; >Index: src/org/eclipse/emf/transaction/tests/ValidationRollbackTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/ValidationRollbackTest.java,v >retrieving revision 1.7 >diff -u -r1.7 ValidationRollbackTest.java >--- src/org/eclipse/emf/transaction/tests/ValidationRollbackTest.java 22 Oct 2007 21:27:15 -0000 1.7 >+++ src/org/eclipse/emf/transaction/tests/ValidationRollbackTest.java 14 Nov 2007 13:12:14 -0000 >@@ -331,7 +331,9 @@ > */ > public void test_rollbackNestingTransactionOnException_135673() { > Command command = new RecordingCommand(domain, "") { //$NON-NLS-1$ >+ @Override > public boolean canUndo() { return true; } >+ @Override > protected void doExecute() { > // start some nested transactions > try { >@@ -361,7 +363,8 @@ > final Error error = new Error(); > > ResourceSetListener testListener = new DemultiplexingListener() { >- protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > throw error; > }}; > >@@ -370,7 +373,8 @@ > > try { > domain.getCommandStack().execute(new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -429,9 +433,11 @@ > final RuntimeException error = new RuntimeException(); > > ResourceSetListener testListener = new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new RecordingCommand(domain, "Error") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > throw error; > }}; > }}; >@@ -443,7 +449,8 @@ > domain.addResourceSetListener(testListener); > > domain.getCommandStack().execute(new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -471,9 +478,11 @@ > final RuntimeException error = new OperationCanceledException(); > > ResourceSetListener testListener = new TriggerListener() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > return new RecordingCommand(domain, "Error") { //$NON-NLS-1$ >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > throw error; > }}; > }}; >@@ -485,7 +494,8 @@ > domain.addResourceSetListener(testListener); > > domain.getCommandStack().execute(new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > root.getWriters().clear(); > root.getStock().clear(); > root.getBranches().clear(); >@@ -549,7 +559,8 @@ > final Book book = (Book) find("root/Root Book"); //$NON-NLS-1$ > assertNotNull(book); > Command command = new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > book.setTitle("New Title"); //$NON-NLS-1$ > throw new NullPointerException(); > }}; >@@ -610,7 +621,7 @@ > > xa.rollback(); > >- List notifications = l.postcommitNotifications; >+ List<Notification> notifications = l.postcommitNotifications; > > // check that rollback worked > startReading(); >@@ -681,7 +692,7 @@ > > xa.rollback(); > >- List notifications = l.postcommitNotifications; >+ List<Notification> notifications = l.postcommitNotifications; > > // check that rollback worked > startReading(); >@@ -703,6 +714,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -712,6 +724,7 @@ > validationEnabled = true; > } > >+ @Override > protected void doTearDown() > throws Exception { > >Index: src/org/eclipse/emf/transaction/tests/ValidateEditTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/ValidateEditTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidateEditTest.java >--- src/org/eclipse/emf/transaction/tests/ValidateEditTest.java 3 Oct 2007 20:17:27 -0000 1.1 >+++ src/org/eclipse/emf/transaction/tests/ValidateEditTest.java 14 Nov 2007 13:12:14 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > import org.eclipse.emf.common.command.Command; >+import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.examples.extlibrary.Book; > import org.eclipse.emf.transaction.RollbackException; > import org.eclipse.emf.transaction.Transaction; >@@ -47,8 +48,9 @@ > > private Book book; > >- private Command setTitle = new TestCommand() { >- public boolean canExecute() { >+ private final Command setTitle = new TestCommand() { >+ @Override >+ public boolean canExecute() { > // command isn't executable if owner's resource is read-only > return true; > } >@@ -61,8 +63,9 @@ > } > }}; > >- private Command clearTitle = new TestCommand() { >- public boolean canExecute() { >+ private final Command clearTitle = new TestCommand() { >+ @Override >+ public boolean canExecute() { > // command isn't executable if owner's resource is read-only > return true; > } >@@ -126,8 +129,9 @@ > final boolean[] token = new boolean[1]; > > setValidateEdit(new ValidateEditSupport.Default() { >- protected IStatus doValidateEdit(Transaction transaction, >- Collection resources, Object context) { >+ @Override >+ protected IStatus doValidateEdit(Transaction transaction, >+ Collection<? extends Resource> resources, Object context) { > token[0] = true; > return Status.CANCEL_STATUS; > }}); >@@ -190,6 +194,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -209,6 +214,7 @@ > assertNotNull(book); > } > >+ @Override > protected void doTearDown() > throws Exception { > >@@ -232,7 +238,7 @@ > } > > void setValidateEdit(Object optionValue) { >- TransactionalEditingDomain.DefaultOptions defaults = (TransactionalEditingDomain.DefaultOptions) TransactionUtil >+ TransactionalEditingDomain.DefaultOptions defaults = TransactionUtil > .getAdapter(domain, TransactionalEditingDomain.DefaultOptions.class); > > defaults.setDefaultTransactionOptions(Collections.singletonMap( >Index: src/org/eclipse/emf/transaction/tests/ResourceSetListenersTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/ResourceSetListenersTest.java,v >retrieving revision 1.8 >diff -u -r1.8 ResourceSetListenersTest.java >--- src/org/eclipse/emf/transaction/tests/ResourceSetListenersTest.java 7 Jun 2007 14:26:17 -0000 1.8 >+++ src/org/eclipse/emf/transaction/tests/ResourceSetListenersTest.java 14 Nov 2007 13:12:14 -0000 >@@ -85,11 +85,11 @@ > assertFalse(listener.postcommit.getTransaction().isActive()); > assertSame(domain, listener.postcommit.getEditingDomain()); > >- List notifications = listener.postcommitNotifications; >+ List<Notification> notifications = listener.postcommitNotifications; > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle, notification.getNewValue()); >@@ -140,11 +140,11 @@ > assertFalse(listener.postcommit.getTransaction().isActive()); > assertSame(domain, listener.postcommit.getEditingDomain()); > >- List notifications = listener.postcommitNotifications; >+ List<Notification> notifications = listener.postcommitNotifications; > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle, notification.getNewValue()); >@@ -196,21 +196,21 @@ > assertFalse(listener.postcommit.getTransaction().isActive()); > assertSame(domain, listener.postcommit.getEditingDomain()); > >- List notifications = listener.postcommitNotifications; >+ List<Notification> notifications = listener.postcommitNotifications; > assertNotNull(notifications); > assertEquals(3, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Category(), notification.getFeature()); > assertSame(BookCategory.BIOGRAPHY_LITERAL, notification.getNewValue()); > >- notification = (Notification) notifications.get(1); >+ notification = notifications.get(1); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle, notification.getNewValue()); > >- notification = (Notification) notifications.get(2); >+ notification = notifications.get(2); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Pages(), notification.getFeature()); > assertEquals(new Integer(500), notification.getNewValue()); >@@ -231,6 +231,7 @@ > commit(); > > TestListener testListener = new TestListener() { >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > try { > // can execute read operations >@@ -308,11 +309,11 @@ > assertFalse(listener.precommit.getTransaction().isActive()); > assertSame(domain, listener.precommit.getEditingDomain()); > >- List notifications = listener.precommitNotifications; >+ List<Notification> notifications = listener.precommitNotifications; > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle, notification.getNewValue()); >@@ -397,11 +398,11 @@ > assertFalse(listener.precommit.getTransaction().isActive()); > assertSame(domain, listener.precommit.getEditingDomain()); > >- List notifications = listener.precommitNotifications; >+ List<Notification> notifications = listener.precommitNotifications; > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle, notification.getNewValue()); >@@ -422,11 +423,11 @@ > assertFalse(listener.precommit.getTransaction().isActive()); > assertSame(domain, listener.precommit.getEditingDomain()); > >- List notifications = listener.precommitNotifications; >+ List<Notification> notifications = listener.precommitNotifications; > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Category(), notification.getFeature()); > assertSame(BookCategory.BIOGRAPHY_LITERAL, notification.getNewValue()); >@@ -447,6 +448,7 @@ > commit(); > > TestListener testListener = new TestListener() { >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) { > try { > // can execute read operations >@@ -515,6 +517,7 @@ > commit(); > > TestListener testListener = new TestListener() { >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) { > try { > // cannot commit the transaction while it is committing >@@ -581,7 +584,7 @@ > > assertEquals("New Library", newLibrary.getName()); //$NON-NLS-1$ > assertEquals(1, newLibrary.getBooks().size()); >- assertEquals("New Book", ((Book) newLibrary.getBooks().get(0)).getTitle()); //$NON-NLS-1$ >+ assertEquals("New Book", newLibrary.getBooks().get(0).getTitle()); //$NON-NLS-1$ > > commit(); > } >@@ -611,7 +614,7 @@ > > // the book is created by the first trigger > assertEquals(1, newLibrary.getBooks().size()); >- Book book = (Book) newLibrary.getBooks().get(0); >+ Book book = newLibrary.getBooks().get(0); > assertEquals("New Book", book.getTitle()); //$NON-NLS-1$ > > // the publication date is created by the cascaded trigger >@@ -665,13 +668,13 @@ > > assertNotNull(listener.postcommit); > >- List notifications = listener.postcommitNotifications; >+ List<Notification> notifications = listener.postcommitNotifications; > assertNotNull(notifications); > > // unbatched notifications are always singletons > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(domain.getResourceSet(), notification.getNotifier()); > assertEquals(Notification.ADD, notification.getEventType()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); >@@ -688,9 +691,10 @@ > try { > class Listener extends ResourceSetListenerImpl { > ResourceSetChangeEvent lastEvent = null; >- List lastNotifications = null; >+ List<Notification> lastNotifications = null; > int count = 0; > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > count++; > >@@ -730,6 +734,7 @@ > final Resource[] newRes = new Resource[1]; > > TestListener testListener = new TestListener() { >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > // make sure that I only do this on the first time that I > // am invoked (from the new library notification) >@@ -760,13 +765,13 @@ > // caused more notifications to the listeners) > assertNotNull(listener.postcommit); > >- List notifications = listener.postcommitNotifications; >+ List<Notification> notifications = listener.postcommitNotifications; > assertNotNull(notifications); > > // unbatched notifications are always singletons > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(domain.getResourceSet(), notification.getNotifier()); > assertEquals(Notification.ADD, notification.getEventType()); > assertEquals(ResourceSet.RESOURCE_SET__RESOURCES, notification.getFeatureID(null)); >@@ -786,6 +791,7 @@ > class AggregatedListener extends TestListener { > int count = 0; > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) > throws RollbackException { > >@@ -794,12 +800,14 @@ > return super.transactionAboutToCommit(event); > } > >+ @Override > public void reset() { > super.reset(); > > count = 0; > } > >+ @Override > public boolean isAggregatePrecommitListener() { > return true; > } >@@ -835,17 +843,17 @@ > assertNotNull(localListener.precommit.getTransaction()); > assertEquals(1, localListener.count); > >- List notifications = localListener.precommitNotifications; >+ List<Notification> notifications = localListener.precommitNotifications; > assertNotNull(notifications); > assertEquals(2, notifications.size()); > > // notifications came in the right order >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle1, notification.getNewValue()); > >- notification = (Notification) notifications.get(1); >+ notification = notifications.get(1); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle2, notification.getNewValue()); >@@ -866,6 +874,7 @@ > class AggregatedListener extends TestListener { > int count = 0; > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) > throws RollbackException { > >@@ -874,11 +883,11 @@ > super.transactionAboutToCommit(event); > > if (count < 2) { >- List notifications = event.getNotifications(); >+ List<Notification> notifications = event.getNotifications(); > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle1, notification.getNewValue()); > >@@ -893,12 +902,14 @@ > return null; > } > >+ @Override > public void reset() { > super.reset(); > > count = 0; > } > >+ @Override > public boolean isAggregatePrecommitListener() { > return true; > } >@@ -924,11 +935,11 @@ > assertNotNull(localListener.precommit.getTransaction()); > assertEquals(2, localListener.count); > >- List notifications = localListener.precommitNotifications; >+ List<Notification> notifications = localListener.precommitNotifications; > assertNotNull(notifications); > assertEquals(1, notifications.size()); > >- Notification notification = (Notification) notifications.get(0); >+ Notification notification = notifications.get(0); > assertSame(book, notification.getNotifier()); > assertSame(EXTLibraryPackage.eINSTANCE.getBook_Title(), notification.getFeature()); > assertSame(newTitle2, notification.getNewValue()); >@@ -946,6 +957,7 @@ > class ResourceListener extends DemultiplexingListener { > boolean wasCalled; > >+ @Override > protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > wasCalled = true; > } >@@ -994,6 +1006,7 @@ > interestingBook = book; > } > >+ @Override > protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > Object notifier = notification.getNotifier(); > >@@ -1048,6 +1061,7 @@ > interestingBook = book; > } > >+ @Override > protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > Object notifier = notification.getNotifier(); > >@@ -1107,6 +1121,7 @@ > interestingBook = book; > } > >+ @Override > protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > Object notifier = notification.getNotifier(); > >@@ -1163,6 +1178,7 @@ > interestingBook = book; > } > >+ @Override > protected void handleNotification(TransactionalEditingDomain domain, Notification notification) { > Object notifier = notification.getNotifier(); > >@@ -1218,13 +1234,15 @@ > public void test_recordingCommandsAsTriggers_bug157103() { > // one trigger sets default library names > domain.addResourceSetListener(new LibraryDefaultNameTrigger() { >- protected Command trigger(TransactionalEditingDomain domain, Notification notification) { >+ @Override >+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > > final Library newLibrary = (Library) notification.getNewValue(); > if ((newLibrary.getName() == null) || (newLibrary.getName().length() == 0)) { > result = new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > newLibrary.setName("New Library"); //$NON-NLS-1$ > }}; > } >@@ -1236,7 +1254,8 @@ > > // add a new library. Our trigger will set a default name > domain.getCommandStack().execute(new RecordingCommand(domain) { >- protected void doExecute() { >+ @Override >+ protected void doExecute() { > newLibrary[0] = EXTLibraryFactory.eINSTANCE.createLibrary(); > root.getBranches().add(newLibrary[0]); > >@@ -1265,6 +1284,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -1280,6 +1300,7 @@ > domain.addResourceSetListener(listener); > } > >+ @Override > protected void doTearDown() > throws Exception { > >Index: src/org/eclipse/emf/transaction/multithread/tests/ReadThread.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/ReadThread.java,v >retrieving revision 1.3 >diff -u -r1.3 ReadThread.java >--- src/org/eclipse/emf/transaction/multithread/tests/ReadThread.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/ReadThread.java 14 Nov 2007 13:12:14 -0000 >@@ -44,6 +44,7 @@ > /** > * @see java.lang.Runnable#run() > */ >+ @Override > public void run() { > try { > if(notifyObject != null) { >Index: src/org/eclipse/emf/transaction/multithread/tests/NestedReadThread.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/NestedReadThread.java,v >retrieving revision 1.3 >diff -u -r1.3 NestedReadThread.java >--- src/org/eclipse/emf/transaction/multithread/tests/NestedReadThread.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/NestedReadThread.java 14 Nov 2007 13:12:14 -0000 >@@ -46,6 +46,7 @@ > /** > * @see java.lang.Runnable#run() > */ >+ @Override > public void run() { > try { > if (notifyObject != null) { >Index: src/org/eclipse/emf/transaction/multithread/tests/WriteThread.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/WriteThread.java,v >retrieving revision 1.3 >diff -u -r1.3 WriteThread.java >--- src/org/eclipse/emf/transaction/multithread/tests/WriteThread.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/WriteThread.java 14 Nov 2007 13:12:14 -0000 >@@ -45,6 +45,7 @@ > /** > * @see java.lang.Runnable#run() > */ >+ @Override > public void run() { > if(notifyObject != null) { > synchronized(notifyObject) { >Index: src/org/eclipse/emf/transaction/multithread/tests/NestedWriteThread.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/NestedWriteThread.java,v >retrieving revision 1.3 >diff -u -r1.3 NestedWriteThread.java >--- src/org/eclipse/emf/transaction/multithread/tests/NestedWriteThread.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/NestedWriteThread.java 14 Nov 2007 13:12:14 -0000 >@@ -49,6 +49,7 @@ > /** > * @see java.lang.Runnable#run() > */ >+ @Override > public void run() { > if (notifyObject != null) { > synchronized (notifyObject) { >Index: src/org/eclipse/emf/transaction/multithread/tests/LongRunningReadThread.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/LongRunningReadThread.java,v >retrieving revision 1.3 >diff -u -r1.3 LongRunningReadThread.java >--- src/org/eclipse/emf/transaction/multithread/tests/LongRunningReadThread.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/LongRunningReadThread.java 14 Nov 2007 13:12:14 -0000 >@@ -38,6 +38,7 @@ > /** > * @see java.lang.Runnable#run() > */ >+ @Override > public void run() { > try { > getDomain().runExclusive(new Runnable() { >Index: src/org/eclipse/emf/transaction/multithread/tests/NestedReadInWriteThread.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/NestedReadInWriteThread.java,v >retrieving revision 1.3 >diff -u -r1.3 NestedReadInWriteThread.java >--- src/org/eclipse/emf/transaction/multithread/tests/NestedReadInWriteThread.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/NestedReadInWriteThread.java 14 Nov 2007 13:12:14 -0000 >@@ -47,6 +47,7 @@ > /** > * @see java.lang.Runnable#run() > */ >+ @Override > public void run() { > if (notifyObject != null) { > synchronized (notifyObject) { >Index: src/org/eclipse/emf/transaction/multithread/tests/AbstractMultithreadTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/multithread/tests/AbstractMultithreadTest.java,v >retrieving revision 1.3 >diff -u -r1.3 AbstractMultithreadTest.java >--- src/org/eclipse/emf/transaction/multithread/tests/AbstractMultithreadTest.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/multithread/tests/AbstractMultithreadTest.java 14 Nov 2007 13:12:14 -0000 >@@ -16,14 +16,10 @@ > */ > package org.eclipse.emf.transaction.multithread.tests; > >-import java.util.Arrays; >- > import junit.framework.Test; > import junit.framework.TestCase; > import junit.framework.TestSuite; >-import junit.textui.TestRunner; > >-import org.eclipse.core.runtime.IPlatformRunnable; > import org.eclipse.emf.transaction.TransactionalEditingDomain; > import org.eclipse.emf.transaction.tests.AbstractTest; > >@@ -33,8 +29,7 @@ > * @author Christian W. Damus (cdamus) > */ > public class AbstractMultithreadTest >- extends TestCase >- implements IPlatformRunnable { >+ extends TestCase { > > private TransactionalEditingDomain domain = null; > >@@ -51,14 +46,6 @@ > > return suite; > } >- >- public Object run(Object args) >- throws Exception { >- >- TestRunner.run(suite()); >- return Arrays >- .asList(new String[] {"Please see raw test suite output for details."}); //$NON-NLS-1$ >- } > > // > // Fixture methods >@@ -68,6 +55,7 @@ > return domain; > } > >+ @Override > protected void setUp() > throws Exception { > >@@ -78,6 +66,7 @@ > domain = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(); > } > >+ @Override > protected void tearDown() > throws Exception { > >Index: src/org/eclipse/emf/transaction/util/tests/InternalUtilTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/util/tests/InternalUtilTests.java,v >retrieving revision 1.2 >diff -u -r1.2 InternalUtilTests.java >--- src/org/eclipse/emf/transaction/util/tests/InternalUtilTests.java 30 Jan 2006 21:40:51 -0000 1.2 >+++ src/org/eclipse/emf/transaction/util/tests/InternalUtilTests.java 14 Nov 2007 13:12:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 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 >@@ -16,14 +16,9 @@ > */ > package org.eclipse.emf.transaction.util.tests; > >-import java.util.Arrays; >- > import junit.framework.Test; > import junit.framework.TestCase; > import junit.framework.TestSuite; >-import junit.textui.TestRunner; >- >-import org.eclipse.core.runtime.IPlatformRunnable; > > /** > * Suite of tests for the utility classes in the EMF-TX API implementation. >@@ -31,8 +26,7 @@ > * @author Christian W. Damus (cdamus) > */ > public class InternalUtilTests >- extends TestCase >- implements IPlatformRunnable { >+ extends TestCase { > > public InternalUtilTests() { > super(""); //$NON-NLS-1$ >@@ -47,12 +41,4 @@ > > return suite; > } >- >- public Object run(Object args) >- throws Exception { >- >- TestRunner.run(suite()); >- return Arrays >- .asList(new String[] {"Please see raw test suite output for details."}); //$NON-NLS-1$ >- } > } >\ No newline at end of file >Index: src/org/eclipse/emf/transaction/util/tests/TransactionUtilTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/util/tests/TransactionUtilTests.java,v >retrieving revision 1.3 >diff -u -r1.3 TransactionUtilTests.java >--- src/org/eclipse/emf/transaction/util/tests/TransactionUtilTests.java 21 Apr 2006 18:03:41 -0000 1.3 >+++ src/org/eclipse/emf/transaction/util/tests/TransactionUtilTests.java 14 Nov 2007 13:12:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -77,15 +77,15 @@ > > startReading(); > Transaction tx = commit(); >- assertSame(domain, TransactionUtil.getEditingDomain((Object) tx)); >+ assertSame(domain, TransactionUtil.getEditingDomain(tx)); > >- assertSame(domain, TransactionUtil.getEditingDomain((Object) domain)); >+ assertSame(domain, TransactionUtil.getEditingDomain(domain)); > > IEditingDomainProvider edp = new IEditingDomainProvider() { > public EditingDomain getEditingDomain() { > return domain; > }}; > >- assertSame(domain, TransactionUtil.getEditingDomain((Object) edp)); >+ assertSame(domain, TransactionUtil.getEditingDomain(edp)); > } > } >Index: src/org/eclipse/emf/transaction/util/tests/LockTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/util/tests/LockTest.java,v >retrieving revision 1.4 >diff -u -r1.4 LockTest.java >--- src/org/eclipse/emf/transaction/util/tests/LockTest.java 15 Oct 2007 16:20:42 -0000 1.4 >+++ src/org/eclipse/emf/transaction/util/tests/LockTest.java 14 Nov 2007 13:12:15 -0000 >@@ -23,7 +23,6 @@ > import junit.framework.TestSuite; > > import org.eclipse.core.resources.ResourcesPlugin; >-import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.jobs.ISchedulingRule; > import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.emf.transaction.TransactionalEditingDomain; >@@ -456,7 +455,7 @@ > try { > lock.acquire(false); > >- Platform.getJobManager().addJobChangeListener(jl); >+ Job.getJobManager().addJobChangeListener(jl); > > synchronized (monitor) { > t.start(); >@@ -488,7 +487,7 @@ > } catch (Exception e) { > fail(e); > } finally { >- Platform.getJobManager().removeJobChangeListener(jl); >+ Job.getJobManager().removeJobChangeListener(jl); > } > } > >@@ -519,7 +518,7 @@ > try { > lock.acquire(false); > >- Platform.getJobManager().addJobChangeListener(jl); >+ Job.getJobManager().addJobChangeListener(jl); > > synchronized (monitor) { > t.start(); >@@ -547,7 +546,7 @@ > } catch (Exception e) { > fail(e); > } finally { >- Platform.getJobManager().removeJobChangeListener(jl); >+ Job.getJobManager().removeJobChangeListener(jl); > } > } > >@@ -621,7 +620,7 @@ > } > > // start an implicit job on our fake rule >- Platform.getJobManager().beginRule(rule, null); >+ Job.getJobManager().beginRule(rule, null); > > try { > // now attempt to acquire the lock while the other thread sleeps >@@ -635,7 +634,7 @@ > > lock.release(); > } finally { >- Platform.getJobManager().endRule(rule); >+ Job.getJobManager().endRule(rule); > } > } catch (Exception e) { > fail(e); >@@ -726,6 +725,7 @@ > // Fixture methods > // > >+ @Override > protected void setUp() > throws Exception { > >@@ -735,6 +735,7 @@ > monitor = new Object(); > } > >+ @Override > protected void tearDown() > throws Exception { > >@@ -767,7 +768,7 @@ > Field field = null; > > try { >- Class clazz = domain.getClass(); >+ Class<?> clazz = domain.getClass(); > > field = clazz.getDeclaredField("transactionLock"); //$NON-NLS-1$ > field.setAccessible(true); >Index: src/org/eclipse/emf/transaction/util/tests/CompositeChangeDescriptionTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/util/tests/CompositeChangeDescriptionTest.java,v >retrieving revision 1.4 >diff -u -r1.4 CompositeChangeDescriptionTest.java >--- src/org/eclipse/emf/transaction/util/tests/CompositeChangeDescriptionTest.java 7 Jun 2007 14:26:18 -0000 1.4 >+++ src/org/eclipse/emf/transaction/util/tests/CompositeChangeDescriptionTest.java 14 Nov 2007 13:12:15 -0000 >@@ -249,6 +249,7 @@ > // Fixture methods > // > >+ @Override > protected void doSetUp() > throws Exception { > >@@ -263,8 +264,10 @@ > commit(); > > // brute-force remove the TransactionChangeRecorder >- for (Iterator iter = testResource.getAllContents(); iter.hasNext();) { >- ((Notifier) iter.next()).eAdapters().clear(); >+ for (Iterator<? extends Notifier> iter = testResource.getAllContents(); >+ iter.hasNext();) { >+ >+ iter.next().eAdapters().clear(); > } > testResource.eAdapters().clear(); > >@@ -272,6 +275,7 @@ > change = new CompositeChangeDescription(); > } > >+ @Override > protected void doTearDown() > throws Exception { > >Index: .settings/org.eclipse.jdt.ui.prefs >=================================================================== >RCS file: .settings/org.eclipse.jdt.ui.prefs >diff -N .settings/org.eclipse.jdt.ui.prefs >--- .settings/org.eclipse.jdt.ui.prefs 20 Dec 2006 17:06:54 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,3 +0,0 @@ >-#Wed Dec 20 11:58:47 EST 2006 >-eclipse.preferences.version=1 >-internal.default.compliance=user >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:54 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 14 Nov 2007 13:12:14 -0000 >@@ -1,8 +1,12 @@ >-#Wed Dec 20 11:58:47 EST 2006 >+#Sun Nov 11 13:25:48 EST 2007 > eclipse.preferences.version=1 >-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled >-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4 >-org.eclipse.jdt.core.compiler.compliance=1.4 >+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve >+org.eclipse.jdt.core.compiler.compliance=1.5 >+org.eclipse.jdt.core.compiler.debug.lineNumber=generate >+org.eclipse.jdt.core.compiler.debug.localVariable=generate >+org.eclipse.jdt.core.compiler.debug.sourceFile=generate > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >Index: src/org/eclipse/emf/transaction/tests/fixtures/ItemDefaultPublicationDateTrigger.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/ItemDefaultPublicationDateTrigger.java,v >retrieving revision 1.3 >diff -u -r1.3 ItemDefaultPublicationDateTrigger.java >--- src/org/eclipse/emf/transaction/tests/fixtures/ItemDefaultPublicationDateTrigger.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/fixtures/ItemDefaultPublicationDateTrigger.java 14 Nov 2007 13:12:14 -0000 >@@ -38,6 +38,7 @@ > Notification.ADD))); > } > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >Index: src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultBookTrigger.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultBookTrigger.java,v >retrieving revision 1.3 >diff -u -r1.3 LibraryDefaultBookTrigger.java >--- src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultBookTrigger.java 7 Jun 2007 14:26:18 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultBookTrigger.java 14 Nov 2007 13:12:14 -0000 >@@ -40,6 +40,7 @@ > Notification.ADD))); > } > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >Index: src/org/eclipse/emf/transaction/tests/fixtures/TestCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/TestCommand.java,v >retrieving revision 1.3 >diff -u -r1.3 TestCommand.java >--- src/org/eclipse/emf/transaction/tests/fixtures/TestCommand.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/fixtures/TestCommand.java 14 Nov 2007 13:12:15 -0000 >@@ -29,10 +29,12 @@ > public abstract class TestCommand > extends AbstractCommand { > >+ @Override > protected boolean prepare() { > return true; > } > >+ @Override > public void undo() { > // do nothing > } >Index: src/org/eclipse/emf/transaction/tests/fixtures/TestValidationEditingDomain.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/TestValidationEditingDomain.java,v >retrieving revision 1.1 >diff -u -r1.1 TestValidationEditingDomain.java >--- src/org/eclipse/emf/transaction/tests/fixtures/TestValidationEditingDomain.java 22 Mar 2007 19:11:51 -0000 1.1 >+++ src/org/eclipse/emf/transaction/tests/fixtures/TestValidationEditingDomain.java 14 Nov 2007 13:12:15 -0000 >@@ -17,6 +17,7 @@ > package org.eclipse.emf.transaction.tests.fixtures; > > import org.eclipse.emf.common.notify.AdapterFactory; >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.edit.provider.ComposedAdapterFactory; >@@ -28,6 +29,7 @@ > import org.eclipse.emf.validation.model.EvaluationMode; > import org.eclipse.emf.validation.service.IConstraintDescriptor; > import org.eclipse.emf.validation.service.IConstraintFilter; >+import org.eclipse.emf.validation.service.ILiveValidator; > import org.eclipse.emf.validation.service.IValidator; > import org.eclipse.emf.validation.service.ModelValidationService; > >@@ -49,6 +51,7 @@ > > public static class FactoryImpl extends TransactionalEditingDomainImpl.FactoryImpl { > >+ @Override > public TransactionalEditingDomain createEditingDomain() { > TransactionalEditingDomainImpl result = new TestValidationEditingDomain( > new ComposedAdapterFactory( >@@ -61,11 +64,13 @@ > return result; > } > >+ @Override > public TransactionalEditingDomain createEditingDomain(ResourceSet rset) { > // not used by the extension point > return null; > } > >+ @Override > public TransactionalEditingDomain getEditingDomain(ResourceSet rset) { > // not used by the extension point > return null; >@@ -82,10 +87,12 @@ > } > > public class TestReadWriteValidatorImpl extends ReadWriteValidatorImpl { >- protected IValidator createValidator() { >+ @Override >+ protected IValidator<Notification> createValidator() { > if (enableCustomValidator) { > readWriteValidatorHitCount++; >- IValidator validator = ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); >+ ILiveValidator validator = ModelValidationService.getInstance().newValidator( >+ EvaluationMode.LIVE); > validator.addConstraintFilter(new IConstraintFilter() { > public boolean accept(IConstraintDescriptor constraint, > EObject target) { >Index: src/org/eclipse/emf/transaction/tests/fixtures/TestListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/TestListener.java,v >retrieving revision 1.3 >diff -u -r1.3 TestListener.java >--- src/org/eclipse/emf/transaction/tests/fixtures/TestListener.java 7 Jun 2007 14:26:18 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/fixtures/TestListener.java 14 Nov 2007 13:12:15 -0000 >@@ -20,6 +20,7 @@ > import java.util.List; > > import org.eclipse.emf.common.command.Command; >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.transaction.NotificationFilter; > import org.eclipse.emf.transaction.ResourceSetChangeEvent; > import org.eclipse.emf.transaction.ResourceSetListenerImpl; >@@ -36,13 +37,13 @@ > public ResourceSetChangeEvent precommit; > > /** The copied list of precommit notifications from the precommit event. */ >- public List precommitNotifications; >+ public List<Notification> precommitNotifications; > > /** The last post-commit event received. */ > public ResourceSetChangeEvent postcommit; > > /** The copied list of postcommit notifications from the postcommit event.*/ >- public List postcommitNotifications; >+ public List<Notification> postcommitNotifications; > > public TestListener() { > super(NotificationFilter.ANY); >@@ -52,18 +53,20 @@ > super(filter); > } > >+ @Override > public Command transactionAboutToCommit(ResourceSetChangeEvent event) > throws RollbackException { > > precommit = event; >- precommitNotifications = new ArrayList(event.getNotifications()); >+ precommitNotifications = new ArrayList<Notification>(event.getNotifications()); > > return null; > } > >+ @Override > public void resourceSetChanged(ResourceSetChangeEvent event) { > postcommit = event; >- postcommitNotifications = new ArrayList(event.getNotifications()); >+ postcommitNotifications = new ArrayList<Notification>(event.getNotifications()); > } > > /** >Index: src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultNameTrigger.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultNameTrigger.java,v >retrieving revision 1.3 >diff -u -r1.3 LibraryDefaultNameTrigger.java >--- src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultNameTrigger.java 7 Jun 2007 14:26:17 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/fixtures/LibraryDefaultNameTrigger.java 14 Nov 2007 13:12:15 -0000 >@@ -38,6 +38,7 @@ > Notification.ADD))); > } > >+ @Override > protected Command trigger(TransactionalEditingDomain domain, Notification notification) { > Command result = null; > >Index: src/org/eclipse/emf/transaction/tests/fixtures/TestEditingDomain.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/TestEditingDomain.java,v >retrieving revision 1.3 >diff -u -r1.3 TestEditingDomain.java >--- src/org/eclipse/emf/transaction/tests/fixtures/TestEditingDomain.java 7 Jun 2007 14:26:18 -0000 1.3 >+++ src/org/eclipse/emf/transaction/tests/fixtures/TestEditingDomain.java 14 Nov 2007 13:12:15 -0000 >@@ -42,6 +42,7 @@ > > public static class FactoryImpl extends TransactionalEditingDomainImpl.FactoryImpl { > >+ @Override > public TransactionalEditingDomain createEditingDomain() { > TransactionalEditingDomain result = new TestEditingDomain( > new ComposedAdapterFactory( >@@ -52,11 +53,13 @@ > return result; > } > >+ @Override > public TransactionalEditingDomain createEditingDomain(ResourceSet rset) { > // not used by the extension point > return null; > } > >+ @Override > public TransactionalEditingDomain getEditingDomain(ResourceSet rset) { > // not used by the extension point > return null; >Index: src/org/eclipse/emf/transaction/tests/fixtures/LogCapture.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/fixtures/LogCapture.java,v >retrieving revision 1.2 >diff -u -r1.2 LogCapture.java >--- src/org/eclipse/emf/transaction/tests/fixtures/LogCapture.java 10 Oct 2006 14:31:40 -0000 1.2 >+++ src/org/eclipse/emf/transaction/tests/fixtures/LogCapture.java 14 Nov 2007 13:12:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 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 >@@ -18,7 +18,7 @@ > > import java.util.List; > >-import junit.framework.TestCase; >+import junit.framework.Assert; > > import org.eclipse.core.runtime.ILogListener; > import org.eclipse.core.runtime.IStatus; >@@ -46,7 +46,7 @@ > }}; > private final TransactionalCommandStack stack; > >- private final List logs = new java.util.ArrayList(); >+ private final List<IStatus> logs = new java.util.ArrayList<IStatus>(); > private IStatus lastLog; > > /** >@@ -123,7 +123,7 @@ > * > * @return a list (possibly empty) of {@link IStatus}es > */ >- public List getLogs() { >+ public List<IStatus> getLogs() { > return logs; > } > >@@ -134,9 +134,9 @@ > */ > public void assertLogged(Throwable throwable) { > IStatus log = getLastLog(); >- TestCase.assertNotNull(log); >+ Assert.assertNotNull(log); > log = findStatus(log, throwable); >- TestCase.assertNotNull(log); >+ Assert.assertNotNull(log); > } > > private void record(IStatus log) { >Index: src/org/eclipse/emf/transaction/tests/constraints/BookTitleConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/src/org/eclipse/emf/transaction/tests/constraints/BookTitleConstraint.java,v >retrieving revision 1.2 >diff -u -r1.2 BookTitleConstraint.java >--- src/org/eclipse/emf/transaction/tests/constraints/BookTitleConstraint.java 7 Jun 2007 14:26:16 -0000 1.2 >+++ src/org/eclipse/emf/transaction/tests/constraints/BookTitleConstraint.java 14 Nov 2007 13:12:14 -0000 >@@ -30,6 +30,7 @@ > public class BookTitleConstraint > extends AbstractModelConstraint { > >+ @Override > public IStatus validate(IValidationContext ctx) { > EMFEventType eType = ctx.getEventType(); > >@@ -38,7 +39,7 @@ > > if (newValue == null > || ((String)newValue).length() == 0) { >- return ctx.createFailureStatus(null); >+ return ctx.createFailureStatus(); > } > } > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 3 Oct 2007 20:17:27 -0000 1.9 >+++ META-INF/MANIFEST.MF 14 Nov 2007 13:12:14 -0000 >@@ -7,7 +7,7 @@ > Bundle-Localization: plugin > Require-Bundle: org.eclipse.emf.transaction;bundle-version="1.2.0", > org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.emf.examples.library.edit;bundle-version="[2.2.0,3.0.0)", >+ org.eclipse.emf.examples.library.edit;bundle-version="[2.3.0,3.0.0)", > org.junit;bundle-version="[3.8.1,4.0.0)", > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true; exceptions="org.eclipse.emf.transaction.tests.constraints" >@@ -17,4 +17,4 @@ > org.eclipse.emf.transaction.tests.fixtures, > org.eclipse.emf.transaction.util.tests > Bundle-Activator: org.eclipse.emf.transaction.tests.TestsPlugin >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/tests/org.eclipse.emf.transaction.tests/build.properties,v >retrieving revision 1.8 >diff -u -r1.8 build.properties >--- build.properties 7 Jun 2007 14:26:18 -0000 1.8 >+++ build.properties 14 Nov 2007 13:12:14 -0000 >@@ -25,5 +25,5 @@ > about.ini,\ > about.html > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ahunter.eclipse
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 206811
:
82668
|
82673
| 82864