W dniu 2014-07-11 15:16, Daniel Naber pisze: > Hi, > > currently a language defines its Java rules like this: > > @Override > public List<Class<? extends Rule>> getRelevantRules() { > return Arrays.asList(CommaWhitespaceRule.class); > } > > I wonder why we return the class here, instead of an actual object? Like > this: > > @Override > public List<Rule> getRelevantRules() { > ResourceBundle messages = JLanguageTool.getMessageBundle(this); > return Arrays.asList(new CommaWhitespaceRule(messages)); > } > > This way we could get rid of some semi-ugly reflection code in > Language.java. If there's no reason against it, I will make that change.
As far as I remember, we used reflection in the past, so this class was a drop-in replacement for the old code. Hence a strange signature. I think we don't any reflection here. Regards, Marcin ------------------------------------------------------------------------------ _______________________________________________ Languagetool-devel mailing list Languagetool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/languagetool-devel