We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null pointer exception is not getting handled correctly, because npe.getMessage() is itself null.
@slf4j public class Demo { public static void doIt(){ Map<String, String> map = new ConcurrentHashMap<>(); try { map.put(null, null); } catch (NullPointerException npe) { log.error(npe.getMessage(), npe); } } }
class DemoTest extends Specification { def "DoIt"() { given: TestLogger logger = TestLoggerFactory.getTestLogger(Demo.class); Demo.doIt(); expect: logger.getAllLoggingEvents().size() > 0; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Null pointer exception is not getting handled correctly, because npe.getMessage() is itself null.
@slf4j
public class Demo {
public static void doIt(){
Map<String, String> map = new ConcurrentHashMap<>();
try {
map.put(null, null);
} catch (NullPointerException npe) {
log.error(npe.getMessage(), npe);
}
}
}
class DemoTest extends Specification {
def "DoIt"() {
given:
TestLogger logger = TestLoggerFactory.getTestLogger(Demo.class);
Demo.doIt();
expect:
logger.getAllLoggingEvents().size() > 0;
}
}
The text was updated successfully, but these errors were encountered: