diff --git a/builder/src/main/java/org/jboss/builder/ConsumeFlags.java b/builder/src/main/java/org/jboss/builder/ConsumeFlags.java index 3394b5b71202d..fed0e3bfd15f9 100644 --- a/builder/src/main/java/org/jboss/builder/ConsumeFlags.java +++ b/builder/src/main/java/org/jboss/builder/ConsumeFlags.java @@ -24,22 +24,27 @@ */ public final class ConsumeFlags extends Flags { + @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; } diff --git a/builder/src/main/java/org/jboss/builder/FinalStep.java b/builder/src/main/java/org/jboss/builder/FinalStep.java index 1f1f494abcabe..1acd541493161 100644 --- a/builder/src/main/java/org/jboss/builder/FinalStep.java +++ b/builder/src/main/java/org/jboss/builder/FinalStep.java @@ -19,6 +19,7 @@ /** */ final class FinalStep implements BuildStep { + @Override public void execute(final BuildContext context) { } diff --git a/builder/src/main/java/org/jboss/builder/ItemId.java b/builder/src/main/java/org/jboss/builder/ItemId.java index 8496f3b6bc0de..32a119a652bed 100644 --- a/builder/src/main/java/org/jboss/builder/ItemId.java +++ b/builder/src/main/java/org/jboss/builder/ItemId.java @@ -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); } @@ -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 itemType = this.itemType; diff --git a/builder/src/main/java/org/jboss/builder/ProduceFlags.java b/builder/src/main/java/org/jboss/builder/ProduceFlags.java index ecf1c0a7749cc..c7112ae2b0c42 100644 --- a/builder/src/main/java/org/jboss/builder/ProduceFlags.java +++ b/builder/src/main/java/org/jboss/builder/ProduceFlags.java @@ -24,22 +24,27 @@ */ public final class ProduceFlags extends Flags { + @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; } diff --git a/builder/src/main/java/org/jboss/builder/diag/Diagnostic.java b/builder/src/main/java/org/jboss/builder/diag/Diagnostic.java index 9f73d1eefae23..2873292572247 100644 --- a/builder/src/main/java/org/jboss/builder/diag/Diagnostic.java +++ b/builder/src/main/java/org/jboss/builder/diag/Diagnostic.java @@ -60,6 +60,7 @@ public void print(PrintStream os) { os.println(); } + @Override public String toString() { StringBuilder b = new StringBuilder(); if (location != null) { @@ -93,6 +94,7 @@ public enum Level { this.name = name; } + @Override public String toString() { return name; } diff --git a/builder/src/main/java/org/jboss/builder/item/SymbolicBuildItem.java b/builder/src/main/java/org/jboss/builder/item/SymbolicBuildItem.java index 7b4426e087564..b9ea763f5b07e 100644 --- a/builder/src/main/java/org/jboss/builder/item/SymbolicBuildItem.java +++ b/builder/src/main/java/org/jboss/builder/item/SymbolicBuildItem.java @@ -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"; } diff --git a/builder/src/main/java/org/jboss/builder/location/Location.java b/builder/src/main/java/org/jboss/builder/location/Location.java index 736191d087be0..2c61c9b9635e5 100644 --- a/builder/src/main/java/org/jboss/builder/location/Location.java +++ b/builder/src/main/java/org/jboss/builder/location/Location.java @@ -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); } diff --git a/builder/src/test/java/org/jboss/builder/BasicTests.java b/builder/src/test/java/org/jboss/builder/BasicTests.java index fba8174684307..68a9b8a6c7949 100644 --- a/builder/src/test/java/org/jboss/builder/BasicTests.java +++ b/builder/src/test/java/org/jboss/builder/BasicTests.java @@ -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()); @@ -54,6 +55,7 @@ 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()); } @@ -61,6 +63,7 @@ public void execute(final BuildContext context) { 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()); @@ -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()); @@ -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()); } @@ -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()); @@ -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()); @@ -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()); diff --git a/core/deployment/src/main/java/org/jboss/shamrock/deployment/logging/LoggingResourceProcessor.java b/core/deployment/src/main/java/org/jboss/shamrock/deployment/logging/LoggingResourceProcessor.java index 3f407b000f694..2966a18b16e25 100644 --- a/core/deployment/src/main/java/org/jboss/shamrock/deployment/logging/LoggingResourceProcessor.java +++ b/core/deployment/src/main/java/org/jboss/shamrock/deployment/logging/LoggingResourceProcessor.java @@ -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)); } diff --git a/core/deployment/src/main/java/org/jboss/shamrock/deployment/steps/StaticInitDebugStep.java b/core/deployment/src/main/java/org/jboss/shamrock/deployment/steps/StaticInitDebugStep.java index b339ddd968aa3..4beef3d01776b 100644 --- a/core/deployment/src/main/java/org/jboss/shamrock/deployment/steps/StaticInitDebugStep.java +++ b/core/deployment/src/main/java/org/jboss/shamrock/deployment/steps/StaticInitDebugStep.java @@ -39,8 +39,10 @@ public class StaticInitDebugStep { private static final BiFunction TRANSFORMER = new BiFunction() { + @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("")) { diff --git a/core/deployment/src/main/java/org/jboss/shamrock/runner/RuntimeClassLoader.java b/core/deployment/src/main/java/org/jboss/shamrock/runner/RuntimeClassLoader.java index f665f304557a1..94f67b7e66a7c 100644 --- a/core/deployment/src/main/java/org/jboss/shamrock/runner/RuntimeClassLoader.java +++ b/core/deployment/src/main/java/org/jboss/shamrock/runner/RuntimeClassLoader.java @@ -294,6 +294,7 @@ public void setTransformers(Map level = config.getOptionalValue("shamrock.log.category." + loggerName + ".level", String.class); @@ -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) diff --git a/core/runtime/src/main/java/org/jboss/shamrock/runtime/Application.java b/core/runtime/src/main/java/org/jboss/shamrock/runtime/Application.java index 8fb3eb4e66868..b6c0cc708bb0f 100644 --- a/core/runtime/src/main/java/org/jboss/shamrock/runtime/Application.java +++ b/core/runtime/src/main/java/org/jboss/shamrock/runtime/Application.java @@ -171,6 +171,7 @@ 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); } @@ -178,6 +179,7 @@ public void handle(final Signal signal) { 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); } @@ -229,6 +231,7 @@ class ShutdownHookThread extends Thread { setDaemon(false); } + @Override public void run() { shutdownRequested = true; LockSupport.unpark(mainThread); @@ -244,6 +247,7 @@ public void run() { } } + @Override public String toString() { return getName(); } diff --git a/core/runtime/src/main/java/org/jboss/shamrock/runtime/ExecutorTemplate.java b/core/runtime/src/main/java/org/jboss/shamrock/runtime/ExecutorTemplate.java index 7bddc3c9c09c4..837eda9a918ba 100644 --- a/core/runtime/src/main/java/org/jboss/shamrock/runtime/ExecutorTemplate.java +++ b/core/runtime/src/main/java/org/jboss/shamrock/runtime/ExecutorTemplate.java @@ -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 { diff --git a/creator/src/main/java/org/jboss/shamrock/creator/AppDependency.java b/creator/src/main/java/org/jboss/shamrock/creator/AppDependency.java index 5bc40b4b9c27d..477b3a03f8701 100644 --- a/creator/src/main/java/org/jboss/shamrock/creator/AppDependency.java +++ b/creator/src/main/java/org/jboss/shamrock/creator/AppDependency.java @@ -71,6 +71,7 @@ public boolean equals(Object obj) { return true; } + @Override public String toString() { return artifact.toString() + '(' + scope + ')'; } diff --git a/creator/src/main/java/org/jboss/shamrock/creator/util/PropertyUtils.java b/creator/src/main/java/org/jboss/shamrock/creator/util/PropertyUtils.java index 2007f4091d0df..be41777deedff 100644 --- a/creator/src/main/java/org/jboss/shamrock/creator/util/PropertyUtils.java +++ b/creator/src/main/java/org/jboss/shamrock/creator/util/PropertyUtils.java @@ -52,6 +52,7 @@ public static String getProperty(final String name) { final SecurityManager sm = System.getSecurityManager(); if(sm != null) { return AccessController.doPrivileged(new PrivilegedAction(){ + @Override public String run() { return System.getProperty(name); }}); diff --git a/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/BuiltinBean.java b/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/BuiltinBean.java index f596cc209d4eb..81bd6c78e507b 100644 --- a/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/BuiltinBean.java +++ b/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/BuiltinBean.java @@ -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) { @@ -75,6 +76,7 @@ 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(); @@ -82,6 +84,7 @@ void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionP 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<>(); @@ -89,6 +92,7 @@ void generate(ClassOutput classOutput, BeanDeployment beanDeployment, InjectionP 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()), diff --git a/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/InterceptorInfo.java b/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/InterceptorInfo.java index 787ff16d36425..e0aa47cef2d8d 100644 --- a/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/InterceptorInfo.java +++ b/ext/arc/processor/src/main/java/org/jboss/protean/arc/processor/InterceptorInfo.java @@ -119,6 +119,7 @@ boolean intercepts(InterceptionType interceptionType) { } } + @Override public boolean isInterceptor() { return true; } diff --git a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/AbstractSharedContext.java b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/AbstractSharedContext.java index 96bf4bd4db881..7f75f45335360 100644 --- a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/AbstractSharedContext.java +++ b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/AbstractSharedContext.java @@ -65,6 +65,7 @@ public void destroy(Contextual contextual) { } } + @Override public synchronized void destroy() { instances.forEachExistingValue(InstanceHandleImpl::destroyInternal); instances.clear(); diff --git a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/GenericArrayTypeImpl.java b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/GenericArrayTypeImpl.java index 2cbafec595c2e..7b6e4c7f94edc 100644 --- a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/GenericArrayTypeImpl.java +++ b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/GenericArrayTypeImpl.java @@ -35,6 +35,7 @@ public GenericArrayTypeImpl(Class rawType, Type... actualTypeArguments) { this.genericComponentType = new ParameterizedTypeImpl(rawType, actualTypeArguments); } + @Override public Type getGenericComponentType() { return genericComponentType; } diff --git a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InjectableBean.java b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InjectableBean.java index 7cf4761a4799d..480a9998283e5 100644 --- a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InjectableBean.java +++ b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InjectableBean.java @@ -46,6 +46,7 @@ public interface InjectableBean extends Bean, InjectableReferenceProvider< * * @return the scope */ + @Override default Class getScope() { return Dependent.class; } @@ -54,12 +55,14 @@ default Class getScope() { * * @return the set of bean types */ + @Override Set getTypes(); /** * * @return the set of qualifiers */ + @Override default Set getQualifiers() { return Qualifiers.DEFAULT_QUALIFIERS; } diff --git a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InstanceHandle.java b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InstanceHandle.java index 592c237f4246a..a4a94013ed352 100644 --- a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InstanceHandle.java +++ b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/InstanceHandle.java @@ -57,6 +57,7 @@ default InjectableBean getBean() { /** * Delegates to {@link #destroy()}. */ + @Override default void close() { destroy(); } diff --git a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/ParameterizedTypeImpl.java b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/ParameterizedTypeImpl.java index 56795c3c34d29..8334395e21625 100644 --- a/ext/arc/runtime/src/main/java/org/jboss/protean/arc/ParameterizedTypeImpl.java +++ b/ext/arc/runtime/src/main/java/org/jboss/protean/arc/ParameterizedTypeImpl.java @@ -39,14 +39,17 @@ public ParameterizedTypeImpl(Type rawType, Type[] actualTypeArguments, Type owne this.ownerType = ownerType; } + @Override public Type[] getActualTypeArguments() { return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length); } + @Override public Type getOwnerType() { return ownerType; } + @Override public Type getRawType() { return rawType; } diff --git a/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerFieldTest.java b/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerFieldTest.java index 8aeb41cec5af6..3a87a33f54240 100644 --- a/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerFieldTest.java +++ b/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerFieldTest.java @@ -49,6 +49,7 @@ static class HeadProducer { @Produces private Head head = new Head() { + @Override public String name() { return "foo"; } diff --git a/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerMethodTest.java b/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerMethodTest.java index b1ee86006de91..c793b359b4843 100644 --- a/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerMethodTest.java +++ b/ext/arc/tests/src/test/java/org/jboss/protean/arc/test/producer/privatemember/PrivateProducerMethodTest.java @@ -58,6 +58,7 @@ void init() { @Produces private Head produce() { return new Head() { + @Override public String name() { return name; } diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreator.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreator.java index 495cbd0078494..be752f912778c 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreator.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreator.java @@ -547,5 +547,6 @@ default void breakScope() { * Indicate that the scope is no longer in use. The scope may refuse additional instructions after this method * is called. */ + @Override default void close() {} } diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreatorImpl.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreatorImpl.java index 28b9be9fdd95d..6524b2ab54150 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreatorImpl.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/BytecodeCreatorImpl.java @@ -569,19 +569,23 @@ public ResultHandle checkCast(final ResultHandle resultHandle, final String cast final ResultHandle resolvedResultHandle = resolve(checkScope(resultHandle)); assert result != null; operations.add(new Operation() { + @Override void writeBytecode(final MethodVisitor methodVisitor) { loadResultHandle(methodVisitor, resolvedResultHandle, BytecodeCreatorImpl.this, result.getType()); storeResultHandle(methodVisitor, result); } + @Override Set getInputResultHandles() { return Collections.singleton(resolvedResultHandle); } + @Override ResultHandle getTopResultHandle() { return resolvedResultHandle; } + @Override ResultHandle getOutgoingResultHandle() { return result; } @@ -589,10 +593,12 @@ ResultHandle getOutgoingResultHandle() { return result; } + @Override public boolean isScopedWithin(final BytecodeCreator other) { return other == this || owner != null && owner.isScopedWithin(other); } + @Override public void continueScope(final BytecodeCreator scope) { if (! isScopedWithin(scope)) { throw new IllegalArgumentException("Cannot continue non-enclosing scope"); @@ -600,6 +606,7 @@ public void continueScope(final BytecodeCreator scope) { operations.add(new JumpOperation(((BytecodeCreatorImpl) scope).top)); } + @Override public void breakScope(final BytecodeCreator scope) { if (! isScopedWithin(scope)) { throw new IllegalArgumentException("Cannot break non-enclosing scope"); @@ -607,6 +614,7 @@ public void breakScope(final BytecodeCreator scope) { operations.add(new JumpOperation(((BytecodeCreatorImpl) scope).bottom)); } + @Override public BytecodeCreator createScope() { final BytecodeCreatorImpl enclosed = new BytecodeCreatorImpl(this); operations.add(new BlockOperation(enclosed)); @@ -688,6 +696,7 @@ void loadResultHandle(MethodVisitor methodVisitor, ResultHandle handle, Bytecode } } + @Override public TryBlock tryBlock() { final TryBlockImpl tryBlock = new TryBlockImpl(this); operations.add(new BlockOperation(tryBlock)); @@ -1015,18 +1024,22 @@ static class JumpOperation extends Operation { this.target = target; } + @Override void writeBytecode(final MethodVisitor methodVisitor) { methodVisitor.visitJumpInsn(Opcodes.GOTO, target); } + @Override Set getInputResultHandles() { return Collections.emptySet(); } + @Override ResultHandle getTopResultHandle() { return null; } + @Override ResultHandle getOutgoingResultHandle() { return null; } @@ -1218,22 +1231,27 @@ static class BlockOperation extends Operation { this.block = block; } + @Override void writeBytecode(final MethodVisitor methodVisitor) { block.writeOperations(methodVisitor); } + @Override Set getInputResultHandles() { return Collections.emptySet(); } + @Override ResultHandle getTopResultHandle() { return null; } + @Override ResultHandle getOutgoingResultHandle() { return null; } + @Override public void findResultHandles(final Set vc) { block.findActiveResultHandles(vc); } diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/CatchBlockCreatorImpl.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/CatchBlockCreatorImpl.java index f5712699ef380..4f343bd67b3fa 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/CatchBlockCreatorImpl.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/CatchBlockCreatorImpl.java @@ -27,6 +27,7 @@ class CatchBlockCreatorImpl extends BytecodeCreatorImpl implements CatchBlockCre this.handle = new ResultHandle("L" + exceptionType + ";", this); } + @Override protected void writeInteriorOperations(final MethodVisitor visitor) { //we need to save the exception into a local var storeResultHandle(visitor, handle); diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/ClassCreator.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/ClassCreator.java index e6a0706a19ad8..e91f13a8c3e24 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/ClassCreator.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/ClassCreator.java @@ -136,6 +136,7 @@ MethodDescriptor getSuperclassAccessor(MethodDescriptor descriptor) { return ctor.getMethodDescriptor(); } + @Override public void close() { ClassWriter file = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); String[] interfaces = new String[this.interfaces.length]; diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/FunctionCreatorImpl.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/FunctionCreatorImpl.java index e09cf85b86f3f..563e219f582ba 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/FunctionCreatorImpl.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/FunctionCreatorImpl.java @@ -102,6 +102,7 @@ private static class FunctionBytecodeCreator extends BytecodeCreatorImpl { * @param handle The handle that may be a parent handle * @return The substituted handler */ + @Override ResultHandle resolve(ResultHandle handle) { // resolve any captures of captures. if (handle == null || handle.getResultType() == ResultHandle.ResultType.CONSTANT) return handle; @@ -130,6 +131,7 @@ ResultHandle resolve(ResultHandle handle) { } } + @Override ResultHandle[] resolve(ResultHandle... handle) { ResultHandle[] ret = new ResultHandle[handle.length]; for (int i = 0; i < handle.length; ++i) { @@ -138,10 +140,12 @@ ResultHandle[] resolve(ResultHandle... handle) { return ret; } + @Override MethodCreatorImpl getMethod() { return method; } + @Override public ResultHandle invokeSpecialMethod(MethodDescriptor descriptor, ResultHandle object, ResultHandle... args) { final ClassCreator ownersCreator = getMethod().getOwner().getMethod().getClassCreator(); if (descriptor.getDeclaringClass().equals(ownersCreator.getSuperClass())) { diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/MethodCreatorImpl.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/MethodCreatorImpl.java index 34aa30b5b3643..a2496a3dc588f 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/MethodCreatorImpl.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/MethodCreatorImpl.java @@ -124,10 +124,12 @@ public void write(ClassWriter file) { visitor.visitEnd(); } + @Override ResultHandle resolve(final ResultHandle handle) { return handle; } + @Override ResultHandle[] resolve(final ResultHandle... handles) { return handles; } @@ -159,22 +161,27 @@ ClassCreator getClassCreator() { FunctionCreatorImpl addFunctionBody(final ResultHandle instance, final ClassCreator cc, final MethodCreatorImpl mc, final BytecodeCreatorImpl owner) { FunctionCreatorImpl fc = new FunctionCreatorImpl(instance, cc, mc, owner); operations.add(new Operation() { + @Override void writeBytecode(final MethodVisitor methodVisitor) { fc.getBytecode().writeOperations(methodVisitor); } + @Override Set getInputResultHandles() { return Collections.emptySet(); } + @Override ResultHandle getTopResultHandle() { return null; } + @Override ResultHandle getOutgoingResultHandle() { return null; } + @Override public void findResultHandles(final Set vc) { fc.getBytecode().findActiveResultHandles(vc); } diff --git a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/TryBlockImpl.java b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/TryBlockImpl.java index 4847adb11b761..c54bffb7e7e5c 100644 --- a/ext/gizmo/src/main/java/org/jboss/protean/gizmo/TryBlockImpl.java +++ b/ext/gizmo/src/main/java/org/jboss/protean/gizmo/TryBlockImpl.java @@ -33,6 +33,7 @@ class TryBlockImpl extends BytecodeCreatorImpl implements TryBlock { super(enclosing); } + @Override public CatchBlockCreator addCatch(final String exceptionType) { String name = exceptionType.replace('.', '/'); if (catchBlocks.containsKey(name)) { @@ -43,6 +44,7 @@ public CatchBlockCreator addCatch(final String exceptionType) { return catchBlock; } + @Override protected void writeOperations(final MethodVisitor visitor) { // this is everything between top & bottom labels super.writeOperations(visitor); @@ -61,6 +63,7 @@ protected void writeOperations(final MethodVisitor visitor) { } } + @Override void findActiveResultHandles(final Set handlesToAllocate) { super.findActiveResultHandles(handlesToAllocate); for (CatchBlockCreatorImpl value : catchBlocks.values()) { diff --git a/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/impl/FastBootEntityManagerFactoryBuilder.java b/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/impl/FastBootEntityManagerFactoryBuilder.java index 9faafd4778504..dce65036a426b 100644 --- a/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/impl/FastBootEntityManagerFactoryBuilder.java +++ b/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/impl/FastBootEntityManagerFactoryBuilder.java @@ -180,6 +180,7 @@ public void sessionFactoryClosed(SessionFactory sessionFactory) { private static class JpaEntityNotFoundDelegate implements EntityNotFoundDelegate, Serializable { + @Override public void handleEntityNotFound(String entityName, Serializable id) { throw new EntityNotFoundException( "Unable to find " + entityName + " with id " + id ); } diff --git a/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/recording/RecordableBootstrap.java b/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/recording/RecordableBootstrap.java index fe3f939dd3dbc..3654d65feb666 100644 --- a/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/recording/RecordableBootstrap.java +++ b/ext/hibernate-orm-protean/src/main/java/org/hibernate/protean/recording/RecordableBootstrap.java @@ -102,6 +102,7 @@ public RecordableBootstrap( /** * Intended for internal testing use only!! */ + @Override public LoadedConfig getAggregatedCfgXml() { return aggregatedCfgXml; } @@ -157,6 +158,7 @@ private static List standardInitiatorList() { return Collections.unmodifiableList( serviceInitiators ); } + @Override public BootstrapServiceRegistry getBootstrapServiceRegistry() { return bootstrapServiceRegistry; } @@ -174,6 +176,7 @@ public BootstrapServiceRegistry getBootstrapServiceRegistry() { * @see #configure() * @see #configure(String) */ + @Override @SuppressWarnings({"unchecked"}) public StandardServiceRegistryBuilder loadProperties(String resourceName) { settings.putAll( configLoader.loadProperties( resourceName ) ); @@ -193,6 +196,7 @@ public StandardServiceRegistryBuilder loadProperties(String resourceName) { * @see #configure() * @see #configure(String) */ + @Override @SuppressWarnings({"unchecked"}) public StandardServiceRegistryBuilder loadProperties(File file) { settings.putAll( configLoader.loadProperties( file ) ); @@ -208,6 +212,7 @@ public StandardServiceRegistryBuilder loadProperties(File file) { * @see #configure(String) * @see #loadProperties(String) */ + @Override public StandardServiceRegistryBuilder configure() { return configure( DEFAULT_CFG_RESOURCE_NAME ); } @@ -219,18 +224,22 @@ public StandardServiceRegistryBuilder configure() { * * @return this, for method chaining */ + @Override public StandardServiceRegistryBuilder configure(String resourceName) { return configure( configLoader.loadConfigXmlResource( resourceName ) ); } + @Override public StandardServiceRegistryBuilder configure(File configurationFile) { return configure( configLoader.loadConfigXmlFile( configurationFile ) ); } + @Override public StandardServiceRegistryBuilder configure(URL url) { return configure( configLoader.loadConfigXmlUrl( url ) ); } + @Override @SuppressWarnings({"unchecked"}) public StandardServiceRegistryBuilder configure(LoadedConfig loadedConfig) { aggregatedCfgXml.merge( loadedConfig ); @@ -247,6 +256,7 @@ public StandardServiceRegistryBuilder configure(LoadedConfig loadedConfig) { * * @return this, for method chaining */ + @Override @SuppressWarnings({"unchecked", "UnusedDeclaration"}) public StandardServiceRegistryBuilder applySetting(String settingName, Object value) { settings.put( settingName, value ); @@ -260,12 +270,14 @@ public StandardServiceRegistryBuilder applySetting(String settingName, Object va * * @return this, for method chaining */ + @Override @SuppressWarnings({"unchecked", "UnusedDeclaration"}) public StandardServiceRegistryBuilder applySettings(Map settings) { this.settings.putAll( settings ); return this; } + @Override public void clearSettings() { settings.clear(); } @@ -277,6 +289,7 @@ public void clearSettings() { * * @return this, for method chaining */ + @Override @SuppressWarnings({"UnusedDeclaration"}) public StandardServiceRegistryBuilder addInitiator(StandardServiceInitiator initiator) { initiators.add( initiator ); @@ -291,6 +304,7 @@ public StandardServiceRegistryBuilder addInitiator(StandardServiceInitiator init * * @return this, for method chaining */ + @Override @SuppressWarnings({"unchecked"}) public StandardServiceRegistryBuilder addService(final Class serviceRole, final Service service) { providedServices.add( new ProvidedService( serviceRole, service ) ); @@ -310,6 +324,7 @@ public StandardServiceRegistryBuilder addService(final Class serviceRole, final * * @return this, for method chaining */ + @Override public StandardServiceRegistryBuilder disableAutoClose() { this.autoCloseRegistry = false; return this; @@ -321,6 +336,7 @@ public StandardServiceRegistryBuilder disableAutoClose() { * * @return this, for method chaining */ + @Override public StandardServiceRegistryBuilder enableAutoClose() { this.autoCloseRegistry = true; return this; @@ -331,6 +347,7 @@ public StandardServiceRegistryBuilder enableAutoClose() { * * @return The StandardServiceRegistry. */ + @Override @SuppressWarnings("unchecked") public StandardServiceRegistry build() { applyServiceContributingIntegrators(); @@ -381,6 +398,7 @@ private void applyServiceContributors() { * @deprecated Temporarily exposed since Configuration is still around and much code still uses Configuration. * This allows code to configure the builder and access that to configure Configuration object. */ + @Override @Deprecated public Map getSettings() { return settings; diff --git a/jpa/deployment/src/main/java/org/jboss/shamrock/jpa/HibernateEntityEnhancer.java b/jpa/deployment/src/main/java/org/jboss/shamrock/jpa/HibernateEntityEnhancer.java index a4918e20029d3..fac399c0f850d 100644 --- a/jpa/deployment/src/main/java/org/jboss/shamrock/jpa/HibernateEntityEnhancer.java +++ b/jpa/deployment/src/main/java/org/jboss/shamrock/jpa/HibernateEntityEnhancer.java @@ -74,6 +74,7 @@ public HibernateEnhancingClassVisitor(String className, ClassVisitor outputClass this.outputClassVisitor = outputClassVisitor; } + @Override public void visitEnd() { super.visitEnd(); final ClassWriter writer = (ClassWriter) this.cv; //safe cast: cv is the the ClassWriter instance we passed to the super constructor diff --git a/maven/src/main/java/org/jboss/shamrock/maven/MojoLogger.java b/maven/src/main/java/org/jboss/shamrock/maven/MojoLogger.java index 31cf1bc626fbe..f79f1151ec9e5 100644 --- a/maven/src/main/java/org/jboss/shamrock/maven/MojoLogger.java +++ b/maven/src/main/java/org/jboss/shamrock/maven/MojoLogger.java @@ -37,8 +37,10 @@ public class MojoLogger implements LoggerProvider { public static volatile Supplier logSupplier; + @Override public Logger getLogger(final String name) { return new Logger(name) { + @Override protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) { final Supplier logSupplier = MojoLogger.logSupplier; if (logSupplier != null) { @@ -55,6 +57,7 @@ protected void doLog(final Level level, final String loggerClassName, final Obje } } + @Override protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) { final Supplier logSupplier = MojoLogger.logSupplier; if (logSupplier != null) { @@ -74,6 +77,7 @@ protected void doLogf(final Level level, final String loggerClassName, final Str } } + @Override public boolean isEnabled(final Level level) { final Supplier logSupplier = MojoLogger.logSupplier; if (logSupplier == null) return false; @@ -124,48 +128,60 @@ String invalidFormat(final String format, final Object[] parameters) { return b.toString(); } + @Override public void clearMdc() { } + @Override public Object putMdc(final String key, final Object value) { //throw Assert.unsupported(); return null; } + @Override public Object getMdc(final String key) { return null; } + @Override public void removeMdc(final String key) { } + @Override public Map getMdcMap() { return Collections.emptyMap(); } + @Override public void clearNdc() { } + @Override public String getNdc() { return ""; } + @Override public int getNdcDepth() { return 0; } + @Override public String popNdc() { return ""; } + @Override public String peekNdc() { return ""; } + @Override public void pushNdc(final String message) { throw Assert.unsupported(); } + @Override public void setNdcMaxDepth(final int maxDepth) { } } diff --git a/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java b/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java index 75edc3bf0a0fa..758c2d6afc471 100644 --- a/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java +++ b/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java @@ -267,6 +267,7 @@ static final class ProcessorClassOutput implements ClassOutput { this.producer = producer; } + @Override public void write(final String name, final byte[] data) { producer.produce(new GeneratedClassBuildItem(true, name, data)); } diff --git a/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java b/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java index cf11f4263139c..63a4d3941443f 100644 --- a/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java +++ b/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java @@ -78,6 +78,7 @@ public class QuartzScheduler implements Scheduler { private final Map timers = new ConcurrentHashMap<>(); + @Override public void pause() { if (running.get()) { try { @@ -88,6 +89,7 @@ public void pause() { } } + @Override public void resume() { if (running.get()) { try { diff --git a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorMandatory.java b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorMandatory.java index 80ade25010e3f..293c8beb4de62 100644 --- a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorMandatory.java +++ b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorMandatory.java @@ -40,6 +40,7 @@ public TransactionalInterceptorMandatory() { super(false); } + @Override @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { return super.intercept(ic); diff --git a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNever.java b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNever.java index fad83a0ec2fd9..b967348518fc5 100644 --- a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNever.java +++ b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNever.java @@ -40,6 +40,7 @@ public TransactionalInterceptorNever() { super(true); } + @Override @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { return super.intercept(ic); diff --git a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNotSupported.java b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNotSupported.java index aef56eff74f92..4bceba9e8c1de 100644 --- a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNotSupported.java +++ b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorNotSupported.java @@ -36,6 +36,7 @@ public TransactionalInterceptorNotSupported() { super(true); } + @Override @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { return super.intercept(ic); diff --git a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequired.java b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequired.java index d85ea504a3a6e..02dad48286d3e 100644 --- a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequired.java +++ b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequired.java @@ -37,6 +37,7 @@ public TransactionalInterceptorRequired() { super(false); } + @Override @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { return super.intercept(ic); diff --git a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequiresNew.java b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequiresNew.java index 4e7a2ede2f272..15d1093b2ca26 100644 --- a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequiresNew.java +++ b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorRequiresNew.java @@ -37,6 +37,7 @@ public TransactionalInterceptorRequiresNew() { super(false); } + @Override @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { return super.intercept(ic); diff --git a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorSupports.java b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorSupports.java index 243b228ce0a14..7052eeb40562c 100644 --- a/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorSupports.java +++ b/transactions/runtime/src/main/java/org/jboss/shamrock/transactions/runtime/interceptor/TransactionalInterceptorSupports.java @@ -36,6 +36,7 @@ public TransactionalInterceptorSupports() { super(false); } + @Override @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { return super.intercept(ic); diff --git a/vertx/runtime/src/main/java/org/jboss/shamrock/vertx/runtime/graal/JdkSubstitutions.java b/vertx/runtime/src/main/java/org/jboss/shamrock/vertx/runtime/graal/JdkSubstitutions.java index 92b7e17105cca..185d3324a6d15 100644 --- a/vertx/runtime/src/main/java/org/jboss/shamrock/vertx/runtime/graal/JdkSubstitutions.java +++ b/vertx/runtime/src/main/java/org/jboss/shamrock/vertx/runtime/graal/JdkSubstitutions.java @@ -53,6 +53,7 @@ final class Target_sun_misc_URLClassPath { try { return java.security.AccessController.doPrivileged( new java.security.PrivilegedExceptionAction() { + @Override public Target_sun_misc_URLClassPath$Loader run() throws IOException { String file = url.getFile(); if (file != null && file.endsWith("/")) {