[ 
https://issues.apache.org/jira/browse/JENA-561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claude Warren updated JENA-561:
-------------------------------

    Description: 
The documentation for Statement.getAlt() states:
"An exception will be thrown if the object is not a Resource."

However in the case of the default model creating an Alt on a Literal succeeds.


  was:
The documentation for Statement.getAlt() states:
"An exception will be thrown if the object is not a Resource."

However in the case of the default model creating an Alt on a Literal succeeds.

    public class dummy {

        public static void main(String[] args) {
                        Model m = ModelFactory.createDefaultModel();
                        Resource s = m.createResource();
                        Property p = m.createProperty("http://example.com/p";);
                        Literal o = m.createLiteral( "foo" );
                        Statement stmt = m.createStatement(s, p, o);
                        
                        Alt a = stmt.getAlt();
                        System.out.println( "Should have thrown exception as 
statement is "+stmt);
        
                }
    }



> Statement from Default Model does not throw exception when creating Alt
> -----------------------------------------------------------------------
>
>                 Key: JENA-561
>                 URL: https://issues.apache.org/jira/browse/JENA-561
>             Project: Apache Jena
>          Issue Type: Bug
>            Reporter: Claude Warren
>         Attachments: dummy.java
>
>
> The documentation for Statement.getAlt() states:
> "An exception will be thrown if the object is not a Resource."
> However in the case of the default model creating an Alt on a Literal 
> succeeds.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to