Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] [Minor patch] NPE fix in ChildRelationshipDecoderHelper.java

For IP tracking purposes, I would advise that you open a bug and then attach your patch(es) to the bug. If you want a wider audience to see your work / review your ideas, you can then post a link in the mailing list, and subsequent discussion can occur in the bug itself.

It's also easier to use patches if they're in bugs (if you use Mylyn, you can apply them directly from the bug editor).

That said, thanks for contributing! :)

$0.02,

Nick

Kenneth Styrberg wrote:
Hi, here's another minor patch to get VE and SWT to work better together. The problem is that no write method is set in this call, so I added a check.
Maybe we should fix the cause of the NPE instead of checking for it?

I posted another patch in the newsgroup before I realized there was a dev list.

Again, I've very little knowledge on whats going on under the hood. For example when adding a FormAttachment there seem to be some mixup on how to set it to the FormData. The correct syntax is for example "formData.left = formAttachment;" but VE creates "formData.left(formAttachment);". Where it goes wrong I've no idea, so if someone could enlighten
me I would be grateful!

Regards.

Index: codegen/org/eclipse/ve/internal/java/codegen/java/ChildRelationshipDecoderHelper.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.ve/plugins/org.eclipse.ve.java.core/codegen/org/eclipse/ve/internal/java/codegen/java/ChildRelationshipDecoderHelper.java,v
retrieving revision 1.25
diff -u -r1.25 ChildRelationshipDecoderHelper.java
--- codegen/org/eclipse/ve/internal/java/codegen/java/ChildRelationshipDecoderHelper.java 16 Sep 2005 13:34:48 -0000 1.25 +++ codegen/org/eclipse/ve/internal/java/codegen/java/ChildRelationshipDecoderHelper.java 18 Apr 2009 10:07:50 -0000
@@ -555,12 +555,15 @@
    protected int getSFPriority() {
        if(fFmapper!=null){
            String methodName = null;
-            if (fFmapper.getDecorator() != null)
+ if (fFmapper.getDecorator() != null && fFmapper.getDecorator().isSetWriteMethod()) { methodName = fFmapper.getDecorator().getWriteMethod().getName();
-            if (methodName == null)
+            }
+            if (methodName == null) {
methodName = AbstractFeatureMapper.getPropertyMethod(fExpr);
-            if(methodName!=null)
+            }
+            if(methodName!=null) {
                return fFmapper.getFeaturePriority(methodName);
+            }
        }
        return super.getSFPriority();
    }
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev

--
Nick Boldt :: http://wiki.eclipse.org/User:Nickb
Release Engineer :: Eclipse Modeling & Dash Athena


Back to the top