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

clean up warnings #1269

Merged
merged 3 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions dbws/org.eclipse.persistence.dbws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
</parent>

<properties>
<!-- disable warnings for exports for now -->
<comp.xlint>-Xlint:all,-rawtypes,-unchecked,-serial,-exports</comp.xlint>
<test-skip-dbws>${skipTests}</test-skip-dbws>
</properties>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -25,6 +25,7 @@ public XRCustomer() {
super();
}

@Override
public XRDynamicPropertiesManager fetchPropertiesManager() {
return DPM;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -88,20 +88,19 @@ public void buildTestClass() throws ClassNotFoundException {

@SuppressWarnings("unchecked")
@Test
public void buildTestEntity() throws InstantiationException, IllegalAccessException,
NoSuchFieldException {
public void buildTestEntity() throws ReflectiveOperationException {
XRDynamicClassLoader xrdcl =
new XRDynamicClassLoader(XRDynamicEntityTestSuite.class.getClassLoader());
Class<XRDynamicEntity> testClass =
(Class<XRDynamicEntity>)xrdcl.createDynamicClass(TEST_CLASSNAME);
XRDynamicEntity newInstance = testClass.newInstance();
XRDynamicEntity newInstance = testClass.getConstructor().newInstance();
XRDynamicPropertiesManager xrDPM = newInstance.fetchPropertiesManager();
Set<String> propertyNames = new HashSet<String>();
propertyNames.add(FIELD_1);
propertyNames.add(FIELD_2);
xrDPM.setPropertyNames(propertyNames);
//build instance
XRDynamicEntity newInstance2 = testClass.newInstance();
XRDynamicEntity newInstance2 = testClass.getConstructor().newInstance();
assertNotNull(newInstance2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
requires static jakarta.servlet; //AM

requires org.eclipse.persistence.asm;
requires org.eclipse.persistence.core;
requires org.eclipse.persistence.jpa;
requires org.eclipse.persistence.jpa.jpql;
requires org.eclipse.persistence.moxy;
requires transitive org.eclipse.persistence.moxy;

exports org.eclipse.persistence.dbws;
exports org.eclipse.persistence.jpa.rs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -283,6 +283,7 @@ protected XMLDescriptor buildResultDescriptor() {

XMLDirectMapping isCollection = new XMLDirectMapping();
isCollection.setAttributeAccessor(new AttributeAccessor() {

@Override
public String getAttributeName() {
return "isCollection";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -206,11 +206,9 @@ public SOAPMessage generateResponse(Operation op, boolean useSOAP12, Object resu
XMLDescriptor descriptor = resultDescriptors.get(op.getName());
SOAPResponse response = null;
try {
response = (SOAPResponse) descriptor.getJavaClass().newInstance();
} catch (InstantiationException ie) {
response = (SOAPResponse) descriptor.getJavaClass().getConstructor().newInstance();
} catch (ReflectiveOperationException ie) {
throw new SOAPException(ie);
} catch (IllegalAccessException iae) {
throw new SOAPException(iae);
}
response.setResult(result);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -62,7 +62,7 @@ public static void fixOROXAccessors(Project orProject, Project oxProject) {
XRDynamicPropertiesManager xrDPM = null;
if (!clz.getName().endsWith(COLLECTION_WRAPPER_SUFFIX)) {
try {
XRDynamicEntity newInstance = (XRDynamicEntity)clz.newInstance();
XRDynamicEntity newInstance = (XRDynamicEntity)clz.getConstructor().newInstance();
xrDPM = newInstance.fetchPropertiesManager();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -39,18 +39,21 @@ public DynamicRestClassLoader(ClassLoader delegate, DynamicClassWriter writer) {
super(delegate, writer);
}

@Override
public void createDynamicAdapter(String className) {
// Reference adapter for JPARS version < 2.0
RestAdapterClassWriter restAdapter = new RestAdapterClassWriter(className);
addClass(restAdapter.getClassName(), restAdapter);
}

@Override
public void createDynamicCollectionAdapter(String className) {
// Collection adapter for JPARS version >= 2.0
RestCollectionAdapterClassWriter restCollectionAdapter = new RestCollectionAdapterClassWriter(className);
addClass(restCollectionAdapter.getClassName(), restCollectionAdapter);
}

@Override
public void createDynamicReferenceAdapter(String className) {
// Reference adapter for JPARS version >= 2.0
RestReferenceAdapterV2ClassWriter restReferenceAdapterV2 = new RestReferenceAdapterV2ClassWriter(className);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -43,10 +43,9 @@ public ConcreteSubclassFactory(Class clazz) {
* Creates a new ConcreteSubclass object.
*
* @return the object
* @throws InstantiationException the instantiation exception
* @throws IllegalAccessException the illegal access exception
* @throws ReflectiveOperationException for errors
*/
public Object createConcreteSubclass() throws InstantiationException, IllegalAccessException {
return clazz.newInstance();
public Object createConcreteSubclass() throws ReflectiveOperationException {
return clazz.getConstructor().newInstance();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -27,6 +27,7 @@ public RMIConnectionExceptionsTest(int mode) {
super(mode, RMIConnection.class);
}

@Override
protected void setKnownBugs() {
super.setKnownBugs();
if(generator.getMode() == TransporterGenerator.SET_EXCEPTION_INTO_TRANSPORTER) {
Expand All @@ -43,6 +44,7 @@ protected void setKnownBugs() {
}
}

@Override
public void setup() throws Exception {
Session session = new DatabaseSessionImpl();
session.setProperty("TransporterGenerator", generator);
Expand All @@ -53,6 +55,7 @@ public void setup() throws Exception {
setRemoteConnection(rmiConnection);
}

@Override
public void reset() throws Exception {
InitialContext initialNamingContext = new InitialContext();
initialNamingContext.unbind(getNameToBind());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -63,6 +63,7 @@ public RMIConnection createConnection() {
return rmiConnection;
}

@Override
public void setup() {
RemoteModel.originalSession = getSession();
RMIServerManagerController.start(buildServerSession());
Expand All @@ -74,6 +75,7 @@ public void setup() {
getExecutor().setSession(remoteSession);
}

@Override
public void addTests() {
super.addTests();
addTest(getExceptionsTestSuite());
Expand Down