Skip to content

Commit

Permalink
code enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkncelik committed Jun 6, 2018
1 parent c67c19d commit 0479dbc
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/main/java/edu/itu/cavabunga/lib/entity/Property.java
Expand Up @@ -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;
Expand Down
Expand Up @@ -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());
}

Expand Down
Expand Up @@ -22,5 +22,6 @@ public void validate(){
requireOneList.add(PropertyType.Dtstart);
requireOneList.add(PropertyType.Tzname);
requireOneList.add(PropertyType.Tzoffsetfrom);
super.validateRequiredOneProperties(requireOneList);
}
}
Expand Up @@ -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;

Expand Down
Expand Up @@ -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 {
Expand Down
Expand Up @@ -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 {
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/edu/itu/cavabunga/lib/exception/Conflict.java
@@ -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);
}
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/edu/itu/cavabunga/lib/exception/NotFound.java
@@ -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);
}
Expand Down
@@ -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.