Compare commits

...

2 Commits

Author SHA1 Message Date
Ruben
e1007cce30 return error Message String
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 1m29s
2025-09-26 09:33:31 +02:00
Ruben
4cfc070289 surround Method with Try-Catch
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 2m23s
2025-09-23 18:21:55 +02:00

View File

@@ -49,13 +49,10 @@ public class LanguageServerInterface {
* Example: file:///c:/test/main.jav -> file:///c:/test/out/main.class * Example: file:///c:/test/main.jav -> file:///c:/test/out/main.class
* *
* @param pathAsString the URI of the File. See Example. * @param pathAsString the URI of the File. See Example.
* @throws IOException
* @throws ClassNotFoundException
* @throws URISyntaxException
*/ */
public LanguageServerTransferObject getResultSetAndAbstractSyntax(String pathAsString) throws IOException, ClassNotFoundException, URISyntaxException { public LanguageServerTransferObject getResultSetAndAbstractSyntax(String pathAsString){
System.setOut(new PrintStream(OutputStream.nullOutputStream())); System.setOut(new PrintStream(OutputStream.nullOutputStream()));
try {
var uri = new URI(pathAsString); var uri = new URI(pathAsString);
var path = Path.of(uri); var path = Path.of(uri);
var file = path.toFile(); var file = path.toFile();
@@ -70,6 +67,9 @@ public class LanguageServerInterface {
compiler.writeClassFile(bytecode, path.getParent().resolve("out").toFile(), false); compiler.writeClassFile(bytecode, path.getParent().resolve("out").toFile(), false);
return new LanguageServerTransferObject(tiResults, parsedSource, "", compiler.getGeneratedGenerics()); return new LanguageServerTransferObject(tiResults, parsedSource, "", compiler.getGeneratedGenerics());
}catch (Exception e){
throw new RuntimeException(e.getMessage());
}
} }
/** /**