Skip to content

Commit 08c7515

Browse files
hansonrhansonr
authored andcommitted
aesthetics only
1 parent 5df8858 commit 08c7515

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

dist/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SwingJS distribution README.txt
22

3-
See https://github.com/BobHanson/java2script/tree/master/sources/net.sf.j2s.core/dist
3+
See https://github.com/BobHanson/java2script/tree/master/sources/net.sf.j2s.core/dist/README.txt

sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptCompiler.java

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
* @author Bob Hanson
3333
*
3434
*/
35-
public class Java2ScriptCompiler {
35+
class Java2ScriptCompiler {
3636
/**
3737
* The name of the J2S options file, aka as the "Dot-j2s" file.
3838
*/
39-
public static final String J2S_OPTIONS_FILE_NAME = ".j2s";
39+
private static final String J2S_OPTIONS_FILE_NAME = ".j2s";
4040

4141
// BH: added "true".equals(getProperty(props,
4242
// "j2s.compiler.allow.compression")) to ensure compression only occurs when
@@ -77,15 +77,15 @@ public class Java2ScriptCompiler {
7777

7878
private IJavaProject project;
7979

80-
public static boolean isActive(IJavaProject project) {
80+
static boolean isActive(IJavaProject project) {
8181
try {
8282
return new File(project.getProject().getLocation().toOSString(), J2S_OPTIONS_FILE_NAME).exists();
8383
} catch (@SuppressWarnings("unused") Exception e) {
8484
return false;
8585
}
8686
}
8787

88-
public Java2ScriptCompiler() {
88+
Java2ScriptCompiler() {
8989
// initialized only once using CompilationParticipant; every time using
9090
// older Builder idea
9191
}
@@ -94,7 +94,7 @@ public Java2ScriptCompiler() {
9494
* only for CompilationParticipant
9595
* @param isClean
9696
*/
97-
public void startBuild(boolean isClean) {
97+
void startBuild(boolean isClean) {
9898
// at the beginning of a clean build, clear data
9999
isCleanBuild = isClean;
100100
htmlTemplate = null;
@@ -106,19 +106,7 @@ public void startBuild(boolean isClean) {
106106

107107
}
108108

109-
// /**
110-
// * old way from original builder
111-
// *
112-
// */
113-
// public void process(ICompilationUnit sourceUnit, IContainer binaryFolder) {
114-
// if (!(sourceUnit instanceof SourceFile))
115-
// return;
116-
// if (!initializeProject(binaryFolder.getProject(), false))
117-
// return;
118-
// compileToJavaScript(((SourceFile) sourceUnit).resource);
119-
// }
120-
121-
/**
109+
/**
122110
* from Java2ScriptCompilationParticipant.java
123111
*
124112
* get all necessary .j2s params for a build
@@ -128,7 +116,7 @@ public void startBuild(boolean isClean) {
128116
* @return true if this is a j2s project and is enabled
129117
*
130118
*/
131-
public boolean initializeProject(IJavaProject project, boolean isCompilationParticipant) {
119+
boolean initializeProject(IJavaProject project, boolean isCompilationParticipant) {
132120
this.project = project;
133121
this.isCompilationParticipant = isCompilationParticipant;
134122
if (!isActive(project)) {
@@ -246,7 +234,7 @@ public boolean initializeProject(IJavaProject project, boolean isCompilationPart
246234
*
247235
* @param javaSource
248236
*/
249-
public boolean compileToJavaScript(IFile javaSource) {
237+
boolean compileToJavaScript(IFile javaSource) {
250238

251239
String fileName = new String(javaSource.getName());
252240
if (lstExcludedPaths != null) {
@@ -312,6 +300,9 @@ public boolean compileToJavaScript(IFile javaSource) {
312300
return true;
313301
}
314302

303+
//// private methods ////
304+
305+
315306
private void logMethods(String logCalled, String logDeclared, boolean doAppend) {
316307
if (htMethodsCalled != null)
317308
try {
@@ -353,7 +344,7 @@ private String getProperty(String key) {
353344
return val;
354345
}
355346

356-
public void outputJavaScript(Java2ScriptVisitor visitor,
347+
private void outputJavaScript(Java2ScriptVisitor visitor,
357348
// DependencyASTVisitor dvisitor, CompilationUnit fRoot,
358349
String j2sPath) {
359350

@@ -420,6 +411,8 @@ private void writeToFile(File file, String data) {
420411
/**
421412
* The default .j2s file. Replaces .j2s only if it is found but is empty.
422413
*
414+
* OK, I know this should be a resource.
415+
*
423416
*
424417
*
425418
*/

0 commit comments

Comments
 (0)