BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Italicized method names in JBuilder

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE
View previous topic :: View next topic  
Author Message
Mark
Guest





PostPosted: Sat Apr 24, 2004 9:14 pm    Post subject: Italicized method names in JBuilder Reply with quote



I have a ClassB that subclasses ClassA. ClassC has a reference to ClassB.
Using JBuilder MemberInsight in ClassC, the reference to ClassB shows only
the methods in ClassB but not those inherited from ClassA (the ones I wish
to use in this instance). Is this normal? From past experience I thought
that superclass members are available through extension and thus should be
also visible in MemberInsight.

In class A, JBuilder has italicized the method names. I have a feeling that
this might have something to do with the problem above but I don't know what
italicized method names represent. What does this signify?

Thanks for your help.
Mark


Back to top
Shankar Unni
Guest





PostPosted: Sun Apr 25, 2004 5:19 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote



Please do not cross-post. Post in only one newsgroup - pick whatever is
the most appropriate one. Restricting followups to b.p.j.ide.

Mark wrote:

Quote:
Using JBuilder MemberInsight in ClassC, the reference to ClassB shows only
the methods in ClassB but not those inherited from ClassA (the ones I wish
to use in this instance). Is this normal?

No. I think you'll have to show a more concrete example than just A, B
and C.

Quote:
In class A, JBuilder has italicized the method names.

This means that those methods themselves override or implement some
parent class or interface.

I think you'll be best off posting a *SMALL* example of class A, B and
C. Try to restrict the definitions to one member for each class, that
show this problem, with empty bodies, etc. (just to show the structure
of your classes).

Back to top
Mark
Guest





PostPosted: Sun Apr 25, 2004 8:55 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote



"Shankar Unni" <shankarunni (AT) netscape (DOT) net> wrote

Quote:
Please do not cross-post. Post in only one newsgroup - pick whatever is
the most appropriate one. Restricting followups to b.p.j.ide.

Sorry

Quote:

Mark wrote:

Using JBuilder MemberInsight in ClassC, the reference to ClassB shows
only
the methods in ClassB but not those inherited from ClassA (the ones I
wish
to use in this instance). Is this normal?

No. I think you'll have to show a more concrete example than just A, B
and C.

In class A, JBuilder has italicized the method names.

This means that those methods themselves override or implement some
parent class or interface.


Thanks


Quote:
I think you'll be best off posting a *SMALL* example of class A, B and
C. Try to restrict the definitions to one member for each class, that
show this problem, with empty bodies, etc. (just to show the structure
of your classes).

My classes are exceptions and quite small so I posted them fully:

-----------------------
public class MemberException extends Exception {

private String memberID; // required for all MemberException
subclasses

public MemberException(String memberID, Throwable cause) {
super(cause);
this.memberID = memberID;
}
public String getMemberID() {
return memberID;
}
}
----------------------------
public class MemberRegistrationException extends MemberException {

// no extra data required yet in this exception so just call superclass
constructor
public MemberRegistrationException( String memberID, Throwable cause ) {
super(memberID, cause);
}
}
----------------------------
public class MemberRegistrationSQLException extends
MemberRegistrationException {

// this type of exception should have access to SQLException data and
inherited superclass data
SQLException cause;
int errorCode;
String SQLState;

public MemberRegistrationSQLException( String memberID, SQLException
cause ) {
super(memberID, cause);
}
public int getErrorCode() {
errorCode = cause.getErrorCode();
return errorCode;
}
public String getSQLState() {
SQLState = cause.getSQLState();
return SQLState;
}
------------------------------------------------------

The idea being that my data access object should throw a
MemberRegistrationSQLException up from my data access layer to the
controller layer of my Struts-based web application which I want to be able
to access all the methods and data of the MemberRegistrationSQLException
subclass and its superclasses i.e. MemberRegistrationSQLException,
MemberRegistrationException, MemberException (if/when defined) and so on up
the inheritance chain. JBuilder's MemberInsight is only showing the methods
available in MemberRegistrationSQLException but not the superclasses.

I want to be able to do the following:

try {
int registerMemberResult = registrar.registerMember( member );
}
catch ( MemberRegistrationSQLException mrsqle ) {
servlet.log( "An error occurred while registering:
"+member.getMemberID(), mrsqle.getCause() );
}

but getCause() does not appear to be available, nor any other methods,
although should they not be inherited from Throwable via inheritance?

I'm just learning about exceptions, chaining exceptions etc. so I may be
confusing the concepts slightly.

Thanks
Mark





Back to top
Shankar Unni
Guest





PostPosted: Mon Apr 26, 2004 4:33 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote

Mark wrote:

Quote:
I want to be able
to access all the methods and data of the MemberRegistrationSQLException
subclass and its superclasses i.e. MemberRegistrationSQLException,
MemberRegistrationException, MemberException (if/when defined)

I'm afraid you can't do that. SQLState, vendorCode and next are
*private* in SQLException, and cannot be touched even by derived classes.

This has nothing to do with JBuilder per se - it'll only show you
members to which your class (the class of the object you're invoking
memberInsight on) actually has access.

Back to top
Mark
Guest





PostPosted: Mon Apr 26, 2004 6:38 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote


"Shankar Unni" <shankarunni (AT) netscape (DOT) net> wrote

Quote:
Mark wrote:

I want to be able
to access all the methods and data of the MemberRegistrationSQLException
subclass and its superclasses i.e. MemberRegistrationSQLException,
MemberRegistrationException, MemberException (if/when defined)

I'm afraid you can't do that. SQLState, vendorCode and next are
*private* in SQLException, and cannot be touched even by derived classes.

I suppose I should have been clearer given that I want to access the
variablesin the class hierarchy via the public getter methods. I can't see
any reason in the code why these public methods should not be inherited and
available in my subclass.

Quote:
This has nothing to do with JBuilder per se - it'll only show you
members to which your class (the class of the object you're invoking
memberInsight on) actually has access.

I know this thread has moved on from the matter of the JBuilder IDE to
practical Java programming so I posted a question in
comp.lang.java.programmer under the title "Creating / chaining exceptions
and inheriting from their superclasses" . As I have received no responses
from there yet so, at the moment, you arre the only one who has offered an
answer :0). Please feel free to follow up in the other newsgroup if you wish
to.

Thanks
Mark




Back to top
Mark
Guest





PostPosted: Mon Apr 26, 2004 7:27 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote

"Mark" <fake (AT) reallyisfake (DOT) com> wrote


Quote:
"Shankar Unni" <shankarunni (AT) netscape (DOT) net> wrote in message
news:408d39ed$1 (AT) newsgroups (DOT) borland.com...
Mark wrote:

I want to be able
to access all the methods and data of the
MemberRegistrationSQLException
subclass and its superclasses i.e. MemberRegistrationSQLException,
MemberRegistrationException, MemberException (if/when defined)

I'm afraid you can't do that. SQLState, vendorCode and next are
*private* in SQLException, and cannot be touched even by derived
classes.

I suppose I should have been clearer given that I want to access the
variablesin the class hierarchy via the public getter methods. I can't see
any reason in the code why these public methods should not be inherited
and
available in my subclass.

This has nothing to do with JBuilder per se - it'll only show you
members to which your class (the class of the object you're invoking
memberInsight on) actually has access.

I know this thread has moved on from the matter of the JBuilder IDE to
practical Java programming so I posted a question in
comp.lang.java.programmer under the title "Creating / chaining exceptions
and inheriting from their superclasses" . As I have received no responses
from there yet so, at the moment, you arre the only one who has offered an
answer :0). Please feel free to follow up in the other newsgroup if you
wish
to.


An interesting development has occurred which has possibly returned the
topic of this thread back to the JBuilder IDE.

My program is a web application in two parts (represented by two JBuilder
projects). One project represents the model layer (responsible for accessing
data sources) which will end up as a jar library in the web app, the second
project represents the (Struts-based) view/controller layer. Previously, I
was throwing my exception up from the model layer project to the
view/controller layer project (they both "see" each other as they are
configured in JBuilder as "required libraries" of each other).

I decided to implement some JUnit tests in the model layer as I felt that
this would be an easier way to debug the exceptions. However, when I use
MemberRegistrationSQLException in the model layer project I *do* have access
to all the methods in the class hierarchy!

So it seems that when I throw my exception up to a class in the
view/controller layer (a different JBuilder project) I lose access to the
API of my superclasses and can only access the methods in the subclass
itself! This is not good because I want to use the class in my controller
layer to log all the exception data in a servlet log file which I can only
do from the controller layer

I have no idea what produces this effect, it may or may not be the IDE for
all I know. If in some way you can assure me it is not the JBuilder IDE I
can try some other forums for an answer (unless you have an answer of
course!) ;0)

Thanks,
Mark



Back to top
Shankar Unni
Guest





PostPosted: Tue Apr 27, 2004 10:10 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote

Mark wrote:

Quote:
So it seems that when I throw my exception up to a class in the
view/controller layer (a different JBuilder project) I lose access to the
API of my superclasses and can only access the methods in the subclass
itself!

This doesn't strike any chords in me.. I've never had any trouble of
this sort - if a class has publicly visible members (even inherited),
I've always been able to see them.

package-protected access shouldn't be a factor here (the only thing that
can affect visibility like this).

I wonder if anyone else has seen anything like this.

Back to top
Gillmer J. Derge (TeamB)
Guest





PostPosted: Tue Apr 27, 2004 10:43 pm    Post subject: Re: Italicized method names in JBuilder Reply with quote

Shankar Unni wrote:
Quote:
I wonder if anyone else has seen anything like this.

I tried entering the sample code that was posted earlier. I wasn't able
to reproduce the problem. I invoked Insight on an instance of
MemberRegistrationSQLException, and the getCause method appeared in the
list. I wonder if perhaps there's an older version of some of these
classes on the classpath, and JBuilder is finding those instead of the
ones you think it should be finding.

How is your project set up? Do you have multiple source paths? Does it
include any libraries? What happens if you use ClassInsight
(Ctrl-Minus) to jump to the MemberRegistrationSQLException class? What
path is shown in the title bar? Is it the one you expect?

--
Gillmer J. Derge (TeamB)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.