diff --git a/core/src/main/java/de/jplag/Submission.java b/core/src/main/java/de/jplag/Submission.java
index 0fe8db33f..a0c002926 100644
--- a/core/src/main/java/de/jplag/Submission.java
+++ b/core/src/main/java/de/jplag/Submission.java
@@ -65,6 +65,8 @@ public class Submission implements Comparable
+ * Constructor for JTokenizationPass.
+ *
+ * cleanup.
+ *
- * Usages:
+ * Executes after the EOG is constructed, right before the TokenizationPass. Usages:
* reorderingEnabled
. If true, statements may be reordered.
+ * @param enabled value for reorderingEnabled.
+ */
public void setReorderingEnabled(boolean enabled) {
this.reorderingEnabled = enabled;
}
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/JavaCpgLanguage.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/JavaCpgLanguage.java
index b675d58f7..a121597a3 100644
--- a/languages/java-cpg/src/main/java/de/jplag/java_cpg/JavaCpgLanguage.java
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/JavaCpgLanguage.java
@@ -18,12 +18,15 @@
*/
@MetaInfServices(de.jplag.Language.class)
public class JavaCpgLanguage implements Language {
- public static final int DEFAULT_MINIMUM_TOKEN_MATCH = 9;
- public static final String[] FILE_EXTENSIONS = {".java"};
- public static final String NAME = "Java Code Property Graph module";
+ private static final int DEFAULT_MINIMUM_TOKEN_MATCH = 9;
+ private static final String[] FILE_EXTENSIONS = {".java"};
+ private static final String NAME = "Java Code Property Graph module";
private static final String IDENTIFIER = "java-cpg";
private final CpgAdapter cpgAdapter;
+ /**
+ * Creates a new {@link JavaCpgLanguage}.
+ */
public JavaCpgLanguage() {
this.cpgAdapter = new CpgAdapter(allTransformations());
}
@@ -69,6 +72,9 @@ public boolean requiresCoreNormalization() {
return false;
}
+ /**
+ * Resets the set of transformations to the obligatory transformations only.
+ */
public void resetTransformations() {
this.cpgAdapter.clearTransformations();
this.cpgAdapter.addTransformations(this.obligatoryTransformations());
@@ -87,12 +93,12 @@ private GraphTransformation[] obligatoryTransformations() {
* @return the array of recommended transformations
*/
public GraphTransformation[] standardTransformations() {
- return new GraphTransformation[] {removeOptionalOfCall, // 3
- removeOptionalGetCall, // 4
- moveConstantToOnlyUsingClass, // 6
- inlineSingleUseVariable, // 8
- removeLibraryRecord, // 11
- removeEmptyRecord, // 16
+ return new GraphTransformation[] {removeOptionalOfCall, // 1
+ removeOptionalGetCall, // 2
+ moveConstantToOnlyUsingClass, // 5
+ inlineSingleUseVariable, // 7
+ removeLibraryRecord, // 10
+ removeEmptyRecord, // 15
};
}
@@ -101,22 +107,22 @@ public GraphTransformation[] standardTransformations() {
* @return the array of all transformations
*/
public GraphTransformation[] allTransformations() {
- return new GraphTransformation[] {ifWithNegatedConditionResolution, // 1
- forStatementToWhileStatement, // 2
- removeOptionalOfCall, // 3
- removeOptionalGetCall, // 4
- removeGetterMethod, // 5
- moveConstantToOnlyUsingClass, // 6
- inlineSingleUseConstant, // 7
- inlineSingleUseVariable, // 8
- removeEmptyDeclarationStatement, // 9
- removeImplicitStandardConstructor, // 10
- removeLibraryRecord, // 11
- removeLibraryField, // 12
- removeEmptyConstructor, // 13
- removeUnsupportedConstructor, // 14
- removeUnsupportedMethod, // 15
- removeEmptyRecord, // 16
+ return new GraphTransformation[] {ifWithNegatedConditionResolution, // 0
+ forStatementToWhileStatement, // 1
+ removeOptionalOfCall, // 2
+ removeOptionalGetCall, // 3
+ removeGetterMethod, // 4
+ moveConstantToOnlyUsingClass, // 5
+ inlineSingleUseConstant, // 6
+ inlineSingleUseVariable, // 7
+ removeEmptyDeclarationStatement, // 8
+ removeImplicitStandardConstructor, // 9
+ removeLibraryRecord, // 10
+ removeLibraryField, // 11
+ removeEmptyConstructor, // 12
+ removeUnsupportedConstructor, // 13
+ removeUnsupportedMethod, // 14
+ removeEmptyRecord, // 15
};
}
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/passes/JTokenizationPass.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/passes/JTokenizationPass.java
new file mode 100644
index 000000000..b6be3f20e
--- /dev/null
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/passes/JTokenizationPass.java
@@ -0,0 +1,76 @@
+package de.jplag.java_cpg.passes;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
+
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import de.fraunhofer.aisec.cpg.TranslationContext;
+import de.fraunhofer.aisec.cpg.TranslationResult;
+import de.fraunhofer.aisec.cpg.graph.Name;
+import de.fraunhofer.aisec.cpg.helpers.SubgraphWalker;
+import de.fraunhofer.aisec.cpg.passes.TranslationResultPass;
+import de.jplag.Token;
+import de.jplag.TokenType;
+import de.jplag.java_cpg.token.CpgNodeListener;
+import de.jplag.java_cpg.token.CpgToken;
+import de.jplag.java_cpg.token.CpgTokenConsumer;
+import de.jplag.java_cpg.visitorStrategy.NodeOrderStrategy;
+
+/**
+ * This pass tokenizes the {@link de.fraunhofer.aisec.cpg.TranslationResult}. It is a duplicate of
+ * de.jplag.java_cpg.passes.TokenizationPass implemented in Java as a workaround to make JavaDoc work. If the package
+ * 'passes' contains only Kotlin files, JavaDoc fails.
+ */
+public class JTokenizationPass extends TranslationResultPass {
+
+ private static final Logger logger = LoggerFactory.getLogger(TokenizationPass.class);
+ private final ArrayList> callback = null;
+
+ /**
+ *
*
- *
(super)type of the parent node, specified by the incoming edge
* @param parent, NodePattern.RelatedNode parent,
- NodePattern.Related1ToNNode parent,
NodePattern.Related1ToNSequence super S, R> sourceRelated, NodePattern.Related1ToNSequence parent, NodePattern.RelatedNode
+ * Constructor for TransformationException.
+ * the attribute type
* @return the {@link PatternModification}
*/
- public static void handleSimpleRelationships(NodePattern source, NodePattern target, List Type of the source node, defined by the edge
- * @param void recurseSimple(NodePattern sourceRelated,
- NodePattern.RelatedNode targetRelated, List void handleSequenceRelationships(NodePattern source, NodePattern target, List void handleSimpleRelationships(NodePattern source, NodePattern target, List void recurseMulti(NodePattern sourceRelated, NodePattern.Related1ToNNode targetRelated, List sourceRelated, NodePattern.RelatedOneToNNode targetRelated, List.Any1ofNEdge incomingEdge = sourceRelated.edge().getAny1ofNEdgeTo(nextSource);
+ CpgMultiEdge.AnyOfNEdge incomingEdge = sourceRelated.edge().getAnyOfNEdgeTo(nextSource);
NodePattern extends R> nextTarget;
if (Objects.isNull(targetRelated)) {
@@ -359,27 +384,13 @@ private void recurseMulti(NodePatt
nextTarget = nextSource;
} else {
// R is guaranteed by the equal edge type
- NodePattern.Related1ToNNode target1ofN = (NodePattern.Related1ToNNode) targetRelated;
+ NodePattern.RelatedOneToNNode target1ofN = (NodePattern.RelatedOneToNNode) targetRelated;
nextTarget = target1ofN.pattern();
}
compare(nextSource, nextTarget, parent, ops, incomingEdge);
}
- private void handleSequenceRelationships(NodePattern source, NodePattern target, List void recurseSequence(NodePattern targetRelated,
List void recurseSequence(NodeP
}
}
- public GraphTransformation build() {
- return this.calculateTransformation();
+ /**
+ * Try to iterate into the related nodes.
+ * @param Type of the source node, defined by the edge
+ * @param void recurseSimple(NodePattern sourceRelated,
+ NodePattern.RelatedNode targetRelated, ListifWithNegatedConditionResolution
*/
public static final GraphTransformation ifWithNegatedConditionResolution = ifWithNegatedConditionResolution();
+ /** Constant forStatementToWhileStatement
*/
public static final GraphTransformation forStatementToWhileStatement = forStatementToWhileStatement();
+ /** Constant removeGetterMethod
*/
public static final GraphTransformation removeGetterMethod = removeGetterMethod();
+ /** Constant removeUnusedVariableDeclaration
*/
public static final GraphTransformation removeUnusedVariableDeclaration = removeUnusedVariableDeclaration();
+ /** Constant removeUnusedVariableDeclarationStatement
*/
public static final GraphTransformation removeUnusedVariableDeclarationStatement = removeUnusedVariableDeclarationStatement();
+ /** Constant removeEmptyDeclarationStatement
*/
public static final GraphTransformation removeEmptyDeclarationStatement = removeEmptyDeclarationStatement();
+ /** Constant removeLibraryRecord
*/
public static final GraphTransformation removeLibraryRecord = removeLibraryRecord();
+ /** Constant removeLibraryField
*/
public static final GraphTransformation removeLibraryField = removeLibraryField();
+ /** Constant moveConstantToOnlyUsingClass
*/
public static final GraphTransformation moveConstantToOnlyUsingClass = moveConstantToOnlyUsingClass();
+ /** Constant inlineSingleUseVariable
*/
public static final GraphTransformation inlineSingleUseVariable = inlineSingleUseVariable();
+ /** Constant inlineSingleUseConstant
*/
public static final GraphTransformation inlineSingleUseConstant = inlineSingleUseConstant();
+ /** Constant removeEmptyConstructor
*/
public static final GraphTransformation removeEmptyConstructor = removeEmptyConstructor();
+ /** Constant removeEmptyRecord
*/
public static final GraphTransformation removeEmptyRecord = removeEmptyRecord();
+ /** Constant removeImplicitStandardConstructor
*/
public static final GraphTransformation removeImplicitStandardConstructor = removeImplicitStandardConstructor();
+ /** Constant removeOptionalOfCall
*/
public static final GraphTransformation removeOptionalOfCall = removeOptionalOfCall();
+ /** Constant removeOptionalGetCall
*/
public static final GraphTransformation removeOptionalGetCall = removeOptionalGetCall();
+ /** Constant removeUnsupportedConstructor
*/
public static final GraphTransformation removeUnsupportedConstructor = removeUnsupportedConstructor();
+ /** Constant removeUnsupportedMethod
*/
public static final GraphTransformation removeUnsupportedMethod = removeUnsupportedMethod();
+ /** Constant wrapElseStatement
*/
public static final GraphTransformation wrapElseStatement = wrapElseStatement();
+ /** Constant wrapForStatement
*/
public static final GraphTransformation wrapForStatement = wrapForStatement();
+ /** Constant wrapThenStatement
*/
public static final GraphTransformation wrapThenStatement = wrapThenStatement();
+ /** Constant wrapWhileStatement
*/
public static final GraphTransformation wrapWhileStatement = wrapWhileStatement();
+ /** Constant wrapDoStatement
*/
public static final GraphTransformation wrapDoStatement = wrapDoStatement();
private TransformationRepository() {
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/CpgIsomorphismDetector.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/CpgIsomorphismDetector.java
index ce3085bfd..b0a2e400c 100644
--- a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/CpgIsomorphismDetector.java
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/CpgIsomorphismDetector.java
@@ -17,10 +17,16 @@
*/
public class CpgIsomorphismDetector {
- public static final Logger logger = LoggerFactory.getLogger(CpgIsomorphismDetector.class);
+ private static final Logger logger = LoggerFactory.getLogger(CpgIsomorphismDetector.class);
private TreeMap the source node type
+ * @param implements IEdge {
+ /**
+ * The {@link EdgeCategory} of the edge.
+ */
+ protected final EdgeCategory category;
+ private Class sourceClass;
+ private Class getSourceClass() {
+ return this.sourceClass;
+ }
+
+ /**
+ * Gets the target node class of this edge.
+ * @return the target node class
+ */
+ public Class sourceClass) {
+ this.sourceClass = sourceClass;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setTargetClass(Class The type of the source node
* @param implements IEdge {
+public class CpgEdge extends AEdge {
private final Function getter;
private final BiConsumer setter;
- private final EdgeCategory category;
- private Class fromClass;
- private Class implements IEdge {
* @param category the edge category
*/
public CpgEdge(Function getter, BiConsumer setter, EdgeCategory category) {
+ super(category);
this.getter = getter;
this.setter = setter;
- this.category = category;
}
+ /**
+ * Creates a new {@link CpgEdge} with a getter and setter for the target node.
+ * @param getter the getter
+ * @param setter the setter
+ */
public CpgEdge(Function getter, BiConsumer setter) {
this(getter, setter, AST);
}
- public static CpgEdge listValued(Function> getRhs, BiConsumer> setRhs) {
- return new CpgEdge<>(node -> getRhs.apply(node).get(0), (node, value) -> setRhs.accept(node, List.of(value)));
+ /**
+ * Creates a new list-valued {@link CpgEdge} with a getter and setter for the target node list.
+ * @param getter the getter
+ * @param setter the setter
+ * @param The type of the source node
+ * @param CpgEdge listValued(Function> getter, BiConsumer> setter) {
+ return new CpgEdge<>(node -> getter.apply(node).get(0), (node, value) -> setter.accept(node, List.of(value)));
}
/**
@@ -50,28 +60,18 @@ public T getRelated(S from) {
return getter.apply(from);
}
- @Override
- public void setFromClass(Class sClass) {
- this.fromClass = sClass;
- }
-
- @Override
- public void setToClass(Class getFromClass() {
- return fromClass;
- }
-
- public Class getter() {
return getter;
}
+ /**
+ * Gets the setter function of this {@link CpgEdge}, used to set the targets for a given source.
+ * @return the setter
+ */
public BiConsumer setter() {
return setter;
}
@@ -86,17 +86,4 @@ public boolean isEquivalentTo(IEdge, ?> other) {
return Objects.equals(this, other);
}
- @Override
- public boolean isAst() {
- return category == AST;
- }
-
- @Override
- public boolean isAnalytic() {
- return category == ANALYTIC;
- }
-
- public boolean isReference() {
- return category == REFERENCE;
- }
}
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgMultiEdge.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgMultiEdge.java
index 0788586e8..144b9d9ea 100644
--- a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgMultiEdge.java
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgMultiEdge.java
@@ -1,6 +1,6 @@
package de.jplag.java_cpg.transformation.matching.edges;
-import static de.jplag.java_cpg.transformation.matching.edges.IEdge.EdgeCategory.ANALYTIC;
+import static de.jplag.java_cpg.transformation.matching.edges.CpgMultiEdge.ValueType.NODE_VALUED;
import static de.jplag.java_cpg.transformation.matching.edges.IEdge.EdgeCategory.AST;
import java.util.HashMap;
@@ -19,33 +19,28 @@
* @param The type of the source node
* @param implements IEdge {
+public final class CpgMultiEdge extends AEdge {
private final Function> getter;
private final Function>> getEdges;
- private final EdgeCategory category;
private final TriConsumer setter;
- private final boolean edgeValued;
- private Class fromClass;
- private Class> getter, TriConsumer setter, boolean edgeValued,
+ public CpgMultiEdge(Function> getter, TriConsumer setter, ValueType valueType,
Function>> getEdges, EdgeCategory category) {
+ super(category);
this.getter = getter;
this.setter = setter;
- // TODO: Model edgeValued as enum {NODE, EDGE} instead?
- this.edgeValued = edgeValued;
+ this.valueType = valueType;
this.getEdges = getEdges;
- this.category = category;
this.any1ofNEdges = new HashMap<>();
}
@@ -61,24 +56,40 @@ public static CpgMultiEdge edgeValued(Fun
return edgeValued(getter, AST);
}
+ /**
+ * A shorthand to create an edge-valued {@link CpgMultiEdge}.
+ * @param getter a function to get all the edges
+ * @param category the category of the edge
+ * @param The type of the source node
+ * @param CpgMultiEdge edgeValued(Function>> getter, EdgeCategory category) {
Function> getNodes = (S node) -> getter.apply(node).stream().map(PropertyEdge::getEnd).toList();
TriConsumer setOne = (S node, Integer n, T value) -> getter.apply(node).get(n).setEnd(value);
- return new CpgMultiEdge<>(getNodes, setOne, true, getter, category);
+ return new CpgMultiEdge<>(getNodes, setOne, ValueType.EDGE_VALUED, getter, category);
}
/**
* A shorthand to create a node-valued {@link CpgMultiEdge}.
* @param getter a function to get all the nodes
+ * @param category the edge category
* @param The type of the source node
* @param CpgMultiEdge nodeValued(Function> getter, EdgeCategory category) {
TriConsumer setOne = (S node, Integer n, T value) -> getter.apply(node).set(n, value);
- return new CpgMultiEdge<>(getter, setOne, false, null, category);
+ return new CpgMultiEdge<>(getter, setOne, NODE_VALUED, null, category);
}
+ /**
+ * A shorthand to create a node-valued AST {@link CpgMultiEdge}.
+ * @param getter a function to get all the nodes
+ * @param The type of the source node
+ * @param CpgMultiEdge nodeValued(Function> getter) {
return nodeValued(getter, AST);
}
@@ -92,32 +103,29 @@ public List getFromClass() {
- return this.fromClass;
- }
-
- public void setFromClass(Class sClass) {
- this.fromClass = sClass;
- }
-
- public Class> getter() {
return getter;
}
+ /**
+ * Gets the setter function of this multi edge.
+ * @return a {@link TriConsumer} object
+ */
public TriConsumer setter() {
return setter;
}
- public .Any1ofNEdge getAny1ofNEdgeTo(NodePattern extends R> pattern) {
- return (CpgMultiEdge.Any1ofNEdge) this.any1ofNEdges.computeIfAbsent(pattern, p -> new Any1ofNEdge());
+ /**
+ * Gets a {@link AnyOfNEdge} from this {@link CpgMultiEdge} directed at the given {@link NodePattern}.
+ * @param pattern the pattern
+ * @return the 'any of n' edge
+ */
+ public CpgMultiEdge.AnyOfNEdge getAnyOfNEdgeTo(NodePattern extends T> pattern) {
+ return this.any1ofNEdges.computeIfAbsent(pattern, p -> new AnyOfNEdge());
}
/**
@@ -125,9 +133,10 @@ public .Any1ofNEdge getAny1of
* @return true if this edge is edge-valued, false if this edge is node-valued.
*/
public boolean isEdgeValued() {
- return edgeValued;
+ return this.valueType == ValueType.EDGE_VALUED;
}
+ /** {@inheritDoc} */
@Override
public boolean isEquivalentTo(IEdge, ?> other) {
return Objects.equals(this, other);
@@ -142,31 +151,43 @@ public List {
+ public class AnyOfNEdge extends CpgNthEdge {
- public Any1ofNEdge() {
+ /**
+ * Creates a new {@link AnyOfNEdge} for the corresponding {@link CpgMultiEdge}.
+ */
+ public AnyOfNEdge() {
super(CpgMultiEdge.this, -1);
}
+ /**
+ * Gets the corresponding {@link CpgMultiEdge}.
+ * @return the multi edge
+ */
public CpgMultiEdge getMultiEdge() {
return CpgMultiEdge.this;
}
}
+
+ /**
+ * Describes the type of connection between nodes via an edge.
+ */
+ public enum ValueType {
+ /**
+ * An edge where the targets can be accessed directly as nodes.
+ */
+ NODE_VALUED,
+ /**
+ * An edge where the target can be accessed via {@link PropertyEdge}s.
+ */
+ EDGE_VALUED,
+ /**
+ * An edge where the target is a List of nodes.
+ */
+ LIST_VALUED
+ }
}
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgNthEdge.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgNthEdge.java
index 7a6ba339b..02a0cc7ba 100644
--- a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgNthEdge.java
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/CpgNthEdge.java
@@ -5,6 +5,8 @@
/**
* A {@link CpgNthEdge} represents an individual {@link de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge} out of a
* {@link CpgMultiEdge}.
+ * @param source node type
+ * @param extends CpgEdge {
private final CpgMultiEdge multiEdge;
@@ -19,8 +21,8 @@ public CpgNthEdge(CpgMultiEdge edge, int index) {
super(t -> edge.getAllTargets(t).get(index), (t, r) -> edge.setter().accept(t, index, r), edge.getCategory());
this.multiEdge = edge;
this.index = index;
- this.setFromClass(edge.getFromClass());
- this.setToClass(edge.getToClass());
+ this.setSourceClass(edge.getSourceClass());
+ this.setTargetClass(edge.getTargetClass());
}
@Override
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/EdgeUtil.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/EdgeUtil.java
index ddd572498..070e02001 100644
--- a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/EdgeUtil.java
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/edges/EdgeUtil.java
@@ -1,5 +1,7 @@
package de.jplag.java_cpg.transformation.matching.edges;
+import java.util.Objects;
+
import org.jetbrains.annotations.NotNull;
import de.fraunhofer.aisec.cpg.graph.Node;
@@ -14,13 +16,21 @@ public final class EdgeUtil {
private EdgeUtil() {
}
- public static void register(IEdge edge, Class sClass, Class void register(IEdge edge,
/**
* Gets the list of edges with the given node class as target.
* @param tClass the target node class
- * @return the list of edges
* @param
- * @param the source node type
+ * @param {
+
/**
* Sets the class object representing the source {@link Node} type.
- * @param sClass the source {@link Node} class
+ * @param sourceClass the source {@link Node} class
*/
- void setFromClass(Class sClass);
+ void setSourceClass(Class sourceClass);
/**
* Sets the class object representing the target {@link Node} type.
- * @param tClass the target {@link Node} class
+ * @param targetClass the target {@link Node} class
*/
- void setToClass(Class getFromClass();
+ Class getSourceClass();
/**
* Gets the class object representing the target {@link Node} type.
* @return the target {@link Node} class
*/
- Class {
*/
boolean isEquivalentTo(IEdge, ?> other);
+ /**
+ * If true, this is an {@link EdgeCategory#AST} edge.
+ * @return true iff this is an AST edge
+ */
boolean isAst();
+ /**
+ * If true, this is an {@link EdgeCategory#ANALYTIC} edge.
+ * @return true iff this is an analytic edge
+ */
boolean isAnalytic();
+ /**
+ * If true, this is an {@link EdgeCategory#REFERENCE} edge.
+ * @return true iff this is a reference edge
+ */
+ boolean isReference();
+
enum EdgeCategory {
+ /**
+ * An edge that represents the inherent structure of the code.
+ */
AST,
+
+ /**
+ * An edge that represents that nodes are connected by reference (e.g. method call -> method definition).
+ */
REFERENCE,
+
+ /**
+ * An edge that represents a connection that is the result of a calculation. These edges can never be set.
+ */
ANALYTIC
}
}
diff --git a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/pattern/GraphPattern.java b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/pattern/GraphPattern.java
index 94e1a98eb..fa7752381 100644
--- a/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/pattern/GraphPattern.java
+++ b/languages/java-cpg/src/main/java/de/jplag/java_cpg/transformation/matching/pattern/GraphPattern.java
@@ -30,6 +30,10 @@ public interface GraphPattern {
/**
* Adds a newly created {@link NodePattern} to this pattern. This occurs when a {@link GraphTransformation} includes the
* generation of new {@link Node}s.
+ * @param roleName a {@link String} object
+ * @param newNode a {@link NodePattern} object
+ * @param PatternModification equalAttributes(CpgPropertyEdge propertyEdge, String otherId) {
+ public static