@@ -2012,7 +2012,7 @@ protected PGraphics createPrimaryGraphics() {
20122012 * height (but no format) will produce a strange error.
20132013 *
20142014 * Advanced users please note that createImage() should be used instead of
2015- * the syntax <tt >new PImage()</tt >.
2015+ * the syntax <b >new PImage()</b >.
20162016 *
20172017 *
20182018 * <h3>Advanced</h3>
@@ -3364,7 +3364,6 @@ public void die(String what) {
33643364 */
33653365 public void die(String what, Exception e) {
33663366 if (e != null) {
3367- e.printStackTrace();
33683367 }
33693368 die(what);
33703369 }
@@ -4891,6 +4890,28 @@ public final void randomSeed(long seed) {
48914890 public void noiseMode(NoiseMode mode) {
48924891 noiseGenerator.noiseMode(mode);
48934892 }
4893+ /**
4894+ *
4895+ * @param lod
4896+ * @deprecated unsupported with OpenSimplex2 use toxiclibs PerlinNoise if
4897+ * required
4898+ */
4899+
4900+ @Deprecated
4901+ public void noiseDetail(int lod) {
4902+
4903+ }
4904+ /**
4905+ *
4906+ * @param lod
4907+ * @param falloff
4908+ * @deprecated unsupported with OpenSimplex2 use toxiclibs PerlinNoise if
4909+ * required
4910+ */
4911+ @Deprecated
4912+ public void noiseDetail(int lod, float falloff) {
4913+
4914+ }
48944915
48954916 /**
48964917 * @param x
@@ -4951,12 +4972,11 @@ public float noise(float x, float y) {
49514972 public float noise(float x, float y, float z) {
49524973 return noiseGenerator.noise(x, y, z);
49534974 }
4954-
4975+
49554976 public float noise(float x, float y, float z, float w) {
49564977 return noiseGenerator.noise(x, y, z, w);
49574978 }
49584979
4959-
49604980 /**
49614981 *
49624982 *
@@ -5262,7 +5282,7 @@ static public JSONObject loadJSONObject(File file) {
52625282 reader.close();
52635283 } catch (IOException e) {
52645284 // not sure what would cause this
5265- }
5285+ }
52665286 return outgoing;
52675287 }
52685288
@@ -6626,7 +6646,7 @@ static public byte[] loadBytes(File file) {
66266646 int length;
66276647
66286648 if (file.getName().toLowerCase().endsWith(".gz")) {
6629- try ( RandomAccessFile raf = new RandomAccessFile(file, "r")) {
6649+ try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
66306650 raf.seek(raf.length() - 4);
66316651 int b4 = raf.read();
66326652 int b3 = raf.read();
@@ -6788,8 +6808,8 @@ static public String[] loadStrings(BufferedReader reader) {
67886808 return output;
67896809
67906810 } catch (IOException e) {
6791- e.printStackTrace();
67926811 //throw new RuntimeException("Error inside loadStrings()");
6812+
67936813 }
67946814 return null;
67956815 }
@@ -6901,10 +6921,9 @@ static public boolean saveStream(File target, InputStream source) {
69016921 // make sure that this path actually exists before writing
69026922 createPath(target);
69036923 tempFile = createTempFile(target);
6904- FileOutputStream targetStream = new FileOutputStream(tempFile);
6905-
6906- saveStream(targetStream, source);
6907- targetStream.close();
6924+ try (FileOutputStream targetStream = new FileOutputStream(tempFile)) {
6925+ saveStream(targetStream, source);
6926+ }
69086927
69096928 if (target.exists()) {
69106929 if (!target.delete()) {
@@ -7056,7 +7075,6 @@ static public void saveBytes(OutputStream output, byte[] data) {
70567075 output.flush();
70577076
70587077 } catch (IOException e) {
7059- e.printStackTrace();
70607078 }
70617079 }
70627080
@@ -7107,12 +7125,12 @@ static public void saveStrings(File file, String[] data) {
71077125 * @nowebref
71087126 */
71097127 static public void saveStrings(OutputStream output, String[] data) {
7110- PrintWriter writer = createWriter(output);
7111- for (int i = 0; i < data.length; i++) {
7112- writer.println(data[i]);
7128+ try (PrintWriter writer = createWriter(output)) {
7129+ for (String data1 : data) {
7130+ writer.println(data1);
7131+ }
7132+ writer.flush();
71137133 }
7114- writer.flush();
7115- writer.close();
71167134 }
71177135
71187136 //////////////////////////////////////////////////////////////
@@ -7305,7 +7323,6 @@ public File dataFile(String where) {
73057323 try {
73067324 jarPath = jarURL.toURI().getPath();
73077325 } catch (URISyntaxException e) {
7308- e.printStackTrace();
73097326 return null;
73107327 }
73117328 if (jarPath.contains("Contents/Java/")) {
0 commit comments