Skip to content

Commit e105d87

Browse files
committed
j2s 4.2 source simplified
1 parent 944ad01 commit e105d87

34 files changed

+1378
-1633
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20231116084252
1+
20231117083556
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20231116084252
1+
20231117083556
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" path="src"/>
4-
<!-- classpathentry kind="src" path="src_4.2"/ -->
3+
<classpathentry kind="src" path="src_4.2"/>
54
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
65
<classpathentry kind="output" path="bin"/>
76
</classpath>

sources/net.sf.j2s.java.core/.settings/org.eclipse.jdt.core.prefs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
2929
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
3030
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
3131
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
32-
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
32+
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
3333
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
3434
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
3535
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
@@ -63,7 +63,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
6363
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
6464
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
6565
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
66-
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
66+
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
6767
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
6868
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
6969
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
-14.5 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Jmol-j2-site.zip is a collection of JS files from src_4.2/ processing
2+
by the legacy 4.2 java2script transpiler. It is only used for non-SwingJS Jmol.
3+
4+
5+
Jmol-j2-site.zip needs to be copied into Jmol/site-resources-zip/ manually.
6+
7+
8+
where it can be unzipped into the site/ directory
9+
10+
11+
Fixes and modifications from the originals
12+
13+
BH 2023.11.16 removed unnecessary references to StringBuilder and StringBuffer
14+
since these are just strings in JavaScript (which has exceptionally
15+
fast string operations in browsers).
16+
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#Java2Script Configuration
2-
xj2s.excluded.paths=org/apache/harmony/luni/util/
3-
xj2s.string.fixes=org.apache.harmony.luni.util.Msg.getString (",(",org.apache.harmony.luni.util.Msg,,[\\,[,\\, ],],\\, \\,,\\,
42
j2s.site.directory=site_jmol
53
j2s.compiler.status=enable
64
j2s.compiler.mode=debug

sources/net.sf.j2s.java.core/src_4.2/java/io/BufferedOutputStream.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package java.io;
1919

20-
import org.apache.harmony.luni.util.Msg;
20+
2121

2222
/**
2323
* BufferedOutputStream is a class which takes an output stream and
@@ -68,7 +68,7 @@ public BufferedOutputStream(OutputStream out, int size) {
6868
jzSetFOS(out);
6969
if (size <= 0) {
7070
// K0058=size must be > 0
71-
throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
71+
throw new IllegalArgumentException(("K0058")); //$NON-NLS-1$
7272
}
7373
buf = new byte[size];
7474
}
@@ -119,11 +119,11 @@ public synchronized void write(byte[] buffer, int offset, int length)
119119
throws IOException {
120120
if (buffer == null) {
121121
// K0047=buffer is null
122-
throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
122+
throw new NullPointerException(("K0047")); //$NON-NLS-1$
123123
}
124124
if (offset < 0 || offset > buffer.length - length || length < 0) {
125125
// K002f=Arguments out of bounds
126-
throw new ArrayIndexOutOfBoundsException(Msg.getString("K002f")); //$NON-NLS-1$
126+
throw new ArrayIndexOutOfBoundsException(("K002f")); //$NON-NLS-1$
127127
}
128128
if (count == 0 && length >= buf.length) {
129129
out.write(buffer, offset, length);

sources/net.sf.j2s.java.core/src_4.2/java/io/BufferedWriter.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package java.io;
1919

20-
import org.apache.harmony.luni.util.Msg;
20+
2121

2222
/**
2323
* BufferedWriter is for writing buffered character output. Characters written
@@ -69,7 +69,7 @@ public BufferedWriter(Writer out, int size) {
6969
this.out = out;
7070
this.buf = new char[size];
7171
} else {
72-
throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
72+
throw new IllegalArgumentException(("K0058")); //$NON-NLS-1$
7373
}
7474
}
7575

@@ -110,7 +110,7 @@ public void flush() throws IOException {
110110
pos = 0;
111111
out.flush();
112112
} else {
113-
throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
113+
throw new IOException(("K005d")); //$NON-NLS-1$
114114
}
115115
}
116116
}
@@ -160,7 +160,7 @@ public void newLine() throws IOException {
160160
public void write(char[] cbuf, int offset, int count) throws IOException {
161161
synchronized (lock) {
162162
if (!isOpen()) {
163-
throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
163+
throw new IOException(("K005d")); //$NON-NLS-1$
164164
}
165165
if (offset < 0 || offset > cbuf.length - count || count < 0) {
166166
throw new IndexOutOfBoundsException();
@@ -217,7 +217,7 @@ public void write(int oneChar) throws IOException {
217217
}
218218
buf[pos++] = (char) oneChar;
219219
} else {
220-
throw new IOException(Msg.getString("K005d")); //$NON-NLS-1$
220+
throw new IOException(("K005d")); //$NON-NLS-1$
221221
}
222222
}
223223
}
@@ -245,8 +245,7 @@ public void write(int oneChar) throws IOException {
245245
public void write(String str, int offset, int count) throws IOException {
246246
synchronized (lock) {
247247
if (!isOpen()) {
248-
throw new IOException(org.apache.harmony.luni.util.Msg
249-
.getString("K005d")); //$NON-NLS-1$
248+
throw new IOException(("K005d")); //$NON-NLS-1$
250249
}
251250
if (count <= 0) {
252251
return;

sources/net.sf.j2s.java.core/src_4.2/java/io/CharArrayReader.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package java.io;
1919

20-
import org.apache.harmony.luni.util.Msg;
20+
2121

2222
/**
2323
* CharArrayReader is used as a buffered character input stream on a character
@@ -128,7 +128,7 @@ public void mark(int readLimit) throws IOException {
128128
if (isOpen()) {
129129
markedPos = pos;
130130
} else {
131-
throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
131+
throw new IOException(("K0060")); //$NON-NLS-1$
132132
}
133133
}
134134
}
@@ -164,7 +164,7 @@ public int read() throws IOException {
164164
}
165165
return -1;
166166
}
167-
throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
167+
throw new IOException(("K0060")); //$NON-NLS-1$
168168
}
169169
}
170170

@@ -204,7 +204,7 @@ public int read(char buffer[], int offset, int len) throws IOException {
204204
}
205205
return -1;
206206
}
207-
throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
207+
throw new IOException(("K0060")); //$NON-NLS-1$
208208
}
209209
}
210210
throw new ArrayIndexOutOfBoundsException();
@@ -231,7 +231,7 @@ public boolean ready() throws IOException {
231231
if (isOpen()) {
232232
return pos != count;
233233
}
234-
throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
234+
throw new IOException(("K0060")); //$NON-NLS-1$
235235
}
236236
}
237237

@@ -250,7 +250,7 @@ public void reset() throws IOException {
250250
if (isOpen()) {
251251
pos = markedPos != -1 ? markedPos : 0;
252252
} else {
253-
throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
253+
throw new IOException(("K0060")); //$NON-NLS-1$
254254
}
255255
}
256256
}
@@ -284,7 +284,7 @@ public long skip(long n) throws IOException {
284284
}
285285
return skipped;
286286
}
287-
throw new IOException(Msg.getString("K0060")); //$NON-NLS-1$
287+
throw new IOException(("K0060")); //$NON-NLS-1$
288288
}
289289
}
290290
}

0 commit comments

Comments
 (0)