Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/main/java/com/diffplug/spotless/ProcessRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
* calls to an external process.
*/
public class ProcessRunner implements AutoCloseable {
private final ExecutorService threadStdOut = Executors.newSingleThreadExecutor();
private final ExecutorService threadStdErr = Executors.newSingleThreadExecutor();
private final ExecutorService threadStdOut = /*~~>*/Executors.newSingleThreadExecutor();
private final ExecutorService threadStdErr = /*~~>*/Executors.newSingleThreadExecutor();
private final ByteArrayOutputStream bufStdOut;
private final ByteArrayOutputStream bufStdErr;

Expand Down
3 changes: 3 additions & 0 deletions rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ recipeList:
- org.openrewrite.java.format.NormalizeLineBreaks
- org.openrewrite.java.format.RemoveTrailingWhitespace
- org.openrewrite.java.migrate.UpgradeToJava17
- org.openrewrite.java.migrate.lang.FindVirtualThreadOpportunities
- org.openrewrite.java.migrate.lang.StringRulesRecipes
- org.openrewrite.java.migrate.util.JavaLangAPIs
- org.openrewrite.java.migrate.util.JavaUtilAPIs
- org.openrewrite.java.migrate.util.MigrateInflaterDeflaterToClose
- org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private String mavenHookContent(String resourcePath, ExecutorType executorType)

private void parallelRun(ThrowableRun runnable) {
IntStream.range(0, 5)
.mapToObj(i -> new Thread(() -> {
.mapToObj(i -> /*~~>*/new Thread(() -> {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

does this really make any difference?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, I don't think so.

I wonder if all that FindVirtualThreadOpportunities does is literally point out potential opportunities to adopt virtual threads, not actually migrate them.

Furthermore, I wonder if we still need to support versions of Java that don't have virtual threads.

Therefore, I'm inclined to remove this rule.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yup, we just upgraded our baseline to 17, it will be a while before our baseline is 21+

try {
runnable.run();
} catch (Exception e) {
Expand Down
Loading