You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Markus Wiederkehr (JIRA)" <se...@james.apache.org> on 2008/11/09 20:22:44 UTC

[jira] Created: (MIME4J-85) Upgrade source to Java 5

Upgrade source to Java 5
------------------------

                 Key: MIME4J-85
                 URL: https://issues.apache.org/jira/browse/MIME4J-85
             Project: JAMES Mime4j
          Issue Type: Improvement
    Affects Versions: 0.5
            Reporter: Markus Wiederkehr
             Fix For: 0.6


The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.

For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (MIME4J-85) Upgrade source to Java 5

Posted by "Oleg Kalnichevski (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646109#action_12646109 ] 

Oleg Kalnichevski commented on MIME4J-85:
-----------------------------------------

I am in favour of committing this patch

Oleg

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (MIME4J-85) Upgrade source to Java 5

Posted by "Markus Wiederkehr (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Wiederkehr updated MIME4J-85:
------------------------------------

    Attachment: mime4j-java5.patch

updated patch for current trunk and included missing enum Mode.

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (MIME4J-85) Upgrade source to Java 5

Posted by "Taras Puchko (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647316#action_12647316 ] 

Taras Puchko commented on MIME4J-85:
------------------------------------

Dependency resolution works on class level when embedding. So even if you use only one method from a class, the dependencies of the whole class are included, and the dependencies of these dependencies, and so on. To remove unused methods and classes try using a specialized bytecode shrinker like yGuard.

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (MIME4J-85) Upgrade source to Java 5

Posted by "Markus Wiederkehr (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Wiederkehr updated MIME4J-85:
------------------------------------

    Attachment: mime4j-java5-v2.patch

Because of problems with the Retrotranslator plugin this second patch replaces the enum with a Java 1.4 compatible typesafe enum pattern (a class with public static final constants).

It also replaces StringBuffers in the source code with StringBuilders (Retrotranslator is capable of translating them back).

And the POM now includes the retrotranslator:translate-project goal. As far as I can tell (and according to Retrotranslators own verify option) the resulting jar file is compatible with Java 1.4.

I'll leave the first patch attached to this issue just in case..

If someone knows how to configure the Retrotranslator plugin to translate Java 5 enums please let me know.

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (MIME4J-85) Upgrade source to Java 5

Posted by "Robert Burrell Donkin (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647851#action_12647851 ] 

Robert Burrell Donkin commented on MIME4J-85:
---------------------------------------------

+1

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Resolved: (MIME4J-85) Upgrade source to Java 5

Posted by "Oleg Kalnichevski (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved MIME4J-85.
-------------------------------------

    Resolution: Fixed

Patch checked in. Many thanks, Marcus, for contributing it

Oleg

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (MIME4J-85) Upgrade source to Java 5

Posted by "Oleg Kalnichevski (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647832#action_12647832 ] 

Oleg Kalnichevski commented on MIME4J-85:
-----------------------------------------

Folks,

If I hear no loud objections, I'll commit this patch tomorrow (Nov 16th, 12:00GMT).

Oleg

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (MIME4J-85) Upgrade source to Java 5

Posted by "Markus Wiederkehr (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Wiederkehr updated MIME4J-85:
------------------------------------

    Attachment:     (was: mime4j-java5.patch)

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (MIME4J-85) Upgrade source to Java 5

Posted by "Taras Puchko (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647251#action_12647251 ] 

Taras Puchko commented on MIME4J-85:
------------------------------------

Try adding a dependency on retrotranslator-runtime to make Retrotranslator translate enums

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (MIME4J-85) Upgrade source to Java 5

Posted by "Markus Wiederkehr (JIRA)" <se...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Wiederkehr updated MIME4J-85:
------------------------------------

    Attachment: mime4j-java5.patch

proposed patch includes:

* inferred Generics types
* enhanced for-loops
* @Override annotations
* an enum Mode as replacement for the constants in MessageUtils
* changed return type of MimeEntityConfig.clone() to MimeEntityConfig

the last point could be changed to a copy constructor but that would be outside of the scope of this patch.

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (MIME4J-85) Upgrade source to Java 5

Posted by "Markus Wiederkehr (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MIME4J-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647280#action_12647280 ] 

Markus Wiederkehr commented on MIME4J-85:
-----------------------------------------

Thanks you very much! With the added dependency the translation of enums works like a charm.

I also tried to include the runtime classes in my jar using the "embed" parameter. But it looks like all runtime classes are copied no matter if they are needed or not..

Is it possible to embed only the runtime classes that are actually required? The Retrotranslator documentation speaks of a "partial copy"..

> Upgrade source to Java 5
> ------------------------
>
>                 Key: MIME4J-85
>                 URL: https://issues.apache.org/jira/browse/MIME4J-85
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>             Fix For: 0.6
>
>         Attachments: mime4j-java5-v2.patch, mime4j-java5.patch
>
>
> The Mime4j API would greatly benefit from Java 5 language features, most of all Generics.
> For backward compatibility with JVM 1.4 the generated jar file could be transformed using the Retrotranslator Maven Plugin. If this compatibility is required new features of the Java 5 API (such as StringBuilder) cannot be used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org