diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-11-23 11:54:09 +0000 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2019-01-21 15:09:29 +0100 |
commit | 595f2111f828745cd75adad67e5e80bfe81ed353 (patch) | |
tree | 3e3a97a625827ea642f7817163b3dfd0b621b9c4 | |
parent | ae0d33626a0017e11509fc331391183a66f3ec30 (diff) |
throw away pre-6.0 code
-rw-r--r-- | docproc/src/main/java/com/yahoo/docproc/AbstractConcreteDocumentFactory.java | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/docproc/src/main/java/com/yahoo/docproc/AbstractConcreteDocumentFactory.java b/docproc/src/main/java/com/yahoo/docproc/AbstractConcreteDocumentFactory.java index 36686caf7ac..8f771418959 100644 --- a/docproc/src/main/java/com/yahoo/docproc/AbstractConcreteDocumentFactory.java +++ b/docproc/src/main/java/com/yahoo/docproc/AbstractConcreteDocumentFactory.java @@ -28,18 +28,5 @@ public abstract class AbstractConcreteDocumentFactory extends com.yahoo.componen * * @return A concrete document instance */ - public com.yahoo.document.Document getDocumentCopy(java.lang.String type, com.yahoo.document.datatypes.StructuredFieldValue src, com.yahoo.document.DocumentId id) { - // Note: This method can't be abstract because it must work with older bundles where the ConcreteDocumentFactory may not implement it. - // It is overridden to not use reflection by newer bundles. - // The implementation here is not so good in bundles, since it instantiates the doc using reflection. - // TODO: for 6.0: make this method abstract and throw away the code below. - Class<? extends Document> concreteClass = documentTypes().get(type); - try { - Constructor<? extends Document> copyCon = concreteClass.getConstructor(StructuredFieldValue.class, DocumentId.class); - return copyCon.newInstance(src, id); - } catch (InvocationTargetException | NoSuchMethodException | InstantiationException | IllegalAccessException e) { - throw new RuntimeException(Exceptions.toMessageString(e), e); - } - } - + public abstract com.yahoo.document.Document getDocumentCopy(java.lang.String type, com.yahoo.document.datatypes.StructuredFieldValue src, com.yahoo.document.DocumentId id); } |