Repository navigation
Feature utils - #4
Conversation
| * @param values the values | ||
| * @author Harsh Shah | ||
| */ | ||
| public static void success(String message, Object... values) { |
There was a problem hiding this comment.
AnnotateFormatMethod: This method passes a pair of parameters through to String.format, but the enclosing method wasn't annotated @FormatMethod. Doing so gives compile-time rather than run-time protection against malformed format strings.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| builder.setNumberOfQuery(0); | ||
|
|
||
| try { | ||
| URI uri = new URI(url); |
There was a problem hiding this comment.
UnusedVariable: The local variable 'uri' is never read.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| try { | ||
| URI uri = new URI(url); | ||
| } catch (URISyntaxException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
CatchAndPrintStackTrace: Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| try { | ||
| response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); | ||
| } catch (IOException | InterruptedException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
CatchAndPrintStackTrace: Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| * @param values the values | ||
| * @author Harsh Shah | ||
| */ | ||
| public static void error(String message, Object... values) { |
There was a problem hiding this comment.
AnnotateFormatMethod: This method passes a pair of parameters through to String.format, but the enclosing method wasn't annotated @FormatMethod. Doing so gives compile-time rather than run-time protection against malformed format strings.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
|
|
||
| char[] characters = jsonString.toCharArray(); | ||
|
|
||
| Stack<ClosingCharacterModel> stack = new Stack<>(); |
There was a problem hiding this comment.
JdkObsolete: Stack is a nonstandard class that predates the Java Collections Framework; prefer ArrayDeque. Note that the Stack methods push/pop/peek correspond to the Deque methods addFirst/removeFirst/peekFirst.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| try { | ||
| response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); | ||
| } catch (IOException | InterruptedException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
CatchAndPrintStackTrace: Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| * @param values the values | ||
| * @author Harsh Shah | ||
| */ | ||
| public static void success(String message, Object... values) { |
There was a problem hiding this comment.
AnnotateFormatMethod: This method passes a pair of parameters through to String.format, but the enclosing method wasn't annotated @FormatMethod. Doing so gives compile-time rather than run-time protection against malformed format strings.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| * @param values the values | ||
| * @author Harsh Shah | ||
| */ | ||
| public static void error(String message, Object... values) { |
There was a problem hiding this comment.
AnnotateFormatMethod: This method passes a pair of parameters through to String.format, but the enclosing method wasn't annotated @FormatMethod. Doing so gives compile-time rather than run-time protection against malformed format strings.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| try { | ||
| URI uri = new URI(url); | ||
| } catch (URISyntaxException e) { | ||
| e.printStackTrace(); |
There was a problem hiding this comment.
CatchAndPrintStackTrace: Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
|
|
||
| char[] characters = jsonString.toCharArray(); | ||
|
|
||
| Stack<ClosingCharacterModel> stack = new Stack<>(); |
There was a problem hiding this comment.
JdkObsolete: Stack is a nonstandard class that predates the Java Collections Framework; prefer ArrayDeque. Note that the Stack methods push/pop/peek correspond to the Deque methods addFirst/removeFirst/peekFirst.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
| builder.setNumberOfQuery(0); | ||
|
|
||
| try { | ||
| URI uri = new URI(url); |
There was a problem hiding this comment.
UnusedVariable: The local variable 'uri' is never read.
(at-me in a reply with help or ignore)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
Added Utilities and their test cases