PAN-57 Refacted superfluous code

This commit is contained in:
2019-03-17 14:48:43 -06:00
parent a85bf67d08
commit a13ab97154
25 changed files with 331 additions and 371 deletions
@@ -1,7 +1,6 @@
package edu.msudenver.tsp.services.dto;
import com.google.gson.annotations.SerializedName;
import edu.msudenver.tsp.persistence.dto.AccountDto;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@@ -12,8 +11,8 @@ import java.io.Serializable;
import java.util.Date;
public class Account extends BaseDto implements Serializable {
@NotBlank(groups = AccountDto.Insert.class, message = "A username must be specified") @Size(max = 50) private String username;
@NotBlank(groups = AccountDto.Insert.class, message = "A password must be specified") @Size(max = 256) private String password;
@NotBlank(groups = edu.msudenver.tsp.persistence.dto.Account.Insert.class, message = "A username must be specified") @Size(max = 50) private String username;
@NotBlank(groups = edu.msudenver.tsp.persistence.dto.Account.Insert.class, message = "A password must be specified") @Size(max = 256) private String password;
@NotNull @SerializedName("administrator_status") private boolean administratorStatus;
@Temporal(TemporalType.DATE) @SerializedName("last_login") private Date lastLogin;
@@ -1,41 +1,24 @@
package edu.msudenver.tsp.services.parser;
import edu.msudenver.tsp.persistence.controller.DefinitionController;
import edu.msudenver.tsp.persistence.controller.NotationController;
import edu.msudenver.tsp.persistence.controller.ProofController;
import edu.msudenver.tsp.persistence.controller.TheoremController;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
class ParserService {
private final DefinitionController definitionController;
private final TheoremController theoremController;
private final NotationController notationController;
private final ProofController proofController;
private Node root;
@Autowired
public ParserService(final DefinitionController definitionController, final TheoremController theoremController,
final NotationController notationController, final ProofController proofController) {
this.definitionController = definitionController;
this.theoremController = theoremController;
this.notationController = notationController;
this.proofController = proofController;
}
public boolean parseUserInput(final String userInput)
{
try {
final Node tree = parseRawInput(userInput);
final List<String> statements = retrieveStatements(tree);
retrieveStatements(tree);
return true;
} catch(final Exception e) {
e.printStackTrace();
LOG.error(e.getMessage());
}
return false;
}
@@ -44,7 +27,7 @@ class ParserService {
{
input = input.toLowerCase();
root = new Node(input, null);
final Node root = new Node(input, null);
if(input.equals(""))
{