Skip to content
Open
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ dependencies {
providedCompile group: 'org.apache.tomcat', name: 'catalina', version: '6.0.53'
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1'
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
providedCompile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
// providedCompile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest that you put a copy of build.gradle with a suffix like '.with_old_libs.3.11.26' and remove the commented stuff. Sonar gripes at me about commented out code and I used to balk, but it's turned out to be for the better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to just trust Git and remove it all after we got a successful test-deploy test in SIT


implementation group: 'org.jdom', name: 'jdom', version: '1.1.3'

Expand Down Expand Up @@ -246,16 +246,16 @@ dependencies {


// implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.6'
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
implementation group: 'javax.activation', name: 'activation', version: '1.1.1'
//implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.6'
//implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
//implementation group: 'javax.activation', name: 'activation', version: '1.1.1'

implementation group: 'org.jvnet.jaxb2_commons', name: 'jaxb2-basics-runtime', version: '0.11.0'
implementation group: 'com.sun.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0-b170127.1453'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.0-b170127.1453'
//implementation group: 'org.jvnet.jaxb2_commons', name: 'jaxb2-basics-runtime', version: '0.11.0'
//implementation group: 'com.sun.xml.bind', name: 'jaxb-api', version: '2.3.1'
//implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0-b170127.1453'
//implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.0-b170127.1453'

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.5.1'
//implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.5.1'
implementation group: 'io.netty', name: 'netty-codec', version: '4.1.68.Final'

implementation group: 'xerces', name: 'xercesImpl', version: '2.12.2'
Expand Down
7 changes: 6 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@

<property name="joda-time.lib" value="joda-time-2.12.7.jar"/>

<!--
<property name="jaxb-api.lib" value="jaxb-api-2.3.1.jar"/>
<property name="jaxb-core.lib" value="jaxb-core-2.3.0-b170127.1453.jar"/>
<property name="jaxb-impl.lib" value="jaxb-impl-2.3.0-b170127.1453.jar"/>
Expand All @@ -317,6 +318,7 @@
<property name="javax.activation.lib" value="activation-1.1.1.jar"/>

<property name="xlink.lib" value="xlink-v_1_0-1.4.0.jar"/>
-->

<!-- Cloudwatch logback appender -->
<property name="cloudwatch-logback-appender.lib" value="cloudwatch-logback-appender-3.11.jar"/>
Expand Down Expand Up @@ -358,24 +360,27 @@
<include name="${aws-java-sdk-ec2.lib}"/>
<include name="${aws-java-sdk-logs.lib}"/>

<!--
<include name="${jackson-core.lib}"/>
<include name="${jackson-databind.lib}"/>
<include name="${jackson-annotations.lib}"/>

-->
<include name="${java-jwt.lib}"/>
<include name="${jwks-rsa.lib}"/>

<include name="${joda-time.lib}"/>

<include name="${urlRewrite.lib}"/>

<!--
<include name="${jaxb-api.lib}"/>
<include name="${jaxb-core.lib}"/>
<include name="${jaxb-impl.lib}"/>
<include name="${jaxb-runtime.lib}"/>
<include name="${javax.annotation-api.lib}"/>
<include name="${javax.activation.lib}"/>
<include name="${xlink.lib}"/>
-->
</fileset>
<!--
These are the library jars used by Hyrax.
Expand Down
2 changes: 1 addition & 1 deletion dmrppJoinExisiting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ located identified in the arguments. Run this target with no arguments to see th
Use -DARGS=&quot;...&quot; to specify command line options."
depends="compile ">

<java classname="opendap.dap4.DmrppJoinExistingAggregator"
<java classname="opendap.dap4.dmrpp.DmrppJoinExistingAggregator"
fork="true"
maxmemory="4096m"
dir="${build.run}" >
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package opendap.dap4;
package opendap.dap4.dmrpp;

import java.lang.Exception;

Check warning on line 3 in src/opendap/dap4/dmrpp/DmrppAggException.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unnecessary import: java.lang classes are always implicitly imported.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6oASM0YAVBIObqWa&open=AZze6oASM0YAVBIObqWa&pullRequest=287

public class DmrppAggException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
* /////////////////////////////////////////////////////////////////////////////
*/
package opendap.dap4;
package opendap.dap4.dmrpp;

import ch.qos.logback.classic.Level;
import opendap.logging.LogUtil;
Expand Down Expand Up @@ -152,7 +152,7 @@
else {
log.debug("Ingesting ListFile: {}", listFileName);
BufferedReader reader=null;
try{

Check failure on line 155 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change this "try" to a try-with-resources.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWN&open=AZze6n-NM0YAVBIObqWN&pullRequest=287
reader = new BufferedReader(new FileReader(listFileName));
String value = reader.readLine();
while(value!=null){
Expand All @@ -179,7 +179,7 @@
* @throws MalformedURLException
* @throws DmrppAggException
*/
public void ingestDmrppList(ArrayList<String> dmrpp_urls) throws IOException, DmrppAggException {

Check warning on line 182 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'java.io.IOException', as it cannot be thrown from method's body.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZ0ICroTPWE6nyE9h9hE&open=AZ0ICroTPWE6nyE9h9hE&pullRequest=287

Check warning on line 182 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWL&open=AZze6n-NM0YAVBIObqWL&pullRequest=287

for(String dmrppUrl: dmrpp_urls){
String targetUrl;
Expand Down Expand Up @@ -213,7 +213,7 @@
}

/*
if(dmrpp_urls.size()>1) {

Check warning on line 216 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWO&open=AZze6n-NM0YAVBIObqWO&pullRequest=287
}
else if(dmrpp_urls.size()==1){
File arg0 = new File(dmrpp_urls.iterator().next());
Expand Down Expand Up @@ -290,8 +290,8 @@

if(log.isDebugEnabled()) {
XMLOutputter xmlo = new XMLOutputter(Format.getPrettyFormat());
for (String aggVarName : templateVars.keySet()) {

Check warning on line 293 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "aggVarName" which hides the field declared at line 85.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWP&open=AZze6n-NM0YAVBIObqWP&pullRequest=287
Element aggVarElement = templateVars.get(aggVarName);

Check warning on line 294 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "aggVarElement" which hides the field declared at line 84.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWQ&open=AZze6n-NM0YAVBIObqWQ&pullRequest=287
log.debug("aggVar:\n{}", xmlo.outputString(aggVarElement));
}
}
Expand All @@ -304,7 +304,7 @@
* @param chunkIndex
* @throws DmrppAggException
*/
public void ingestAggDataset(Document datasetDoc, int chunkIndex) throws DmrppAggException, IOException {

Check warning on line 307 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'java.io.IOException', as it cannot be thrown from method's body.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZ0ICroTPWE6nyE9h9hF&open=AZ0ICroTPWE6nyE9h9hF&pullRequest=287

Element datasetElement = datasetDoc.getRootElement();
String s = datasetElement.getAttributeValue(DMRPP.HREF,DMRPP.NS);
Expand All @@ -327,7 +327,7 @@
@SuppressWarnings("unchecked")
List<Element> dapObjects = container.getChildren();
for(Element dapObject:dapObjects){
String aggVarName = getFQN(dapObject);

Check warning on line 330 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "aggVarName" which hides the field declared at line 85.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWR&open=AZze6n-NM0YAVBIObqWR&pullRequest=287
log.debug("Begin processing {}",aggVarName);
if (dapObject.getName().equals(DAP4.GROUP)){
aggContainer(dapObject, dataURL, chunkIndex);
Expand Down Expand Up @@ -584,7 +584,7 @@
while(dims.hasNext()){
Element dim = dims.next();
String dimName = dim.getAttributeValue(DAP4.NAME);
String dimSize = dim.getAttributeValue(DAP4.SIZE);

Check warning on line 587 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to local variable "dimSize".

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWS&open=AZze6n-NM0YAVBIObqWS&pullRequest=287

Check warning on line 587 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused "dimSize" local variable.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWT&open=AZze6n-NM0YAVBIObqWT&pullRequest=287

if(dimName==null){
// Handle anonymous dimensions
Expand Down Expand Up @@ -755,14 +755,14 @@

if (tChunkDimSizesElement == null) {
// This is a simple hack one dimensional variables with a single chunk.
tChunkDimSizesElement = hack_simple_var_chunks(childFQN, chunksElement);

Check warning on line 758 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this useless assignment to local variable "tChunkDimSizesElement".

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWU&open=AZze6n-NM0YAVBIObqWU&pullRequest=287
//chunksElement.addContent(0, tChunkDimSizesElement);

Check warning on line 759 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWV&open=AZze6n-NM0YAVBIObqWV&pullRequest=287
}
for (Element chunkElement : chunkElements) {
String chunkPositionInArray = chunkElement.getAttributeValue(DMRPP.CHUNK_POSITION_IN_ARRAY);
if (chunkPositionInArray != null) {
// Took this out, looks like a no-op
// chunkElement.setAttribute(DMRPP.CHUNK_POSITION_IN_ARRAY, chunkPositionInArray.replaceFirst("\\[0,", "[0,"));

Check warning on line 765 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWW&open=AZze6n-NM0YAVBIObqWW&pullRequest=287
String href = chunkElement.getAttributeValue(DMRPP.HREF);
if (href == null) {
if (dataURL == null) {
Expand All @@ -770,7 +770,7 @@
"Both the Dataset and the Chunk are missing a " + DMRPP.HREF + " attribute.";
throw new DmrppAggException(sb);
}
chunkElement.setAttribute(DMRPP.HREF, dataURL.toString());

Check warning on line 773 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

"dataURL" is already a string, there's no need to call "toString()" on it.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWX&open=AZze6n-NM0YAVBIObqWX&pullRequest=287
}
}
else if(chunkElements.size()==1){
Expand Down Expand Up @@ -811,7 +811,7 @@
* @param var
* @return
*/
public String getFQN(Element var){

Check warning on line 814 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this variable to not match a restricted identifier.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWY&open=AZze6n-NM0YAVBIObqWY&pullRequest=287

if(var.getName().equals(DAP4.DIM) && var.getNamespace()==DAP4.NS){
String name = var.getAttributeValue(DAP4.NAME);
Expand All @@ -821,7 +821,7 @@
return name;
}

ArrayList<String> name_fields = new ArrayList<>();

Check warning on line 824 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWM&open=AZze6n-NM0YAVBIObqWM&pullRequest=287
name_fields.add(var.getAttributeValue(DAP4.NAME));

Element parentElement = var.getParentElement();
Expand Down Expand Up @@ -862,7 +862,7 @@
log = (Logger) LoggerFactory.getLogger(opendap.xml.Util.class);
log.setLevel(Level.ERROR);
/*
Iterator<Appender<ILoggingEvent>> it = log.iteratorForAppenders();

Check warning on line 865 in src/opendap/dap4/dmrpp/DmrppJoinExistingAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This block of commented-out lines of code should be removed.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6n-NM0YAVBIObqWZ&open=AZze6n-NM0YAVBIObqWZ&pullRequest=287
while (it.hasNext()) {
Appender<ILoggingEvent> app = it.next();
System.out.println( app.getName() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
* /////////////////////////////////////////////////////////////////////////////
*/
package opendap.dap4;
package opendap.dap4.dmrpp;

import ch.qos.logback.classic.Level;
import opendap.bes.BadConfigurationException;
Expand Down Expand Up @@ -116,7 +116,7 @@
}
else {
BufferedReader reader=null;
try{

Check failure on line 119 in src/opendap/dap4/dmrpp/DmrppJoinNewAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change this "try" to a try-with-resources.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6oAeM0YAVBIObqWc&open=AZze6oAeM0YAVBIObqWc&pullRequest=287
reader = new BufferedReader(new FileReader(listFileName));
String value = reader.readLine();
while(value!=null){
Expand Down Expand Up @@ -628,9 +628,9 @@
* @param var
* @return
*/
public String getFQN(Element var){

Check warning on line 631 in src/opendap/dap4/dmrpp/DmrppJoinNewAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this variable to not match a restricted identifier.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6oAeM0YAVBIObqWd&open=AZze6oAeM0YAVBIObqWd&pullRequest=287

ArrayList<String> name_fields = new ArrayList<>();

Check warning on line 633 in src/opendap/dap4/dmrpp/DmrppJoinNewAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6oAeM0YAVBIObqWb&open=AZze6oAeM0YAVBIObqWb&pullRequest=287
name_fields.add(var.getAttributeValue(DAP4.NAME));

Element parentElement = var.getParentElement();
Expand Down Expand Up @@ -680,7 +680,7 @@
//---------------------------
// Debug control
if (cmd.hasOption("d")) {
debugLevel = Level.ALL;

Check warning on line 683 in src/opendap/dap4/dmrpp/DmrppJoinNewAggregator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of "ALL"; it is deprecated.

See more on https://sonarcloud.io/project/issues?id=opendap-olfs&issues=AZze6oAeM0YAVBIObqWe&open=AZze6oAeM0YAVBIObqWe&pullRequest=287
}

//---------------------------
Expand Down