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

Fix miscellaneous error-prone findings #1312

Merged
merged 1 commit into from
Jan 17, 2023
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 @@ -19,7 +19,6 @@
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ListMultimap;
import com.google.common.flogger.FluentLogger;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
Expand All @@ -44,9 +43,6 @@
* classes.
*/
public class ValidatorLoader {

private static final FluentLogger logger = FluentLogger.forEnclosingClass();

private final ListMultimap<Class<? extends GtfsEntity>, Class<? extends SingleEntityValidator<?>>>
singleEntityValidators = ArrayListMultimap.create();
private final ListMultimap<Class<? extends GtfsTableContainer<?>>, Class<? extends FileValidator>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
}

@Override
@SuppressWarnings("unchecked")
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
List<GtfsEnumDescriptor> enumDescriptors = new ArrayList<>();
for (TypeElement type : typesIn(annotatedElementsIn(roundEnv, GtfsEnumValues.class))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ void generateMethods(TypeSpec.Builder typeSpec) {
fileDescriptor.getSingleColumnPrimaryKey(),
classNames.entityImplementationTypeName());
} else if (fileDescriptor.hasMultiColumnPrimaryKey()) {
addMapByCompositeKey(
typeSpec, fileDescriptor.primaryKeys(), classNames.entityImplementationTypeName());
addMapByCompositeKey(typeSpec, classNames.entityImplementationTypeName());
}

for (GtfsFieldDescriptor indexField : fileDescriptor.indices()) {
Expand Down Expand Up @@ -164,9 +163,7 @@ private static void addMapWithGetter(
.build());
}

private static void addMapByCompositeKey(
TypeSpec.Builder typeSpec, ImmutableList<GtfsFieldDescriptor> keys, TypeName entityTypeName) {

private static void addMapByCompositeKey(TypeSpec.Builder typeSpec, TypeName entityTypeName) {
// Field: Map<CompositeKey, EntityType?> byCompositeKeyMap;
TypeName keyMapType =
ParameterizedTypeName.get(
Expand Down