Skip to content

Bug: J2S compiler not activated on Linux/macOS (Wrong ".J2S" file name)#54

Merged
BobHanson merged 1 commit into
java2script:masterfrom
abego:wrong_dotj2s_literal
Jul 22, 2018
Merged

Bug: J2S compiler not activated on Linux/macOS (Wrong ".J2S" file name)#54
BobHanson merged 1 commit into
java2script:masterfrom
abego:wrong_dotj2s_literal

Conversation

@abego

@abego abego commented Jul 22, 2018

Copy link
Copy Markdown
Contributor

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.java

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.java
@abego abego requested a review from BobHanson July 22, 2018 09:25
@BobHanson BobHanson merged commit f7f45d6 into java2script:master Jul 22, 2018
@BobHanson

Copy link
Copy Markdown
Collaborator

merged, along with change in yadav1. BobHanson/java2script:[master,yadav1], java2script/java2script:master should be synchronized.

BobHanson added a commit that referenced this pull request Aug 20, 2018
hansonr hansonr
$width should be width
d59d845
hansonr hansonr
unnecessary java.lang. removed
b806140
hansonr hansonr
// BH 8/19/2017 3.2.2.04 fixes Enum .name being .$name
c333bc7
hansonr hansonr
extraneous java.lang.; upgrade of JSSAXParser and SAXParserFactory
de539d2
hansonr hansonr
// BH 8/19/2018 -- refactored to simplify $finals$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants