File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
sierra-tools/dtd-encoder/src
main/java/org/httprpc/sierra/tools/dtd
test/java/org/httprpc/sierra/tools/dtd Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,8 @@ public static void main(String[] args) throws Exception {
256256 var workingPath = Path .of (System .getProperty ("user.dir" ));
257257
258258 if (args .length > 0 ) {
259- ClassLoader classLoader ;
259+ var classLoader = ClassLoader .getSystemClassLoader ();
260+
260261 if (args .length > 1 ) {
261262 try (var paths = Files .walk (workingPath .resolve (args [1 ]))) {
262263 classLoader = new URLClassLoader (paths .map (path -> {
@@ -265,10 +266,8 @@ public static void main(String[] args) throws Exception {
265266 } catch (IOException exception ) {
266267 throw new RuntimeException (exception );
267268 }
268- }).toArray (URL []::new ));
269+ }).toArray (URL []::new ), classLoader );
269270 }
270- } else {
271- classLoader = ClassLoader .getSystemClassLoader ();
272271 }
273272
274273 applyBindings (workingPath .resolve (args [0 ]), classLoader );
Original file line number Diff line number Diff line change 1717import org .httprpc .kilo .io .TextDecoder ;
1818import org .junit .jupiter .api .Test ;
1919
20+ import javax .swing .JDesktopPane ;
2021import java .nio .file .Files ;
2122import java .nio .file .Path ;
2223import java .nio .file .StandardCopyOption ;
@@ -33,6 +34,7 @@ public void testDTDEncoder() throws Exception {
3334
3435 var properties = new Properties ();
3536
37+ properties .put ("desktop-pane" , JDesktopPane .class .getName ());
3638 properties .put ("chart-panel" , "org.jfree.chart.ChartPanel" );
3739
3840 var libraryPath = workingPath .resolve ("lib" );
@@ -66,6 +68,7 @@ public void testDTDEncoder() throws Exception {
6668 text = textDecoder .read (inputStream );
6769 }
6870
71+ assertTrue (text .contains ("desktop-pane" ));
6972 assertTrue (text .contains ("chart-panel" ));
7073 } finally {
7174 Files .deleteIfExists (bindingsPath );
You can’t perform that action at this time.
0 commit comments