Skip to content

Commit

Permalink
Migrate commons.logging and log4j-1 loggers to SLF4J
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Aug 12, 2024
1 parent 0264d27 commit 51ca8c9
Show file tree
Hide file tree
Showing 41 changed files with 130 additions and 185 deletions.
12 changes: 2 additions & 10 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ Apache Commons Line Interface (1.0)

* License: Apache Software License 1.1

Apache Commons Logging Jar (1.1.1)

* License: Apache License, 2.0

asm (6.2)

* License: BSD-3-Clause
Expand Down Expand Up @@ -113,17 +109,13 @@ Guice (2.0)

* License: Apache License, 2.0

log4j (1.2.15)

* License: Apache License, 2.0

org.apache.ant (1.6.5)

* License: Apache License, 2.0

Apache Commons Logging (1.3.3)
Simple Logging Facade for Java (SLF4J) (2.0.15)

* License: Apache License, 2.0
* License: MIT License

## Cryptography

Expand Down
1 change: 0 additions & 1 deletion features/org.eclipse.emf.mwe2.launcher-feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ SPDX-License-Identifier: EPL-2.0
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.osgi"/>
<import plugin="org.apache.commons.cli" version="1.8.0" match="compatible"/>
<import plugin="org.apache.log4j"/>
</requires>

<plugin
Expand Down
12 changes: 5 additions & 7 deletions maven/org.eclipse.emf.mwe2.parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<properties>
<tycho-qualifier>yyyyMMdd-HHmm</tycho-qualifier>

<tycho-version>2.7.5</tycho-version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
Expand All @@ -32,8 +32,6 @@
<commons-cli.version>1.8.0</commons-cli.version>
<guava.version>33.2.1-jre</guava.version>
<google-inject.version>7.0.0</google-inject.version>
<log4j.version>1.2.25</log4j.version>
<commons-logging.version>1.3.3</commons-logging.version>
<cbi-plugins.version>1.3.5</cbi-plugins.version>

<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
Expand Down Expand Up @@ -63,7 +61,7 @@
<url>http://www.eclipse.org/legal/epl-2.0</url>
</license>
</licenses>

<pluginRepositories>
<!-- for eclipse-jarsigner-plugin -->
<pluginRepository>
Expand All @@ -77,7 +75,7 @@
</snapshots>
</pluginRepository>
</pluginRepositories>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
Expand Down Expand Up @@ -211,7 +209,7 @@
<name>model</name>
<placement>X</placement>
</tag>
</tags>
</tags>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -304,7 +302,7 @@
<module>../org.eclipse.emf.mwe2.target/org.eclipse.emf.mwe2.target.nightly</module>
</modules>
</profile>
<!--
<!--
Profile 'release' is activated when property BUILD_TYPE is NOT 'N' (nightly).
For release builds strict version checking is disabled, since Maven version will be a
release version, while OSGi artifacts (MANIFEST.MF, feature.xml) still contain a qualified version.
Expand Down
2 changes: 0 additions & 2 deletions maven/org.eclipse.emf.mwe2.repository/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<bundle id="com.google.guava.failureaccess.source" version="1.0.2.qualifier"/>
<bundle id="org.apache.commons.cli" version="1.8.0"/>
<bundle id="org.apache.commons.cli.source" version="1.8.0"/>
<bundle id="org.apache.commons.commons-logging" version="0.0.0"/>
<bundle id="org.apache.commons.commons-logging.source" version="0.0.0"/>
<category-def name="mwe2lang" label="MWE">
<description>
The configuration language used to configure Xtext&apos;s code generator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@
<repository location="https://download.eclipse.org/cbi/updates/license/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.apache.log4j" version="1.2.25"/>
<unit id="org.junit" version="0.0.0"/>
<unit id="org.apache.commons.cli" version="1.8.0"/>
<unit id="org.apache.commons.commons-logging" version="0.0.0"/>
<unit id="com.google.guava" version="33.2.1.jre"/>
<unit id="com.google.guava.failureaccess" version="1.0.2"/>
<unit id="slf4j.api" version="2.0.13"/>
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-09"/>
</location>
</locations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
<repository location="https://download.eclipse.org/cbi/updates/license/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.apache.log4j" version="1.2.25"/>
<unit id="org.junit" version="0.0.0"/>
<unit id="org.apache.commons.cli" version="1.8.0"/>
<unit id="org.apache.commons.commons-logging" version="0.0.0"/>
<unit id="com.google.guava" version="33.2.1.jre"/>
<unit id="com.google.guava.failureaccess" version="1.0.2"/>
<unit id="slf4j.api" version="2.0.13"/>
<repository location="https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/2024-09"/>
</location>
</locations>
Expand Down
2 changes: 1 addition & 1 deletion plugins/org.eclipse.emf.mwe.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ Export-Package: org.eclipse.emf.mwe.core,
org.eclipse.emf.mwe.internal.core.util;x-friends:="org.eclipse.emf.mwe.tests"
Bundle-Activator: org.eclipse.emf.mwe.internal.core.MWEPlugin$Implementation
Bundle-ActivationPolicy: lazy
Import-Package: org.apache.commons.logging;version="1.0.4"
Import-Package: org.slf4j;version="[1.7.0,3.0.0)"
Automatic-Module-Name: org.eclipse.emf.mwe.core
5 changes: 0 additions & 5 deletions plugins/org.eclipse.emf.mwe.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,5 @@
<artifactId>commons-cli</artifactId>
<version>${commons-cli.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import java.util.Map;
import java.util.jar.Manifest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.mwe.core.issues.Issues;
import org.eclipse.emf.mwe.core.issues.IssuesImpl;
Expand All @@ -26,6 +24,8 @@
import org.eclipse.emf.mwe.internal.core.Workflow;
import org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory;
import org.eclipse.emf.mwe.internal.core.ast.util.converter.Converter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class WorkflowEngine {
Expand All @@ -34,7 +34,7 @@ public class WorkflowEngine {

private ProgressMonitor monitor;

private static final Log logger = LogFactory.getLog(WorkflowEngine.class);
private static final Logger logger = LoggerFactory.getLogger(WorkflowEngine.class);

private Map<String, String> params;

Expand Down Expand Up @@ -113,7 +113,7 @@ public boolean prepare(final String workFlowFile, final ProgressMonitor theMonit
}
}
catch (final ConfigurationException ex) {
logger.fatal(ex.getMessage(), ex);
logger.error(ex.getMessage(), ex);
logIssues(logger, issues);
return false;
}
Expand Down Expand Up @@ -205,7 +205,7 @@ private void addExternalSlotContents(final Map<?, ?> slotContents) {
}
}

private void logIssues(final Log logger, final Issues issues) {
private void logIssues(final Logger logger, final Issues issues) {
// log any configuration warning messages
final Diagnostic[] issueArray = issues.getIssues();
for (final Diagnostic issue : issueArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import java.util.Collection;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.core.ConfigurationException;
import org.eclipse.emf.mwe.core.WorkflowComponent;
import org.eclipse.emf.mwe.core.WorkflowComponentWithID;
Expand All @@ -32,6 +30,8 @@
import org.eclipse.emf.mwe.internal.core.util.ComponentPrinter;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* A composite <tt>WorkflowComponent</tt>.
Expand All @@ -41,7 +41,7 @@ public class CompositeComponent implements WorkflowComponentWithID, IWorkflowCom

private static final String COMPONENT_NAME = "Composite component";

protected static final Log log = LogFactory.getLog(CompositeComponent.class);
protected static final Logger log = LoggerFactory.getLogger(CompositeComponent.class);

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class WorkflowCustomization {

private static Map<String,Class<?>> keywordmapping = new HashMap<String,Class<?>>();

private static final Log logger = LogFactory.getLog(WorkflowCustomization.class);
private static final Logger logger = LoggerFactory.getLogger(WorkflowCustomization.class);

public static void registerKeywordMapping( String keyword, Class<?> componentClass ) {
keywordmapping .put( keyword, componentClass );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.emf.mwe.core.lib;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.core.WorkflowComponentWithID;
import org.eclipse.emf.mwe.core.WorkflowContext;
import org.eclipse.emf.mwe.core.container.CompositeComponent;
Expand All @@ -21,14 +19,16 @@
import org.eclipse.emf.mwe.internal.core.ast.parser.Location;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Base class useful for implementing custom WorkflowComponents.
*
*/
public abstract class AbstractWorkflowComponent implements WorkflowComponentWithID, IWorkflowComponent {

private static final Log log = LogFactory.getLog(AbstractWorkflowComponent.class);
private static final Logger log = LoggerFactory.getLogger(AbstractWorkflowComponent.class);

/** The component's id */
private String componentID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
*******************************************************************************/
package org.eclipse.emf.mwe.core.lib;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.core.WorkflowComponentWithID;
import org.eclipse.emf.mwe.core.WorkflowContext;
import org.eclipse.emf.mwe.core.issues.IssuesImpl;
import org.eclipse.emf.mwe.core.issues.MWEDiagnostic;
import org.eclipse.emf.mwe.core.monitor.NullProgressMonitor;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author Sebastian Zarnekow - Initial contribution and API
*/
public class Mwe2Bridge {

private static final Log log = LogFactory.getLog(Mwe2Bridge.class);
private static final Logger log = LoggerFactory.getLogger(Mwe2Bridge.class);

private final WorkflowComponentWithID delegate;

public Mwe2Bridge(WorkflowComponentWithID delegate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import java.util.List;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.core.resources.ResourceLoader;
import org.eclipse.emf.mwe.internal.core.ast.parser.Location;
import org.eclipse.emf.mwe.internal.core.ast.parser.WorkflowParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DeclaredPropertyFileAST extends AbstractASTBase {
private final Log log = LogFactory.getLog(getClass());
private static final Logger log = LoggerFactory.getLogger(DeclaredPropertyFileAST.class);

private String file;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.core.issues.Issues;
import org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase;
import org.eclipse.emf.mwe.internal.core.ast.ComponentAST;
Expand All @@ -30,12 +28,14 @@
import org.eclipse.emf.mwe.internal.core.ast.InclusionAST;
import org.eclipse.emf.mwe.internal.core.ast.ReferenceAST;
import org.eclipse.emf.mwe.internal.core.ast.SimpleParamAST;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.helpers.DefaultHandler;

public class WorkflowParser extends DefaultHandler {
private static final Log log = LogFactory.getLog(WorkflowParser.class);
private static final Logger log = LoggerFactory.getLogger(WorkflowParser.class);

// reserved element names
public final static String PROPERTY = "property";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.emf.mwe.internal.core.ast.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.core.resources.ResourceLoader;
import org.eclipse.emf.mwe.core.resources.ResourceLoaderFactory;
import org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase;
Expand All @@ -22,10 +20,12 @@
import org.eclipse.emf.mwe.internal.core.ast.InclusionAST;
import org.eclipse.emf.mwe.internal.core.ast.ReferenceAST;
import org.eclipse.emf.mwe.internal.core.ast.SimpleParamAST;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class VisitorBase {

protected Log log = LogFactory.getLog(getClass());
protected Logger log = LoggerFactory.getLogger(getClass());

protected ResourceLoader loader = ResourceLoaderFactory.createResourceLoader();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import java.io.InterruptedIOException;
import java.util.ArrayList;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.internal.core.debug.communication.packages.AbstractPackage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* This Runnable listens for incoming packages asynchroniously and keeps them, until they are required by
Expand All @@ -26,7 +26,7 @@
public class PackageReceiver implements Runnable {
private final ArrayList<AbstractPackage> receivedPackages;

private static final Log logger = LogFactory.getLog(PackageReceiver.class);
private static final Logger logger = LoggerFactory.getLogger(PackageReceiver.class);

private final Connection connection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import java.io.InterruptedIOException;
import java.util.ArrayList;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.mwe.internal.core.debug.communication.packages.AbstractPackage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* This Runnable sends packages out asynchroniously as they arrive from customers.
Expand All @@ -26,7 +26,7 @@ public class PackageSender implements Runnable {

private final ArrayList<AbstractPackage> outgoingPackages;

private static final Log logger = LogFactory.getLog(PackageSender.class);
private static final Logger logger = LoggerFactory.getLogger(PackageSender.class);

private final Connection connection;

Expand Down
Loading

0 comments on commit 51ca8c9

Please sign in to comment.