Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] NPE in IHasAttributes.removeAttributeValue

Hello,

I am trying to remove an attribute's specified value from an Entity using
the JNDI context provider. Here is the code:

IEntity person = context.getEntity("uid=riyer,o=JNDITest");
person.removeAttributeValue(new URI("telephoneNumber"), "25691129");

It is failing with a NullPointerException. The stack trace shows:

java.lang.NullPointerException
      at org.eclipse.higgins.idas.spi.BasicAttribute.<init>(
BasicAttribute.java:105)
      at
org.eclipse.higgins.idas.spi.BasicAttributeSet.removeAttributeValue(
BasicAttributeSet.java:175)
      at org.eclipse.higgins.idas.spi.BasicEntity.removeAttributeValue(
BasicEntity.java:228)
      at org.eclipse.higgins.idas.cp.jndi.JNDIEntity.removeAttributeValue(
JNDIEntity.java:401)
      at
org.eclipse.higgins.idas.cp.jndi.test.JNDICPTest.testRemoveAttributeValueFromPerson(
JNDICPTest.java:108)

The problem lies in the BasicAttribute constructor:

public BasicAttribute(
            URI attrID,
            Object data,
            IAttributeContainer container,
            IContext context) throws IdASException {
            _context = context;
            // Turn the value into an IAttribute
            IAttributeValueModel valueModel = this
.getModel().getValueModel();
                                 .....

Here, the getModel() call is attempted on an uninitialized instance. It
might be needed to modify this API to pass the Object data type as an
argument.

Is this a known problem? If not, should I go ahead and create a bug report
for the same?

Thanks,
Best regards,
Rajalakshmi Iyer



Back to the top