Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code quality fix - "switch" statements should end with a "default" clause. #21

Merged
merged 1 commit into from
Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public static Sequence createStream(InputStream input) throws IOException {
return new SequenceInt32();
case TYPE_SEQ64:
return new SequenceLog64();
}
throw new IllegalFormatException("Implementation not found for Sequence with code "+type);
default :
throw new IllegalFormatException("Implementation not found for Sequence with code "+type);
}
}

public static Sequence createStream(CountInputStream input, File f) throws IOException {
Expand All @@ -85,8 +86,9 @@ public static Sequence createStream(CountInputStream input, File f) throws IOExc
case TYPE_SEQ64:
// return new SequenceLog64();
throw new NotImplementedException();
default:
throw new IllegalFormatException("Implementation not found for Sequence with code "+type);
}
throw new IllegalFormatException("Implementation not found for Sequence with code "+type);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ protected int getGlobalId(int id, DictionarySectionRole position) {
case PREDICATE:
case SHARED:
return id;
default:
throw new IllegalArgumentException();
}

throw new IllegalArgumentException();
}

protected int getLocalId(int id, TripleComponentRole position) {
Expand All @@ -81,9 +81,9 @@ protected int getLocalId(int id, TripleComponentRole position) {
}
case PREDICATE:
return id;
default:
throw new IllegalArgumentException();
}

throw new IllegalArgumentException();
}

/* (non-Javadoc)
Expand Down Expand Up @@ -131,8 +131,9 @@ public int stringToId(CharSequence str, TripleComponentRole position) {
return getGlobalId(ret, DictionarySectionRole.OBJECT);
}
return -1;
default:
throw new IllegalArgumentException();
}
throw new IllegalArgumentException();
}

@Override
Expand Down Expand Up @@ -201,8 +202,9 @@ private DictionarySectionPrivate getSection(int id, TripleComponentRole role) {
} else {
return (DictionarySectionPrivate)objects;
}
default:
throw new IllegalArgumentException();
}
throw new IllegalArgumentException();
}

/* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ public int insert(CharSequence str, TripleComponentRole position) {
case OBJECT:
isOrganized = false;
return ((TempDictionarySection)objects).add(str);
default:
throw new IllegalArgumentException();
}
throw new IllegalArgumentException();
}

@Override
Expand Down Expand Up @@ -162,9 +163,9 @@ protected int getGlobalId(int id, DictionarySectionRole position) {
case PREDICATE:
case SHARED:
return id;
default:
throw new IllegalArgumentException();
}

throw new IllegalArgumentException();
}

/* (non-Javadoc)
Expand Down Expand Up @@ -205,7 +206,8 @@ public int stringToId(CharSequence str, TripleComponentRole position) {
return getGlobalId(ret, DictionarySectionRole.OBJECT);
}
return -1;
default:
throw new IllegalArgumentException();
}
throw new IllegalArgumentException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public static DictionarySectionPrivate loadFrom(InputStream input, ProgressListe
section.load(input, listener);
}
return section;
default:
throw new IOException("DictionarySection implementation not available for id "+dictType);
}
throw new IOException("DictionarySection implementation not available for id "+dictType);
}

public static DictionarySectionPrivate loadFrom(CountInputStream input, File f, ProgressListener listener) throws IOException {
Expand All @@ -81,7 +82,8 @@ public static DictionarySectionPrivate loadFrom(CountInputStream input, File f,
DictionarySectionPrivate section= new PFCDictionarySectionMap(input, f);

return section;
default:
throw new IOException("DictionarySection implementation not available for id "+dictType);
}
throw new IOException("DictionarySection implementation not available for id "+dictType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ public Integer next() {
return iterator.next().getPredicate();
case OBJECT:
return iterator.next().getObject();
default:
// Never reached
return 0;
}
// Never reached
return 0;
}

/*
Expand Down