harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Cornwall (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5594) [classlib][pack200] Deprecated classes don't have Deprecated attribute
Date Wed, 12 Mar 2008 16:06:46 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-5594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577892#action_12577892

Andrew Cornwall commented on HARMONY-5594:

That's my Smalltalk heritage showing :-) In Smalltalk it's considered poor form to expect
subtype and subclass behaviour to match - in other words, one shouldn't use implementation
details (the class of the object) to determine how it responds to messages.

It's not really important in this case - but if there were ever another class that also implemented
SourceFileAttribute behaviour, using instanceof means it would either need to be a subclass
of SourceFileAttribute (possibly inheriting variables/behaviour you don't want), or Segment
would need to change. It's theoretically possible that you could end up with:

if(!((attrib instanceof SourceFileAttribute)||(attrib instanceof OtherSourceFileAttribute)||(attrib
instanceof StillAnotherSourceFileAttribute)||...) {

Implementing isSourceFileAttribute allows any class which implements the semantics of SourceFileAttribute
to use the same code.

If I wanted to be strictly true to Smalltalk's nature, I should probably have implemented
an interface so that classes which aren't subclasses of Attribute can also respond to isSourceFileAttribute()...
but I didn't, so my allegiance to good style goes only so far :-)

> [classlib][pack200] Deprecated classes don't have Deprecated attribute
> ----------------------------------------------------------------------
>                 Key: HARMONY-5594
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5594
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Pack200 HEAD
>            Reporter: Andrew Cornwall
>            Assignee: Sian January
>         Attachments: main.patch
> Classes which are marked as Deprecated do not get the Deprecated attribute when they're
written out. In fact, it appears that any "undefined" attribute won't be written out.
> This patch causes all attributes stored with a class to be written out into its class
file except for SourceFileAttribute, which is recomputed right before it is written.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message