abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christine Koppelt (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ABDERA-309) Allow underscores in URLs
Date Thu, 08 Nov 2012 23:08:13 GMT
Christine Koppelt created ABDERA-309:
----------------------------------------

             Summary: Allow underscores in URLs
                 Key: ABDERA-309
                 URL: https://issues.apache.org/jira/browse/ABDERA-309
             Project: Abdera
          Issue Type: Bug
            Reporter: Denilson Nastacio


 I just downloaded Abdera 1.1.2 and tried to parse the following atom XML document:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:snx="http://www.ibm.com/xmlns/prod/sn"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<generator uri="http://www.ibm.com/xmlns/prod/sn" version="3.0.1.0">IBM
Connections - Dogear</generator>
<title>Bookmarks - Public Bookmarks</title>
<link rel="self" type="application/atom+xml"
href="https://w3-connections.ibm.com/dogear/atom?page=690&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
/>
<link rel="http://www.ibm.com/xmlns/prod/sn/tag-cloud" type="application/atomcat+xml"
href="https://w3-connections.ibm.com/dogear/tags?page=690&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
/>
<link rel="first"
href="https://w3-connections.ibm.com/dogear/atom?ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
type="application/atom+xml" />
<link rel="previous"
href="https://w3-connections.ibm.com/dogear/atom?page=689&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
type="application/atom+xml" />
<link rel="next"
href="https://w3-connections.ibm.com/dogear/atom?page=691&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
type="application/atom+xml" />
<link rel="last"
href="https://w3-connections.ibm.com/dogear/atom?page=22990&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
type="application/atom+xml" />
<link rel="alternate" type="text/html"
href="https://w3-connections.ibm.com/dogear/html?page=690&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US"
/>
<id>tag:dogear.ibm.com,2005:feed:/?page=690&amp;ps=50&amp;sortBy=created&amp;sortOrder=desc&amp;lang=en_US
</id>
<updated>2012-08-20T00:31:46+00:00</updated>
<entry>
<id>tag:dogear.ibm.com,2005:link:54f5f435-0efb-446f-b0bd-3d81fcf8ee9e</id>
<title>ITS Asset Overview Portal</title>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type"
term="bookmark" />
<link href="http://its_gbsc.cn.ibm.com/" />
<content type="html"></content>
<published>2012-08-19T14:45:40+00:00</published>
<updated>2012-08-19T14:45:40+00:00</updated>
<category term="china" />
<category term="gbsc" />
<author>
<email>asreeram@in.ibm.com</email>
<snx:userid>76dbfdc0-8f0a-1028-875c-db07163b51b2</snx:userid>
<snx:userState>active</snx:userState>
<name>SREERAM ANANTHASAYANAM</name>
<uri>https://w3-connections.ibm.com/dogear/html?email=asreeram%40in.ibm.com&lt;/uri>
</author>
<snx:clickcount>0</snx:clickcount>
<snx:linkcount>1</snx:linkcount>
<link rel="http://www.ibm.com/xmlns/prod/sn/same" type="application/atom+xml"
href="https://w3-connections.ibm.com" />
</entry>
</feed>

and received the following exception:

org.apache.abdera.i18n.text.InvalidCharacterException: Invalid Character 0x5f(_)
at org.apache.abdera.i18n.text.CodepointIterator$RestrictedCodepointIterator.next(CodepointIterator.java:476)
at org.apache.abdera.i18n.text.CharUtils.verifyNot(CharUtils.java:883)
at org.apache.abdera.i18n.iri.IDNA.toASCII(IDNA.java:108)
at org.apache.abdera.i18n.iri.IRI.init(IRI.java:127)
at org.apache.abdera.i18n.iri.IRI.<init>(IRI.java:65)
at org.apache.abdera.parser.stax.FOMElement._getUriValue(FOMElement.java:293)
at org.apache.abdera.parser.stax.FOMLink.getHref(FOMLink.java:77)
at com.ibm.bluegenome.io.FeedScannerTest.testB(FeedScannerTest.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)



The issue appeared when I called the last line in the following block:

Document<Feed> doc = abderaParser.parse(new FileInputStream(
"input/dogear/atom.xml"));
Feed feed = doc.getRoot();
        List<Entry> feedEntries = feed.getEntries();
        int feedEntriesSize = feedEntries.size();
        for (int i = 0; i < feedEntriesSize; i++) {
            Entry srcFeedEntry = feedEntries.get(i);
            Link alink = srcFeedEntry.getAlternateLink();
            if (alink != null) {
                alink.getHref().toASCIIString();
            }
        }

----

which points to <link href="http://its_gbsc.cn.ibm.com/" />

When modify that URL removing the "_" character, the parsing succeeds.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message