all groups > vj# > may 2005 >
You're in the

vj#

group:

java.lang.UnsupportedOperationException


java.lang.UnsupportedOperationException kdiangel
5/11/2005 8:57:09 PM
vj#:
At the following line in my code the program simply exits. return

dataPoints.remove( (DataPoint)obj );

The exception message is:

java.lang.UnsupportedOperationException

Re: java.lang.UnsupportedOperationException kdiangel
5/12/2005 9:10:31 AM
public boolean remove( Object obj )
{
if ( obj == null )
throw new NullPointerException("DataSet does not support null DataPoint
objects");

return dataPoints.remove( (DataPoint)obj );
}


[quoted text, click to view]
Re: java.lang.UnsupportedOperationException Lars-Inge Tønnessen [VJ# MVP]
5/12/2005 5:52:21 PM

[quoted text, click to view]

Please show us more code.


Regards,
Lars-Inge Tønnessen

Re: java.lang.UnsupportedOperationException kdiangel
5/12/2005 9:42:02 PM
Was the code I provided of any more help? I can't figure out what could be
wrong. Any help would be greatly appreciated.

Best regards,

Keith

[quoted text, click to view]
Re: java.lang.UnsupportedOperationException Lars-Inge Tønnessen [VJ# MVP]
5/18/2005 7:10:34 PM
Hi Keith,

I have been out of town for a few days.



public boolean remove( Object obj )
{
return dataPoints.remove( (DataPoint)obj );
}

Sorry, this did not tell me anything why it's not working.

What is dataPoints ?
Where do you make an instance of dataPoints?

( I would guess the dataPoints object is empty (null).)



What will happen if you do anything like this?

public boolean remove( Object obj )
{
if ( dataPoints == null ) return false;
return dataPoints.remove( (DataPoint)obj );
}



Regards,
Lars-Inge Tønnessen

Re: java.lang.UnsupportedOperationException kdiangelis
5/21/2005 11:57:38 AM
Thanks. I tried that and it passes right over it.

I looked up in the MSDN library, and java.util.Collection.Remove is not
supported. I'm wondering why it compiles? Anyway, do you know if there is
an equivalent for it in the .NET Framework?

--
KVD


[quoted text, click to view]
AddThis Social Bookmark Button