The columnConfigSet at src\main\java\com\ge\digital\oa\moa\controller\ConfigController.java in line 45 may unintentionally allow setting the value of saveAll in setColumnsConfig, in the object src\main\java\com\ge\digital\oa\moa\service\ConfigService.java at line 170.
< /code>
Jede Idee, wie man den Code umschreibt, so dass der CheckMarx nicht mehr beschwert.@PutMapping("/columns")
@ResponseStatus(OK)
public void setColumnsConfig(@RequestBody(required=true) ColumnConfigSetDto columnConfigSet) {
service.setColumnsConfig(columnConfigSet);
}
< /code>
public void setColumnsConfig(ColumnConfigSetDto columnConfigSet) {
String userId = columnConfigSet.getUserId();
String viewName = columnConfigSet.getViewName();
List configs = new ArrayList();
for (ColumnConfigDto colConfig : columnConfigSet.getColumns()) {
// build a db config row only for the visibility property for now
ColumnConfigId confId = new ColumnConfigId();
confId.setUserId(userId);
confId.setViewName(viewName);
confId.setKey(colConfig.getKey());
confId.setProperty("visible");
ColumnConfig conf = new ColumnConfig();
conf.setColumnConfigId(confId);
conf.setValue(colConfig.getIsVisible() ? "true" : "false" );
configs.add(conf);
}
if (!configs.isEmpty()) {
configRepo.saveAll(configs);
}
}
< /code>
Below are my DTO Objects which is used in this code :
@Getter
@Setter
public class ColumnConfigSetDto {
@JsonProperty("userId")
private String userId;
@JsonProperty("viewName")
private String viewName;
@JsonProperty("columns")
private List columns;
}
< /code>
Below are my DTO code which is used in this
@Getter
@Setter
public class ColumnConfigDto {
@JsonProperty("key")
private String key;
@JsonProperty("label")
private String label;
@JsonProperty("isVisible")
private Boolean isVisible;
@JsonProperty("position")
private Integer position;
@JsonProperty("isSortable")
private Boolean isSortable;
@JsonProperty("isHideable")
private Boolean isHideable;
}
Ich werde in CheckMarx -Scan aufmerksam machen, und sagt, dass unsichere Objektbindung im Saveall () Aufruf.[code]The columnConfigSet at src\main\java\com\ge\digital\oa\moa\controller\ConfigController.java in line 45 may unintentionally allow setting the value of saveAll in setColumnsConfig, in the object src\main\java\com\ge\digital\oa\moa\service\ConfigService.java at line 170. < /code> Jede Idee, wie man den Code umschreibt, so dass der CheckMarx nicht mehr beschwert.@PutMapping("/columns") @ResponseStatus(OK) public void setColumnsConfig(@RequestBody(required=true) ColumnConfigSetDto columnConfigSet) { service.setColumnsConfig(columnConfigSet); } < /code>
public void setColumnsConfig(ColumnConfigSetDto columnConfigSet) {
Ich schreibe ein Bildverarbeitungsprogramm, um die Echtzeitverarbeitung von Videobildern durchzuführen. Es ist in C# und verwendet die Emgu.CV-Bibliothek (C#), die die OpenCV-Bibliotheks-DLL (nicht...
Ich schreibe ein Bildverarbeitungsprogramm, um die Echtzeitverarbeitung von Videobildern durchzuführen. Es ist in C# und verwendet die Emgu.CV-Bibliothek (C#), die die OpenCV-Bibliotheks-DLL (nicht...
Ich schreibe ein Bildverarbeitungsprogramm, um die Echtzeitverarbeitung von Videobildern durchzuführen. Es ist in C# und verwendet die Emgu.CV-Bibliothek (C#), die die OpenCV-Bibliotheks-DLL (nicht...