mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
code simplification
This commit is contained in:
parent
b28987edd2
commit
368a931804
3 changed files with 6 additions and 15 deletions
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -88,8 +88,6 @@ public class PluginCollection {
|
|||
}
|
||||
|
||||
switch (formatType) {
|
||||
case NONE:
|
||||
return null;
|
||||
case ANY:
|
||||
{
|
||||
FormatPlugin p = getPlugin(fileType, FormatPlugin.Type.NATIVE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue