Skip to content

Commit f15ba06

Browse files
committed
Reformatted source code using scalariform
Used options: ``` +alignParameters +alignSingleLineCaseStatements +preserveDanglingCloseParenthesis +preserveSpaceBeforeArguments -spacesWithinPatternBinders ``` Built scalariform from [source](scala-ide/scalariform@1e1315077e).
1 parent fb12a40 commit f15ba06

File tree

81 files changed

+1411
-1278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1411
-1278
lines changed

src/xml/scala/xml/Atom.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
package scala
1010
package xml
1111

12-
/** The class `Atom` provides an XML node for text (`PCDATA`).
12+
/**
13+
* The class `Atom` provides an XML node for text (`PCDATA`).
1314
* It is used in both non-bound and bound XML representations.
1415
*
1516
* @author Burak Emir
1617
* @param data the text contained in this node, may not be `'''null'''`.
1718
*/
1819
class Atom[+A](val data: A) extends SpecialNode with Serializable {
1920
if (data == null)
20-
throw new IllegalArgumentException("cannot construct "+getClass.getSimpleName+" with null")
21+
throw new IllegalArgumentException("cannot construct " + getClass.getSimpleName + " with null")
2122

2223
override protected def basisForHashCode: Seq[Any] = Seq(data)
2324

@@ -32,11 +33,12 @@ class Atom[+A](val data: A) extends SpecialNode with Serializable {
3233
}
3334

3435
final override def doCollectNamespaces = false
35-
final override def doTransform = false
36+
final override def doTransform = false
3637

3738
def label = "#PCDATA"
3839

39-
/** Returns text, with some characters escaped according to the XML
40+
/**
41+
* Returns text, with some characters escaped according to the XML
4042
* specification.
4143
*/
4244
def buildString(sb: StringBuilder): StringBuilder =

src/xml/scala/xml/Attribute.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
package scala
1010
package xml
1111

12-
/** This singleton object contains the `apply` and `unapply` methods for
12+
/**
13+
* This singleton object contains the `apply` and `unapply` methods for
1314
* convenient construction and deconstruction.
1415
*
1516
* @author Burak Emir
@@ -41,14 +42,15 @@ object Attribute {
4142
}
4243
}
4344

44-
/** The `Attribute` trait defines the interface shared by both
45+
/**
46+
* The `Attribute` trait defines the interface shared by both
4547
* [[scala.xml.PrefixedAttribute]] and [[scala.xml.UnprefixedAttribute]].
4648
*
4749
* @author Burak Emir
4850
* @version 1.0
4951
*/
5052
abstract trait Attribute extends MetaData {
51-
def pre: String // will be null if unprefixed
53+
def pre: String // will be null if unprefixed
5254
val key: String
5355
val value: Seq[Node]
5456
val next: MetaData
@@ -85,7 +87,8 @@ abstract trait Attribute extends MetaData {
8587
else 1 + next.size
8688
}
8789

88-
/** Appends string representation of only this attribute to stringbuffer.
90+
/**
91+
* Appends string representation of only this attribute to stringbuffer.
8992
*/
9093
protected def toString1(sb: StringBuilder) {
9194
if (value == null)

src/xml/scala/xml/Comment.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
package scala
1010
package xml
1111

12-
/** The class `Comment` implements an XML node for comments.
12+
/**
13+
* The class `Comment` implements an XML node for comments.
1314
*
1415
* @author Burak Emir
1516
* @param commentText the text contained in this node, may not contain "--"
@@ -19,12 +20,13 @@ case class Comment(commentText: String) extends SpecialNode {
1920
def label = "#REM"
2021
override def text = ""
2122
final override def doCollectNamespaces = false
22-
final override def doTransform = false
23+
final override def doTransform = false
2324

2425
if (commentText contains "--")
2526
throw new IllegalArgumentException("text contains \"--\"")
2627

27-
/** Appends &quot;<!-- text -->&quot; to this string buffer.
28+
/**
29+
* Appends &quot;<!-- text -->&quot; to this string buffer.
2830
*/
2931
override def buildString(sb: StringBuilder) =
3032
sb append "<!--" append commentText append "-->"

src/xml/scala/xml/Document.scala

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
package scala
1010
package xml
1111

12-
/** A document information item (according to InfoSet spec). The comments
12+
/**
13+
* A document information item (according to InfoSet spec). The comments
1314
* are copied from the Infoset spec, only augmented with some information
1415
* on the Scala types for definitions that might have no value.
1516
* Also plays the role of an `XMLEvent` for pull parsing.
@@ -20,7 +21,8 @@ package xml
2021
@SerialVersionUID(-2289320563321795109L)
2122
class Document extends NodeSeq with pull.XMLEvent with Serializable {
2223

23-
/** An ordered list of child information items, in document
24+
/**
25+
* An ordered list of child information items, in document
2426
* order. The list contains exactly one element information item. The
2527
* list also contains one processing instruction information item for
2628
* each processing instruction outside the document element, and one
@@ -37,14 +39,16 @@ class Document extends NodeSeq with pull.XMLEvent with Serializable {
3739
/** The dtd that comes with the document, if any */
3840
var dtd: scala.xml.dtd.DTD = _
3941

40-
/** An unordered set of notation information items, one for each notation
42+
/**
43+
* An unordered set of notation information items, one for each notation
4144
* declared in the DTD. If any notation is multiply declared, this property
4245
* has no value.
4346
*/
4447
def notations: Seq[scala.xml.dtd.NotationDecl] =
4548
dtd.notations
4649

47-
/** An unordered set of unparsed entity information items, one for each
50+
/**
51+
* An unordered set of unparsed entity information items, one for each
4852
* unparsed entity declared in the DTD.
4953
*/
5054
def unparsedEntities: Seq[scala.xml.dtd.EntityDecl] =
@@ -53,27 +57,31 @@ class Document extends NodeSeq with pull.XMLEvent with Serializable {
5357
/** The base URI of the document entity. */
5458
var baseURI: String = _
5559

56-
/** The name of the character encoding scheme in which the document entity
60+
/**
61+
* The name of the character encoding scheme in which the document entity
5762
* is expressed.
5863
*/
5964
var encoding: Option[String] = _
6065

61-
/** An indication of the standalone status of the document, either
66+
/**
67+
* An indication of the standalone status of the document, either
6268
* true or false. This property is derived from the optional standalone
6369
* document declaration in the XML declaration at the beginning of the
6470
* document entity, and has no value (`None`) if there is no
6571
* standalone document declaration.
6672
*/
6773
var standAlone: Option[Boolean] = _
6874

69-
/** A string representing the XML version of the document. This
75+
/**
76+
* A string representing the XML version of the document. This
7077
* property is derived from the XML declaration optionally present at
7178
* the beginning of the document entity, and has no value (`None`)
7279
* if there is no XML declaration.
7380
*/
7481
var version: Option[String] = _
7582

76-
/** 9. This property is not strictly speaking part of the infoset of
83+
/**
84+
* 9. This property is not strictly speaking part of the infoset of
7785
* the document. Rather it is an indication of whether the processor
7886
* has read the complete DTD. Its value is a boolean. If it is false,
7987
* then certain properties (indicated in their descriptions below) may
@@ -86,7 +94,7 @@ class Document extends NodeSeq with pull.XMLEvent with Serializable {
8694
def theSeq: Seq[Node] = this.docElem
8795

8896
override def canEqual(other: Any) = other match {
89-
case _: Document => true
90-
case _ => false
97+
case _: Document => true
98+
case _ => false
9199
}
92100
}

src/xml/scala/xml/Elem.scala

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
package scala
1010
package xml
1111

12-
/** This singleton object contains the `apply` and `unapplySeq` methods for
12+
/**
13+
* This singleton object contains the `apply` and `unapplySeq` methods for
1314
* convenient construction and deconstruction. It is possible to deconstruct
1415
* any `Node` instance (that is not a `SpecialNode` or a `Group`) using the
1516
* syntax `case Elem(prefix, label, attribs, scope, child @ _*) => ...`
@@ -18,7 +19,8 @@ package xml
1819
* @author Burak Emir <[email protected]>
1920
*/
2021
object Elem {
21-
/** Build an Elem, setting its minimizeEmpty property to `true` if it has no children. Note that this
22+
/**
23+
* Build an Elem, setting its minimizeEmpty property to `true` if it has no children. Note that this
2224
* default may not be exactly what you want, as some XML dialects don't permit some elements to be minimized.
2325
*
2426
* @deprecated This factory method is retained for backward compatibility; please use the other one, with which you
@@ -32,35 +34,37 @@ object Elem {
3234
new Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
3335

3436
def unapplySeq(n: Node) = n match {
35-
case _: SpecialNode | _: Group => None
36-
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child))
37+
case _: SpecialNode | _: Group => None
38+
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child))
3739
}
3840

3941
import scala.sys.process._
40-
/** Implicitly convert a [[scala.xml.Elem]] into a
41-
* [[scala.sys.process.ProcessBuilder]]. This is done by obtaining the text
42-
* elements of the element, trimming spaces, and then converting the result
43-
* from string to a process. Importantly, tags are completely ignored, so
44-
* they cannot be used to separate parameters.
45-
*/
42+
/**
43+
* Implicitly convert a [[scala.xml.Elem]] into a
44+
* [[scala.sys.process.ProcessBuilder]]. This is done by obtaining the text
45+
* elements of the element, trimming spaces, and then converting the result
46+
* from string to a process. Importantly, tags are completely ignored, so
47+
* they cannot be used to separate parameters.
48+
*/
4649
@deprecated("To create a scala.sys.process.Process from an xml.Elem, please use Process(elem.text.trim).", "2.11.0")
4750
implicit def xmlToProcess(command: scala.xml.Elem): ProcessBuilder = Process(command.text.trim)
4851

4952
@deprecated("To create a scala.sys.process.Process from an xml.Elem, please use Process(elem.text.trim).", "2.11.0")
5053
implicit def processXml(p: Process.type) = new {
51-
/** Creates a [[scala.sys.process.ProcessBuilder]] from a Scala XML Element.
52-
* This can be used as a way to template strings.
53-
*
54-
* @example {{{
55-
* apply(<x> {dxPath.absolutePath} --dex --output={classesDexPath.absolutePath} {classesMinJarPath.absolutePath}</x>)
56-
* }}}
57-
*/
54+
/**
55+
* Creates a [[scala.sys.process.ProcessBuilder]] from a Scala XML Element.
56+
* This can be used as a way to template strings.
57+
*
58+
* @example {{{
59+
* apply(<x> {dxPath.absolutePath} --dex --output={classesDexPath.absolutePath} {classesMinJarPath.absolutePath}</x>)
60+
* }}}
61+
*/
5862
def apply(command: Elem): ProcessBuilder = Process(command.text.trim)
5963
}
6064
}
6165

62-
63-
/** The case class `Elem` extends the `Node` class,
66+
/**
67+
* The case class `Elem` extends the `Node` class,
6468
* providing an immutable data object representing an XML element.
6569
*
6670
* @param prefix namespace prefix (may be null, but not the empty string)
@@ -81,15 +85,14 @@ class Elem(
8185
override val scope: NamespaceBinding,
8286
val minimizeEmpty: Boolean,
8387
val child: Node*)
84-
extends Node with Serializable
85-
{
88+
extends Node with Serializable {
8689
@deprecated("This constructor is retained for backward compatibility. Please use the primary constructor, which lets you specify your own preference for `minimizeEmpty`.", "2.10.0")
8790
def this(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, child: Node*) = {
8891
this(prefix, label, attributes, scope, child.isEmpty, child: _*)
8992
}
9093

9194
final override def doCollectNamespaces = true
92-
final override def doTransform = true
95+
final override def doTransform = true
9396

9497
override val attributes = MetaData.normalize(attributes1, scope)
9598

@@ -106,7 +109,8 @@ extends Node with Serializable
106109
override protected def basisForHashCode: Seq[Any] =
107110
prefix :: label :: attributes :: child.toList
108111

109-
/** Returns a new element with updated attributes, resolving namespace uris
112+
/**
113+
* Returns a new element with updated attributes, resolving namespace uris
110114
* from this element's scope. See MetaData.update for details.
111115
*
112116
* @param updates MetaData with new and updated attributes
@@ -115,7 +119,8 @@ extends Node with Serializable
115119
final def %(updates: MetaData): Elem =
116120
copy(attributes = MetaData.update(attributes, scope, updates))
117121

118-
/** Returns a copy of this element with any supplied arguments replacing
122+
/**
123+
* Returns a copy of this element with any supplied arguments replacing
119124
* this element's value for that field.
120125
*
121126
* @return a new symbol with updated attributes
@@ -126,10 +131,10 @@ extends Node with Serializable
126131
attributes: MetaData = this.attributes,
127132
scope: NamespaceBinding = this.scope,
128133
minimizeEmpty: Boolean = this.minimizeEmpty,
129-
child: Seq[Node] = this.child.toSeq
130-
): Elem = Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
134+
child: Seq[Node] = this.child.toSeq): Elem = Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
131135

132-
/** Returns concatenation of `text(n)` for each child `n`.
136+
/**
137+
* Returns concatenation of `text(n)` for each child `n`.
133138
*/
134139
override def text = (child map (_.text)).mkString
135140
}

src/xml/scala/xml/EntityRef.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
package scala
1010
package xml
1111

12-
/** The class `EntityRef` implements an XML node for entity references.
12+
/**
13+
* The class `EntityRef` implements an XML node for entity references.
1314
*
1415
* @author Burak Emir
1516
* @version 1.0
1617
* @param entityName the name of the entity reference, for example `amp`.
1718
*/
1819
case class EntityRef(entityName: String) extends SpecialNode {
1920
final override def doCollectNamespaces = false
20-
final override def doTransform = false
21+
final override def doTransform = false
2122
def label = "#ENTITY"
2223

2324
override def text = entityName match {
@@ -29,7 +30,8 @@ case class EntityRef(entityName: String) extends SpecialNode {
2930
case _ => Utility.sbToString(buildString)
3031
}
3132

32-
/** Appends `"&amp; entityName;"` to this string buffer.
33+
/**
34+
* Appends `"&amp; entityName;"` to this string buffer.
3335
*
3436
* @param sb the string buffer.
3537
* @return the modified string buffer `sb`.

0 commit comments

Comments
 (0)