Community
Participate
Working Groups
org.eclipse.swt.examples.controlexample.Tab.parameterInfo(String): returnType may be null: String typeName = null; Class returnType = getReturnType(methodRoot); boolean isArray = returnType.isArray(); if (isArray) { typeName = returnType.getComponentType().getName(); } else { typeName = returnType.getName(); } possible solution: wrap this code into try/catch: Class returnType = getReturnType(methodRoot); String typeName; boolean isArray; try { isArray = returnType.isArray(); if (isArray) { typeName = returnType.getComponentType().getName(); } else { typeName = returnType.getName(); } } catch (NullPointerException e) { isArray = false; typeName = "<<UnknownReturnType>>"; }
do you have a case that fails ? I believe that methodRoot always have a return type, otherwise it wouldn't be in the nameCombo control. Ivan, are you using a tool to detect bugs in SWT ? Which one ?
> do you have a case that fails ? > I believe that methodRoot always have a return type, otherwise it wouldn't be > in the nameCombo control. If an exception is caught in getReturnType() then it returns null. Why is try/catch present in getReturnType()? I think this can't fail under normal conditions too. In my case I've obfuscated method names (I hadn't known that getters/setters are used by Tab) and pressed "Set/Get API" button, and got ControlExample termination due to NPE. > > > Ivan, are you using a tool to detect bugs in SWT ? Which one ? I'm experimenting with Java-to-C translation. Sometimes GCC complains about the code...
> I'm experimenting with Java-to-C translation. Very cool.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.