Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 262748 - [jar exporter] extract constants for string literals in JarRsrcLoader et al.
Summary: [jar exporter] extract constants for string literals in JarRsrcLoader et al.
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Ferenc Hechler CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-28 08:38 EST by Markus Keller CLA
Modified: 2009-11-05 09:36 EST (History)
2 users (show)

See Also:
markus.kell.r: review+


Attachments
extracted constants into class JIJConst (20.84 KB, patch)
2009-10-26 18:05 EDT, Ferenc Hechler CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-01-28 08:38:58 EST
HEAD

The code in org.eclipse.jdt.internal.ui.jarpackagerfat is hard to maintain because relevant string literals are spread and duplicated in various classes, e.g. JarRsrcLoader, RsrcURLStreamHandler, FatJarRsrcUrlAntExporter, FatJarRsrcUrlManifestProvider, etc.

String literals like "Rsrc-Main-Class", "rsrc" (the URL protocol), etc. should be extracted into constants and moved into a few selected classes.

Coordinate this with bug 262746 (move redistributable classes into a separate source folder).
Comment 1 Markus Keller CLA 2009-01-28 08:55:23 EST
Ferenc, could you provide a patch for this?
Comment 2 Ferenc Hechler CLA 2009-01-28 17:49:43 EST
I will keep this on hold until bug 262746 is fixed.


Comment 3 Markus Keller CLA 2009-02-18 12:35:53 EST
Please put the constants from org.eclipse.jdt.internal.jarinjarloader into JarRsrcLoader.java and don't refer to them from org.eclipse.jdt.internal.ui.jarpackagerfat (they would not be visible in the built plug-in). Just use the same constant names, e.g. in FatJarRsrcUrlAntExporter
Comment 4 Ferenc Hechler CLA 2009-03-05 08:24:44 EST
I will add a patch next week
Comment 5 Markus Keller CLA 2009-03-05 09:54:00 EST
> I will add a patch next week

Thanks. Next week is M6 and we won't have time to release it then, but I'll look at it early M7.
Comment 6 Dani Megert CLA 2009-10-19 08:36:34 EDT
ping.
Comment 7 Ferenc Hechler CLA 2009-10-20 14:32:34 EDT
Oops,
shame on me...
I will get on with it!
Comment 8 Ferenc Hechler CLA 2009-10-26 18:05:21 EDT
Created attachment 150566 [details]
extracted constants into class JIJConst

the patch extracts constant strings regarding the jar in jar loader into the Class JIJConst. The class exists twice. Once for the loader and once for the export wizard.
Comment 9 Markus Keller CLA 2009-11-05 09:36:38 EST
Thanks, released to HEAD with a few changes:

- replaced JIJConst.JAR_MANIFEST with JarFile.MANIFEST_NAME
- renamed JIJConst to JIJConstants
- removed @author tags
- added @since 3.6
- removed unused constants
- formatting