Bug 73895 - unnecessary cast causing problems
Summary: unnecessary cast causing problems
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.2.1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-14 13:08 EDT by Martin Lippert CLA
Modified: 2004-10-21 09:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Lippert CLA 2004-09-14 13:08:41 EDT
class: org.aspectj.weaver.ResolvedTypeX$Name
method: isCoerceableFrom(..)

I am having trouble with the line:

ResolvedMember[] b = ((Name)other).getDeclaredMethods(); //??? is this cast
always safe

As the comment suggests this cast is NOT always safe. In my case the cast is not
safe because I have some additional implementations for ResolvedTypeX (some
optimizations).

Solution: just remove the cast since the method "getDeclaredMethods" is already
defined abstract in the type of "other" (ResolvedTypeX). So the cast seems to be
obsolete anyway.
Comment 1 Adrian Colyer CLA 2004-10-21 09:54:15 EDT
cast removed. Martin's analysis is correct, and removing this cast cannot do any
harm. Fix is in 1.2.1.