| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a79fe7f commit 25a2a59
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,10 +30,6 @@ | |||
| 30 | 30 | * according to its tab, including the original IProblem object | |
| 31 | 31 | */ | |
| 32 | 32 | public class JavaProblem implements Problem { | |
| 33 | - /** | ||
| 34 | - * The IProblem which is being wrapped | ||
| 35 | - */ | ||
| 36 | - private IProblem iProblem; | ||
| 37 | 33 | /** | |
| 38 | 34 | * The tab number to which the error belongs to | |
| 39 | 35 | */ | |
@@ -71,11 +67,9 @@ public class JavaProblem implements Problem { | |||
| 71 | 67 | * @param lineNumber - Line number(pde code) of the error | |
| 72 | 68 | */ | |
| 73 | 69 | public JavaProblem(IProblem iProblem, int tabIndex, int lineNumber) { | |
| 74 | - this.iProblem = iProblem; | ||
| 75 | 70 | if(iProblem.isError()) { | |
| 76 | 71 | type = ERROR; | |
| 77 | - } | ||
| 78 | - else if(iProblem.isWarning()) { | ||
| 72 | + } else if (iProblem.isWarning()) { | ||
| 79 | 73 | type = WARNING; | |
| 80 | 74 | } | |
| 81 | 75 | this.tabIndex = tabIndex; | |
@@ -88,62 +82,41 @@ public void setPDEOffsets(int startOffset, int stopOffset){ | |||
| 88 | 82 | this.stopOffset = stopOffset; | |
| 89 | 83 | } | |
| 90 | 84 | ||
| 85 | + @Override | ||
| 91 | 86 | public int getStartOffset() { | |
| 92 | 87 | return startOffset; | |
| 93 | 88 | } | |
| 94 | 89 | ||
| 90 | + @Override | ||
| 95 | 91 | public int getStopOffset() { | |
| 96 | 92 | return stopOffset; | |
| 97 | 93 | } | |
| 98 | 94 | ||
| 99 | - public String toString() { | ||
| 100 | - return new String("TAB " + tabIndex + ",LN " + lineNumber + "LN START OFF: " | ||
| 101 | - + startOffset + ",LN STOP OFF: " + stopOffset + ",PROB: " | ||
| 102 | - + message); | ||
| 103 | - } | ||
| 104 | - | ||
| 95 | + @Override | ||
| 105 | 96 | public boolean isError() { | |
| 106 | 97 | return type == ERROR; | |
| 107 | 98 | } | |
| 108 | 99 | ||
| 100 | + @Override | ||
| 109 | 101 | public boolean isWarning() { | |
| 110 | 102 | return type == WARNING; | |
| 111 | 103 | } | |
| 112 | 104 | ||
| 105 | + @Override | ||
| 113 | 106 | public String getMessage() { | |
| 114 | 107 | return message; | |
| 115 | 108 | } | |
| 116 | 109 | ||
| 117 | - public IProblem getIProblem() { | ||
| 118 | - return iProblem; | ||
| 119 | - } | ||
| 120 | - | ||
| 110 | + @Override | ||
| 121 | 111 | public int getTabIndex() { | |
| 122 | 112 | return tabIndex; | |
| 123 | 113 | } | |
| 124 | 114 | ||
| 115 | + @Override | ||
| 125 | 116 | public int getLineNumber() { | |
| 126 | 117 | return lineNumber; | |
| 127 | 118 | } | |
| 128 | 119 | ||
| 129 | - /** | ||
| 130 | - * Remember to subtract a -1 to line number because in compile check code an | ||
| 131 | - * extra package statement is added, so all line numbers are increased by 1 | ||
| 132 | - * | ||
| 133 | - * @return | ||
| 134 | - */ | ||
| 135 | - public int getSourceLineNumber() { | ||
| 136 | - return iProblem.getSourceLineNumber(); | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - public void setType(int ProblemType){ | ||
| 140 | - if(ProblemType == ERROR) | ||
| 141 | - type = ERROR; | ||
| 142 | - else if(ProblemType == WARNING) | ||
| 143 | - type = WARNING; | ||
| 144 | - else throw new IllegalArgumentException("Illegal Problem type passed to Problem.setType(int)"); | ||
| 145 | - } | ||
| 146 | - | ||
| 147 | 120 | public String[] getImportSuggestions() { | |
| 148 | 121 | return importSuggestions; | |
| 149 | 122 | } | |
@@ -152,23 +125,11 @@ public void setImportSuggestions(String[] a) { | |||
| 152 | 125 | importSuggestions = a; | |
| 153 | 126 | } | |
| 154 | 127 | ||
| 155 | - // Split camel case words into separate words. | ||
| 156 | - // "VaraibleDeclaration" becomes "Variable Declaration" | ||
| 157 | - // But sadly "PApplet" become "P Applet" and so on. | ||
| 158 | - public static String splitCamelCaseWord(String word) { | ||
| 159 | - String newWord = ""; | ||
| 160 | - for (int i = 1; i < word.length(); i++) { | ||
| 161 | - if (Character.isUpperCase(word.charAt(i))) { | ||
| 162 | - // System.out.println(word.substring(0, i) + " " | ||
| 163 | - // + word.substring(i)); | ||
| 164 | - newWord += word.substring(0, i) + " "; | ||
| 165 | - word = word.substring(i); | ||
| 166 | - i = 1; | ||
| 167 | - } | ||
| 168 | - } | ||
| 169 | - newWord += word; | ||
| 170 | - // System.out.println(newWord); | ||
| 171 | - return newWord.trim(); | ||
| 128 | + @Override | ||
| 129 | + public String toString() { | ||
| 130 | + return "TAB " + tabIndex + ",LN " + lineNumber + "LN START OFF: " | ||
| 131 | + + startOffset + ",LN STOP OFF: " + stopOffset + ",PROB: " | ||
| 132 | + + message; | ||
| 172 | 133 | } | |
| 173 | 134 | ||
| 174 | 135 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments