Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the log4j security issues #126

Merged
merged 6 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions atomic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@

<!-- external compile dependencies -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
Expand All @@ -30,7 +31,7 @@
import tools.vitruv.change.atomic.hid.internal.HierarchicalIdResolver;

class UuidResolverImpl implements UuidResolver {
static private final Logger LOGGER = Logger.getLogger(UuidResolverImpl.class);
static private final Logger LOGGER = LogManager.getLogger(UuidResolverImpl.class);
private static final String NON_READONLY_PREFIX = "ord_";

private static final String SERIALIZATION_SEPARATOR = "|";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package tools.vitruv.change.atomic.command.internal

import edu.kit.ipd.sdq.activextendannotations.Utility
import java.util.List
import org.apache.log4j.Logger
import org.apache.logging.log4j.Logger
import org.apache.logging.log4j.LogManager
import org.eclipse.emf.common.command.Command
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.edit.command.AddCommand
Expand Down Expand Up @@ -31,7 +32,7 @@ import static extension tools.vitruv.change.atomic.command.internal.ChangeComman
*/
@Utility
package class ApplyBackwardCommandSwitch {
static val Logger logger = Logger.getLogger(ApplyBackwardCommandSwitch)
static val Logger logger = LogManager.getLogger(ApplyBackwardCommandSwitch)

def package dispatch static List<Command> getCommands(EChange<EObject> change) {
#[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package tools.vitruv.change.atomic.command.internal

import edu.kit.ipd.sdq.activextendannotations.Utility
import java.util.List
import org.apache.log4j.Logger
import org.apache.logging.log4j.Logger
import org.apache.logging.log4j.LogManager
import org.eclipse.emf.common.command.Command
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.edit.command.AddCommand
Expand Down Expand Up @@ -30,7 +31,7 @@ import static extension tools.vitruv.change.atomic.command.internal.ChangeComman
*/
@Utility
package class ApplyForwardCommandSwitch {
static val Logger logger = Logger.getLogger(ApplyForwardCommandSwitch)
static val Logger logger = LogManager.getLogger(ApplyForwardCommandSwitch)

def package dispatch static List<Command> getCommands(EChange<EObject> change) {
#[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package tools.vitruv.change.atomic.hid.internal
import com.google.common.collect.BiMap
import com.google.common.collect.HashBiMap
import java.util.PriorityQueue
import org.apache.log4j.Logger
import org.apache.logging.log4j.Logger
import org.apache.logging.log4j.LogManager
import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.resource.ResourceSet
Expand All @@ -20,7 +21,7 @@ import static extension tools.vitruv.change.atomic.hid.ObjectResolutionUtil.getH
* {@link HierarchicalIdResolver}
*/
class HierarchicalIdResolverImpl implements HierarchicalIdResolver {
static val logger = Logger.getLogger(HierarchicalIdResolverImpl)
static val logger = LogManager.getLogger(HierarchicalIdResolverImpl)
static val CACHE_PREFIX = "cache:/"

val ResourceSet resourceSet
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should probably be excluded or do we really need it?

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies to the generated code in src-gen, do we really need that in the repo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Maven build generates all files to the target folder and the remaining steps of the build (e.g., Java compiler) only pick up files from there. We can add the directories to the .gitignore file, but there is really no point in using them, unless the entire build is done by Eclipse.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
*/
package tools.vitruv.change.atomic;


/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Additive EChange</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* *
* Abstract EChange which adds a new value, like an EObject or primitive type.
* <!-- end-model-doc -->
*
*
* @see tools.vitruv.change.atomic.AtomicPackage#getAdditiveEChange()
* @model abstract="true" ElementBounds="org.eclipse.emf.ecore.EJavaObject" ValueBounds="org.eclipse.emf.ecore.EJavaObject"
* @generated
*/
public interface AdditiveEChange<Element extends Object, Value extends Object> extends EChange<Element>
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* *
* Get the added value.
* @return The newly added value.
* <!-- end-model-doc -->
* @model kind="operation" required="true"
* @generated
*/
Value getNewValue();

} // AdditiveEChange
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
*/
package tools.vitruv.change.atomic;

import org.eclipse.emf.ecore.EFactory;

/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see tools.vitruv.change.atomic.AtomicPackage
* @generated
*/
public interface AtomicFactory extends EFactory
{
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
AtomicFactory eINSTANCE = tools.vitruv.change.atomic.impl.AtomicFactoryImpl.init();

/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
AtomicPackage getAtomicPackage();

} //AtomicFactory
Loading
Loading