Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/julianmendez/born into cr…
Browse files Browse the repository at this point in the history
…eate-gui-tests
  • Loading branch information
Julian Mendez committed Nov 23, 2016
2 parents ccd9837 + 25da0f8 commit 62ba9f2
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public AnnotatorConfiguration getAnnotatorConfiguration() {

@Override
public void setAnnotatorConfiguration(AnnotatorConfiguration annotatorConfiguration) {
Objects.requireNonNull(annotatorConfiguration);
this.annotatorConfiguration = annotatorConfiguration;
this.annotatorConfiguration = Objects.requireNonNull(annotatorConfiguration);
}

@Override
Expand All @@ -49,8 +48,7 @@ public ProcessorConfiguration getProcessorConfiguration() {

@Override
public void setProcessorConfiguration(ProcessorConfiguration processorConfiguration) {
Objects.requireNonNull(processorConfiguration);
this.processorConfiguration = processorConfiguration;
this.processorConfiguration = Objects.requireNonNull(processorConfiguration);
}

@Override
Expand All @@ -60,8 +58,7 @@ public MultiProcessorConfiguration getMultiProcessorConfiguration() {

@Override
public void setMultiProcessorConfiguration(MultiProcessorConfiguration multiProcessorConfiguration) {
Objects.requireNonNull(multiProcessorConfiguration);
this.multiProcessorConfiguration = multiProcessorConfiguration;
this.multiProcessorConfiguration = Objects.requireNonNull(multiProcessorConfiguration);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public class BornPanel extends JPanel implements BornView {
* model
*/
public BornPanel(BornModel model) {
Objects.requireNonNull(model);
this.model = model;
this.model = Objects.requireNonNull(model);
this.processorView = new ProcessorPanel(this.model.getProcessorConfiguration());
this.testMakerView = new TestMakerPanel(this.model.getAnnotatorConfiguration());
this.experimentMakerView = new ExperimentRunnerPanel(this.model.getMultiProcessorConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ public void run() {
* an OWL ontology manager
*/
public ExperimentRunnerController(ExperimentRunnerView view, OWLOntologyManager ontologyManager) {
Objects.requireNonNull(view);
Objects.requireNonNull(ontologyManager);
this.view = view;
this.owlOntologyManager = ontologyManager;
this.view = Objects.requireNonNull(view);
this.owlOntologyManager = Objects.requireNonNull(ontologyManager);
init();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public class ExperimentRunnerPanel extends JPanel implements ExperimentRunnerVie
* model
*/
public ExperimentRunnerPanel(MultiProcessorConfiguration model) {
Objects.requireNonNull(model);
this.model = model;
this.model = Objects.requireNonNull(model);
createPanel();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ public void run() {
* an OWL ontology manager
*/
public ProcessorController(ProcessorView view, OWLOntologyManager ontologyManager) {
Objects.requireNonNull(view);
Objects.requireNonNull(ontologyManager);
this.view = view;
this.owlOntologyManager = ontologyManager;
this.view = Objects.requireNonNull(view);
this.owlOntologyManager = Objects.requireNonNull(ontologyManager);
init();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public class ProcessorPanel extends JPanel implements ProcessorView {
private final ProcessorConfiguration model;

public ProcessorPanel(ProcessorConfiguration model) {
Objects.requireNonNull(model);
this.model = model;
this.model = Objects.requireNonNull(model);
setLayout(null);
createPanel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ public class TestMakerController implements ActionListener {
* an OWL ontology manager
*/
public TestMakerController(TestMakerView view, OWLOntologyManager ontologyManager) {
Objects.requireNonNull(view);
Objects.requireNonNull(ontologyManager);
this.view = view;
this.owlOntologyManager = ontologyManager;
this.view = Objects.requireNonNull(view);
this.owlOntologyManager = Objects.requireNonNull(ontologyManager);
init();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public class TestMakerPanel extends JPanel implements TestMakerView {
* model
*/
public TestMakerPanel(AnnotatorConfiguration model) {
Objects.requireNonNull(model);
this.model = model;
this.model = Objects.requireNonNull(model);
createPanel();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public class BornStarter implements OWLOntologyChangeListener, OWLOntologyLoader
* OWL ontology manager
*/
public BornStarter(OWLOntologyManager manager) {
Objects.requireNonNull(manager);
this.ontologyManager = manager;
this.ontologyManager = Objects.requireNonNull(manager, "Ontology manager must not be null");
this.panel = new BornController(new BornPanel(new BornModelImpl()), this.ontologyManager);
getOWLOntologyManager().addOntologyLoaderListener(this);
getOWLOntologyManager().addOntologyChangeListener(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public EmptyRule() {
}

public EmptyRule(String comment) {
Objects.requireNonNull(comment);
this.comment = comment;
this.comment = Objects.requireNonNull(comment);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ public ClauseImpl() {
* body
*/
public ClauseImpl(Term head, List<Term> body) {
Objects.requireNonNull(head);
Objects.requireNonNull(body);
this.head = head;
this.head = Objects.requireNonNull(head);
this.body.addAll(body);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public ProbClauseImpl() {
public ProbClauseImpl(Term head, List<Term> body, String probability) {
Objects.requireNonNull(head);
Objects.requireNonNull(body);
Objects.requireNonNull(probability);
this.clause = new ClauseImpl(head, body);
this.probability = probability;
this.probability = Objects.requireNonNull(probability);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ public TermImpl(String name, List<Term> arguments) {
*/
public TermImpl(Term leftTerm, String infixOperator, Term rightTerm) {
Objects.requireNonNull(leftTerm);
Objects.requireNonNull(infixOperator);
Objects.requireNonNull(rightTerm);
this.name = infixOperator;
this.name = Objects.requireNonNull(infixOperator);
this.arguments.add(leftTerm);
this.arguments.add(rightTerm);
this.termType = Term.Type.INFIX_OPERATOR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public class DefaultIdentifierCollector {
* normalized axiom
*/
public DefaultIdentifierCollector(NormalizedIntegerAxiom axiom) {
Objects.requireNonNull(axiom);
this.axiom = axiom;
this.axiom = Objects.requireNonNull(axiom);
axiom.accept(new AuxiliaryIdentifierCollector());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public class Module {
private Set<NormalizedIntegerAxiom> axioms;

public Module(Set<Integer> entities, Set<NormalizedIntegerAxiom> axioms) {
Objects.requireNonNull(entities);
Objects.requireNonNull(axioms);
this.entities = entities;
this.axioms = axioms;
this.entities = Objects.requireNonNull(entities);
this.axioms = Objects.requireNonNull(axioms);
}

public Set<Integer> getEntities() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public InputStream getInputOntology() {

@Override
public void setInputOntology(InputStream inputOntology) {
Objects.requireNonNull(inputOntology);
this.inputOntology = inputOntology;
this.inputOntology = Objects.requireNonNull(inputOntology);
}

@Override
Expand All @@ -35,8 +34,7 @@ public OutputStream getOutputOntology() {

@Override
public void setOutputOntology(OutputStream outputOntology) {
Objects.requireNonNull(outputOntology);
this.outputOntology = outputOntology;
this.outputOntology = Objects.requireNonNull(outputOntology);
}

@Override
Expand All @@ -56,8 +54,7 @@ public Set<String> getInputBayesianNetworkVariables() {

@Override
public void setInputBayesianNetworkVariables(Set<String> inputBayesianNetworkVariables) {
Objects.requireNonNull(inputBayesianNetworkVariables);
this.inputBayesianNetworkVariables = inputBayesianNetworkVariables;
this.inputBayesianNetworkVariables = Objects.requireNonNull(inputBayesianNetworkVariables);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@ public class ExampleConfigurationImpl implements ExampleConfiguration {
*/
public ExampleConfigurationImpl(String ontologyName, String ontologyFileName, OWLOntology owlOntology,
String bayesianNetworkFileName, String bayesianNetwork, String query) {
Objects.requireNonNull(ontologyName);
Objects.requireNonNull(ontologyFileName);
Objects.requireNonNull(owlOntology);
Objects.requireNonNull(bayesianNetworkFileName);
Objects.requireNonNull(bayesianNetwork);
Objects.requireNonNull(query);
this.ontologyName = ontologyName;
this.ontologyFileName = ontologyFileName;
this.owlOntology = owlOntology;
this.bayesianNetworkFileName = bayesianNetworkFileName;
this.bayesianNetwork = bayesianNetwork;
this.query = query;
this.ontologyName = Objects.requireNonNull(ontologyName);
this.ontologyFileName = Objects.requireNonNull(ontologyFileName);
this.owlOntology = Objects.requireNonNull(owlOntology);
this.bayesianNetworkFileName = Objects.requireNonNull(bayesianNetworkFileName);
this.bayesianNetwork = Objects.requireNonNull(bayesianNetwork);
this.query = Objects.requireNonNull(query);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ String getFile(InputStream input) throws IOException {
}

String getFileName(String fileNameWithPath) {
Objects.requireNonNull(fileNameWithPath);
String ret = fileNameWithPath;
String ret = Objects.requireNonNull(fileNameWithPath);
int lastIndex = fileNameWithPath.lastIndexOf(Symbol.FILE_SEPARATOR);
if (lastIndex != -1) {
ret = fileNameWithPath.substring(lastIndex + Symbol.FILE_SEPARATOR.length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ public BornReasoner(OWLOntology rootOntology, boolean buffering) {
*/
public BornReasoner(OWLOntology rootOntology, boolean buffering, OWLReasonerConfiguration configuration) {
this(rootOntology, buffering);
Objects.requireNonNull(rootOntology);
Objects.requireNonNull(configuration);
this.reasonerConfiguration = configuration;
this.reasonerConfiguration = Objects.requireNonNull(configuration);
}

public boolean addAxiom(OWLAxiom axiom) {
Expand Down Expand Up @@ -198,7 +196,7 @@ public NodeSet<OWLDataProperty> getDisjointDataProperties(OWLDataPropertyExpress
@Override
public NodeSet<OWLObjectPropertyExpression> getDisjointObjectProperties(
OWLObjectPropertyExpression objectPropertyExpression) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getDisjointDataProperties(" + objectPropertyExpression + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand Down Expand Up @@ -226,7 +224,7 @@ public Node<OWLDataProperty> getEquivalentDataProperties(OWLDataProperty dataPro
@Override
public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties(
OWLObjectPropertyExpression objectPropertyExpression) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getEquivalentObjectProperties(" + objectPropertyExpression + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand Down Expand Up @@ -258,7 +256,7 @@ public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression classExpressi
@Override
public Node<OWLObjectPropertyExpression> getInverseObjectProperties(
OWLObjectPropertyExpression objectPropertyExpression) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getInverseObjectProperties(" + objectPropertyExpression + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand All @@ -268,7 +266,7 @@ public Node<OWLObjectPropertyExpression> getInverseObjectProperties(
@Override
public NodeSet<OWLClass> getObjectPropertyDomains(OWLObjectPropertyExpression objectPropertyExpression,
boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException,
TimeOutException {
TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getObjectPropertyDomains(" + objectPropertyExpression + ", " + direct + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand All @@ -278,7 +276,7 @@ public NodeSet<OWLClass> getObjectPropertyDomains(OWLObjectPropertyExpression ob
@Override
public NodeSet<OWLClass> getObjectPropertyRanges(OWLObjectPropertyExpression objectPropertyExpression,
boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException,
TimeOutException {
TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getObjectPropertyRanges(" + objectPropertyExpression + ", " + direct + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand All @@ -288,7 +286,7 @@ public NodeSet<OWLClass> getObjectPropertyRanges(OWLObjectPropertyExpression obj
@Override
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(OWLNamedIndividual individual,
OWLObjectPropertyExpression objectPropertyExpression) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(individual);
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getObjectPropertyValues(" + individual + ", " + objectPropertyExpression + ")");
Expand Down Expand Up @@ -397,7 +395,7 @@ public NodeSet<OWLDataProperty> getSubDataProperties(OWLDataProperty dataPropert
@Override
public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties(
OWLObjectPropertyExpression objectPropertyExpression, boolean direct) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getSubObjectProperties(" + objectPropertyExpression + ", " + direct + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand Down Expand Up @@ -427,7 +425,7 @@ public NodeSet<OWLDataProperty> getSuperDataProperties(OWLDataProperty dataPrope
@Override
public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties(
OWLObjectPropertyExpression objectPropertyExpression, boolean direct) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getSuperObjectProperties(" + objectPropertyExpression + ", " + direct + ")");
throw new UnsupportedReasonerOperationInBornException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public List<OntologyAndNetwork> getOntologyList() {

@Override
public void setOntologyList(List<OntologyAndNetwork> ontologyList) {
Objects.requireNonNull(ontologyList);
this.ontologyList = ontologyList;
this.ontologyList = Objects.requireNonNull(ontologyList);
}

@Override
Expand All @@ -39,8 +38,7 @@ public String getOutputDirectory() {

@Override
public void setOutputDirectory(String outputDirectory) {
Objects.requireNonNull(outputDirectory);
this.outputDirectory = outputDirectory;
this.outputDirectory = Objects.requireNonNull(outputDirectory);
}

@Override
Expand Down Expand Up @@ -70,8 +68,7 @@ public Function<String, String> getQueryProcessor() {

@Override
public void setQueryProcessor(Function<String, String> queryProcessor) {
Objects.requireNonNull(queryProcessor);
this.queryProcessor = queryProcessor;
this.queryProcessor = Objects.requireNonNull(queryProcessor);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ public OntologyAndNetwork(OWLOntology owlOntology) {
* Bayesian network in ProbLog syntax
*/
public OntologyAndNetwork(OWLOntology owlOntology, String bayesianNetwork) {
Objects.requireNonNull(owlOntology);
Objects.requireNonNull(bayesianNetwork);
this.owlOntology = owlOntology;
this.owlOntology = Objects.requireNonNull(owlOntology);
this.ontologyName = owlOntology.getOntologyID().toString();
this.bayesianNetwork = bayesianNetwork;
this.bayesianNetwork = Objects.requireNonNull(bayesianNetwork);
}

/**
Expand All @@ -57,12 +55,9 @@ public OntologyAndNetwork(OWLOntology owlOntology, String bayesianNetwork) {
* Bayesian network in ProbLog syntax
*/
public OntologyAndNetwork(String ontologyName, OWLOntology owlOntology, String bayesianNetwork) {
Objects.requireNonNull(ontologyName);
Objects.requireNonNull(owlOntology);
Objects.requireNonNull(bayesianNetwork);
this.ontologyName = ontologyName;
this.owlOntology = owlOntology;
this.bayesianNetwork = bayesianNetwork;
this.ontologyName = Objects.requireNonNull(ontologyName);
this.owlOntology = Objects.requireNonNull(owlOntology);
this.bayesianNetwork = Objects.requireNonNull(bayesianNetwork);
}

/**
Expand Down
Loading

0 comments on commit 62ba9f2

Please sign in to comment.