Remove unneccesary log lines and clean up some documentation

This commit is contained in:
James Agnew 2018-02-24 10:57:32 -05:00
parent 3b2930f8e9
commit 6e47951220
6 changed files with 32 additions and 21 deletions

View File

@ -55,7 +55,7 @@ public interface IParserErrorHandler {
void incorrectJsonType(IParseLocation theLocation, String theElementName, ValueType theExpectedValueType, ScalarType theExpectedScalarType, ValueType theFoundValueType, ScalarType theFoundScalarType);
/**
* The parser detected an atttribute value that was invalid (such as: empty "" values are not permitted)
* The parser detected an attribute value that was invalid (such as: empty "" values are not permitted)
*
* @param theLocation
* The location in the document. Note that this may be <code>null</code> as the ParseLocation feature is experimental. Use with caution, as the API may change.
@ -70,7 +70,7 @@ public interface IParserErrorHandler {
*
* @param theLocation
* The location in the document. Note that this may be <code>null</code> as the ParseLocation feature is experimental. Use with caution, as the API may change.
* @param theReference The actual invalid reference (e.g. "#3")
* @param theElementName The missing element name
* @since 2.1
*/
void missingRequiredElement(IParseLocation theLocation, String theElementName);
@ -123,7 +123,7 @@ public interface IParserErrorHandler {
* type which will currently always be set to null. This interface is included here so that
* locations can be added to the API in a future release without changing the API.
*/
public interface IParseLocation {
interface IParseLocation {
/**
* Returns the name of the parent element (the element containing the element currently being parsed)

View File

@ -1033,7 +1033,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
} else {
parentElementName = "extension";
}
getErrorHandler().missingRequiredElement(new ParseLocation(parentElementName), "url");
getErrorHandler().missingRequiredElement(new ParseLocation().setParentElementName(parentElementName), "url");
url = null;
} else {
url = getExtensionUrl(jsonElement.getAsString());

View File

@ -9,9 +9,9 @@ package ca.uhn.fhir.parser;
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -29,9 +29,8 @@ class ParseLocation implements IParseLocation {
/**
* Constructor
*/
public ParseLocation(String theParentElementName) {
public ParseLocation() {
super();
myParentElementName = theParentElementName;
}
@Override
@ -39,4 +38,9 @@ class ParseLocation implements IParseLocation {
return myParentElementName;
}
public ParseLocation setParentElementName(String theParentElementName) {
myParentElementName = theParentElementName;
return this;
}
}

View File

@ -806,7 +806,7 @@ class ParserState<T> {
@SuppressWarnings("unchecked")
List<IBase> securityLabels = (List<IBase>) myMap.get(ResourceMetadataKeyEnum.SECURITY_LABELS);
if (securityLabels == null) {
securityLabels = new ArrayList<IBase>();
securityLabels = new ArrayList<>();
myMap.put(ResourceMetadataKeyEnum.SECURITY_LABELS, securityLabels);
}
IBase securityLabel = myContext.getVersion().newCodingDt();

View File

@ -7,6 +7,7 @@ import ca.uhn.fhir.model.dstu2.resource.Bundle.Entry;
import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
import ca.uhn.fhir.model.dstu2.resource.ValueSet;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
@ -163,7 +164,7 @@ public class ValidationDataUploader extends BaseCommand {
ValueSet next = (ValueSet) i.getResource();
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
@ -182,7 +183,7 @@ public class ValidationDataUploader extends BaseCommand {
ValueSet next = (ValueSet) i.getResource();
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
@ -200,7 +201,7 @@ public class ValidationDataUploader extends BaseCommand {
ValueSet next = (ValueSet) i.getResource();
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
}
@ -225,7 +226,7 @@ public class ValidationDataUploader extends BaseCommand {
}
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading StructureDefinition {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading StructureDefinition {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
try {
client.update().resource(next).execute();
} catch (Exception e) {
@ -268,12 +269,14 @@ public class ValidationDataUploader extends BaseCommand {
int bytes = ctx.newXmlParser().encodeResourceToString(next).length();
ourLog.info("Uploading ValueSet {}/{} : {} ({} bytes}", new Object[]{count, total, next.getIdElement().getValue(), bytes});
ourLog.info("Uploading ValueSet {}/{} : {} ({} bytes}", new Object[] {count, total, next.getIdElement().getValue(), bytes});
try {
IIdType id = client.update().resource(next).execute().getId();
ourLog.info(" - Got ID: {}", id.getValue());
} catch (UnprocessableEntityException e) {
ourLog.warn("UnprocessableEntityException: " + e.toString());
} catch (BaseServerResponseException e) {
ourLog.warn("Server responded HTTP " + e.getStatusCode() + ": " + e.toString());
}
count++;
}
@ -293,7 +296,7 @@ public class ValidationDataUploader extends BaseCommand {
org.hl7.fhir.dstu3.model.Resource next = i.getResource();
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
try {
client.update().resource(next).execute();
} catch (Exception e) {
@ -318,7 +321,7 @@ public class ValidationDataUploader extends BaseCommand {
}
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
}
@ -364,7 +367,7 @@ public class ValidationDataUploader extends BaseCommand {
int bytes = theCtx.newXmlParser().encodeResourceToString(next).length();
ourLog.info("Uploading ValueSet {}/{} : {} ({} bytes}", new Object[]{count, total, next.getIdElement().getValue(), bytes});
ourLog.info("Uploading ValueSet {}/{} : {} ({} bytes}", new Object[] {count, total, next.getIdElement().getValue(), bytes});
try {
IIdType id = client.update().resource(next).execute().getId();
ourLog.info(" - Got ID: {}", id.getValue());
@ -388,7 +391,7 @@ public class ValidationDataUploader extends BaseCommand {
org.hl7.fhir.r4.model.Resource next = i.getResource();
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
@ -410,7 +413,7 @@ public class ValidationDataUploader extends BaseCommand {
}
next.setId(next.getIdElement().toUnqualifiedVersionless());
ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[]{count, total, next.getIdElement().getValue()});
ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
}
@ -470,7 +473,7 @@ public class ValidationDataUploader extends BaseCommand {
continue;
}
ourLog.info("Uploading {} StructureDefinition {}/{} : {}", new Object[]{name, count, total, next.getIdElement().getValue()});
ourLog.info("Uploading {} StructureDefinition {}/{} : {}", new Object[] {name, count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;
@ -518,7 +521,7 @@ public class ValidationDataUploader extends BaseCommand {
continue;
}
ourLog.info("Uploading {} StructureDefinition {}/{} : {}", new Object[]{name, count, total, next.getIdElement().getValue()});
ourLog.info("Uploading {} StructureDefinition {}/{} : {}", new Object[] {name, count, total, next.getIdElement().getValue()});
client.update().resource(next).execute();
count++;

View File

@ -154,6 +154,10 @@
Deleting a resource from the testpage overlay resulted in an error page after
clicking "delete", even though the delete succeeded.
</action>
<action type="remove">
A number of info level log lines have been reduced to debug level in the JPA server, in
order to reduce contention during heavy loads.
</action>
</release>
<release version="3.2.0" date="2018-01-13">
<action type="add">