Skip to content

Commit

Permalink
Merge pull request #392 from gsmet/missing-override
Browse files Browse the repository at this point in the history
Add missing @OverRide annotations
  • Loading branch information
cescoffier authored Dec 26, 2018
2 parents 8638731 + 4378401 commit 576b6af
Show file tree
Hide file tree
Showing 45 changed files with 140 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builder/src/main/java/org/jboss/builder/ConsumeFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,27 @@
*/
public final class ConsumeFlags extends Flags<ConsumeFlag, ConsumeFlags> {

@Override
protected ConsumeFlags value(final int bits) {
return values[bits & enumValues.length - 1];
}

@Override
protected ConsumeFlags this_() {
return this;
}

@Override
protected ConsumeFlag itemOf(final int index) {
return enumValues[index];
}

@Override
protected ConsumeFlag castItemOrNull(final Object obj) {
return obj instanceof ConsumeFlag ? (ConsumeFlag) obj : null;
}

@Override
protected ConsumeFlags castThis(final Object obj) {
return (ConsumeFlags) obj;
}
Expand Down
1 change: 1 addition & 0 deletions builder/src/main/java/org/jboss/builder/FinalStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/**
*/
final class FinalStep implements BuildStep {
@Override
public void execute(final BuildContext context) {

}
Expand Down
3 changes: 3 additions & 0 deletions builder/src/main/java/org/jboss/builder/ItemId.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ boolean isMulti() {
return MultiBuildItem.class.isAssignableFrom(itemType) || NamedMultiBuildItem.class.isAssignableFrom(itemType);
}

@Override
public boolean equals(Object obj) {
return obj instanceof ItemId && equals((ItemId) obj);
}
Expand All @@ -52,10 +53,12 @@ boolean equals(ItemId obj) {
return this == obj || obj != null && itemType == obj.itemType && Objects.equals(name, obj.name);
}

@Override
public int hashCode() {
return Objects.hashCode(name) * 31 + Objects.hashCode(itemType);
}

@Override
public String toString() {
final Object name = this.name;
final Class<? extends BuildItem> itemType = this.itemType;
Expand Down
5 changes: 5 additions & 0 deletions builder/src/main/java/org/jboss/builder/ProduceFlags.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,27 @@
*/
public final class ProduceFlags extends Flags<ProduceFlag, ProduceFlags> {

@Override
protected ProduceFlags value(final int bits) {
return values[bits & enumValues.length - 1];
}

@Override
protected ProduceFlags this_() {
return this;
}

@Override
protected ProduceFlag itemOf(final int index) {
return enumValues[index];
}

@Override
protected ProduceFlag castItemOrNull(final Object obj) {
return obj instanceof ProduceFlag ? (ProduceFlag) obj : null;
}

@Override
protected ProduceFlags castThis(final Object obj) {
return (ProduceFlags) obj;
}
Expand Down
2 changes: 2 additions & 0 deletions builder/src/main/java/org/jboss/builder/diag/Diagnostic.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void print(PrintStream os) {
os.println();
}

@Override
public String toString() {
StringBuilder b = new StringBuilder();
if (location != null) {
Expand Down Expand Up @@ -93,6 +94,7 @@ public enum Level {
this.name = name;
}

@Override
public String toString() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ public static SymbolicBuildItem getInstance() {
return INSTANCE;
}

@Override
public int hashCode() {
return 0;
}

@Override
public boolean equals(final Object obj) {
return obj == this;
}

@Override
public String toString() {
return "symbolic";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ public Location getParent() {
return parent;
}

@Override
public boolean equals(final Object obj) {
return obj instanceof Location && Objects.equals(parent, ((Location) obj).getParent());
}

@Override
public int hashCode() {
return Objects.hashCode(parent);
}
Expand Down
8 changes: 8 additions & 0 deletions builder/src/test/java/org/jboss/builder/BasicTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void testSimple() throws ChainBuildException, BuildException {
final BuildChainBuilder builder = BuildChain.builder();
final AtomicBoolean ran = new AtomicBoolean();
BuildStepBuilder stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
ran.set(true);
context.produce(new DummyItem());
Expand All @@ -54,13 +55,15 @@ public void execute(final BuildContext context) {
public void testLinked() throws ChainBuildException, BuildException {
final BuildChainBuilder builder = BuildChain.builder();
BuildStepBuilder stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
context.produce(new DummyItem());
}
});
stepBuilder.produces(DummyItem.class);
stepBuilder.build();
stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
assertNotNull(context.consume(DummyItem.class));
context.produce(new DummyItem2());
Expand All @@ -80,6 +83,7 @@ public void testInitial() throws ChainBuildException, BuildException {
final BuildChainBuilder builder = BuildChain.builder();
builder.addInitial(DummyItem.class);
BuildStepBuilder stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
assertNotNull(context.consume(DummyItem.class));
context.produce(new DummyItem2());
Expand All @@ -100,6 +104,7 @@ public void execute(final BuildContext context) {
public void testPruning() throws ChainBuildException, BuildException {
final BuildChainBuilder builder = BuildChain.builder();
BuildStepBuilder stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
context.produce(new DummyItem());
}
Expand All @@ -108,6 +113,7 @@ public void execute(final BuildContext context) {
stepBuilder.build();
final AtomicBoolean ran = new AtomicBoolean();
stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
assertNotNull(context.consume(DummyItem.class));
context.produce(new DummyItem2());
Expand All @@ -129,6 +135,7 @@ public void testCircular() {
final BuildChainBuilder builder = BuildChain.builder();
builder.addFinal(DummyItem.class);
BuildStepBuilder stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
context.consume(DummyItem2.class);
context.produce(new DummyItem());
Expand All @@ -138,6 +145,7 @@ public void execute(final BuildContext context) {
stepBuilder.consumes(DummyItem2.class);
stepBuilder.build();
stepBuilder = builder.addBuildStep(new BuildStep() {
@Override
public void execute(final BuildContext context) {
context.consume(DummyItem.class);
context.produce(new DummyItem2());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ static final class ProcessorClassOutput implements ClassOutput {
this.producer = producer;
}

@Override
public void write(final String name, final byte[] data) {
producer.produce(new GeneratedClassBuildItem(false, name, data));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
public class StaticInitDebugStep {

private static final BiFunction<String, ClassVisitor, ClassVisitor> TRANSFORMER = new BiFunction<String, ClassVisitor, ClassVisitor>() {
@Override
public ClassVisitor apply(final String className, final ClassVisitor classVisitor) {
return new ClassVisitor(Opcodes.ASM6, classVisitor) {
@Override
public MethodVisitor visitMethod(final int access, final String name, final String descriptor, final String signature, final String[] exceptions) {
final MethodVisitor outer = super.visitMethod(access, name, descriptor, signature, exceptions);
if (name.equals("<clinit>")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public void setTransformers(Map<String, List<BiFunction<String, ClassVisitor, Cl
this.bytecodeTransformers = functions;
}

@Override
public void writeResource(String name, byte[] data) throws IOException {
resources.put(name, data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ public class RuntimeLoggingConfigurator implements EmbeddedConfigurator {

static final Config config = ConfigProvider.getConfig();

@Override
public Level getMinimumLevelOf(final String loggerName) {
return Level.ALL;
}

@Override
public Level getLevelOf(final String loggerName) {
Config config = getConfig();
Optional<String> level = config.getOptionalValue("shamrock.log.category." + loggerName + ".level", String.class);
Expand Down Expand Up @@ -67,6 +69,7 @@ public Level getLevelOf(final String loggerName) {
return Level.INFO;
}

@Override
public Handler[] getHandlersOf(final String loggerName) {
Config config = getConfig();
String format = config.getOptionalValue("shamrock.log.console.format", String.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ public final void run(String[] args) {
try {
if (ImageInfo.inImageRuntimeCode()) {
final SignalHandler handler = new SignalHandler() {
@Override
public void handle(final Signal signal) {
System.exit(0);
}
};
Signal.handle(new Signal("INT"), handler);
Signal.handle(new Signal("TERM"), handler);
Signal.handle(new Signal("QUIT"), new SignalHandler() {
@Override
public void handle(final Signal signal) {
DiagnosticPrinter.printDiagnostics(System.out);
}
Expand Down Expand Up @@ -229,6 +231,7 @@ class ShutdownHookThread extends Thread {
setDaemon(false);
}

@Override
public void run() {
shutdownRequested = true;
LockSupport.unpark(mainThread);
Expand All @@ -244,6 +247,7 @@ public void run() {
}
}

@Override
public String toString() {
return getName();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public Executor setupRunTime(ShutdownContext shutdownContext, int defaultCoreSiz
builder.setKeepAliveTime(getIntConfigVal("executor.keep-alive-millis", defaultKeepAliveMillis), TimeUnit.MILLISECONDS);
final EnhancedQueueExecutor executor = builder.build();
shutdownContext.addShutdownTask(new Runnable() {
@Override
public void run() {
executor.shutdown();
for (;;) try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public boolean equals(Object obj) {
return true;
}

@Override
public String toString() {
return artifact.toString() + '(' + scope + ')';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static String getProperty(final String name) {
final SecurityManager sm = System.getSecurityManager();
if(sm != null) {
return AccessController.doPrivileged(new PrivilegedAction<String>(){
@Override
public String run() {
return System.getProperty(name);
}});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
enum BuiltinBean {

INSTANCE(DotNames.INSTANCE, new Generator() {
@Override
void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionPointInfo injectionPoint, ClassCreator clazzCreator,
MethodCreator constructor, String providerName, AnnotationLiteralProcessor annotationLiterals) {

Expand Down Expand Up @@ -75,20 +76,23 @@ void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionP

}
}), INJECTION_POINT(DotNames.INJECTION_POINT, new Generator() {
@Override
void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionPointInfo injectionPoint, ClassCreator clazzCreator,
MethodCreator constructor, String providerName, AnnotationLiteralProcessor annotationLiterals) {
// this.injectionPointProvider1 = new InjectionPointProvider();
constructor.writeInstanceField(FieldDescriptor.of(clazzCreator.getClassName(), providerName, InjectableReferenceProvider.class.getName()),
constructor.getThis(), constructor.newInstance(MethodDescriptor.ofConstructor(InjectionPointProvider.class)));
}
}), BEAN(DotNames.BEAN, new Generator() {
@Override
void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionPointInfo injectionPoint, ClassCreator clazzCreator,
MethodCreator constructor, String providerName, AnnotationLiteralProcessor annotationLiterals) {
// this.beanProvider1 = new BeanMetadataProvider<>();
constructor.writeInstanceField(FieldDescriptor.of(clazzCreator.getClassName(), providerName, InjectableReferenceProvider.class.getName()),
constructor.getThis(), constructor.newInstance(MethodDescriptor.ofConstructor(BeanMetadataProvider.class)));
}
}), BEAN_MANAGER(DotNames.BEAN_MANAGER, new Generator() {
@Override
void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionPointInfo injectionPoint, ClassCreator clazzCreator,
MethodCreator constructor, String providerName, AnnotationLiteralProcessor annotationLiterals) {
constructor.writeInstanceField(FieldDescriptor.of(clazzCreator.getClassName(), providerName, InjectableReferenceProvider.class.getName()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ boolean intercepts(InterceptionType interceptionType) {
}
}

@Override
public boolean isInterceptor() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void destroy(Contextual<?> contextual) {
}
}

@Override
public synchronized void destroy() {
instances.forEachExistingValue(InstanceHandleImpl::destroyInternal);
instances.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public GenericArrayTypeImpl(Class<?> rawType, Type... actualTypeArguments) {
this.genericComponentType = new ParameterizedTypeImpl(rawType, actualTypeArguments);
}

@Override
public Type getGenericComponentType() {
return genericComponentType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public interface InjectableBean<T> extends Bean<T>, InjectableReferenceProvider<
*
* @return the scope
*/
@Override
default Class<? extends Annotation> getScope() {
return Dependent.class;
}
Expand All @@ -54,12 +55,14 @@ default Class<? extends Annotation> getScope() {
*
* @return the set of bean types
*/
@Override
Set<Type> getTypes();

/**
*
* @return the set of qualifiers
*/
@Override
default Set<Annotation> getQualifiers() {
return Qualifiers.DEFAULT_QUALIFIERS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ default InjectableBean<T> getBean() {
/**
* Delegates to {@link #destroy()}.
*/
@Override
default void close() {
destroy();
}
Expand Down
Loading

0 comments on commit 576b6af

Please sign in to comment.