Re: NPE in Builder.java

From: Mike Schrag (mschra..dimension.com)
Date: Thu Nov 13 2008 - 09:33:42 EST

  • Next message: Juergen Lorenz Simon: "Problem with WO53 and Eclipse 3.4.1, WOLips 3.4.5535"

    Thanks for these patches ... In the future, it helps keep things
    organized for us if you can log them into Jira instead of just posting
    on the mailing list.

    ms

    On Nov 13, 2008, at 8:39 AM, Jochen Hansmeyer wrote:

    > Hi,
    >
    > another suggestion: I sometimes get a NullPointerException. I don't
    > know which configuration problems are responsible for
    > projectAdapter.getBuildAdapter() returning null. This is just to
    > prevent the NPE.
    >
    >
    > best regards
    > Jochen
    >
    >
    > --- woproject/wolips/core/plugins/org.objectstyle.wolips/java/org/
    > objectstyle/wolips/core/resources/internal/build/Builder.java
    > (revision 5538)
    > +++ woproject/wolips/core/plugins/org.objectstyle.wolips/java/org/
    > objectstyle/wolips/core/resources/internal/build/Builder.java
    > (working copy)
    >.. -103,7 +103,10 @@
    > protected IProject[] build(int kind, Map args, IProgressMonitor
    > monitor) throws CoreException {
    > IProject project = this.getProject();
    > IProjectAdapter projectAdapter = (IProjectAdapter)
    > project.getAdapter(IProjectAdapter.class);
    > - IBuildAdapter buildAdapter = projectAdapter.getBuildAdapter();
    > + IBuildAdapter buildAdapter = null;
    > + if ( projectAdapter != null ) {
    > + buildAdapter = projectAdapter.getBuildAdapter();
    > + }
    >
    > if (kind == IncrementalProjectBuilder.FULL_BUILD) {
    > this.clean(monitor);
    >



    This archive was generated by hypermail 2.0.0 : Thu Nov 13 2008 - 09:34:34 EST