Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
LanguageNote
Java
Code Block
titleGetters
linenumberstrue
languagejava
private String field;
 
// Recognized as a getter
public String getField() {
  return field;
}

// Recognized as a getter
public String getMyOwnField() {
  return field;
}

// Not recognized as a getter
public String getField() {
  String a = "toto";
  return field;
}
Code Block
titleSetters
linenumberstrue
languagejava
private String field;
 
// Recognized as a setter
public void setField(String field) {
  this.field = field;
}

// Recognized as a setter
public void setMyOwnField(String myOwnField) {
  this.field = myOwnField;
}

// Not recognized as a setter
public void setField(String field) {
  if (field == null) {
    this.field = "My field is null";
  } else {
    this.field = field;
  }
}