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

Wrong strings comparison #4670

Closed
AppChecker opened this Issue Sep 19, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@AppChecker

AppChecker commented Sep 19, 2016

In file java/src/processing/mode/java/JavaEditor.java#L2771 there is following expression:

    `if (n.type == "int" || n.type == "hex" || n.type == "webcolor") {`

and in java/src/processing/mode/java/JavaEditor.java#L2787 there is following expression:

   ` if (n.type == "float") {`

Maybe it will be more reliable to compare by "equals":

  `  if (n.type.equals("int") || n.type.equals("hex") || n.type.equals("webcolor")) {`

if (n.type.equals("float")) {

Possible defect was found by Echelon team with AppChecker static analyzer

@benfry benfry closed this in beef7c0 Oct 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment