我有一个简单的测试,我作为JUnit插件测试运行:
import org.junit.Test;
public class SimpleTest {
@Test
public void doNothingTest(){
System.out.println("Nothing to see here...");
}
}
测试完成,然后打印到控制台:
!ENTRY org.eclipse.epp.logging.aeri.core 2 1 2016-03-02 07:04:33.285 !MESSAGE AERI因错误而失败。请报告此错误:null;版本:1.100.0.v20160211-1103 !堆栈0 显示java.lang.NullPointerException 在org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:217) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:90) 在org.eclipse.epp.logging.aeri.core.SystemControl.executeHandler(SystemControl.java:103) 在org.eclipse.epp.logging.aeri.core.SystemControl.isActive(SystemControl.java:65) 在org.eclipse.epp.logging.aeri.core.util.LogListener.logging(LogListener.java:45) 在org.eclipse.core.internal.runtime.RuntimeLog.logToListeners(RuntimeLog.java:161) 在org.eclipse.core.internal.runtime.PlatformLogWriter.logged(PlatformLogWriter.java:103) at org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.safeLogged(ExtendedLogReaderServiceFactory.java:88) 在org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:217) 在org.eclipse.osgi.internal.log.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:189) 在......
许多很多行都在继续。
这是抛出异常的源代码片段。 Object result = ...
行抛出NPE。
@Override
public Object invoke(Object object, Class<? extends Annotation> qualifier, PrimaryObjectSupplier objectSupplier) {
Object result = invokeUsingClass(object, object.getClass(), qualifier, IInjector.NOT_A_VALUE, objectSupplier, null, true);
if (result == IInjector.NOT_A_VALUE) {
if (object != null && qualifier != null) {
throw new InjectionException("Unable to find matching method to invoke. Searching for the annotation \"" + qualifier.toString() + "\" on an instance of \"" + object.getClass().getSimpleName() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
throw new InjectionException("Unable to find matching method to invoke. One of the arguments was null."); //$NON-NLS-1$
}
return result;
此来源来自org.eclipse.e4.core.di.source_1.5.0.v20150421-2214.jar