Add Override annotation

This commit is contained in:
Timo Westkämper 2015-05-06 18:55:55 +03:00 committed by John Tims
parent 2fe18bd315
commit bf881bebef
34 changed files with 294 additions and 16 deletions

View File

@ -39,6 +39,7 @@ class SimpleTypeVisitorAdapter<R, P> extends SimpleTypeVisitor6<R, P> {
} catch (Exception e) {}
}
@Override
public R visitUnknown(TypeMirror t, P p) {
if (IntersectionTypeClass != null && IntersectionTypeClass.isInstance(t)) {
try {

View File

@ -66,6 +66,7 @@ class PropertyAccessInvocationHandler implements MethodInterceptor {
}
//CHECKSTYLE:OFF
@Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
//CHECKSTYLE:ON
Object rv = null;

View File

@ -35,6 +35,7 @@ public class QueryMixin<T> {
private final boolean expandAnyPaths;
private final ReplaceVisitor<Void> replaceVisitor = new ReplaceVisitor<Void>() {
@Override
public Expression<?> visit(Path<?> expr, @Nullable Void context) {
return normalizePath(expr);
}

View File

@ -37,11 +37,13 @@ public abstract class ExpressionBase<T> implements Expression<T> {
public ExpressionBase(Class<? extends T> type) {
this.type = type;
}
@Override
public final Class<? extends T> getType() {
return type;
}
@Override
public final int hashCode() {
if (hashCode == null) {
hashCode = accept(HashCodeVisitor.DEFAULT, null);

View File

@ -13,9 +13,10 @@
*/
package com.querydsl.core.types;
import java.util.List;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
import java.util.List;
import com.querydsl.core.Tuple;
@ -66,6 +67,7 @@ public abstract class MappingProjection<T> extends FactoryExpressionBase<T> {
qTuple = new QTuple(ExpressionUtils.distinctList(args));
}
@Override
public T newInstance(Object... values) {
return map(qTuple.newInstance(values));
}
@ -78,10 +80,12 @@ public abstract class MappingProjection<T> extends FactoryExpressionBase<T> {
*/
protected abstract T map(Tuple row);
@Override
public List<Expression<?>> getArgs() {
return qTuple.getArgs();
}
@Override
public <R, C> R accept(Visitor<R, C> v, @Nullable C context) {
return v.visit(this, context);
}

View File

@ -30,11 +30,13 @@ public abstract class MutableExpressionBase<T> implements Expression<T> {
public MutableExpressionBase(Class<? extends T> type) {
this.type = type;
}
@Override
public final Class<? extends T> getType() {
return type;
}
@Override
public final int hashCode() {
return accept(HashCodeVisitor.DEFAULT, null);
}

View File

@ -123,6 +123,7 @@ public enum Ops implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}
@ -162,6 +163,7 @@ public enum Ops implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}
@ -183,6 +185,7 @@ public enum Ops implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}
@ -237,6 +240,7 @@ public enum Ops implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}
@ -282,6 +286,7 @@ public enum Ops implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}
@ -308,6 +313,7 @@ public enum Ops implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -64,14 +64,17 @@ public class ParamExpressionImpl<T> extends ExpressionBase<T> implements ParamEx
}
}
@Override
public final String getName() {
return name;
}
@Override
public final boolean isAnon() {
return anon;
}
@Override
public final String getNotSetMessage() {
if (!anon) {
return "The parameter " + name + " needs to be set";

View File

@ -67,6 +67,7 @@ public enum PathType implements Operator {
*/
VARIABLE;
@Override
public Class<?> getType() {
return Object.class;
}

View File

@ -60,6 +60,7 @@ public class Templates {
protected Templates(char escape) {
this.escape = escape;
templateFactory = new TemplateFactory(escape) {
@Override
public String escapeForLike(String str) {
return Templates.this.escapeForLike(str);
}

View File

@ -109,6 +109,7 @@ public class ListPath<E, Q extends SimpleExpression<? super E>> extends Collecti
}
}
@Override
public Class<E> getElementType() {
return elementType;
}

View File

@ -74,6 +74,7 @@ public class SetPath<E, Q extends SimpleExpression<? super E>> extends Collectio
return any;
}
@Override
public Class<E> getElementType() {
return elementType;
}

View File

@ -87,6 +87,7 @@ public class JDOQuery<T> extends AbstractJDOQuery<T, JDOQuery<T>> {
* @param persistenceManager PersistenceManager instance to use
* @return cloned query
*/
@Override
public JDOQuery<T> clone(PersistenceManager persistenceManager) {
JDOQuery<T> query = new JDOQuery<T>(persistenceManager, getTemplates(),
getMetadata().clone(), isDetach());

View File

@ -116,6 +116,7 @@ public class JDOQueryFactory implements QueryFactory<JDOQuery<?>> {
return query().from(from);
}
@Override
public JDOQuery<?> query() {
return new JDOQuery<Void>(persistenceManager.get());
}

View File

@ -34,6 +34,7 @@ class JPAListAccessVisitor extends ReplaceVisitor<Void> {
this.metadata = metadata;
}
@Override
public Expression<?> visit(Path<?> expr, @Nullable Void context) {
expr = (Path<?>) super.visit(expr, null);
PathMetadata pathMetadata = expr.getMetadata();

View File

@ -56,10 +56,12 @@ public abstract class JPAQueryBase<T, Q extends JPAQueryBase<T, Q>> extends Fetc
queryMixin.getMetadata().reset();
}
@Override
public Q fetchJoin() {
return queryMixin.fetchJoin();
}
@Override
public Q fetchAll() {
return queryMixin.fetchAll();
}
@ -67,115 +69,142 @@ public abstract class JPAQueryBase<T, Q extends JPAQueryBase<T, Q>> extends Fetc
public Q from(EntityPath<?> arg) {
return queryMixin.from(arg);
}
@Override
public Q from(EntityPath<?>... args) {
return queryMixin.from(args);
}
@Override
public <P> Q from(CollectionExpression<?,P> target, Path<P> alias) {
return queryMixin.from(Expressions.as((Path)target, alias));
}
@Override
public <P> Q innerJoin(CollectionExpression<?,P> target) {
return queryMixin.innerJoin(target);
}
@Override
public <P> Q innerJoin(CollectionExpression<?,P>target, Path<P> alias) {
return queryMixin.innerJoin(target, alias);
}
@Override
public <P> Q innerJoin(EntityPath<P> target) {
return queryMixin.innerJoin(target);
}
@Override
public <P> Q innerJoin(EntityPath<P> target, Path<P> alias) {
return queryMixin.innerJoin(target, alias);
}
@Override
public <P> Q innerJoin(MapExpression<?,P> target) {
return queryMixin.innerJoin(target);
}
@Override
public <P> Q innerJoin(MapExpression<?,P> target, Path<P> alias) {
return queryMixin.innerJoin(target, alias);
}
@Override
public <P> Q join(CollectionExpression<?,P> target) {
return queryMixin.join(target);
}
@Override
public <P> Q join(CollectionExpression<?,P> target, Path<P> alias) {
return queryMixin.join(target, alias);
}
@Override
public <P> Q join(EntityPath<P> target) {
return queryMixin.join(target);
}
@Override
public <P> Q join(EntityPath<P> target, Path<P> alias) {
return queryMixin.join(target, alias);
}
@Override
public <P> Q join(MapExpression<?,P> target) {
return queryMixin.join(target);
}
@Override
public <P> Q join(MapExpression<?,P> target, Path<P> alias) {
return queryMixin.join(target, alias);
}
@Override
public <P> Q leftJoin(CollectionExpression<?,P> target) {
return queryMixin.leftJoin(target);
}
@Override
public <P> Q leftJoin(CollectionExpression<?,P> target, Path<P> alias) {
return queryMixin.leftJoin(target, alias);
}
@Override
public <P> Q leftJoin(EntityPath<P> target) {
return queryMixin.leftJoin(target);
}
@Override
public <P> Q leftJoin(EntityPath<P> target, Path<P> alias) {
return queryMixin.leftJoin(target, alias);
}
@Override
public <P> Q leftJoin(MapExpression<?,P> target) {
return queryMixin.leftJoin(target);
}
@Override
public <P> Q leftJoin(MapExpression<?,P> target, Path<P> alias) {
return queryMixin.leftJoin(target, alias);
}
@Override
public <P> Q rightJoin(CollectionExpression<?,P> target) {
return queryMixin.rightJoin(target);
}
@Override
public <P> Q rightJoin(CollectionExpression<?,P> target, Path<P> alias) {
return queryMixin.rightJoin(target, alias);
}
@Override
public <P> Q rightJoin(EntityPath<P> target) {
return queryMixin.rightJoin(target);
}
@Override
public <P> Q rightJoin(EntityPath<P> target, Path<P> alias) {
return queryMixin.rightJoin(target, alias);
}
@Override
public <P> Q rightJoin(MapExpression<?,P> target) {
return queryMixin.rightJoin(target);
}
@Override
public <P> Q rightJoin(MapExpression<?,P> target, Path<P> alias) {
return queryMixin.rightJoin(target, alias);
}
public Q on(Predicate condition) {
return queryMixin.on(condition);
}
@Override
public Q on(Predicate... conditions) {
return queryMixin.on(conditions);
}
@ -187,6 +216,7 @@ public abstract class JPAQueryBase<T, Q extends JPAQueryBase<T, Q>> extends Fetc
return serializer.toString().trim();
}
@Override
public abstract Q clone();
}

View File

@ -52,9 +52,11 @@ public class JPAQueryMixin<T> extends QueryMixin<T> {
private final JPACollectionAnyVisitor collectionAnyVisitor;
private final ReplaceVisitor<Void> replaceVisitor = new ReplaceVisitor<Void>() {
@Override
public Expression<?> visit(Path<?> expr, Void context) {
return convertPathForOrder(expr);
}
@Override
public Expression<?> visit(SubQueryExpression<?> expr, @Nullable Void context) {
// don't shorten paths inside subquery expressions
return expr;

View File

@ -37,6 +37,7 @@ public enum JPQLOps implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -210,6 +210,7 @@ public abstract class AbstractHibernateQuery<T, Q extends AbstractHibernateQuery
MDC.remove(MDC_PARAMETERS);
}
@Override
protected void reset() {
super.reset();
cleanupMDC();
@ -333,7 +334,8 @@ public abstract class AbstractHibernateQuery<T, Q extends AbstractHibernateQuery
reset();
}
}
@Override
protected JPQLSerializer createSerializer() {
return new JPQLSerializer(getTemplates());
}
@ -375,6 +377,7 @@ public abstract class AbstractHibernateQuery<T, Q extends AbstractHibernateQuery
*
* @return closed query
*/
@Override
public Q clone() {
return this.clone(this.session);
}

View File

@ -280,7 +280,8 @@ public abstract class AbstractHibernateSQLQuery<T, Q extends AbstractHibernateSQ
this.timeout = timeout;
return (Q)this;
}
@Override
protected void clone(Q query) {
super.clone(query);
cacheable = query.cacheable;
@ -289,13 +290,13 @@ public abstract class AbstractHibernateSQLQuery<T, Q extends AbstractHibernateSQ
readOnly = query.readOnly;
timeout = query.timeout;
}
protected abstract Q clone(SessionHolder session);
public Q clone(Session session) {
return this.clone(new DefaultSessionHolder(session));
}
}
public Q clone(StatelessSession statelessSession) {
return this.clone(new StatelessSessionHolder(statelessSession));
}

View File

@ -246,6 +246,7 @@ public abstract class AbstractJPAQuery<T, Q extends AbstractJPAQuery<T, Q>> exte
@Nullable
@SuppressWarnings("unchecked")
@Override
public T fetchOne() {
try{
Query query = createQuery(getMetadata().getModifiers(), false);
@ -313,6 +314,7 @@ public abstract class AbstractJPAQuery<T, Q extends AbstractJPAQuery<T, Q>> exte
*
* @return cloned query
*/
@Override
public Q clone() {
return clone(entityManager, getTemplates());
}

View File

@ -32,6 +32,7 @@ public enum LuceneOps implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -32,6 +32,7 @@ public enum LuceneOps implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -25,6 +25,7 @@ import com.querydsl.sql.codegen.MetaDataExporter;
*/
public class MetadataExportMojo extends AbstractMetaDataExportMojo{
@Override
protected boolean isForTest() {
return false;
}

View File

@ -24,6 +24,7 @@ import com.querydsl.sql.codegen.MetaDataExporter;
*/
public class TestMetadataExportMojo extends AbstractMetaDataExportMojo{
@Override
protected boolean isForTest() {
return true;
}

View File

@ -31,6 +31,7 @@ public enum MongodbOps implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -126,6 +126,7 @@ public enum SpatialOps implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -52,6 +52,7 @@ public class ForeignKeyData implements KeyData {
parentColumns.add(parentColumn);
}
@Override
public String getName() {
return name;
}
@ -61,19 +62,23 @@ public class ForeignKeyData implements KeyData {
return schema;
}
@Override
public String getTable() {
return table;
}
@Override
public List<String> getForeignColumns() {
return foreignColumns;
}
@Override
public List<String> getParentColumns() {
return parentColumns;
}
@Nullable
@Override
public Type getType() {
return type;
}

View File

@ -52,6 +52,7 @@ public class InverseForeignKeyData implements KeyData{
parentColumns.add(parentColumn);
}
@Override
public String getName() {
return name;
}
@ -61,19 +62,23 @@ public class InverseForeignKeyData implements KeyData{
return schema;
}
@Override
public String getTable() {
return table;
}
@Override
public List<String> getForeignColumns() {
return foreignColumns;
}
@Override
public List<String> getParentColumns() {
return parentColumns;
}
@Nullable
@Override
public Type getType() {
return type;
}

View File

@ -126,6 +126,7 @@ public abstract class AbstractSQLQuery<T, Q extends AbstractSQLQuery<T, Q>> exte
return addFlag(SQLOps.FOR_UPDATE_FLAG);
}
@Override
protected SQLSerializer createSerializer() {
SQLSerializer serializer = new SQLSerializer(configuration);
serializer.setUseLiterals(useLiterals);

View File

@ -53,10 +53,12 @@ public abstract class AbstractSQLQueryFactory<Q extends SQLCommonQuery<?>> imple
return (Q) query().from(from);
}
@Override
public final Q from(Expression<?>... args) {
return (Q) query().from(args);
}
@Override
public final Q from(SubQueryExpression<?> subQuery, Path<?> alias) {
return (Q) query().from(subQuery, alias);
}

View File

@ -83,6 +83,7 @@ public enum SQLOps implements Operator {
this.type = type;
}
@Override
public Class<?> getType() {
return type;
}

View File

@ -33,6 +33,7 @@ public abstract class AbstractType<T> implements Type<T> {
return new int[]{type};
}
@Override
public String getLiteral(T value) {
return value.toString();
}