|
67 | 67 | import static com.oracle.graal.python.util.PythonUtils.toTruffleStringUncached;
|
68 | 68 | import static com.oracle.graal.python.util.PythonUtils.tsLiteral;
|
69 | 69 |
|
70 |
| -import java.io.File; |
71 | 70 | import java.io.IOException;
|
72 | 71 | import java.io.InputStreamReader;
|
73 | 72 | import java.io.PrintWriter;
|
74 | 73 | import java.lang.management.ManagementFactory;
|
75 | 74 | import java.lang.reflect.Method;
|
76 | 75 | import java.nio.charset.StandardCharsets;
|
77 |
| -import java.nio.file.Files; |
78 |
| -import java.nio.file.InvalidPathException; |
79 |
| -import java.nio.file.Path; |
80 |
| -import java.nio.file.Paths; |
81 | 76 | import java.util.Arrays;
|
82 | 77 | import java.util.List;
|
83 | 78 | import java.util.logging.Level;
|
@@ -642,7 +637,7 @@ private static int which() {
|
642 | 637 | if (path != null) {
|
643 | 638 | for (int i = 0; i < C_COMPILER_PRECEDENCE.length; i++) {
|
644 | 639 | int last = 0;
|
645 |
| - for (int j = path.indexOf(File.pathSeparatorChar); j != -1; j = path.indexOf(File.pathSeparatorChar, last)) { |
| 640 | + for (int j = path.indexOf(env.getPathSeparator()); j != -1; j = path.indexOf(env.getPathSeparator(), last)) { |
646 | 641 | try {
|
647 | 642 | if (env.getPublicTruffleFile(path.substring(last, j)).resolve(C_COMPILER_PRECEDENCE[i]).isExecutable()) {
|
648 | 643 | return i;
|
@@ -912,6 +907,7 @@ TruffleString doit(VirtualFrame frame,
|
912 | 907 | @Builtin(name = "java_assert", minNumOfPositionalArgs = 0)
|
913 | 908 | @GenerateNodeFactory
|
914 | 909 | abstract static class JavaAssertNode extends PythonBuiltinNode {
|
| 910 | + @SuppressWarnings("all") |
915 | 911 | @Specialization
|
916 | 912 | Object doit() {
|
917 | 913 | boolean assertOn = false;
|
@@ -1027,7 +1023,7 @@ abstract static class GetPythonHomePaths extends PythonBuiltinNode {
|
1027 | 1023 | @Specialization
|
1028 | 1024 | TruffleString get() {
|
1029 | 1025 | PythonContext context = getContext();
|
1030 |
| - TruffleString sep = TruffleString.fromJavaStringUncached(File.pathSeparator, TS_ENCODING); |
| 1026 | + TruffleString sep = TruffleString.fromJavaStringUncached(context.getEnv().getPathSeparator(), TS_ENCODING); |
1031 | 1027 | return context.getStdlibHome().concatUncached(sep, TS_ENCODING, false).concatUncached(context.getCoreHome(), TS_ENCODING, false);
|
1032 | 1028 | }
|
1033 | 1029 | }
|
@@ -1106,6 +1102,7 @@ Object foreignNumberList(Object number) {
|
1106 | 1102 | return new ForeignNumberList(number);
|
1107 | 1103 | }
|
1108 | 1104 |
|
| 1105 | + @SuppressWarnings("static-method") |
1109 | 1106 | @ExportLibrary(value = InteropLibrary.class, delegateTo = "number")
|
1110 | 1107 | static final class ForeignNumberList implements TruffleObject {
|
1111 | 1108 | final Object number;
|
@@ -1150,7 +1147,7 @@ Object foreignWrapper(Object object) {
|
1150 | 1147 | return new ForeignWrapper(object);
|
1151 | 1148 | }
|
1152 | 1149 |
|
1153 |
| - @SuppressWarnings("unused") |
| 1150 | + @SuppressWarnings({"unused", "static-method"}) |
1154 | 1151 | @ExportLibrary(value = InteropLibrary.class, delegateTo = "object")
|
1155 | 1152 | static final class ForeignWrapper implements TruffleObject {
|
1156 | 1153 | final Object object;
|
|
0 commit comments