mirror of
https://github.com/OpenSPG/openspg.git
synced 2026-01-07 21:01:25 +00:00
fix(pmd): fix java pmd error (#115)
This commit is contained in:
parent
945cf8fbbd
commit
a9c29efdb2
@ -16,8 +16,6 @@ package com.antgroup.openspg.builder.core.physical.process;
|
||||
import com.antgroup.openspg.builder.model.pipeline.config.BaseNodeConfig;
|
||||
import com.antgroup.openspg.builder.model.pipeline.enums.NodeTypeEnum;
|
||||
import com.antgroup.openspg.builder.model.record.BaseRecord;
|
||||
import com.antgroup.openspg.builder.model.record.BaseSPGRecord;
|
||||
import com.antgroup.openspg.builder.model.record.SPGRecordTypeEnum;
|
||||
import java.util.List;
|
||||
|
||||
public class CheckProcessor extends BaseProcessor<CheckProcessor.CheckNodeConfig> {
|
||||
@ -39,66 +37,6 @@ public class CheckProcessor extends BaseProcessor<CheckProcessor.CheckNodeConfig
|
||||
|
||||
@Override
|
||||
public List<BaseRecord> process(List<BaseRecord> inputs) {
|
||||
for (BaseRecord record : inputs) {
|
||||
BaseSPGRecord spgRecord = (BaseSPGRecord) record;
|
||||
if (SPGRecordTypeEnum.RELATION.equals(spgRecord.getRecordType())) {
|
||||
// checkSubProperty(((RelationRecord) spgRecord));
|
||||
} else {
|
||||
// checkProperty(((BaseAdvancedRecord) spgRecord));
|
||||
}
|
||||
}
|
||||
return inputs;
|
||||
}
|
||||
|
||||
// private void checkProperty(BaseAdvancedRecord advancedRecord) {
|
||||
// for (Property property : advancedRecord.getSpgType().getProperties()) {
|
||||
// if (property.getObjectTypeRef().isBasicType()) {
|
||||
// if (property.getConstraint() == null) {
|
||||
// continue;
|
||||
// }
|
||||
// SPGPropertyRecord propertyRecord = advancedRecord.getPropertyRecord(property);
|
||||
// Object stdValue = (propertyRecord == null ? null : propertyRecord.getValue().getStd());
|
||||
// doCheckBasicProperty(
|
||||
// property.getName(), stdValue, property.getConstraint().getConstraintItems());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void checkSubProperty(RelationRecord relationRecord) {
|
||||
// for (SubProperty subProperty : relationRecord.getRelationType().getSubProperties()) {
|
||||
// if (subProperty.getObjectTypeRef().isBasicType()) {
|
||||
// if (subProperty.getConstraint() == null) {
|
||||
// continue;
|
||||
// }
|
||||
// SPGSubPropertyRecord subPropertyRecord =
|
||||
// relationRecord.getSubPropertyRecord(subProperty);
|
||||
// Object stdValue =
|
||||
// (subPropertyRecord == null ? null : subPropertyRecord.getValue().getStd());
|
||||
// doCheckBasicProperty(
|
||||
// subProperty.getName(), stdValue, subProperty.getConstraint().getConstraintItems());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void doCheckBasicProperty(
|
||||
// String propertyName, Object stdValue, List<BaseConstraintItem> constraintItems) {
|
||||
// Object[] values = new Object[] {stdValue};
|
||||
// for (BaseConstraintItem constraintItem : constraintItems) {
|
||||
// for (Object value : values) {
|
||||
// if (!constraintItem.checkIsLegal(value)) {
|
||||
// throw new BuilderRecordException(
|
||||
// this,
|
||||
// "the property {}={} violates constraints:{}",
|
||||
// propertyName,
|
||||
// stdValue,
|
||||
// constraintItem.getConstraintTypeEnum().name());
|
||||
// }
|
||||
// }
|
||||
// if (constraintItem instanceof MultiValConstraint) {
|
||||
// if (stdValue != null) {
|
||||
// values = stdValue.toString().split(",");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@ -98,7 +98,6 @@ public class LocalBuilderMain {
|
||||
try {
|
||||
commandLine = parser.parse(options, args);
|
||||
} catch (ParseException e) {
|
||||
System.out.println(e.getMessage());
|
||||
helper.printHelp("Usage: ", options);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@ -138,6 +138,7 @@ public class OdpsUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
List<OdpsType> neededType =
|
||||
schemaNeeded.getColumns().stream()
|
||||
.map(column -> column.getTypeInfo().getOdpsType())
|
||||
@ -149,7 +150,6 @@ public class OdpsUtils {
|
||||
.map(column -> column.getTypeInfo().getOdpsType())
|
||||
.sorted(Enum::compareTo)
|
||||
.collect(Collectors.toList());
|
||||
/*
|
||||
Comment it out and wait for the type inference to complete
|
||||
if (!neededType.equals(realType)) {
|
||||
log.error(
|
||||
|
||||
@ -13,15 +13,11 @@
|
||||
|
||||
package com.antgroup.openspg.server.api.http.server;
|
||||
|
||||
import com.antgroup.openspg.server.common.model.exception.IllegalParamsException;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
public interface HttpBizCallback<T> {
|
||||
|
||||
/**
|
||||
* Perform some pre-validation, and if the validation fails, throw an {@link
|
||||
* IllegalParamsException} exception directly.
|
||||
*/
|
||||
/** Perform some pre-validation */
|
||||
void check();
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user