-
Notifications
You must be signed in to change notification settings - Fork 654
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
Add support to compile with Java 17 #4014
base: 4.10.x
Are you sure you want to change the base?
Changes from all commits
c082afa
1294ab5
7785b46
11b6ab0
ffb8865
284513f
7bdf395
6e498d7
4ae125a
f034f49
a42d8bd
34a1854
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,23 +17,24 @@ | |
*/ | ||
package org.wso2.carbon.caching.impl; | ||
|
||
import org.wso2.carbon.context.CarbonContext; | ||
import org.wso2.carbon.base.ServerConfiguration; | ||
import org.wso2.carbon.context.CarbonContext; | ||
import org.wso2.carbon.utils.multitenancy.MultitenantConstants; | ||
|
||
import javax.cache.Cache; | ||
import javax.cache.CacheBuilder; | ||
import javax.cache.CacheException; | ||
import javax.cache.CacheManager; | ||
import javax.cache.OptionalFeature; | ||
import javax.cache.Status; | ||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
import javax.cache.Cache; | ||
import javax.cache.CacheBuilder; | ||
import javax.cache.CacheException; | ||
import javax.cache.CacheManager; | ||
import javax.cache.OptionalFeature; | ||
import javax.cache.Status; | ||
|
||
import static org.wso2.carbon.caching.impl.CachingConstants.ILLEGAL_STATE_EXCEPTION_MESSAGE; | ||
|
||
/** | ||
|
@@ -202,13 +203,13 @@ boolean removeLocalCaches() { | |
return this.caches.isEmpty(); | ||
} | ||
|
||
@Override | ||
public javax.transaction.UserTransaction getUserTransaction() { | ||
Util.checkAccess(ownerTenantDomain, ownerTenantId); | ||
checkStatusStarted(); | ||
touch(); | ||
return null; //To change body of implemented methods use File | Settings | File Templates. | ||
} | ||
// @Override | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// public javax.transaction.UserTransaction getUserTransaction() { | ||
// Util.checkAccess(ownerTenantDomain, ownerTenantId); | ||
// checkStatusStarted(); | ||
// touch(); | ||
// return null; //To change body of implemented methods use File | Settings | File Templates. | ||
// } | ||
|
||
@Override | ||
public boolean isSupported(OptionalFeature optionalFeature) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
import org.apache.commons.logging.LogFactory; | ||
import org.apache.xerces.impl.Constants; | ||
import org.apache.xerces.util.SecurityManager; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.w3c.dom.Element; | ||
import org.wso2.carbon.base.api.ServerConfigurationService; | ||
import org.wso2.carbon.securevault.SecretManagerInitializer; | ||
|
@@ -55,6 +56,7 @@ | |
* This class stores the configuration of the Carbon Server. | ||
*/ | ||
@SuppressWarnings("unused") | ||
//@Component(service = ServerConfigurationService.class) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this. |
||
public class ServerConfiguration implements ServerConfigurationService { | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ public void setSecurityManager() { | |
String resourcePath = resourceURL.getPath(); | ||
resourcePath = resourcePath + "policy-test.policy"; | ||
System.setProperty("java.security.policy", resourcePath); | ||
System.setSecurityManager(new SecurityManager()); | ||
// System.setSecurityManager(new SecurityManager()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security manager not working properly with Java 17. Hence need to get rid of security manager. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
~ | ||
~ WSO2 Inc. licenses this file to you under the Apache License, | ||
~ Version 2.0 (the "License"); you may not use this file except | ||
~ in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, | ||
~ software distributed under the License is distributed on an | ||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
~ KIND, either express or implied. See the License for the | ||
~ specific language governing permissions and limitations | ||
~ under the License. | ||
--> | ||
|
||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | ||
|
||
<suite name="Carbon-Kernel-Core_Test-Suite"> | ||
<test name="carbon-core-unit-tests" preserve-order="true" parallel="false"> | ||
<classes> | ||
<class name="org.wso2.carbon.base.CarbonApplicationContextHolderBaseTest" /> | ||
<class name="org.wso2.carbon.base.CarbonBaseUtilsTest" /> | ||
<!-- <class name="org.wso2.carbon.base.CarbonBaseUtilsWithIncorrectSecPolicy" />--> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security manager related functionality is not working with JDK 17. |
||
<class name="org.wso2.carbon.base.CarbonContextHolderBaseTest" /> | ||
<!-- <class name="org.wso2.carbon.base.ServerConfigurationTest" />--> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test was working incorrectly before. Due to a new validation added in Files API, this is failing now. |
||
</classes> | ||
</test> | ||
</suite> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javax.transaction
is not available with JDK 17. Since this seems to be not used, removed. But need to validate the functionality.