Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-10 Thread Sunburned Surveyor

I want to send a quick thank you note to Michael, Craig, and Bob for their
help with my JUnit test. I made the fixes that were needed and the JUnit
test is now working properly.

I'm sure I'll have more JUnit tests as I move forward.

Thanks Again,

The Sunburned Surveyor

On 5/5/07, Michaël Michaud <[EMAIL PROTECTED]> wrote:


Hi,

What do you think about :

if (renderer == null) {
fail("returned renderer is null");
else if (!renderer instanceof LayerRenderer) {
fail("returned renderer is a " + renderer.getClass().getName());
}
}

Michaël

Sunburned Surveyor a écrit :

> That does help a little Michael.
>
> I'm basically checking two things in my test method, of which I only
> posted a snippet. I want to [1] make sure that the object returned by
> the RendererFactoryTool isn't null, and that [2] it is an instance of
> the LayerRenderer class.
>
> I appreciate the tip on the use of the instanceof operator. That will
> make my code a little cleaner.
>
> The Sunburned Surveyor
>
> On 5/5/07, *Michaël Michaud* <[EMAIL PROTECTED]
> > wrote:
>
> Hi,
>
> Maybe I don't see what you want to do (I just woke up), but it seems
> that your comment doesn't match your test.
> If testResult is an instance of LayerRenderer, so the renderer
> returned
> IS an instance of LayerRenderer !
>
> One more detail : "instance of" is a kind of boolean operator, you
can
> just write : if (c instanceof LayerManager)
> No need to add == true
>
> Hope that helps
>
> Michaël
>
> A. Craig West a écrit :
>
> >I think it's just a typo, you have an extra semicolon at the end
> of the if...
> >-Craig
> >
> >On 5/4/07, Sunburned Surveyor < [EMAIL PROTECTED]
> > wrote:
> >
> >
> >>Hey guys. I need some help with the use of the instanceof
> operator. This one
> >>really has me stumped. :]
> >>
> >>In one of my unit tests I have the following test method:
> >>
> >>else if(testResult instanceof
> >>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> >>== true);
> >>{
> >>Class thisClass = testResult.getClass();
> >>String toPrint = thisClass.getName();
> >>fail("The renderer returned was not an instance of
> >>LayerRenderer. The object " +
> >>"returned was a " + toPrint);
> >>}
> >>
> >>This test method fails and prints the following message: "The
> renderer
> >>returned was not an instance of LayerRenderer. The ojbect
> >> returned was a
> >>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"
> >>
> >>How could the testResult object not be an instance of the
> >>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> >>when I use the instanceof operator, but be an object of that
> same class as
> >>indicated by the error message?
> >>
> >>Am I using the instanceof operator incorrectly?
> >>
> >>Thanks in advance for the help.
> >>
> >>The Sunburned Surveyor
> >>
> >>
> >>
>
>>-
>
> >>This SF.net email is sponsored by DB2 Express
> >>Download DB2 Express C - the FREE version of DB2 express and take
> >>control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >>___
> >>Jump-pilot-devel mailing list
> >> Jump-pilot-devel@lists.sourceforge.net
> 
> >>https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >>
> >>
> >>
> >>
> >
>
>-
> >This SF.net email is sponsored by DB2 Express
> >Download DB2 Express C - the FREE version of DB2 express and take
> >control of your XML. No limits. Just data. Click to get it now.
> >http://sourceforge.net/powerbar/db2/
> >___
> >Jump-pilot-devel mailing list
> >Jump-pilot-devel@lists.sourceforge.net
> 
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
> >
> >
> >
>
>
>
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> 
> http

Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-05 Thread Michaël Michaud
Hi,

What do you think about :
 
if (renderer == null) {
fail("returned renderer is null");
else if (!renderer instanceof LayerRenderer) {
fail("returned renderer is a " + renderer.getClass().getName());
}
}

Michaël

Sunburned Surveyor a écrit :

> That does help a little Michael.
>  
> I'm basically checking two things in my test method, of which I only 
> posted a snippet. I want to [1] make sure that the object returned by 
> the RendererFactoryTool isn't null, and that [2] it is an instance of 
> the LayerRenderer class.
>  
> I appreciate the tip on the use of the instanceof operator. That will 
> make my code a little cleaner.
>  
> The Sunburned Surveyor
>  
> On 5/5/07, *Michaël Michaud* <[EMAIL PROTECTED] 
> > wrote:
>
> Hi,
>
> Maybe I don't see what you want to do (I just woke up), but it seems
> that your comment doesn't match your test.
> If testResult is an instance of LayerRenderer, so the renderer
> returned
> IS an instance of LayerRenderer !
>
> One more detail : "instance of" is a kind of boolean operator, you can
> just write : if (c instanceof LayerManager)
> No need to add == true
>
> Hope that helps
>
> Michaël
>
> A. Craig West a écrit :
>
> >I think it's just a typo, you have an extra semicolon at the end
> of the if...
> >-Craig
> >
> >On 5/4/07, Sunburned Surveyor < [EMAIL PROTECTED]
> > wrote:
> >
> >
> >>Hey guys. I need some help with the use of the instanceof
> operator. This one
> >>really has me stumped. :]
> >>
> >>In one of my unit tests I have the following test method:
> >>
> >>else if(testResult instanceof
> >>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> >>== true);
> >>{
> >>Class thisClass = testResult.getClass();
> >>String toPrint = thisClass.getName();
> >>fail("The renderer returned was not an instance of
> >>LayerRenderer. The object " +
> >>"returned was a " + toPrint);
> >>}
> >>
> >>This test method fails and prints the following message: "The
> renderer
> >>returned was not an instance of LayerRenderer. The ojbect
> >> returned was a
> >>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"
> >>
> >>How could the testResult object not be an instance of the
> >>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> >>when I use the instanceof operator, but be an object of that
> same class as
> >>indicated by the error message?
> >>
> >>Am I using the instanceof operator incorrectly?
> >>
> >>Thanks in advance for the help.
> >>
> >>The Sunburned Surveyor
> >>
> >>
> >>
> 
> >>-
>
> >>This SF.net email is sponsored by DB2 Express
> >>Download DB2 Express C - the FREE version of DB2 express and take
> >>control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >>___
> >>Jump-pilot-devel mailing list
> >> Jump-pilot-devel@lists.sourceforge.net
> 
> >>https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >>
> >>
> >>
> >>
> >
> >-
> >This SF.net email is sponsored by DB2 Express
> >Download DB2 Express C - the FREE version of DB2 express and take
> >control of your XML. No limits. Just data. Click to get it now.
> >http://sourceforge.net/powerbar/db2/
> >___
> >Jump-pilot-devel mailing list
> >Jump-pilot-devel@lists.sourceforge.net
> 
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
> >
> >
> >
>
>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> 
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>
>
>-
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version

Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-05 Thread Sunburned Surveyor

That does help a little Michael.

I'm basically checking two things in my test method, of which I only posted
a snippet. I want to [1] make sure that the object returned by the
RendererFactoryTool isn't null, and that [2] it is an instance of the
LayerRenderer class.

I appreciate the tip on the use of the instanceof operator. That will make
my code a little cleaner.

The Sunburned Surveyor

On 5/5/07, Michaël Michaud <[EMAIL PROTECTED]> wrote:


Hi,

Maybe I don't see what you want to do (I just woke up), but it seems
that your comment doesn't match your test.
If testResult is an instance of LayerRenderer, so the renderer returned
IS an instance of LayerRenderer !

One more detail : "instance of" is a kind of boolean operator, you can
just write : if (c instanceof LayerManager)
No need to add == true

Hope that helps

Michaël

A. Craig West a écrit :

>I think it's just a typo, you have an extra semicolon at the end of the
if...
>-Craig
>
>On 5/4/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
>
>
>>Hey guys. I need some help with the use of the instanceof operator. This
one
>>really has me stumped. :]
>>
>>In one of my unit tests I have the following test method:
>>
>>else if(testResult instanceof
>>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
>>== true);
>>{
>>Class thisClass = testResult.getClass();
>>String toPrint = thisClass.getName();
>>fail("The renderer returned was not an instance of
>>LayerRenderer. The object " +
>>"returned was a " + toPrint);
>>}
>>
>>This test method fails and prints the following message: "The renderer
>>returned was not an instance of LayerRenderer. The ojbect
>> returned was a
>>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"
>>
>>How could the testResult object not be an instance of the
>>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
>>when I use the instanceof operator, but be an object of that same class
as
>>indicated by the error message?
>>
>>Am I using the instanceof operator incorrectly?
>>
>>Thanks in advance for the help.
>>
>>The Sunburned Surveyor
>>
>>
>>

>>-
>>This SF.net email is sponsored by DB2 Express
>>Download DB2 Express C - the FREE version of DB2 express and take
>>control of your XML. No limits. Just data. Click to get it now.
>>http://sourceforge.net/powerbar/db2/
>>___
>>Jump-pilot-devel mailing list
>>Jump-pilot-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
>>
>>
>>
>
>-
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>___
>Jump-pilot-devel mailing list
>Jump-pilot-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>
>


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-05 Thread Michaël Michaud
Hi,

Maybe I don't see what you want to do (I just woke up), but it seems 
that your comment doesn't match your test.
If testResult is an instance of LayerRenderer, so the renderer returned 
IS an instance of LayerRenderer !

One more detail : "instance of" is a kind of boolean operator, you can 
just write : if (c instanceof LayerManager)
No need to add == true

Hope that helps

Michaël

A. Craig West a écrit :

>I think it's just a typo, you have an extra semicolon at the end of the if...
>-Craig
>
>On 5/4/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
>  
>
>>Hey guys. I need some help with the use of the instanceof operator. This one
>>really has me stumped. :]
>>
>>In one of my unit tests I have the following test method:
>>
>>else if(testResult instanceof
>>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
>>== true);
>>{
>>Class thisClass = testResult.getClass();
>>String toPrint = thisClass.getName();
>>fail("The renderer returned was not an instance of
>>LayerRenderer. The object " +
>>"returned was a " + toPrint);
>>}
>>
>>This test method fails and prints the following message: "The renderer
>>returned was not an instance of LayerRenderer. The ojbect
>> returned was a
>>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"
>>
>>How could the testResult object not be an instance of the
>>com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
>>when I use the instanceof operator, but be an object of that same class as
>>indicated by the error message?
>>
>>Am I using the instanceof operator incorrectly?
>>
>>Thanks in advance for the help.
>>
>>The Sunburned Surveyor
>>
>>
>>
>>-
>>This SF.net email is sponsored by DB2 Express
>>Download DB2 Express C - the FREE version of DB2 express and take
>>control of your XML. No limits. Just data. Click to get it now.
>>http://sourceforge.net/powerbar/db2/
>>___
>>Jump-pilot-devel mailing list
>>Jump-pilot-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
>>
>>
>>
>
>-
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>___
>Jump-pilot-devel mailing list
>Jump-pilot-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>  
>


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-04 Thread Sunburned Surveyor

Craig,

I've never thought about "pair programming" in that way. I'm a hobby
programmer, and don't have anyone to check my code, except for the
occasional patient soul on this mailing list. I do know how many mistakes
are caught by a second set of eyes at my day job, I just never thought about
the same thing happening with my programming.

I think I'd be really up a creek without a paddle if I didn't have an editor
like Eclipse to help me discover my errors.

It would be like a word processor without spellcheck.

The Sunburned Surveyor


On 5/4/07, A. Craig West <[EMAIL PROTECTED]> wrote:


The one advantage of being an editor luddite who only uses vi is that
I'm used to having to find this stuff myself :-) It's things like this
that have always had me wondering if pair programming would be worth
it, whenever I have worked as part of a pair, it seems like we are a
lot more productive, but I've never been able to convince management
that it is enough of a factor to justify it...
-Craig

On 5/4/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> Sure thing. I wonder why I didn't see that error in my Eclipse editor?
>
> I'll make the correction and see if that fixes the problem.
>
> Thanks very much for the help Craig. Sometimes the second pair of eyes
> catches something very obvious.
>
> The Sunburned Surveyor
>
>
> On 5/4/07, A. Craig West <[EMAIL PROTECTED]> wrote:
> >
> > I think it's just a typo, you have an extra semicolon at the end of
the
> if...
> > -Craig
> >
> > On 5/4/07, Sunburned Surveyor < [EMAIL PROTECTED]> wrote:
> > > Hey guys. I need some help with the use of the instanceof operator.
This
> one
> > > really has me stumped. :]
> > >
> > > In one of my unit tests I have the following test method:
> > >
> > > else if(testResult instanceof
> > >
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> > > == true);
> > > {
> > > Class thisClass = testResult.getClass();
> > > String toPrint = thisClass.getName();
> > > fail("The renderer returned was not an instance of
> > > LayerRenderer. The object " +
> > > "returned was a " + toPrint);
> > > }
> > >
> > > This test method fails and prints the following message: "The
renderer
> > > returned was not an instance of LayerRenderer. The ojbect
> > >  returned was a
> > >
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> "
> > >
> > > How could the testResult object not be an instance of the
> > >
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> > > when I use the instanceof operator, but be an object of that same
class
> as
> > > indicated by the error message?
> > >
> > > Am I using the instanceof operator incorrectly?
> > >
> > > Thanks in advance for the help.
> > >
> > > The Sunburned Surveyor
> > >
> > >
> > >
> > >
>
-
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > ___
> > > Jump-pilot-devel mailing list
> > > Jump-pilot-devel@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> > >
> > >
> >
> >
>
-
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > ___
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
>
>
>
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the

Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-04 Thread A. Craig West
The one advantage of being an editor luddite who only uses vi is that
I'm used to having to find this stuff myself :-) It's things like this
that have always had me wondering if pair programming would be worth
it, whenever I have worked as part of a pair, it seems like we are a
lot more productive, but I've never been able to convince management
that it is enough of a factor to justify it...
-Craig

On 5/4/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> Sure thing. I wonder why I didn't see that error in my Eclipse editor?
>
> I'll make the correction and see if that fixes the problem.
>
> Thanks very much for the help Craig. Sometimes the second pair of eyes
> catches something very obvious.
>
> The Sunburned Surveyor
>
>
> On 5/4/07, A. Craig West <[EMAIL PROTECTED]> wrote:
> >
> > I think it's just a typo, you have an extra semicolon at the end of the
> if...
> > -Craig
> >
> > On 5/4/07, Sunburned Surveyor < [EMAIL PROTECTED]> wrote:
> > > Hey guys. I need some help with the use of the instanceof operator. This
> one
> > > really has me stumped. :]
> > >
> > > In one of my unit tests I have the following test method:
> > >
> > > else if(testResult instanceof
> > >
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> > > == true);
> > > {
> > > Class thisClass = testResult.getClass();
> > > String toPrint = thisClass.getName();
> > > fail("The renderer returned was not an instance of
> > > LayerRenderer. The object " +
> > > "returned was a " + toPrint);
> > > }
> > >
> > > This test method fails and prints the following message: "The renderer
> > > returned was not an instance of LayerRenderer. The ojbect
> > >  returned was a
> > >
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> "
> > >
> > > How could the testResult object not be an instance of the
> > >
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> > > when I use the instanceof operator, but be an object of that same class
> as
> > > indicated by the error message?
> > >
> > > Am I using the instanceof operator incorrectly?
> > >
> > > Thanks in advance for the help.
> > >
> > > The Sunburned Surveyor
> > >
> > >
> > >
> > >
> -
> > > This SF.net email is sponsored by DB2 Express
> > > Download DB2 Express C - the FREE version of DB2 express and take
> > > control of your XML. No limits. Just data. Click to get it now.
> > > http://sourceforge.net/powerbar/db2/
> > > ___
> > > Jump-pilot-devel mailing list
> > > Jump-pilot-devel@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> > >
> > >
> >
> >
> -
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > ___
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> >
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
>
>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-04 Thread Sunburned Surveyor

Sure thing. I wonder why I didn't see that error in my Eclipse editor?

I'll make the correction and see if that fixes the problem.

Thanks very much for the help Craig. Sometimes the second pair of eyes
catches something very obvious.

The Sunburned Surveyor


On 5/4/07, A. Craig West <[EMAIL PROTECTED]> wrote:


I think it's just a typo, you have an extra semicolon at the end of the
if...
-Craig

On 5/4/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> Hey guys. I need some help with the use of the instanceof operator. This
one
> really has me stumped. :]
>
> In one of my unit tests I have the following test method:
>
> else if(testResult instanceof
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> == true);
> {
> Class thisClass = testResult.getClass();
> String toPrint = thisClass.getName();
> fail("The renderer returned was not an instance of
> LayerRenderer. The object " +
> "returned was a " + toPrint);
> }
>
> This test method fails and prints the following message: "The renderer
> returned was not an instance of LayerRenderer. The ojbect
>  returned was a
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"
>
> How could the testResult object not be an instance of the
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> when I use the instanceof operator, but be an object of that same class
as
> indicated by the error message?
>
> Am I using the instanceof operator incorrectly?
>
> Thanks in advance for the help.
>
> The Sunburned Surveyor
>
>
>
>
-
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


Re: [JPP-Devel] Proper use of instanceof operator?

2007-05-04 Thread A. Craig West
I think it's just a typo, you have an extra semicolon at the end of the if...
-Craig

On 5/4/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> Hey guys. I need some help with the use of the instanceof operator. This one
> really has me stumped. :]
>
> In one of my unit tests I have the following test method:
>
> else if(testResult instanceof
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> == true);
> {
> Class thisClass = testResult.getClass();
> String toPrint = thisClass.getName();
> fail("The renderer returned was not an instance of
> LayerRenderer. The object " +
> "returned was a " + toPrint);
> }
>
> This test method fails and prints the following message: "The renderer
> returned was not an instance of LayerRenderer. The ojbect
>  returned was a
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"
>
> How could the testResult object not be an instance of the
> com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer
> when I use the instanceof operator, but be an object of that same class as
> indicated by the error message?
>
> Am I using the instanceof operator incorrectly?
>
> Thanks in advance for the help.
>
> The Sunburned Surveyor
>
>
>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


[JPP-Devel] Proper use of instanceof operator?

2007-05-04 Thread Sunburned Surveyor

Hey guys. I need some help with the use of the instanceof operator. This one
really has me stumped. :]

In one of my unit tests I have the following test method:

   else if(testResult instanceof
com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer == true);
   {
   Class thisClass = testResult.getClass();
   String toPrint = thisClass.getName();
   fail("The renderer returned was not an instance of
LayerRenderer. The object " +
   "returned was a " + toPrint);
   }

This test method fails and prints the following message: "The renderer
returned was not an instance of LayerRenderer. The ojbect
returned was a com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer"

How could the testResult object not be an instance of the
com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer when I use the
instanceof operator, but be an object of that same class as indicated by the
error message?

Am I using the instanceof operator incorrectly?

Thanks in advance for the help.

The Sunburned Surveyor
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel