| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,162 +1,30 @@ | ||
| /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ | ||
|
|
||
| /* | ||
| Part of the Processing project - http://processing.org | ||
|
|
||
| Copyright (c) 2004-08 Ben Fry and Casey Reas | ||
| Copyright (c) 2001-04 Massachusetts Institute of Technology | ||
|
|
||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation; either version 2 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with this program; if not, write to the Free Software Foundation, | ||
| Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| */ | ||
| // temporary band-aid class to support modes which are still looking here for the now-refactored class. | ||
| // - josh giesbrecht | ||
|
|
||
| package processing.app; | ||
|
|
||
| @Deprecated | ||
| // please migrate to using processing.utils.SketchException instead! all class functionality is the same as before. | ||
| public class SketchException extends processing.utils.SketchException { | ||
|
|
||
| /** | ||
| * An exception with a line number attached that occurs | ||
| * during either pre-processing, compile, or run time. | ||
| */ | ||
| public class SketchException extends Exception { | ||
| protected String message; | ||
| protected int codeIndex; | ||
| protected int codeLine; | ||
| protected int codeColumn; | ||
| protected boolean showStackTrace; | ||
|
|
||
|
|
||
| public SketchException(String message) { | ||
| this(message, true); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, boolean showStackTrace) { | ||
| this(message, -1, -1, -1, showStackTrace); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, int file, int line) { | ||
| this(message, file, line, -1, true); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, int file, int line, int column) { | ||
| this(message, file, line, column, true); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, int file, int line, int column, | ||
| boolean showStackTrace) { | ||
| this.message = message; | ||
| this.codeIndex = file; | ||
| this.codeLine = line; | ||
| this.codeColumn = column; | ||
| this.showStackTrace = showStackTrace; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Override getMessage() in Throwable, so that I can set | ||
| * the message text outside the constructor. | ||
| */ | ||
| public String getMessage() { | ||
| return message; | ||
| } | ||
|
|
||
|
|
||
| public void setMessage(String message) { | ||
| this.message = message; | ||
| } | ||
|
|
||
|
|
||
| public int getCodeIndex() { | ||
| return codeIndex; | ||
| } | ||
|
|
||
|
|
||
| public void setCodeIndex(int index) { | ||
| codeIndex = index; | ||
| } | ||
|
|
||
|
|
||
| public boolean hasCodeIndex() { | ||
| return codeIndex != -1; | ||
| } | ||
|
|
||
|
|
||
| public int getCodeLine() { | ||
| return codeLine; | ||
| } | ||
|
|
||
|
|
||
| public void setCodeLine(int line) { | ||
| this.codeLine = line; | ||
| } | ||
|
|
||
|
|
||
| public boolean hasCodeLine() { | ||
| return codeLine != -1; | ||
| } | ||
|
|
||
|
|
||
| public void setCodeColumn(int column) { | ||
| this.codeColumn = column; | ||
| } | ||
|
|
||
|
|
||
| public int getCodeColumn() { | ||
| return codeColumn; | ||
| } | ||
|
|
||
|
|
||
| public void showStackTrace() { | ||
| showStackTrace = true; | ||
| } | ||
|
|
||
|
|
||
| public void hideStackTrace() { | ||
| showStackTrace = false; | ||
| } | ||
|
|
||
|
|
||
| public boolean isStackTraceEnabled() { | ||
| return showStackTrace; | ||
| } | ||
| // Idea complained without all these super wrappers for constructors. ¯\_(ツ)_/¯ sure, why not? | ||
| public SketchException(String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public SketchException(String message, boolean showStackTrace) { | ||
| super(message, showStackTrace); | ||
| } | ||
|
|
||
| /** | ||
| * Nix the java.lang crap out of an exception message | ||
| * because it scares the children. | ||
| * <P> | ||
| * This function must be static to be used with super() | ||
| * in each of the constructors above. | ||
| */ | ||
| /* | ||
| static public final String massage(String msg) { | ||
| if (msg.indexOf("java.lang.") == 0) { | ||
| //int dot = msg.lastIndexOf('.'); | ||
| msg = msg.substring("java.lang.".length()); | ||
| public SketchException(String message, int file, int line) { | ||
| super(message, file, line); | ||
| } | ||
| return msg; | ||
| //return (dot == -1) ? msg : msg.substring(dot+1); | ||
| } | ||
| */ | ||
|
|
||
| public SketchException(String message, int file, int line, int column) { | ||
| super(message, file, line, column); | ||
| } | ||
|
|
||
| public void printStackTrace() { | ||
| if (showStackTrace) { | ||
| super.printStackTrace(); | ||
| public SketchException(String message, int file, int line, int column, boolean showStackTrace) { | ||
| super(message, file, line, column, showStackTrace); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| plugins { | ||
| id("java") | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| testImplementation(platform("org.junit:junit-bom:5.10.0")) | ||
| testImplementation("org.junit.jupiter:junit-jupiter") | ||
| } | ||
|
|
||
| tasks.test { | ||
| useJUnitPlatform() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ | ||
|
|
||
| /* | ||
| Part of the Processing project - http://processing.org | ||
|
|
||
| Copyright (c) 2004-08 Ben Fry and Casey Reas | ||
| Copyright (c) 2001-04 Massachusetts Institute of Technology | ||
|
|
||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation; either version 2 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with this program; if not, write to the Free Software Foundation, | ||
| Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| */ | ||
|
|
||
| package processing.utils; | ||
|
|
||
|
|
||
| /** | ||
| * An exception with a line number attached that occurs | ||
| * during either pre-processing, compile, or run time. | ||
| */ | ||
| public class SketchException extends Exception { | ||
| protected String message; | ||
| protected int codeIndex; | ||
| protected int codeLine; | ||
| protected int codeColumn; | ||
| protected boolean showStackTrace; | ||
|
|
||
|
|
||
| public SketchException(String message) { | ||
| this(message, true); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, boolean showStackTrace) { | ||
| this(message, -1, -1, -1, showStackTrace); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, int file, int line) { | ||
| this(message, file, line, -1, true); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, int file, int line, int column) { | ||
| this(message, file, line, column, true); | ||
| } | ||
|
|
||
|
|
||
| public SketchException(String message, int file, int line, int column, | ||
| boolean showStackTrace) { | ||
| this.message = message; | ||
| this.codeIndex = file; | ||
| this.codeLine = line; | ||
| this.codeColumn = column; | ||
| this.showStackTrace = showStackTrace; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Override getMessage() in Throwable, so that I can set | ||
| * the message text outside the constructor. | ||
| */ | ||
| public String getMessage() { | ||
| return message; | ||
| } | ||
|
|
||
|
|
||
| public void setMessage(String message) { | ||
| this.message = message; | ||
| } | ||
|
|
||
|
|
||
| public int getCodeIndex() { | ||
| return codeIndex; | ||
| } | ||
|
|
||
|
|
||
| public void setCodeIndex(int index) { | ||
| codeIndex = index; | ||
| } | ||
|
|
||
|
|
||
| public boolean hasCodeIndex() { | ||
| return codeIndex != -1; | ||
| } | ||
|
|
||
|
|
||
| public int getCodeLine() { | ||
| return codeLine; | ||
| } | ||
|
|
||
|
|
||
| public void setCodeLine(int line) { | ||
| this.codeLine = line; | ||
| } | ||
|
|
||
|
|
||
| public boolean hasCodeLine() { | ||
| return codeLine != -1; | ||
| } | ||
|
|
||
|
|
||
| public void setCodeColumn(int column) { | ||
| this.codeColumn = column; | ||
| } | ||
|
|
||
|
|
||
| public int getCodeColumn() { | ||
| return codeColumn; | ||
| } | ||
|
|
||
|
|
||
| public void showStackTrace() { | ||
| showStackTrace = true; | ||
| } | ||
|
|
||
|
|
||
| public void hideStackTrace() { | ||
| showStackTrace = false; | ||
| } | ||
|
|
||
|
|
||
| public boolean isStackTraceEnabled() { | ||
| return showStackTrace; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * Nix the java.lang crap out of an exception message | ||
| * because it scares the children. | ||
| * <P> | ||
| * This function must be static to be used with super() | ||
| * in each of the constructors above. | ||
| */ | ||
| /* | ||
| static public final String massage(String msg) { | ||
| if (msg.indexOf("java.lang.") == 0) { | ||
| //int dot = msg.lastIndexOf('.'); | ||
| msg = msg.substring("java.lang.".length()); | ||
| } | ||
| return msg; | ||
| //return (dot == -1) ? msg : msg.substring(dot+1); | ||
| } | ||
| */ | ||
|
|
||
|
|
||
| public void printStackTrace() { | ||
| if (showStackTrace) { | ||
| super.printStackTrace(); | ||
| } | ||
| } | ||
| } |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityJust curious, when would this band-aid be removed?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityMy plan was to submit PRs to the other supported modes to switch them over, once this is released. Then when all existing supported modes are fully switched over this could be deleted.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityConsidering we do not know which 3rd party modes/tools have used this class I would expect this stub to be there for quite a while.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@joshgiesbrecht ah! also i just noticed you had already said this :) could you add a brief comment to the file documenting your plan?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality@catilac @Stefterv There aren't that many modes to check, but I hadn't considered tools (or libraries, yikes). Is there a 'usual' for deprecated classes that should be planned for? I can update the file with specifics then.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThe thing is, most modes we also do not have a way currently to easily publish new versions, so I suspect this stub to be there for quite a while
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.