diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/AbstractCodeModel.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/AbstractCodeModel.java index d15353b..c15467b 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/AbstractCodeModel.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/AbstractCodeModel.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,7 +94,7 @@ public abstract class AbstractCodeModel * * @param nameProvider the {@link NameProvider} */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + @SuppressWarnings({"unchecked", "rawtypes"}) protected AbstractCodeModel(final NameProvider nameProvider) { this.nameProvider = Objects.requireNonNull(nameProvider, "The NameProvider must not be null"); @@ -126,11 +126,11 @@ protected AbstractCodeModel(final NameProvider nameProvider) { * @param namespaceDescriptors the {@link Stream} of {@link Marshalled} {@link NamespaceDescriptor}s */ protected AbstractCodeModel(final NameProvider nameProvider, - final Marshaller marshaller, - final Stream> traits, - final Stream> typeDescriptors, - final Stream> moduleDescriptors, - final Stream> namespaceDescriptors) { + final Marshaller marshaller, + final Stream> traits, + final Stream> typeDescriptors, + final Stream> moduleDescriptors, + final Stream> namespaceDescriptors) { this(nameProvider); @@ -245,20 +245,15 @@ public Iterator iterator(final Class type) { this.moduleDescriptors.values().iterator(), this.namespaceDescriptors.values().iterator(), this.traitable.iterator(type)); - } - else if (CodeModel.class.isAssignableFrom(type)) { + } else if (CodeModel.class.isAssignableFrom(type)) { return (Iterator) Iterators.of(this); - } - else if (TypeDescriptor.class.isAssignableFrom(type)) { + } else if (TypeDescriptor.class.isAssignableFrom(type)) { return (Iterator) this.typeDescriptors.values().iterator(); - } - else if (ModuleDescriptor.class.isAssignableFrom(type)) { + } else if (ModuleDescriptor.class.isAssignableFrom(type)) { return (Iterator) this.moduleDescriptors.values().iterator(); - } - else if (NamespaceDescriptor.class.isAssignableFrom(type)) { + } else if (NamespaceDescriptor.class.isAssignableFrom(type)) { return (Iterator) this.namespaceDescriptors.values().iterator(); - } - else { + } else { return this.traitable.iterator(type); } } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModel.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModel.java index afd073e..9c28748 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModel.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModel.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -104,7 +104,8 @@ default TypeDescriptor createTypeDescriptor(final TypeName typeName) { */ default T createTypeDescriptor(final TypeName typeName, final BiFunction supplier) { - return createTypeDescriptor(typeName, supplier, t -> {}); + return createTypeDescriptor(typeName, supplier, t -> { + }); } /** @@ -234,7 +235,8 @@ default ModuleDescriptor createModuleDescriptor(final ModuleName moduleName) { */ default M createModuleDescriptor(final ModuleName moduleName, final BiFunction supplier) { - return createModuleDescriptor(moduleName, supplier, m -> {}); + return createModuleDescriptor(moduleName, supplier, m -> { + }); } /** @@ -321,7 +323,8 @@ default NamespaceDescriptor createNamespaceDescriptor(final Namespace namespace) */ default N createNamespaceDescriptor(final Namespace namespace, final BiFunction supplier) { - return createNamespaceDescriptor(namespace, supplier, n -> {}); + return createNamespaceDescriptor(namespace, supplier, n -> { + }); } /** @@ -360,7 +363,8 @@ default N createNamespaceDescriptor(final Namesp * @return the new {@link Traitable} for the {@link Object} in the {@link CodeModel} */ default Traitable createTraitable(final Traitable object) { - return createTraitable(object, t -> {}); + return createTraitable(object, t -> { + }); } /** diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModelTraitable.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModelTraitable.java index cb952a6..568740c 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModelTraitable.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/CodeModelTraitable.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -89,10 +89,10 @@ class CodeModelTraitable * Constructs a {@link CodeModelTraitable} for the specified {@link Object}. * * @param codeModel the {@link AbstractCodeModel} that established the {@link Traitable} - * @param object the {@link Traitable} {@link Object} + * @param object the {@link Traitable} {@link Object} */ CodeModelTraitable(final AbstractCodeModel codeModel, - final Traitable object) { + final Traitable object) { this.codeModel = Objects.requireNonNull(codeModel, "The CodeModel must not be null"); this.object = Objects.requireNonNull(object, "The object must not be null"); @@ -165,8 +165,7 @@ public T createTrait(final Function this.codeModel.index().index(trait); return trait; }); - } - else { + } else { this.traitsByClass.compute(registrationClass, (_, existing) -> { final var list = existing == null ? ConcurrentHashMap.newKeySet() : existing; @@ -216,13 +215,11 @@ public boolean removeTrait(final T trait) { removed.set(true); return null; - } - else { + } else { return existing; } }); - } - else { + } else { this.traitsByClass.compute(registrationClass, (_, existing) -> { if (existing == null) { removed.set(false); @@ -236,8 +233,7 @@ public boolean removeTrait(final T trait) { traitAware.onRemovedTrait(trait); } removed.set(true); - } - else { + } else { removed.set(false); } @@ -278,15 +274,13 @@ public Optional computeIfAbsent(final this.codeModel.index().index(newTrait); return newTrait; - } - else { + } else { lazyTrait.set((T) existing); return existing; } }); - } - else { + } else { this.traitsByClass.compute(registrationClass, (_, existing) -> { if (existing == null || existing.isEmpty()) { final var trait = function.apply(traitable); @@ -363,8 +357,7 @@ public Optional computeIfPresent(final return newTrait; }); - } - else { + } else { this.traitsByClass.compute(registrationClass, (_, existing) -> { if (existing == null || existing.isEmpty()) { return existing; @@ -499,8 +492,7 @@ private T getTraitOrNull(final Class requiredClass) final var first = (T) traits.iterator().next(); return requiredClass.isInstance(first) ? first : null; - } - else { + } else { // exhaustively search :( return this.singularTraitsByClass.values().stream() .filter(requiredClass::isInstance) @@ -581,9 +573,9 @@ public String toString() { return this.traitsByClass.isEmpty() ? "" : this.traitsByClass.values().stream() - .flatMap(Set::stream) - .map(Object::toString) - .collect(Collectors.joining(",", " [", "]")); + .flatMap(Set::stream) + .map(Object::toString) + .collect(Collectors.joining(",", " [", "]")); } /** @@ -596,16 +588,14 @@ public String toString() { public static boolean isSingular(final Class registrationClass) { if (singularTraitClasses.contains(registrationClass)) { return true; - } - else if (nonSingularTraitClasses.contains(registrationClass)) { + } else if (nonSingularTraitClasses.contains(registrationClass)) { return false; } final var singular = registrationClass.getAnnotation(Singular.class); if (singular == null) { nonSingularTraitClasses.add(registrationClass); - } - else { + } else { singularTraitClasses.add(registrationClass); } @@ -686,8 +676,7 @@ && isConcrete(registrationClass)) { for (final Class interfaceClass : registrationClass.getInterfaces()) { hierarchy.push(interfaceClass); } - } - else { + } else { // ensure that the registration class is a Trait if (Trait.class.isAssignableFrom(registrationClass)) { @@ -704,8 +693,7 @@ && isConcrete(registrationClass)) { } return (Class) registrationClass; - } - else { + } else { // we ignore classes that use @Singular or @NonSingular which are not Traits } } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/ConceptualCodeModel.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/ConceptualCodeModel.java index 5e66c4b..e1eee38 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/ConceptualCodeModel.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/ConceptualCodeModel.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -68,11 +68,11 @@ public ConceptualCodeModel(final NameProvider nameProvider) { */ @Unmarshal public ConceptualCodeModel(final @Bound NameProvider nameProvider, - final Marshaller marshaller, - final Stream> traits, - final Stream> typeDescriptors, - final Stream> moduleDescriptors, - final Stream> namespaceDescriptors) { + final Marshaller marshaller, + final Stream> traits, + final Stream> typeDescriptors, + final Stream> moduleDescriptors, + final Stream> namespaceDescriptors) { super(nameProvider, marshaller, traits, typeDescriptors, moduleDescriptors, namespaceDescriptors); } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractModuleDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractModuleDescriptor.java index 2b9b1ba..a530f8c 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractModuleDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractModuleDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -49,7 +49,7 @@ public abstract class AbstractModuleDescriptor /** * Constructs an {@link AbstractModuleDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param moduleName the {@link ModuleName} */ protected AbstractModuleDescriptor(final CodeModel codeModel, @@ -63,7 +63,7 @@ protected AbstractModuleDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractModuleDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param moduleName the {@link ModuleName} * @param traits the {@link Marshalled} {@link Trait}s diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractNamespaceDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractNamespaceDescriptor.java index 9c39dec..97e5ba1 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractNamespaceDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractNamespaceDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public abstract class AbstractNamespaceDescriptor * Constructs an {@link AbstractNamespaceDescriptor}. * * @param codeModel the {@link CodeModel} - * @param namespace the {@link Namespace} + * @param namespace the {@link Namespace} */ protected AbstractNamespaceDescriptor(final CodeModel codeModel, final Namespace namespace) { @@ -63,7 +63,7 @@ protected AbstractNamespaceDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractNamespaceDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param namespace the {@link Namespace} * @param traits the {@link Marshalled} {@link Trait}s diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTraitable.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTraitable.java index 4ad9c25..621918a 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTraitable.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTraitable.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -75,13 +75,13 @@ protected AbstractTraitable(final Traitable traitable) { this(traitable instanceof CodeModel self ? self : Objects.requireNonNull(traitable, "The Traitable must not be null") - .codeModel()); + .codeModel()); } /** * {@link Unmarshal} an {@link AbstractTraitable}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -113,8 +113,7 @@ protected void destructor(final Marshaller marshaller, traits.set(traits() .filter(trait -> marshaller.isMarshallable(trait.getClass())) .map(marshaller::marshal)); - } - else { + } else { traits.set(Stream.empty()); } } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTypeDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTypeDescriptor.java index 576a21a..37f13e2 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTypeDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/AbstractTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public abstract class AbstractTypeDescriptor * Constructs an {@link AbstractTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ protected AbstractTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -63,7 +63,7 @@ protected AbstractTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/CallableDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/CallableDescriptor.java index ce7850b..b9b5b35 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/CallableDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/CallableDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/FormalParameterDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/FormalParameterDescriptor.java index 6b0f1e0..fa5b1a8 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/FormalParameterDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/FormalParameterDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -65,8 +65,8 @@ public final class FormalParameterDescriptor * Constructs a {@link FormalParameterDescriptor}. * * @param codeModel the {@link CodeModel} - * @param name the {@link Optional} {@link IrreducibleName} - * @param type the {@link TypeUsage} for the type of formal parameter + * @param name the {@link Optional} {@link IrreducibleName} + * @param type the {@link TypeUsage} for the type of formal parameter */ private FormalParameterDescriptor(final CodeModel codeModel, final Optional name, @@ -81,7 +81,7 @@ private FormalParameterDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractTraitable}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param name the {@link Optional} {@link IrreducibleName} @@ -169,8 +169,8 @@ public boolean equals(final Object o) { * Creates a {@link FormalParameterDescriptor}. * * @param codeModel the {@link CodeModel} - * @param name the {@link Optional} {@link IrreducibleName} - * @param type the {@link TypeUsage} for the type of formal parameter + * @param name the {@link Optional} {@link IrreducibleName} + * @param type the {@link TypeUsage} for the type of formal parameter */ public static FormalParameterDescriptor of(final CodeModel codeModel, final Optional name, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ModuleDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ModuleDescriptor.java index d3d4411..6aad687 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ModuleDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ModuleDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NamespaceDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NamespaceDescriptor.java index 0b5b01d..1eb27f7 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NamespaceDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NamespaceDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NonSingular.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NonSingular.java index c9ba91b..253be7b 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NonSingular.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/NonSingular.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,8 +32,8 @@ * purposes. * * @author brian.oliver - * @since Mar-2025 * @see Singular + * @since Mar-2025 */ @Retention(RetentionPolicy.RUNTIME) public @interface NonSingular { diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicModuleDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicModuleDescriptor.java index 0bc6bcc..c63c035 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicModuleDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicModuleDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -47,7 +47,7 @@ public class PolymorphicModuleDescriptor /** * Constructs an {@link PolymorphicModuleDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param moduleName the {@link ModuleName} */ private PolymorphicModuleDescriptor(final CodeModel codeModel, @@ -59,7 +59,7 @@ private PolymorphicModuleDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link PolymorphicModuleDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param moduleName the {@link ModuleName} * @param traits the {@link Stream} {@link Marshalled} {@link Trait}s @@ -91,7 +91,7 @@ public void destructor(final Marshaller marshaller, /** * Creates an {@link PolymorphicModuleDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param moduleName the {@link ModuleName} * @return a new {@link PolymorphicModuleDescriptor} */ diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicNamespaceDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicNamespaceDescriptor.java index c935e2e..cdf9b76 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicNamespaceDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicNamespaceDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -49,7 +49,7 @@ public class PolymorphicNamespaceDescriptor * Constructs an {@link PolymorphicNamespaceDescriptor}. * * @param codeModel the {@link CodeModel} - * @param namespace the {@link ModuleName} + * @param namespace the {@link ModuleName} */ private PolymorphicNamespaceDescriptor(final CodeModel codeModel, final Namespace namespace) { @@ -60,7 +60,7 @@ private PolymorphicNamespaceDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link PolymorphicNamespaceDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param namespace the {@link Namespace} * @param traits the {@link Marshalled} {@link Trait}s @@ -93,7 +93,7 @@ public void destructor(final Marshaller marshaller, * Creates an {@link PolymorphicNamespaceDescriptor}. * * @param codeModel the {@link CodeModel} - * @param namespace the {@link Namespace} + * @param namespace the {@link Namespace} * @return a new {@link PolymorphicNamespaceDescriptor} */ public static PolymorphicNamespaceDescriptor of(final CodeModel codeModel, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicTypeDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicTypeDescriptor.java index 1971154..7124ce4 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicTypeDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/PolymorphicTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -48,7 +48,7 @@ public class PolymorphicTypeDescriptor * Constructs an {@link PolymorphicTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ private PolymorphicTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -59,7 +59,7 @@ private PolymorphicTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link PolymorphicTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s @@ -92,7 +92,7 @@ public void destructor(final Marshaller marshaller, * Creates an {@link PolymorphicTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link PolymorphicTypeDescriptor} */ public static PolymorphicTypeDescriptor of(final CodeModel codeModel, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/RequiresModuleDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/RequiresModuleDescriptor.java index 9b6fc0d..0b7c5d5 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/RequiresModuleDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/RequiresModuleDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ public class RequiresModuleDescriptor * {@link ModuleName}. * * @param codeModel the {@link CodeModel} - * @param requires the required {@link ModuleName} + * @param requires the required {@link ModuleName} */ private RequiresModuleDescriptor(final CodeModel codeModel, final ModuleName requires) { @@ -71,7 +71,7 @@ private RequiresModuleDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link RequiresModuleDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param requires the required {@link ModuleName} @@ -141,7 +141,7 @@ public int hashCode() { * Creates a {@link RequiresModuleDescriptor}. * * @param codeModel the {@link CodeModel} - * @param requires the required {@link ModuleName} + * @param requires the required {@link ModuleName} * @return a new {@link RequiresModuleDescriptor} */ public static RequiresModuleDescriptor of(final CodeModel codeModel, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Singular.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Singular.java index 68b1384..2022753 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Singular.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Singular.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,8 +27,8 @@ * Specifies that only a single instance of a {@link Class} of {@link Trait} may be present in a {@link Traitable}. * * @author brian.oliver - * @since Mar-2025 * @see NonSingular + * @since Mar-2025 */ @Retention(RetentionPolicy.RUNTIME) public @interface Singular { diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ThrowableDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ThrowableDescriptor.java index 90a78b5..873834d 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ThrowableDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/ThrowableDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -65,7 +65,7 @@ private ThrowableDescriptor(final TypeUsage throwableType) { /** * {@link Unmarshal} an {@link AbstractTraitable}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param throwableType the {@link Marshalled} {@link TypeUsage} for the Throwable Type diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Trait.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Trait.java index f39af6b..396b32c 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Trait.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Trait.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TraitAware.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TraitAware.java index 86ef6d3..90ffb2e 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TraitAware.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TraitAware.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Traitable.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Traitable.java index 6be8bb6..ec4bc93 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Traitable.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/Traitable.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -187,7 +187,7 @@ default Stream traits(final Class requiredClass, return requiredClass == null || extractor == null || predicate == null || !hasTraits() ? Stream.empty() : traits(requiredClass) - .filter(trait -> predicate.test(extractor.apply(trait))); + .filter(trait -> predicate.test(extractor.apply(trait))); } /** @@ -207,8 +207,8 @@ default Stream traits(final Class requiredClass, return requiredClass == null || extractor == null || !hasTraits() ? Stream.empty() : traits(requiredClass) - .filter(trait -> (value == null && extractor.apply(trait) == null) - || (value != null && Objects.equals(value, extractor.apply(trait)))); + .filter(trait -> (value == null && extractor.apply(trait) == null) + || (value != null && Objects.equals(value, extractor.apply(trait)))); } /** diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TypeDescriptor.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TypeDescriptor.java index f4a3ad1..7aea14d 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TypeDescriptor.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/descriptor/TypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CachingNameProvider.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CachingNameProvider.java index 83de936..bb24589 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CachingNameProvider.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CachingNameProvider.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CallableName.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CallableName.java index dbe4582..9ecd02e 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CallableName.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/CallableName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/IrreducibleName.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/IrreducibleName.java index ed5d097..f9f4e47 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/IrreducibleName.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/IrreducibleName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/ModuleName.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/ModuleName.java index cfaa7e2..6fd5372 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/ModuleName.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/ModuleName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Name.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Name.java index 1cad07f..57f922c 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Name.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Name.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NameProvider.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NameProvider.java index f14db09..7b24a47 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NameProvider.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NameProvider.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Namespace.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Namespace.java index 555d6ba..34e1d41 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Namespace.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/Namespace.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NonCachingNameProvider.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NonCachingNameProvider.java index 4aac61d..e91e99f 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NonCachingNameProvider.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/NonCachingNameProvider.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,13 +53,13 @@ public class NonCachingNameProvider public NonCachingNameProvider(final Function> namespacePartExtractor) { this.namespacePartExtractor = namespacePartExtractor == null ? (string -> Strings.isEmpty(string) - ? Stream.empty() - : Arrays.stream(string.split("\\.")) - .peek(part -> { - if (part.isEmpty()) { - throw new IllegalArgumentException("A Namespace must not contain empty names"); - } - })) + ? Stream.empty() + : Arrays.stream(string.split("\\.")) + .peek(part -> { + if (part.isEmpty()) { + throw new IllegalArgumentException("A Namespace must not contain empty names"); + } + })) : namespacePartExtractor; } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/TypeName.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/TypeName.java index ace5ac7..3540001 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/TypeName.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/naming/TypeName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/IrreducibleNameTransformer.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/IrreducibleNameTransformer.java index 47d47e6..b85c010 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/IrreducibleNameTransformer.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/IrreducibleNameTransformer.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -70,8 +70,8 @@ public String transform(final Marshaller marshaller, @Override public IrreducibleName reform(final Marshaller marshaller, - final Type type, - final String string) { + final Type type, + final String string) { return this.nameProvider.getIrreducibleName(string); } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/ModuleNameTransformer.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/ModuleNameTransformer.java index 99b422e..c58e6c8 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/ModuleNameTransformer.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/ModuleNameTransformer.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/NamespaceTransformer.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/NamespaceTransformer.java index 80e117a..511eb36 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/NamespaceTransformer.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/NamespaceTransformer.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/TypeNameTransformer.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/TypeNameTransformer.java index 7116595..719eec9 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/TypeNameTransformer.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/transport/TypeNameTransformer.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractNamedTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractNamedTypeUsage.java index fc24741..f282497 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractNamedTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractNamedTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,7 +53,7 @@ public abstract class AbstractNamedTypeUsage * Constructs an {@link AbstractNamedTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ protected AbstractNamedTypeUsage(final CodeModel codeModel, final TypeName typeName) { @@ -66,7 +66,7 @@ protected AbstractNamedTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractNamedTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractTypeUsage.java index a037d1d..8291c74 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AbstractTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -57,7 +57,7 @@ public AbstractTypeUsage(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link AbstractTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AnnotationTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AnnotationTypeUsage.java index 3a33424..ef1e5e3 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AnnotationTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/AnnotationTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,8 +60,8 @@ public class AnnotationTypeUsage * Constructs an {@link AnnotationTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} - * @param values the {@link AnnotationValue}s + * @param typeName the {@link TypeName} + * @param values the {@link AnnotationValue}s */ private AnnotationTypeUsage(final CodeModel codeModel, final TypeName typeName, @@ -77,7 +77,7 @@ private AnnotationTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AnnotationTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param values the {@link Marshalled} {@link AnnotationValue}s @@ -157,8 +157,8 @@ public int compareTo(final AnnotationTypeUsage other) { * Creates an {@link AnnotationTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} - * @param values the {@link AnnotationValue}s + * @param typeName the {@link TypeName} + * @param values the {@link AnnotationValue}s * @return a new {@link AnnotationTypeUsage} */ public static AnnotationTypeUsage of(final CodeModel codeModel, @@ -172,8 +172,8 @@ public static AnnotationTypeUsage of(final CodeModel codeModel, * Creates an {@link AnnotationTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} - * @param values the {@link AnnotationValue}s + * @param typeName the {@link TypeName} + * @param values the {@link AnnotationValue}s * @return a new {@link AnnotationTypeUsage} */ public static AnnotationTypeUsage of(final CodeModel codeModel, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/ArrayTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/ArrayTypeUsage.java index 3fc2387..412afd4 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/ArrayTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/ArrayTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -56,7 +56,7 @@ public class ArrayTypeUsage * Constructs an {@link ArrayTypeUsage} for the specified component {@link TypeUsage}. * * @param codeModel the {@link CodeModel} - * @param component the {@link TypeUsage} + * @param component the {@link TypeUsage} */ private ArrayTypeUsage(final CodeModel codeModel, final Lazy component) { @@ -67,7 +67,7 @@ private ArrayTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} an {@link ArrayTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param component the {@link Marshalled} {@link TypeUsage} for the array component type diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/GenericTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/GenericTypeUsage.java index 0ecdc33..f15dc4e 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/GenericTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/GenericTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ public class GenericTypeUsage /** * Constructs a {@link GenericTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param typeName the {@link TypeName} * @param parameters the {@link Lazy} {@link TypeUsage}s */ @@ -78,7 +78,7 @@ private GenericTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractNamedTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s @@ -143,8 +143,7 @@ public boolean isOptional() { public boolean equals(final Object object) { if (this == object) { return true; - } - else if (object instanceof GenericTypeUsage other) { + } else if (object instanceof GenericTypeUsage other) { return Objects.equals(typeName(), other.typeName()) && super.equals(other) && Streams.equals(parameters(), other.parameters()); @@ -168,7 +167,7 @@ protected String render(final Function nameRenderer, * that the specified {@link TypeName} is defined as a generic type. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link GenericTypeUsage} */ public static GenericTypeUsage of(final CodeModel codeModel, @@ -180,7 +179,7 @@ public static GenericTypeUsage of(final CodeModel codeModel, /** * Creates a {@link GenericTypeUsage} with the specified parameters. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param typeName the {@link TypeName} * @param parameters the {@link Lazy} {@link TypeUsage} parameters * @return a new {@link GenericTypeUsage} @@ -195,7 +194,7 @@ public static GenericTypeUsage of(final CodeModel codeModel, /** * Creates a {@link GenericTypeUsage} with the specified parameters. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param typeName the {@link TypeName} * @param parameters the {@link TypeUsage}s * @return a new {@link GenericTypeUsage} diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/IntersectionTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/IntersectionTypeUsage.java index 618dbed..c2c1013 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/IntersectionTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/IntersectionTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ public class IntersectionTypeUsage * Constructs an {@link IntersectionTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param types the {@link Lazy} {@link TypeUsage} in the {@link IntersectionTypeUsage} + * @param types the {@link Lazy} {@link TypeUsage} in the {@link IntersectionTypeUsage} */ private IntersectionTypeUsage(final CodeModel codeModel, final Stream> types) { @@ -75,7 +75,7 @@ private IntersectionTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} an {@link IntersectionTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param types the {@link TypeUsage}s @@ -152,7 +152,7 @@ protected String render(final Function nameRenderer, * Creates an {@link IntersectionTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param types the {@link Lazy} {@link TypeUsage} in the {@link UnionTypeUsage} + * @param types the {@link Lazy} {@link TypeUsage} in the {@link UnionTypeUsage} * @return a new {@link IntersectionTypeUsage} */ public static IntersectionTypeUsage of(final CodeModel codeModel, @@ -164,7 +164,7 @@ public static IntersectionTypeUsage of(final CodeModel codeModel, /** * Creates a {@link IntersectionTypeUsage} with the specified parameters. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param parameters the {@link TypeUsage}s * @return a new {@link IntersectionTypeUsage} */ diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/NamedTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/NamedTypeUsage.java index 7e497a8..505d520 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/NamedTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/NamedTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/SpecificTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/SpecificTypeUsage.java index b12b415..949923d 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/SpecificTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/SpecificTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -47,7 +47,7 @@ public class SpecificTypeUsage * Constructs a {@link SpecificTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ private SpecificTypeUsage(final CodeModel codeModel, final TypeName typeName) { @@ -58,7 +58,7 @@ private SpecificTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} a {@link SpecificTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s @@ -100,7 +100,7 @@ public boolean equals(final Object object) { * Creates a {@link SpecificTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a {@link SpecificTypeUsage} */ public static SpecificTypeUsage of(final CodeModel codeModel, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/TypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/TypeUsage.java index 039ebd8..14a422f 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/TypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/TypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnionTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnionTypeUsage.java index 6b4b528..43ac143 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnionTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnionTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ public class UnionTypeUsage * Constructs a {@link UnionTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param types the {@link Lazy} {@link TypeUsage} in the {@link UnionTypeUsage} + * @param types the {@link Lazy} {@link TypeUsage} in the {@link UnionTypeUsage} */ private UnionTypeUsage(final CodeModel codeModel, final Stream> types) { @@ -75,7 +75,7 @@ private UnionTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} an {@link UnionTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param types the {@link TypeUsage}s @@ -151,7 +151,7 @@ protected String render(final Function nameRenderer, * Creates a {@link UnionTypeUsage}. * * @param codeModel the {@link CodeModel} - * @param types the {@link Lazy} {@link TypeUsage} in the {@link UnionTypeUsage} + * @param types the {@link Lazy} {@link TypeUsage} in the {@link UnionTypeUsage} * @return a new {@link UnionTypeUsage} */ public static UnionTypeUsage of(final CodeModel codeModel, @@ -164,7 +164,7 @@ public static UnionTypeUsage of(final CodeModel codeModel, * Creates a {@link UnionTypeUsage} with the specified parameters. * * @param codeModel the {@link CodeModel} - * @param types the {@link TypeUsage}s + * @param types the {@link TypeUsage}s * @return a new {@link GenericTypeUsage} */ public static UnionTypeUsage of(final CodeModel codeModel, diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnknownTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnknownTypeUsage.java index 9d37fcc..a680a5b 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnknownTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/UnknownTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -63,7 +63,7 @@ private UnknownTypeUsage(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link UnknownTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/VoidTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/VoidTypeUsage.java index eda6bc6..248f2fa 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/VoidTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/VoidTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -64,7 +64,7 @@ private VoidTypeUsage(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link VoidTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/WildcardTypeUsage.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/WildcardTypeUsage.java index ab0b58e..10ee95b 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/WildcardTypeUsage.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/WildcardTypeUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -67,7 +67,7 @@ private WildcardTypeUsage(final CodeModel codeModel) { /** * Constructs a bounded {@link WildcardTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param lowerBound the {@link Optional} {@link Lazy} lower-bound {@link TypeUsage} (from {@code ? super T}) * @param upperBound the {@link Optional} {@link Lazy} upper-bound {@link TypeUsage} (from {@code ? extends T}) */ @@ -88,7 +88,7 @@ private WildcardTypeUsage(final CodeModel codeModel, /** * {@link Unmarshal} a {@link WildcardTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param typeName the {@link TypeName} * @param traits the {@link Marshalled} {@link Trait}s @@ -152,7 +152,7 @@ public static WildcardTypeUsage create(final CodeModel codeModel) { /** * Creates a bounded {@link WildcardTypeUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param lowerBound the {@link Optional} {@link Lazy} lower-bound {@link TypeUsage} (from {@code ? super T}) * @param upperBound the {@link Optional} {@link Lazy} upper-bound {@link TypeUsage} (from {@code ? extends T}) * @return a {@link WildcardTypeUsage} diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsageMatch.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsageMatch.java index 263c739..bd3bf22 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsageMatch.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsageMatch.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsagePattern.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsagePattern.java index 7900792..8f504ef 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsagePattern.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotatedTypeUsagePattern.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsageMatch.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsageMatch.java index 8e4faf3..146a084 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsageMatch.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsageMatch.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsagePattern.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsagePattern.java index 53bd9dd..676820e 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsagePattern.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/AnnotationTypeUsagePattern.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsageMatch.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsageMatch.java index e523416..23338b6 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsageMatch.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsageMatch.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsagePattern.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsagePattern.java index 52f58ff..b11f23c 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsagePattern.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/GenericTypeUsagePattern.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -146,8 +146,8 @@ public Optional> parameter(final int index) { return index < 0 || index >= parameterMatches.count() ? Optional.empty() : parameterMatches.stream() - .skip(index) - .findFirst(); + .skip(index) + .findFirst(); } }; } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsageMatch.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsageMatch.java index aa3a9b9..dabd134 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsageMatch.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsageMatch.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsagePattern.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsagePattern.java index 76911dd..ea13dc3 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsagePattern.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/NamedTypeUsagePattern.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsageMatch.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsageMatch.java index ce8cfc8..89b9e89 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsageMatch.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsageMatch.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsagePattern.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsagePattern.java index 36f6977..7768044 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsagePattern.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/OptionalTypeUsagePattern.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsageMatch.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsageMatch.java index f64ee58..719266c 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsageMatch.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsageMatch.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ default Optional map(final Function mapper) { return mapper == null ? Optional.empty() : typeUsage() - .map(mapper); + .map(mapper); } /** @@ -73,7 +73,7 @@ default Optional flatMap(final Function> return mapper == null ? Optional.empty() : typeUsage() - .flatMap(mapper); + .flatMap(mapper); } /** @@ -86,7 +86,7 @@ default Optional filter(final Predicate filter) { return filter == null ? Optional.empty() : typeUsage() - .filter(filter); + .filter(filter); } /** @@ -115,8 +115,7 @@ default T orElseThrow(final Supplier supplier if (isPresent()) { return orElseThrow(); - } - else { + } else { throw supplier.get(); } } @@ -169,8 +168,7 @@ default void ifPresentOrElse(final Consumer consumer, if (consumer != null) { typeUsage().ifPresent(consumer); } - } - else if (runnable != null) { + } else if (runnable != null) { runnable.run(); } } diff --git a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsagePattern.java b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsagePattern.java index a1d97b9..c8ab674 100644 --- a/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsagePattern.java +++ b/codemodel-foundation/src/main/java/build/codemodel/foundation/usage/pattern/TypeUsagePattern.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/main/java/module-info.java b/codemodel-foundation/src/main/java/module-info.java index 3095acb..4f2c192 100644 --- a/codemodel-foundation/src/main/java/module-info.java +++ b/codemodel-foundation/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-foundation/src/test/java/build/codemodel/foundation/CodeModelCompatibilityTests.java b/codemodel-foundation/src/test/java/build/codemodel/foundation/CodeModelCompatibilityTests.java index cd28a91..ef2a627 100644 --- a/codemodel-foundation/src/test/java/build/codemodel/foundation/CodeModelCompatibilityTests.java +++ b/codemodel-foundation/src/test/java/build/codemodel/foundation/CodeModelCompatibilityTests.java @@ -658,7 +658,7 @@ class ColorableTypeDescriptor * Constructs a {@link ColorableTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ public ColorableTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { diff --git a/codemodel-foundation/src/test/java/build/codemodel/foundation/ConceptualCodeModelTests.java b/codemodel-foundation/src/test/java/build/codemodel/foundation/ConceptualCodeModelTests.java index 98b4c61..5e3ab54 100644 --- a/codemodel-foundation/src/test/java/build/codemodel/foundation/ConceptualCodeModelTests.java +++ b/codemodel-foundation/src/test/java/build/codemodel/foundation/ConceptualCodeModelTests.java @@ -215,12 +215,18 @@ void shouldCreateTypeDescriptorOnceWithTraitSuppliers() { codeModel.createTypeDescriptor( typeName, PolymorphicTypeDescriptor::of, - Streamable.of(_ -> { counter.incrementAndGet(); return Color.RED; })); + Streamable.of(_ -> { + counter.incrementAndGet(); + return Color.RED; + })); codeModel.createTypeDescriptor( typeName, PolymorphicTypeDescriptor::of, - Streamable.of(_ -> { counter.incrementAndGet(); return Color.RED; })); + Streamable.of(_ -> { + counter.incrementAndGet(); + return Color.RED; + })); assertThat(counter.get()).isEqualTo(1); } @@ -251,12 +257,18 @@ void shouldCreateModuleDescriptorOnceWithTraitSuppliers() { codeModel.createModuleDescriptor( moduleName, PolymorphicModuleDescriptor::of, - Streamable.of(_ -> { counter.incrementAndGet(); return Color.RED; })); + Streamable.of(_ -> { + counter.incrementAndGet(); + return Color.RED; + })); codeModel.createModuleDescriptor( moduleName, PolymorphicModuleDescriptor::of, - Streamable.of(_ -> { counter.incrementAndGet(); return Color.RED; })); + Streamable.of(_ -> { + counter.incrementAndGet(); + return Color.RED; + })); assertThat(counter.get()).isEqualTo(1); } @@ -287,12 +299,18 @@ void shouldCreateNamespaceDescriptorOnceWithTraitSuppliers() { codeModel.createNamespaceDescriptor( namespace, PolymorphicNamespaceDescriptor::of, - Streamable.of(_ -> { counter.incrementAndGet(); return Color.RED; })); + Streamable.of(_ -> { + counter.incrementAndGet(); + return Color.RED; + })); codeModel.createNamespaceDescriptor( namespace, PolymorphicNamespaceDescriptor::of, - Streamable.of(_ -> { counter.incrementAndGet(); return Color.RED; })); + Streamable.of(_ -> { + counter.incrementAndGet(); + return Color.RED; + })); assertThat(counter.get()).isEqualTo(1); } @@ -325,7 +343,7 @@ public static class Wheel extends AbstractTraitable implements Trait { - public Wheel(final TypeDescriptor typeDescriptor) { + Wheel(final TypeDescriptor typeDescriptor) { super(typeDescriptor); } diff --git a/codemodel-foundation/src/test/java/build/codemodel/foundation/descriptor/MarshallingTests.java b/codemodel-foundation/src/test/java/build/codemodel/foundation/descriptor/MarshallingTests.java index 6f45096..794345b 100644 --- a/codemodel-foundation/src/test/java/build/codemodel/foundation/descriptor/MarshallingTests.java +++ b/codemodel-foundation/src/test/java/build/codemodel/foundation/descriptor/MarshallingTests.java @@ -103,7 +103,7 @@ void shouldMarshallAndTransportAndUnmarshallRequiresModuleDescriptor() marshallAndTransportAndUnMarshalAndAssert(descriptor); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/codemodel-foundation/src/test/java/build/codemodel/foundation/usage/MarshallingTests.java b/codemodel-foundation/src/test/java/build/codemodel/foundation/usage/MarshallingTests.java index c43c1fc..5781897 100644 --- a/codemodel-foundation/src/test/java/build/codemodel/foundation/usage/MarshallingTests.java +++ b/codemodel-foundation/src/test/java/build/codemodel/foundation/usage/MarshallingTests.java @@ -235,7 +235,7 @@ void shouldMarshallAndTransportAndUnmarshalBoundedWildcardTypeUsage() assertTrue(unmarshalled.upperBound().isPresent(), "upper bound must be preserved"); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/codemodel-framework-builder/src/main/java/build/codemodel/framework/builder/InternalFramework.java b/codemodel-framework-builder/src/main/java/build/codemodel/framework/builder/InternalFramework.java index a0f5159..bcf8cf2 100644 --- a/codemodel-framework-builder/src/main/java/build/codemodel/framework/builder/InternalFramework.java +++ b/codemodel-framework-builder/src/main/java/build/codemodel/framework/builder/InternalFramework.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -121,7 +121,7 @@ class InternalFramework this.plugins = plugins == null ? new ArrayList<>() : Streams.sortByRequires(plugins.filter(Objects::nonNull), Streams.SortOrder.FIRST) - .collect(Collectors.toCollection(ArrayList::new)); + .collect(Collectors.toCollection(ArrayList::new)); // arrange plugins according to their type and interface types this.pluginsByClass = new LinkedHashMap<>(); @@ -297,7 +297,7 @@ public T enrich(final T codeModel, final TelemetryRecorder @Override @SuppressWarnings("unchecked") public Optional typeCheck(final T codeModel, - final TelemetryRecorder telemetryRecorder) { + final TelemetryRecorder telemetryRecorder) { final var observableRecorder = ObservableTelemetryRecorder.of(telemetryRecorder); diff --git a/codemodel-framework-builder/src/main/java/module-info.java b/codemodel-framework-builder/src/main/java/module-info.java index eb02a7e..e82f9a2 100644 --- a/codemodel-framework-builder/src/main/java/module-info.java +++ b/codemodel-framework-builder/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,6 +17,7 @@ * limitations under the License. * #L% */ + import build.codemodel.framework.Framework; /** diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/Framework.java b/codemodel-framework/src/main/java/build/codemodel/framework/Framework.java index 866a5c4..8929c84 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/Framework.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/Framework.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,7 +94,7 @@ public interface Framework { * Enriches the provided {@link CodeModel} using the {@link Enricher}s known to the {@link Framework}, * reporting any issues with the specified {@link TelemetryRecorder}. * - * @param codeModel the {@link CodeModel} to enrich + * @param codeModel the {@link CodeModel} to enrich * @param telemetryRecorder the {@link TelemetryRecorder} * @return the {@link CodeModel} to permit fluent-style method invocation */ @@ -105,20 +105,20 @@ public interface Framework { * {@link Framework}, reporting any issues with the specified {@link TelemetryRecorder}, returning * the {@link CodeModel} if successful. * - * @param codeModel the {@link CodeModel} to type-check + * @param codeModel the {@link CodeModel} to type-check * @param telemetryRecorder the {@link TelemetryRecorder} * @return the {@link Optional} {@link CodeModel} if type-checking was successful, otherwise {@link Optional#empty()} */ Optional typeCheck(T codeModel, - TelemetryRecorder telemetryRecorder); + TelemetryRecorder telemetryRecorder); /** * Attempts to compile the specified {@link CodeModel} using the {@link Compiler}s known to the {@link Framework}, * returning the {@link Optional} {@link Compilation} when successful, otherwise returning an {@link Optional#empty()}, * with errors, warnings and other compilation information recorded in the provided {@link TelemetryRecorder}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param telemetryRecorder the {@link TelemetryRecorder} * @return the {@link Optional} {@link Compilation} when compilation was successful, otherwise {@link Optional#empty()} */ diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/Plugin.java b/codemodel-framework/src/main/java/build/codemodel/framework/Plugin.java index edc964d..90ee7db 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/Plugin.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/Plugin.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/Targetable.java b/codemodel-framework/src/main/java/build/codemodel/framework/Targetable.java index 61836ff..20a62b8 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/Targetable.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/Targetable.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,7 +39,6 @@ public interface Targetable * Obtains the first actual type parameter of the specified parameterized {@link Class}. * * @param parameterizedClass the parameterized {@link Class}. - * * @return the {@link Optional} {@link Class} of the target type, or {@link Optional#empty()} * if it can't be determined */ diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compilation.java b/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compilation.java index 4106ec4..b324d31 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compilation.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compilation.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compiler.java b/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compiler.java index 57ee7ba..6889477 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compiler.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/compiler/Compiler.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -67,7 +67,7 @@ default Optional> getTargetClass() { * {@link TelemetryRecorder}. * * @param target the target to compile - * @param codeModel the {@link CodeModel} in which compilation is occurring + * @param codeModel the {@link CodeModel} in which compilation is occurring * @param telemetryRecorder the {@link TelemetryRecorder} */ void compile(T target, diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/compiler/TypeChecker.java b/codemodel-framework/src/main/java/build/codemodel/framework/compiler/TypeChecker.java index 22f2ece..962f780 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/compiler/TypeChecker.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/compiler/TypeChecker.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -62,7 +62,7 @@ default Optional> getTargetClass() { * failures. * * @param target the target to be checked - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param telemetryRecorder the {@link TelemetryRecorder} */ void check(T target, diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completer.java b/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completer.java index 21a9d03..805561c 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completer.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completer.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completion.java b/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completion.java index be73650..b7d4dfb 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completion.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/completer/Completion.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Enricher.java b/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Enricher.java index 82751e0..3ed7a51 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Enricher.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Enricher.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -95,8 +95,7 @@ default boolean isTraitPermitted(final T target) { .map(c -> { try { return target.getTrait(c).isEmpty(); - } - catch (final IllegalStateException e) { + } catch (final IllegalStateException e) { return true; } }) diff --git a/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Initializer.java b/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Initializer.java index d6601ac..fdf4c7e 100644 --- a/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Initializer.java +++ b/codemodel-framework/src/main/java/build/codemodel/framework/initialization/Initializer.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/codemodel-framework/src/main/java/module-info.java b/codemodel-framework/src/main/java/module-info.java index f675adc..6286925 100644 --- a/codemodel-framework/src/main/java/module-info.java +++ b/codemodel-framework/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,6 +17,7 @@ * limitations under the License. * #L% */ + import build.codemodel.foundation.CodeModel; /** diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 3508171..125a9d4 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -8,6 +8,10 @@ + + + + diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml new file mode 100644 index 0000000..fc88870 --- /dev/null +++ b/config/checkstyle/suppressions.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/config/pmd/pmd-ruleset.xml b/config/pmd/pmd-ruleset.xml new file mode 100644 index 0000000..511e15d --- /dev/null +++ b/config/pmd/pmd-ruleset.xml @@ -0,0 +1,8 @@ + + + Flags fully qualified names in code/Javadoc that should instead be imported. + + diff --git a/dependency-injection/src/main/java/build/codemodel/injection/AbstractBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/AbstractBinding.java index 3127b0f..f1ec6b9 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/AbstractBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/AbstractBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/AbstractBindingBuilder.java b/dependency-injection/src/main/java/build/codemodel/injection/AbstractBindingBuilder.java index f714c20..33e39b1 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/AbstractBindingBuilder.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/AbstractBindingBuilder.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/AbstractDependency.java b/dependency-injection/src/main/java/build/codemodel/injection/AbstractDependency.java index 6a4a7d5..8e8760e 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/AbstractDependency.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/AbstractDependency.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/Binding.java b/dependency-injection/src/main/java/build/codemodel/injection/Binding.java index 059b3d2..d557884 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/Binding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/Binding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/BindingAlreadyExistsException.java b/dependency-injection/src/main/java/build/codemodel/injection/BindingAlreadyExistsException.java index c093aa2..1b69ced 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/BindingAlreadyExistsException.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/BindingAlreadyExistsException.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/BindingGraphTrait.java b/dependency-injection/src/main/java/build/codemodel/injection/BindingGraphTrait.java index a456a07..03654f4 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/BindingGraphTrait.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/BindingGraphTrait.java @@ -58,7 +58,8 @@ public final class BindingGraphTrait * @param from the binding that requires the dependency * @param edge the edge, carrying the unresolved {@link Dependency} */ - public record UnsatisfiedDependency(BindingNode from, DependencyEdge edge) {} + public record UnsatisfiedDependency(BindingNode from, DependencyEdge edge) { + } /** * The underlying weighted binding graph. Vertices are {@link BindingNode}s; edge weights are diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ChainedResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/ChainedResolver.java index c7cf304..902518b 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ChainedResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ChainedResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ClassBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/ClassBinding.java index a53fd5c..c3efbb7 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ClassBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ClassBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ConfigurationResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/ConfigurationResolver.java index 58ec7a3..8fe6e32 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ConfigurationResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ConfigurationResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -92,8 +92,7 @@ public Dependency dependency() { } }); } - } - catch (final ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { return Optional.empty(); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ConstructorInjectionPoint.java b/dependency-injection/src/main/java/build/codemodel/injection/ConstructorInjectionPoint.java index 7d4c830..a462ef2 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ConstructorInjectionPoint.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ConstructorInjectionPoint.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -108,12 +108,10 @@ public T inject(final Object target, final Object[] actualParameters) { if (constructor.trySetAccessible()) { try { return (T) constructor.newInstance(actualParameters); - } - catch (final InstantiationException | IllegalAccessException | InvocationTargetException e) { + } catch (final InstantiationException | IllegalAccessException | InvocationTargetException e) { throw new InjectionFailedException(this, e); } - } - else { + } else { throw new InjectionFailedException(this, "Can't inject into " + constructor + " as it's inaccessible"); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/CyclicDependencyException.java b/dependency-injection/src/main/java/build/codemodel/injection/CyclicDependencyException.java index 8a56292..c8708f6 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/CyclicDependencyException.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/CyclicDependencyException.java @@ -96,6 +96,6 @@ public String getMessage() { + (this.detectedInDependency == this.causedByDependency ? "dependency on itself." : "(transitive) dependency on " + this.causedByDependency + ", which defines a dependency on " - + this.detectedInDependency); + + this.detectedInDependency); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/DefaultOptionResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/DefaultOptionResolver.java index f722315..614c469 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/DefaultOptionResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/DefaultOptionResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -95,8 +95,7 @@ public Dependency dependency() { return dependency; } }); - } - catch (final ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { return Optional.empty(); } } @@ -138,8 +137,7 @@ private Optional instantiateDefault(final Class option try { defaultConstructor.trySetAccessible(); return Optional.of(defaultConstructor.newInstance()); - } - catch (final InstantiationException | IllegalAccessException | InvocationTargetException e) { + } catch (final InstantiationException | IllegalAccessException | InvocationTargetException e) { throw new InjectionException("@Default constructor failed for " + optionClass, e); } } @@ -160,8 +158,7 @@ private Optional instantiateDefault(final Class option try { defaultMethod.trySetAccessible(); return Optional.of(defaultMethod.invoke(null)); - } - catch (final IllegalAccessException | InvocationTargetException e) { + } catch (final IllegalAccessException | InvocationTargetException e) { throw new InjectionException("@Default method " + defaultMethod + " failed", e); } } @@ -182,8 +179,7 @@ private Optional instantiateDefault(final Class option try { defaultField.trySetAccessible(); return Optional.of(defaultField.get(null)); - } - catch (final IllegalAccessException e) { + } catch (final IllegalAccessException e) { throw new InjectionException("@Default field " + defaultField + " failed", e); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/Dependency.java b/dependency-injection/src/main/java/build/codemodel/injection/Dependency.java index 68002de..840b4a3 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/Dependency.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/Dependency.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/FieldInjectionPoint.java b/dependency-injection/src/main/java/build/codemodel/injection/FieldInjectionPoint.java index 9a86c7d..04e3f4a 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/FieldInjectionPoint.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/FieldInjectionPoint.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -107,12 +107,10 @@ public T inject(final Object target, final Object[] actualParameters) { field.set(target, actualParameters[0]); return (T) field.get(target); - } - catch (final IllegalAccessException | IllegalArgumentException e) { + } catch (final IllegalAccessException | IllegalArgumentException e) { throw new InjectionFailedException(this, e); } - } - else { + } else { throw new InjectionFailedException(this, "Can't inject into " + field + " as it's inaccessible"); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/IndependentDependency.java b/dependency-injection/src/main/java/build/codemodel/injection/IndependentDependency.java index 7fb1465..b4b4f15 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/IndependentDependency.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/IndependentDependency.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/InjectionContext.java b/dependency-injection/src/main/java/build/codemodel/injection/InjectionContext.java index be253e9..96742b8 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/InjectionContext.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/InjectionContext.java @@ -1221,7 +1221,7 @@ void addSupplier(final Supplier supplier) { Set buildSet() { return this.suppliers.stream() .map(Supplier::get) - .collect(Collectors.toCollection(java.util.LinkedHashSet::new)); + .collect(Collectors.toCollection(LinkedHashSet::new)); } } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/InjectionException.java b/dependency-injection/src/main/java/build/codemodel/injection/InjectionException.java index b899aaf..4d124fb 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/InjectionException.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/InjectionException.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/InjectionFailedException.java b/dependency-injection/src/main/java/build/codemodel/injection/InjectionFailedException.java index 98f1d30..3150f8a 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/InjectionFailedException.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/InjectionFailedException.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/InjectionPoint.java b/dependency-injection/src/main/java/build/codemodel/injection/InjectionPoint.java index 57d7244..14b90ba 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/InjectionPoint.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/InjectionPoint.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/InjectionPointDependency.java b/dependency-injection/src/main/java/build/codemodel/injection/InjectionPointDependency.java index 0f71490..c57b7af 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/InjectionPointDependency.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/InjectionPointDependency.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/Injector.java b/dependency-injection/src/main/java/build/codemodel/injection/Injector.java index d2cac1c..80d5065 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/Injector.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/Injector.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/LazySingletonClassBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/LazySingletonClassBinding.java index 6e7982d..a7a0dba 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/LazySingletonClassBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/LazySingletonClassBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/MethodInjectionPoint.java b/dependency-injection/src/main/java/build/codemodel/injection/MethodInjectionPoint.java index 07a4d3e..b0a34b6 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/MethodInjectionPoint.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/MethodInjectionPoint.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -107,12 +107,10 @@ public T inject(final Object target, final Object[] actualParameters) { if (method.trySetAccessible()) { try { return (T) method.invoke(target, actualParameters); - } - catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) { + } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) { throw new InjectionFailedException(this, e); } - } - else { + } else { throw new InjectionFailedException(this, "Can't inject into " + method + " as it's inaccessible"); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/NonSingletonClassBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/NonSingletonClassBinding.java index 494806a..f504104 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/NonSingletonClassBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/NonSingletonClassBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/OptionalResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/OptionalResolver.java index f1c14a8..476f009 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/OptionalResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/OptionalResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/PostInject.java b/dependency-injection/src/main/java/build/codemodel/injection/PostInject.java index 74c4653..717205c 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/PostInject.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/PostInject.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ProviderResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/ProviderResolver.java index a00880e..e269974 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ProviderResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ProviderResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/Provides.java b/dependency-injection/src/main/java/build/codemodel/injection/Provides.java index b3ce2c5..87fe391 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/Provides.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/Provides.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ProvidesResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/ProvidesResolver.java index 60d7d85..c6e9dff 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ProvidesResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ProvidesResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -117,8 +117,7 @@ public Dependency dependency() { return dependency; } }); - } - catch (final IllegalAccessException | InvocationTargetException e) { + } catch (final IllegalAccessException | InvocationTargetException e) { throw new InjectionException("@Provides method " + method + " failed", e); } } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/QualifiedResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/QualifiedResolver.java index a33f902..7bd5f94 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/QualifiedResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/QualifiedResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/Resolver.java b/dependency-injection/src/main/java/build/codemodel/injection/Resolver.java index cf0be6c..2e4e4eb 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/Resolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/Resolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/SingletonValueBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/SingletonValueBinding.java index 66ab6d9..a0b3304 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/SingletonValueBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/SingletonValueBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/SupplierBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/SupplierBinding.java index 8fbe4db..6737031 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/SupplierBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/SupplierBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/SystemProperty.java b/dependency-injection/src/main/java/build/codemodel/injection/SystemProperty.java index 9cca492..af3b30f 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/SystemProperty.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/SystemProperty.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -37,7 +37,7 @@ */ @Documented @Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.FIELD, ElementType.PARAMETER }) +@Target({ElementType.FIELD, ElementType.PARAMETER}) public @interface SystemProperty { /** @@ -52,7 +52,7 @@ */ @Documented @Retention(RetentionPolicy.RUNTIME) - @Target({ ElementType.FIELD, ElementType.PARAMETER }) + @Target({ElementType.FIELD, ElementType.PARAMETER}) @interface Default { /** diff --git a/dependency-injection/src/main/java/build/codemodel/injection/SystemPropertyResolver.java b/dependency-injection/src/main/java/build/codemodel/injection/SystemPropertyResolver.java index 87ea2e9..056aa70 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/SystemPropertyResolver.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/SystemPropertyResolver.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -103,19 +103,19 @@ public Optional> resolve(final Dependency dependency) return propertyValue == null ? null : TypeUsages.getThreadContextClass(dependency.typeUsage()) - .map(requiredClass -> - new ValueBinding() { - @Override - public Dependency dependency() { - return dependency; - } - - @Override - public Object value() { - return Strings.convert(propertyValue, requiredClass); - } - }) - .orElse(null); + .map(requiredClass -> + new ValueBinding() { + @Override + public Dependency dependency() { + return dependency; + } + + @Override + public Object value() { + return Strings.convert(propertyValue, requiredClass); + } + }) + .orElse(null); }); } diff --git a/dependency-injection/src/main/java/build/codemodel/injection/UnsatisfiedDependencyException.java b/dependency-injection/src/main/java/build/codemodel/injection/UnsatisfiedDependencyException.java index 2ef6c68..e66a186 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/UnsatisfiedDependencyException.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/UnsatisfiedDependencyException.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/build/codemodel/injection/ValueBinding.java b/dependency-injection/src/main/java/build/codemodel/injection/ValueBinding.java index 84c6e15..0e51689 100644 --- a/dependency-injection/src/main/java/build/codemodel/injection/ValueBinding.java +++ b/dependency-injection/src/main/java/build/codemodel/injection/ValueBinding.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/main/java/module-info.java b/dependency-injection/src/main/java/module-info.java index 5e7052b..1c62757 100644 --- a/dependency-injection/src/main/java/module-info.java +++ b/dependency-injection/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/BindingGraphTests.java b/dependency-injection/src/test/java/build/codemodel/injection/BindingGraphTests.java index 91e08f9..8001d4c 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/BindingGraphTests.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/BindingGraphTests.java @@ -163,8 +163,15 @@ void unsatisfiedDependencyDetected_unitTest() { contributor.contributeBinding(engineNode); final Dependency unregistered = new Dependency() { - @Override public TypeUsage typeUsage() { return null; } - @Override public String signature() { return "com.example.Unregistered"; } + @Override + public TypeUsage typeUsage() { + return null; + } + + @Override + public String signature() { + return "com.example.Unregistered"; + } }; contributor.contributeDependency(engineNode, null, new DependencyEdge(null, unregistered)); diff --git a/dependency-injection/src/test/java/build/codemodel/injection/ContextualTesting.java b/dependency-injection/src/test/java/build/codemodel/injection/ContextualTesting.java index bab3b2b..556690d 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/ContextualTesting.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/ContextualTesting.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/DefaultOptionResolverTests.java b/dependency-injection/src/test/java/build/codemodel/injection/DefaultOptionResolverTests.java index b7a66d8..20f3dd5 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/DefaultOptionResolverTests.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/DefaultOptionResolverTests.java @@ -93,8 +93,15 @@ void shouldNotResolveNonOptionTypes() { final var context = framework.newContext( DefaultOptionResolver.of(framework), dep -> Optional.of(new ValueBinding() { - @Override public Object value() { return "fallback"; } - @Override public Dependency dependency() { return dep; } + @Override + public Object value() { + return "fallback"; + } + + @Override + public Dependency dependency() { + return dep; + } })); context.bind(ServiceWithString.class).to(ServiceWithString.class); @@ -143,7 +150,7 @@ public static class OptionWithConstructorDefault extends AbstractValueOption { @Default - public OptionWithConstructorDefault() { + OptionWithConstructorDefault() { super("constructor-default"); } } @@ -162,7 +169,7 @@ public static class OptionWithFieldDefault public static class OptionWithNoDefault extends AbstractValueOption { - public OptionWithNoDefault(final String value) { + OptionWithNoDefault(final String value) { super(value); } } diff --git a/dependency-injection/src/test/java/build/codemodel/injection/InjectionContextTests.java b/dependency-injection/src/test/java/build/codemodel/injection/InjectionContextTests.java index db59f26..284bbf6 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/InjectionContextTests.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/InjectionContextTests.java @@ -406,7 +406,8 @@ void shouldIncludeRequiredByChainInUnsatisfiedDependencyMessage() { /** * A leaf dependency that is never bound, causing a resolution failure when a service chain requests it. */ - interface MissingLeafService {} + interface MissingLeafService { + } /** * A singleton mid-chain service that requires the unbound {@link MissingLeafService}. @@ -414,7 +415,8 @@ interface MissingLeafService {} @Singleton static class ChainMiddleService { @Inject - ChainMiddleService(final MissingLeafService leaf) {} + ChainMiddleService(final MissingLeafService leaf) { + } } /** @@ -422,7 +424,8 @@ static class ChainMiddleService { */ static class ChainRootService { @Inject - ChainRootService(final ChainMiddleService middle) {} + ChainRootService(final ChainMiddleService middle) { + } } /** diff --git a/dependency-injection/src/test/java/build/codemodel/injection/QualifiedResolverTests.java b/dependency-injection/src/test/java/build/codemodel/injection/QualifiedResolverTests.java index 7f3ba23..b5596bb 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/QualifiedResolverTests.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/QualifiedResolverTests.java @@ -23,7 +23,7 @@ * @author spencer.firestone * @since Jan-2020 */ -class QualifiedResolverTest +class QualifiedResolverTests implements ContextualTesting { /** @@ -177,7 +177,7 @@ private static class ClassWithMultipleInjections { @Documented @Inherited @Retention(RetentionPolicy.RUNTIME) - @Target({ METHOD, CONSTRUCTOR, FIELD }) + @Target({METHOD, CONSTRUCTOR, FIELD}) @Qualifier private @interface FooQualifier { @@ -189,7 +189,7 @@ private static class ClassWithMultipleInjections { @Documented @Inherited @Retention(RetentionPolicy.RUNTIME) - @Target({ METHOD, CONSTRUCTOR, FIELD }) + @Target({METHOD, CONSTRUCTOR, FIELD}) @Qualifier private @interface StringQualifier { diff --git a/dependency-injection/src/test/java/build/codemodel/injection/ValidationTests.java b/dependency-injection/src/test/java/build/codemodel/injection/ValidationTests.java index 6d97e2e..05b5b94 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/ValidationTests.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/ValidationTests.java @@ -28,7 +28,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - import java.util.concurrent.atomic.AtomicInteger; import static org.assertj.core.api.Assertions.assertThat; diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Car.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Car.java index a17c54c..68d1e78 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Car.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Car.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Convertible.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Convertible.java index e799749..acf0983 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Convertible.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Convertible.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Drivers.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Drivers.java index 57f81c8..f607f53 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Drivers.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Drivers.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/DriversSeat.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/DriversSeat.java index cb0f575..48c917d 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/DriversSeat.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/DriversSeat.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Engine.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Engine.java index d2692ea..b974a87 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Engine.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Engine.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/FuelTank.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/FuelTank.java index 2154bb4..58c90e5 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/FuelTank.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/FuelTank.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/GasEngine.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/GasEngine.java index be13a50..ee40345 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/GasEngine.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/GasEngine.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seat.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seat.java index da874b8..20fa97e 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seat.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seat.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seatbelt.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seatbelt.java index 7278393..fd72756 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seatbelt.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Seatbelt.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Tire.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Tire.java index b28438f..0f1b728 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Tire.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/Tire.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/V8Engine.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/V8Engine.java index 810f151..37a1d0a 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/V8Engine.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/V8Engine.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/Cupholder.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/Cupholder.java index a7ff3ab..dfc5b6a 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/Cupholder.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/Cupholder.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/RoundThing.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/RoundThing.java index c2b8e7b..687ce37 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/RoundThing.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/RoundThing.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/SpareTire.java b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/SpareTire.java index 71bb22b..cc6b365 100755 --- a/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/SpareTire.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/compatibility/accessories/SpareTire.java @@ -25,9 +25,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/AbstractPerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/AbstractPerson.java index 4addc09..437de64 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/AbstractPerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/AbstractPerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/ConstructorInjectablePerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/ConstructorInjectablePerson.java index f2e73e6..fb12267 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/ConstructorInjectablePerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/ConstructorInjectablePerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePerson.java index f4c8241..c10dac7 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithDefaultConstructor.java b/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithDefaultConstructor.java index 5047f67..63bb7f5 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithDefaultConstructor.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithDefaultConstructor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithInjectAnnotatedDefaultConstructor.java b/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithInjectAnnotatedDefaultConstructor.java index 8064bfe..dba795a 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithInjectAnnotatedDefaultConstructor.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/FieldInjectablePersonWithInjectAnnotatedDefaultConstructor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/MultipleConstructorPerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/MultipleConstructorPerson.java index 7fdbe3f..199f61c 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/MultipleConstructorPerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/MultipleConstructorPerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/NonAbstractPerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/NonAbstractPerson.java index 1d0b66a..990c858 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/NonAbstractPerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/NonAbstractPerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/SetterInjectablePerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/SetterInjectablePerson.java index cce4181..951e69c 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/SetterInjectablePerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/SetterInjectablePerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/dependency-injection/src/test/java/build/codemodel/injection/example/SystemPropertyInjectablePerson.java b/dependency-injection/src/test/java/build/codemodel/injection/example/SystemPropertyInjectablePerson.java index 77d814e..e8c54eb 100644 --- a/dependency-injection/src/test/java/build/codemodel/injection/example/SystemPropertyInjectablePerson.java +++ b/dependency-injection/src/test/java/build/codemodel/injection/example/SystemPropertyInjectablePerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractArithmeticExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractArithmeticExpression.java index 175cd69..e819843 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractArithmeticExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractArithmeticExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -63,7 +63,7 @@ protected AbstractArithmeticExpression(final CodeModel codeModel, /** * {@link Unmarshal} an {@link AbstractArithmeticExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryArithmeticExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryArithmeticExpression.java index 9d9ceeb..7d6938b 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryArithmeticExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryArithmeticExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -73,7 +73,7 @@ protected AbstractBinaryArithmeticExpression(final Expression left, /** * {@link Unmarshal} an {@link AbstractBinaryArithmeticExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryLogicalExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryLogicalExpression.java index 14943b3..ca86c64 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryLogicalExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractBinaryLogicalExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -73,7 +73,7 @@ protected AbstractBinaryLogicalExpression(final Expression left, /** * {@link Unmarshal} an {@link AbstractBinaryLogicalExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractComparisonExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractComparisonExpression.java index a4040b3..4cf0803 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractComparisonExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractComparisonExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -73,7 +73,7 @@ protected AbstractComparisonExpression(final Expression left, /** * {@link Unmarshal} an {@link AbstractComparisonExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractExpression.java index bd1c86a..14d190b 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,7 +53,7 @@ protected AbstractExpression(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link AbstractExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractLogicalExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractLogicalExpression.java index 8b160ec..82327de 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractLogicalExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractLogicalExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -69,7 +69,7 @@ protected AbstractLogicalExpression(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link AbstractLogicalExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryArithmeticExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryArithmeticExpression.java index 9a059f9..63fa56e 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryArithmeticExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryArithmeticExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -66,7 +66,7 @@ protected AbstractUnaryArithmeticExpression(final Expression expression) { /** * {@link Unmarshal} an {@link AbstractUnaryArithmeticExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryLogicalExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryLogicalExpression.java index c7d3c1b..6645a1c 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryLogicalExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AbstractUnaryLogicalExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -65,7 +65,7 @@ protected AbstractUnaryLogicalExpression(final Expression expression) { /** * {@link Unmarshal} an {@link AbstractUnaryLogicalExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Addition.java b/expression-codemodel/src/main/java/build/codemodel/expression/Addition.java index 0745a40..509f927 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Addition.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Addition.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,11 +55,11 @@ private Addition(final Expression left, super(left, right); } - + /** * Un{@link Marshal} an {@link Addition}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -118,7 +118,7 @@ public static Addition of(final Expression left, return new Addition(left, right); } - + static { Marshalling.register(Addition.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/AnyInCommon.java b/expression-codemodel/src/main/java/build/codemodel/expression/AnyInCommon.java index 69ed914..7637a10 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/AnyInCommon.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/AnyInCommon.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,11 +55,11 @@ private AnyInCommon(final Expression left, super(left, right); } - + /** * Un{@link Marshal} an {@link AnyInCommon}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public AnyInCommon(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -117,7 +117,7 @@ public static AnyInCommon of(final Expression left, return new AnyInCommon(left, right); } - + static { Marshalling.register(AnyInCommon.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/ArithmeticExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/ArithmeticExpression.java index ce1fda2..3e296ac 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/ArithmeticExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/ArithmeticExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/BinaryArithmeticExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/BinaryArithmeticExpression.java index fee236b..39fbdf0 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/BinaryArithmeticExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/BinaryArithmeticExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/BinaryLogicalExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/BinaryLogicalExpression.java index 097d57f..0c354d9 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/BinaryLogicalExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/BinaryLogicalExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/BooleanLiteral.java b/expression-codemodel/src/main/java/build/codemodel/expression/BooleanLiteral.java index 020041e..6bf5322 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/BooleanLiteral.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/BooleanLiteral.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public class BooleanLiteral * Constructs a {@link BooleanLiteral}. * * @param codeModel the {@link CodeModel} - * @param value the non-{@code null}able value + * @param value the non-{@code null}able value */ private BooleanLiteral(final CodeModel codeModel, final boolean value) { @@ -62,7 +62,7 @@ private BooleanLiteral(final CodeModel codeModel, /** * Unmarshalling constructor for {@link BooleanLiteral}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param value the non-{@code null}able value @@ -99,7 +99,7 @@ public void destructor(final Marshaller marshaller, * Creates a {@link BooleanLiteral}. * * @param codeModel the {@link CodeModel} - * @param value the {@code null}able value + * @param value the {@code null}able value */ public static BooleanLiteral of(final CodeModel codeModel, final boolean value) { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Cast.java b/expression-codemodel/src/main/java/build/codemodel/expression/Cast.java index c84d488..898520b 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Cast.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Cast.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -73,7 +73,7 @@ private Cast(final TypeUsage targetType, /** * Un{@link Marshal} a {@link Cast}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Marshalled} {@link Trait}s * @param targetType the {@link Marshalled} {@link TypeUsage} specifying the target Type diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/ComparisonExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/ComparisonExpression.java index 7e81bc8..3da13fa 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/ComparisonExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/ComparisonExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Conjunction.java b/expression-codemodel/src/main/java/build/codemodel/expression/Conjunction.java index 1644369..505bae1 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Conjunction.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Conjunction.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ private Conjunction(final Expression left, /** * Un{@link Marshal} a {@link Conjunction}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -74,7 +74,7 @@ public Conjunction(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -118,7 +118,7 @@ public static Conjunction of(final Expression left, return new Conjunction(left, right); } - + static { Marshalling.register(Conjunction.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Disjunction.java b/expression-codemodel/src/main/java/build/codemodel/expression/Disjunction.java index 9c1e6a9..766176c 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Disjunction.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Disjunction.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ private Disjunction(final Expression left, /** * Un{@link Marshal} a {@link Disjunction}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Division.java b/expression-codemodel/src/main/java/build/codemodel/expression/Division.java index 4eb93ef..01ae8ae 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Division.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Division.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private Division(final Expression left, /** * Un{@link Marshal} a {@link Division}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/EqualTo.java b/expression-codemodel/src/main/java/build/codemodel/expression/EqualTo.java index c3de653..0b873cf 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/EqualTo.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/EqualTo.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,11 +55,11 @@ private EqualTo(final Expression left, super(left, right); } - + /** * Un{@link Marshal} an {@link EqualTo}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public EqualTo(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -117,7 +117,7 @@ public static EqualTo of(final Expression left, return new EqualTo(left, right); } - + static { Marshalling.register(EqualTo.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/ExclusiveDisjunction.java b/expression-codemodel/src/main/java/build/codemodel/expression/ExclusiveDisjunction.java index e4ea6fc..4992f02 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/ExclusiveDisjunction.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/ExclusiveDisjunction.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ private ExclusiveDisjunction(final Expression left, /** * Un{@link Marshal} an {@link ExclusiveDisjunction}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -74,7 +74,7 @@ public ExclusiveDisjunction(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -118,7 +118,7 @@ public static ExclusiveDisjunction of(final Expression left, return new ExclusiveDisjunction(left, right); } - + static { Marshalling.register(ExclusiveDisjunction.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Exponent.java b/expression-codemodel/src/main/java/build/codemodel/expression/Exponent.java index 61716da..dc5b783 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Exponent.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Exponent.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -47,7 +47,7 @@ public class Exponent /** * Constructs a {@link Exponent}. * - * @param base the base {@link Expression} + * @param base the base {@link Expression} * @param exponent the exponent {@link Expression} */ private Exponent(final Expression base, @@ -59,7 +59,7 @@ private Exponent(final Expression base, /** * Un{@link Marshal} an {@link Exponent}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public Exponent(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled base, final Marshalled exponent) { - + super(codeModel, marshaller, traits, typeUsage, base, exponent); } @@ -109,7 +109,7 @@ public boolean equals(final Object object) { /** * Creates a {@link Exponent} of two {@link Expression}s. * - * @param base the base {@link Expression} + * @param base the base {@link Expression} * @param exponent the exponent {@link Expression} * @return a new {@link Exponent} */ @@ -118,7 +118,7 @@ public static Exponent of(final Expression base, return new Exponent(base, exponent); } - + static { Marshalling.register(Exponent.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Expression.java b/expression-codemodel/src/main/java/build/codemodel/expression/Expression.java index 2bb774d..477161b 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Expression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Expression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/ExpressionType.java b/expression-codemodel/src/main/java/build/codemodel/expression/ExpressionType.java index c4dc52a..ad9ce55 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/ExpressionType.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/ExpressionType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Expressions.java b/expression-codemodel/src/main/java/build/codemodel/expression/Expressions.java index 0a8b0d5..609ca90 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Expressions.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Expressions.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -73,8 +73,7 @@ public Literal valueOf(final T value) { // attempt to use an appropriate representation of the Value if (value instanceof Literal literal) { return (Literal) literal; - } - else if (value instanceof Boolean booleanValue) { + } else if (value instanceof Boolean booleanValue) { return (Literal) valueOf(booleanValue); } @@ -357,7 +356,7 @@ public VariableUsage variableOf(final VariableName name) { /** * Creates a {@link Cast} {@link Expression} for a defined {@link TypeUsage}. * - * @param targetType the {@link TypeUsage} specifying the target Type + * @param targetType the {@link TypeUsage} specifying the target Type * @param expression the {@link Expression} to cast * @return a new {@link VariableUsage} */ diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/FunctionDescriptor.java b/expression-codemodel/src/main/java/build/codemodel/expression/FunctionDescriptor.java index 824620f..9740598 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/FunctionDescriptor.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/FunctionDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -102,7 +102,7 @@ private FunctionDescriptor(final TypeDescriptor typeDescriptor, /** * Un{@link Marshal} a {@link FunctionDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeDescriptor the {@link Marshalled} {@link TypeDescriptor} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/FunctionUsage.java b/expression-codemodel/src/main/java/build/codemodel/expression/FunctionUsage.java index 6e39aa1..e5f2f00 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/FunctionUsage.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/FunctionUsage.java @@ -62,7 +62,7 @@ public class FunctionUsage /** * Constructs a {@link FunctionUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param functionName the {@link FunctionName} for the function * @param arguments the arguments for the function */ @@ -80,7 +80,7 @@ private FunctionUsage(final CodeModel codeModel, /** * Un{@link Marshal} a {@link FunctionUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Trait}s * @param functionName the {@link FunctionName} @@ -153,14 +153,15 @@ public boolean equals(final Object object) { return true; } return object instanceof FunctionUsage other - && Objects.equals(this.functionName, other.functionName) - && this.arguments.equals(other.arguments) - && super.equals(object); + && Objects.equals(this.functionName, other.functionName) + && this.arguments.equals(other.arguments) + && super.equals(object); } + /** * Creates a {@link FunctionUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param functionName the {@link FunctionName} for the function * @param arguments the arguments for the function */ @@ -174,7 +175,7 @@ public static FunctionUsage of(final CodeModel codeModel, /** * Creates a {@link FunctionUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param functionName the {@link FunctionName} for the function * @param arguments the arguments for the function */ diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThan.java b/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThan.java index c615ec3..31f062a 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThan.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThan.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private GreaterThan(final Expression left, /** * Un{@link Marshal} a {@link GreaterThan}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public GreaterThan(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -119,7 +119,7 @@ public static GreaterThan of(final Expression left, return new GreaterThan(left, right); } - + static { Marshalling.register(GreaterThan.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThanOrEqualTo.java b/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThanOrEqualTo.java index d8908d1..8fddaa1 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThanOrEqualTo.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/GreaterThanOrEqualTo.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private GreaterThanOrEqualTo(final Expression left, /** * Un{@link Marshal} a {@link GreaterThanOrEqualTo}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/LessThan.java b/expression-codemodel/src/main/java/build/codemodel/expression/LessThan.java index fa11681..53006a7 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/LessThan.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/LessThan.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private LessThan(final Expression left, /** * Un{@link Marshal} a {@link LessThan}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public LessThan(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -117,7 +117,7 @@ public static LessThan of(final Expression left, return new LessThan(left, right); } - + static { Marshalling.register(LessThan.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/LessThanOrEqualTo.java b/expression-codemodel/src/main/java/build/codemodel/expression/LessThanOrEqualTo.java index 76e3b30..e8d484d 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/LessThanOrEqualTo.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/LessThanOrEqualTo.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private LessThanOrEqualTo(final Expression left, /** * Un{@link Marshal} a {@link LessThanOrEqualTo}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Literal.java b/expression-codemodel/src/main/java/build/codemodel/expression/Literal.java index 8f09611..8319185 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Literal.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Literal.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -57,7 +57,7 @@ public class Literal /** * Constructs a {@link Literal}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param value the {@code null}able value * @param valueClass the {@code null}able {@link Class} of value */ @@ -75,8 +75,8 @@ protected Literal(final CodeModel codeModel, * Constructs a {@link Literal}. * * @param codeModel the {@link CodeModel} - * @param value the {@code null}able value - * @param type the {@link TypeUsage} + * @param value the {@code null}able value + * @param type the {@link TypeUsage} */ protected Literal(final CodeModel codeModel, final T value, @@ -92,7 +92,7 @@ protected Literal(final CodeModel codeModel, * Constructs a {@link Literal}. * * @param codeModel the {@link CodeModel} - * @param value the {@code null}able value + * @param value the {@code null}able value */ @SuppressWarnings("unchecked") protected Literal(final CodeModel codeModel, @@ -163,7 +163,7 @@ public Stream compositeChildren() { * Creates a {@link Literal}. * * @param the type of value - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param value the {@code null}able value * @param valueClass the {@code null}able {@link Class} */ @@ -177,10 +177,10 @@ public static Literal of(final CodeModel codeModel, /** * Creates a {@link Literal}. * - * @param the type of value + * @param the type of value * @param codeModel the {@link CodeModel} - * @param value the {@code null}able value - * @param type the {@link TypeUsage} + * @param value the {@code null}able value + * @param type the {@link TypeUsage} */ public static Literal of(final CodeModel codeModel, final T value, @@ -192,9 +192,9 @@ public static Literal of(final CodeModel codeModel, /** * Creates a {@link Literal}. * - * @param the type of value + * @param the type of value * @param codeModel the {@link CodeModel} - * @param value the {@code null}able value + * @param value the {@code null}able value */ public static Literal of(final CodeModel codeModel, final T value) { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/LogicalExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/LogicalExpression.java index a4d4a1d..bc445ee 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/LogicalExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/LogicalExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Modulo.java b/expression-codemodel/src/main/java/build/codemodel/expression/Modulo.java index 6147858..6732950 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Modulo.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Modulo.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private Modulo(final Expression left, /** * Un{@link Marshal} a {@link Modulo}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public Modulo(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -118,7 +118,7 @@ public static Modulo of(final Expression left, return new Modulo(left, right); } - + static { Marshalling.register(Modulo.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Multiplication.java b/expression-codemodel/src/main/java/build/codemodel/expression/Multiplication.java index d0d41d8..97e9a3b 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Multiplication.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Multiplication.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private Multiplication(final Expression left, /** * Un{@link Marshal} a {@link Multiplication}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -118,7 +118,7 @@ public static Multiplication of(final Expression left, return new Multiplication(left, right); } - + static { Marshalling.register(Multiplication.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Negation.java b/expression-codemodel/src/main/java/build/codemodel/expression/Negation.java index 2a0e30e..6a4e909 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Negation.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Negation.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -56,7 +56,7 @@ private Negation(final Expression expression) { /** * Un{@link Marshal} a {@link Negation}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param expression the {@link Marshalled} {@link Expression} to negate diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Negative.java b/expression-codemodel/src/main/java/build/codemodel/expression/Negative.java index 09a3561..99527f3 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Negative.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Negative.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -57,7 +57,7 @@ private Negative(final Expression expression) { /** * Un{@link Marshal} a {@link Negative}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param expression the {@link Marshalled} {@link Expression} to negate @@ -68,7 +68,7 @@ public Negative(@Bound final CodeModel codeModel, final Stream> traits, final Optional> typeUsage, final Marshalled expression) { - + super(codeModel, marshaller, traits, typeUsage, expression); } @@ -106,7 +106,7 @@ public boolean equals(final Object object) { public static Negative of(final Expression expression) { return new Negative(expression); } - + static { Marshalling.register(Negative.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/NoneInCommon.java b/expression-codemodel/src/main/java/build/codemodel/expression/NoneInCommon.java index 8e2a1b6..e268530 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/NoneInCommon.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/NoneInCommon.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,11 +55,11 @@ private NoneInCommon(final Expression left, super(left, right); } - + /** * Un{@link Marshal} a {@link NoneInCommon}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link TypeUsage} @@ -73,7 +73,7 @@ public NoneInCommon(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -117,7 +117,7 @@ public static NoneInCommon of(final Expression left, return new NoneInCommon(left, right); } - + static { Marshalling.register(NoneInCommon.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/NotEqualTo.java b/expression-codemodel/src/main/java/build/codemodel/expression/NotEqualTo.java index e24078a..1c7c36d 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/NotEqualTo.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/NotEqualTo.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,11 +55,11 @@ private NotEqualTo(final Expression left, super(left, right); } - + /** * Un{@link Marshal} a {@link NotEqualTo}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Stream} of {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public NotEqualTo(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -117,7 +117,7 @@ public static NotEqualTo of(final Expression left, return new NotEqualTo(left, right); } - + static { Marshalling.register(NotEqualTo.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/NumericLiteral.java b/expression-codemodel/src/main/java/build/codemodel/expression/NumericLiteral.java index 16724a9..5e156ac 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/NumericLiteral.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/NumericLiteral.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -49,7 +49,7 @@ public class NumericLiteral * Constructs a {@link NumericLiteral}. * * @param codeModel the {@link CodeModel} - * @param value the non-{@code null}able value + * @param value the non-{@code null}able value */ private NumericLiteral(final CodeModel codeModel, final Number value) { @@ -60,7 +60,7 @@ private NumericLiteral(final CodeModel codeModel, /** * Unmarshalling constructor for {@link NumericLiteral}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param value the non-{@code null}able value @@ -97,7 +97,7 @@ public void destructor(final Marshaller marshaller, * Creates a {@link NumericLiteral}. * * @param codeModel the {@link CodeModel} - * @param value the {@code null}able value + * @param value the {@code null}able value */ public static NumericLiteral of(final CodeModel codeModel, final Number value) { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/StringLiteral.java b/expression-codemodel/src/main/java/build/codemodel/expression/StringLiteral.java index bc748ae..d7c2f49 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/StringLiteral.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/StringLiteral.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -49,7 +49,7 @@ public class StringLiteral * Constructs a {@link StringLiteral}. * * @param codeModel the {@link CodeModel} - * @param value the {@link String} value + * @param value the {@link String} value */ private StringLiteral(final CodeModel codeModel, final String value) { @@ -60,7 +60,7 @@ private StringLiteral(final CodeModel codeModel, /** * Unmarshalling constructor for {@link StringLiteral}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param value the {@link String} value @@ -97,7 +97,7 @@ public void destructor(final Marshaller marshaller, * Creates a {@link StringLiteral}. * * @param codeModel the {@link CodeModel} - * @param value the {@link String} value + * @param value the {@link String} value */ public static StringLiteral of(final CodeModel codeModel, final String value) { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Subtraction.java b/expression-codemodel/src/main/java/build/codemodel/expression/Subtraction.java index 5662057..e081e75 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Subtraction.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Subtraction.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private Subtraction(final Expression left, /** * Un{@link Marshal} a {@link Subtraction}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public Subtraction(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -118,7 +118,7 @@ public static Subtraction of(final Expression left, return new Subtraction(left, right); } - + static { Marshalling.register(Subtraction.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/TemplateExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/TemplateExpression.java index 275100c..b2e751c 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/TemplateExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/TemplateExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -56,24 +56,24 @@ public class TemplateExpression protected TemplateExpression(final CodeModel codeModel, final List expressions) { super(codeModel); - + this.expressions = expressions; } - + /** * Un{@link Marshal} a {@link TemplateExpression}. * * @param codeModel the {@link CodeModel} - * @param marshaller the {@link Marshaller} - * @param traits the {@link Stream} of {@link Trait}s - * @param expressions the {@link List} of {@link Expression}s + * @param marshaller the {@link Marshaller} + * @param traits the {@link Stream} of {@link Trait}s + * @param expressions the {@link List} of {@link Expression}s */ @Unmarshal public TemplateExpression(@Bound final CodeModel codeModel, final Marshaller marshaller, final Stream> traits, final Stream> expressions) { - + super(codeModel, marshaller, traits); this.expressions = expressions @@ -92,7 +92,7 @@ public TemplateExpression(@Bound final CodeModel codeModel, public void destructor(final Marshaller marshaller, final Out>> traits, final Out>> expressions) { - + super.destructor(marshaller, traits); expressions.set(this.expressions.stream().map(expr -> marshaller.marshal(expr))); @@ -132,7 +132,7 @@ public static TemplateExpression of(final List expressions) { public static TemplateExpression empty(final CodeModel codeModel) { return new TemplateExpression(codeModel, new ArrayList<>()); } - + static { Marshalling.register(TemplateExpression.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/Then.java b/expression-codemodel/src/main/java/build/codemodel/expression/Then.java index 828bcb5..be93245 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/Then.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/Then.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private Then(final Expression left, /** * Un{@link Marshal} a {@link Then}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Marshalled} {@link Trait}s * @param typeUsage the {@link Optional} {@link Marshalled} {@link TypeUsage} @@ -73,7 +73,7 @@ public Then(@Bound final CodeModel codeModel, final Optional> typeUsage, final Marshalled left, final Marshalled right) { - + super(codeModel, marshaller, traits, typeUsage, left, right); } @@ -117,7 +117,7 @@ public static Then of(final Expression left, return new Then(left, right); } - + static { Marshalling.register(Then.class, MethodHandles.lookup()); } diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/UnaryArithmeticExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/UnaryArithmeticExpression.java index 066533a..ba27e58 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/UnaryArithmeticExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/UnaryArithmeticExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/UnaryLogicalExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/UnaryLogicalExpression.java index a22c6c3..8549f56 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/UnaryLogicalExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/UnaryLogicalExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/VariableUsage.java b/expression-codemodel/src/main/java/build/codemodel/expression/VariableUsage.java index 99069ee..fa6bb38 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/VariableUsage.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/VariableUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -61,8 +61,8 @@ public class VariableUsage * Constructs a {@link VariableUsage}. * * @param codeModel the {@link CodeModel} - * @param name the {@link VariableName} - * @param type the {@link Optional} {@link TypeUsage} for the variable + * @param name the {@link VariableName} + * @param type the {@link Optional} {@link TypeUsage} for the variable */ private VariableUsage(final CodeModel codeModel, final VariableName name, @@ -77,7 +77,7 @@ private VariableUsage(final CodeModel codeModel, /** * Un{@link Marshal} a {@link VariableUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param traits the {@link Marshalled} {@link Trait}s * @param name the {@link VariableName} @@ -153,8 +153,8 @@ public int hashCode() { * Creates a {@link VariableUsage}. * * @param codeModel the {@link CodeModel} - * @param name the {@link VariableName} - * @param type the {@link Optional} {@link TypeUsage} for the variable + * @param name the {@link VariableName} + * @param type the {@link Optional} {@link TypeUsage} for the variable */ public static VariableUsage of(final CodeModel codeModel, final VariableName name, @@ -167,8 +167,8 @@ public static VariableUsage of(final CodeModel codeModel, * Creates a {@link VariableUsage}. * * @param codeModel the {@link CodeModel} - * @param name the {@link VariableName} - * @param type the {{@link TypeUsage} for the variable + * @param name the {@link VariableName} + * @param type the {{@link TypeUsage} for the variable */ public static VariableUsage of(final CodeModel codeModel, final VariableName name, @@ -181,7 +181,7 @@ public static VariableUsage of(final CodeModel codeModel, * Create a {@link VariableUsage}. * * @param codeModel the {@link CodeModel} - * @param name the {@link VariableName} + * @param name the {@link VariableName} */ public static VariableUsage of(final CodeModel codeModel, final VariableName name) { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/naming/AbstractCallableName.java b/expression-codemodel/src/main/java/build/codemodel/expression/naming/AbstractCallableName.java index ac4a09d..1671e6a 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/naming/AbstractCallableName.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/naming/AbstractCallableName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,19 +94,19 @@ protected AbstractCallableName(final Optional moduleName, .map(name -> name + ".") .orElse("") : this.moduleName - .map(name -> name.toString() + "/") - .orElse("") - + this.namespace() - .map(Namespace::toString) - .map(name -> name + ".") - .orElse("")) + .map(name -> name.toString() + "/") + .orElse("") + + this.namespace() + .map(Namespace::toString) + .map(name -> name + ".") + .orElse("")) + this.irreducibleName; } - /** + /** * Un{@link Marshal} an {@link AbstractCallableName}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param moduleName the {@link Optional} {@link ModuleName} * @param namespace the {@link Optional} {@link Namespace} @@ -125,7 +125,7 @@ protected AbstractCallableName(@Bound final CodeModel codeModel, this.moduleName = moduleName; this.namespace = namespace; this.typeName = typeName; - this.irreducibleName = irreducibleName; + this.irreducibleName = irreducibleName; this.string = string; } @@ -145,7 +145,7 @@ protected void destructor(final Marshaller marshaller, final Out> typeName, final Out irreducibleName, final Out string) { - + moduleName.set(this.moduleName); namespace.set(this.namespace); typeName.set(this.typeName); diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/naming/FunctionName.java b/expression-codemodel/src/main/java/build/codemodel/expression/naming/FunctionName.java index ff6812e..2a7db38 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/naming/FunctionName.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/naming/FunctionName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -63,10 +63,10 @@ private FunctionName(final Optional moduleName, super(moduleName, namespace, typeName, irreducibleName); } - /** + /** * Un{@link Marshal} an {@link FunctionName}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param moduleName the {@link Optional} {@link ModuleName} * @param namespace the {@link Optional} {@link Namespace} @@ -98,11 +98,11 @@ public FunctionName(@Bound final CodeModel codeModel, */ @Marshal public void destructor(final Marshaller marshaller, - final Out> moduleName, - final Out> namespace, - final Out> typeName, - final Out irreducibleName, - final Out string) { + final Out> moduleName, + final Out> namespace, + final Out> typeName, + final Out irreducibleName, + final Out string) { super.destructor(marshaller, moduleName, namespace, typeName, irreducibleName, string); } @@ -131,10 +131,10 @@ public static FunctionName of(final Optional moduleName, * @return a {@link FunctionName} */ public static FunctionName of(final IrreducibleName irreducibleName) { - return FunctionName.of(Optional.empty(), - Optional.empty(), - Optional.empty(), - irreducibleName); + return of(Optional.empty(), + Optional.empty(), + Optional.empty(), + irreducibleName); } static { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/naming/VariableName.java b/expression-codemodel/src/main/java/build/codemodel/expression/naming/VariableName.java index e61c244..eac96a6 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/naming/VariableName.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/naming/VariableName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -98,19 +98,19 @@ private VariableName(final Optional moduleName, .map(name -> name + ".") .orElse("") : this.moduleName - .map(name -> name.toString() + "/") - .orElse("") - + this.namespace() - .map(Namespace::toString) - .map(name -> name + ".") - .orElse("")) + .map(name -> name.toString() + "/") + .orElse("") + + this.namespace() + .map(Namespace::toString) + .map(name -> name + ".") + .orElse("")) + this.irreducibleName; } /** * Unmarshalling constructor for {@link VariableName}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param moduleName the {@link Optional} {@link ModuleName} * @param namespace the {@link Optional} {@link Namespace} @@ -130,7 +130,7 @@ public VariableName(@Bound final CodeModel codeModel, this.moduleName = moduleName; this.namespace = namespace; this.typeName = typeName; - this.irreducibleName = irreducibleName; + this.irreducibleName = irreducibleName; this.string = string; } @@ -151,7 +151,7 @@ public void destructor(final Marshaller marshaller, final Out> typeName, final Out irreducibleName, final Out string) { - + moduleName.set(this.moduleName); namespace.set(this.namespace); typeName.set(this.typeName); @@ -264,10 +264,10 @@ public static VariableName of(final Optional moduleName, * @return a {@link VariableName} */ public static VariableName of(final IrreducibleName irreducibleName) { - return VariableName.of(Optional.empty(), - Optional.empty(), - Optional.empty(), - irreducibleName); + return of(Optional.empty(), + Optional.empty(), + Optional.empty(), + irreducibleName); } static { diff --git a/expression-codemodel/src/main/java/build/codemodel/expression/parsing/EmptyExpression.java b/expression-codemodel/src/main/java/build/codemodel/expression/parsing/EmptyExpression.java index 326c365..18a8439 100644 --- a/expression-codemodel/src/main/java/build/codemodel/expression/parsing/EmptyExpression.java +++ b/expression-codemodel/src/main/java/build/codemodel/expression/parsing/EmptyExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ protected EmptyExpression(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link EmptyExpression}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ diff --git a/expression-codemodel/src/main/java/module-info.java b/expression-codemodel/src/main/java/module-info.java index 63ad1bf..3d2b87a 100644 --- a/expression-codemodel/src/main/java/module-info.java +++ b/expression-codemodel/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/expression-codemodel/src/test/java/build/codemodel/expression/MarshallingTests.java b/expression-codemodel/src/test/java/build/codemodel/expression/MarshallingTests.java index e15118a..97280eb 100644 --- a/expression-codemodel/src/test/java/build/codemodel/expression/MarshallingTests.java +++ b/expression-codemodel/src/test/java/build/codemodel/expression/MarshallingTests.java @@ -524,7 +524,7 @@ void shouldPreserveBooleanTypeAfterMarshallingLogicalExpressions() } } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/expression-codemodel/src/test/java/build/codemodel/expression/naming/MarshallingTests.java b/expression-codemodel/src/test/java/build/codemodel/expression/naming/MarshallingTests.java index 73645ef..1d3b974 100644 --- a/expression-codemodel/src/test/java/build/codemodel/expression/naming/MarshallingTests.java +++ b/expression-codemodel/src/test/java/build/codemodel/expression/naming/MarshallingTests.java @@ -82,7 +82,7 @@ void shouldMarshallAndTransportAndUnmarshallFunctionName() IrreducibleName.of("test"))); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/expression-codemodel/src/test/java/build/codemodel/expression/parsing/ExpressionParserTests.java b/expression-codemodel/src/test/java/build/codemodel/expression/parsing/ExpressionParserTests.java index 6d1b0d5..9d26f43 100644 --- a/expression-codemodel/src/test/java/build/codemodel/expression/parsing/ExpressionParserTests.java +++ b/expression-codemodel/src/test/java/build/codemodel/expression/parsing/ExpressionParserTests.java @@ -1,5 +1,7 @@ package build.codemodel.expression.parsing; +import build.base.parsing.ExpressionParser; +import build.base.parsing.ExpressionParserException; import build.codemodel.expression.Addition; import build.codemodel.expression.AnyInCommon; import build.codemodel.expression.Conjunction; @@ -31,8 +33,6 @@ import build.codemodel.foundation.ConceptualCodeModel; import build.codemodel.foundation.naming.CachingNameProvider; import build.codemodel.foundation.naming.IrreducibleName; -import build.base.parsing.ExpressionParser; -import build.base.parsing.ExpressionParserException; import build.codemodel.foundation.naming.NonCachingNameProvider; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -108,9 +108,8 @@ void init() { */ @ParameterizedTest @NullSource - @ValueSource(strings = { "", " " }) - void shouldParseAnEmptyExpression(String expr) - { + @ValueSource(strings = {"", " "}) + void shouldParseAnEmptyExpression(final String expr) { final var result = parser.parse(expr); assertNull(result); } @@ -119,8 +118,8 @@ void shouldParseAnEmptyExpression(String expr) * Ensures that a {@link NumericLiteral} is correctly parsed regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "1", " 1", "1 " }) - void shouldParseSingleLiteral(String expr) { + @ValueSource(strings = {"1", " 1", "1 "}) + void shouldParseSingleLiteral(final String expr) { final var expected = NumericLiteral.of(codeModel, new BigDecimal("1")); final var result = parser.parse(expr); assertGraph(expected, result); @@ -130,11 +129,11 @@ void shouldParseSingleLiteral(String expr) { * Ensures that a {@link Addition} is correctly parsed regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "1 + 2", "1+2", "1 +2 " }) - void shouldParseSimpleAddition(String expr) { + @ValueSource(strings = {"1 + 2", "1+2", "1 +2 "}) + void shouldParseSimpleAddition(final String expr) { final var expected = Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -144,11 +143,11 @@ void shouldParseSimpleAddition(String expr) { * Ensures that a {@link Multiplication} is correctly parsed regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "1 * 2", "1*2", "1 *2 " }) - void shouldParseSimpleMultiplication(String expr) { + @ValueSource(strings = {"1 * 2", "1*2", "1 *2 "}) + void shouldParseSimpleMultiplication(final String expr) { final var expected = Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -159,14 +158,14 @@ void shouldParseSimpleMultiplication(String expr) { * Note tha this test is a simple case to ensure proper handling of precedence. */ @ParameterizedTest - @ValueSource(strings = { "1 + 2 * 3", "1+2*3", "1 +2* 3" }) - void shouldParseAdditionThenMultiplicationWithCorrectPrecedence(String expr) { + @ValueSource(strings = {"1 + 2 * 3", "1+2*3", "1 +2* 3"}) + void shouldParseAdditionThenMultiplicationWithCorrectPrecedence(final String expr) { final var expected = Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("2")), - NumericLiteral.of(codeModel, new BigDecimal("3")) - ) + NumericLiteral.of(codeModel, new BigDecimal("1")), + Multiplication.of( + NumericLiteral.of(codeModel, new BigDecimal("2")), + NumericLiteral.of(codeModel, new BigDecimal("3")) + ) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -177,14 +176,14 @@ void shouldParseAdditionThenMultiplicationWithCorrectPrecedence(String expr) { * Note tha this test is a simple case to ensure proper handling of precedence. */ @ParameterizedTest - @ValueSource(strings = { "1 * 2 + 3", "1*2+3", "1 *2+ 3" }) - void shouldParseMultiplicationThenAdditionWithCorrectPrecedence(String expr) { + @ValueSource(strings = {"1 * 2 + 3", "1*2+3", "1 *2+ 3"}) + void shouldParseMultiplicationThenAdditionWithCorrectPrecedence(final String expr) { final var expected = Addition.of( - Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ), - NumericLiteral.of(codeModel, new BigDecimal("3")) + Multiplication.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ), + NumericLiteral.of(codeModel, new BigDecimal("3")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -195,14 +194,14 @@ void shouldParseMultiplicationThenAdditionWithCorrectPrecedence(String expr) { * Note tha this test is a simple case to ensure proper handling of precedence. */ @ParameterizedTest - @ValueSource(strings = { "1 + 2 - 3", "1+2-3" }) - void shouldParseAdditionAndSubtractionAsEqualPrecedence(String expr) { + @ValueSource(strings = {"1 + 2 - 3", "1+2-3"}) + void shouldParseAdditionAndSubtractionAsEqualPrecedence(final String expr) { final var expected = Subtraction.of( - Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ), - NumericLiteral.of(codeModel, new BigDecimal("3")) + Addition.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ), + NumericLiteral.of(codeModel, new BigDecimal("3")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -212,17 +211,17 @@ void shouldParseAdditionAndSubtractionAsEqualPrecedence(String expr) { * Ensures that a multipart expression is correctly parsed according to precedence and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "1 + 2 * 3 - 4", "1+2*3-4" }) - void shouldParseMultiNodeExpressionWithCorrectPrecedence(String expr) { + @ValueSource(strings = {"1 + 2 * 3 - 4", "1+2*3-4"}) + void shouldParseMultiNodeExpressionWithCorrectPrecedence(final String expr) { final var expected = Subtraction.of( - Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("2")), - NumericLiteral.of(codeModel, new BigDecimal("3")) - ) - ), - NumericLiteral.of(codeModel, new BigDecimal("4")) + Addition.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + Multiplication.of( + NumericLiteral.of(codeModel, new BigDecimal("2")), + NumericLiteral.of(codeModel, new BigDecimal("3")) + ) + ), + NumericLiteral.of(codeModel, new BigDecimal("4")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -234,7 +233,7 @@ void shouldParseMultiNodeExpressionWithCorrectPrecedence(String expr) { @Test void shouldParseNegativeCorrectly() { final var expected = Negative.of( - NumericLiteral.of(codeModel, new BigDecimal("1")) + NumericLiteral.of(codeModel, new BigDecimal("1")) ); final var result = parser.parse("-1"); assertGraph(expected, result); @@ -244,13 +243,13 @@ void shouldParseNegativeCorrectly() { * Ensures that a {@link Negative} is correctly parsed at the beginning of an expression and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "-1 + 2", "-1+2" }) - void shouldParseNegativeBeginningAnExpressionCorrectly(String expr) { + @ValueSource(strings = {"-1 + 2", "-1+2"}) + void shouldParseNegativeBeginningAnExpressionCorrectly(final String expr) { final var expected = Addition.of( - Negative.of( - NumericLiteral.of(codeModel, new BigDecimal("1")) - ), - NumericLiteral.of(codeModel, new BigDecimal("2")) + Negative.of( + NumericLiteral.of(codeModel, new BigDecimal("1")) + ), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -260,13 +259,13 @@ void shouldParseNegativeBeginningAnExpressionCorrectly(String expr) { * Ensures that a {@link Negative} is correctly parsed within an expression and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "1 + -2", "1+-2" }) - void shouldParseNegativeWithinAnExpressionCorrectly(String expr) { + @ValueSource(strings = {"1 + -2", "1+-2"}) + void shouldParseNegativeWithinAnExpressionCorrectly(final String expr) { final var expected = Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - Negative.of( - NumericLiteral.of(codeModel, new BigDecimal("2")) - ) + NumericLiteral.of(codeModel, new BigDecimal("1")), + Negative.of( + NumericLiteral.of(codeModel, new BigDecimal("2")) + ) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -276,14 +275,14 @@ void shouldParseNegativeWithinAnExpressionCorrectly(String expr) { * Ensures that a section is parsed with the correct precedence and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "(1 + 2) * 3", "(1+2)*3" }) - void shouldParseASectionAtTheStartOfAnExpressionWithTheCorrectPrecedence(String expr) { + @ValueSource(strings = {"(1 + 2) * 3", "(1+2)*3"}) + void shouldParseASectionAtTheStartOfAnExpressionWithTheCorrectPrecedence(final String expr) { final var expected = Multiplication.of( - Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ), - NumericLiteral.of(codeModel, new BigDecimal("3")) + Addition.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ), + NumericLiteral.of(codeModel, new BigDecimal("3")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -293,17 +292,17 @@ void shouldParseASectionAtTheStartOfAnExpressionWithTheCorrectPrecedence(String * Ensures that a section is parsed with the correct precedence and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "4 * (1 + 2) * 3", "4*(1+2)*3" }) - void shouldParseASectionWithinAnExpressionWithTheCorrectPrecedence(String expr) { + @ValueSource(strings = {"4 * (1 + 2) * 3", "4*(1+2)*3"}) + void shouldParseASectionWithinAnExpressionWithTheCorrectPrecedence(final String expr) { final var expected = Multiplication.of( - Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("4")), - Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ) - ), - NumericLiteral.of(codeModel, new BigDecimal("3")) + Multiplication.of( + NumericLiteral.of(codeModel, new BigDecimal("4")), + Addition.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ) + ), + NumericLiteral.of(codeModel, new BigDecimal("3")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -313,20 +312,20 @@ void shouldParseASectionWithinAnExpressionWithTheCorrectPrecedence(String expr) * Ensures that nested sections are parsed with the correct precedence and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "4 * (1 + (5 - 2)) * 3", "4*(1+(5-2))*3" }) - void shouldParseNestedSectionsWithinAnExpressionCorrectly(String expr) { + @ValueSource(strings = {"4 * (1 + (5 - 2)) * 3", "4*(1+(5-2))*3"}) + void shouldParseNestedSectionsWithinAnExpressionCorrectly(final String expr) { final var expected = Multiplication.of( - Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("4")), - Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - Subtraction.of( - NumericLiteral.of(codeModel, new BigDecimal("5")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ) - ) - ), - NumericLiteral.of(codeModel, new BigDecimal("3")) + Multiplication.of( + NumericLiteral.of(codeModel, new BigDecimal("4")), + Addition.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + Subtraction.of( + NumericLiteral.of(codeModel, new BigDecimal("5")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ) + ) + ), + NumericLiteral.of(codeModel, new BigDecimal("3")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -336,17 +335,17 @@ void shouldParseNestedSectionsWithinAnExpressionCorrectly(String expr) { * Ensures that multiple sections are parsed with the correct precedence and regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "(1 + 2) * (3 - 4)", "(1+2)*(3-4)" }) - void shouldParseMultipleDistinctSectionsWithinAnExpressionWithCorrectPrecedence(String expr) { + @ValueSource(strings = {"(1 + 2) * (3 - 4)", "(1+2)*(3-4)"}) + void shouldParseMultipleDistinctSectionsWithinAnExpressionWithCorrectPrecedence(final String expr) { final var expected = Multiplication.of( - Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ), - Subtraction.of( - NumericLiteral.of(codeModel, new BigDecimal("3")), - NumericLiteral.of(codeModel, new BigDecimal("4")) - ) + Addition.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ), + Subtraction.of( + NumericLiteral.of(codeModel, new BigDecimal("3")), + NumericLiteral.of(codeModel, new BigDecimal("4")) + ) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -356,12 +355,12 @@ void shouldParseMultipleDistinctSectionsWithinAnExpressionWithCorrectPrecedence( * Ensures that double {@link Negative} are correctly parsed regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "--1", "- -1" }) - void shouldParseDoubleNegativeCorrectly(String expr) { + @ValueSource(strings = {"--1", "- -1"}) + void shouldParseDoubleNegativeCorrectly(final String expr) { final var expected = Negative.of( - Negative.of( - NumericLiteral.of(codeModel, new BigDecimal("1")) - ) + Negative.of( + NumericLiteral.of(codeModel, new BigDecimal("1")) + ) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -373,8 +372,8 @@ void shouldParseDoubleNegativeCorrectly(String expr) { @Test void shouldParseDecimalsCorrectly() { final var expected = Addition.of( - NumericLiteral.of(codeModel, new BigDecimal("1.3534")), - NumericLiteral.of(codeModel, new BigDecimal("2.7111111")) + NumericLiteral.of(codeModel, new BigDecimal("1.3534")), + NumericLiteral.of(codeModel, new BigDecimal("2.7111111")) ); final var result = parser.parse("1.3534 + 2.7111111"); assertGraph(expected, result); @@ -384,11 +383,11 @@ void shouldParseDecimalsCorrectly() { * Ensures that {@link Modulo} is correctly parsed regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "3 % 2", "3%2" }) - void shouldParseModuloCorrectly(String expr) { + @ValueSource(strings = {"3 % 2", "3%2"}) + void shouldParseModuloCorrectly(final String expr) { final var expected = Modulo.of( - NumericLiteral.of(codeModel, new BigDecimal("3")), - NumericLiteral.of(codeModel, new BigDecimal("2")) + NumericLiteral.of(codeModel, new BigDecimal("3")), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -398,11 +397,11 @@ void shouldParseModuloCorrectly(String expr) { * Ensures that {@link Exponent} is correctly parsed regardless of whitespace. */ @ParameterizedTest - @ValueSource(strings = { "3 ^ 2", "3^2" }) - void shouldParseExponentCorrectly(String expr) { + @ValueSource(strings = {"3 ^ 2", "3^2"}) + void shouldParseExponentCorrectly(final String expr) { final var expected = Exponent.of( - NumericLiteral.of(codeModel, new BigDecimal("3")), - NumericLiteral.of(codeModel, new BigDecimal("2")) + NumericLiteral.of(codeModel, new BigDecimal("3")), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -414,11 +413,11 @@ void shouldParseExponentCorrectly(String expr) { @Test void shouldParseExponentWithTheCorrectPrecedence() { final var expected = Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("3")), - Exponent.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) - ) + NumericLiteral.of(codeModel, new BigDecimal("3")), + Exponent.of( + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) + ) ); final var result = parser.parse("3 * 1 ^ 2"); assertGraph(expected, result); @@ -430,8 +429,8 @@ void shouldParseExponentWithTheCorrectPrecedence() { @Test void shouldParseSubtractionAfterEndSection() { final var expected = Subtraction.of( - NumericLiteral.of(codeModel, new BigDecimal("1")), - NumericLiteral.of(codeModel, new BigDecimal("2")) + NumericLiteral.of(codeModel, new BigDecimal("1")), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse("(1)-2"); assertGraph(expected, result); @@ -453,8 +452,8 @@ void shouldParseVariablesCorrectly() { @Test void shouldParseVariablesWithinAnExpressionCorrectly() { final var expected = Multiplication.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bob"))), - NumericLiteral.of(codeModel, new BigDecimal("5")) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bob"))), + NumericLiteral.of(codeModel, new BigDecimal("5")) ); final var result = parser.parse("[bob] * 5"); assertGraph(expected, result); @@ -466,8 +465,8 @@ void shouldParseVariablesWithinAnExpressionCorrectly() { @Test void shouldParseMinFunctionCorrectly() { final var expected = FunctionUsage.of(codeModel, FunctionName.of(IrreducibleName.of("min")), - NumericLiteral.of(codeModel, new BigDecimal("3")), - NumericLiteral.of(codeModel, new BigDecimal("5")) + NumericLiteral.of(codeModel, new BigDecimal("3")), + NumericLiteral.of(codeModel, new BigDecimal("5")) ); final var result = parser.parse("3 min 5"); assertGraph(expected, result); @@ -479,11 +478,11 @@ void shouldParseMinFunctionCorrectly() { @Test void shouldParseMaxFunctionCorrectly() { final var expected = FunctionUsage.of(codeModel, FunctionName.of(IrreducibleName.of("max")), - NumericLiteral.of(codeModel, new BigDecimal("3")), - Multiplication.of( - NumericLiteral.of(codeModel, new BigDecimal("5")), - NumericLiteral.of(codeModel, new BigDecimal("3")) - ) + NumericLiteral.of(codeModel, new BigDecimal("3")), + Multiplication.of( + NumericLiteral.of(codeModel, new BigDecimal("5")), + NumericLiteral.of(codeModel, new BigDecimal("3")) + ) ); final var result = parser.parse("3 max (5 * 3)"); assertGraph(expected, result); @@ -495,8 +494,8 @@ void shouldParseMaxFunctionCorrectly() { @Test void shouldParseAbsFunctionCorrectly() { final var expected = FunctionUsage.of(codeModel, FunctionName.of(IrreducibleName.of("abs")), - Negative.of( - NumericLiteral.of(codeModel, new BigDecimal("3"))) + Negative.of( + NumericLiteral.of(codeModel, new BigDecimal("3"))) ); final var result = parser.parse("abs -3"); assertGraph(expected, result); @@ -508,10 +507,10 @@ void shouldParseAbsFunctionCorrectly() { @Test void shouldParseAbsFunctionWithCorrectPrecedence() { final var expected = Multiplication.of( - FunctionUsage.of(codeModel, FunctionName.of(IrreducibleName.of("abs")), - Negative.of( - NumericLiteral.of(codeModel, new BigDecimal("3")))), - NumericLiteral.of(codeModel, new BigDecimal("2")) + FunctionUsage.of(codeModel, FunctionName.of(IrreducibleName.of("abs")), + Negative.of( + NumericLiteral.of(codeModel, new BigDecimal("3")))), + NumericLiteral.of(codeModel, new BigDecimal("2")) ); final var result = parser.parse("abs -3 * 2"); assertGraph(expected, result); @@ -521,8 +520,8 @@ void shouldParseAbsFunctionWithCorrectPrecedence() { * Ensures that incomplete expressions throw an {@link ExpressionParserException}. */ @ParameterizedTest - @ValueSource(strings = { "(1 + 2", "1 +", "-" }) - void shouldThrowOnMalformedExpression(String expr) { + @ValueSource(strings = {"(1 + 2", "1 +", "-"}) + void shouldThrowOnMalformedExpression(final String expr) { final var exception = assertThrows(ExpressionParserException.class, () -> parser.parse(expr)); assertEquals("The expression is malformed", exception.getMessage()); } @@ -532,7 +531,7 @@ void shouldThrowOnMalformedExpression(String expr) { */ @ParameterizedTest @MethodSource("provideStringsForShouldThrowOnUnknownToken") - void shouldThrowOnUnknownToken(String expr, int location) { + void shouldThrowOnUnknownToken(final String expr, final int location) { final var exception = assertThrows(ExpressionParserException.class, () -> parser.parse(expr)); assertEquals("The expression contains an unknown or unexpected token at Location 1:" + location, exception.getMessage()); } @@ -543,8 +542,8 @@ void shouldThrowOnUnknownToken(String expr, int location) { @Test void shouldCorrectlyParseExpression_1_Issue_263() { final var expected = AnyInCommon.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) ); final var result = parser.parse("[this] ac [instances]"); assertGraph(expected, result); @@ -554,11 +553,11 @@ void shouldCorrectlyParseExpression_1_Issue_263() { * Ensures that expressions containing 'less than' tokens ('lt' or '<') are parsed correctly. */ @ParameterizedTest - @ValueSource(strings = { "[this] lt [instances]", "[this] < [instances]" }) - void shouldCorrectlyParseExpression_2_lt_Issue_263(String expr) { + @ValueSource(strings = {"[this] lt [instances]", "[this] < [instances]"}) + void shouldCorrectlyParseExpression_2_lt_Issue_263(final String expr) { final var expected = LessThan.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -568,11 +567,11 @@ void shouldCorrectlyParseExpression_2_lt_Issue_263(String expr) { * Ensures that expressions containing 'less than or equal to' token ('le' or '<=') are parsed correctly. */ @ParameterizedTest - @ValueSource(strings = { "[this] le [instances]", "[this] <= [instances]" }) - void shouldCorrectlyParseExpression_2_le_Issue_263(String expr) { + @ValueSource(strings = {"[this] le [instances]", "[this] <= [instances]"}) + void shouldCorrectlyParseExpression_2_le_Issue_263(final String expr) { final var expected = LessThanOrEqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -582,11 +581,11 @@ void shouldCorrectlyParseExpression_2_le_Issue_263(String expr) { * Ensures that expressions containing 'greater than' tokens ('gt' or '>') are parsed correctly. */ @ParameterizedTest - @ValueSource(strings = { "[this] gt [instances]", "[this] > [instances]" }) - void shouldCorrectlyParseExpression_2_gt_Issue_263(String expr) { + @ValueSource(strings = {"[this] gt [instances]", "[this] > [instances]"}) + void shouldCorrectlyParseExpression_2_gt_Issue_263(final String expr) { final var expected = GreaterThan.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -596,11 +595,11 @@ void shouldCorrectlyParseExpression_2_gt_Issue_263(String expr) { * Ensures that expressions containing 'greater than or equal to' token ('ge' or '>=') are parsed correctly. */ @ParameterizedTest - @ValueSource(strings = { "[this] ge [instances]", "[this] >= [instances]" }) - void shouldCorrectlyParseExpression_2_ge_Issue_263(String expr) { + @ValueSource(strings = {"[this] ge [instances]", "[this] >= [instances]"}) + void shouldCorrectlyParseExpression_2_ge_Issue_263(final String expr) { final var expected = GreaterThanOrEqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instances"))) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -612,13 +611,13 @@ void shouldCorrectlyParseExpression_2_ge_Issue_263(String expr) { @Test void shouldCorrectlyParseExpression_3_Issue_263() { final var expected = Conjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bem process"))), - Negation.of( - LessThanOrEqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bem process"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bem processes"))) - ) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bem process"))), + Negation.of( + LessThanOrEqualTo.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bem process"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("bem processes"))) ) + ) ); final var result = parser.parse("[bem process] and not ([bem process] le [bem processes])"); assertGraph(expected, result); @@ -628,11 +627,11 @@ void shouldCorrectlyParseExpression_3_Issue_263() { * Ensures that expressions containing 'equal to' tokens ('eq' or '==') are parsed correctly. */ @ParameterizedTest - @ValueSource(strings = { "[this] eq [instance parm]", "[this] == [instance parm]" }) - void shouldCorrectlyParseExpression_4a_Issue_263(String expr) { + @ValueSource(strings = {"[this] eq [instance parm]", "[this] == [instance parm]"}) + void shouldCorrectlyParseExpression_4a_Issue_263(final String expr) { final var expected = EqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instance parm"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instance parm"))) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -642,11 +641,11 @@ void shouldCorrectlyParseExpression_4a_Issue_263(String expr) { * Ensures that expressions containing 'not equal to' tokens ('ne' or '!=') are parsed correctly. */ @ParameterizedTest - @ValueSource(strings = { "[this] ne [instance parm]", "[this] != [instance parm]" }) - void shouldCorrectlyParseExpression_4b_Issue_263(String expr) { + @ValueSource(strings = {"[this] ne [instance parm]", "[this] != [instance parm]"}) + void shouldCorrectlyParseExpression_4b_Issue_263(final String expr) { final var expected = NotEqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instance parm"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("this"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instance parm"))) ); final var result = parser.parse(expr); assertGraph(expected, result); @@ -658,19 +657,19 @@ void shouldCorrectlyParseExpression_4b_Issue_263(String expr) { @Test void shouldCorrectlyParseExpression_5_Issue_263() { final var expected = Disjunction.of( + Disjunction.of( Disjunction.of( - Disjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("sub interest"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("all parms"))) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("is parm possible"))) - ) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("sub interest"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("all parms"))) ), - AnyInCommon.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("work data parm"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("parms for method"))) + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("is parm possible"))) ) + ), + AnyInCommon.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("work data parm"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("parms for method"))) + ) ); final var result = parser.parse("[sub interest] or [all parms] or (not [is parm possible]) or ([work data parm] ac [parms for method])"); assertGraph(expected, result); @@ -682,65 +681,65 @@ void shouldCorrectlyParseExpression_5_Issue_263() { @Test void shouldCorrectlyParseExpression_6_Issue_263() { final var expected = Disjunction.of( - Disjunction.of( + Disjunction.of( + Conjunction.of( + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method for class"))) + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method implements for class"))) + ) + ), + Conjunction.of( + Conjunction.of( Conjunction.of( + Conjunction.of( Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method for class"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method for class"))) ), Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method implements for class"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("not check use method"))) ) + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method implements method"))) + ) ), - Conjunction.of( - Conjunction.of( - Conjunction.of( - Conjunction.of( - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method for class"))) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("not check use method"))) - ) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method implements method"))) - ) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method implemented by Method"))) - ) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("mes in use"))) - ) + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method implemented by Method"))) ) - ), + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("mes in use"))) + ) + ) + ), + Conjunction.of( Conjunction.of( + Conjunction.of( Conjunction.of( - Conjunction.of( - Conjunction.of( - Conjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method for class"))), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("not check use method"))) - ) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("mes in use"))) - ) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("implements methods other than self"))) - ) - ), + Conjunction.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method for class"))), Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method referenced by yp"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("not check use method"))) ) + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("mes in use"))) + ) ), Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("referenced by override conversion mapping"))) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("implements methods other than self"))) ) + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("method referenced by yp"))) + ) + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("referenced by override conversion mapping"))) ) + ) ); final var result = parser.parse("(not [method for class] and not [method implements for class]) or(not [method for class] and (not [not check use method]) and (not [method implements method]) and (not [method implemented by Method]) and (not [mes in use]))or ([method for class] and (not [not check use method]) and (not [mes in use]) and (not [implements methods other than self]) and (not [method referenced by yp])) and not [referenced by override conversion mapping]"); assertGraph(expected, result); @@ -752,16 +751,16 @@ void shouldCorrectlyParseExpression_6_Issue_263() { @Test void shouldCorrectlyParseExpression_7_Issue_263() { final var expected = Disjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("removes not enterable or rto or dapt"))), - Conjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("removes do not show"))), - Negation.of( - Disjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("ec not enterable"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("ec as page title"))) - ) - ) + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("removes not enterable or rto or dapt"))), + Conjunction.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("removes do not show"))), + Negation.of( + Disjunction.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("ec not enterable"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("ec as page title"))) + ) ) + ) ); final var result = parser.parse("[removes not enterable or rto or dapt] or ([removes do not show] and not ([ec not enterable] or [ec as page title]))"); assertGraph(expected, result); @@ -773,134 +772,134 @@ void shouldCorrectlyParseExpression_7_Issue_263() { @Test void shouldCorrectlyParseExpression_8_Issue_263() { final var result = parser.parse("[existing supplier] " + - "and " + - "(( [Accepted Currencies on element] eq [Accepted Currencies persisted] ) or not [Accepted Currencies was submitted]) " + - "and " + - "(( [Always Separate Payments on element] eq [Always Separate Payments persisted] ) or not [Always Separate Payments was submitted]) " + - "and " + - "( [Supplier Name on element] eq [Supplier Name persisted] ) " + - "and " + - "(( [Business Entity External ID on element] eq [Business Entity External ID persisted] ) or not [Business Entity External ID was submitted] ) " + - "and " + - "(( [Basic Worktag Only on element] eq [Basic Worktag Only persisted] ) or not [Basic Worktag Only was submitted] ) " + - "and " + - "(( [Certificate Number on element] eq [Certificate Number persisted] ) or not [Certificate Number was submitted] ) " + - "and " + - "(( [Certifier on element] eq [Certifier persisted] ) or not [Certifier was submitted] ) " + - "and " + - "(( [Suppliers Customer Account Number on element] eq [Suppliers Customer Account Number persisted] ) or not [Suppliers Customer Account Number was submitted] ) " + - "and " + - "(( [Disable Change Order on element] eq [Disable Change Order persisted] ) or not [Disable Change Order was submitted] ) " + - "and " + - "(( [Do Not Pay During Bank Account Updates on element] eq [Do Not Pay During Bank Account Updates persisted] ) or not [Do Not Pay During Bank Account Updates was submitted] ) " + - "and " + - "(( [Do Not Reimburse Contingent Worker Expense Reports on element] eq [Do Not Reimburse Contingent Worker Expense Reports persisted] ) or not [Do Not Reimburse Contingent Worker Expense Reports was submitted] ) " + - "and " + - "(( [DUNS Number on element] eq [DUNS Number persisted] ) or not [DUNS Number was submitted] ) " + - "and " + - "(( [Unique Entity Identifier on element] eq [Unique Entity Identifier persisted] ) or not [Unique Entity Identifier was submitted] ) " + - "and " + - "(( [FATCA on element] eq [FATCA persisted] ) or not [FATCA was submitted] ) " + - "and " + - "(( [Exclude Freight for Discount Calculation on element] eq [Exclude Freight for Discount Calculation persisted] ) or not [Exclude Freight for Discount Calculation was submitted] ) " + - "and " + - "(( [Exclude Other for Discount Calculation on element] eq [Exclude Other for Discount Calculation persisted] ) or not [Exclude Other for Discount Calculation was submitted] ) " + - "and " + - "(( [Exclude Tax for Discount Calculation on element] eq [Exclude Tax for Discount Calculation persisted] ) or not [Exclude Tax for Discount Calculation was submitted] ) " + - "and " + - "(( [Supplier ID on element] eq [Supplier ID persisted] ) or not [Supplier ID was submitted] ) " + - "and " + - "(( [Invoice Any Supplier on element] eq [Invoice Any Supplier persisted] ) or not [Invoice Any Supplier was submitted] ) " + - "and " + - "(( [MBE/WMBE Business on element] eq [MBE/WMBE Business persisted] ) or not [MBE/WMBE Business was submitted] ) " + - "and " + - "(( [Supplier Payment Memo on element] eq [Supplier Payment Memo persisted] ) or not [Supplier Payment Memo was submitted] ) " + - "and " + - "(( [ID on element] eq [ID persisted] ) or not [ID was submitted] ) " + - "and " + - "(( [Report 1099 MISC with Parent on element] eq [Report 1099 MISC with Parent persisted] ) or not [Report 1099 MISC with Parent was submitted] ) " + - "and " + - "(( [Use Invoice Memo on element] eq [Use Invoice Memo persisted] ) or not [Use Invoice Memo was submitted] ) " + - "and " + - "(( [Use Supplier Connection Memo on element] eq [Use Supplier Connection Memo persisted] ) or not [Use Supplier Connection Memo was submitted] ) " + - "and " + - "(( [Use Supplier Reference on element] eq [Use Supplier Reference persisted] ) or not [Use Supplier Reference was submitted] ) " + - "and " + - "(( [Tax Document Date on element] eq [Tax Document Date persisted] ) or not [Tax Document Date was submitted] ) " + - "and " + - "(( [Certificate of Insurance Date on element] eq [Certificate of Insurance Date persisted] ) or not [Certificate of Insurance Date was submitted] ) " + - "and " + - "(( [Certification Expiration Date on element] eq [Certification Expiration Date persisted] ) or not [Certification Expiration Date was submitted] ) " + - "and " + - "(( [Companies and Company Hierarchies on element] eq [Companies and Company Hierarchies persisted] ) or not [Companies and Company Hierarchies was submitted] ) " + - "and " + - "(( [Approval Status on element] eq [Approval Status persisted] ) or not [Approval Status was submitted] ) " + - "and " + - "(( [Tax Authority Form Type on element] eq [Tax Authority Form Type persisted] ) or not [Tax Authority Form Type was submitted] ) " + - "and " + - "(( [Supplier Category on element] eq [Supplier Category persisted] ) or not [Supplier Category was submitted] ) " + - "and " + - "(( [Supplier Group on element] eq [Supplier Group persisted] ) or not [Supplier Group was submitted] ) " + - "and " + - "(( [Default Tax Code on element] eq [Default Tax Code persisted] ) or not [Default Tax Code was submitted] ) " + - "and " + - "(( [Withholding Tax Code on element] eq [Withholding Tax Code persisted] ) or not [Withholding Tax Code was submitted] ) " + - "and " + - "(( [Purchase Order Issue Option on element] eq [Purchase Order Issue Option persisted] ) or not [Purchase Order Issue Option was submitted] ) " + - "and " + - "(( [Multi-Supplier Supplier Link for PO Issue on element] eq [Multi-Supplier Supplier Link for PO Issue persisted] ) or not [Multi-Supplier Supplier Link for PO Issue was submitted] ) " + - "and " + - "(( [Shipping Terms on element] eq [Shipping Terms persisted] ) or not [Shipping Terms was submitted] ) " + - "and " + - "(( [Shipping Method on element] eq [Shipping Method persisted] ) or not [Shipping Method was submitted] ) " + - "and " + - "(( [Default Payment Terms on element] eq [Default Payment Terms persisted] ) or not [Default Payment Terms was submitted] ) " + - "and " + - "(( [Payment Type on element] eq [Payment Type persisted] ) or not [Payment Type was submitted] ) " + - "and " + - "(( [Default Payment Type on element] eq [Default Payment Type persisted] ) or not [Default Payment Type was submitted] ) " + - "and " + - "(( [Worker Credit Card on element] eq [Worker Credit Card persisted] ) or not [Worker Credit Card was submitted] ) " + - "and " + - "(( [Suppliers as Children on element] eq [Suppliers as Children persisted] ) or not [Suppliers as Children was submitted] ) " + - "and " + - "(( [Proposed Suppliers as Children on element] eq [Proposed Suppliers as Children persisted] ) or not [Proposed Suppliers as Children was submitted] ) " + - "and " + - "(( [Default Currency on element] eq [Default Currency persisted] ) or not [Default Currency was submitted] ) " + - "and " + - "(( [Integration System on element] eq [Integration System persisted] ) or not [Integration System was submitted] ) " + - "and " + - "(( [Spend Category or Hierarchy on element] eq [Spend Category or Hierarchy persisted] ) or not [Spend Category or Hierarchy was submitted] ) " + - "and " + - "(( [Taxpayer ID Number Type on element] eq [Taxpayer ID Number Type persisted] ) or not [Taxpayer ID Number Type was submitted] ) " + - "and " + - "(( [Deprecated 1099 Payee on element] eq [Deprecated 1099 Payee persisted] ) or not [Deprecated 1099 Payee was submitted] ) " + - "and " + - "(( [Default Additional Reference Type on element] eq [Default Additional Reference Type persisted] ) or not " + - "[Default Additional Reference Type was submitted] ) " + - "and " + - "(( [Default Spend Category on element] eq [Default Spend Category persisted] ) or not " + - "[Default Spend Category was submitted] ) " + - "and " + - "(( [Supplier Minimum Order Amount on element] eq [Supplier Minimum Order Amount persisted] ) or not [Supplier Minimum Order Amount was submitted] ) " + - "and " + - "(( [Minimum Order Amount Currency on element] eq [Minimum Order Amount Currency persisted] ) or not [Minimum Order Amount Currency was submitted] ) " + - "and " + - "(( [Change Order Issue Option on element] eq [Change Order Issue Option persisted] ) or not [Change Order Issue Option was submitted] ) " + - "and " + - "(( [Supplier Change Source on element] eq [Supplier Change Source persisted] ) or not [Supplier Change Source was submitted] ) " + - "and " + - "(( [Edit Portal Taxes on element] eq [Edit Portal Taxes persisted] ) or not [Edit Portal Taxes was submitted] ) " + - "and " + - "(( [Supplier Note Follow-Up Date on element] eq [Supplier Note Follow-Up Date persisted] ) or not [Supplier Note Follow-Up Date was submitted] ) " + - "and " + - "(( [Default Procurement Item on element] eq [Default Procurement Item persisted] ) or not " + - "[Default Procurement Item was submitted] ) " + - "and " + - "(( [Payment Terms Based on Invoice Received Date on element] eq [Payment Terms Based on Invoice Received Date Persisted] ) or not " + - "[Payment Terms Based on Invoice Received Date was submitted] ) " + - "and " + - "([Restricted Companies for Supplier Contacts are Not Changed or Not Submitted] )"); + "and " + + "(( [Accepted Currencies on element] eq [Accepted Currencies persisted] ) or not [Accepted Currencies was submitted]) " + + "and " + + "(( [Always Separate Payments on element] eq [Always Separate Payments persisted] ) or not [Always Separate Payments was submitted]) " + + "and " + + "( [Supplier Name on element] eq [Supplier Name persisted] ) " + + "and " + + "(( [Business Entity External ID on element] eq [Business Entity External ID persisted] ) or not [Business Entity External ID was submitted] ) " + + "and " + + "(( [Basic Worktag Only on element] eq [Basic Worktag Only persisted] ) or not [Basic Worktag Only was submitted] ) " + + "and " + + "(( [Certificate Number on element] eq [Certificate Number persisted] ) or not [Certificate Number was submitted] ) " + + "and " + + "(( [Certifier on element] eq [Certifier persisted] ) or not [Certifier was submitted] ) " + + "and " + + "(( [Suppliers Customer Account Number on element] eq [Suppliers Customer Account Number persisted] ) or not [Suppliers Customer Account Number was submitted] ) " + + "and " + + "(( [Disable Change Order on element] eq [Disable Change Order persisted] ) or not [Disable Change Order was submitted] ) " + + "and " + + "(( [Do Not Pay During Bank Account Updates on element] eq [Do Not Pay During Bank Account Updates persisted] ) or not [Do Not Pay During Bank Account Updates was submitted] ) " + + "and " + + "(( [Do Not Reimburse Contingent Worker Expense Reports on element] eq [Do Not Reimburse Contingent Worker Expense Reports persisted] ) or not [Do Not Reimburse Contingent Worker Expense Reports was submitted] ) " + + "and " + + "(( [DUNS Number on element] eq [DUNS Number persisted] ) or not [DUNS Number was submitted] ) " + + "and " + + "(( [Unique Entity Identifier on element] eq [Unique Entity Identifier persisted] ) or not [Unique Entity Identifier was submitted] ) " + + "and " + + "(( [FATCA on element] eq [FATCA persisted] ) or not [FATCA was submitted] ) " + + "and " + + "(( [Exclude Freight for Discount Calculation on element] eq [Exclude Freight for Discount Calculation persisted] ) or not [Exclude Freight for Discount Calculation was submitted] ) " + + "and " + + "(( [Exclude Other for Discount Calculation on element] eq [Exclude Other for Discount Calculation persisted] ) or not [Exclude Other for Discount Calculation was submitted] ) " + + "and " + + "(( [Exclude Tax for Discount Calculation on element] eq [Exclude Tax for Discount Calculation persisted] ) or not [Exclude Tax for Discount Calculation was submitted] ) " + + "and " + + "(( [Supplier ID on element] eq [Supplier ID persisted] ) or not [Supplier ID was submitted] ) " + + "and " + + "(( [Invoice Any Supplier on element] eq [Invoice Any Supplier persisted] ) or not [Invoice Any Supplier was submitted] ) " + + "and " + + "(( [MBE/WMBE Business on element] eq [MBE/WMBE Business persisted] ) or not [MBE/WMBE Business was submitted] ) " + + "and " + + "(( [Supplier Payment Memo on element] eq [Supplier Payment Memo persisted] ) or not [Supplier Payment Memo was submitted] ) " + + "and " + + "(( [ID on element] eq [ID persisted] ) or not [ID was submitted] ) " + + "and " + + "(( [Report 1099 MISC with Parent on element] eq [Report 1099 MISC with Parent persisted] ) or not [Report 1099 MISC with Parent was submitted] ) " + + "and " + + "(( [Use Invoice Memo on element] eq [Use Invoice Memo persisted] ) or not [Use Invoice Memo was submitted] ) " + + "and " + + "(( [Use Supplier Connection Memo on element] eq [Use Supplier Connection Memo persisted] ) or not [Use Supplier Connection Memo was submitted] ) " + + "and " + + "(( [Use Supplier Reference on element] eq [Use Supplier Reference persisted] ) or not [Use Supplier Reference was submitted] ) " + + "and " + + "(( [Tax Document Date on element] eq [Tax Document Date persisted] ) or not [Tax Document Date was submitted] ) " + + "and " + + "(( [Certificate of Insurance Date on element] eq [Certificate of Insurance Date persisted] ) or not [Certificate of Insurance Date was submitted] ) " + + "and " + + "(( [Certification Expiration Date on element] eq [Certification Expiration Date persisted] ) or not [Certification Expiration Date was submitted] ) " + + "and " + + "(( [Companies and Company Hierarchies on element] eq [Companies and Company Hierarchies persisted] ) or not [Companies and Company Hierarchies was submitted] ) " + + "and " + + "(( [Approval Status on element] eq [Approval Status persisted] ) or not [Approval Status was submitted] ) " + + "and " + + "(( [Tax Authority Form Type on element] eq [Tax Authority Form Type persisted] ) or not [Tax Authority Form Type was submitted] ) " + + "and " + + "(( [Supplier Category on element] eq [Supplier Category persisted] ) or not [Supplier Category was submitted] ) " + + "and " + + "(( [Supplier Group on element] eq [Supplier Group persisted] ) or not [Supplier Group was submitted] ) " + + "and " + + "(( [Default Tax Code on element] eq [Default Tax Code persisted] ) or not [Default Tax Code was submitted] ) " + + "and " + + "(( [Withholding Tax Code on element] eq [Withholding Tax Code persisted] ) or not [Withholding Tax Code was submitted] ) " + + "and " + + "(( [Purchase Order Issue Option on element] eq [Purchase Order Issue Option persisted] ) or not [Purchase Order Issue Option was submitted] ) " + + "and " + + "(( [Multi-Supplier Supplier Link for PO Issue on element] eq [Multi-Supplier Supplier Link for PO Issue persisted] ) or not [Multi-Supplier Supplier Link for PO Issue was submitted] ) " + + "and " + + "(( [Shipping Terms on element] eq [Shipping Terms persisted] ) or not [Shipping Terms was submitted] ) " + + "and " + + "(( [Shipping Method on element] eq [Shipping Method persisted] ) or not [Shipping Method was submitted] ) " + + "and " + + "(( [Default Payment Terms on element] eq [Default Payment Terms persisted] ) or not [Default Payment Terms was submitted] ) " + + "and " + + "(( [Payment Type on element] eq [Payment Type persisted] ) or not [Payment Type was submitted] ) " + + "and " + + "(( [Default Payment Type on element] eq [Default Payment Type persisted] ) or not [Default Payment Type was submitted] ) " + + "and " + + "(( [Worker Credit Card on element] eq [Worker Credit Card persisted] ) or not [Worker Credit Card was submitted] ) " + + "and " + + "(( [Suppliers as Children on element] eq [Suppliers as Children persisted] ) or not [Suppliers as Children was submitted] ) " + + "and " + + "(( [Proposed Suppliers as Children on element] eq [Proposed Suppliers as Children persisted] ) or not [Proposed Suppliers as Children was submitted] ) " + + "and " + + "(( [Default Currency on element] eq [Default Currency persisted] ) or not [Default Currency was submitted] ) " + + "and " + + "(( [Integration System on element] eq [Integration System persisted] ) or not [Integration System was submitted] ) " + + "and " + + "(( [Spend Category or Hierarchy on element] eq [Spend Category or Hierarchy persisted] ) or not [Spend Category or Hierarchy was submitted] ) " + + "and " + + "(( [Taxpayer ID Number Type on element] eq [Taxpayer ID Number Type persisted] ) or not [Taxpayer ID Number Type was submitted] ) " + + "and " + + "(( [Deprecated 1099 Payee on element] eq [Deprecated 1099 Payee persisted] ) or not [Deprecated 1099 Payee was submitted] ) " + + "and " + + "(( [Default Additional Reference Type on element] eq [Default Additional Reference Type persisted] ) or not " + + "[Default Additional Reference Type was submitted] ) " + + "and " + + "(( [Default Spend Category on element] eq [Default Spend Category persisted] ) or not " + + "[Default Spend Category was submitted] ) " + + "and " + + "(( [Supplier Minimum Order Amount on element] eq [Supplier Minimum Order Amount persisted] ) or not [Supplier Minimum Order Amount was submitted] ) " + + "and " + + "(( [Minimum Order Amount Currency on element] eq [Minimum Order Amount Currency persisted] ) or not [Minimum Order Amount Currency was submitted] ) " + + "and " + + "(( [Change Order Issue Option on element] eq [Change Order Issue Option persisted] ) or not [Change Order Issue Option was submitted] ) " + + "and " + + "(( [Supplier Change Source on element] eq [Supplier Change Source persisted] ) or not [Supplier Change Source was submitted] ) " + + "and " + + "(( [Edit Portal Taxes on element] eq [Edit Portal Taxes persisted] ) or not [Edit Portal Taxes was submitted] ) " + + "and " + + "(( [Supplier Note Follow-Up Date on element] eq [Supplier Note Follow-Up Date persisted] ) or not [Supplier Note Follow-Up Date was submitted] ) " + + "and " + + "(( [Default Procurement Item on element] eq [Default Procurement Item persisted] ) or not " + + "[Default Procurement Item was submitted] ) " + + "and " + + "(( [Payment Terms Based on Invoice Received Date on element] eq [Payment Terms Based on Invoice Received Date Persisted] ) or not " + + "[Payment Terms Based on Invoice Received Date was submitted] ) " + + "and " + + "([Restricted Companies for Supplier Contacts are Not Changed or Not Submitted] )"); // Note that we do not verify the parsed expression result as it is too large to be practical. // Instead, we check that the expression was parsed without error, and returned a non-null result. assertNotNull(result); @@ -912,32 +911,32 @@ void shouldCorrectlyParseExpression_8_Issue_263() { @Test void shouldCorrectlyParseExpression_9_Issue_263() { final var expected = Disjunction.of( - Conjunction.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("isMeasureExpression"))), - Disjunction.of( - AnyInCommon.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("thisInstance"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("calculation")) - ) - ), - AnyInCommon.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("thisInstance"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("constant")) - ) - ) + Conjunction.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("isMeasureExpression"))), + Disjunction.of( + AnyInCommon.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("thisInstance"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("calculation")) ) - ), - Conjunction.of( - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("isMeasureExpression")) - ) - ), - AnyInCommon.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("thisInstance"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("calculation")) - ) + ), + AnyInCommon.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("thisInstance"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("constant")) ) + ) ) + ), + Conjunction.of( + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("isMeasureExpression")) + ) + ), + AnyInCommon.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("thisInstance"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("calculation")) + ) + ) + ) ); final var result = parser.parse("( ([isMeasureExpression]) and (([thisInstance] ac [calculation]) or ([thisInstance] ac [constant])) ) or (not ([isMeasureExpression]) and ([thisInstance] ac [calculation]) )"); assertGraph(expected, result); @@ -949,13 +948,13 @@ void shouldCorrectlyParseExpression_9_Issue_263() { @Test void shouldCorrectlyParseExpression_10_Issue_263() { final var expected = Disjunction.of( - EqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("external association by name"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("current external association"))) - ), - Negation.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("external association by name"))) - ) + EqualTo.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("external association by name"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("current external association"))) + ), + Negation.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("external association by name"))) + ) ); final var result = parser.parse("([external association by name] eq [current external association]) or not [external association by name]"); assertGraph(expected, result); @@ -967,14 +966,14 @@ void shouldCorrectlyParseExpression_10_Issue_263() { @Test void shouldCorrectlyParseExpression_11_Issue_263() { final var expected = Conjunction.of( - EqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Top Level of this Level"))), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Top Level parm"))) - ), - NotEqualTo.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Level"))) - , VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Top Level parm"))) - ) + EqualTo.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Top Level of this Level"))), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Top Level parm"))) + ), + NotEqualTo.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Level"))) + , VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("Top Level parm"))) + ) ); final var result = parser.parse("([Top Level of this Level] eq [Top Level parm]) and ([Level] ne [Top Level parm])"); assertGraph(expected, result); @@ -982,19 +981,19 @@ void shouldCorrectlyParseExpression_11_Issue_263() { private static Stream provideStringsForShouldThrowOnUnknownToken() { return Stream.of( - Arguments.of("1 + 2 # 3", 7), - Arguments.of("1 thing 2", 3), - Arguments.of("{1 + 1}", 1), - Arguments.of("1 + 2)", 6), - Arguments.of("(1 + 2))", 8), - Arguments.of("1 2", 3) + Arguments.of("1 + 2 # 3", 7), + Arguments.of("1 thing 2", 3), + Arguments.of("{1 + 1}", 1), + Arguments.of("1 + 2)", 6), + Arguments.of("(1 + 2))", 8), + Arguments.of("1 2", 3) ); } - private void assertGraph(Expression expected, Expression actual) { + private void assertGraph(final Expression expected, final Expression actual) { - var expectedClass = expected.getClass(); - var actualClass = actual.getClass(); + final var expectedClass = expected.getClass(); + final var actualClass = actual.getClass(); if (!expectedClass.isAssignableFrom(actualClass)) { throw new RuntimeException("Unmatched node"); @@ -1004,27 +1003,22 @@ private void assertGraph(Expression expected, Expression actual) { final var rightMethod = safeGetMethod(expectedClass, "right"); if (leftMethod != null && rightMethod != null) { - try - { - assertGraph((Expression)leftMethod.invoke(expected), (Expression)leftMethod.invoke(actual)); - assertGraph((Expression)rightMethod.invoke(expected), (Expression)rightMethod.invoke(actual)); - } - catch (Exception e) { + try { + assertGraph((Expression) leftMethod.invoke(expected), (Expression) leftMethod.invoke(actual)); + assertGraph((Expression) rightMethod.invoke(expected), (Expression) rightMethod.invoke(actual)); + } catch (final Exception e) { throw new RuntimeException("Unmatched node"); } return; - } - else if (leftMethod != null || rightMethod != null) { + } else if (leftMethod != null || rightMethod != null) { throw new RuntimeException("Unmatched node"); } final var expressionMethod = safeGetMethod(expectedClass, "expression"); if (expressionMethod != null) { - try - { - assertGraph((Expression)expressionMethod.invoke(expected), (Expression)expressionMethod.invoke(actual)); - } - catch (Exception e) { + try { + assertGraph((Expression) expressionMethod.invoke(expected), (Expression) expressionMethod.invoke(actual)); + } catch (final Exception e) { throw new RuntimeException("Unmatched node"); } return; @@ -1037,24 +1031,21 @@ else if (leftMethod != null || rightMethod != null) { final var actualArgs = actualFunction.arguments().toArray(); assertEquals(expectedArgs.length, actualArgs.length); for (var i = 0; i < expectedArgs.length - 1; i++) { - assertGraph((Expression)expectedArgs[i], (Expression)actualArgs[i]); + assertGraph((Expression) expectedArgs[i], (Expression) actualArgs[i]); } } - } - else if (expected instanceof Literal || + } else if (expected instanceof Literal || expected instanceof VariableUsage) { assertEquals(expected, actual); - } - else { + } else { throw new RuntimeException("Unmatched node"); } } - private Method safeGetMethod(Class clazz, String methodName) { + private Method safeGetMethod(final Class clazz, final String methodName) { try { return clazz.getMethod(methodName); - } - catch (NoSuchMethodException e) { + } catch (final NoSuchMethodException e) { return null; } } diff --git a/expression-codemodel/src/test/java/build/codemodel/expression/parsing/TemplateParserTests.java b/expression-codemodel/src/test/java/build/codemodel/expression/parsing/TemplateParserTests.java index c15ab6f..46390dd 100644 --- a/expression-codemodel/src/test/java/build/codemodel/expression/parsing/TemplateParserTests.java +++ b/expression-codemodel/src/test/java/build/codemodel/expression/parsing/TemplateParserTests.java @@ -10,14 +10,13 @@ import build.codemodel.foundation.naming.CachingNameProvider; import build.codemodel.foundation.naming.IrreducibleName; import build.codemodel.foundation.naming.NonCachingNameProvider; - -import java.util.Optional; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import java.util.List; +import java.util.Optional; import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -53,7 +52,7 @@ static void init() { */ @ParameterizedTest @MethodSource("templateAndParsedProvider") - void shouldCorrectlyParseTemplateExpressions(String expression, List expected) { + void shouldCorrectlyParseTemplateExpressions(final String expression, final List expected) { final var result = parser.parse(expression); assertNotNull(result); @@ -68,44 +67,44 @@ static Stream templateAndParsedProvider() { final var javaNameProvider = new CachingNameProvider(new NonCachingNameProvider()); final var codeModel = new ConceptualCodeModel(javaNameProvider); return Stream.of( - Arguments.arguments("some text", List.of(StringLiteral.of(codeModel, "some text"))), - Arguments.arguments("[[]", List.of(StringLiteral.of(codeModel, "[]"))), - Arguments.arguments(":[[", List.of(StringLiteral.of(codeModel, ":["))), - Arguments.arguments("[[\\[[\\]]+", List.of(StringLiteral.of(codeModel, "[\\[\\]]+"))), - Arguments.arguments("[[ [variable] ]", List.of( - StringLiteral.of(codeModel, "[ "), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("variable"))), - StringLiteral.of(codeModel, " ]"))), - Arguments.arguments("\"", List.of(StringLiteral.of(codeModel, "\""))), - Arguments.arguments("\"[[[variable]]\"", List.of( - StringLiteral.of(codeModel, "\"["), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("variable"))), - StringLiteral.of(codeModel, "]\""))), - Arguments.arguments("'[[[variable]]'", List.of( - StringLiteral.of(codeModel, "'["), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("variable"))), - StringLiteral.of(codeModel, "]'"))), - Arguments.arguments("[template]:[expression]", List.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("template"))), - StringLiteral.of(codeModel, ":"), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("expression"))))), - Arguments.arguments("[[template]:[expression]", List.of( - StringLiteral.of(codeModel, "[template]:"), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("expression"))))), - Arguments.arguments("[[[template]:[expression]", List.of( - StringLiteral.of(codeModel, "["), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("template"))), - StringLiteral.of(codeModel, ":"), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("expression"))))), - Arguments.arguments("[instance] ([class])", List.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instance"))), - StringLiteral.of(codeModel, " ("), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("class"))), - StringLiteral.of(codeModel, ")"))), - Arguments.arguments("[prev]\n[curr]", List.of( - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("prev"))), - StringLiteral.of(codeModel, "\n"), - VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("curr"))))) + Arguments.arguments("some text", List.of(StringLiteral.of(codeModel, "some text"))), + Arguments.arguments("[[]", List.of(StringLiteral.of(codeModel, "[]"))), + Arguments.arguments(":[[", List.of(StringLiteral.of(codeModel, ":["))), + Arguments.arguments("[[\\[[\\]]+", List.of(StringLiteral.of(codeModel, "[\\[\\]]+"))), + Arguments.arguments("[[ [variable] ]", List.of( + StringLiteral.of(codeModel, "[ "), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("variable"))), + StringLiteral.of(codeModel, " ]"))), + Arguments.arguments("\"", List.of(StringLiteral.of(codeModel, "\""))), + Arguments.arguments("\"[[[variable]]\"", List.of( + StringLiteral.of(codeModel, "\"["), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("variable"))), + StringLiteral.of(codeModel, "]\""))), + Arguments.arguments("'[[[variable]]'", List.of( + StringLiteral.of(codeModel, "'["), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("variable"))), + StringLiteral.of(codeModel, "]'"))), + Arguments.arguments("[template]:[expression]", List.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("template"))), + StringLiteral.of(codeModel, ":"), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("expression"))))), + Arguments.arguments("[[template]:[expression]", List.of( + StringLiteral.of(codeModel, "[template]:"), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("expression"))))), + Arguments.arguments("[[[template]:[expression]", List.of( + StringLiteral.of(codeModel, "["), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("template"))), + StringLiteral.of(codeModel, ":"), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("expression"))))), + Arguments.arguments("[instance] ([class])", List.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("instance"))), + StringLiteral.of(codeModel, " ("), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("class"))), + StringLiteral.of(codeModel, ")"))), + Arguments.arguments("[prev]\n[curr]", List.of( + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("prev"))), + StringLiteral.of(codeModel, "\n"), + VariableUsage.of(codeModel, VariableName.of(IrreducibleName.of("curr"))))) ); } } diff --git a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/AbstractHierarchicalCodeModel.java b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/AbstractHierarchicalCodeModel.java index 9ea1c62..7c62b01 100644 --- a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/AbstractHierarchicalCodeModel.java +++ b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/AbstractHierarchicalCodeModel.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -88,11 +88,11 @@ protected AbstractHierarchicalCodeModel(final NameProvider nameProvider) { * @param namespaceDescriptors the {@link Stream} of {@link Marshalled} {@link NamespaceDescriptor}s */ protected AbstractHierarchicalCodeModel(final NameProvider nameProvider, - final Marshaller marshaller, - final Stream> traits, - final Stream> typeDescriptors, - final Stream> moduleDescriptors, - final Stream> namespaceDescriptors) { + final Marshaller marshaller, + final Stream> traits, + final Stream> typeDescriptors, + final Stream> moduleDescriptors, + final Stream> namespaceDescriptors) { super(nameProvider, marshaller, traits, typeDescriptors, moduleDescriptors, namespaceDescriptors); } diff --git a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/HierarchicalCodeModel.java b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/HierarchicalCodeModel.java index 04eeb49..a3962e1 100644 --- a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/HierarchicalCodeModel.java +++ b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/HierarchicalCodeModel.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractHierarchicalTypeDescriptor.java b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractHierarchicalTypeDescriptor.java index 4883df7..66f8d34 100644 --- a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractHierarchicalTypeDescriptor.java +++ b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractHierarchicalTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public abstract class AbstractHierarchicalTypeDescriptor * Constructs an {@link AbstractHierarchicalTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ protected AbstractHierarchicalTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -61,7 +61,7 @@ protected AbstractHierarchicalTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link AbstractHierarchicalTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ diff --git a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractParentTypeDescriptor.java b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractParentTypeDescriptor.java index 004ea63..9fb4376 100644 --- a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractParentTypeDescriptor.java +++ b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/AbstractParentTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -63,7 +63,7 @@ protected AbstractParentTypeDescriptor(final NamedTypeUsage parentTypeUsage) { /** * {@link Unmarshal} an {@link AbstractParentTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param parentTypeUsage the {@link Marshalled} {@link NamedTypeUsage} for the parent type * @param traits the {@link Marshalled} {@link Trait}s diff --git a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/HierarchicalTypeDescriptor.java b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/HierarchicalTypeDescriptor.java index b5a171d..b0b2a58 100644 --- a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/HierarchicalTypeDescriptor.java +++ b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/HierarchicalTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/ParentTypeDescriptor.java b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/ParentTypeDescriptor.java index cb5c47b..0a3ac77 100644 --- a/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/ParentTypeDescriptor.java +++ b/hierarchical-codemodel/src/main/java/build/codemodel/hierarchical/descriptor/ParentTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hierarchical-codemodel/src/main/java/module-info.java b/hierarchical-codemodel/src/main/java/module-info.java index ecd7bba..f15cd99 100644 --- a/hierarchical-codemodel/src/main/java/module-info.java +++ b/hierarchical-codemodel/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/ClassTypeDescriptor.java b/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/ClassTypeDescriptor.java index 2be0772..843c739 100644 --- a/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/ClassTypeDescriptor.java +++ b/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/ClassTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,7 +53,7 @@ public class ClassTypeDescriptor * Constructs an {@link ClassTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ protected ClassTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -64,7 +64,7 @@ protected ClassTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link ClassTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -96,7 +96,7 @@ public void destructor(final Marshaller marshaller, * Creates an {@link ClassTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link ClassTypeDescriptor} */ public static ClassTypeDescriptor of(final CodeModel codeModel, diff --git a/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/Extends.java b/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/Extends.java index 1ec1d77..00d0345 100644 --- a/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/Extends.java +++ b/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/Extends.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/HierarchicalCodeModelTests.java b/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/HierarchicalCodeModelTests.java index 1336114..d9b3edd 100644 --- a/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/HierarchicalCodeModelTests.java +++ b/hierarchical-codemodel/src/test/java/build/codemodel/hierarchical/HierarchicalCodeModelTests.java @@ -373,7 +373,7 @@ void shouldDetermineAssignableTypes() { * Obtains the {@link HierarchicalTypeDescriptor}s for the specified encoded {@link TypeName}s from * the {@link HierarchicalCodeModel}. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeNames the encoded {@link TypeName}s * @return a {@link Stream} */ @@ -392,7 +392,7 @@ private Stream getTypeDescriptors(final Hierarchical * Determines the assignable encoded {@link TypeName}s of the specified encoded {@link TypeName}s from a * {@link HierarchicalCodeModel}. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeNames the encoded {@link TypeName}s * @return the {@link Stream} of assignable encoded {@link TypeName}s * @see HierarchicalCodeModel#getAssignableTypeDescriptors(Stream) @@ -409,7 +409,7 @@ private Stream getAssignableTypeNames(final HierarchicalCodeModel codeMo /** * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has no children. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} */ private void assertHasNoChildren(final HierarchicalCodeModel codeModel, @@ -428,7 +428,7 @@ private void assertHasNoChildren(final HierarchicalCodeModel codeModel, * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has children * with the provided encoded {@link TypeName}s. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} * @param childTypeNames the encoded child {@link TypeName}s */ @@ -452,7 +452,7 @@ private void assertHasChildren(final HierarchicalCodeModel codeModel, * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has no * descendants. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} */ private void assertHasNoDescendants(final HierarchicalCodeModel codeModel, @@ -471,7 +471,7 @@ private void assertHasNoDescendants(final HierarchicalCodeModel codeModel, * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has descendants * with the provided encoded {@link TypeName}s. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} * @param childTypeNames the encoded child {@link TypeName}s */ @@ -495,7 +495,7 @@ private void assertHasDescendants(final HierarchicalCodeModel codeModel, * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has parents * with the provided encoded {@link TypeName}s. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} * @param parentTypeNames the encoded parent {@link TypeName}s */ @@ -518,7 +518,7 @@ private void assertHasParents(final HierarchicalCodeModel codeModel, /** * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has no parents. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} */ private void assertHasNoParents(final HierarchicalCodeModel codeModel, @@ -537,7 +537,7 @@ private void assertHasNoParents(final HierarchicalCodeModel codeModel, * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has ancestors * with the provided encoded {@link TypeName}s. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} * @param ancestorTypeNames the encoded ancestor {@link TypeName}s */ @@ -560,7 +560,7 @@ private void assertHasAncestors(final HierarchicalCodeModel codeModel, /** * Asserts that the specified encoded {@link TypeName} in the {@link HierarchicalCodeModel} has no ancestors. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} */ private void assertHasNoAncestors(final HierarchicalCodeModel codeModel, @@ -579,7 +579,7 @@ private void assertHasNoAncestors(final HierarchicalCodeModel codeModel, * Asserts that the encoded {@link TypeName} in the provided {@link HierarchicalCodeModel} is at the specified * {@link HierarchicalTypeDescriptor#level()}. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} * @param level the level */ @@ -600,7 +600,7 @@ private void assertLevel(final HierarchicalCodeModel codeModel, * Asserts that the encoded {@link TypeName} in the provided {@link HierarchicalCodeModel} possibly * forms a Diamond Pattern * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param encodedTypeName the encoded {@link TypeName} * @param formsDiamondPattern {@code true} if must form Diamond Pattern, {@code false} otherwise */ @@ -621,7 +621,7 @@ private void assertFormsDiamondPattern(final HierarchicalCodeModel codeModel, * Asserts that the encoded {@link TypeName} is only assignable to each of the specified encoded * {@link TypeName}s within the context of the specified {@link HierarchicalCodeModel}. * - * @param codeModel the {@link HierarchicalCodeModel} + * @param codeModel the {@link HierarchicalCodeModel} * @param fromEncodedTypeName the encoded from {@link TypeName} * @param toEncodedTypeNames the encoded to {@link TypeName} */ diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/AbstractStatement.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/AbstractStatement.java index cf013b9..f3b7766 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/AbstractStatement.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/AbstractStatement.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -51,7 +51,7 @@ protected AbstractStatement(final CodeModel codeModel) { /** * {@link Unmarshal} an {@link AbstractStatement}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/Assignment.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/Assignment.java index fa22405..db0b069 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/Assignment.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/Assignment.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -73,7 +73,7 @@ private Assignment(final VariableUsage variable, /** * {@link Unmarshal} an {@link Assignment}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param variable the {@link Marshalled} {@link VariableUsage} diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/Block.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/Block.java index 141bb4e..76a2287 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/Block.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/Block.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -54,7 +54,7 @@ public class Block /** * Constructs a {@link Block}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param statements the {@link Statement}s */ private Block(final CodeModel codeModel, @@ -70,7 +70,7 @@ private Block(final CodeModel codeModel, /** * {@link Unmarshal} a {@link Block}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling {@link Marshalled} objects * @param traits the {@link Marshalled} {@link Trait}s * @param statements the {@link Marshalled} {@link Statement}s diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/If.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/If.java index 0f1a4cd..bdebeaf 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/If.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/If.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -82,7 +82,7 @@ private If(final Expression condition, /** * {@link Unmarshal} an {@link If}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param condition the {@link Marshalled} condition {@link Expression} diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/Return.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/Return.java index eb7a724..542a29e 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/Return.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/Return.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/Statement.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/Statement.java index e5cbca9..3d82d2d 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/Statement.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/Statement.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/Statements.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/Statements.java index b5c142d..b7cde1b 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/Statements.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/Statements.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/imperative-codemodel/src/main/java/build/codemodel/imperative/While.java b/imperative-codemodel/src/main/java/build/codemodel/imperative/While.java index 97f8f20..fb9e76d 100644 --- a/imperative-codemodel/src/main/java/build/codemodel/imperative/While.java +++ b/imperative-codemodel/src/main/java/build/codemodel/imperative/While.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -72,7 +72,7 @@ private While(final Expression condition, /** * {@link Unmarshal} a {@link While}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param condition the {@link Marshalled} condition {@link Expression} diff --git a/imperative-codemodel/src/main/java/module-info.java b/imperative-codemodel/src/main/java/module-info.java index 4a33c0c..2f45f18 100644 --- a/imperative-codemodel/src/main/java/module-info.java +++ b/imperative-codemodel/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/imperative-codemodel/src/test/java/build/codemodel/imperative/MarshallingTests.java b/imperative-codemodel/src/test/java/build/codemodel/imperative/MarshallingTests.java index 562fa84..fe6e9d1 100644 --- a/imperative-codemodel/src/test/java/build/codemodel/imperative/MarshallingTests.java +++ b/imperative-codemodel/src/test/java/build/codemodel/imperative/MarshallingTests.java @@ -190,7 +190,7 @@ void shouldMarshallAndTransportAndUnmarshallWhile() marshallAndTransportAndUnMarshalAndAssert(whileStatement); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/AnnotationDiscovery.java b/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/AnnotationDiscovery.java index a9df1fc..1f88efe 100644 --- a/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/AnnotationDiscovery.java +++ b/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/AnnotationDiscovery.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/Discoverable.java b/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/Discoverable.java index 486e95d..1692c21 100644 --- a/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/Discoverable.java +++ b/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/Discoverable.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/DiscoverableAnnotationDiscovery.java b/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/DiscoverableAnnotationDiscovery.java index 4bc609e..9f6b998 100644 --- a/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/DiscoverableAnnotationDiscovery.java +++ b/jdk-annotation-discovery/src/main/java/build/codemodel/annotation/discovery/DiscoverableAnnotationDiscovery.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-annotation-discovery/src/main/java/module-info.java b/jdk-annotation-discovery/src/main/java/module-info.java index bffd5c1..4a13f59 100644 --- a/jdk-annotation-discovery/src/main/java/module-info.java +++ b/jdk-annotation-discovery/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-annotation-processor/src/main/java/build/codemodel/annotation/processing/AnnotationProcessor.java b/jdk-annotation-processor/src/main/java/build/codemodel/annotation/processing/AnnotationProcessor.java index 6c526b8..a92f359 100644 --- a/jdk-annotation-processor/src/main/java/build/codemodel/annotation/processing/AnnotationProcessor.java +++ b/jdk-annotation-processor/src/main/java/build/codemodel/annotation/processing/AnnotationProcessor.java @@ -303,20 +303,20 @@ public boolean process(final Set annotations, + typeDescriptor.typeName() + (typeDescriptor.traits(ExtendsTypeDescriptor.class).findFirst().isPresent() ? " extends " + typeDescriptor.traits(ExtendsTypeDescriptor.class) - .map(ExtendsTypeDescriptor::parentTypeUsage) - .map(Objects::toString) - .collect(Collectors.joining(", ")) + .map(ExtendsTypeDescriptor::parentTypeUsage) + .map(Objects::toString) + .collect(Collectors.joining(", ")) : "") + (typeDescriptor.traits(ImplementsTypeDescriptor.class).findFirst().isPresent() ? " implements " + typeDescriptor.traits(ImplementsTypeDescriptor.class) - .map(ImplementsTypeDescriptor::parentTypeUsage) - .map(Objects::toString) - .collect(Collectors.joining(", ")) + .map(ImplementsTypeDescriptor::parentTypeUsage) + .map(Objects::toString) + .collect(Collectors.joining(", ")) : "") + (typeDescriptor.traits().findFirst().isPresent() ? " Traits[" + typeDescriptor.traits().map(Object::getClass).map(Class::getSimpleName) - .collect(Collectors.joining(", ")) + "]" + .collect(Collectors.joining(", ")) + "]" : ""))); // -------- @@ -467,9 +467,9 @@ private FieldDescriptor createFieldDescriptor(final CodeModel codeModel, * @return a {@link ConstructorDescriptor} */ private ConstructorDescriptor createConstructorDescriptor(final CodeModel codeModel, - final JDKTypeDescriptor typeDescriptor, - final ExecutableElement constructorElement, - final LinkedHashMap pending) { + final JDKTypeDescriptor typeDescriptor, + final ExecutableElement constructorElement, + final LinkedHashMap pending) { final var formalParameters = resolver().getFormalParameters(constructorElement, (variable, pd) -> pd.addTrait(SourceLocation.elementRef(variable))); diff --git a/jdk-annotation-processor/src/main/java/module-info.java b/jdk-annotation-processor/src/main/java/module-info.java index d9a05ef..476e565 100644 --- a/jdk-annotation-processor/src/main/java/module-info.java +++ b/jdk-annotation-processor/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-annotation-processor/src/test/java/build/codemodel/annotation/processing/AnnotationProcessorTests.java b/jdk-annotation-processor/src/test/java/build/codemodel/annotation/processing/AnnotationProcessorTests.java index 3f5d42e..9fec913 100644 --- a/jdk-annotation-processor/src/test/java/build/codemodel/annotation/processing/AnnotationProcessorTests.java +++ b/jdk-annotation-processor/src/test/java/build/codemodel/annotation/processing/AnnotationProcessorTests.java @@ -1,8 +1,8 @@ package build.codemodel.annotation.processing; -import build.base.compile.testing.Compilation; -import build.base.compile.testing.Compiler; -import build.base.compile.testing.JavaFileObjects; +import build.base.compile.testing.Compilation; +import build.base.compile.testing.Compiler; +import build.base.compile.testing.JavaFileObjects; import java.io.File; import java.nio.file.FileSystems; diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/ImportedTypeNames.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/ImportedTypeNames.java index fdb84a4..a6f02b2 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/ImportedTypeNames.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/ImportedTypeNames.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/JDKCodeModel.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/JDKCodeModel.java index 27e4c96..42e26c5 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/JDKCodeModel.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/JDKCodeModel.java @@ -203,7 +203,8 @@ public void rescan(final JavaFileObject updatedFile) { public void rescan(final JavaFileObject updatedFile, final List classpath, final List modulePath) { - rescan(updatedFile, List.of(), classpath, modulePath, d -> { }); + rescan(updatedFile, List.of(), classpath, modulePath, d -> { + }); } /** @@ -240,7 +241,7 @@ public void rescan(final JavaFileObject updatedFile, .map(fp -> fp.uri().equals(uri)) .orElse(false)) .forEach(this::removeModuleDescriptor); - final var allFiles = new java.util.ArrayList(contextFiles.size() + 1); + final var allFiles = new ArrayList(contextFiles.size() + 1); allFiles.add(updatedFile); contextFiles.stream().filter(f -> !f.toUri().equals(uri)).forEach(allFiles::add); new JdkInitializer(List.of(), List.of(), allFiles, classpath, modulePath) @@ -338,8 +339,8 @@ public TypeUsage getTypeUsage(final Type type, typeUsage = TypeVariableUsage.of(this, typeName, Optional.empty(), upperBound); } else if (type instanceof WildcardType wildcardType) { - final java.lang.reflect.Type[] lowers = wildcardType.getLowerBounds(); - final java.lang.reflect.Type[] uppers = wildcardType.getUpperBounds(); + final Type[] lowers = wildcardType.getLowerBounds(); + final Type[] uppers = wildcardType.getUpperBounds(); final Optional> optLower = lowers.length > 0 ? Optional.of(Lazy.of(getTypeUsage(lowers[0]))) @@ -785,7 +786,7 @@ public Stream getAnnotations(final AnnotatedElement element return element == null ? Stream.empty() : Streams.of(element.getDeclaredAnnotations()) - .map(this::getAnnotation); + .map(this::getAnnotation); } /** diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkExpressionConverter.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkExpressionConverter.java index 980e5f7..86b5ca6 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkExpressionConverter.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkExpressionConverter.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -223,9 +223,9 @@ private void tagExpressionType(final ExpressionTree tree, final Expression expr) } final var typeMirror = trees.getTypeMirror(path); if (typeMirror == null - || typeMirror.getKind() == TypeKind.ERROR - || typeMirror.getKind() == TypeKind.NONE - || typeMirror.getKind() == TypeKind.OTHER) { + || typeMirror.getKind() == TypeKind.ERROR + || typeMirror.getKind() == TypeKind.NONE + || typeMirror.getKind() == TypeKind.OTHER) { return; } expr.addTrait(ExpressionType.of(typeResolver.apply(typeMirror))); @@ -362,14 +362,14 @@ private Optional resolveParameter(final Element element) { final var arity = paramTypes.size(); final Optional callable = executableElement.getKind() == ElementKind.CONSTRUCTOR ? typeDescriptor.traits(ConstructorDescriptor.class) - .filter(cd -> cd.getFormalParameterCount() == arity) - .filter(cd -> parametersMatch(cd, paramTypes)) - .findFirst() + .filter(cd -> cd.getFormalParameterCount() == arity) + .filter(cd -> parametersMatch(cd, paramTypes)) + .findFirst() : typeDescriptor.traits(MethodDescriptor.class) - .filter(md -> md.methodName().name().toString().equals(executableElement.getSimpleName().toString())) - .filter(md -> md.getFormalParameterCount() == arity) - .filter(md -> parametersMatch(md, paramTypes)) - .findFirst(); + .filter(md -> md.methodName().name().toString().equals(executableElement.getSimpleName().toString())) + .filter(md -> md.getFormalParameterCount() == arity) + .filter(md -> parametersMatch(md, paramTypes)) + .findFirst(); return callable .map(c -> c.getFormalParameter(index)) .map(Symbol.Parameter::new); @@ -474,7 +474,7 @@ TypeUsage resolveTypeUsage(final Tree typeTree) { .orElseGet(() -> UnknownTypeUsage.create(codeModel)); } - private Optional resolveLambdaParameterType(final com.sun.source.tree.VariableTree p) { + private Optional resolveLambdaParameterType(final VariableTree p) { final var tree = p.getType() != null ? p.getType() : p; return resolveTypeMirror(tree).map(typeResolver); } @@ -494,9 +494,9 @@ private Optional resolveTypeMirror(final Tree tree) { } final var mirror = trees.getTypeMirror(path); if (mirror == null - || mirror.getKind() == TypeKind.ERROR - || mirror.getKind() == TypeKind.NONE - || mirror.getKind() == TypeKind.OTHER) { + || mirror.getKind() == TypeKind.ERROR + || mirror.getKind() == TypeKind.NONE + || mirror.getKind() == TypeKind.OTHER) { return Optional.empty(); } return Optional.of(mirror); diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkInitializer.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkInitializer.java index d779a6e..d70961f 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkInitializer.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkInitializer.java @@ -428,8 +428,8 @@ private void addSuperTypeUsageSourceLocations(final JDKTypeDescriptor typeDescri } private void addRecordComponentSourceLocations(final JDKTypeDescriptor typeDescriptor, - final TreePath classPath, - final CompilationUnitTree cut) { + final TreePath classPath, + final CompilationUnitTree cut) { final var classTree = (ClassTree) classPath.getLeaf(); final var componentTypeTrees = classTree.getMembers().stream() .filter(VariableTree.class::isInstance) @@ -454,8 +454,8 @@ private void addThrowsSourceLocations(final Traitable traitable, } private void addTypeParameterBoundSourceLocations(final Traitable traitable, - final List typeParamTrees, - final CompilationUnitTree cut) { + final List typeParamTrees, + final CompilationUnitTree cut) { final var descriptor = traitable.getTrait(ParameterizedTypeDescriptor.class); if (descriptor.isEmpty()) { return; diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkStatementConverter.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkStatementConverter.java index f4baf18..16c922a 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkStatementConverter.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/JdkStatementConverter.java @@ -329,7 +329,7 @@ SwitchCase convertCase(final CaseTree c, final Expression selector) { * (see the TODO on {@code Symbol} resolution gaps). */ private Optional convertPatternLabel(final PatternTree pattern, - final Expression selector) { + final Expression selector) { if (pattern instanceof BindingPatternTree binding) { final var type = exprConverter.resolveTypeUsage(binding.getVariable().getType()); exprConverter.addSourceLocation(binding.getVariable().getType()).ifPresent(type::addTrait); diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeMirrorResolver.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeMirrorResolver.java index 7daa0eb..46a909c 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeMirrorResolver.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeMirrorResolver.java @@ -365,7 +365,7 @@ private void addFieldModifiers(final FieldDescriptor fieldDescriptor, if (fieldModifiers.contains(Modifier.STATIC)) { fieldDescriptor.addTrait(Static.STATIC); } - TypeMirrorResolver.getAccessModifier(fieldModifiers).ifPresent(fieldDescriptor::addTrait); + getAccessModifier(fieldModifiers).ifPresent(fieldDescriptor::addTrait); } // --- Annotations --- @@ -466,7 +466,7 @@ public JDKTypeDescriptor buildTypeDescriptor(final TypeName typeName, } this.addTypeParameters(typeDescriptor, typeElement); - TypeMirrorResolver.applyModifiers(typeDescriptor, typeElement.getModifiers()); + applyModifiers(typeDescriptor, typeElement.getModifiers()); this.addSuperclass(typeDescriptor, typeElement); this.addInterfaces(typeDescriptor, typeElement); @@ -532,7 +532,7 @@ public void modifyMethod(final MethodDescriptor methodDescriptor, if (methodElement.isDefault()) { methodDescriptor.addTrait(new MethodImplementationDescriptor(methodDescriptor)); } - TypeMirrorResolver.applyModifiers(methodDescriptor, methodElement.getModifiers()); + applyModifiers(methodDescriptor, methodElement.getModifiers()); this.addTypeAnnotations(methodDescriptor, methodElement); } @@ -540,7 +540,7 @@ public void modifyConstructor(final ConstructorDescriptor constructorDescriptor, final ExecutableElement constructorElement) { this.addTypeParameters(constructorDescriptor, constructorElement); this.addThrowables(constructorElement, constructorDescriptor); - TypeMirrorResolver.getAccessModifier(constructorElement.getModifiers()) + getAccessModifier(constructorElement.getModifiers()) .ifPresent(constructorDescriptor::addTrait); this.addTypeAnnotations(constructorDescriptor, constructorElement); } diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeUsages.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeUsages.java index 2f8f329..7219b9b 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeUsages.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/TypeUsages.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -126,8 +126,7 @@ public static String getJDKTypeName(final TypeName typeName, // attempt to import the type name if (importedTypeNames.include(typeName)) { return typeName.name().toString(); - } - else { + } else { return typeName.canonicalName(); } } @@ -192,8 +191,7 @@ public static Optional> getClass(final TypeUsage typeUsage, try { return Optional.ofNullable(classLoader.loadClass(className)); - } - catch (final ClassNotFoundException e) { + } catch (final ClassNotFoundException e) { // attempt to determine the Class of a primitive type return Optional.ofNullable(switch (className) { case "java.lang.int" -> int.class; diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationMemberDefaultValue.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationMemberDefaultValue.java index 2e3fac9..061942b 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationMemberDefaultValue.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationMemberDefaultValue.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationType.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationType.java index fc163b1..f5ef349 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationType.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/AnnotationType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/ConstructorType.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/ConstructorType.java index 35feb75..843f339 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/ConstructorType.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/ConstructorType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnclosingTypeDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnclosingTypeDescriptor.java index 3467e59..e88a5d7 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnclosingTypeDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnclosingTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnumType.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnumType.java index 1eb7352..da8bdd4 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnumType.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/EnumType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldInitializerDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldInitializerDescriptor.java index f8567ee..0807610 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldInitializerDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldInitializerDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldType.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldType.java index 016421a..3cb989f 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldType.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/FieldType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Final.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Final.java index 1284404..55b2388 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Final.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Final.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKClassTypeDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKClassTypeDescriptor.java index 254cc5e..9f15c60 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKClassTypeDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKClassTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public class JDKClassTypeDescriptor * Constructs a {@link JDKClassTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ private JDKClassTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -61,7 +61,7 @@ private JDKClassTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link JDKClassTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -93,7 +93,7 @@ public void destructor(final Marshaller marshaller, * Creates a {@link JDKClassTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link ClassTypeDescriptor} */ public static JDKClassTypeDescriptor of(final CodeModel codeModel, diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKInterfaceTypeDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKInterfaceTypeDescriptor.java index 23d5ecb..f5e11a6 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKInterfaceTypeDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKInterfaceTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -51,7 +51,7 @@ public class JDKInterfaceTypeDescriptor * Constructs a {@link JDKInterfaceTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ private JDKInterfaceTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -62,7 +62,7 @@ private JDKInterfaceTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link JDKInterfaceTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -94,7 +94,7 @@ public void destructor(final Marshaller marshaller, * Creates a {@link JDKInterfaceTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link ClassTypeDescriptor} */ public static JDKInterfaceTypeDescriptor of(final CodeModel codeModel, diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKModuleDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKModuleDescriptor.java index 2fb0d11..8b51bd7 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKModuleDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKModuleDescriptor.java @@ -116,7 +116,7 @@ public static JDKModuleDescriptor of(final CodeModel codeModel, * Populates this descriptor's traits from a javac {@link ModuleTree}. * Called by {@link build.codemodel.jdk.JdkInitializer} after creating the descriptor. * - * @param moduleTree the {@link ModuleTree} produced by javac + * @param moduleTree the {@link ModuleTree} produced by javac * @param annotationTypeNameResolver resolves an annotation's {@link AnnotationTree} to the * module-qualified {@link TypeName} of its declaring type, * matching how that type's descriptor was registered diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKType.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKType.java index d9e8c26..b794182 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKType.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKTypeDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKTypeDescriptor.java index 86a0de9..afd9c9e 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKTypeDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/JDKTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodBodyDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodBodyDescriptor.java index fe2236c..bcf921c 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodBodyDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodBodyDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodImplementationDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodImplementationDescriptor.java index a50a3af..0c88814 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodImplementationDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodImplementationDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodType.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodType.java index 6fa7cbd..17104b9 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodType.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/MethodType.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/OpensDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/OpensDescriptor.java index b3adbc9..94613b3 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/OpensDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/OpensDescriptor.java @@ -42,8 +42,8 @@ */ @NonSingular public record OpensDescriptor(Namespace packageName, - List targetModuleNames, - Optional modifier) + List targetModuleNames, + Optional modifier) implements Trait { public OpensDescriptor { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/RecordComponentDescriptor.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/RecordComponentDescriptor.java index 4115d22..45ebfbb 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/RecordComponentDescriptor.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/RecordComponentDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Static.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Static.java index 75f4f79..9ee306c 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Static.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/descriptor/Static.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ArrayAccess.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ArrayAccess.java index 81fc720..be3f9bc 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ArrayAccess.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ArrayAccess.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/AssignmentOperator.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/AssignmentOperator.java index 7885d46..236279b 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/AssignmentOperator.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/AssignmentOperator.java @@ -27,28 +27,52 @@ * @since Apr-2026 */ public enum AssignmentOperator { - /** Simple assignment: {@code x = y} */ + /** + * Simple assignment: {@code x = y} + */ ASSIGN, - /** Addition assignment: {@code x += y} */ + /** + * Addition assignment: {@code x += y} + */ PLUS, - /** Subtraction assignment: {@code x -= y} */ + /** + * Subtraction assignment: {@code x -= y} + */ MINUS, - /** Multiplication assignment: {@code x *= y} */ + /** + * Multiplication assignment: {@code x *= y} + */ MULTIPLY, - /** Division assignment: {@code x /= y} */ + /** + * Division assignment: {@code x /= y} + */ DIVIDE, - /** Remainder assignment: {@code x %= y} */ + /** + * Remainder assignment: {@code x %= y} + */ REMAINDER, - /** Bitwise AND assignment: {@code x &= y} */ + /** + * Bitwise AND assignment: {@code x &= y} + */ AND, - /** Bitwise OR assignment: {@code x |= y} */ + /** + * Bitwise OR assignment: {@code x |= y} + */ OR, - /** Bitwise XOR assignment: {@code x ^= y} */ + /** + * Bitwise XOR assignment: {@code x ^= y} + */ XOR, - /** Left shift assignment: {@code x <<= y} */ + /** + * Left shift assignment: {@code x <<= y} + */ LEFT_SHIFT, - /** Signed right shift assignment: {@code x >>= y} */ + /** + * Signed right shift assignment: {@code x >>= y} + */ RIGHT_SHIFT, - /** Unsigned right shift assignment: {@code x >>>= y} */ + /** + * Unsigned right shift assignment: {@code x >>>= y} + */ UNSIGNED_RIGHT_SHIFT } diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/BitwiseOperator.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/BitwiseOperator.java index fdf772e..8cdb8d2 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/BitwiseOperator.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/BitwiseOperator.java @@ -27,16 +27,28 @@ * @since Apr-2026 */ public enum BitwiseOperator { - /** Bitwise AND: {@code a & b} */ + /** + * Bitwise AND: {@code a & b} + */ AND, - /** Bitwise OR: {@code a | b} */ + /** + * Bitwise OR: {@code a | b} + */ OR, - /** Bitwise XOR: {@code a ^ b} */ + /** + * Bitwise XOR: {@code a ^ b} + */ XOR, - /** Left shift: {@code a << b} */ + /** + * Left shift: {@code a << b} + */ LEFT_SHIFT, - /** Signed right shift: {@code a >> b} */ + /** + * Signed right shift: {@code a >> b} + */ RIGHT_SHIFT, - /** Unsigned right shift: {@code a >>> b} */ + /** + * Unsigned right shift: {@code a >>> b} + */ UNSIGNED_RIGHT_SHIFT } diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/CharLiteral.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/CharLiteral.java index 11444ba..2b58cf6 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/CharLiteral.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/CharLiteral.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -91,7 +91,7 @@ public boolean equals(final Object object) { * Creates a {@link CharLiteral} expression. * * @param codeModel the {@link CodeModel} - * @param value the {@code char} value + * @param value the {@code char} value * @return a new {@link CharLiteral} */ public static CharLiteral of(final CodeModel codeModel, final char value) { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/FieldAccess.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/FieldAccess.java index 6dcd0f0..8511f34 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/FieldAccess.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/FieldAccess.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Identifier.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Identifier.java index bd2afd3..d74c38c 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Identifier.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Identifier.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -91,7 +91,7 @@ public boolean equals(final Object object) { * Creates an {@link Identifier} expression. * * @param codeModel the {@link CodeModel} - * @param name the identifier name + * @param name the identifier name * @return a new {@link Identifier} */ public static Identifier of(final CodeModel codeModel, final String name) { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Lambda.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Lambda.java index 97ece95..b690831 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Lambda.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Lambda.java @@ -139,7 +139,7 @@ public static Lambda of(final CodeModel codeModel, * Creates a {@link Lambda} expression with no parameters. * * @param codeModel the {@link CodeModel} - * @param body the body {@link Statement} + * @param body the body {@link Statement} * @return a new {@link Lambda} */ public static Lambda of(final CodeModel codeModel, final Statement body) { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/MethodReference.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/MethodReference.java index 62b4f0b..1d59461 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/MethodReference.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/MethodReference.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -64,8 +64,8 @@ public final class MethodReference private final Optional qualifierType; private MethodReference(final Expression qualifier, - final String methodName, - final Optional qualifierType) { + final String methodName, + final Optional qualifierType) { super(Objects.requireNonNull(qualifier, "qualifier must not be null").codeModel()); this.qualifier = qualifier; this.methodName = Objects.requireNonNull(methodName, "methodName must not be null"); diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/NullLiteral.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/NullLiteral.java index c16f2e0..a43f6a9 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/NullLiteral.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/NullLiteral.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Parenthesized.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Parenthesized.java index 09ed13b..713805a 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Parenthesized.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Parenthesized.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PostfixOperator.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PostfixOperator.java index 8581b24..7db7a91 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PostfixOperator.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PostfixOperator.java @@ -27,8 +27,12 @@ * @since Apr-2026 */ public enum PostfixOperator { - /** Post-increment: {@code x++} */ + /** + * Post-increment: {@code x++} + */ INCREMENT, - /** Post-decrement: {@code x--} */ + /** + * Post-decrement: {@code x--} + */ DECREMENT } diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PrefixOperator.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PrefixOperator.java index c0bb8e4..a09dbb6 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PrefixOperator.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/PrefixOperator.java @@ -27,12 +27,20 @@ * @since Apr-2026 */ public enum PrefixOperator { - /** Pre-increment: {@code ++x} */ + /** + * Pre-increment: {@code ++x} + */ INCREMENT, - /** Pre-decrement: {@code --x} */ + /** + * Pre-decrement: {@code --x} + */ DECREMENT, - /** Bitwise complement: {@code ~x} */ + /** + * Bitwise complement: {@code ~x} + */ BITWISE_COMPLEMENT, - /** Unary plus: {@code +x} */ + /** + * Unary plus: {@code +x} + */ UNARY_PLUS } diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ResolvedMethod.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ResolvedMethod.java index 740952c..e9790ab 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ResolvedMethod.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/ResolvedMethod.java @@ -52,10 +52,10 @@ * ({@link Singular}). If the declaring type is not present in the * {@link build.codemodel.foundation.CodeModel}, no trait is attached. * - * @param codeModel the {@link CodeModel} to resolve {@link #descriptor()} against - * @param declaringType the {@link TypeName} of the type declaring the resolved method - * @param methodName the simple name of the resolved method - * @param parameterTypes the resolved method's formal parameter types, in declaration order + * @param codeModel the {@link CodeModel} to resolve {@link #descriptor()} against + * @param declaringType the {@link TypeName} of the type declaring the resolved method + * @param methodName the simple name of the resolved method + * @param parameterTypes the resolved method's formal parameter types, in declaration order * @author reed.vonredwitz * @since Apr-2026 */ @@ -76,7 +76,7 @@ public record ResolvedMethod(CodeModel codeModel, * Resolves the {@link MethodDescriptor} this invocation currently refers to. * * @return the resolved {@link MethodDescriptor}, or {@link Optional#empty()} if the declaring - * type or the matching method is no longer present in {@link #codeModel()} + * type or the matching method is no longer present in {@link #codeModel()} */ public Optional descriptor() { return codeModel.getTypeDescriptor(declaringType) diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/SwitchExpression.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/SwitchExpression.java index 108db44..21ba33b 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/SwitchExpression.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/SwitchExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Symbol.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Symbol.java index 2367bee..3a415b3 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Symbol.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Symbol.java @@ -112,7 +112,7 @@ public TypeUsage declaredType() { * @param fieldName the simple name of the resolved field */ record Field(TypeUsage declaredType, CodeModel codeModel, TypeName declaringType, - String fieldName) implements Symbol { + String fieldName) implements Symbol { public Field { Objects.requireNonNull(declaredType, "declaredType must not be null"); @@ -125,7 +125,7 @@ record Field(TypeUsage declaredType, CodeModel codeModel, TypeName declaringType * Resolves the {@link FieldDescriptor} this reference currently refers to. * * @return the resolved {@link FieldDescriptor}, or {@link Optional#empty()} if the - * declaring type or the matching field is no longer present in {@link #codeModel()} + * declaring type or the matching field is no longer present in {@link #codeModel()} */ public Optional descriptor() { return codeModel.getTypeDescriptor(declaringType) diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Ternary.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Ternary.java index 84a5fba..95880df 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Ternary.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/Ternary.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/UnknownExpression.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/UnknownExpression.java index 4c4f9d7..833bab6 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/UnknownExpression.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/expression/UnknownExpression.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Assert.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Assert.java index a796902..290a14a 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Assert.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Assert.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Break.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Break.java index 9ea9a4e..23a8555 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Break.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Break.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -92,7 +92,7 @@ public boolean equals(final Object object) { * Creates a {@link Break} statement. * * @param codeModel the {@link CodeModel} - * @param label the optional target label name + * @param label the optional target label name * @return a new {@link Break} */ public static Break of(final CodeModel codeModel, final Optional label) { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Continue.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Continue.java index c6a1b7f..ad13c36 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Continue.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Continue.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -92,7 +92,7 @@ public boolean equals(final Object object) { * Creates a {@link Continue} statement. * * @param codeModel the {@link CodeModel} - * @param label the optional target label name + * @param label the optional target label name * @return a new {@link Continue} */ public static Continue of(final CodeModel codeModel, final Optional label) { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/DoWhile.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/DoWhile.java index 6203040..38cea06 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/DoWhile.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/DoWhile.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/ExpressionStatement.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/ExpressionStatement.java index 8e89338..6d57570 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/ExpressionStatement.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/ExpressionStatement.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/For.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/For.java index 3cfaf3a..1a5cf0b 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/For.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/For.java @@ -179,7 +179,7 @@ public boolean equals(final Object object) { /** * Creates a {@link For} statement. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param initializers the initializer {@link Statement}s * @param condition the optional loop condition {@link Expression} * @param updates the update {@link Expression}s diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Labeled.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Labeled.java index cd35f82..0f1054c 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Labeled.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Labeled.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -120,15 +120,15 @@ public boolean equals(final Object object) { * Creates a {@link Labeled} statement. * * @param codeModel the {@link CodeModel} - * @param label the label name - * @param statement the labeled {@link Statement} + * @param label the label name + * @param statement the labeled {@link Statement} * @return a new {@link Labeled} */ public static Labeled of(final CodeModel codeModel, final String label, final Statement statement) { return new Labeled(Objects.requireNonNull(codeModel, "codeModel must not be null"), - label, statement); + label, statement); } static { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchCase.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchCase.java index a19a93e..ef2d539 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchCase.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchCase.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -159,7 +159,7 @@ public boolean equals(final Object object) { * Creates a {@link SwitchCase}. * Pass {@code null} or an empty stream for {@code labels} to create the {@code default} case. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param labels the case label {@link Expression}s, or {@code null} for the {@code default} case * @param statements the body {@link Statement}s * @return a new {@link SwitchCase} @@ -168,7 +168,7 @@ public static SwitchCase of(final CodeModel codeModel, final Stream labels, final Stream statements) { return new SwitchCase(Objects.requireNonNull(codeModel, "codeModel must not be null"), - labels, statements, Optional.empty()); + labels, statements, Optional.empty()); } /** @@ -186,7 +186,7 @@ public static SwitchCase of(final CodeModel codeModel, final Stream statements, final Optional guard) { return new SwitchCase(Objects.requireNonNull(codeModel, "codeModel must not be null"), - labels, statements, guard); + labels, statements, guard); } static { diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchStatement.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchStatement.java index 74da2d3..9ac9933 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchStatement.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/SwitchStatement.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Synchronized.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Synchronized.java index 556a3c9..9a7164f 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Synchronized.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Synchronized.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Throw.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Throw.java index 4459f4f..0e5dd98 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Throw.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Throw.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Try.java b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Try.java index f9373aa..c6cd9fe 100644 --- a/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Try.java +++ b/jdk-codemodel/src/main/java/build/codemodel/jdk/statement/Try.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -179,7 +179,7 @@ public boolean equals(final Object object) { /** * Creates a {@link Try} statement. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param resources the try-with-resources {@link Statement}s * @param body the try body {@link Block} * @param catches the {@link CatchClause}s @@ -197,7 +197,7 @@ public static Try of(final CodeModel codeModel, /** * Creates a {@link Try} statement with no resources. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param body the try body {@link Block} * @param catches the {@link CatchClause}s * @param finallyBlock the optional {@code finally} {@link Block} diff --git a/jdk-codemodel/src/main/java/module-info.java b/jdk-codemodel/src/main/java/module-info.java index 36cd0ac..2c79442 100644 --- a/jdk-codemodel/src/main/java/module-info.java +++ b/jdk-codemodel/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ArrayAccessArrayTypeTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ArrayAccessArrayTypeTests.java index 9ec663d..466a5b9 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ArrayAccessArrayTypeTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ArrayAccessArrayTypeTests.java @@ -1,10 +1,10 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.jdk.descriptor.MethodBodyDescriptor; import build.codemodel.jdk.expression.ArrayAccess; import build.codemodel.jdk.statement.LocalVariableDeclaration; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/BodyCaptureTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/BodyCaptureTests.java index 2baea10..ee61a09 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/BodyCaptureTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/BodyCaptureTests.java @@ -1,21 +1,19 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.expression.NumericLiteral; import build.codemodel.expression.StringLiteral; import build.codemodel.foundation.usage.NamedTypeUsage; -import build.codemodel.imperative.Block; import build.codemodel.imperative.Return; import build.codemodel.jdk.descriptor.FieldInitializerDescriptor; import build.codemodel.jdk.descriptor.MethodBodyDescriptor; import build.codemodel.jdk.expression.Lambda; -import build.codemodel.jdk.statement.CatchClause; import build.codemodel.jdk.statement.ExpressionStatement; import build.codemodel.jdk.statement.LocalVariableDeclaration; import build.codemodel.jdk.statement.Try; import build.codemodel.objectoriented.descriptor.ConstructorDescriptor; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/DiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/DiscoveryTests.java index 228f3a9..30567d4 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/DiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/DiscoveryTests.java @@ -1,11 +1,11 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.jdk.descriptor.JDKTypeDescriptor; import build.codemodel.objectoriented.descriptor.Classification; import build.codemodel.objectoriented.descriptor.ExtendsTypeDescriptor; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionCaptureFidelityTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionCaptureFidelityTests.java index 7cdceb1..dcc391c 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionCaptureFidelityTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionCaptureFidelityTests.java @@ -20,6 +20,7 @@ * #L% */ +import build.base.compile.testing.JavaFileObjects; import build.codemodel.expression.Cast; import build.codemodel.foundation.usage.NamedTypeUsage; import build.codemodel.imperative.Return; @@ -38,7 +39,6 @@ import build.codemodel.jdk.statement.ExpressionStatement; import build.codemodel.jdk.statement.LocalVariableDeclaration; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; @@ -290,7 +290,7 @@ public class TypeTokens { .filter(m -> m.methodName().name().toString().equals("stringClass")) .findFirst().orElseThrow() .getTrait(MethodBodyDescriptor.class).orElseThrow().body(); - final var returnExpr = ((build.codemodel.imperative.Return) body.statements().findFirst().orElseThrow()) + final var returnExpr = ((Return) body.statements().findFirst().orElseThrow()) .expression().orElseThrow(); assertThat(returnExpr).isInstanceOf(build.codemodel.jdk.expression.ClassLiteral.class); @@ -320,7 +320,7 @@ public class PrimitiveTokens { .filter(m -> m.methodName().name().toString().equals("intClass")) .findFirst().orElseThrow() .getTrait(MethodBodyDescriptor.class).orElseThrow().body(); - final var intReturn = ((build.codemodel.imperative.Return) intClassBody.statements().findFirst().orElseThrow()) + final var intReturn = ((Return) intClassBody.statements().findFirst().orElseThrow()) .expression().orElseThrow(); assertThat(intReturn) @@ -331,7 +331,7 @@ public class PrimitiveTokens { .filter(m -> m.methodName().name().toString().equals("voidClass")) .findFirst().orElseThrow() .getTrait(MethodBodyDescriptor.class).orElseThrow().body(); - final var voidReturn = ((build.codemodel.imperative.Return) voidClassBody.statements().findFirst().orElseThrow()) + final var voidReturn = ((Return) voidClassBody.statements().findFirst().orElseThrow()) .expression().orElseThrow(); assertThat(voidReturn) diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionTypeResolutionTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionTypeResolutionTests.java index 35d5adf..c9c7401 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionTypeResolutionTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ExpressionTypeResolutionTests.java @@ -1,5 +1,6 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.expression.ExpressionType; import build.codemodel.expression.StringLiteral; import build.codemodel.foundation.usage.NamedTypeUsage; @@ -12,7 +13,6 @@ import build.codemodel.jdk.statement.ExpressionStatement; import build.codemodel.jdk.statement.LocalVariableDeclaration; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldAccessReceiverTypeTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldAccessReceiverTypeTests.java index 468d77e..57d99d3 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldAccessReceiverTypeTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldAccessReceiverTypeTests.java @@ -1,11 +1,11 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.NamedTypeUsage; import build.codemodel.jdk.descriptor.MethodBodyDescriptor; import build.codemodel.jdk.expression.FieldAccess; import build.codemodel.jdk.statement.LocalVariableDeclaration; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldDiscoveryTests.java index 4aa0846..bff1673 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/FieldDiscoveryTests.java @@ -1,10 +1,10 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.NamedTypeUsage; import build.codemodel.objectoriented.descriptor.AccessModifier; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/GenericsDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/GenericsDiscoveryTests.java index 2ef82b9..043b11a 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/GenericsDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/GenericsDiscoveryTests.java @@ -1,5 +1,6 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.GenericTypeUsage; import build.codemodel.foundation.usage.IntersectionTypeUsage; import build.codemodel.foundation.usage.NamedTypeUsage; @@ -8,7 +9,6 @@ import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; import build.codemodel.objectoriented.descriptor.ParameterizedTypeDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ImportDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ImportDiscoveryTests.java index 7edc48c..43d3f6a 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ImportDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ImportDiscoveryTests.java @@ -20,8 +20,8 @@ * #L% */ -import build.codemodel.jdk.descriptor.ImportDeclaration; import build.base.compile.testing.JavaFileObjects; +import build.codemodel.jdk.descriptor.ImportDeclaration; import org.junit.jupiter.api.Test; import java.util.Comparator; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/IncrementalRescanTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/IncrementalRescanTests.java index 74ce931..9654aa7 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/IncrementalRescanTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/IncrementalRescanTests.java @@ -359,7 +359,7 @@ public class Foo { /** * When the rescanned file references a type that lives on the classpath (not among the * source files), the rescan must pass that classpath through to the new {@link JdkInitializer}. - * Without it the type degrades to {@link build.codemodel.foundation.usage.UnknownTypeUsage}. + * Without it the type degrades to {@link UnknownTypeUsage}. */ @Test void rescanPreservesClasspathResolution() throws Exception { @@ -370,7 +370,7 @@ void rescanPreservesClasspathResolution() throws Exception { "com.example.Helper", "package com.example; public class Helper {}"); final var compiler = javax.tools.ToolProvider.getSystemJavaCompiler(); - try (final var fm = compiler.getStandardFileManager(null, null, null)) { + try (var fm = compiler.getStandardFileManager(null, null, null)) { compiler.getTask(null, fm, _ -> { }, List.of("-d", classpathDir.toString()), null, List.of(helperSource)).call(); @@ -392,7 +392,7 @@ public class Foo { .traits(FieldDescriptor.class).findFirst().orElseThrow(); assertThat(depField.type()) .as("Helper must resolve on initial populate") - .isNotInstanceOf(build.codemodel.foundation.usage.UnknownTypeUsage.class); + .isNotInstanceOf(UnknownTypeUsage.class); // Rescan Foo with the classpath so Helper still resolves final var fooV2 = JavaFileObjects.forSourceString("com.example.Foo", """ @@ -410,12 +410,12 @@ public class Foo { .findFirst().orElseThrow(); assertThat(depFieldAfter.type()) .as("Helper must still resolve after rescan when classpath is forwarded") - .isNotInstanceOf(build.codemodel.foundation.usage.UnknownTypeUsage.class); + .isNotInstanceOf(UnknownTypeUsage.class); } /** * Without forwarding the classpath, a rescan of a file that references a classpath-only type - * degrades that field to {@link build.codemodel.foundation.usage.UnknownTypeUsage}. + * degrades that field to {@link UnknownTypeUsage}. * This test documents the failure mode so callers know they must use the overload that * accepts classpath/modulePath. */ @@ -544,7 +544,7 @@ public class Foo { public int value; } /** * Regression: when a method's return type is a generic whose type argument is defined in a * required module, rescanning the method's file without its {@code module-info.java} degrades - * the return type to {@link build.codemodel.foundation.usage.UnknownTypeUsage} because javac + * the return type to {@link UnknownTypeUsage} because javac * sees the cross-module type as an {@code ErrorType} when there are no {@code requires} * declarations in scope. * @@ -574,7 +574,7 @@ void genericReturnTypeOfSourceDefinedTypeRemainsResolvedAfterRescan() throws Exc public class Result {} """); final var compiler = javax.tools.ToolProvider.getSystemJavaCompiler(); - try (final var fm = compiler.getStandardFileManager(null, null, null)) { + try (var fm = compiler.getStandardFileManager(null, null, null)) { compiler.getTask(null, fm, _ -> { }, List.of("-d", resultModuleDir.toString()), @@ -609,7 +609,7 @@ public class Foo { .findFirst().orElseThrow(); assertThat(initialItems.returnType()) .as("items() return type must resolve on initial populate") - .isNotInstanceOf(build.codemodel.foundation.usage.UnknownTypeUsage.class); + .isNotInstanceOf(UnknownTypeUsage.class); // Add then remove an extra method, passing module-info as context so javac keeps module resolution. final var fooV2 = JavaFileObjects.forSourceString("com.example.consumer.Foo", """ @@ -641,7 +641,7 @@ public class Foo { assertThat(itemsAfterRescan.returnType()) .as("items() return type must not degrade to UnknownTypeUsage after add-then-remove rescan") - .isNotInstanceOf(build.codemodel.foundation.usage.UnknownTypeUsage.class); + .isNotInstanceOf(UnknownTypeUsage.class); assertThat(itemsAfterRescan.returnType().canonicalName()) .as("items() return type canonical name must not be null") .isNotNull(); @@ -655,7 +655,7 @@ void rescanWithoutClasspathDegradesToUnknownTypeUsage() throws Exception { "com.example.Helper", "package com.example; public class Helper {}"); final var compiler = javax.tools.ToolProvider.getSystemJavaCompiler(); - try (final var fm = compiler.getStandardFileManager(null, null, null)) { + try (var fm = compiler.getStandardFileManager(null, null, null)) { compiler.getTask(null, fm, _ -> { }, List.of("-d", classpathDir.toString()), null, List.of(helperSource)).call(); @@ -689,12 +689,12 @@ public class Foo { .findFirst().orElseThrow(); assertThat(depFieldAfter.type()) .as("Helper degrades to UnknownTypeUsage when classpath is not forwarded") - .isInstanceOf(build.codemodel.foundation.usage.UnknownTypeUsage.class); + .isInstanceOf(UnknownTypeUsage.class); } /** * Regression: types defined in sibling source files of the same module degrade to - * {@link build.codemodel.foundation.usage.UnknownTypeUsage} after a rescan, because those + * {@link UnknownTypeUsage} after a rescan, because those * sibling files are neither on the classpath/module-path nor included in the rescan's * compilation unit. * @@ -894,18 +894,18 @@ public void target() { void callersCachedFieldSymbolGoesStaleAfterDeclaringTypeIsRescanned() { final var baseSource = JavaFileObjects.forSourceString("com.example.Base", """ package com.example; - + public class Base { - + protected int value; } """); final var subSource = JavaFileObjects.forSourceString("com.example.Sub", """ package com.example; - + public class Sub extends Base { - + public int read() { return value; } @@ -938,13 +938,13 @@ public int read() { // Simulate an editor save of Base.java: same field name, but padded so its offset moves. final var baseV2 = JavaFileObjects.forSourceString("com.example.Base", """ package com.example; - + public class Base { - + // several new lines added above, shifting every subsequent offset // several new lines added above, shifting every subsequent offset // several new lines added above, shifting every subsequent offset - + protected int value; } """); diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/JDKCodeModelTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/JDKCodeModelTests.java index b7e8ab7..2f4f8ac 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/JDKCodeModelTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/JDKCodeModelTests.java @@ -13,10 +13,10 @@ import build.codemodel.jdk.descriptor.JDKTypeDescriptor; import build.codemodel.jdk.descriptor.Varargs; import build.codemodel.jdk.example.AbstractPerson; -import build.codemodel.jdk.example.FinalParamExample; import build.codemodel.jdk.example.BoundedContainer; import build.codemodel.jdk.example.Container; import build.codemodel.jdk.example.Description; +import build.codemodel.jdk.example.FinalParamExample; import build.codemodel.jdk.example.NonAbstractPerson; import build.codemodel.jdk.example.ThrowingExample; import build.codemodel.jdk.example.VarargsExample; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/JdkInitializerTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/JdkInitializerTests.java index 84449da..8c94470 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/JdkInitializerTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/JdkInitializerTests.java @@ -1,5 +1,6 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.CodeModel; import build.codemodel.foundation.naming.NonCachingNameProvider; import build.codemodel.foundation.usage.AnnotationTypeUsage; @@ -16,7 +17,6 @@ import build.codemodel.objectoriented.descriptor.ConstructorDescriptor; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.io.ByteArrayOutputStream; @@ -225,7 +225,7 @@ void shouldResolveTypesFromClasspath() throws Exception { "com.example.Helper", "package com.example; public class Helper {}"); final var compiler = ToolProvider.getSystemJavaCompiler(); - try (final var fm = compiler.getStandardFileManager(null, null, null)) { + try (var fm = compiler.getStandardFileManager(null, null, null)) { compiler.getTask(null, fm, diagnostic -> { }, List.of("-d", classpathDir.toString()), null, List.of(helperSource)).call(); @@ -417,11 +417,20 @@ void shouldTraverseMethods() { final var personFactoryName = nameProvider.getTypeName(Optional.empty(), "build.codemodel.jdk.example.PersonFactory"); final var personFactoryTd = codeModel.getTypeDescriptor(personFactoryName).orElseThrow(); - final var parts = personFactoryTd.parts().toList(); - final var composition = personFactoryTd.composition().toList(); - final var typeUsages = personFactoryTd.parts(TypeUsage.class).toList(); - final var allTypeUsages = personFactoryTd.composition(TypeUsage.class).toList(); - System.out.println(); + + // the static factory method is directly reachable as a part of its declaring type + final var ofMethod = personFactoryTd.parts(MethodDescriptor.class) + .filter(m -> m.methodName().name().toString().equals("of")) + .findFirst() + .orElseThrow(); + + assertThat(ofMethod.getFormalParameterCount()).isZero(); + assertThat(ofMethod.returnType()).isInstanceOf(SpecificTypeUsage.class); + assertThat(((SpecificTypeUsage) ofMethod.returnType()).typeName().name().toString()) + .isEqualTo("AbstractPerson"); + + // traversing the method's own parts reaches its return type as a TypeUsage + assertThat(ofMethod.parts().toList()).contains(ofMethod.returnType()); } @Test diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/MemberOrderTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/MemberOrderTests.java index 0ad9be5..8ef07fd 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/MemberOrderTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/MemberOrderTests.java @@ -20,10 +20,10 @@ * #L% */ +import build.base.compile.testing.JavaFileObjects; import build.codemodel.jdk.descriptor.SourceLocation; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.Comparator; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodDiscoveryTests.java index ea3bd01..bbadc13 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodDiscoveryTests.java @@ -1,12 +1,12 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.VoidTypeUsage; import build.codemodel.jdk.descriptor.MethodImplementationDescriptor; import build.codemodel.jdk.descriptor.Varargs; import build.codemodel.objectoriented.descriptor.Classification; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; @@ -27,10 +27,10 @@ void shouldCreateMethodDescriptors() { final var source = JavaFileObjects.forSourceString("Discover", """ public interface Discover { void findableVoidMethod(); - + default void findableDefaultMethod() { } - + int methodWithParameters(String name, double size); } """); diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodInvocationReceiverTypeTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodInvocationReceiverTypeTests.java index 5852798..a6eca39 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodInvocationReceiverTypeTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodInvocationReceiverTypeTests.java @@ -1,12 +1,12 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.NamedTypeUsage; import build.codemodel.jdk.descriptor.MemberTypeDescriptor; import build.codemodel.jdk.descriptor.MethodBodyDescriptor; import build.codemodel.jdk.expression.MethodInvocation; import build.codemodel.jdk.statement.ExpressionStatement; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodReferenceQualifierTypeTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodReferenceQualifierTypeTests.java index 13a5533..d8a9faf 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodReferenceQualifierTypeTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodReferenceQualifierTypeTests.java @@ -1,12 +1,12 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.NamedTypeUsage; import build.codemodel.jdk.descriptor.MethodBodyDescriptor; import build.codemodel.jdk.descriptor.SourceLocation; import build.codemodel.jdk.expression.MethodReference; import build.codemodel.jdk.expression.ResolvedMethod; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodResolutionTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodResolutionTests.java index 6279a0c..57fc685 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodResolutionTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/MethodResolutionTests.java @@ -1,11 +1,10 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.imperative.Return; import build.codemodel.jdk.expression.MethodInvocation; import build.codemodel.jdk.expression.ResolvedMethod; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.codemodel.jdk.JdkInitializer; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; @@ -148,7 +147,7 @@ public void hello() {} final var typeName = cm.getNameProvider().getTypeName(Optional.empty(), "com.example.Foo"); final var method = cm.getTypeDescriptor(typeName).orElseThrow() .traits(MethodDescriptor.class).findFirst().orElseThrow(); - final var trait = new ResolvedMethod(cm, typeName, "hello", java.util.List.of()); + final var trait = new ResolvedMethod(cm, typeName, "hello", List.of()); assertThat(trait.parts().toList()).containsExactly(method); } } diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleDiscoveryTests.java index fe597e8..9828b93 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleDiscoveryTests.java @@ -1,13 +1,13 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.descriptor.RequiresModuleDescriptor; -import build.codemodel.jdk.descriptor.RequiresModifier; import build.codemodel.jdk.descriptor.ExportsDescriptor; import build.codemodel.jdk.descriptor.OpenModule; import build.codemodel.jdk.descriptor.OpensDescriptor; import build.codemodel.jdk.descriptor.ProvidesDescriptor; +import build.codemodel.jdk.descriptor.RequiresModifier; import build.codemodel.jdk.descriptor.UsesDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleNameResolutionTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleNameResolutionTests.java index ff38c71..ab7851a 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleNameResolutionTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ModuleNameResolutionTests.java @@ -21,17 +21,16 @@ */ +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.naming.ModuleName; import build.codemodel.jdk.descriptor.MemberTypeDescriptor; -import build.base.compile.testing.JavaFileObjects; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import org.junit.jupiter.api.Test; import java.io.File; import java.util.List; import java.util.Optional; - import javax.tools.JavaFileObject; import static org.assertj.core.api.Assertions.assertThat; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/NestedTypeDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/NestedTypeDiscoveryTests.java index 191aa25..961ad8f 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/NestedTypeDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/NestedTypeDiscoveryTests.java @@ -20,9 +20,9 @@ * #L% */ +import build.base.compile.testing.JavaFileObjects; import build.codemodel.jdk.descriptor.EnclosingTypeDescriptor; import build.codemodel.jdk.descriptor.MemberTypeDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/RecursivelyDefinedTypeDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/RecursivelyDefinedTypeDiscoveryTests.java index 4d73d99..9dbfc9c 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/RecursivelyDefinedTypeDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/RecursivelyDefinedTypeDiscoveryTests.java @@ -1,9 +1,9 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; import build.codemodel.objectoriented.descriptor.ParameterizedTypeDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/ReferencesToTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/ReferencesToTests.java index d09f6f8..5366727 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/ReferencesToTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/ReferencesToTests.java @@ -20,10 +20,10 @@ * #L% */ +import build.base.compile.testing.JavaFileObjects; import build.codemodel.objectoriented.descriptor.ConstructorDescriptor; import build.codemodel.objectoriented.descriptor.FieldDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/SymbolResolutionTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/SymbolResolutionTests.java index 0317618..a0e464c 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/SymbolResolutionTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/SymbolResolutionTests.java @@ -1,5 +1,6 @@ package build.codemodel.jdk; +import build.base.compile.testing.JavaFileObjects; import build.codemodel.foundation.usage.NamedTypeUsage; import build.codemodel.imperative.Return; import build.codemodel.jdk.descriptor.MethodBodyDescriptor; @@ -10,7 +11,6 @@ import build.codemodel.jdk.statement.LocalVariableDeclaration; import build.codemodel.objectoriented.descriptor.ConstructorDescriptor; import build.codemodel.objectoriented.descriptor.MethodDescriptor; -import build.base.compile.testing.JavaFileObjects; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/TypeKindDiscoveryTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/TypeKindDiscoveryTests.java index 43ad900..dccca1d 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/TypeKindDiscoveryTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/TypeKindDiscoveryTests.java @@ -25,9 +25,9 @@ void shouldDetectEnumType() { final var source = JavaFileObjects.forSourceString( "com.example.Color", """ - package com.example; - public enum Color { RED, GREEN, BLUE } - """); + package com.example; + public enum Color { RED, GREEN, BLUE } + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -42,9 +42,9 @@ void shouldDetectRecordType() { final var source = JavaFileObjects.forSourceString( "com.example.Point", """ - package com.example; - public record Point(int x, int y) {} - """); + package com.example; + public record Point(int x, int y) {} + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -59,9 +59,9 @@ void shouldDetectAnnotationType() { final var source = JavaFileObjects.forSourceString( "com.example.Marker", """ - package com.example; - public @interface Marker {} - """); + package com.example; + public @interface Marker {} + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -76,9 +76,9 @@ void shouldCaptureEnumConstants() { final var source = JavaFileObjects.forSourceString( "com.example.Color", """ - package com.example; - public enum Color { RED, GREEN, BLUE } - """); + package com.example; + public enum Color { RED, GREEN, BLUE } + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -96,9 +96,9 @@ void shouldCaptureRecordComponents() { final var source = JavaFileObjects.forSourceString( "com.example.Point", """ - package com.example; - public record Point(int x, int y) {} - """); + package com.example; + public record Point(int x, int y) {} + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -117,12 +117,12 @@ void shouldCaptureAnnotationMemberDefault() { final var source = JavaFileObjects.forSourceString( "com.example.Marker", """ - package com.example; - public @interface Marker { - String value() default "hello"; - int count() default 1; - } - """); + package com.example; + public @interface Marker { + String value() default "hello"; + int count() default 1; + } + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -152,11 +152,11 @@ void shouldCaptureEnclosingTypeForNestedClass() { final var source = JavaFileObjects.forSourceString( "com.example.Outer", """ - package com.example; - public class Outer { - public static class Inner {} - } - """); + package com.example; + public class Outer { + public static class Inner {} + } + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); @@ -184,9 +184,9 @@ void enumConstantsShouldBeReturnedInSourceDeclarationOrder() { final var source = JavaFileObjects.forSourceString( "com.example.Planet", """ - package com.example; - public enum Planet { MERCURY, VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE } - """); + package com.example; + public enum Planet { MERCURY, VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE } + """); final var codeModel = new JDKCodeModel(new NonCachingNameProvider()); new JdkInitializer(List.of(), List.of(), List.of(source)) .initialize(codeModel); diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MarshallingTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MarshallingTests.java index bd9539e..c5d27e1 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MarshallingTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MarshallingTests.java @@ -80,7 +80,7 @@ void shouldMarshallAndTransportAndUnmarshallJDKInterfaceTypeDescriptor() IrreducibleName.of("Object")))); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MereologyTests.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MereologyTests.java index 742db4a..d5ad7c0 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MereologyTests.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/descriptor/MereologyTests.java @@ -23,7 +23,6 @@ import build.codemodel.expression.NumericLiteral; import build.codemodel.foundation.naming.IrreducibleName; import build.codemodel.foundation.naming.NonCachingNameProvider; -import build.codemodel.foundation.usage.TypeUsage; import build.codemodel.imperative.Block; import build.codemodel.jdk.JDKCodeModel; import build.codemodel.jdk.expression.ClassLiteral; diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/AbstractPerson.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/AbstractPerson.java index eb4090a..2da3028 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/AbstractPerson.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/AbstractPerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Container.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Container.java index 502c520..d2032bd 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Container.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Container.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Description.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Description.java index e78ef50..ddee93a 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Description.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Description.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,8 +35,8 @@ */ @Inherited @Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, - ElementType.ANNOTATION_TYPE, ElementType.PARAMETER }) +@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, + ElementType.ANNOTATION_TYPE, ElementType.PARAMETER}) @Repeatable(Descriptions.class) public @interface Description { diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Descriptions.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Descriptions.java index d4f632b..ed9d846 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Descriptions.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/Descriptions.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,7 +35,7 @@ */ @Inherited @Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.ANNOTATION_TYPE }) +@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.ANNOTATION_TYPE}) public @interface Descriptions { Description[] value(); diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/NonAbstractPerson.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/NonAbstractPerson.java index 7ec6674..1ebe99d 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/NonAbstractPerson.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/NonAbstractPerson.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/PersonFactory.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/PersonFactory.java index cd879ae..fd1c90c 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/PersonFactory.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/PersonFactory.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/ThrowingExample.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/ThrowingExample.java index 135a008..a96d411 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/ThrowingExample.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/ThrowingExample.java @@ -29,7 +29,7 @@ */ public class ThrowingExample { - public ThrowingExample(String path) throws IOException { + public ThrowingExample(final String path) throws IOException { } public void read() throws IOException { diff --git a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/VarargsExample.java b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/VarargsExample.java index 4559f2c..74167a1 100644 --- a/jdk-codemodel/src/test/java/build/codemodel/jdk/example/VarargsExample.java +++ b/jdk-codemodel/src/test/java/build/codemodel/jdk/example/VarargsExample.java @@ -27,12 +27,12 @@ */ public class VarargsExample { - public VarargsExample(String first, String... rest) { + public VarargsExample(final String first, final String... rest) { } - public void format(String prefix, Object... args) { + public void format(final String prefix, final Object... args) { } - public void fixed(String a, String b) { + public void fixed(final String a, final String b) { } } diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/ObjectOrientedCodeModel.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/ObjectOrientedCodeModel.java index a6f0f16..87af13c 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/ObjectOrientedCodeModel.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/ObjectOrientedCodeModel.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -70,11 +70,11 @@ public ObjectOrientedCodeModel(final NameProvider nameProvider) { */ @Unmarshal public ObjectOrientedCodeModel(final @Bound NameProvider nameProvider, - final Marshaller marshaller, - final Stream> traits, - final Stream> typeDescriptors, - final Stream> moduleDescriptors, - final Stream> namespaceDescriptors) { + final Marshaller marshaller, + final Stream> traits, + final Stream> typeDescriptors, + final Stream> moduleDescriptors, + final Stream> namespaceDescriptors) { super(nameProvider, marshaller, traits, typeDescriptors, moduleDescriptors, namespaceDescriptors); } diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/AccessModifier.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/AccessModifier.java index 75fd2f5..168e33f 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/AccessModifier.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/AccessModifier.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ClassTypeDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ClassTypeDescriptor.java index 03f9c54..6cb91fe 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ClassTypeDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ClassTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -54,7 +54,7 @@ public class ClassTypeDescriptor * Constructs an {@link ClassTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ protected ClassTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -65,7 +65,7 @@ protected ClassTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link ClassTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -97,7 +97,7 @@ public void destructor(final Marshaller marshaller, * Creates an {@link ClassTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link ClassTypeDescriptor} */ public static ClassTypeDescriptor of(final CodeModel codeModel, diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/Classification.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/Classification.java index ab3adfe..04dfbad 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/Classification.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/Classification.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ConstructorDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ConstructorDescriptor.java index 9bf2c43..3d97836 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ConstructorDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ConstructorDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -109,7 +109,7 @@ private ConstructorDescriptor(final TypeDescriptor typeDescriptor, /** * {@link Unmarshal} a {@link ConstructorDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeDescriptor the {@link TypeDescriptor} diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ExtendsTypeDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ExtendsTypeDescriptor.java index 6b2d624..96172a9 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ExtendsTypeDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ExtendsTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ private ExtendsTypeDescriptor(final NamedTypeUsage parentTypeUsage) { /** * {@link Unmarshal} an {@link ExtendsTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param parentTypeUsage the {@link Marshalled} {@link NamedTypeUsage} for the parent type * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/FieldDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/FieldDescriptor.java index b83b37d..ef5148a 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/FieldDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/FieldDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -65,8 +65,8 @@ public final class FieldDescriptor * Constructs a {@link FieldDescriptor}. * * @param codeModel the {@link CodeModel} - * @param name the {@link IrreducibleName} - * @param type the {@link TypeUsage} defining the field type + * @param name the {@link IrreducibleName} + * @param type the {@link TypeUsage} defining the field type */ private FieldDescriptor(final CodeModel codeModel, final IrreducibleName name, @@ -81,7 +81,7 @@ private FieldDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link FieldDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param name the {@link IrreducibleName} @@ -171,8 +171,8 @@ public int hashCode() { * Creates a {@link FieldDescriptor}. * * @param codeModel the {@link CodeModel} - * @param name the {@link IrreducibleName} - * @param type the {@link TypeUsage} defining the field type + * @param name the {@link IrreducibleName} + * @param type the {@link TypeUsage} defining the field type */ public static FieldDescriptor of(final CodeModel codeModel, final IrreducibleName name, diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ImplementsTypeDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ImplementsTypeDescriptor.java index 1775932..c41040c 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ImplementsTypeDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ImplementsTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ private ImplementsTypeDescriptor(final NamedTypeUsage interfaceTypeUsage) { /** * {@link Unmarshal} an {@link ImplementsTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param parentTypeUsage the {@link Marshalled} {@link NamedTypeUsage} for the parent type * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/InterfaceTypeDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/InterfaceTypeDescriptor.java index 1b704d5..824838e 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/InterfaceTypeDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/InterfaceTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -54,7 +54,7 @@ public class InterfaceTypeDescriptor * Constructs an {@link InterfaceTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} */ protected InterfaceTypeDescriptor(final CodeModel codeModel, final TypeName typeName) { @@ -65,7 +65,7 @@ protected InterfaceTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link InterfaceTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -97,7 +97,7 @@ public void destructor(final Marshaller marshaller, * Creates an {@link InterfaceTypeDescriptor}. * * @param codeModel the {@link CodeModel} - * @param typeName the {@link TypeName} + * @param typeName the {@link TypeName} * @return a new {@link InterfaceTypeDescriptor} */ public static InterfaceTypeDescriptor of(final CodeModel codeModel, diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodDescriptor.java index f2ce7b3..83810be 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -102,7 +102,7 @@ private MethodDescriptor(final TypeDescriptor typeDescriptor, /** * {@link Unmarshal} a {@link MethodDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param typeDescriptor the {@link TypeDescriptor} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param methodName the {@link MethodName} @@ -127,8 +127,8 @@ public MethodDescriptor(@Bound final CodeModel codeModel, this.formalParameters = formalParameters == null ? new ArrayList<>() : formalParameters - .map(marshaller::unmarshal) - .collect(Collectors.toCollection(ArrayList::new)); + .map(marshaller::unmarshal) + .collect(Collectors.toCollection(ArrayList::new)); } /** diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodUsage.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodUsage.java index 0132c8f..31a2e9a 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodUsage.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/MethodUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -88,7 +88,7 @@ private MethodUsage(final Expression expression, /** * {@link Unmarshal} a {@link MethodUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param expression the {@link Marshalled} {@link Expression} to obtain the Object on which to invoke the method diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ParameterizedTypeDescriptor.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ParameterizedTypeDescriptor.java index 13fa792..c719946 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ParameterizedTypeDescriptor.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ParameterizedTypeDescriptor.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -59,7 +59,7 @@ public final class ParameterizedTypeDescriptor /** * Constructs a {@link ParameterizedTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param typeVariables the {@link TypeVariableUsage}s */ private ParameterizedTypeDescriptor(final CodeModel codeModel, @@ -75,7 +75,7 @@ private ParameterizedTypeDescriptor(final CodeModel codeModel, /** * {@link Unmarshal} a {@link ParameterizedTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s * @param typeVariables the {@link Marshalled} {@link TypeVariableUsage}s @@ -147,7 +147,7 @@ public int hashCode() { /** * Creates a {@link ParameterizedTypeDescriptor}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param typeVariables the {@link TypeVariableUsage}s */ public static ParameterizedTypeDescriptor of(final CodeModel codeModel, diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/SuperUsage.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/SuperUsage.java index feec7ec..d0afa6e 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/SuperUsage.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/SuperUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ private SuperUsage(final CodeModel codeModel) { /** * {@link Unmarshal} a {@link SuperUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -77,7 +77,7 @@ public SuperUsage(@Bound final CodeModel codeModel, */ @Marshal public void destructor(final Marshaller marshaller, - final Out>> traits) { + final Out>> traits) { super.destructor(marshaller, traits); } diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ThisUsage.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ThisUsage.java index dd4d5b2..f6e48a4 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ThisUsage.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/descriptor/ThisUsage.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ private ThisUsage(final CodeModel codeModel) { /** * {@link Unmarshal} a {@link ThisUsage}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} for unmarshalling the {@link Marshalled} {@link Trait}s * @param traits the {@link Marshalled} {@link Trait}s */ @@ -77,7 +77,7 @@ public ThisUsage(@Bound final CodeModel codeModel, */ @Marshal public void destructor(final Marshaller marshaller, - final Out>> traits) { + final Out>> traits) { super.destructor(marshaller, traits); } diff --git a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/naming/MethodName.java b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/naming/MethodName.java index 391ceef..e57648d 100644 --- a/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/naming/MethodName.java +++ b/objectoriented-codemodel/src/main/java/build/codemodel/objectoriented/naming/MethodName.java @@ -9,9 +9,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -66,7 +66,7 @@ private MethodName(final Optional moduleName, /** * {@link Unmarshal} a {@link MethodName}. * - * @param codeModel the {@link CodeModel} + * @param codeModel the {@link CodeModel} * @param marshaller the {@link Marshaller} * @param moduleName the {@link Optional} {@link ModuleName} * @param namespace the {@link Optional} {@link Namespace} diff --git a/objectoriented-codemodel/src/main/java/module-info.java b/objectoriented-codemodel/src/main/java/module-info.java index bcc7587..2975e14 100644 --- a/objectoriented-codemodel/src/main/java/module-info.java +++ b/objectoriented-codemodel/src/main/java/module-info.java @@ -7,9 +7,9 @@ * 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 the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MarshallingTests.java b/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MarshallingTests.java index 42daa20..5951a37 100644 --- a/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MarshallingTests.java +++ b/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MarshallingTests.java @@ -306,7 +306,7 @@ void shouldMarshallAndTransportAndUnmarshallSuperUsage() void shouldMarshallAndTransportAndUnmarshallImplementsTypeDescriptor() throws IOException { - var namedTypeUsage = GenericTypeUsage.of(codeModel, TypeName.of( + final var namedTypeUsage = GenericTypeUsage.of(codeModel, TypeName.of( ModuleName.of("com.example", this.nameProvider), Optional.empty(), Optional.empty(), @@ -324,7 +324,7 @@ void shouldMarshallAndTransportAndUnmarshallImplementsTypeDescriptor() void shouldMarshallAndTransportAndUnmarshallExtendsTypeDescriptor() throws IOException { - var namedTypeUsage = GenericTypeUsage.of(codeModel, TypeName.of( + final var namedTypeUsage = GenericTypeUsage.of(codeModel, TypeName.of( ModuleName.of("com.example", this.nameProvider), Optional.empty(), Optional.empty(), @@ -333,7 +333,7 @@ void shouldMarshallAndTransportAndUnmarshallExtendsTypeDescriptor() marshallAndTransportAndUnMarshalAndAssert(ExtendsTypeDescriptor.of(namedTypeUsage)); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var unmarshalled = marshallAndTransportAndUnMarshal(original); @@ -348,7 +348,7 @@ private void marshallAndTransportAndUnMarshalAndAssert(T original) } } - private T marshallAndTransportAndUnMarshal(T original) + private T marshallAndTransportAndUnMarshal(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); diff --git a/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MethodDescriptorSignatureTests.java b/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MethodDescriptorSignatureTests.java index 784241e..85c2579 100644 --- a/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MethodDescriptorSignatureTests.java +++ b/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/descriptor/MethodDescriptorSignatureTests.java @@ -79,26 +79,28 @@ void setUp() { classNamespace = Namespace.of(IrreducibleName.of("com.example.MyService")); } - private TypeUsage specific(String qualifiedName) { + private TypeUsage specific(final String qualifiedName) { return SpecificTypeUsage.of(codeModel, naming.getTypeName(Optional.empty(), qualifiedName)); } - private TypeUsage specificWithModule(String module, String qualifiedName) { + private TypeUsage specificWithModule(final String module, final String qualifiedName) { return SpecificTypeUsage.of(codeModel, naming.getTypeName(naming.getModuleName(module), qualifiedName)); } - private FormalParameterDescriptor param(TypeUsage type) { + private FormalParameterDescriptor param(final TypeUsage type) { return FormalParameterDescriptor.of(codeModel, Optional.empty(), type); } - private MethodDescriptor method(String name, TypeUsage returnType, Optional namespace, - FormalParameterDescriptor... params) { + private MethodDescriptor method(final String name, + final TypeUsage returnType, + final Optional namespace, + final FormalParameterDescriptor... params) { final var methodName = MethodName.of(Optional.empty(), namespace, Optional.empty(), IrreducibleName.of(name)); return MethodDescriptor.of(declaringType, methodName, returnType, Stream.of(params)); } - private MethodDescriptor withModifier(MethodDescriptor descriptor, AccessModifier modifier) { + private MethodDescriptor withModifier(final MethodDescriptor descriptor, final AccessModifier modifier) { descriptor.addTrait(modifier); return descriptor; } diff --git a/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/naming/MarshallingTests.java b/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/naming/MarshallingTests.java index a92776b..728ef3a 100644 --- a/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/naming/MarshallingTests.java +++ b/objectoriented-codemodel/src/test/java/build/codemodel/objectoriented/naming/MarshallingTests.java @@ -95,7 +95,7 @@ void shouldMarshallAndTransportAndUnmarshallMethodName() IrreducibleName.of("fullyQualifiedMethod"))); } - private void marshallAndTransportAndUnMarshalAndAssert(T original) + private void marshallAndTransportAndUnMarshalAndAssert(final T original) throws IOException { final var marshaller = Marshalling.newMarshaller(); final var marshalled = marshaller.marshal(original); diff --git a/pom.xml b/pom.xml index ce98daa..03a719d 100644 --- a/pom.xml +++ b/pom.xml @@ -83,6 +83,8 @@ 3.2.8 3.12.0 2.7.1 + 3.28.0 + 7.26.0 3.4.0 3.4.0 3.5.5 @@ -363,6 +365,44 @@ true true false + true + suppressions.file=${maven.multiModuleProjectDirectory}/config/checkstyle/suppressions.xml + + + + validate + validate + + check + + + + + + + org.apache.maven.plugins + maven-pmd-plugin + ${maven-pmd-plugin.version} + + + net.sourceforge.pmd + pmd-core + ${pmd.version} + + + net.sourceforge.pmd + pmd-java + ${pmd.version} + + + + + ${maven.multiModuleProjectDirectory}/config/pmd/pmd-ruleset.xml + + false + true + true + true