Skip to content

Commit 7465df0

Browse files
committed
Updated to jspecify annotations
1 parent 6b30a3f commit 7465df0

File tree

177 files changed

+1413
-1439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+1413
-1439
lines changed

phase2-demo-webapp/src/main/java/com/helger/phase2/webapp/module/ConfigurableAS2MDNServletReceiverModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
*/
1717
package com.helger.phase2.webapp.module;
1818

19+
import org.jspecify.annotations.NonNull;
20+
1921
import com.helger.phase2.processor.receiver.net.AS2MDNReceiverHandler;
2022
import com.helger.phase2.servlet.util.AS2ServletMDNReceiverModule;
2123

22-
import jakarta.annotation.Nonnull;
23-
2424
/**
2525
* Configurable version of {@link AS2ServletMDNReceiverModule}.
2626
*
@@ -29,7 +29,7 @@
2929
public class ConfigurableAS2MDNServletReceiverModule extends AS2ServletMDNReceiverModule
3030
{
3131
@Override
32-
@Nonnull
32+
@NonNull
3333
public AS2MDNReceiverHandler createHandler ()
3434
{
3535
final AS2MDNReceiverHandler ret = super.createHandler ();

phase2-demo-webapp/src/main/java/com/helger/phase2/webapp/module/ConfigurableAS2ServletReceiverModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
*/
1717
package com.helger.phase2.webapp.module;
1818

19+
import org.jspecify.annotations.NonNull;
20+
1921
import com.helger.phase2.processor.receiver.net.AS2ReceiverHandler;
2022
import com.helger.phase2.servlet.util.AS2ServletReceiverModule;
2123

22-
import jakarta.annotation.Nonnull;
23-
2424
/**
2525
* Configurable version of {@link AS2ServletReceiverModule}.
2626
*
@@ -29,7 +29,7 @@
2929
public class ConfigurableAS2ServletReceiverModule extends AS2ServletReceiverModule
3030
{
3131
@Override
32-
@Nonnull
32+
@NonNull
3333
public AS2ReceiverHandler createHandler ()
3434
{
3535
final AS2ReceiverHandler ret = super.createHandler ();

phase2-demo-webapp/src/main/java/com/helger/phase2/webapp/servlet/AS2WebAppListener.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
*/
1717
package com.helger.phase2.webapp.servlet;
1818

19+
import org.jspecify.annotations.NonNull;
20+
1921
import com.helger.web.scope.mgr.WebScopeManager;
2022

21-
import jakarta.annotation.Nonnull;
2223
import jakarta.servlet.ServletContext;
2324
import jakarta.servlet.ServletContextEvent;
2425
import jakarta.servlet.ServletContextListener;
@@ -39,13 +40,13 @@ public class AS2WebAppListener implements ServletContextListener
3940
* @param aSC
4041
* The servlet context. May not be <code>null</code>.
4142
*/
42-
public static void staticInit (@Nonnull final ServletContext aSC)
43+
public static void staticInit (@NonNull final ServletContext aSC)
4344
{
4445
com.helger.phase2.servlet.AS2WebAppListener.staticInit (aSC);
4546
GlobalAS2Session.ensureClassIsLoaded ();
4647
}
4748

48-
public void contextInitialized (@Nonnull final ServletContextEvent aSCE)
49+
public void contextInitialized (@NonNull final ServletContextEvent aSCE)
4950
{
5051
final ServletContext aSC = aSCE.getServletContext ();
5152
staticInit (aSC);
@@ -60,7 +61,7 @@ public static void staticDestroy ()
6061
WebScopeManager.onGlobalEnd ();
6162
}
6263

63-
public void contextDestroyed (@Nonnull final ServletContextEvent aSce)
64+
public void contextDestroyed (@NonNull final ServletContextEvent aSce)
6465
{
6566
staticDestroy ();
6667
}

phase2-lib/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
com.helger.phase2.util.http,
153153
com.helger.phase2.util.javamail
154154
</Export-Package>
155-
<Import-Package>!jakarta.annotation.*,*</Import-Package>
155+
<Import-Package>!org.jspecify.annotations.*,*</Import-Package>
156156
<Include-Resource>{maven-resources},phase2-version.properties=target/classes/phase2-version.properties</Include-Resource>
157157
</instructions>
158158
</configuration>

phase2-lib/src/main/java/com/helger/phase2/AbstractDynamicComponent.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
*/
3333
package com.helger.phase2;
3434

35+
import org.jspecify.annotations.NonNull;
36+
import org.jspecify.annotations.Nullable;
37+
3538
import com.helger.annotation.OverridingMethodsMustInvokeSuper;
3639
import com.helger.annotation.concurrent.GuardedBy;
3740
import com.helger.annotation.style.ReturnsMutableObject;
@@ -45,9 +48,6 @@
4548
import com.helger.typeconvert.collection.IStringMap;
4649
import com.helger.typeconvert.collection.StringMap;
4750

48-
import jakarta.annotation.Nonnull;
49-
import jakarta.annotation.Nullable;
50-
5151
/**
5252
* Abstract implementation of {@link IDynamicComponent}.
5353
*
@@ -60,7 +60,7 @@ public abstract class AbstractDynamicComponent implements IDynamicComponent
6060
private final StringMap m_aAttrs = new StringMap ();
6161
private IAS2Session m_aSession;
6262

63-
@Nonnull
63+
@NonNull
6464
@ReturnsMutableObject
6565
public final StringMap attrs ()
6666
{
@@ -73,24 +73,24 @@ public String getName ()
7373
return ClassHelper.getClassLocalName (this);
7474
}
7575

76-
@Nonnull
77-
public final String getAttributeAsStringRequired (@Nonnull final String sKey) throws AS2InvalidParameterException
76+
@NonNull
77+
public final String getAttributeAsStringRequired (@NonNull final String sKey) throws AS2InvalidParameterException
7878
{
7979
final String sValue = m_aRWLock.readLockedGet ( () -> attrs ().getAsString (sKey));
8080
if (sValue == null)
8181
throw new AS2InvalidParameterException ("Parameter not found", this, sKey, null);
8282
return sValue;
8383
}
8484

85-
public final int getAttributeAsIntRequired (@Nonnull final String sKey) throws AS2InvalidParameterException
85+
public final int getAttributeAsIntRequired (@NonNull final String sKey) throws AS2InvalidParameterException
8686
{
8787
final int nValue = m_aRWLock.readLockedInt ( () -> attrs ().getAsInt (sKey, Integer.MIN_VALUE));
8888
if (nValue == Integer.MIN_VALUE)
8989
throw new AS2InvalidParameterException ("Parameter not found", this, sKey, null);
9090
return nValue;
9191
}
9292

93-
@Nonnull
93+
@NonNull
9494
public final IAS2Session getSession ()
9595
{
9696
if (m_aSession == null)
@@ -99,7 +99,7 @@ public final IAS2Session getSession ()
9999
}
100100

101101
@OverridingMethodsMustInvokeSuper
102-
public void initDynamicComponent (@Nonnull final IAS2Session aSession, @Nullable final IStringMap aParameters)
102+
public void initDynamicComponent (@NonNull final IAS2Session aSession, @Nullable final IStringMap aParameters)
103103
throws AS2Exception
104104
{
105105
m_aSession = ValueEnforcer.notNull (aSession, "Session");

phase2-lib/src/main/java/com/helger/phase2/IDynamicComponent.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
*/
3333
package com.helger.phase2;
3434

35+
import org.jspecify.annotations.NonNull;
36+
import org.jspecify.annotations.Nullable;
37+
3538
import com.helger.phase2.exception.AS2Exception;
3639
import com.helger.phase2.params.AS2InvalidParameterException;
3740
import com.helger.phase2.session.IAS2Session;
3841
import com.helger.typeconvert.collection.IStringMap;
3942

40-
import jakarta.annotation.Nonnull;
41-
import jakarta.annotation.Nullable;
42-
4343
/**
4444
* The Component interface provides a standard way to dynamically create and initialize an object.
4545
* Component-based objects also have access to a Session, which allow each component to access all
@@ -57,7 +57,7 @@ public interface IDynamicComponent
5757
/**
5858
* @return The attributes of this component.
5959
*/
60-
@Nonnull
60+
@NonNull
6161
IStringMap attrs ();
6262

6363
/**
@@ -76,7 +76,7 @@ public interface IDynamicComponent
7676
*
7777
* @return this component's session. Never <code>null</code>.
7878
*/
79-
@Nonnull
79+
@NonNull
8080
IAS2Session getSession ();
8181

8282
/**
@@ -95,5 +95,5 @@ public interface IDynamicComponent
9595
* If a required parameter is null in the parameters Map
9696
* @see IAS2Session
9797
*/
98-
void initDynamicComponent (@Nonnull IAS2Session aSession, @Nullable IStringMap aParameters) throws AS2Exception;
98+
void initDynamicComponent (@NonNull IAS2Session aSession, @Nullable IStringMap aParameters) throws AS2Exception;
9999
}

phase2-lib/src/main/java/com/helger/phase2/cert/AS2CertificateNotFoundException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434

3535
import java.security.cert.X509Certificate;
3636

37+
import org.jspecify.annotations.NonNull;
38+
import org.jspecify.annotations.Nullable;
39+
3740
import com.helger.phase2.exception.AS2Exception;
3841
import com.helger.phase2.partner.Partnership;
3942

40-
import jakarta.annotation.Nonnull;
41-
import jakarta.annotation.Nullable;
42-
4343
public class AS2CertificateNotFoundException extends AS2Exception
4444
{
4545
private final ECertificatePartnershipType m_ePartnershipType;
4646
private final String m_sAlias;
4747

4848
public AS2CertificateNotFoundException (@Nullable final ECertificatePartnershipType ePartnershipType,
49-
@Nonnull final Partnership aPartnership)
49+
@NonNull final Partnership aPartnership)
5050
{
5151
super ("Type " + ePartnershipType + ": no alias found for partnership " + aPartnership);
5252
m_ePartnershipType = ePartnershipType;

phase2-lib/src/main/java/com/helger/phase2/cert/AS2KeyNotFoundException.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@
3434

3535
import java.security.cert.X509Certificate;
3636

37+
import org.jspecify.annotations.NonNull;
38+
import org.jspecify.annotations.Nullable;
39+
3740
import com.helger.collection.commons.ICommonsList;
3841
import com.helger.phase2.exception.AS2Exception;
3942

40-
import jakarta.annotation.Nonnull;
41-
import jakarta.annotation.Nullable;
42-
4343
/**
4444
* AS2 exception to be thrown if a private key is not found
4545
*
4646
* @author Philip Helger
4747
*/
4848
public class AS2KeyNotFoundException extends AS2Exception
4949
{
50-
public AS2KeyNotFoundException (@Nonnull final X509Certificate aCert,
50+
public AS2KeyNotFoundException (@NonNull final X509Certificate aCert,
5151
@Nullable final String sAlias,
52-
@Nonnull final ICommonsList <String> aAllAliases,
52+
@NonNull final ICommonsList <String> aAllAliases,
5353
@Nullable final Throwable aCause)
5454
{
5555
super ("Alias '" + sAlias + "' for Certificate '" + aCert + "'. All contained aliases are: " + aAllAliases, aCause);

0 commit comments

Comments
 (0)