mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
do the same thing with less code
This commit is contained in:
@@ -24,8 +24,6 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
package processing.mode.java;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
@@ -249,20 +247,13 @@ public class JavaBuild {
|
||||
File outputFolder = (packageName == null) ?
|
||||
srcFolder : new File(srcFolder, packageName.replace('.', '/'));
|
||||
outputFolder.mkdirs();
|
||||
// Base.openFolder(outputFolder);
|
||||
final File java = new File(outputFolder, sketch.getName() + ".java");
|
||||
BufferedWriter bw = Files.newBufferedWriter(java.toPath(), StandardCharsets.UTF_8);
|
||||
final PrintWriter stream = new PrintWriter(bw);
|
||||
final PrintWriter writer = PApplet.createWriter(java);
|
||||
try {
|
||||
result = preprocessor.write(stream, bigCode.toString(), codeFolderPackages);
|
||||
result = preprocessor.write(writer, bigCode.toString(), codeFolderPackages);
|
||||
} finally {
|
||||
stream.close();
|
||||
writer.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
String msg = "Build folder disappeared or could not be written";
|
||||
throw new SketchException(msg);
|
||||
|
||||
} catch (antlr.RecognitionException re) {
|
||||
// re also returns a column that we're not bothering with for now
|
||||
// first assume that it's the main file
|
||||
|
||||
Reference in New Issue
Block a user