HighTechTalks DotNet Forums  

java.lang.UnsupportedOperationException

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss java.lang.UnsupportedOperationException in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
kdiangel
 
Posts: n/a

Default java.lang.UnsupportedOperationException - 05-11-2005 , 11:57 PM






At the following line in my code the program simply exits. return

dataPoints.remove( (DataPoint)obj );

The exception message is:

java.lang.UnsupportedOperationException

How do I find out what is causing the exception?

Reply With Quote
  #2  
Old   
kdiangel
 
Posts: n/a

Default Re: java.lang.UnsupportedOperationException - 05-12-2005 , 12:10 PM






public boolean remove( Object obj )
{
if ( obj == null )
throw new NullPointerException("DataSet does not support null DataPoint
objects");

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


"Lars-Inge Tønnessen [VJ# MVP]" wrote:

Quote:
dataPoints.remove( (DataPoint)obj );

Please show us more code.


Regards,
Lars-Inge Tønnessen




Reply With Quote
  #3  
Old   
kdiangel
 
Posts: n/a

Default Re: java.lang.UnsupportedOperationException - 05-13-2005 , 12:42 AM



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

"Lars-Inge Tønnessen [VJ# MVP]" wrote:

Quote:
dataPoints.remove( (DataPoint)obj );

Please show us more code.


Regards,
Lars-Inge Tønnessen




Reply With Quote
  #4  
Old   
kdiangelis
 
Posts: n/a

Default Re: java.lang.UnsupportedOperationException - 05-21-2005 , 02:57 PM



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


"Lars-Inge Tønnessen [VJ# MVP]" wrote:

Quote:
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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.