-
Notifications
You must be signed in to change notification settings - Fork 3
Dev/1.15.8 #83
New issue
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
Dev/1.15.8 #83
Conversation
src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java
Outdated
Show resolved
Hide resolved
src/main/java/com/hms_networks/americas/sc/extensions/taginfo/TagInfoManager.java
Outdated
Show resolved
Hide resolved
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.
General code clarity improvements
5e86e47
to
08e6799
Compare
@@ -371,6 +371,16 @@ private static synchronized void processTagListEBDLine(String line) | |||
case indexUnit: | |||
String tagUnit = currentToken; | |||
|
|||
// Remove wrapping quotes if present | |||
final char quoteChar = '"'; |
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.
should this be named doubleQuoteChar to avoid ambiguity?
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.
Updated, although I think it is/was fine either way.
At some point, code needs to be considered self-explanatory, otherwise, it introduces unnecessary redundancy. In situations like this, I don't have a hard preference against including variables such as doubleQuoteChar
, but I don't think it is better than hardcoded "
.
Given the code comment, a hardcoded "
should have its meaning easily interpreted, and adding variable(s) can arguably make the code more difficult to follow in some situations simply because it results in longer code blocks.
final int firstCharIndex = 0; | ||
final int secondCharIndex = 1; | ||
final int lastCharIndex = tagUnit.length() - 1; | ||
if (tagUnit.charAt(firstCharIndex) == quoteChar |
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.
if (tagUnit.charAt(firstCharIndex) == quoteChar | |
if (tagUnit.charAt(firstCharIndex) == quoteChar |
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.
Changed
Removed extra quotes from being included in the unit field of TagInfo objects since the unit field is already a string object and the extra quotes are redundant/confusing.
08e6799
to
f28a0b8
Compare
No description provided.