}
public static DiagnosticsType newDiagnostic(final int code,
final String details, final DiagnosticsType diagnostics) {
DiagnosticType diags[];
DiagnosticsType newDiagnostics=diagnostics;
int numExistingDiagnostics=0;
if(diagnostics!=null) {
diags=diagnostics.getDiagnostic();
numExistingDiagnostics=diags.length;
DiagnosticType[] newDiags=
new DiagnosticType[numExistingDiagnostics+1];
System.arraycopy(diags, 0, newDiags, 0, numExistingDiagnostics);
diags=newDiags;
diagnostics.setDiagnostic(diags);
}
else {
diags=new DiagnosticType[1];
newDiagnostics=new DiagnosticsType();
newDiagnostics.setDiagnostic(diags);
}
diags[numExistingDiagnostics]=SRWDiagnostic.newDiagnosticType(code, details);
return newDiagnostics;
}