I have a static util method that I am calling with some values being null.
Here is the method signature that I am calling:
public static void logAndDisplayError(@Nullable Shell parentShell, String dialogTitle, String exceptionMessage, @Nullable Exception e, @Nullable Integer statusCode, boolean is1CD)
Here is the call to the method:
EclipseError.logAndDisplayError(getShell(), "Error Occured On Finish", message, null, null, true);
Inside the method, I am making a MessageDialog which is causing a null pointer.
Here is the MessageDialog creation:
MessageDialog dialog = new MessageDialog(parentShell,
dialogTitle,
MessageDialog.getImage(Dialog.DLG_IMG_MESSAGE_ERROR),
getErrorMessage(e.getMessage(), e, statusCode),
MessageDialog.ERROR,
new String[]{"1CD Help", "Ok"},
1);
The null pointer is occuring on this call in the MessageDialog:
getErrorMessage(e.getMessage(), e, statusCode)
So we know that e and statusCode are null. But I have Nullable defined in the getErrorMessage method...
private static String getErrorMessage(String exceptionMessage, @Nullable Exception e, @Nullable Integer statusCode)
Why is it throwing the null pointer?
Also, here is the @Nullable I am using:
org.eclipse.jdt.annotation.Nullable