Home » Language IDEs » AspectJ » Newbie got a NullPointerException :)
Newbie got a NullPointerException :) [message #56704] |
Sat, 24 September 2005 22:51 |
Eclipse User |
|
|
|
Originally posted by: Dominik.pich.info
Well, I'm quite new to AOP,aspectJ and AJDT, so I cannot really judge when
it is ME making a mistake or the computer(aspectj/ajdt)
Anyway, when compiled the code below with eclipse 3.1 using ajdt throws a
NullPointerException...
---
Eclipse AspectJ Development Tools
Version: 1.3.0
Build id: 20050921231918
AspectJ version: 1.5.0.20050919101948
---
package org.implemented.ed2kRelay.aspects;
import org.implemented.library.net.IDataPool;
import org.implemented.library.net.messaging.Message;
/**
* This class provides support for throwing exceptions when a call to a
data pool fails
* Only applicaple for pools typed <Message, Integer>
*/
public aspect Validate {
pointcut valid(IDataPool pool, Message value, Integer key):
call(public boolean IDataPool.validate(Message, Integer))
&& target(pool)
&& args(value, key);
after(IDataPool pool, Message value, Integer key) returning(boolean
validated): valid(pool,value,key) {
doConditionalThrow(value, (Message)pool.get(key), validated);
}
/*
* From here on, it's an ordinary class implementation.
*/
private void doConditionalThrow(Message value, Message keyed, boolean
b) {
//look at bool passed
}
}
|
|
|
Re: Newbie got a NullPointerException :) [message #56786 is a reply to message #56704] |
Mon, 26 September 2005 16:52 |
Matt Chapman Messages: 429 Registered: July 2009 |
Senior Member |
|
|
Hi Dominik,
The syntax looks okay to me. Did the NullPointerException appear in a
dialog box when building the project? If so, it probably indicates a
compiler bug. Can you do "Show view > Error log" and see if you can
extract a stack trace for the exception?
Regards,
Matt.
Dominik Pich wrote:
> Well, I'm quite new to AOP,aspectJ and AJDT, so I cannot really judge when
> it is ME making a mistake or the computer(aspectj/ajdt)
> Anyway, when compiled the code below with eclipse 3.1 using ajdt throws a
> NullPointerException...
> ---
> Eclipse AspectJ Development Tools
> Version: 1.3.0
> Build id: 20050921231918
> AspectJ version: 1.5.0.20050919101948
> ---
> package org.implemented.ed2kRelay.aspects;
> import org.implemented.library.net.IDataPool;
> import org.implemented.library.net.messaging.Message;
> /**
> * This class provides support for throwing exceptions when a call to a
> data pool fails
> * Only applicaple for pools typed <Message, Integer>
> */
> public aspect Validate {
> pointcut valid(IDataPool pool, Message value, Integer key):
> call(public boolean IDataPool.validate(Message, Integer))
> && target(pool)
> && args(value, key);
> after(IDataPool pool, Message value, Integer key) returning(boolean
> validated): valid(pool,value,key) {
> doConditionalThrow(value, (Message)pool.get(key), validated);
> }
> /*
> * From here on, it's an ordinary class implementation.
> */
> private void doConditionalThrow(Message value, Message keyed, boolean
> b) {
> //look at bool passed
> }
> }
|
|
|
Re: Newbie got a NullPointerException :) [message #56840 is a reply to message #56786] |
Mon, 26 September 2005 19:06 |
Eclipse User |
|
|
|
Originally posted by: Dominik.pich.info
Thanks for helping :)
NullPointerException thrown: null
trace:
----
java.lang.NullPointerException
at
org.aspectj.weaver.ResolvedType.lookupResolvedMember(Resolve dType.java:350)
at
org.aspectj.weaver.ResolvedMemberImpl.accumulateMembersMatch ing(ResolvedMemberImpl.java:212)
at
org.aspectj.weaver.ResolvedMemberImpl.getJoinPointSignatures (ResolvedMemberImpl.java:166)
at
org.aspectj.weaver.MemberImpl.getJoinPointSignatures(MemberI mpl.java:917)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(Signatu rePattern.java:150)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(Kin dedPointcut.java:111)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:63)
at org.aspectj.weaver.Advice.match(Advice.java:101)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1727)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstructi on(BcelClassWeaver.java:1716)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1529)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInit(BcelClassW eaver.java:1393)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1322)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:381)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:96)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:141 5)
at
org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeav er.java:1380)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver .java:1157)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:100 1)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(A jCompilerAdapter.java:286)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCo mpiling(AjCompilerAdapter.java:165)
at
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after Returning$org_aspectj_ajdt_internal_compiler_CompilerAdapter $2$f9cc9ca0(CompilerAdapter.aj:70)
at
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compi le(Compiler.java:367)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.perfor mCompilation(AjBuildManager.java:728)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuil d(AjBuildManager.java:229)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.increm entalBuild(AjBuildManager.java:147)
at
org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAd apter.java:115)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread .run(AspectJBuildManager.java:191)
|
|
| | |
Re: Newbie got a NullPointerException :) [message #590118 is a reply to message #56704] |
Mon, 26 September 2005 16:52 |
Matt Chapman Messages: 429 Registered: July 2009 |
Senior Member |
|
|
Hi Dominik,
The syntax looks okay to me. Did the NullPointerException appear in a
dialog box when building the project? If so, it probably indicates a
compiler bug. Can you do "Show view > Error log" and see if you can
extract a stack trace for the exception?
Regards,
Matt.
Dominik Pich wrote:
> Well, I'm quite new to AOP,aspectJ and AJDT, so I cannot really judge when
> it is ME making a mistake or the computer(aspectj/ajdt)
> Anyway, when compiled the code below with eclipse 3.1 using ajdt throws a
> NullPointerException...
> ---
> Eclipse AspectJ Development Tools
> Version: 1.3.0
> Build id: 20050921231918
> AspectJ version: 1.5.0.20050919101948
> ---
> package org.implemented.ed2kRelay.aspects;
> import org.implemented.library.net.IDataPool;
> import org.implemented.library.net.messaging.Message;
> /**
> * This class provides support for throwing exceptions when a call to a
> data pool fails
> * Only applicaple for pools typed <Message, Integer>
> */
> public aspect Validate {
> pointcut valid(IDataPool pool, Message value, Integer key):
> call(public boolean IDataPool.validate(Message, Integer))
> && target(pool)
> && args(value, key);
> after(IDataPool pool, Message value, Integer key) returning(boolean
> validated): valid(pool,value,key) {
> doConditionalThrow(value, (Message)pool.get(key), validated);
> }
> /*
> * From here on, it's an ordinary class implementation.
> */
> private void doConditionalThrow(Message value, Message keyed, boolean
> b) {
> //look at bool passed
> }
> }
|
|
|
Re: Newbie got a NullPointerException :) [message #590147 is a reply to message #56786] |
Mon, 26 September 2005 19:06 |
Eclipse User |
|
|
|
Originally posted by: Dominik.pich.info
Thanks for helping :)
NullPointerException thrown: null
trace:
----
java.lang.NullPointerException
at
org.aspectj.weaver.ResolvedType.lookupResolvedMember(Resolve dType.java:350)
at
org.aspectj.weaver.ResolvedMemberImpl.accumulateMembersMatch ing(ResolvedMemberImpl.java:212)
at
org.aspectj.weaver.ResolvedMemberImpl.getJoinPointSignatures (ResolvedMemberImpl.java:166)
at
org.aspectj.weaver.MemberImpl.getJoinPointSignatures(MemberI mpl.java:917)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(Signatu rePattern.java:150)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(Kin dedPointcut.java:111)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:63)
at org.aspectj.weaver.Advice.match(Advice.java:101)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1727)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstructi on(BcelClassWeaver.java:1716)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1529)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInit(BcelClassW eaver.java:1393)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1322)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:381)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:96)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:141 5)
at
org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeav er.java:1380)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver .java:1157)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:100 1)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(A jCompilerAdapter.java:286)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCo mpiling(AjCompilerAdapter.java:165)
at
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after Returning$org_aspectj_ajdt_internal_compiler_CompilerAdapter $2$f9cc9ca0(CompilerAdapter.aj:70)
at
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compi le(Compiler.java:367)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.perfor mCompilation(AjBuildManager.java:728)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuil d(AjBuildManager.java:229)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.increm entalBuild(AjBuildManager.java:147)
at
org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAd apter.java:115)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread .run(AspectJBuildManager.java:191)
|
|
| | |
Goto Forum:
Current Time: Sat Nov 09 05:52:18 GMT 2024
Powered by FUDForum. Page generated in 0.05799 seconds
|