Bug 61374 - Version the BCEL libraries to allow graceful failure when the wrong version is found.
Summary: Version the BCEL libraries to allow graceful failure when the wrong version i...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 1.2.1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 59921 66222 75071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-07 08:45 EDT by Andrew Clement CLA
Modified: 2004-10-21 04:31 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2004-05-07 08:45:15 EDT
We have bugs reported like bug 59921 and bug 60389.  These bugs relate to the 
problem where the compiler locates the wrong version of BCEL libraries - 
because they are a different version, some of the methods AspectJ calls either 
don't exist or have different parameter lists.  The error the user sees is a 
horrible internal compiler error.  if we versioned the BCEL libraries as we 
changed them, we could check the version found on compiler startup and verify 
they are as expected.  if the version doesn't match we can report a nice 
readable error message that tells the user how to fix it.
Comment 1 Andrew Clement CLA 2004-07-26 03:27:47 EDT
Or we could rename the packages for the version of BCEL that we use to prevent
future clashes.
Comment 2 Andrew Clement CLA 2004-07-26 03:30:20 EDT
*** Bug 59921 has been marked as a duplicate of this bug. ***
Comment 3 Ulf Dittmer CLA 2004-07-26 15:39:55 EDT
*** Bug 66222 has been marked as a duplicate of this bug. ***
Comment 4 Adrian Colyer CLA 2004-08-10 04:27:17 EDT
Ideally need to do something here for the 1.2.1 release.
Comment 5 Andrew Clement CLA 2004-08-12 04:02:46 EDT
Fixed.  I have modified the bcel-builder project and introduced two new targets:

transformToAJ - changes the package structure from org.apache to org.aspectj.apache

transformFromAJ - changes the package structure from org.aspectj.apache to
org.aspectj

I didn't do any bytecode transformation to achieve this as I realised I wanted
to have a valid src.zip that matched the transformed bytecode.  So I just used
ANT.  A mapper to do the renaming of files and introduce the extra level of
package naming and then a <replaceregexp> task call to transform references
inside all the source files.

We store our changes to BCEL in a patch.txt file.  This file is still a patch
against the non-renamed bcel source.  So the order of operations when building a
new version of BCEL is:

- Extract bcel5.1 into a folder
- Patch that bcel
- Transform the package names
- Package up the transformed code

You *can* then work on the transformed code, if you make a fix then you will run
the 'diff' target on build.xml to create a new version of the patch, that works
as follows:

- Transform the package names back
- Diff the source with the original BCEL source to create patch.txt

This works really well !

The new names for BCEL classes resulted in a ton of changes in the weaver
(import statements).

Waiting for build before closing.
Comment 6 Andrew Clement CLA 2004-08-12 08:01:23 EDT
Fixed version available:

BUILD COMPLETE -  build.339
Date of build: 08/12/2004 09:42:49
Time to build: 92 minutes 32 seconds
Last changed: 08/12/2004 09:01:04
Last log entry: BCEL rename (enhancement 61374)
Latest good AspectJ jar available at:
download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Comment 7 Andrew Clement CLA 2004-09-29 09:30:52 EDT
*** Bug 75071 has been marked as a duplicate of this bug. ***
Comment 8 Adrian Colyer CLA 2004-10-21 04:31:23 EDT
Fix released as part of AspectJ 1.2.1