Commit 7622dc6
committed
Bug: J2S compiler not activated on Linux/macOS (Wrong ".J2S" file name)
Cause
=====
In Java2ScriptCompiler the literals ".J2S" and ".j2s" are used as names
for the J2S compiler options file (the "dot-j2s" file). The literals
only differ in the case of the letters.
On Windows both literals ".J2S" and ".j2s" denote the same file. However
on other operating systems (like Linux and macOS) the two literals (can)
identify two different files. This is because these operating
system have (or can have) case-sensitive file systems.
As a consequence adding a file ".j2s" (with lower case letters) to a
project will not activate the J2S compiler on Linux and macOS because
the compiler's "isActive" method checks for the file ".J2S" (with upper
case letters) and does not find such a file.
Solution
========
Always use one unique name for the J2S compiler options file (".j2s"),
accessible through constant `Java2ScriptCompiler.J2S_OPTIONS_FILE_NAME`.
Also
====
- fix "unused import" warnings in Java2ScriptCompiler.java1 parent 4c08840 commit 7622dc6
File tree
1 file changed
+8
-10
lines changed- sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler
1 file changed
+8
-10
lines changedLines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
| |||
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
45 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
86 | | - | |
87 | | - | |
| 84 | + | |
| 85 | + | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
| |||
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
144 | | - | |
| 142 | + | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| |||
0 commit comments