Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
public void readSensitiveFile() {
  try {
    SecurityManager sm = System.getSecurityManager();
    if(sm != null) {  // Check if file can be read
      sm.checkRead(""/temp/tempFile"");
    } 
    // Access the file
  } catch (SecurityException se) { 
    // Log exception  
  }
}

...

Code Block
bgColor#ccccff
public final void readSensitiveFile() {
  try {
    SecurityManager sm = System.getSecurityManager();
    if(sm != null) {  // check if file can be read
      sm.checkRead(""/temp/tempFile"");
    } 
    // Access the file
  } catch (SecurityException se) { 
    // Log exception 
  }
}

...

Code Block
bgColor#ccccff
private void readSensitiveFile() {
  try {
    SecurityManager sm = System.getSecurityManager();
    if(sm != null) {  // check if file can be read
      sm.checkRead(""/temp/tempFile"");
    } 
    // Access the file
  } catch (SecurityException se) { 
    // Log exception 
  }
}

...

MET05-J. Validate method parameters            12. Methods (MET)            MET30-J. Follow the general contract while overriding the equals method