Skip to content

Commit

Permalink
YARG-8 Extract YARG ConsoleRunner into separate module (remove guava …
Browse files Browse the repository at this point in the history
…for yarg-api module)
  • Loading branch information
Andrey Subbotin committed Aug 8, 2017
1 parent 6d254e8 commit 0ce0256
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
11 changes: 4 additions & 7 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ configure([api, core, console]) {
}

dependencies {
compile(group: 'com.google.guava', name: 'guava', version: '19.0')
deployerJars(group: 'org.apache.maven.wagon', name: 'wagon-http', version: '1.0-beta-2')
}

Expand Down Expand Up @@ -167,7 +166,6 @@ configure([api, core, console]) {
}

configure(api) {

}

configure(core) {
Expand All @@ -187,7 +185,6 @@ configure(core) {
compile(group: 'commons-io', name: 'commons-io', version: '2.4')
compile(group: 'dom4j', name: 'dom4j', version: '1.6.1')
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21')
compile(group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.21')
compile(group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.12')
compile(group: 'antlr', name: 'antlr', version: '2.7.7')
compile(group: 'asm', name: 'asm', version: '3.3.1')
Expand All @@ -203,10 +200,10 @@ configure(core) {
compile(group: "org.plutext", name: "jaxb-svg11", version: "1.0.2")
compile(group: "org.plutext", name: "jaxb-xslfo", version: "1.0.1")
compile(group: "org.plutext", name: "jaxb-xmldsig-core", version: "1.0.0")
compile(group: "org.apache.xmlgraphics", name: "batik-bridge", version: "1.7")
compile(group: "org.apache.xmlgraphics", name: "batik-svggen", version: "1.7")
compile(group: "org.apache.xmlgraphics", name: "batik-awt-util", version: "1.7")
compile(group: "org.apache.xmlgraphics", name: "batik-css", version: "1.7")
compile(group: "org.apache.xmlgraphics", name: "batik-bridge", version: "1.8")
compile(group: "org.apache.xmlgraphics", name: "batik-svggen", version: "1.8")
compile(group: "org.apache.xmlgraphics", name: "batik-awt-util", version: "1.8")
compile(group: "org.apache.xmlgraphics", name: "batik-css", version: "1.8")
compile(group: "xalan", name: "xalan", version: "2.7.1")
compile(group: "xalan", name: "serializer", version: "2.7.1")
compile(group: "com.lowagie", name: "itext", version: "2.1.7") {
Expand Down
17 changes: 12 additions & 5 deletions core/modules/api/src/com/haulmont/yarg/reporting/RunParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.haulmont.yarg.reporting;

import com.google.common.base.Preconditions;
import com.haulmont.yarg.structure.Report;
import com.haulmont.yarg.structure.ReportTemplate;

Expand All @@ -40,17 +39,23 @@ public RunParams(Report report) {
* @param templateCode - string code of template
*/
public RunParams templateCode(String templateCode) {
Preconditions.checkNotNull(templateCode, "\"templateCode\" parameter can not be null");
if (templateCode == null) {
throw new NullPointerException("\"templateCode\" parameter can not be null");
}
this.reportTemplate = report.getReportTemplates().get(templateCode);
Preconditions.checkNotNull(reportTemplate, String.format("Report template not found for code [%s]", templateCode));
if (reportTemplate == null) {
throw new NullPointerException(String.format("Report template not found for code [%s]", templateCode));
}
return this;
}

/**
* Setup template. Throws validation exception if template is null
*/
public RunParams template(ReportTemplate reportTemplate) {
Preconditions.checkNotNull(reportTemplate, "\"reportTemplate\" parameter can not be null");
if (reportTemplate == null) {
throw new NullPointerException("\"reportTemplate\" parameter can not be null");
}
this.reportTemplate = reportTemplate;
return this;
}
Expand All @@ -59,7 +64,9 @@ public RunParams template(ReportTemplate reportTemplate) {
* Adds parameters from map
*/
public RunParams params(Map<String, Object> params) {
Preconditions.checkNotNull(params, "\"params\" parameter can not be null");
if (params == null) {
throw new NullPointerException("\"params\" parameter can not be null");
}
this.params.putAll(params);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.haulmont.yarg.structure;

import com.google.common.base.Preconditions;

import java.io.Serializable;
import java.util.*;

Expand Down Expand Up @@ -229,7 +227,9 @@ protected static class BandNameVisitor implements BandVisitor {
protected BandData foundBand;

public BandNameVisitor(String name) {
Preconditions.checkNotNull(name, "Could not find band with name = null");
if (name == null) {
throw new NullPointerException("Could not find band with name = null");
}
this.name = name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package com.haulmont.yarg.structure;

import com.google.common.base.Preconditions;

import java.io.ObjectStreamException;
import java.io.Serializable;
import java.util.Map;
Expand Down Expand Up @@ -52,7 +50,9 @@ public class ReportOutputType implements Serializable {
}

protected static void registerOutputType(ReportOutputType outputType) {
Preconditions.checkNotNull(outputType, "\"outputType\" parameter can not be null");
if (outputType == null) {
throw new NullPointerException("\"outputType\" parameter can not be null");
}
values.put(outputType.id, outputType);
}

Expand All @@ -61,7 +61,9 @@ public static ReportOutputType getOutputTypeById(String id) {
}

public ReportOutputType(String id) {
Preconditions.checkNotNull(id, "\"id\" field can not be null");
if (id == null) {
throw new NullPointerException("\"id\" field can not be null");
}
this.id = id;
}

Expand Down

0 comments on commit 0ce0256

Please sign in to comment.