Skip to content

Commit

Permalink
compiler warnings (casts, access to static, forgotten valueOf,..), (#…
Browse files Browse the repository at this point in the history
…1262)

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Aug 31, 2021
1 parent 71285ee commit 6d7fa3c
Show file tree
Hide file tree
Showing 2,490 changed files with 10,115 additions and 2,846 deletions.
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 @@ -32,30 +32,37 @@ public Vector getEvents() {
return this.events;
}

@Override
public void postDelete(DescriptorEvent event) {
this.events.addElement(event);
}

@Override
public void postInsert(DescriptorEvent event) {
this.events.addElement(event);
}

@Override
public void postUpdate(DescriptorEvent event) {
this.events.addElement(event);
}

@Override
public void postWrite(DescriptorEvent event) {
this.events.addElement(event);
}

@Override
public void preDelete(DescriptorEvent event) {
this.events.addElement(event);
}

@Override
public void preInsert(DescriptorEvent event) {
this.events.addElement(event);
}

@Override
public void preUpdate(DescriptorEvent event) {
this.events.addElement(event);
}
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 @@ -1532,8 +1532,8 @@ public void buildVehicleDescriptor() {
descriptor.getDescriptorInheritancePolicy().setShouldReadSubclasses(true);
descriptor.getDescriptorInheritancePolicy().setClassIndicatorFieldName("TYPE");
descriptor.getDescriptorInheritancePolicy().setShouldUseClassNameAsIndicator(false);
descriptor.getDescriptorInheritancePolicy().addClassIndicator(org.eclipse.persistence.testing.models.aggregate.Car.class, new java.lang.Integer(1));
descriptor.getDescriptorInheritancePolicy().addClassIndicator(org.eclipse.persistence.testing.models.aggregate.Bicycle.class, new java.lang.Integer(2));
descriptor.getDescriptorInheritancePolicy().addClassIndicator(org.eclipse.persistence.testing.models.aggregate.Car.class, Integer.valueOf(1));
descriptor.getDescriptorInheritancePolicy().addClassIndicator(org.eclipse.persistence.testing.models.aggregate.Bicycle.class, Integer.valueOf(2));

// SECTION: COPY POLICY
descriptor.createCopyPolicy("constructor");
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 @@ -39,6 +39,7 @@ public AggregateRelationshipsProject() {
addDescriptor(buildStepChildClassDescriptor());
}

@Override
public void applyLogin() {
setDatasourceLogin(new DatabaseLogin());
}
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 @@ -36,6 +36,7 @@ public AggregateSystem(boolean useNewAggregateCollection) {
project = new AggregateProject(useNewAggregateCollection);
}

@Override
public void addDescriptors(DatabaseSession session) {
if (project == null) {
project = new AggregateProject(useNewAggregateCollection);
Expand All @@ -55,6 +56,7 @@ public void addDescriptors(DatabaseSession session) {
session.addDescriptors(project);
}

@Override
public void createTables(DatabaseSession session) {
SchemaManager schemaManager = new SchemaManager(session);

Expand Down Expand Up @@ -128,6 +130,7 @@ public TableDefinition getRelationTable() {
return definition;
}

@Override
public void populate(DatabaseSession session) {
Object instance;
PopulationManager manager = PopulationManager.getDefaultManager();
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 @@ -22,6 +22,7 @@
public class AggregateUpdateDescriptorListener extends DescriptorEventAdapter {
public boolean updateOccured = false;

@Override
public void aboutToUpdate(DescriptorEvent event) {
updateOccured = true;
}
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 @@ -34,6 +34,7 @@ public SwitchProject() {
addDescriptor(buildSwitchStateONDescriptor());
}

@Override
public void applyLogin() {
DatabaseLogin login = new DatabaseLogin();
setLogin(login);
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 @@ -35,6 +35,7 @@ public BigBadProject() {
addDescriptor(buildBigBadReferenceDataDescriptor());
}

@Override
public void applyLogin() {
DatabaseLogin login = new DatabaseLogin();
setLogin(login);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2019 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 @@ -32,20 +32,23 @@ public BigBadSystem() {
project = new BigBadProject();
}

@Override
public void addDescriptors(DatabaseSession session) {
if (project == null) {
project = new BigBadProject();
}
session.addDescriptors(project);
}

@Override
public void createTables(DatabaseSession session) {
(new BigBadTableCreator()).replaceTables(session);
}

/**
* Write 100 big bad instances with generated data.
*/
@Override
public void populate(DatabaseSession session) {
session.getLogin().useStringBinding(100);

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 @@ -24,13 +24,15 @@ public CollectionsSystem() {
project = new CollectionsProject();
}

@Override
public void addDescriptors(DatabaseSession session) {
if (project == null) {
project = new CollectionsProject();
}
session.addDescriptors(project);
}

@Override
public void createTables(DatabaseSession session) {
SchemaManager schemaManager = new SchemaManager(session);

Expand All @@ -48,6 +50,7 @@ public void createTables(DatabaseSession session) {
schemaManager.createSequences();
}

@Override
public void populate(DatabaseSession session) {
PopulationManager manager = PopulationManager.getDefaultManager();
UnitOfWork uow = session.acquireUnitOfWork();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2019 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 @@ -37,10 +37,12 @@ public Menu(String menuType) {
this.type = menuType;
}

@Override
public PropertyChangeListener _persistence_getPropertyChangeListener() {
return listener;
}

@Override
public void _persistence_setPropertyChangeListener(PropertyChangeListener listener) {
this.listener = listener;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ public MenuItem() {
super();
}

@Override
public PropertyChangeListener _persistence_getPropertyChangeListener() {
return listener;
}

@Override
public void _persistence_setPropertyChangeListener(PropertyChangeListener listener) {
this.listener = listener;
}
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 @@ -30,10 +30,12 @@ public Person() {
super();
}

@Override
public PropertyChangeListener _persistence_getPropertyChangeListener() {
return listener;
}

@Override
public void _persistence_setPropertyChangeListener(PropertyChangeListener listener) {
this.listener = listener;
}
Expand All @@ -58,6 +60,7 @@ public void mapChange(String propertyName, Map changedCollection, Object key, Ob
}
}

@Override
public int compareTo(Object o) {
return this.lastName.compareTo(((Person)o).getLastName());
}
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 @@ -57,10 +57,12 @@ public Restaurant() {
licenses = new HashMap();
}

@Override
public PropertyChangeListener _persistence_getPropertyChangeListener() {
return listener;
}

@Override
public void _persistence_setPropertyChangeListener(PropertyChangeListener listener) {
this.listener = listener;
}
Expand Down Expand Up @@ -394,6 +396,7 @@ public String toString() {
}

static class LocationComparator implements Comparator {
@Override
public int compare(Object object1, Object object2) {
if ((object1.getClass() != Location.class) || (object2.getClass() != Location.class)) {
throw new ClassCastException("Invalid comparison : " + object1 + ", " + object2);
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 @@ -28,13 +28,15 @@ public MapCollectionsSystem() {
project = new MapCollectionsProject();
}

@Override
public void addDescriptors(DatabaseSession session) {
if (project == null) {
project = new MapCollectionsProject();
}
session.addDescriptors(project);
}

@Override
public void createTables(DatabaseSession session) {
SchemaManager schemaManager = new SchemaManager(session);

Expand Down Expand Up @@ -70,6 +72,7 @@ public void createTables(DatabaseSession session) {
schemaManager.createSequences();
}

@Override
public void populate(DatabaseSession session) {
MapPopulator system = new MapPopulator();
UnitOfWork unitOfWork = session.acquireUnitOfWork();
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 ConversionManagerSystem() {
project = new ConversionManagerProject();
}

@Override
public void addDescriptors(DatabaseSession session) {
if (project == null) {
project = new ConversionManagerProject();
Expand Down Expand Up @@ -53,6 +54,7 @@ public void addDescriptors(DatabaseSession session) {
session.addDescriptors(project);
}

@Override
public void createTables(DatabaseSession session) {
SchemaManager schemaManager = new SchemaManager(session);
TableDefinition definition = ConversionDataObject.tableDefinition();
Expand All @@ -68,6 +70,7 @@ public void createTables(DatabaseSession session) {
schemaManager.createSequences();
}

@Override
public void populate(DatabaseSession session) {
Object instance;
PopulationManager manager = PopulationManager.getDefaultManager();
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 @@ -36,6 +36,7 @@ public DirectMapMappingsProject() {
addDescriptor(buildDescriptors());
}

@Override
public void applyLogin() {
DatabaseLogin login = new DatabaseLogin();
login.usePlatform(new org.eclipse.persistence.platform.database.OraclePlatform());
Expand Down

0 comments on commit 6d7fa3c

Please sign in to comment.