1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

code simplification

This commit is contained in:
Nikolay Pultsin 2014-07-01 21:56:36 +01:00
parent b28987edd2
commit 368a931804
3 changed files with 6 additions and 15 deletions

View file

@ -69,7 +69,7 @@ public class BookCollection extends AbstractBookCollection {
if (plugin == null) {
return null;
}
if (!plugin.type().Builtin && bookFile != bookFile.getPhysicalFile()) {
if (!(plugin instanceof BuiltinFormatPlugin) && bookFile != bookFile.getPhysicalFile()) {
return null;
}
try {

View file

@ -54,18 +54,11 @@ public abstract class FormatPlugin {
public abstract String readAnnotation(ZLFile file);
public enum Type {
ANY(false),
JAVA(true),
NATIVE(true),
EXTERNAL(false),
EXTERNAL_PROGRAM(false),
NONE(false);
public final boolean Builtin;
Type(boolean builtin) {
Builtin = builtin;
}
ANY,
JAVA,
NATIVE,
EXTERNAL,
EXTERNAL_PROGRAM;
};
public abstract Type type();

View file

@ -88,8 +88,6 @@ public class PluginCollection {
}
switch (formatType) {
case NONE:
return null;
case ANY:
{
FormatPlugin p = getPlugin(fileType, FormatPlugin.Type.NATIVE);