Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.TypeReference;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;

class OrderingInference {

private Objenesis objenesis = new ObjenesisStd();

private IClassHierarchy classHierarchy;

private static final Logger LOGGER = Logger.getGlobal();
private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

public OrderingInference(IClassHierarchy classHierarchy) {
this.classHierarchy = classHierarchy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.CancelException;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;
import edu.cuny.hunter.streamrefactoring.core.utils.Util;
import edu.cuny.hunter.streamrefactoring.core.wala.EclipseProjectAnalysisEngine;

Expand All @@ -83,7 +84,7 @@ public class Stream {

private static Map<IJavaProject, IClassHierarchy> javaProjectToClassHierarchyMap = new HashMap<>();

private static final Logger LOGGER = Logger.getLogger("edu.cuny.hunter.streamrefactoring");
private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

private static Map<MethodDeclaration, IR> methodDeclarationToIRMap = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
import com.ibm.wala.shrikeCT.InvalidClassFileException;
import com.ibm.wala.util.CancelException;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;

@SuppressWarnings("restriction")
public class StreamAnalysisVisitor extends ASTVisitor {
private Set<Stream> streamSet = new HashSet<>();

private static final Logger logger = Logger.getLogger("edu.cuny.hunter.streamrefactoring");
private static final Logger logger = Logger.getLogger(Packages.streamRefactoring);

public StreamAnalysisVisitor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@

import edu.cuny.hunter.streamrefactoring.core.safe.ModifiedBenignOracle;
import edu.cuny.hunter.streamrefactoring.core.safe.TypestateSolverFactory;
import edu.cuny.hunter.streamrefactoring.core.utils.Packages;
import edu.cuny.hunter.streamrefactoring.core.wala.CallStringWithReceivers;
import edu.cuny.hunter.streamrefactoring.core.wala.EclipseProjectAnalysisEngine;

class StreamStateMachine {

private static final Logger LOGGER = Logger.getGlobal();
private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

/**
* A list of stateful intermediate operation signatures.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@
import com.ibm.wala.util.strings.Atom;
import com.ibm.wala.util.strings.StringStuff;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;

public final class Util {

private static final Logger LOGGER = Logger.getGlobal();
private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

private static final class CorrespondingASTVisitor extends ASTVisitor {
private CompilationUnit unit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
import com.ibm.wala.ipa.callgraph.propagation.PointerAnalysis;
import com.ibm.wala.ssa.SSAInvokeInstruction;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;

public class InstructionBasedSolver extends TrackingUniqueSolver {

private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

private SSAInvokeInstruction instruction;

Expand All @@ -38,7 +42,7 @@ protected Collection<InstanceKey> computeTrackedInstances() throws PropertiesExc
Collection<InstanceKey> trackedInstancesByType = this.computeTrackedInstancesByType();

for (InstanceKey instanceKey : trackedInstancesByType) {
Logger.getGlobal().info("Examining instance: " + instanceKey);
LOGGER.info("Examining instance: " + instanceKey);
if (Util.instanceKeyCorrespondsWithInstantiationInstruction(instanceKey, this.getInstruction(),
this.getCallGraph()))
ret.add(instanceKey);
Expand All @@ -47,7 +51,7 @@ protected Collection<InstanceKey> computeTrackedInstances() throws PropertiesExc
if (ret.size() != 1)
throw new IllegalStateException("Tracking more or less than one instance: " + ret.size());

Logger.getGlobal().info("Tracking: " + ret);
LOGGER.info("Tracking: " + ret);
this.setTrackedInstances(ret);
return ret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.util.collections.Pair;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;

public class ModifiedBenignOracle extends BenignOracle {

private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

public ModifiedBenignOracle(CallGraph callGraph, PointerAnalysis<?> pointerAnalysis) {
super(callGraph, pointerAnalysis);
}

@Override
public void addBenignInstanceKey(InstanceKey ik) {
Logger.getGlobal().info(() -> "Was requested to ignore \"benign\" instance with key: " + ik);
LOGGER.info(() -> "Was requested to ignore \"benign\" instance with key: " + ik);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package edu.cuny.hunter.streamrefactoring.core.utils;

public class Packages {
Copy link
Member

Choose a reason for hiding this comment

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

What is a package?

public final static String streamRefactoring = "edu.cuny.hunter.streamrefactoring";
Copy link
Member

Choose a reason for hiding this comment

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

How about something like LOGGER_NAME?

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.config.FileOfClasses;

import edu.cuny.hunter.streamrefactoring.core.utils.Packages;

/**
* Modified from EclipseAnalysisEngine.java, originally from Keshmesh. Authored
* by Mohsen Vakilian and Stas Negara. Modified by Nicholas Chen and Raffi
Expand All @@ -40,7 +42,7 @@
*/
public class EclipseProjectAnalysisEngine<I extends InstanceKey> extends JDTJavaSourceAnalysisEngine<I> {

private static final Logger LOGGER = Logger.getGlobal();
private static final Logger LOGGER = Logger.getLogger(Packages.streamRefactoring);

/**
* The N value used to create the {@link nCFABuilder}.
Expand Down