You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Tim Parsons (JIRA)" <ji...@apache.org> on 2010/12/15 17:40:00 UTC
[jira] Created: (ABDERA-275) Error in Turkish Locale when using
GZIP compression
Error in Turkish Locale when using GZIP compression
---------------------------------------------------
Key: ABDERA-275
URL: https://issues.apache.org/jira/browse/ABDERA-275
Project: Abdera
Issue Type: Bug
Affects Versions: 1.1.1, 1.1, 1.0, 0.4.0, 0.3.0, 0.2.2
Environment: Issue was found on Windows XP, not tested on other OSes. Issue affects Turkish Locale.
Reporter: Tim Parsons
>From a client machine, using the Turkish locale, try to retrieve a feed from a remote server that uses GZIP compression. An exception is thrown:
java.lang.IllegalArgumentException: No enum const class org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.GZ?P
at java.lang.Enum.valueOf(Unknown Source)
at org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.valueOf(CompressionUtil.java:30)
at org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.value(CompressionUtil.java:36)
at org.apache.abdera.i18n.text.io.CompressionUtil.getDecodingInputStream(CompressionUtil.java:94)
at org.apache.abdera.protocol.client.CommonsResponse.getInputStream(CommonsResponse.java:150)
at org.apache.abdera.protocol.client.cache.InMemoryCachedResponse.<init>(InMemoryCachedResponse.java:48)
at org.apache.abdera.protocol.client.cache.InMemoryCache.createCachedResponse(InMemoryCache.java:38)
at org.apache.abdera.protocol.client.cache.AbstractCache.update(AbstractCache.java:127)
at org.apache.abdera.protocol.client.cache.AbstractCache.update(AbstractCache.java:105)
at org.apache.abdera.protocol.client.AbderaClient.execute(AbderaClient.java:693)
at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:216)
at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:404)
The problem occurs because a string comparison using upper case is involved, and the locale is not set to English.
This issue was first found in Abdera 0.2.2. A test application was written, and Abdera 0.4, 1.1 and 1.1.1 were all tested with it. The exception occurs in all versions of Abdera. Here is the source for the simple test app:
Locale.setDefault( new Locale("tr", "", ""));
try {
Abdera abdera = new Abdera();
// This line for Abdera 0.2.2
// Client client = new CommonsClient(abdera);
// This line for Abdera 0.4.0+
AbderaClient client = new AbderaClient(abdera);
String url = "http://abdera.apache.org/releases.xml";
ClientResponse response = client.get(url);
if( response.getStatus() == 200 ) {
System.out.println("Connected OK");
} else {
System.out.println("Error connecting to URL: " + url +
"\nStatus code: " + response.getStatus() +
"\nStatus text: " + response.getStatusText() );
}
} catch( Exception e ) {
e.printStackTrace();
}
In Abdera 0.2.2, the fix was to change the following line in protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java from:
switch(ContentEncoding.valueOf(encodings[n].toUpperCase().replaceAll("-", ""))) {
to:
switch(ContentEncoding.valueOf(encodings[n].toUpperCase(Locale.ENGLISH).replaceAll("-", ""))) {
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (ABDERA-275) Error in Turkish Locale when using
GZIP compression
Posted by "Christine Koppelt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ABDERA-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christine Koppelt resolved ABDERA-275.
--------------------------------------
Resolution: Fixed
fixed in trunk
> Error in Turkish Locale when using GZIP compression
> ---------------------------------------------------
>
> Key: ABDERA-275
> URL: https://issues.apache.org/jira/browse/ABDERA-275
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 0.2.2, 0.3.0, 0.4.0, 1.0, 1.1, 1.1.1
> Environment: Issue was found on Windows XP, not tested on other OSes. Issue affects Turkish Locale.
> Reporter: Tim Parsons
>
> From a client machine, using the Turkish locale, try to retrieve a feed from a remote server that uses GZIP compression. An exception is thrown:
> java.lang.IllegalArgumentException: No enum const class org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.GZ?P
> at java.lang.Enum.valueOf(Unknown Source)
> at org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.valueOf(CompressionUtil.java:30)
> at org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.value(CompressionUtil.java:36)
> at org.apache.abdera.i18n.text.io.CompressionUtil.getDecodingInputStream(CompressionUtil.java:94)
> at org.apache.abdera.protocol.client.CommonsResponse.getInputStream(CommonsResponse.java:150)
> at org.apache.abdera.protocol.client.cache.InMemoryCachedResponse.<init>(InMemoryCachedResponse.java:48)
> at org.apache.abdera.protocol.client.cache.InMemoryCache.createCachedResponse(InMemoryCache.java:38)
> at org.apache.abdera.protocol.client.cache.AbstractCache.update(AbstractCache.java:127)
> at org.apache.abdera.protocol.client.cache.AbstractCache.update(AbstractCache.java:105)
> at org.apache.abdera.protocol.client.AbderaClient.execute(AbderaClient.java:693)
> at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:216)
> at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:404)
> The problem occurs because a string comparison using upper case is involved, and the locale is not set to English.
> This issue was first found in Abdera 0.2.2. A test application was written, and Abdera 0.4, 1.1 and 1.1.1 were all tested with it. The exception occurs in all versions of Abdera. Here is the source for the simple test app:
> Locale.setDefault( new Locale("tr", "", ""));
>
> try {
> Abdera abdera = new Abdera();
>
> // This line for Abdera 0.2.2
> // Client client = new CommonsClient(abdera);
>
> // This line for Abdera 0.4.0+
> AbderaClient client = new AbderaClient(abdera);
>
> String url = "http://abdera.apache.org/releases.xml";
> ClientResponse response = client.get(url);
> if( response.getStatus() == 200 ) {
> System.out.println("Connected OK");
>
> } else {
> System.out.println("Error connecting to URL: " + url +
> "\nStatus code: " + response.getStatus() +
> "\nStatus text: " + response.getStatusText() );
> }
> } catch( Exception e ) {
> e.printStackTrace();
> }
> In Abdera 0.2.2, the fix was to change the following line in protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java from:
> switch(ContentEncoding.valueOf(encodings[n].toUpperCase().replaceAll("-", ""))) {
> to:
> switch(ContentEncoding.valueOf(encodings[n].toUpperCase(Locale.ENGLISH).replaceAll("-", ""))) {
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ABDERA-275) Error in Turkish Locale when using
GZIP compression
Posted by "Christine Koppelt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ABDERA-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christine Koppelt updated ABDERA-275:
-------------------------------------
Fix Version/s: 1.1.2
> Error in Turkish Locale when using GZIP compression
> ---------------------------------------------------
>
> Key: ABDERA-275
> URL: https://issues.apache.org/jira/browse/ABDERA-275
> Project: Abdera
> Issue Type: Bug
> Affects Versions: 0.2.2, 0.3.0, 0.4.0, 1.0, 1.1, 1.1.1
> Environment: Issue was found on Windows XP, not tested on other OSes. Issue affects Turkish Locale.
> Reporter: Tim Parsons
> Fix For: 1.1.2
>
>
> From a client machine, using the Turkish locale, try to retrieve a feed from a remote server that uses GZIP compression. An exception is thrown:
> java.lang.IllegalArgumentException: No enum const class org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.GZ?P
> at java.lang.Enum.valueOf(Unknown Source)
> at org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.valueOf(CompressionUtil.java:30)
> at org.apache.abdera.i18n.text.io.CompressionUtil$CompressionCodec.value(CompressionUtil.java:36)
> at org.apache.abdera.i18n.text.io.CompressionUtil.getDecodingInputStream(CompressionUtil.java:94)
> at org.apache.abdera.protocol.client.CommonsResponse.getInputStream(CommonsResponse.java:150)
> at org.apache.abdera.protocol.client.cache.InMemoryCachedResponse.<init>(InMemoryCachedResponse.java:48)
> at org.apache.abdera.protocol.client.cache.InMemoryCache.createCachedResponse(InMemoryCache.java:38)
> at org.apache.abdera.protocol.client.cache.AbstractCache.update(AbstractCache.java:127)
> at org.apache.abdera.protocol.client.cache.AbstractCache.update(AbstractCache.java:105)
> at org.apache.abdera.protocol.client.AbderaClient.execute(AbderaClient.java:693)
> at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:216)
> at org.apache.abdera.protocol.client.AbderaClient.get(AbderaClient.java:404)
> The problem occurs because a string comparison using upper case is involved, and the locale is not set to English.
> This issue was first found in Abdera 0.2.2. A test application was written, and Abdera 0.4, 1.1 and 1.1.1 were all tested with it. The exception occurs in all versions of Abdera. Here is the source for the simple test app:
> Locale.setDefault( new Locale("tr", "", ""));
>
> try {
> Abdera abdera = new Abdera();
>
> // This line for Abdera 0.2.2
> // Client client = new CommonsClient(abdera);
>
> // This line for Abdera 0.4.0+
> AbderaClient client = new AbderaClient(abdera);
>
> String url = "http://abdera.apache.org/releases.xml";
> ClientResponse response = client.get(url);
> if( response.getStatus() == 200 ) {
> System.out.println("Connected OK");
>
> } else {
> System.out.println("Error connecting to URL: " + url +
> "\nStatus code: " + response.getStatus() +
> "\nStatus text: " + response.getStatusText() );
> }
> } catch( Exception e ) {
> e.printStackTrace();
> }
> In Abdera 0.2.2, the fix was to change the following line in protocol/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java from:
> switch(ContentEncoding.valueOf(encodings[n].toUpperCase().replaceAll("-", ""))) {
> to:
> switch(ContentEncoding.valueOf(encodings[n].toUpperCase(Locale.ENGLISH).replaceAll("-", ""))) {
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira