Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WELD-2753 Apply formatter changes #178

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ jobs:
java-version: 17,
}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java.name }}
uses: actions/setup-java@v1.4.3
uses: actions/setup-java@v3.12.0
with:
java-version: ${{ matrix.java.java-version }}
distribution: 'temurin'
- name: "Build with Maven"
run: |
mvn clean install
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.project
.settings
.classpath
.cache
target
*.iml
.idea/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
<version>46</version>
<version>47</version>
</parent>

<prerequisites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ public interface CDI11Bootstrap extends Bootstrap {
*
* <p>
* The container fires the {@link BeforeBeanDiscovery} event which allows extensions to register scopes and stereotypes.
* The container combines the registered scopes and stereotypes with scopes associated with the built-in contexts and built-in
* stereotypes and makes the resulting set available through {@link TypeDiscoveryConfiguration#getKnownBeanDefiningAnnotations()}
* The container combines the registered scopes and stereotypes with scopes associated with the built-in contexts and
* built-in
* stereotypes and makes the resulting set available through
* {@link TypeDiscoveryConfiguration#getKnownBeanDefiningAnnotations()}
* </p>
*
* <p>
Expand All @@ -83,10 +85,13 @@ public interface CDI11Bootstrap extends Bootstrap {
*
* <ul>
* <li>The set of annotations returned from {@link TypeDiscoveryConfiguration#getKnownBeanDefiningAnnotations()}</li>
* <li>Every Java annotation discovered by the integrator that is annotated with {@link NormalScope} or {@link Stereotype}</li>
* <li>Every Java annotation discovered by the integrator that is annotated with {@link NormalScope} or
* {@link Stereotype}</li>
* </ul>
*
* <p>The resulting set is referred to as <em>bean defining annotations</em> hereafter.</p>
* <p>
* The resulting set is referred to as <em>bean defining annotations</em> hereafter.
* </p>
*
* <p>
* Next, the integrator processes available archives according to these rules. The rules are exclusive.
Expand Down Expand Up @@ -137,15 +142,17 @@ public interface CDI11Bootstrap extends Bootstrap {
*
* <p>
* For each explicit bean archive the integrator creates an instance of {@link BeanDeploymentArchive} representing this
* archive. The {@link BeanDeploymentArchive#getBeanClasses()} or {@link BeanDeploymentArchive#getLoadedBeanClasses()} method returns a collection of all types present within the
* archive. The {@link BeanDeploymentArchive#getBeanClasses()} or {@link BeanDeploymentArchive#getLoadedBeanClasses()}
* method returns a collection of all types present within the
* archive. Filtering rules defined in {@link BeansXml#getScanning()} are not required to be applied by the integrator and
* are applied later on by Weld. The {@link BeanDeploymentArchive#getEjbs()} method returns a collection of EJB descriptors
* for EJBs present in the archive.
* </p>
*
* <p>
* For each implicit bean archive the integrator creates an instance of {@link BeanDeploymentArchive} representing this
* archive. The {@link BeanDeploymentArchive#getBeanClasses()} or {@link BeanDeploymentArchive#getLoadedBeanClasses()} method of the bean archive returns all the types found in the
* archive. The {@link BeanDeploymentArchive#getBeanClasses()} or {@link BeanDeploymentArchive#getLoadedBeanClasses()}
* method of the bean archive returns all the types found in the
* archive which are annotated with a bean defining annotations or are Session bean definitions. Filtering rules (
* {@link BeansXml#getScanning()}) are not required to be applied by the integrator. The
* {@link BeanDeploymentArchive#getEjbs()} method returns a collection of EJB descriptors for Session beans present in the
Expand Down Expand Up @@ -176,7 +183,8 @@ public interface CDI11Bootstrap extends Bootstrap {
*
* <p>
* In addition to {@link Bootstrap#startContainer(Environment, Deployment)}, this method allows an identifier (contextId) to
* be assigned to the container. This identifier will be used to identify this application when invoking {@link Singleton} methods.
* be assigned to the container. This identifier will be used to identify this application when invoking {@link Singleton}
* methods.
*
* @param contextId the identifier of this application container instance
* @param environment the environment in use, by default {@link Environments#EE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public interface Environment {
Set<Class<? extends Service>> getRequiredBeanDeploymentArchiveServices();

/**
* Environment aware of EE modules. In such environment each bean archive which belongs to a module should register {@link EEModuleDescriptor}
* Environment aware of EE modules. In such environment each bean archive which belongs to a module should register
* {@link EEModuleDescriptor}
*
* @return true by default
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public interface ServiceRegistry extends Iterable<Service> {
* @param <S> the service type to add
* @param type the service type to add
* @param service the service implementation
* @return null if no service implementation was previously associated with the given service. Otherwise, the previous service implementation is returned.
* @return null if no service implementation was previously associated with the given service. Otherwise, the previous
* service implementation is returned.
*/
<S extends Service> S addIfAbsent(Class<S> type, S service);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
package org.jboss.weld.bootstrap.api;

/**
* Holds a reference to an application singleton. This singleton is used internally by Weld to store various application scoped objects.
* Holds a reference to an application singleton. This singleton is used internally by Weld to store various application scoped
* objects.
*
* This allows Weld to operate as a shared library. In a shared mode, the same instance of Weld implementation is used by all the applications in a server
* This allows Weld to operate as a shared library. In a shared mode, the same instance of Weld implementation is used by all
* the applications in a server
* environment. In the exclusive mode, each application loads a separate copy of Weld implementation at the application level.
*
* Alternative implementations of Singleton can be used as required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ private static class IsolatedStaticSingleton<T> implements Singleton<T> {

public T get(String id) {
if (object == null) {
throw new IllegalStateException("Singleton is not set. Is your Thread.currentThread().getContextClassLoader() set correctly?");
throw new IllegalStateException(
"Singleton is not set. Is your Thread.currentThread().getContextClassLoader() set correctly?");
}
return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public interface BeanDeploymentArchive {
* </p>
*
* <p>
* For an implicit bean archive this method returns all the types found in the archive which are annotated with a bean defining annotation or are Session
* For an implicit bean archive this method returns all the types found in the archive which are annotated with a bean
* defining annotation or are Session
* bean definitions.
* </p>
*
Expand All @@ -72,7 +73,8 @@ public interface BeanDeploymentArchive {
/**
* Get all pre-loaded classes for the bean deployment archive.
*
* Weld checks if there is an overlap of FQCNs between the classes returned from this method and class names returned from {@link #getBeanClasses()}.
* Weld checks if there is an overlap of FQCNs between the classes returned from this method and class names returned from
* {@link #getBeanClasses()}.
* If two names overlap the class object returned from this method is used.
*
* @return the classes, empty if no pre-loaded classes are available
Expand All @@ -83,8 +85,10 @@ default Collection<Class<?>> getLoadedBeanClasses() {
}

/**
* If possible, return all the classes found in the archive. For explicit bean archive the result of this method should be the same as for
* {@link #getBeanClasses()}. For implicit bean archive this method should also return types which are neither annotated with bean defining annotations nor
* If possible, return all the classes found in the archive. For explicit bean archive the result of this method should be
* the same as for
* {@link #getBeanClasses()}. For implicit bean archive this method should also return types which are neither annotated
* with bean defining annotations nor
* are Session bean definitions.
*
* @return all classes found in the bean deployment archive, empty if no classes are present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String getVersion() {
return null;
}

public boolean isTrimmed(){
public boolean isTrimmed() {
return false;
}
};
Expand All @@ -67,7 +67,8 @@ public boolean isTrimmed(){
* Note that since CDI 4.0, this method returns {@link BeanDiscoveryMode#ANNOTATED} if the file does not declare
* discovery mode attribute.
*
* @return The value of the <code>bean-discovery-mode</code> attribute or {@link BeanDiscoveryMode#ANNOTATED} if the file does not
* @return The value of the <code>bean-discovery-mode</code> attribute or {@link BeanDiscoveryMode#ANNOTATED} if the file
* does not
* contain the <code>bean-discovery-mode</code> attribute.
*/
BeanDiscoveryMode getBeanDiscoveryMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public interface ClassAvailableActivation {

/**
* The name attribute
*
* @return the name attribute
*/
String getClassName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
*
* <p>
* The BeanDeploymentArchive tree represents the "logical structure" of the deployment; Given two archives A and B, which have a
* transitive closure of accessible archives A' and B', it allowable for the the archives A &amp; B to be represented as a single
* transitive closure of accessible archives A' and B', it allowable for the the archives A &amp; B to be represented as a
* single
* BeanDeploymentArchive, assuming that A' and B' are bi-directionally accessible.
* </p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,21 @@
import org.jboss.weld.bootstrap.spi.helpers.EEModuleDescriptorImpl;

/**
* In Java EE environment, each {@link BeanDeploymentArchive} should provide a description of the Java EE module it belongs to (WAR, RAR, etc.). This applies to
* physical bean archives deployed within the given module and also to logical bean archives that belong to the module. Bean archives that are not part of a
* In Java EE environment, each {@link BeanDeploymentArchive} should provide a description of the Java EE module it belongs to
* (WAR, RAR, etc.). This applies to
* physical bean archives deployed within the given module and also to logical bean archives that belong to the module. Bean
* archives that are not part of a
* Java EE module (e.g. built-in server libraries) are not required to have a {@link EEModuleDescriptor} service registered.
*
* <p>
* {@link EEModuleDescriptor} is a per-BDA service.
* </p>
*
* <p>
* It is recommended to share an immutable {@link EEModuleDescriptor} instance for all bean deployment archives of the same Java EE module. However, each bean
* deployment archive may register its own {@link EEModuleDescriptor} instance. In this case, all descriptors representing a given EE module must use the same
* It is recommended to share an immutable {@link EEModuleDescriptor} instance for all bean deployment archives of the same Java
* EE module. However, each bean
* deployment archive may register its own {@link EEModuleDescriptor} instance. In this case, all descriptors representing a
* given EE module must use the same
* id and type.
* </p>
*
Expand All @@ -47,7 +51,11 @@ public interface EEModuleDescriptor extends Service {
*
*/
public enum ModuleType {
EAR, WEB, EJB_JAR, APPLICATION_CLIENT, CONNECTOR
EAR,
WEB,
EJB_JAR,
APPLICATION_CLIENT,
CONNECTOR
}

/**
Expand Down
73 changes: 38 additions & 35 deletions weld-spi/src/main/java/org/jboss/weld/bootstrap/spi/Filter.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
package org.jboss.weld.bootstrap.spi;

import java.util.Collection;

/**
* <p>
* {@link Filter} is a data structures representing the &lt;exclude&gt; elements beans.xml (Since CDI 1.1). See the XSD for
* details of the semantics of &lt;exclude&gt;.
* </p>
*
* @see <a href="https://github.com/jboss/cdi/blob/master/api/src/main/resources/beans_1_1.xsd">Beans 1.1</a>
*
* @author Pete Muir
* @see Scanning
*/
public interface Filter {

/**
* The name attribute
* @return the name attribute
*/
String getName();

/**
* Nested &lt;if-system-property&gt; elements
* @return nested &lt;if-system-property&gt; elements
*/
Collection<Metadata<SystemPropertyActivation>> getSystemPropertyActivations();

/**
* Nested &lt;if-class-available&gt; elements
* @return nested &lt;if-class-available&gt; elements
*/
Collection<Metadata<ClassAvailableActivation>> getClassAvailableActivations();

package org.jboss.weld.bootstrap.spi;

import java.util.Collection;

/**
* <p>
* {@link Filter} is a data structures representing the &lt;exclude&gt; elements beans.xml (Since CDI 1.1). See the XSD for
* details of the semantics of &lt;exclude&gt;.
* </p>
*
* @see <a href="https://github.com/jboss/cdi/blob/master/api/src/main/resources/beans_1_1.xsd">Beans 1.1</a>
*
* @author Pete Muir
* @see Scanning
*/
public interface Filter {

/**
* The name attribute
*
* @return the name attribute
*/
String getName();

/**
* Nested &lt;if-system-property&gt; elements
*
* @return nested &lt;if-system-property&gt; elements
*/
Collection<Metadata<SystemPropertyActivation>> getSystemPropertyActivations();

/**
* Nested &lt;if-class-available&gt; elements
*
* @return nested &lt;if-class-available&gt; elements
*/
Collection<Metadata<ClassAvailableActivation>> getClassAvailableActivations();

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ public interface Metadata<T> {

/**
* The metadata value
*
* @return the metadata value
*/
T getValue();

/**
* The location of the metadata, used in error and log messages
*
* @return location of the metadata, used in error and log messages
*/
String getLocation();
Expand Down