DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-371
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andy Jefferson
Reporter: Todd Lipcon
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

StringUtils.getDecodedStringFromURLString deals with '+' improperly

Created: 26/Aug/09 11:30 PM   Updated: 11/Sep/09 08:40 AM   Resolved: 27/Aug/09 08:39 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.0.m2

 Description  « Hide is a misnamed class, since it actually decodes x-www-form-urlencoded, which is different than URL encoding. StringUtils.getDecodedStringFromURLString uses this broken class and thus inherits a bug. Specifically, '+' characters in the filename get decoded as ' ' characters.

This manifests itself in NonManagedPluginRegistry if, for example, the jar is in a path that contains a plus:

[datanucleusenhancer] Exception in thread "main" Error reading manifest file "jar:file:/home/todd/cloudera/cdh/build/hive/0.3.99+1/source/src/lib/datanucleus-enhancer-1.1.2.jar!/plugin.xml"
[datanucleusenhancer] org.datanucleus.exceptions.NucleusException: Error reading manifest file "jar:file:/home/todd/cloudera/cdh/build/hive/0.3.99+1/source/src/lib/datanucleus-enhancer-1.1.2.jar!/plugin.xml"
[datanucleusenhancer] at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(
[datanucleusenhancer] at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(
[datanucleusenhancer] at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints(
[datanucleusenhancer] at org.datanucleus.plugin.PluginManager.registerExtensionPoints(
[datanucleusenhancer] at org.datanucleus.OMFContext.<init>(
[datanucleusenhancer] at org.datanucleus.enhancer.DataNucleusEnhancer.<init>(
[datanucleusenhancer] at org.datanucleus.enhancer.DataNucleusEnhancer.main(
[datanucleusenhancer] Caused by: error in opening zip file
[datanucleusenhancer] at Method)
[datanucleusenhancer] at<init>(
[datanucleusenhancer] at java.util.jar.JarFile.<init>(
[datanucleusenhancer] at java.util.jar.JarFile.<init>(
[datanucleusenhancer] at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(

The fix is to call urlString.replace('+', '%2B') before decoding the URL.


Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 27/Aug/09 08:39 AM
Thx for the report. SVN trunk has this.