Skip to content

Commit f664379

Browse files
author
jossonsmith
committed
Add some comments and fixed a bug calculating correct path from InputStream
1 parent c109395 commit f664379

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

sources/net.sf.j2s.java.core/src/java/lang/Class.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
* @create Nov 5, 2005
1717
*******/
1818

19+
/*
20+
* The following *-# are used to compress the JavaScript file into small file.
21+
* For more details, please read /net.sf.j2s.lib/build/build.xml
22+
*/
1923
/*-#
2024
# _x_CLASS_NAME__ -> C$N
2125
# _x_PKG_NAME__ -> P$N
@@ -1524,7 +1528,8 @@ Clazz.innerFunctions = {
15241528
if (x != -1) {
15251529
baseFolder = baseFolder.substring (0, x);
15261530
} else {
1527-
baseFolder = null;
1531+
baseFolder = ClazzLoader.getClasspathFor (clazzName, true);
1532+
//baseFolder = null;
15281533
}
15291534
} else {
15301535
var bins = Clazz.binaryFolders;

sources/net.sf.j2s.java.core/src/java/lang/ClassLoader.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ ClazzLoader.isClassExcluded = function (clazz) {
508508
/**
509509
* The following *.script* can be overriden to indicate the
510510
* status of classes loading.
511+
*
512+
* TODO: There should be a Java interface with name like INativeLoaderStatus
511513
*/
512514
/* protected */
513515
ClazzLoader.scriptLoading = function (file) {};
@@ -770,6 +772,10 @@ ClazzLoader.isResourceExisted = function (id, path, base) {
770772
return false;
771773
};
772774

775+
/*
776+
* loadCSS may be considered part of SWT library. Should be packed with
777+
* SWT not with Java core.
778+
*/
773779
/* public */
774780
ClazzLoader.loadCSS = function (cssName) {
775781
var cssKey = "";
@@ -913,6 +919,9 @@ ClazzLoader.tryToLoadNext = function (file) {
913919

914920
ClazzLoader.tracks = new Array ();
915921

922+
/*
923+
* There are classes reference cycles. Try to detect and break those cycles.
924+
*/
916925
/* protected */
917926
ClazzLoader.checkOptionalCycle = function (node) {
918927
var ts = ClazzLoader.tracks;
@@ -1528,6 +1537,10 @@ ClazzLoader.runtimeLoaded = function () {
15281537
ClazzLoader.runtimeLoaded = function () {};
15291538
};
15301539

1540+
/*
1541+
* Load those key *.z.js. This *.z.js will be surely loaded before other
1542+
* queued *.js.
1543+
*/
15311544
/* public */
15321545
ClazzLoader.loadZJar = function (zjarPath, keyClazz) {
15331546
ClazzLoader.jarClasspath (zjarPath, [keyClazz]);

0 commit comments

Comments
 (0)