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 80842 Details for
Bug 206812
Adopt J2SE 5.0 in Query 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]
First pass at adopting J2SE 5.0-isms
query-j2se-5.0.patch (text/plain), 179.95 KB, created by
Christian Damus
on 2007-10-21 20:52:51 EDT
(
hide
)
Description:
First pass at adopting J2SE 5.0-isms
Filename:
MIME Type:
Creator:
Christian Damus
Created:
2007-10-21 20:52:51 EDT
Size:
179.95 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.query.tests >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests/.settings/org.eclipse.jdt.core.prefs,v >retrieving revision 1.1 >diff -u -r1.1 org.eclipse.jdt.core.prefs >--- .settings/org.eclipse.jdt.core.prefs 20 Dec 2006 17:06:56 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 22 Oct 2007 00:41:20 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:39:25 EST 2006 >+#Sun Oct 21 00:00:43 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: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:06:56 -0000 1.2 >+++ .classpath 22 Oct 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/query/tests/EObjectStructuralFeatureValueConditionTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests/src/org/eclipse/emf/query/tests/EObjectStructuralFeatureValueConditionTest.java,v >retrieving revision 1.1 >diff -u -r1.1 EObjectStructuralFeatureValueConditionTest.java >--- src/org/eclipse/emf/query/tests/EObjectStructuralFeatureValueConditionTest.java 26 Apr 2007 17:13:30 -0000 1.1 >+++ src/org/eclipse/emf/query/tests/EObjectStructuralFeatureValueConditionTest.java 22 Oct 2007 00:41:20 -0000 >@@ -25,6 +25,7 @@ > import junit.framework.TestSuite; > import junit.textui.TestRunner; > >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.examples.extlibrary.EXTLibraryFactory; > import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; > import org.eclipse.emf.examples.extlibrary.Library; >@@ -60,7 +61,7 @@ > } > > public void test_searchForNullValue_184011() { >- Collection objects = new java.util.HashSet(); >+ Collection<EObject> objects = new java.util.HashSet<EObject>(); > > Library a = EXTLibraryFactory.eINSTANCE.createLibrary(); > objects.add(a); >@@ -80,7 +81,7 @@ > EXTLibraryPackage.Literals.LIBRARY__NAME, > ObjectInstanceCondition.IS_NULL); > >- Collection results = query(objects, cond); >+ Collection<EObject> results = query(objects, cond); > assertEquals(Collections.singleton(b), results); > > cond = new EObjectReferenceValueCondition( >@@ -95,8 +96,8 @@ > // Framework methods > // > >- Collection query(Collection source, EObjectCondition cond) { >- return new SELECT(new FROM(source), new WHERE(cond)).execute() >- .getEObjects(); >+ Collection<EObject> query(Collection<? extends EObject> source, >+ EObjectCondition cond) { >+ return new SELECT(new FROM(source), new WHERE(cond)).execute(); > } > } >Index: src/org/eclipse/emf/query/tests/AllTests.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests/src/org/eclipse/emf/query/tests/AllTests.java,v >retrieving revision 1.5 >diff -u -r1.5 AllTests.java >--- src/org/eclipse/emf/query/tests/AllTests.java 26 Apr 2007 17:13:30 -0000 1.5 >+++ src/org/eclipse/emf/query/tests/AllTests.java 22 Oct 2007 00:41:20 -0000 >@@ -30,6 +30,7 @@ > * @author Yasser Lulu > * > */ >+@SuppressWarnings("deprecation") > public class AllTests extends TestCase implements IPlatformRunnable { > > public static void main(String[] args) { >@@ -52,5 +53,4 @@ > TestRunner.run(suite()); > return Arrays.asList(new String[] { "Please see raw test suite output for details." }); //$NON-NLS-1$ > } >- > } >Index: src/org/eclipse/emf/query/tests/EMFQueryTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests/src/org/eclipse/emf/query/tests/EMFQueryTest.java,v >retrieving revision 1.7 >diff -u -r1.7 EMFQueryTest.java >--- src/org/eclipse/emf/query/tests/EMFQueryTest.java 9 Nov 2006 16:05:09 -0000 1.7 >+++ src/org/eclipse/emf/query/tests/EMFQueryTest.java 22 Oct 2007 00:41:20 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -47,7 +47,6 @@ > import org.eclipse.emf.query.conditions.ObjectInstanceCondition; > import org.eclipse.emf.query.conditions.booleans.BooleanCondition; > import org.eclipse.emf.query.conditions.eobjects.EObjectCondition; >-import org.eclipse.emf.query.conditions.eobjects.EObjectSource; > import org.eclipse.emf.query.conditions.eobjects.EObjectTypeRelationCondition; > import org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectAttributeValueCondition; > import org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectReferenceValueCondition; >@@ -74,7 +73,7 @@ > return new TestSuite(EMFQueryTest.class); > } > >- private Collection modelElements; >+ private Collection<EObject> modelElements; > > private Library library; > >@@ -106,10 +105,11 @@ > /** > * @see junit.framework.TestCase#setUp() > */ >+ @Override > protected void setUp() throws Exception { > super.setUp(); > >- modelElements = new ArrayList(); >+ modelElements = new ArrayList<EObject>(); > modelElements.add(getLibrary()); > > book_EClass = EXTLibraryPackage.Literals.BOOK; >@@ -121,6 +121,7 @@ > /** > * @see junit.framework.TestCase#tearDown() > */ >+ @Override > protected void tearDown() throws Exception { > resource = null; > super.tearDown(); >@@ -129,12 +130,14 @@ > private void logicalOperatorsTesting() { > Condition FALSE = new BooleanCondition(false) { > >+ @Override > public boolean isSatisfied(Object object) { > return false; > } > }; > Condition TRUE = new BooleanCondition(true) { > >+ @Override > public boolean isSatisfied(Object object) { > return true; > } >@@ -189,15 +192,19 @@ > public void test_QueryStatementExceptionHandling() { > final RuntimeException exception = new RuntimeException(); > >- QueryStatement statement = new QueryStatement(false, new NullProgressMonitor()) { >+ QueryStatement statement = new QueryStatement(false, >+ new NullProgressMonitor()) { >+ @Override > public boolean canBeResumed() { > return false; > } > >+ @Override > protected void doExecute() { > throw exception; > } > >+ @Override > protected void doResume() { > doExecute(); > } >@@ -226,7 +233,7 @@ > EAttribute categoryAttribute = EXTLibraryPackage.eINSTANCE.getBook_Category(); > > SELECT s = new SELECT( >- new FROM(new EObjectSource(b)), >+ new FROM(b), > new WHERE(new EObjectAttributeValueCondition(categoryAttribute, > new ObjectInstanceCondition(categoryAttribute.getDefaultValue()), > EStructuralFeatureValueGetter.getInstance()))); >@@ -276,12 +283,14 @@ > > private boolean shouldPrune; > >+ @Override > public boolean shouldPrune(EObject object) { > return shouldPrune; > } > >+ @Override > public boolean isSatisfied(EObject element) { >- if (element.eClass() == book_EClass) { >+ if (element instanceof Book) { > if (((Book) element).getTitle().equals(title)) { > shouldPrune = true; > return true; >@@ -290,9 +299,9 @@ > return false; > } > })); >- Collection resultSet = statement.execute(); >- instance_Book1 = (Book) ((resultSet.isEmpty()) ? null >- : (EObject) resultSet.toArray()[0]); >+ Collection<EObject> resultSet = statement.execute(); >+ instance_Book1 = ((resultSet.isEmpty()) ? null >+ : resultSet.toArray(new Book[resultSet.size()])[0]); > return instance_Book1; > } > >@@ -300,7 +309,7 @@ > if (resource == null) { > resource = new ResourceImpl(URI.createURI("foo:///foo.xml")); //$NON-NLS-1$ > >- List contents = resource.getContents(); >+ List<EObject> contents = resource.getContents(); > > Library l = EXTLibraryFactory.eINSTANCE.createLibrary(); > l.setName("New Library"); //$NON-NLS-1$ >@@ -336,7 +345,7 @@ > return library; > } > >- private Collection getQueryObjects() { >+ private Collection<EObject> getQueryObjects() { > return modelElements; > } > } >\ No newline at end of file >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Apr 2007 17:24:46 -0000 1.9 >+++ META-INF/MANIFEST.MF 22 Oct 2007 00:41:20 -0000 >@@ -2,13 +2,13 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.query.tests >-Bundle-Version: 1.1.0.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Export-Package: org.eclipse.emf.query.tests > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.junit;bundle-version="[3.8.1,4.0.0)", >- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)", >- org.eclipse.emf.query;bundle-version="1.0.0", >- org.eclipse.emf.examples.library;bundle-version="[2.2.0,3.0.0)" >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+ org.eclipse.emf.ecore;bundle-version="[2.3.0,3.0.0)", >+ org.eclipse.emf.query;bundle-version="1.2.0", >+ org.eclipse.emf.examples.library;bundle-version="[2.3.0,3.0.0)" >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >#P org.eclipse.emf.query.examples >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples/META-INF/MANIFEST.MF,v >retrieving revision 1.13 >diff -u -r1.13 MANIFEST.MF >--- META-INF/MANIFEST.MF 20 Sep 2007 15:15:31 -0000 1.13 >+++ META-INF/MANIFEST.MF 22 Oct 2007 00:41:38 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.query.examples;singleton:=true >-Bundle-Version: 1.1.100.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin > Eclipse-LazyStart: true >@@ -13,4 +13,4 @@ > Bundle-Activator: org.eclipse.emf.query.examples.internal.QueryExamplesPlugin > Export-Package: org.eclipse.emf.query.examples.internal;x-internal:=true, > org.eclipse.emf.query.examples.internal.wizard;x-internal:=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.query/examples/org.eclipse.emf.query.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:07:08 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 22 Oct 2007 00:41:38 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:36:42 EST 2006 >+#Sun Oct 21 00:31:23 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/query/examples/internal/wizard/AbstractExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples/src/org/eclipse/emf/query/examples/internal/wizard/AbstractExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractExampleWizard.java >--- src/org/eclipse/emf/query/examples/internal/wizard/AbstractExampleWizard.java 17 May 2006 17:01:00 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/internal/wizard/AbstractExampleWizard.java 22 Oct 2007 00:41:38 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -24,12 +24,11 @@ > import java.lang.reflect.InvocationTargetException; > import java.net.URL; > import java.util.Collection; >-import java.util.Iterator; > import java.util.zip.ZipEntry; > import java.util.zip.ZipInputStream; > >-import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.FileLocator; >@@ -114,8 +113,9 @@ > } > } > >+ @Override > public boolean performFinish() { >- final Collection projectDescriptors = getProjectDescriptors(); >+ final Collection<ProjectDescriptor> projectDescriptors = getProjectDescriptors(); > > try { > getContainer().run(true, false, new IRunnableWithProgress() { >@@ -123,13 +123,14 @@ > throws InvocationTargetException, InterruptedException { > > WorkspaceModifyOperation op = new WorkspaceModifyOperation() { >+ @Override > protected void execute(IProgressMonitor m) > > throws CoreException, InvocationTargetException, InterruptedException { >- m.beginTask("Unzipping Projects", projectDescriptors.size()); >+ m.beginTask("Unzipping Projects", projectDescriptors.size()); //$NON-NLS-1$ > >- for (Iterator i = projectDescriptors.iterator(); i.hasNext();) { >- unzipProject((ProjectDescriptor)i.next(), m); >+ for (ProjectDescriptor desc : projectDescriptors) { >+ unzipProject(desc, m); > m.worked(1); > } > } >@@ -157,7 +158,7 @@ > * @return The collection of project descriptors that should be > * unzipped into the workspace. > */ >- protected abstract Collection getProjectDescriptors(); >+ protected abstract Collection<ProjectDescriptor> getProjectDescriptors(); > > private void unzipProject(ProjectDescriptor descriptor, IProgressMonitor monitor) { > String bundleName = descriptor.getBundleName(); >@@ -247,7 +248,7 @@ > } > > project.open(monitor); >- project.refreshLocal(IFile.DEPTH_INFINITE, monitor); >+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor); > > // Close and re-open the project to force eclipse to re-evaluate > // any natures that this project has. >Index: src/org/eclipse/emf/query/examples/internal/wizard/StatementsExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples/src/org/eclipse/emf/query/examples/internal/wizard/StatementsExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 StatementsExampleWizard.java >--- src/org/eclipse/emf/query/examples/internal/wizard/StatementsExampleWizard.java 17 May 2006 17:01:00 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/internal/wizard/StatementsExampleWizard.java 22 Oct 2007 00:41:38 -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 StatementsExampleWizard > extends AbstractExampleWizard { > >- protected Collection getProjectDescriptors() { >+ @Override >+ protected Collection<ProjectDescriptor> getProjectDescriptors() { > // We need the statements 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.query.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.query.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.query.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) { > QueryExamplesPlugin.getDefault().getLog().log(((CoreException)e).getStatus()); >Index: src/org/eclipse/emf/query/examples/internal/wizard/OCLExampleWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples/src/org/eclipse/emf/query/examples/internal/wizard/OCLExampleWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 OCLExampleWizard.java >--- src/org/eclipse/emf/query/examples/internal/wizard/OCLExampleWizard.java 17 May 2006 17:01:00 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/internal/wizard/OCLExampleWizard.java 22 Oct 2007 00:41:38 -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.query.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.query.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.query.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) { > QueryExamplesPlugin.getDefault().getLog().log(((CoreException)e).getStatus()); >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:07:08 -0000 1.2 >+++ .classpath 22 Oct 2007 00:41:38 -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> >#P org.eclipse.emf.query.doc >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/doc/org.eclipse.emf.query.doc/META-INF/MANIFEST.MF,v >retrieving revision 1.7 >diff -u -r1.7 MANIFEST.MF >--- META-INF/MANIFEST.MF 22 Mar 2007 22:20:34 -0000 1.7 >+++ META-INF/MANIFEST.MF 22 Oct 2007 00:41:48 -0000 >@@ -2,9 +2,9 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.query.doc;singleton:=true >-Bundle-Version: 1.1.0.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Vendor: %Provider.name > Bundle-Localization: plugin > Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >#P org.eclipse.emf.query-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query-feature/feature.xml,v >retrieving revision 1.12 >diff -u -r1.12 feature.xml >--- feature.xml 26 Apr 2007 18:07:21 -0000 1.12 >+++ feature.xml 22 Oct 2007 00:41:51 -0000 >@@ -2,7 +2,7 @@ > <feature > id="org.eclipse.emf.query" > label="%featureName" >- version="1.1.0.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> > >@@ -11,7 +11,7 @@ > </description> > > <copyright url="http://www.eclipse.org/legal/epl-v10.html"> >- Copyright (c) 2005, 2006 IBM Corporation and others. >+ Copyright (c) 2005, 2007 IBM Corporation and others. > All rights reserved. This program and the accompanying materials > are made available under the terms of the Eclipse Public License v1.0 > which accompanies this distribution, and is available at >@@ -29,7 +29,7 @@ > > <requires> > <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.ecore" version="2.3.0" match="compatible"/> > <import plugin="com.ibm.icu" version="3.4.3" match="compatible"/> > </requires> > >#P org.eclipse.emf.query.tests-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/tests/org.eclipse.emf.query.tests-feature/feature.xml,v >retrieving revision 1.15 >diff -u -r1.15 feature.xml >--- feature.xml 12 Jun 2007 13:58:28 -0000 1.15 >+++ feature.xml 22 Oct 2007 00:41:55 -0000 >@@ -18,7 +18,7 @@ > <feature > id="org.eclipse.emf.query.tests" > label="%featureName" >- version="1.1.0.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> > >@@ -46,10 +46,11 @@ > <requires> > <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> > <import plugin="org.junit" version="3.8.1" match="compatible"/> >- <import plugin="org.eclipse.emf.ecore" version="2.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.query" version="1.0.0" match="greaterOrEqual"/> >- <import plugin="org.eclipse.emf.examples.library" version="2.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.query.ocl" version="1.0.0" match="greaterOrEqual"/> >+ <import plugin="org.eclipse.emf.ecore" version="2.3.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.query" version="1.2.0" match="greaterOrEqual"/> >+ <import plugin="org.eclipse.emf.examples.library" version="2.3.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.query.ocl" version="1.1.0" match="greaterOrEqual"/> >+ <import plugin="org.eclipse.ocl.ecore" version="1.1.0" match="compatible"/> > </requires> > > <plugin >#P org.eclipse.emf.query >Index: src/org/eclipse/emf/query/conditions/strings/SubStringValue.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/strings/SubStringValue.java,v >retrieving revision 1.4 >diff -u -r1.4 SubStringValue.java >--- src/org/eclipse/emf/query/conditions/strings/SubStringValue.java 10 Oct 2006 14:29:58 -0000 1.4 >+++ src/org/eclipse/emf/query/conditions/strings/SubStringValue.java 22 Oct 2007 00:43:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,6 +17,8 @@ > > package org.eclipse.emf.query.conditions.strings; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > import com.ibm.icu.text.Collator; > import com.ibm.icu.text.RuleBasedCollator; > import com.ibm.icu.text.SearchIterator; >@@ -59,10 +61,25 @@ > * It defaults to being case-sensitive. > * > * @param subString The initialization <code>String<code> to see if it is a sub-string of those being evaluated >- * @param adpater The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ * @param adapter The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects > */ >- public SubStringValue(String subString, StringAdapter adpater) { >- this(subString, true, adpater); >+ public SubStringValue(String subString, StringAdapter adapter) { >+ this(subString, true, adapter); >+ } >+ >+ /** >+ * A constructor that takes an initialization <code>String<code> to >+ * see if it is a sub-string of those being evaluated and a <code>StringAdapter</code> for >+ * adapting the evaluated object to string before checking them. >+ * It defaults to being case-sensitive. >+ * >+ * @param subString The initialization <code>String<code> to see if it is a sub-string of those being evaluated >+ * @param adapter a generic string adapter to use to get a <code>String<code> out of evaluated Objects >+ * >+ * @since 1.2 >+ */ >+ public SubStringValue(String subString, IDataTypeAdapter<String> adapter) { >+ this(subString, true, adapter); > } > > /** >@@ -87,11 +104,28 @@ > * > * @param subString The initialization <code>String<code> to see if it is a sub-string of those being evaluated > * @param caseSensitive A boolean value specifying whether to use case in matching strings >- * @param adpater The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ * @param adapter The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ */ >+ public SubStringValue(String subString, boolean caseSensitive, >+ StringAdapter adapter) { >+ super(subString, caseSensitive, adapter); >+ } >+ >+ /** >+ * A constructor that takes an initialization <code>String<code> to >+ * see if it is a sub-string of those being evaluated, a boolean >+ * flag indicating whether the matching should be case-sensitive or not and >+ * and a <code>StringAdapter</code> for adapting the evaluated object to string before checking them. >+ * >+ * @param subString The initialization <code>String<code> to see if it is a sub-string of those being evaluated >+ * @param caseSensitive A boolean value specifying whether to use case in matching strings >+ * @param adapter a generic string adapter to use to get a <code>String<code> out of evaluated Objects >+ * >+ * @since 1.2 > */ > public SubStringValue(String subString, boolean caseSensitive, >- StringAdapter adpater) { >- super(subString, caseSensitive, adpater); >+ IDataTypeAdapter<String> adapter) { >+ super(subString, caseSensitive, adapter); > } > > /** >@@ -101,6 +135,7 @@ > * > * @see org.eclipse.emf.query.conditions.strings.StringCondition#isSatisfied(java.lang.String) > */ >+ @Override > public boolean isSatisfied(String str) { > StringSearch search = new StringSearch(getString(), str); > >Index: src/org/eclipse/emf/query/conditions/strings/StringAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/strings/StringAdapter.java,v >retrieving revision 1.3 >diff -u -r1.3 StringAdapter.java >--- src/org/eclipse/emf/query/conditions/strings/StringAdapter.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/strings/StringAdapter.java 22 Oct 2007 00:43:44 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,6 +17,8 @@ > > package org.eclipse.emf.query.conditions.strings; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > /** > * An Adapter class to be used to extract from -adapt- the argument object to > * some >@@ -26,7 +28,7 @@ > * > * @see StringCondition > */ >-public abstract class StringAdapter { >+public abstract class StringAdapter implements IDataTypeAdapter<String> { > > /** > * The simplest <code>StringAdapter</code> implementation that represents >@@ -35,9 +37,15 @@ > */ > public static final StringAdapter DEFAULT = new StringAdapter() { > >+ @Override > public String getString(Object object) { > return (String) object; > } >+ >+ @Override >+ public String adapt(Object value) { >+ return (String) value; >+ } > }; > > /** >@@ -47,5 +55,9 @@ > * @return String the <code>String<code> object representation of the argument object > */ > public abstract String getString(Object object); >+ >+ public String adapt(Object value) { >+ return getString(value); >+ } > > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/conditions/strings/StringCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/strings/StringCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 StringCondition.java >--- src/org/eclipse/emf/query/conditions/strings/StringCondition.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/strings/StringCondition.java 22 Oct 2007 00:43:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,7 +17,8 @@ > > package org.eclipse.emf.query.conditions.strings; > >-import org.eclipse.emf.query.conditions.Condition; >+import org.eclipse.emf.query.conditions.DataTypeCondition; >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; > > /** > * An abstract <code>Condition</code> object that tests for >@@ -26,9 +27,7 @@ > * > */ > public abstract class StringCondition >- extends Condition { >- >- private StringAdapter adapter; >+ extends DataTypeCondition<String> { > > /** > * Constructs this <code>StringCondition</code> with a >@@ -39,7 +38,23 @@ > * of the argument object when evaluating it. > */ > protected StringCondition(StringAdapter adapter) { >- this.adapter = adapter; >+ this(null, adapter); >+ } >+ >+ /** >+ * Constructs this <code>StringCondition</code> with a >+ * <code>StringAdapter</code> adapter to adapt argument objects to >+ * <code>String<code> objects in order to do the evaluation, and a string >+ * to test inputs against. >+ * >+ * @param value the value against which to test inputs >+ * @param adapter a generic string adapter to use to extract a <code>String<code> representation >+ * of the argument object when evaluating it. >+ * >+ * @since 1.2 >+ */ >+ protected StringCondition(String value, IDataTypeAdapter<String> adapter) { >+ super(value, adapter); > } > > /* >@@ -47,8 +62,9 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { >- return isSatisfied(adapter.getString(object)); >+ return isSatisfied(adapter.adapt(object)); > } > > /** >Index: src/org/eclipse/emf/query/conditions/strings/StringLength.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/strings/StringLength.java,v >retrieving revision 1.3 >diff -u -r1.3 StringLength.java >--- src/org/eclipse/emf/query/conditions/strings/StringLength.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/strings/StringLength.java 22 Oct 2007 00:43:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,6 +17,8 @@ > > package org.eclipse.emf.query.conditions.strings; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > /** > * A Condition object that tests for > * <code>String<code> length values. The arguments being evaluated >@@ -53,10 +55,26 @@ > * for adapting the evaluated object to string before getting their length. > * > * @param length The int value that the evaluated string length must match >- * @param adpater The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ * @param adapter The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ */ >+ public StringLength(int length, StringAdapter adapter) { >+ this(length, length, adapter); >+ } >+ >+ /** >+ * A constructor that takes one int argument to test strings' length against >+ * and a <code>StringAdapter</code>. It evaluates to <code>true</code> >+ * when the evaluated <code>String<code> length equals the length >+ * initialization argument. It uses the argument <code>StringAdapter</code> >+ * for adapting the evaluated object to string before getting their length. >+ * >+ * @param length The int value that the evaluated string length must match >+ * @param adapter a generic string adapter to use to get a <code>String<code> out of evaluated Objects >+ * >+ * @since 1.2 > */ >- public StringLength(int length, StringAdapter adpater) { >- this(length, length, adpater); >+ public StringLength(int length, IDataTypeAdapter<String> adapter) { >+ this(length, length, adapter); > } > > /** >@@ -83,10 +101,27 @@ > * > * @param lowerBound the int value representing the lower-bound in range testing > * @param upperBound the int value representing the upper-bound in range testing >- * @param adpater The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ * @param adapter The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ */ >+ public StringLength(int lowerBound, int upperBound, StringAdapter adapter) { >+ super(adapter); >+ this.lowerBound = lowerBound; >+ this.upperBound = upperBound; >+ } >+ >+ /** >+ * A constructor that takes two int arguments representing a range to test >+ * strings' length against. It evaluates to <code>true</code> when the >+ * evaluated <code>String<code> length is equal to any >+ * these two int values passed or fall in between. It uses the argument <code>StringAdapter</code> >+ * for adapting the evaluated object to string before getting their length. >+ * >+ * @param lowerBound the int value representing the lower-bound in range testing >+ * @param upperBound the int value representing the upper-bound in range testing >+ * @param adapter a generic string adapter to use to get a <code>String<code> out of evaluated Objects > */ >- public StringLength(int lowerBound, int upperBound, StringAdapter adpater) { >- super(adpater); >+ public StringLength(int lowerBound, int upperBound, IDataTypeAdapter<String> adapter) { >+ super(null, adapter); > this.lowerBound = lowerBound; > this.upperBound = upperBound; > } >@@ -96,6 +131,7 @@ > * > * @see org.eclipse.emf.query.conditions.strings.StringCondition#isSatisfied(java.lang.String) > */ >+ @Override > public boolean isSatisfied(String str) { > return ((str.length() >= lowerBound) && (str.length() <= upperBound)); > } >Index: src/org/eclipse/emf/query/conditions/strings/StringValue.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/strings/StringValue.java,v >retrieving revision 1.4 >diff -u -r1.4 StringValue.java >--- src/org/eclipse/emf/query/conditions/strings/StringValue.java 10 Oct 2006 14:29:58 -0000 1.4 >+++ src/org/eclipse/emf/query/conditions/strings/StringValue.java 22 Oct 2007 00:43:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,6 +17,8 @@ > > package org.eclipse.emf.query.conditions.strings; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > import com.ibm.icu.text.Normalizer; > > /** >@@ -29,8 +31,6 @@ > public class StringValue > extends StringCondition { > >- private String string; >- > private boolean caseSensitive; > > /** >@@ -67,12 +67,30 @@ > * > * @param string the initialization <code>String<code> to use for equality testing > * @param caseSensitive a boolean value specifying whether to use case in matching strings >- * @param adpater The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ * @param adapter The <code>StringAdapter</code> to use to get a <code>String<code> out of evaluated Objects >+ */ >+ public StringValue(String string, boolean caseSensitive, >+ StringAdapter adapter) { >+ super(string, adapter); >+ this.caseSensitive = caseSensitive; >+ } >+ >+ /** >+ * A simple constructor that takes an initialization >+ * <code>String<code> to match against, >+ * a <code>StringAdapter</code> for adapting the evaluated object to string before matching >+ * them and a boolean flag indicating whether the pattern matching >+ * should be case-sensitive or not. >+ * >+ * @param string the initialization <code>String<code> to use for equality testing >+ * @param caseSensitive a boolean value specifying whether to use case in matching strings >+ * @param adapter a generic string adapter to use to get a <code>String<code> out of evaluated Objects >+ * >+ * @since 1.2 > */ > public StringValue(String string, boolean caseSensitive, >- StringAdapter adpater) { >- super(adpater); >- this.string = string; >+ IDataTypeAdapter<String> adapter) { >+ super(string, adapter); > this.caseSensitive = caseSensitive; > } > >@@ -81,6 +99,7 @@ > * <code>String<code>. > * @see org.eclipse.emf.query.conditions.strings.StringCondition#isSatisfied(java.lang.String) > */ >+ @Override > public boolean isSatisfied(String str) { > return Normalizer.compare( > getString(), str, >@@ -106,7 +125,7 @@ > * @return The initialization <code>String<code> that this <code>StringValue</code> condition uses for testing > */ > protected final String getString() { >- return string; >+ return value; > } > > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/conditions/strings/StringRegularExpressionValue.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/strings/StringRegularExpressionValue.java,v >retrieving revision 1.3 >diff -u -r1.3 StringRegularExpressionValue.java >--- src/org/eclipse/emf/query/conditions/strings/StringRegularExpressionValue.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/strings/StringRegularExpressionValue.java 22 Oct 2007 00:43:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -19,6 +19,8 @@ > > import java.util.regex.Pattern; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > /** > * A <code>StringValue</code> condition subclass that tests for > * <code>String<code> using regular expression. >@@ -56,12 +58,31 @@ > * The regular expression pattern to use for matching strings > * when evaluating this <code>StringRegularExpressionValue</code> > * condition. >- * @param adpater >+ * @param adapter > * The <code>StringAdapter</code> to use to get a > * <code>String<code> out of evaluated Objects > */ >- public StringRegularExpressionValue(String patternStr, StringAdapter adpater) { >- this(patternStr, true, adpater); >+ public StringRegularExpressionValue(String patternStr, StringAdapter adapter) { >+ this(patternStr, true, adapter); >+ } >+ >+ /** >+ * A constructor that takes the regular expression to use for matching, and >+ * a <code>StringAdapter</code> for adapting the evaluated object to >+ * string before matching them. It defaults to being case-sensitive. >+ * >+ * @param patternStr >+ * The regular expression pattern to use for matching strings >+ * when evaluating this <code>StringRegularExpressionValue</code> >+ * condition. >+ * @param adapter >+ * A generic string adapter to use to get a >+ * <code>String<code> out of evaluated Objects >+ * >+ * @since 1.2 >+ */ >+ public StringRegularExpressionValue(String patternStr, IDataTypeAdapter<String> adapter) { >+ this(patternStr, true, adapter); > } > > /** >@@ -77,13 +98,40 @@ > * @param caseSensitive > * a boolean value specifying whether to use case in matching > * strings >- * @param adpater >+ * @param adapter > * The <code>StringAdapter</code> to use to get a > * <code>String<code> out of evaluated Objects > */ > public StringRegularExpressionValue(String patternStr, >- boolean caseSensitive, StringAdapter adpater) { >- super(patternStr, caseSensitive, adpater); >+ boolean caseSensitive, StringAdapter adapter) { >+ super(patternStr, caseSensitive, adapter); >+ pattern = (caseSensitive) ? Pattern.compile(patternStr) : Pattern >+ .compile(patternStr, Pattern.CASE_INSENSITIVE >+ | Pattern.UNICODE_CASE); >+ } >+ >+ /** >+ * A constructor that takes the regular expression to use for matching, a >+ * <code>StringAdapter</code> for adapting the evaluated object to string >+ * before matching them and a boolean flag indicating whether the pattern >+ * matching should be case-sensitive or not. >+ * >+ * @param patternStr >+ * The regular expression pattern to use for matching strings >+ * when evaluating this <code>StringRegularExpressionValue</code> >+ * condition. >+ * @param caseSensitive >+ * a boolean value specifying whether to use case in matching >+ * strings >+ * @param adapter >+ * A generic string adapter to use to get a >+ * <code>String<code> out of evaluated Objects >+ * >+ * @since 1.2 >+ */ >+ public StringRegularExpressionValue(String patternStr, >+ boolean caseSensitive, IDataTypeAdapter<String> adapter) { >+ super(patternStr, caseSensitive, adapter); > pattern = (caseSensitive) ? Pattern.compile(patternStr) : Pattern > .compile(patternStr, Pattern.CASE_INSENSITIVE > | Pattern.UNICODE_CASE); >@@ -95,6 +143,7 @@ > * > * @see org.eclipse.emf.query.conditions.strings.StringCondition#isSatisfied(java.lang.String) > */ >+ @Override > public boolean isSatisfied(String str) { > return getPattern().matcher(str).find(); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectContainmentFeatureCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectContainmentFeatureCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectContainmentFeatureCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectContainmentFeatureCondition.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectContainmentFeatureCondition.java 22 Oct 2007 00:43:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -65,6 +65,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return containmentFeature.equals(eObject.eContainingFeature()); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectStructuralFeatureCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureCondition.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureCondition.java 22 Oct 2007 00:43:30 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -62,6 +62,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return getFeatures(eObject.eClass()).contains(feature); > } >@@ -90,7 +91,7 @@ > * EClass and are consequently to be used for testing and evaluation > * of this condition object > */ >- protected List getFeatures(EClass eClass) { >+ protected List<? extends EStructuralFeature> getFeatures(EClass eClass) { > return eClass.getEAllStructuralFeatures(); > } > >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EStructuralFeatureValueGetter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EStructuralFeatureValueGetter.java,v >retrieving revision 1.3 >diff -u -r1.3 EStructuralFeatureValueGetter.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EStructuralFeatureValueGetter.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EStructuralFeatureValueGetter.java 22 Oct 2007 00:43:30 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -43,25 +43,25 @@ > /** > * @deprecated Use the singleton provided by {@link #getInstance()}. > */ >+ @Deprecated > public EStructuralFeatureValueGetter() { > super(); > } > >- private List getFilteredContents(EObject eObject, >- EObjectCondition filterCondition) { >- Iterator it = eObject.eContents().iterator(); >+ private List<EObject> getFilteredContents(EObject eObject, EObjectCondition filterCondition) { >+ Iterator<EObject> it = eObject.eContents().iterator(); > if (it.hasNext()) { > EObject eContainedEObject = null; >- List list = new ArrayList(); >+ List<EObject> list = new ArrayList<EObject>(); > do { >- eContainedEObject = (EObject) it.next(); >+ eContainedEObject = it.next(); > if (filterCondition.isSatisfied(eContainedEObject)) { > list.add(eContainedEObject); > } > } while (it.hasNext()); > return list; > } >- return Collections.EMPTY_LIST; >+ return Collections.emptyList(); > } > > /* >@@ -70,7 +70,7 @@ > * @see org.eclipse.emf.query.conditions.eobjects.structuralfeatures.IEStructuralFeatureValueGetter#eContents(org.eclipse.emf.ecore.EObject, > * org.eclipse.emf.query.conditions.eobjects.EObjectCondition) > */ >- public List eContents(EObject eObject, EObjectCondition filterCondition) { >+ public List<EObject> eContents(EObject eObject, EObjectCondition filterCondition) { > return (filterCondition == null) ? eObject.eContents() > : getFilteredContents(eObject, filterCondition); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferenceValueCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferenceValueCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectReferenceValueCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferenceValueCondition.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferenceValueCondition.java 22 Oct 2007 00:43:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -21,7 +21,6 @@ > > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EReference; >- > import org.eclipse.emf.query.conditions.ConditionPolicy; > import org.eclipse.emf.query.conditions.eobjects.EObjectCondition; > import org.eclipse.emf.query.handlers.PruneHandler; >@@ -307,7 +306,8 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectStructuralFeatureCondition#getFeatures(org.eclipse.emf.ecore.EClass) > */ >- protected final List getFeatures(EClass eClass) { >+ @Override >+ protected final List<EReference> getFeatures(EClass eClass) { > return eClass.getEAllReferences(); > } > >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/IEStructuralFeatureValueGetter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/IEStructuralFeatureValueGetter.java,v >retrieving revision 1.3 >diff -u -r1.3 IEStructuralFeatureValueGetter.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/IEStructuralFeatureValueGetter.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/IEStructuralFeatureValueGetter.java 22 Oct 2007 00:43:30 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -53,7 +53,7 @@ > * > * @return List The list of children of the argument eObject. > */ >- List eContents(EObject eObject, EObjectCondition filterCondition); >+ List<EObject> eContents(EObject eObject, EObjectCondition filterCondition); > > /** > * An <code>EStructuralFeature</code>'s value getter. >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureValueCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureValueCondition.java,v >retrieving revision 1.5 >diff -u -r1.5 EObjectStructuralFeatureValueCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureValueCondition.java 26 Apr 2007 17:13:31 -0000 1.5 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectStructuralFeatureValueCondition.java 22 Oct 2007 00:43:30 -0000 >@@ -60,7 +60,7 @@ > * <code>EStructuralFeature</code> and the resultant evaluation of this > * condition will be <code>false</code></li> > * >- * <li>If the collection resturned as a value of a multiple-valued >+ * <li>If the collection returned as a value of a multiple-valued > * <code>EStructuralFeature</code> is empty, then no further evaluation is > * done on the <code>EStructuralFeature</code> and the resultant evaluation of > * this condition will be <code>false</code></li> >@@ -146,6 +146,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > if (super.isSatisfied(eObject)) { > return featureCondition.isSatisfied(eObject); >@@ -210,7 +211,8 @@ > this.resolve = resolve; > } > >- public boolean isSatisfied(EObject eObject) { >+ @Override >+ public boolean isSatisfied(EObject eObject) { > Object featureValue = null; > if (eObject.eIsSet(feature)) { > featureValue = eStructuralFeatureValueGetter.eGet(eObject, >@@ -248,13 +250,14 @@ > eStructuralFeatureValueGetter, resolve); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { >- List list = null; >+ List<?> list = null; > if (eObject.eIsSet(feature)) { >- list = (List) eStructuralFeatureValueGetter.eGet(eObject, >+ list = (List<?>) eStructuralFeatureValueGetter.eGet(eObject, > feature, resolve); > } else if (feature.getDefaultValue() != null) { >- list = (List)feature.getDefaultValue(); >+ list = (List<?>) feature.getDefaultValue(); > } > > return (list == null || list.isEmpty()) ? false : policy.isSatisfied( >@@ -282,6 +285,7 @@ > policy, feature, eStructuralFeatureValueGetter, resolve); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { > if (FeatureMapUtil.isMany(eObject, feature)) { > return multipleEvaluator.isSatisfied(eObject); >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferencerCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferencerCondition.java,v >retrieving revision 1.5 >diff -u -r1.5 EObjectReferencerCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferencerCondition.java 10 Oct 2006 14:29:57 -0000 1.5 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectReferencerCondition.java 22 Oct 2007 00:43:30 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -104,12 +104,13 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > boolean result = false; > EReference eReference = null; >- Iterator it = eObject.eClass().getEAllReferences().iterator(); >+ Iterator<EReference> it = eObject.eClass().getEAllReferences().iterator(); > while (it.hasNext() && (result == false)) { >- eReference = (EReference) it.next(); >+ eReference = it.next(); > > // We don't consider containment or container EReferences > // as "referencers." Plus, the EReference must be set >@@ -121,7 +122,7 @@ > eReference, true); > > if (FeatureMapUtil.isMany(eObject, eReference)) { >- result = ((Collection) value).contains(referencedEObject); >+ result = ((Collection<?>) value).contains(referencedEObject); > } else { > result = referencedEObject.equals(value); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectAttributeValueCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectAttributeValueCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectAttributeValueCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectAttributeValueCondition.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/structuralfeatures/EObjectAttributeValueCondition.java 22 Oct 2007 00:43:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -21,7 +21,6 @@ > > import org.eclipse.emf.ecore.EAttribute; > import org.eclipse.emf.ecore.EClass; >- > import org.eclipse.emf.query.conditions.Condition; > import org.eclipse.emf.query.conditions.ConditionPolicy; > import org.eclipse.emf.query.conditions.eobjects.EObjectCondition; >@@ -271,7 +270,8 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectStructuralFeatureCondition#getFeatures(org.eclipse.emf.ecore.EClass) > */ >- protected final List getFeatures(EClass eClass) { >+ @Override >+ protected final List<EAttribute> getFeatures(EClass eClass) { > return eClass.getEAllAttributes(); > } > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/conditions/numbers/NumberAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/numbers/NumberAdapter.java,v >retrieving revision 1.3 >diff -u -r1.3 NumberAdapter.java >--- src/org/eclipse/emf/query/conditions/numbers/NumberAdapter.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/numbers/NumberAdapter.java 22 Oct 2007 00:43:44 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,28 +17,64 @@ > > package org.eclipse.emf.query.conditions.numbers; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > /** > * An Adapter class to be used to extract from -adapt- the argument object to > * some numeric value that would later be used in Condition evaluation. > * >- * Clients can subclass it and provide their own implementation >+ * Clients can subclass it and provide their own implementation. >+ * <p> >+ * Since the 1.2 release, this class is no longer abstract and can be used >+ * as a generic number adapter for all number types. >+ * </p> >+ * >+ * @param <N> the kind of number to which I adapt input values > * > * @see NumberCondition > */ > >-public abstract class NumberAdapter { >+public class NumberAdapter<N extends Number & Comparable<? super N>> >+ implements IDataTypeAdapter<N> { > >- private NumberAdapter() { >- //private >+ /** >+ * A default number adapter, that simply assumes that >+ * input values are of my number kind and casts them appropriately. >+ * Note that the declaration of this default as type Integer actually >+ * doesn't matter at all, because the "cast" to (N), in this case (Integer), >+ * doesn't actually exist; hence the "unchecked" warning in the default >+ * implementation of {@link #adapt(Object)}. >+ */ >+ private static final NumberAdapter<?> DEFAULT = new NumberAdapter<Integer>(); >+ >+ /** >+ * Initializes me as a default number adapter, that simply assumes that >+ * input values are of my number kind and casts them appropriately. >+ * >+ * @since 1.2 >+ */ >+ public NumberAdapter() { >+ super(); >+ } >+ >+ /** >+ * Obtains a default number adapter, that simply assumes that input >+ * values are of the required number kind and casts them appropriately. >+ * >+ * @since 1.2 >+ */ >+ @SuppressWarnings("unchecked") >+ public static <N extends Number & Comparable<? super N>> NumberAdapter<N> getDefault() { >+ return (NumberAdapter<N>) DEFAULT; > } > > /** > * A subclass of <code>NumberAdapter</code> to be used to adapt an > * argument object to <code>int</code> values Clients can either use the >- * default implemantation supplied or have their own. >+ * default implementation supplied or have their own. > */ > public static abstract class IntegerAdapter >- extends NumberAdapter { >+ extends NumberAdapter<Integer> { > > /** > * The simplest <code>IntegerAdapter</code> implementation that >@@ -47,9 +83,15 @@ > */ > public static final IntegerAdapter DEFAULT = new IntegerAdapter() { > >+ @Override > public int intValue(Object object) { > return ((Integer) object).intValue(); > } >+ >+ @Override >+ public Integer adapt(Object value) { >+ return (Integer) value; >+ } > }; > > /** >@@ -67,10 +109,10 @@ > /** > * A subclass of <code>NumberAdapter</code> to be used to adapt an > * argument object to <code>double</code> values Clients can either use >- * the default implemantation supplied or have their own. >+ * the default implementation supplied or have their own. > */ > public static abstract class DoubleAdapter >- extends NumberAdapter { >+ extends NumberAdapter<Double> { > > /** > * The simplest <code>DoubleAdapter</code> implementation that >@@ -79,9 +121,15 @@ > */ > public static final DoubleAdapter DEFAULT = new DoubleAdapter() { > >+ @Override > public double doubleValue(Object object) { > return ((Double) object).doubleValue(); > } >+ >+ @Override >+ public Double adapt(Object value) { >+ return (Double) value; >+ } > }; > > /** >@@ -99,10 +147,10 @@ > /** > * A subclass of <code>NumberAdapter</code> to be used to adapt an > * argument object to <code>byte</code> values Clients can either use the >- * default implemantation supplied or have their own. >+ * default implementation supplied or have their own. > */ > public static abstract class ByteAdapter >- extends NumberAdapter { >+ extends NumberAdapter<Byte> { > > /** > * The simplest <code>ByteAdapter</code> implementation that >@@ -111,9 +159,15 @@ > */ > public static final ByteAdapter DEFAULT = new ByteAdapter() { > >+ @Override > public byte byteValue(Object object) { > return ((Byte) object).byteValue(); > } >+ >+ @Override >+ public Byte adapt(Object value) { >+ return (Byte) value; >+ } > }; > > /** >@@ -131,10 +185,10 @@ > /** > * A subclass of <code>NumberAdapter</code> to be used to adapt an > * argument object to <code>long</code> values Clients can either use the >- * default implemantation supplied or have their own. >+ * default implementation supplied or have their own. > */ > public static abstract class LongAdapter >- extends NumberAdapter { >+ extends NumberAdapter<Long> { > > /** > * The simplest <code>LongAdapter</code> implementation that >@@ -143,9 +197,15 @@ > */ > public static final LongAdapter DEFAULT = new LongAdapter() { > >+ @Override > public long longValue(Object object) { > return ((Long) object).longValue(); > } >+ >+ @Override >+ public Long adapt(Object value) { >+ return (Long) value; >+ } > }; > > /** >@@ -163,10 +223,10 @@ > /** > * A subclass of <code>NumberAdapter</code> to be used to adapt an > * argument object to <code>float</code> values Clients can either use the >- * default implemantation supplied or have their own. >+ * default implementation supplied or have their own. > */ > public static abstract class FloatAdapter >- extends NumberAdapter { >+ extends NumberAdapter<Float> { > > /** > * The simplest <code>FloatAdapter</code> implementation that >@@ -175,9 +235,15 @@ > */ > public static final FloatAdapter DEFAULT = new FloatAdapter() { > >+ @Override > public float floatValue(Object object) { > return ((Float) object).floatValue(); > } >+ >+ @Override >+ public Float adapt(Object value) { >+ return (Float) value; >+ } > }; > > /** >@@ -195,10 +261,10 @@ > /** > * A subclass of <code>NumberAdapter</code> to be used to adapt an > * argument object to <code>short</code> values Clients can either use the >- * default implemantation supplied or have their own. >+ * default implementation supplied or have their own. > */ > public static abstract class ShortAdapter >- extends NumberAdapter { >+ extends NumberAdapter<Short> { > > /** > * The simplest <code>ShortAdapter</code> implementation that >@@ -207,9 +273,15 @@ > */ > public static final ShortAdapter DEFAULT = new ShortAdapter() { > >+ @Override > public short shortValue(Object object) { > return ((Short) object).shortValue(); > } >+ >+ @Override >+ public Short adapt(Object value) { >+ return (Short) value; >+ } > }; > > /** >@@ -224,4 +296,8 @@ > public abstract short shortValue(Object object); > } > >+ @SuppressWarnings("unchecked") >+ public N adapt(Object value) { >+ return (N) value; >+ } > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/conditions/numbers/NumberCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/numbers/NumberCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 NumberCondition.java >--- src/org/eclipse/emf/query/conditions/numbers/NumberCondition.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/numbers/NumberCondition.java 22 Oct 2007 00:43:44 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,7 +17,7 @@ > > package org.eclipse.emf.query.conditions.numbers; > >-import org.eclipse.emf.query.conditions.Condition; >+import org.eclipse.emf.query.conditions.DataTypeCondition; > > /** > * A <code>Condition</code> object that tests for numeric arguments. The >@@ -25,29 +25,116 @@ > * a <code>NumberAdapter</code> and then compared to the initialization value > * of this <code>NumberCondition</code>. It evaluates to <code>true</code> > * when the values are equal or if the value is within the range of supplied >- * lower-bound and upper-bound >+ * lower-bound and upper-bound. >+ * <p> >+ * Since the 1.2 release, this class is no longer abstract, serving as a generic >+ * number condition, applicable to any number type. Indeed, the nested >+ * subclasses specific to different precisions are obsolete (though not >+ * deprecated). >+ * </p> >+ * >+ * @see > */ >- >-public abstract class NumberCondition >- extends Condition { >+public class NumberCondition<N extends Number & Comparable<? super N>> >+ extends DataTypeCondition<N> { > > /** The upper bound of a range condition. */ >- protected Number upperBound; >+ protected N upperBound; > > /** The lower bound of a range condition. */ >- protected Number lowerBound; >+ protected N lowerBound; > > /** >- * Adapts elements to numbers (usually according to some numeric >- * {@link org.eclipse.emf.ecore.EAttribute}. >+ * Initializes me with a single number against which to test input >+ * values, assuming that they will be numbers of the appropriate kind. >+ * >+ * @param number the number to match against input values >+ * >+ * @since 1.2 > */ >- protected NumberAdapter adapter; >+ public NumberCondition(N number) { >+ super(number, NumberAdapter.<N>getDefault()); >+ >+ this.lowerBound = number; >+ this.upperBound = number; >+ } > >- private NumberCondition(Number lowerBound, Number upperBound, >- NumberAdapter adapter) { >+ /** >+ * Initializes me with upper and lower bounds against which to test input >+ * values, assuming that they will be numbers of the appropriate kind. >+ * >+ * @param lowerBound the lower bound to test >+ * @param upperBound the upper bound to test >+ * >+ * @since 1.2 >+ */ >+ public NumberCondition(N lowerBound, N upperBound) { >+ super(lowerBound, NumberAdapter.<N>getDefault()); >+ > this.lowerBound = lowerBound; > this.upperBound = upperBound; >- this.adapter = adapter; >+ } >+ >+ /** >+ * Initializes me with a single number against which to test input >+ * values, and an adapter to convert those inputs to numbers. >+ * >+ * @param number the number to match against input values >+ * @param adapter to convert input values to the appropriate number kind >+ * >+ * @since 1.2 >+ */ >+ public NumberCondition(N number, NumberAdapter<? extends N> adapter) { >+ super(number, adapter); >+ >+ this.lowerBound = number; >+ this.upperBound = number; >+ } >+ >+ /** >+ * Initializes me with upper and lower bounds against which to test input >+ * values, and an adapter to convert those inputs to numbers. >+ * >+ * @param lowerBound the lower bound to test >+ * @param upperBound the upper bound to test >+ * @param adapter to convert input values to the appropriate number kind >+ * >+ * @since 1.2 >+ */ >+ public NumberCondition(N lowerBound, N upperBound, NumberAdapter<? extends N> adapter) { >+ super(lowerBound, adapter); >+ >+ this.lowerBound = lowerBound; >+ this.upperBound = upperBound; >+ } >+ >+ /** >+ * Obtains a condition checking for values equal to the specified >+ * <tt>number</tt>. >+ * >+ * @param number a number to check for >+ * @return a condition that does the checking >+ * >+ * @since 1.2 >+ */ >+ public static <N extends Number & Comparable<? super N>> NumberCondition<N> >+ equals(N number) { >+ return new NumberCondition<N>(number, number); >+ } >+ >+ /** >+ * Obtains a condition checking for values in the range to the specified >+ * <tt>lowerBound</tt> and <tt>upperBound</tt> (inclusive). >+ * >+ * @param lowerBound the lower bound of numbers to check for >+ * @param upperBound the upper bound of numbers to check for >+ * @return a condition that does the checking >+ * >+ * @since 1.2 >+ */ >+ public static <N extends Number & Comparable<? super N>> NumberCondition<N> >+ between(N lowerBound, N upperBound) { >+ return new NumberCondition<N>(lowerBound, upperBound); > } > > /** >@@ -56,7 +143,7 @@ > * or have their own. > */ > public static class IntegerValue >- extends NumberCondition { >+ extends NumberCondition<Integer> { > > /** > * A simple constructor, it takes only one <code>Integer</code> >@@ -135,6 +222,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return isSatisfied(((NumberAdapter.IntegerAdapter) adapter) > .intValue(object)); >@@ -148,7 +236,7 @@ > * their own. > */ > public static class ByteValue >- extends NumberCondition { >+ extends NumberCondition<Byte> { > > /** > * A simple constructor, it takes only one <code>Byte</code> argument >@@ -225,6 +313,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return isSatisfied(((NumberAdapter.ByteAdapter) adapter) > .byteValue(object)); >@@ -237,7 +326,7 @@ > * or have their own. > */ > public static class DoubleValue >- extends NumberCondition { >+ extends NumberCondition<Double> { > > /** > * A simple constructor, it takes only one <code>Double</code> >@@ -316,6 +405,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return isSatisfied(((NumberAdapter.DoubleAdapter) adapter) > .doubleValue(object)); >@@ -328,7 +418,7 @@ > * their own. > */ > public static class FloatValue >- extends NumberCondition { >+ extends NumberCondition<Float> { > > /** > * A simple constructor, it takes only one Float argument which means in >@@ -407,6 +497,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return isSatisfied(((NumberAdapter.FloatAdapter) adapter) > .floatValue(object)); >@@ -419,7 +510,7 @@ > * their own. > */ > public static class LongValue >- extends NumberCondition { >+ extends NumberCondition<Long> { > > /** > * A simple constructor, it takes only one Long argument which means in >@@ -496,6 +587,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return isSatisfied(((NumberAdapter.LongAdapter) adapter) > .longValue(object)); >@@ -508,7 +600,7 @@ > * their own. > */ > public static class ShortValue >- extends NumberCondition { >+ extends NumberCondition<Short> { > > /** > * A simple constructor, it takes only one Short argument which means in >@@ -586,6 +678,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return isSatisfied(((NumberAdapter.ShortAdapter) adapter) > .shortValue(object)); >@@ -747,4 +840,11 @@ > return (shortValue >= lowerBound.shortValue()) > && (shortValue <= upperBound.shortValue()); > } >+ >+ @Override >+ public boolean isSatisfied(Object object) { >+ N number = adapter.adapt(object); >+ return (lowerBound.compareTo(number) <= 0) >+ && (upperBound.compareTo(number) >= 0); >+ } > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/internal/util/TypeRelationChecker.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/internal/util/TypeRelationChecker.java,v >retrieving revision 1.3 >diff -u -r1.3 TypeRelationChecker.java >--- src/org/eclipse/emf/query/internal/util/TypeRelationChecker.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/internal/util/TypeRelationChecker.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -31,26 +31,30 @@ > */ > public abstract class TypeRelationChecker { > >- private static final Map typesRelationsMaps = new WeakHashMap(); >+ private static final Map<EClass, Map<TypeRelation, Map<EClass, Boolean>>> >+ typesRelationsMaps = new WeakHashMap<EClass, Map<TypeRelation,Map<EClass,Boolean>>>(); > >- private static Map getTypeRelationsCacheMap(EClass type, >+ private static Map<EClass, Boolean> getTypeRelationsCacheMap(EClass type, > TypeRelation relationKind) { > return getTypeMap(typesRelationsMaps, type, relationKind); > } > >- private static Map getTypeMap(Map typesMaps, EClass type, >+ private static Map<EClass, Boolean> getTypeMap( >+ Map<EClass, Map<TypeRelation, Map<EClass, Boolean>>> typesMaps, >+ EClass type, > TypeRelation relationKind) { >- Map map = null; >- Map maps = (Map) typesMaps.get(type); >+ >+ Map<EClass, Boolean> map = null; >+ Map<TypeRelation, Map<EClass, Boolean>> maps = typesMaps.get(type); > if (maps == null) { >- maps = new WeakHashMap(); >+ maps = new WeakHashMap<TypeRelation, Map<EClass,Boolean>>(); > typesMaps.put(type, maps); >- map = new WeakHashMap(); >+ map = new WeakHashMap<EClass, Boolean>(); > maps.put(relationKind, map); > } else { >- map = (Map) maps.get(relationKind); >+ map = maps.get(relationKind); > if (map == null) { >- map = new WeakHashMap(); >+ map = new WeakHashMap<EClass, Boolean>(); > maps.put(relationKind, map); > } > } >@@ -61,7 +65,7 @@ > private EClass type; > > private TypeRelation relationKind; >- private Map typeRelationsCache; >+ private Map<EClass, Boolean> typeRelationsCache; > > private TypeRelationChecker(EClass type, TypeRelation relationKind) { > if (type == null || relationKind == null) { >@@ -81,7 +85,7 @@ > * > * @return the cache > */ >- protected final Map getRelationsCache() { >+ protected final Map<EClass, Boolean> getRelationsCache() { > return typeRelationsCache; > } > >@@ -111,11 +115,10 @@ > * @return whether it relates as required to the checker's type > */ > public boolean isTypeRelationOK(EClass eClass) { >- Boolean checked = (Boolean) getRelationsCache().get(eClass); >+ Boolean checked = getRelationsCache().get(eClass); > if (checked == null) { > boolean result = checkRelation(eClass); >- getRelationsCache().put(eClass, >- (result) ? Boolean.TRUE : Boolean.FALSE); >+ getRelationsCache().put(eClass, result); > return result; > } > return checked.booleanValue(); >@@ -182,13 +185,14 @@ > private static class BaseTypeRelationChecker > extends TypeRelationChecker { > >- private List allSuperTypes; >+ private List<EClass> allSuperTypes; > > BaseTypeRelationChecker(EClass type) { > super(type, TypeRelation.BASETYPE_LITERAL); > allSuperTypes = type.getEAllSuperTypes(); > } > >+ @Override > protected boolean checkRelation(EClass type) { > return allSuperTypes.contains(type); > } >@@ -198,13 +202,14 @@ > private static class DirectBaseTypeRelationChecker > extends TypeRelationChecker { > >- private List directSuperTypes; >+ private List<EClass> directSuperTypes; > > DirectBaseTypeRelationChecker(EClass type) { > super(type, TypeRelation.DIRECT_BASETYPE_LITERAL); > directSuperTypes = type.getESuperTypes(); > } > >+ @Override > protected boolean checkRelation(EClass type) { > return directSuperTypes.contains(type); > } >@@ -218,6 +223,7 @@ > super(type, TypeRelation.DIRECT_SUBTYPE_LITERAL); > } > >+ @Override > protected boolean checkRelation(EClass type) { > return type.getESuperTypes().contains(getType()); > } >@@ -231,6 +237,7 @@ > super(type, TypeRelation.SAMETYPE_LITERAL); > } > >+ @Override > protected boolean checkRelation(EClass type) { > return getType().equals(type); > } >@@ -244,6 +251,7 @@ > super(type, TypeRelation.SUBTYPE_LITERAL); > } > >+ @Override > protected boolean checkRelation(EClass type) { > return type.getEAllSuperTypes().contains(getType()); > } >@@ -261,6 +269,7 @@ > this.typeRelationCheckers = typeRelationCheckers; > } > >+ @Override > protected boolean checkRelation(EClass type) { > for (int i = 0; i < typeRelationCheckers.length; ++i) { > if (typeRelationCheckers[i].isTypeRelationOK(type)) { >@@ -294,6 +303,7 @@ > checker = new RelatedTypeRelationChecker(type); > } > >+ @Override > protected boolean checkRelation(EClass type) { > return !checker.checkRelation(type); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/EObjectTypeRelationCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/EObjectTypeRelationCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectTypeRelationCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/EObjectTypeRelationCondition.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/EObjectTypeRelationCondition.java 22 Oct 2007 00:42:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -24,7 +24,7 @@ > import org.eclipse.emf.query.internal.util.TypeRelationChecker; > > /** >- * An <code>EObjectCondition</code> specilaization to be used for evaluating >+ * An <code>EObjectCondition</code> specialization to be used for evaluating > * the inheritance/type relationship of an <code>EObject</code> to another > * using the EObjects' EClasses. For example it could be used to find if a given > * <code>EObject</code> is a subtype/supertype of another <code>EObject</code>. >@@ -36,11 +36,13 @@ > > /** > * A constant <code>EObjectTypeRelationCondition</code> object used to >- * indicate that the type relatioship is undefined and hence it is always >+ * indicate that the type relationship is undefined and hence it is always > * satisfied. > */ >- public static final EObjectTypeRelationCondition UNDEFINED = new EObjectTypeRelationCondition() { >+ public static final EObjectTypeRelationCondition UNDEFINED = >+ new EObjectTypeRelationCondition() { > >+ @Override > public boolean isSatisfied(EObject eObject) { > return true; > } >@@ -130,6 +132,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return typeRelationChecker.isTypeRelationOK(eObject.eClass()); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/EObjectCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/EObjectCondition.java,v >retrieving revision 1.4 >diff -u -r1.4 EObjectCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/EObjectCondition.java 6 Jun 2007 22:27:46 -0000 1.4 >+++ src/org/eclipse/emf/query/conditions/eobjects/EObjectCondition.java 22 Oct 2007 00:42:59 -0000 >@@ -55,6 +55,7 @@ > */ > public static final EObjectCondition E_TRUE = new EObjectCondition() { > >+ @Override > public boolean isSatisfied(EObject object) { > return true; > } >@@ -67,6 +68,7 @@ > public static final EObjectCondition E_FALSE = new EObjectCondition( > PruneHandler.ALWAYS) { > >+ @Override > public boolean isSatisfied(EObject object) { > return false; > } >@@ -75,17 +77,19 @@ > private PruneHandler pruneHandler; > > /** >- * A simple constructor. It defaults to using the PruneHandler.NEVER >+ * A simple constructor. It defaults to using the PruneHandler.NEVER and >+ * matches any {@link EObject}. > * > * @see org.eclipse.emf.query.handlers.PruneHandler > */ >- protected EObjectCondition() { >+ public EObjectCondition() { > this(PruneHandler.NEVER); > } > > /** >- * A constructor that takes in a <code>PruneHandler</code> instaince to >- * use for pruning >+ * A constructor that takes in a <code>PruneHandler</code> instance to >+ * use for pruning. This constructor will match any kind of {@link EObject}, >+ * so it is only safe for conditions with <tt>E == EObject</tt>. > * > * @param pruneHandler > * The <code>PruneHandler</code> to use for pruning >@@ -125,6 +129,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > if (object instanceof EObject) { > return isSatisfied((EObject) object); >@@ -160,6 +165,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { > return EObjectCondition.this.isSatisfied(eObject) > && condition.isSatisfied(eObject); >@@ -169,6 +175,7 @@ > * Prunes if and only if either of the <code>and</code>ed conditions > * would prune. > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return EObjectCondition.this.shouldPrune(eObject) > || condition.shouldPrune(eObject); >@@ -182,6 +189,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { > return EObjectCondition.this.isSatisfied(eObject) > || condition.isSatisfied(eObject); >@@ -191,6 +199,7 @@ > * Prunes if and only if both of the <code>or</code>ed conditions > * would prune. > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return EObjectCondition.this.shouldPrune(eObject) > && condition.shouldPrune(eObject); >@@ -204,6 +213,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { > return EObjectCondition.this.isSatisfied(eObject) > ^ condition.isSatisfied(eObject); >@@ -214,6 +224,7 @@ > * Prunes if and only if both of the <code>xor</code>ed conditions > * would prune. > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return EObjectCondition.this.shouldPrune(eObject) > && condition.shouldPrune(eObject); >@@ -227,6 +238,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { > return (!(EObjectCondition.this.isSatisfied(eObject))) > || condition.isSatisfied(eObject); >@@ -235,6 +247,7 @@ > /** > * Never prunes. > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return false; > } >@@ -247,6 +260,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(EObject eObject) { > return EObjectCondition.this.isSatisfied(eObject) == condition > .isSatisfied(eObject); >@@ -255,6 +269,7 @@ > /** > * Never prunes. > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return false; > } >@@ -290,7 +305,7 @@ > * <code>EObjectCondition</code> and the argument > * <code>EObjectCondition</code>. The returned > * <code>EObjectCondition</code> is a newly created >- * <code>EObjectCondition</code> which is satisified if either of its >+ * <code>EObjectCondition</code> which is satisfied if either of its > * constituent <code>EObjectCondition</code> is. Please note that the > * newly compounded <code>EObjectCondition</code> will evaluate this > * <code>EObjectCondition</code> first, and if the result is >@@ -320,7 +335,7 @@ > * <code>EObjectCondition</code> and the argument > * <code>EObjectCondition</code>. The returned > * <code>EObjectCondition</code> is a newly created >- * <code>EObjectCondition</code> which is satisified if XORing its >+ * <code>EObjectCondition</code> which is satisfied if XORing its > * constituent <code>EObjectCondition</code> is. > * > * @param condition >Index: src/org/eclipse/emf/query/conditions/eobjects/IN.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/IN.java,v >retrieving revision 1.3 >diff -u -r1.3 IN.java >--- src/org/eclipse/emf/query/conditions/eobjects/IN.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/IN.java 22 Oct 2007 00:42:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -38,7 +38,7 @@ > * The set of EObjects to check if they contain amongst them some > * other <code>EObject</code> > */ >- public IN(Set eObjects) { >+ public IN(Set<? extends EObject> eObjects) { > this(new EObjectSource(eObjects)); > } > >@@ -72,6 +72,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return eObjectSource.getEObjects().contains(eObject); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/ENot.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/ENot.java,v >retrieving revision 1.3 >diff -u -r1.3 ENot.java >--- src/org/eclipse/emf/query/conditions/eobjects/ENot.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/ENot.java 22 Oct 2007 00:42:43 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -43,6 +43,7 @@ > /** > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return !(condition.isSatisfied(object)); > } >@@ -52,6 +53,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return !(condition.isSatisfied(eObject)); > } >@@ -61,6 +63,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#shouldPrune(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return false; > } >Index: src/org/eclipse/emf/query/conditions/eobjects/TypeRelation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/TypeRelation.java,v >retrieving revision 1.3 >diff -u -r1.3 TypeRelation.java >--- src/org/eclipse/emf/query/conditions/eobjects/TypeRelation.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/TypeRelation.java 22 Oct 2007 00:43:15 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,31 +17,25 @@ > > package org.eclipse.emf.query.conditions.eobjects; > >-import java.util.ArrayList; > import java.util.Collections; > import java.util.List; > >-import org.eclipse.emf.common.util.AbstractEnumerator; >+import org.eclipse.emf.common.util.Enumerator; > > /** >- * An enumerator for the kinds of relatioships between EClasses/types. It is >+ * An enumerator for the kinds of relationships between EClasses/types. It is > * primarily used by <code>EObjectTypeRelationCondition</code> to check for > * relations between EObjects > */ >-public final class TypeRelation >- extends AbstractEnumerator { >- >- private static int valueCounter; >- >- private static final List values = new ArrayList(); >+public enum TypeRelation >+ implements Enumerator { > > /** > * A <code>TypeRelation</code> enumeration literal used to denote an > * undefined relationship between two types which means the two types could > * or could not be related at all. > */ >- public static final TypeRelation UNDEFINED_LITERAL = new TypeRelation( >- "UNDEFINED"); //$NON-NLS-1$ >+ UNDEFINED_LITERAL("UNDEFINED"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote the >@@ -49,8 +43,7 @@ > * this relationship, in other words, either type could be a parent of > * another, or they could be the same. > */ >- public static final TypeRelation RELATED_TYPE_LITERAL = new TypeRelation( >- "RELATED_TYPE"); //$NON-NLS-1$ >+ RELATED_TYPE_LITERAL("RELATED_TYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote the >@@ -58,71 +51,61 @@ > * this relationship, in other words, either type should not be a parent of > * the other, nor they should be the same. > */ >- public static final TypeRelation UNRELATED_TYPE_LITERAL = new TypeRelation( >- "UNRELATED_TYPE"); //$NON-NLS-1$ >+ UNRELATED_TYPE_LITERAL("UNRELATED_TYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that two > * types are exactly the same. > */ >- public static final TypeRelation SAMETYPE_LITERAL = new TypeRelation( >- "SAMETYPE"); //$NON-NLS-1$ >+ SAMETYPE_LITERAL("SAMETYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is a base type of another. > */ >- public static final TypeRelation BASETYPE_LITERAL = new TypeRelation( >- "BASETYPE"); //$NON-NLS-1$ >+ BASETYPE_LITERAL("BASETYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is a sub type of another. > */ >- public static final TypeRelation SUBTYPE_LITERAL = new TypeRelation( >- "SUBTYPE"); //$NON-NLS-1$ >+ SUBTYPE_LITERAL("SUBTYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is a direct super type of another. > */ >- public static final TypeRelation DIRECT_BASETYPE_LITERAL = new TypeRelation( >- "DIRECT_BASETYPE"); //$NON-NLS-1$ >+ DIRECT_BASETYPE_LITERAL("DIRECT_BASETYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is a direct sub type of another. > */ >- public static final TypeRelation DIRECT_SUBTYPE_LITERAL = new TypeRelation( >- "DIRECT_SUBTYPE"); //$NON-NLS-1$ >+ DIRECT_SUBTYPE_LITERAL("DIRECT_SUBTYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is either the same or a direct sub type of another. > */ >- public static final TypeRelation SAMETYPE_OR_DIRECT_SUBTYPE_LITERAL = new TypeRelation( >- "SAMETYPE_OR_DIRECT_SUBTYPE"); //$NON-NLS-1$ >+ SAMETYPE_OR_DIRECT_SUBTYPE_LITERAL("SAMETYPE_OR_DIRECT_SUBTYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is either the same or a direct base type of another. > */ >- public static final TypeRelation SAMETYPE_OR_DIRECT_BASETYPE_LITERAL = new TypeRelation( >- "SAMETYPE_OR_DIRECT_BASETYPE"); //$NON-NLS-1$ >+ SAMETYPE_OR_DIRECT_BASETYPE_LITERAL("SAMETYPE_OR_DIRECT_BASETYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is either the same or a sub type of another. > */ >- public static final TypeRelation SAMETYPE_OR_SUBTYPE_LITERAL = new TypeRelation( >- "SAMETYPE_OR_SUBTYPE"); //$NON-NLS-1$ >+ SAMETYPE_OR_SUBTYPE_LITERAL("SAMETYPE_OR_SUBTYPE"), //$NON-NLS-1$ > > /** > * A <code>TypeRelation</code> enumeration literal used to denote that one > * type is either the same or a super type of another. > */ >- public static final TypeRelation SAMETYPE_OR_BASETYPE_LITERAL = new TypeRelation( >- "SAMETYPE_OR_BASETYPE"); //$NON-NLS-1$ >+ SAMETYPE_OR_BASETYPE_LITERAL("SAMETYPE_OR_BASETYPE"); //$NON-NLS-1$ > > /** > * The integer value of the UNDEFINED_LITERAL <code>TypeRelation</code> >@@ -201,17 +184,17 @@ > public static final int SAMETYPE_OR_BASETYPE = SAMETYPE_OR_BASETYPE_LITERAL > .getValue(); > >+ private static final List<TypeRelation> values = java.util.Arrays.asList(values()); >+ > /** > * An immutable list of the enumeration literals declared by this enumerator > */ >- public static final List VALUES = Collections.unmodifiableList(values); >- >- private static final TypeRelation[] VALUES_ARRAY = (TypeRelation[]) VALUES >- .toArray(new TypeRelation[VALUES.size()]); >+ public static final List<TypeRelation> VALUES = Collections.unmodifiableList(values); > >+ private final String name; >+ > private TypeRelation(String name) { >- super(valueCounter++, name); >- values.add(this); >+ this.name = name; > } > > /** >@@ -221,14 +204,14 @@ > * @param value > * An integer representing the value of a > * <code>TypeRelation</code> enumeration literal >- * @return TypeRelation the <code>TypeRelation</code> having this name or >- * null if the name is not recognised >+ * @return the <code>TypeRelation</code> having this name or >+ * null if the name is not recognized > */ > public static TypeRelation get(int value) { >- if (value >= VALUES_ARRAY.length || value < 0) { >+ if (value >= VALUES.size() || value < 0) { > return null; > } >- return VALUES_ARRAY[value]; >+ return VALUES.get(value); > } > > /** >@@ -238,13 +221,13 @@ > * @param name > * A string representing the name of a <code>TypeRelation</code> > * enumeration literal >- * @return TypeRelation the <code>TypeRelation</code> having this name or >- * <code>null</code> if the name is not recognised >+ * @return the <code>TypeRelation</code> having this name or >+ * <code>null</code> if the name is not recognized > */ > public static TypeRelation get(String name) { >- for (int i = 0; i < VALUES_ARRAY.length; ++i) { >- if (VALUES_ARRAY[i].getName().equals(name)) { >- return VALUES_ARRAY[i]; >+ for (TypeRelation next : VALUES) { >+ if (next.getName().equals(name)) { >+ return next; > } > } > return null; >@@ -253,12 +236,23 @@ > /** > * Answers how many enumeration literals declared by this enumerator. > * >- * @return int The total count of all enumeration literals declared by this >+ * @return The total count of all enumeration literals declared by this > * enumerator > */ > public static int getTotalCount() { >- return VALUES_ARRAY.length; >+ return VALUES.size(); > } > >+ public String getLiteral() { >+ return getName(); >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public int getValue() { >+ return ordinal(); >+ } > } > >Index: src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionAdapter.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectConditionAdapter.java >--- src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionAdapter.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionAdapter.java 22 Oct 2007 00:42:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -61,22 +61,12 @@ > } > > /** >- * Overrides the parent's implementation by simply forwarding the actual >- * evaluation to the adapted <code>Condition</code> regardless whether or >- * not the argument object conforms to <code>EObject</code>. >- * >- * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) >- */ >- public boolean isSatisfied(Object object) { >- return condition.isSatisfied(object); >- } >- >- /** > * The implementation of this function simply forwards the actual evaluation > * to the adapted <code>Condition</code>. > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return condition.isSatisfied(eObject); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionDelegator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionDelegator.java,v >retrieving revision 1.2 >diff -u -r1.2 EObjectConditionDelegator.java >--- src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionDelegator.java 6 Jun 2007 22:27:46 -0000 1.2 >+++ src/org/eclipse/emf/query/conditions/eobjects/EObjectConditionDelegator.java 22 Oct 2007 00:42:59 -0000 >@@ -48,7 +48,7 @@ > private EObjectCondition eObjectCondition; > > /** >- * A simple constructor, initlaizes the wrapped >+ * A simple constructor, initializes the wrapped > * <code>EObjectCondition</code> to <code>null</code>. The supplier of > * this <code>EObjectConditionDelegator</code> must ensure that a valid > * <code>EObjectCondition</code> is passed to this >@@ -78,6 +78,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return eObjectCondition.isSatisfied(object); > } >@@ -88,6 +89,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObject) { > return eObjectCondition.isSatisfied(eObject); > } >@@ -98,6 +100,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#shouldPrune(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean shouldPrune(EObject eObject) { > return eObjectCondition.shouldPrune(eObject); > } >Index: src/org/eclipse/emf/query/conditions/eobjects/IEObjectSource.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/IEObjectSource.java,v >retrieving revision 1.3 >diff -u -r1.3 IEObjectSource.java >--- src/org/eclipse/emf/query/conditions/eobjects/IEObjectSource.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/IEObjectSource.java 22 Oct 2007 00:42:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -19,6 +19,8 @@ > > import java.util.Set; > >+import org.eclipse.emf.ecore.EObject; >+ > /** > * An interface the represents an <code>EObject</code> source/supplier. These > * EObjects are to be used in queries and subjected to evaluation by >@@ -33,5 +35,5 @@ > * @return Set The set of EObjects this <code>IEObjectSource</code> > * furnishes > */ >- Set getEObjects(); >+ Set<? extends EObject> getEObjects(); > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/conditions/eobjects/EObjectSource.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/EObjectSource.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectSource.java >--- src/org/eclipse/emf/query/conditions/eobjects/EObjectSource.java 10 Oct 2006 14:29:57 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/eobjects/EObjectSource.java 22 Oct 2007 00:42:59 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -25,7 +25,7 @@ > > /** > * <p> >- * This class represnts a simple implementation of {@link org.eclipse.emf.query.conditions.eobjects.IEObjectSource} >+ * This class represents a simple implementation of {@link org.eclipse.emf.query.conditions.eobjects.IEObjectSource} > * that is constructed with one EObject or a collection of EObjects. > * </p> > * <p> >@@ -37,7 +37,7 @@ > */ > public class EObjectSource implements IEObjectSource { > private EObject eObject; >- private Set set; >+ private Set<EObject> set; > > /** > * Initializes me with a single sub-tree from which to get objects. >@@ -54,18 +54,19 @@ > * > * @param eObjects the roots (zero or more) of sub-trees to query > */ >- public EObjectSource(Collection eObjects) { >+ public EObjectSource(Collection<? extends EObject> eObjects) { > if (eObjects instanceof Set) { >- set = (Set) eObjects; >+ @SuppressWarnings("unchecked") // nobody should be adding to this set >+ Set<EObject> eObjectSet = (Set<EObject>) eObjects; >+ set = eObjectSet; > } else { >- set = new HashSet(); >- set.addAll(eObjects); >+ set = new HashSet<EObject>(eObjects); > } > } > >- public Set getEObjects() { >+ public Set<? extends EObject> getEObjects() { > if (set == null) { >- set = new HashSet(); >+ set = new HashSet<EObject>(); > set.add(eObject); > } > return set; >Index: src/org/eclipse/emf/query/conditions/eobjects/EObjectInstanceCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/eobjects/EObjectInstanceCondition.java,v >retrieving revision 1.4 >diff -u -r1.4 EObjectInstanceCondition.java >--- src/org/eclipse/emf/query/conditions/eobjects/EObjectInstanceCondition.java 26 Apr 2007 17:13:31 -0000 1.4 >+++ src/org/eclipse/emf/query/conditions/eobjects/EObjectInstanceCondition.java 22 Oct 2007 00:42:59 -0000 >@@ -41,10 +41,10 @@ > * > * @since 1.1 > */ >- public static final EObjectInstanceCondition IS_NULL = >- new EObjectInstanceCondition(null) { >+ public static final EObjectInstanceCondition IS_NULL = new EObjectInstanceCondition(null) { > >- public boolean isSatisfied(Object object) { >+ @Override >+ public boolean isSatisfied(Object object) { > return object == null; > }}; > >@@ -85,6 +85,7 @@ > * > * @see org.eclipse.emf.query.conditions.eobjects.EObjectCondition#isSatisfied(org.eclipse.emf.ecore.EObject) > */ >+ @Override > public boolean isSatisfied(EObject eObj) { > return getEObject().equals(eObj); > } >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/.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:09 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 22 Oct 2007 00:42:43 -0000 >@@ -1,8 +1,8 @@ >-#Wed Dec 20 11:33:17 EST 2006 >+#Sat Oct 20 22:49:46 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/query/conditions/Not.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/Not.java,v >retrieving revision 1.3 >diff -u -r1.3 Not.java >--- src/org/eclipse/emf/query/conditions/Not.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/Not.java 22 Oct 2007 00:42:43 -0000 >@@ -42,6 +42,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object object) { > return !(condition.isSatisfied(object)); > } >Index: src/org/eclipse/emf/query/conditions/ObjectInstanceCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/ObjectInstanceCondition.java,v >retrieving revision 1.4 >diff -u -r1.4 ObjectInstanceCondition.java >--- src/org/eclipse/emf/query/conditions/ObjectInstanceCondition.java 26 Apr 2007 17:13:31 -0000 1.4 >+++ src/org/eclipse/emf/query/conditions/ObjectInstanceCondition.java 22 Oct 2007 00:42:43 -0000 >@@ -41,7 +41,8 @@ > public static final ObjectInstanceCondition IS_NULL = > new ObjectInstanceCondition(null) { > >- public boolean isSatisfied(Object obj) { >+ @Override >+ public boolean isSatisfied(Object obj) { > return obj == null; > }}; > >@@ -65,6 +66,7 @@ > * > * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) > */ >+ @Override > public boolean isSatisfied(Object obj) { > return getObject().equals(obj); > } >Index: src/org/eclipse/emf/query/conditions/ConditionPolicy.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/ConditionPolicy.java,v >retrieving revision 1.3 >diff -u -r1.3 ConditionPolicy.java >--- src/org/eclipse/emf/query/conditions/ConditionPolicy.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/ConditionPolicy.java 22 Oct 2007 00:42:43 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -18,7 +18,6 @@ > package org.eclipse.emf.query.conditions; > > import java.util.Collection; >-import java.util.Iterator; > > /** > * An abstract base class for <code>ConditionPolicy</code> objects. >@@ -53,7 +52,7 @@ > * objects -in accordance to this <code>ConditionPolicy</code>, > * <code>false</code> otherwise > */ >- public abstract boolean isSatisfied(Condition condition, Collection objects); >+ public abstract boolean isSatisfied(Condition condition, Collection<?> objects); > > /** > * Answers whether the argument conditions evaluate -collectively- to >@@ -103,19 +102,20 @@ > */ > public static final ConditionPolicy ALL = new ConditionPolicy() { > >- public boolean isSatisfied(Condition condition, Collection objects) { >- Iterator it = objects.iterator(); >- while (it.hasNext()) { >- if (condition.isSatisfied(it.next()) == false) { >+ @Override >+ public boolean isSatisfied(Condition condition, Collection<?> objects) { >+ for (Object o : objects) { >+ if (condition.isSatisfied(o) == false) { > return false; > } > } > return true; > } > >+ @Override > public boolean isSatisfied(Condition[] conditions, Object object) { >- for (int i = 0; i < conditions.length; ++i) { >- if (conditions[i].isSatisfied(object) == false) { >+ for (Condition c : conditions) { >+ if (c.isSatisfied(object) == false) { > return false; > } > } >@@ -133,19 +133,20 @@ > */ > public static final ConditionPolicy ANY = new ConditionPolicy() { > >- public boolean isSatisfied(Condition condition, Collection objects) { >- Iterator it = objects.iterator(); >- while (it.hasNext()) { >- if (condition.isSatisfied(it.next())) { >+ @Override >+ public boolean isSatisfied(Condition condition, Collection<?> objects) { >+ for (Object o : objects) { >+ if (condition.isSatisfied(o)) { > return true; > } > } > return false; > } > >+ @Override > public boolean isSatisfied(Condition[] conditions, Object object) { >- for (int i = 0; i < conditions.length; ++i) { >- if (conditions[i].isSatisfied(object)) { >+ for (Condition c : conditions) { >+ if (c.isSatisfied(object)) { > return true; > } > } >Index: src/org/eclipse/emf/query/conditions/Condition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/Condition.java,v >retrieving revision 1.3 >diff -u -r1.3 Condition.java >--- src/org/eclipse/emf/query/conditions/Condition.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/Condition.java 22 Oct 2007 00:42:43 -0000 >@@ -35,6 +35,7 @@ > */ > public static final Condition TRUE = new Condition() { > >+ @Override > public boolean isSatisfied(Object object) { > return true; > } >@@ -46,6 +47,7 @@ > */ > public static final Condition FALSE = new Condition() { > >+ @Override > public boolean isSatisfied(Object object) { > return false; > } >@@ -75,6 +77,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(Object object) { > return Condition.this.isSatisfied(object) > || condition.isSatisfied(object); >@@ -88,6 +91,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(Object object) { > return Condition.this.isSatisfied(object) > && condition.isSatisfied(object); >@@ -101,6 +105,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(Object object) { > return Condition.this.isSatisfied(object) > ^ condition.isSatisfied(object); >@@ -114,6 +119,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(Object object) { > return (!(Condition.this.isSatisfied(object))) > || condition.isSatisfied(object); >@@ -127,6 +133,7 @@ > super(condition); > } > >+ @Override > public boolean isSatisfied(Object object) { > return Condition.this.isSatisfied(object) == condition > .isSatisfied(object); >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 26 Apr 2007 17:24:45 -0000 1.9 >+++ META-INF/MANIFEST.MF 22 Oct 2007 00:42:43 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.query >-Bundle-Version: 1.1.0.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.query.internal.EMFQueryPlugin$Implementation > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >@@ -20,7 +20,7 @@ > org.eclipse.emf.query.internal.util;x-friends:="org.eclipse.emf.query.tests", > org.eclipse.emf.query.statements > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)", >+ org.eclipse.emf.ecore;bundle-version="[2.3.0,3.0.0)", > com.ibm.icu;bundle-version="[3.4.3,4.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >Index: src/org/eclipse/emf/query/internal/statements/EObjectContentIterator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/internal/statements/EObjectContentIterator.java,v >retrieving revision 1.4 >diff -u -r1.4 EObjectContentIterator.java >--- src/org/eclipse/emf/query/internal/statements/EObjectContentIterator.java 10 Oct 2006 14:29:58 -0000 1.4 >+++ src/org/eclipse/emf/query/internal/statements/EObjectContentIterator.java 22 Oct 2007 00:44:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -35,16 +35,17 @@ > * > * @author Yasser Lulu > */ >-public class EObjectContentIterator extends AbstractTreeIterator { >+public class EObjectContentIterator extends AbstractTreeIterator<EObject> { > > private static final long serialVersionUID = 4310034547053143619L; > > private static class EObjectAdapter extends EObjectImpl { >- private EList list; >- EObjectAdapter(Collection collection) { >- list = new BasicEList(collection); >+ private EList<EObject> list; >+ EObjectAdapter(Collection<? extends EObject> collection) { >+ list = new BasicEList<EObject>(collection); > } >- public final EList eContents() { >+ @Override >+ public final EList<EObject> eContents() { > return list; > } > } >@@ -99,7 +100,7 @@ > * > * @param eObjects the collection to iterate > */ >- public EObjectContentIterator(Collection eObjects) { >+ public EObjectContentIterator(Collection<? extends EObject> eObjects) { > this(eObjects, null); > } > >@@ -112,7 +113,7 @@ > * from the collection from consideration by the query > */ > public EObjectContentIterator( >- Collection eObjects, >+ Collection<? extends EObject> eObjects, > EObjectCondition filterCondition) { > this(eObjects, filterCondition, EStructuralFeatureValueGetter.getInstance()); > } >@@ -128,7 +129,7 @@ > * the filter condition > */ > public EObjectContentIterator( >- Collection eObjects, >+ Collection<? extends EObject> eObjects, > EObjectCondition filterCondition, > IEStructuralFeatureValueGetter eStructuralFeatureValueGetter) { > this( >@@ -142,11 +143,12 @@ > * > * @return the iterator > */ >- protected final Iterator getChildren() { >+ protected final Iterator<? extends EObject> getChildren() { > return getChildren(rootEObject); > } > >- protected final Iterator getChildren(Object obj) { >+ @Override >+ protected final Iterator<? extends EObject> getChildren(Object obj) { > return (obj == rootEObject) > ? (obj instanceof EObjectAdapter) > ? ((EObject)obj).eContents().iterator() >Index: src/org/eclipse/emf/query/internal/statements/FlatEObjectContentIterator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/internal/statements/FlatEObjectContentIterator.java,v >retrieving revision 1.4 >diff -u -r1.4 FlatEObjectContentIterator.java >--- src/org/eclipse/emf/query/internal/statements/FlatEObjectContentIterator.java 10 Oct 2006 14:29:58 -0000 1.4 >+++ src/org/eclipse/emf/query/internal/statements/FlatEObjectContentIterator.java 22 Oct 2007 00:44:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -33,7 +33,7 @@ > > private static final long serialVersionUID = 964764750547412881L; > >- private Iterator it; >+ private Iterator<? extends EObject> it; > > /** > * Initializes me with a single <code>eObject</code> to iterate. >@@ -61,7 +61,7 @@ > * > * @param eObjects the eobjects to iterate > */ >- public FlatEObjectContentIterator(Collection eObjects) { >+ public FlatEObjectContentIterator(Collection<? extends EObject> eObjects) { > this(eObjects, null); > } > >@@ -72,7 +72,7 @@ > * @param eObjectStructuralFeatureValueGetter the value getter to apply > * to them > */ >- public FlatEObjectContentIterator(Collection eObjects, >+ public FlatEObjectContentIterator(Collection<? extends EObject> eObjects, > IEStructuralFeatureValueGetter eObjectStructuralFeatureValueGetter) { > super(eObjects, null, eObjectStructuralFeatureValueGetter); > } >@@ -80,6 +80,7 @@ > /** > * @see org.eclipse.emf.common.util.TreeIterator#prune() > */ >+ @Override > public void prune() { > //disable parent's > } >@@ -87,6 +88,7 @@ > /** > * @see java.util.Iterator#hasNext() > */ >+ @Override > public boolean hasNext() { > return getIterator().hasNext(); > } >@@ -94,24 +96,27 @@ > /** > * @see java.util.Iterator#next() > */ >- public Object next() { >+ @Override >+ public EObject next() { > return getIterator().next(); > } > > /** > * @see java.util.Iterator#remove() > */ >+ @Override > public void remove() { > getIterator().remove(); > } > >- private Iterator getIterator() { >+ private Iterator<? extends EObject> getIterator() { > if (it == null) { > it = getChildren(); > } > return it; > } > >+ @Override > public boolean canPrune() { > return false; > } >@@ -121,6 +126,7 @@ > * > * @return my iterator kind ({@link IteratorKind#FLAT_LITERAL}) > */ >+ @Override > public IteratorKind getIteratorKind() { > return IteratorKind.FLAT_LITERAL; > } >Index: src/org/eclipse/emf/query/internal/statements/QueryResultSet.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/internal/statements/QueryResultSet.java,v >retrieving revision 1.3 >diff -u -r1.3 QueryResultSet.java >--- src/org/eclipse/emf/query/internal/statements/QueryResultSet.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/internal/statements/QueryResultSet.java 22 Oct 2007 00:44:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -27,10 +27,13 @@ > import org.eclipse.emf.query.statements.IQueryResult; > > /** >+ * >+ * @param <E> the kind of element provided by the result set >+ * > * @author Yasser Lulu > */ >-public class QueryResultSet implements Set, IQueryResult { >- private Set eObjects; >+public class QueryResultSet implements Set<EObject>, IQueryResult { >+ private Set<EObject> eObjects; > private Exception exception; > private boolean cancelled; > >@@ -38,7 +41,7 @@ > * Initializes me. > */ > public QueryResultSet() { >- this(new HashSet()); >+ this(new HashSet<EObject>()); > } > > /** >@@ -46,7 +49,7 @@ > * > * @param eObjects my objects > */ >- public QueryResultSet(Set eObjects) { >+ public QueryResultSet(Set<? extends EObject> eObjects) { > this(eObjects, null); > } > >@@ -57,12 +60,12 @@ > * @param eObjects my objects > * @param exception the exception that was thrown > */ >- public QueryResultSet(Set eObjects, Exception exception) { >- this.eObjects = eObjects; >+ public QueryResultSet(Set<? extends EObject> eObjects, Exception exception) { >+ this.eObjects = new HashSet<EObject>(eObjects); > this.exception = exception; > } > >- public Set getEObjects() { >+ public Set<EObject> getEObjects() { > return eObjects; > } > >@@ -75,7 +78,7 @@ > } > > public void clear() { >- eObjects = new HashSet(); >+ eObjects = new HashSet<EObject>(); > exception = null; > } > >@@ -93,28 +96,28 @@ > return eObjects.size(); > } > >- public Iterator iterator() { >+ public Iterator<EObject> iterator() { > return eObjects.iterator(); > } > > /** > * @see java.util.Collection#removeAll(java.util.Collection) > */ >- public boolean removeAll(Collection c) { >+ public boolean removeAll(Collection<?> c) { > return eObjects.removeAll(c); > } > > /** > * @see java.util.Collection#add(java.lang.Object) > */ >- public boolean add(Object o) { >+ public boolean add(EObject o) { > return eObjects.add(o); > } >- >+ > /** > * @see java.util.Collection#addAll(java.util.Collection) > */ >- public boolean addAll(Collection c) { >+ public boolean addAll(Collection<? extends EObject> c) { > return eObjects.addAll(c); > } > >@@ -128,7 +131,7 @@ > /** > * @see java.util.Collection#containsAll(java.util.Collection) > */ >- public boolean containsAll(Collection c) { >+ public boolean containsAll(Collection<?> c) { > return eObjects.containsAll(c); > } > >@@ -149,7 +152,7 @@ > /** > * @see java.util.Collection#retainAll(java.util.Collection) > */ >- public boolean retainAll(Collection c) { >+ public boolean retainAll(Collection<?> c) { > return eObjects.retainAll(c); > } > >@@ -163,14 +166,14 @@ > /** > * @see java.util.Collection#toArray(java.lang.Object[]) > */ >- public Object[] toArray(Object[] a) { >+ public <S> S[] toArray(S[] a) { > return eObjects.toArray(a); > } > > /** >- * Asks whether the query was cancelled. >+ * Asks whether the query was canceled. > * >- * @return whether the query was cancelled >+ * @return whether the query was canceled > */ > public boolean isCancelled() { > return cancelled; >Index: src/org/eclipse/emf/query/internal/statements/QueryStatement.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/internal/statements/QueryStatement.java,v >retrieving revision 1.3 >diff -u -r1.3 QueryStatement.java >--- src/org/eclipse/emf/query/internal/statements/QueryStatement.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/internal/statements/QueryStatement.java 22 Oct 2007 00:44:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -20,6 +20,7 @@ > import java.util.Set; > > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.query.conditions.eobjects.IEObjectSource; > import org.eclipse.emf.query.internal.EMFQueryPlugin; > import org.eclipse.emf.query.internal.EMFQueryStatusCodes; >@@ -40,7 +41,7 @@ > /** > * Initializes me. > * >- * @param cancellable whether I can be cancelled >+ * @param cancellable whether I can be canceled > * @param progressMonitor a monitor to track progress > */ > public QueryStatement( >@@ -130,7 +131,7 @@ > return resultSet; > } > >- public Set getEObjects() { >+ public Set<? extends EObject> getEObjects() { > return execute().getEObjects(); > } > >Index: src/org/eclipse/emf/query/handlers/PruneHandler.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/handlers/PruneHandler.java,v >retrieving revision 1.3 >diff -u -r1.3 PruneHandler.java >--- src/org/eclipse/emf/query/handlers/PruneHandler.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/handlers/PruneHandler.java 22 Oct 2007 00:43:59 -0000 >@@ -51,6 +51,7 @@ > */ > public static final PruneHandler ALWAYS = new PruneHandler() { > >+ @Override > public boolean shouldPrune(EObject eObject) { > return true; > } >@@ -63,6 +64,7 @@ > */ > public static final PruneHandler NEVER = new PruneHandler() { > >+ @Override > public boolean shouldPrune(EObject eObject) { > return false; > } >Index: src/org/eclipse/emf/query/internal/EMFQueryPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/internal/EMFQueryPlugin.java,v >retrieving revision 1.3 >diff -u -r1.3 EMFQueryPlugin.java >--- src/org/eclipse/emf/query/internal/EMFQueryPlugin.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/internal/EMFQueryPlugin.java 22 Oct 2007 00:44:14 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -128,7 +128,8 @@ > super(new ResourceLocator[] {}); > } > >- public ResourceLocator getPluginResourceLocator() { >+ @Override >+ public ResourceLocator getPluginResourceLocator() { > return plugin; > } > >@@ -160,7 +161,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. >@@ -185,7 +186,7 @@ > Boolean value = null; > > synchronized (cachedOptions) { >- value = (Boolean) cachedOptions.get(option); >+ value = cachedOptions.get(option); > > if (null == value) { > value = >@@ -302,7 +303,7 @@ > */ > public static void changing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > String valueDescription, > Object oldValue, >@@ -341,7 +342,7 @@ > */ > public static void catching( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -374,7 +375,7 @@ > */ > public static void throwing( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Throwable throwable) { > >@@ -404,7 +405,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -429,7 +430,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object parameter) { > >@@ -458,7 +459,7 @@ > */ > public static void entering( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object[] parameters) { > >@@ -485,7 +486,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName) { > > if (shouldTrace(option)) { >@@ -510,7 +511,7 @@ > */ > public static void exiting( > String option, >- Class clazz, >+ Class<?> clazz, > String methodName, > Object returnValue) { > >@@ -527,11 +528,11 @@ > } > } > >- public static void catching(Class class1, String functionName, Throwable exception) { >+ public static void catching(Class<?> class1, String functionName, Throwable exception) { > Tracing.catching(EMFQueryDebugOptions.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(EMFQueryDebugOptions.EXCEPTIONS_THROWING, class1, functionName, exception); > } > >Index: src/org/eclipse/emf/query/statements/SET.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/SET.java,v >retrieving revision 1.3 >diff -u -r1.3 SET.java >--- src/org/eclipse/emf/query/statements/SET.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/statements/SET.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >Index: src/org/eclipse/emf/query/statements/FROM.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/FROM.java,v >retrieving revision 1.3 >diff -u -r1.3 FROM.java >--- src/org/eclipse/emf/query/statements/FROM.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/statements/FROM.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -101,11 +101,12 @@ > eStructuralFeatureValueGetter); > } > >- public FROM(Collection eObjects) { >+ public FROM(Collection<? extends EObject> eObjects) { > this(eObjects, IteratorKind.HIERARCHICAL_LITERAL); > } > >- public FROM(Collection eObjects, EObjectCondition filterCondition) { >+ public FROM(Collection<? extends EObject> eObjects, >+ EObjectCondition filterCondition) { > this( > eObjects, > filterCondition, >@@ -113,12 +114,12 @@ > null); > } > >- public FROM(Collection eObjects, IteratorKind iteratorKind) { >+ public FROM(Collection<? extends EObject> eObjects, IteratorKind iteratorKind) { > this(eObjects, null, iteratorKind, null); > } > > public FROM( >- Collection eObjects, >+ Collection<? extends EObject> eObjects, > EObjectCondition filterCondition, > IteratorKind iteratorKind, > IEStructuralFeatureValueGetter eStructuralFeatureValueGetter) { >@@ -133,16 +134,16 @@ > return canPrune; > } > >- public TreeIterator iterator() { >+ public TreeIterator<EObject> iterator() { > return (iteratorKind == IteratorKind.HIERARCHICAL_LITERAL) >- ? (TreeIterator) (new EObjectContentIterator(getEObjects(), >+ ? new EObjectContentIterator(getEObjects(), > filterCondition, >- getEStructuralFeatureValueGetter())) >- : (TreeIterator) (new FlatEObjectContentIterator(getEObjects(), >- getEStructuralFeatureValueGetter())); >+ getEStructuralFeatureValueGetter()) >+ : new FlatEObjectContentIterator(getEObjects(), >+ getEStructuralFeatureValueGetter()); > } > >- private Set getEObjects() { >+ private Set<? extends EObject> getEObjects() { > return eObjectSource.getEObjects(); > } > >Index: src/org/eclipse/emf/query/statements/SELECT.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/SELECT.java,v >retrieving revision 1.4 >diff -u -r1.4 SELECT.java >--- src/org/eclipse/emf/query/statements/SELECT.java 10 Oct 2006 14:29:58 -0000 1.4 >+++ src/org/eclipse/emf/query/statements/SELECT.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -54,7 +54,7 @@ > > private int maximumResultSize; > >- private TreeIterator it; >+ private TreeIterator<EObject> it; > > public SELECT(FROM from, WHERE where) { > this(true, from, where); >@@ -89,16 +89,19 @@ > * > * @see QueryStatement#execute() > */ >+ @Override > protected void doExecute() { > it = getFromClause().iterator(); > doResume(); > } > >+ @Override > protected void handleException(Exception exception, String functionName) { > it = null; > super.handleException(exception, functionName); > } > >+ @Override > public boolean canBeResumed() { > try { > return ((it != null) && (it.hasNext())); >@@ -116,6 +119,7 @@ > /** > * @see org.eclipse.emf.query.internal.statements.QueryStatement#doResume() > */ >+ @Override > protected void doResume() { > EObject eObject = null; > //must set the newly created result-set >@@ -123,7 +127,7 @@ > boolean canPrune = getFromClause().canBePruned(); > WHERE whereClause = getWhereClause(); > while (it.hasNext() && (isCancelled() == false)) { >- eObject = (EObject) it.next(); >+ eObject = it.next(); > if (whereClause.matches(eObject)) { > addEObject(eObject); > if (getResultSet().size() == maximumResultSize) { >@@ -163,14 +167,17 @@ > return where; > } > >+ @Override > public final IQueryResult execute() { > return super.execute(); > } > >- public final Set getEObjects() { >+ @Override >+ public final Set<? extends EObject> getEObjects() { > return super.getEObjects(); > } > >+ @Override > public final IQueryResult resume(IProgressMonitor progressMon) { > return super.resume(progressMon); > } >Index: src/org/eclipse/emf/query/statements/IteratorKind.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/IteratorKind.java,v >retrieving revision 1.3 >diff -u -r1.3 IteratorKind.java >--- src/org/eclipse/emf/query/statements/IteratorKind.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/statements/IteratorKind.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,62 +17,71 @@ > > package org.eclipse.emf.query.statements; > >-import java.util.ArrayList; > import java.util.Collections; > import java.util.List; > >-import org.eclipse.emf.common.util.AbstractEnumerator; >+import org.eclipse.emf.common.util.Enumerator; > > /** > * An enumeration of iteration methodologies for EObjects. > * > * @author Yasser Lulu > */ >-public final class IteratorKind extends AbstractEnumerator { >- private static int value; >- private static final List values = new ArrayList(); >- >+public enum IteratorKind implements Enumerator { > /** > * Iterate in a "flat" fashion without traversing the contents > * of the EObjects. > */ >- public static final IteratorKind FLAT_LITERAL = new IteratorKind("FLAT"); //$NON-NLS-1$ >+ FLAT_LITERAL("FLAT"), //$NON-NLS-1$ > > /** > * Iterate in a "hierarchical" fashion traversing the containment > * subtree of each EObject. > */ >- public static final IteratorKind HIERARCHICAL_LITERAL = new IteratorKind("HIERARCHICAL"); //$NON-NLS-1$ >+ HIERARCHICAL_LITERAL("HIERARCHICAL"); //$NON-NLS-1$ > > public static final int FLAT = FLAT_LITERAL.getValue(); > public static final int HIERARCHICAL = HIERARCHICAL_LITERAL.getValue(); > >- public static final List VALUES = Collections.unmodifiableList(values); >- private static final IteratorKind[] VALUES_ARRAY = >- (IteratorKind[]) VALUES.toArray(new IteratorKind[VALUES.size()]); >+ private static final List<IteratorKind> values = java.util.Arrays.asList(values()); >+ >+ public static final List<IteratorKind> VALUES = Collections.unmodifiableList(values); > >+ private final String name; >+ > private IteratorKind(String name) { >- super(value++, name); >- values.add(this); >+ this.name = name; > } > > public static IteratorKind get(int val) { >- if (val >= VALUES_ARRAY.length || val < 0) { >+ if (val >= values.size() || val < 0) { > return null; > } >- return VALUES_ARRAY[val]; >+ return values.get(val); > } > > public static IteratorKind get(String name) { >- for (int i = 0; i < VALUES_ARRAY.length; ++i) { >- if (VALUES_ARRAY[i].getName().equals(name)) { >- return VALUES_ARRAY[i]; >+ for (IteratorKind next : values()) { >+ if (next.getName().equals(name)) { >+ return next; > } > } > return null; > } > > public static int getTotalCount() { >- return VALUES_ARRAY.length; >+ return values.size(); >+ } >+ >+ public String getLiteral() { >+ return getName(); >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public int getValue() { >+ return ordinal(); > } > } >Index: src/org/eclipse/emf/query/statements/IQueryResult.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/IQueryResult.java,v >retrieving revision 1.2 >diff -u -r1.2 IQueryResult.java >--- src/org/eclipse/emf/query/statements/IQueryResult.java 29 Nov 2005 16:53:11 -0000 1.2 >+++ src/org/eclipse/emf/query/statements/IQueryResult.java 22 Oct 2007 00:44:25 -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,6 +19,7 @@ > > import java.util.Collection; > >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.query.conditions.eobjects.IEObjectSource; > > >@@ -38,7 +39,7 @@ > * @author Chris McGee (cmcgee) > */ > public interface IQueryResult >- extends Collection, IEObjectSource { >+ extends Collection<EObject>, IEObjectSource { > > /** > * Retrieve the exception (if any) that occurred during the execute >Index: src/org/eclipse/emf/query/statements/WHERE.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/WHERE.java,v >retrieving revision 1.3 >diff -u -r1.3 WHERE.java >--- src/org/eclipse/emf/query/statements/WHERE.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/statements/WHERE.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -29,7 +29,7 @@ > * > * @author Yasser Lulu > */ >-public class WHERE extends QueryClause{ >+public class WHERE extends QueryClause { > > // IMPORTANT: never cache results to guarantee correctness of results when > // re-executing the query, since eObject could change some of their >Index: src/org/eclipse/emf/query/statements/UPDATE.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/statements/UPDATE.java,v >retrieving revision 1.3 >diff -u -r1.3 UPDATE.java >--- src/org/eclipse/emf/query/statements/UPDATE.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/statements/UPDATE.java 22 Oct 2007 00:44:25 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -51,7 +51,8 @@ > this.set = set; > } > >- protected void addEObject(EObject eObject) { >+ @Override >+ protected void addEObject(EObject eObject) { > if (getSetClause().set(eObject)) { > super.addEObject(eObject); > } >Index: src/org/eclipse/emf/query/conditions/booleans/BooleanCondition.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/booleans/BooleanCondition.java,v >retrieving revision 1.3 >diff -u -r1.3 BooleanCondition.java >--- src/org/eclipse/emf/query/conditions/booleans/BooleanCondition.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/booleans/BooleanCondition.java 22 Oct 2007 00:42:43 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,7 +17,8 @@ > > package org.eclipse.emf.query.conditions.booleans; > >-import org.eclipse.emf.query.conditions.Condition; >+import org.eclipse.emf.query.conditions.DataTypeCondition; >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; > > /** > * A <code>Condition</code> object that tests for <code>Boolean</code> >@@ -27,11 +28,7 @@ > * It evaluates to <code>true</code> when values are equal > */ > public class BooleanCondition >- extends Condition { >- >- private boolean booleanValue; >- >- private BooleanAdapter adapter; >+ extends DataTypeCondition<Boolean> { > > /** > * Constructs this <code>BooleanCondition</code> with a boolean value to >@@ -57,22 +54,31 @@ > * The initialization value of this <code>Condition</code> to > * use in testing argument objects for equality. > * @param adapter >- * The <code>BooleanAdapter</code> to use to extract a >+ * The generic <code>IDataTypeAdapter</code> to use to extract a > * <code>Boolean</code> representation of the argument object > * when evaluating it. >+ * >+ * @since 1.2 > */ >- public BooleanCondition(boolean booleanValue, BooleanAdapter adapter) { >- this.booleanValue = booleanValue; >- this.adapter = adapter; >+ public BooleanCondition(boolean booleanValue, IDataTypeAdapter<Boolean> adapter) { >+ super(booleanValue, adapter); > } > >- /* >- * (non-Javadoc) >+ /** >+ * Constructs this <code>BooleanCondition</code> with a boolean value to >+ * test for. It uses the argument <code>BooleanAdapter</code> adapter to >+ * adapt argument objects to <code>Boolean</code> objects in order to do >+ * the comparison > * >- * @see org.eclipse.emf.query.conditions.Condition#isSatisfied(java.lang.Object) >+ * @param booleanValue >+ * The initialization value of this <code>Condition</code> to >+ * use in testing argument objects for equality. >+ * @param adapter >+ * The <code>BooleanAdapter</code> to use to extract a >+ * <code>Boolean</code> representation of the argument object >+ * when evaluating it. > */ >- public boolean isSatisfied(Object object) { >- return adapter.getBoolean(object).booleanValue() == booleanValue; >+ public BooleanCondition(boolean booleanValue, BooleanAdapter adapter) { >+ super(booleanValue, adapter); > } >- > } >\ No newline at end of file >Index: src/org/eclipse/emf/query/conditions/booleans/BooleanAdapter.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/src/org/eclipse/emf/query/conditions/booleans/BooleanAdapter.java,v >retrieving revision 1.3 >diff -u -r1.3 BooleanAdapter.java >--- src/org/eclipse/emf/query/conditions/booleans/BooleanAdapter.java 10 Oct 2006 14:29:58 -0000 1.3 >+++ src/org/eclipse/emf/query/conditions/booleans/BooleanAdapter.java 22 Oct 2007 00:42:43 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * 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 >@@ -17,6 +17,8 @@ > > package org.eclipse.emf.query.conditions.booleans; > >+import org.eclipse.emf.query.conditions.IDataTypeAdapter; >+ > /** > * An Adapter class to be used to extract from -adapt- the argument object some > * Boolean object (value) that would later be used in <code>Condition</code> >@@ -24,7 +26,7 @@ > * > * @see BooleanCondition > */ >-public abstract class BooleanAdapter { >+public abstract class BooleanAdapter implements IDataTypeAdapter<Boolean> { > > /** > * The simplest <code>BooleanAdapter</code> implementation that represents >@@ -33,9 +35,15 @@ > */ > public static final BooleanAdapter DEFAULT = new BooleanAdapter() { > >+ @Override > public Boolean getBoolean(Object object) { > return (Boolean) object; > } >+ >+ @Override >+ public Boolean adapt(Object value) { >+ return (Boolean) value; >+ } > }; > > /** >@@ -47,4 +55,8 @@ > * @return Boolean the <code>Boolean</code> object representation of the argument object > */ > public abstract Boolean getBoolean(Object object); >+ >+ public Boolean adapt(Object value) { >+ return getBoolean(value); >+ } > } >\ No newline at end of file >Index: .classpath >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query/.classpath,v >retrieving revision 1.2 >diff -u -r1.2 .classpath >--- .classpath 20 Dec 2006 17:07:09 -0000 1.2 >+++ .classpath 22 Oct 2007 00:42:43 -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/query/conditions/IDataTypeAdapter.java >=================================================================== >RCS file: src/org/eclipse/emf/query/conditions/IDataTypeAdapter.java >diff -N src/org/eclipse/emf/query/conditions/IDataTypeAdapter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/query/conditions/IDataTypeAdapter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,41 @@ >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.query.conditions; >+ >+ >+/** >+ * An object that knows how to adapt objects to a given type. >+ * >+ * @param <T> the type of object to which the adapter adapts values >+ * >+ * @author Christian W. Damus (cdamus) >+ * >+ * @since 1.2 >+ */ >+public interface IDataTypeAdapter<T> { >+ >+ /** >+ * Adapts the specified input value to the type that I provide. >+ * >+ * @param value the input value >+ * >+ * @return the corresponding output value >+ * >+ * @since 1.2 >+ */ >+ T adapt(Object value); >+} >Index: src/org/eclipse/emf/query/conditions/DataTypeCondition.java >=================================================================== >RCS file: src/org/eclipse/emf/query/conditions/DataTypeCondition.java >diff -N src/org/eclipse/emf/query/conditions/DataTypeCondition.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/query/conditions/DataTypeCondition.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,57 @@ >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.query.conditions; >+ >+ >+/** >+ * A condition on data-type (primitive) values. >+ * >+ * @param <T> the data type, of which values the condition tests >+ * >+ * @author Christian W. Damus (cdamus) >+ * >+ * @since 1.2 >+ */ >+public class DataTypeCondition<T> >+ extends Condition { >+ >+ private static IDataTypeAdapter<?> DEFAULT_ADAPTER = new IDataTypeAdapter<Object>() { >+ public Object adapt(Object value) { >+ return value; >+ }}; >+ >+ protected final IDataTypeAdapter<? extends T> adapter; >+ >+ protected final T value; >+ >+ public DataTypeCondition(T value, IDataTypeAdapter<? extends T> adapter) { >+ this.value = value; >+ this.adapter = adapter; >+ } >+ >+ @SuppressWarnings("unchecked") >+ public DataTypeCondition(T value) { >+ this(value, (IDataTypeAdapter<T>) DEFAULT_ADAPTER); >+ } >+ >+ // Documentation copied from the inherited specification >+ @Override >+ public boolean isSatisfied(Object object) { >+ return value.equals(adapter.adapt(object)); >+ } >+ >+} >#P org.eclipse.emf.query.examples-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples-feature/feature.xml,v >retrieving revision 1.15 >diff -u -r1.15 feature.xml >--- feature.xml 20 Sep 2007 15:15:38 -0000 1.15 >+++ feature.xml 22 Oct 2007 00:46:01 -0000 >@@ -18,7 +18,7 @@ > <feature > id="org.eclipse.emf.query.examples" > label="%featureName" >- version="1.1.100.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> > >@@ -52,12 +52,13 @@ > <import plugin="org.eclipse.ui" 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.query.ocl" version="1.0.0" match="compatible"/> >- <import plugin="org.eclipse.emf.examples.library.editor" version="2.2.0" match="compatible"/> >- <import plugin="org.eclipse.emf.query" 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" version="2.2.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.query.ocl" version="1.1.0" match="compatible"/> >+ <import plugin="org.eclipse.ocl.ecore" version="1.1.0" match="compatible"/> >+ <import plugin="org.eclipse.emf.query" 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" version="2.3.0" match="compatible"/> > </requires> > > <plugin >#P org.eclipse.emf.query.examples.statements >Index: src/org/eclipse/emf/query/examples/statements/QueryPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/src/org/eclipse/emf/query/examples/statements/QueryPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 QueryPlugin.java >--- src/org/eclipse/emf/query/examples/statements/QueryPlugin.java 29 Nov 2005 16:54:03 -0000 1.2 >+++ src/org/eclipse/emf/query/examples/statements/QueryPlugin.java 22 Oct 2007 00:46:13 -0000 >@@ -39,6 +39,7 @@ > /** > * This method is called upon plug-in activation > */ >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > } >@@ -46,6 +47,7 @@ > /** > * This method is called when the plug-in is stopped > */ >+ @Override > public void stop(BundleContext context) throws Exception { > super.stop(context); > } >Index: src/org/eclipse/emf/query/examples/statements/actions/SelectBooksDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/src/org/eclipse/emf/query/examples/statements/actions/SelectBooksDelegate.java,v >retrieving revision 1.4 >diff -u -r1.4 SelectBooksDelegate.java >--- src/org/eclipse/emf/query/examples/statements/actions/SelectBooksDelegate.java 6 Jun 2007 22:27:59 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/statements/actions/SelectBooksDelegate.java 22 Oct 2007 00:46:13 -0000 >@@ -19,6 +19,7 @@ > > import java.util.Collection; > >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; > import org.eclipse.emf.examples.extlibrary.Writer; > import org.eclipse.emf.query.conditions.eobjects.EObjectCondition; >@@ -50,7 +51,8 @@ > QueryStatementsMessages.selectBooks_message_notFound); > } > >- protected Collection performQuery(Object value) >+ @Override >+ protected Collection<EObject> performQuery(Object value) > throws Exception { > > if (null == selectedEObjects) { >@@ -87,7 +89,7 @@ > */ > public void run(IAction action) { > try { >- Collection result = performQuery(selectedEObjects.iterator().next()); >+ Collection<EObject> result = performQuery(selectedEObjects.iterator().next()); > if (result.isEmpty()) { > MessageDialog > .openInformation(shell, title, notFoundMessage); >@@ -105,6 +107,7 @@ > /* (non-Javadoc) > * @see org.eclipse.emf.query.examples.statements.actions.AbstractQueryDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) > */ >+ @Override > public void selectionChanged(IAction action, ISelection selection) { > super.selectionChanged(action, selection); > >Index: src/org/eclipse/emf/query/examples/statements/actions/AbstractQueryDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/src/org/eclipse/emf/query/examples/statements/actions/AbstractQueryDelegate.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractQueryDelegate.java >--- src/org/eclipse/emf/query/examples/statements/actions/AbstractQueryDelegate.java 6 Jun 2007 22:27:59 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/statements/actions/AbstractQueryDelegate.java 22 Oct 2007 00:46:13 -0000 >@@ -19,6 +19,7 @@ > > import java.util.Collection; > >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.examples.extlibrary.presentation.EXTLibraryEditor; > import org.eclipse.emf.query.examples.statements.internal.l10n.QueryStatementsMessages; > import org.eclipse.jface.action.IAction; >@@ -41,7 +42,7 @@ > implements IEditorActionDelegate, IActionDelegate2 { > > /** >- * Error message to display when an exception occured >+ * Error message to display when an exception occurred > */ > protected static final String MESSAGE_EXCEPTION = QueryStatementsMessages.message_exception; > >@@ -58,7 +59,7 @@ > /** > * Selected EObjects > */ >- protected Collection selectedEObjects = null; >+ protected Collection<EObject> selectedEObjects = null; > > /** > * The InputDialog title >@@ -91,7 +92,7 @@ > * The value used to drive the query > * @return The set of objects returned by the query > */ >- protected abstract Collection performQuery(Object value) >+ protected abstract Collection<EObject> performQuery(Object value) > throws Exception; > > /* >@@ -103,7 +104,12 @@ > try { > if (selection instanceof IStructuredSelection) { > IStructuredSelection structuredSelection = (IStructuredSelection) selection; >- this.selectedEObjects = structuredSelection.toList(); >+ this.selectedEObjects = new java.util.ArrayList<EObject>(); >+ for (Object next : structuredSelection.toList()) { >+ if (next instanceof EObject) { >+ selectedEObjects.add((EObject) next); >+ } >+ } > } > } catch (Exception e) { > // Exceptions are not expected >Index: src/org/eclipse/emf/query/examples/statements/actions/SelectWritersDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/src/org/eclipse/emf/query/examples/statements/actions/SelectWritersDelegate.java,v >retrieving revision 1.4 >diff -u -r1.4 SelectWritersDelegate.java >--- src/org/eclipse/emf/query/examples/statements/actions/SelectWritersDelegate.java 20 Sep 2007 15:15:34 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/statements/actions/SelectWritersDelegate.java 22 Oct 2007 00:46:13 -0000 >@@ -20,10 +20,10 @@ > > import java.util.Collection; > import java.util.Collections; >-import java.util.Iterator; > import java.util.List; > > import org.eclipse.emf.common.util.Enumerator; >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.examples.extlibrary.BookCategory; > import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; > import org.eclipse.emf.examples.extlibrary.Library; >@@ -42,6 +42,7 @@ > import org.eclipse.jface.viewers.IStructuredContentProvider; > import org.eclipse.jface.viewers.LabelProvider; > import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.jface.window.Window; > import org.eclipse.ui.dialogs.ListDialog; > > /** >@@ -65,7 +66,8 @@ > QueryStatementsMessages.selectWriters_message_notFound); > } > >- protected Collection performQuery(Object value) >+ @Override >+ protected Collection<EObject> performQuery(Object value) > throws Exception { > if (null == selectedEObjects) { > throw new NullPointerException("Argument 'context' is null"); //$NON-NLS-1$ >@@ -103,7 +105,7 @@ > * @see org.eclipse.emf.query.examples.statements.actions.AbstractQueryDelegate#run(org.eclipse.jface.action.IAction) > */ > public void run(IAction action) { >- final List contents = BookCategory.VALUES; >+ final List<BookCategory> contents = BookCategory.VALUES; > > ListDialog dialog = new ListDialog(shell); > dialog.setTitle(title); >@@ -126,6 +128,7 @@ > } > }); > dialog.setLabelProvider(new LabelProvider() { >+ @Override > public String getText(Object element) { > if (element instanceof Enumerator) { > return ((Enumerator)element).getName(); >@@ -137,9 +140,9 @@ > dialog.setBlockOnOpen(true); > > >- if (ListDialog.OK == dialog.open()) { >+ if (Window.OK == dialog.open()) { > try { >- Collection result = performQuery(dialog.getResult()[0]); >+ Collection<EObject> result = performQuery(dialog.getResult()[0]); > if (result.isEmpty()) { > MessageDialog > .openInformation(shell, title, notFoundMessage); >@@ -155,13 +158,13 @@ > } > > >+ @Override > public void selectionChanged(IAction action, ISelection selection) { > super.selectionChanged(action, selection); > > if (action.isEnabled()) { > // Ensure that the selection is a selection of library(ies). >- for (Iterator i = selectedEObjects.iterator(); i.hasNext();) { >- Object o = i.next(); >+ for (EObject o : selectedEObjects) { > if (!(o instanceof Library)) { > action.setEnabled(false); > return; >Index: src/org/eclipse/emf/query/examples/statements/actions/SelectLargeBooksDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/src/org/eclipse/emf/query/examples/statements/actions/SelectLargeBooksDelegate.java,v >retrieving revision 1.2 >diff -u -r1.2 SelectLargeBooksDelegate.java >--- src/org/eclipse/emf/query/examples/statements/actions/SelectLargeBooksDelegate.java 29 Nov 2005 16:54:03 -0000 1.2 >+++ src/org/eclipse/emf/query/examples/statements/actions/SelectLargeBooksDelegate.java 22 Oct 2007 00:46:13 -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,8 +18,8 @@ > package org.eclipse.emf.query.examples.statements.actions; > > import java.util.Collection; >-import java.util.Iterator; > >+import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; > import org.eclipse.emf.examples.extlibrary.Library; > import org.eclipse.emf.query.conditions.eobjects.structuralfeatures.EObjectAttributeValueCondition; >@@ -48,13 +48,15 @@ > /* (non-Javadoc) > * @see org.eclipse.emf.query.examples.statements.actions.AbstractQueryDelegate#performQuery(java.lang.Object) > */ >- protected Collection performQuery(Object value) >+ @Override >+ protected Collection<EObject> performQuery(Object value) > throws Exception { > > SELECT select = new SELECT( > new FROM(selectedEObjects), >- new WHERE(new EObjectAttributeValueCondition(EXTLibraryPackage.eINSTANCE.getBook_Pages(), >- new NumberCondition.IntegerValue(new Integer(500),new Integer(Integer.MAX_VALUE)) >+ new WHERE(new EObjectAttributeValueCondition( >+ EXTLibraryPackage.eINSTANCE.getBook_Pages(), >+ NumberCondition.between(500, Integer.MAX_VALUE) > ) > ) > ); >@@ -67,7 +69,7 @@ > */ > public void run(IAction action) { > try { >- Collection result = performQuery(null); >+ Collection<EObject> result = performQuery(null); > if (result.isEmpty()) { > MessageDialog > .openInformation(shell, title, notFoundMessage); >@@ -85,13 +87,13 @@ > /* (non-Javadoc) > * @see org.eclipse.emf.query.examples.statements.actions.AbstractQueryDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) > */ >+ @Override > public void selectionChanged(IAction action, ISelection selection) { > super.selectionChanged(action, selection); > > if (action.isEnabled()) { > // Ensure that the selection is a selection of library(ies). >- for (Iterator i = selectedEObjects.iterator(); i.hasNext();) { >- Object o = i.next(); >+ for (EObject o : selectedEObjects) { > if (!(o instanceof Library)) { > action.setEnabled(false); > return; >Index: .settings/org.eclipse.jdt.ui.prefs >=================================================================== >RCS file: .settings/org.eclipse.jdt.ui.prefs >diff -N .settings/org.eclipse.jdt.ui.prefs >--- .settings/org.eclipse.jdt.ui.prefs 20 Dec 2006 17:06:51 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,3 +0,0 @@ >-#Wed Dec 20 11:37:45 EST 2006 >-eclipse.preferences.version=1 >-internal.default.compliance=user >Index: .settings/org.eclipse.jdt.core.prefs >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/.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:51 -0000 1.1 >+++ .settings/org.eclipse.jdt.core.prefs 22 Oct 2007 00:46:13 -0000 >@@ -1,8 +1,12 @@ >-#Wed Dec 20 11:37:45 EST 2006 >+#Sun Oct 21 00:23:19 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.inlineJsrBytecode=enabled >+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 >+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve >+org.eclipse.jdt.core.compiler.compliance=1.5 >+org.eclipse.jdt.core.compiler.debug.lineNumber=generate >+org.eclipse.jdt.core.compiler.debug.localVariable=generate >+org.eclipse.jdt.core.compiler.debug.sourceFile=generate > org.eclipse.jdt.core.compiler.problem.assertIdentifier=error >-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning >-org.eclipse.jdt.core.compiler.source=1.4 >+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error >+org.eclipse.jdt.core.compiler.source=1.5 >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.statements/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 20 Sep 2007 15:15:33 -0000 1.10 >+++ META-INF/MANIFEST.MF 22 Oct 2007 00:46:13 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %Plugin.name > Bundle-SymbolicName: org.eclipse.emf.query.examples.statements; singleton:=true >-Bundle-Version: 1.0.200.qualifier >+Bundle-Version: 1.2.0.qualifier > Bundle-Activator: org.eclipse.emf.query.examples.statements.QueryPlugin > Bundle-Vendor: %Plugin.providerName > Bundle-Localization: plugin >@@ -11,10 +11,10 @@ > org.eclipse.emf.query.examples.statements.internal.l10n;x-internal:=true > 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.query;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;bundle-version="[2.2.0,3.0.0)" >+ org.eclipse.emf.query;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.emf;bundle-version="[2.3.0,3.0.0)" > Eclipse-LazyStart: true >-Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+Bundle-RequiredExecutionEnvironment: J2SE-1.5 >#P org.eclipse.emf.query.examples.ocl >Index: src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 ContextFreeQueryWizard.java >--- src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizard.java 6 Jun 2007 22:28:12 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizard.java 22 Oct 2007 00:46:49 -0000 >@@ -31,6 +31,7 @@ > super(); > } > >+ @Override > protected IOCLQueryWizardPage createOclQueryPage() { > return new ContextFreeQueryWizardPage(); > } >Index: src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizardPage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizardPage.java,v >retrieving revision 1.6 >diff -u -r1.6 QueryWithContextWizardPage.java >--- src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizardPage.java 30 Mar 2007 19:23:40 -0000 1.6 >+++ src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizardPage.java 22 Oct 2007 00:46:49 -0000 >@@ -129,10 +129,12 @@ > private void fillContextCombo() { > contextCombo.setContentProvider(new ArrayContentProvider()); > contextCombo.setLabelProvider(new LabelProvider() { >+ @Override > public String getText(Object element) { > return ((EClassifier) element).getName(); > }}); > contextCombo.setSorter(new ViewerSorter() { >+ @Override > public int compare(Viewer viewer, Object e1, Object e2) { > return ((EClassifier) e1).getName().compareTo( > ((EClassifier) e2).getName()); >@@ -201,6 +203,7 @@ > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >+ @Override > public void dispose() { > super.dispose(); > } >Index: src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizardPage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizardPage.java,v >retrieving revision 1.5 >diff -u -r1.5 ContextFreeQueryWizardPage.java >--- src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizardPage.java 22 Mar 2007 22:20:45 -0000 1.5 >+++ src/org/eclipse/emf/query/examples/ocl/wizards/ContextFreeQueryWizardPage.java 22 Oct 2007 00:46:49 -0000 >@@ -115,6 +115,7 @@ > /* (non-Javadoc) > * Redefines/Implements/Extends the inherited method. > */ >+ @Override > public void dispose() { > super.dispose(); > } >Index: src/org/eclipse/emf/query/examples/ocl/wizards/AbstractQueryWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/wizards/AbstractQueryWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractQueryWizard.java >--- src/org/eclipse/emf/query/examples/ocl/wizards/AbstractQueryWizard.java 22 Mar 2007 22:20:45 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/ocl/wizards/AbstractQueryWizard.java 22 Oct 2007 00:46:49 -0000 >@@ -40,6 +40,7 @@ > super(); > } > >+ @Override > public void addPages() { > super.addPages(); > >@@ -47,6 +48,7 @@ > addPage(page); > } > >+ @Override > public boolean performFinish() { > condition = page.getCondition(); > >Index: src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizard.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizard.java,v >retrieving revision 1.4 >diff -u -r1.4 QueryWithContextWizard.java >--- src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizard.java 6 Jun 2007 22:28:12 -0000 1.4 >+++ src/org/eclipse/emf/query/examples/ocl/wizards/QueryWithContextWizard.java 22 Oct 2007 00:46:49 -0000 >@@ -31,6 +31,7 @@ > super(); > } > >+ @Override > protected IOCLQueryWizardPage createOclQueryPage() { > return new QueryWithContextWizardPage(); > } >Index: src/org/eclipse/emf/query/examples/ocl/actions/OCLQueryDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/actions/OCLQueryDelegate.java,v >retrieving revision 1.3 >diff -u -r1.3 OCLQueryDelegate.java >--- src/org/eclipse/emf/query/examples/ocl/actions/OCLQueryDelegate.java 30 Mar 2007 19:23:40 -0000 1.3 >+++ src/org/eclipse/emf/query/examples/ocl/actions/OCLQueryDelegate.java 22 Oct 2007 00:46:49 -0000 >@@ -55,6 +55,7 @@ > super(); > } > >+ @Override > public void run(IAction action) { > Collection<EObject> selection = getSelectedObjects(); > >Index: src/org/eclipse/emf/query/examples/ocl/actions/AbstractQueryDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/actions/AbstractQueryDelegate.java,v >retrieving revision 1.5 >diff -u -r1.5 AbstractQueryDelegate.java >--- src/org/eclipse/emf/query/examples/ocl/actions/AbstractQueryDelegate.java 6 Jun 2007 22:28:12 -0000 1.5 >+++ src/org/eclipse/emf/query/examples/ocl/actions/AbstractQueryDelegate.java 22 Oct 2007 00:46:49 -0000 >@@ -111,6 +111,7 @@ > /** > * Gets all of the {@link EObject}s in the current selection, if any. > */ >+ @Override > public void selectionChanged(IAction action, final ISelection selection) { > selectedEObjects = Collections.emptySet(); > >Index: src/org/eclipse/emf/query/examples/ocl/actions/ContextFreeQueryDelegate.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/actions/ContextFreeQueryDelegate.java,v >retrieving revision 1.5 >diff -u -r1.5 ContextFreeQueryDelegate.java >--- src/org/eclipse/emf/query/examples/ocl/actions/ContextFreeQueryDelegate.java 30 Mar 2007 19:23:40 -0000 1.5 >+++ src/org/eclipse/emf/query/examples/ocl/actions/ContextFreeQueryDelegate.java 22 Oct 2007 00:46:49 -0000 >@@ -55,6 +55,7 @@ > super(); > } > >+ @Override > public void run(IAction action) { > Collection<EObject> selection = getSelectedObjects(); > >Index: src/org/eclipse/emf/query/examples/ocl/OCLPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/examples/org.eclipse.emf.query.examples.ocl/src/org/eclipse/emf/query/examples/ocl/OCLPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 OCLPlugin.java >--- src/org/eclipse/emf/query/examples/ocl/OCLPlugin.java 6 Jun 2007 22:28:12 -0000 1.2 >+++ src/org/eclipse/emf/query/examples/ocl/OCLPlugin.java 22 Oct 2007 00:46:49 -0000 >@@ -39,6 +39,7 @@ > /** > * This method is called upon plug-in activation > */ >+ @Override > public void start(BundleContext context) throws Exception { > super.start(context); > } >@@ -46,6 +47,7 @@ > /** > * This method is called when the plug-in is stopped > */ >+ @Override > public void stop(BundleContext context) throws Exception { > super.stop(context); > } >#P org.eclipse.emf.query.sdk-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/plugins/org.eclipse.emf.query.sdk-feature/feature.xml,v >retrieving revision 1.3 >diff -u -r1.3 feature.xml >--- feature.xml 20 Sep 2007 15:15:36 -0000 1.3 >+++ feature.xml 22 Oct 2007 00:46:58 -0000 >@@ -2,7 +2,7 @@ > <feature > id="org.eclipse.emf.query.sdk" > label="%featureName" >- version="1.1.100.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> > >#P org.eclipse.emf.query.doc-feature >Index: feature.xml >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.query/doc/org.eclipse.emf.query.doc-feature/feature.xml,v >retrieving revision 1.11 >diff -u -r1.11 feature.xml >--- feature.xml 20 Sep 2007 15:15:37 -0000 1.11 >+++ feature.xml 22 Oct 2007 00:47:01 -0000 >@@ -18,7 +18,7 @@ > <feature > id="org.eclipse.emf.query.doc" > label="%featureName" >- version="1.1.100.qualifier" >+ version="1.2.0.qualifier" > provider-name="%providerName" > image="modeling32.png"> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ahunter.eclipse
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 206812
: 80842