Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by NavBot

...

Code Block
bgColor#FFcccc
  File someFile = new File(""someFileName.txt"");
  // do something with someFile
  someFile.delete();

...

Code Block
bgColor#ccccff
  File someFile = new File(""someFileName.txt"");
  // do something with someFile
  if (!someFile.delete()) {
    // handle the fact that the file has not been deleted
  }

...

Code Block
bgColor#FFcccc
public class Ignore {
  public static void main(String[] args) {
    String original = "insecure";"insecure";
    original.replace( 'i', '9' );
    System.out.println(original);
  }
}

...

Code Block
bgColor#ccccff
public class DoNotIgnore {
  public static void main(String[] args) {
    String original = "insecure";"insecure";
    original = original.replace( 'i', '9' );
    System.out.println(original);
  }
}

...

Wiki Markup
\[[API 06|AA. Java References#API 06]\] method [delete()|http://java.sun.com/javase/6/docs/api/java/io/File.html#delete()]
\[[API 06|AA. Java References#API 06]\] method [replace()|http://java.sun.com/javase/6/docs/api/java/lang/String.html#replace(char,%20char)]
\[[Green 08|AA. Java References#Green 08]\] [""String.replace""|http://mindprod.com/jgloss/gotchas.html]
\[[Pugh 09|AA. Java References#Pugh 09]\] misusing putIfAbsent
\[[MITRE 09|AA. Java References#MITRE 09]\] [CWE ID 252|http://cwe.mitre.org/data/definitions/252.html] ""Unchecked Return Value""

...

EXP01-J. Ensure a null pointer is not dereferenced            04. Expressions (EXP)            EXP03-J. Do not compare String objects using equality or relational operators