Skip to content

Commit

Permalink
More syntax changes to satisfy scalafmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckerle committed Nov 11, 2023
1 parent 4421833 commit 92e9ecf
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.apache.daffodil.lib.util._
import org.apache.daffodil.lib.xml.XMLUtils
import org.apache.daffodil.lib.xml._
import org.apache.daffodil.runtime1.api.DFDL
import org.apache.daffodil.runtime1.api.MetadataHandler
import org.apache.daffodil.runtime1.debugger._
import org.apache.daffodil.runtime1.infoset.InfosetInputter
import org.apache.daffodil.runtime1.infoset.InfosetOutputter
Expand Down Expand Up @@ -390,6 +391,7 @@ class Fakes private () {
override def tunables: DaffodilTunables = DaffodilTunables()
override def variableMap: VariableMap = VariableMap(Nil)
override def validationMode: ValidationMode.Type = ValidationMode.Full
override def walkMetadata(handler: MetadataHandler): Unit = {}

override def withExternalVariables(extVars: Seq[Binding]): DFDL.DataProcessor = this
override def withExternalVariables(extVars: java.io.File): DFDL.DataProcessor = this
Expand All @@ -404,6 +406,7 @@ class Fakes private () {
override def newContentHandlerInstance(
output: DFDL.Output,
): DFDL.DaffodilUnparseContentHandler = null

}
lazy val fakeDP = new FakeDataProcessor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,31 @@ import org.apache.daffodil.runtime1.api.InfosetArray
import org.apache.daffodil.runtime1.api.InfosetComplexElement
import org.apache.daffodil.runtime1.api.InfosetSimpleElement
import org.apache.daffodil.runtime1.dpath.NodeInfo
import org.apache.daffodil.runtime1.infoset.{InfosetInputter => SInfosetInputter}
import org.apache.daffodil.runtime1.infoset.{InfosetOutputter => SInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.{JDOMInfosetInputter => SJDOMInfosetInputter}
import org.apache.daffodil.runtime1.infoset.{JDOMInfosetOutputter => SJDOMInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.{JsonInfosetInputter => SJsonInfosetInputter}
import org.apache.daffodil.runtime1.infoset.{JsonInfosetOutputter => SJsonInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.{NullInfosetOutputter => SNullInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.{ScalaXMLInfosetInputter => SScalaXMLInfosetInputter}
import org.apache.daffodil.runtime1.infoset.{ScalaXMLInfosetOutputter => SScalaXMLInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.{W3CDOMInfosetInputter => SW3CDOMInfosetInputter}
import org.apache.daffodil.runtime1.infoset.{W3CDOMInfosetOutputter => SW3CDOMInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.{XMLTextInfosetInputter => SXMLTextInfosetInputter}
import org.apache.daffodil.runtime1.infoset.{XMLTextInfosetOutputter => SXMLTextInfosetOutputter}
import org.apache.daffodil.runtime1.infoset.InfosetInputterEventType
import org.apache.daffodil.runtime1.infoset.InfosetOutputterImpl
import org.apache.daffodil.runtime1.infoset.{ InfosetInputter => SInfosetInputter }
import org.apache.daffodil.runtime1.infoset.{ InfosetOutputter => SInfosetOutputter }
import org.apache.daffodil.runtime1.infoset.{ JDOMInfosetInputter => SJDOMInfosetInputter }
import org.apache.daffodil.runtime1.infoset.{ JDOMInfosetOutputter => SJDOMInfosetOutputter }
import org.apache.daffodil.runtime1.infoset.{ JsonInfosetInputter => SJsonInfosetInputter }
import org.apache.daffodil.runtime1.infoset.{ JsonInfosetOutputter => SJsonInfosetOutputter }
import org.apache.daffodil.runtime1.infoset.{ NullInfosetOutputter => SNullInfosetOutputter }
import org.apache.daffodil.runtime1.infoset.{
ScalaXMLInfosetInputter => SScalaXMLInfosetInputter,
}
import org.apache.daffodil.runtime1.infoset.{
ScalaXMLInfosetOutputter => SScalaXMLInfosetOutputter,
}
import org.apache.daffodil.runtime1.infoset.{ W3CDOMInfosetInputter => SW3CDOMInfosetInputter }
import org.apache.daffodil.runtime1.infoset.{
W3CDOMInfosetOutputter => SW3CDOMInfosetOutputter,
}
import org.apache.daffodil.runtime1.infoset.{
XMLTextInfosetInputter => SXMLTextInfosetInputter,
}
import org.apache.daffodil.runtime1.infoset.{
XMLTextInfosetOutputter => SXMLTextInfosetOutputter,
}

/**
* Abstract class used to determine how the infoset representation should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ object DFDL {

def save(output: DFDL.Output): Unit

def walkMetadata(handler: MetadataHandler): Unit
def tunables: DaffodilTunables
def variableMap: VariableMap
def validationMode: ValidationMode.Type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ import org.apache.daffodil.lib.xml.NS
import org.apache.daffodil.lib.xml.NamedQName
import org.apache.daffodil.runtime1.dpath.PrimTypeNode

/*
/**
* This is the supportable API for access to the RuntimeData structures
* which provide access to static information about a given .
*
* This is used to interface other data processing fabrics to Daffodil
* data and metadata, by mapping to/from these metadata objects.
*/
trait Metadata {
def schemaFileLineNumber: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ sealed trait DINode {
}
}
def isArray: Boolean
// def optArray: Option[DIArray]

def asElement: DIElement =
if (isSimple) asSimple
Expand Down Expand Up @@ -1030,7 +1029,6 @@ sealed trait DIElement
def isSimple: Boolean
def isComplex: Boolean
def isArray: Boolean
// def optArray: Option[DIArray]

final def name: String = erd.name
final def namespace: NS = erd.targetNamespace
Expand Down Expand Up @@ -1193,7 +1191,6 @@ final class DIArray(
override def isSimple = false
override def isComplex = false
override def isArray = true
// override lazy val optArray: Option[DIArray] = Some(this)

override def diParent = parent

Expand Down Expand Up @@ -1595,7 +1592,8 @@ sealed class DISimple(override val erd: ElementRuntimeData)
@inline private def v = dataValue.getAnyRef

override def getAnyRef: AnyRef = dataValue.getAnyRef // v.asInstanceOf[AnyRef]
override def getBigDecimal: JBigDecimal = dataValue.getBigDecimal // v.asInstanceOf[JBigDecimal]
override def getBigDecimal: JBigDecimal =
dataValue.getBigDecimal // v.asInstanceOf[JBigDecimal]
override def getCalendar: Calendar = v.asInstanceOf[DFDLCalendar].calendar
override def getDate: Calendar = v.asInstanceOf[DFDLDate].calendar
override def getTime: Calendar = v.asInstanceOf[DFDLTime].calendar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@

package org.apache.daffodil.runtime1.infoset

import scala.xml.NamespaceBinding

import org.apache.daffodil.lib.xml.XMLUtils
import org.apache.daffodil.runtime1.api.DFDL
import org.apache.daffodil.runtime1.api.InfosetArray
import org.apache.daffodil.runtime1.api.InfosetComplexElement
import org.apache.daffodil.runtime1.api.InfosetElement
import org.apache.daffodil.runtime1.api.InfosetSimpleElement
import org.apache.daffodil.runtime1.dpath.NodeInfo

import org.xml.sax.ContentHandler
import org.xml.sax.helpers.AttributesImpl

import scala.xml.NamespaceBinding

class SAXInfosetOutputter(
xmlReader: DFDL.DaffodilParseXMLReader,
val namespacesFeature: Boolean,
Expand Down Expand Up @@ -103,7 +104,10 @@ class SAXInfosetOutputter(

override def endArray(ar: InfosetArray): Unit = {} // not applicable

private def doStartPrefixMapping(elem: InfosetElement, contentHandler: ContentHandler): Unit = {
private def doStartPrefixMapping(
elem: InfosetElement,
contentHandler: ContentHandler,
): Unit = {
val (nsbStart: NamespaceBinding, nsbEnd: NamespaceBinding) = getNsbStartAndEnd(elem)
var n = nsbStart
while (n.ne(nsbEnd) && n.ne(null) && n.ne(scala.xml.TopScope)) {
Expand All @@ -128,7 +132,10 @@ class SAXInfosetOutputter(
* Add the prefixes and uris from the element's NamespaceBinding to Attributes,
* when namespacePrefixes feature is true
*/
private def doAttributesPrefixMapping(elem: InfosetElement, attrs: AttributesImpl): AttributesImpl = {
private def doAttributesPrefixMapping(
elem: InfosetElement,
attrs: AttributesImpl,
): AttributesImpl = {
val (nsbStart: NamespaceBinding, nsbEnd: NamespaceBinding) = getNsbStartAndEnd(elem)
var n = nsbStart
while (n.ne(nsbEnd) && n.ne(null) && n.ne(scala.xml.TopScope)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@

package org.apache.daffodil.runtime1.infoset

import scala.collection.mutable.ListBuffer
import scala.xml.MetaData
import scala.xml.Null
import scala.xml.UnprefixedAttribute

import org.apache.daffodil.lib.exceptions.Assert
import org.apache.daffodil.lib.util.Maybe
import org.apache.daffodil.lib.util.MStackOf
import org.apache.daffodil.lib.util.Maybe
import org.apache.daffodil.lib.xml.XMLUtils
import org.apache.daffodil.runtime1.api.InfosetArray
import org.apache.daffodil.runtime1.api.InfosetComplexElement
import org.apache.daffodil.runtime1.api.InfosetSimpleElement
import org.apache.daffodil.runtime1.dpath.NodeInfo

import scala.collection.mutable.ListBuffer
import scala.xml.MetaData
import scala.xml.Null
import scala.xml.UnprefixedAttribute

class ScalaXMLInfosetOutputter(showFreedInfo: Boolean = false)
extends InfosetOutputterImpl
with XMLInfosetOutputterMixin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@

package org.apache.daffodil.runtime1.processors

import org.apache.daffodil.lib.Implicits._
import org.apache.daffodil.lib.api.Diagnostic
import org.apache.daffodil.runtime1.api.MetadataHandler
import org.apache.daffodil.runtime1.infoset.InfosetOutputter
import org.apache.daffodil.runtime1.layers.LayerExecutionException

import java.io.File
import java.io.IOException
import java.io.ObjectOutputStream
Expand All @@ -33,6 +27,12 @@ import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.util.zip.GZIPOutputStream

import org.apache.daffodil.lib.Implicits._
import org.apache.daffodil.lib.api.Diagnostic
import org.apache.daffodil.runtime1.api.MetadataHandler
import org.apache.daffodil.runtime1.infoset.InfosetOutputter
import org.apache.daffodil.runtime1.layers.LayerExecutionException

object INoWarn4 {
ImplicitsSuppressUnusedImportWarning()
}
Expand All @@ -46,8 +46,8 @@ import org.apache.daffodil.lib.api.WithDiagnostics
import org.apache.daffodil.lib.equality._
import org.apache.daffodil.runtime1.api.DFDL
import org.apache.daffodil.runtime1.debugger.Debugger
import org.apache.daffodil.runtime1.dsom._
import org.apache.daffodil.runtime1.dsom.TunableLimitExceededError
import org.apache.daffodil.runtime1.dsom._
object EqualityNoWarn3 {
EqualitySuppressUnusedImportWarning()
}
Expand All @@ -69,11 +69,11 @@ import org.apache.daffodil.runtime1.infoset.InfosetException
import org.apache.daffodil.runtime1.infoset.InfosetInputter
import org.apache.daffodil.runtime1.infoset.TeeInfosetOutputter
import org.apache.daffodil.runtime1.infoset.XMLTextInfosetOutputter
import org.apache.daffodil.runtime1.processors.parsers.PState
import org.apache.daffodil.runtime1.processors.parsers.ParseError
import org.apache.daffodil.runtime1.processors.parsers.Parser
import org.apache.daffodil.runtime1.processors.parsers.PState
import org.apache.daffodil.runtime1.processors.unparsers.UnparseError
import org.apache.daffodil.runtime1.processors.unparsers.UState
import org.apache.daffodil.runtime1.processors.unparsers.UnparseError

/**
* Implementation mixin - provides simple helper methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package org.apache.daffodil.runtime1.processors

import java.nio.CharBuffer
import java.nio.LongBuffer

import org.apache.daffodil.io.DataStreamCommon
import org.apache.daffodil.io.FormatInfo
import org.apache.daffodil.io.LocalBufferMixin
Expand All @@ -38,28 +41,25 @@ import org.apache.daffodil.lib.schema.annotation.props.gen.BitOrder
import org.apache.daffodil.lib.schema.annotation.props.gen.ByteOrder
import org.apache.daffodil.lib.schema.annotation.props.gen.EncodingErrorPolicy
import org.apache.daffodil.lib.schema.annotation.props.gen.UTF16Width
import org.apache.daffodil.lib.util.MStackOfLong
import org.apache.daffodil.lib.util.Maybe
import org.apache.daffodil.lib.util.Maybe.Nope
import org.apache.daffodil.lib.util.Maybe.One
import org.apache.daffodil.lib.util.MaybeInt
import org.apache.daffodil.lib.util.MaybeULong
import org.apache.daffodil.lib.util.MStackOfLong
import org.apache.daffodil.runtime1.api.DFDL
import org.apache.daffodil.runtime1.api.InfosetElement
import org.apache.daffodil.runtime1.dpath.DState
import org.apache.daffodil.runtime1.dsom.DPathCompileInfo
import org.apache.daffodil.runtime1.dsom.RuntimeSchemaDefinitionError
import org.apache.daffodil.runtime1.dsom.RuntimeSchemaDefinitionWarning
import org.apache.daffodil.runtime1.dsom.ValidationError
import org.apache.daffodil.runtime1.infoset._
import org.apache.daffodil.runtime1.infoset.DataValue.DataValuePrimitive
import org.apache.daffodil.runtime1.infoset._
import org.apache.daffodil.runtime1.processors.dfa.Registers
import org.apache.daffodil.runtime1.processors.dfa.RegistersPool
import org.apache.daffodil.runtime1.processors.unparsers.UState

import java.nio.CharBuffer
import java.nio.LongBuffer

/**
* Trait mixed into the PState.Mark object class and the ParseOrUnparseState
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.daffodil.example

import scala.collection.mutable.ArrayBuffer

import org.apache.daffodil.lib.util.MaybeBoolean
import org.apache.daffodil.runtime1.api.InfosetArray
import org.apache.daffodil.runtime1.api.InfosetComplexElement
Expand Down

0 comments on commit 92e9ecf

Please sign in to comment.