mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#1738 - Refactor tidy suppressWarnings and access
This commit is contained in:
1 parent
30a0935300
commit
e6c9f151c1
12 files changed
+25
-27
No files matched your search
@@ -235,7 +235,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
/**
|
||||
* Map of BeanProperty Linked so as to preserve order.
|
||||
*/
|
||||
protected final LinkedHashMap<String, BeanProperty> propMap;
|
||||
private final LinkedHashMap<String, BeanProperty> propMap;
|
||||
|
||||
/**
|
||||
* Map of DB column to property path (for nativeSql mapping).
|
||||
@@ -252,7 +252,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
*/
|
||||
final Class<T> beanType;
|
||||
|
||||
protected final Class<?> rootBeanType;
|
||||
final Class<?> rootBeanType;
|
||||
|
||||
/**
|
||||
* This is not sent to a remote client.
|
||||
@@ -287,11 +287,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
*/
|
||||
private final ChangeLogFilter changeLogFilter;
|
||||
|
||||
/**
|
||||
* The table joins for this bean.
|
||||
*/
|
||||
private final TableJoin[] derivedTableJoins;
|
||||
|
||||
/**
|
||||
* Inheritance information. Server side only.
|
||||
*/
|
||||
@@ -374,7 +369,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
* All non transient properties excluding the id properties.
|
||||
*/
|
||||
private final BeanProperty[] propertiesNonTransient;
|
||||
protected final BeanProperty[] propertiesIndex;
|
||||
final BeanProperty[] propertiesIndex;
|
||||
private final BeanProperty[] propertiesGenInsert;
|
||||
private final BeanProperty[] propertiesGenUpdate;
|
||||
private final List<BeanProperty[]> propertiesUnique = new ArrayList<>();
|
||||
@@ -423,7 +418,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
|
||||
private final BeanDescriptorDraftHelp<T> draftHelp;
|
||||
private final BeanDescriptorCacheHelp<T> cacheHelp;
|
||||
final BeanDescriptorJsonHelp<T> jsonHelp;
|
||||
private final BeanDescriptorJsonHelp<T> jsonHelp;
|
||||
private DocStoreBeanAdapter<T> docStoreAdapter;
|
||||
private DocumentMapping docMapping;
|
||||
private boolean docStoreEmbeddedInvalidation;
|
||||
@@ -529,8 +524,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
this.propertiesGenInsert = listHelper.getGeneratedInsert();
|
||||
this.propertiesGenUpdate = listHelper.getGeneratedUpdate();
|
||||
|
||||
this.derivedTableJoins = listHelper.getTableJoin();
|
||||
|
||||
boolean noRelationships = propertiesOne.length + propertiesMany.length == 0;
|
||||
|
||||
this.cacheSharableBeans = noRelationships && deploy.getCacheOptions().isReadOnly();
|
||||
@@ -655,7 +648,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
/**
|
||||
* Return true if this is an abstract type.
|
||||
*/
|
||||
public boolean isAbstractType() {
|
||||
boolean isAbstractType() {
|
||||
return abstractType;
|
||||
}
|
||||
|
||||
@@ -689,7 +682,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
* as they are used to get the imported and exported properties.
|
||||
* </p>
|
||||
*/
|
||||
public void initialiseId(BeanDescriptorInitContext initContext) {
|
||||
void initialiseId(BeanDescriptorInitContext initContext) {
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("BeanDescriptor initialise " + fullName);
|
||||
@@ -783,7 +776,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
/**
|
||||
* Perform last initialisation for the descriptor.
|
||||
*/
|
||||
public void initLast() {
|
||||
void initLast() {
|
||||
|
||||
for (BeanProperty prop : propertiesNonTransient) {
|
||||
if (prop.isUnique()) {
|
||||
@@ -825,7 +818,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
* Initialise the document mapping.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initialiseDocMapping() {
|
||||
void initialiseDocMapping() {
|
||||
for (BeanPropertyAssocMany<?> many : propertiesMany) {
|
||||
many.initialisePostTarget();
|
||||
}
|
||||
@@ -840,7 +833,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
cacheHelp.deriveNotifyFlags();
|
||||
}
|
||||
|
||||
public void initInheritInfo() {
|
||||
void initInheritInfo() {
|
||||
if (inheritInfo != null) {
|
||||
// need to check every BeanDescriptor in the inheritance hierarchy
|
||||
if (saveRecurseSkippable) {
|
||||
@@ -894,7 +887,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
/**
|
||||
* Return the ReadAuditPrepare for preparing read audit events prior to logging.
|
||||
*/
|
||||
public ReadAuditPrepare getReadAuditPrepare() {
|
||||
private ReadAuditPrepare getReadAuditPrepare() {
|
||||
return ebeanServer.getReadAuditPrepare();
|
||||
}
|
||||
|
||||
@@ -980,7 +973,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
/**
|
||||
* Populate the diff for inserts with flattened non-null property values.
|
||||
*/
|
||||
protected void jsonWriteForInsert(SpiJsonWriter jsonWriter, EntityBean newBean) throws IOException {
|
||||
void jsonWriteForInsert(SpiJsonWriter jsonWriter, EntityBean newBean) throws IOException {
|
||||
jsonWriter.writeStartObject();
|
||||
for (BeanProperty prop : propertiesBaseScalar) {
|
||||
prop.jsonWriteForInsert(jsonWriter, newBean);
|
||||
@@ -1057,7 +1050,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
elDeployCache.put(fkey.getName(), fkey);
|
||||
}
|
||||
|
||||
public void initialiseFkeys() {
|
||||
void initialiseFkeys() {
|
||||
for (BeanPropertyAssocOne<?> aPropertiesOneImported : propertiesOneImported) {
|
||||
if (!aPropertiesOneImported.isFormula()) {
|
||||
aPropertiesOneImported.addFkey();
|
||||
|
||||
@@ -107,6 +107,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
|
||||
/**
|
||||
* Copy constructor for ManyToOne inside Embeddable.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanPropertyAssoc(BeanPropertyAssoc source, BeanPropertyOverride override) {
|
||||
super(source, override);
|
||||
foreignKey = source.foreignKey;
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanPropertyAssocOne;
|
||||
*/
|
||||
public class BeanPropertyIdClass extends BeanPropertyAssocOne {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanPropertyIdClass(BeanDescriptorMap owner, BeanDescriptor descriptor, DeployBeanPropertyAssocOne deploy) {
|
||||
super(owner, descriptor, deploy);
|
||||
}
|
||||
|
||||
@@ -1267,6 +1267,7 @@ public class DeployBeanDescriptor<T> {
|
||||
/**
|
||||
* Returns the jackson annotated class, if jackson is present.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object /*AnnotatedClass*/ getJacksonAnnotatedClass() {
|
||||
if (jacksonAnnotatedClass == null) {
|
||||
jacksonAnnotatedClass = new DeployBeanObtainJackson(serverConfig, beanType).obtain();
|
||||
|
||||
@@ -183,6 +183,7 @@ class AnnotationAssocManys extends AnnotationParser {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void readElementCollection(DeployBeanPropertyAssocMany<?> prop, ElementCollection elementCollection) {
|
||||
|
||||
prop.setElementCollection();
|
||||
|
||||
@@ -495,7 +495,7 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> select(FetchGroup fetchGroup) {
|
||||
public Query<T> select(FetchGroup<T> fetchGroup) {
|
||||
return query.select(fetchGroup);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Binder {
|
||||
if (isLob(dt)) {
|
||||
bindBuf.append("[LOB]");
|
||||
} else {
|
||||
bindBuf.append(String.valueOf(val));
|
||||
bindBuf.append(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,6 +198,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery, SpiProfileTran
|
||||
/**
|
||||
* Create the Sql select based on the request.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public CQuery(OrmQueryRequest<T> request, CQueryPredicates predicates, CQueryPlan queryPlan) {
|
||||
this.request = request;
|
||||
this.audit = request.isAuditReads();
|
||||
@@ -569,13 +570,11 @@ public class CQuery<T> implements DbReadContext, CancelableQuery, SpiProfileTran
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
BeanCollection<T> readCollection() throws SQLException {
|
||||
|
||||
while (hasNext()) {
|
||||
EntityBean bean = next();
|
||||
help.add(collection, bean, false);
|
||||
help.add(collection, next(), false);
|
||||
}
|
||||
|
||||
updateExecutionStatistics();
|
||||
return collection;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.ebeaninternal.server.type.bindcapture.BindCapture;
|
||||
|
||||
class CQueryBindCapture {
|
||||
|
||||
private final double multiplier = 1.3d;
|
||||
private static final double multiplier = 1.3d;
|
||||
|
||||
private final CQueryPlan cQueryPlan;
|
||||
private final QueryPlanLogger planLogger;
|
||||
|
||||
@@ -1718,6 +1718,7 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
return beanDescriptor.getBeanType();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Query<T> setInheritType(Class<? extends T> type) {
|
||||
if (type == beanType) {
|
||||
|
||||
Reference in new issue
Block a user