BAEL 4401 (#9913)
* BAEL-4401 * Update with master and resolve conflicts
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.baeldung.nullmethodparameter;
|
||||
|
||||
public class NullParameterExample {
|
||||
public void processSomethingNotNull(Object myParameter) {
|
||||
if (myParameter == null) {
|
||||
throw new IllegalArgumentException("Parameter 'myParameter' cannot be null");
|
||||
}
|
||||
//Do something with the parameter
|
||||
}
|
||||
|
||||
public void processSomethingElseNotNull(Object myParameter) {
|
||||
if (myParameter == null) {
|
||||
throw new NullPointerException("Parameter 'myParameter' cannot be null");
|
||||
}
|
||||
//Do something with the parameter
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user