You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2009/09/04 11:19:38 UTC
svn commit: r811315 - in /incubator/uima/sandbox/trunk/Lucas/src:
main/java/org/apache/uima/lucas/consumer/
main/java/org/apache/uima/lucas/indexer/mapping/
test/java/org/apache/uima/lucas/indexer/mapping/
Author: twgoetz
Date: Fri Sep 4 09:19:38 2009
New Revision: 811315
URL: http://svn.apache.org/viewvc?rev=811315&view=rev
Log:
UIMA-1552: make code compile with java 1.5
https://issues.apache.org/jira/browse/UIMA-1552
Modified:
incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/consumer/LuceneCASIndexer.java
incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/indexer/mapping/MappingFileReader.java
incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/mapping/MappingFileReaderTest.java
Modified: incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/consumer/LuceneCASIndexer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/consumer/LuceneCASIndexer.java?rev=811315&r1=811314&r2=811315&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/consumer/LuceneCASIndexer.java (original)
+++ incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/consumer/LuceneCASIndexer.java Fri Sep 4 09:19:38 2009
@@ -119,11 +119,14 @@
.readFieldDescriptionsFromFile(mappingFile);
} catch (IOException e) {
throw new ResourceInitializationException(e);
+ } catch (ParserConfigurationException e) {
+ throw new ResourceInitializationException(e);
+ } catch (SAXException e) {
+ throw new ResourceInitializationException(e);
}
}
- private MappingFileReader createMappingFileReader() throws IOException{
- try {
+ private MappingFileReader createMappingFileReader() throws ParserConfigurationException, SAXException, IOException{
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
Map<String, ElementMapper<?>> elementMappers = new HashMap<String, ElementMapper<?>>();
elementMappers.put(MappingFileReader.ANNOTATION, new AnnotationMapper());
@@ -131,12 +134,6 @@
elementMappers.put(MappingFileReader.FIELD, new FieldMapper());
elementMappers.put(MappingFileReader.FEATURE, new FeatureMapper());
return new MappingFileReader(parser, elementMappers);
-
- } catch (ParserConfigurationException e) {
- throw new IOException("Can't build SAXParser", e);
- } catch (SAXException e) {
- throw new IOException("Can't build SAXParser", e);
- }
}
private void getIndexWriterInstance()
Modified: incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/indexer/mapping/MappingFileReader.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/indexer/mapping/MappingFileReader.java?rev=811315&r1=811314&r2=811315&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/indexer/mapping/MappingFileReader.java (original)
+++ incubator/uima/sandbox/trunk/Lucas/src/main/java/org/apache/uima/lucas/indexer/mapping/MappingFileReader.java Fri Sep 4 09:19:38 2009
@@ -64,18 +64,18 @@
}
public Collection<FieldDescription> readFieldDescriptionsFromFile(
- File mappingFile) throws IOException {
+ File mappingFile) throws IOException, SAXException {
parseFile(mappingFile);
return fieldDescriptions;
}
- private void parseFile(File mappingFile) throws IOException {
- try {
+ private void parseFile(File mappingFile) throws IOException, SAXException {
+// try {
parser.parse(mappingFile, this);
- } catch (SAXException e) {
- throw new IOException(e);
- }
+// } catch (SAXException e) {
+// throw new IOException(e);
+// }
}
@Override
Modified: incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/mapping/MappingFileReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/mapping/MappingFileReaderTest.java?rev=811315&r1=811314&r2=811315&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/mapping/MappingFileReaderTest.java (original)
+++ incubator/uima/sandbox/trunk/Lucas/src/test/java/org/apache/uima/lucas/indexer/mapping/MappingFileReaderTest.java Fri Sep 4 09:19:38 2009
@@ -33,6 +33,7 @@
import org.junit.Before;
import org.junit.Test;
+import org.xml.sax.SAXException;
public class MappingFileReaderTest {
@@ -66,7 +67,7 @@
}
@Test
- public void testCreateFieldDescriptions() throws IOException{
+ public void testCreateFieldDescriptions() throws IOException, SAXException{
Collection<FieldDescription> fieldDescriptions = mappingFileReader.readFieldDescriptionsFromFile(new File(MAPPING_FILE));
assertEquals(1, fieldDescriptions.size());