Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Closed
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
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016-2017 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -37,7 +38,6 @@
import org.androidannotations.internal.exception.AndroidManifestNotFoundException;
import org.androidannotations.internal.exception.ProcessingException;
import org.androidannotations.internal.exception.RClassNotFoundException;
import org.androidannotations.internal.exception.ValidationException;
import org.androidannotations.internal.exception.VersionMismatchException;
import org.androidannotations.internal.exception.VersionNotFoundException;
import org.androidannotations.internal.generation.CodeModelGenerator;
Expand Down Expand Up @@ -124,8 +124,6 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
try {
checkApiAndProcessorVersions();
processThrowing(annotations, roundEnv);
} catch (ValidationException e) {
// We do nothing, errors have been printed by ModelValidator
} catch (ProcessingException e) {
handleException(annotations, roundEnv, e);
} catch (Exception e) {
Expand Down Expand Up @@ -210,7 +208,7 @@ private IRClass findRClasses(AndroidManifest androidManifest) throws RClassNotFo
}
}

private AnnotationElements validateAnnotations(AnnotationElements extractedModel, AnnotationElementsHolder validatingHolder) throws ValidationException {
private AnnotationElements validateAnnotations(AnnotationElements extractedModel, AnnotationElementsHolder validatingHolder) {
timeStats.start("Validate Annotations");
ModelValidator modelValidator = new ModelValidator(androidAnnotationsEnv);
AnnotationElements validatedAnnotations = modelValidator.validate(extractedModel, validatingHolder);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016-2017 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -15,9 +16,7 @@
*/
package org.androidannotations.internal.process;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.lang.model.element.AnnotationMirror;
Expand All @@ -26,7 +25,6 @@
import org.androidannotations.AndroidAnnotationsEnvironment;
import org.androidannotations.ElementValidation;
import org.androidannotations.handler.AnnotationHandler;
import org.androidannotations.internal.exception.ValidationException;
import org.androidannotations.internal.model.AnnotationElements;
import org.androidannotations.internal.model.AnnotationElementsHolder;
import org.androidannotations.logger.Logger;
Expand All @@ -41,10 +39,9 @@ public ModelValidator(AndroidAnnotationsEnvironment environment) {
this.environment = environment;
}

public AnnotationElements validate(AnnotationElements extractedModel, AnnotationElementsHolder validatingHolder) throws ValidationException {
public AnnotationElements validate(AnnotationElements extractedModel, AnnotationElementsHolder validatingHolder) {

LOGGER.info("Validating elements");
List<ElementValidation> failedValidations = new ArrayList<>();

/*
* We currently do not validate the elements on the ancestors, assuming
Expand Down Expand Up @@ -84,16 +81,11 @@ public AnnotationElements validate(AnnotationElements extractedModel, Annotation
if (elementValidation.isValid()) {
validatedAnnotatedElements.add(annotatedElement);
} else {
failedValidations.add(elementValidation);
LOGGER.warn("Element {} invalidated by {}", annotatedElement, annotatedElement, validatorSimpleName);
}
}
}

if (!failedValidations.isEmpty()) {
throw new ValidationException(failedValidations);
}

return validatingHolder;
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.