Skip to content

Commit 50f144d

Browse files
committed
Merge branch 'saledouble-master_add_entry_point'
2 parents e352a39 + bd03890 commit 50f144d

File tree

5 files changed

+383
-314
lines changed

5 files changed

+383
-314
lines changed

edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis/StreamAnalyzer.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ private static void addImplicitEntryPoints(Collection<Entrypoint> target, Iterab
5555
*/
5656
private Map<EclipseProjectAnalysisEngine<InstanceKey>, Collection<Entrypoint>> enginesWithBuiltCallGraphsToEntrypointsUsed = new HashMap<>();
5757

58+
private boolean findImplicitBenchmarkEntryPoints;
59+
5860
private boolean findImplicitEntryPoints = true;
5961

6062
private boolean findImplicitTestEntryPoints;
@@ -74,9 +76,11 @@ public StreamAnalyzer(boolean visitDocTags, boolean findImplicitEntryPoints) {
7476
this.findImplicitEntryPoints = findImplicitEntryPoints;
7577
}
7678

77-
public StreamAnalyzer(boolean visitDocTags, boolean findImplicitEntryPoints, boolean findImplicitTestEntryPoints) {
79+
public StreamAnalyzer(boolean visitDocTags, boolean findImplicitEntryPoints, boolean findImplicitTestEntryPoints,
80+
boolean findImplicitBenchmarkEntryPoints) {
7881
this(visitDocTags, findImplicitEntryPoints);
7982
this.findImplicitTestEntryPoints = findImplicitTestEntryPoints;
83+
this.findImplicitBenchmarkEntryPoints = findImplicitBenchmarkEntryPoints;
8084
}
8185

8286
/**
@@ -202,6 +206,14 @@ protected Collection<Entrypoint> buildCallGraph(EclipseProjectAnalysisEngine<Ins
202206
addImplicitEntryPoints(entryPoints, jUnitEntryPoints);
203207
}
204208

209+
if (this.findImplicitBenchmarkEntryPoints) {
210+
// try to find benchmark entry points.
211+
Set<Entrypoint> benchmarkEntryPoints = Util.findBenchmarkEntryPoints(engine.getClassHierarchy());
212+
213+
// add them as well.
214+
addImplicitEntryPoints(entryPoints, benchmarkEntryPoints);
215+
}
216+
205217
if (entryPoints.isEmpty()) {
206218
LOGGER.warning(() -> "Project: " + engine.getProject().getElementName() + " has no entry points.");
207219
return entryPoints;

0 commit comments

Comments
 (0)