Fix regression bug.

This commit is contained in:
Paulo Gustavo Veiga 2020-11-23 18:17:48 -08:00
parent 3ef7f6a7f0
commit 7a5b4ca75a
2 changed files with 10 additions and 7 deletions

View File

@ -25,6 +25,7 @@ import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.User; import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestErrors; import com.wisemapping.rest.model.RestErrors;
import com.wisemapping.security.Utils; import com.wisemapping.security.Utils;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
@ -42,6 +43,8 @@ import java.util.Locale;
public class BaseController { public class BaseController {
final private Logger logger = Logger.getLogger("com.wisemapping.rest");
@Qualifier("messageSource") @Qualifier("messageSource")
@Autowired @Autowired
private ResourceBundleMessageSource messageSource; private ResourceBundleMessageSource messageSource;
@ -56,7 +59,7 @@ public class BaseController {
@ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseStatus(HttpStatus.BAD_REQUEST)
@ResponseBody @ResponseBody
public RestErrors handleClientErrors(@NotNull IllegalArgumentException ex) { public RestErrors handleClientErrors(@NotNull IllegalArgumentException ex) {
System.err.println(ex.getMessage()); logger.error(ex.getMessage(), ex);
return new RestErrors(ex.getMessage(), Severity.WARNING); return new RestErrors(ex.getMessage(), Severity.WARNING);
} }

View File

@ -653,7 +653,7 @@ public class MindmapController extends BaseController {
if (found == null) { if (found == null) {
throw new LabelCouldNotFoundException("Label could not be found. Id: " + labelId); throw new LabelCouldNotFoundException("Label could not be found. Id: " + labelId);
} }
for (String id : ",".split(ids)) { for (String id : ids.split(",")) {
final int mindmapId = Integer.parseInt(id); final int mindmapId = Integer.parseInt(id);
final Mindmap mindmap = findMindmapById(mindmapId); final Mindmap mindmap = findMindmapById(mindmapId);
final Label label = mindmap.findLabel(labelId); final Label label = mindmap.findLabel(labelId);