Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] java proxy dependencies

I think my preference would be to try the compression option first. Do you know if this is able to reduce the jar to a reasonable size?

Greg

On Oct 29, 2010, at 8:28 PM, Roland Schulz wrote:



On Fri, Oct 29, 2010 at 6:28 PM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:
I see three options:

1. Go back to using SimpleDateFormat.
2. Drop the date attribute (it's not being used as far as I know).
In both cases we would still need to move the attributes in a different plugin because the rest of  org.eclipse.ptp.core depends on several other eclipse plugin classes.

3. Provide a separate attribute implementation for the proxy (not very desirable).
I agree.

Or as two other options, which don't modify code changes in move the problem to the build/runtime. We could do Dieter's suggestion of compression or Ben's suggestion of downloading large part from a different website.


Which of these 5 options should we do?

Roland
 

Greg

On Oct 29, 2010, at 4:50 PM, Roland Schulz wrote:



On Fri, Oct 29, 2010 at 1:32 PM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:
The ICU classes are now the preferred ones for Eclipse plugins. I think this is documented in the Eclipse guidelines somewhere. 
 But for the Proxy -> UI communication initialization isn't important. In the long run we will use binary. And even before the communication of dates shouldn't be in initialized format. 

How would moving attributes to it's own package help? Do you mean it's own plugin?
yes. That's what I meant. Sorry.

Roland 

Greg


On Oct 29, 2010, at 1:17 PM, Roland Schulz wrote:



On Fri, Oct 29, 2010 at 1:01 PM, Albert L. Rossi <arossi@xxxxxxxxxxxxx> wrote:
In this particular case I would think using the java.text.SimpleDateFormat is the preferable choice if there is not some compelling reason to use the com.ibm.icu classes.

In general, though, I think it would too prone to error to load dependencies based on an ad hoc list and not recursively.  
I would suggest to do both. At the moment we are missing the icu classes in the run-time jar but use them indirectly in the code (but the code is currently not used). I suggest to remove the dependency on icu AND make sure that any classes which are potentially used are guaranteed to be included in the JAR.

Where does the 6Mb figure come from, Roland?
I obtained that two ways with the same result: I looked at my eclipse folder for the size of the icu jar
/eclipse/plugins/com.ibm.icu_4.2.1.v20100412.jar. I also created a small test program which uses the DateFormat and than created with File->Export->Runnable_Jar a JAR with all dependencies. This includes the icu jar and thus is also 6MB big. Currently our proxy JAR is <1MB because it is missing the ICU (and other) dependencies which are currently not used in normal operation but are used if an exception occurs (the attributes classes use org.eclipse.osgi.util.NLS for error message) or if a Date attribute is added to the config file.

Roland

Al
----- Roland Schulz <roland@xxxxxxx> wrote:
> Hi,
>
> their is a problem with the build/runtime dependencies again. Ben's patch
> added dependencies to org.eclipse.ptp.core
> (for org.eclipse.ptp.core.attributes) which in turn depends on the "Plug-in
> dependencies" (org.eclipse.pde.core.requiredPlugins),
> e.g. com.ibm.icu.text.DateFormat.
>
> At the moment the dependencies from "Plug-in dependencies" are not
> automatically added to the Jar file (I wrote Dieter a separate email about
> that). It does not crash because the attribute definition configuration file
> currently does not include any date attribute. Thus currently the
> dependencies which are not included are not used at run-time. But obviously
> it is not acceptable that changing the configuration file causes a
> ClassNotFoundException.
>
> The problem is made worse, because com.ibm.icu is alone 6.2MB. Adding
> all "Plug-in dependencies" is 30MB. I think it is important that the proxy
> jar file (which has to be uploaded) is not >6MB.
>
> I see 5 options (ordered from most to least favored)
>
> 1) Should we move org.eclipse.ptp.core.attributes into its own package? Why
> is the com.ibm.icu.text.DateFormat required and why can't we use
> java.text.SimpleDateFormat?
>
> 2) Or should we copy the required Attribute classes to some of the proxy
> packages (e.g. rm.proxy.core) and modify the copy to not require any of the
> "Plugin Dependencies" (e.g. icu)
>
> 3) Use a JAR shrinker and hope that it can reduce it to a acceptable size. I
> tried ProGuard and couldn't make it work. Thus I'm not sure whether it would
> produce an acceptable size. Does someone has experience with a JAR shrinker?
>
> 4) Or should we live with the fact that the plugin jar is huge.
>
> 5) Have a manually list of classes which have to be added to the jar. The
> problem is that dependencies in seldom used code (e.g. Error
> handlers/Exceptions) are not noticed and the user doesn't see the error
> because the Proxy crashes with ClassNotFoundException.
>
> What do you think?
>
> Roland
>
> --
> ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
> 865-241-1537, ORNL PO BOX 2008 MS6309





--
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309




--
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309




--
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309


Back to the top