diff --git a/cobigen/cobigen-core-parent/cobigen-core/src/main/java/com/devonfw/cobigen/impl/generator/InputInterpreterImpl.java b/cobigen/cobigen-core-parent/cobigen-core/src/main/java/com/devonfw/cobigen/impl/generator/InputInterpreterImpl.java index ea6d6679f3..a253ac2ffe 100644 --- a/cobigen/cobigen-core-parent/cobigen-core/src/main/java/com/devonfw/cobigen/impl/generator/InputInterpreterImpl.java +++ b/cobigen/cobigen-core-parent/cobigen-core/src/main/java/com/devonfw/cobigen/impl/generator/InputInterpreterImpl.java @@ -61,6 +61,19 @@ public Object read(String type, Path path, Charset inputCharset, Object... addit @Override public Object read(Path path, Charset inputCharset, Object... additionalArguments) throws InputReaderException { Set keySet = PluginRegistry.getTriggerInterpreterKeySet(); + // We first try to find an input reader that is most likely readable + for (String s : keySet) { + try { + if (isMostLikelyReadable(s, path)) { + return getInputReader(s).read(path, inputCharset, additionalArguments); + } + } catch (InputReaderException e) { + // nothing to do. + } + } + + // No input reader is most likely readable, then we try with every of them until we find the correct + // one for (String s : keySet) { try { return getInputReader(s).read(path, inputCharset, additionalArguments); diff --git a/cobigen/cobigen-core-parent/pom.xml b/cobigen/cobigen-core-parent/pom.xml index ee1f3219bd..7ba527871b 100644 --- a/cobigen/cobigen-core-parent/pom.xml +++ b/cobigen/cobigen-core-parent/pom.xml @@ -12,7 +12,7 @@ - 5.3.4 + 5.3.5-SNAPSHOT