Skip to content

Commit

Permalink
Update scaladocs mentioning deprecated API
Browse files Browse the repository at this point in the history
Ensure nothing mentions the deprecated API removed in previous commits
for DAFFODIL-2743.  Also fix some IDEA nits and bump actions/setup-java
from 3.7.0 to 3.8.0 because GitHub has suddenly removed 3.7.0.

main.yml: Bump actions/setup-java from 3.7.0 to 3.8.0 because GitHub has
suddenly removed 3.7.0, meaning CI now breaks until we bump to 3.8.0.

DataProcessor.scala: Rewrite scaladoc mentioning compilerExternalVars
to say this constructor is for reconstructing a DataProcessor from a
SerializedDataProcessor. Remove another scaladoc since it's no longer
relevant.

SchemaSet.scala: Simplify scaladoc to stop mentioning deprecated API.
Fix some IDEA nits in the same code block with IDEA quick fixes.

DAFFODIL-2743
  • Loading branch information
tuxji committed Dec 6, 2022
1 parent 3e63abc commit 0e9a6b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v3.7.0
uses: actions/setup-java@v3.8.0
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java_version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,9 @@ final class SchemaSet private (
}

/**
* The root element can be specified by a deprecated API call on the compiler
* object or the ProcessorFactory class, but the call on the ProcessorFactory class
* just overrides anything coming from the compiler object.
* You can define the root by passing the root specification to the Compiler.compileX method.
*
* The right way is to pass the root specification to the Compiler.compileX method.
*
* Or, you can leave it unspecified, and this method will determine from the
* Or, you can leave the root unspecified, and this method will determine it from the
* first element declaration of the first schema file.
*/
lazy val root: Root = {
Expand All @@ -360,12 +356,12 @@ final class SchemaSet private (
// if the root element and rootNamespace aren't provided at all, then
// the first element of the first schema document is the root
val sDocs = this.allSchemaDocuments
assuming(sDocs.length > 0)
val firstSchemaDocument = sDocs(0)
assuming(sDocs.nonEmpty)
val firstSchemaDocument = sDocs.head
val gdecl = firstSchemaDocument.globalElementDecls
val firstElement = {
schemaDefinitionUnless(gdecl.length >= 1, "No global elements in: " + firstSchemaDocument.uriString)
gdecl(0)
schemaDefinitionUnless(gdecl.nonEmpty, "No global elements in: " + firstSchemaDocument.uriString)
gdecl.head
}
firstElement
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,27 +154,23 @@ class DataProcessor private (
* That means when we save for reloading, we must explicitly clobber validationMode and externalVars to
* initialized values.
*
* @throws java.io.ObjectStreamException
* @throws java.io.ObjectStreamException Must be part of writeReplace's API
* @return the serializable object
*/
@throws(classOf[java.io.ObjectStreamException])
private def writeReplace() : Object =
new SerializableDataProcessor(ssrd, tunables, externalVars, validationMode)

/**
* The compilerExternalVars argument supports the deprecated feature to assign external var bindings
* on the compiler object.
*
* These are just incorporated into the initial variable map of the data processor.
* This constructor reconstructs a DataProcessor from a SerializedDataProcessor.
*/

def this(
ssrd: SchemaSetRuntimeData,
tunables:DaffodilTunables,
compilerExternalVars: Queue[Binding] = Queue.empty,
externalVars: Queue[Binding] = Queue.empty,
validationMode: ValidationMode.Type = ValidationMode.Off) =
this(ssrd, tunables, ExternalVariablesLoader.loadVariables(compilerExternalVars, ssrd, ssrd.originalVariables),
false, None, validationMode, compilerExternalVars)
this(ssrd, tunables, ExternalVariablesLoader.loadVariables(externalVars, ssrd, ssrd.originalVariables),
false, None, validationMode, externalVars)

def copy(
ssrd: SchemaSetRuntimeData = ssrd,
Expand Down Expand Up @@ -271,13 +267,6 @@ class DataProcessor private (
copy(externalVars = newBindings)
}

/**
* Note that tunables is not used. So this method is equivalent to
* the other similar method that doesn't take that parameter.
*
* @param extVars File containing configuration with external variable bindings in it.
* @param tunable This is ignored.
*/
def withExternalVariables(extVars: Seq[Binding]): DataProcessor = {
val newBindings = loadExternalVariables(extVars)
copy(externalVars = newBindings)
Expand Down

0 comments on commit 0e9a6b8

Please sign in to comment.