Wrote /root/JavaX-Caches/tmp_2092781667/main.java - 536 bytes (written=536, should be 536) javac=0, ecj=1, useJarBot=0 Checking ECJ at port 4898 at 127.0.0.1 /root/jdk-17/bin/javac -source 11 -target 11 -nowarn -encoding utf8 -Xdiags:verbose -cp /root/.javax/x30.jar:/root/dexcompiler/android.jar:/root/dexcompiler/support-v4-22.2.1.jar:/root/javafx/javafx.base.jar:/root/javafx/javafx.graphics.jar:/root/javafx/javafx.swing.jar -d /root/JavaX-Caches/tmp_1293606839 /root/JavaX-Caches/tmp_2092781667/main.java 2>&1
[Compilation Error]

Compiler errors. Medium transpile. Show Java sources. Show snippet. Edit.

/root/JavaX-Caches/tmp_2092781667/main.java:2: error: class, interface, or enum expected static Pair<Float, Float> bwCentroid(BWImage img, bool dark) { ^ /root/JavaX-Caches/tmp_2092781667/main.java:4: error: class, interface, or enum expected double sumX = 0, sumY = 0; ^ /root/JavaX-Caches/tmp_2092781667/main.java:5: error: class, interface, or enum expected double midX = (w-1)/2.0, midY = (h-1)/2.0; // optimized for odd image dimensions ^ /root/JavaX-Caches/tmp_2092781667/main.java:6: error: class, interface, or enum expected for y to h: for x to w: { ^ /root/JavaX-Caches/tmp_2092781667/main.java:8: error: class, interface, or enum expected if (dark) weight = 1-weight; ^ /root/JavaX-Caches/tmp_2092781667/main.java:9: error: class, interface, or enum expected sumX += weight*(x-midX); ^ /root/JavaX-Caches/tmp_2092781667/main.java:10: error: class, interface, or enum expected sumY += weight*(y-midY); ^ /root/JavaX-Caches/tmp_2092781667/main.java:11: error: class, interface, or enum expected } ^ /root/JavaX-Caches/tmp_2092781667/main.java:13: error: class, interface, or enum expected ret new Pair((float) (midX+sumX/baseX), (float) (midY+sumY/baseY)); ^ /root/JavaX-Caches/tmp_2092781667/main.java:14: error: class, interface, or enum expected } ^ 10 errors