Permalink
Browse files

Made the code Java 5 compilable.

  • Loading branch information...
1 parent 139c70a commit 7c24db7ba1697c67b0b1c4c06dc2c17704faa684 dmak committed Aug 12, 2011
Showing with 178 additions and 289 deletions.
  1. +8 −2 build.xml
  2. +5 −4 src/main/net/sf/cdk/tools/checkdoctest/IncorrectBugNumberTagletTest.java
  3. +5 −4 src/main/net/sf/cdk/tools/checkdoctest/MissingGithashTagletTest.java
  4. +5 −4 src/main/net/sf/cdk/tools/checkdoctest/MissingModuleTagletTest.java
  5. +5 −5 src/main/org/openscience/cdk/fingerprint/HybridizationFingerprinter.java
  6. +1 −3 src/main/org/openscience/cdk/geometry/cip/rules/AtomicNumberRule.java
  7. +1 −2 src/main/org/openscience/cdk/geometry/cip/rules/CIPLigandRule.java
  8. +1 −2 src/main/org/openscience/cdk/geometry/cip/rules/CombinedAtomicMassNumberRule.java
  9. +0 −3 src/main/org/openscience/cdk/geometry/cip/rules/ISequenceSubRule.java
  10. +1 −2 src/main/org/openscience/cdk/geometry/cip/rules/MassNumberRule.java
  11. +8 −8 src/main/org/openscience/cdk/signature/MoleculeSignature.java
  12. +0 −1 src/main/org/openscience/cdk/smsd/algorithm/matchers/DefaultBondMatcher.java
  13. +0 −1 src/main/org/openscience/cdk/smsd/algorithm/matchers/DefaultMCSPlusAtomMatcher.java
  14. +0 −1 src/main/org/openscience/cdk/smsd/algorithm/matchers/DefaultRGraphAtomMatcher.java
  15. +0 −1 src/main/org/openscience/cdk/smsd/algorithm/matchers/DefaultVFAtomMatcher.java
  16. +0 −1 src/main/org/openscience/cdk/smsd/algorithm/matchers/DefaultVFBondMatcher.java
  17. +0 −6 src/main/org/openscience/cdk/smsd/algorithm/mcsplus/MCSPlusHandler.java
  18. +1 −6 src/main/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCSHandler.java
  19. +1 −6 src/main/org/openscience/cdk/smsd/algorithm/rgraph/CDKSubGraphHandler.java
  20. +5 −14 src/main/org/openscience/cdk/smsd/algorithm/single/SingleMappingHandler.java
  21. +5 −15 src/main/org/openscience/cdk/smsd/algorithm/vflib/VFlibMCSHandler.java
  22. +5 −15 src/main/org/openscience/cdk/smsd/algorithm/vflib/VFlibSubStructureHandler.java
  23. +0 −6 src/main/org/openscience/cdk/smsd/algorithm/vflib/VFlibTurboHandler.java
  24. +3 −9 src/main/org/openscience/cdk/smsd/algorithm/vflib/builder/EdgeBuilder.java
  25. +7 −18 src/main/org/openscience/cdk/smsd/algorithm/vflib/builder/NodeBuilder.java
  26. +9 −24 src/main/org/openscience/cdk/smsd/algorithm/vflib/builder/VFQueryBuilder.java
  27. +3 −12 src/main/org/openscience/cdk/smsd/algorithm/vflib/map/VFMCSMapper.java
  28. +3 −12 src/main/org/openscience/cdk/smsd/algorithm/vflib/map/VFMapper.java
  29. +9 −24 src/main/org/openscience/cdk/smsd/algorithm/vflib/map/VFState.java
  30. +1 −3 src/main/org/openscience/cdk/smsd/algorithm/vflib/query/QueryCompiler.java
  31. +1 −2 src/main/org/openscience/cdk/smsd/filters/ChemicalFilters.java
  32. +0 −6 src/main/org/openscience/cdk/smsd/helper/FinalMappings.java
  33. +3 −1 src/main/org/openscience/cdk/smsd/labelling/AbstractReactionLabeller.java
  34. +6 −3 src/main/org/openscience/cdk/smsd/labelling/AtomContainerAtomPermutor.java
  35. +6 −3 src/main/org/openscience/cdk/smsd/labelling/AtomContainerPrinter.java
  36. +7 −4 src/main/org/openscience/cdk/smsd/labelling/CanonicalLabellingAdaptor.java
  37. +6 −3 src/main/org/openscience/cdk/smsd/labelling/MoleculeSignatureLabellingAdaptor.java
  38. +3 −2 src/main/org/openscience/cdk/smsd/labelling/SignatureReactionCanoniser.java
  39. +3 −2 src/main/org/openscience/cdk/smsd/labelling/SmilesReactionCanoniser.java
  40. +4 −3 src/main/org/openscience/cdk/smsd/ring/HanserRingFinder.java
  41. +4 −1 src/main/org/openscience/cdk/smsd/ring/RingFilter.java
  42. +4 −3 src/test/org/openscience/cdk/interfaces/AbstractAtomContainerSetTest.java
  43. +12 −7 src/test/org/openscience/cdk/interfaces/AbstractMoleculeSetTest.java
  44. +19 −18 src/test/org/openscience/cdk/renderer/RendererModelTest.java
  45. +2 −3 src/test/org/openscience/cdk/renderer/elements/AbstractElementTest.java
  46. +2 −3 src/test/org/openscience/cdk/renderer/elements/TextElementTest.java
  47. +0 −1 src/test/org/openscience/cdk/renderer/generators/parameter/AbstractGeneratorParameterTest.java
  48. +0 −3 src/test/org/openscience/cdk/renderer/visitor/AbstractAWTDrawVisitorTest.java
  49. +4 −7 src/test/org/openscience/cdk/smsd/interfaces/IMCSBaseTest.java
View
@@ -5,6 +5,7 @@
<!-- compile options -->
<property name="build.sysclasspath" value="ignore" />
<property name="build.compiler" value="modern" />
+ <property name="compile.target.version" value="1.5"/>
<property name="debug" value="on" />
<property name="deprecation" value="on" />
<property name="optimization" value="off" />
@@ -90,6 +91,7 @@
<echo message="" />
<echo message="Compiling:" />
<echo message=" for: ${build.compiler}" />
+ <echo message=" target: ${compile.target.version}" />
<echo message=" debug: ${debug}" />
<echo message=" deprecation: ${deprecation}" />
<echo message=" optimization: ${optimization}" />
@@ -99,6 +101,7 @@
<echo message="Available Targets" />
<echo message=" clean: Remove class files and any temporary files" />
<echo message=" dist-all: Compile all modules" />
+ <echo message=" test-all: Performs a full JUnit test for all modules" />
<echo message=" dist-large: Create the comprehensive jar, with all modules" />
<echo message=" test-dist-all: Compile all test modules" />
<echo message="test-dist-large: Create a single jar file with all test modules" />
@@ -259,7 +262,7 @@
<mkdir dir="${build}" />
<javac includes="net/sf/cdk/tools/MakeJavafilesFiles.java"
srcdir="${src}/main/" destdir="${build}" optimize="${optimization}"
- debug="${debug}" deprecation="${deprecation}" source="1.6"/>
+ debug="${debug}" deprecation="${deprecation}" source="${compile.target.version}" target="${compile.target.version}"/>
<java classpath="${build}" classname="net.sf.cdk.tools.MakeJavafilesFiles">
<arg value="${src}/META-INF"/>
<arg value="${src}/main"/>
@@ -375,7 +378,7 @@
<!-- ok, now that we have a copy, compile this copy -->
<javac srcdir="${build.src}/${module}" destdir="${build}/${module}" optimize="${optimization}"
- debug="${debug}" deprecation="${deprecation}" target="1.6" source="1.6">
+ debug="${debug}" deprecation="${deprecation}" source="${compile.target.version}" target="${compile.target.version}">
<classpath>
<fileset dir="${lib}" >
<exclude name="**/*" unless="module.libdepends.present" />
@@ -713,6 +716,7 @@
<attribute name="Implementation-Title" value="org.openscience.cdk"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="The CDK Project"/>
+ <attribute name="X-Compile-Target-JDK" value="${compile.target.version}"/>
</section>
</manifest>
<fileset dir="${appjars.dir}">
@@ -786,6 +790,7 @@
<attribute name="Implementation-Title" value="org.openscience.cdk"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="The CDK Project"/>
+ <attribute name="X-Compile-Target-JDK" value="${compile.target.version}"/>
</section>
</manifest>
<fileset dir="${appjars.dir}">
@@ -882,6 +887,7 @@
<attribute name="Implementation-Title" value="org.openscience.cdk"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="The CDK Project"/>
+ <attribute name="X-Compile-Target-JDK" value="${compile.target.version}"/>
</section>
</manifest>
<fileset dir="${appjars.dir}">
@@ -19,15 +19,15 @@
import java.util.ArrayList;
import java.util.List;
-import net.sf.cdk.tools.doclets.CDKBugTaglet;
-
import com.github.ojdcheck.test.IClassDocTester;
import com.github.ojdcheck.test.ITestReport;
import com.github.ojdcheck.test.TestReport;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Tag;
+import net.sf.cdk.tools.doclets.CDKBugTaglet;
+
/**
* OpenJavaDocCheck test that tests if the content of the cdk.bug
* tag is a valid integer.
@@ -96,10 +96,11 @@ public Priority getPriority() {
return Priority.ERROR;
}
- @Override
+ /**
+ * {@inheritDoc}
+ */
public String getURL() {
// There is not web page yet
return null;
}
-
}
@@ -20,14 +20,14 @@
import java.util.Collections;
import java.util.List;
-import net.sf.cdk.tools.doclets.CDKGitTaglet;
-
import com.github.ojdcheck.test.IClassDocTester;
import com.github.ojdcheck.test.ITestReport;
import com.github.ojdcheck.test.TestReport;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.Tag;
+import net.sf.cdk.tools.doclets.CDKGitTaglet;
+
/**
* OpenJavaDocCheck test that warns about missing cdk.githash tags.
*
@@ -78,10 +78,11 @@ public Priority getPriority() {
return Priority.MINOR_ERROR;
}
- @Override
+ /**
+ * {@inheritDoc}
+ */
public String getURL() {
// There is not web page yet
return null;
}
-
}
@@ -20,14 +20,14 @@
import java.util.Collections;
import java.util.List;
-import net.sf.cdk.tools.doclets.CDKModuleTaglet;
-
import com.github.ojdcheck.test.IClassDocTester;
import com.github.ojdcheck.test.ITestReport;
import com.github.ojdcheck.test.TestReport;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.Tag;
+import net.sf.cdk.tools.doclets.CDKModuleTaglet;
+
/**
* OpenJavaDocCheck test that warns of a class JavaDoc does not contain
* the cdk.module tag needed by the build system.
@@ -79,10 +79,11 @@ public Priority getPriority() {
return Priority.WARNING;
}
- @Override
+ /**
+ * {@inheritDoc}
+ */
public String getURL() {
// There is not web page yet
return null;
}
-
}
@@ -38,9 +38,9 @@
import org.openscience.cdk.graph.PathTools;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
+import org.openscience.cdk.interfaces.IAtomType.Hybridization;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IPseudoAtom;
-import org.openscience.cdk.interfaces.IAtomType.Hybridization;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
import org.openscience.cdk.tools.periodictable.PeriodicTable;
@@ -295,11 +295,11 @@ public int getSize() {
return size;
}
- @Override
- public Map<String, Integer> getRawFingerprint(IAtomContainer container)
- throws CDKException {
+ /**
+ * {@inheritDoc}
+ */
+ public Map<String, Integer> getRawFingerprint(IAtomContainer container) {
throw new UnsupportedOperationException();
}
-
}
@@ -36,8 +36,7 @@
@TestClass("org.openscience.cdk.geometry.cip.rules.AtomicNumberRuleTest")
class AtomicNumberRule implements ISequenceSubRule<ILigand> {
- /** {@inheritDoc}} */
- @Override
+ /** {@inheritDoc} */
@TestMethod("testCompare_Identity,testCompare,testOrder")
public int compare(ILigand ligand1, ILigand ligand2) {
return getAtomicNumber(ligand1).compareTo(getAtomicNumber(ligand2));
@@ -48,5 +47,4 @@ private Integer getAtomicNumber(ILigand ligand) {
if (atomNumber != null) return atomNumber;
return PeriodicTable.getAtomicNumber(ligand.getLigandAtom().getSymbol());
}
-
}
@@ -44,8 +44,7 @@
CombinedAtomicMassNumberRule numberRule = new CombinedAtomicMassNumberRule();
- /** {@inheritDoc}} */
- @Override
+ /** {@inheritDoc} */
@TestMethod("testCompare,testCompare_Identity,testOrder")
public int compare(ILigand ligand1, ILigand ligand2) {
int numberComp = numberRule.compare(ligand1, ligand2);
@@ -42,8 +42,7 @@
MassNumberRule massNumberRule = new MassNumberRule();
AtomicNumberRule atomicNumberRule = new AtomicNumberRule();
- /** {@inheritDoc}} */
- @Override
+ /** {@inheritDoc} */
@TestMethod("testCompare,testCompare_Identity,testOrder")
public int compare(ILigand ligand1, ILigand ligand2) {
int atomicNumberComp = atomicNumberRule.compare(ligand1, ligand2);
@@ -24,8 +24,6 @@
import java.util.Comparator;
-import org.openscience.cdk.geometry.cip.ILigand;
-
/**
* Sequence sub rule used in the CIP method to decide which of the two ligands takes
* precedence {@cdk.cite Cahn1966}. A list ordered based on these rules will be
@@ -46,7 +44,6 @@
* @return 1 if ligand1 is of higher precedence than ligand2, -1 if ligand2 is
* of higher precedence than ligan1, and 0 if they have equal precedence
*/
- @Override
public int compare(ILigand ligand1, ILigand ligand2);
}
@@ -43,8 +43,7 @@
ILoggingTool logger = LoggingToolFactory.createLoggingTool(MassNumberRule.class);
IsotopeFactory factory;
- /** {@inheritDoc}} */
- @Override
+ /** {@inheritDoc} */
@TestMethod("testCompare_Identity,testCompare,testOrder")
public int compare(ILigand ligand1, ILigand ligand2) {
ensureFactory(ligand1);
@@ -122,14 +122,14 @@ public MoleculeSignature(IMolecule molecule, int height) {
this.molecule = molecule;
}
- @Override /** {@inheritDoc} */
- @TestMethod("getVertexCountTest")
+ @Override
+ @TestMethod("getVertexCountTest")
protected int getVertexCount() {
return this.molecule.getAtomCount();
}
- @Override /** {@inheritDoc} */
- @TestMethod("getSignatureStringForVertexTest")
+ @Override
+ @TestMethod("getSignatureStringForVertexTest")
public String signatureStringForVertex(int vertexIndex) {
AtomSignature atomSignature;
int height = super.getHeight();
@@ -142,16 +142,16 @@ public String signatureStringForVertex(int vertexIndex) {
return atomSignature.toCanonicalString();
}
- @Override /** {@inheritDoc} */
- @TestMethod("getSignatureStringForVertexTest_height")
+ @Override
+ @TestMethod("getSignatureStringForVertexTest_height")
public String signatureStringForVertex(int vertexIndex, int height) {
AtomSignature atomSignature =
new AtomSignature(vertexIndex, height, this.molecule);
return atomSignature.toCanonicalString();
}
- @Override /** {@inheritDoc} */
- @TestMethod("getSignatureForVertexTest")
+ @Override
+ @TestMethod("getSignatureForVertexTest")
public AbstractVertexSignature signatureForVertex(int vertexIndex) {
return new AtomSignature(vertexIndex, this.molecule);
}
@@ -106,7 +106,6 @@ public DefaultBondMatcher(IQueryBond queryBond) {
* @param targetBond target bond
* @return true if bonds match
*/
- @Override
public boolean matches(IAtomContainer targetContainer, IBond targetBond) {
if (this.smartQueryBond != null && queryBond == null) {
return smartQueryBond.matches(targetBond);
@@ -174,7 +174,6 @@ private int countImplicitHydrogens(IAtom atom) {
* @param targetAtom
* @return
*/
- @Override
public boolean matches(IAtomContainer targetContainer, IAtom targetAtom) {
if (smartQueryAtom != null && qAtom == null) {
if (!smartQueryAtom.matches(targetAtom)) {
@@ -120,7 +120,6 @@ public DefaultRGraphAtomMatcher(IAtomContainer queryContainer, IAtom template, i
* @param targetAtom
* @return
*/
- @Override
public boolean matches(IAtomContainer targetContainer, IAtom targetAtom) {
if (qAtom instanceof IQueryAtom) {
if (!((IQueryAtom) qAtom).matches(targetAtom)) {
@@ -175,7 +175,6 @@ private int countImplicitHydrogens(IAtom atom) {
* @param targetAtom
* @return
*/
- @Override
public boolean matches(TargetProperties targetContainer, IAtom targetAtom) {
if (smartQueryAtom != null && qAtom == null) {
if (!smartQueryAtom.matches(targetAtom)) {
@@ -109,7 +109,6 @@ public DefaultVFBondMatcher(IQueryBond queryBond) {
* @param targetBond target bond
* @return true if bonds match
*/
- @Override
public boolean matches(TargetProperties targetConatiner, IBond targetBond) {
if (this.smartQueryBond != null) {
return smartQueryBond.matches(targetBond);
@@ -73,7 +73,6 @@ public MCSPlusHandler() {
* @param source
* @param target
*/
- @Override
@TestMethod("testSet_MolHandler_MolHandler")
public synchronized void set(MolHandler source, MolHandler target) {
this.source = source.getMolecule();
@@ -85,7 +84,6 @@ public synchronized void set(MolHandler source, MolHandler target) {
* @param source
* @param target
*/
- @Override
@TestMethod("testSet_IQueryAtomContainer_MolHandler")
public void set(IQueryAtomContainer source, IAtomContainer target) {
this.source = source;
@@ -184,31 +182,27 @@ private synchronized void setFirstAtomMapping() {
/** {@inheritDoc}
*/
- @Override
@TestMethod("testSearchMCS")
public synchronized List<Map<Integer, Integer>> getAllMapping() {
return allMCS;
}
/** {@inheritDoc}
*/
- @Override
@TestMethod("testSearchMCS")
public synchronized Map<Integer, Integer> getFirstMapping() {
return firstMCS;
}
/** {@inheritDoc}
*/
- @Override
@TestMethod("testSearchMCS")
public synchronized List<Map<IAtom, IAtom>> getAllAtomMapping() {
return allAtomMCS;
}
/** {@inheritDoc}
*/
- @Override
@TestMethod("testSearchMCS")
public synchronized Map<IAtom, IAtom> getFirstAtomMapping() {
return atomsMCS;
Oops, something went wrong.

0 comments on commit 7c24db7

Please sign in to comment.