From 93403eb4cec5b1bd3afab0b5951a272b657eb487 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Mon, 6 Sep 2010 14:49:47 +0200 Subject: [PATCH 1/7] Removed plugin not used by Bioclipse 2.4 --- plugins/org.openscience.cdk.log4j/.classpath | 7 - plugins/org.openscience.cdk.log4j/.project | 22 - .../META-INF/MANIFEST.MF | 16 - .../build.properties | 4 - .../src/log4j.javafiles | 1 - .../cdk/config/data/log4j.properties | 10 - .../org/openscience/cdk/log4j/Activator.java | 5 - .../openscience/cdk/tools/LoggingTool.java | 474 ------------------ 8 files changed, 539 deletions(-) delete mode 100644 plugins/org.openscience.cdk.log4j/.classpath delete mode 100644 plugins/org.openscience.cdk.log4j/.project delete mode 100644 plugins/org.openscience.cdk.log4j/META-INF/MANIFEST.MF delete mode 100644 plugins/org.openscience.cdk.log4j/build.properties delete mode 100644 plugins/org.openscience.cdk.log4j/src/log4j.javafiles delete mode 100644 plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/config/data/log4j.properties delete mode 100644 plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/log4j/Activator.java delete mode 100644 plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/tools/LoggingTool.java diff --git a/plugins/org.openscience.cdk.log4j/.classpath b/plugins/org.openscience.cdk.log4j/.classpath deleted file mode 100644 index b1f7ca702..000000000 --- a/plugins/org.openscience.cdk.log4j/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/org.openscience.cdk.log4j/.project b/plugins/org.openscience.cdk.log4j/.project deleted file mode 100644 index b3576ce86..000000000 --- a/plugins/org.openscience.cdk.log4j/.project +++ /dev/null @@ -1,22 +0,0 @@ - - - org.openscience.cdk.log4j - - - - - - org.eclipse.jdt.core.javabuilder - - - org.eclipse.pde.ManifestBuilder - - - org.eclipse.pde.SchemaBuilder - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/plugins/org.openscience.cdk.log4j/META-INF/MANIFEST.MF b/plugins/org.openscience.cdk.log4j/META-INF/MANIFEST.MF deleted file mode 100644 index 68886c90f..000000000 --- a/plugins/org.openscience.cdk.log4j/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: CDK plugin -Bundle-SymbolicName: org.openscience.cdk.log4j;singleton:=true -Bundle-Version: 1.3.5.0bioclipse1 -Bundle-Vendor: The Chemistry Development Kit Project -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.openscience.cdk.log4j.Activator -Bundle-ClassPath: . -Require-Bundle: org.openscience.cdk.annotation, - org.openscience.cdk.core, - org.eclipse.core.runtime -Import-Package: org.apache.log4j -Export-Package: org.openscience.cdk.tools, - org.openscience.cdk.config.data, - org.openscience.cdk.log4j diff --git a/plugins/org.openscience.cdk.log4j/build.properties b/plugins/org.openscience.cdk.log4j/build.properties deleted file mode 100644 index 4bca34f0c..000000000 --- a/plugins/org.openscience.cdk.log4j/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src -output.. = bin -bin.includes = META-INF/,\ - . diff --git a/plugins/org.openscience.cdk.log4j/src/log4j.javafiles b/plugins/org.openscience.cdk.log4j/src/log4j.javafiles deleted file mode 100644 index 5fbdc9c9a..000000000 --- a/plugins/org.openscience.cdk.log4j/src/log4j.javafiles +++ /dev/null @@ -1 +0,0 @@ -org/openscience/cdk/tools/LoggingTool.java diff --git a/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/config/data/log4j.properties b/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/config/data/log4j.properties deleted file mode 100644 index 0c42009c3..000000000 --- a/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/config/data/log4j.properties +++ /dev/null @@ -1,10 +0,0 @@ -log4j.rootCategory=DEBUG, file - -log4j.category.org.openscience.cdk=DEBUG - -log4j.appender.file=org.apache.log4j.FileAppender -log4j.appender.file.File=cdk.log -log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d [%t] %-5p %c - %m%n - -log4j.category.joelib=WARN diff --git a/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/log4j/Activator.java b/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/log4j/Activator.java deleted file mode 100644 index 40d355ae6..000000000 --- a/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/log4j/Activator.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.openscience.cdk.log4j; - -import org.eclipse.core.runtime.Plugin; - -public class Activator extends Plugin {} diff --git a/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/tools/LoggingTool.java b/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/tools/LoggingTool.java deleted file mode 100644 index 7ad8264e9..000000000 --- a/plugins/org.openscience.cdk.log4j/src/org/openscience/cdk/tools/LoggingTool.java +++ /dev/null @@ -1,474 +0,0 @@ -/* Copyright (C) 2002-2003 Christoph Steinbeck - * 2002-2008 Egon Willighagen - * - * Contact: cdk-devel@lists.sourceforge.net - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.openscience.cdk.tools; - -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.StringReader; - -import org.apache.log4j.Logger; -import org.openscience.cdk.annotations.TestClass; -import org.openscience.cdk.annotations.TestMethod; - -/** - * Useful for logging messages. Often used as a class static variable instantiated like: - *
- * public class SomeClass {
- *     private static ILoggingTool logger =
- *         LoggingToolFactory.createLoggingTool(SomeClass.class);
- * }
- * 
- * There is no special reason not to make the logger private and static, as the logging - * information is closely bound to one specific Class, not subclasses and not instances. - * - *

The logger has five logging levels: - *

    - *
    DEBUG - *
    Default mode. Used for information you might need to track down the cause of a - * bug in the source code, or to understand how an algorithm works. - *
    WARNING - *
    This indicates a special situation which is unlike to happen, but for which no - * special actions need to be taken. E.g. missing information in files, or an - * unknown atom type. The action is normally something user friendly. - *
    INFO - *
    For reporting informative information to the user that he might easily disregard. - * Real important information should be given to the user using a GUI element. - *
    FATAL - *
    This level is used for situations that should not have happened *and* that - * lead to a situation where this program can no longer function (rare in Java). - *
    ERROR - *
    This level is used for situations that should not have happened *and* thus - * indicate a bug. - *
- * - *

Consider that the debugging will not always be turned on. Therefore, it is better - * not to concatenate string in the logger.debug() call, but have the LoggingTool do - * this when appropriate. In other words, use: - *

- * logger.debug("The String X has this value: ", someString);
- * logger.debug("The int Y has this value: ", y);
- * 
- * instead of: - *
- * logger.debug("The String X has this value: " + someString);
- * logger.debug("The int Y has this value: " + y);
- * 
- * - *

For logging calls that require even more computation you can use the - * isDebugEnabled() method: - *

- * if (logger.isDebugEnabled()) {
- *   logger.info("The 1056389822th prime that is used is: ",
- *     calculatePrime(1056389822));
- * }
- * 
- * - *

The class uses log4j as a backend if available, and System.out otherwise. - * - * @cdk.module log4j - * @cdk.githash - * @cdk.builddepends log4j.jar - */ -@TestClass("org.openscience.cdk.tools.LoggingToolTest") -public class LoggingTool implements ILoggingTool { - - private boolean doDebug = false; - private boolean toSTDOUT = false; - - private Logger log4jLogger; - private static ILoggingTool logger; - private String classname; - - private int stackLength; // NOPMD - - /** Default number of StackTraceElements to be printed by debug(Exception). */ - public final int DEFAULT_STACK_LENGTH = 5; - - /** - * Constructs a LoggingTool which produces log lines without any special - * indication which class the message originates from. - */ - public LoggingTool() { - this(LoggingTool.class); - } - - /** - * Constructs a LoggingTool which produces log lines indicating them to be - * for the Class of the Object. - * - * @param object Object from which the log messages originate - */ - public LoggingTool(Object object) { - this(object.getClass()); - } - - /** - * Constructs a LoggingTool which produces log lines indicating them to be - * for the given Class. - * - * @param classInst Class from which the log messages originate - */ - public LoggingTool(Class classInst) { - LoggingTool.logger = this; - stackLength = DEFAULT_STACK_LENGTH; - this.classname = classInst.getName(); - try { - log4jLogger = Logger.getLogger(classname); - } catch (NoClassDefFoundError e) { - toSTDOUT = true; - logger.debug("Log4J class not found!"); - } catch (NullPointerException e) { // NOPMD - toSTDOUT = true; - logger.debug("Properties file not found!"); - } catch (Exception e) { - toSTDOUT = true; - logger.debug("Unknown error occured: ", e.getMessage()); - } - /* ************************************************************** - * but some JVMs (i.e. MSFT) won't pass the SecurityException to - * this exception handler. So we are going to check the JVM - * version first - ****************************************************************/ - doDebug = false; - String strJvmVersion = System.getProperty("java.version"); - if (strJvmVersion.compareTo("1.2") >= 0) { - // Use a try {} to catch SecurityExceptions when used in applets - try { - // by default debugging is set off, but it can be turned on - // with starting java like "java -Dcdk.debugging=true" - if (System.getProperty("cdk.debugging", "false").equals("true")) { - doDebug = true; - } - if (System.getProperty("cdk.debug.stdout", "false").equals("true")) { - toSTDOUT = true; - } - } catch (Exception e) { - logger.debug("guessed what happened: security exception thrown by applet runner"); - logger.debug(" therefore, do not debug"); - } - } - } - - /** - * Forces the LoggingTool to configurate the Log4J toolkit. - * Normally this should be done by the application that uses the CDK library, - * but is available for convenience. - */ - @TestMethod("testConfigureLog4j") - public static void configureLog4j() { - LoggingTool localLogger = new LoggingTool(LoggingTool.class); - try { // NOPMD - org.apache.log4j.PropertyConfigurator.configure( - LoggingTool.class.getResource("/org/openscience/cdk/config/data/log4j.properties")); - } catch (NullPointerException e) { // NOPMD - localLogger.error("Properties file not found: ", e.getMessage()); - localLogger.debug(e); - } catch (Exception e) { - localLogger.error("Unknown error occured: ", e.getMessage()); - localLogger.debug(e); - } - } - - /** - * Outputs system properties for the operating system and the java - * version. More specifically: os.name, os.version, os.arch, java.version - * and java.vendor. - */ - @TestMethod("testDumpSystemProperties") - public void dumpSystemProperties() { - debug("os.name : " + System.getProperty("os.name")); - debug("os.version : " + System.getProperty("os.version")); - debug("os.arch : " + System.getProperty("os.arch")); - debug("java.version : " + System.getProperty("java.version")); - debug("java.vendor : " + System.getProperty("java.vendor")); - } - - /** - * Sets the number of StackTraceElements to be printed in DEBUG mode when - * calling debug(Throwable). - * The default value is DEFAULT_STACK_LENGTH. - * - * @param length the new stack length - * - * @see #DEFAULT_STACK_LENGTH - */ - @TestMethod("testSetStackLength_int") - public void setStackLength(int length) { - this.stackLength = length; - } - - /** - * Outputs the system property for java.class.path. - */ - @TestMethod("testDumpClasspath") - public void dumpClasspath() { - debug("java.class.path: " + System.getProperty("java.class.path")); - } - - /** - * Shows DEBUG output for the Object. If the object is an instanceof - * Throwable it will output the trace. Otherwise it will use the - * toString() method. - * - * @param object Object to apply toString() too and output - */ - @TestMethod("testDebug_Object") - public void debug(Object object) { - if (doDebug) { - if (object instanceof Throwable) { - debugThrowable((Throwable)object); - } else { - debugString("" + object); - } - } - } - - private void debugString(String string) { - if (toSTDOUT) { - printToSTDOUT("DEBUG", string); - } else { - log4jLogger.debug(string); - } - } - - /** - * Shows DEBUG output for the given Object's. It uses the - * toString() method to concatenate the objects. - * - * @param object Object to apply toString() too and output - * @param objects Object[] to apply toString() too and output - */ - @TestMethod("testDebug_Object_int") - public void debug(Object object, Object... objects) { - if (doDebug) { - StringBuilder result = new StringBuilder(); - result.append(object.toString()); - for (Object obj : objects) { - result.append(obj.toString()); - } - debugString(result.toString()); - } - } - - private void debugThrowable(Throwable problem) { - if (problem != null) { - if (problem instanceof Error) { - debug("Error: ", problem.getMessage()); - } else { - debug("Exception: ", problem.getMessage()); - } - java.io.StringWriter stackTraceWriter = new java.io.StringWriter(); - problem.printStackTrace(new PrintWriter(stackTraceWriter)); - String trace = stackTraceWriter.toString(); - try { - BufferedReader reader = new BufferedReader(new StringReader(trace)); - if (reader.ready()) { - String traceLine = reader.readLine(); - int counter = 0; - while (reader.ready() && traceLine != null && - (counter < stackLength)) { - debug(traceLine); - traceLine = reader.readLine(); - counter++; - } - } - } catch (Exception ioException) { - error("Serious error in LoggingTool while printing exception stack trace: " + - ioException.getMessage()); - logger.debug(ioException); - } - Throwable cause = problem.getCause(); - if (cause != null) { - debug("Caused by: "); - debugThrowable(cause); - } - } - } - - /** - * Shows ERROR output for the Object. It uses the toString() method. - * - * @param object Object to apply toString() too and output - */ - @TestMethod("testError_Object") - public void error(Object object) { - if (doDebug) { - errorString("" + object); - } - } - - /** - * Shows ERROR output for the given Object's. It uses the - * toString() method to concatenate the objects. - * - * @param object Object to apply toString() too and output - * @param objects Object[] to apply toString() too and output - */ - @TestMethod("testError_Object_int") - public void error(Object object, Object... objects) { - if (doDebug) { - StringBuilder result = new StringBuilder(); - result.append(object.toString()); - for (Object obj : objects) { - result.append(obj.toString()); - } - errorString(result.toString()); - } - } - - private void errorString(String string) { - if (toSTDOUT) { - printToSTDOUT("ERROR", string); - } else { - log4jLogger.error(string); - } - } - - /** - * Shows FATAL output for the Object. It uses the toString() method. - * - * @param object Object to apply toString() too and output - */ - @TestMethod("testFatal_Object") - public void fatal(Object object) { - if (doDebug) { - if (toSTDOUT) { - printToSTDOUT("FATAL", object.toString()); - } else { - log4jLogger.fatal("" + object.toString()); - } - } - } - - /** - * Shows INFO output for the Object. It uses the toString() method. - * - * @param object Object to apply toString() too and output - */ - @TestMethod("testInfo_Object") - public void info(Object object) { - if (doDebug) { - infoString("" + object); - } - } - - /** - * Shows INFO output for the given Object's. It uses the - * toString() method to concatenate the objects. - * - * @param object Object to apply toString() too and output - * @param objects Object[] to apply toString() too and output - */ - @TestMethod("testInfo_Object_int") - public void info(Object object, Object... objects) { - if (doDebug) { - StringBuilder result = new StringBuilder(); - result.append(object.toString()); - for (Object obj : objects) { - result.append(obj.toString()); - } - infoString(result.toString()); - } - } - - private void infoString(String string) { - if (toSTDOUT) { - printToSTDOUT("INFO", string); - } else { - log4jLogger.info(string); - } - } - - /** - * Shows WARN output for the Object. It uses the toString() method. - * - * @param object Object to apply toString() too and output - */ - @TestMethod("testWarn_Object") - public void warn(Object object) { - if (doDebug) { - warnString("" + object); - } - } - - private void warnString(String string) { - if (toSTDOUT) { - printToSTDOUT("WARN", string); - } else { - log4jLogger.warn(string); - } - } - - /** - * Shows WARN output for the given Object's. It uses the - * toString() method to concatenate the objects. - * - * @param object Object to apply toString() too and output - * @param objects Object[] to apply toString() too and output - */ - @TestMethod("testWarn_Object_int") - public void warn(Object object, Object... objects) { - if (doDebug) { - StringBuilder result = new StringBuilder(); - result.append(object.toString()); - for (Object obj : objects) { - result.append(obj.toString()); - } - warnString(result.toString()); - } - } - /** - * Use this method for computational demanding debug info. - * For example: - *

-     * if (logger.isDebugEnabled()) {
-     *   logger.info("The 1056389822th prime that is used is: ",
-     *                calculatePrime(1056389822));
-     * }
-     * 
- * - * @return true, if debug is enabled - */ - @TestMethod("testIsDebugEnabled") - public boolean isDebugEnabled() { - return doDebug; - } - - private void printToSTDOUT(String level, String message) { - System.out.print(classname); - System.out.print(" "); - System.out.print(level); - System.out.print(": "); - System.out.println(message); - } - - /** - * Creates a new {@link LoggingTool} for the given class. - * - * @param sourceClass Class for which logging messages are recorded. - * @return A {@link LoggingTool}. - */ - @TestMethod("testCreate") - public static ILoggingTool create(Class sourceClass) { - return new LoggingTool(sourceClass); - } - -} - From 4c8b1f6ed5b6f84c53049dac9b50ea131b84ab7a Mon Sep 17 00:00:00 2001 From: Arvid Berg Date: Tue, 7 Sep 2010 20:51:17 +0800 Subject: [PATCH 2/7] Changed inchi-bundle to sinchi and removed hardcoded version from site-feature --- .../org.openscience.cdk_feature/feature.xml | 2 +- features/org.openscience.cdk_site/feature.xml | 130 +++++++++--------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/features/org.openscience.cdk_feature/feature.xml b/features/org.openscience.cdk_feature/feature.xml index 05c066ee0..5aace4858 100644 --- a/features/org.openscience.cdk_feature/feature.xml +++ b/features/org.openscience.cdk_feature/feature.xml @@ -136,7 +136,7 @@ unpack="false"/> - - + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + version="0.0.0"/> + + From 2263ddf413975bfb6ccfb1c1cc8814f9d4935b5c Mon Sep 17 00:00:00 2001 From: Arvid Berg Date: Wed, 8 Sep 2010 13:35:31 +0200 Subject: [PATCH 3/7] Updated bundle references for xom and cmlxom --- features/org.openscience.cdk_site/buckminster.cspex | 4 ++-- features/org.openscience.cdk_site/feature.xml | 13 ------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/features/org.openscience.cdk_site/buckminster.cspex b/features/org.openscience.cdk_site/buckminster.cspex index b75da5cef..4d42cad03 100644 --- a/features/org.openscience.cdk_site/buckminster.cspex +++ b/features/org.openscience.cdk_site/buckminster.cspex @@ -4,8 +4,8 @@ xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0" xmlns="http://www.eclipse.org/buckminster/CSpec-1.0"> - - + + diff --git a/features/org.openscience.cdk_site/feature.xml b/features/org.openscience.cdk_site/feature.xml index 6397a956e..d256ef762 100644 --- a/features/org.openscience.cdk_site/feature.xml +++ b/features/org.openscience.cdk_site/feature.xml @@ -189,13 +189,6 @@ version="0.0.0" unpack="false"/> - - - - Date: Wed, 8 Sep 2010 15:10:50 +0200 Subject: [PATCH 4/7] Removed cdk.log4j and changed net.sf.jniinchi to net.bioclipse.jniinchi --- .../org.openscience.cdk_feature/feature.xml | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/features/org.openscience.cdk_feature/feature.xml b/features/org.openscience.cdk_feature/feature.xml index 5aace4858..a5cbb7f34 100644 --- a/features/org.openscience.cdk_feature/feature.xml +++ b/features/org.openscience.cdk_feature/feature.xml @@ -191,13 +191,6 @@ version="0.0.0" unpack="false"/> - - - - + + From 0f2c76c91a9552d8f21e309fb78d4843c3e568b8 Mon Sep 17 00:00:00 2001 From: Arvid Berg Date: Wed, 8 Sep 2010 16:17:20 +0200 Subject: [PATCH 5/7] Removed dependency on log4j --- features/org.openscience.cdk_site/buckminster.cspex | 1 - 1 file changed, 1 deletion(-) diff --git a/features/org.openscience.cdk_site/buckminster.cspex b/features/org.openscience.cdk_site/buckminster.cspex index 4d42cad03..fa563ff3a 100644 --- a/features/org.openscience.cdk_site/buckminster.cspex +++ b/features/org.openscience.cdk_site/buckminster.cspex @@ -6,7 +6,6 @@ - From d46d1b3e5b7ddca378b11626cbd0a4cda415ca9a Mon Sep 17 00:00:00 2001 From: Arvid Berg Date: Thu, 30 Sep 2010 13:30:39 +0200 Subject: [PATCH 6/7] Removed ioformats and annotation from cdk feature --- features/org.openscience.cdk_site/feature.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/features/org.openscience.cdk_site/feature.xml b/features/org.openscience.cdk_site/feature.xml index d256ef762..54cf2aed4 100644 --- a/features/org.openscience.cdk_site/feature.xml +++ b/features/org.openscience.cdk_site/feature.xml @@ -21,13 +21,6 @@ id="org.openscience.cdk_feature" version="0.0.0"/> - - - - Date: Tue, 5 Oct 2010 11:06:56 +0200 Subject: [PATCH 7/7] Updated version of site to 1.3.5.0bioclipse1 --- features/org.openscience.cdk_site/feature.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/org.openscience.cdk_site/feature.xml b/features/org.openscience.cdk_site/feature.xml index 54cf2aed4..b5ee37e97 100644 --- a/features/org.openscience.cdk_site/feature.xml +++ b/features/org.openscience.cdk_site/feature.xml @@ -2,7 +2,7 @@