Occurrence extends TMObject implements OccurrenceIF { @Override public String getValue() { Object value = loadField(LF_value); if (value instanceof String) { return (String) value; } else if (value instanceof OnDemandValue) { OnDemandValue odv = (OnDemandValue)value; try { Reader r = (Reader)odv.getValue(_p_getTransaction()); try { return IOUtils.toString(r); } finally { r.close(); } } catch (IOException e) { throw new OntopiaRuntimeException(e); } } else if (value != null) { throw new OntopiaRuntimeException("Occurrence value cannot be non-null at this point: " + value); } else { return null; } } Occurrence();  Occurrence(TransactionIF txn); @Override void detach(); @Override int _p_getFieldCount(); @Override String getClassIndicator(); @Override String getObjectId(); @Override void remove(); @Override TopicIF getTopic(); @Override LocatorIF getDataType(); @Override String getValue(); @Override void setValue(String value); @Override void setValue(String value, LocatorIF datatype); @Override Reader getReader(); @Override void setReader(Reader value, long length, LocatorIF datatype); @Override LocatorIF getLocator(); @Override void setLocator(LocatorIF locator); @Override long getLength(); @Override Collection<TopicIF> getScope(); @Override void addTheme(TopicIF theme); @Override void removeTheme(TopicIF theme); @Override TopicIF getType(); @Override void setType(TopicIF type); @Override TopicIF getReifier(); @Override void setReifier(TopicIF _reifier); @Override String toString(); @Override void syncAfterMerge(IdentityIF source, IdentityIF target); static final String CLASS_INDICATOR; }
@Test public void testIssue494() throws Exception { topicmap.getStore().commit(); Assert.assertNotNull("Bug 494: empty occurrence value returned as null", occurrence.getValue()); }