Permalink
Browse files

code enhancement

  • Loading branch information...
dgkncelik committed Jun 6, 2018
1 parent c67c19d commit 0479dbccec3b440c09eb187dd63a44f75b66bafc
@@ -6,7 +6,6 @@
import edu.itu.cavabunga.lib.exception.Validation;
import lombok.Data;
import org.hibernate.annotations.DiscriminatorOptions;
import org.omg.PortableServer.THREAD_POLICY_ID;
import javax.persistence.*;
import javax.persistence.Version;
@@ -12,7 +12,7 @@
public class Journal extends Component {
@Override
public void validate(){
if(!(this.getParent() instanceof Component)){
if(this.getParent() != null && !(this.getParent() instanceof Component)){
throw new Validation("Journal component cannot be child of: " + this.getParent().getClass().getName());
}
@@ -22,5 +22,6 @@ public void validate(){
requireOneList.add(PropertyType.Dtstart);
requireOneList.add(PropertyType.Tzname);
requireOneList.add(PropertyType.Tzoffsetfrom);
super.validateRequiredOneProperties(requireOneList);
}
}
@@ -2,7 +2,6 @@
import edu.itu.cavabunga.lib.entity.Parameter;
import edu.itu.cavabunga.lib.exception.Validation;
import org.omg.PortableServer.THREAD_POLICY_ID;
import javax.persistence.Entity;
@@ -4,7 +4,6 @@
import edu.itu.cavabunga.lib.exception.Validation;
import javax.persistence.Entity;
import java.util.List;
@Entity
public class Calscale extends Property {
@@ -3,7 +3,6 @@
import edu.itu.cavabunga.lib.entity.Property;
import javax.persistence.Entity;
import java.util.concurrent.ExecutionException;
@Entity
public class Description extends Property {
@@ -1,10 +1,7 @@
package edu.itu.cavabunga.lib.exception;
public class Conflict extends RuntimeException {
public Conflict(){
}
public Conflict(){}
public Conflict(String message){
super(message);
}
@@ -1,10 +1,7 @@
package edu.itu.cavabunga.lib.exception;
public class NotFound extends RuntimeException {
public NotFound(){
}
public NotFound(){}
public NotFound(String message){
super(message);
}
@@ -1,10 +1,7 @@
package edu.itu.cavabunga.lib.exception;
public class Validation extends RuntimeException {
public Validation(){
}
public Validation(){}
public Validation(String message) { super(message); }
public Validation(Throwable cause) { super(cause); }
}

0 comments on commit 0479dbc

Please sign in to comment.