FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix no page showing for mismatched return type · jssmith1/processing@e116462 · GitHub

Repository navigation

Commit e116462

Browse files
committed
Fix no page showing for mismatched return type
1 parent 49353e3 commit e116462

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

‎java/src/processing/mode/java/pdex/ErrorChecker.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ static private Optional<String> getMatchingRefURL(IProblem compilerError, ASTNod
201201
case IProblem.ShouldReturnValue:
202202
return urlAssembler.getMissingReturnURL(problemNode);
203203
case IProblem.TypeMismatch:
204+
case IProblem.ReturnTypeMismatch:
204205
String providedType = truncateClass(problemArguments[0]);
205206
String requiredType = truncateClass(problemArguments[1]);
206207
return urlAssembler.getTypeMismatchURL(providedType, requiredType, problemNode);

‎java/src/processing/mode/java/pdex/MatchingRefURLAssembler.java‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,7 @@ public Optional<String> getMissingReturnURL(ASTNode problemNode) {
309309
* @return the the URL with path and parameters for the corresponding MatchingRef page
310310
*/
311311
public Optional<String> getTypeMismatchURL(String providedType, String requiredType, ASTNode problemNode) {
312-
ASTNode parent = problemNode.getParent();
313-
if (!(parent instanceof VariableDeclarationFragment)) {
314-
return Optional.empty();
315-
}
316-
317-
String varName = ((VariableDeclarationFragment) parent).getName().toString();
318-
312+
String varName = problemNode.toString();
319313
return Optional.of(URL + "typemismatch?typeonename=" + providedType
320314
+ "&typetwoname=" + requiredType
321315
+ "&varname=" + varName);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL