Skip to content

Commit 49415c9

Browse files
committed
Clean up.
1 parent a83e860 commit 49415c9

File tree

1 file changed

+22
-23
lines changed
  • edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis

1 file changed

+22
-23
lines changed

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

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,19 @@ protected InstanceKey computeInstanceKey(Collection<InstanceKey> trackedInstance
311311
"Can't find instance key for: " + this.getCreation() + " using tracked instances: " + trackedInstances);
312312
}
313313

314+
protected void convertToParallel(CompilationUnitRewrite rewrite) {
315+
LOGGER.info("Converting to parallel.");
316+
MethodInvocation creation = this.getCreation();
317+
ASTRewrite astRewrite = rewrite.getASTRewrite();
318+
SimpleName newMethodName = creation.getAST().newSimpleName("parallelStream");
319+
astRewrite.replace(creation.getName(), newMethodName, null);
320+
}
321+
322+
protected void convertToSequential(CompilationUnitRewrite rewrite) {
323+
// TODO Auto-generated method stub
324+
LOGGER.info("Converting to sequential.");
325+
}
326+
314327
public Set<TransformationAction> getActions() {
315328
if (this.actions != null)
316329
return Collections.unmodifiableSet(this.actions);
@@ -772,38 +785,24 @@ public String toString() {
772785
return builder.toString();
773786
}
774787

775-
protected void convertToParallel(CompilationUnitRewrite rewrite) {
776-
LOGGER.info("Converting to parallel.");
777-
MethodInvocation creation = this.getCreation();
778-
ASTRewrite astRewrite = rewrite.getASTRewrite();
779-
SimpleName newMethodName = creation.getAST().newSimpleName("parallelStream");
780-
astRewrite.replace(creation.getName(), newMethodName, null);
781-
}
782-
783-
protected void convertToSequential(CompilationUnitRewrite rewrite) {
784-
// TODO Auto-generated method stub
785-
LOGGER.info("Converting to sequential.");
786-
}
787-
788-
protected void unorder(CompilationUnitRewrite rewrite) {
789-
// TODO Auto-generated method stub
790-
LOGGER.info("Unordering.");
791-
}
792-
793788
public void transform(CompilationUnitRewrite rewrite) {
794789
// for each stream transformation.
795-
for (TransformationAction action : getActions()) {
790+
for (TransformationAction action : this.getActions())
796791
switch (action) {
797792
case CONVERT_TO_PARALLEL:
798-
convertToParallel(rewrite);
793+
this.convertToParallel(rewrite);
799794
break;
800795
case CONVERT_TO_SEQUENTIAL:
801-
convertToSequential(rewrite);
796+
this.convertToSequential(rewrite);
802797
break;
803798
case UNORDER:
804-
unorder(rewrite);
799+
this.unorder(rewrite);
805800
break;
806801
}
807-
}
802+
}
803+
804+
protected void unorder(CompilationUnitRewrite rewrite) {
805+
// TODO Auto-generated method stub
806+
LOGGER.info("Unordering.");
808807
}
809808
}

0 commit comments

Comments
 (0)