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 82505 Details for
Bug 206808
Adopt J2SE 5.0 in Validation 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]
Re-synchronized patch
bug206808.patch (text/plain), 660.79 KB, created by
Christian Damus
on 2007-11-08 19:43:15 EST
(
hide
)
Description:
Re-synchronized patch
Filename:
MIME Type:
Creator:
Christian Damus
Created:
2007-11-08 19:43:15 EST
Size:
660.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.validation.examples >Index: src/org/eclipse/emf/validation/examples/internal/wizard/AbstractExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples/src/org/eclipse/emf/validation/examples/internal/wizard/AbstractExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractExampleWizard.java >--- src/org/eclipse/emf/validation/examples/internal/wizard/AbstractExampleWizard.java 17 May 2006 17:01:01 -0000 1.4 >+++ src/org/eclipse/emf/validation/examples/internal/wizard/AbstractExampleWizard.java 9 Nov 2007 00:41:10 -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,7 +24,6 @@ > 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; > >@@ -115,7 +114,7 @@ > } > > public boolean performFinish() { >- final Collection projectDescriptors = getProjectDescriptors(); >+ final Collection<ProjectDescriptor> projectDescriptors = getProjectDescriptors(); > > try { > getContainer().run(true, false, new IRunnableWithProgress() { >@@ -128,8 +127,8 @@ > 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 +156,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(); >Index: src/org/eclipse/emf/validation/examples/internal/wizard/GeneralExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples/src/org/eclipse/emf/validation/examples/internal/wizard/GeneralExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 GeneralExampleWizard.java >--- src/org/eclipse/emf/validation/examples/internal/wizard/GeneralExampleWizard.java 17 May 2006 17:01:01 -0000 1.4 >+++ src/org/eclipse/emf/validation/examples/internal/wizard/GeneralExampleWizard.java 9 Nov 2007 00:41:10 -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 GeneralExampleWizard > extends AbstractExampleWizard { > >- protected Collection getProjectDescriptors() { >+ @Override >+ protected Collection<ProjectDescriptor> getProjectDescriptors() { > // We need the general 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.validation.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.validation.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.validation.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) { > ValidationExamplesPlugin.getDefault().getLog().log(((CoreException)e).getStatus()); >Index: src/org/eclipse/emf/validation/examples/internal/wizard/AdapterExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples/src/org/eclipse/emf/validation/examples/internal/wizard/AdapterExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 AdapterExampleWizard.java >--- src/org/eclipse/emf/validation/examples/internal/wizard/AdapterExampleWizard.java 17 May 2006 17:01:01 -0000 1.4 >+++ src/org/eclipse/emf/validation/examples/internal/wizard/AdapterExampleWizard.java 9 Nov 2007 00:41:10 -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 AdapterExampleWizard > extends AbstractExampleWizard { > >- protected Collection getProjectDescriptors() { >+ @Override >+ protected Collection<ProjectDescriptor> getProjectDescriptors() { > // We need the adapter 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.validation.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.validation.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.validation.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) { > ValidationExamplesPlugin.getDefault().getLog().log(((CoreException)e).getStatus()); >Index: src/org/eclipse/emf/validation/examples/internal/wizard/OCLExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples/src/org/eclipse/emf/validation/examples/internal/wizard/OCLExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 OCLExampleWizard.java >--- src/org/eclipse/emf/validation/examples/internal/wizard/OCLExampleWizard.java 17 May 2006 17:01:01 -0000 1.4 >+++ src/org/eclipse/emf/validation/examples/internal/wizard/OCLExampleWizard.java 9 Nov 2007 00:41:10 -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 OCLExampleWizard > extends AbstractExampleWizard { > >- protected Collection getProjectDescriptors() { >+ @Override >+ protected Collection<ProjectDescriptor> getProjectDescriptors() { > // We need the OCL 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.validation.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.validation.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.validation.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) { > ValidationExamplesPlugin.getDefault().getLog().log(((CoreException)e).getStatus()); >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples/build.properties,v >retrieving revision 1.10 >diff -u -r1.10 build.properties >--- build.properties 6 Jun 2007 22:27:57 -0000 1.10 >+++ build.properties 9 Nov 2007 00:41:10 -0000 >@@ -25,6 +25,6 @@ > zips/*.zip,\ > icons/ > 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.validation/examples/org.eclipse.emf.validation.examples/.classpath,v >retrieving revision 1.3 >diff -u -r1.3 .classpath >--- .classpath 20 Dec 2006 17:06:54 -0000 1.3 >+++ .classpath 9 Nov 2007 00:41:10 -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.validation/examples/org.eclipse.emf.validation.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:54 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 9 Nov 2007 00:41:10 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:45:30 EST 2006 >+#Mon Nov 05 21:48:43 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.validation/examples/org.eclipse.emf.validation.examples/META-INF/MANIFEST.MF,v >retrieving revision 1.14 >diff -u -r1.14 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Nov 2007 17:30:14 -0000 1.14 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:10 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.examples;singleton:=true >-Bundle-Version: 1.1.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.validation.examples.internal.ValidationExamplesPlugin > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >@@ -13,4 +13,4 @@ > org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", > org.eclipse.ui.ide;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.validation.examples.adapter >Index: src/org/eclipse/emf/validation/examples/adapter/EValidatorAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.adapter/src/org/eclipse/emf/validation/examples/adapter/EValidatorAdapter.java,v >retrieving revision 1.2 >diff -u -r1.2 EValidatorAdapter.java >--- src/org/eclipse/emf/validation/examples/adapter/EValidatorAdapter.java 29 Nov 2005 16:53:02 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/adapter/EValidatorAdapter.java 9 Nov 2007 00:41:11 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -54,23 +54,24 @@ > public EValidatorAdapter() { > super(); > >- batchValidator = >- (IBatchValidator) ModelValidationService.getInstance().newValidator( >+ batchValidator = ModelValidationService.getInstance().newValidator( > EvaluationMode.BATCH); > batchValidator.setIncludeLiveConstraints(true); > batchValidator.setReportSuccesses(false); > } > >+ @Override > public boolean validate(EObject eObject, DiagnosticChain diagnostics, >- Map context) { >+ Map<Object, Object> context) { > return validate(eObject.eClass(), eObject, diagnostics, context); > } > > /** > * Implements validation by delegation to the EMF validation framework. > */ >+ @Override > public boolean validate(EClass eClass, EObject eObject, >- DiagnosticChain diagnostics, Map context) { >+ DiagnosticChain diagnostics, Map<Object, Object> context) { > // first, do whatever the basic EcoreValidator does > super.validate(eClass, eObject, diagnostics, context); > >@@ -102,8 +103,9 @@ > * validation framework; they are validated indirectly via the > * {@link EObject}s that hold their values. > */ >+ @Override > public boolean validate(EDataType eDataType, Object value, >- DiagnosticChain diagnostics, Map context) { >+ DiagnosticChain diagnostics, Map<Object, Object> context) { > return super.validate(eDataType, value, diagnostics, context); > } > >@@ -115,7 +117,7 @@ > * @param context the context (may be <code>null</code>) > * @param status the element's validation status > */ >- private void processed(EObject eObject, Map context, IStatus status) { >+ private void processed(EObject eObject, Map<Object, Object> context, IStatus status) { > if (context != null) { > context.put(eObject, status); > } >@@ -132,7 +134,7 @@ > * the <code>eObject</code> or one of its containers has already been > * validated; <code>false</code>, otherwise > */ >- private boolean hasProcessed(EObject eObject, Map context) { >+ private boolean hasProcessed(EObject eObject, Map<Object, Object> context) { > boolean result = false; > > if (context != null) { >@@ -160,8 +162,8 @@ > if (status.isMultiStatus()) { > IStatus[] children = status.getChildren(); > >- for (int i = 0; i < children.length; i++) { >- appendDiagnostics(children[i], diagnostics); >+ for (IStatus element : children) { >+ appendDiagnostics(element, diagnostics); > } > } else if (status instanceof IConstraintStatus) { > diagnostics.add(new BasicDiagnostic( >Index: src/org/eclipse/emf/validation/examples/adapter/constraints/ExampleConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.adapter/src/org/eclipse/emf/validation/examples/adapter/constraints/ExampleConstraint.java,v >retrieving revision 1.2 >diff -u -r1.2 ExampleConstraint.java >--- src/org/eclipse/emf/validation/examples/adapter/constraints/ExampleConstraint.java 29 Nov 2005 16:53:03 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/adapter/constraints/ExampleConstraint.java 9 Nov 2007 00:41:11 -0000 >@@ -41,7 +41,8 @@ > /** > * I fail on every object that I see. > */ >+ @Override > public IStatus validate(IValidationContext ctx) { >- return ctx.createFailureStatus(new Object[] {ctx.getTarget()}); >+ return ctx.createFailureStatus(ctx.getTarget()); > } > } >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.adapter/build.properties,v >retrieving revision 1.6 >diff -u -r1.6 build.properties >--- build.properties 6 Jun 2007 22:28:08 -0000 1.6 >+++ build.properties 9 Nov 2007 00:41:11 -0000 >@@ -19,5 +19,5 @@ > .,\ > 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.validation/examples/org.eclipse.emf.validation.examples.adapter/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:58 -0000 1.2 >+++ .classpath 9 Nov 2007 00:41:11 -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: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.adapter/META-INF/MANIFEST.MF,v >retrieving revision 1.7 >diff -u -r1.7 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 May 2007 16:09:20 -0000 1.7 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:11 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.examples.adapter; singleton:=true >-Bundle-Version: 1.0.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.validation.examples.adapter.ValidationExamplePlugin > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >@@ -12,7 +12,7 @@ > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)", > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.emf.examples.library;bundle-version="[2.2.0,3.0.0)", >- org.eclipse.emf.validation;bundle-version="[1.0.0,2.0.0)" >+ org.eclipse.emf.examples.library;bundle-version="[2.3.0,3.0.0)", >+ org.eclipse.emf.validation;bundle-version="[1.2.0,2.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.validation/examples/org.eclipse.emf.validation.examples.adapter/.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:58 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 9 Nov 2007 00:41:11 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:46:27 EST 2006 >+#Tue Oct 30 22:14:54 EDT 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.validation.examples-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples-feature/feature.xml,v >retrieving revision 1.16 >diff -u -r1.16 feature.xml >--- feature.xml 7 Nov 2007 17:30:18 -0000 1.16 >+++ feature.xml 9 Nov 2007 00:41:12 -0000 >@@ -18,7 +18,7 @@ > <feature > id="org.eclipse.emf.validation.examples" > label="%featureName" >- version="1.1.100.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> > >@@ -52,13 +52,15 @@ > <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> > <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/> > <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.validation" version="1.0.0" match="compatible"/> >- <import plugin="org.eclipse.emf.examples.library" version="2.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.examples.library.edit" version="2.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.examples.library.editor" version="2.2.0" match="compatible"/> > <import plugin="org.eclipse.ui.console" version="3.1.100" match="compatible"/> >- <import plugin="org.eclipse.emf.validation.ui" version="1.0.0" match="compatible"/> > <import plugin="org.eclipse.core.expressions" version="3.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.validation" version="1.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.examples.library" version="2.3.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.examples.library.edit" version="2.3.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.examples.library.editor" version="2.3.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.validation.ui" version="1.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.validation.ocl" version="1.1.0" match="compatible"/> >+ <import plugin="org.eclipse.ocl.ecore" version="1.1.0" match="compatible"/> > </requires> > > <plugin >#P org.eclipse.emf.validation.ocl >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ocl/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 May 2007 15:46:29 -0000 1.9 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:12 -0000 >@@ -2,12 +2,12 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.ocl; singleton:=true >-Bundle-Version: 1.1.0.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Export-Package: org.eclipse.emf.validation.internal.ocl;x-internal:=true, > org.eclipse.emf.validation.ocl >-Require-Bundle: org.eclipse.emf.validation;bundle-version="[1.0.0,2.0.0)", >+Require-Bundle: org.eclipse.emf.validation;bundle-version="[1.2.0,2.0.0)", > org.eclipse.emf.ocl;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, > org.eclipse.ocl;bundle-version="[1.1.0,2.0.0)";visibility:=reexport, > org.eclipse.ocl.ecore;bundle-version="[1.1.0,2.0.0)", >Index: src/org/eclipse/emf/validation/ocl/AbstractOCLModelConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ocl/src/org/eclipse/emf/validation/ocl/AbstractOCLModelConstraint.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractOCLModelConstraint.java >--- src/org/eclipse/emf/validation/ocl/AbstractOCLModelConstraint.java 6 Jun 2007 22:28:11 -0000 1.4 >+++ src/org/eclipse/emf/validation/ocl/AbstractOCLModelConstraint.java 9 Nov 2007 00:41:12 -0000 >@@ -111,8 +111,9 @@ > * @deprecated Override the {@link #createOCLEnvironmentFactory()} method, > * instead. > */ >+ @Deprecated > protected org.eclipse.emf.ocl.parser.EnvironmentFactory createEnvironmentFactory() { >- return org.eclipse.emf.ocl.parser.EcoreEnvironmentFactory.ECORE_INSTANCE; >+ return org.eclipse.emf.ocl.parser.EnvironmentFactory.ECORE_INSTANCE; > } > > >@@ -165,6 +166,7 @@ > * > * @deprecated Use the {@link #getConstraintCondition(EObject)} method, instead. > */ >+ @Deprecated > public org.eclipse.emf.ocl.query.Query getCondition(EClass eClass) { > org.eclipse.emf.ocl.query.Query result = null; > >@@ -209,7 +211,7 @@ > // variable and result locus, as OCL has no way to provide > // additional extractions. Also, there is no way for the OCL > // to access the context object >- return ctx.createFailureStatus(new Object[]{target}); >+ return ctx.createFailureStatus(target); > } > } > >#P org.eclipse.emf.validation >Index: src/org/eclipse/emf/validation/internal/service/LiveValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/LiveValidator.java,v >retrieving revision 1.3 >diff -u -r1.3 LiveValidator.java >--- src/org/eclipse/emf/validation/internal/service/LiveValidator.java 21 Mar 2007 21:06:33 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/LiveValidator.java 9 Nov 2007 00:41:13 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions; > import org.eclipse.emf.validation.internal.util.Trace; > import org.eclipse.emf.validation.model.EvaluationMode; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.EventTypeService; > import org.eclipse.emf.validation.service.ILiveValidator; > import org.eclipse.emf.validation.service.INotificationGenerator; >@@ -38,8 +39,8 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public class LiveValidator extends AbstractValidator implements ILiveValidator { >- private FilteredCollection.Filter notificationFilter; >+public class LiveValidator extends AbstractValidator<Notification> implements ILiveValidator { >+ private FilteredCollection.Filter<Notification> notificationFilter; > > /** > * Initializes me with the operation <code>executor</code> that I use to >@@ -48,39 +49,34 @@ > * @param executor used by me to execute operations (must not be > * <code>null</code>) > */ >- public LiveValidator(IProviderOperationExecutor executor) { >+ public LiveValidator(IProviderOperationExecutor<Collection<IModelConstraint>> executor) { > super(EvaluationMode.LIVE, executor); > } > > /* (non-Javadoc) > * Implements the inherited method. > */ >- public IStatus validate(Notification notification) { >- return validate((Object)notification); >- } >- >- /* (non-Javadoc) >- * Implements the inherited method. >- */ >- protected Collection doValidate(Collection objects, Set clientContexts) { >+ @Override >+ protected Collection<IStatus> doValidate(Collection<? extends Notification> objects, >+ Set<IClientContext> clientContexts) { > // Generate notifications for contributed emf event types >- Collection notifications = generateNotifications(objects); >+ Collection<Notification> notifications = generateNotifications(objects); > > // Merge similar notifications together to avoid repeated constraint > // evaluations on the same kind of change to the same feature >- List events = mergeNotifications(notifications); >- Iterator iter = events.iterator(); >+ List<Notification> events = mergeNotifications(notifications); >+ Iterator<Notification> iter = events.iterator(); > >- List result = new java.util.ArrayList(32); // anticipate moderate number >+ List<IStatus> result = new java.util.ArrayList<IStatus>(32); // anticipate moderate number > > GetLiveConstraintsOperation operation = > new GetLiveConstraintsOperation(); >- operation.setAllEvents(new java.util.ArrayList(objects)); >+ operation.setAllEvents(new java.util.ArrayList<Notification>(objects)); > AbstractValidationContext ctx = operation.getContext(); > ctx.setReportSuccesses(isReportSuccesses()); > > while (iter.hasNext()) { >- final Notification event = (Notification)iter.next(); >+ final Notification event = iter.next(); > > Object notifier = event.getNotifier(); > >@@ -96,7 +92,8 @@ > // set the validation context's client contexts so that we > // selected the most appropriate constraints to evaluate > >- Collection contexts = ClientContextManager.getInstance().getClientContextsFor( >+ Collection<IClientContext> contexts = >+ ClientContextManager.getInstance().getClientContextsFor( > (EObject) notifier); > > ctx.setClientContexts(contexts); >@@ -123,7 +120,7 @@ > AbstractValidationContext ctx, > Notification event, > GetLiveConstraintsOperation operation, >- List results) { >+ List<IStatus> results) { > if (Trace.shouldTraceEntering(EMFModelValidationDebugOptions.PROVIDERS)) { > Trace.entering(getClass(), "validate", //$NON-NLS-1$ > new Object[] {event}); >@@ -148,13 +145,12 @@ > * @param notifications the input notifications > * @return the merged (possibly fewer) notifications > */ >- private List mergeNotifications(Collection notifications) { >+ private List<Notification> mergeNotifications(Collection<Notification> notifications) { > // use a linked map to preserve list ordering >- Map result = new java.util.LinkedHashMap(notifications.size()); >+ Map<Notification, Notification> result = >+ new java.util.LinkedHashMap<Notification, Notification>(notifications.size()); > >- for (Iterator iter = notifications.iterator(); iter.hasNext();) { >- Notification next = (Notification) iter.next(); >- >+ for (Notification next : notifications) { > // only triggger constraints on EObjects that are still > // connected to a particular resource. We will filter the > // notification appropriately. >@@ -172,17 +168,19 @@ > } > } > >- return new java.util.ArrayList(result.keySet()); >+ return new java.util.ArrayList<Notification>(result.keySet()); > } > >- private Collection generateNotifications(Collection notifications) { >- Collection generators = EventTypeService.getInstance().getNotificationGenerators(); >- Collection newNotifications = new ArrayList(); >+ private Collection<Notification> generateNotifications( >+ Collection<? extends Notification> notifications) { >+ >+ Collection<INotificationGenerator> generators = >+ EventTypeService.getInstance().getNotificationGenerators(); >+ Collection<Notification> newNotifications = new ArrayList<Notification>(); > > // Add generated notifications for each generator >- for (Iterator iter = generators.iterator(); iter.hasNext();) { >- INotificationGenerator generator = (INotificationGenerator)iter.next(); >- newNotifications.addAll(generator.generateNotifications(notifications)); >+ for (INotificationGenerator next : generators) { >+ newNotifications.addAll(next.generateNotifications(notifications)); > } > > // Add existing notifications >@@ -203,7 +201,7 @@ > return getNotificationFilter().accept(notification); > } > >- public void setNotificationFilter(FilteredCollection.Filter filter) { >+ public void setNotificationFilter(FilteredCollection.Filter<Notification> filter) { > notificationFilter = filter; > } > >@@ -214,7 +212,7 @@ > * <code>AttachedToResourceNotificationFilter</code>. > * </p> > */ >- public FilteredCollection.Filter getNotificationFilter() { >+ public FilteredCollection.Filter<Notification> getNotificationFilter() { > if (notificationFilter == null) { > notificationFilter = new AttachedToResourceNotificationFilter(); > } >@@ -258,16 +256,17 @@ > // take a copy to ensure that they are modifiable. Also, this > // avoids destroying the original notification's collection > if (oldValue instanceof Collection) { >- oldValue = new java.util.ArrayList((Collection) oldValue); >+ oldValue = new java.util.ArrayList<Object>((Collection<?>) oldValue); > } > if (newValue instanceof Collection) { >- newValue = new java.util.ArrayList((Collection) newValue); >+ newValue = new java.util.ArrayList<Object>((Collection<?>) newValue); > } > } > > /* (non-Javadoc) > * Redefines the inherited method to return the stored event type. > */ >+ @Override > public int getEventType() { > return eventType; > } >@@ -276,6 +275,7 @@ > * Redefines the inherited method to return the stored new feature > * value. > */ >+ @Override > public Object getNewValue() { > return newValue; > } >@@ -284,6 +284,7 @@ > * Redefines the inherited method to return the stored old feature > * value. > */ >+ @Override > public Object getOldValue() { > return oldValue; > } >@@ -295,6 +296,7 @@ > * the same, as well as the "Remove" and "Remove Many", for the purposes > * of this comparison. > */ >+ @Override > public boolean equals(Object o) { > boolean result = false; > >@@ -334,6 +336,7 @@ > * To be consistent with the {@link #equals(Object)} method, my hash > * code is computed from my notifier, event type, and feature. > */ >+ @Override > public int hashCode() { > int localEventType = getEventType(); > >@@ -354,10 +357,12 @@ > * Redefines the inherited method to implement a merge for singleton and > * list features. > */ >+ @Override >+ @SuppressWarnings("unchecked") > public boolean merge(Notification other) { > boolean result = false; > >- Collection newCollection; >+ Collection<Object> newCollection; > Object otherValue; > > if (this.equals(other)) { >@@ -366,16 +371,16 @@ > case Notification.RESOLVE: > > if (newValue instanceof Collection) { >- newCollection = (Collection) newValue; >+ newCollection = (Collection<Object>) newValue; > } else { >- newCollection = new java.util.ArrayList(); >+ newCollection = new java.util.ArrayList<Object>(); > newCollection.add(newValue); > } > > otherValue = other.getNewValue(); > > if (otherValue instanceof Collection) { >- newCollection.addAll((Collection) otherValue); >+ newCollection.addAll((Collection<?>) otherValue); > } else { > newCollection.add(otherValue); > } >@@ -388,16 +393,16 @@ > case Notification.ADD_MANY: > > if (newValue instanceof Collection) { >- newCollection = (Collection) newValue; >+ newCollection = (Collection<Object>) newValue; > } else { >- newCollection = new java.util.ArrayList(); >+ newCollection = new java.util.ArrayList<Object>(); > newCollection.add(newValue); > } > > otherValue = other.getNewValue(); > > if (otherValue instanceof Collection) { >- newCollection.addAll((Collection) otherValue); >+ newCollection.addAll((Collection<?>) otherValue); > } else { > newCollection.add(otherValue); > } >@@ -411,16 +416,16 @@ > case Notification.REMOVE_MANY: > > if (oldValue instanceof Collection) { >- newCollection = (Collection) oldValue; >+ newCollection = (Collection<Object>) oldValue; > } else { >- newCollection = new java.util.ArrayList(); >+ newCollection = new java.util.ArrayList<Object>(); > newCollection.add(oldValue); > } > > otherValue = other.getOldValue(); > > if (otherValue instanceof Collection) { >- newCollection.addAll((Collection) otherValue); >+ newCollection.addAll((Collection<?>) otherValue); > } else { > newCollection.add(otherValue); > } >@@ -433,16 +438,16 @@ > case Notification.REMOVING_ADAPTER: > > if (oldValue instanceof Collection) { >- newCollection = (Collection) oldValue; >+ newCollection = (Collection<Object>) oldValue; > } else { >- newCollection = new java.util.ArrayList(); >+ newCollection = new java.util.ArrayList<Object>(); > newCollection.add(oldValue); > } > > otherValue = other.getOldValue(); > > if (otherValue instanceof Collection) { >- newCollection.addAll((Collection) otherValue); >+ newCollection.addAll((Collection<?>) otherValue); > } else { > newCollection.add(otherValue); > } >@@ -477,15 +482,12 @@ > * <code>EObject</code> that is attached to a resource (i.e., it is not > * deleted) > */ >- private class AttachedToResourceNotificationFilter implements FilteredCollection.Filter { >- public boolean accept(Object element) { >- if (element instanceof Notification) { >- Notification notification = (Notification)element; >- return (notification.getNotifier() instanceof EObject) && >- (((EObject)notification.getNotifier()).eResource() != null); >- } >- >- return false; >+ private class AttachedToResourceNotificationFilter >+ implements FilteredCollection.Filter<Notification> { >+ >+ public boolean accept(Notification element) { >+ return (element.getNotifier() instanceof EObject) && >+ (((EObject) element.getNotifier()).eResource() != null); > } > } > } >Index: src/org/eclipse/emf/validation/internal/service/GetBatchConstraintsOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/GetBatchConstraintsOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 GetBatchConstraintsOperation.java >--- src/org/eclipse/emf/validation/internal/service/GetBatchConstraintsOperation.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/GetBatchConstraintsOperation.java 9 Nov 2007 00:41:13 -0000 >@@ -48,29 +48,29 @@ > } > > // implements the inherited method >+ @Override > protected void executeImpl( > IModelConstraintProvider provider, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > assert provider != null; > > provider.getBatchConstraints(getEObject(), constraints); > } > > // implements the inherited method >+ @Override > protected AbstractValidationContext createContext() { >- class BatchOnlyFilter implements FilteredCollection.Filter { >- private final FilteredCollection.Filter delegate; >+ class BatchOnlyFilter implements FilteredCollection.Filter<IModelConstraint> { >+ private final FilteredCollection.Filter<IModelConstraint> delegate; > >- BatchOnlyFilter(FilteredCollection.Filter delegate) { >+ BatchOnlyFilter(FilteredCollection.Filter<IModelConstraint> delegate) { > this.delegate = delegate; > } > > // additionally exclude any live mode constraints >- public boolean accept(Object element) { >- IModelConstraint constraint = (IModelConstraint)element; >- >- return constraint.getDescriptor().getEvaluationMode().isBatchOnly() >- && delegate.accept(constraint); >+ public boolean accept(IModelConstraint element) { >+ return element.getDescriptor().getEvaluationMode().isBatchOnly() >+ && delegate.accept(element); > } > } > >@@ -78,7 +78,8 @@ > // overrides the inherited method to provide a filter that > // additionally excludes "live" mode constraints if we are > // only looking for batch mode >- public FilteredCollection.Filter getConstraintFilter() { >+ @Override >+ public FilteredCollection.Filter<IModelConstraint> getConstraintFilter() { > if (!batchOnly) { > return super.getConstraintFilter(); > } else { >Index: src/org/eclipse/emf/validation/internal/service/AbstractGetConstraintsOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/AbstractGetConstraintsOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractGetConstraintsOperation.java >--- src/org/eclipse/emf/validation/internal/service/AbstractGetConstraintsOperation.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/AbstractGetConstraintsOperation.java 9 Nov 2007 00:41:13 -0000 >@@ -18,6 +18,7 @@ > > import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions; > import org.eclipse.emf.validation.internal.util.Trace; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IModelConstraintProvider; > import org.eclipse.emf.validation.util.FilteredCollection; > >@@ -30,15 +31,17 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public abstract class AbstractGetConstraintsOperation implements IProviderOperation { >+public abstract class AbstractGetConstraintsOperation >+ implements IProviderOperation<Collection<IModelConstraint>> { > > /** The EMF object to be validated. */ > private EObject eObject; > > /** The constraints which I have gathered from providers. */ >- private final Collection myConstraints = new java.util.ArrayList(); >+ private final Collection<IModelConstraint> myConstraints = >+ new java.util.ArrayList<IModelConstraint>(); > >- private Collection filteredConstraints; >+ private Collection<IModelConstraint> filteredConstraints; > > private AbstractValidationContext context; > >@@ -86,14 +89,14 @@ > // initialize the context now, if necessary > if (context == null) { > context = createContext(); >- filteredConstraints = new FilteredCollection( >+ filteredConstraints = new FilteredCollection<IModelConstraint>( > getUnfilteredConstraints(), > context.getConstraintFilter()); > } > } > > // implements the interface method >- public final Collection getConstraints() { >+ public final Collection<IModelConstraint> getConstraints() { > return filteredConstraints; > } > >@@ -104,7 +107,7 @@ > * > * @return my full collection of constraints > */ >- protected Collection getUnfilteredConstraints() { >+ protected Collection<IModelConstraint> getUnfilteredConstraints() { > return myConstraints; > } > >@@ -117,7 +120,7 @@ > * @param provider a constraint provider > * @return my unmodifiable constraints collection > */ >- public Object execute(IModelConstraintProvider provider) { >+ public Collection<IModelConstraint> execute(IModelConstraintProvider provider) { > Trace.entering( > EMFModelValidationDebugOptions.PROVIDERS, > getClass(), >@@ -153,5 +156,5 @@ > */ > protected abstract void executeImpl( > IModelConstraintProvider provider, >- Collection constraints); >+ Collection<IModelConstraint> constraints); > } >Index: src/org/eclipse/emf/validation/internal/service/AbstractValidationContext.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/AbstractValidationContext.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractValidationContext.java >--- src/org/eclipse/emf/validation/internal/service/AbstractValidationContext.java 30 Nov 2006 22:52:12 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/AbstractValidationContext.java 9 Nov 2007 00:41:13 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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,7 +44,7 @@ > * @author Christian W. Damus (cdamus) > */ > public abstract class AbstractValidationContext implements IValidationContext { >- private final IProviderOperation operation; >+ private final IProviderOperation<Collection<IModelConstraint>> operation; > > // tracks the eObjects that are ignored by a constraint > private final ConstraintIgnorement ignoredConstraints = >@@ -52,20 +52,21 @@ > > private ConstraintFilter filter; // lazily initialized > >- private final java.util.Map constraintData = new java.util.HashMap(); >+ private final Map<IConstraintDescriptor, Object> constraintData = >+ new java.util.HashMap<IConstraintDescriptor, Object>(); > > private IModelConstraint currentConstraint = null; > private IConstraintDescriptor currentDescriptor = null; > >- private Set resultLocus = new java.util.HashSet(); >+ private final Set<EObject> resultLocus = new java.util.HashSet<EObject>(); > > private boolean reportSuccesses = false; > >- private Collection clientContexts = Collections.EMPTY_SET; >+ private Collection<IClientContext> clientContexts = Collections.emptySet(); > > // filters out all ignored and disabled, as well as constraints > // that have already been executed on the current target >- private class ConstraintFilter implements FilteredCollection.Filter { >+ private class ConstraintFilter implements FilteredCollection.Filter<IModelConstraint> { > /** Initializes me. */ > ConstraintFilter() { > // nothing to initialize. Just declare the constructor explicitly >@@ -75,9 +76,8 @@ > * I filter out any constraint that is disabled, ignored, or has already > * been evaluated against the current target object. > */ >- public boolean accept(Object constraint) { >- IConstraintDescriptor desc = >- ((IModelConstraint)constraint).getDescriptor(); >+ public boolean accept(IModelConstraint constraint) { >+ IConstraintDescriptor desc = constraint.getDescriptor(); > > return (desc.isEnabled() && !isIgnored(desc)); > } >@@ -100,7 +100,8 @@ > // whether they are triggered for specific features (in the live and > // feature validation cases) or just by the object type (batch mode) > private class ConstraintIgnorement { >- private final Map ignoreMap = new java.util.HashMap(); >+ private final Map<EObject, Collection<IConstraintDescriptor>> ignoreMap = >+ new java.util.HashMap<EObject, Collection<IConstraintDescriptor>>(); > > /** > * Ignores the specified <code>constraint</code> for this >@@ -111,7 +112,7 @@ > * @param constraint the constraint > */ > void ignore(EObject eObject, IConstraintDescriptor constraint) { >- Collection ignored = getIgnoredConstraints(eObject); >+ Collection<IConstraintDescriptor> ignored = getIgnoredConstraints(eObject); > > if (ignored == null) { > ignored = initIgnoredConstraints(eObject); >@@ -130,7 +131,7 @@ > * @return whether the <code>constraint</code> is ignored > */ > boolean isIgnored(EObject eObject, IConstraintDescriptor constraint) { >- Collection ignored = getIgnoredConstraints(eObject); >+ Collection<IConstraintDescriptor> ignored = getIgnoredConstraints(eObject); > > return (ignored != null) && ignored.contains(constraint); > } >@@ -145,8 +146,8 @@ > * and that are not triggered by a feature, or <code>null</code> if > * no ignored constraints collection exists, yet > */ >- private Collection getIgnoredConstraints(EObject target) { >- return (Collection) ignoreMap.get(target); >+ private Collection<IConstraintDescriptor> getIgnoredConstraints(EObject target) { >+ return ignoreMap.get(target); > } > > /** >@@ -156,8 +157,8 @@ > * @param target a validation target object > * @return the new ignored constraints collection > */ >- private Collection initIgnoredConstraints(EObject target) { >- Collection result = new java.util.HashSet(); >+ private Collection<IConstraintDescriptor> initIgnoredConstraints(EObject target) { >+ Collection<IConstraintDescriptor> result = new java.util.HashSet<IConstraintDescriptor>(); > > ignoreMap.put(target, result); > >@@ -171,7 +172,7 @@ > * @param operation the operation for which I provide a validation context > */ > protected AbstractValidationContext( >- IProviderOperation operation) { >+ IProviderOperation<Collection<IModelConstraint>> operation) { > this.operation = operation; > } > >@@ -180,7 +181,7 @@ > * > * @return my operation > */ >- protected final IProviderOperation getOperation() { >+ protected final IProviderOperation<Collection<IModelConstraint>> getOperation() { > return operation; > } > >@@ -194,8 +195,8 @@ > /** > * Default implementation simply returns an empty list. > */ >- public List getAllEvents() { >- return Collections.EMPTY_LIST; >+ public List<Notification> getAllEvents() { >+ return Collections.emptyList(); > } > > /** >@@ -225,10 +226,8 @@ > } > > // implements the interface method >- public void skipCurrentConstraintForAll(Collection eObjects) { >- for (Iterator iter = eObjects.iterator(); iter.hasNext();) { >- Object next = iter.next(); >- >+ public void skipCurrentConstraintForAll(Collection<?> eObjects) { >+ for (Object next : eObjects) { > if (next instanceof EObject) { > skipCurrentConstraintFor((EObject)next); > } >@@ -243,7 +242,7 @@ > * > * @return a constraint filter for this context > */ >- public FilteredCollection.Filter getConstraintFilter() { >+ public FilteredCollection.Filter<IModelConstraint> getConstraintFilter() { > if (filter == null) { > filter = new ConstraintFilter(); > } >@@ -268,7 +267,7 @@ > > // implements the interface method > public final Object putCurrentConstraintData(Object newData) { >- return constraintData.put(getConstraint(), newData); >+ return constraintData.put(getConstraint().getDescriptor(), newData); > } > > /** >@@ -298,18 +297,18 @@ > resultLocus.add(eObject); > } > >- public void addResults(Collection eObjects) { >+ public void addResults(Collection<? extends EObject> eObjects) { > assert eObjects != null; > > // explicitly iterate instead of calling resultLocus.addAll() in order > // to assert the types of the elements by casting >- for (Iterator iter = eObjects.iterator(); iter.hasNext();) { >- addResult((EObject)iter.next()); >+ for (EObject next : eObjects) { >+ addResult(next); > } > } > > // implements the interface method >- public Set getResultLocus() { >+ public Set<EObject> getResultLocus() { > return java.util.Collections.unmodifiableSet(resultLocus); > } > >@@ -328,7 +327,7 @@ > } > > /** >- * Obtains the dscriptor of the constraint currently being evaluated. >+ * Obtains the descriptor of the constraint currently being evaluated. > * > * @return the current constraint'sdescriptor > */ >@@ -388,7 +387,7 @@ > } > > // implements the interface method >- public IStatus createFailureStatus(Object[] messageArgs) { >+ public IStatus createFailureStatus(Object... messageArgs) { > > String message = TextUtils.formatMessage( > getDescriptor().getMessagePattern(), >@@ -412,18 +411,18 @@ > * > * @return my constraints > */ >- final Collection getConstraints() { >+ final Collection<IModelConstraint> getConstraints() { > // use only those constraints that match the client contexts >- final Collection delegate = ClientContextManager.getInstance().getBindings( >+ final Collection<IModelConstraint> delegate = ClientContextManager.getInstance().getBindings( > clientContexts, > getOperation().getConstraints()); > > // wraps my constraints collection's iterator in order to access > // the descriptor of each constraint as it is traversed >- class ConstraintsIterator implements Iterator { >- private final Iterator delegateIterator; >+ class ConstraintsIterator implements Iterator<IModelConstraint> { >+ private final Iterator<? extends IModelConstraint> delegateIterator; > >- ConstraintsIterator(Collection delegateCollection) { >+ ConstraintsIterator(Collection<? extends IModelConstraint> delegateCollection) { > this.delegateIterator = delegateCollection.iterator(); > } > >@@ -435,11 +434,11 @@ > // implements the interface method, additionally setting attributes > // of the enclosing context object from the next constraint > // descriptor >- public Object next() { >- Object result = delegateIterator.next(); >+ public IModelConstraint next() { >+ IModelConstraint result = delegateIterator.next(); > > // make this descriptor available in the context >- setConstraint((IModelConstraint)result); >+ setConstraint(result); > > // set the default result locus for this next constraint > AbstractValidationContext.this.initializeResultLocus(); >@@ -452,11 +451,13 @@ > throw new UnsupportedOperationException(); > }} > >- return new AbstractCollection() { >- public Iterator iterator() { >+ return new AbstractCollection<IModelConstraint>() { >+ @Override >+ public Iterator<IModelConstraint> iterator() { > return new ConstraintsIterator(delegate); > } > >+ @Override > public int size() { > return delegate.size(); > }}; >@@ -470,9 +471,9 @@ > * {@link org.eclipse.emf.validation.internal.service.IClientContext}s > * or <code>null</code> to specify none > */ >- final void setClientContexts(Collection clientContexts) { >+ final void setClientContexts(Collection<IClientContext> clientContexts) { > if (clientContexts == null) { >- clientContexts = Collections.EMPTY_SET; >+ clientContexts = Collections.emptySet(); > } > > this.clientContexts = clientContexts; >@@ -485,7 +486,7 @@ > * @return a collection of > * {@link org.eclipse.emf.validation.internal.service.IClientContext}s > */ >- final Collection getClientContexts() { >+ final Collection<IClientContext> getClientContexts() { > return clientContexts; > } > >@@ -522,8 +523,8 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- public Set getResultLocus() { >- return Collections.EMPTY_SET; >+ public Set<EObject> getResultLocus() { >+ return Collections.emptySet(); > } > } > } >Index: src/org/eclipse/emf/validation/internal/service/BatchValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/BatchValidator.java,v >retrieving revision 1.1 >diff -u -r1.1 BatchValidator.java >--- src/org/eclipse/emf/validation/internal/service/BatchValidator.java 27 Oct 2005 17:20:59 -0000 1.1 >+++ src/org/eclipse/emf/validation/internal/service/BatchValidator.java 9 Nov 2007 00:41:13 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2003, 2005 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -29,6 +29,7 @@ > import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions; > import org.eclipse.emf.validation.internal.util.Trace; > import org.eclipse.emf.validation.model.EvaluationMode; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IBatchValidator; > import org.eclipse.emf.validation.service.ITraversalStrategy; > >@@ -40,7 +41,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public class BatchValidator extends AbstractValidator implements IBatchValidator { >+public class BatchValidator extends AbstractValidator<EObject> implements IBatchValidator { > private boolean includeLiveConstraints = false; > private IProgressMonitor progressMonitor = null; > >@@ -54,7 +55,8 @@ > * @param executor used by me to execute operations (must not be > * <code>null</code>) > */ >- public BatchValidator(IProviderOperationExecutor executor) { >+ public BatchValidator( >+ IProviderOperationExecutor<Collection<IModelConstraint>> executor) { > super(EvaluationMode.BATCH, executor); > } > >@@ -96,7 +98,7 @@ > > this.traversalStrategy = strategy; > } >- >+ > /* (non-Javadoc) > * Implements the inherited method. > */ >@@ -113,7 +115,7 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- public IStatus validate(Collection objects, IProgressMonitor monitor) { >+ public IStatus validate(Collection<? extends EObject> objects, IProgressMonitor monitor) { > IStatus result; > > progressMonitor = monitor; >@@ -126,8 +128,11 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- protected Collection doValidate(Collection objects, Set clientContexts) { >- List result = new java.util.ArrayList(64); // anticipate large scale >+ @Override >+ protected Collection<IStatus> doValidate(Collection<? extends EObject> objects, >+ Set<IClientContext> clientContexts) { >+ >+ List<IStatus> result = new java.util.ArrayList<IStatus>(64); // anticipate large scale > > GetBatchConstraintsOperation operation = > new GetBatchConstraintsOperation(!isIncludeLiveConstraints()); >@@ -155,11 +160,11 @@ > */ > private void validate( > ITraversalStrategy traversal, >- List evaluationResults, >+ List<IStatus> evaluationResults, > AbstractValidationContext ctx, >- Collection objects, >+ Collection<? extends EObject> objects, > GetBatchConstraintsOperation operation, >- Set clientContexts) { >+ Set<IClientContext> clientContexts) { > > IProgressMonitor monitor = progressMonitor; > if (monitor == null) { >@@ -181,7 +186,7 @@ > final EObject next = traversal.next(); > > if (recomputeClients) { >- Collection contexts = ClientContextManager.getInstance() >+ Collection<IClientContext> contexts = ClientContextManager.getInstance() > .getClientContextsFor(next); > ctx.setClientContexts(contexts); > clientContexts.addAll(contexts); >@@ -225,7 +230,7 @@ > AbstractValidationContext ctx, > EObject eObject, > GetBatchConstraintsOperation operation, >- List results) { >+ List<IStatus> results) { > if (Trace.shouldTraceEntering(EMFModelValidationDebugOptions.PROVIDERS)) { > Trace.entering(getClass(), "validate", //$NON-NLS-1$ > new Object[] {eObject}); >@@ -248,30 +253,31 @@ > } > > private static class DefaultRecursiveTraversalStrategy implements ITraversalStrategy { >- private Map delegates; >- private Iterator delegateIterator; >+ private Map<ITraversalStrategy, Collection<EObject>> delegates; >+ private Map<ITraversalStrategy, IProgressMonitor> monitors; >+ private Iterator<ITraversalStrategy> delegateIterator; > private ITraversalStrategy current; > > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >- public void startTraversal(Collection traversalRoots, IProgressMonitor monitor) { >+ public void startTraversal(Collection<? extends EObject> traversalRoots, >+ IProgressMonitor monitor) { > delegates = initDelegates(traversalRoots); >+ monitors = new java.util.HashMap<ITraversalStrategy, IProgressMonitor>(); > > monitor.beginTask("", delegates.size() * 1024); //$NON-NLS-1$ > >- for (Iterator iter = delegates.entrySet().iterator(); iter.hasNext();) { >- Map.Entry next = (Map.Entry)iter.next(); >+ for (Map.Entry<ITraversalStrategy, Collection<EObject>> next : >+ delegates.entrySet()) { > > SubProgressMonitor sub = new SubProgressMonitor( > monitor, > 1024, > SubProgressMonitor.SUPPRESS_SUBTASK_LABEL); >- ((ITraversalStrategy)next.getKey()).startTraversal( >- (Collection)next.getValue(), >- sub); >+ next.getKey().startTraversal(next.getValue(), sub); > >- next.setValue(sub); >+ monitors.put(next.getKey(), sub); > } > > delegateIterator = delegates.keySet().iterator(); >@@ -282,7 +288,7 @@ > */ > public boolean hasNext() { > if ((current == null) && (delegateIterator.hasNext())) { >- current = (ITraversalStrategy)delegateIterator.next(); >+ current = delegateIterator.next(); > } > > if (current == null) { >@@ -290,7 +296,7 @@ > } > > if (!current.hasNext()) { >- ((IProgressMonitor)delegates.get(current)).done(); >+ monitors.get(current).done(); > current = null; > > return hasNext(); // get the next delegate and try it >@@ -328,18 +334,19 @@ > current.elementValidated(element, status); > } > >- private Map initDelegates(Collection traversalRoots) { >- Map result = new java.util.HashMap(); >+ private Map<ITraversalStrategy, Collection<EObject>> initDelegates( >+ Collection<? extends EObject> traversalRoots) { > >- for (Iterator iter = traversalRoots.iterator(); iter.hasNext();) { >- EObject next = (EObject)iter.next(); >- >+ Map<ITraversalStrategy, Collection<EObject>> result = >+ new java.util.HashMap<ITraversalStrategy, Collection<EObject>>(); >+ >+ for (EObject next : traversalRoots) { > ITraversalStrategy delegate = TraversalStrategyManager > .getInstance().getTraversalStrategy(next); > >- Collection delegateRoots = (Collection)result.get(delegate); >+ Collection<EObject> delegateRoots = result.get(delegate); > if (delegateRoots == null) { >- delegateRoots = new java.util.LinkedList(); >+ delegateRoots = new java.util.ArrayList<EObject>(); > result.put(delegate, delegateRoots); > } > >Index: src/org/eclipse/emf/validation/internal/service/IProviderOperationExecutor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/IProviderOperationExecutor.java,v >retrieving revision 1.2 >diff -u -r1.2 IProviderOperationExecutor.java >--- src/org/eclipse/emf/validation/internal/service/IProviderOperationExecutor.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/IProviderOperationExecutor.java 9 Nov 2007 00:41:13 -0000 >@@ -20,14 +20,16 @@ > * implementations in this package to execute operations > * in the context of the object that created them. > * >+ * @param <T> the result type of the operation that I execute >+ * > * @author Christian W. Damus (cdamus) > */ >-public interface IProviderOperationExecutor { >+public interface IProviderOperationExecutor<T> { > /** > * Executes the specified <code>op</code>eration. > * > * @param op the operation to execute. The execution result must be > * obtained from it > */ >- void execute(IProviderOperation op); >+ void execute(IProviderOperation<? extends T> op); > } >Index: src/org/eclipse/emf/validation/internal/service/ConstraintCache.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/ConstraintCache.java,v >retrieving revision 1.2 >diff -u -r1.2 ConstraintCache.java >--- src/org/eclipse/emf/validation/internal/service/ConstraintCache.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/ConstraintCache.java 9 Nov 2007 00:41:13 -0000 >@@ -64,10 +64,12 @@ > * weak map to avoid interfering with garbage-collection of EMF metamodels > * (and to clean up the cache when metamodels disappear!). > */ >- private final Map buckets = new java.util.WeakHashMap(); >+ private final Map<EClass, EClassBucket> buckets = >+ new java.util.WeakHashMap<EClass, EClassBucket>(); > > /** The cacheable providers. */ >- private final Collection providers = new java.util.ArrayList(); >+ private final Collection<IProviderDescriptor> providers = >+ new java.util.ArrayList<IProviderDescriptor>(); > > /** > * A container for the constraints provided by all cacheable providers >@@ -76,8 +78,9 @@ > * @author Christian W. Damus (cdamus) > */ > private static class EClassBucket { >- private Collection batchConstraints; >- private final Map liveConstraints = new java.util.HashMap(); >+ private Collection<IModelConstraint> batchConstraints; >+ private final Map<EMFEventType, Map<String, Collection<IModelConstraint>>> >+ liveConstraints = new java.util.HashMap<EMFEventType, Map<String, Collection<IModelConstraint>>>(); > > /** > * Initializes me. >@@ -92,7 +95,7 @@ > * @return my batch constraints, or <code>null</code> if they have not > * yet been retrieved from my registered providers > */ >- Collection getBatchConstraints() { >+ Collection<IModelConstraint> getBatchConstraints() { > return batchConstraints; > } > >@@ -101,8 +104,8 @@ > * > * @param constraints the batch constraints > */ >- void cacheBatchConstraints(Collection constraints) { >- batchConstraints = new java.util.ArrayList(constraints); >+ void cacheBatchConstraints(Collection<IModelConstraint> constraints) { >+ batchConstraints = new java.util.ArrayList<IModelConstraint>(constraints); > } > > /** >@@ -116,15 +119,16 @@ > * @return the corresponding constraints, or <code>null</code> if they > * have not yet been retrieved from my registered providers > */ >- Collection getLiveConstraints(EMFEventType eventType, String featureName) { >+ Collection<IModelConstraint> getLiveConstraints(EMFEventType eventType, String featureName) { > if (featureName == null) { > featureName = NOT_A_FEATURE_NAME; > } > >- Map constraintMap = (Map)liveConstraints.get(eventType); >+ Map<String, Collection<IModelConstraint>> constraintMap = >+ liveConstraints.get(eventType); > > if (constraintMap != null) { >- return (Collection)constraintMap.get(featureName); >+ return constraintMap.get(featureName); > } else { > return null; > } >@@ -143,22 +147,23 @@ > void cacheLiveConstraints( > EMFEventType eventType, > String featureName, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > > if (featureName == null) { > featureName = NOT_A_FEATURE_NAME; > } > >- Map constraintMap = (Map)liveConstraints.get(eventType); >+ Map<String, Collection<IModelConstraint>> constraintMap = >+ liveConstraints.get(eventType); > > if (constraintMap == null) { >- constraintMap = new java.util.HashMap(); >+ constraintMap = new java.util.HashMap<String, Collection<IModelConstraint>>(); > liveConstraints.put(eventType, constraintMap); > } > > constraintMap.put( > featureName, >- new java.util.ArrayList(constraints)); >+ new java.util.ArrayList<IModelConstraint>(constraints)); > } > > /** >@@ -175,12 +180,8 @@ > } > > // replace in the live constraints, if appropriate >- for (Iterator iter = liveConstraints.values().iterator(); iter.hasNext();) { >- Map next = (Map) iter.next(); >- >- for (Iterator nested = next.values().iterator(); nested.hasNext();) { >- Collection constraints = (Collection) nested.next(); >- >+ for (Map<String, Collection<IModelConstraint>> next : liveConstraints.values()) { >+ for (Collection<IModelConstraint> constraints : next.values()) { > if ((constraints != null) && constraints.remove(oldConstraint)) { > constraints.add(newConstraint); > } >@@ -204,7 +205,8 @@ > public IProviderDescriptor getDescriptor() { > return new IProviderDescriptor() { > // the cache is assumed to always have an answer >- public boolean provides(IProviderOperation operation) { >+ public boolean provides( >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation) { > return true; > } > >@@ -234,7 +236,7 @@ > * > * @return the cached providers > */ >- public Collection getProviders() { >+ public Collection<IProviderDescriptor> getProviders() { > return providers; > } > >@@ -258,7 +260,7 @@ > * @return the corresponding bucket > */ > private EClassBucket getBucket(EClass clazz) { >- EClassBucket result = (EClassBucket)buckets.get(clazz); >+ EClassBucket result = buckets.get(clazz); > > if (result == null) { > result = new EClassBucket(); >@@ -274,10 +276,9 @@ > * @param operation the operation to execute > * @return the constraints retrieved by the operation > */ >- private Collection execute(AbstractGetConstraintsOperation operation) { >- for (Iterator iter = getProviders().iterator(); iter.hasNext(); ) { >- IProviderDescriptor next = >- (IProviderDescriptor)iter.next(); >+ private Collection<IModelConstraint> execute(AbstractGetConstraintsOperation operation) { >+ for (Iterator<IProviderDescriptor> iter = getProviders().iterator(); iter.hasNext(); ) { >+ IProviderDescriptor next = iter.next(); > > if (next.provides(operation)) { > try { >@@ -298,16 +299,16 @@ > } > > // implements the interface method >- public Collection getLiveConstraints( >+ public Collection<IModelConstraint> getLiveConstraints( > Notification notification, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > > assert notification != null; > >- Collection result = constraints; >+ Collection<IModelConstraint> result = constraints; > > if (result == null) { >- result = new java.util.ArrayList(); >+ result = new java.util.ArrayList<IModelConstraint>(); > } > > if (notification.getNotifier() instanceof EObject) { >@@ -322,7 +323,8 @@ > } > > EClassBucket bucket = getBucket(eObject.eClass()); >- Collection cached = bucket.getLiveConstraints(eventType, featureName); >+ Collection<IModelConstraint> cached = bucket.getLiveConstraints( >+ eventType, featureName); > > if (cached == null) { > if (Trace.shouldTrace(EMFModelValidationDebugOptions.CACHE)) { >@@ -354,18 +356,18 @@ > } > > // implements the interface method >- public Collection getBatchConstraints( >+ public Collection<IModelConstraint> getBatchConstraints( > EObject eObject, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > >- Collection result = constraints; >+ Collection<IModelConstraint> result = constraints; > > if (result == null) { >- result = new java.util.ArrayList(); >+ result = new java.util.ArrayList<IModelConstraint>(); > } > > EClassBucket bucket = getBucket(eObject.eClass()); >- Collection cached = bucket.getBatchConstraints(); >+ Collection<IModelConstraint> cached = bucket.getBatchConstraints(); > if (cached == null) { > if (Trace.shouldTrace(EMFModelValidationDebugOptions.CACHE)) { > Trace.trace( >@@ -440,9 +442,7 @@ > > // ask each bucket to replace the old constraint with the new, if > // that constraint is in that bucket >- for (Iterator iter = buckets.values().iterator(); iter.hasNext();) { >- EClassBucket next = (EClassBucket) iter.next(); >- >+ for (EClassBucket next : buckets.values()) { > next.replace(oldConstraint, newConstraint); > } > } >Index: src/org/eclipse/emf/validation/internal/service/ProviderDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/ProviderDescriptor.java,v >retrieving revision 1.6 >diff -u -r1.6 ProviderDescriptor.java >--- src/org/eclipse/emf/validation/internal/service/ProviderDescriptor.java 6 Jun 2007 22:27:53 -0000 1.6 >+++ src/org/eclipse/emf/validation/internal/service/ProviderDescriptor.java 9 Nov 2007 00:41:13 -0000 >@@ -34,6 +34,7 @@ > import org.eclipse.emf.validation.internal.util.StringMatcher; > import org.eclipse.emf.validation.internal.util.Trace; > import org.eclipse.emf.validation.model.EvaluationMode; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.AbstractConstraintProvider; > import org.eclipse.emf.validation.service.IModelConstraintProvider; > import org.eclipse.emf.validation.service.ModelValidationService; >@@ -52,14 +53,15 @@ > private final IConfigurationElement myConfig; > private IConfigurationElement[] targets; > private String[] nsUris; >- private StringMatcher[] nsUriMatchers; >+ private final StringMatcher[] nsUriMatchers; > private IModelConstraintProvider provider = null; > private final boolean shouldCacheConstraints; > >- private final EvaluationMode mode; >+ private final EvaluationMode<?> mode; > > // map of (String => Boolean) caching whether a namespace is provided >- private final Map providedNamespaces = new java.util.WeakHashMap(); >+ private final Map<String, Boolean> providedNamespaces = >+ new java.util.HashMap<String, Boolean>(); > > /** > * The "null" provider never provides any constraints. It is used as a >@@ -71,17 +73,21 @@ > super(); > } > >- public Collection getBatchConstraints(EObject eObject, Collection constraints) { >+ @Override >+ public Collection<IModelConstraint> getBatchConstraints(EObject eObject, >+ Collection<IModelConstraint> constraints) { > return noOp(constraints); > } > >- public Collection getLiveConstraints(Notification notification, Collection constraints) { >+ @Override >+ public Collection<IModelConstraint> getLiveConstraints(Notification notification, >+ Collection<IModelConstraint> constraints) { > return noOp(constraints); > } > >- private Collection noOp(Collection constraints) { >+ private Collection<IModelConstraint> noOp(Collection<IModelConstraint> constraints) { > return (constraints == null) >- ? new java.util.ArrayList() >+ ? new java.util.ArrayList<IModelConstraint>() > : constraints; > } > } >@@ -98,8 +104,8 @@ > > this.mode = getMode(config); > >- Set uriSet = new java.util.HashSet(); >- Map uriMatcherMap = new java.util.HashMap(); >+ Set<String> uriSet = new java.util.HashSet<String>(); >+ Map<String, StringMatcher> uriMatcherMap = new java.util.HashMap<String, StringMatcher>(); > > // backward compatibility for the namespaceUri attribute > String uri = config.getAttribute(XmlConfig.A_NAMESPACE_URI); >@@ -118,8 +124,8 @@ > } > > IConfigurationElement[] pkgs = config.getChildren(XmlConfig.E_PACKAGE); >- for (int i = 0; i < pkgs.length; i++) { >- uri = pkgs[i].getAttribute(XmlConfig.A_NAMESPACE_URI); >+ for (IConfigurationElement element : pkgs) { >+ uri = element.getAttribute(XmlConfig.A_NAMESPACE_URI); > if (uri != null) { > uri = uri.trim(); > >@@ -151,9 +157,8 @@ > throw e; > } > >- nsUris = (String[]) uriSet.toArray(new String[uriSet.size()]); >- nsUriMatchers = (StringMatcher[]) uriMatcherMap.values().toArray( >- new StringMatcher[uriMatcherMap.size()]); >+ nsUris = uriSet.toArray(new String[uriSet.size()]); >+ nsUriMatchers = uriMatcherMap.values().toArray(new StringMatcher[uriMatcherMap.size()]); > > String shouldCache = config.getAttribute(XmlConfig.A_CACHE); > shouldCacheConstraints = (shouldCache == null) >@@ -180,7 +185,7 @@ > * @return the evaluation mode, or {@link EvaluationMode#NULL} if the > * provider provides constraints in mixed modes > */ >- private EvaluationMode getMode() { >+ private EvaluationMode<?> getMode() { > return mode; > } > >@@ -192,7 +197,8 @@ > * @return whether the provider has any chance of providing constraints > * for this context > */ >- public boolean provides(IProviderOperation operation) { >+ public boolean provides( >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation) { > if (operation instanceof GetLiveConstraintsOperation) { > return providesLiveConstraints(operation); > } else if (operation instanceof GetBatchConstraintsOperation) { >@@ -294,7 +300,7 @@ > * <CODE>true</CODE>, otherwise > */ > private boolean providesLiveConstraints( >- IProviderOperation operation) { >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation) { > > Trace.entering( > EMFModelValidationDebugOptions.PROVIDERS, >@@ -315,9 +321,7 @@ > } else { > EObject eObject = op.getEObject(); > >- for (int i = 0; i < targets.length; i++) { >- IConfigurationElement next = targets[i]; >- >+ for (IConfigurationElement next : targets) { > if (isLive() > && providerHandlesEObject(eObject, next) > && providerHandlesEvent(op.getEventType(), next)) { >@@ -344,7 +348,7 @@ > * <CODE>true</CODE>, otherwise > */ > private boolean providesBatchConstraints( >- IProviderOperation operation) { >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation) { > > Trace.entering( > EMFModelValidationDebugOptions.PROVIDERS, >@@ -365,9 +369,7 @@ > } else { > EObject eObject = op.getEObject(); > >- for (int i = 0; i < targets.length; i++) { >- IConfigurationElement next = targets[i]; >- >+ for (IConfigurationElement next : targets) { > if (providerHandlesEObject(eObject, next)) { > result = true; > break; >@@ -443,19 +445,19 @@ > EPackage epkg = eObject.eClass().getEPackage(); > String targetNsUri = epkg.getNsURI(); > >- Boolean result = (Boolean) providedNamespaces.get(targetNsUri); >+ Boolean result = providedNamespaces.get(targetNsUri); > if (result == null) { > result = providerHandlesNamespace(targetNsUri, targetNsUri); > > if (result == null) { > // look for EPackages that this package extends >- Set extended = getExtendedEPackages(epkg); >+ Set<EPackage> extended = getExtendedEPackages(epkg); > > if (!extended.isEmpty()) { >- for (Iterator iter = extended.iterator(); iter.hasNext() >+ for (Iterator<EPackage> iter = extended.iterator(); iter.hasNext() > && (result == null);) { > >- EPackage next = (EPackage) iter.next(); >+ EPackage next = iter.next(); > result = providerHandlesNamespace(targetNsUri, next > .getNsURI()); > } >@@ -540,8 +542,8 @@ > * @return all of the packages containing classifiers extended by this > * package's classifiers, not including the original package > */ >- private Set getExtendedEPackages(EPackage epackage) { >- Set result = new java.util.HashSet(); >+ private Set<EPackage> getExtendedEPackages(EPackage epackage) { >+ Set<EPackage> result = new java.util.HashSet<EPackage>(); > > getExtendedEPackages(epackage, result); > result.remove(epackage); >@@ -553,15 +555,11 @@ > * Recursive helper implementation of > * {@link #getExtendedEPackages(EPackage)}. > */ >- private void getExtendedEPackages(EPackage epackage, Set result) { >- for (Iterator iter = epackage.getEClassifiers().iterator(); iter >- .hasNext();) { >- Object next = iter.next(); >- >+ private void getExtendedEPackages(EPackage epackage, Set<EPackage> result) { >+ for (Object next : epackage.getEClassifiers()) { > if (next instanceof EClass) { >- for (Iterator jter = ((EClass) next).getESuperTypes() >- .iterator(); jter.hasNext();) { >- EPackage nextPackage = ((EClass) jter.next()).getEPackage(); >+ for (EClass zuper : ((EClass) next).getESuperTypes()) { >+ EPackage nextPackage = zuper.getEPackage(); > > if ((nextPackage != epackage) > && !result.contains(nextPackage)) { >@@ -601,8 +599,8 @@ > // it is implied that all events are supported > result = true; > } else { >- for (int i = 0; i < events.length; i++) { >- final String eventName = events[i].getAttribute( >+ for (IConfigurationElement element : events) { >+ final String eventName = element.getAttribute( > XmlConfig.A_NAME); > > if (eventType.getName().equalsIgnoreCase(eventName)) { >@@ -646,7 +644,7 @@ > * @return the evaluation mode of the constraint provider, or > * {@link EvaluationMode#NULL} if it has none > */ >- private EvaluationMode getMode(IConfigurationElement config) { >+ private EvaluationMode<?> getMode(IConfigurationElement config) { > String result = config.getAttribute(XmlConfig.A_MODE); > > if (result == null) { >@@ -657,6 +655,7 @@ > } > > // redefines the inherited method >+ @Override > public String toString() { > StringBuffer result = new StringBuffer(64); > >Index: src/org/eclipse/emf/validation/internal/service/GetLiveConstraintsOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/GetLiveConstraintsOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 GetLiveConstraintsOperation.java >--- src/org/eclipse/emf/validation/internal/service/GetLiveConstraintsOperation.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/GetLiveConstraintsOperation.java 9 Nov 2007 00:41:13 -0000 >@@ -20,6 +20,7 @@ > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.validation.EMFEventType; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IModelConstraintProvider; > > /** >@@ -39,7 +40,7 @@ > > private EMFEventType eventType; > private Notification notification; >- private List allEvents; >+ private List<Notification> allEvents; > > /** > * Initializes me. >@@ -72,7 +73,7 @@ > * > * @param events the {@link Notification}s > */ >- protected void setAllEvents(List events) { >+ protected void setAllEvents(List<? extends Notification> events) { > this.allEvents = Collections.unmodifiableList(events); > } > >@@ -90,7 +91,7 @@ > * > * @return the events > */ >- public final List getAllEvents() { >+ public final List<Notification> getAllEvents() { > return allEvents; > } > >@@ -104,18 +105,21 @@ > } > > // implements the inherited method >+ @Override > protected void executeImpl( > IModelConstraintProvider provider, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > assert provider != null; > > provider.getLiveConstraints(getNotification(), constraints); > } > > // implements the inherited method >+ @Override > protected AbstractValidationContext createContext() { > return new AbstractValidationContext(this) { > // re-implements the inherited method >+ @Override > public EStructuralFeature getFeature() { > EStructuralFeature result = null; > >@@ -129,6 +133,7 @@ > /* > * Redefines the inherited method. > */ >+ @Override > public Object getFeatureNewValue() { > Object result = null; > >@@ -153,15 +158,18 @@ > } > > // re-implements the inherited method >+ @Override > public EMFEventType getEventType() { > return GetLiveConstraintsOperation.this.getEventType(); > } > > // re-implements the inherited method >- public List getAllEvents() { >+ @Override >+ public List<Notification> getAllEvents() { > return GetLiveConstraintsOperation.this.getAllEvents(); > } > >+ @Override > public Notification getNotification() { > return GetLiveConstraintsOperation.this.getNotification(); > }}; >Index: src/org/eclipse/emf/validation/internal/service/TraversalStrategyManager.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/TraversalStrategyManager.java,v >retrieving revision 1.4 >diff -u -r1.4 TraversalStrategyManager.java >--- src/org/eclipse/emf/validation/internal/service/TraversalStrategyManager.java 31 Oct 2007 19:59:07 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/service/TraversalStrategyManager.java 9 Nov 2007 00:41:13 -0000 >@@ -52,7 +52,8 @@ > private static final TraversalStrategyManager INSTANCE = > new TraversalStrategyManager(); > >- private final Map packageDescriptors = new java.util.HashMap(); >+ private final Map<String, Descriptor> packageDescriptors = >+ new java.util.HashMap<String, Descriptor>(); > > /** > * Not instantiated by clients. >@@ -144,7 +145,7 @@ > * @return the corresponding descriptor > */ > private Descriptor getDescriptor(String nsUri) { >- Descriptor result = (Descriptor)packageDescriptors.get(nsUri); >+ Descriptor result = packageDescriptors.get(nsUri); > > if (result == null) { > result = new Descriptor(nsUri); >@@ -162,8 +163,9 @@ > */ > private static class Descriptor { > private final String nsUri; >- private Map eclassMap = new java.util.HashMap(); >- private ThreadLocalLazyStrategy packageDefaultStrategy; >+ private Map<Object, ThreadLocal<ITraversalStrategy>> eclassMap = >+ new java.util.HashMap<Object, ThreadLocal<ITraversalStrategy>>(); >+ private ThreadLocal<ITraversalStrategy> packageDefaultStrategy; > private boolean isResolved; > > /** >@@ -188,14 +190,16 @@ > * Determines whether <code>other</code> is a descriptor for the > * same EPackage as me. > */ >- public boolean equals(Object other) { >+ @Override >+ public boolean equals(Object other) { > return (other instanceof Descriptor) && > getNamespaceUri().equals( > ((Descriptor)other).getNamespaceUri()); > } > > // overrides the inherited implementation >- public int hashCode() { >+ @Override >+ public int hashCode() { > return getNamespaceUri().hashCode(); > } > >@@ -208,10 +212,13 @@ > */ > void addTraversalStrategy(IConfigurationElement config) { > IConfigurationElement[] eclasses = config.getChildren(E_ECLASS); >+ >+ ThreadLocal<ITraversalStrategy> strategy = >+ new ThreadLocalLazyStrategy(config); > > if ((eclasses.length == 0) && (packageDefaultStrategy == null)) { > // can only have one wildcard strategy >- packageDefaultStrategy = new ThreadLocalLazyStrategy(config); >+ packageDefaultStrategy = strategy; > } else { > for (int i = 0; i < eclasses.length; i++) { > IConfigurationElement next = eclasses[i]; >@@ -219,7 +226,7 @@ > > if (!eclassMap.containsKey(eclassName)) { > // take the first one registered against a name >- eclassMap.put(eclassName, config); >+ eclassMap.put(eclassName, strategy); > } > } > } >@@ -234,16 +241,15 @@ > private void resolve(EPackage ePackage) { > isResolved = true; > >- Map newMap = new java.util.HashMap(); >+ Map<Object, ThreadLocal<ITraversalStrategy>> newMap = >+ new java.util.HashMap<Object, ThreadLocal<ITraversalStrategy>>(); > >- for (Iterator iter = eclassMap.entrySet().iterator(); iter.hasNext();) { >- Map.Entry next = (Map.Entry)iter.next(); >+ for (Map.Entry<Object, ThreadLocal<ITraversalStrategy>> next : eclassMap.entrySet()) { > String eclassName = (String)next.getKey(); > > EClassifier eclass = ePackage.getEClassifier(eclassName); > if (eclass instanceof EClass) { >- newMap.put(eclass, new ThreadLocalLazyStrategy( >- (IConfigurationElement) next.getValue())); >+ newMap.put(eclass, next.getValue()); > } else { > // not a valid eclass > Log.warningMessage( >@@ -274,14 +280,14 @@ > resolve(eclass.getEPackage()); > } > >- ThreadLocal strategy = (ThreadLocal) eclassMap.get(eclass); >+ ThreadLocal<ITraversalStrategy> strategy = eclassMap.get(eclass); > > if (strategy == null) { > strategy = inheritStrategy(eclass); > eclassMap.put(eclass, strategy); > } > >- return (ITraversalStrategy) strategy.get(); >+ return strategy.get(); > } > } > >@@ -295,8 +301,8 @@ > * @return the inherited strategy, or the package's default, if none > * better is found > */ >- private ThreadLocal inheritStrategy(EClass eclass) { >- ThreadLocal result = getInheritedStrategy(eclass); >+ private ThreadLocal<ITraversalStrategy> inheritStrategy(EClass eclass) { >+ ThreadLocal<ITraversalStrategy> result = getInheritedStrategy(eclass); > > if (result == null) { > // use the wildcard strategy >@@ -320,16 +326,16 @@ > * @return the inherited strategy, or <code>null</code> if none was > * provided by any extension point > */ >- private ThreadLocal getInheritedStrategy(EClass eclass) { >- ThreadLocal result = null; >+ private ThreadLocal<ITraversalStrategy> getInheritedStrategy(EClass eclass) { >+ ThreadLocal<ITraversalStrategy> result = null; > >- for (Iterator iter = eclass.getESuperTypes().iterator(); >+ for (Iterator<EClass> iter = eclass.getESuperTypes().iterator(); > (result == null) && iter.hasNext();) { > >- EClass next = (EClass)iter.next(); >+ EClass next = iter.next(); > > if (eclassMap.containsKey(next)) { >- result = (ThreadLocal) eclassMap.get(next); >+ result = eclassMap.get(next); > } else { > result = getInheritedStrategy(next); > } >@@ -367,19 +373,17 @@ > // replace all ocurrences of the configuration element with the > // newly instantiated traversal strategy for future look-ups > if (packageDefaultStrategy != null) { >- packageDefaultStrategy.preinitialize(result, config); >+ ((ThreadLocalLazyStrategy) packageDefaultStrategy).preinitialize(result, config); > } > >- for (Iterator iter = eclassMap.values().iterator(); iter.hasNext();) { >- ThreadLocalLazyStrategy next = (ThreadLocalLazyStrategy) iter.next(); >- >- next.preinitialize(result, config); >+ for (Object next : eclassMap.values()) { >+ ((ThreadLocalLazyStrategy) next).preinitialize(result, config); > } > > return result; > } > >- private class ThreadLocalLazyStrategy extends ThreadLocal { >+ private class ThreadLocalLazyStrategy extends ThreadLocal<ITraversalStrategy> { > private final IConfigurationElement config; > > ThreadLocalLazyStrategy() { >@@ -390,7 +394,8 @@ > this.config = config; > } > >- protected Object initialValue() { >+ @Override >+ protected ITraversalStrategy initialValue() { > return (config == null)? new ITraversalStrategy.Recursive() : > initializeStrategy(config); > } >Index: src/org/eclipse/emf/validation/internal/service/ClientContextManager.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/ClientContextManager.java,v >retrieving revision 1.3 >diff -u -r1.3 ClientContextManager.java >--- src/org/eclipse/emf/validation/internal/service/ClientContextManager.java 6 Jun 2007 22:27:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/ClientContextManager.java 9 Nov 2007 00:41:13 -0000 >@@ -51,10 +51,10 @@ > > private static final ClientContextManager INSTANCE = new ClientContextManager(); > >- private final Set clientContexts = new java.util.HashSet(); >- private final Map clientContextMap = new java.util.HashMap(); >+ private final Set<IClientContext> clientContexts = new java.util.HashSet<IClientContext>(); >+ private final Map<String, IClientContext> clientContextMap = new java.util.HashMap<String, IClientContext>(); > >- private final Set defaultContexts = new java.util.HashSet(); >+ private final Set<IClientContext> defaultContexts = new java.util.HashSet<IClientContext>(); > > /** > * Not instantiable by clients. >@@ -80,7 +80,7 @@ > * under this ID > */ > public IClientContext getClientContext(String contextId) { >- return (IClientContext) clientContextMap.get(contextId); >+ return clientContextMap.get(contextId); > } > > /** >@@ -88,7 +88,7 @@ > * > * @return the available {@link IClientContext}s > */ >- public Set getClientContexts() { >+ public Set<IClientContext> getClientContexts() { > return clientContexts; > } > >@@ -100,13 +100,13 @@ > * <code>eObject</code> belongs. This may be empty if no context > * selector matches this element > */ >- public Collection getClientContextsFor(EObject eObject) { >- Collection result = new java.util.ArrayList(); >+ public Collection<IClientContext> getClientContextsFor(EObject eObject) { >+ Collection<IClientContext> result = new java.util.ArrayList<IClientContext>(); > > EvaluationContext ctx = new EvaluationContext(null, eObject); > >- for (Iterator iter = getClientContexts().iterator(); iter.hasNext();) { >- IClientContext next = (IClientContext) iter.next(); >+ for (Iterator<IClientContext> iter = getClientContexts().iterator(); iter.hasNext();) { >+ IClientContext next = iter.next(); > IClientSelector selector = next.getSelector(); > > final Object toTest = (selector instanceof XmlExpressionSelector) >@@ -149,20 +149,20 @@ > * @return the {@link IModelConstraint}s from amongst the specified > * <code>constraints</code> that are bound to the <code>context</code> > */ >- public Collection getBindings(EObject eObject, Collection constraints) { >- Collection result; >+ public Collection<IModelConstraint> getBindings(EObject eObject, >+ Collection<? extends IModelConstraint> constraints) { > >- Collection contexts = getClientContextsFor(eObject); >+ Collection<IModelConstraint> result; >+ >+ Collection<IClientContext> contexts = getClientContextsFor(eObject); > > if (contexts.isEmpty()) { > // no context recognizes this object? Oh, well, then there are > // no constraints >- result = Collections.EMPTY_LIST; >+ result = Collections.emptyList(); > } else if (contexts.size() == 1) { > // easy when there's just one context >- result = getBindings( >- (IClientContext) contexts.iterator().next(), >- constraints); >+ result = getBindings(contexts.iterator().next(), constraints); > } else { > // multiple contexts require more looping > result = getBindings(contexts, constraints); >@@ -180,12 +180,13 @@ > * @return the {@link IModelConstraint}s from amongst the specified > * <code>constraints</code> that are bound to the <code>context</code> > */ >- public Collection getBindings(IClientContext context, Collection constraints) { >- Collection result = new java.util.ArrayList(constraints.size()); >+ public Collection<IModelConstraint> getBindings(IClientContext context, >+ Collection<? extends IModelConstraint> constraints) { > >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- IModelConstraint constraint = (IModelConstraint) iter.next(); >- >+ Collection<IModelConstraint> result = new java.util.ArrayList<IModelConstraint>( >+ constraints.size()); >+ >+ for (IModelConstraint constraint : constraints) { > if (context.includes(constraint)) { > result.add(constraint); > } else if (context.isDefault()) { >@@ -209,29 +210,31 @@ > * @return the {@link IModelConstraint}s from amongst the specified > * <code>constraints</code> that are bound to the <code>context</code> > */ >- public Collection getBindings(Collection contexts, Collection constraints) { >- Collection result = new java.util.ArrayList(constraints.size()); >+ public Collection<IModelConstraint> getBindings( >+ Collection<? extends IClientContext> contexts, >+ Collection<? extends IModelConstraint> constraints) { >+ >+ Collection<IModelConstraint> result = new java.util.ArrayList<IModelConstraint>( >+ constraints.size()); > > // use an array for performance (to avoid creating so many iterators) >- IClientContext[] ctxArray = (IClientContext[]) contexts.toArray( >- new IClientContext[contexts.size()]); >+ IClientContext[] ctxArray = contexts.toArray(new IClientContext[contexts.size()]); > > // in case we don't find an explicit binding, we need to know whether > // we need to look for default bindings. This will only be the case > // if any of the current contexts is default > boolean anyContextIsDefault = false; > >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- IModelConstraint constraint = (IModelConstraint) iter.next(); >+ for (IModelConstraint constraint : constraints) { > boolean bound = false; > >- for (int i = 0; i < ctxArray.length; i++) { >- bound = ctxArray[i].includes(constraint); >+ for (IClientContext element : ctxArray) { >+ bound = element.includes(constraint); > > if (bound) { > result.add(constraint); > break; // needn't look at any more contexts >- } else if (ctxArray[i].isDefault()) { >+ } else if (element.isDefault()) { > // no need to check for default contexts as long as we > // find explicit bindings > anyContextIsDefault = true; >@@ -270,15 +273,17 @@ > boolean result = true; > String id = constraint.getDescriptor().getId(); > >- for (Iterator iter = clientContexts.iterator(); result && iter.hasNext();) { >- result = !((IClientContext) iter.next()).includes(constraint); >+ for (Iterator<IClientContext> iter = clientContexts.iterator(); >+ result && iter.hasNext();) { >+ >+ result = !iter.next().includes(constraint); > } > > if (result) { > // add the constraint to all default contexts so that we don't do > // this computation again >- for (Iterator iter = defaultContexts.iterator(); iter.hasNext();) { >- ((ClientContext) iter.next()).bindConstraint(id); >+ for (IClientContext next : defaultContexts) { >+ ((ClientContext) next).bindConstraint(id); > } > } > >@@ -313,9 +318,7 @@ > * <code>constraintBindings</code> extension point > */ > private void configureClientContexts(IConfigurationElement[] elements) { >- for (int i = 0; i < elements.length; i++) { >- IConfigurationElement config = elements[i]; >- >+ for (IConfigurationElement config : elements) { > if (E_CLIENT_CONTEXT.equals(config.getName())) { > try { > ClientContext context = new ClientContext(config); >@@ -345,9 +348,7 @@ > * <code>constraintBindings</code> extension point > */ > private void configureBindings(IConfigurationElement[] elements) { >- for (int i = 0; i < elements.length; i++) { >- IConfigurationElement config = elements[i]; >- >+ for (IConfigurationElement config : elements) { > if (E_BINDING.equals(config.getName())) { > String contextId = config.getAttribute(A_CONTEXT); > >@@ -396,8 +397,8 @@ > } > > IConfigurationElement[] children = config.getChildren(A_CONSTRAINT); >- for (int i = 0; i < children.length; i++) { >- final String ref = children[i].getAttribute(A_REF); >+ for (IConfigurationElement element : children) { >+ final String ref = element.getAttribute(A_REF); > > if (ref == null) { > Log.warningMessage( >@@ -412,8 +413,8 @@ > } > > children = config.getChildren(A_CATEGORY); >- for (int i = 0; i < children.length; i++) { >- final String ref = children[i].getAttribute(A_REF); >+ for (IConfigurationElement element : children) { >+ final String ref = element.getAttribute(A_REF); > > if (ref == null) { > Log.errorMessage( >Index: src/org/eclipse/emf/validation/internal/service/IProviderDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/IProviderDescriptor.java,v >retrieving revision 1.2 >diff -u -r1.2 IProviderDescriptor.java >--- src/org/eclipse/emf/validation/internal/service/IProviderDescriptor.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/IProviderDescriptor.java 9 Nov 2007 00:41:13 -0000 >@@ -12,6 +12,9 @@ > > package org.eclipse.emf.validation.internal.service; > >+import java.util.Collection; >+ >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IModelConstraintProvider; > > /** >@@ -33,7 +36,8 @@ > * @return whether the provider has any chance of providing constraints > * for this context > */ >- boolean provides(IProviderOperation operation); >+ boolean provides( >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation); > > /** > * Queries whether the system should cache constraints retrieved from >Index: src/org/eclipse/emf/validation/internal/service/AbstractValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/AbstractValidator.java,v >retrieving revision 1.3 >diff -u -r1.3 AbstractValidator.java >--- src/org/eclipse/emf/validation/internal/service/AbstractValidator.java 29 Mar 2007 16:50:25 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/AbstractValidator.java 9 Nov 2007 00:41:13 -0000 >@@ -46,14 +46,14 @@ > * > * @author Christian W. Damus (cdamus) > */ >-abstract class AbstractValidator implements IValidator { >- private final EvaluationMode mode; >- private final Map clientData = new java.util.HashMap(); >- private final IProviderOperationExecutor executor; >+abstract class AbstractValidator<T> implements IValidator<T> { >+ private final EvaluationMode<T> mode; >+ private final Map<String, Object> clientData = new java.util.HashMap<String, Object>(); >+ private final IProviderOperationExecutor<Collection<IModelConstraint>> executor; > > private boolean reportSuccesses = false; > >- private Collection filters = null; >+ private Collection<IConstraintFilter> filters = null; > > /** > * Initializes me with the evaluation <code>mode</code> that I support and >@@ -66,8 +66,8 @@ > * <code>null</code>) > */ > protected AbstractValidator( >- EvaluationMode mode, >- IProviderOperationExecutor executor) { >+ EvaluationMode<T> mode, >+ IProviderOperationExecutor<Collection<IModelConstraint>> executor) { > assert mode != null && !mode.isNull(); > assert executor != null; > >@@ -78,7 +78,7 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- public final EvaluationMode getEvaluationMode() { >+ public final EvaluationMode<T> getEvaluationMode() { > return mode; > } > >@@ -116,7 +116,7 @@ > * validation API is also encouraged to delegate to this method after > * first checking that arguments are of or coerced to the correct types. > */ >- public final IStatus validate(Object object) { >+ public final IStatus validate(T object) { > return validate(Collections.singleton(object)); > } > >@@ -132,10 +132,10 @@ > * returns an appropriate {@link IStatus#CANCEL} status when it catches one. > * </p> > */ >- public final IStatus validate(Collection objects) { >+ public final IStatus validate(Collection<? extends T> objects) { > IStatus result; > >- Set encounteredClientContexts = new HashSet(); >+ Set<IClientContext> encounteredClientContexts = new HashSet<IClientContext>(); > > try { > result = createStatus(doValidate(objects, encounteredClientContexts)); >@@ -173,17 +173,17 @@ > * @return The client contexts ids provided to this validator by the last call > * to the {@link #evaluateConstraints(AbstractValidationContext, List) method. > */ >- private Collection getClientContextIds(Collection clientContexts) { >- List contextIds = new ArrayList(); >+ private Collection<String> getClientContextIds(Collection<IClientContext> clientContexts) { >+ List<String> contextIds = new ArrayList<String>(); > > if (clientContexts == null) { > return contextIds; > } > >- for (Iterator i = clientContexts.iterator(); i.hasNext();) { >- IClientContext context = (IClientContext)i.next(); >+ for (IClientContext context : clientContexts) { > contextIds.add(context.getId()); > } >+ > return contextIds; > } > >@@ -200,7 +200,8 @@ > * canceled (e.g., when a constraint returns > * {@link IStatus#CANCEL} status) > */ >- protected abstract Collection doValidate(Collection objects, Set clientContexts); >+ protected abstract Collection<IStatus> doValidate(Collection<? extends T> objects, >+ Set<IClientContext> clientContexts); > > /** > * Helper method to evaluate a bunch of constraints. Disabled constraints >@@ -220,11 +221,11 @@ > */ > protected IStatus evaluateConstraints( > AbstractValidationContext ctx, >- List results) { >+ List<IStatus> results) { > IStatus resultStatus = Status.OK_STATUS; > >- for (Iterator iter = ctx.getConstraints().iterator(); iter.hasNext();) { >- IModelConstraint next = (IModelConstraint)iter.next(); >+ for (Object element : ctx.getConstraints()) { >+ IModelConstraint next = (IModelConstraint)element; > > if (!acceptConstraint(next.getDescriptor(), ctx.getTarget())) { > continue; >@@ -282,7 +283,8 @@ > * > * @param operation the operation to execute > */ >- protected final void execute(IProviderOperation operation) { >+ protected final void execute( >+ IProviderOperation<Collection<IModelConstraint>> operation) { > getOperationExecutor().execute(operation); > } > >@@ -291,7 +293,7 @@ > * > * @return my operation executor > */ >- private IProviderOperationExecutor getOperationExecutor() { >+ private IProviderOperationExecutor<Collection<IModelConstraint>> getOperationExecutor() { > return executor; > } > >@@ -305,7 +307,7 @@ > * @return a multi-status if more than one result; a plain {@link IStatus}, > * otherwise > */ >- private IStatus createStatus(Collection results) { >+ private IStatus createStatus(Collection<IStatus> results) { > if (results.isEmpty()) { > return new org.eclipse.core.runtime.Status( > IStatus.OK, >@@ -314,7 +316,7 @@ > EMFModelValidationStatusCodes.NO_CONSTRAINTS_EVALUATED_MSG, > null); > } else if (results.size() == 1) { >- return (IStatus)results.iterator().next(); >+ return results.iterator().next(); > } else { > return new AggregateStatus(results); > } >@@ -322,8 +324,8 @@ > > private boolean acceptConstraint(IConstraintDescriptor constraint, EObject target) { > if (filters != null) { >- for (Iterator iter = filters.iterator(); iter.hasNext();) { >- IConstraintFilter filter = (IConstraintFilter)iter.next(); >+ for (Object element : filters) { >+ IConstraintFilter filter = (IConstraintFilter)element; > > if (!filter.accept(constraint, target)) { > return false; >@@ -336,7 +338,7 @@ > > public void addConstraintFilter(IConstraintFilter filter) { > if (filters == null) { >- filters = new BasicEList(4); >+ filters = new BasicEList<IConstraintFilter>(4); > } > > filters.add(filter); >@@ -348,9 +350,9 @@ > } > } > >- public Collection getConstraintFilters() { >+ public Collection<IConstraintFilter> getConstraintFilters() { > if (filters == null) { >- return Collections.EMPTY_LIST; >+ return Collections.emptyList(); > } > > return Collections.unmodifiableCollection(filters); >@@ -363,7 +365,7 @@ > * @author Christian W. Damus (cdamus) > */ > private static class AggregateStatus implements IStatus { >- private final Collection children; >+ private final Collection<? extends IStatus> children; > private final int severity; > private final int code; > private final String message; >@@ -375,7 +377,7 @@ > * > * @param statuses the statuses that I aggregate > */ >- AggregateStatus(Collection statuses) { >+ AggregateStatus(Collection<? extends IStatus> statuses) { > // aggregate the results into a multi-status > > int maxSeverity = getMaximalSeverity(statuses); >@@ -413,7 +415,7 @@ > > // implements the interface method > public IStatus[] getChildren() { >- return (IStatus[])children.toArray(new IStatus[children.size()]); >+ return children.toArray(new IStatus[children.size()]); > } > > // implements the interface method >@@ -462,13 +464,13 @@ > * @param statuses a collection of {@link IStatus} objects > * @return the maximal severity amongst the <code>statuses</code> > */ >- private int getMaximalSeverity(Collection statuses) { >+ private int getMaximalSeverity(Collection<? extends IStatus> statuses) { > int result = IStatus.OK; > >- for (Iterator iter = statuses.iterator(); >+ for (Iterator<? extends IStatus> iter = statuses.iterator(); > (result < IStatus.ERROR) && iter.hasNext();) { > >- IStatus next = (IStatus)iter.next(); >+ IStatus next = iter.next(); > > if (next.getSeverity() > result) { > result = next.getSeverity(); >Index: src/org/eclipse/emf/validation/internal/service/IProviderOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/IProviderOperation.java,v >retrieving revision 1.2 >diff -u -r1.2 IProviderOperation.java >--- src/org/eclipse/emf/validation/internal/service/IProviderOperation.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/IProviderOperation.java 9 Nov 2007 00:41:13 -0000 >@@ -16,14 +16,17 @@ > > import org.eclipse.emf.ecore.EObject; > >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IModelConstraintProvider; > > /** > * Interface describing an {@link IModelConstraintProvider} operation. > * >+ * @param <T> the result type of the operation >+ * > * @author Christian W. Damus (cdamus) > */ >-public interface IProviderOperation { >+public interface IProviderOperation<T> { > /** > * Obtains the EMF object that is to be validated. > * >@@ -37,7 +40,7 @@ > * > * @return the constraints > */ >- Collection getConstraints(); >+ Collection<IModelConstraint> getConstraints(); > > /** > * Executes me on the specified constraint <code>provider</code>. >@@ -45,5 +48,5 @@ > * @param provider a constraint provider > * @return my {@link #getConstraints constraints collection} > */ >- Object execute(IModelConstraintProvider provider); >+ T execute(IModelConstraintProvider provider); > } >Index: src/org/eclipse/emf/validation/internal/service/ValidationCanceledException.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/ValidationCanceledException.java,v >retrieving revision 1.1 >diff -u -r1.1 ValidationCanceledException.java >--- src/org/eclipse/emf/validation/internal/service/ValidationCanceledException.java 29 Mar 2007 16:50:25 -0000 1.1 >+++ src/org/eclipse/emf/validation/internal/service/ValidationCanceledException.java 9 Nov 2007 00:41:13 -0000 >@@ -29,6 +29,8 @@ > * @author Christian W. Damus (cdamus) > */ > public class ValidationCanceledException extends RuntimeException { >+ private static final long serialVersionUID = -2541909077699487325L; >+ > private final IStatus status; > > /** >Index: src/org/eclipse/emf/validation/internal/service/ClientContext.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/service/ClientContext.java,v >retrieving revision 1.3 >diff -u -r1.3 ClientContext.java >--- src/org/eclipse/emf/validation/internal/service/ClientContext.java 6 Jun 2007 22:27:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/ClientContext.java 9 Nov 2007 00:41:13 -0000 >@@ -55,10 +55,10 @@ > private final boolean isDefault; > > // set of String constraint IDs that are bound to me >- private final Set constraintBindings = new java.util.HashSet(); >+ private final Set<String> constraintBindings = new java.util.HashSet<String>(); > > // set of String category IDs that are bound to me >- private final Set categoryBindings = new java.util.HashSet(); >+ private final Set<String> categoryBindings = new java.util.HashSet<String>(); > > /** > * Initializes me with my XML configuration. >@@ -266,11 +266,11 @@ > * @return <code>true</code> if any of the <code>categories</code> is bound, > * or if any of their ancestors is bound; <code>false</code>, otherwise > */ >- private boolean hasCategoryBinding(Collection categories) { >+ private boolean hasCategoryBinding(Collection<Category> categories) { > boolean result = false; > >- for (Iterator iter = categories.iterator(); !result && iter.hasNext();) { >- Category category = (Category) iter.next(); >+ for (Iterator<Category> iter = categories.iterator(); !result && iter.hasNext();) { >+ Category category = iter.next(); > > result = categoryBindings.contains(category.getPath()); > >@@ -316,6 +316,7 @@ > /** > * The context ID fully determines equality. > */ >+ @Override > public boolean equals(Object obj) { > return (obj instanceof ClientContext) > && ((ClientContext) obj).getId().equals(getId()); >@@ -324,10 +325,12 @@ > /** > * The context ID fully determines equality. > */ >+ @Override > public int hashCode() { > return getId().hashCode(); > } > >+ @Override > public String toString() { > return "ClientContext[" + getId() + ']'; //$NON-NLS-1$ > } >Index: src/org/eclipse/emf/validation/service/ConstraintChangeEventType.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/ConstraintChangeEventType.java,v >retrieving revision 1.1 >diff -u -r1.1 ConstraintChangeEventType.java >--- src/org/eclipse/emf/validation/service/ConstraintChangeEventType.java 19 Mar 2007 16:47:08 -0000 1.1 >+++ src/org/eclipse/emf/validation/service/ConstraintChangeEventType.java 9 Nov 2007 00:41:14 -0000 >@@ -16,7 +16,7 @@ > import java.util.Collections; > import java.util.List; > >-import org.eclipse.emf.common.util.AbstractEnumerator; >+import org.eclipse.emf.common.util.Enumerator; > > /** > * Enumeration for a constraint change event type. >@@ -25,52 +25,41 @@ > * > * @author David Cummings (dcummin) > */ >-public final class ConstraintChangeEventType >- extends AbstractEnumerator { >- >- private static final long serialVersionUID = 1L; >- >- /** >- * An internal unique identifier for this enumerated type. >- */ >- private static int nextOrdinal = 0; >+public enum ConstraintChangeEventType >+ implements Enumerator { > > /** > * Registered constraint change event type > */ >- public static final ConstraintChangeEventType REGISTERED = new ConstraintChangeEventType( >- "Registered"); //$NON-NLS-1$ >+ REGISTERED("Registered"), //$NON-NLS-1$ > > /** > * Unregistered constraint change event type > */ >- public static final ConstraintChangeEventType UNREGISTERED = new ConstraintChangeEventType( >- "Unregistered"); //$NON-NLS-1$ >+ UNREGISTERED ("Unregistered"), //$NON-NLS-1$ > > /** > * Enabled constraint change event type > */ >- public static final ConstraintChangeEventType ENABLED = new ConstraintChangeEventType( >- "Enabled"); //$NON-NLS-1$ >+ ENABLED("Enabled"), //$NON-NLS-1$ > > /** > * Disabled constraint change event type > */ >- public static final ConstraintChangeEventType DISABLED = new ConstraintChangeEventType( >- "Disabled"); //$NON-NLS-1$ >+ DISABLED("Disabled"), //$NON-NLS-1$ > > /** > * Added category constraint change event type > */ >- public static final ConstraintChangeEventType ADDED_CATEGORY = new ConstraintChangeEventType( >- "Added Category"); //$NON-NLS-1$ >+ ADDED_CATEGORY("Added Category"), //$NON-NLS-1$ > > /** > * Removed category constraint change event type > */ >- public static final ConstraintChangeEventType REMOVED_CATEGORY = new ConstraintChangeEventType( >- "Removed Category"); //$NON-NLS-1$ >+ REMOVED_CATEGORY ("Removed Category"); //$NON-NLS-1$ > >+ >+ private static final long serialVersionUID = 1L; > > private static final ConstraintChangeEventType[] VALUES = { REGISTERED, > UNREGISTERED, >@@ -79,24 +68,16 @@ > ADDED_CATEGORY, > REMOVED_CATEGORY }; > >+ private final String name; >+ > /** > * Constructs a new constraint change event type with the specified name and > * ordinal. > * > * @param name The name of the constraint change event type >- * @param ordinal The ordinal for the constraint change event type. >- */ >- private ConstraintChangeEventType(String name, int ordinal) { >- super(ordinal, name); >- } >- >- /** >- * Constructs a new constraint change event type with the specified name. >- * >- * @param name The name of the new constraint change event type. > */ > private ConstraintChangeEventType(String name) { >- this(name, nextOrdinal++); >+ this.name = name; > } > > /** >@@ -104,7 +85,19 @@ > * > * @return an unmodifiable collection of the event types > */ >- protected List getValues() { >+ protected List<ConstraintChangeEventType> getValues() { > return Collections.unmodifiableList(Arrays.asList(VALUES)); > } >+ >+ public int getValue() { >+ return ordinal(); >+ } >+ >+ public String getLiteral() { >+ return getName(); >+ } >+ >+ public String getName() { >+ return name; >+ } > } >Index: src/org/eclipse/emf/validation/service/IBatchValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/IBatchValidator.java,v >retrieving revision 1.3 >diff -u -r1.3 IBatchValidator.java >--- src/org/eclipse/emf/validation/service/IBatchValidator.java 6 Jun 2007 22:27:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/service/IBatchValidator.java 9 Nov 2007 00:41:14 -0000 >@@ -33,7 +33,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public interface IBatchValidator extends IValidator { >+public interface IBatchValidator extends IValidator<EObject> { > /** > * <p> > * Queries whether I also evaluate applicable live constraints on each >@@ -117,17 +117,15 @@ > * @return the validation status > * @see IValidator#validate(Object) > */ >- IStatus validate(Collection eObjects, IProgressMonitor monitor); >+ IStatus validate(Collection<? extends EObject> eObjects, IProgressMonitor monitor); > > /** > * Validates a single {@link EObject EMF element} without using any > * progress monitor. > * >- * @param object must be an {@link org.eclipse.emf.ecore.EObject} >- * @throws ClassCastException if <code>object</code> is not an >- * {@link org.eclipse.emf.ecore.EObject} >+ * @param object the object to validate > */ >- IStatus validate(Object object); >+ IStatus validate(EObject eobject); > > /** > * Validates multiple {@link EObject EMF elements} without using any >@@ -137,5 +135,5 @@ > * @throws ClassCastException if any of the <code>objects</code> is > * not an {@link org.eclipse.emf.ecore.EObject} > */ >- IStatus validate(Collection objects); >+ IStatus validate(Collection<? extends EObject> objects); > } >Index: src/org/eclipse/emf/validation/service/ValidationEvent.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/ValidationEvent.java,v >retrieving revision 1.2 >diff -u -r1.2 ValidationEvent.java >--- src/org/eclipse/emf/validation/service/ValidationEvent.java 29 Dec 2005 18:56:18 -0000 1.2 >+++ src/org/eclipse/emf/validation/service/ValidationEvent.java 9 Nov 2007 00:41:14 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2005 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 >@@ -27,7 +27,7 @@ > /** > * Event notifying {@link IValidationListener}s that a validation operation > * has occurred. >- * >+ * > * @author Christian W. Damus (cdamus) > */ > public final class ValidationEvent >@@ -35,19 +35,21 @@ > > private static final long serialVersionUID = -7900125537603879206L; > >- private final EvaluationMode mode; >- private final Map clientData; >+ private final EvaluationMode<?> mode; >+ private final Map<String, ?> clientData; > private final IStatus status; >- private final Collection targets; >- private List results; >+ private final Collection<?> targets; >+ private List<IConstraintStatus> results; > >- private Collection clientContextIds = null; >+ private Collection<String> clientContextIds = null; > > /** > * Initializes me with the evaluation mode, client data, elements or > * notifications validated, and validation results that I will pass along > * to listeners. > * >+ * @param <T> the kind of objects that were validated >+ * > * @param mode the evaluation mode > * @param clientData data specific to the particular validation client > * that performed the validation wishes to make available to listeners >@@ -55,10 +57,10 @@ > * mode) that were validated > * @param status the validation results > */ >- public ValidationEvent( >- EvaluationMode mode, >- Map clientData, >- Collection targets, >+ public <T> ValidationEvent( >+ EvaluationMode<T> mode, >+ Map<String, ?> clientData, >+ Collection<? extends T> targets, > IStatus status) { > > super(ModelValidationService.getInstance()); >@@ -68,7 +70,7 @@ > this.targets = Collections.unmodifiableCollection(targets); > > if (clientData == null) { >- this.clientData = Collections.EMPTY_MAP; >+ this.clientData = Collections.emptyMap(); > } else { > this.clientData = Collections.unmodifiableMap(clientData); > } >@@ -77,9 +79,12 @@ > /** > * Initializes me with the evaluation mode, client data, elements or > * notifications validated, and validation results that I will pass along >- * to listeners. Also, I will be initialized with the client context Ids >+ * to listeners. Also, I will be initialized with the client context IDs > * that were involved in the validation. > * >+ * >+ * @param <T> the kind of objects that were validated >+ * > * @param mode the evaluation mode > * @param clientData data specific to the particular validation client > * that performed the validation wishes to make available to listeners >@@ -89,12 +94,12 @@ > * @param clientContextIds the client context Ids that were involved in the > * validation. > */ >- public ValidationEvent( >- EvaluationMode mode, >- Map clientData, >- Collection targets, >+ public <T> ValidationEvent( >+ EvaluationMode<T> mode, >+ Map<String, ?> clientData, >+ Collection<? extends T> targets, > IStatus status, >- Collection clientContextIds) { >+ Collection<String> clientContextIds) { > > this(mode,clientData,targets,status); > >@@ -108,9 +113,9 @@ > * @return A collection of the client context ids in String form. These > * ids should not be modified in any way as they may affect other listeners. > */ >- public Collection getClientContextIds() { >+ public Collection<String> getClientContextIds() { > if (clientContextIds == null) { >- clientContextIds = Collections.EMPTY_LIST; >+ clientContextIds = Collections.emptyList(); > } > return clientContextIds; > } >@@ -121,7 +126,7 @@ > * @return the evaluation mode; never <code>null</code> or > * even {@link EvaluationMode#NULL} > */ >- public EvaluationMode getEvaluationMode() { >+ public EvaluationMode<?> getEvaluationMode() { > return mode; > } > >@@ -137,7 +142,7 @@ > * > * @return an unmodifiable mapping of client data > */ >- public Map getClientData() { >+ public Map<String, ?> getClientData() { > return clientData; > } > >@@ -150,7 +155,7 @@ > * > * @see #getValidationResults() > */ >- public Collection getValidationTargets() { >+ public Collection<?> getValidationTargets() { > return targets; > } > >@@ -188,22 +193,22 @@ > * > * @see #getValidationTargets() > */ >- public List getValidationResults() { >+ public List<IConstraintStatus> getValidationResults() { > if (results == null) { > // lazily compute the results > if (status.isMultiStatus()) { > IStatus[] children = status.getChildren(); >- results = new java.util.ArrayList(children.length); >- for (int i = 0; i < children.length; i++) { >- if (children[i] instanceof IConstraintStatus) { >- results.add(children[i]); >+ results = new java.util.ArrayList<IConstraintStatus>(children.length); >+ for (IStatus element : children) { >+ if (element instanceof IConstraintStatus) { >+ results.add((IConstraintStatus) element); > } > } > results = Collections.unmodifiableList(results); > } else if (status instanceof IConstraintStatus) { >- results = Collections.singletonList(status); >+ results = Collections.singletonList((IConstraintStatus) status); > } else { >- results = Collections.EMPTY_LIST; >+ results = Collections.emptyList(); > } > } > >Index: src/org/eclipse/emf/validation/service/AbstractConstraintProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/AbstractConstraintProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractConstraintProvider.java >--- src/org/eclipse/emf/validation/service/AbstractConstraintProvider.java 7 Nov 2007 17:30:11 -0000 1.4 >+++ src/org/eclipse/emf/validation/service/AbstractConstraintProvider.java 9 Nov 2007 00:41:14 -0000 >@@ -14,7 +14,6 @@ > package org.eclipse.emf.validation.service; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > import java.util.ListIterator; > import java.util.Set; >@@ -62,7 +61,7 @@ > IExecutableExtension { > > private String[] namespaceUris; >- private List myConstraints = new java.util.ArrayList(); >+ private final List<IModelConstraint> myConstraints = new java.util.ArrayList<IModelConstraint>(); > > /** > * A proxy for a lazily instantiated implementation of the >@@ -137,7 +136,7 @@ > > // replace me with my delegate in the list of constraints, to avoid > // the delegation in future invocations and to free some memory >- for (ListIterator iter = getConstraints().listIterator(); >+ for (ListIterator<IModelConstraint> iter = getConstraints().listIterator(); > iter.hasNext();) { > > if (iter.next() == this) { >@@ -206,7 +205,7 @@ > * > * @since 1.1 > */ >- protected List getConstraints() { >+ protected List<IModelConstraint> getConstraints() { > return myConstraints; > } > >@@ -232,7 +231,7 @@ > String propertyName, > Object data) throws CoreException { > >- Set uris = new java.util.HashSet(); >+ Set<String> uris = new java.util.HashSet<String>(); > > // backwards compatibility to the namespaceUri attribute > String uri = config.getAttribute( >@@ -243,8 +242,8 @@ > > IConfigurationElement[] pkgs = config.getChildren(XmlConfig.E_PACKAGE); > >- for (int i = 0; i < pkgs.length; i++) { >- uri = pkgs[i].getAttribute(XmlConfig.A_NAMESPACE_URI); >+ for (IConfigurationElement element : pkgs) { >+ uri = element.getAttribute(XmlConfig.A_NAMESPACE_URI); > if (uri != null) { > uris.add(uri.trim()); > } >@@ -266,15 +265,15 @@ > throw e; > } > >- namespaceUris = (String[]) uris.toArray(new String[uris.size()]); >+ namespaceUris = uris.toArray(new String[uris.size()]); > } > > /** > * @since 1.1 > */ >- public Collection getLiveConstraints( >+ public Collection<IModelConstraint> getLiveConstraints( > Notification notification, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > > assert notification != null; > >@@ -282,17 +281,16 @@ > Trace.entering(getClass(), "getLiveConstraints"); //$NON-NLS-1$ > } > >- Collection result = constraints; >+ Collection<IModelConstraint> result = constraints; > > if (result == null) { >- result = new java.util.ArrayList(); >+ result = new java.util.ArrayList<IModelConstraint>(); > } > > if (notification.getNotifier() instanceof EObject) { > EObject eObject = (EObject)notification.getNotifier(); > >- for (Iterator iter = getConstraints().iterator(); iter.hasNext(); ) { >- IModelConstraint next = (IModelConstraint)iter.next(); >+ for (IModelConstraint next : getConstraints()) { > IConstraintDescriptor desc = next.getDescriptor(); > > if (desc.isLive() && desc.targetsTypeOf(eObject) >@@ -313,22 +311,21 @@ > /** > * @since 1.1 > */ >- public Collection getBatchConstraints( >+ public Collection<IModelConstraint> getBatchConstraints( > EObject eObject, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > > if (Trace.shouldTraceEntering(EMFModelValidationDebugOptions.PROVIDERS)) { > Trace.entering(getClass(), "getBatchConstraints"); //$NON-NLS-1$ > } > >- Collection result = constraints; >+ Collection<IModelConstraint> result = constraints; > > if (result == null) { >- result = new java.util.ArrayList(); >+ result = new java.util.ArrayList<IModelConstraint>(); > } > >- for (Iterator iter = getConstraints().iterator(); iter.hasNext(); ) { >- IModelConstraint next = (IModelConstraint)iter.next(); >+ for (IModelConstraint next : getConstraints()) { > IConstraintDescriptor desc = next.getDescriptor(); > > if (desc.isBatch() && desc.targetsTypeOf(eObject)) { >@@ -355,12 +352,16 @@ > * > * @since 1.2 > */ >- protected void registerConstraints(Collection constraints) throws ConstraintExistsException { >+ protected void registerConstraints( >+ Collection<? extends IModelConstraint> constraints) >+ throws ConstraintExistsException { >+ > if (!constraints.isEmpty()) { >- List descriptors = new java.util.ArrayList(constraints.size()); >+ List<IConstraintDescriptor> descriptors = >+ new java.util.ArrayList<IConstraintDescriptor>(constraints.size()); > >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- descriptors.add(((IModelConstraint) iter.next()).getDescriptor()); >+ for (IModelConstraint next : constraints) { >+ descriptors.add(next.getDescriptor()); > } > > ConstraintRegistry.getInstance().bulkRegister(descriptors); >Index: src/org/eclipse/emf/validation/service/ConstraintRegistry.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/ConstraintRegistry.java,v >retrieving revision 1.3 >diff -u -r1.3 ConstraintRegistry.java >--- src/org/eclipse/emf/validation/service/ConstraintRegistry.java 7 Nov 2007 17:30:11 -0000 1.3 >+++ src/org/eclipse/emf/validation/service/ConstraintRegistry.java 9 Nov 2007 00:41:14 -0000 >@@ -13,7 +13,6 @@ > package org.eclipse.emf.validation.service; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.Map; > > import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions; >@@ -49,7 +48,8 @@ > public class ConstraintRegistry { > private static final ConstraintRegistry INSTANCE = new ConstraintRegistry(); > >- private final Map descriptors = new java.util.HashMap(); >+ private final Map<String, IConstraintDescriptor> descriptors = >+ new java.util.HashMap<String, IConstraintDescriptor>(); > > private volatile IConstraintListener[] constraintListeners; > >@@ -78,7 +78,7 @@ > * does not exist > */ > public IConstraintDescriptor getDescriptor(String id) { >- return (IConstraintDescriptor)descriptors.get(id); >+ return descriptors.get(id); > } > > /** >@@ -92,7 +92,7 @@ > * does not exist > */ > public IConstraintDescriptor getDescriptor(String pluginId, String id) { >- return (IConstraintDescriptor)descriptors.get( >+ return descriptors.get( > XmlConstraintDescriptor.normalizedId(pluginId, id)); > } > >@@ -104,9 +104,9 @@ > * @return the available constraint descriptors, as an unmodifiable > * collection > */ >- public Collection getAllDescriptors() { >+ public Collection<IConstraintDescriptor> getAllDescriptors() { > synchronized (descriptors) { >- return new java.util.ArrayList(descriptors.values()); >+ return new java.util.ArrayList<IConstraintDescriptor>(descriptors.values()); > } > } > >@@ -315,13 +315,13 @@ > * @throws ConstraintExistsException if any constraint's ID is already > * registered under a different descriptor > */ >- void bulkRegister(Collection constraints) throws ConstraintExistsException { >- Collection registered = new java.util.ArrayList(constraints.size()); >+ void bulkRegister(Collection<? extends IConstraintDescriptor> constraints) >+ throws ConstraintExistsException { >+ Collection<IConstraintDescriptor> registered = >+ new java.util.ArrayList<IConstraintDescriptor>(constraints.size()); > > synchronized (descriptors) { >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- IConstraintDescriptor next = (IConstraintDescriptor) iter.next(); >- >+ for (IConstraintDescriptor next : constraints) { > if (doRegister(next)) { > registered.add(next); > } >@@ -332,8 +332,8 @@ > ConstraintChangeEvent event = > new ConstraintChangeEvent(null, ConstraintChangeEventType.REGISTERED); > >- for (Iterator iter = registered.iterator(); iter.hasNext();) { >- event.setConstraint((IConstraintDescriptor) iter.next()); >+ for (IConstraintDescriptor next : registered) { >+ event.setConstraint(next); > broadcastConstraintChangeEvent(event); > } > } >Index: src/org/eclipse/emf/validation/service/IModelConstraintProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/IModelConstraintProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 IModelConstraintProvider.java >--- src/org/eclipse/emf/validation/service/IModelConstraintProvider.java 6 Jun 2007 22:27:54 -0000 1.2 >+++ src/org/eclipse/emf/validation/service/IModelConstraintProvider.java 9 Nov 2007 00:41:14 -0000 >@@ -16,6 +16,7 @@ > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.validation.model.IModelConstraint; > > /** > * <p> >@@ -62,7 +63,8 @@ > * <CODE>constraints </CODE> parameter (with additions), or a new > * collection if <CODE>constraints == null</CODE> > */ >- Collection getBatchConstraints(EObject eObject, Collection constraints); >+ Collection<IModelConstraint> getBatchConstraints(EObject eObject, >+ Collection<IModelConstraint> constraints); > > /** > * Obtains a collection of live >@@ -83,7 +85,7 @@ > * <CODE>constraints </CODE> parameter (with additions), or a new > * collection if <CODE>constraints == null</CODE> > */ >- Collection getLiveConstraints( >+ Collection<IModelConstraint> getLiveConstraints( > Notification notification, >- Collection constraints); >+ Collection<IModelConstraint> constraints); > } >Index: src/org/eclipse/emf/validation/service/ILiveValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/ILiveValidator.java,v >retrieving revision 1.3 >diff -u -r1.3 ILiveValidator.java >--- src/org/eclipse/emf/validation/service/ILiveValidator.java 16 Mar 2007 20:46:11 -0000 1.3 >+++ src/org/eclipse/emf/validation/service/ILiveValidator.java 9 Nov 2007 00:41:14 -0000 >@@ -31,7 +31,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public interface ILiveValidator extends IValidator { >+public interface ILiveValidator extends IValidator<Notification> { > /** > * Validates the specified {@link Notification EMF event}. This method is a > * synonym for the inherited {@link IValidator#validate(Object)}. >@@ -42,15 +42,6 @@ > */ > IStatus validate(Notification notification); > >- /** >- * {@inheritDoc} >- * >- * @param object must be a {@link Notification} >- * @throws ClassCastException if <code>object</code> is not a >- * {@link Notification} >- */ >- IStatus validate(Object object); >- > /** > * Obtains a filter that is used to determine which notifications will be > * validated (passed on to constraints to check). The default filter, if >@@ -64,7 +55,7 @@ > * > * @since 1.1 > */ >- FilteredCollection.Filter getNotificationFilter(); >+ FilteredCollection.Filter<Notification> getNotificationFilter(); > > /** > * Sets the filter that is used to determine which notifications will be >@@ -76,5 +67,5 @@ > * > * @since 1.1 > */ >- void setNotificationFilter(FilteredCollection.Filter filter); >+ void setNotificationFilter(FilteredCollection.Filter<Notification> filter); > } >Index: src/org/eclipse/emf/validation/service/IConstraintDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/IConstraintDescriptor.java,v >retrieving revision 1.4 >diff -u -r1.4 IConstraintDescriptor.java >--- src/org/eclipse/emf/validation/service/IConstraintDescriptor.java 24 May 2007 20:54:24 -0000 1.4 >+++ src/org/eclipse/emf/validation/service/IConstraintDescriptor.java 9 Nov 2007 00:41:14 -0000 >@@ -94,7 +94,7 @@ > * > * @return my evaluation mode > */ >- EvaluationMode getEvaluationMode(); >+ EvaluationMode<?> getEvaluationMode(); > > /** > * Queries whether I target the type (or any supertype) of the specified >@@ -196,7 +196,7 @@ > * > * @return an unmodifiable set of {@link Category}s > */ >- Set getCategories(); >+ Set<Category> getCategories(); > > /** > * Adds a category to me. If, previously, I was in the default category, >Index: src/org/eclipse/emf/validation/service/AbstractConstraintDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/AbstractConstraintDescriptor.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractConstraintDescriptor.java >--- src/org/eclipse/emf/validation/service/AbstractConstraintDescriptor.java 19 Mar 2007 16:47:08 -0000 1.2 >+++ src/org/eclipse/emf/validation/service/AbstractConstraintDescriptor.java 9 Nov 2007 00:41:14 -0000 >@@ -30,8 +30,8 @@ > * @author Christian W. Damus (cdamus) > */ > public abstract class AbstractConstraintDescriptor implements IConstraintDescriptor { >- private final Set categories = new java.util.HashSet(); >- private final Set unmodCategories = >+ private final Set<Category> categories = new java.util.HashSet<Category>(); >+ private final Set<Category> unmodCategories = > java.util.Collections.unmodifiableSet(categories); > > private Throwable exception; >@@ -109,17 +109,17 @@ > private boolean isMandatory() { > boolean result = false; > >- for (Iterator iter = getCategories().iterator(); >+ for (Iterator<Category> iter = getCategories().iterator(); > !result && iter.hasNext();) { > >- result = ((Category) iter.next()).isMandatory(); >+ result = iter.next().isMandatory(); > } > > return result; > } > > // implements the interface method >- public Set getCategories() { >+ public Set<Category> getCategories() { > return unmodCategories; > } > >@@ -199,6 +199,7 @@ > } > > // redefines the inherited method >+ @Override > public int hashCode() { > return (getId() == null) ? 0 : getId().hashCode(); > } >@@ -208,12 +209,14 @@ > * > * @see #getId() > */ >+ @Override > public boolean equals(Object other) { > return (other instanceof IConstraintDescriptor) > && ((IConstraintDescriptor)other).getId().equals(getId()); > } > > // redefines the inherited method >+ @Override > public String toString() { > StringBuffer result = new StringBuffer(64); > >Index: src/org/eclipse/emf/validation/service/AbstractTraversalStrategy.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/AbstractTraversalStrategy.java,v >retrieving revision 1.1 >diff -u -r1.1 AbstractTraversalStrategy.java >--- src/org/eclipse/emf/validation/service/AbstractTraversalStrategy.java 27 Oct 2005 17:21:00 -0000 1.1 >+++ src/org/eclipse/emf/validation/service/AbstractTraversalStrategy.java 9 Nov 2007 00:41:14 -0000 >@@ -44,7 +44,7 @@ > /** Don't allow client's progress to count more steps than this number. */ > private static final int MAX_PROGRESS_TICKS = 2048; > >- private Iterator iterator; >+ private Iterator<? extends EObject> iterator; > private IProgressMonitor monitor; > > /** >@@ -62,7 +62,7 @@ > * updates). > */ > public void startTraversal( >- Collection traversalRoots, >+ Collection<? extends EObject> traversalRoots, > IProgressMonitor progressMonitor) { > > int taskSize = countElements(traversalRoots); >@@ -110,7 +110,7 @@ > * @return the total number of elements to be validated within these > * sub-trees > */ >- protected abstract int countElements(Collection traversalRoots); >+ protected abstract int countElements(Collection<? extends EObject> traversalRoots); > > /** > * Implemented by subclasses to return an iterator that provides all of the >@@ -120,7 +120,8 @@ > * @param traversalRoots the roots of the traversal sub-trees > * @return an iterator that covers all of the elements to be validated > */ >- protected abstract Iterator createIterator(Collection traversalRoots); >+ protected abstract Iterator<? extends EObject> createIterator( >+ Collection<? extends EObject> traversalRoots); > > /** > * Provides subclasses with access to the progress monitor, if they want it >@@ -148,7 +149,7 @@ > * @see #createIterator > */ > public EObject next() { >- return (EObject)iterator.next(); >+ return iterator.next(); > } > > /** >Index: src/org/eclipse/emf/validation/service/ModelValidationService.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/ModelValidationService.java,v >retrieving revision 1.4 >diff -u -r1.4 ModelValidationService.java >--- src/org/eclipse/emf/validation/service/ModelValidationService.java 6 Jun 2007 22:27:54 -0000 1.4 >+++ src/org/eclipse/emf/validation/service/ModelValidationService.java 9 Nov 2007 00:41:14 -0000 >@@ -71,7 +71,8 @@ > public class ModelValidationService { > private static final ModelValidationService instance = new ModelValidationService(); > >- private final Collection constraintProviders = new java.util.HashSet(); >+ private final Collection<IProviderDescriptor> constraintProviders = >+ new java.util.HashSet<IProviderDescriptor>(); > > // latch to control multiple invocations of loadXmlConstraintDefinitions() > private boolean xmlConstraintDeclarationsLoaded = false; >@@ -107,24 +108,31 @@ > * The resulting validator may be retained as long as it is needed, and > * reused any number of times. Each validator has its own separate state. > * </p> >+ * >+ * @param <T> the kind of validator to return >+ * > * @param mode the evaluation mode for which to create a new validator. > * Must not be <code>null</code> or {@link EvaluationMode#NULL} >+ * > * @return a new validator >+ * > * @throws IllegalArgumentException if the <code>mode</code> is not a > * valid evaluation mode > */ >- public IValidator newValidator(EvaluationMode mode) { >+ @SuppressWarnings("unchecked") >+ public <T, V extends IValidator<T>> V newValidator(EvaluationMode<T> mode) { > assert mode != null && !mode.isNull(); > >- IProviderOperationExecutor executor = new IProviderOperationExecutor() { >- public void execute(IProviderOperation op) { >- ModelValidationService.this.execute(op); >- }}; >+ IProviderOperationExecutor<Collection<IModelConstraint>> executor = >+ new IProviderOperationExecutor<Collection<IModelConstraint>>() { >+ public void execute(IProviderOperation<? extends Collection<IModelConstraint>> op) { >+ ModelValidationService.this.execute(op); >+ }}; > > if (mode == EvaluationMode.BATCH) { >- return new BatchValidator(executor); >+ return (V) new BatchValidator(executor); > } else if (mode == EvaluationMode.LIVE) { >- return new LiveValidator(executor); >+ return (V) new LiveValidator(executor); > } else { > throw new IllegalArgumentException(); > } >@@ -213,21 +221,22 @@ > */ > public void broadcastValidationEvent(ValidationEvent event) { > // Check if listeners exist >- if (listeners == null) >+ if (listeners == null) { > return; >+ } > > IValidationListener[] array = listeners; // copy the reference > >- for (int i = 0; i < array.length; i++) { >+ for (IValidationListener element : array) { > try { >- array[i].validationOccurred(event); >+ element.validationOccurred(event); > } catch (Exception e) { > Trace.catching(getClass(), "broadcastValidationEvent", e); //$NON-NLS-1$ > > if (Trace.shouldTrace(EMFModelValidationDebugOptions.LISTENERS)) { > Trace.trace( > EMFModelValidationDebugOptions.LISTENERS, >- "Uncaught exception in listener: " + array[i].getClass().getName()); //$NON-NLS-1$ >+ "Uncaught exception in listener: " + element.getClass().getName()); //$NON-NLS-1$ > } > > Log.l7dWarning( >@@ -253,10 +262,10 @@ > public void configureListeners(IConfigurationElement[] elements) { > assert elements != null; > >- for (int i = 0; i < elements.length; i++) { >- if (elements[i].getName().equals("listener")) { //$NON-NLS-1$ >+ for (IConfigurationElement element : elements) { >+ if (element.getName().equals("listener")) { //$NON-NLS-1$ > try { >- addValidationListener(new LazyListener(elements[i])); >+ addValidationListener(new LazyListener(element)); > } catch (CoreException e) { > Trace.catching(getClass(), "configureListeners()", e); //$NON-NLS-1$ > >@@ -283,16 +292,16 @@ > > constraintCache = new ConstraintCache(); > >- Collection providers = getProviders(); >+ Collection<IProviderDescriptor> providers = getProviders(); > > // include the cache in my collection of providers > providers.add(constraintCache.getDescriptor()); > >- for (int i = 0; i < elements.length; i++) { >- if (elements[i].getName().equals(XmlConfig.E_CONSTRAINT_PROVIDER)) { >+ for (IConfigurationElement element : elements) { >+ if (element.getName().equals(XmlConfig.E_CONSTRAINT_PROVIDER)) { > try { > IProviderDescriptor descriptor = >- new ProviderDescriptor(elements[i]); >+ new ProviderDescriptor(element); > > if (descriptor.isCacheEnabled()) { > constraintCache.addProvider(descriptor); >@@ -338,7 +347,7 @@ > * > * @return a collection of {@link ProviderDescriptor}s > */ >- private Collection getProviders() { >+ private Collection<IProviderDescriptor> getProviders() { > return constraintProviders; > } > >@@ -347,9 +356,11 @@ > * > * @param operation the operation to execute > */ >- private void execute(IProviderOperation operation) { >- for (Iterator iter = getProviders().iterator(); iter.hasNext(); ) { >- IProviderDescriptor next = (IProviderDescriptor)iter.next(); >+ private void execute( >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation) { >+ >+ for (Iterator<IProviderDescriptor> iter = getProviders().iterator(); iter.hasNext(); ) { >+ IProviderDescriptor next = iter.next(); > > if (next.provides(operation)) { > try { >@@ -397,10 +408,8 @@ > * > * @param providers the available providers > */ >- private void loadXmlConstraintDeclarations(Collection providers) { >- for (Iterator iter = providers.iterator(); iter.hasNext();) { >- IProviderDescriptor next = (IProviderDescriptor)iter.next(); >- >+ private void loadXmlConstraintDeclarations(Collection<IProviderDescriptor> providers) { >+ for (IProviderDescriptor next : providers) { > if (next.isXmlProvider()) { > // the initialization of this provider is not very expensive > // and is guaranteed not to load any other plug-ins >@@ -437,7 +446,7 @@ > if (epackage != null) { > EClassifier classifier = null; > >- List packageNames = parsePackageNames(className); >+ List<String> packageNames = parsePackageNames(className); > if (packageNames == null) { > classifier = epackage.getEClassifier(className); > } else if (packageHasName(epackage, packageNames)) { >@@ -466,7 +475,7 @@ > * @see #findClass(String, String) > */ > private static EPackage findPackage(String namespaceUri) { >- Map registry = org.eclipse.emf.ecore.EPackage.Registry.INSTANCE; >+ Map<String, Object> registry = org.eclipse.emf.ecore.EPackage.Registry.INSTANCE; > > Object result = registry.get(namespaceUri); > >@@ -487,12 +496,12 @@ > * @return the package names in right-to-left order, as a list of > * strings, or <code>null</code> if the class name is not qualified > */ >- private static List parsePackageNames(String qualifiedClassName) { >- List result = null; >+ private static List<String> parsePackageNames(String qualifiedClassName) { >+ List<String> result = null; > int end = qualifiedClassName.lastIndexOf('.'); // known BMP code point > > if (end >= 0) { >- result = new java.util.ArrayList(); >+ result = new java.util.ArrayList<String>(); > > // skip the class name part and collect other parts in > // reverse order >@@ -520,10 +529,10 @@ > * the package from bottom to top of the containment hierarchy; > * <code>false</code>, otherwise > */ >- private static boolean packageHasName(EPackage epackage, List name) { >+ private static boolean packageHasName(EPackage epackage, List<String> name) { > boolean result = true; > EPackage pkg = epackage; >- Iterator iter = name.iterator(); >+ Iterator<String> iter = name.iterator(); > > while (result && iter.hasNext() && (pkg != null)) { > result = iter.next().equals(pkg.getName()); >@@ -548,7 +557,7 @@ > */ > private final class LazyListener implements IValidationListener { > private final IConfigurationElement config; >- private List registeredClientContexts = null; >+ private List<String> registeredClientContexts = null; > private IValidationListener validationListener = null; > > private static final String E_CLIENT_CONTEXT = "clientContext"; //$NON-NLS-1$ >@@ -582,10 +591,10 @@ > IConfigurationElement[] children = config.getChildren(E_CLIENT_CONTEXT); > > // Probably a small number of registered client contexts. >- registeredClientContexts = new ArrayList(3); >+ registeredClientContexts = new ArrayList<String>(4); > >- for (int i=0; i<children.length; i++) { >- registeredClientContexts.add(children[i].getAttribute(A_CLIENT_CONTEXT_ID)); >+ for (IConfigurationElement element : children) { >+ registeredClientContexts.add(element.getAttribute(A_CLIENT_CONTEXT_ID)); > } > } > >@@ -610,9 +619,7 @@ > > // Otherwise, we will delay the loading of this listener until > // we are certain that they are interested in listening. >- for (Iterator i = registeredClientContexts.iterator(); i.hasNext();) { >- String clientContextId = (String)i.next(); >- >+ for (String clientContextId : registeredClientContexts) { > if (event.getClientContextIds().contains(clientContextId)) { > try { > if (validationListener == null) { >Index: src/org/eclipse/emf/validation/service/ITraversalStrategy.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/ITraversalStrategy.java,v >retrieving revision 1.3 >diff -u -r1.3 ITraversalStrategy.java >--- src/org/eclipse/emf/validation/service/ITraversalStrategy.java 31 Oct 2007 19:59:27 -0000 1.3 >+++ src/org/eclipse/emf/validation/service/ITraversalStrategy.java 9 Nov 2007 00:41:14 -0000 >@@ -61,14 +61,17 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- protected int countElements(Collection traversalRoots) { >+ @Override >+ protected int countElements(Collection<? extends EObject> traversalRoots) { > return traversalRoots.size(); > } > > /* (non-Javadoc) > * Implements the inherited method. > */ >- protected Iterator createIterator(Collection traversalRoots) { >+ @Override >+ protected Iterator<? extends EObject> createIterator( >+ Collection<? extends EObject> traversalRoots) { > return traversalRoots.iterator(); > } > } >@@ -89,7 +92,7 @@ > * @author Christian W. Damus (cdamus) > */ > final class Recursive extends AbstractTraversalStrategy { >- private Collection roots; >+ private Collection<EObject> roots; > private boolean contextChanged = true; > > /** >@@ -99,8 +102,9 @@ > super(); > } > >- public void startTraversal( >- Collection traversalRoots, >+ @Override >+ public void startTraversal( >+ Collection<? extends EObject> traversalRoots, > IProgressMonitor progressMonitor) { > > roots = makeTargetsDisjoint(traversalRoots); >@@ -108,29 +112,25 @@ > super.startTraversal(traversalRoots, progressMonitor); > } > >- private Collection getRoots() { >+ private Collection<EObject> getRoots() { > return roots; > } > > /* (non-Javadoc) > * Implements the inherited method. > */ >- protected int countElements(Collection ignored) { >+ @Override >+ protected int countElements(Collection<? extends EObject> ignored) { > return countRecursive(getRoots()); > } > >- private int countRecursive(Collection elements) { >+ private int countRecursive(Collection<? extends EObject> elements) { > int result = 0; > > result = elements.size(); > >- for (Iterator iter = elements.iterator(); iter.hasNext(); ) { >- Object next = iter.next(); >- >- if (next instanceof EObject) { >- result = result + countRecursive( >- ((EObject)next).eContents()); >- } >+ for (EObject next : elements) { >+ result = result + countRecursive(next.eContents()); > } > > return result; >@@ -139,21 +139,25 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- protected Iterator createIterator(Collection ignored) { >- return new EcoreUtil.ContentTreeIterator(getRoots()) { >+ @Override >+ protected Iterator<? extends EObject> createIterator( >+ Collection<? extends EObject> ignored) { >+ >+ return new EcoreUtil.ContentTreeIterator<EObject>(getRoots()) { > private static final long serialVersionUID = -5653134989235663973L; > >- public Iterator getChildren(Object obj) { >+ @Override >+ public Iterator<EObject> getChildren(Object obj) { > if (obj == getRoots()) { >- return new Iterator() { >- private final Iterator delegate = >+ return new Iterator<EObject>() { >+ private final Iterator<EObject> delegate = > getRoots().iterator(); > > public boolean hasNext() { > return delegate.hasNext(); > } > >- public Object next() { >+ public EObject next() { > // if I'm being asked for my next element, then > // we are stepping to another traversal root > contextChanged = true; >@@ -169,7 +173,8 @@ > } > } > >- public Object next() { >+ @Override >+ public EObject next() { > // this will be set to true again the next time we test hasNext() at > // the traversal root level > contextChanged = false; >@@ -178,27 +183,26 @@ > }}; > } > >- public boolean isClientContextChanged() { >+ @Override >+ public boolean isClientContextChanged() { > return contextChanged; > } > >- private Set makeTargetsDisjoint(Collection objects) { >- Set result = new java.util.HashSet(); >+ private Set<EObject> makeTargetsDisjoint(Collection<? extends EObject> objects) { >+ Set<EObject> result = new java.util.HashSet<EObject>(); > > // ensure that any contained (descendent) elements of other elements > // that we include are not included, because they will be > // traversed by recursion, anyway > >- for (Iterator it = objects.iterator(); it.hasNext();) { >- EObject target = (EObject)it.next(); >- >+ for (EObject target : objects) { > // EcoreUtil uses the InternalEObject interface to check > // containment, so we do the same. Also, we kip up a level to > // the immediate container for efficiency: an object is its > // own ancestor, so we can "pre-step" up a level to avoid the > // cost of doing it individually for every miss in the collection > if (!EcoreUtil.isAncestor(objects, >- ((InternalEObject) target).eInternalContainer())) { >+ ((InternalEObject) target).eInternalContainer())) { > result.add(target); > } > } >@@ -222,7 +226,8 @@ > * @param monitor the progress monitor used to track progress. The receiver > * may retain this progress monitor for the duration of the traversal > */ >- void startTraversal(Collection traversalRoots, IProgressMonitor monitor); >+ void startTraversal(Collection<? extends EObject> traversalRoots, >+ IProgressMonitor monitor); > > /** > * Queries whether there is another element to be validated. >Index: src/org/eclipse/emf/validation/service/INotificationGenerator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/INotificationGenerator.java,v >retrieving revision 1.2 >diff -u -r1.2 INotificationGenerator.java >--- src/org/eclipse/emf/validation/service/INotificationGenerator.java 24 May 2007 20:54:24 -0000 1.2 >+++ src/org/eclipse/emf/validation/service/INotificationGenerator.java 9 Nov 2007 00:41:14 -0000 >@@ -14,6 +14,8 @@ > > import java.util.Collection; > >+import org.eclipse.emf.common.notify.Notification; >+ > /** > * Interface implemented by clients who wish to define a notification > * generator. >@@ -37,5 +39,6 @@ > * @param notifications that are eligible for validation > * @return collection of newly generated notifications > */ >- public Collection generateNotifications(Collection notifications); >+ public Collection<Notification> generateNotifications( >+ Collection<? extends Notification> notifications); > } >Index: src/org/eclipse/emf/validation/service/IValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/IValidator.java,v >retrieving revision 1.2 >diff -u -r1.2 IValidator.java >--- src/org/eclipse/emf/validation/service/IValidator.java 19 Mar 2007 18:16:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/service/IValidator.java 9 Nov 2007 00:41:14 -0000 >@@ -59,18 +59,20 @@ > * <b>Note</b> that clients are not intended to implement this interface. > * </p> > * >+ * @param <T> the kind of target element validated by the validator >+ * > * @see ModelValidationService#newValidator(EvaluationMode) > * > * @author Christian W. Damus (cdamus) > */ >-public interface IValidator { >+public interface IValidator<T> { > /** > * Indicates the evaluation mode that I support. This indicates the kind > * of objects expected by the <code>validate()</code> methods to process. > * > * @return my evaluation mode > */ >- EvaluationMode getEvaluationMode(); >+ EvaluationMode<T> getEvaluationMode(); > > /** > * Queries whether successful constraint evaluations are reported, in >@@ -130,7 +132,7 @@ > * @throws ClassCastException if the <code>object</code> is not of > * the correct type for this validator > */ >- IStatus validate(Object object); >+ IStatus validate(T object); > > /** > * Validates multiple objects, all in the same >@@ -146,7 +148,7 @@ > * not of the correct type for this validator > * @see #validate(Object) > */ >- IStatus validate(Collection objects); >+ IStatus validate(Collection<? extends T> objects); > > /** > * Adds a constraint filter to this validator. The validator >@@ -183,5 +185,5 @@ > * > * @since 1.1 > */ >- Collection getConstraintFilters(); >+ Collection<IConstraintFilter> getConstraintFilters(); > } >Index: src/org/eclipse/emf/validation/service/EventTypeService.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/service/EventTypeService.java,v >retrieving revision 1.2 >diff -u -r1.2 EventTypeService.java >--- src/org/eclipse/emf/validation/service/EventTypeService.java 22 Mar 2007 20:20:24 -0000 1.2 >+++ src/org/eclipse/emf/validation/service/EventTypeService.java 9 Nov 2007 00:41:14 -0000 >@@ -43,13 +43,13 @@ > private static final String A_FEATURE_SPECIFIC = "featureSpecific"; //$NON-NLS-1$ > private static final String A_NOTIFICATION_GENERATOR = "notificationGenerator"; //$NON-NLS-1$ > >- private final Map notificationGenerators; >+ private final Map<String, INotificationGenerator> notificationGenerators; > > /** > * Cannot be instantiated by clients. > */ > private EventTypeService() { >- notificationGenerators = new HashMap(); >+ notificationGenerators = new HashMap<String, INotificationGenerator>(); > } > > /** >@@ -79,18 +79,20 @@ > public void configureEventTypes(IConfigurationElement[] elements) { > assert elements != null; > >- for (int i = 0; i < elements.length; i++) { >- if (elements[i].getName().equals("eventType")) { //$NON-NLS-1$ >+ for (IConfigurationElement element : elements) { >+ if (element.getName().equals("eventType")) { //$NON-NLS-1$ > try { >- String name = elements[i].getAttribute(A_NAME); >+ String name = element.getAttribute(A_NAME); > if ((name != null) && (name.length() > 0)) { > EMFEventType.addEventType(name, >- Boolean.valueOf(elements[i].getAttribute(A_FEATURE_SPECIFIC)).booleanValue() >+ Boolean.valueOf(element.getAttribute(A_FEATURE_SPECIFIC)).booleanValue() > ); > >- String notificationGenerator = elements[i].getAttribute(A_NOTIFICATION_GENERATOR); >+ String notificationGenerator = element.getAttribute(A_NOTIFICATION_GENERATOR); > if ((notificationGenerator != null) && (notificationGenerator.length() > 0)) { >- notificationGenerators.put(name, elements[i].createExecutableExtension(A_NOTIFICATION_GENERATOR)); >+ notificationGenerators.put( >+ name, >+ (INotificationGenerator) element.createExecutableExtension(A_NOTIFICATION_GENERATOR)); > } > } > } catch (CoreException e) { >@@ -107,7 +109,7 @@ > * > * @return collection of notification generators > */ >- public Collection getNotificationGenerators() { >+ public Collection<INotificationGenerator> getNotificationGenerators() { > return Collections.unmodifiableCollection(notificationGenerators.values()); > } > >@@ -120,6 +122,6 @@ > * null otherwise > */ > public INotificationGenerator getNotificationGenerator(String eventName) { >- return (INotificationGenerator)notificationGenerators.get(eventName); >+ return notificationGenerators.get(eventName); > } > } >Index: src/org/eclipse/emf/validation/util/XmlConfig.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/util/XmlConfig.java,v >retrieving revision 1.6 >diff -u -r1.6 XmlConfig.java >--- src/org/eclipse/emf/validation/util/XmlConfig.java 31 Oct 2007 19:59:48 -0000 1.6 >+++ src/org/eclipse/emf/validation/util/XmlConfig.java 9 Nov 2007 00:41:14 -0000 >@@ -204,15 +204,15 @@ > IConfigurationElement constraint, > String name) { > >- List result = new java.util.ArrayList(); >+ List<String> result = new java.util.ArrayList<String>(); > > IConfigurationElement[] parms = constraint.getChildren(E_PARAM); >- for (int i = 0; i < parms.length; i++) { >- if (name.equals(parms[i].getAttribute(A_NAME))) { >- String value = parms[i].getAttribute(A_VALUE); >+ for (IConfigurationElement element : parms) { >+ if (name.equals(element.getAttribute(A_NAME))) { >+ String value = element.getAttribute(A_VALUE); > > if (value == null) { >- value = parms[i].getValue(); >+ value = element.getValue(); > } > > if (value != null) { >@@ -221,7 +221,7 @@ > } > } > >- return (String[])result.toArray(new String[result.size()]); >+ return result.toArray(new String[result.size()]); > } > > /** >@@ -253,8 +253,8 @@ > String path = tokens.nextToken().trim(); > > if (path.length() > 0) { >- for (int i = 0; i < children.length; i++) { >- final String id = children[i].getAttribute(A_ID); >+ for (IConfigurationElement element : children) { >+ final String id = element.getAttribute(A_ID); > > IConstraintDescriptor constraint = > ConstraintRegistry.getInstance().getDescriptor( >@@ -263,7 +263,7 @@ > > if (constraint == null) { > try { >- constraint = new XmlConstraintDescriptor(children[i]); >+ constraint = new XmlConstraintDescriptor(element); > } catch (ConstraintExistsException e) { > // shouldn't happen because I checked for existence > continue; >Index: src/org/eclipse/emf/validation/util/FilteredCollection.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/util/FilteredCollection.java,v >retrieving revision 1.2 >diff -u -r1.2 FilteredCollection.java >--- src/org/eclipse/emf/validation/util/FilteredCollection.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/util/FilteredCollection.java 9 Nov 2007 00:41:14 -0000 >@@ -21,25 +21,29 @@ > * Wrapper for a Java 2 {@link Collection} that provides a filtered view of its > * contents according to a client-specified filter algorithm. > * >+ * @param <E> the collection element type >+ * > * @author Christian W. Damus (cdamus) > */ >-public class FilteredCollection extends AbstractCollection { >+public class FilteredCollection<E> extends AbstractCollection<E> { > /** > * Indicates the end of iteration. Cannot use 'null' for this purpose, as > * it may legitimately be present in a collection. > */ > private static final Object END_TOKEN = new Object(); > >- private final Collection filteree; >- private final Filter filter; >+ private final Collection<? extends E> filteree; >+ private final Filter<? super E> filter; > > /** > * Interface for the algorithm that determines which elements are in and > * which are out of the filtered collection. > * >+ * @param <E> the collection element type to filter >+ * > * @author Christian W. Damus (cdamus) > */ >- public static interface Filter { >+ public static interface Filter<E> { > /** > * Determines whether to accept or reject the specified > * <code>element</code> from the collection. >@@ -48,7 +52,7 @@ > * @return <CODE>true</CODE> if the <code>element</code> should be > * included in the filtered view; <CODE>false</CODE>, otherwise > */ >- boolean accept(Object element); >+ boolean accept(E element); > } > > /** >@@ -65,7 +69,7 @@ > * @param collection the collection that I am to filter > * @param filter the filter algorithm to apply > */ >- public FilteredCollection(Collection collection, Filter filter) { >+ public FilteredCollection(Collection<? extends E> collection, Filter<? super E> filter) { > this.filteree = collection; > this.filter = filter; > } >@@ -77,7 +81,7 @@ > * > * @return my filter > */ >- public final Filter getFilter() { >+ public final Filter<? super E> getFilter() { > return filter; > } > >@@ -87,9 +91,11 @@ > * > * @author Christian W. Damus (cdamus) > */ >- private class Iter implements Iterator { >- private final Iterator filteredIterator = filteree.iterator(); >- private Object next = END_TOKEN; >+ @SuppressWarnings("unchecked") >+ private class Iter implements Iterator<E> { >+ private final Iterator<? extends E> filteredIterator = filteree.iterator(); >+ >+ private E next = (E) END_TOKEN; > > /** > * Queries whether I have another object that matches the >@@ -105,7 +111,7 @@ > break; > } else { > // try again >- next = END_TOKEN; >+ next = (E) END_TOKEN; > } > } > } >@@ -116,14 +122,14 @@ > /** > * Retrieves the next object that matches my {@link #getFilter filter}. > */ >- public Object next() { >+ public E next() { > if (!hasNext()) { > throw new NoSuchElementException(); > } > >- Object result = next; >+ E result = next; > >- next = END_TOKEN; >+ next = (E) END_TOKEN; > > return result; > } >@@ -146,7 +152,8 @@ > * @return an iterator the exposes only the elements of my wrapped > * collection that match my filter > */ >- public Iterator iterator() { >+ @Override >+ public Iterator<E> iterator() { > return new Iter(); > } > >@@ -164,10 +171,11 @@ > * @return the number of elements in my wrapped collection that match my > * filter > */ >+ @Override > public int size() { > int result = 0; > >- for (Iterator iter = iterator(); iter.hasNext(); iter.next()) { >+ for (Iterator<E> iter = iterator(); iter.hasNext(); iter.next()) { > result++; > } > >Index: src/org/eclipse/emf/validation/internal/util/XmlConstraintDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/XmlConstraintDescriptor.java,v >retrieving revision 1.6 >diff -u -r1.6 XmlConstraintDescriptor.java >--- src/org/eclipse/emf/validation/internal/util/XmlConstraintDescriptor.java 13 Apr 2007 21:34:28 -0000 1.6 >+++ src/org/eclipse/emf/validation/internal/util/XmlConstraintDescriptor.java 9 Nov 2007 00:41:14 -0000 >@@ -13,7 +13,6 @@ > package org.eclipse.emf.validation.internal.util; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.Map; > > import org.eclipse.core.runtime.CoreException; >@@ -24,7 +23,6 @@ > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EStructuralFeature; >- > import org.eclipse.emf.validation.EMFEventType; > import org.eclipse.emf.validation.internal.EMFModelValidationDebugOptions; > import org.eclipse.emf.validation.internal.EMFModelValidationPlugin; >@@ -76,13 +74,14 @@ > private String name; > private String id; > private int statusCode; >- private String pluginId; >+ private final String pluginId; > > private String description; > private ConstraintSeverity severity = ConstraintSeverity.ERROR; >- private EvaluationMode mode; >+ private EvaluationMode<?> mode; > >- private Map targetMap = new java.util.HashMap(); >+ private Map<Object, TargetDescriptor> targetMap = >+ new java.util.HashMap<Object, TargetDescriptor>(); > > private String messagePattern; > >@@ -243,7 +242,7 @@ > new Object[] {key}); > } > >- TargetDescriptor result = (TargetDescriptor)targetMap.get(key); >+ TargetDescriptor result = targetMap.get(key); > > if (result == null) { > result = new TargetDescriptor(); >@@ -263,11 +262,11 @@ > } > > // implements the interface method >- public EvaluationMode getEvaluationMode() { >+ public EvaluationMode<?> getEvaluationMode() { > return mode; > } > >- private void setEvaluationMode(EvaluationMode mode) { >+ private void setEvaluationMode(EvaluationMode<?> mode) { > this.mode = mode; > } > >@@ -282,13 +281,11 @@ > > resolved = true; > >- Map oldMap = targetMap; >- targetMap = new java.util.HashMap(); >- >- for (Iterator iter = oldMap.entrySet().iterator(); iter.hasNext(); ) { >- Map.Entry next = (Map.Entry)iter.next(); >+ Map<Object, TargetDescriptor> oldMap = targetMap; >+ targetMap = new java.util.HashMap<Object, TargetDescriptor>(); > >- String typeName = (String)next.getKey(); >+ for (Map.Entry<Object, TargetDescriptor> next : oldMap.entrySet()) { >+ String typeName = (String) next.getKey(); > > EClass targetEClass = null; > // See if the typeName value from the extension has a qualified >@@ -337,12 +334,8 @@ > // that are for ancestor EClasses. This is an O{n**2) algorithm, but > // there are not expected ever to be more than a handful of targets in > // any given constraint >- for (Iterator iter = targetMap.entrySet().iterator(); iter.hasNext();) { >- Map.Entry next = (Map.Entry) iter.next(); >- >- inheritTriggers( >- (EClass) next.getKey(), >- (TargetDescriptor) next.getValue()); >+ for (Map.Entry<Object, TargetDescriptor> next : targetMap.entrySet()) { >+ inheritTriggers((EClass) next.getKey(), next.getValue()); > } > } > >@@ -355,12 +348,11 @@ > * @param descriptor its descriptor > */ > private void inheritTriggers(EClass target, TargetDescriptor descriptor) { >- for (Iterator iter = targetMap.entrySet().iterator(); iter.hasNext();) { >- Map.Entry next = (Map.Entry) iter.next(); >+ for (Map.Entry<Object, TargetDescriptor> next : targetMap.entrySet()) { > EClass otherTarget = (EClass) next.getKey(); > > if ((otherTarget != target) && (otherTarget.isSuperTypeOf(target))) { >- descriptor.merge((TargetDescriptor) next.getValue()); >+ descriptor.merge(next.getValue()); > } > } > } >@@ -591,9 +583,7 @@ > > IConfigurationElement[] targets = extConfig.getChildren(XmlConfig.E_TARGET); > >- for (int i = 0; i < targets.length; i++) { >- final IConfigurationElement target = targets[i]; >- >+ for (final IConfigurationElement target : targets) { > TargetDescriptor targetType = addTargetType( > target.getAttribute(XmlConfig.A_CLASS)); > >@@ -602,22 +592,22 @@ > // to events in the model > IConfigurationElement[] events = XmlConfig.getEvents(target); > >- for (int j = 0; j < events.length; j++) { >+ for (IConfigurationElement element : events) { > EMFEventType eventType = EMFEventType.getInstance( >- events[j].getAttribute(XmlConfig.A_NAME)); >+ element.getAttribute(XmlConfig.A_NAME)); > > if (!eventType.isNull()) { > // add specific supported features, if any > IConfigurationElement[] features = >- events[j].getChildren(XmlConfig.E_FEATURE); >+ element.getChildren(XmlConfig.E_FEATURE); > > if ((features == null) || (features.length == 0)) { > targetType.addEvent(eventType); > } else { >- for (int k = 0; k < features.length; k++) { >+ for (IConfigurationElement element2 : features) { > targetType.addEvent( > eventType, >- features[k].getAttribute( >+ element2.getAttribute( > XmlConfig.A_NAME)); > } > } >@@ -652,7 +642,7 @@ > EMFModelValidationStatusCodes.CONSTRAINT_NOT_INITED, > EMFModelValidationPlugin.getMessage( > RULE_INCOMPLETE, >- new String[]{missingItem}), >+ missingItem), > null)); > > Trace.throwing(getClass(), "assertNotNull", ce); //$NON-NLS-1$ >@@ -685,8 +675,10 @@ > * @author Christian W. Damus (cdamus) > */ > private static class TargetDescriptor { >- private final Collection nonFeatureSpecificEvents = new java.util.HashSet(); >- private final Map featureSpecificEvents = new java.util.HashMap(); >+ private final Collection<EMFEventType> nonFeatureSpecificEvents = >+ new java.util.HashSet<EMFEventType>(); >+ private final Map<EMFEventType, Collection<String>> featureSpecificEvents = >+ new java.util.HashMap<EMFEventType, Collection<String>>(); > > /** > * Indicates whether I explicitly support my target EClass, or whether >@@ -743,11 +735,11 @@ > */ > void addEvent(EMFEventType eventType, String featureName) { > if (featureName != null) { >- Collection currentFeatures = (Collection)featureSpecificEvents.get( >+ Collection<String> currentFeatures = featureSpecificEvents.get( > eventType); > > if (currentFeatures == null) { >- currentFeatures = new java.util.HashSet(); >+ currentFeatures = new java.util.HashSet<String>(); > featureSpecificEvents.put(eventType, currentFeatures); > } > >@@ -792,8 +784,8 @@ > // see whether the collection of supported event > // types includes this feature > if (featureSpecificEvents.containsKey(eventType)) { >- Collection eventFeatures = >- (Collection)featureSpecificEvents.get(eventType); >+ Collection<String> eventFeatures = >+ featureSpecificEvents.get(eventType); > > // if no features are registered and I am supported and > // I have no parents, then it is implied that I >@@ -827,19 +819,18 @@ > > this.nonFeatureSpecificEvents.addAll(parent.nonFeatureSpecificEvents); > >- for (Iterator iter = parent.featureSpecificEvents.entrySet().iterator(); iter.hasNext();) { >- Map.Entry next = (Map.Entry) iter.next(); >- Object eventType = next.getKey(); >- Collection features = (Collection) next.getValue(); >+ for (Map.Entry<EMFEventType, Collection<String>> next : parent.featureSpecificEvents.entrySet()) { >+ EMFEventType eventType = next.getKey(); >+ Collection<String> features = next.getValue(); > >- Collection myFeatures = (Collection) this.featureSpecificEvents.get(eventType); >+ Collection<String> myFeatures = this.featureSpecificEvents.get(eventType); > if (myFeatures == null) { > // add all of my parent's features. Need to create a copy > // because I might inherit other features from a different > // parent > this.featureSpecificEvents.put( > eventType, >- new java.util.HashSet(features)); >+ new java.util.HashSet<String>(features)); > } else { > myFeatures.addAll(features); > } >Index: src/org/eclipse/emf/validation/internal/util/XmlConfigurationElement.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/XmlConfigurationElement.java,v >retrieving revision 1.4 >diff -u -r1.4 XmlConfigurationElement.java >--- src/org/eclipse/emf/validation/internal/util/XmlConfigurationElement.java 6 Jun 2007 22:27:54 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/util/XmlConfigurationElement.java 9 Nov 2007 00:41:13 -0000 >@@ -14,7 +14,6 @@ > > import java.net.MalformedURLException; > import java.net.URL; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > >@@ -28,11 +27,10 @@ > import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; >-import org.osgi.framework.Bundle; >- > import org.eclipse.emf.validation.internal.EMFModelValidationPlugin; > import org.eclipse.emf.validation.internal.EMFModelValidationStatusCodes; > import org.eclipse.emf.validation.util.XmlConfig; >+import org.osgi.framework.Bundle; > > /** > * A custom implementation of the Eclipse configuration element API which is >@@ -48,8 +46,9 @@ > private final URL baseUrl; > > private String value; >- private final Map attributes; >- private final List children = new java.util.ArrayList(); >+ private final Map<String, String> attributes; >+ private final List<IConfigurationElement> children = >+ new java.util.ArrayList<IConfigurationElement>(); > private Object parent; > > /** >@@ -60,7 +59,7 @@ > * @param baseUrl the base of any relative URL of files that I load > */ > XmlConfigurationElement(String name, IExtension extension, URL baseUrl) { >- this(name, new java.util.HashMap(), extension, baseUrl); >+ this(name, new java.util.HashMap<String, String>(), extension, baseUrl); > } > > /** >@@ -74,7 +73,7 @@ > */ > XmlConfigurationElement( > String name, >- Map attributes, >+ Map<String, String> attributes, > IExtension extension, > URL baseUrl) { > this.myName = name; >@@ -111,7 +110,7 @@ > > // implements the interface method > public String getAttribute(String name) { >- return (String)attributes.get(name); >+ return attributes.get(name); > } > > // implements the interface method >@@ -121,8 +120,7 @@ > > // implements the interface method > public String[] getAttributeNames() { >- return (String[])attributes.keySet() >- .toArray(new String[attributes.size()]); >+ return attributes.keySet().toArray(new String[attributes.size()]); > } > > /** >@@ -137,24 +135,21 @@ > > // implements the interface method > public IConfigurationElement[] getChildren() { >- return (IConfigurationElement[])children.toArray( >- new IConfigurationElement[children.size()]); >+ return children.toArray(new IConfigurationElement[children.size()]); > } > > // implements the interface method > public IConfigurationElement[] getChildren(String name) { >- java.util.List result = new java.util.ArrayList(children.size()); >- >- for (Iterator iter = children.iterator(); iter.hasNext(); ) { >- IConfigurationElement next = (IConfigurationElement)iter.next(); >+ java.util.List<IConfigurationElement> result = >+ new java.util.ArrayList<IConfigurationElement>(children.size()); > >+ for (IConfigurationElement next : children) { > if (next.getName().equals(name)) { > result.add(next); > } > } > >- return (IConfigurationElement[])result.toArray( >- new IConfigurationElement[result.size()]); >+ return result.toArray(new IConfigurationElement[result.size()]); > } > > /** >@@ -217,9 +212,9 @@ > * constraintses > */ > public void flatten(IConfigurationElement[] constraintses) throws CoreException { >- for (int i = 0; i < constraintses.length; i++) { >- flatten(constraintses[i]); >- removeChild(constraintses[i]); >+ for (IConfigurationElement element : constraintses) { >+ flatten(element); >+ removeChild(element); > } > } > >@@ -247,8 +242,8 @@ > * files > */ > public void include(IConfigurationElement[] includes) throws CoreException { >- for (int i = 0; i < includes.length; i++) { >- include(includes[i]); >+ for (IConfigurationElement element : includes) { >+ include(element); > } > } > >@@ -322,12 +317,13 @@ > private void absorb(IConfigurationElement includedConstraints) { > IConfigurationElement[] elements = includedConstraints.getChildren(); > >- for (int i = 0; i < elements.length; i++) { >- addChild(elements[i]); >+ for (IConfigurationElement element : elements) { >+ addChild(element); > } > } > > // redefines the inherited method >+ @Override > public String toString() { > StringBuffer result = new StringBuffer(64); > >Index: src/org/eclipse/emf/validation/internal/util/StringMatcher.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/StringMatcher.java,v >retrieving revision 1.4 >diff -u -r1.4 StringMatcher.java >--- src/org/eclipse/emf/validation/internal/util/StringMatcher.java 21 Feb 2006 22:05:18 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/util/StringMatcher.java 9 Nov 2007 00:41:13 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2002, 2006 IBM Corporation and others. >+ * Copyright (c) 2002, 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 >@@ -60,12 +60,12 @@ > /* > * (Non JavaDoc) > */ >- private int start; //inclusive >+ private final int start; //inclusive > > /* > * (Non JavaDoc) > */ >- private int end; //exclusive >+ private final int end; //exclusive > > /** > * Creates a new position. >@@ -124,8 +124,9 @@ > */ > public StringMatcher(String pattern, boolean ignoreCase, > boolean ignoreWildCards) { >- if (pattern == null) >+ if (pattern == null) { > throw new IllegalArgumentException(); >+ } > fIgnoreCase = ignoreCase; > fIgnoreWildCards = ignoreWildCards; > fPattern = pattern; >@@ -153,28 +154,35 @@ > * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned > */ > public StringMatcher.Position find(String text, int start, int end) { >- if (text == null) >+ if (text == null) { > throw new IllegalArgumentException(); >+ } > > int tlen = text.length(); >- if (start < 0) >+ if (start < 0) { > start = 0; >- if (end > tlen) >+ } >+ if (end > tlen) { > end = tlen; >- if (end < 0 || start >= end) >+ } >+ if (end < 0 || start >= end) { > return null; >- if (fLength == 0) >+ } >+ if (fLength == 0) { > return new Position(start, start); >+ } > if (fIgnoreWildCards) { > int x = posIn(text, start, end); >- if (x < 0) >+ if (x < 0) { > return null; >+ } > return new Position(x, x + fLength); > } > > int segCount = fSegments.length; >- if (segCount == 0)//pattern contains only '*'(s) >+ if (segCount == 0) { > return new Position(start, end); >+ } > > int curPos = start; > int matchStart = -1; >@@ -182,14 +190,17 @@ > for (i = 0; i < segCount && curPos < end; ++i) { > String current = fSegments[i]; > int nextMatch = regExpPosIn(text, curPos, end, current); >- if (nextMatch < 0) >+ if (nextMatch < 0) { > return null; >- if (i == 0) >+ } >+ if (i == 0) { > matchStart = nextMatch; >+ } > curPos = nextMatch + current.length(); > } >- if (i < segCount) >+ if (i < segCount) { > return null; >+ } > return new Position(matchStart, curPos); > } > >@@ -221,36 +232,45 @@ > * substring > */ > public boolean match(String text, int start, int end) { >- if (null == text) >+ if (null == text) { > throw new IllegalArgumentException(); >+ } > >- if (start > end) >+ if (start > end) { > return false; >+ } > >- if (fIgnoreWildCards) >+ if (fIgnoreWildCards) { > return (end - start == fLength) > && fPattern.regionMatches(fIgnoreCase, 0, text, start, fLength); >+ } > int segCount = fSegments.length; >- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) // pattern >+ if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) { > // contains > // only > // '*'(s) > return true; >- if (start == end) >+ } >+ if (start == end) { > return fLength == 0; >- if (fLength == 0) >+ } >+ if (fLength == 0) { > return start == end; >+ } > > int tlen = text.length(); >- if (start < 0) >+ if (start < 0) { > start = 0; >- if (end > tlen) >+ } >+ if (end > tlen) { > end = tlen; >+ } > > int tCurPos = start; > int bound = end - fBound; >- if (bound < 0) >+ if (bound < 0) { > return false; >+ } > int i = 0; > String current = fSegments[i]; > int segLength = current.length(); >@@ -276,12 +296,14 @@ > int k = current.indexOf(fSingleWildCard); // known BMP code point > if (k < 0) { > currentMatch = textPosIn(text, tCurPos, end, current); >- if (currentMatch < 0) >+ if (currentMatch < 0) { > return false; >+ } > } else { > currentMatch = regExpPosIn(text, tCurPos, end, current); >- if (currentMatch < 0) >+ if (currentMatch < 0) { > return false; >+ } > } > tCurPos = currentMatch + current.length(); > i++; >@@ -315,8 +337,9 @@ > * and/or '?' > */ > private void parseWildCards() { >- if (fPattern.startsWith("*"))//$NON-NLS-1$ >+ if (fPattern.startsWith("*")) { //$NON-NLS-1$ > fHasLeadingStar = true; >+ } > // if it is equal to '*', then it clearly is not a UTF-32 surrogate > if (UTF16.charAt(fPattern, fLength - 1) == '*') { > /* make sure it's not an escaped wildcard */ >@@ -327,7 +350,7 @@ > } > } > >- Vector temp = new Vector(); >+ Vector<String> temp = new Vector<String>(); > > int pos = 0; > StringBuffer buf = new StringBuffer(); >@@ -397,14 +420,16 @@ > > if (!fIgnoreCase) { > int i = UTF16.indexOf(text, fPattern, start); >- if (i == -1 || i > max) >+ if (i == -1 || i > max) { > return -1; >+ } > return i; > } > > for (int i = start; i <= max; ++i) { >- if (text.regionMatches(true, i, fPattern, 0, fLength)) >+ if (text.regionMatches(true, i, fPattern, 0, fLength)) { > return i; >+ } > } > > return -1; >@@ -429,8 +454,9 @@ > > int max = end - plen; > for (int i = start; i <= max; ++i) { >- if (regExpRegionMatches(text, i, p, 0, plen)) >+ if (regExpRegionMatches(text, i, p, 0, plen)) { > return i; >+ } > } > return -1; > } >@@ -475,8 +501,9 @@ > continue; > } > } >- if (pchar == tchar) >+ if (pchar == tchar) { > continue; >+ } > if (fIgnoreCase && Normalizer.compare( > tchar, pchar, Normalizer.COMPARE_IGNORE_CASE) == 0) { > continue; >@@ -505,14 +532,16 @@ > > if (!fIgnoreCase) { > int i = UTF16.indexOf(text, p, start); >- if (i == -1 || i > max) >+ if (i == -1 || i > max) { > return -1; >+ } > return i; > } > > for (int i = start; i <= max; ++i) { >- if (text.regionMatches(true, i, p, 0, plen)) >+ if (text.regionMatches(true, i, p, 0, plen)) { > return i; >+ } > } > > return -1; >Index: src/org/eclipse/emf/validation/internal/util/TextUtils.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/TextUtils.java,v >retrieving revision 1.2 >diff -u -r1.2 TextUtils.java >--- src/org/eclipse/emf/validation/internal/util/TextUtils.java 30 Nov 2006 22:52:12 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/util/TextUtils.java 9 Nov 2007 00:41:13 -0000 >@@ -106,12 +106,14 @@ > ResourceSet resourceSet = resource.getResourceSet(); > > if (resourceSet != null) { >- List factories = resourceSet.getAdapterFactories(); >+ List<AdapterFactory> factories = resourceSet.getAdapterFactories(); > > // iterate only as long as we don't find an adapter factory > // that successfully adapted the eObject >- for (Iterator iter = factories.iterator(); iter.hasNext() && (result == null);) { >- AdapterFactory next = (AdapterFactory) iter.next(); >+ for (Iterator<AdapterFactory> iter = factories.iterator(); >+ iter.hasNext() && (result == null);) { >+ >+ AdapterFactory next = iter.next(); > > if (next.isFactoryForType(type)) { > result = next.adapt(eObject, type); >@@ -128,26 +130,26 @@ > * Applies the specified arguments to my message pattern. > * > * @param messagePattern the message pattern >- * @param inputArgs the pattern arguments >+ * @param inputArg the pattern arguments > * @return the formatted message string > * > * @since 1.1 > */ >- public static String formatMessage(String messagePattern, Object[] inputArgs) { >- Object[] args = new Object[inputArgs.length]; >+ public static String formatMessage(String messagePattern, Object... inputArg) { >+ Object[] args = new Object[inputArg.length]; > > for (int i = 0; i < args.length; i++) { >- Object inputArg = inputArgs[i]; >+ Object next = inputArg[i]; > >- if (inputArg instanceof Collection) { >- inputArg = formatMultiValue((Collection)inputArg); >- } else if (inputArg instanceof Object[]) { >- inputArg = formatMultiValue(Arrays.asList((Object[])inputArg)); >+ if (next instanceof Collection) { >+ next = formatMultiValue((Collection<?>) next); >+ } else if (next instanceof Object[]) { >+ next = formatMultiValue(Arrays.asList((Object[]) next)); > } else { >- inputArg = formatScalarValue(inputArg); >+ next = formatScalarValue(next); > } > >- args[i] = inputArg; >+ args[i] = next; > } > > return NLS.bind(messagePattern, args); >@@ -160,10 +162,10 @@ > * @param multiValuedArg the multiple objects > * @return the string representation of the list > */ >- private static String formatMultiValue(Collection multiValuedArg) { >- List args = new java.util.ArrayList(multiValuedArg); >+ private static String formatMultiValue(Collection<?> multiValuedArg) { >+ List<Object> args = new java.util.ArrayList<Object>(multiValuedArg); > >- for (ListIterator iter = args.listIterator(); iter.hasNext(); ) { >+ for (ListIterator<Object> iter = args.listIterator(); iter.hasNext(); ) { > iter.set(formatScalarValue(iter.next())); > } > >@@ -180,7 +182,7 @@ > */ > private static String formatScalarValue(Object value) { > if (value instanceof EObject) { >- return TextUtils.getText((EObject)value); >+ return TextUtils.getText((EObject) value); > } else { > return String.valueOf(value); > } >Index: src/org/eclipse/emf/validation/internal/util/Log.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/Log.java,v >retrieving revision 1.2 >diff -u -r1.2 Log.java >--- src/org/eclipse/emf/validation/internal/util/Log.java 6 Jun 2007 22:27:54 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/util/Log.java 9 Nov 2007 00:41:13 -0000 >@@ -16,7 +16,6 @@ > > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >- > import org.eclipse.emf.validation.internal.EMFModelValidationPlugin; > > /** >@@ -487,7 +486,7 @@ > if (patternArgs instanceof Object[]) { > args = (Object[])patternArgs; > } else if (patternArgs instanceof Collection) { >- Collection argsCollection = (Collection)patternArgs; >+ Collection<?> argsCollection = (Collection<?>) patternArgs; > > args = argsCollection.toArray(new Object[argsCollection.size()]); > } else { >@@ -555,7 +554,7 @@ > > log(severity, > code, >- EMFModelValidationPlugin.getMessage(messagePattern, patternArgKeys), >- exception); >+ EMFModelValidationPlugin.getMessage(messagePattern, >+ (Object[]) patternArgKeys), exception); > } > } >Index: src/org/eclipse/emf/validation/internal/util/XmlConstraintFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/XmlConstraintFactory.java,v >retrieving revision 1.4 >diff -u -r1.4 XmlConstraintFactory.java >--- src/org/eclipse/emf/validation/internal/util/XmlConstraintFactory.java 6 Jun 2007 22:27:54 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/util/XmlConstraintFactory.java 9 Nov 2007 00:41:14 -0000 >@@ -47,7 +47,8 @@ > "constraintParsers"; //$NON-NLS-1$ > > /** Mapping of language names to parser implementations. */ >- private final java.util.Map parserMap = new java.util.HashMap(); >+ private final java.util.Map<String, IConstraintParser> parserMap = >+ new java.util.HashMap<String, IConstraintParser>(); > > /** > * Initializes me. I load my parsers from the <tt>constraintParsers</tt> >@@ -60,6 +61,8 @@ > } > > // implements the inherited method >+ @Override >+ @SuppressWarnings("deprecation") > protected IModelConstraint createConstraint(IXmlConstraintDescriptor desc) { > IConfigurationElement config = desc.getConfig(); > >@@ -98,6 +101,8 @@ > } > } > >+ @Override >+ @SuppressWarnings("deprecation") > protected IModelConstraint createConstraint(IConstraintDescriptor descriptor) { > if (descriptor instanceof IXmlConstraintDescriptor) { > return createConstraint((IXmlConstraintDescriptor) descriptor); >@@ -110,6 +115,7 @@ > } > } > >+ @SuppressWarnings("deprecation") > protected IModelConstraint createConstraint(IParameterizedConstraintDescriptor descriptor) { > final String lang = descriptor.getLanguage(); > >@@ -151,6 +157,7 @@ > * > * @param config the Eclipse extension configuration data for the parser > */ >+ @SuppressWarnings("deprecation") > void registerParser(IConfigurationElement config) { > assert config != null; > >@@ -163,7 +170,8 @@ > > if (parser instanceof IXmlConstraintParser > || parser instanceof IParameterizedConstraintParser) { >- parserMap.put(UCharacter.toLowerCase(language), parser); >+ parserMap.put(UCharacter.toLowerCase(language), >+ (IConstraintParser) parser); > > Trace.trace( > EMFModelValidationDebugOptions.PARSERS, >@@ -194,7 +202,7 @@ > * @return the parser, or <code>null</code> if it cannot be found > */ > private IConstraintParser getParser(String language) { >- return (IConstraintParser) parserMap.get(UCharacter.toLowerCase(language)); >+ return parserMap.get(UCharacter.toLowerCase(language)); > } > > /** >@@ -207,9 +215,7 @@ > EMFModelValidationPlugin.getPluginId(), > CONSTRAINT_PARSERS_EXT_P_NAME); > >- for (int i = 0; i < configs.length; i++) { >- IConfigurationElement config = configs[i]; >- >+ for (IConfigurationElement config : configs) { > registerParser(config); > } > } >Index: src/org/eclipse/emf/validation/internal/util/Trace.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/Trace.java,v >retrieving revision 1.2 >diff -u -r1.2 Trace.java >--- src/org/eclipse/emf/validation/internal/util/Trace.java 6 Jun 2007 22:27:54 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/util/Trace.java 9 Nov 2007 00:41:13 -0000 >@@ -124,7 +124,7 @@ > * @param methodName The name of method that is being entered. > */ > public static void entering( >- Class clazz, >+ Class<?> clazz, > String methodName) { > > EMFModelValidationPlugin.Tracing.entering( >@@ -142,7 +142,7 @@ > * @param parameter The parameter to the method being entered. > */ > public static void entering( >- Class clazz, >+ Class<?> clazz, > String methodName, > Object parameter) { > >@@ -162,7 +162,7 @@ > * @param parameters The parameters to the method being entered. > */ > public static void entering( >- Class clazz, >+ Class<?> clazz, > String methodName, > Object[] parameters) { > >@@ -183,7 +183,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTraceEntering()) { >@@ -206,7 +206,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object parameter) { > >@@ -231,7 +231,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object[] parameters) { > >@@ -251,7 +251,7 @@ > * @param methodName The name of method that is being exited. > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName) { > > EMFModelValidationPlugin.Tracing.exiting( >@@ -269,7 +269,7 @@ > * @param returnValue The return value of the method being exited. > */ > public static void exiting( >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >@@ -290,7 +290,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTraceExiting()) { >@@ -313,7 +313,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >@@ -336,7 +336,7 @@ > * @param throwable The throwable that is being caught. > */ > public static void catching( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -357,7 +357,7 @@ > * @param throwable The throwable that is being thrown. > */ > public static void throwing( >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >Index: src/org/eclipse/emf/validation/internal/util/JavaConstraintParser.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/JavaConstraintParser.java,v >retrieving revision 1.5 >diff -u -r1.5 JavaConstraintParser.java >--- src/org/eclipse/emf/validation/internal/util/JavaConstraintParser.java 6 Jun 2007 22:27:54 -0000 1.5 >+++ src/org/eclipse/emf/validation/internal/util/JavaConstraintParser.java 9 Nov 2007 00:41:13 -0000 >@@ -49,7 +49,8 @@ > * the single-instance model of {@link AbstractModelConstraint} any class > * implementing one or more ad hoc validation method signatures. > */ >- private static final Map constraintImplementationMap = new java.util.HashMap(); >+ private static final Map<Class<?>, Object> constraintImplementationMap = >+ new java.util.HashMap<Class<?>, Object>(); > > /** > * Adapts instances of {@link AbstractModelConstraint} to the internal >@@ -112,6 +113,7 @@ > descriptor); > } > >+ @SuppressWarnings("deprecation") > public IModelConstraint parseConstraint(IXmlConstraintDescriptor descriptor) > throws ConstraintParserException { > >@@ -155,7 +157,7 @@ > Bundle bundle = Platform.getBundle(bundleName); > > try { >- Class resultType = bundle.loadClass(className); >+ Class<?> resultType = bundle.loadClass(className); > > if (AbstractModelConstraint.class.isAssignableFrom(resultType)) { > // instantiate the class extending AbstractModelConstraint >@@ -212,7 +214,7 @@ > * @throws IllegalAccessException if the instance needs to be created > * and the default constructor is not accessible > */ >- static Object getInstance(Class constraintClass) >+ static Object getInstance(Class<?> constraintClass) > throws InstantiationException, IllegalAccessException { > > Object result = constraintImplementationMap.get(constraintClass); >Index: src/org/eclipse/emf/validation/internal/util/ConstraintsContentHandler.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/util/ConstraintsContentHandler.java,v >retrieving revision 1.5 >diff -u -r1.5 ConstraintsContentHandler.java >--- src/org/eclipse/emf/validation/internal/util/ConstraintsContentHandler.java 22 Feb 2006 21:52:45 -0000 1.5 >+++ src/org/eclipse/emf/validation/internal/util/ConstraintsContentHandler.java 9 Nov 2007 00:41:13 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -96,8 +96,9 @@ > * @author Christian W. Damus (cdamus) > */ > private class Stack { >- private final List contents = new java.util.ArrayList(); >- private final List bodies = new java.util.ArrayList(); >+ private final List<XmlConfigurationElement> contents = >+ new java.util.ArrayList<XmlConfigurationElement>(); >+ private final List<StringBuffer> bodies = new java.util.ArrayList<StringBuffer>(); > private int lastIndex = -1; > > /** >@@ -142,8 +143,7 @@ > throw se; > } > >- XmlConfigurationElement result = >- (XmlConfigurationElement)contents.get(lastIndex); >+ XmlConfigurationElement result = contents.get(lastIndex); > > result.setValue(localize(getBody().toString().trim())); > >@@ -172,7 +172,7 @@ > throw se; > } > >- return (XmlConfigurationElement)contents.get(lastIndex); >+ return contents.get(lastIndex); > } > > /** >@@ -193,7 +193,7 @@ > throw se; > } > >- return (StringBuffer)bodies.get(lastIndex); >+ return bodies.get(lastIndex); > } > } > >@@ -204,7 +204,8 @@ > * @author Christian W. Damus (cdamus) > */ > private static final class ResourceBundleCache { >- private final Map map = new java.util.HashMap(); >+ private final Map<Bundle, Map<String, ResourceBundle>> map = >+ new java.util.HashMap<Bundle, Map<String, ResourceBundle>>(); > > /** > * Obtains the resource bundle named <code>baseName</code> in the >@@ -218,10 +219,10 @@ > */ > ResourceBundle get(Bundle osgiBundle, String baseName) { > ResourceBundle result = null; >- Map secondLevel = (Map) map.get(osgiBundle); >+ Map<String, ResourceBundle> secondLevel = map.get(osgiBundle); > > if (secondLevel != null) { >- result = (ResourceBundle) secondLevel.get(baseName); >+ result = secondLevel.get(baseName); > } > > return result; >@@ -237,10 +238,10 @@ > * @param rb the resource bundle to cache > */ > void put(Bundle osgiBundle, String baseName, ResourceBundle rb) { >- Map secondLevel = (Map) map.get(osgiBundle); >+ Map<String, ResourceBundle> secondLevel = map.get(osgiBundle); > > if (secondLevel == null) { >- secondLevel = new java.util.HashMap(); >+ secondLevel = new java.util.HashMap<String, ResourceBundle>(); > map.put(osgiBundle, secondLevel); > } > >@@ -284,13 +285,14 @@ > /** > * Pushes a new element onto the top of the stack. > */ >+ @Override > public void startElement( > String namespaceURI, > String localName, > String qName, > Attributes atts) { > int attCount = atts.getLength(); >- Map attMap = new java.util.HashMap(); >+ Map<String, String> attMap = new java.util.HashMap<String, String>(); > > for (int i = 0; i < attCount; i++) { > attMap.put(atts.getQName(i), localize(atts.getValue(i))); >@@ -307,6 +309,7 @@ > * > * @see #getResult > */ >+ @Override > public void endElement( > String namespaceURI, > String localName, >@@ -324,6 +327,7 @@ > /** > * Appends text to the body of the top element on the stack. > */ >+ @Override > public void characters(char[] ch, int start, int length) > throws SAXException { > >@@ -337,6 +341,7 @@ > * @throws SAXException if a version is indicated in the processing > * instruction that is not a supported version > */ >+ @Override > public void processingInstruction(String target, String data) > throws SAXException { > if (target.equals(EMF_VALIDATION_INSTRUCTION)) { >@@ -558,6 +563,7 @@ > // > > // extends the inherited method >+ @Override > public void fatalError(SAXParseException e) throws SAXException { > Log.errorMessage( > EMFModelValidationStatusCodes.ERROR_PARSING_XML_FILE, >@@ -569,6 +575,7 @@ > } > > // extends the inherited method >+ @Override > public void error(SAXParseException e) throws SAXException { > Log.errorMessage( > EMFModelValidationStatusCodes.ERROR_PARSING_XML_FILE, >@@ -580,6 +587,7 @@ > } > > // extends the inherited method >+ @Override > public void warning(SAXParseException e) throws SAXException { > Log.warningMessage( > EMFModelValidationStatusCodes.ERROR_PARSING_XML_FILE, >Index: src/org/eclipse/emf/validation/model/CategoryManager.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/CategoryManager.java,v >retrieving revision 1.2 >diff -u -r1.2 CategoryManager.java >--- src/org/eclipse/emf/validation/model/CategoryManager.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/model/CategoryManager.java 9 Nov 2007 00:41:14 -0000 >@@ -13,7 +13,6 @@ > package org.eclipse.emf.validation.model; > > import java.util.Collection; >-import java.util.Iterator; > import java.util.SortedSet; > > import org.eclipse.core.runtime.IConfigurationElement; >@@ -76,7 +75,7 @@ > * @return an unmodifiable set of {@link Category}s, sorted by their > * names > */ >- public SortedSet getTopLevelCategories() { >+ public SortedSet<Category> getTopLevelCategories() { > return globalCategory.getChildren(); > } > >@@ -174,17 +173,19 @@ > } > > // first, recursively remove the child categories >- Collection children = new java.util.ArrayList(category.getChildren()); >- for (Iterator iter = children.iterator(); iter.hasNext();) { >- removeCategory((Category)iter.next()); >+ Collection<Category> children = category.getChildren(); >+ Category[] childrenArray = children.toArray(new Category[children.size()]); >+ for (Category child : childrenArray) { >+ removeCategory(child); > } > > // purge the constraints from this category, so that they know they > // are no longer in it >- Collection constraints = new java.util.ArrayList( >- category.getConstraints()); >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- category.removeConstraint((IConstraintDescriptor)iter.next()); >+ Collection<IConstraintDescriptor> constraints = category.getConstraints(); >+ IConstraintDescriptor[] constraintsArray = constraints.toArray( >+ new IConstraintDescriptor[constraints.size()]); >+ for (IConstraintDescriptor constraint : constraintsArray) { >+ category.removeConstraint(constraint); > } > > // finally, remove the category from its parent >@@ -234,9 +235,7 @@ > EMFModelValidationPlugin.CONSTRAINT_PROVIDERS_EXT_P_NAME) > .getConfigurationElements(); > >- for (int i = 0; i < elements.length; i++) { >- IConfigurationElement next = elements[i]; >- >+ for (IConfigurationElement next : elements) { > if (next.getName().equals(XmlConfig.E_CATEGORY)) { > loadCategories(globalCategory, next); > } >@@ -272,9 +271,9 @@ > IConfigurationElement[] subcategories = element.getChildren( > XmlConfig.E_CATEGORY); > >- for (int i = 0; i < subcategories.length; i++) { >+ for (IConfigurationElement element2 : subcategories) { > // recursively load the child categories, if any >- loadCategories(category, subcategories[i]); >+ loadCategories(category, element2); > } > } else { > Trace.trace( >@@ -289,8 +288,8 @@ > * > * @return the mandatory categories > */ >- public Collection getMandatoryCategories() { >- Collection result = new java.util.ArrayList(); >+ public Collection<Category> getMandatoryCategories() { >+ Collection<Category> result = new java.util.ArrayList<Category>(); > > globalCategory.getMandatoryCategories(result); > >Index: src/org/eclipse/emf/validation/model/EvaluationMode.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/EvaluationMode.java,v >retrieving revision 1.3 >diff -u -r1.3 EvaluationMode.java >--- src/org/eclipse/emf/validation/model/EvaluationMode.java 6 Jun 2007 22:27:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/model/EvaluationMode.java 9 Nov 2007 00:41:14 -0000 >@@ -15,9 +15,10 @@ > import java.io.Serializable; > import java.util.Arrays; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > >+import org.eclipse.emf.common.notify.Notification; >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.validation.internal.l10n.ValidationMessages; > > /** >@@ -31,16 +32,13 @@ > * still want critical constraints to be evaluated on batch invocations. > * </p> > * >+ * @param <T> the kind of object that is validated in an evaluation mode >+ * > * @author Christian W. Damus (cdamus) > */ >-public final class EvaluationMode implements Serializable { >- private static final long serialVersionUID = -2088295328444150344L; >- >- static final String LIVE_MODE = ValidationMessages.mode_live; >- static final String BATCH_MODE = ValidationMessages.mode_batch; >- static final String NULL_MODE = ValidationMessages.mode_unknown; >+public final class EvaluationMode<T> implements Serializable { > >- private static int nextOrdinal = 0; >+ private static final long serialVersionUID = 1862313226055912569L; > > /** > * <p> >@@ -56,37 +54,32 @@ > * contexts. > * </b> > */ >- public static final EvaluationMode LIVE = >- new EvaluationMode("Live", LIVE_MODE); //$NON-NLS-1$ >+ public static final EvaluationMode<Notification> LIVE = new EvaluationMode<Notification>("Live", //$NON-NLS-1$ >+ ValidationMessages.mode_live); > > /** > * Constraints executed in the "Batch" context are intended to be > * constraints that are evaluated on demand (when the user elects to >- * evaluate them). These do not, therefore, udually define conditions for >+ * evaluate them). These do not, therefore, usually define conditions for > * data integrity, but rather semantic rules that guide a user to creating > * a better model. > */ >- public static final EvaluationMode BATCH = >- new EvaluationMode("Batch", BATCH_MODE); //$NON-NLS-1$ >+ public static final EvaluationMode<EObject> BATCH = new EvaluationMode<EObject>("Batch", //$NON-NLS-1$ >+ ValidationMessages.mode_batch); > > /** > * This special value is a pointer-safe null value according to the > * <i>Null Object</i> pattern. It is not a valid evaluation mode for > * a constraint. > */ >- public static final EvaluationMode NULL = >- new EvaluationMode("none", NULL_MODE); //$NON-NLS-1$ >+ public static final EvaluationMode<Void> NULL = new EvaluationMode<Void>("none", //$NON-NLS-1$ >+ ValidationMessages.mode_unknown); > > /** All valid instances. */ >- private static final List instances = Collections.unmodifiableList( >- Arrays.asList(new EvaluationMode[]{ >- LIVE, >- BATCH, >- NULL, >- })); >+ private static final List<EvaluationMode<?>> instances = Collections.unmodifiableList( >+ Arrays.asList(new EvaluationMode<?>[] {LIVE, BATCH, NULL})); > > private final String name; >- private final int ordinal; > private final String localizedName; > > /** >@@ -98,7 +91,6 @@ > */ > private EvaluationMode(String name, String localizedName) { > this.name = name; >- this.ordinal = nextOrdinal++; > this.localizedName = localizedName; > } > >@@ -111,14 +103,13 @@ > * @param name the name of the instance to retrieve (not case-sensitive) > * @return the named instance, or {@link #NULL} if no such instance exists > */ >- public static EvaluationMode getInstance(String name) { >- EvaluationMode result = NULL; >- >- for (Iterator iter = instances.iterator(); iter.hasNext(); ) { >- EvaluationMode next = (EvaluationMode)iter.next(); >+ @SuppressWarnings("unchecked") >+ public static <T> EvaluationMode<T> getInstance(String name) { >+ EvaluationMode<T> result = (EvaluationMode<T>) NULL; > >+ for (EvaluationMode<?> next : instances) { > if (next.getName().equalsIgnoreCase(name)) { >- result = next; >+ result = (EvaluationMode<T>) next; > break; > } > } >@@ -131,7 +122,7 @@ > * > * @return all values > */ >- public static final List getAllInstances() { >+ public static final List<EvaluationMode<?>> getAllInstances() { > return instances; > } > >@@ -193,17 +184,12 @@ > } > > // re-implements the inherited method >+ @Override > public String toString() { > return getName(); > } >- >- /** >- * Implements the instance substitution protocol defined by the Java >- * Serialization Specification. >- * >- * @return the correct pre-defined instance of the enumeration >- */ >+ > private Object readResolve() { >- return getAllInstances().get(ordinal); >+ return getInstance(getName()); > } > } >Index: src/org/eclipse/emf/validation/model/IModelConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/IModelConstraint.java,v >retrieving revision 1.4 >diff -u -r1.4 IModelConstraint.java >--- src/org/eclipse/emf/validation/model/IModelConstraint.java 6 Jun 2007 22:27:53 -0000 1.4 >+++ src/org/eclipse/emf/validation/model/IModelConstraint.java 9 Nov 2007 00:41:14 -0000 >@@ -42,7 +42,7 @@ > * <p> > * <b>Note</b> that it is best to use the > * {@link IValidationContext#createSuccessStatus()} and >- * {@link IValidationContext#createFailureStatus(Object[])} methods of the context >+ * {@link IValidationContext#createFailureStatus(Object...)} methods of the context > * object to create the status object returned from this method, to ensure > * that the status object returned is correctly handled by the validation > * system. >@@ -51,7 +51,7 @@ > * cases, it can return a > * {@link ConstraintStatus#createMultiStatus(IValidationContext, Collection) multi-status} of > * multiple results created by the overloaded variants of the >- * {@link ConstraintStatus#createStatus(IValidationContext, org.eclipse.emf.ecore.EObject, Collection, String, Object[])} >+ * {@link ConstraintStatus#createStatus(IValidationContext, org.eclipse.emf.ecore.EObject, Collection, String, Object...)} > * method. In these cases, also, each resulting status can store a distinct > * result locus. For example: > * </p> >@@ -98,7 +98,7 @@ > * Must not return <code>null</code> > * > * @see IValidationContext#createSuccessStatus() >- * @see IValidationContext#createFailureStatus(Object[]) >+ * @see IValidationContext#createFailureStatus(Object...) > * @see ConstraintStatus#createStatus(IValidationContext, org.eclipse.emf.ecore.EObject, Collection, String, Object[]) > */ > IStatus validate(IValidationContext ctx); >Index: src/org/eclipse/emf/validation/model/IConstraintStatus.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/IConstraintStatus.java,v >retrieving revision 1.2 >diff -u -r1.2 IConstraintStatus.java >--- src/org/eclipse/emf/validation/model/IConstraintStatus.java 6 Jun 2007 22:27:53 -0000 1.2 >+++ src/org/eclipse/emf/validation/model/IConstraintStatus.java 9 Nov 2007 00:41:14 -0000 >@@ -49,5 +49,5 @@ > * successful validation, the result is an empty collection. The result > * is never <code>null</code> > */ >- Set getResultLocus(); >+ Set<EObject> getResultLocus(); > } >Index: src/org/eclipse/emf/validation/model/ConstraintSeverity.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/ConstraintSeverity.java,v >retrieving revision 1.3 >diff -u -r1.3 ConstraintSeverity.java >--- src/org/eclipse/emf/validation/model/ConstraintSeverity.java 6 Jun 2007 22:27:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/model/ConstraintSeverity.java 9 Nov 2007 00:41:14 -0000 >@@ -12,13 +12,12 @@ > > package org.eclipse.emf.validation.model; > >-import java.io.Serializable; > import java.util.Arrays; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.emf.common.util.Enumerator; > import org.eclipse.emf.validation.internal.l10n.ValidationMessages; > > /** >@@ -32,47 +31,40 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public final class ConstraintSeverity implements Serializable { >- private static final long serialVersionUID = -5310833954198275258L; >- >- private static int nextOrdinal = 0; >- >+public enum ConstraintSeverity implements Enumerator { > /** > * Indicates that failure of the constraint should only generate an > * informational message to the user. > */ >- public static final ConstraintSeverity INFO = new ConstraintSeverity( >- "INFO", ValidationMessages.severity_info, IStatus.INFO); //$NON-NLS-1$ >+ INFO("INFO", ValidationMessages.severity_info, IStatus.INFO), //$NON-NLS-1$ > > /** > * Indicates that failure of the constraint constitutes a warning condition. > */ >- public static final ConstraintSeverity WARNING = new ConstraintSeverity( >- "WARNING", ValidationMessages.severity_warning, IStatus.WARNING); //$NON-NLS-1$ >+ WARNING("WARNING", ValidationMessages.severity_warning, IStatus.WARNING), //$NON-NLS-1$ > > /** > * Indicates that failure of the constraint constitutes an error condition. > */ >- public static final ConstraintSeverity ERROR = new ConstraintSeverity( >- "ERROR", ValidationMessages.severity_error, IStatus.ERROR); //$NON-NLS-1$ >+ ERROR("ERROR", ValidationMessages.severity_error, IStatus.ERROR), //$NON-NLS-1$ > > /** > * Indicates that failure of the constraint constitutes an error condition > * that should cancel the validation operation (no further constraints are > * evaluated). > */ >- public static final ConstraintSeverity CANCEL = new ConstraintSeverity( >- "CANCEL", ValidationMessages.severity_cancel, IStatus.CANCEL); //$NON-NLS-1$ >+ CANCEL("CANCEL", ValidationMessages.severity_cancel, IStatus.CANCEL), //$NON-NLS-1$ > /** > * This special value is a pointer-safe null value according to the > * <i>Null Object</i> pattern. It is not a valid severity for > * a constraint. > */ >- public static final ConstraintSeverity NULL = new ConstraintSeverity( >- "none", ValidationMessages.severity_null, IStatus.OK); //$NON-NLS-1$ >+ NULL("none", ValidationMessages.severity_null, IStatus.OK); //$NON-NLS-1$ >+ >+ private static final long serialVersionUID = -5310833954198275258L; > > /** All of my values. */ >- private static final List instances = Collections.unmodifiableList( >+ private static final List<ConstraintSeverity> instances = Collections.unmodifiableList( > Arrays.asList(new ConstraintSeverity[]{ > INFO, > WARNING, >@@ -83,7 +75,6 @@ > > private final String name; > private final String localizedName; >- private final int ordinal; > private final int istatusSeverity; > > /** >@@ -96,7 +87,6 @@ > */ > private ConstraintSeverity(String name, String localizedName, int istatusSeverity) { > this.name = name; >- this.ordinal = nextOrdinal++; > this.istatusSeverity = istatusSeverity; > > this.localizedName = localizedName; >@@ -112,9 +102,7 @@ > public static ConstraintSeverity getInstance(String name) { > ConstraintSeverity result = NULL; > >- for (Iterator iter = instances.iterator(); iter.hasNext(); ) { >- ConstraintSeverity next = (ConstraintSeverity)iter.next(); >- >+ for (ConstraintSeverity next : instances) { > if (next.getName().equalsIgnoreCase(name)) { > result = next; > break; >@@ -129,7 +117,7 @@ > * > * @return all values > */ >- public static final List getAllInstances() { >+ public static final List<ConstraintSeverity> getAllInstances() { > return instances; > } > >@@ -173,17 +161,16 @@ > } > > // re-implements the inherited method >+ @Override > public String toString() { > return getName(); > } >- >- /** >- * Implements the instance substitution protocol defined by the Java >- * Serialization Specification. >- * >- * @return the correct pre-defined instance of the enumeration >- */ >- private Object readResolve() { >- return getAllInstances().get(ordinal); >+ >+ public int getValue() { >+ return ordinal(); >+ } >+ >+ public String getLiteral() { >+ return getName(); > } > } >Index: src/org/eclipse/emf/validation/model/Category.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/Category.java,v >retrieving revision 1.5 >diff -u -r1.5 Category.java >--- src/org/eclipse/emf/validation/model/Category.java 10 Oct 2006 14:31:06 -0000 1.5 >+++ src/org/eclipse/emf/validation/model/Category.java 9 Nov 2007 00:41:14 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -14,7 +14,7 @@ > > import java.util.Collection; > import java.util.Collections; >-import java.util.Iterator; >+import java.util.Map; > import java.util.Set; > import java.util.SortedSet; > >@@ -41,7 +41,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public class Category implements Comparable { >+public class Category implements Comparable<Category> { > static final String SLASH = "/"; //$NON-NLS-1$ > > /** >@@ -70,9 +70,11 @@ > private boolean mandatory; > > private final Category parent; >- private final java.util.Map children = new java.util.HashMap(); >+ private final Map<String, Category> children = >+ new java.util.HashMap<String, Category>(); > >- private final Set constraints = new java.util.HashSet(); >+ private final Set<IConstraintDescriptor> constraints = >+ new java.util.HashSet<IConstraintDescriptor>(); > > /** > * Initializes me with my ID and parent category. >@@ -165,7 +167,7 @@ > * @return the {@link IConstraintDescriptor}s that are members of me as an > * unmodifiable set > */ >- public Set getConstraints() { >+ public Set<IConstraintDescriptor> getConstraints() { > return Collections.unmodifiableSet(constraints); > } > >@@ -225,9 +227,9 @@ > * @return an unmodifiable set of the {@link Category}s that are > * my children, sorted by {@link #getName name}. May be an empty set > */ >- public SortedSet getChildren() { >+ public SortedSet<Category> getChildren() { > return Collections.unmodifiableSortedSet( >- new java.util.TreeSet(children.values())); >+ new java.util.TreeSet<Category>(children.values())); > } > > /** >@@ -238,7 +240,7 @@ > * @return the matching category, or <code>null</code> if not found > */ > public Category getChild(String childId) { >- return (Category)children.get(childId); >+ return children.get(childId); > } > > /** >@@ -363,11 +365,13 @@ > } > > // redefines the inherited method >+ @Override > public int hashCode() { > return getPath().hashCode(); > } > > // redefines the inherited method >+ @Override > public boolean equals(Object other) { > return (other instanceof Category) > && ((Category)other).getPath().equals(getPath()); >@@ -382,10 +386,7 @@ > } > > // implements the interface method >- public int compareTo(Object o) { >- // this will throw if o has the wrong type. That's expected >- Category other = (Category)o; >- >+ public int compareTo(Category other) { > Collator aCollator = getCollator(); > > int result = aCollator.compare(getName(), other.getName()); >@@ -400,6 +401,7 @@ > } > > // redefines the inherited method >+ @Override > public String toString() { > StringBuffer result = new StringBuffer(32); > >@@ -418,14 +420,12 @@ > * > * @param collection the collection of mandatory categories to which I append > */ >- void getMandatoryCategories(Collection collection) { >+ void getMandatoryCategories(Collection<? super Category> collection) { > if (isMandatory()) { > collection.add(this); > } > >- for (Iterator iter = getChildren().iterator(); iter.hasNext(); ) { >- Category next = (Category)iter.next(); >- >+ for (Category next : getChildren()) { > next.getMandatoryCategories(collection); > } > } >Index: src/org/eclipse/emf/validation/model/ConstraintStatus.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/model/ConstraintStatus.java,v >retrieving revision 1.3 >diff -u -r1.3 ConstraintStatus.java >--- src/org/eclipse/emf/validation/model/ConstraintStatus.java 21 Mar 2007 18:51:04 -0000 1.3 >+++ src/org/eclipse/emf/validation/model/ConstraintStatus.java 9 Nov 2007 00:41:14 -0000 >@@ -60,7 +60,7 @@ > private final IModelConstraint constraint; > private EObject target; > >- private Set resultLocus; >+ private Set<EObject> resultLocus; > > /** > * Initializes me as a failure of the specified <code>constraint</code> >@@ -76,7 +76,7 @@ > public ConstraintStatus(IModelConstraint constraint, > EObject target, > String message, >- Set resultLocus) { >+ Set<? extends EObject> resultLocus) { > this( > constraint, > target, >@@ -123,7 +123,7 @@ > int severity, > int code, > String message, >- Set resultLocus) { >+ Set<? extends EObject> resultLocus) { > super(severity, constraint.getDescriptor().getPluginId(), code, message, null); > > assert constraint != null; >@@ -135,8 +135,8 @@ > > // unmodifiable defensive copy > this.resultLocus = (resultLocus != null) >- ? Collections.unmodifiableSet(new java.util.HashSet(resultLocus)) >- : Collections.EMPTY_SET; >+ ? Collections.unmodifiableSet(new java.util.HashSet<EObject>(resultLocus)) >+ : Collections.<EObject>emptySet(); > } > > /** >@@ -174,9 +174,9 @@ > public static ConstraintStatus createStatus( > IValidationContext ctx, > EObject target, >- Collection resultLocus, >+ Collection<? extends EObject> resultLocus, > String messagePattern, >- Object[] messageArguments) { >+ Object... messageArguments) { > > IConstraintDescriptor desc = ConstraintRegistry.getInstance().getDescriptor( > ctx.getCurrentConstraintId()); >@@ -224,25 +224,25 @@ > public static ConstraintStatus createStatus( > IValidationContext ctx, > EObject target, >- Collection resultLocus, >+ Collection<? extends EObject> resultLocus, > int severity, > int errorCode, > String messagePattern, >- Object[] messageArguments) { >+ Object... messageArguments) { > > // need a prototype status to get certain critical information, such > // as the constraint object and target >- ConstraintStatus result = (ConstraintStatus) ctx.createFailureStatus(null); >+ ConstraintStatus result = (ConstraintStatus) ctx.createFailureStatus(); > > if (target != null) { > result.target = target; > } > >- Set results; >+ Set<EObject> results; > if (resultLocus == null) { > results = Collections.singleton(result.getTarget()); > } else { >- results = new java.util.HashSet(resultLocus); >+ results = new java.util.HashSet<EObject>(resultLocus); > if (!results.contains(result.getTarget())) { > results.add(result.getTarget()); > } >@@ -293,9 +293,9 @@ > */ > public static ConstraintStatus createStatus( > IValidationContext ctx, >- Collection resultLocus, >+ Collection<? extends EObject> resultLocus, > String messagePattern, >- Object[] messageArguments) { >+ Object... messageArguments) { > > IConstraintDescriptor desc = ConstraintRegistry.getInstance().getDescriptor( > ctx.getCurrentConstraintId()); >@@ -341,11 +341,11 @@ > */ > public static ConstraintStatus createStatus( > IValidationContext ctx, >- Collection resultLocus, >+ Collection<? extends EObject> resultLocus, > int severity, > int errorCode, > String messagePattern, >- Object[] messageArguments) { >+ Object... messageArguments) { > return createStatus(ctx, null, resultLocus, > severity, errorCode, > messagePattern, messageArguments); >@@ -382,18 +382,18 @@ > public static IStatus createSuccessStatus( > IValidationContext ctx, > EObject target, >- Collection resultLocus) { >+ Collection<? extends EObject> resultLocus) { > IStatus status = ctx.createSuccessStatus(); > > if (status instanceof IConstraintStatus) { > IConstraintStatus successStatus = (IConstraintStatus)status; > ConstraintStatus constraintStatus = new ConstraintStatus(successStatus.getConstraint(), target); > >- Set results; >+ Set<EObject> results; > if (resultLocus == null) { > results = Collections.singleton(target); > } else { >- results = new java.util.HashSet(resultLocus); >+ results = new java.util.HashSet<EObject>(resultLocus); > if (!results.contains(target)) { > results.add(target); > } >@@ -430,7 +430,8 @@ > * > * @see #createMultiStatus(IValidationContext, String, Object[], Collection) > */ >- public static IStatus createMultiStatus(IValidationContext ctx, Collection statuses) { >+ public static IStatus createMultiStatus(IValidationContext ctx, >+ Collection<? extends IStatus> statuses) { > return createMultiStatus( > ctx, > ValidationMessages.eval_some_fail_WARN_, null, >@@ -470,12 +471,12 @@ > public static IStatus createMultiStatus( > IValidationContext ctx, > String messagePattern, Object[] messageArguments, >- Collection statuses) { >+ Collection<? extends IStatus> statuses) { > if (statuses == null || statuses.isEmpty()) { > throw new IllegalArgumentException("no statuses to aggregate"); //$NON-NLS-1$ > } > >- IStatus[] children = (IStatus[]) statuses.toArray(new IStatus[statuses.size()]); >+ IStatus[] children = statuses.toArray(new IStatus[statuses.size()]); > > IConstraintDescriptor desc = ConstraintRegistry.getInstance().getDescriptor( > ctx.getCurrentConstraintId()); >@@ -518,7 +519,7 @@ > * successful validation, the result is an empty collection. The result > * is never <code>null</code> > */ >- public final Set getResultLocus() { >+ public final Set<EObject> getResultLocus() { > return resultLocus; > } > >@@ -527,16 +528,16 @@ > implements IConstraintStatus { > private final IModelConstraint constraint; > private final EObject target; >- private final Set resultLocus; >+ private final Set<EObject> resultLocus; > > Multi(String pluginId, int code, IStatus[] children, String message) { > super(pluginId, code, children, message, null); > > IConstraintStatus prototype = null; > >- for (int i = 0; i < children.length; i++) { >- if (children[i] instanceof IConstraintStatus) { >- prototype = (IConstraintStatus) children[i]; >+ for (IStatus element : children) { >+ if (element instanceof IConstraintStatus) { >+ prototype = (IConstraintStatus) element; > break; > } > } >@@ -544,7 +545,7 @@ > if (prototype == null) { > constraint = null; > target = null; >- resultLocus = Collections.EMPTY_SET; >+ resultLocus = Collections.emptySet(); > } else { > constraint = prototype.getConstraint(); > target = prototype.getTarget(); >@@ -560,7 +561,7 @@ > return target; > } > >- public Set getResultLocus() { >+ public Set<EObject> getResultLocus() { > return resultLocus; > } > } >Index: src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintParser.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintParser.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFConstraintParser.java >--- src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintParser.java 6 Jun 2007 22:27:54 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintParser.java 9 Nov 2007 00:41:13 -0000 >@@ -35,6 +35,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >+@SuppressWarnings("deprecation") > public class EMFConstraintParser > implements IParameterizedConstraintParser, IXmlConstraintParser { > private static final String PARAMETER_CLASS = "class"; //$NON-NLS-1$ >@@ -48,7 +49,7 @@ > private static final String METHOD_NOT_FOUND = ValidationMessages.emfadapter_methodNotFound_WARN_; > > /** The signature of validation methods in the EMF API. */ >- private static final Class[] VALIDATION_METHOD_SIGNATURE = new Class[] { >+ private static final Class<?>[] VALIDATION_METHOD_SIGNATURE = new Class<?>[] { > DiagnosticChain.class, > java.util.Map.class, > }; >@@ -100,7 +101,7 @@ > try { > // use the contributing plug-in's class loader to get the interface > // type (in case the plug-in isn't my own) >- Class emfInterface = bundle.loadClass(className); >+ Class<?> emfInterface = bundle.loadClass(className); > > // get the method, which we know has always the same signature in > // the EMF API >Index: src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintAdapter.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFConstraintAdapter.java >--- src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintAdapter.java 16 Aug 2007 14:31:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/emfadapter/EMFConstraintAdapter.java 9 Nov 2007 00:41:13 -0000 >@@ -54,7 +54,8 @@ > * since the EMF APIs have no access to it and there is nothing else in > * this adapter layer maintains a reference to it. > */ >- private static final Map contextMapCache = new java.util.WeakHashMap(); >+ private static final Map<IValidationContext, Map<Object, Object>> contextMapCache = >+ new java.util.WeakHashMap<IValidationContext, Map<Object,Object>>(); > > private final IConstraintDescriptor descriptor; > private final Method validationMethod; >@@ -88,7 +89,7 @@ > (EMFValidationContextAdapter)validationArgs[0]; > > ctxAdapter.setAdaptedContext(ctx); >- validationArgs[1] = getEmfContextFor(ctx); >+ validationArgs[1] = getEMFContextFor(ctx); > > try { > boolean success = ((Boolean)validationMethod.invoke( >@@ -131,7 +132,7 @@ > private IStatus fail(EMFValidationContextAdapter ctxAdapter) { > final IValidationContext ctx = ctxAdapter.getAdaptedContext(); > >- List resultLocus = new java.util.ArrayList(ctx.getResultLocus()); >+ List<EObject> resultLocus = new java.util.ArrayList<EObject>(ctx.getResultLocus()); > resultLocus.remove(ctx.getTarget()); > > Diagnostic status = ctxAdapter.getLastStatus(); >@@ -142,9 +143,8 @@ > // 1 - the result locus minus the target(as a collection of > // model elements) > return ctx.createFailureStatus( >- new Object[] { > (status == null) ? null : status.getMessage(), >- resultLocus}); >+ resultLocus); > } > > /** >@@ -164,8 +164,8 @@ > getDescriptor().getStatusCode(), > EMFModelValidationPlugin.getMessage( > ValidationMessages.emfadapter_disabled_WARN_, >- new Object[] {getDescriptor().getName()}), >- Collections.EMPTY_SET); >+ getDescriptor().getName()), >+ Collections.<EObject>emptySet()); > > EMFModelValidationPlugin.getPlugin().getLog().log( > new Status( >@@ -185,11 +185,11 @@ > * @param ctx our validation context > * @return the corresponding EMF validation context > */ >- private static Map getEmfContextFor(IValidationContext ctx) { >- Map result = (Map) contextMapCache.get(ctx); >+ private static Map<Object, Object> getEMFContextFor(IValidationContext ctx) { >+ Map<Object, Object> result = contextMapCache.get(ctx); > > if (result == null) { >- result = new java.util.HashMap(); >+ result = new java.util.HashMap<Object, Object>(); > > // add a substitution label provider for good measure > result.put( >Index: src/org/eclipse/emf/validation/internal/emfadapter/EMFValidationContextAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/emfadapter/EMFValidationContextAdapter.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFValidationContextAdapter.java >--- src/org/eclipse/emf/validation/internal/emfadapter/EMFValidationContextAdapter.java 16 Aug 2007 14:31:53 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/emfadapter/EMFValidationContextAdapter.java 9 Nov 2007 00:41:13 -0000 >@@ -12,7 +12,6 @@ > > package org.eclipse.emf.validation.internal.emfadapter; > >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.emf.common.util.BasicDiagnostic; >@@ -49,16 +48,15 @@ > /* (non-Javadoc) > * Redefines the inherited method > */ >+ @Override > public void add(Diagnostic diagnostic) { > if (diagnostic.getSeverity() != Diagnostic.OK) { >- List ddata = diagnostic.getData(); >+ List<?> ddata = diagnostic.getData(); > > if (ddata != null) { > // add any EObjects that we find to our results > >- for (Iterator iter = ddata.iterator(); iter.hasNext();) { >- Object next = iter.next(); >- >+ for (Object next : ddata) { > if (next instanceof EObject) { > adaptedContext.addResult((EObject) next); > } >Index: src/org/eclipse/emf/validation/AbstractModelConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/AbstractModelConstraint.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractModelConstraint.java >--- src/org/eclipse/emf/validation/AbstractModelConstraint.java 6 Jun 2007 22:27:54 -0000 1.4 >+++ src/org/eclipse/emf/validation/AbstractModelConstraint.java 9 Nov 2007 00:41:13 -0000 >@@ -54,7 +54,7 @@ > * <p> > * <b>Note</b> that it is best to use the > * {@link IValidationContext#createSuccessStatus()} and >- * {@link IValidationContext#createFailureStatus(Object[])} methods of the context >+ * {@link IValidationContext#createFailureStatus(Object...)} methods of the context > * object to create the status object returned from this method, to ensure > * that the status object returned is correctly handled by the validation > * system. >@@ -110,7 +110,7 @@ > * Must not return <code>null</code> > * > * @see IValidationContext#createSuccessStatus() >- * @see IValidationContext#createFailureStatus(Object[]) >+ * @see IValidationContext#createFailureStatus(Object...) > * @see ConstraintStatus#createStatus(IValidationContext, java.util.Collection, String, Object[]) > * @see ConstraintStatus#createMultiStatus(IValidationContext, Collection) > */ >Index: src/org/eclipse/emf/validation/EMFEventType.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/EMFEventType.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFEventType.java >--- src/org/eclipse/emf/validation/EMFEventType.java 21 Mar 2007 21:06:33 -0000 1.3 >+++ src/org/eclipse/emf/validation/EMFEventType.java 9 Nov 2007 00:41:13 -0000 >@@ -16,7 +16,6 @@ > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > >@@ -47,7 +46,8 @@ > > private static int nextNotificationTypeCode = 0; > >- private static final Map nameToInstance = new java.util.HashMap(); >+ private static final Map<String, EMFEventType> nameToInstance = >+ new java.util.HashMap<String, EMFEventType>(); > > /** > * The EMF "Add" event (corresponds to {@link Notification#ADD}). >@@ -142,7 +142,7 @@ > -1); > > /** All of my values. */ >- private static final List predefinedInstances = Collections.unmodifiableList( >+ private static final List<EMFEventType> predefinedInstances = Collections.unmodifiableList( > Arrays.asList(new EMFEventType[]{ > ADD, > ADD_MANY, >@@ -157,7 +157,8 @@ > NULL, > })); > >- private static final List instances = new ArrayList(predefinedInstances); >+ private static final List<EMFEventType> instances = new ArrayList<EMFEventType>( >+ predefinedInstances); > > private final String name; > private final boolean featureSpecific; >@@ -224,9 +225,7 @@ > public static EMFEventType getInstance(String name) { > EMFEventType result = NULL; > >- for (Iterator iter = instances.iterator(); iter.hasNext(); ) { >- EMFEventType next = (EMFEventType)iter.next(); >- >+ for (EMFEventType next : instances) { > if (next.getName().equalsIgnoreCase(name)) { > result = next; > break; >@@ -247,9 +246,7 @@ > public static EMFEventType getInstance(int code) { > EMFEventType result = NULL; > >- for (Iterator iter = instances.iterator(); iter.hasNext(); ) { >- EMFEventType next = (EMFEventType)iter.next(); >- >+ for (EMFEventType next : instances) { > if (next.toNotificationType() == code) { > result = next; > break; >@@ -264,7 +261,7 @@ > * > * @return all values > */ >- public static final List getAllInstances() { >+ public static final List<EMFEventType> getAllInstances() { > return instances; > } > >@@ -276,7 +273,7 @@ > * > * @return all predefined values > */ >- public static final List getPredefinedInstances() { >+ public static final List<EMFEventType> getPredefinedInstances() { > return predefinedInstances; > } > >@@ -337,6 +334,7 @@ > } > > // re-implements the inherited method >+ @Override > public String toString() { > return getName(); > } >Index: src/org/eclipse/emf/validation/IValidationContext.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/IValidationContext.java,v >retrieving revision 1.3 >diff -u -r1.3 IValidationContext.java >--- src/org/eclipse/emf/validation/IValidationContext.java 30 Nov 2006 22:52:12 -0000 1.3 >+++ src/org/eclipse/emf/validation/IValidationContext.java 9 Nov 2007 00:41:13 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -17,6 +17,7 @@ > import java.util.Set; > > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.validation.model.ConstraintStatus; >@@ -90,7 +91,7 @@ > * @return the raw {@link org.eclipse.emf.common.notify.Notification}s being validated, or an empty > * list if this is a batch validation. This list is not modifiable > */ >- List getAllEvents(); >+ List<Notification> getAllEvents(); > > /** > * In the case of a live constraint evaluation, obtains the particular >@@ -174,7 +175,7 @@ > * > * @see #skipCurrentConstraintFor(EObject) > */ >- void skipCurrentConstraintForAll(Collection eObjects); >+ void skipCurrentConstraintForAll(Collection<?> eObjects); > > /** > * <p> >@@ -234,7 +235,7 @@ > * > * @see #addResult(EObject) > */ >- Set getResultLocus(); >+ Set<EObject> getResultLocus(); > > /** > * Adds a result to the result locus of the current constraint. The result >@@ -257,7 +258,7 @@ > * > * @see #addResult(EObject) > */ >- void addResults(Collection eObjects); >+ void addResults(Collection<? extends EObject> eObjects); > > /** > * Creates a status object indicating successful evaluation of the >@@ -273,10 +274,10 @@ > * the severity, error code, and message defined in the constraint meta-data > * in the XML. > * >- * @param messageArguments the positional {0}, {1}, etc. arguments to >+ * @param messageArgument the positional {0}, {1}, etc. arguments to > * replace in the message pattern (may by <code>null</code> if none > * are needed) > * @return the status indicating a constraint violation > */ >- IStatus createFailureStatus(Object[] messageArguments); >+ IStatus createFailureStatus(Object... messageArgument); > } >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/build.properties,v >retrieving revision 1.8 >diff -u -r1.8 build.properties >--- build.properties 6 Jun 2007 22:27:54 -0000 1.8 >+++ build.properties 9 Nov 2007 00:41:13 -0000 >@@ -29,5 +29,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.validation/plugins/org.eclipse.emf.validation/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:53 -0000 1.2 >+++ .classpath 9 Nov 2007 00:41: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: src/org/eclipse/emf/validation/marker/MarkerUtil.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/marker/MarkerUtil.java,v >retrieving revision 1.6 >diff -u -r1.6 MarkerUtil.java >--- src/org/eclipse/emf/validation/marker/MarkerUtil.java 19 Sep 2007 16:13:52 -0000 1.6 >+++ src/org/eclipse/emf/validation/marker/MarkerUtil.java 9 Nov 2007 00:41:14 -0000 >@@ -91,13 +91,13 @@ > public void run(IProgressMonitor m) > throws CoreException { > >- final Map visitedResources = new HashMap(); >+ final Map<URI, IFile> visitedResources = new HashMap<URI, IFile>(); > > if (validationStatus.isMultiStatus()) { > IStatus[] children = validationStatus.getChildren(); >- for (int i=0; i<children.length ;i++) { >- if (children[i] instanceof IConstraintStatus) { >- createMarker((IConstraintStatus)children[i], markerType, configurator, visitedResources); >+ for (IStatus element : children) { >+ if (element instanceof IConstraintStatus) { >+ createMarker((IConstraintStatus)element, markerType, configurator, visitedResources); > } > } > } else if (validationStatus instanceof IConstraintStatus) { >@@ -110,7 +110,8 @@ > } > > private static void createMarker(IConstraintStatus status, >- String markerType, IMarkerConfigurator configurator, Map visitedResources) throws CoreException { >+ String markerType, IMarkerConfigurator configurator, >+ Map<URI, IFile> visitedResources) throws CoreException { > > Resource r = status.getTarget().eResource(); > URI uri = r.getURI(); >@@ -118,7 +119,7 @@ > // Normalize the URI to something that we can deal with like file or platform scheme > uri = r.getResourceSet().getURIConverter().normalize(uri); > >- IFile file = (IFile)visitedResources.get(uri); >+ IFile file = visitedResources.get(uri); > > if (file == null) { > if (PLATFORM_SCHEME.equals(uri.scheme()) && uri.segmentCount() > 1 >Index: src/org/eclipse/emf/validation/internal/EMFModelValidationPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/EMFModelValidationPlugin.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFModelValidationPlugin.java >--- src/org/eclipse/emf/validation/internal/EMFModelValidationPlugin.java 21 Mar 2007 21:06:33 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/EMFModelValidationPlugin.java 9 Nov 2007 00:41:13 -0000 >@@ -181,6 +181,7 @@ > } > > // implements the inherited method >+ @Override > public ResourceLocator getPluginResourceLocator() { > return plugin; > } >@@ -221,6 +222,7 @@ > } > > // extends the inherited method >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > >@@ -289,7 +291,7 @@ > /** > * 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. >@@ -314,7 +316,7 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >@@ -431,7 +433,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -470,7 +472,7 @@ > */ > public static void catching( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -503,7 +505,7 @@ > */ > public static void throwing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -533,7 +535,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -558,7 +560,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object parameter) { > >@@ -587,7 +589,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object[] parameters) { > >@@ -614,7 +616,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -639,7 +641,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >@@ -656,11 +658,11 @@ > } > } > >- public static void catching(Class class1, String functionName, Throwable exception) { >+ public static void catching(Class<?> class1, String functionName, Throwable exception) { > Tracing.catching(EMFModelValidationDebugOptions.EXCEPTIONS_CATCHING, class1, functionName, exception); > } > >- public static void throwing(Class class1, String functionName, Throwable exception) { >+ public static void throwing(Class<?> class1, String functionName, Throwable exception) { > Tracing.throwing(EMFModelValidationDebugOptions.EXCEPTIONS_THROWING, class1, functionName, exception); > } > >@@ -688,7 +690,7 @@ > * > * @see org.eclipse.osgi.util.NLS > */ >- public static String getMessage(String messagePattern, Object[] args) { >+ public static String getMessage(String messagePattern, Object... args) { > return formatMessage(messagePattern, args); > } > >@@ -703,7 +705,7 @@ > * > * @see org.eclipse.osgi.util.NLS > */ >- private static String formatMessage(String messagePattern, Object[] args) { >+ private static String formatMessage(String messagePattern, Object... args) { > try { > return NLS.bind(messagePattern, args); > } catch (Exception e) { >@@ -733,7 +735,7 @@ > * @return the list, <code>strings[0]</code> if there is only one element, > * or <code>""</code> if the array has no elements > */ >- public static String formatList(Collection items) { >+ public static String formatList(Collection<?> items) { > switch (items.size()) { > case 0 : > return ""; //$NON-NLS-1$ >@@ -756,8 +758,8 @@ > * > * @see #formatList(Collection) > */ >- private static String formatList2(Collection items) { >- Iterator iter = items.iterator(); >+ private static String formatList2(Collection<?> items) { >+ Iterator<?> iter = items.iterator(); > int max = items.size() - 1; > > final String sep = getString( >@@ -800,8 +802,8 @@ > * > * @see #formatList(Collection) > */ >- private static String formatPair(Collection items) { >- Iterator iter = items.iterator(); >+ private static String formatPair(Collection<?> items) { >+ Iterator<?> iter = items.iterator(); > > StringBuffer result = new StringBuffer(32); > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/META-INF/MANIFEST.MF,v >retrieving revision 1.12 >diff -u -r1.12 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Nov 2007 17:30:10 -0000 1.12 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:13 -0000 >@@ -25,4 +25,4 @@ > com.ibm.icu;bundle-version="[3.4.3,4.0.0)", > org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: src/org/eclipse/emf/validation/xml/AbstractXmlConstraintDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/xml/AbstractXmlConstraintDescriptor.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractXmlConstraintDescriptor.java >--- src/org/eclipse/emf/validation/xml/AbstractXmlConstraintDescriptor.java 29 Nov 2005 16:54:05 -0000 1.2 >+++ src/org/eclipse/emf/validation/xml/AbstractXmlConstraintDescriptor.java 9 Nov 2007 00:41:14 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2005 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 >@@ -32,6 +32,7 @@ > * > * @author Chris McGee (cmcgee) > */ >+@SuppressWarnings("deprecation") > public abstract class AbstractXmlConstraintDescriptor > extends AbstractConstraintDescriptor > implements IXmlConstraintDescriptor { >Index: src/org/eclipse/emf/validation/xml/XmlConstraintProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/xml/XmlConstraintProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 XmlConstraintProvider.java >--- src/org/eclipse/emf/validation/xml/XmlConstraintProvider.java 6 Jun 2007 22:27:53 -0000 1.4 >+++ src/org/eclipse/emf/validation/xml/XmlConstraintProvider.java 9 Nov 2007 00:41:14 -0000 >@@ -85,6 +85,7 @@ > * @throws CoreException if the superclass implementation of this > * method throws or on an error in accessing the <code>config</code> > */ >+ @Override > public void setInitializationData( > IConfigurationElement config, > String propertyName, >@@ -95,14 +96,14 @@ > IConfigurationElement[] constraintses = config.getChildren( > XmlConfig.E_CONSTRAINTS); > >- for (int i = 0; i < constraintses.length; i++) { >+ for (IConfigurationElement element : constraintses) { > IConfigurationElement next = >- XmlConfig.parseConstraintsWithIncludes(constraintses[i]); >+ XmlConfig.parseConstraintsWithIncludes(element); > > IConfigurationElement[] configs = next.getChildren(); > >- for (int j = 0; j < configs.length; j++) { >- addConstraint(configs[j]); >+ for (IConfigurationElement element2 : configs) { >+ addConstraint(element2); > } > } > >@@ -115,6 +116,7 @@ > * > * @param config the <TT><constraint></TT> element > */ >+ @SuppressWarnings("deprecation") > private void addConstraint(IConfigurationElement config) { > final String contributorId = config > .getDeclaringExtension() >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/.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 9 Nov 2007 00:41:13 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:44:32 EST 2006 >+#Thu Nov 08 18:54:38 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.validation.ui.ide >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui.ide/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:45 -0000 1.2 >+++ .classpath 9 Nov 2007 00:41:15 -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.validation/plugins/org.eclipse.emf.validation.ui.ide/build.properties,v >retrieving revision 1.6 >diff -u -r1.6 build.properties >--- build.properties 6 Jun 2007 22:27:49 -0000 1.6 >+++ build.properties 9 Nov 2007 00:41:15 -0000 >@@ -21,5 +21,5 @@ > src.includes = plugin.xml,\ > plugin.properties,\ > 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.validation/plugins/org.eclipse.emf.validation.ui.ide/META-INF/MANIFEST.MF,v >retrieving revision 1.8 >diff -u -r1.8 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 May 2007 16:08:55 -0000 1.8 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:15 -0000 >@@ -2,18 +2,18 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.ui.ide; singleton:=true >-Bundle-Version: 1.0.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.validation.ui.ide.internal.ValidationUIIDEPlugin$Implementation > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Export-Package: org.eclipse.emf.validation.ui.ide.internal;x-internal:=true, > org.eclipse.emf.validation.ui.ide.internal.l10n;x-internal:=true, > org.eclipse.emf.validation.ui.ide.quickfix >-Require-Bundle: org.eclipse.emf.validation;bundle-version="[1.0.0,2.0.0)", >- org.eclipse.emf.validation.ui;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, >+Require-Bundle: org.eclipse.emf.validation;bundle-version="[1.2.0,2.0.0)", >+ org.eclipse.emf.validation.ui;bundle-version="[1.2.0,2.0.0)";visibility:=reexport, > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", > org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.resources;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.validation/plugins/org.eclipse.emf.validation.ui.ide/.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:41 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 9 Nov 2007 00:41:15 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:49:40 EST 2006 >+#Thu Nov 08 19:08:49 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/validation/ui/ide/quickfix/ValidationMarkerResolution.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui.ide/src/org/eclipse/emf/validation/ui/ide/quickfix/ValidationMarkerResolution.java,v >retrieving revision 1.2 >diff -u -r1.2 ValidationMarkerResolution.java >--- src/org/eclipse/emf/validation/ui/ide/quickfix/ValidationMarkerResolution.java 6 Jun 2007 22:27:49 -0000 1.2 >+++ src/org/eclipse/emf/validation/ui/ide/quickfix/ValidationMarkerResolution.java 9 Nov 2007 00:41:15 -0000 >@@ -88,10 +88,10 @@ > if (result) { > // see whether this constraint is in any mandatory category > >- for (Iterator iter = constraint.getCategories().iterator(); >+ for (Iterator<Category> iter = constraint.getCategories().iterator(); > result && iter.hasNext();) { > >- result = !((Category) iter.next()).isMandatory(); >+ result = !iter.next().isMandatory(); > } > } > >Index: src/org/eclipse/emf/validation/ui/ide/internal/ValidationUIIDEPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui.ide/src/org/eclipse/emf/validation/ui/ide/internal/ValidationUIIDEPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 ValidationUIIDEPlugin.java >--- src/org/eclipse/emf/validation/ui/ide/internal/ValidationUIIDEPlugin.java 29 Nov 2005 16:52:20 -0000 1.2 >+++ src/org/eclipse/emf/validation/ui/ide/internal/ValidationUIIDEPlugin.java 9 Nov 2007 00:41:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -128,6 +128,7 @@ > super(new ResourceLocator[] {}); > } > >+ @Override > public ResourceLocator getPluginResourceLocator() { > return plugin; > } >@@ -160,7 +161,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. >@@ -185,7 +187,7 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >@@ -302,7 +304,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -341,7 +343,7 @@ > */ > public static void catching( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -374,7 +376,7 @@ > */ > public static void throwing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -404,7 +406,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -429,7 +431,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object parameter) { > >@@ -458,7 +460,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object[] parameters) { > >@@ -485,7 +487,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -510,7 +512,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >#P org.eclipse.emf.validation.examples.ocl >Index: src/org/eclipse/emf/validation/examples/ocl/OCLConstraintProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.ocl/src/org/eclipse/emf/validation/examples/ocl/OCLConstraintProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 OCLConstraintProvider.java >--- src/org/eclipse/emf/validation/examples/ocl/OCLConstraintProvider.java 7 Nov 2007 17:30:16 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/ocl/OCLConstraintProvider.java 9 Nov 2007 00:41:17 -0000 >@@ -30,6 +30,7 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.emf.validation.model.Category; > import org.eclipse.emf.validation.model.CategoryManager; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.AbstractConstraintProvider; > import org.eclipse.emf.validation.service.ConstraintExistsException; > import org.eclipse.ocl.OCLInput; >@@ -136,8 +137,7 @@ > } > > private void addConstraint(Category category, String namespace, OCL ocl, Constraint constraint) { >- @SuppressWarnings("unchecked") >- Collection<OCLConstraint> constraints = getConstraints(); >+ Collection<IModelConstraint> constraints = getConstraints(); > > OCLConstraintDescriptor desc = new OCLConstraintDescriptor( > namespace, constraint, constraints.size() + 1); >Index: src/org/eclipse/emf/validation/examples/ocl/OCLConstraintDescriptor.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.ocl/src/org/eclipse/emf/validation/examples/ocl/OCLConstraintDescriptor.java,v >retrieving revision 1.1 >diff -u -r1.1 OCLConstraintDescriptor.java >--- src/org/eclipse/emf/validation/examples/ocl/OCLConstraintDescriptor.java 7 May 2007 16:12:12 -0000 1.1 >+++ src/org/eclipse/emf/validation/examples/ocl/OCLConstraintDescriptor.java 9 Nov 2007 00:41:17 -0000 >@@ -61,7 +61,7 @@ > return getBody(); > } > >- public EvaluationMode getEvaluationMode() { >+ public EvaluationMode<?> getEvaluationMode() { > return EvaluationMode.BATCH; > } > >@@ -70,7 +70,7 @@ > } > > public String getMessagePattern() { >- return "Constraint " + getName() + " violated on {0}"; >+ return String.format("Constraint %s violated on {0}", getName()); //$NON-NLS-1$ > } > > public String getName() { >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.ocl/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Nov 2007 17:30:16 -0000 1.9 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:16 -0000 >@@ -2,13 +2,13 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.examples.ocl; singleton:=true >-Bundle-Version: 1.1.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.validation.examples.ocl.OCLValidationExamplePlugin > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Export-Package: org.eclipse.emf.validation.examples.ocl > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.emf.validation;bundle-version="[1.0.0,2.0.0)", >+ org.eclipse.emf.validation;bundle-version="[1.2.0,2.0.0)", > org.eclipse.emf.validation.ocl;bundle-version="[1.1.0,2.0.0)", > org.eclipse.ocl.ecore;bundle-version="[1.1.0,2.0.0)" > Eclipse-LazyStart: true >#P org.eclipse.emf.validation.tests >Index: src/ordersystem/impl/OrderSystemFactoryImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/OrderSystemFactoryImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemFactoryImpl.java >--- src/ordersystem/impl/OrderSystemFactoryImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/OrderSystemFactoryImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -19,13 +19,24 @@ > > import java.util.Date; > >-import ordersystem.*; >+import ordersystem.Account; >+import ordersystem.Address; >+import ordersystem.Customer; >+import ordersystem.InventoryItem; >+import ordersystem.LineItem; >+import ordersystem.Order; >+import ordersystem.OrderSystem; >+import ordersystem.OrderSystemFactory; >+import ordersystem.OrderSystemPackage; >+import ordersystem.Product; >+import ordersystem.Warehouse; > > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EDataType; > import org.eclipse.emf.ecore.EObject; >- >+import org.eclipse.emf.ecore.EPackage; > import org.eclipse.emf.ecore.impl.EFactoryImpl; >+import org.eclipse.emf.ecore.plugin.EcorePlugin; > > /** > * <!-- begin-user-doc --> >@@ -35,7 +46,26 @@ > */ > public class OrderSystemFactoryImpl extends EFactoryImpl implements OrderSystemFactory { > /** >- * Creates and instance of the factory. >+ * Creates the default factory implementation. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static OrderSystemFactory init() { >+ try { >+ OrderSystemFactory theOrderSystemFactory = (OrderSystemFactory)EPackage.Registry.INSTANCE.getEFactory("http:///ordersystem.ecore"); //$NON-NLS-1$ >+ if (theOrderSystemFactory != null) { >+ return theOrderSystemFactory; >+ } >+ } >+ catch (Exception exception) { >+ EcorePlugin.INSTANCE.log(exception); >+ } >+ return new OrderSystemFactoryImpl(); >+ } >+ >+ /** >+ * Creates an instance of the factory. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -49,7 +79,8 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EObject create(EClass eClass) { >+ @Override >+ public EObject create(EClass eClass) { > switch (eClass.getClassifierID()) { > case OrderSystemPackage.ORDER: return createOrder(); > case OrderSystemPackage.PRODUCT: return createProduct(); >@@ -70,7 +101,8 @@ > * <!-- end-user-doc --> > * @generated > */ >- public Object createFromString(EDataType eDataType, String initialValue) { >+ @Override >+ public Object createFromString(EDataType eDataType, String initialValue) { > switch (eDataType.getClassifierID()) { > case OrderSystemPackage.JAVA_DATE: > return createJavaDateFromString(eDataType, initialValue); >@@ -84,7 +116,8 @@ > * <!-- end-user-doc --> > * @generated > */ >- public String convertToString(EDataType eDataType, Object instanceValue) { >+ @Override >+ public String convertToString(EDataType eDataType, Object instanceValue) { > switch (eDataType.getClassifierID()) { > case OrderSystemPackage.JAVA_DATE: > return convertJavaDateToString(eDataType, instanceValue); >@@ -222,7 +255,8 @@ > * @deprecated > * @generated > */ >- public static OrderSystemPackage getPackage() { >+ @Deprecated >+ public static OrderSystemPackage getPackage() { > return OrderSystemPackage.eINSTANCE; > } > } //OrderSystemFactoryImpl >Index: src/ordersystem/impl/OrderSystemImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/OrderSystemImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemImpl.java >--- src/ordersystem/impl/OrderSystemImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/OrderSystemImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -27,16 +27,11 @@ > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.common.util.EList; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; > import org.eclipse.emf.ecore.util.InternalEList; > >@@ -85,7 +80,7 @@ > * @generated > * @ordered > */ >- protected EList customer = null; >+ protected EList<Customer> customer; > > /** > * The cached value of the '{@link #getProduct() <em>Product</em>}' containment reference list. >@@ -95,7 +90,7 @@ > * @generated > * @ordered > */ >- protected EList product = null; >+ protected EList<Product> product; > > /** > * The cached value of the '{@link #getWarehouse() <em>Warehouse</em>}' containment reference list. >@@ -105,7 +100,7 @@ > * @generated > * @ordered > */ >- protected EList warehouse = null; >+ protected EList<Warehouse> warehouse; > > /** > * <!-- begin-user-doc --> >@@ -121,8 +116,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getOrderSystem(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.ORDER_SYSTEM; > } > > /** >@@ -151,9 +147,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getCustomer() { >+ public EList<Customer> getCustomer() { > if (customer == null) { >- customer = new EObjectContainmentWithInverseEList(Customer.class, this, OrderSystemPackage.ORDER_SYSTEM__CUSTOMER, OrderSystemPackage.CUSTOMER__OWNER); >+ customer = new EObjectContainmentWithInverseEList<Customer>(Customer.class, this, OrderSystemPackage.ORDER_SYSTEM__CUSTOMER, OrderSystemPackage.CUSTOMER__OWNER); > } > return customer; > } >@@ -163,9 +159,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getProduct() { >+ public EList<Product> getProduct() { > if (product == null) { >- product = new EObjectContainmentWithInverseEList(Product.class, this, OrderSystemPackage.ORDER_SYSTEM__PRODUCT, OrderSystemPackage.PRODUCT__OWNER); >+ product = new EObjectContainmentWithInverseEList<Product>(Product.class, this, OrderSystemPackage.ORDER_SYSTEM__PRODUCT, OrderSystemPackage.PRODUCT__OWNER); > } > return product; > } >@@ -175,64 +171,58 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getWarehouse() { >+ public EList<Warehouse> getWarehouse() { > if (warehouse == null) { >- warehouse = new EObjectContainmentWithInverseEList(Warehouse.class, this, OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE, OrderSystemPackage.WAREHOUSE__OWNER); >+ warehouse = new EObjectContainmentWithInverseEList<Warehouse>(Warehouse.class, this, OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE, OrderSystemPackage.WAREHOUSE__OWNER); > } > return warehouse; > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: >- return ((InternalEList)getCustomer()).basicAdd(otherEnd, msgs); >- case OrderSystemPackage.ORDER_SYSTEM__PRODUCT: >- return ((InternalEList)getProduct()).basicAdd(otherEnd, msgs); >- case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: >- return ((InternalEList)getWarehouse()).basicAdd(otherEnd, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @SuppressWarnings("unchecked") >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getCustomer()).basicAdd(otherEnd, msgs); >+ case OrderSystemPackage.ORDER_SYSTEM__PRODUCT: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getProduct()).basicAdd(otherEnd, msgs); >+ case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getWarehouse()).basicAdd(otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: >- return ((InternalEList)getCustomer()).basicRemove(otherEnd, msgs); >- case OrderSystemPackage.ORDER_SYSTEM__PRODUCT: >- return ((InternalEList)getProduct()).basicRemove(otherEnd, msgs); >- case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: >- return ((InternalEList)getWarehouse()).basicRemove(otherEnd, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: >+ return ((InternalEList<?>)getCustomer()).basicRemove(otherEnd, msgs); >+ case OrderSystemPackage.ORDER_SYSTEM__PRODUCT: >+ return ((InternalEList<?>)getProduct()).basicRemove(otherEnd, msgs); >+ case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: >+ return ((InternalEList<?>)getWarehouse()).basicRemove(otherEnd, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.ORDER_SYSTEM__VERSION: > return new Integer(getVersion()); > case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: >@@ -242,42 +232,45 @@ > case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: > return getWarehouse(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @SuppressWarnings("unchecked") >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.ORDER_SYSTEM__VERSION: > setVersion(((Integer)newValue).intValue()); > return; > case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: > getCustomer().clear(); >- getCustomer().addAll((Collection)newValue); >+ getCustomer().addAll((Collection<? extends Customer>)newValue); > return; > case OrderSystemPackage.ORDER_SYSTEM__PRODUCT: > getProduct().clear(); >- getProduct().addAll((Collection)newValue); >+ getProduct().addAll((Collection<? extends Product>)newValue); > return; > case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: > getWarehouse().clear(); >- getWarehouse().addAll((Collection)newValue); >+ getWarehouse().addAll((Collection<? extends Warehouse>)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ORDER_SYSTEM__VERSION: > setVersion(VERSION_EDEFAULT); > return; >@@ -291,16 +284,17 @@ > getWarehouse().clear(); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ORDER_SYSTEM__VERSION: > return version != VERSION_EDEFAULT; > case OrderSystemPackage.ORDER_SYSTEM__CUSTOMER: >@@ -310,10 +304,10 @@ > case OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE: > return warehouse != null && !warehouse.isEmpty(); > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/WarehouseImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/WarehouseImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 WarehouseImpl.java >--- src/ordersystem/impl/WarehouseImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/WarehouseImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -27,16 +27,11 @@ > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.common.util.EList; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.ecore.util.InternalEList; >@@ -86,7 +81,7 @@ > * @generated > * @ordered > */ >- protected EList item = null; >+ protected EList<InventoryItem> item; > > /** > * The cached value of the '{@link #getLocation() <em>Location</em>}' containment reference. >@@ -96,7 +91,7 @@ > * @generated > * @ordered > */ >- protected Address location = null; >+ protected Address location; > > /** > * <!-- begin-user-doc --> >@@ -112,8 +107,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getWarehouse(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.WAREHOUSE; > } > > /** >@@ -144,7 +140,17 @@ > */ > public OrderSystem getOwner() { > if (eContainerFeatureID != OrderSystemPackage.WAREHOUSE__OWNER) return null; >- return (OrderSystem)eContainer; >+ return (OrderSystem)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetOwner(OrderSystem newOwner, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.WAREHOUSE__OWNER, msgs); >+ return msgs; > } > > /** >@@ -153,15 +159,15 @@ > * @generated > */ > public void setOwner(OrderSystem newOwner) { >- if (newOwner != eContainer || (eContainerFeatureID != OrderSystemPackage.WAREHOUSE__OWNER && newOwner != null)) { >+ if (newOwner != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.WAREHOUSE__OWNER && newOwner != null)) { > if (EcoreUtil.isAncestor(this, newOwner)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newOwner != null) > msgs = ((InternalEObject)newOwner).eInverseAdd(this, OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE, OrderSystem.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.WAREHOUSE__OWNER, msgs); >+ msgs = basicSetOwner(newOwner, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -173,9 +179,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getItem() { >+ public EList<InventoryItem> getItem() { > if (item == null) { >- item = new EObjectContainmentWithInverseEList(InventoryItem.class, this, OrderSystemPackage.WAREHOUSE__ITEM, OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE); >+ item = new EObjectContainmentWithInverseEList<InventoryItem>(InventoryItem.class, this, OrderSystemPackage.WAREHOUSE__ITEM, OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE); > } > return item; > } >@@ -225,72 +231,63 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.WAREHOUSE__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.WAREHOUSE__OWNER, msgs); >- case OrderSystemPackage.WAREHOUSE__ITEM: >- return ((InternalEList)getItem()).basicAdd(otherEnd, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @SuppressWarnings("unchecked") >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.WAREHOUSE__OWNER: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetOwner((OrderSystem)otherEnd, msgs); >+ case OrderSystemPackage.WAREHOUSE__ITEM: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getItem()).basicAdd(otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.WAREHOUSE__OWNER: >- return eBasicSetContainer(null, OrderSystemPackage.WAREHOUSE__OWNER, msgs); >- case OrderSystemPackage.WAREHOUSE__ITEM: >- return ((InternalEList)getItem()).basicRemove(otherEnd, msgs); >- case OrderSystemPackage.WAREHOUSE__LOCATION: >- return basicSetLocation(null, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.WAREHOUSE__OWNER: >+ return basicSetOwner(null, msgs); >+ case OrderSystemPackage.WAREHOUSE__ITEM: >+ return ((InternalEList<?>)getItem()).basicRemove(otherEnd, msgs); >+ case OrderSystemPackage.WAREHOUSE__LOCATION: >+ return basicSetLocation(null, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.WAREHOUSE__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE, OrderSystem.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.WAREHOUSE__OWNER: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__WAREHOUSE, OrderSystem.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.WAREHOUSE__NAME: > return getName(); > case OrderSystemPackage.WAREHOUSE__OWNER: >@@ -300,16 +297,18 @@ > case OrderSystemPackage.WAREHOUSE__LOCATION: > return getLocation(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @SuppressWarnings("unchecked") >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.WAREHOUSE__NAME: > setName((String)newValue); > return; >@@ -318,22 +317,23 @@ > return; > case OrderSystemPackage.WAREHOUSE__ITEM: > getItem().clear(); >- getItem().addAll((Collection)newValue); >+ getItem().addAll((Collection<? extends InventoryItem>)newValue); > return; > case OrderSystemPackage.WAREHOUSE__LOCATION: > setLocation((Address)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.WAREHOUSE__NAME: > setName(NAME_EDEFAULT); > return; >@@ -347,16 +347,17 @@ > setLocation((Address)null); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.WAREHOUSE__NAME: > return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); > case OrderSystemPackage.WAREHOUSE__OWNER: >@@ -366,10 +367,10 @@ > case OrderSystemPackage.WAREHOUSE__LOCATION: > return location != null; > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/OrderSystemPackageImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/OrderSystemPackageImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemPackageImpl.java >--- src/ordersystem/impl/OrderSystemPackageImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/OrderSystemPackageImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -30,9 +30,7 @@ > import ordersystem.OrderSystemPackage; > import ordersystem.Product; > import ordersystem.Warehouse; >- > import ordersystem.special.SpecialPackage; >- > import ordersystem.special.impl.SpecialPackageImpl; > > import org.eclipse.emf.ecore.EAttribute; >@@ -40,7 +38,6 @@ > import org.eclipse.emf.ecore.EDataType; > import org.eclipse.emf.ecore.EPackage; > import org.eclipse.emf.ecore.EReference; >- > import org.eclipse.emf.ecore.impl.EPackageImpl; > > /** >@@ -169,24 +166,27 @@ > * @generated > */ > public static OrderSystemPackage init() { >- if (isInited) return (OrderSystemPackage)EPackage.Registry.INSTANCE.get(OrderSystemPackage.eNS_URI); >+ if (isInited) return (OrderSystemPackage)EPackage.Registry.INSTANCE.getEPackage(OrderSystemPackage.eNS_URI); > >- // Obtain or create and register package. >- OrderSystemPackageImpl theOrderSystemPackage = (OrderSystemPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OrderSystemPackageImpl()); >+ // Obtain or create and register package >+ OrderSystemPackageImpl theOrderSystemPackage = (OrderSystemPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof OrderSystemPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new OrderSystemPackageImpl()); > > isInited = true; > > // Obtain or create and register interdependencies >- SpecialPackageImpl theSpecialPackage = (SpecialPackageImpl)(EPackage.Registry.INSTANCE.get(SpecialPackage.eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(SpecialPackage.eNS_URI) : SpecialPackageImpl.eINSTANCE); >+ SpecialPackageImpl theSpecialPackage = (SpecialPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SpecialPackage.eNS_URI) instanceof SpecialPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SpecialPackage.eNS_URI) : SpecialPackage.eINSTANCE); > >- // Step 1: create meta-model objects >+ // Create package meta-data objects > theOrderSystemPackage.createPackageContents(); > theSpecialPackage.createPackageContents(); > >- // Step 2: complete initialization >+ // Initialize created meta-data > theOrderSystemPackage.initializePackageContents(); > theSpecialPackage.initializePackageContents(); > >+ // Mark meta-data to indicate it can't be changed >+ theOrderSystemPackage.freeze(); >+ > return theOrderSystemPackage; > } > >@@ -794,80 +794,84 @@ > setNsURI(eNS_URI); > > // Obtain other dependent packages >- SpecialPackageImpl theSpecialPackage = (SpecialPackageImpl)EPackage.Registry.INSTANCE.getEPackage(SpecialPackage.eNS_URI); >+ SpecialPackage theSpecialPackage = (SpecialPackage)EPackage.Registry.INSTANCE.getEPackage(SpecialPackage.eNS_URI); > > // Add subpackages > getESubpackages().add(theSpecialPackage); > >+ // Create type parameters >+ >+ // Set bounds for type parameters >+ > // Add supertypes to classes > > // Initialize classes and features; add operations and parameters >- initEClass(orderEClass, Order.class, "Order", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getOrder_PlacedOn(), this.getJavaDate(), "placedOn", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getOrder_FilledOn(), this.getJavaDate(), "filledOn", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getOrder_Completed(), ecorePackage.getEBoolean(), "completed", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getOrder_Id(), ecorePackage.getEString(), "id", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getOrder_Owner(), this.getCustomer(), this.getCustomer_Order(), "owner", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getOrder_Item(), this.getLineItem(), this.getLineItem_Owner(), "item", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(productEClass, Product.class, "Product", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getProduct_Name(), ecorePackage.getEString(), "name", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getProduct_Sku(), ecorePackage.getEString(), "sku", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getProduct_Price(), ecorePackage.getEDouble(), "price", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getProduct_Owner(), this.getOrderSystem(), this.getOrderSystem_Product(), "owner", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(warehouseEClass, Warehouse.class, "Warehouse", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getWarehouse_Name(), ecorePackage.getEString(), "name", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getWarehouse_Owner(), this.getOrderSystem(), this.getOrderSystem_Warehouse(), "owner", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getWarehouse_Item(), this.getInventoryItem(), this.getInventoryItem_Warehouse(), "item", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getWarehouse_Location(), this.getAddress(), null, "location", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(orderSystemEClass, OrderSystem.class, "OrderSystem", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getOrderSystem_Version(), ecorePackage.getEInt(), "version", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getOrderSystem_Customer(), this.getCustomer(), this.getCustomer_Owner(), "customer", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getOrderSystem_Product(), this.getProduct(), this.getProduct_Owner(), "product", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getOrderSystem_Warehouse(), this.getWarehouse(), this.getWarehouse_Owner(), "warehouse", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(lineItemEClass, LineItem.class, "LineItem", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getLineItem_Quantity(), ecorePackage.getEInt(), "quantity", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getLineItem_Discount(), ecorePackage.getEDouble(), "discount", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getLineItem_Owner(), this.getOrder(), this.getOrder_Item(), "owner", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getLineItem_Product(), this.getProduct(), null, "product", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- addEOperation(lineItemEClass, ecorePackage.getEDouble(), "getCost"); //$NON-NLS-1$ >- >- initEClass(inventoryItemEClass, InventoryItem.class, "InventoryItem", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getInventoryItem_InStock(), ecorePackage.getEInt(), "inStock", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getInventoryItem_RestockThreshold(), ecorePackage.getEInt(), "restockThreshold", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getInventoryItem_NextStockDate(), this.getJavaDate(), "nextStockDate", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getInventoryItem_Warehouse(), this.getWarehouse(), this.getWarehouse_Item(), "Warehouse", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getInventoryItem_Product(), this.getProduct(), null, "product", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(customerEClass, Customer.class, "Customer", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getCustomer_LastName(), ecorePackage.getEString(), "lastName", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getCustomer_FirstName(), ecorePackage.getEString(), "firstName", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getCustomer_Owner(), this.getOrderSystem(), this.getOrderSystem_Customer(), "owner", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getCustomer_Account(), this.getAccount(), this.getAccount_Owner(), "account", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getCustomer_Order(), this.getOrder(), this.getOrder_Owner(), "order", null, 0, -1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getAddress_Number(), ecorePackage.getEString(), "number", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAddress_Street(), ecorePackage.getEString(), "street", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAddress_Apartment(), ecorePackage.getEString(), "apartment", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAddress_City(), ecorePackage.getEString(), "city", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAddress_Province(), ecorePackage.getEString(), "province", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAddress_PostalCode(), ecorePackage.getEString(), "postalCode", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAddress_Country(), ecorePackage.getEString(), "country", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- >- initEClass(accountEClass, Account.class, "Account", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getAccount_PaymentMethod(), ecorePackage.getEString(), "paymentMethod", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEAttribute(getAccount_AccountNumber(), ecorePackage.getEString(), "accountNumber", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getAccount_Owner(), this.getCustomer(), this.getCustomer_Account(), "owner", null, 0, 1, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getAccount_BillingAddress(), this.getAddress(), null, "billingAddress", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >- initEReference(getAccount_ShippingAddress(), this.getAddress(), null, "shippingAddress", null, 1, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEClass(orderEClass, Order.class, "Order", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getOrder_PlacedOn(), this.getJavaDate(), "placedOn", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getOrder_FilledOn(), this.getJavaDate(), "filledOn", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getOrder_Completed(), ecorePackage.getEBoolean(), "completed", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getOrder_Id(), ecorePackage.getEString(), "id", null, 0, 1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getOrder_Owner(), this.getCustomer(), this.getCustomer_Order(), "owner", null, 0, 1, Order.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getOrder_Item(), this.getLineItem(), this.getLineItem_Owner(), "item", null, 0, -1, Order.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(productEClass, Product.class, "Product", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getProduct_Name(), ecorePackage.getEString(), "name", null, 0, 1, Product.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getProduct_Sku(), ecorePackage.getEString(), "sku", null, 0, 1, Product.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getProduct_Price(), ecorePackage.getEDouble(), "price", null, 0, 1, Product.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getProduct_Owner(), this.getOrderSystem(), this.getOrderSystem_Product(), "owner", null, 0, 1, Product.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(warehouseEClass, Warehouse.class, "Warehouse", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getWarehouse_Name(), ecorePackage.getEString(), "name", null, 0, 1, Warehouse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getWarehouse_Owner(), this.getOrderSystem(), this.getOrderSystem_Warehouse(), "owner", null, 0, 1, Warehouse.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getWarehouse_Item(), this.getInventoryItem(), this.getInventoryItem_Warehouse(), "item", null, 0, -1, Warehouse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getWarehouse_Location(), this.getAddress(), null, "location", null, 1, 1, Warehouse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(orderSystemEClass, OrderSystem.class, "OrderSystem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getOrderSystem_Version(), ecorePackage.getEInt(), "version", null, 0, 1, OrderSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getOrderSystem_Customer(), this.getCustomer(), this.getCustomer_Owner(), "customer", null, 0, -1, OrderSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getOrderSystem_Product(), this.getProduct(), this.getProduct_Owner(), "product", null, 0, -1, OrderSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getOrderSystem_Warehouse(), this.getWarehouse(), this.getWarehouse_Owner(), "warehouse", null, 0, -1, OrderSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(lineItemEClass, LineItem.class, "LineItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getLineItem_Quantity(), ecorePackage.getEInt(), "quantity", null, 0, 1, LineItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getLineItem_Discount(), ecorePackage.getEDouble(), "discount", null, 0, 1, LineItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getLineItem_Owner(), this.getOrder(), this.getOrder_Item(), "owner", null, 0, 1, LineItem.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getLineItem_Product(), this.getProduct(), null, "product", null, 1, 1, LineItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ addEOperation(lineItemEClass, ecorePackage.getEDouble(), "getCost", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(inventoryItemEClass, InventoryItem.class, "InventoryItem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getInventoryItem_InStock(), ecorePackage.getEInt(), "inStock", null, 0, 1, InventoryItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getInventoryItem_RestockThreshold(), ecorePackage.getEInt(), "restockThreshold", null, 0, 1, InventoryItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getInventoryItem_NextStockDate(), this.getJavaDate(), "nextStockDate", null, 0, 1, InventoryItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getInventoryItem_Warehouse(), this.getWarehouse(), this.getWarehouse_Item(), "Warehouse", null, 0, 1, InventoryItem.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getInventoryItem_Product(), this.getProduct(), null, "product", null, 1, 1, InventoryItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(customerEClass, Customer.class, "Customer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getCustomer_LastName(), ecorePackage.getEString(), "lastName", null, 0, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getCustomer_FirstName(), ecorePackage.getEString(), "firstName", null, 0, 1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getCustomer_Owner(), this.getOrderSystem(), this.getOrderSystem_Customer(), "owner", null, 0, 1, Customer.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getCustomer_Account(), this.getAccount(), this.getAccount_Owner(), "account", null, 0, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getCustomer_Order(), this.getOrder(), this.getOrder_Owner(), "order", null, 0, -1, Customer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getAddress_Number(), ecorePackage.getEString(), "number", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAddress_Street(), ecorePackage.getEString(), "street", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAddress_Apartment(), ecorePackage.getEString(), "apartment", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAddress_City(), ecorePackage.getEString(), "city", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAddress_Province(), ecorePackage.getEString(), "province", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAddress_PostalCode(), ecorePackage.getEString(), "postalCode", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAddress_Country(), ecorePackage.getEString(), "country", null, 0, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ >+ initEClass(accountEClass, Account.class, "Account", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getAccount_PaymentMethod(), ecorePackage.getEString(), "paymentMethod", null, 0, 1, Account.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEAttribute(getAccount_AccountNumber(), ecorePackage.getEString(), "accountNumber", null, 0, 1, Account.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getAccount_Owner(), this.getCustomer(), this.getCustomer_Account(), "owner", null, 0, 1, Account.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getAccount_BillingAddress(), this.getAddress(), null, "billingAddress", null, 1, 1, Account.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEReference(getAccount_ShippingAddress(), this.getAddress(), null, "shippingAddress", null, 1, 1, Account.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ > > // Initialize data types >- initEDataType(javaDateEDataType, Date.class, "JavaDate", IS_SERIALIZABLE); //$NON-NLS-1$ >+ initEDataType(javaDateEDataType, Date.class, "JavaDate", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ > > // Create resource > createResource(eNS_URI); >Index: src/ordersystem/impl/AccountImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/AccountImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 AccountImpl.java >--- src/ordersystem/impl/AccountImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/AccountImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -20,19 +20,14 @@ > import ordersystem.Account; > import ordersystem.Address; > import ordersystem.Customer; >- > import ordersystem.OrderSystemPackage; > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EcoreUtil; > > /** >@@ -101,7 +96,7 @@ > * @generated > * @ordered > */ >- protected Address billingAddress = null; >+ protected Address billingAddress; > > /** > * The cached value of the '{@link #getShippingAddress() <em>Shipping Address</em>}' containment reference. >@@ -111,7 +106,7 @@ > * @generated > * @ordered > */ >- protected Address shippingAddress = null; >+ protected Address shippingAddress; > > /** > * <!-- begin-user-doc --> >@@ -127,8 +122,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getAccount(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.ACCOUNT; > } > > /** >@@ -180,7 +176,17 @@ > */ > public Customer getOwner() { > if (eContainerFeatureID != OrderSystemPackage.ACCOUNT__OWNER) return null; >- return (Customer)eContainer; >+ return (Customer)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetOwner(Customer newOwner, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.ACCOUNT__OWNER, msgs); >+ return msgs; > } > > /** >@@ -189,15 +195,15 @@ > * @generated > */ > public void setOwner(Customer newOwner) { >- if (newOwner != eContainer || (eContainerFeatureID != OrderSystemPackage.ACCOUNT__OWNER && newOwner != null)) { >+ if (newOwner != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.ACCOUNT__OWNER && newOwner != null)) { > if (EcoreUtil.isAncestor(this, newOwner)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newOwner != null) > msgs = ((InternalEObject)newOwner).eInverseAdd(this, OrderSystemPackage.CUSTOMER__ACCOUNT, Customer.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.ACCOUNT__OWNER, msgs); >+ msgs = basicSetOwner(newOwner, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -292,70 +298,60 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.ACCOUNT__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.ACCOUNT__OWNER, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.ACCOUNT__OWNER: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetOwner((Customer)otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.ACCOUNT__OWNER: >- return eBasicSetContainer(null, OrderSystemPackage.ACCOUNT__OWNER, msgs); >- case OrderSystemPackage.ACCOUNT__BILLING_ADDRESS: >- return basicSetBillingAddress(null, msgs); >- case OrderSystemPackage.ACCOUNT__SHIPPING_ADDRESS: >- return basicSetShippingAddress(null, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.ACCOUNT__OWNER: >+ return basicSetOwner(null, msgs); >+ case OrderSystemPackage.ACCOUNT__BILLING_ADDRESS: >+ return basicSetBillingAddress(null, msgs); >+ case OrderSystemPackage.ACCOUNT__SHIPPING_ADDRESS: >+ return basicSetShippingAddress(null, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.ACCOUNT__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.CUSTOMER__ACCOUNT, Customer.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.ACCOUNT__OWNER: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.CUSTOMER__ACCOUNT, Customer.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.ACCOUNT__PAYMENT_METHOD: > return getPaymentMethod(); > case OrderSystemPackage.ACCOUNT__ACCOUNT_NUMBER: >@@ -367,16 +363,17 @@ > case OrderSystemPackage.ACCOUNT__SHIPPING_ADDRESS: > return getShippingAddress(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.ACCOUNT__PAYMENT_METHOD: > setPaymentMethod((String)newValue); > return; >@@ -393,16 +390,17 @@ > setShippingAddress((Address)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ACCOUNT__PAYMENT_METHOD: > setPaymentMethod(PAYMENT_METHOD_EDEFAULT); > return; >@@ -419,16 +417,17 @@ > setShippingAddress((Address)null); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ACCOUNT__PAYMENT_METHOD: > return PAYMENT_METHOD_EDEFAULT == null ? paymentMethod != null : !PAYMENT_METHOD_EDEFAULT.equals(paymentMethod); > case OrderSystemPackage.ACCOUNT__ACCOUNT_NUMBER: >@@ -440,10 +439,10 @@ > case OrderSystemPackage.ACCOUNT__SHIPPING_ADDRESS: > return shippingAddress != null; > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/InventoryItemImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/InventoryItemImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 InventoryItemImpl.java >--- src/ordersystem/impl/InventoryItemImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/InventoryItemImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -26,14 +26,10 @@ > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EcoreUtil; > > /** >@@ -122,7 +118,7 @@ > * @generated > * @ordered > */ >- protected Product product = null; >+ protected Product product; > > /** > * <!-- begin-user-doc --> >@@ -138,8 +134,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getInventoryItem(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.INVENTORY_ITEM; > } > > /** >@@ -212,7 +209,17 @@ > */ > public Warehouse getWarehouse() { > if (eContainerFeatureID != OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE) return null; >- return (Warehouse)eContainer; >+ return (Warehouse)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetWarehouse(Warehouse newWarehouse, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newWarehouse, OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE, msgs); >+ return msgs; > } > > /** >@@ -221,15 +228,15 @@ > * @generated > */ > public void setWarehouse(Warehouse newWarehouse) { >- if (newWarehouse != eContainer || (eContainerFeatureID != OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE && newWarehouse != null)) { >+ if (newWarehouse != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE && newWarehouse != null)) { > if (EcoreUtil.isAncestor(this, newWarehouse)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newWarehouse != null) > msgs = ((InternalEObject)newWarehouse).eInverseAdd(this, OrderSystemPackage.WAREHOUSE__ITEM, Warehouse.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newWarehouse, OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE, msgs); >+ msgs = basicSetWarehouse(newWarehouse, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -243,8 +250,8 @@ > */ > public Product getProduct() { > if (product != null && product.eIsProxy()) { >- Product oldProduct = product; >- product = (Product)eResolveProxy((InternalEObject)product); >+ InternalEObject oldProduct = (InternalEObject)product; >+ product = (Product)eResolveProxy(oldProduct); > if (product != oldProduct) { > if (eNotificationRequired()) > eNotify(new ENotificationImpl(this, Notification.RESOLVE, OrderSystemPackage.INVENTORY_ITEM__PRODUCT, oldProduct, product)); >@@ -276,66 +283,56 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetWarehouse((Warehouse)otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE: >- return eBasicSetContainer(null, OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE: >+ return basicSetWarehouse(null, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.WAREHOUSE__ITEM, Warehouse.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.INVENTORY_ITEM__WAREHOUSE: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.WAREHOUSE__ITEM, Warehouse.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.INVENTORY_ITEM__IN_STOCK: > return new Integer(getInStock()); > case OrderSystemPackage.INVENTORY_ITEM__RESTOCK_THRESHOLD: >@@ -348,16 +345,17 @@ > if (resolve) return getProduct(); > return basicGetProduct(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.INVENTORY_ITEM__IN_STOCK: > setInStock(((Integer)newValue).intValue()); > return; >@@ -374,16 +372,17 @@ > setProduct((Product)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.INVENTORY_ITEM__IN_STOCK: > setInStock(IN_STOCK_EDEFAULT); > return; >@@ -400,16 +399,17 @@ > setProduct((Product)null); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.INVENTORY_ITEM__IN_STOCK: > return inStock != IN_STOCK_EDEFAULT; > case OrderSystemPackage.INVENTORY_ITEM__RESTOCK_THRESHOLD: >@@ -421,10 +421,10 @@ > case OrderSystemPackage.INVENTORY_ITEM__PRODUCT: > return product != null; > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/AddressImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/AddressImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 AddressImpl.java >--- src/ordersystem/impl/AddressImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/AddressImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,14 +18,10 @@ > package ordersystem.impl; > > import ordersystem.Address; >- > import ordersystem.OrderSystemPackage; > > import org.eclipse.emf.common.notify.Notification; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; > >@@ -203,8 +199,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getAddress(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.ADDRESS; > } > > /** >@@ -356,11 +353,12 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.ADDRESS__NUMBER: > return getNumber(); > case OrderSystemPackage.ADDRESS__STREET: >@@ -376,16 +374,17 @@ > case OrderSystemPackage.ADDRESS__COUNTRY: > return getCountry(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.ADDRESS__NUMBER: > setNumber((String)newValue); > return; >@@ -408,16 +407,17 @@ > setCountry((String)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ADDRESS__NUMBER: > setNumber(NUMBER_EDEFAULT); > return; >@@ -440,16 +440,17 @@ > setCountry(COUNTRY_EDEFAULT); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ADDRESS__NUMBER: > return NUMBER_EDEFAULT == null ? number != null : !NUMBER_EDEFAULT.equals(number); > case OrderSystemPackage.ADDRESS__STREET: >@@ -465,10 +466,10 @@ > case OrderSystemPackage.ADDRESS__COUNTRY: > return COUNTRY_EDEFAULT == null ? country != null : !COUNTRY_EDEFAULT.equals(country); > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/LineItemImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/LineItemImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 LineItemImpl.java >--- src/ordersystem/impl/LineItemImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/LineItemImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -24,14 +24,10 @@ > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EcoreUtil; > > /** >@@ -99,7 +95,7 @@ > * @generated > * @ordered > */ >- protected Product product = null; >+ protected Product product; > > /** > * <!-- begin-user-doc --> >@@ -115,8 +111,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getLineItem(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.LINE_ITEM; > } > > /** >@@ -168,7 +165,17 @@ > */ > public Order getOwner() { > if (eContainerFeatureID != OrderSystemPackage.LINE_ITEM__OWNER) return null; >- return (Order)eContainer; >+ return (Order)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetOwner(Order newOwner, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.LINE_ITEM__OWNER, msgs); >+ return msgs; > } > > /** >@@ -177,15 +184,15 @@ > * @generated > */ > public void setOwner(Order newOwner) { >- if (newOwner != eContainer || (eContainerFeatureID != OrderSystemPackage.LINE_ITEM__OWNER && newOwner != null)) { >+ if (newOwner != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.LINE_ITEM__OWNER && newOwner != null)) { > if (EcoreUtil.isAncestor(this, newOwner)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newOwner != null) > msgs = ((InternalEObject)newOwner).eInverseAdd(this, OrderSystemPackage.ORDER__ITEM, Order.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.LINE_ITEM__OWNER, msgs); >+ msgs = basicSetOwner(newOwner, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -199,8 +206,8 @@ > */ > public Product getProduct() { > if (product != null && product.eIsProxy()) { >- Product oldProduct = product; >- product = (Product)eResolveProxy((InternalEObject)product); >+ InternalEObject oldProduct = (InternalEObject)product; >+ product = (Product)eResolveProxy(oldProduct); > if (product != oldProduct) { > if (eNotificationRequired()) > eNotify(new ENotificationImpl(this, Notification.RESOLVE, OrderSystemPackage.LINE_ITEM__PRODUCT, oldProduct, product)); >@@ -244,66 +251,56 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.LINE_ITEM__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.LINE_ITEM__OWNER, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.LINE_ITEM__OWNER: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetOwner((Order)otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > >- /** >+ /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.LINE_ITEM__OWNER: >- return eBasicSetContainer(null, OrderSystemPackage.LINE_ITEM__OWNER, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.LINE_ITEM__OWNER: >+ return basicSetOwner(null, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > >- /** >+ /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.LINE_ITEM__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.ORDER__ITEM, Order.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.LINE_ITEM__OWNER: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.ORDER__ITEM, Order.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > >- /** >+ /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.LINE_ITEM__QUANTITY: > return new Integer(getQuantity()); > case OrderSystemPackage.LINE_ITEM__DISCOUNT: >@@ -314,16 +311,17 @@ > if (resolve) return getProduct(); > return basicGetProduct(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > >- /** >+ /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.LINE_ITEM__QUANTITY: > setQuantity(((Integer)newValue).intValue()); > return; >@@ -337,16 +335,17 @@ > setProduct((Product)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > >- /** >+ /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.LINE_ITEM__QUANTITY: > setQuantity(QUANTITY_EDEFAULT); > return; >@@ -360,16 +359,17 @@ > setProduct((Product)null); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.LINE_ITEM__QUANTITY: > return quantity != QUANTITY_EDEFAULT; > case OrderSystemPackage.LINE_ITEM__DISCOUNT: >@@ -379,10 +379,10 @@ > case OrderSystemPackage.LINE_ITEM__PRODUCT: > return product != null; > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/CustomerImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/CustomerImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 CustomerImpl.java >--- src/ordersystem/impl/CustomerImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/CustomerImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -23,21 +23,15 @@ > import ordersystem.Customer; > import ordersystem.Order; > import ordersystem.OrderSystem; >- > import ordersystem.OrderSystemPackage; > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.common.util.EList; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.ecore.util.InternalEList; >@@ -108,7 +102,7 @@ > * @generated > * @ordered > */ >- protected EList account = null; >+ protected EList<Account> account; > > /** > * The cached value of the '{@link #getOrder() <em>Order</em>}' containment reference list. >@@ -118,7 +112,7 @@ > * @generated > * @ordered > */ >- protected EList order = null; >+ protected EList<Order> order; > > /** > * <!-- begin-user-doc --> >@@ -134,8 +128,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getCustomer(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.CUSTOMER; > } > > /** >@@ -187,7 +182,17 @@ > */ > public OrderSystem getOwner() { > if (eContainerFeatureID != OrderSystemPackage.CUSTOMER__OWNER) return null; >- return (OrderSystem)eContainer; >+ return (OrderSystem)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetOwner(OrderSystem newOwner, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.CUSTOMER__OWNER, msgs); >+ return msgs; > } > > /** >@@ -196,15 +201,15 @@ > * @generated > */ > public void setOwner(OrderSystem newOwner) { >- if (newOwner != eContainer || (eContainerFeatureID != OrderSystemPackage.CUSTOMER__OWNER && newOwner != null)) { >+ if (newOwner != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.CUSTOMER__OWNER && newOwner != null)) { > if (EcoreUtil.isAncestor(this, newOwner)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newOwner != null) > msgs = ((InternalEObject)newOwner).eInverseAdd(this, OrderSystemPackage.ORDER_SYSTEM__CUSTOMER, OrderSystem.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.CUSTOMER__OWNER, msgs); >+ msgs = basicSetOwner(newOwner, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -216,9 +221,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getAccount() { >+ public EList<Account> getAccount() { > if (account == null) { >- account = new EObjectContainmentWithInverseEList(Account.class, this, OrderSystemPackage.CUSTOMER__ACCOUNT, OrderSystemPackage.ACCOUNT__OWNER); >+ account = new EObjectContainmentWithInverseEList<Account>(Account.class, this, OrderSystemPackage.CUSTOMER__ACCOUNT, OrderSystemPackage.ACCOUNT__OWNER); > } > return account; > } >@@ -228,83 +233,74 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getOrder() { >+ public EList<Order> getOrder() { > if (order == null) { >- order = new EObjectContainmentWithInverseEList(Order.class, this, OrderSystemPackage.CUSTOMER__ORDER, OrderSystemPackage.ORDER__OWNER); >+ order = new EObjectContainmentWithInverseEList<Order>(Order.class, this, OrderSystemPackage.CUSTOMER__ORDER, OrderSystemPackage.ORDER__OWNER); > } > return order; > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.CUSTOMER__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.CUSTOMER__OWNER, msgs); >- case OrderSystemPackage.CUSTOMER__ACCOUNT: >- return ((InternalEList)getAccount()).basicAdd(otherEnd, msgs); >- case OrderSystemPackage.CUSTOMER__ORDER: >- return ((InternalEList)getOrder()).basicAdd(otherEnd, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @SuppressWarnings("unchecked") >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.CUSTOMER__OWNER: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetOwner((OrderSystem)otherEnd, msgs); >+ case OrderSystemPackage.CUSTOMER__ACCOUNT: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getAccount()).basicAdd(otherEnd, msgs); >+ case OrderSystemPackage.CUSTOMER__ORDER: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getOrder()).basicAdd(otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.CUSTOMER__OWNER: >- return eBasicSetContainer(null, OrderSystemPackage.CUSTOMER__OWNER, msgs); >- case OrderSystemPackage.CUSTOMER__ACCOUNT: >- return ((InternalEList)getAccount()).basicRemove(otherEnd, msgs); >- case OrderSystemPackage.CUSTOMER__ORDER: >- return ((InternalEList)getOrder()).basicRemove(otherEnd, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.CUSTOMER__OWNER: >+ return basicSetOwner(null, msgs); >+ case OrderSystemPackage.CUSTOMER__ACCOUNT: >+ return ((InternalEList<?>)getAccount()).basicRemove(otherEnd, msgs); >+ case OrderSystemPackage.CUSTOMER__ORDER: >+ return ((InternalEList<?>)getOrder()).basicRemove(otherEnd, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.CUSTOMER__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__CUSTOMER, OrderSystem.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.CUSTOMER__OWNER: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__CUSTOMER, OrderSystem.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.CUSTOMER__LAST_NAME: > return getLastName(); > case OrderSystemPackage.CUSTOMER__FIRST_NAME: >@@ -316,16 +312,18 @@ > case OrderSystemPackage.CUSTOMER__ORDER: > return getOrder(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @SuppressWarnings("unchecked") >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.CUSTOMER__LAST_NAME: > setLastName((String)newValue); > return; >@@ -337,23 +335,24 @@ > return; > case OrderSystemPackage.CUSTOMER__ACCOUNT: > getAccount().clear(); >- getAccount().addAll((Collection)newValue); >+ getAccount().addAll((Collection<? extends Account>)newValue); > return; > case OrderSystemPackage.CUSTOMER__ORDER: > getOrder().clear(); >- getOrder().addAll((Collection)newValue); >+ getOrder().addAll((Collection<? extends Order>)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.CUSTOMER__LAST_NAME: > setLastName(LAST_NAME_EDEFAULT); > return; >@@ -370,16 +369,17 @@ > getOrder().clear(); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.CUSTOMER__LAST_NAME: > return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName); > case OrderSystemPackage.CUSTOMER__FIRST_NAME: >@@ -391,10 +391,10 @@ > case OrderSystemPackage.CUSTOMER__ORDER: > return order != null && !order.isEmpty(); > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/ProductImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/ProductImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 ProductImpl.java >--- src/ordersystem/impl/ProductImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/ProductImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -23,14 +23,10 @@ > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EcoreUtil; > > /** >@@ -124,8 +120,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getProduct(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.PRODUCT; > } > > /** >@@ -198,7 +195,17 @@ > */ > public OrderSystem getOwner() { > if (eContainerFeatureID != OrderSystemPackage.PRODUCT__OWNER) return null; >- return (OrderSystem)eContainer; >+ return (OrderSystem)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetOwner(OrderSystem newOwner, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.PRODUCT__OWNER, msgs); >+ return msgs; > } > > /** >@@ -207,15 +214,15 @@ > * @generated > */ > public void setOwner(OrderSystem newOwner) { >- if (newOwner != eContainer || (eContainerFeatureID != OrderSystemPackage.PRODUCT__OWNER && newOwner != null)) { >+ if (newOwner != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.PRODUCT__OWNER && newOwner != null)) { > if (EcoreUtil.isAncestor(this, newOwner)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newOwner != null) > msgs = ((InternalEObject)newOwner).eInverseAdd(this, OrderSystemPackage.ORDER_SYSTEM__PRODUCT, OrderSystem.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.PRODUCT__OWNER, msgs); >+ msgs = basicSetOwner(newOwner, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -224,66 +231,56 @@ > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.PRODUCT__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.PRODUCT__OWNER, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.PRODUCT__OWNER: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetOwner((OrderSystem)otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.PRODUCT__OWNER: >- return eBasicSetContainer(null, OrderSystemPackage.PRODUCT__OWNER, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.PRODUCT__OWNER: >+ return basicSetOwner(null, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.PRODUCT__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__PRODUCT, OrderSystem.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.PRODUCT__OWNER: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__PRODUCT, OrderSystem.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.PRODUCT__NAME: > return getName(); > case OrderSystemPackage.PRODUCT__SKU: >@@ -293,16 +290,17 @@ > case OrderSystemPackage.PRODUCT__OWNER: > return getOwner(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.PRODUCT__NAME: > setName((String)newValue); > return; >@@ -316,16 +314,17 @@ > setOwner((OrderSystem)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.PRODUCT__NAME: > setName(NAME_EDEFAULT); > return; >@@ -339,16 +338,17 @@ > setOwner((OrderSystem)null); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.PRODUCT__NAME: > return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); > case OrderSystemPackage.PRODUCT__SKU: >@@ -358,10 +358,10 @@ > case OrderSystemPackage.PRODUCT__OWNER: > return getOwner() != null; > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/ordersystem/impl/OrderImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/impl/OrderImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderImpl.java >--- src/ordersystem/impl/OrderImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/impl/OrderImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -23,21 +23,15 @@ > import ordersystem.Customer; > import ordersystem.LineItem; > import ordersystem.Order; >- > import ordersystem.OrderSystemPackage; > > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.common.util.EList; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > import org.eclipse.emf.ecore.impl.EObjectImpl; >- > import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.ecore.util.InternalEList; >@@ -149,7 +143,7 @@ > * @generated > * @ordered > */ >- protected EList item = null; >+ protected EList<LineItem> item; > > /** > * <!-- begin-user-doc --> >@@ -165,8 +159,9 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected EClass eStaticClass() { >- return OrderSystemPackage.eINSTANCE.getOrder(); >+ @Override >+ protected EClass eStaticClass() { >+ return OrderSystemPackage.Literals.ORDER; > } > > /** >@@ -260,7 +255,17 @@ > */ > public Customer getOwner() { > if (eContainerFeatureID != OrderSystemPackage.ORDER__OWNER) return null; >- return (Customer)eContainer; >+ return (Customer)eContainer(); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public NotificationChain basicSetOwner(Customer newOwner, NotificationChain msgs) { >+ msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.ORDER__OWNER, msgs); >+ return msgs; > } > > /** >@@ -269,15 +274,15 @@ > * @generated > */ > public void setOwner(Customer newOwner) { >- if (newOwner != eContainer || (eContainerFeatureID != OrderSystemPackage.ORDER__OWNER && newOwner != null)) { >+ if (newOwner != eInternalContainer() || (eContainerFeatureID != OrderSystemPackage.ORDER__OWNER && newOwner != null)) { > if (EcoreUtil.isAncestor(this, newOwner)) > throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ > NotificationChain msgs = null; >- if (eContainer != null) >+ if (eInternalContainer() != null) > msgs = eBasicRemoveFromContainer(msgs); > if (newOwner != null) > msgs = ((InternalEObject)newOwner).eInverseAdd(this, OrderSystemPackage.CUSTOMER__ORDER, Customer.class, msgs); >- msgs = eBasicSetContainer((InternalEObject)newOwner, OrderSystemPackage.ORDER__OWNER, msgs); >+ msgs = basicSetOwner(newOwner, msgs); > if (msgs != null) msgs.dispatch(); > } > else if (eNotificationRequired()) >@@ -289,79 +294,70 @@ > * <!-- end-user-doc --> > * @generated > */ >- public EList getItem() { >+ public EList<LineItem> getItem() { > if (item == null) { >- item = new EObjectContainmentWithInverseEList(LineItem.class, this, OrderSystemPackage.ORDER__ITEM, OrderSystemPackage.LINE_ITEM__OWNER); >+ item = new EObjectContainmentWithInverseEList<LineItem>(LineItem.class, this, OrderSystemPackage.ORDER__ITEM, OrderSystemPackage.LINE_ITEM__OWNER); > } > return item; > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.ORDER__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, OrderSystemPackage.ORDER__OWNER, msgs); >- case OrderSystemPackage.ORDER__ITEM: >- return ((InternalEList)getItem()).basicAdd(otherEnd, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >+ @SuppressWarnings("unchecked") >+ @Override >+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.ORDER__OWNER: >+ if (eInternalContainer() != null) >+ msgs = eBasicRemoveFromContainer(msgs); >+ return basicSetOwner((Customer)otherEnd, msgs); >+ case OrderSystemPackage.ORDER__ITEM: >+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getItem()).basicAdd(otherEnd, msgs); > } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >+ return super.eInverseAdd(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case OrderSystemPackage.ORDER__OWNER: >- return eBasicSetContainer(null, OrderSystemPackage.ORDER__OWNER, msgs); >- case OrderSystemPackage.ORDER__ITEM: >- return ((InternalEList)getItem()).basicRemove(otherEnd, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >+ @Override >+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { >+ switch (featureID) { >+ case OrderSystemPackage.ORDER__OWNER: >+ return basicSetOwner(null, msgs); >+ case OrderSystemPackage.ORDER__ITEM: >+ return ((InternalEList<?>)getItem()).basicRemove(otherEnd, msgs); > } >- return eBasicSetContainer(null, featureID, msgs); >+ return super.eInverseRemove(otherEnd, featureID, msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case OrderSystemPackage.ORDER__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.CUSTOMER__ORDER, Customer.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >+ @Override >+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { >+ switch (eContainerFeatureID) { >+ case OrderSystemPackage.ORDER__OWNER: >+ return eInternalContainer().eInverseRemove(this, OrderSystemPackage.CUSTOMER__ORDER, Customer.class, msgs); > } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >+ return super.eBasicRemoveFromContainerFeature(msgs); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case OrderSystemPackage.ORDER__PLACED_ON: > return getPlacedOn(); > case OrderSystemPackage.ORDER__FILLED_ON: >@@ -375,16 +371,18 @@ > case OrderSystemPackage.ORDER__ITEM: > return getItem(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @SuppressWarnings("unchecked") >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case OrderSystemPackage.ORDER__PLACED_ON: > setPlacedOn((Date)newValue); > return; >@@ -402,19 +400,20 @@ > return; > case OrderSystemPackage.ORDER__ITEM: > getItem().clear(); >- getItem().addAll((Collection)newValue); >+ getItem().addAll((Collection<? extends LineItem>)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ORDER__PLACED_ON: > setPlacedOn(PLACED_ON_EDEFAULT); > return; >@@ -434,16 +433,17 @@ > getItem().clear(); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** > * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >+ * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case OrderSystemPackage.ORDER__PLACED_ON: > return PLACED_ON_EDEFAULT == null ? placedOn != null : !PLACED_ON_EDEFAULT.equals(placedOn); > case OrderSystemPackage.ORDER__FILLED_ON: >@@ -457,10 +457,10 @@ > case OrderSystemPackage.ORDER__ITEM: > return item != null && !item.isEmpty(); > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > >- /** >+ /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > */ >Index: src/org/eclipse/emf/validation/tests/SetTargetConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/SetTargetConstraint.java,v >retrieving revision 1.1 >diff -u -r1.1 SetTargetConstraint.java >--- src/org/eclipse/emf/validation/tests/SetTargetConstraint.java 21 Mar 2007 18:50:52 -0000 1.1 >+++ src/org/eclipse/emf/validation/tests/SetTargetConstraint.java 9 Nov 2007 00:41:18 -0000 >@@ -39,6 +39,7 @@ > public static boolean enabled = false; > > // Documentation copied from the inherited specification >+ @Override > public IStatus validate(IValidationContext ctx) { > if (!enabled) { > return ctx.createSuccessStatus(); >@@ -63,7 +64,7 @@ > null); > } > >- Collection statuses = new java.util.ArrayList(); >+ Collection<IStatus> statuses = new java.util.ArrayList<IStatus>(); > > statuses.add(ConstraintStatus.createStatus( > ctx, >Index: src/org/eclipse/emf/validation/tests/LogCapture.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/LogCapture.java,v >retrieving revision 1.1 >diff -u -r1.1 LogCapture.java >--- src/org/eclipse/emf/validation/tests/LogCapture.java 31 Oct 2007 19:59:48 -0000 1.1 >+++ src/org/eclipse/emf/validation/tests/LogCapture.java 9 Nov 2007 00:41:18 -0000 >@@ -16,7 +16,6 @@ > */ > package org.eclipse.emf.validation.tests; > >-import java.util.Iterator; > import java.util.List; > > import junit.framework.TestCase; >@@ -41,7 +40,7 @@ > } > }}; > >- private final List logs = new java.util.ArrayList(); >+ private final List<IStatus> logs = new java.util.ArrayList<IStatus>(); > private IStatus lastLog; > > /** >@@ -83,7 +82,7 @@ > * > * @return a list (possibly empty) of {@link IStatus}es > */ >- public List getLogs() { >+ public List<IStatus> getLogs() { > return logs; > } > >@@ -95,12 +94,10 @@ > * > * @return the matching log entries > */ >- public List getLogs(int statusCode) { >- List result = new java.util.ArrayList(); >+ public List<IStatus> getLogs(int statusCode) { >+ List<IStatus> result = new java.util.ArrayList<IStatus>(); > >- for (Iterator iter = logs.iterator(); iter.hasNext();) { >- IStatus next = (IStatus) iter.next(); >- >+ for (IStatus next : logs) { > if (next.getCode() == statusCode) { > result.add(next); > } >Index: src/org/eclipse/emf/validation/tests/AllTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/AllTests.java,v >retrieving revision 1.5 >diff -u -r1.5 AllTests.java >--- src/org/eclipse/emf/validation/tests/AllTests.java 19 Sep 2007 16:13:44 -0000 1.5 >+++ src/org/eclipse/emf/validation/tests/AllTests.java 9 Nov 2007 00:41:18 -0000 >@@ -44,7 +44,7 @@ > static { > // register the .ordersystem extension for loading the example XMI file > Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; >- Map m = reg.getExtensionToFactoryMap(); >+ Map<String, Object> m = reg.getExtensionToFactoryMap(); > m.put("ordersystem", new XMIResourceFactoryImpl()); //$NON-NLS-1$ > } > >@@ -80,6 +80,7 @@ > // this method is called if and only if unit tests are being executed > TestSuite suite = new TestSuite( > "Test for org.eclipse.emf.validation plug-in") { //$NON-NLS-1$ >+ @Override > public void run(TestResult result) { > // ensure that the tests know that they are running > executingUnitTests = true; >Index: src/org/eclipse/emf/validation/tests/FrameworkTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/FrameworkTest.java,v >retrieving revision 1.6 >diff -u -r1.6 FrameworkTest.java >--- src/org/eclipse/emf/validation/tests/FrameworkTest.java 10 Oct 2006 14:31:05 -0000 1.6 >+++ src/org/eclipse/emf/validation/tests/FrameworkTest.java 9 Nov 2007 00:41:18 -0000 >@@ -18,11 +18,8 @@ > package org.eclipse.emf.validation.tests; > > import java.io.IOException; >-import java.util.Arrays; > import java.util.Collection; > import java.util.Collections; >-import java.util.Iterator; >- > import ordersystem.OrderSystem; > import ordersystem.OrderSystemFactory; > import ordersystem.special.SpecialFactory; >@@ -68,6 +65,7 @@ > * Load the static example Order System model (<tt>test.ordersystem</tt>) > * on the first invocation of this method. > */ >+ @Override > protected void setUp() throws Exception { > if (orderSystem == null) { > ResourceSet resourceSet = new org.eclipse.emf.ecore.resource.impl.ResourceSetImpl(); >@@ -138,8 +136,8 @@ > > IStatus[] status = getStatuses(batchValidator.validate(object)); > >- for (int i=0; i<status.length; i++) { >- IModelConstraint constraint = ((IConstraintStatus)status[i]).getConstraint(); >+ for (IStatus element : status) { >+ IModelConstraint constraint = ((IConstraintStatus)element).getConstraint(); > > if (constraint.getDescriptor().getId().equals(ID_PREFIX + "ordersystem.marker")) { //$NON-NLS-1$ > return; >@@ -163,10 +161,8 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasContents", //$NON-NLS-1$ >- ID_PREFIX + "order.notFilledBeforePlacement", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasContents", //$NON-NLS-1$ >+ ID_PREFIX + "order.notFilledBeforePlacement"); //$NON-NLS-1$ > } > > /** >@@ -185,10 +181,8 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasName", //$NON-NLS-1$ >- ID_PREFIX + "order.hasOwner", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasName", //$NON-NLS-1$ >+ ID_PREFIX + "order.hasOwner"); //$NON-NLS-1$ > } > > /** >@@ -204,10 +198,11 @@ > IStatus[] status = getStatuses(liveValidator.validate( > Collections.nCopies(5, event))); > >- Collection evaluatedConstraints = new java.util.HashSet(); >+ Collection<IModelConstraint> evaluatedConstraints = >+ new java.util.HashSet<IModelConstraint>(); > >- for (int i = 0; i < status.length; i++) { >- IConstraintStatus next = (IConstraintStatus)status[i]; >+ for (IStatus element : status) { >+ IConstraintStatus next = (IConstraintStatus)element; > > evaluatedConstraints.add(next.getConstraint()); > } >@@ -292,9 +287,7 @@ > assertAllConstraintsNotPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "bad.constraint.xml", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "bad.constraint.xml"); //$NON-NLS-1$ > } > > /** >@@ -308,16 +301,14 @@ > > IStatus[] status = getStatuses(batchValidator.validate(object)); > >- Collection ids = Arrays.asList(new String[] { >+ String[] ids = new String[] { > ID_PREFIX + "bad.constraint.disabled.java", //$NON-NLS-1$ > ID_PREFIX + "bad.constraint.disabled.ocl", //$NON-NLS-1$ > ID_PREFIX + "bad.constraint.disabled.bsh", //$NON-NLS-1$ > ID_PREFIX + "bad.constraint.disabled.runtime", //$NON-NLS-1$ >- }); >+ }; > >- for (Iterator iter = ids.iterator(); iter.hasNext();) { >- String id = (String)iter.next(); >- >+ for (String id : ids) { > IStatus nextStatus = getStatus(status, id); > if (nextStatus != null) { > assertTrue(nextStatus.matches(IStatus.INFO)); >@@ -359,8 +350,8 @@ > > IStatus[] status = getStatuses(batchValidator.validate(object)); > >- for (int i=0; i<status.length; i++) { >- IModelConstraint constraint = ((IConstraintStatus)status[i]).getConstraint(); >+ for (IStatus element : status) { >+ IModelConstraint constraint = ((IConstraintStatus)element).getConstraint(); > assertFalse("Got constraints from ordersystem namespace prefix provider.", constraint.getDescriptor().getId().startsWith(ID_PREFIX + "ordersystem")); //$NON-NLS-1$ //$NON-NLS-2$ > } > >@@ -387,16 +378,12 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.batch1", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.batch1"); //$NON-NLS-1$ > > assertAllConstraintsNotPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.batch2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.batch2"); //$NON-NLS-1$ > > // also check that the provider filter correctly excludes the > // Order type (the constraint otherwise would apply to all types, >@@ -409,9 +396,7 @@ > assertAllConstraintsNotPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.batch1", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.batch1"); //$NON-NLS-1$ > } > > /** >@@ -434,16 +419,12 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.live2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.live2"); //$NON-NLS-1$ > > assertAllConstraintsNotPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.live1", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.live1"); //$NON-NLS-1$ > > // also check that the provider filter correctly excludes the > // Order type (the constraint otherwise would apply to all types, >@@ -457,9 +438,7 @@ > assertAllConstraintsNotPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.live2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.live2"); //$NON-NLS-1$ > > // finally, check that the provider filter correctly excludes an > // event type that is not "Set" >@@ -472,9 +451,7 @@ > assertAllConstraintsNotPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "providertarget.live2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "providertarget.live2"); //$NON-NLS-1$ > } > > /** >@@ -490,9 +467,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "multipackage.test", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "multipackage.test"); //$NON-NLS-1$ > } > > /** >@@ -509,9 +484,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "inheritance.test", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "inheritance.test"); //$NON-NLS-1$ > } > > /** >@@ -528,8 +501,6 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "qualifiedName.test", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "qualifiedName.test"); //$NON-NLS-1$ > } > } >Index: src/org/eclipse/emf/validation/tests/CachedTestProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/CachedTestProvider.java,v >retrieving revision 1.3 >diff -u -r1.3 CachedTestProvider.java >--- src/org/eclipse/emf/validation/tests/CachedTestProvider.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/tests/CachedTestProvider.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -17,6 +17,7 @@ > > package org.eclipse.emf.validation.tests; > >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.AbstractConstraintProvider; > > import org.eclipse.emf.ecore.EClass; >@@ -33,7 +34,7 @@ > public class CachedTestProvider extends AbstractConstraintProvider { > private static CachedTestProvider instance; > >- private final java.util.Map hits = new java.util.HashMap(); >+ private final java.util.Map<EClass, Integer> hits = new java.util.HashMap<EClass, Integer>(); > > /** > * Initializes me and remembers me for static access. >@@ -47,8 +48,9 @@ > } > > // redefines the inherited method >- public Collection getBatchConstraints(EObject eObject, >- Collection constraints) { >+ @Override >+ public Collection<IModelConstraint> getBatchConstraints(EObject eObject, >+ Collection<IModelConstraint> constraints) { > // I don't actually need to provide any constraints in order to > // register a hit. The cache will remember that there are no > // constraints! >@@ -64,7 +66,7 @@ > * @param clazz the EMF type > */ > private final void registerHit(EClass clazz) { >- hits.put(clazz, new Integer(getHitCount(clazz) + 1)); >+ hits.put(clazz, getHitCount(clazz) + 1); > } > > /** >@@ -84,8 +86,8 @@ > * @return the number of times that I have provided constraints > */ > public int getHitCount(EClass clazz) { >- Integer result = (Integer)hits.get(clazz); >+ Integer result = hits.get(clazz); > >- return (result == null) ? 0 : result.intValue(); >+ return (result == null) ? 0 : result; > } > } >Index: src/org/eclipse/emf/validation/tests/TestBase.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/TestBase.java,v >retrieving revision 1.5 >diff -u -r1.5 TestBase.java >--- src/org/eclipse/emf/validation/tests/TestBase.java 19 Mar 2007 18:16:52 -0000 1.5 >+++ src/org/eclipse/emf/validation/tests/TestBase.java 9 Nov 2007 00:41:18 -0000 >@@ -17,8 +17,8 @@ > > package org.eclipse.emf.validation.tests; > >+import java.util.Arrays; > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > > import junit.framework.TestCase; >@@ -31,8 +31,8 @@ > import org.eclipse.emf.validation.model.IConstraintStatus; > import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IBatchValidator; >+import org.eclipse.emf.validation.service.ILiveValidator; > import org.eclipse.emf.validation.service.ITraversalStrategy; >-import org.eclipse.emf.validation.service.IValidator; > import org.eclipse.emf.validation.service.ModelValidationService; > > /** >@@ -49,19 +49,17 @@ > > protected final IBatchValidator batchValidator; > protected final IBatchValidator treeValidator; >- protected final IValidator liveValidator; >+ protected final ILiveValidator liveValidator; > > public TestBase(String name) { > super(name); > >- batchValidator = (IBatchValidator) >- ModelValidationService.getInstance().newValidator( >+ batchValidator = ModelValidationService.getInstance().newValidator( > EvaluationMode.BATCH); > batchValidator.setTraversalStrategy(new ITraversalStrategy.Flat()); > batchValidator.setReportSuccesses(true); > >- treeValidator = (IBatchValidator) >- ModelValidationService.getInstance().newValidator( >+ treeValidator = ModelValidationService.getInstance().newValidator( > EvaluationMode.BATCH); > treeValidator.setTraversalStrategy(new ITraversalStrategy.Recursive()); > treeValidator.setReportSuccesses(true); >@@ -82,16 +80,16 @@ > protected void assertAllConstraintsNotPresent( > String constraintType, > IStatus[] statuses, >- Collection ids) { >+ String... ids) { > >- Collection found = new java.util.ArrayList(); >+ Collection<String> found = new java.util.ArrayList<String>(); > >- for (int i = 0; i < statuses.length; i++) { >- IModelConstraint next = ((IConstraintStatus)statuses[i]).getConstraint(); >+ for (IStatus element : statuses) { >+ IModelConstraint next = ((IConstraintStatus)element).getConstraint(); > > String id = next.getDescriptor().getId(); > >- if (ids.contains(id)) { >+ if (Arrays.asList(ids).contains(id)) { > found.add(id); > } > } >@@ -111,17 +109,15 @@ > */ > protected void assertAllConstraintsNotPresent( > String constraintType, >- Collection constraints, >- Collection ids) { >+ Collection<IModelConstraint> constraints, >+ String... ids) { > >- Collection found = new java.util.ArrayList(); >+ Collection<String> found = new java.util.ArrayList<String>(); > >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- IModelConstraint next = (IModelConstraint)iter.next(); >- >+ for (IModelConstraint next : constraints) { > String id = next.getDescriptor().getId(); > >- if (ids.contains(id)) { >+ if (Arrays.asList(ids).contains(id)) { > found.add(id); > } > } >@@ -142,12 +138,12 @@ > protected void assertAllConstraintsPresent( > String constraintType, > IStatus[] statuses, >- Collection ids) { >+ String... ids) { > >- Collection notFound = new java.util.LinkedList(ids); >+ Collection<String> notFound = new java.util.LinkedList<String>(Arrays.asList(ids)); > >- for (int i = 0; i < statuses.length; i++) { >- IModelConstraint next = ((IConstraintStatus)statuses[i]).getConstraint(); >+ for (IStatus element : statuses) { >+ IModelConstraint next = ((IConstraintStatus)element).getConstraint(); > > notFound.remove(next.getDescriptor().getId()); > } >@@ -167,14 +163,12 @@ > */ > protected void assertAllConstraintsPresent( > String constraintType, >- Collection constraints, >- Collection ids) { >+ Collection<IModelConstraint> constraints, >+ String... ids) { > >- Collection notFound = new java.util.LinkedList(ids); >+ Collection<String> notFound = new java.util.LinkedList<String>(Arrays.asList(ids)); > >- for (Iterator iter = constraints.iterator(); iter.hasNext();) { >- IModelConstraint next = (IModelConstraint)iter.next(); >- >+ for (IModelConstraint next : constraints) { > notFound.remove(next.getDescriptor().getId()); > } > >@@ -194,12 +188,12 @@ > protected void assertAllTargetsPresent( > String constraintType, > IStatus[] statuses, >- Collection targets) { >+ Collection<? extends EObject> targets) { > >- Collection notFound = new java.util.LinkedList(targets); >+ Collection<EObject> notFound = new java.util.LinkedList<EObject>(targets); > >- for (int i = 0; i < statuses.length; i++) { >- IConstraintStatus next = (IConstraintStatus)statuses[i]; >+ for (IStatus element : statuses) { >+ IConstraintStatus next = (IConstraintStatus)element; > > notFound.remove(next.getTarget()); > } >@@ -211,9 +205,9 @@ > > protected void assertConstraintAndTargetNotPresent(String constraintType, > IStatus[] statuses, String constraintId, EObject target) { >- for (int i = 0; i < statuses.length; i++) { >- IConstraintStatus status = (IConstraintStatus)statuses[i]; >- IModelConstraint constraint = ((IConstraintStatus)statuses[i]).getConstraint(); >+ for (IStatus element : statuses) { >+ IConstraintStatus status = (IConstraintStatus)element; >+ IModelConstraint constraint = ((IConstraintStatus)element).getConstraint(); > > if (target.equals(status.getTarget()) && constraintId.equals(constraint.getDescriptor().getId())) { > fail("Found unwanted " + constraintType + " constraint " + constraintId + " on " + target); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >@@ -223,9 +217,9 @@ > > protected void assertConstraintAndTargetPresent(String constraintType, > IStatus[] statuses, String constraintId, EObject target) { >- for (int i = 0; i < statuses.length; i++) { >- IConstraintStatus status = (IConstraintStatus)statuses[i]; >- IModelConstraint constraint = ((IConstraintStatus)statuses[i]).getConstraint(); >+ for (IStatus element : statuses) { >+ IConstraintStatus status = (IConstraintStatus)element; >+ IModelConstraint constraint = ((IConstraintStatus)element).getConstraint(); > > if (target.equals(status.getTarget()) && constraintId.equals(constraint.getDescriptor().getId())) { > return; >@@ -244,8 +238,8 @@ > protected IStatus getStatus(IStatus[] statuses, String id) { > IStatus result = null; > >- for (int i = 0; i < statuses.length; i++) { >- IConstraintStatus next = (IConstraintStatus)statuses[i]; >+ for (IStatus element : statuses) { >+ IConstraintStatus next = (IConstraintStatus)element; > > if (next.getConstraint().getDescriptor().getId().equals(id)) { > result = next; >@@ -265,17 +259,17 @@ > * @since 1.1 > */ > protected IStatus[] getStatuses(IStatus[] statuses, String id) { >- List result = new java.util.ArrayList(); >+ List<IStatus> result = new java.util.ArrayList<IStatus>(); > >- for (int i = 0; i < statuses.length; i++) { >- IConstraintStatus next = (IConstraintStatus)statuses[i]; >+ for (IStatus element : statuses) { >+ IConstraintStatus next = (IConstraintStatus) element; > > if (next.getConstraint().getDescriptor().getId().equals(id)) { > result.add(next); > } > } > >- return (IStatus[]) result.toArray(new IStatus[result.size()]); >+ return result.toArray(new IStatus[result.size()]); > } > > /** >@@ -293,19 +287,19 @@ > return new IStatus[0]; > } > >- List result = new java.util.ArrayList(); >+ List<IStatus> result = new java.util.ArrayList<IStatus>(); > > collectStatuses(status, result); > >- return (IStatus[]) result.toArray(new IStatus[result.size()]); >+ return result.toArray(new IStatus[result.size()]); > } > >- private void collectStatuses(IStatus status, List statuses) { >+ private void collectStatuses(IStatus status, List<IStatus> statuses) { > if (status.isMultiStatus()) { > IStatus[] children = status.getChildren(); > >- for (int i = 0; i < children.length; i++) { >- collectStatuses(children[i], statuses); >+ for (IStatus element : children) { >+ collectStatuses(element, statuses); > } > } else { > statuses.add(status); >@@ -327,8 +321,8 @@ > System.out.println(o); > > final int childTabs = tabs + 1; >- for (Iterator iter = o.eContents().iterator(); iter.hasNext(); ) { >- showRecursive((EObject)iter.next(), childTabs); >+ for (EObject next : o.eContents()) { >+ showRecursive(next, childTabs); > } > } > >Index: src/org/eclipse/emf/validation/tests/Example1.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/Example1.java,v >retrieving revision 1.3 >diff -u -r1.3 Example1.java >--- src/org/eclipse/emf/validation/tests/Example1.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/tests/Example1.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 @@ > package org.eclipse.emf.validation.tests; > > import java.util.Calendar; >-import java.util.Iterator; > import java.util.Random; > > import ordersystem.Account; >@@ -88,9 +87,8 @@ > result.setLocation(createAddress(city)); > > int i = 1; >- for (Iterator iter = os.getProduct().iterator(); iter.hasNext(); ) { >- result.getItem() >- .add(createInventoryItem((Product)iter.next(), i++)); >+ for (Product next : os.getProduct()) { >+ result.getItem().add(createInventoryItem(next, i++)); > } > > os.getWarehouse().add(result); >Index: src/org/eclipse/emf/validation/tests/TestBadXmlConfigProvider.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/TestBadXmlConfigProvider.java,v >retrieving revision 1.3 >diff -u -r1.3 TestBadXmlConfigProvider.java >--- src/org/eclipse/emf/validation/tests/TestBadXmlConfigProvider.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/tests/TestBadXmlConfigProvider.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 2001 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,6 +26,7 @@ > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.AbstractConstraintProvider; > import org.eclipse.emf.validation.util.XmlConfig; > >@@ -46,16 +47,18 @@ > * @author Christian W. Damus (cdamus) > */ > public class TestBadXmlConfigProvider extends AbstractConstraintProvider { >- private static final java.util.Map instanceMap = new java.util.HashMap(); >+ private static final java.util.Map<String, TestBadXmlConfigProvider> instanceMap = >+ new java.util.HashMap<String, TestBadXmlConfigProvider>(); > > /** > * Always throws. > * > * @throws RuntimeException always > */ >- public Collection getLiveConstraints( >+ @Override >+ public Collection<IModelConstraint> getLiveConstraints( > Notification notification, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > if (AllTests.isExecutingUnitTests()) { > // only throw if we are actually executing the unit tests > throw new RuntimeException("I am supposed to abend."); //$NON-NLS-1$ >@@ -70,9 +73,10 @@ > * > * @throws RuntimeException always > */ >- public Collection getBatchConstraints( >+ @Override >+ public Collection<IModelConstraint> getBatchConstraints( > EObject eObject, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > if (AllTests.isExecutingUnitTests()) { > // only throw if we are actually executing the unit tests > throw new RuntimeException("I am supposed to abend."); //$NON-NLS-1$ >@@ -87,6 +91,7 @@ > * > * @throws CoreException if no <tt><constraints></tt> element is found > */ >+ @Override > public void setInitializationData( > IConfigurationElement config, > String propertyName, >@@ -111,8 +116,8 @@ > // put this instance into the map > String[] uris = getNamespaceUris(); > >- for (int i = 0; i < uris.length; i++) { >- registerInstance(uris[i], this); >+ for (String element : uris) { >+ registerInstance(element, this); > } > } > >@@ -123,7 +128,7 @@ > * @return the corresponding instance > */ > public static TestBadXmlConfigProvider getInstance(String uriNsPrefix) { >- return (TestBadXmlConfigProvider)instanceMap.get(uriNsPrefix); >+ return instanceMap.get(uriNsPrefix); > } > > private static synchronized void registerInstance( >Index: src/org/eclipse/emf/validation/tests/MultiConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/tests/MultiConstraint.java,v >retrieving revision 1.1 >diff -u -r1.1 MultiConstraint.java >--- src/org/eclipse/emf/validation/tests/MultiConstraint.java 30 Nov 2006 22:52:13 -0000 1.1 >+++ src/org/eclipse/emf/validation/tests/MultiConstraint.java 9 Nov 2007 00:41:18 -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,17 +34,18 @@ > public static boolean enabled = false; > > // Documentation copied from the inherited specification >+ @Override > public IStatus validate(IValidationContext ctx) { > if (!enabled) { > return ctx.createSuccessStatus(); > } > >- Collection statuses = new java.util.ArrayList(); >+ Collection<IStatus> statuses = new java.util.ArrayList<IStatus>(); > > statuses.add(ctx.createFailureStatus(new Object[] {"Nothing to say."})); //$NON-NLS-1$ > > // try a nested multi-status, just for fun >- Collection nested = new java.util.ArrayList(); >+ Collection<IStatus> nested = new java.util.ArrayList<IStatus>(); > nested.add(ConstraintStatus.createStatus( > ctx, > ctx.getTarget().eContents(), >Index: src/org/eclipse/emf/validation/internal/xml/tests/XmlConstraintProviderTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/xml/tests/XmlConstraintProviderTest.java,v >retrieving revision 1.4 >diff -u -r1.4 XmlConstraintProviderTest.java >--- src/org/eclipse/emf/validation/internal/xml/tests/XmlConstraintProviderTest.java 31 Oct 2007 19:59:48 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/xml/tests/XmlConstraintProviderTest.java 9 Nov 2007 00:41:18 -0000 >@@ -17,9 +17,7 @@ > > package org.eclipse.emf.validation.internal.xml.tests; > >-import java.util.Arrays; > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > > import ordersystem.OrderSystemFactory; >@@ -27,6 +25,7 @@ > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.validation.internal.EMFModelValidationStatusCodes; >@@ -34,7 +33,6 @@ > import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IBatchValidator; > import org.eclipse.emf.validation.service.ITraversalStrategy; >-import org.eclipse.emf.validation.service.IValidator; > import org.eclipse.emf.validation.service.ModelValidationService; > import org.eclipse.emf.validation.tests.TestBase; > import org.eclipse.emf.validation.tests.TestNotification; >@@ -57,10 +55,9 @@ > // validate an object for which the test plug-in does not define any > // constraints at all, to force the providers to be loaded (so > // that the static "fixture" instance will be initialized) >- IValidator validator = ModelValidationService.getInstance().newValidator( >+ IBatchValidator validator = ModelValidationService.getInstance().newValidator( > EvaluationMode.BATCH); >- ((IBatchValidator)validator).setTraversalStrategy( >- new ITraversalStrategy.Flat()); >+ validator.setTraversalStrategy(new ITraversalStrategy.Flat()); > validator.validate(OrderSystemFactory.eINSTANCE.createInventoryItem()); > } > >@@ -73,11 +70,13 @@ > private boolean initializationDataWasSet = false; > > // gives the outer class access to the protected superclass method >- protected List getConstraints() { >+ @Override >+ protected List<IModelConstraint> getConstraints() { > return super.getConstraints(); > } > > // extends the inherited method to record the fact of this being set >+ @Override > public void setInitializationData(IConfigurationElement config, > String propertyName, Object data) throws CoreException { > super.setInitializationData(config, propertyName, data); >@@ -99,22 +98,18 @@ > } > > public void test_getConstraints() { >- Collection result = fixture.getConstraints(); >+ Collection<IModelConstraint> result = fixture.getConstraints(); > > assertAllConstraintsPresent( > "various", //$NON-NLS-1$ > result, >- Arrays.asList(new Object[] { >- ID_PREFIX + "product.batch1", //$NON-NLS-1$ >- ID_PREFIX + "product.batch2", //$NON-NLS-1$ >- ID_PREFIX + "product.live1", //$NON-NLS-1$ >- ID_PREFIX + "product.live2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "product.batch1", //$NON-NLS-1$ >+ ID_PREFIX + "product.batch2", //$NON-NLS-1$ >+ ID_PREFIX + "product.live1", //$NON-NLS-1$ >+ ID_PREFIX + "product.live2"); //$NON-NLS-1$ > > // check that all of the constraints are proxies >- for (Iterator iter = result.iterator(); iter.hasNext();) { >- IModelConstraint next = (IModelConstraint)iter.next(); >- >+ for (IModelConstraint next : result) { > assertTrue(next.getClass().getName().endsWith("$ConstraintProxy")); //$NON-NLS-1$ > } > } >@@ -122,23 +117,21 @@ > public void test_getBatchConstraints() { > EObject object = OrderSystemFactory.eINSTANCE.createProduct(); > >- Collection result = new java.util.HashSet(); >+ Collection<IModelConstraint> result = new java.util.HashSet<IModelConstraint>(); > > fixture.getBatchConstraints(object, result); > > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > result, >- Arrays.asList(new Object[] { >- ID_PREFIX + "product.batch1", //$NON-NLS-1$ >- ID_PREFIX + "product.batch2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "product.batch1", //$NON-NLS-1$ >+ ID_PREFIX + "product.batch2"); //$NON-NLS-1$ > } > > public void test_getLiveConstraints() { > EObject object = OrderSystemFactory.eINSTANCE.createProduct(); > >- Collection result = new java.util.HashSet(); >+ Collection<IModelConstraint> result = new java.util.HashSet<IModelConstraint>(); > > fixture.getLiveConstraints( > new TestNotification(object, Notification.SET), >@@ -147,22 +140,18 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > result, >- Arrays.asList(new Object[] { >- ID_PREFIX + "product.live1", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "product.live1"); //$NON-NLS-1$ > > assertAllConstraintsNotPresent( > "live", //$NON-NLS-1$ > result, >- Arrays.asList(new Object[] { >- ID_PREFIX + "product.live2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "product.live2"); //$NON-NLS-1$ > } > > public void test_getLiveConstraintsForFeature() { > EObject object = OrderSystemFactory.eINSTANCE.createProduct(); > >- Collection result = new java.util.HashSet(); >+ Collection<IModelConstraint> result = new java.util.HashSet<IModelConstraint>(); > > fixture.getLiveConstraints( > new TestNotification( >@@ -177,14 +166,12 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > result, >- Arrays.asList(new Object[] { >- ID_PREFIX + "product.live1", //$NON-NLS-1$ >- ID_PREFIX + "product.live2", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "product.live1", //$NON-NLS-1$ >+ ID_PREFIX + "product.live2"); //$NON-NLS-1$ > } > > public void test_duplicateConstraintsLogged_207988() { >- List statuses = TestPlugin.getLogCapture().getLogs( >+ List<IStatus> statuses = TestPlugin.getLogCapture().getLogs( > EMFModelValidationStatusCodes.PROVIDER_DUPLICATE_CONSTRAINT); > assertFalse("Duplicate constraint not logged", statuses.isEmpty()); //$NON-NLS-1$ > } >Index: src/org/eclipse/emf/validation/internal/service/tests/ParameterizedConstraintParserTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/tests/ParameterizedConstraintParserTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ParameterizedConstraintParserTest.java >--- src/org/eclipse/emf/validation/internal/service/tests/ParameterizedConstraintParserTest.java 1 Dec 2006 00:23:37 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/service/tests/ParameterizedConstraintParserTest.java 9 Nov 2007 00:41:18 -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.validation.internal.service.tests; > >-import java.util.Arrays; > import java.util.Collections; > > import ordersystem.Order; >@@ -79,7 +78,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > statuses, >- Arrays.asList(new String[] {TEST_ID1})); >+ TEST_ID1); > > IStatus status = getStatus(statuses, TEST_ID1); > >@@ -109,7 +108,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > statuses, >- Arrays.asList(new String[] {TEST_ID2})); >+ TEST_ID2); > > IStatus status = getStatus(statuses, TEST_ID2); > >@@ -138,7 +137,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > statuses, >- Arrays.asList(new String[] {ID_PREFIX + "order.newParserAPI"})); //$NON-NLS-1$ >+ ID_PREFIX + "order.newParserAPI"); //$NON-NLS-1$ > > IStatus status = getStatus(statuses, ID_PREFIX + "order.newParserAPI"); //$NON-NLS-1$ > >@@ -200,6 +199,7 @@ > public static final class JavaConstraint extends AbstractModelConstraint { > static boolean enabled = false; > >+ @Override > public IStatus validate(IValidationContext ctx) { > assertTrue(ctx.getTarget() instanceof Order); > >@@ -251,7 +251,7 @@ > return "Test constraint"; //$NON-NLS-1$ > } > >- public EvaluationMode getEvaluationMode() { >+ public EvaluationMode<?> getEvaluationMode() { > return EvaluationMode.BATCH; > } > >Index: src/org/eclipse/emf/validation/internal/service/tests/ModelValidationServiceTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/tests/ModelValidationServiceTest.java,v >retrieving revision 1.9 >diff -u -r1.9 ModelValidationServiceTest.java >--- src/org/eclipse/emf/validation/internal/service/tests/ModelValidationServiceTest.java 31 Oct 2007 19:58:44 -0000 1.9 >+++ src/org/eclipse/emf/validation/internal/service/tests/ModelValidationServiceTest.java 9 Nov 2007 00:41:18 -0000 >@@ -22,7 +22,6 @@ > import java.util.Collection; > import java.util.Collections; > import java.util.List; >-import java.util.ListIterator; > import java.util.Set; > > import ordersystem.Address; >@@ -53,8 +52,8 @@ > import org.eclipse.emf.validation.service.IBatchValidator; > 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.ITraversalStrategy; >-import org.eclipse.emf.validation.service.IValidator; > import org.eclipse.emf.validation.service.ModelValidationService; > import org.eclipse.emf.validation.tests.CancelConstraint; > import org.eclipse.emf.validation.tests.MultiConstraint; >@@ -99,14 +98,12 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasContents", //$NON-NLS-1$ >- ID_PREFIX + "order.notFilledBeforePlacement", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasContents", //$NON-NLS-1$ >+ ID_PREFIX + "order.notFilledBeforePlacement"); //$NON-NLS-1$ > } > > public void test_validateBatchCollection() { >- Collection objects = new java.util.ArrayList(); >+ Collection<EObject> objects = new java.util.ArrayList<EObject>(); > objects.add(OrderSystemFactory.eINSTANCE.createOrder()); > objects.add(OrderSystemFactory.eINSTANCE.createAddress()); > >@@ -129,14 +126,14 @@ > assertAllTargetsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new Object[] { >+ Arrays.asList(new EObject[] { > order, > item, > })); > } > > public void test_validateSubtreeBatchCollection() { >- Collection orders = new java.util.ArrayList(); >+ Collection<EObject> orders = new java.util.ArrayList<EObject>(); > > Order order1 = OrderSystemFactory.eINSTANCE.createOrder(); > LineItem item1 = OrderSystemFactory.eINSTANCE.createLineItem(); >@@ -155,7 +152,7 @@ > assertAllTargetsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new Object[] { >+ Arrays.asList(new EObject[] { > order1, > item1, > order2, >@@ -173,14 +170,12 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasName", //$NON-NLS-1$ >- ID_PREFIX + "order.hasOwner", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasName", //$NON-NLS-1$ >+ ID_PREFIX + "order.hasOwner"); //$NON-NLS-1$ > } > > public void test_validateLiveList() { >- List events = new java.util.ArrayList(); >+ List<Notification> events = new java.util.ArrayList<Notification>(); > Resource res = new XMIResourceImpl(); > > Order order = OrderSystemFactory.eINSTANCE.createOrder(); >@@ -197,10 +192,10 @@ > > IStatus[] status = getStatuses(liveValidator.validate(events)); > >- List targets = new java.util.LinkedList(events); >+ List<EObject> targets = new java.util.ArrayList<EObject>(events.size()); > >- for (ListIterator iter = targets.listIterator(); iter.hasNext();) { >- iter.set(((Notification)iter.next()).getNotifier()); >+ for (Notification next : events) { >+ targets.add((EObject) next.getNotifier()); > } > > assertAllTargetsPresent( >@@ -226,9 +221,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.multiConstraint", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.multiConstraint"); //$NON-NLS-1$ > > status = getStatuses(status, ID_PREFIX + "order.multiConstraint"); //$NON-NLS-1$ > assertEquals(3, status.length); >@@ -237,8 +230,8 @@ > boolean foundFun = false; > boolean foundSilly = false; > >- final Set justOrder = Collections.singleton(order); >- final Set orderAndItem = new java.util.HashSet(); >+ final Set<Order> justOrder = Collections.singleton(order); >+ final Set<EObject> orderAndItem = new java.util.HashSet<EObject>(); > orderAndItem.add(order); > orderAndItem.addAll(order.getItem()); > >@@ -293,9 +286,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.setTargetConstraint", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.setTargetConstraint"); //$NON-NLS-1$ > > status = getStatuses(status, ID_PREFIX + "order.setTargetConstraint"); //$NON-NLS-1$ > assertEquals(3, status.length); >@@ -304,8 +295,8 @@ > boolean foundSilly = false; > boolean foundSuccess = false; > >- final Set justItem = Collections.singleton(item); >- final Set orderAndItem = new java.util.HashSet(); >+ final Set<LineItem> justItem = Collections.singleton(item); >+ final Set<EObject> orderAndItem = new java.util.HashSet<EObject>(); > orderAndItem.add(order); > orderAndItem.addAll(order.getItem()); > >@@ -351,15 +342,16 @@ > Order order2 = OrderSystemFactory.eINSTANCE.createOrder(); > order2.setCompleted(false); > >- EList contents = new XMIResourceImpl().getContents(); >+ EList<EObject> contents = new XMIResourceImpl().getContents(); > contents.add(order1); > contents.add(order2); > >- Collection events = new ArrayList(); >+ Collection<Notification> events = new ArrayList<Notification>(); > events.add(new TestNotification(order1, Notification.SET)); > events.add(new TestNotification(order2, Notification.SET)); > >- IValidator validator = ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); >+ ILiveValidator validator = ModelValidationService.getInstance().newValidator( >+ EvaluationMode.LIVE); > IConstraintFilter filter = new IConstraintFilter() { > public boolean accept(IConstraintDescriptor constraint, > EObject object) { >@@ -394,11 +386,11 @@ > Order order2 = OrderSystemFactory.eINSTANCE.createOrder(); > order2.setCompleted(false); > >- EList contents = new XMIResourceImpl().getContents(); >+ EList<EObject> contents = new XMIResourceImpl().getContents(); > contents.add(order1); > contents.add(order2); > >- Collection targets = new ArrayList(); >+ Collection<EObject> targets = new ArrayList<EObject>(); > targets.add(order1); > targets.add(order2); > >@@ -447,9 +439,7 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.cancelConstraint", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.cancelConstraint"); //$NON-NLS-1$ > > IStatus particular = getStatus(status, ID_PREFIX + "order.cancelConstraint"); //$NON-NLS-1$ > assertTrue("Wrong kind of constraint", particular instanceof IConstraintStatus); //$NON-NLS-1$ >@@ -470,16 +460,14 @@ > EObject object = OrderSystemFactory.eINSTANCE.createOrder(); > res.getContents().add(object); // must be in a resource > >- Collection events = new ArrayList(); >+ Collection<Notification> events = new ArrayList<Notification>(); > events.add(new TestNotification(object, Notification.SET)); > IStatus[] status = getStatuses(liveValidator.validate(events)); > > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.cancelConstraint", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.cancelConstraint"); //$NON-NLS-1$ > > IStatus particular = getStatus(status, ID_PREFIX + "order.cancelConstraint"); //$NON-NLS-1$ > assertTrue("Wrong kind of constraint", particular instanceof IConstraintStatus); //$NON-NLS-1$ >@@ -504,6 +492,7 @@ > epackage.getEClassifiers().add(myOrderClass); > > class MyOrderImpl extends OrderImpl { >+ @Override > public EClass eClass() { > return myOrderClass; > } >@@ -519,10 +508,8 @@ > assertAllConstraintsPresent( > "batch", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasContents", //$NON-NLS-1$ >- ID_PREFIX + "order.notFilledBeforePlacement", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasContents", //$NON-NLS-1$ >+ ID_PREFIX + "order.notFilledBeforePlacement"); //$NON-NLS-1$ > } > > /** >@@ -530,7 +517,7 @@ > * not repeatedly validate an element. > */ > public void test_recursiveTraversalStrategy_207990() { >- Collection objects = new java.util.ArrayList(); >+ Collection<EObject> objects = new java.util.ArrayList<EObject>(); > > Order order1 = OrderSystemFactory.eINSTANCE.createOrder(); > LineItem item1 = OrderSystemFactory.eINSTANCE.createLineItem(); >@@ -540,7 +527,7 @@ > objects.add(item1); // child element precedes ancestor > objects.add(order1); > >- Set visited = new java.util.HashSet(); >+ Set<EObject> visited = new java.util.HashSet<EObject>(); > ITraversalStrategy traversal = batchValidator.getDefaultTraversalStrategy(); > > traversal.startTraversal(objects, new NullProgressMonitor()); >@@ -621,6 +608,7 @@ > // Framework methods > // > >+ @Override > protected void tearDown() > throws Exception { > >@@ -670,7 +658,7 @@ > return delegate.next(); > } > >- public void startTraversal(Collection traversalRoots, >+ public void startTraversal(Collection<? extends EObject> traversalRoots, > IProgressMonitor monitor) { > synchronized (TestTraversalStrategy.class) { > used = true; >Index: src/org/eclipse/emf/validation/internal/service/tests/ConstraintListenersTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/tests/ConstraintListenersTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ConstraintListenersTest.java >--- src/org/eclipse/emf/validation/internal/service/tests/ConstraintListenersTest.java 19 Mar 2007 16:47:07 -0000 1.1 >+++ src/org/eclipse/emf/validation/internal/service/tests/ConstraintListenersTest.java 9 Nov 2007 00:41:18 -0000 >@@ -138,6 +138,7 @@ > assertNull("Remove category for non-associated category incorrectly sent an event", listener.getLastEvent()); //$NON-NLS-1$ > } > >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -149,6 +150,7 @@ > listener.setEnabled(true); > } > >+ @Override > protected void tearDown() throws Exception { > listener.setEnabled(false); > listener.setLastEvent(null); >@@ -199,8 +201,8 @@ > return 0; > } > >- public EvaluationMode getEvaluationMode() { >- return null; >+ public EvaluationMode<?> getEvaluationMode() { >+ return EvaluationMode.NULL; > } > > public boolean targetsTypeOf(EObject eObject) { >Index: src/org/eclipse/emf/validation/internal/service/tests/ConstraintRegistryTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/tests/ConstraintRegistryTest.java,v >retrieving revision 1.4 >diff -u -r1.4 ConstraintRegistryTest.java >--- src/org/eclipse/emf/validation/internal/service/tests/ConstraintRegistryTest.java 7 Nov 2007 17:30:08 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/service/tests/ConstraintRegistryTest.java 9 Nov 2007 00:41:18 -0000 >@@ -99,7 +99,7 @@ > } > > public void testGetAllDescriptors() { >- Collection allFound = >+ Collection<IConstraintDescriptor> allFound = > ConstraintRegistry.getInstance().getAllDescriptors(); > > assertNotNull(allFound); >@@ -185,14 +185,16 @@ > public void test_bulkRegister() { > ConstraintListener.getInstance().reset(); > >- Collection constraints = new java.util.ArrayList(); >+ Collection<IModelConstraint> constraints = new java.util.ArrayList<IModelConstraint>(); > constraints.add(new FixtureConstraint()); > constraints.add(new FixtureConstraint()); > constraints.add(new FixtureConstraint()); > constraints.add(new FixtureConstraint()); > > class ProviderAccess extends AbstractConstraintProvider { >- public void registerConstraints(Collection constraints) >+ @Override >+ public void registerConstraints( >+ Collection<? extends IModelConstraint> constraints) > throws ConstraintExistsException { > super.registerConstraints(constraints); > }} >@@ -211,6 +213,7 @@ > // Test fixtures > // > >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -221,6 +224,7 @@ > listener.setEnabled(true); > } > >+ @Override > protected void tearDown() throws Exception { > ConstraintListener listener = ConstraintListener.getInstance(); > >@@ -272,7 +276,7 @@ > return 0; > } > >- public EvaluationMode getEvaluationMode() { >+ public EvaluationMode<?> getEvaluationMode() { > return null; > } > >Index: src/org/eclipse/emf/validation/internal/service/tests/EventTypeServiceTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/tests/EventTypeServiceTest.java,v >retrieving revision 1.1 >diff -u -r1.1 EventTypeServiceTest.java >--- src/org/eclipse/emf/validation/internal/service/tests/EventTypeServiceTest.java 21 Mar 2007 21:06:30 -0000 1.1 >+++ src/org/eclipse/emf/validation/internal/service/tests/EventTypeServiceTest.java 9 Nov 2007 00:41:18 -0000 >@@ -46,7 +46,8 @@ > } > > public void test_getNotificationGenerators_177647() { >- Collection generators = EventTypeService.getInstance().getNotificationGenerators(); >+ Collection<INotificationGenerator> generators = >+ EventTypeService.getInstance().getNotificationGenerators(); > > assertEquals(generators.size(), 1); > } >Index: src/ordersystem/special/SpecialPackage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/SpecialPackage.java,v >retrieving revision 1.2 >diff -u -r1.2 SpecialPackage.java >--- src/ordersystem/special/SpecialPackage.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/SpecialPackage.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -35,6 +35,7 @@ > * </ul> > * <!-- end-user-doc --> > * @see ordersystem.special.SpecialFactory >+ * @model kind="package" > * @generated > */ > public interface SpecialPackage extends EPackage{ >@@ -135,7 +136,7 @@ > int PREFERRED_CUSTOMER__SINCE = OrderSystemPackage.CUSTOMER_FEATURE_COUNT + 0; > > /** >- * The number of structural features of the the '<em>Preferred Customer</em>' class. >+ * The number of structural features of the '<em>Preferred Customer</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -199,7 +200,7 @@ > int LIMITED_EDITION_PRODUCT__AVAILABLE_UNTIL = OrderSystemPackage.PRODUCT_FEATURE_COUNT + 0; > > /** >- * The number of structural features of the the '<em>Limited Edition Product</em>' class. >+ * The number of structural features of the '<em>Limited Edition Product</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -259,4 +260,55 @@ > */ > SpecialFactory getSpecialFactory(); > >+ /** >+ * <!-- begin-user-doc --> >+ * Defines literals for the meta objects that represent >+ * <ul> >+ * <li>each class,</li> >+ * <li>each feature of each class,</li> >+ * <li>each enum,</li> >+ * <li>and each data type</li> >+ * </ul> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ interface Literals { >+ /** >+ * The meta object literal for the '{@link ordersystem.special.impl.PreferredCustomerImpl <em>Preferred Customer</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.special.impl.PreferredCustomerImpl >+ * @see ordersystem.special.impl.SpecialPackageImpl#getPreferredCustomer() >+ * @generated >+ */ >+ EClass PREFERRED_CUSTOMER = eINSTANCE.getPreferredCustomer(); >+ >+ /** >+ * The meta object literal for the '<em><b>Since</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute PREFERRED_CUSTOMER__SINCE = eINSTANCE.getPreferredCustomer_Since(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.special.impl.LimitedEditionProductImpl <em>Limited Edition Product</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.special.impl.LimitedEditionProductImpl >+ * @see ordersystem.special.impl.SpecialPackageImpl#getLimitedEditionProduct() >+ * @generated >+ */ >+ EClass LIMITED_EDITION_PRODUCT = eINSTANCE.getLimitedEditionProduct(); >+ >+ /** >+ * The meta object literal for the '<em><b>Available Until</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute LIMITED_EDITION_PRODUCT__AVAILABLE_UNTIL = eINSTANCE.getLimitedEditionProduct_AvailableUntil(); >+ >+ } >+ > } //SpecialPackage >Index: src/ordersystem/special/PreferredCustomer.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/PreferredCustomer.java,v >retrieving revision 1.2 >diff -u -r1.2 PreferredCustomer.java >--- src/ordersystem/special/PreferredCustomer.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/PreferredCustomer.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,7 +34,7 @@ > * </p> > * > * @see ordersystem.special.SpecialPackage#getPreferredCustomer() >- * >+ * @model > * @generated > */ > public interface PreferredCustomer extends Customer { >Index: src/ordersystem/special/LimitedEditionProduct.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/LimitedEditionProduct.java,v >retrieving revision 1.2 >diff -u -r1.2 LimitedEditionProduct.java >--- src/ordersystem/special/LimitedEditionProduct.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/LimitedEditionProduct.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,7 +34,7 @@ > * </p> > * > * @see ordersystem.special.SpecialPackage#getLimitedEditionProduct() >- * >+ * @model > * @generated > */ > public interface LimitedEditionProduct extends Product { >Index: src/ordersystem/special/SpecialFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/SpecialFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 SpecialFactory.java >--- src/ordersystem/special/SpecialFactory.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/SpecialFactory.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,7 +34,7 @@ > * <!-- end-user-doc --> > * @generated > */ >- SpecialFactory eINSTANCE = new ordersystem.special.impl.SpecialFactoryImpl(); >+ SpecialFactory eINSTANCE = ordersystem.special.impl.SpecialFactoryImpl.init(); > > /** > * Returns a new object of class '<em>Preferred Customer</em>'. >Index: src/org/eclipse/emf/validation/internal/model/tests/SpecialOrderNotificationGenerator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/SpecialOrderNotificationGenerator.java,v >retrieving revision 1.1 >diff -u -r1.1 SpecialOrderNotificationGenerator.java >--- src/org/eclipse/emf/validation/internal/model/tests/SpecialOrderNotificationGenerator.java 21 Mar 2007 21:06:23 -0000 1.1 >+++ src/org/eclipse/emf/validation/internal/model/tests/SpecialOrderNotificationGenerator.java 9 Nov 2007 00:41:18 -0000 >@@ -20,8 +20,6 @@ > > import java.util.ArrayList; > import java.util.Collection; >-import java.util.Iterator; >- > import ordersystem.LineItem; > import ordersystem.Order; > import ordersystem.special.LimitedEditionProduct; >@@ -39,17 +37,15 @@ > * Create special notifications for those orders who contain limited > * edition products > */ >- public Collection generateNotifications(Collection notifications) { >- Collection newNotifications = new ArrayList(); >+ public Collection<Notification> generateNotifications(Collection<? extends Notification> notifications) { >+ Collection<Notification> newNotifications = new ArrayList<Notification>(); > >- for (Iterator iter=notifications.iterator(); iter.hasNext(); ) { >- Notification notification = (Notification)iter.next(); >+ for (Notification notification : notifications) { > if (notification.getNotifier() instanceof Order) { >- Order order = (Order)notification.getNotifier(); >+ Order order = (Order) notification.getNotifier(); > LimitedEditionProduct lep = null; > >- for (Iterator itemIter=order.getItem().iterator(); itemIter.hasNext();) { >- LineItem obj = (LineItem)itemIter.next(); >+ for (LineItem obj : order.getItem()) { > if (obj.getProduct() instanceof LimitedEditionProduct) { > lep = (LimitedEditionProduct)obj.getProduct(); > } >Index: src/org/eclipse/emf/validation/internal/model/tests/ConstraintSeverityTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/ConstraintSeverityTest.java,v >retrieving revision 1.4 >diff -u -r1.4 ConstraintSeverityTest.java >--- src/org/eclipse/emf/validation/internal/model/tests/ConstraintSeverityTest.java 6 Jun 2007 22:28:15 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/model/tests/ConstraintSeverityTest.java 9 Nov 2007 00:41:18 -0000 >@@ -25,7 +25,6 @@ > import java.io.ObjectInputStream; > import java.io.ObjectOutput; > import java.io.ObjectOutputStream; >-import java.util.Iterator; > import java.util.List; > > import junit.framework.TestCase; >@@ -53,7 +52,7 @@ > } > > public void test_getAllInstances() { >- List instances = ConstraintSeverity.getAllInstances(); >+ List<ConstraintSeverity> instances = ConstraintSeverity.getAllInstances(); > > assertTrue(instances.contains(ConstraintSeverity.NULL)); > assertTrue(instances.contains(ConstraintSeverity.INFO)); >@@ -84,8 +83,8 @@ > try { > output = new ObjectOutputStream(stream); > >- for (Iterator i = ConstraintSeverity.getAllInstances().iterator(); i.hasNext();) { >- output.writeObject(i.next()); >+ for (ConstraintSeverity next : ConstraintSeverity.getAllInstances()) { >+ output.writeObject(next); > } > > output.flush(); >@@ -93,8 +92,8 @@ > input = new ObjectInputStream( > new ByteArrayInputStream(stream.toByteArray())); > >- for (Iterator i = ConstraintSeverity.getAllInstances().iterator(); i.hasNext();) { >- assertSame(i.next(), input.readObject()); >+ for (ConstraintSeverity next : ConstraintSeverity.getAllInstances()) { >+ assertSame(next, input.readObject()); > } > } catch (Exception e) { > fail(e.getLocalizedMessage()); >Index: src/org/eclipse/emf/validation/internal/model/tests/EMFEventTypeTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/EMFEventTypeTest.java,v >retrieving revision 1.4 >diff -u -r1.4 EMFEventTypeTest.java >--- src/org/eclipse/emf/validation/internal/model/tests/EMFEventTypeTest.java 21 Mar 2007 21:06:30 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/model/tests/EMFEventTypeTest.java 9 Nov 2007 00:41:18 -0000 >@@ -27,7 +27,6 @@ > import java.io.ObjectInputStream; > import java.io.ObjectOutput; > import java.io.ObjectOutputStream; >-import java.util.Iterator; > import java.util.List; > > import junit.framework.TestCase; >@@ -112,7 +111,7 @@ > } > > public void test_getPredefinedInstances_177647() { >- List instances = EMFEventType.getPredefinedInstances(); >+ List<EMFEventType> instances = EMFEventType.getPredefinedInstances(); > > assertTrue(instances.contains(EMFEventType.NULL)); > assertTrue(instances.contains(EMFEventType.ADD)); >@@ -127,7 +126,7 @@ > } > > public void test_getAllInstances() { >- List instances = EMFEventType.getAllInstances(); >+ List<EMFEventType> instances = EMFEventType.getAllInstances(); > > assertTrue(instances.contains(EMFEventType.NULL)); > assertTrue(instances.contains(EMFEventType.ADD)); >@@ -198,8 +197,8 @@ > try { > output = new ObjectOutputStream(stream); > >- for (Iterator i = EMFEventType.getAllInstances().iterator(); i.hasNext();) { >- output.writeObject(i.next()); >+ for (EMFEventType next : EMFEventType.getAllInstances()) { >+ output.writeObject(next); > } > > output.flush(); >@@ -207,8 +206,8 @@ > input = new ObjectInputStream( > new ByteArrayInputStream(stream.toByteArray())); > >- for (Iterator i = EMFEventType.getAllInstances().iterator(); i.hasNext();) { >- assertSame(i.next(), input.readObject()); >+ for (EMFEventType next : EMFEventType.getAllInstances()) { >+ assertSame(next, input.readObject()); > } > } catch (Exception e) { > fail(e.getLocalizedMessage()); >Index: src/org/eclipse/emf/validation/internal/model/tests/CategoryTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/CategoryTest.java,v >retrieving revision 1.3 >diff -u -r1.3 CategoryTest.java >--- src/org/eclipse/emf/validation/internal/model/tests/CategoryTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/model/tests/CategoryTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -22,8 +22,6 @@ > import org.eclipse.emf.validation.model.CategoryManager; > > import java.util.Collection; >-import java.util.Iterator; >- > import junit.framework.TestCase; > > /** >@@ -101,10 +99,10 @@ > * Tests the consistency of the top-level categories query. > */ > public void test_getTopLevelCategories() { >- Collection topLevel = mgr.getTopLevelCategories(); >+ Collection<Category> topLevel = mgr.getTopLevelCategories(); > >- for (Iterator iter = topLevel.iterator(); iter.hasNext();) { >- assertNull(((Category)iter.next()).getParent()); >+ for (Category next : topLevel) { >+ assertNull(next.getParent()); > } > } > >@@ -112,10 +110,10 @@ > * Tests the consistency of the mandatory categories query. > */ > public void test_getMandatoryCategories() { >- Collection topLevel = mgr.getMandatoryCategories(); >+ Collection<Category> topLevel = mgr.getMandatoryCategories(); > >- for (Iterator iter = topLevel.iterator(); iter.hasNext();) { >- assertTrue(((Category)iter.next()).isMandatory()); >+ for (Category next : topLevel) { >+ assertTrue(next.isMandatory()); > } > } > >@@ -136,8 +134,8 @@ > public void test_dumpCategories() { > Trace.trace(">>> Testing dumpCategories"); //$NON-NLS-1$ > >- for (Iterator iter = mgr.getTopLevelCategories().iterator(); iter.hasNext();) { >- dumpCategory((Category)iter.next()); >+ for (Category next : mgr.getTopLevelCategories()) { >+ dumpCategory(next); > } > } > >@@ -149,12 +147,12 @@ > private void dumpCategory(Category category) { > Trace.trace(category.toString()); > >- for (Iterator iter = category.getConstraints().iterator(); iter.hasNext();) { >- Trace.trace(" " + iter.next()); //$NON-NLS-1$ >+ for (Object next : category.getConstraints()) { >+ Trace.trace(" " + next); //$NON-NLS-1$ > } > >- for (Iterator iter = category.getChildren().iterator(); iter.hasNext();) { >- dumpCategory((Category)iter.next()); >+ for (Category child : category.getChildren()) { >+ dumpCategory(child); > } > } > } >Index: src/org/eclipse/emf/validation/internal/model/tests/EvaluationModeTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/EvaluationModeTest.java,v >retrieving revision 1.4 >diff -u -r1.4 EvaluationModeTest.java >--- src/org/eclipse/emf/validation/internal/model/tests/EvaluationModeTest.java 6 Jun 2007 22:28:15 -0000 1.4 >+++ src/org/eclipse/emf/validation/internal/model/tests/EvaluationModeTest.java 9 Nov 2007 00:41:18 -0000 >@@ -23,7 +23,6 @@ > import java.io.ObjectInputStream; > import java.io.ObjectOutput; > import java.io.ObjectOutputStream; >-import java.util.Iterator; > import java.util.List; > > import junit.framework.TestCase; >@@ -51,7 +50,7 @@ > } > > public void test_getAllInstances() { >- List instances = EvaluationMode.getAllInstances(); >+ List<EvaluationMode<?>> instances = EvaluationMode.getAllInstances(); > > assertTrue(instances.contains(EvaluationMode.BATCH)); > assertTrue(instances.contains(EvaluationMode.LIVE)); >@@ -109,8 +108,8 @@ > try { > output = new ObjectOutputStream(stream); > >- for (Iterator i = EvaluationMode.getAllInstances().iterator(); i.hasNext();) { >- output.writeObject(i.next()); >+ for (EvaluationMode<?> next : EvaluationMode.getAllInstances()) { >+ output.writeObject(next); > } > > output.flush(); >@@ -118,8 +117,8 @@ > input = new ObjectInputStream( > new ByteArrayInputStream(stream.toByteArray())); > >- for (Iterator i = EvaluationMode.getAllInstances().iterator(); i.hasNext();) { >- assertSame(i.next(), input.readObject()); >+ for (EvaluationMode<?> next : EvaluationMode.getAllInstances()) { >+ assertSame(next, input.readObject()); > } > } catch (Exception e) { > fail(e.getLocalizedMessage()); >Index: src/org/eclipse/emf/validation/internal/model/tests/ClientContextManagerTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/ClientContextManagerTest.java,v >retrieving revision 1.2 >diff -u -r1.2 ClientContextManagerTest.java >--- src/org/eclipse/emf/validation/internal/model/tests/ClientContextManagerTest.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/org/eclipse/emf/validation/internal/model/tests/ClientContextManagerTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -105,6 +105,7 @@ > {"class", TestSelector.class.getName()}})); //$NON-NLS-1$ > } > >+ @Override > protected void setUp() { > // this setup effectively tests the configureBindings() method, > // including the ability of the system to ignore >@@ -158,7 +159,7 @@ > > public void test_getBindings_eobject() { > IModelConstraint constraint = new TestConstraint(); >- Collection constraints = Collections.singleton(constraint); >+ Collection<IModelConstraint> constraints = Collections.singleton(constraint); > > assertTrue(mgr.getBindings(product, constraints).contains(constraint)); > assertFalse(mgr.getBindings(order, constraints).contains(constraint)); >@@ -166,14 +167,14 @@ > > public void test_getBindings_eobject_none() { > IModelConstraint constraint = new TestConstraint(); >- Collection constraints = Collections.singleton(constraint); >+ Collection<IModelConstraint> constraints = Collections.singleton(constraint); > > assertTrue(mgr.getBindings(order, constraints).isEmpty()); > } > > public void test_getBindings_context() { > IModelConstraint constraint = new TestConstraint(); >- Collection constraints = Collections.singleton(constraint); >+ Collection<IModelConstraint> constraints = Collections.singleton(constraint); > > assertTrue(mgr.getBindings(ctx, constraints).contains(constraint)); > assertFalse(mgr.getBindings(ctx2, constraints).contains(constraint)); >@@ -181,12 +182,12 @@ > > public void test_getBindings_contexts() { > IModelConstraint constraint = new TestConstraint(); >- Collection constraints = Collections.singleton(constraint); >+ Collection<IModelConstraint> constraints = Collections.singleton(constraint); > > assertTrue(mgr.getBindings( >- Arrays.asList(new Object[] {ctx, ctx2}), constraints).contains(constraint)); >+ Arrays.asList(ctx, ctx2), constraints).contains(constraint)); > assertFalse(mgr.getBindings( >- Arrays.asList(new Object[] {ctx2, ctx2}), constraints).contains(constraint)); >+ Arrays.asList(ctx2, ctx2), constraints).contains(constraint)); > } > > public void test_defaultBindings_context() { >@@ -211,7 +212,7 @@ > return descr; > }}; > >- Collection constraints = Collections.singleton(constraint); >+ Collection<IModelConstraint> constraints = Collections.singleton(constraint); > > IClientContext junitCtx = mgr.getClientContext(JUNIT_CLIENT); > >@@ -244,11 +245,11 @@ > return descr; > }}; > >- Collection contexts = new java.util.ArrayList(); >+ Collection<IClientContext> contexts = new java.util.ArrayList<IClientContext>(); > contexts.add(ctx); > contexts.add(ctx2); > >- Collection constraints = Collections.singleton(constraint); >+ Collection<IModelConstraint> constraints = Collections.singleton(constraint); > > IClientContext junitCtx = mgr.getClientContext(JUNIT_CLIENT); > >Index: src/org/eclipse/emf/validation/internal/model/tests/ConstraintStatusTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/model/tests/ConstraintStatusTest.java,v >retrieving revision 1.3 >diff -u -r1.3 ConstraintStatusTest.java >--- src/org/eclipse/emf/validation/internal/model/tests/ConstraintStatusTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/model/tests/ConstraintStatusTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -51,7 +51,7 @@ > private static final EObject TEST_TARGET = > OrderSystemFactory.eINSTANCE.createWarehouse(); > >- private static final Set TEST_RESULTLOCUS = >+ private static final Set<EObject> TEST_RESULTLOCUS = > Collections.singleton(TEST_TARGET); > > private static FixtureConstraint fixtureConstraint; >@@ -59,11 +59,11 @@ > private static ConstraintStatus failedFixture; > > private static class FixtureConstraint implements IModelConstraint { >- private String name; >- private String id; >- private String pluginId; >- private ConstraintSeverity severity; >- private int code; >+ private final String name; >+ private final String id; >+ private final String pluginId; >+ private final ConstraintSeverity severity; >+ private final int code; > > FixtureConstraint(String name, String id, String pluginId, > ConstraintSeverity severity, int code) { >@@ -121,7 +121,7 @@ > return null; > } > >- public EvaluationMode getEvaluationMode() { >+ public EvaluationMode<?> getEvaluationMode() { > return null; > } > >@@ -145,8 +145,8 @@ > // do nothing > } > >- public Set getCategories() { >- return Collections.EMPTY_SET; >+ public Set<Category> getCategories() { >+ return Collections.emptySet(); > } > > public void addCategory(Category category) { >Index: src/ordersystem/Product.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/Product.java,v >retrieving revision 1.2 >diff -u -r1.2 Product.java >--- src/ordersystem/Product.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/Product.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -35,7 +35,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getProduct() >- * >+ * @model > * @generated > */ > public interface Product extends EObject{ >@@ -50,7 +50,7 @@ > * @return the value of the '<em>Name</em>' attribute. > * @see #setName(String) > * @see ordersystem.OrderSystemPackage#getProduct_Name() >- * >+ * @model > * @generated > */ > String getName(); >@@ -76,7 +76,7 @@ > * @return the value of the '<em>Sku</em>' attribute. > * @see #setSku(String) > * @see ordersystem.OrderSystemPackage#getProduct_Sku() >- * >+ * @model > * @generated > */ > String getSku(); >@@ -102,7 +102,7 @@ > * @return the value of the '<em>Price</em>' attribute. > * @see #setPrice(double) > * @see ordersystem.OrderSystemPackage#getProduct_Price() >- * >+ * @model > * @generated > */ > double getPrice(); >Index: src/ordersystem/Customer.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/Customer.java,v >retrieving revision 1.2 >diff -u -r1.2 Customer.java >--- src/ordersystem/Customer.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/Customer.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,7 +38,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getCustomer() >- * >+ * @model > * @generated > */ > public interface Customer extends EObject{ >@@ -53,7 +53,7 @@ > * @return the value of the '<em>Last Name</em>' attribute. > * @see #setLastName(String) > * @see ordersystem.OrderSystemPackage#getCustomer_LastName() >- * >+ * @model > * @generated > */ > String getLastName(); >@@ -79,7 +79,7 @@ > * @return the value of the '<em>First Name</em>' attribute. > * @see #setFirstName(String) > * @see ordersystem.OrderSystemPackage#getCustomer_FirstName() >- * >+ * @model > * @generated > */ > String getFirstName(); >@@ -135,10 +135,10 @@ > * @return the value of the '<em>Account</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getCustomer_Account() > * @see ordersystem.Account#getOwner >- * @model type="ordersystem.Account" opposite="owner" containment="true" >+ * @model opposite="owner" containment="true" > * @generated > */ >- EList getAccount(); >+ EList<Account> getAccount(); > > /** > * Returns the value of the '<em><b>Order</b></em>' containment reference list. >@@ -153,9 +153,9 @@ > * @return the value of the '<em>Order</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getCustomer_Order() > * @see ordersystem.Order#getOwner >- * @model type="ordersystem.Order" opposite="owner" containment="true" >+ * @model opposite="owner" containment="true" > * @generated > */ >- EList getOrder(); >+ EList<Order> getOrder(); > > } // Customer >Index: src/ordersystem/Order.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/Order.java,v >retrieving revision 1.2 >diff -u -r1.2 Order.java >--- src/ordersystem/Order.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/Order.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -41,7 +41,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getOrder() >- * >+ * @model > * @generated > */ > public interface Order extends EObject{ >@@ -108,7 +108,7 @@ > * @return the value of the '<em>Completed</em>' attribute. > * @see #setCompleted(boolean) > * @see ordersystem.OrderSystemPackage#getOrder_Completed() >- * >+ * @model > * @generated > */ > boolean isCompleted(); >@@ -134,7 +134,7 @@ > * @return the value of the '<em>Id</em>' attribute. > * @see #setId(String) > * @see ordersystem.OrderSystemPackage#getOrder_Id() >- * >+ * @model > * @generated > */ > String getId(); >@@ -190,9 +190,9 @@ > * @return the value of the '<em>Item</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getOrder_Item() > * @see ordersystem.LineItem#getOwner >- * @model type="ordersystem.LineItem" opposite="owner" containment="true" >+ * @model opposite="owner" containment="true" > * @generated > */ >- EList getItem(); >+ EList<LineItem> getItem(); > > } // Order >Index: src/ordersystem/InventoryItem.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/InventoryItem.java,v >retrieving revision 1.2 >diff -u -r1.2 InventoryItem.java >--- src/ordersystem/InventoryItem.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/InventoryItem.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,7 +38,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getInventoryItem() >- * >+ * @model > * @generated > */ > public interface InventoryItem extends EObject{ >@@ -53,7 +53,7 @@ > * @return the value of the '<em>In Stock</em>' attribute. > * @see #setInStock(int) > * @see ordersystem.OrderSystemPackage#getInventoryItem_InStock() >- * >+ * @model > * @generated > */ > int getInStock(); >@@ -79,7 +79,7 @@ > * @return the value of the '<em>Restock Threshold</em>' attribute. > * @see #setRestockThreshold(int) > * @see ordersystem.OrderSystemPackage#getInventoryItem_RestockThreshold() >- * >+ * @model > * @generated > */ > int getRestockThreshold(); >Index: src/ordersystem/OrderSystemFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/OrderSystemFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemFactory.java >--- src/ordersystem/OrderSystemFactory.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/OrderSystemFactory.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,13 +34,13 @@ > * <!-- end-user-doc --> > * @generated > */ >- OrderSystemFactory eINSTANCE = new ordersystem.impl.OrderSystemFactoryImpl(); >+ OrderSystemFactory eINSTANCE = ordersystem.impl.OrderSystemFactoryImpl.init(); > > /** >- * Returns a new object of class '<em>OrderSystem</em>'. >+ * Returns a new object of class '<em>Order System</em>'. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >- * @return a new object of class '<em>OrderSystem</em>'. >+ * @return a new object of class '<em>Order System</em>'. > * @generated > */ > OrderSystem createOrderSystem(); >Index: src/ordersystem/OrderSystemPackage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/OrderSystemPackage.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemPackage.java >--- src/ordersystem/OrderSystemPackage.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/OrderSystemPackage.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -35,6 +35,7 @@ > * </ul> > * <!-- end-user-doc --> > * @see ordersystem.OrderSystemFactory >+ * @model kind="package" > * @generated > */ > public interface OrderSystemPackage extends EPackage{ >@@ -71,7 +72,7 @@ > OrderSystemPackage eINSTANCE = ordersystem.impl.OrderSystemPackageImpl.init(); > > /** >- * The meta object id for the '{@link ordersystem.impl.OrderSystemImpl <em>OrderSystem</em>}' class. >+ * The meta object id for the '{@link ordersystem.impl.OrderSystemImpl <em>Order System</em>}' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @see ordersystem.impl.OrderSystemImpl >@@ -175,7 +176,7 @@ > int ORDER__ITEM = 5; > > /** >- * The number of structural features of the the '<em>Order</em>' class. >+ * The number of structural features of the '<em>Order</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -240,7 +241,7 @@ > int PRODUCT__OWNER = 3; > > /** >- * The number of structural features of the the '<em>Product</em>' class. >+ * The number of structural features of the '<em>Product</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -295,7 +296,7 @@ > int WAREHOUSE__LOCATION = 3; > > /** >- * The number of structural features of the the '<em>Warehouse</em>' class. >+ * The number of structural features of the '<em>Warehouse</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -340,7 +341,7 @@ > int ORDER_SYSTEM__WAREHOUSE = 3; > > /** >- * The number of structural features of the the '<em>OrderSystem</em>' class. >+ * The number of structural features of the '<em>Order System</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -385,7 +386,7 @@ > int LINE_ITEM__PRODUCT = 3; > > /** >- * The number of structural features of the the '<em>Line Item</em>' class. >+ * The number of structural features of the '<em>Line Item</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -449,7 +450,7 @@ > int INVENTORY_ITEM__PRODUCT = 4; > > /** >- * The number of structural features of the the '<em>Inventory Item</em>' class. >+ * The number of structural features of the '<em>Inventory Item</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -503,7 +504,7 @@ > int CUSTOMER__ORDER = 4; > > /** >- * The number of structural features of the the '<em>Customer</em>' class. >+ * The number of structural features of the '<em>Customer</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -575,7 +576,7 @@ > int ADDRESS__COUNTRY = 6; > > /** >- * The number of structural features of the the '<em>Address</em>' class. >+ * The number of structural features of the '<em>Address</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -629,7 +630,7 @@ > int ACCOUNT__SHIPPING_ADDRESS = 4; > > /** >- * The number of structural features of the the '<em>Account</em>' class. >+ * The number of structural features of the '<em>Account</em>' class. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -649,10 +650,10 @@ > > > /** >- * Returns the meta object for class '{@link ordersystem.OrderSystem <em>OrderSystem</em>}'. >+ * Returns the meta object for class '{@link ordersystem.OrderSystem <em>Order System</em>}'. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >- * @return the meta object for class '<em>OrderSystem</em>'. >+ * @return the meta object for class '<em>Order System</em>'. > * @see ordersystem.OrderSystem > * @generated > */ >@@ -1242,4 +1243,471 @@ > */ > OrderSystemFactory getOrderSystemFactory(); > >+ /** >+ * <!-- begin-user-doc --> >+ * Defines literals for the meta objects that represent >+ * <ul> >+ * <li>each class,</li> >+ * <li>each feature of each class,</li> >+ * <li>each enum,</li> >+ * <li>and each data type</li> >+ * </ul> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ interface Literals { >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.OrderImpl <em>Order</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.OrderImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getOrder() >+ * @generated >+ */ >+ EClass ORDER = eINSTANCE.getOrder(); >+ >+ /** >+ * The meta object literal for the '<em><b>Placed On</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ORDER__PLACED_ON = eINSTANCE.getOrder_PlacedOn(); >+ >+ /** >+ * The meta object literal for the '<em><b>Filled On</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ORDER__FILLED_ON = eINSTANCE.getOrder_FilledOn(); >+ >+ /** >+ * The meta object literal for the '<em><b>Completed</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ORDER__COMPLETED = eINSTANCE.getOrder_Completed(); >+ >+ /** >+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ORDER__ID = eINSTANCE.getOrder_Id(); >+ >+ /** >+ * The meta object literal for the '<em><b>Owner</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ORDER__OWNER = eINSTANCE.getOrder_Owner(); >+ >+ /** >+ * The meta object literal for the '<em><b>Item</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ORDER__ITEM = eINSTANCE.getOrder_Item(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.ProductImpl <em>Product</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.ProductImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getProduct() >+ * @generated >+ */ >+ EClass PRODUCT = eINSTANCE.getProduct(); >+ >+ /** >+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute PRODUCT__NAME = eINSTANCE.getProduct_Name(); >+ >+ /** >+ * The meta object literal for the '<em><b>Sku</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute PRODUCT__SKU = eINSTANCE.getProduct_Sku(); >+ >+ /** >+ * The meta object literal for the '<em><b>Price</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute PRODUCT__PRICE = eINSTANCE.getProduct_Price(); >+ >+ /** >+ * The meta object literal for the '<em><b>Owner</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference PRODUCT__OWNER = eINSTANCE.getProduct_Owner(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.WarehouseImpl <em>Warehouse</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.WarehouseImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getWarehouse() >+ * @generated >+ */ >+ EClass WAREHOUSE = eINSTANCE.getWarehouse(); >+ >+ /** >+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute WAREHOUSE__NAME = eINSTANCE.getWarehouse_Name(); >+ >+ /** >+ * The meta object literal for the '<em><b>Owner</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference WAREHOUSE__OWNER = eINSTANCE.getWarehouse_Owner(); >+ >+ /** >+ * The meta object literal for the '<em><b>Item</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference WAREHOUSE__ITEM = eINSTANCE.getWarehouse_Item(); >+ >+ /** >+ * The meta object literal for the '<em><b>Location</b></em>' containment reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference WAREHOUSE__LOCATION = eINSTANCE.getWarehouse_Location(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.OrderSystemImpl <em>Order System</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.OrderSystemImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getOrderSystem() >+ * @generated >+ */ >+ EClass ORDER_SYSTEM = eINSTANCE.getOrderSystem(); >+ >+ /** >+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ORDER_SYSTEM__VERSION = eINSTANCE.getOrderSystem_Version(); >+ >+ /** >+ * The meta object literal for the '<em><b>Customer</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ORDER_SYSTEM__CUSTOMER = eINSTANCE.getOrderSystem_Customer(); >+ >+ /** >+ * The meta object literal for the '<em><b>Product</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ORDER_SYSTEM__PRODUCT = eINSTANCE.getOrderSystem_Product(); >+ >+ /** >+ * The meta object literal for the '<em><b>Warehouse</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ORDER_SYSTEM__WAREHOUSE = eINSTANCE.getOrderSystem_Warehouse(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.LineItemImpl <em>Line Item</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.LineItemImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getLineItem() >+ * @generated >+ */ >+ EClass LINE_ITEM = eINSTANCE.getLineItem(); >+ >+ /** >+ * The meta object literal for the '<em><b>Quantity</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute LINE_ITEM__QUANTITY = eINSTANCE.getLineItem_Quantity(); >+ >+ /** >+ * The meta object literal for the '<em><b>Discount</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute LINE_ITEM__DISCOUNT = eINSTANCE.getLineItem_Discount(); >+ >+ /** >+ * The meta object literal for the '<em><b>Owner</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference LINE_ITEM__OWNER = eINSTANCE.getLineItem_Owner(); >+ >+ /** >+ * The meta object literal for the '<em><b>Product</b></em>' reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference LINE_ITEM__PRODUCT = eINSTANCE.getLineItem_Product(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.InventoryItemImpl <em>Inventory Item</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.InventoryItemImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getInventoryItem() >+ * @generated >+ */ >+ EClass INVENTORY_ITEM = eINSTANCE.getInventoryItem(); >+ >+ /** >+ * The meta object literal for the '<em><b>In Stock</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute INVENTORY_ITEM__IN_STOCK = eINSTANCE.getInventoryItem_InStock(); >+ >+ /** >+ * The meta object literal for the '<em><b>Restock Threshold</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute INVENTORY_ITEM__RESTOCK_THRESHOLD = eINSTANCE.getInventoryItem_RestockThreshold(); >+ >+ /** >+ * The meta object literal for the '<em><b>Next Stock Date</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute INVENTORY_ITEM__NEXT_STOCK_DATE = eINSTANCE.getInventoryItem_NextStockDate(); >+ >+ /** >+ * The meta object literal for the '<em><b>Warehouse</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference INVENTORY_ITEM__WAREHOUSE = eINSTANCE.getInventoryItem_Warehouse(); >+ >+ /** >+ * The meta object literal for the '<em><b>Product</b></em>' reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference INVENTORY_ITEM__PRODUCT = eINSTANCE.getInventoryItem_Product(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.CustomerImpl <em>Customer</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.CustomerImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getCustomer() >+ * @generated >+ */ >+ EClass CUSTOMER = eINSTANCE.getCustomer(); >+ >+ /** >+ * The meta object literal for the '<em><b>Last Name</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CUSTOMER__LAST_NAME = eINSTANCE.getCustomer_LastName(); >+ >+ /** >+ * The meta object literal for the '<em><b>First Name</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute CUSTOMER__FIRST_NAME = eINSTANCE.getCustomer_FirstName(); >+ >+ /** >+ * The meta object literal for the '<em><b>Owner</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference CUSTOMER__OWNER = eINSTANCE.getCustomer_Owner(); >+ >+ /** >+ * The meta object literal for the '<em><b>Account</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference CUSTOMER__ACCOUNT = eINSTANCE.getCustomer_Account(); >+ >+ /** >+ * The meta object literal for the '<em><b>Order</b></em>' containment reference list feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference CUSTOMER__ORDER = eINSTANCE.getCustomer_Order(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.AddressImpl <em>Address</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.AddressImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getAddress() >+ * @generated >+ */ >+ EClass ADDRESS = eINSTANCE.getAddress(); >+ >+ /** >+ * The meta object literal for the '<em><b>Number</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__NUMBER = eINSTANCE.getAddress_Number(); >+ >+ /** >+ * The meta object literal for the '<em><b>Street</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__STREET = eINSTANCE.getAddress_Street(); >+ >+ /** >+ * The meta object literal for the '<em><b>Apartment</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__APARTMENT = eINSTANCE.getAddress_Apartment(); >+ >+ /** >+ * The meta object literal for the '<em><b>City</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__CITY = eINSTANCE.getAddress_City(); >+ >+ /** >+ * The meta object literal for the '<em><b>Province</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__PROVINCE = eINSTANCE.getAddress_Province(); >+ >+ /** >+ * The meta object literal for the '<em><b>Postal Code</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__POSTAL_CODE = eINSTANCE.getAddress_PostalCode(); >+ >+ /** >+ * The meta object literal for the '<em><b>Country</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ADDRESS__COUNTRY = eINSTANCE.getAddress_Country(); >+ >+ /** >+ * The meta object literal for the '{@link ordersystem.impl.AccountImpl <em>Account</em>}' class. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see ordersystem.impl.AccountImpl >+ * @see ordersystem.impl.OrderSystemPackageImpl#getAccount() >+ * @generated >+ */ >+ EClass ACCOUNT = eINSTANCE.getAccount(); >+ >+ /** >+ * The meta object literal for the '<em><b>Payment Method</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ACCOUNT__PAYMENT_METHOD = eINSTANCE.getAccount_PaymentMethod(); >+ >+ /** >+ * The meta object literal for the '<em><b>Account Number</b></em>' attribute feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EAttribute ACCOUNT__ACCOUNT_NUMBER = eINSTANCE.getAccount_AccountNumber(); >+ >+ /** >+ * The meta object literal for the '<em><b>Owner</b></em>' container reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ACCOUNT__OWNER = eINSTANCE.getAccount_Owner(); >+ >+ /** >+ * The meta object literal for the '<em><b>Billing Address</b></em>' containment reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ACCOUNT__BILLING_ADDRESS = eINSTANCE.getAccount_BillingAddress(); >+ >+ /** >+ * The meta object literal for the '<em><b>Shipping Address</b></em>' containment reference feature. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ EReference ACCOUNT__SHIPPING_ADDRESS = eINSTANCE.getAccount_ShippingAddress(); >+ >+ /** >+ * The meta object literal for the '<em>Java Date</em>' data type. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see java.util.Date >+ * @see ordersystem.impl.OrderSystemPackageImpl#getJavaDate() >+ * @generated >+ */ >+ EDataType JAVA_DATE = eINSTANCE.getJavaDate(); >+ >+ } >+ > } //OrderSystemPackage >Index: src/ordersystem/Address.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/Address.java,v >retrieving revision 1.2 >diff -u -r1.2 Address.java >--- src/ordersystem/Address.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/Address.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,7 +38,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getAddress() >- * >+ * @model > * @generated > */ > public interface Address extends EObject{ >@@ -53,7 +53,7 @@ > * @return the value of the '<em>Number</em>' attribute. > * @see #setNumber(String) > * @see ordersystem.OrderSystemPackage#getAddress_Number() >- * >+ * @model > * @generated > */ > String getNumber(); >@@ -79,7 +79,7 @@ > * @return the value of the '<em>Street</em>' attribute. > * @see #setStreet(String) > * @see ordersystem.OrderSystemPackage#getAddress_Street() >- * >+ * @model > * @generated > */ > String getStreet(); >@@ -105,7 +105,7 @@ > * @return the value of the '<em>Apartment</em>' attribute. > * @see #setApartment(String) > * @see ordersystem.OrderSystemPackage#getAddress_Apartment() >- * >+ * @model > * @generated > */ > String getApartment(); >@@ -131,7 +131,7 @@ > * @return the value of the '<em>City</em>' attribute. > * @see #setCity(String) > * @see ordersystem.OrderSystemPackage#getAddress_City() >- * >+ * @model > * @generated > */ > String getCity(); >@@ -157,7 +157,7 @@ > * @return the value of the '<em>Province</em>' attribute. > * @see #setProvince(String) > * @see ordersystem.OrderSystemPackage#getAddress_Province() >- * >+ * @model > * @generated > */ > String getProvince(); >@@ -183,7 +183,7 @@ > * @return the value of the '<em>Postal Code</em>' attribute. > * @see #setPostalCode(String) > * @see ordersystem.OrderSystemPackage#getAddress_PostalCode() >- * >+ * @model > * @generated > */ > String getPostalCode(); >@@ -209,7 +209,7 @@ > * @return the value of the '<em>Country</em>' attribute. > * @see #setCountry(String) > * @see ordersystem.OrderSystemPackage#getAddress_Country() >- * >+ * @model > * @generated > */ > String getCountry(); >Index: src/ordersystem/Warehouse.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/Warehouse.java,v >retrieving revision 1.2 >diff -u -r1.2 Warehouse.java >--- src/ordersystem/Warehouse.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/Warehouse.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -37,7 +37,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getWarehouse() >- * >+ * @model > * @generated > */ > public interface Warehouse extends EObject{ >@@ -52,7 +52,7 @@ > * @return the value of the '<em>Name</em>' attribute. > * @see #setName(String) > * @see ordersystem.OrderSystemPackage#getWarehouse_Name() >- * >+ * @model > * @generated > */ > String getName(); >@@ -108,10 +108,10 @@ > * @return the value of the '<em>Item</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getWarehouse_Item() > * @see ordersystem.InventoryItem#getWarehouse >- * @model type="ordersystem.InventoryItem" opposite="Warehouse" containment="true" >+ * @model opposite="Warehouse" containment="true" > * @generated > */ >- EList getItem(); >+ EList<InventoryItem> getItem(); > > /** > * Returns the value of the '<em><b>Location</b></em>' containment reference. >Index: src/ordersystem/LineItem.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/LineItem.java,v >retrieving revision 1.2 >diff -u -r1.2 LineItem.java >--- src/ordersystem/LineItem.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/LineItem.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -35,7 +35,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getLineItem() >- * >+ * @model > * @generated > */ > public interface LineItem extends EObject{ >@@ -50,7 +50,7 @@ > * @return the value of the '<em>Quantity</em>' attribute. > * @see #setQuantity(int) > * @see ordersystem.OrderSystemPackage#getLineItem_Quantity() >- * >+ * @model > * @generated > */ > int getQuantity(); >@@ -76,7 +76,7 @@ > * @return the value of the '<em>Discount</em>' attribute. > * @see #setDiscount(double) > * @see ordersystem.OrderSystemPackage#getLineItem_Discount() >- * >+ * @model > * @generated > */ > double getDiscount(); >@@ -148,7 +148,7 @@ > /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >- * @model parameters="" >+ * @model kind="operation" > * @generated > */ > double getCost(); >Index: src/ordersystem/Account.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/Account.java,v >retrieving revision 1.2 >diff -u -r1.2 Account.java >--- src/ordersystem/Account.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/Account.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -36,7 +36,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getAccount() >- * >+ * @model > * @generated > */ > public interface Account extends EObject{ >@@ -51,7 +51,7 @@ > * @return the value of the '<em>Payment Method</em>' attribute. > * @see #setPaymentMethod(String) > * @see ordersystem.OrderSystemPackage#getAccount_PaymentMethod() >- * >+ * @model > * @generated > */ > String getPaymentMethod(); >@@ -77,7 +77,7 @@ > * @return the value of the '<em>Account Number</em>' attribute. > * @see #setAccountNumber(String) > * @see ordersystem.OrderSystemPackage#getAccount_AccountNumber() >- * >+ * @model > * @generated > */ > String getAccountNumber(); >Index: src/ordersystem/OrderSystem.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/OrderSystem.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystem.java >--- src/ordersystem/OrderSystem.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/OrderSystem.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -37,7 +37,7 @@ > * </p> > * > * @see ordersystem.OrderSystemPackage#getOrderSystem() >- * >+ * @model > * @generated > */ > public interface OrderSystem extends EObject{ >@@ -52,7 +52,7 @@ > * @return the value of the '<em>Version</em>' attribute. > * @see #setVersion(int) > * @see ordersystem.OrderSystemPackage#getOrderSystem_Version() >- * >+ * @model > * @generated > */ > int getVersion(); >@@ -80,10 +80,10 @@ > * @return the value of the '<em>Customer</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getOrderSystem_Customer() > * @see ordersystem.Customer#getOwner >- * @model type="ordersystem.Customer" opposite="owner" containment="true" >+ * @model opposite="owner" containment="true" > * @generated > */ >- EList getCustomer(); >+ EList<Customer> getCustomer(); > > /** > * Returns the value of the '<em><b>Product</b></em>' containment reference list. >@@ -98,10 +98,10 @@ > * @return the value of the '<em>Product</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getOrderSystem_Product() > * @see ordersystem.Product#getOwner >- * @model type="ordersystem.Product" opposite="owner" containment="true" >+ * @model opposite="owner" containment="true" > * @generated > */ >- EList getProduct(); >+ EList<Product> getProduct(); > > /** > * Returns the value of the '<em><b>Warehouse</b></em>' containment reference list. >@@ -116,9 +116,9 @@ > * @return the value of the '<em>Warehouse</em>' containment reference list. > * @see ordersystem.OrderSystemPackage#getOrderSystem_Warehouse() > * @see ordersystem.Warehouse#getOwner >- * @model type="ordersystem.Warehouse" opposite="owner" containment="true" >+ * @model opposite="owner" containment="true" > * @generated > */ >- EList getWarehouse(); >+ EList<Warehouse> getWarehouse(); > > } // OrderSystem >Index: src/ordersystem/special/impl/SpecialFactoryImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/impl/SpecialFactoryImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 SpecialFactoryImpl.java >--- src/ordersystem/special/impl/SpecialFactoryImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/impl/SpecialFactoryImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -17,12 +17,16 @@ > > package ordersystem.special.impl; > >-import ordersystem.special.*; >+import ordersystem.special.LimitedEditionProduct; >+import ordersystem.special.PreferredCustomer; >+import ordersystem.special.SpecialFactory; >+import ordersystem.special.SpecialPackage; > > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EObject; >- >+import org.eclipse.emf.ecore.EPackage; > import org.eclipse.emf.ecore.impl.EFactoryImpl; >+import org.eclipse.emf.ecore.plugin.EcorePlugin; > > /** > * <!-- begin-user-doc --> >@@ -32,7 +36,26 @@ > */ > public class SpecialFactoryImpl extends EFactoryImpl implements SpecialFactory { > /** >- * Creates and instance of the factory. >+ * Creates the default factory implementation. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public static SpecialFactory init() { >+ try { >+ SpecialFactory theSpecialFactory = (SpecialFactory)EPackage.Registry.INSTANCE.getEFactory("http:///ordersystem/special.ecore"); //$NON-NLS-1$ >+ if (theSpecialFactory != null) { >+ return theSpecialFactory; >+ } >+ } >+ catch (Exception exception) { >+ EcorePlugin.INSTANCE.log(exception); >+ } >+ return new SpecialFactoryImpl(); >+ } >+ >+ /** >+ * Creates an instance of the factory. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> > * @generated >@@ -46,6 +69,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public EObject create(EClass eClass) { > switch (eClass.getClassifierID()) { > case SpecialPackage.PREFERRED_CUSTOMER: return createPreferredCustomer(); >@@ -90,6 +114,7 @@ > * @deprecated > * @generated > */ >+ @Deprecated > public static SpecialPackage getPackage() { > return SpecialPackage.eINSTANCE; > } >Index: src/ordersystem/special/impl/PreferredCustomerImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/impl/PreferredCustomerImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 PreferredCustomerImpl.java >--- src/ordersystem/special/impl/PreferredCustomerImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/impl/PreferredCustomerImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -17,28 +17,16 @@ > > package ordersystem.special.impl; > >-import java.util.Collection; > import java.util.Date; > >-import ordersystem.OrderSystem; >-import ordersystem.OrderSystemPackage; >- > import ordersystem.impl.CustomerImpl; >- > import ordersystem.special.PreferredCustomer; > import ordersystem.special.SpecialPackage; > > import org.eclipse.emf.common.notify.Notification; >-import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; >-import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > >-import org.eclipse.emf.ecore.util.InternalEList; >- > /** > * <!-- begin-user-doc --> > * An implementation of the model object '<em><b>Preferred Customer</b></em>'. >@@ -87,8 +75,9 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > protected EClass eStaticClass() { >- return SpecialPackage.eINSTANCE.getPreferredCustomer(); >+ return SpecialPackage.Literals.PREFERRED_CUSTOMER; > } > > /** >@@ -117,85 +106,13 @@ > * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, SpecialPackage.PREFERRED_CUSTOMER__OWNER, msgs); >- case SpecialPackage.PREFERRED_CUSTOMER__ACCOUNT: >- return ((InternalEList)getAccount()).basicAdd(otherEnd, msgs); >- case SpecialPackage.PREFERRED_CUSTOMER__ORDER: >- return ((InternalEList)getOrder()).basicAdd(otherEnd, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >- } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- return eBasicSetContainer(null, SpecialPackage.PREFERRED_CUSTOMER__OWNER, msgs); >- case SpecialPackage.PREFERRED_CUSTOMER__ACCOUNT: >- return ((InternalEList)getAccount()).basicRemove(otherEnd, msgs); >- case SpecialPackage.PREFERRED_CUSTOMER__ORDER: >- return ((InternalEList)getOrder()).basicRemove(otherEnd, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >- } >- return eBasicSetContainer(null, featureID, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__CUSTOMER, OrderSystem.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >- } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.PREFERRED_CUSTOMER__LAST_NAME: >- return getLastName(); >- case SpecialPackage.PREFERRED_CUSTOMER__FIRST_NAME: >- return getFirstName(); >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- return getOwner(); >- case SpecialPackage.PREFERRED_CUSTOMER__ACCOUNT: >- return getAccount(); >- case SpecialPackage.PREFERRED_CUSTOMER__ORDER: >- return getOrder(); >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case SpecialPackage.PREFERRED_CUSTOMER__SINCE: > return getSince(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** >@@ -203,30 +120,14 @@ > * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.PREFERRED_CUSTOMER__LAST_NAME: >- setLastName((String)newValue); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__FIRST_NAME: >- setFirstName((String)newValue); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- setOwner((OrderSystem)newValue); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__ACCOUNT: >- getAccount().clear(); >- getAccount().addAll((Collection)newValue); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__ORDER: >- getOrder().clear(); >- getOrder().addAll((Collection)newValue); >- return; >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case SpecialPackage.PREFERRED_CUSTOMER__SINCE: > setSince((Date)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** >@@ -234,28 +135,14 @@ > * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.PREFERRED_CUSTOMER__LAST_NAME: >- setLastName(LAST_NAME_EDEFAULT); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__FIRST_NAME: >- setFirstName(FIRST_NAME_EDEFAULT); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- setOwner((OrderSystem)null); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__ACCOUNT: >- getAccount().clear(); >- return; >- case SpecialPackage.PREFERRED_CUSTOMER__ORDER: >- getOrder().clear(); >- return; >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case SpecialPackage.PREFERRED_CUSTOMER__SINCE: > setSince(SINCE_EDEFAULT); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** >@@ -263,22 +150,13 @@ > * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.PREFERRED_CUSTOMER__LAST_NAME: >- return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName); >- case SpecialPackage.PREFERRED_CUSTOMER__FIRST_NAME: >- return FIRST_NAME_EDEFAULT == null ? firstName != null : !FIRST_NAME_EDEFAULT.equals(firstName); >- case SpecialPackage.PREFERRED_CUSTOMER__OWNER: >- return getOwner() != null; >- case SpecialPackage.PREFERRED_CUSTOMER__ACCOUNT: >- return account != null && !account.isEmpty(); >- case SpecialPackage.PREFERRED_CUSTOMER__ORDER: >- return order != null && !order.isEmpty(); >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case SpecialPackage.PREFERRED_CUSTOMER__SINCE: > return SINCE_EDEFAULT == null ? since != null : !SINCE_EDEFAULT.equals(since); > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > > /** >@@ -286,6 +164,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public String toString() { > if (eIsProxy()) return super.toString(); > >Index: src/ordersystem/special/impl/SpecialPackageImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/impl/SpecialPackageImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 SpecialPackageImpl.java >--- src/ordersystem/special/impl/SpecialPackageImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/impl/SpecialPackageImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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,9 +18,7 @@ > package ordersystem.special.impl; > > import ordersystem.OrderSystemPackage; >- > import ordersystem.impl.OrderSystemPackageImpl; >- > import ordersystem.special.LimitedEditionProduct; > import ordersystem.special.PreferredCustomer; > import ordersystem.special.SpecialFactory; >@@ -29,7 +27,6 @@ > import org.eclipse.emf.ecore.EAttribute; > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EPackage; >- > import org.eclipse.emf.ecore.impl.EPackageImpl; > > /** >@@ -102,24 +99,27 @@ > * @generated > */ > public static SpecialPackage init() { >- if (isInited) return (SpecialPackage)EPackage.Registry.INSTANCE.get(SpecialPackage.eNS_URI); >+ if (isInited) return (SpecialPackage)EPackage.Registry.INSTANCE.getEPackage(SpecialPackage.eNS_URI); > >- // Obtain or create and register package. >- SpecialPackageImpl theSpecialPackage = (SpecialPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SpecialPackageImpl()); >+ // Obtain or create and register package >+ SpecialPackageImpl theSpecialPackage = (SpecialPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SpecialPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SpecialPackageImpl()); > > isInited = true; > > // Obtain or create and register interdependencies >- OrderSystemPackageImpl theOrderSystemPackage = (OrderSystemPackageImpl)(EPackage.Registry.INSTANCE.get(OrderSystemPackage.eNS_URI) instanceof EPackage ? EPackage.Registry.INSTANCE.get(OrderSystemPackage.eNS_URI) : OrderSystemPackageImpl.eINSTANCE); >+ OrderSystemPackageImpl theOrderSystemPackage = (OrderSystemPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(OrderSystemPackage.eNS_URI) instanceof OrderSystemPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(OrderSystemPackage.eNS_URI) : OrderSystemPackage.eINSTANCE); > >- // Step 1: create meta-model objects >+ // Create package meta-data objects > theSpecialPackage.createPackageContents(); > theOrderSystemPackage.createPackageContents(); > >- // Step 2: complete initialization >+ // Initialize created meta-data > theSpecialPackage.initializePackageContents(); > theOrderSystemPackage.initializePackageContents(); > >+ // Mark meta-data to indicate it can't be changed >+ theSpecialPackage.freeze(); >+ > return theSpecialPackage; > } > >@@ -218,17 +218,21 @@ > setNsURI(eNS_URI); > > // Obtain other dependent packages >- OrderSystemPackageImpl theOrderSystemPackage = (OrderSystemPackageImpl)EPackage.Registry.INSTANCE.getEPackage(OrderSystemPackage.eNS_URI); >+ OrderSystemPackage theOrderSystemPackage = (OrderSystemPackage)EPackage.Registry.INSTANCE.getEPackage(OrderSystemPackage.eNS_URI); >+ >+ // Create type parameters >+ >+ // Set bounds for type parameters > > // Add supertypes to classes > preferredCustomerEClass.getESuperTypes().add(theOrderSystemPackage.getCustomer()); > limitedEditionProductEClass.getESuperTypes().add(theOrderSystemPackage.getProduct()); > > // Initialize classes and features; add operations and parameters >- initEClass(preferredCustomerEClass, PreferredCustomer.class, "PreferredCustomer", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getPreferredCustomer_Since(), theOrderSystemPackage.getJavaDate(), "since", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEClass(preferredCustomerEClass, PreferredCustomer.class, "PreferredCustomer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getPreferredCustomer_Since(), theOrderSystemPackage.getJavaDate(), "since", null, 0, 1, PreferredCustomer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ > >- initEClass(limitedEditionProductEClass, LimitedEditionProduct.class, "LimitedEditionProduct", !IS_ABSTRACT, !IS_INTERFACE); //$NON-NLS-1$ >- initEAttribute(getLimitedEditionProduct_AvailableUntil(), theOrderSystemPackage.getJavaDate(), "availableUntil", null, 0, 1, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ >+ initEClass(limitedEditionProductEClass, LimitedEditionProduct.class, "LimitedEditionProduct", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ >+ initEAttribute(getLimitedEditionProduct_AvailableUntil(), theOrderSystemPackage.getJavaDate(), "availableUntil", null, 0, 1, LimitedEditionProduct.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ > } > } //SpecialPackageImpl >Index: src/ordersystem/special/impl/LimitedEditionProductImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/impl/LimitedEditionProductImpl.java,v >retrieving revision 1.2 >diff -u -r1.2 LimitedEditionProductImpl.java >--- src/ordersystem/special/impl/LimitedEditionProductImpl.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/impl/LimitedEditionProductImpl.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -19,21 +19,12 @@ > > import java.util.Date; > >-import ordersystem.OrderSystem; >-import ordersystem.OrderSystemPackage; >- > import ordersystem.impl.ProductImpl; >- > import ordersystem.special.LimitedEditionProduct; > import ordersystem.special.SpecialPackage; > > import org.eclipse.emf.common.notify.Notification; >-import org.eclipse.emf.common.notify.NotificationChain; >- > import org.eclipse.emf.ecore.EClass; >-import org.eclipse.emf.ecore.EStructuralFeature; >-import org.eclipse.emf.ecore.InternalEObject; >- > import org.eclipse.emf.ecore.impl.ENotificationImpl; > > /** >@@ -84,8 +75,9 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > protected EClass eStaticClass() { >- return SpecialPackage.eINSTANCE.getLimitedEditionProduct(); >+ return SpecialPackage.Literals.LIMITED_EDITION_PRODUCT; > } > > /** >@@ -114,75 +106,13 @@ > * <!-- end-user-doc --> > * @generated > */ >- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER, msgs); >- default: >- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); >- } >- } >- if (eContainer != null) >- msgs = eBasicRemoveFromContainer(msgs); >- return eBasicSetContainer(otherEnd, featureID, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { >- if (featureID >= 0) { >- switch (eDerivedStructuralFeatureID(featureID, baseClass)) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- return eBasicSetContainer(null, SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER, msgs); >- default: >- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); >- } >- } >- return eBasicSetContainer(null, featureID, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) { >- if (eContainerFeatureID >= 0) { >- switch (eContainerFeatureID) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- return (eContainer).eInverseRemove(this, OrderSystemPackage.ORDER_SYSTEM__PRODUCT, OrderSystem.class, msgs); >- default: >- return eDynamicBasicRemoveFromContainer(msgs); >- } >- } >- return (eContainer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs); >- } >- >- /** >- * <!-- begin-user-doc --> >- * <!-- end-user-doc --> >- * @generated >- */ >- public Object eGet(EStructuralFeature eFeature, boolean resolve) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__NAME: >- return getName(); >- case SpecialPackage.LIMITED_EDITION_PRODUCT__SKU: >- return getSku(); >- case SpecialPackage.LIMITED_EDITION_PRODUCT__PRICE: >- return new Double(getPrice()); >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- return getOwner(); >+ @Override >+ public Object eGet(int featureID, boolean resolve, boolean coreType) { >+ switch (featureID) { > case SpecialPackage.LIMITED_EDITION_PRODUCT__AVAILABLE_UNTIL: > return getAvailableUntil(); > } >- return eDynamicGet(eFeature, resolve); >+ return super.eGet(featureID, resolve, coreType); > } > > /** >@@ -190,25 +120,14 @@ > * <!-- end-user-doc --> > * @generated > */ >- public void eSet(EStructuralFeature eFeature, Object newValue) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__NAME: >- setName((String)newValue); >- return; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__SKU: >- setSku((String)newValue); >- return; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__PRICE: >- setPrice(((Double)newValue).doubleValue()); >- return; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- setOwner((OrderSystem)newValue); >- return; >+ @Override >+ public void eSet(int featureID, Object newValue) { >+ switch (featureID) { > case SpecialPackage.LIMITED_EDITION_PRODUCT__AVAILABLE_UNTIL: > setAvailableUntil((Date)newValue); > return; > } >- eDynamicSet(eFeature, newValue); >+ super.eSet(featureID, newValue); > } > > /** >@@ -216,25 +135,14 @@ > * <!-- end-user-doc --> > * @generated > */ >- public void eUnset(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__NAME: >- setName(NAME_EDEFAULT); >- return; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__SKU: >- setSku(SKU_EDEFAULT); >- return; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__PRICE: >- setPrice(PRICE_EDEFAULT); >- return; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- setOwner((OrderSystem)null); >- return; >+ @Override >+ public void eUnset(int featureID) { >+ switch (featureID) { > case SpecialPackage.LIMITED_EDITION_PRODUCT__AVAILABLE_UNTIL: > setAvailableUntil(AVAILABLE_UNTIL_EDEFAULT); > return; > } >- eDynamicUnset(eFeature); >+ super.eUnset(featureID); > } > > /** >@@ -242,20 +150,13 @@ > * <!-- end-user-doc --> > * @generated > */ >- public boolean eIsSet(EStructuralFeature eFeature) { >- switch (eDerivedStructuralFeatureID(eFeature)) { >- case SpecialPackage.LIMITED_EDITION_PRODUCT__NAME: >- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); >- case SpecialPackage.LIMITED_EDITION_PRODUCT__SKU: >- return SKU_EDEFAULT == null ? sku != null : !SKU_EDEFAULT.equals(sku); >- case SpecialPackage.LIMITED_EDITION_PRODUCT__PRICE: >- return price != PRICE_EDEFAULT; >- case SpecialPackage.LIMITED_EDITION_PRODUCT__OWNER: >- return getOwner() != null; >+ @Override >+ public boolean eIsSet(int featureID) { >+ switch (featureID) { > case SpecialPackage.LIMITED_EDITION_PRODUCT__AVAILABLE_UNTIL: > return AVAILABLE_UNTIL_EDEFAULT == null ? availableUntil != null : !AVAILABLE_UNTIL_EDEFAULT.equals(availableUntil); > } >- return eDynamicIsSet(eFeature); >+ return super.eIsSet(featureID); > } > > /** >@@ -263,6 +164,7 @@ > * <!-- end-user-doc --> > * @generated > */ >+ @Override > public String toString() { > if (eIsProxy()) return super.toString(); > >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:07:08 -0000 1.2 >+++ .classpath 9 Nov 2007 00:41:18 -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.validation/tests/org.eclipse.emf.validation.tests/build.properties,v >retrieving revision 1.8 >diff -u -r1.8 build.properties >--- build.properties 6 Jun 2007 22:28:15 -0000 1.8 >+++ build.properties 9 Nov 2007 00:41:18 -0000 >@@ -30,5 +30,5 @@ > plugin.properties,\ > include_files/,\ > about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: src/ordersystem/special/util/SpecialSwitch.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/util/SpecialSwitch.java,v >retrieving revision 1.2 >diff -u -r1.2 SpecialSwitch.java >--- src/ordersystem/special/util/SpecialSwitch.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/util/SpecialSwitch.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -40,7 +40,7 @@ > * @see ordersystem.special.SpecialPackage > * @generated > */ >-public class SpecialSwitch { >+public class SpecialSwitch<T> { > /** > * The cached model package > * <!-- begin-user-doc --> >@@ -68,7 +68,7 @@ > * @return the first non-null result returned by a <code>caseXXX</code> call. > * @generated > */ >- public Object doSwitch(EObject theEObject) { >+ public T doSwitch(EObject theEObject) { > return doSwitch(theEObject.eClass(), theEObject); > } > >@@ -79,16 +79,16 @@ > * @return the first non-null result returned by a <code>caseXXX</code> call. > * @generated > */ >- protected Object doSwitch(EClass theEClass, EObject theEObject) { >+ protected T doSwitch(EClass theEClass, EObject theEObject) { > if (theEClass.eContainer() == modelPackage) { > return doSwitch(theEClass.getClassifierID(), theEObject); > } > else { >- List eSuperTypes = theEClass.getESuperTypes(); >+ List<EClass> eSuperTypes = theEClass.getESuperTypes(); > return > eSuperTypes.isEmpty() ? > defaultCase(theEObject) : >- doSwitch((EClass)eSuperTypes.get(0), theEObject); >+ doSwitch(eSuperTypes.get(0), theEObject); > } > } > >@@ -99,18 +99,18 @@ > * @return the first non-null result returned by a <code>caseXXX</code> call. > * @generated > */ >- protected Object doSwitch(int classifierID, EObject theEObject) { >+ protected T doSwitch(int classifierID, EObject theEObject) { > switch (classifierID) { > case SpecialPackage.PREFERRED_CUSTOMER: { > PreferredCustomer preferredCustomer = (PreferredCustomer)theEObject; >- Object result = casePreferredCustomer(preferredCustomer); >+ T result = casePreferredCustomer(preferredCustomer); > if (result == null) result = caseCustomer(preferredCustomer); > if (result == null) result = defaultCase(theEObject); > return result; > } > case SpecialPackage.LIMITED_EDITION_PRODUCT: { > LimitedEditionProduct limitedEditionProduct = (LimitedEditionProduct)theEObject; >- Object result = caseLimitedEditionProduct(limitedEditionProduct); >+ T result = caseLimitedEditionProduct(limitedEditionProduct); > if (result == null) result = caseProduct(limitedEditionProduct); > if (result == null) result = defaultCase(theEObject); > return result; >@@ -120,77 +120,77 @@ > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Preferred Customer</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Preferred Customer</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Preferred Customer</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Preferred Customer</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object casePreferredCustomer(PreferredCustomer object) { >+ public T casePreferredCustomer(PreferredCustomer object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Limited Edition Product</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Limited Edition Product</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Limited Edition Product</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Limited Edition Product</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseLimitedEditionProduct(LimitedEditionProduct object) { >+ public T caseLimitedEditionProduct(LimitedEditionProduct object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Customer</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Customer</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Customer</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Customer</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseCustomer(Customer object) { >+ public T caseCustomer(Customer object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Product</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Product</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Product</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Product</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseProduct(Product object) { >+ public T caseProduct(Product object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch, but this is the last case anyway. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>EObject</em>'. >+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) > * @generated > */ >- public Object defaultCase(EObject object) { >+ public T defaultCase(EObject object) { > return null; > } > >Index: src/ordersystem/special/util/SpecialAdapterFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/special/util/SpecialAdapterFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 SpecialAdapterFactory.java >--- src/ordersystem/special/util/SpecialAdapterFactory.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/special/util/SpecialAdapterFactory.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -66,6 +66,7 @@ > * @return whether this factory is applicable for the type of the object. > * @generated > */ >+ @Override > public boolean isFactoryForType(Object object) { > if (object == modelPackage) { > return true; >@@ -82,21 +83,26 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected SpecialSwitch modelSwitch = >- new SpecialSwitch() { >- public Object casePreferredCustomer(PreferredCustomer object) { >+ protected SpecialSwitch<Adapter> modelSwitch = >+ new SpecialSwitch<Adapter>() { >+ @Override >+ public Adapter casePreferredCustomer(PreferredCustomer object) { > return createPreferredCustomerAdapter(); > } >- public Object caseLimitedEditionProduct(LimitedEditionProduct object) { >+ @Override >+ public Adapter caseLimitedEditionProduct(LimitedEditionProduct object) { > return createLimitedEditionProductAdapter(); > } >- public Object caseCustomer(Customer object) { >+ @Override >+ public Adapter caseCustomer(Customer object) { > return createCustomerAdapter(); > } >- public Object caseProduct(Product object) { >+ @Override >+ public Adapter caseProduct(Product object) { > return createProductAdapter(); > } >- public Object defaultCase(EObject object) { >+ @Override >+ public Adapter defaultCase(EObject object) { > return createEObjectAdapter(); > } > }; >@@ -109,8 +115,9 @@ > * @return the adapter for the <code>target</code>. > * @generated > */ >+ @Override > public Adapter createAdapter(Notifier target) { >- return (Adapter)modelSwitch.doSwitch((EObject)target); >+ return modelSwitch.doSwitch((EObject)target); > } > > >Index: src/ordersystem/util/OrderSystemSwitch.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/util/OrderSystemSwitch.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemSwitch.java >--- src/ordersystem/util/OrderSystemSwitch.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/util/OrderSystemSwitch.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -37,7 +37,7 @@ > * @see ordersystem.OrderSystemPackage > * @generated > */ >-public class OrderSystemSwitch { >+public class OrderSystemSwitch<T> { > /** > * The cached model package > * <!-- begin-user-doc --> >@@ -65,7 +65,7 @@ > * @return the first non-null result returned by a <code>caseXXX</code> call. > * @generated > */ >- public Object doSwitch(EObject theEObject) { >+ public T doSwitch(EObject theEObject) { > return doSwitch(theEObject.eClass(), theEObject); > } > >@@ -76,16 +76,16 @@ > * @return the first non-null result returned by a <code>caseXXX</code> call. > * @generated > */ >- protected Object doSwitch(EClass theEClass, EObject theEObject) { >+ protected T doSwitch(EClass theEClass, EObject theEObject) { > if (theEClass.eContainer() == modelPackage) { > return doSwitch(theEClass.getClassifierID(), theEObject); > } > else { >- List eSuperTypes = theEClass.getESuperTypes(); >+ List<EClass> eSuperTypes = theEClass.getESuperTypes(); > return > eSuperTypes.isEmpty() ? > defaultCase(theEObject) : >- doSwitch((EClass)eSuperTypes.get(0), theEObject); >+ doSwitch(eSuperTypes.get(0), theEObject); > } > } > >@@ -96,59 +96,59 @@ > * @return the first non-null result returned by a <code>caseXXX</code> call. > * @generated > */ >- protected Object doSwitch(int classifierID, EObject theEObject) { >+ protected T doSwitch(int classifierID, EObject theEObject) { > switch (classifierID) { > case OrderSystemPackage.ORDER: { > Order order = (Order)theEObject; >- Object result = caseOrder(order); >+ T result = caseOrder(order); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.PRODUCT: { > Product product = (Product)theEObject; >- Object result = caseProduct(product); >+ T result = caseProduct(product); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.WAREHOUSE: { > Warehouse warehouse = (Warehouse)theEObject; >- Object result = caseWarehouse(warehouse); >+ T result = caseWarehouse(warehouse); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.ORDER_SYSTEM: { > OrderSystem orderSystem = (OrderSystem)theEObject; >- Object result = caseOrderSystem(orderSystem); >+ T result = caseOrderSystem(orderSystem); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.LINE_ITEM: { > LineItem lineItem = (LineItem)theEObject; >- Object result = caseLineItem(lineItem); >+ T result = caseLineItem(lineItem); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.INVENTORY_ITEM: { > InventoryItem inventoryItem = (InventoryItem)theEObject; >- Object result = caseInventoryItem(inventoryItem); >+ T result = caseInventoryItem(inventoryItem); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.CUSTOMER: { > Customer customer = (Customer)theEObject; >- Object result = caseCustomer(customer); >+ T result = caseCustomer(customer); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.ADDRESS: { > Address address = (Address)theEObject; >- Object result = caseAddress(address); >+ T result = caseAddress(address); > if (result == null) result = defaultCase(theEObject); > return result; > } > case OrderSystemPackage.ACCOUNT: { > Account account = (Account)theEObject; >- Object result = caseAccount(account); >+ T result = caseAccount(account); > if (result == null) result = defaultCase(theEObject); > return result; > } >@@ -157,152 +157,152 @@ > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>OrderSystem</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Order System</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>OrderSystem</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Order System</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseOrderSystem(OrderSystem object) { >+ public T caseOrderSystem(OrderSystem object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Customer</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Customer</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Customer</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Customer</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseCustomer(Customer object) { >+ public T caseCustomer(Customer object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Account</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Account</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Account</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Account</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseAccount(Account object) { >+ public T caseAccount(Account object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Address</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Address</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Address</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Address</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseAddress(Address object) { >+ public T caseAddress(Address object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Order</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Order</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Order</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Order</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseOrder(Order object) { >+ public T caseOrder(Order object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Line Item</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Line Item</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Line Item</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Line Item</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseLineItem(LineItem object) { >+ public T caseLineItem(LineItem object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Product</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Product</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Product</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Product</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseProduct(Product object) { >+ public T caseProduct(Product object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Warehouse</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Warehouse</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Warehouse</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Warehouse</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseWarehouse(Warehouse object) { >+ public T caseWarehouse(Warehouse object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>Inventory Item</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>Inventory Item</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>Inventory Item</em>'. >+ * @return the result of interpreting the object as an instance of '<em>Inventory Item</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) > * @generated > */ >- public Object caseInventoryItem(InventoryItem object) { >+ public T caseInventoryItem(InventoryItem object) { > return null; > } > > /** >- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'. >+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. > * <!-- begin-user-doc --> > * This implementation returns null; > * returning a non-null result will terminate the switch, but this is the last case anyway. > * <!-- end-user-doc --> > * @param object the target of the switch. >- * @return the result of interpretting the object as an instance of '<em>EObject</em>'. >+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'. > * @see #doSwitch(org.eclipse.emf.ecore.EObject) > * @generated > */ >- public Object defaultCase(EObject object) { >+ public T defaultCase(EObject object) { > return null; > } > >Index: src/ordersystem/util/OrderSystemAdapterFactory.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/ordersystem/util/OrderSystemAdapterFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 OrderSystemAdapterFactory.java >--- src/ordersystem/util/OrderSystemAdapterFactory.java 29 Nov 2005 16:52:51 -0000 1.2 >+++ src/ordersystem/util/OrderSystemAdapterFactory.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2005 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 >@@ -63,7 +63,8 @@ > * @return whether this factory is applicable for the type of the object. > * @generated > */ >- public boolean isFactoryForType(Object object) { >+ @Override >+ public boolean isFactoryForType(Object object) { > if (object == modelPackage) { > return true; > } >@@ -79,36 +80,46 @@ > * <!-- end-user-doc --> > * @generated > */ >- protected OrderSystemSwitch modelSwitch = >- new OrderSystemSwitch() { >- public Object caseOrder(Order object) { >+ protected OrderSystemSwitch<Adapter> modelSwitch = >+ new OrderSystemSwitch<Adapter>() { >+ @Override >+ public Adapter caseOrder(Order object) { > return createOrderAdapter(); > } >- public Object caseProduct(Product object) { >+ @Override >+ public Adapter caseProduct(Product object) { > return createProductAdapter(); > } >- public Object caseWarehouse(Warehouse object) { >+ @Override >+ public Adapter caseWarehouse(Warehouse object) { > return createWarehouseAdapter(); > } >- public Object caseOrderSystem(OrderSystem object) { >+ @Override >+ public Adapter caseOrderSystem(OrderSystem object) { > return createOrderSystemAdapter(); > } >- public Object caseLineItem(LineItem object) { >+ @Override >+ public Adapter caseLineItem(LineItem object) { > return createLineItemAdapter(); > } >- public Object caseInventoryItem(InventoryItem object) { >+ @Override >+ public Adapter caseInventoryItem(InventoryItem object) { > return createInventoryItemAdapter(); > } >- public Object caseCustomer(Customer object) { >+ @Override >+ public Adapter caseCustomer(Customer object) { > return createCustomerAdapter(); > } >- public Object caseAddress(Address object) { >+ @Override >+ public Adapter caseAddress(Address object) { > return createAddressAdapter(); > } >- public Object caseAccount(Account object) { >+ @Override >+ public Adapter caseAccount(Account object) { > return createAccountAdapter(); > } >- public Object defaultCase(EObject object) { >+ @Override >+ public Adapter defaultCase(EObject object) { > return createEObjectAdapter(); > } > }; >@@ -121,13 +132,14 @@ > * @return the adapter for the <code>target</code>. > * @generated > */ >- public Adapter createAdapter(Notifier target) { >- return (Adapter)modelSwitch.doSwitch((EObject)target); >+ @Override >+ public Adapter createAdapter(Notifier target) { >+ return modelSwitch.doSwitch((EObject)target); > } > > > /** >- * Creates a new adapter for an object of class '{@link ordersystem.OrderSystem <em>OrderSystem</em>}'. >+ * Creates a new adapter for an object of class '{@link ordersystem.OrderSystem <em>Order System</em>}'. > * <!-- begin-user-doc --> > * This default implementation returns null so that we can easily ignore cases; > * it's useful to ignore a case when inheritance will catch all the cases anyway. >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/META-INF/MANIFEST.MF,v >retrieving revision 1.12 >diff -u -r1.12 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Nov 2007 17:30:08 -0000 1.12 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:18 -0000 >@@ -30,4 +30,4 @@ > org.eclipse.emf.validation.ui;bundle-version="1.1.100", > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: model/order.genmodel >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/model/order.genmodel,v >retrieving revision 1.1 >diff -u -r1.1 order.genmodel >--- model/order.genmodel 27 Oct 2005 17:28:03 -0000 1.1 >+++ model/order.genmodel 9 Nov 2007 00:41:18 -0000 >@@ -4,7 +4,8 @@ > xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.validation.tests/src" > editDirectory="/org.eclipse.emf.validation.tests.edit/src" editorDirectory="/org.eclipse.emf.validation.tests.editor/src" > modelPluginID="org.eclipse.emf.validation.tests" modelName="Order" editPluginClass="ordersystem.provider.OrderEditPlugin" >- editorPluginClass="ordersystem.presentation.OrderEditorPlugin" nonNLSMarkers="true"> >+ editorPluginClass="ordersystem.presentation.OrderEditorPlugin" nonNLSMarkers="true" >+ complianceLevel="5.0"> > <foreignModel>OrderSystem.mdl</foreignModel> > <genPackages prefix="OrderSystem" ecorePackage="OrderSystem.ecore#/"> > <genDataTypes ecoreDataType="OrderSystem.ecore#//JavaDate"/> >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/GetLiveConstraintsOperationTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/GetLiveConstraintsOperationTest.java,v >retrieving revision 1.3 >diff -u -r1.3 GetLiveConstraintsOperationTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/GetLiveConstraintsOperationTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/GetLiveConstraintsOperationTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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,6 +26,7 @@ > > import org.eclipse.emf.validation.EMFEventType; > import org.eclipse.emf.validation.internal.service.GetLiveConstraintsOperation; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.tests.TestNotification; > > /** >@@ -49,6 +50,7 @@ > /* (non-Javadoc) > * Extends the inherited method. > */ >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -84,18 +86,16 @@ > } > > public void test_execute() { >- Object o = getFixture().execute(new TestProvider()); >- assertNotNull(o); >- assertTrue("Execution result not collection", o instanceof Collection);//$NON-NLS-1$ >+ Collection<IModelConstraint> c = getFixture().execute(new TestProvider()); >+ assertNotNull(c); > >- Collection c = (Collection)o; > assertTrue("Token not found", c.contains(LIVE_TOKEN));//$NON-NLS-1$ > } > > public void test_getConstraints() { > getFixture().execute(new TestProvider()); > >- Collection c = getFixture().getConstraints(); >+ Collection<IModelConstraint> c = getFixture().getConstraints(); > > // check that the token is in this collection > assertTrue("Token not found", c.contains(LIVE_TOKEN)); //$NON-NLS-1$ >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/LiveValidatorTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/LiveValidatorTest.java,v >retrieving revision 1.5 >diff -u -r1.5 LiveValidatorTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/LiveValidatorTest.java 21 Mar 2007 21:06:30 -0000 1.5 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/LiveValidatorTest.java 9 Nov 2007 00:41:18 -0000 >@@ -17,7 +17,6 @@ > > package org.eclipse.emf.validation.internal.service.impl.tests; > >-import java.util.Arrays; > import java.util.Collections; > import java.util.List; > >@@ -28,8 +27,7 @@ > import ordersystem.OrderSystemFactory; > import ordersystem.OrderSystemPackage; > import ordersystem.Product; >-import ordersystem.special.impl.SpecialFactoryImpl; >- >+import ordersystem.special.SpecialFactory; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.impl.AdapterImpl; >@@ -43,7 +41,6 @@ > import org.eclipse.emf.validation.internal.service.LiveValidator; > import org.eclipse.emf.validation.model.EvaluationMode; > import org.eclipse.emf.validation.service.ILiveValidator; >-import org.eclipse.emf.validation.service.IValidator; > import org.eclipse.emf.validation.service.ModelValidationService; > import org.eclipse.emf.validation.tests.TestBase; > import org.eclipse.emf.validation.tests.TestNotification; >@@ -68,6 +65,7 @@ > /* (non-Javadoc) > * Extends the inherited method. > */ >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -101,7 +99,7 @@ > * Class to test for IStatus validate(Object) > */ > public void test_validate_object() { >- Object target = new TestNotification( >+ Notification target = new TestNotification( > OrderSystemFactory.eINSTANCE.createProduct(), > Notification.SET, > OrderSystemPackage.PRODUCT__SKU, >@@ -113,13 +111,6 @@ > } catch (Exception e) { > fail("Should not throw."); //$NON-NLS-1$ > } >- >- try { >- getValidator().validate("foo"); //$NON-NLS-1$ >- fail("Should throw."); //$NON-NLS-1$ >- } catch (Exception e) { >- // good >- } > } > > /* >@@ -144,7 +135,7 @@ > * Class to test for IStatus validate(Collection) > */ > public void test_validateCollection() { >- Object target = new TestNotification( >+ Notification target = new TestNotification( > OrderSystemFactory.eINSTANCE.createProduct(), > Notification.SET, > OrderSystemPackage.PRODUCT__SKU, >@@ -153,17 +144,10 @@ > > try { > getValidator().validate(Collections.singleton(target)); >- getValidator().validate(Collections.EMPTY_SET); >+ getValidator().validate(Collections.<Notification>emptySet()); > } catch (Exception e) { > fail("Should not throw."); //$NON-NLS-1$ > } >- >- try { >- getValidator().validate(Collections.singleton("foo")); //$NON-NLS-1$ >- fail("Should throw."); //$NON-NLS-1$ >- } catch (Exception e) { >- // good >- } > } > > private OrderSystem createOrderSystem() { >@@ -187,7 +171,7 @@ > os.getCustomer().add(c); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -219,7 +203,7 @@ > } > > // add a few customers, individually, to record separate notifications >- List customers = new java.util.ArrayList(); >+ List<Customer> customers = new java.util.ArrayList<Customer>(); > Customer c = OrderSystemFactory.eINSTANCE.createCustomer(); > os.getCustomer().add(c); // one > customers.add(c); >@@ -231,7 +215,7 @@ > customers.add(c); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -256,7 +240,7 @@ > OrderSystem os = createOrderSystem(); > > // add a few customers >- List customers = new java.util.ArrayList(); >+ List<Customer> customers = new java.util.ArrayList<Customer>(); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); >@@ -271,11 +255,11 @@ > } > > // remove a customer >- Customer c = (Customer) customers.get(0); >+ Customer c = customers.get(0); > os.getCustomer().remove(c); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -300,7 +284,7 @@ > OrderSystem os = createOrderSystem(); > > // add a few customers >- List customers = new java.util.ArrayList(); >+ List<Customer> customers = new java.util.ArrayList<Customer>(); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); >@@ -320,7 +304,7 @@ > os.getCustomer().remove(customers.get(2)); // three > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -345,7 +329,7 @@ > OrderSystem os = createOrderSystem(); > > // add a few customers >- List customers = new java.util.ArrayList(); >+ List<Customer> customers = new java.util.ArrayList<Customer>(); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); >@@ -363,7 +347,7 @@ > os.getCustomer().move(0, 2); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -388,7 +372,7 @@ > OrderSystem os = createOrderSystem(); > > // add a few customers >- List customers = new java.util.ArrayList(); >+ List<Customer> customers = new java.util.ArrayList<Customer>(); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); > customers.add(OrderSystemFactory.eINSTANCE.createCustomer()); >@@ -408,7 +392,7 @@ > os.getCustomer().move(0, 1); // three > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -444,7 +428,7 @@ > os.eAdapters().remove(ng); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -484,7 +468,7 @@ > os.eAdapters().remove(ng); // three > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -519,7 +503,7 @@ > os.setVersion(3); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -556,7 +540,7 @@ > os.setVersion(3); > > // validate the changes, using a real validator >- IValidator realValidator = >+ ILiveValidator realValidator = > ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > realValidator.validate(ng.getNotifications()); > >@@ -581,7 +565,8 @@ > EObject object = OrderSystemFactory.eINSTANCE.createOrder(); // Don't add to a resource > Notification event = new TestNotification(object, Notification.SET); > >- ILiveValidator localValidator = (ILiveValidator)ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); >+ ILiveValidator localValidator = ModelValidationService.getInstance().newValidator( >+ EvaluationMode.LIVE); > localValidator.setReportSuccesses(true); > IStatus[] status = getStatuses(localValidator.validate(event)); > >@@ -589,29 +574,22 @@ > assertAllConstraintsNotPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasName", //$NON-NLS-1$ >- ID_PREFIX + "order.hasOwner", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasName", //$NON-NLS-1$ >+ ID_PREFIX + "order.hasOwner"); //$NON-NLS-1$ > } > > public void test_notficationFilterCustom_177653() { > EObject object = OrderSystemFactory.eINSTANCE.createOrder(); > Notification event = new TestNotification(object, Notification.SET); > >- ILiveValidator localValidator = (ILiveValidator)ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); >+ ILiveValidator localValidator = ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > localValidator.setReportSuccesses(true); > > // Set notification filter which accepts eObjects that are not attached > // to a resource >- localValidator.setNotificationFilter(new FilteredCollection.Filter() { >- public boolean accept(Object element) { >- if (element instanceof Notification) { >- Notification notification = (Notification)element; >- return (notification.getNotifier() instanceof EObject); >- } >- >- return false; >+ localValidator.setNotificationFilter(new FilteredCollection.Filter<Notification>() { >+ public boolean accept(Notification element) { >+ return (element.getNotifier() instanceof EObject); > }}); > > IStatus[] status = getStatuses(localValidator.validate(event)); >@@ -619,16 +597,14 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "order.hasName", //$NON-NLS-1$ >- ID_PREFIX + "order.hasOwner", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "order.hasName", //$NON-NLS-1$ >+ ID_PREFIX + "order.hasOwner"); //$NON-NLS-1$ > } > > public void test_notificationGenerator_177647() { > Order order = OrderSystemFactory.eINSTANCE.createOrder(); > LineItem item = OrderSystemFactory.eINSTANCE.createLineItem(); >- Product product = SpecialFactoryImpl.eINSTANCE.createLimitedEditionProduct(); >+ Product product = SpecialFactory.eINSTANCE.createLimitedEditionProduct(); > > Resource res = new XMIResourceImpl(); > >@@ -641,7 +617,7 @@ > > Notification event = new TestNotification(order, Notification.SET); > >- ILiveValidator localValidator = (ILiveValidator)ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); >+ ILiveValidator localValidator = ModelValidationService.getInstance().newValidator(EvaluationMode.LIVE); > localValidator.setReportSuccesses(true); > > IStatus[] status = getStatuses(localValidator.validate(event)); >@@ -649,30 +625,29 @@ > assertAllConstraintsPresent( > "live", //$NON-NLS-1$ > status, >- Arrays.asList(new String[] { >- ID_PREFIX + "limitedEdition.canIncludeInSpecial", //$NON-NLS-1$ >- })); >+ ID_PREFIX + "limitedEdition.canIncludeInSpecial"); //$NON-NLS-1$ > > // Ensure that a constraint targeted at ALL events (eg using wildcard), > // does not get triggered see > // XMLConstraintDescriptor#targetsEvent(Notification) > assertAllConstraintsNotPresent( >- "live", status, Arrays.asList(new String[] { //$NON-NLS-1$ >- ID_PREFIX + "limitedEdition.hasDates", //$NON-NLS-1$ >- })); >+ "live", status, //$NON-NLS-1$ >+ ID_PREFIX + "limitedEdition.hasDates"); //$NON-NLS-1$ > } > > private static class NotificationGatherer extends AdapterImpl { >- private List notifications = new java.util.ArrayList(); >+ private final List<Notification> notifications = >+ new java.util.ArrayList<Notification>(); > > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >+ @Override > public void notifyChanged(Notification msg) { > notifications.add(msg); > } > >- List getNotifications() { >+ List<Notification> getNotifications() { > return notifications; > } > >@@ -691,6 +666,7 @@ > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >+ @Override > public IStatus validate(IValidationContext ctx) { > instance = this; > invocationCount++; >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintCacheTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintCacheTest.java,v >retrieving revision 1.3 >diff -u -r1.3 ConstraintCacheTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintCacheTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintCacheTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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 >@@ -28,6 +28,7 @@ > import org.eclipse.emf.validation.internal.service.ConstraintCache; > import org.eclipse.emf.validation.internal.service.IProviderDescriptor; > import org.eclipse.emf.validation.internal.service.IProviderOperation; >+import org.eclipse.emf.validation.model.IModelConstraint; > import org.eclipse.emf.validation.service.IModelConstraintProvider; > import org.eclipse.emf.validation.tests.TestNotification; > >@@ -54,6 +55,7 @@ > /* (non-Javadoc) > * Extends the inherited method. > */ >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -77,14 +79,14 @@ > } > > public void test_getProviders() { >- Collection c = getFixture().getProviders(); >+ Collection<IProviderDescriptor> c = getFixture().getProviders(); > > assertNotNull("Collection is null", c); //$NON-NLS-1$ > assertFalse("Collection is empty", c.isEmpty()); //$NON-NLS-1$ > } > > public void test_addProvider() { >- Collection c = getFixture().getProviders(); >+ Collection<IProviderDescriptor> c = getFixture().getProviders(); > > assertNotNull("Collection is null", c); //$NON-NLS-1$ > assertTrue("Provider not found", c.contains(provider)); //$NON-NLS-1$ >@@ -93,7 +95,7 @@ > public void test_getBatchConstraints() { > assertTrue("Hit count should be zero", batchHits == 0); //$NON-NLS-1$ > >- Collection c = getFixture().getBatchConstraints( >+ Collection<IModelConstraint> c = getFixture().getBatchConstraints( > OrderSystemFactory.eINSTANCE.createProduct(), > null); > >@@ -114,7 +116,7 @@ > public void test_getLiveConstraints() { > assertTrue("Hit count should be zero", liveHits == 0); //$NON-NLS-1$ > >- Collection c = getFixture().getLiveConstraints( >+ Collection<IModelConstraint> c = getFixture().getLiveConstraints( > new TestNotification( > OrderSystemFactory.eINSTANCE.createProduct(), > Notification.SET), >@@ -139,7 +141,8 @@ > static class TestDescriptor implements IProviderDescriptor { > private final IModelConstraintProvider testProvider = new TestProvider(); > >- public boolean provides(IProviderOperation operation) { >+ public boolean provides( >+ IProviderOperation<? extends Collection<? extends IModelConstraint>> operation) { > return true; > } > >@@ -163,17 +166,19 @@ > static class TestProvider > extends AbstractGetConstraintsOperationTest.TestProvider { > >- public Collection getBatchConstraints( >+ @Override >+ public Collection<IModelConstraint> getBatchConstraints( > EObject eObject, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > > batchHits++; > return super.getBatchConstraints(eObject, constraints); > } > >- public Collection getLiveConstraints( >+ @Override >+ public Collection<IModelConstraint> getLiveConstraints( > Notification notification, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > > liveHits++; > return super.getLiveConstraints(notification, constraints); >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/BatchValidatorTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/BatchValidatorTest.java,v >retrieving revision 1.3 >diff -u -r1.3 BatchValidatorTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/BatchValidatorTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/BatchValidatorTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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 >@@ -29,6 +29,7 @@ > import org.eclipse.emf.validation.internal.service.IProviderOperation; > import org.eclipse.emf.validation.internal.service.IProviderOperationExecutor; > import org.eclipse.emf.validation.model.EvaluationMode; >+import org.eclipse.emf.validation.model.IModelConstraint; > > import junit.framework.TestCase; > >@@ -51,6 +52,7 @@ > /* (non-Javadoc) > * Extends the inherited method. > */ >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -84,41 +86,27 @@ > * Class to test for IStatus validate(Object) > */ > public void test_validate_object() { >- Object target = OrderSystemFactory.eINSTANCE.createProduct(); >+ EObject target = OrderSystemFactory.eINSTANCE.createProduct(); > > try { > getValidator().validate(target); > } catch (Exception e) { > fail("Should not throw."); //$NON-NLS-1$ > } >- >- try { >- getValidator().validate("foo"); //$NON-NLS-1$ >- fail("Should throw."); //$NON-NLS-1$ >- } catch (Exception e) { >- // good >- } > } > > /* > * Class to test for IStatus validate(Collection) > */ > public void test_validateCollection() { >- Object target = OrderSystemFactory.eINSTANCE.createProduct(); >+ EObject target = OrderSystemFactory.eINSTANCE.createProduct(); > > try { > getValidator().validate(Collections.singleton(target)); >- getValidator().validate(Collections.EMPTY_SET); >+ getValidator().validate(Collections.<EObject>emptySet()); > } catch (Exception e) { > fail("Should not throw."); //$NON-NLS-1$ > } >- >- try { >- getValidator().validate(Collections.singleton("foo")); //$NON-NLS-1$ >- fail("Should throw."); //$NON-NLS-1$ >- } catch (Exception e) { >- // good >- } > } > > public void test_isIncludeLiveConstraints() { >@@ -163,7 +151,7 @@ > public void test_validate_Collection_IProgressMonitor() { > TestMonitor monitor = new TestMonitor(); > >- Collection targets = new java.util.LinkedList(); >+ Collection<EObject> targets = new java.util.ArrayList<EObject>(); > targets.add(OrderSystemFactory.eINSTANCE.createProduct()); > targets.add(OrderSystemFactory.eINSTANCE.createProduct()); > >@@ -233,11 +221,12 @@ > } > } > >- static class TestExecutor implements IProviderOperationExecutor { >+ static class TestExecutor >+ implements IProviderOperationExecutor<Collection<IModelConstraint>> { > /* (non-Javadoc) > * Implements the inherited method. > */ >- public void execute(IProviderOperation op) { >+ public void execute(IProviderOperation<? extends Collection<IModelConstraint>> op) { > // don't need to do anything > } > } >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintDescriptorTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintDescriptorTest.java,v >retrieving revision 1.5 >diff -u -r1.5 ConstraintDescriptorTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintDescriptorTest.java 10 Oct 2006 14:31:05 -0000 1.5 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/ConstraintDescriptorTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 @@ > package org.eclipse.emf.validation.internal.service.impl.tests; > > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > import java.util.Map; > import java.util.Set; >@@ -34,6 +33,7 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.InvalidRegistryObjectException; > import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.validation.EMFEventType; > import org.eclipse.emf.validation.internal.util.XmlConstraintDescriptor; > import org.eclipse.emf.validation.model.Category; >@@ -60,7 +60,7 @@ > private static final String TEST_BODY = "self.name = 'Ottawa'";//$NON-NLS-1$ > private static final int TEST_CODE = 1000; > private static final ConstraintSeverity TEST_SEVERITY = ConstraintSeverity.WARNING; >- private static final EvaluationMode TEST_MODE = EvaluationMode.LIVE; >+ private static final EvaluationMode<Notification> TEST_MODE = EvaluationMode.LIVE; > private static final String TEST_NAMESPACE_URI = "http:///ordersystem.ecore"; //$NON-NLS-1$ > private static final String TEST_CLASS = "Warehouse"; //$NON-NLS-1$ > private static final String TEST_EVENT = "Set"; //$NON-NLS-1$ >@@ -74,8 +74,8 @@ > * Handy implementation of the Eclipse extension configuration element. > */ > public static class FixtureElement implements IConfigurationElement { >- private final Map attributes = new java.util.HashMap(); >- private final List children = new java.util.ArrayList(); >+ private final Map<String, String> attributes = new java.util.HashMap<String, String>(); >+ private final List<IConfigurationElement> children = new java.util.ArrayList<IConfigurationElement>(); > private Object parent; > private final String myName; > private String value = ""; //$NON-NLS-1$ >@@ -99,8 +99,8 @@ > FixtureElement result = new FixtureElement(name); > > if (attributes != null) { >- for (int i = 0; i < attributes.length; i++) { >- result.putAttribute(attributes[i][0], attributes[i][1]); >+ for (String[] element : attributes) { >+ result.putAttribute(element[0], element[1]); > } > } > >@@ -111,7 +111,7 @@ > > // implements/extends the inherited method > public String getAttribute(String name) { >- return (String)attributes.get(name); >+ return attributes.get(name); > } > > public FixtureElement putAttribute(String name, String newValue) { >@@ -127,30 +127,25 @@ > > // implements/extends the inherited method > public String[] getAttributeNames() { >- return (String[])attributes.keySet().toArray( >- new String[attributes.size()]); >+ return attributes.keySet().toArray(new String[attributes.size()]); > } > > // implements/extends the inherited method > public IConfigurationElement[] getChildren() { >- return (IConfigurationElement[])children.toArray( >- new IConfigurationElement[children.size()]); >+ return children.toArray(new IConfigurationElement[children.size()]); > } > > // implements/extends the inherited method > public IConfigurationElement[] getChildren(String name) { >- List result = new java.util.ArrayList(); >+ List<IConfigurationElement> result = new java.util.ArrayList<IConfigurationElement>(); > >- for (Iterator iter = children.iterator(); iter.hasNext(); ) { >- IConfigurationElement next = (IConfigurationElement)iter.next(); >- >+ for (IConfigurationElement next : children) { > if (next.getName().equals(name)) { > result.add(next); > } > } > >- return (IConfigurationElement[])result.toArray( >- new IConfigurationElement[result.size()]); >+ return result.toArray(new IConfigurationElement[result.size()]); > } > > public FixtureElement addChild(IConfigurationElement child) { >@@ -188,6 +183,7 @@ > // constructor can find the plug-in ID that it needs from the > // configuration element > /** @deprecated */ >+ @Deprecated > public IExtension getDeclaringExtension() { > return new IExtension() { > >@@ -418,7 +414,7 @@ > } > > public void test_getCategories() { >- Set categories = Collections.singleton( >+ Set<Category> categories = Collections.singleton( > CategoryManager.getInstance().getDefaultCategory()); > > assertEquals(categories, getFixture().getCategories()); >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/AbstractGetConstraintsOperationTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/AbstractGetConstraintsOperationTest.java,v >retrieving revision 1.3 >diff -u -r1.3 AbstractGetConstraintsOperationTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/AbstractGetConstraintsOperationTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/AbstractGetConstraintsOperationTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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 >@@ -40,8 +40,8 @@ > * @author Christian W. Damus (cdamus) > */ > abstract class AbstractGetConstraintsOperationTest extends TestBase { >- protected static final Object BATCH_TOKEN = newConstraint(EvaluationMode.BATCH); >- protected static final Object LIVE_TOKEN = newConstraint(EvaluationMode.LIVE); >+ protected static final IModelConstraint BATCH_TOKEN = newConstraint(EvaluationMode.BATCH); >+ protected static final IModelConstraint LIVE_TOKEN = newConstraint(EvaluationMode.LIVE); > > private AbstractGetConstraintsOperation fixture; > >@@ -61,7 +61,7 @@ > this.fixture = fixture; > } > >- private static TestConstraint newConstraint(EvaluationMode mode) { >+ private static TestConstraint newConstraint(EvaluationMode<?> mode) { > ConstraintDescriptorTest.FixtureElement config = > ConstraintDescriptorTest.newFixtureConfig(); > >@@ -83,27 +83,29 @@ > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >- public Collection getBatchConstraints( >+ public Collection<IModelConstraint> getBatchConstraints( > EObject eObject, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > return appendTo(constraints, BATCH_TOKEN); > } > > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >- public Collection getLiveConstraints( >+ public Collection<IModelConstraint> getLiveConstraints( > Notification notification, >- Collection constraints) { >+ Collection<IModelConstraint> constraints) { > return appendTo(constraints, LIVE_TOKEN); > } > >- private Collection appendTo(Collection c, Object o) { >+ private Collection<IModelConstraint> appendTo(Collection<IModelConstraint> c, >+ IModelConstraint constraint) { >+ > if (c == null) { >- c = new java.util.ArrayList(1); >+ c = new java.util.ArrayList<IModelConstraint>(1); > } > >- c.add(o); >+ c.add(constraint); > > return c; > } >Index: src/org/eclipse/emf/validation/internal/service/impl/tests/GetBatchConstraintsOperationTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/service/impl/tests/GetBatchConstraintsOperationTest.java,v >retrieving revision 1.3 >diff -u -r1.3 GetBatchConstraintsOperationTest.java >--- src/org/eclipse/emf/validation/internal/service/impl/tests/GetBatchConstraintsOperationTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/service/impl/tests/GetBatchConstraintsOperationTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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,6 +24,7 @@ > import org.eclipse.emf.ecore.EObject; > > import org.eclipse.emf.validation.internal.service.GetBatchConstraintsOperation; >+import org.eclipse.emf.validation.model.IModelConstraint; > > /** > * Tests for {@link GetBatchConstraintsOperation}. >@@ -45,6 +46,7 @@ > /* (non-Javadoc) > * Extends the inherited method. > */ >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >@@ -60,18 +62,16 @@ > } > > public void test_execute() { >- Object o = getFixture().execute(new TestProvider()); >- assertNotNull(o); >- assertTrue("Execution result not collection", o instanceof Collection);//$NON-NLS-1$ >+ Collection<IModelConstraint> c = getFixture().execute(new TestProvider()); >+ assertNotNull(c); > >- Collection c = (Collection)o; > assertTrue("Token not found", c.contains(BATCH_TOKEN));//$NON-NLS-1$ > } > > public void test_getConstraints() { > getFixture().execute(new TestProvider()); > >- Collection c = getFixture().getConstraints(); >+ Collection<IModelConstraint> c = getFixture().getConstraints(); > > // check that the token is in this collection > assertTrue("Token not found", c.contains(BATCH_TOKEN)); //$NON-NLS-1$ >Index: src/org/eclipse/emf/validation/internal/util/tests/FilteredCollectionTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/util/tests/FilteredCollectionTest.java,v >retrieving revision 1.3 >diff -u -r1.3 FilteredCollectionTest.java >--- src/org/eclipse/emf/validation/internal/util/tests/FilteredCollectionTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/util/tests/FilteredCollectionTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -20,8 +20,6 @@ > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collection; >-import java.util.Iterator; >- > import org.eclipse.emf.validation.util.FilteredCollection; > > import junit.framework.Test; >@@ -34,15 +32,15 @@ > * @author Christian W. Damus (cdamus) > */ > public class FilteredCollectionTest extends TestCase { >- private class Filter implements FilteredCollection.Filter { >+ private class Filter implements FilteredCollection.Filter<Integer> { > // filters out odd integers >- public boolean accept(Object element) { >- return (((Integer)element).intValue() % 2) == 0; >+ public boolean accept(Integer element) { >+ return (element % 2) == 0; > } > } > >- private Filter filter = new Filter(); >- private Collection original = Arrays.asList( >+ private final Filter filter = new Filter(); >+ private final Collection<Integer> original = Arrays.asList( > new Integer[] { > new Integer(0), > new Integer(1), >@@ -51,13 +49,13 @@ > new Integer(4), > new Integer(5), > }); >- private Collection expectedFilteredResult = Arrays.asList( >+ private final Collection<Integer> expectedFilteredResult = Arrays.asList( > new Integer[] { > new Integer(0), > new Integer(2), > new Integer(4), > }); >- private FilteredCollection filteredCollection = new FilteredCollection( >+ private final FilteredCollection<Integer> filteredCollection = new FilteredCollection<Integer>( > original, > filter); > >@@ -78,13 +76,11 @@ > /** Tests for correct iteration. */ > public void test_iterator() { > // test for contents. Note that lists can only be compared to lists >- assertEquals(expectedFilteredResult, new ArrayList(filteredCollection)); >+ assertEquals(expectedFilteredResult, new ArrayList<Integer>(filteredCollection)); > > // test for ordering > int i = 0; >- for (Iterator iter = filteredCollection.iterator(); iter.hasNext();) { >- Integer next = (Integer)iter.next(); >- >+ for (Integer next : filteredCollection) { > assertEquals(i, next.intValue()); > > i = i + 2; >Index: src/org/eclipse/emf/validation/internal/util/tests/DisabledConstraintTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/util/tests/DisabledConstraintTest.java,v >retrieving revision 1.3 >diff -u -r1.3 DisabledConstraintTest.java >--- src/org/eclipse/emf/validation/internal/util/tests/DisabledConstraintTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/util/tests/DisabledConstraintTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -27,6 +27,7 @@ > > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EStructuralFeature; > >@@ -84,7 +85,7 @@ > > public static class ValidationContext implements IValidationContext { > private final EObject target; >- private Set resultLocus = new java.util.HashSet(); >+ private final Set<EObject> resultLocus = new java.util.HashSet<EObject>(); > > public ValidationContext(EObject target) { > this.target = target; >@@ -107,8 +108,8 @@ > } > > // implements the inherited method >- public List getAllEvents() { >- return Collections.EMPTY_LIST; >+ public List<Notification> getAllEvents() { >+ return Collections.emptyList(); > } > > // implements the inherited method >@@ -127,7 +128,7 @@ > } > > // implements the inherited method >- public void skipCurrentConstraintForAll(Collection eObjects) { >+ public void skipCurrentConstraintForAll(Collection<?> eObjects) { > // no need to do anything in this test fixture > } > >@@ -147,7 +148,7 @@ > } > > // implements the inherited method >- public Set getResultLocus() { >+ public Set<EObject> getResultLocus() { > return resultLocus; > } > >@@ -157,8 +158,8 @@ > } > > // implements the inherited method >- public void addResults(Collection eObjects) { >- resultLocus.add(eObjects); >+ public void addResults(Collection<? extends EObject> eObjects) { >+ resultLocus.addAll(eObjects); > } > > /* (non-Javadoc) >@@ -171,7 +172,7 @@ > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >- public IStatus createFailureStatus(Object[] messageArguments) { >+ public IStatus createFailureStatus(Object... messageArguments) { > return new Status( > IStatus.ERROR, > "org.eclipse.emf.validation.tests", //$NON-NLS-1$ >Index: src/org/eclipse/emf/validation/internal/util/tests/ConstraintFactoryTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests/src/org/eclipse/emf/validation/internal/util/tests/ConstraintFactoryTest.java,v >retrieving revision 1.3 >diff -u -r1.3 ConstraintFactoryTest.java >--- src/org/eclipse/emf/validation/internal/util/tests/ConstraintFactoryTest.java 10 Oct 2006 14:31:05 -0000 1.3 >+++ src/org/eclipse/emf/validation/internal/util/tests/ConstraintFactoryTest.java 9 Nov 2007 00:41:18 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2003, 2006 IBM Corporation and others. >+ * Copyright (c) 2003, 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 >@@ -33,13 +33,14 @@ > * @author Christian W. Damus (cdamus) > */ > public class ConstraintFactoryTest extends TestCase { >- private ConstraintFactory factory = ConstraintFactory.getInstance(); >+ private final ConstraintFactory factory = ConstraintFactory.getInstance(); > > public void test_getInstance() { > assertSame(factory, ConstraintFactory.getInstance()); > } > > public void test_newConstraint() { >+ @SuppressWarnings("deprecation") > IModelConstraint constraint = factory.newConstraint( > ConstraintDescriptorTest.getFixture()); > >@@ -66,6 +67,7 @@ > try { > XmlConstraintDescriptor desc = new XmlConstraintDescriptor(element); > >+ @SuppressWarnings("deprecation") > IModelConstraint constraint = factory.newConstraint(desc); > > assertFalse(desc.isEnabled()); >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.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:07:07 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 9 Nov 2007 00:41:18 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:48:36 EST 2006 >+#Wed Oct 31 00:04:04 EDT 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.validation.ui >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.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:48 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 9 Nov 2007 00:41:20 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:49:05 EST 2006 >+#Wed Oct 31 00:02:33 EDT 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/validation/ui/internal/preferences/ValidationLiveProblemsDestination.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/ValidationLiveProblemsDestination.java,v >retrieving revision 1.2 >diff -u -r1.2 ValidationLiveProblemsDestination.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/ValidationLiveProblemsDestination.java 6 Jun 2007 22:28:06 -0000 1.2 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/ValidationLiveProblemsDestination.java 9 Nov 2007 00:41:20 -0000 >@@ -15,6 +15,7 @@ > import java.util.Arrays; > import java.util.List; > >+import org.eclipse.emf.common.util.Enumerator; > import org.eclipse.emf.validation.ui.internal.ValidationUIPlugin; > > >@@ -23,17 +24,11 @@ > * > * @author Christian W. Damus (cdamus) > */ >-public class ValidationLiveProblemsDestination { >- /** >- * An internal unique identifier for this enumerated type. >- */ >- private static int nextOrdinal = 0; >- >- private String name; >- private int ordinal; >+public enum ValidationLiveProblemsDestination implements Enumerator { >+ DIALOG("Dialog"), //$NON-NLS-1$ >+ CONSOLE("Console"); //$NON-NLS-1$ > >- public static final ValidationLiveProblemsDestination DIALOG = new ValidationLiveProblemsDestination("Dialog"); //$NON-NLS-1$ >- public static final ValidationLiveProblemsDestination CONSOLE = new ValidationLiveProblemsDestination("Console"); //$NON-NLS-1$ >+ private String name; > > /** > * The list of values for this enumerated type. >@@ -65,7 +60,6 @@ > */ > private ValidationLiveProblemsDestination(String name) { > this.name = name; >- this.ordinal = nextOrdinal++; > } > > /** >@@ -73,15 +67,23 @@ > * > * @return The list of constants for this enumerated type. > */ >- protected List getValues() { >+ protected List<ValidationLiveProblemsDestination> getValues() { > return Arrays.asList(VALUES); > } > > public int getOrdinal() { >- return ordinal; >+ return getValue(); > } > > public String getName() { > return name; > } >+ >+ public int getValue() { >+ return ordinal(); >+ } >+ >+ public String getLiteral() { >+ return getName(); >+ } > } >Index: src/org/eclipse/emf/validation/ui/internal/preferences/CategoryTreeNode.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/CategoryTreeNode.java,v >retrieving revision 1.6 >diff -u -r1.6 CategoryTreeNode.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/CategoryTreeNode.java 7 Nov 2007 17:27:30 -0000 1.6 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/CategoryTreeNode.java 9 Nov 2007 00:41:20 -0000 >@@ -20,7 +20,6 @@ > import java.util.Collections; > import java.util.Iterator; > import java.util.List; >-import java.util.ListIterator; > > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.validation.model.Category; >@@ -49,7 +48,7 @@ > */ > private ICategoryTreeNode delegate; > >- private List constraints; >+ private List<IConstraintNode> constraints; > > /** > * Implementation of the root node of the category selection tree. >@@ -68,22 +67,15 @@ > } > > // implements the inherited method to wrap the top-level categories >- protected List createChildren() { >- List result = new java.util.ArrayList( >- CategoryManager.getInstance().getTopLevelCategories()); >- >- for (ListIterator iter = result.listIterator(); iter.hasNext();) { >- Category next = (Category) iter.next(); >- >- if (isRecursivelyEmpty(next)) { >- iter.remove(); >- } else { >- iter.set( >- new CategoryTreeNode( >- getTree(), >- next, >- this, >- getFilter())); >+ @Override >+ protected List<ICategoryTreeNode> createChildren() { >+ Collection<Category> topLevel = CategoryManager.getInstance().getTopLevelCategories(); >+ List<ICategoryTreeNode> result = new java.util.ArrayList<ICategoryTreeNode>( >+ topLevel.size()); >+ >+ for (Category next : topLevel) { >+ if (!isRecursivelyEmpty(next)) { >+ result.add(new CategoryTreeNode(getTree(), next, this, getFilter())); > } > } > >@@ -116,13 +108,14 @@ > } > > // redefines the inherited method >- public String getDescription() { >+ @Override >+ public String getDescription() { > return ""; //$NON-NLS-1$ > } > > // redefines the inherited method >- public List getConstraints() { >- return Collections.EMPTY_LIST; >+ public List<IConstraintNode> getConstraints() { >+ return Collections.emptyList(); > } > } > >@@ -153,13 +146,15 @@ > } > > // redefines the inherited method >- protected List createChildren() { >+ @Override >+ protected List<ICategoryTreeNode> createChildren() { > // delegates are leaf nodes, by definition >- return Collections.EMPTY_LIST; >+ return Collections.emptyList(); > } > > // extends the inherited method >- public String toString() { >+ @Override >+ public String toString() { > String result = super.toString(); > > StringBuffer buf = new StringBuffer(result.length() + 2); >@@ -232,26 +227,25 @@ > } > > // implements the inherited method >- protected List createChildren() { >+ @Override >+ protected List<ICategoryTreeNode> createChildren() { > final Category category = getCategory(); >- Collection categoryChildren = category.getChildren(); >+ Collection<Category> categoryChildren = category.getChildren(); > >- List result; >+ List<ICategoryTreeNode> result; > > if (!categoryChildren.isEmpty() && !getConstraints(category, getFilter()).isEmpty()) { > // add one for the delegate child that contains my own constraints >- result = new java.util.ArrayList(categoryChildren.size() + 1); >+ result = new java.util.ArrayList<ICategoryTreeNode>(categoryChildren.size() + 1); > > // add my delegate > delegate = new DelegateNode(getTree(), category, this, getFilter()); > result.add(delegate); > } else { >- result = new java.util.ArrayList(categoryChildren.size()); >+ result = new java.util.ArrayList<ICategoryTreeNode>(categoryChildren.size()); > } > >- for (Iterator iter = categoryChildren.iterator(); iter.hasNext();) { >- Category next = (Category) iter.next(); >- >+ for (Category next : categoryChildren) { > if (!isRecursivelyEmpty(next)) { > result.add(new CategoryTreeNode( > getTree(), >@@ -311,9 +305,7 @@ > */ > private void propagateToConstraints(boolean newChecked) { > if (!hasDelegate()) { >- for (Iterator iter = getConstraints().iterator(); iter.hasNext();) { >- IConstraintNode next = (IConstraintNode) iter.next(); >- >+ for (IConstraintNode next : getConstraints()) { > // my constraints update my check state as necessary > next.setChecked(newChecked); > } >@@ -388,9 +380,7 @@ > boolean newChecked = newValue; > boolean newGrayed = false; > >- for (Iterator iter = getConstraints().iterator(); iter.hasNext();) { >- IConstraintNode next = (IConstraintNode) iter.next(); >- >+ for (IConstraintNode next : getConstraints()) { > if (next != constraint) { > if (next.isChecked() != newValue) { > newGrayed = true; >@@ -424,11 +414,10 @@ > } > > // extends the inherited method >- public void applyToPreferences() { >+ @Override >+ public void applyToPreferences() { > if (!hasDelegate()) { >- for (Iterator iter = getConstraints().iterator(); iter.hasNext();) { >- IConstraintNode next = (IConstraintNode) iter.next(); >- >+ for (IConstraintNode next : getConstraints()) { > next.applyToPreferences(); > } > } >@@ -437,12 +426,15 @@ > } > > // extends the inherited method >- public void revertFromPreferences() { >+ @Override >+ public void revertFromPreferences() { > if (!hasDelegate()) { > IConstraintNode node = null; > >- for (Iterator iter = getConstraints().iterator(); iter.hasNext();) { >- node = (IConstraintNode) iter.next(); >+ for (Iterator<IConstraintNode> iter = getConstraints().iterator(); >+ iter.hasNext();) { >+ >+ node = iter.next(); > > node.revertFromPreferences(); > } >@@ -457,12 +449,15 @@ > } > > // extends the inherited method >- public void restoreDefaults() { >+ @Override >+ public void restoreDefaults() { > if (!hasDelegate()) { > IConstraintNode node = null; > >- for (Iterator iter = getConstraints().iterator(); iter.hasNext();) { >- node = (IConstraintNode) iter.next(); >+ for (Iterator<IConstraintNode> iter = getConstraints().iterator(); >+ iter.hasNext();) { >+ >+ node = iter.next(); > > node.restoreDefaults(); > } >@@ -483,7 +478,8 @@ > * @return <code>null</code> if I have a delegate node; the superclass > * result, otherwise > */ >- public Category getCategory() { >+ @Override >+ public Category getCategory() { > if (hasDelegate()) { > return null; > } else { >@@ -492,21 +488,20 @@ > } > > // implements the inherited method >- public List getConstraints() { >+ public List<IConstraintNode> getConstraints() { > if (hasDelegate()) { >- constraints = Collections.EMPTY_LIST; >+ constraints = Collections.emptyList(); > } else if (constraints == null) { >- constraints = new java.util.ArrayList( >- getConstraints(getCategory(), getFilter())); >- >- for (ListIterator iter = constraints.listIterator(); >- iter.hasNext();) { >- >- IConstraintNode node = ConstraintNode.getInstance( >- (IConstraintDescriptor)iter.next()); >+ Collection<IConstraintDescriptor> descriptors = getConstraints( >+ getCategory(), getFilter()); >+ constraints = new java.util.ArrayList<IConstraintNode>( >+ descriptors.size()); >+ >+ for (IConstraintDescriptor next : descriptors) { >+ IConstraintNode node = ConstraintNode.getInstance(next); > > node.addCategory(this); >- iter.set(node); >+ constraints.add(node); > } > } > >@@ -514,18 +509,18 @@ > } > > // implements the inherited method >- public IConstraintNode[] getSelectedConstraints() { >- List result = new java.util.ArrayList(getConstraints().size()); >+ @Override >+ public IConstraintNode[] getSelectedConstraints() { >+ List<IConstraintNode> result = new java.util.ArrayList<IConstraintNode>( >+ getConstraints().size()); > >- for (Iterator iter = getConstraints().iterator(); iter.hasNext();) { >- IConstraintNode next = (IConstraintNode) iter.next(); >- >+ for (IConstraintNode next : getConstraints()) { > if (next.isChecked()) { > result.add(next); > } > } > >- return (IConstraintNode[]) result.toArray( >+ return result.toArray( > new IConstraintNode[result.size()]); > } > >@@ -544,7 +539,8 @@ > * category (because my delegate has it), I return my delegate's category's > * name. > */ >- public String toString() { >+ @Override >+ public String toString() { > if ((getCategory() == null) && hasDelegate()) { > return delegate.getCategory().getName(); > } else { >Index: src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintNode.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintNode.java,v >retrieving revision 1.5 >diff -u -r1.5 ConstraintNode.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintNode.java 22 Mar 2007 20:42:58 -0000 1.5 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintNode.java 9 Nov 2007 00:41:20 -0000 >@@ -34,13 +34,15 @@ > public class ConstraintNode > implements IConstraintNode { > >- private static final java.util.Map instanceMap = new java.util.HashMap(); >+ private static final java.util.Map<String, IConstraintNode> instanceMap = >+ new java.util.HashMap<String, IConstraintNode>(); > > private final IConstraintDescriptor constraint; > private Boolean mandatory; > private boolean checked = false; > >- private final java.util.Set categories = new java.util.HashSet(); >+ private final java.util.Set<ICategoryTreeNode> categories = >+ new java.util.HashSet<ICategoryTreeNode>(); > > /** > * Initializes me with the constraint that I represent. >@@ -64,7 +66,7 @@ > IConstraintNode result = null; > > if (id != null) { >- result = (IConstraintNode) instanceMap.get(id); >+ result = instanceMap.get(id); > > if (result == null) { > result = new ConstraintNode(constraint); >@@ -107,7 +109,7 @@ > /* (non-Javadoc) > * Implements the inherited method. > */ >- public Collection getCategories() { >+ public Collection<Category> getCategories() { > return constraint.getCategories(); > } > >@@ -158,10 +160,10 @@ > if (mandatory == null) { > boolean m = false; > >- for (Iterator iter = constraint.getCategories().iterator(); >+ for (Iterator<Category> iter = constraint.getCategories().iterator(); > !m && iter.hasNext();) { > >- if (((Category) iter.next()).isMandatory()) { >+ if (iter.next().isMandatory()) { > m = true; > } > } >@@ -239,9 +241,7 @@ > * This allows them to update theirs, to match. > */ > private void updateCategories() { >- for (Iterator iter = categories.iterator(); iter.hasNext();) { >- ICategoryTreeNode next = (ICategoryTreeNode) iter.next(); >- >+ for (ICategoryTreeNode next : categories) { > next.updateCheckState(this); > } > } >Index: src/org/eclipse/emf/validation/ui/internal/preferences/AbstractCategoryTreeNode.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/AbstractCategoryTreeNode.java,v >retrieving revision 1.5 >diff -u -r1.5 AbstractCategoryTreeNode.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/AbstractCategoryTreeNode.java 22 Mar 2007 20:42:58 -0000 1.5 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/AbstractCategoryTreeNode.java 9 Nov 2007 00:41:20 -0000 >@@ -16,7 +16,6 @@ > */ > package org.eclipse.emf.validation.ui.internal.preferences; > >-import java.util.Iterator; > import java.util.List; > import java.util.Set; > >@@ -67,7 +66,7 @@ > * > * @return my children > */ >- protected abstract List createChildren(); >+ protected abstract List<ICategoryTreeNode> createChildren(); > > /** > * Lazily initializes my children on first access. >@@ -76,9 +75,8 @@ > */ > private void initChildren() { > if (children == null) { >- List childList = createChildren(); >- children = (ICategoryTreeNode[])childList.toArray( >- new ICategoryTreeNode[childList.size()]); >+ List<ICategoryTreeNode> childList = createChildren(); >+ children = childList.toArray(new ICategoryTreeNode[childList.size()]); > } > } > >@@ -96,8 +94,8 @@ > if (result) { > // check children, too > >- for (Iterator iter = cat.getChildren().iterator(); result && iter.hasNext();) { >- result = isRecursivelyEmpty((Category) iter.next()); >+ for (Category child : cat.getChildren()) { >+ result = isRecursivelyEmpty(child); > } > } > >@@ -115,12 +113,11 @@ > * > * @since 1.1 > */ >- protected static Set getConstraints(Category category, IConstraintFilter filter) { >- Set filteredConstraints = new java.util.HashSet(); >+ protected static Set<IConstraintDescriptor> getConstraints(Category category, IConstraintFilter filter) { >+ Set<IConstraintDescriptor> filteredConstraints = >+ new java.util.HashSet<IConstraintDescriptor>(); > >- for (Iterator iter = category.getConstraints().iterator(); iter.hasNext();) { >- IConstraintDescriptor descriptor = (IConstraintDescriptor)iter.next(); >- >+ for (IConstraintDescriptor descriptor : category.getConstraints()) { > if (filter.accept(descriptor, null)) { > filteredConstraints.add(descriptor); > } >@@ -169,8 +166,8 @@ > public void applyToPreferences() { > ICategoryTreeNode[] currentChildren = getChildren(); > >- for (int i = 0; i < currentChildren.length; i++) { >- currentChildren[i].applyToPreferences(); >+ for (ICategoryTreeNode element : currentChildren) { >+ element.applyToPreferences(); > } > } > >@@ -178,8 +175,8 @@ > public void revertFromPreferences() { > ICategoryTreeNode[] currentChildren = getChildren(); > >- for (int i = 0; i < currentChildren.length; i++) { >- currentChildren[i].revertFromPreferences(); >+ for (ICategoryTreeNode element : currentChildren) { >+ element.revertFromPreferences(); > } > } > >@@ -187,8 +184,8 @@ > public void restoreDefaults() { > ICategoryTreeNode[] currentChildren = getChildren(); > >- for (int i = 0; i < currentChildren.length; i++) { >- currentChildren[i].restoreDefaults(); >+ for (ICategoryTreeNode element : currentChildren) { >+ element.restoreDefaults(); > } > } > >@@ -200,6 +197,7 @@ > } > > // redefines the inherited method >+ @Override > public String toString() { > return (getCategory() == null) > ? "" //$NON-NLS-1$ >Index: src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintDetailsHelper.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintDetailsHelper.java,v >retrieving revision 1.7 >diff -u -r1.7 ConstraintDetailsHelper.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintDetailsHelper.java 22 Mar 2007 20:42:58 -0000 1.7 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/ConstraintDetailsHelper.java 9 Nov 2007 00:41:20 -0000 >@@ -18,7 +18,6 @@ > > import java.text.MessageFormat; > import java.util.Collection; >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.emf.validation.model.Category; >@@ -70,7 +69,7 @@ > public static String formatConstraintDescription( > IConstraintNode constraint, > Category selectedCategory, >- List styles) { >+ List<? super StyleRange> styles) { > > String description = constraint.getDescription(); > >@@ -93,7 +92,7 @@ > description, > constraint.getSeverity()}); > >- Collection categories = constraint.getCategories(); >+ Collection<Category> categories = constraint.getCategories(); > if (categories.size() > 1) { > // also display the other categories that contain this constraint > text = text + getOtherCategories(selectedCategory, categories); >@@ -117,14 +116,12 @@ > */ > private static String getOtherCategories( > Category selected, >- Collection categories) { >+ Collection<? extends Category> categories) { > > StringBuffer result = new StringBuffer(64); > result.append(ALSO_IN_CATEGORIES); > >- for (Iterator iter = categories.iterator(); iter.hasNext();) { >- Category next = (Category)iter.next(); >- >+ for (Category next : categories) { > if (next != selected) { > result.append(PLATFORM_NEWLINE); > result.append(next.getQualifiedName()); >@@ -144,7 +141,7 @@ > * @param styles a list which collects the corresponding style ranges > * @return the original <code>text</code> minus the markup > */ >- private static String parseStyles(String text, List styles) { >+ private static String parseStyles(String text, List<? super StyleRange> styles) { > int pos = -1; > int lastPos = 0; > >Index: src/org/eclipse/emf/validation/ui/internal/preferences/IConstraintNode.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/IConstraintNode.java,v >retrieving revision 1.5 >diff -u -r1.5 IConstraintNode.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/IConstraintNode.java 22 Mar 2007 20:42:58 -0000 1.5 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/IConstraintNode.java 9 Nov 2007 00:41:20 -0000 >@@ -19,6 +19,7 @@ > > import java.util.Collection; > >+import org.eclipse.emf.validation.model.Category; > import org.eclipse.jface.viewers.CheckStateChangedEvent; > > >@@ -60,7 +61,7 @@ > * > * @return the categories of the constraint that I represent > */ >- Collection getCategories(); >+ Collection<Category> getCategories(); > > /** > * Obtains the evaluation mode of the constraint, to show in the GUI. >Index: src/org/eclipse/emf/validation/ui/internal/preferences/ICategoryTreeNode.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/preferences/ICategoryTreeNode.java,v >retrieving revision 1.5 >diff -u -r1.5 ICategoryTreeNode.java >--- src/org/eclipse/emf/validation/ui/internal/preferences/ICategoryTreeNode.java 22 Mar 2007 20:42:58 -0000 1.5 >+++ src/org/eclipse/emf/validation/ui/internal/preferences/ICategoryTreeNode.java 9 Nov 2007 00:41:20 -0000 >@@ -101,7 +101,7 @@ > * > * @return my constraints, or an empty list if I am not a leaf node > */ >- List getConstraints(); >+ List<IConstraintNode> getConstraints(); > > /** > * Obtains the category that I represent if I am a leaf node. >Index: src/org/eclipse/emf/validation/ui/internal/ValidationUIPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/ValidationUIPlugin.java,v >retrieving revision 1.5 >diff -u -r1.5 ValidationUIPlugin.java >--- src/org/eclipse/emf/validation/ui/internal/ValidationUIPlugin.java 6 Jun 2007 22:28:06 -0000 1.5 >+++ src/org/eclipse/emf/validation/ui/internal/ValidationUIPlugin.java 9 Nov 2007 00:41:20 -0000 >@@ -136,7 +136,8 @@ > super(new ResourceLocator[] {}); > } > >- public ResourceLocator getPluginResourceLocator() { >+ @Override >+ public ResourceLocator getPluginResourceLocator() { > return plugin; > } > >@@ -178,7 +179,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. >@@ -203,7 +205,7 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >@@ -320,7 +322,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -359,7 +361,7 @@ > */ > public static void catching( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -392,7 +394,7 @@ > */ > public static void throwing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -422,7 +424,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -447,7 +449,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object parameter) { > >@@ -476,7 +478,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object[] parameters) { > >@@ -503,7 +505,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -528,7 +530,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >Index: src/org/eclipse/emf/validation/ui/internal/LiveValidationListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/LiveValidationListener.java,v >retrieving revision 1.5 >diff -u -r1.5 LiveValidationListener.java >--- src/org/eclipse/emf/validation/ui/internal/LiveValidationListener.java 30 Mar 2007 19:23:32 -0000 1.5 >+++ src/org/eclipse/emf/validation/ui/internal/LiveValidationListener.java 9 Nov 2007 00:41:20 -0000 >@@ -16,7 +16,6 @@ > import java.text.MessageFormat; > import java.util.Collection; > import java.util.HashSet; >-import java.util.Iterator; > import java.util.List; > import java.util.Set; > >@@ -28,6 +27,7 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.emf.validation.model.EvaluationMode; >+import org.eclipse.emf.validation.model.IConstraintStatus; > import org.eclipse.emf.validation.service.IValidationListener; > import org.eclipse.emf.validation.service.ValidationEvent; > import org.eclipse.emf.validation.ui.internal.console.ConsoleUtil; >@@ -63,7 +63,7 @@ > private static final String EP_UI_REGISTERED_CLIENT_CONTEXTS = "org.eclipse.emf.validation.ui.UIRegisteredClientContext"; //$NON-NLS-1$ > private static final String A_ID = "id"; //$NON-NLS-1$ > >- private static SoftReference registeredClientContextIds = null; >+ private static SoftReference<Set<String>> registeredClientContextIds = null; > > /** > * Helper object for creating message to output view. >@@ -98,26 +98,29 @@ > * > * @return true if there is a supported client context in the collection, false otherwise > */ >- private synchronized static boolean isSupportedClientContexts(Collection clientContextIds) { >- Set registeredIds = registeredClientContextIds != null ? (Set)registeredClientContextIds.get() : null; >+ private synchronized static boolean isSupportedClientContexts( >+ Collection<String> clientContextIds) { >+ Set<String> registeredIds = registeredClientContextIds != null >+ ? registeredClientContextIds.get() : null; >+ > if (registeredIds == null) { >- registeredIds = new HashSet(); >- registeredClientContextIds = new SoftReference(registeredIds); >+ registeredIds = new HashSet<String>(); >+ registeredClientContextIds = new SoftReference<Set<String>>(registeredIds); > > IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EP_UI_REGISTERED_CLIENT_CONTEXTS); > IExtension[] extensions = point.getExtensions(); > >- for (int i=0; i<extensions.length; i++) { >- IConfigurationElement[] elements = extensions[i].getConfigurationElements(); >+ for (IExtension element : extensions) { >+ IConfigurationElement[] elements = element.getConfigurationElements(); > >- for (int j=0; j<elements.length; j++) { >- registeredIds.add(elements[j].getAttribute(A_ID)); >+ for (IConfigurationElement element2 : elements) { >+ registeredIds.add(element2.getAttribute(A_ID)); > } > } > } > >- for (Iterator i = clientContextIds.iterator(); i.hasNext();) { >- if (registeredIds.contains(i.next())) { >+ for (String next : clientContextIds) { >+ if (registeredIds.contains(next)) { > return true; > } > } >@@ -133,8 +136,9 @@ > */ > private void showProblemMessages(ValidationEvent event) { > // The workbench must be running in order for us to display anything to the user >- if (!PlatformUI.isWorkbenchRunning()) >- return; >+ if (!PlatformUI.isWorkbenchRunning()) { >+ return; >+ } > > final ValidationLiveProblemsDestination destination = > ValidationLiveProblemsDestination.getPreferenceSetting(); >@@ -216,6 +220,7 @@ > * Redefines the inherited method to always return > * the more appropriate severity for the dialog. > */ >+ @Override > public int getSeverity() { > return dialogSeverity; > }}; >@@ -262,9 +267,9 @@ > * first in the array if none is found > */ > static IStatus getFirstStatus(IStatus[] statuses, int severity) { >- for (int i = 0; i < statuses.length; i++) { >- if (statuses[i].matches(severity)) { >- return statuses[i]; >+ for (IStatus element : statuses) { >+ if (element.matches(severity)) { >+ return element; > } > } > >@@ -278,10 +283,9 @@ > * @return its validation results, as a status array > */ > private static IStatus[] toStatusArray(ValidationEvent event) { >- List results = event.getValidationResults(); >+ List<IConstraintStatus> results = event.getValidationResults(); > >- return (IStatus[]) results.toArray( >- new IStatus[results.size()]); >+ return results.toArray(new IStatus[results.size()]); > } > > /** >@@ -354,9 +358,7 @@ > private void appendProblemsRecursive( > IStatus[] statuses, > StringBuffer output) { >- for (int i = 0; i < statuses.length; i++) { >- IStatus next = statuses[i]; >- >+ for (IStatus next : statuses) { > if (!next.isOK()) { > final String messagePattern; > >@@ -424,6 +426,7 @@ > * @param composite The composite to parent from. > * @return <code>composite</code> > */ >+ @Override > protected Control createDialogArea(Composite composite) { > Composite result; > >@@ -448,6 +451,7 @@ > > checkbox.addSelectionListener(new SelectionAdapter() { > >+ @Override > public void widgetSelected(SelectionEvent e) { > // toggle the preference setting for display of live > // warnings according to user's selection >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/build.properties,v >retrieving revision 1.7 >diff -u -r1.7 build.properties >--- build.properties 6 Jun 2007 22:28:06 -0000 1.7 >+++ build.properties 9 Nov 2007 00:41:20 -0000 >@@ -24,5 +24,5 @@ > plugin.properties,\ > icons/,\ > 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.validation/plugins/org.eclipse.emf.validation.ui/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:48 -0000 1.2 >+++ .classpath 9 Nov 2007 00:41:20 -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/validation/ui/internal/console/ConsoleUtil.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/internal/console/ConsoleUtil.java,v >retrieving revision 1.2 >diff -u -r1.2 ConsoleUtil.java >--- src/org/eclipse/emf/validation/ui/internal/console/ConsoleUtil.java 10 Oct 2006 14:30:54 -0000 1.2 >+++ src/org/eclipse/emf/validation/ui/internal/console/ConsoleUtil.java 9 Nov 2007 00:41:20 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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 >@@ -51,10 +51,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 'default streams for error, warining and info for that console' mapping */ >- private static Map nameToDefaultStream = new HashMap(); >+ private static Map<String, MessageConsoleStream> nameToDefaultStream = >+ new HashMap<String, MessageConsoleStream>(); > > > // Strings for error, info, warning and default message types >@@ -92,7 +94,7 @@ > nameToConsole.put(name, console ); > } > >- return (MessageConsole) nameToConsole.get( name); >+ return nameToConsole.get( name); > } > > >@@ -114,7 +116,8 @@ > */ > public 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); > nameToDefaultStream.remove(name+ERROR ); > nameToDefaultStream.remove(name+INFO ); >@@ -142,7 +145,7 @@ > > } > >- return (MessageConsoleStream) nameToDefaultStream.get(name+type); >+ return nameToDefaultStream.get(name+type); > > } > >Index: src/org/eclipse/emf/validation/ui/preferences/ConstraintsSelectionBlock.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/src/org/eclipse/emf/validation/ui/preferences/ConstraintsSelectionBlock.java,v >retrieving revision 1.4 >diff -u -r1.4 ConstraintsSelectionBlock.java >--- src/org/eclipse/emf/validation/ui/preferences/ConstraintsSelectionBlock.java 30 Oct 2007 15:28:03 -0000 1.4 >+++ src/org/eclipse/emf/validation/ui/preferences/ConstraintsSelectionBlock.java 9 Nov 2007 00:41:20 -0000 >@@ -363,7 +363,8 @@ > * @param constraint the constraint meta-data > */ > private void setDetails(IConstraintNode constraint) { >- List styles = new java.util.ArrayList(32); // lots of style info >+ // lots of style info >+ List<StyleRange> styles = new java.util.ArrayList<StyleRange>(32); > String text = ConstraintDetailsHelper.formatConstraintDescription( > constraint, > getCurrentCategorySelection(), >@@ -371,7 +372,7 @@ > > getDetailsArea().setText(text); > getDetailsArea().setStyleRanges( >- (StyleRange[])styles.toArray(new StyleRange[styles.size()])); >+ styles.toArray(new StyleRange[styles.size()])); > } > } > >@@ -432,11 +433,13 @@ > ValidationUIPlugin.getImageDescriptor(LOCK_ICON).createImage( > true); > >+ @Override > public void dispose() { > lockImage.dispose(); > super.dispose(); > } > >+ @Override > public Image getImage(Object element) { > ICategoryTreeNode node = (ICategoryTreeNode)element; > >@@ -494,12 +497,14 @@ > true); > > // extends the inherited method >+ @Override > public void dispose() { > lockImage.dispose(); > super.dispose(); > } > > // redefines the inherited method >+ @Override > public Image getImage(Object element) { > IConstraintNode constraint = (IConstraintNode) element; > >@@ -514,6 +519,7 @@ > } > > // redefines the inherited method >+ @Override > public String getText(Object element) { > return ((IConstraintNode)element).getName(); > }}); >@@ -646,9 +652,7 @@ > } > > private void markEnabledCategories(ICategoryTreeNode[] categories) { >- for (int i = 0; i < categories.length; i++) { >- ICategoryTreeNode next = categories[i]; >- >+ for (ICategoryTreeNode next : categories) { > getCategoryTree().setChecked( > next, > next.isChecked()); >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 Oct 2007 15:28:03 -0000 1.10 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:20 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.ui; singleton:=true >-Bundle-Version: 1.1.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.validation.ui.internal.ValidationUIPlugin$Implementation > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >@@ -11,10 +11,10 @@ > org.eclipse.emf.validation.ui.internal.l10n;x-internal:=true, > org.eclipse.emf.validation.ui.internal.preferences;x-internal:=true, > org.eclipse.emf.validation.ui.preferences >-Require-Bundle: org.eclipse.emf.validation;bundle-version="[1.1.0,2.0.0)", >+Require-Bundle: org.eclipse.emf.validation;bundle-version="[1.2.0,2.0.0)", > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > com.ibm.icu;bundle-version="[3.4.3,4.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 >#P org.eclipse.emf.validation.ocl-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation.ocl-feature/feature.xml,v >retrieving revision 1.11 >diff -u -r1.11 feature.xml >--- feature.xml 26 Apr 2007 18:16:14 -0000 1.11 >+++ feature.xml 9 Nov 2007 00:41:22 -0000 >@@ -18,7 +18,7 @@ > <feature > id="org.eclipse.emf.validation.ocl" > label="%featureName" >- version="1.1.0.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> > >@@ -44,9 +44,11 @@ > </url> > > <requires> >- <import plugin="org.eclipse.emf.validation" version="1.0.0" match="compatible"/> > <import plugin="org.eclipse.emf.ocl" version="1.0.0" match="compatible"/> > <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.validation" version="1.2.0" match="compatible"/> >+ <import plugin="org.eclipse.ocl" version="1.1.0" match="compatible"/> >+ <import plugin="org.eclipse.ocl.ecore" version="1.1.0" match="compatible"/> > </requires> > > <plugin >#P org.eclipse.emf.validation.examples.general >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:59 -0000 1.2 >+++ .classpath 9 Nov 2007 00:41:24 -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.validation/examples/org.eclipse.emf.validation.examples.general/build.properties,v >retrieving revision 1.5 >diff -u -r1.5 build.properties >--- build.properties 6 Jun 2007 22:27:51 -0000 1.5 >+++ build.properties 9 Nov 2007 00:41:24 -0000 >@@ -20,5 +20,5 @@ > .,\ > about.html > src.includes = about.html >-javacSource = 1.4 >-javacTarget = 1.4 >+javacSource = 1.5 >+javacTarget = 1.5 >Index: src/org/eclipse/emf/validation/examples/general/constraints/NonEmptyNamesConstraint.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/src/org/eclipse/emf/validation/examples/general/constraints/NonEmptyNamesConstraint.java,v >retrieving revision 1.2 >diff -u -r1.2 NonEmptyNamesConstraint.java >--- src/org/eclipse/emf/validation/examples/general/constraints/NonEmptyNamesConstraint.java 6 Jun 2007 22:27:51 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/general/constraints/NonEmptyNamesConstraint.java 9 Nov 2007 00:41:24 -0000 >@@ -36,6 +36,7 @@ > /* (non-Javadoc) > * @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext) > */ >+ @Override > public IStatus validate(IValidationContext ctx) { > EObject eObj = ctx.getTarget(); > EMFEventType eType = ctx.getEventType(); >@@ -50,7 +51,7 @@ > } > > if (name == null || name.length() == 0) { >- return ctx.createFailureStatus(new Object[] {eObj.eClass().getName()}); >+ return ctx.createFailureStatus(eObj.eClass().getName()); > } > // In the case of live mode. > } else { >@@ -58,7 +59,7 @@ > > if (newValue == null > || ((String)newValue).length() == 0) { >- return ctx.createFailureStatus(new Object[] {eObj.eClass().getName()}); >+ return ctx.createFailureStatus(eObj.eClass().getName()); > } > } > >Index: src/org/eclipse/emf/validation/examples/general/listeners/ValidationListener.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/src/org/eclipse/emf/validation/examples/general/listeners/ValidationListener.java,v >retrieving revision 1.2 >diff -u -r1.2 ValidationListener.java >--- src/org/eclipse/emf/validation/examples/general/listeners/ValidationListener.java 6 Jun 2007 22:27:51 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/general/listeners/ValidationListener.java 9 Nov 2007 00:41:24 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.emf.validation.examples.general.console.ConsoleUtil; > import org.eclipse.emf.validation.examples.general.internal.l10n.ValidationMessages; >+import org.eclipse.emf.validation.model.IConstraintStatus; > import org.eclipse.emf.validation.service.IValidationListener; > import org.eclipse.emf.validation.service.ValidationEvent; > import org.eclipse.osgi.util.NLS; >@@ -99,9 +100,7 @@ > private void appendProblemsRecursive( > IStatus[] statuses, > StringBuffer output) { >- for (int i = 0; i < statuses.length; i++) { >- IStatus next = statuses[i]; >- >+ for (IStatus next : statuses) { > if (!next.isOK()) { > final String messagePattern; > >@@ -222,9 +221,8 @@ > * @return its validation results, as a status array > */ > private static IStatus[] toStatusArray(ValidationEvent event) { >- List results = event.getValidationResults(); >+ List<IConstraintStatus> results = event.getValidationResults(); > >- return (IStatus[]) results.toArray( >- new IStatus[results.size()]); >+ return results.toArray(new IStatus[results.size()]); > } > } >Index: src/org/eclipse/emf/validation/examples/general/console/ConsoleUtil.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/src/org/eclipse/emf/validation/examples/general/console/ConsoleUtil.java,v >retrieving revision 1.2 >diff -u -r1.2 ConsoleUtil.java >--- src/org/eclipse/emf/validation/examples/general/console/ConsoleUtil.java 10 Oct 2006 14:30:57 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/general/console/ConsoleUtil.java 9 Nov 2007 00:41:24 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 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 >@@ -51,10 +51,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 'default streams for error, warining and info for that console' mapping */ >- private static Map nameToDefaultStream = new HashMap(); >+ /** cache for 'console name' to 'default streams for error, warning and info for that console' mapping */ >+ private static Map<String, MessageConsoleStream> nameToDefaultStream = >+ new HashMap<String, MessageConsoleStream>(); > > > // Strings for error, info, warning and default message types >@@ -87,12 +89,13 @@ > if(nameToConsole.get(name) == null){ > > MessageConsole console = new MessageConsole(name,image); >- ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{console}); >+ ConsolePlugin.getDefault().getConsoleManager().addConsoles( >+ new IConsole[]{console}); > >- nameToConsole.put(name, console ); >+ nameToConsole.put(name, console); > } > >- return (MessageConsole) nameToConsole.get( name); >+ return nameToConsole.get(name); > } > > >@@ -114,7 +117,8 @@ > */ > public 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); > nameToDefaultStream.remove(name+ERROR ); > nameToDefaultStream.remove(name+INFO ); >@@ -142,7 +146,7 @@ > > } > >- return (MessageConsoleStream) nameToDefaultStream.get(name+type); >+ return nameToDefaultStream.get(name+type); > > } > >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/.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:59 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 9 Nov 2007 00:41:24 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:46:50 EST 2006 >+#Tue Oct 30 22:16:49 EDT 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/validation/examples/general/actions/EnableLiveValidationDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/src/org/eclipse/emf/validation/examples/general/actions/EnableLiveValidationDelegate.java,v >retrieving revision 1.2 >diff -u -r1.2 EnableLiveValidationDelegate.java >--- src/org/eclipse/emf/validation/examples/general/actions/EnableLiveValidationDelegate.java 6 Jun 2007 22:27:51 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/general/actions/EnableLiveValidationDelegate.java 9 Nov 2007 00:41:24 -0000 >@@ -18,8 +18,7 @@ > package org.eclipse.emf.validation.examples.general.actions; > > import java.util.Collection; >-import java.util.Iterator; >- >+import org.eclipse.emf.common.notify.Adapter; > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.util.EContentAdapter; > import org.eclipse.emf.examples.extlibrary.presentation.EXTLibraryEditor; >@@ -60,7 +59,7 @@ > /** > * Selected EObjects > */ >- protected Collection selectedEObjects = null; >+ protected Collection<Resource> selectedResources = null; > > String title = ValidationMessages.EnableLiveValidationDelegate_title; > >@@ -69,28 +68,35 @@ > * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, > * org.eclipse.jface.viewers.ISelection) > */ >+ @SuppressWarnings("unchecked") > public void selectionChanged(IAction action, final ISelection selection) { >- this.selectedEObjects = null; >+ this.selectedResources = null; > try { > if (selection instanceof IStructuredSelection) { > IStructuredSelection structuredSelection = (IStructuredSelection) selection; >- this.selectedEObjects = structuredSelection.toList(); >+ >+ Collection<?> selectedHunh = structuredSelection.toList(); >+ >+ for (Object next : selectedHunh) { >+ if (!(next instanceof Resource)) { >+ action.setEnabled(false); >+ } else if (resourceHasAdapter((Resource) next)) { >+ action.setEnabled(false); >+ } >+ } >+ >+ if (action.isEnabled()) { >+ this.selectedResources = (Collection<Resource>) selectedHunh; >+ } else { >+ this.selectedResources = null; >+ } > } > } catch (Exception e) { > // Exceptions are not expected > MessageDialog.openInformation(shell, title, MESSAGE_EXCEPTION); > throw new RuntimeException(e); > } finally { >- action.setEnabled((null != selectedEObjects)); >- } >- >- for (Iterator i = selectedEObjects.iterator(); i.hasNext();) { >- Object o = i.next(); >- if (!(o instanceof Resource)) { >- action.setEnabled(false); >- } else if (resourceHasAdapter((Resource)o)) { >- action.setEnabled(false); >- } >+ action.setEnabled((null != selectedResources)); > } > } > >@@ -131,9 +137,7 @@ > * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) > */ > public void run(IAction action) { >- for (Iterator i = selectedEObjects.iterator(); i.hasNext();) { >- Resource r = (Resource)i.next(); >- >+ for (Resource r : selectedResources) { > if (!resourceHasAdapter(r)) { > EContentAdapter liveValidationContentAdapter = new LiveValidationContentAdapter(this); > r.eAdapters().add(liveValidationContentAdapter); >@@ -142,10 +146,8 @@ > } > > private boolean resourceHasAdapter(Resource r) { >- Collection adapters = r.eAdapters(); >- for (Iterator j = adapters.iterator(); j.hasNext();) { >- Object o = j.next(); >- if (o instanceof LiveValidationContentAdapter) { >+ for (Adapter next : r.eAdapters()) { >+ if (next instanceof LiveValidationContentAdapter) { > return true; > } > } >Index: src/org/eclipse/emf/validation/examples/general/actions/BatchValidationDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/src/org/eclipse/emf/validation/examples/general/actions/BatchValidationDelegate.java,v >retrieving revision 1.2 >diff -u -r1.2 BatchValidationDelegate.java >--- src/org/eclipse/emf/validation/examples/general/actions/BatchValidationDelegate.java 6 Jun 2007 22:27:51 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/general/actions/BatchValidationDelegate.java 9 Nov 2007 00:41:24 -0000 >@@ -19,7 +19,6 @@ > > import java.util.Collection; > import java.util.HashSet; >-import java.util.Iterator; > import java.util.Set; > > import org.eclipse.core.runtime.CoreException; >@@ -41,6 +40,7 @@ > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.viewers.LabelProvider; > import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.jface.window.Window; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IActionDelegate2; >@@ -74,23 +74,36 @@ > /** > * Selected EObjects > */ >- protected Collection selectedEObjects = null; >+ protected Collection<EObject> selectedEObjects = null; > > /** > * The InputDialog title > */ >- private String title = ValidationMessages.BatchValidationDelegate_title; >+ private final String title = ValidationMessages.BatchValidationDelegate_title; > > /* > * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, > * org.eclipse.jface.viewers.ISelection) > */ >+ @SuppressWarnings("unchecked") > public void selectionChanged(IAction action, final ISelection selection) { > this.selectedEObjects = null; > try { > if (selection instanceof IStructuredSelection) { > IStructuredSelection structuredSelection = (IStructuredSelection) selection; >- this.selectedEObjects = structuredSelection.toList(); >+ >+ Collection<?> selectedHunh = structuredSelection.toList(); >+ for (Object next : selectedHunh) { >+ if (!(next instanceof EObject)) { >+ action.setEnabled(false); >+ } >+ } >+ >+ if (action.isEnabled()) { >+ this.selectedEObjects = (Collection<EObject>) selectedHunh; >+ } else { >+ this.selectedEObjects = null; >+ } > } > } catch (Exception e) { > // Exceptions are not expected >@@ -100,11 +113,6 @@ > action.setEnabled((null != selectedEObjects)); > } > >- for (Iterator i = selectedEObjects.iterator(); i.hasNext();) { >- if (!(i.next() instanceof EObject)) { >- action.setEnabled(false); >- } >- } > } > > /* >@@ -146,7 +154,7 @@ > public void run(IAction action) { > ValidationDelegateClientSelector.running = true; > >- IBatchValidator validator = (IBatchValidator)ModelValidationService.getInstance() >+ IBatchValidator validator = ModelValidationService.getInstance() > .newValidator(EvaluationMode.BATCH); > validator.setIncludeLiveConstraints(true); > >@@ -179,6 +187,7 @@ > } > }); > dialog.setLabelProvider(new LabelProvider() { >+ @Override > public String getText(Object element) { > if (element instanceof IStatus) { > return ((IStatus)element).getMessage(); >@@ -189,15 +198,15 @@ > dialog.setBlockOnOpen(true); > dialog.setMessage(ValidationMessages.BatchValidationDelegate_errorMessage); > >- if (ListDialog.OK == dialog.open()) { >- Set errorSelections = new HashSet(); >+ if (Window.OK == dialog.open()) { >+ Set<EObject> errorSelections = new HashSet<EObject>(); > if (!status.isMultiStatus()) { > IConstraintStatus cstatus = (IConstraintStatus)status; > errorSelections.add(cstatus.getTarget()); > } else { > IStatus[] children = status.getChildren(); >- for (int i = 0; i<children.length; i++) { >- IConstraintStatus cstatus = (IConstraintStatus)children[i]; >+ for (IStatus element : children) { >+ IConstraintStatus cstatus = (IConstraintStatus)element; > errorSelections.add(cstatus.getTarget()); > } > } >Index: src/org/eclipse/emf/validation/examples/general/actions/LiveValidationContentAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/src/org/eclipse/emf/validation/examples/general/actions/LiveValidationContentAdapter.java,v >retrieving revision 1.2 >diff -u -r1.2 LiveValidationContentAdapter.java >--- src/org/eclipse/emf/validation/examples/general/actions/LiveValidationContentAdapter.java 6 Jun 2007 22:27:51 -0000 1.2 >+++ src/org/eclipse/emf/validation/examples/general/actions/LiveValidationContentAdapter.java 9 Nov 2007 00:41:24 -0000 >@@ -51,14 +51,15 @@ > /* (non-Javadoc) > * @see org.eclipse.emf.ecore.util.EContentAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification) > */ >+ @Override > public void notifyChanged(final Notification notification) { > super.notifyChanged(notification); > > actionDelegate.shell.getDisplay().asyncExec(new Runnable() { > public void run() { > if (validator == null) { >- validator = (ILiveValidator) ModelValidationService >- .getInstance().newValidator(EvaluationMode.LIVE); >+ validator = ModelValidationService.getInstance().newValidator( >+ EvaluationMode.LIVE); > } > > ValidationDelegateClientSelector.running = true; >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/examples/org.eclipse.emf.validation.examples.general/META-INF/MANIFEST.MF,v >retrieving revision 1.4 >diff -u -r1.4 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 May 2007 16:09:10 -0000 1.4 >+++ META-INF/MANIFEST.MF 9 Nov 2007 00:41:24 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.validation.examples.general; singleton:=true >-Bundle-Version: 1.0.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.validation.examples.general.ValidationPlugin > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >@@ -14,11 +14,11 @@ > org.eclipse.emf.validation.examples.general.listeners > Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.emf.validation;bundle-version="[1.0.0,2.0.0)", >- org.eclipse.emf.examples.library;bundle-version="[2.2.0,3.0.0)", >- org.eclipse.emf.examples.library.edit;bundle-version="[2.2.0,3.0.0)", >- org.eclipse.emf.examples.library.editor;bundle-version="[2.2.0,3.0.0)", >+ org.eclipse.emf.validation;bundle-version="[1.2.0,2.0.0)", >+ org.eclipse.emf.examples.library;bundle-version="[2.3.0,3.0.0)", >+ org.eclipse.emf.examples.library.edit;bundle-version="[2.3.0,3.0.0)", >+ org.eclipse.emf.examples.library.editor;bundle-version="[2.3.0,3.0.0)", > org.eclipse.ui.console;bundle-version="[3.1.100,4.0.0)", >- org.eclipse.emf.validation.ui;bundle-version="[1.0.0,2.0.0)" >+ org.eclipse.emf.validation.ui;bundle-version="[1.2.0,2.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >#P org.eclipse.emf.validation.tests-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/tests/org.eclipse.emf.validation.tests-feature/feature.xml,v >retrieving revision 1.16 >diff -u -r1.16 feature.xml >--- feature.xml 7 Nov 2007 17:30:09 -0000 1.16 >+++ feature.xml 9 Nov 2007 00:41:27 -0000 >@@ -44,14 +44,19 @@ > </url> > > <requires> >+ <import plugin="org.junit" version="3.8.1" match="compatible"/> >+ <import plugin="org.eclipse.ui" version="3.2.0" match="compatible"/> >+ <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> > <import plugin="org.eclipse.core.expressions" version="3.2.0" match="compatible"/> > <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/> >- <import plugin="org.junit" version="3.8.1" match="compatible"/> > <import plugin="org.eclipse.emf.ecore.xmi" version="2.2.0" match="compatible"/> >- <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.validation.ui" version="1.0.1" match="greaterOrEqual"/> >- <import plugin="org.eclipse.ui" version="3.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.validation" version="1.1.1" match="greaterOrEqual"/> >+ <import plugin="org.apache.ant"/> >+ <import plugin="org.eclipse.ui.ide.application"/> >+ <import plugin="org.eclipse.equinox.app"/> >+ <import plugin="org.apache.ant" version="1.4.1" match="compatible"/> >+ <import plugin="org.eclipse.emf.validation" version="1.2.0" match="greaterOrEqual"/> >+ <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.validation.ui" version="1.1.100" match="greaterOrEqual"/> > </requires> > > <plugin
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
Actions:
View
|
Diff
Attachments on
bug 206808
:
82297
|
82505
|
82865