Skip to content

Commit 08e966e

Browse files
Merge pull request #4433 from madurangasiriwardena/java21
Add Java 21 compile time support
2 parents 30439c9 + 45668ee commit 08e966e

File tree

109 files changed

+2789
-1659
lines changed

Some content is hidden

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

109 files changed

+2789
-1659
lines changed

.github/workflows/pr-builder.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build the project on pull requests with tests
22
# Uses:
33
# OS: ubuntu-latest
4-
# JDK: Adopt JDK 11
4+
# JDK: Adopt JDK 21
55

66
name: PR Builder
77

@@ -24,10 +24,10 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v2
27-
- name: Set up Adopt JDK 11
27+
- name: Set up Adopt JDK 21
2828
uses: actions/setup-java@v2
2929
with:
30-
java-version: "11"
30+
java-version: "21"
3131
distribution: "adopt"
3232
- name: Cache local Maven repository
3333
id: cache-maven-m2

core/feature-manager/org.wso2.carbon.feature.mgt.core/pom.xml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
<artifactId>org.wso2.carbon.utils</artifactId>
4141
</dependency>
4242
<dependency>
43-
<groupId>org.wso2.eclipse.equinox</groupId>
43+
<groupId>org.eclipse.platform</groupId>
4444
<artifactId>org.eclipse.equinox.p2.artifact.repository</artifactId>
4545
<exclusions>
4646
<exclusion>
4747
<groupId>org.wso2.eclipse.osgi</groupId>
4848
<artifactId>org.eclipse.osgi</artifactId>
4949
</exclusion>
5050
<exclusion>
51-
<groupId>org.wso2.eclipse.osgi</groupId>
51+
<groupId>org.eclipse.platform</groupId>
5252
<artifactId>org.eclipse.osgi.services</artifactId>
5353
</exclusion>
5454
<exclusion>
@@ -68,7 +68,7 @@
6868
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
6969
</exclusion>
7070
<exclusion>
71-
<groupId>org.eclipse.osgi</groupId>
71+
<groupId>org.eclipse.platform</groupId>
7272
<artifactId>org.eclipse.equinox.jsp.jasper</artifactId>
7373
</exclusion>
7474
<exclusion>
@@ -90,39 +90,39 @@
9090
<artifactId>org.eclipse.osgi</artifactId>
9191
</dependency>
9292
<dependency>
93-
<groupId>org.wso2.eclipse.osgi</groupId>
93+
<groupId>org.eclipse.platform</groupId>
9494
<artifactId>org.eclipse.osgi.services</artifactId>
9595
</dependency>
9696
<dependency>
97-
<groupId>org.wso2.eclipse.equinox</groupId>
97+
<groupId>org.eclipse.platform</groupId>
9898
<artifactId>org.eclipse.equinox.common</artifactId>
9999
</dependency>
100100
<dependency>
101-
<groupId>org.wso2.eclipse.equinox</groupId>
101+
<groupId>org.eclipse.platform</groupId>
102102
<artifactId>org.eclipse.equinox.p2.core</artifactId>
103103
</dependency>
104104
<dependency>
105-
<groupId>org.wso2.eclipse.equinox</groupId>
105+
<groupId>org.eclipse.platform</groupId>
106106
<artifactId>org.eclipse.equinox.p2.director</artifactId>
107107
</dependency>
108108
<dependency>
109-
<groupId>org.wso2.eclipse.equinox</groupId>
109+
<groupId>org.eclipse.platform</groupId>
110110
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
111111
</dependency>
112112
<dependency>
113-
<groupId>org.wso2.eclipse.equinox</groupId>
113+
<groupId>org.eclipse.platform</groupId>
114114
<artifactId>org.eclipse.equinox.p2.metadata</artifactId>
115115
</dependency>
116116
<dependency>
117-
<groupId>org.wso2.eclipse.equinox</groupId>
117+
<groupId>org.eclipse.platform</groupId>
118118
<artifactId>org.eclipse.equinox.p2.metadata.repository</artifactId>
119119
</dependency>
120120
<dependency>
121-
<groupId>org.wso2.eclipse.equinox</groupId>
121+
<groupId>org.eclipse.platform</groupId>
122122
<artifactId>org.eclipse.equinox.p2.repository</artifactId>
123123
</dependency>
124124
<dependency>
125-
<groupId>org.wso2.eclipse.equinox</groupId>
125+
<groupId>org.eclipse.platform</groupId>
126126
<artifactId>org.eclipse.equinox.simpleconfigurator</artifactId>
127127
</dependency>
128128
<dependency>
@@ -162,6 +162,10 @@
162162
<Export-Package>
163163
org.wso2.carbon.feature.mgt.core.*
164164
</Export-Package>
165+
<!-- TODO this is wrong. Just trying out -->
166+
<Provide-Capability>
167+
osgi.service;objectClass=org.eclipse.equinox.p2.core.IProvisioningAgentProvider
168+
</Provide-Capability>
165169
</instructions>
166170
</configuration>
167171
</plugin>

core/feature-manager/org.wso2.carbon.feature.mgt.services/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@
5454
<artifactId>org.wso2.carbon.feature.mgt.core</artifactId>
5555
</dependency>
5656
<dependency>
57-
<groupId>org.wso2.eclipse.equinox</groupId>
57+
<groupId>org.eclipse.platform</groupId>
5858
<artifactId>org.eclipse.equinox.p2.core</artifactId>
5959
</dependency>
6060
<dependency>
61-
<groupId>org.wso2.eclipse.equinox</groupId>
61+
<groupId>org.eclipse.platform</groupId>
6262
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
6363
</dependency>
6464
<dependency>
65-
<groupId>org.wso2.eclipse.equinox</groupId>
65+
<groupId>org.eclipse.platform</groupId>
6666
<artifactId>org.eclipse.equinox.p2.metadata</artifactId>
6767
</dependency>
6868
<dependency>
69-
<groupId>org.wso2.eclipse.equinox</groupId>
69+
<groupId>org.eclipse.platform</groupId>
7070
<artifactId>org.eclipse.equinox.p2.repository</artifactId>
7171
</dependency>
7272
<dependency>
73-
<groupId>org.wso2.eclipse.equinox</groupId>
73+
<groupId>org.eclipse.platform</groupId>
7474
<artifactId>org.eclipse.equinox.common</artifactId>
7575
</dependency>
7676
</dependencies>

core/feature-manager/org.wso2.carbon.p2.touchpoint/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
<dependencies>
1818
<dependency>
19-
<groupId>org.wso2.eclipse.equinox</groupId>
19+
<groupId>org.eclipse.platform</groupId>
2020
<artifactId>org.eclipse.equinox.common</artifactId>
2121
</dependency>
2222
<dependency>
23-
<groupId>org.wso2.eclipse.equinox</groupId>
23+
<groupId>org.eclipse.platform</groupId>
2424
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
2525
</dependency>
2626
</dependencies>

core/javax.cache/src/main/java/javax/cache/CacheManager.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
package javax.cache;
99

10-
import javax.transaction.UserTransaction;
11-
1210
/**
1311
* A CacheManager is used for looking up Caches and controls their lifecycle. It represents a collection of caches.
1412
* <p/>
@@ -127,14 +125,6 @@ public interface CacheManager {
127125
*/
128126
boolean removeCache(String cacheName);
129127

130-
/**
131-
* This method will return a UserTransaction.
132-
*
133-
* @return the UserTransaction.
134-
* @throws UnsupportedOperationException if JTA is not supported
135-
*/
136-
UserTransaction getUserTransaction();
137-
138128
/**
139129
* Indicates whether a optional feature is supported by this CacheManager.
140130
*

core/javax.cache/src/main/java/org/wso2/carbon/caching/impl/CarbonCacheManager.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,24 @@
1717
*/
1818
package org.wso2.carbon.caching.impl;
1919

20-
import org.wso2.carbon.context.CarbonContext;
2120
import org.wso2.carbon.base.ServerConfiguration;
21+
import org.wso2.carbon.context.CarbonContext;
2222
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
2323

24-
import javax.cache.Cache;
25-
import javax.cache.CacheBuilder;
26-
import javax.cache.CacheException;
27-
import javax.cache.CacheManager;
28-
import javax.cache.OptionalFeature;
29-
import javax.cache.Status;
3024
import java.util.Collections;
3125
import java.util.HashSet;
3226
import java.util.Map;
3327
import java.util.concurrent.ConcurrentHashMap;
3428
import java.util.regex.Matcher;
3529
import java.util.regex.Pattern;
3630

31+
import javax.cache.Cache;
32+
import javax.cache.CacheBuilder;
33+
import javax.cache.CacheException;
34+
import javax.cache.CacheManager;
35+
import javax.cache.OptionalFeature;
36+
import javax.cache.Status;
37+
3738
import static org.wso2.carbon.caching.impl.CachingConstants.ILLEGAL_STATE_EXCEPTION_MESSAGE;
3839

3940
/**
@@ -202,14 +203,6 @@ boolean removeLocalCaches() {
202203
return this.caches.isEmpty();
203204
}
204205

205-
@Override
206-
public javax.transaction.UserTransaction getUserTransaction() {
207-
Util.checkAccess(ownerTenantDomain, ownerTenantId);
208-
checkStatusStarted();
209-
touch();
210-
return null; //To change body of implemented methods use File | Settings | File Templates.
211-
}
212-
213206
@Override
214207
public boolean isSupported(OptionalFeature optionalFeature) {
215208
Util.checkAccess(ownerTenantDomain, ownerTenantId);

core/org.wso2.carbon.application.deployer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<artifactId>org.eclipse.osgi</artifactId>
3838
</dependency>
3939
<dependency>
40-
<groupId>org.wso2.eclipse.osgi</groupId>
40+
<groupId>org.eclipse.platform</groupId>
4141
<artifactId>org.eclipse.osgi.services</artifactId>
4242
</dependency>
4343
<dependency>

core/org.wso2.carbon.base/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<plugin>
3737
<groupId>org.apache.felix</groupId>
3838
<artifactId>maven-bundle-plugin</artifactId>
39-
4039
<extensions>true</extensions>
4140
<configuration>
4241
<instructions>
@@ -48,7 +47,7 @@
4847
org.wso2.carbon.base.*; version="1.0.0"
4948
</Export-Package>
5049
<Import-Package>
51-
javax.activation.*;version="[0.0.0, 1.0.0)",
50+
javax.activation.*;version="[0.0.0, 1.0.0)";resolution:=optional,
5251
javax.servlet; version="${imp.pkg.version.javax.servlet}",
5352
javax.servlet.http; version="${imp.pkg.version.javax.servlet}",
5453
org.wso2.securevault.*,
@@ -59,6 +58,9 @@
5958
<Import-Package>
6059
*;resolution:=optional
6160
</Import-Package>
61+
<Provide-Capability>
62+
osgi.service;objectClass=org.wso2.carbon.base.api.ServerConfigurationService
63+
</Provide-Capability>
6264
</instructions>
6365
</configuration>
6466
</plugin>
@@ -67,12 +69,19 @@
6769
<artifactId>maven-surefire-plugin</artifactId>
6870
<inherited>true</inherited>
6971
<configuration>
72+
<argLine>
73+
--add-opens=java.base/java.lang=ALL-UNNAMED
74+
--add-opens=java.base/java.util=ALL-UNNAMED
75+
</argLine>
7076
<classpathDependencyExcludes>
7177
<classpathDependencyExclude>org.wso2.org.ops4j.pax.logging:pax-logging-api</classpathDependencyExclude>
7278
</classpathDependencyExcludes>
7379
<systemPropertyVariables>
7480
<java.util.logging.manager>org.apache.logging.log4j.jul.LogManager</java.util.logging.manager>
7581
</systemPropertyVariables>
82+
<suiteXmlFiles>
83+
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
84+
</suiteXmlFiles>
7685
</configuration>
7786
</plugin>
7887
</plugins>
@@ -118,6 +127,7 @@
118127
<groupId>org.eclipse.equinox</groupId>
119128
<artifactId>javax.servlet</artifactId>
120129
</dependency>
130+
121131
<dependency>
122132
<groupId>org.wso2.orbit.xerces</groupId>
123133
<artifactId>xercesImpl</artifactId>

core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/api/ServerConfigurationService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.wso2.carbon.base.api;
22

3+
import org.osgi.service.component.annotations.Component;
34
import org.w3c.dom.Element;
45

56
import java.util.Set;

core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/internal/CarbonBaseActivator.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@
2222
import org.apache.commons.logging.LogFactory;
2323
import org.osgi.framework.BundleActivator;
2424
import org.osgi.framework.BundleContext;
25-
import org.osgi.framework.ServiceReference;
2625
import org.osgi.framework.ServiceRegistration;
27-
import org.wso2.carbon.base.CarbonBaseConstants;
2826
import org.wso2.carbon.base.CarbonBaseUtils;
2927
import org.wso2.carbon.base.ServerConfiguration;
3028
import org.wso2.carbon.base.ServerConfigurationException;
3129
import org.wso2.carbon.base.api.ServerConfigurationService;
3230

31+
import java.io.File;
32+
import java.io.FileInputStream;
33+
import java.io.FileNotFoundException;
34+
import java.io.IOException;
35+
import java.io.InputStream;
36+
3337
import javax.servlet.ServletException;
34-
import java.io.*;
3538

3639
/**
3740
* Activator of the {@link org.wso2.carbon.base} bundle
@@ -52,7 +55,6 @@ public void start(BundleContext bundleContext) throws Exception {
5255
System.setProperty("portOffset", portOffset);
5356
//register carbon server confg as an OSGi service
5457
registration = bundleContext.registerService(ServerConfigurationService.class.getName(), carbonServerConfiguration, null);
55-
5658
}
5759

5860
@Override

0 commit comments

Comments
 (0)