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

no effective code change - fixed warnings about serialization, override, raw-types #1032

Merged
merged 1 commit into from Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/io/ebean/AcquireLockException.java
Expand Up @@ -10,6 +10,7 @@
* </p>
*/
public class AcquireLockException extends PessimisticLockException {
private static final long serialVersionUID = -8585962352965876691L;

/**
* Create with a message and cause.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/ebean/DataIntegrityException.java
Expand Up @@ -6,6 +6,7 @@
* Thrown when a foreign key constraint is enforced.
*/
public class DataIntegrityException extends PersistenceException {
private static final long serialVersionUID = -6740171949170180970L;

/**
* Create with a message and cause.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/ebean/DuplicateKeyException.java
Expand Up @@ -4,6 +4,7 @@
* Thrown when a duplicate is attempted on a unique constraint.
*/
public class DuplicateKeyException extends DataIntegrityException {
private static final long serialVersionUID = -4771932723285724817L;

/**
* Create with a message and cause.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/ebean/Transaction.java
Expand Up @@ -129,6 +129,7 @@ public interface Transaction extends AutoCloseable {
/**
* Synonym for end() to support AutoClosable.
*/
@Override
void close();

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/ebeaninternal/api/SpiQuery.java
Expand Up @@ -161,6 +161,7 @@ public static TemporalMode of(SpiQuery<?> query) {
/**
* Return the ForUpdate mode.
*/
@Override
ForUpdate getForUpdateMode();

/**
Expand Down
Expand Up @@ -985,6 +985,7 @@ public void addDocStoreUpdates(DocStoreUpdates docStoreUpdates) {
docStoreUpdates.queueIndex(beanDescriptor.getDocStoreQueueId(), idValue);
}
}
break;
default:
break;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/io/ebeaninternal/server/deploy/ManyType.java
Expand Up @@ -16,8 +16,10 @@ public enum ManyType {

private final boolean map;

@SuppressWarnings("rawtypes")
private final Class<? extends Collection> type;

@SuppressWarnings("rawtypes")
ManyType(boolean map, Class<? extends Collection> type) {
this.map = map;
this.type = type;
Expand All @@ -31,6 +33,7 @@ public boolean isMap() {
* Returns List.class or Set.class and null for Map.
* Not intended to be called for maps.
*/
@SuppressWarnings("rawtypes")
public Class<? extends Collection> getCollectionType() {
return type;
}
Expand Down
Expand Up @@ -7,7 +7,8 @@
* Holds the first SQLException found when executing a JDBC batch.
*/
public class BatchedSqlException extends Exception {

private static final long serialVersionUID = -4374631080253580648L;

private SQLException cause;

BatchedSqlException(String message, SQLException cause) {
Expand Down
Expand Up @@ -18,7 +18,7 @@ public DJsonScalar(TypeManager typeManager) {
this.typeManager = typeManager;
}

@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void write(JsonGenerator gen, Object value) throws IOException {

if (value instanceof String) {
Expand Down
Expand Up @@ -198,7 +198,7 @@ public void popPath() {
* If there is a JsonReadBeanVisitor registered to the current path then
* call it's visit method with the bean and unmappedProperties.
*/
@SuppressWarnings(value = "unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void beanVisitor(Object bean, Map<String, Object> unmappedProperties) {
if (visitorMap != null) {
JsonReadBeanVisitor visitor = visitorMap.get(pathStack.peekWithNull());
Expand Down
Expand Up @@ -646,6 +646,7 @@ private void batchFlushReset() {
}
}

@Override
public PersistenceException translate(String message, SQLException cause) {
if (manager != null) {
return manager.translate(message, cause);
Expand Down
Expand Up @@ -19,6 +19,7 @@
/**
* Type mapped for DB ARRAY type (Postgres only effectively).
*/
@SuppressWarnings("rawtypes")
public class ScalarTypeArrayList extends ScalarTypeJsonCollection<List> implements ScalarTypeArray {

private static ScalarTypeArrayList UUID = new ScalarTypeArrayList("uuid", DocPropertyType.UUID, ArrayElementConverter.UUID);
Expand Down Expand Up @@ -75,6 +76,7 @@ public DocPropertyType getDocType() {
/**
* Return the DB column definition for DDL generation.
*/
@Override
public String getDbColumnDefn() {
return arrayType + "[]";
}
Expand Down
Expand Up @@ -48,11 +48,13 @@ public ScalarTypeArrayListH2 typeFor(Type valueType) {
}
}

@SuppressWarnings("rawtypes")
private ScalarTypeArrayListH2(String arrayType, DocPropertyType docPropertyType, ArrayElementConverter converter) {
super(arrayType, docPropertyType, converter);
}

@Override
@SuppressWarnings("rawtypes")
public void bind(DataBind bind, List value) throws SQLException {
if (value == null) {
bind.setNull(Types.ARRAY);
Expand Down
Expand Up @@ -75,6 +75,7 @@ public DocPropertyType getDocType() {
/**
* Return the DB column definition for DDL generation.
*/
@Override
public String getDbColumnDefn() {
return arrayType + "[]";
}
Expand Down
Expand Up @@ -61,6 +61,7 @@ public JsonB(DocPropertyType docType) {
/**
* Base class for List handling.
*/
@SuppressWarnings("rawtypes")
private abstract static class Base extends ScalarTypeJsonCollection<List> {

public Base(int dbType, DocPropertyType docType) {
Expand Down Expand Up @@ -135,6 +136,7 @@ private static class PgBase extends ScalarTypeJsonList.Base {
this.pgType = pgType;
}

@SuppressWarnings("rawtypes")
@Override
public void bind(DataBind bind, List value) throws SQLException {

Expand Down
Expand Up @@ -21,6 +21,7 @@
/**
* Type which maps Map<String,Object> to various DB types (Clob, Varchar, Blob) in JSON format.
*/
@SuppressWarnings("rawtypes")
public abstract class ScalarTypeJsonMap extends ScalarTypeBase<Map> {

private static final ScalarTypeJsonMap CLOB = new ScalarTypeJsonMap.Clob();
Expand Down
Expand Up @@ -17,6 +17,7 @@ public abstract class ScalarTypeJsonMapPostgres extends ScalarTypeJsonMap {
this.postgresType = postgresType;
}

@SuppressWarnings("rawtypes")
@Override
public void bind(DataBind bind, Map value) throws SQLException {

Expand Down
Expand Up @@ -67,6 +67,7 @@ public GenericObject(ObjectMapper objectMapper, Type type, int dbType, String pg
/**
* Type for Sets wrapping the ObjectMapper Set as a ModifyAwareSet.
*/
@SuppressWarnings("rawtypes")
private static class OmSet extends Base<Set> {

public OmSet(ObjectMapper objectMapper, Type type, int dbType, String pgType, DocPropertyType docType) {
Expand All @@ -84,6 +85,7 @@ public Set read(DataReader reader) throws SQLException {
/**
* Type for Lists wrapping the ObjectMapper List as a ModifyAwareList.
*/
@SuppressWarnings("rawtypes")
private static class OmList extends Base<List> {

public OmList(ObjectMapper objectMapper, Type type, int dbType, String pgType, DocPropertyType docType) {
Expand All @@ -101,6 +103,7 @@ public List read(DataReader reader) throws SQLException {
/**
* Type for Map wrapping the ObjectMapper Map as a ModifyAwareMap.
*/
@SuppressWarnings("rawtypes")
private static class OmMap extends Base<Map> {

public OmMap(ObjectMapper objectMapper, Type type, int dbType, String pgType) {
Expand Down
Expand Up @@ -64,6 +64,7 @@ public JsonB(DocPropertyType docPropertyType) {
/**
* Base class for List handling.
*/
@SuppressWarnings("rawtypes")
private abstract static class Base extends ScalarTypeJsonCollection<Set> {

public Base(int dbType, DocPropertyType docPropertyType) {
Expand Down Expand Up @@ -142,6 +143,7 @@ private static class PgBase extends ScalarTypeJsonSet.Base {
this.pgType = pgType;
}

@SuppressWarnings("rawtypes")
@Override
public void bind(DataBind bind, Set value) throws SQLException {

Expand Down
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import io.ebean.config.ServerConfig;
import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.config.dbplatform.h2.H2Platform;
import io.ebeaninternal.server.core.bootup.BootupClasses;
import io.ebeaninternal.server.type.DefaultTypeManager;
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/tests/model/basic/Article.java
Expand Up @@ -14,6 +14,7 @@
@CacheBeanTuning(maxSecsToLive = 45)
@Entity
public class Article extends BasicDomain {
private static final long serialVersionUID = -7181090513848918784L;

String name;

Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/tests/model/basic/Car.java
Expand Up @@ -16,6 +16,7 @@
@Inheritance
@DiscriminatorValue("C")
public class Car extends Vehicle {
private static final long serialVersionUID = -65427345082456523L;

public enum Size {
SMALL("S"),
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/tests/model/basic/OEngine.java
Expand Up @@ -4,10 +4,12 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Version;

import java.io.Serializable;
import java.util.UUID;

@Entity
public class OEngine {
public class OEngine implements Serializable {

private static final long serialVersionUID = 1L;

Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/tests/model/basic/OGearBox.java
Expand Up @@ -5,10 +5,12 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Version;

import java.io.Serializable;
import java.util.UUID;

@Entity
public class OGearBox {
public class OGearBox implements Serializable {

private static final long serialVersionUID = 1L;

Expand Down
5 changes: 4 additions & 1 deletion src/test/java/org/tests/model/basic/TIntRoot.java
@@ -1,5 +1,7 @@
package org.tests.model.basic;

import java.io.Serializable;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
Expand All @@ -11,7 +13,8 @@
@Inheritance
@DiscriminatorColumn(name = "my_type", length = 3, discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("1")
public class TIntRoot {
public class TIntRoot implements Serializable {
private static final long serialVersionUID = -7057502590435806504L;

@Id
Integer id;
Expand Down
5 changes: 4 additions & 1 deletion src/test/java/org/tests/model/basic/TMappedSuper2.java
@@ -1,11 +1,14 @@
package org.tests.model.basic;

import java.io.Serializable;

import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import javax.persistence.Version;

@MappedSuperclass
public class TMappedSuper2 {
public class TMappedSuper2 implements Serializable {
private static final long serialVersionUID = 325282672490816821L;

String something;

Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/tests/model/basic/Truck.java
Expand Up @@ -12,6 +12,7 @@
@Inheritance
@DiscriminatorValue("T")
public class Truck extends Vehicle {
private static final long serialVersionUID = 9195535931523211134L;

public enum Size {
SMALL("S"),
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/tests/model/basic/cache/CInhOne.java
Expand Up @@ -11,6 +11,7 @@
@Inheritance
@DiscriminatorValue("O")
public class CInhOne extends CInhRoot {
private static final long serialVersionUID = -3933815364935720317L;

private String driver;

Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/tests/model/basic/cache/CInhRoot.java
Expand Up @@ -12,6 +12,7 @@
@Inheritance
@DiscriminatorColumn(length = 3)
public abstract class CInhRoot extends BasicDomain {
private static final long serialVersionUID = -4673953370819311120L;

private String licenseNumber;

Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/tests/model/basic/cache/CInhTwo.java
Expand Up @@ -11,6 +11,7 @@
@Inheritance
@DiscriminatorValue("T")
public class CInhTwo extends CInhRoot {
private static final long serialVersionUID = -8528396890675473212L;

private String action;

Expand Down
3 changes: 2 additions & 1 deletion src/test/java/org/tests/model/onetoone/OCompany.java
Expand Up @@ -7,7 +7,8 @@

@Entity
public class OCompany extends BasicDomain {

private static final long serialVersionUID = 6733591692223352686L;

@Column(length = 50, unique = true)
public String corpId;

Expand Down
3 changes: 2 additions & 1 deletion src/test/java/org/tests/model/onetoone/ORoadShowMsg.java
Expand Up @@ -9,7 +9,8 @@

@Entity
public class ORoadShowMsg extends BasicDomain {

private static final long serialVersionUID = -1555123312818834212L;

@OneToOne(cascade = CascadeType.ALL, optional = false)
@JoinColumn()//(name = "corp_id", nullable = false, referencedColumnName = "corp_id")
public OCompany company;
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/tests/model/selfref/BaseResourceFile.java
Expand Up @@ -3,10 +3,12 @@
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import java.io.Serializable;
import java.util.UUID;

@MappedSuperclass
public abstract class BaseResourceFile {
public abstract class BaseResourceFile implements Serializable {

private static final long serialVersionUID = 1L;

Expand Down
5 changes: 4 additions & 1 deletion src/test/java/org/tests/sp/model/IdEntity.java
@@ -1,13 +1,16 @@
package org.tests.sp.model;

import java.io.Serializable;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

@MappedSuperclass
public abstract class IdEntity {
public abstract class IdEntity implements Serializable {
private static final long serialVersionUID = 7804145008732783678L;

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
Expand Down