Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFcccc
private Object myState = null;

// Sets some internal state in the library
void setfilesetState(Object state) {
  myState = state;
}

// Performs some action using the file passed earlier
void useState() {
  // Perform some action here
}

...

Code Block
bgColor#ccccff
private Object myState = null;

// Sets some internal state in the library
void setfilesetState(Object state) {
  if (state == null) {
    // Handle null state
  }

  // Defensive copy here when state is mutable

  if (isInvalidState(state)) {
    // Handle invalid state
  }
  myState = state;
}

// Performs some action using the state passed earlier
void useState() {
  if (myState == null) {
    // Handle no state (e.g. null) condition
  }
  // ...
}

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="10e2d4299f3a89f6-c60b7d60-46b44b94-93f9ac9e-a66fca800369550f4fd1fa9d"><ac:plain-text-body><![CDATA[

[ISO/IEC TR 24772:2010

http://www.aitcnet.org/isai/]

"Argument Passing to Library Functions [TRJ]"

]]></ac:plain-text-body></ac:structured-macro>

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="05af120aacfafd19-1d1245a1-476045db-9d628254-df70c9b43246e24a5efccfee"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch 08]]

Item 38: Check parameters for validity

]]></ac:plain-text-body></ac:structured-macro>

...