Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 5585 Details for
Bug 40943
Binary weaving should copy non-Java resources from "-injars" to "-outjar"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Copy non-Java resources from "-injars" to "-outjar"
patch-40493.txt (text/plain), 4.71 KB, created by
Matthew Webster
on 2003-07-30 12:54:39 EDT
(
hide
)
Description:
Copy non-Java resources from "-injars" to "-outjar"
Filename:
MIME Type:
Creator:
Matthew Webster
Created:
2003-07-30 12:54:39 EDT
Size:
4.71 KB
patch
obsolete
>Index: src/org/aspectj/weaver/bcel/BcelWeaver.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java,v >retrieving revision 1.13 >diff -u -r1.13 BcelWeaver.java >--- src/org/aspectj/weaver/bcel/BcelWeaver.java 1 May 2003 19:47:44 -0000 1.13 >+++ src/org/aspectj/weaver/bcel/BcelWeaver.java 30 Jul 2003 16:47:39 -0000 >@@ -47,6 +47,7 @@ > private Map sourceJavaClasses = new HashMap(); /* String -> UnwovenClassFile */ > private List addedClasses = new ArrayList(); /* List<UnovenClassFile> */ > private List deletedTypenames = new ArrayList(); /* List<String> */ >+ private Map resources = new HashMap(); /* String -> byte[] */ > private boolean needToReweaveWorld = false; > > private List shadowMungerList = null; // setup by prepareForWeave >@@ -119,20 +120,26 @@ > ZipEntry entry = inStream.getNextEntry(); > if (entry == null) break; > >+ byte[] bytes = FileUtil.readAsByteArray(inStream); >+ String filename = entry.getName(); >+ > if (entry.isDirectory() || !entry.getName().endsWith(".class")) { >+ System.out.println("? " + getClass().getName() + ".addJarFile() entry=" + entry); >+ addResource(filename,bytes); >+ > continue; //??? need to pass other things along untouched > // outStream.putNextEntry(entry); > // outStream.write(Utility.getByteArray(inStream)); > // outStream.closeEntry(); > // return; > } >- //System.err.println("adding class: " + entry.getName()); >- >- byte[] bytes = FileUtil.readAsByteArray(inStream); >- String filename = entry.getName(); >- UnwovenClassFile classFile = new UnwovenClassFile(new File(outDir, filename).getAbsolutePath(), bytes); >- inStream.closeEntry(); >- this.addClassFile(classFile); >+ else { >+ UnwovenClassFile classFile = new UnwovenClassFile(new File(outDir, filename).getAbsolutePath(), bytes); >+ inStream.closeEntry(); >+ this.addClassFile(classFile); >+ //System.err.println("adding class: " + entry.getName()); >+ } >+ > } > > inStream.close(); >@@ -154,6 +161,10 @@ > world.deleteSourceObjectType(TypeX.forName(typename)); > } > >+ public void addResource (String name, byte[] bytes) { >+ resources.put(name,bytes); >+ } >+ > // ---- weave preparation > > public void prepareForWeave() { >@@ -191,10 +202,14 @@ > } > > public void dumpUnwoven(File file) throws IOException { >+ System.out.println("> " + getClass().getName() + ".dumpUnwoven(" + file + ")"); > BufferedOutputStream os = FileUtil.makeOutputStream(file); > this.zipOutputStream = new ZipOutputStream(os); > dumpUnwoven(); >+ /* BUG 40943*/ >+ dumpResources(); > zipOutputStream.close(); //this flushes and closes the acutal file >+ System.out.println("< " + getClass().getName() + ".dumpUnwoven()"); > } > > >@@ -206,18 +221,37 @@ > } > } > >+ /* BUG #40943 */ >+ public void dumpResources () throws IOException { >+ System.out.println("> " + getClass().getName() + ".dumpResources()"); >+ >+ Iterator iter = resources.keySet().iterator(); >+ while (iter.hasNext()) { >+ String name = (String)iter.next(); >+ byte[] bytes = (byte[])resources.get(name); >+ System.out.println(" " + getClass().getName() + ".dumpResources() " + name); >+ writeZipEntry(name,bytes); >+ } >+ >+ System.out.println("< " + getClass().getName() + ".dumpResources()"); >+ } > > // ---- weaving > > public Collection weave(File file) throws IOException { >+ System.out.println("> " + getClass().getName() + ".weave(" + file + ")"); > OutputStream os = FileUtil.makeOutputStream(file); > this.zipOutputStream = new ZipOutputStream(os); > Collection c = weave(); >+ /* BUG 40943*/ >+ dumpResources(); > zipOutputStream.close(); //this flushes and closes the acutal file >+ System.out.println("< " + getClass().getName() + ".weave()"); > return c; > } > > public Collection weave() throws IOException { >+ System.out.println("> " + getClass().getName() + ".weave()"); > prepareForWeave(); > Collection filesToWeave; > >@@ -286,6 +320,7 @@ > addedClasses = new ArrayList(); > deletedTypenames = new ArrayList(); > >+ System.out.println("< " + getClass().getName() + ".weave()"); > return wovenClassNames; > } > >@@ -422,6 +457,7 @@ > } > > private void writeZipEntry(String name, byte[] bytes) throws IOException { >+ System.out.println("? " + getClass().getName() + ".writeZipEntry() name='" + name +"'"); > ZipEntry newEntry = new ZipEntry(name); //??? get compression scheme right > > zipOutputStream.putNextEntry(newEntry);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
aclement
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 40943
: 5585