~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to src/library/scala/xml/Equality.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*                     __                                               *\
2
2
**     ________ ___   / /  ___     Scala API                            **
3
 
**    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
 
3
**    / __/ __// _ | / /  / _ |    (c) 2003-2013, LAMP/EPFL             **
4
4
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
5
5
** /____/\___/_/ |_/____/_/ | |                                         **
6
6
**                          |/                                          **
8
8
 
9
9
package scala.xml
10
10
 
11
 
/** In an attempt to contain the damage being inflicted on
12
 
 *  consistency by the ad hoc equals methods spread around
13
 
 *  xml, the logic is centralized and all the xml classes
14
 
 *  go through the xml.Equality trait.  There are two forms
15
 
 *  of xml comparison.
16
 
 *
17
 
 *  1) def strict_==(other: xml.Equality)
18
 
 *
19
 
 *  This one tries to honor the little things like symmetry
20
 
 *  and hashCode contracts.  The equals method routes all
21
 
 *  comparisons through this.
22
 
 *
23
 
 *  2) xml_==(other: Any)
24
 
 *
25
 
 *  This one picks up where strict_== leaves off.  It might
26
 
 *  declare any two things equal.
27
 
 *
28
 
 *  As things stood, the logic not only made a mockery of
29
 
 *  the collections equals contract, but also laid waste to
30
 
 *  that of case classes.
 
11
/** In an attempt to contain the damage being inflicted on consistency by the
 
12
 *  ad hoc `equals` methods spread around `xml`, the logic is centralized and
 
13
 *  all the `xml` classes go through the `xml.Equality trait`.  There are two
 
14
 *  forms of `xml` comparison.
 
15
 *
 
16
 *  1. `'''def''' strict_==(other: scala.xml.Equality)`
 
17
 *
 
18
 *  This one tries to honor the little things like symmetry and hashCode
 
19
 *  contracts.  The `equals` method routes all comparisons through this.
 
20
 *
 
21
 *  1. `xml_==(other: Any)`
 
22
 *
 
23
 *  This one picks up where `strict_==` leaves off.  It might declare any two
 
24
 *  things equal.
 
25
 *
 
26
 *  As things stood, the logic not only made a mockery of the collections
 
27
 *  equals contract, but also laid waste to that of case classes.
31
28
 *
32
29
 *  Among the obstacles to sanity are/were:
33
30
 *
68
65
}
69
66
import Equality._
70
67
 
71
 
private[xml]
72
68
trait Equality extends scala.Equals {
73
 
  def basisForHashCode: Seq[Any]
 
69
  protected def basisForHashCode: Seq[Any]
 
70
 
74
71
  def strict_==(other: Equality): Boolean
75
72
  def strict_!=(other: Equality) = !strict_==(other)
76
73
 
77
 
  /** We insist we're only equal to other xml.Equality implementors,
 
74
  /** We insist we're only equal to other `xml.Equality` implementors,
78
75
   *  which heads off a lot of inconsistency up front.
79
76
   */
80
77
  override def canEqual(other: Any): Boolean = other match {
107
104
    strictlyEqual || (blithe && compareBlithely(this, asRef(other)))
108
105
  }
109
106
}
110