Skip to content

Commit 1663990

Browse files
author
Peter Empen
committed
Merge remote-tracking branch 'origin/master' into constrained
2 parents 7fbf467 + 51ea0b9 commit 1663990

File tree

16 files changed

+32
-58
lines changed

16 files changed

+32
-58
lines changed

build.sbt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ lazy val core = project
2121
libraryDependencies ++= Seq(
2222
"org.scalacheck" %% "scalacheck" % "1.13.4" % "optional;provided",
2323
"org.gephi" % "gephi-toolkit" % "0.9.2" % "test" classifier "all"
24+
),
25+
dependencyOverrides ++= Seq(
26+
"org.netbeans.modules" % "org-netbeans-core" % "RELEASE90" % "test",
27+
"org.netbeans.modules" % "org-netbeans-core-startup-base" % "RELEASE90" % "test",
28+
"org.netbeans.modules" % "org-netbeans-modules-masterfs" % "RELEASE90" % "test",
29+
"org.netbeans.api" % "org-openide-util-lookup" % "RELEASE90" % "test",
2430
)
2531
)
2632
)
@@ -63,14 +69,12 @@ lazy val misc = project
6369
)
6470
)
6571

66-
ThisBuild / scalafmtConfig := Some(file(".scalafmt.conf"))
67-
6872
ThisBuild / resolvers ++= Seq(
69-
"NetBeans nexus" at "http://bits.netbeans.org/nexus/content/groups/netbeans/",
70-
"NetBeans spring" at "http://repo.spring.io/libs-release-remote/",
7173
"gephi-thirdparty" at "https://raw.github.com/gephi/gephi/mvn-thirdparty-repo/"
7274
)
7375

76+
ThisBuild / scalafmtConfig := Some(file(".scalafmt.conf"))
77+
7478
lazy val defaultSettings = Defaults.coreDefaultSettings ++ Seq(
7579
scalaVersion := Version.compiler_2_12,
7680
crossScalaVersions := Seq(scalaVersion.value, Version.compiler_2_11),
@@ -79,6 +83,7 @@ lazy val defaultSettings = Defaults.coreDefaultSettings ++ Seq(
7983
"-Ywarn-unused:imports",
8084
"-Yrangepos"
8185
),
86+
Compile / scalacOptions in compile += "-Ywarn-unused:privates",
8287
addCompilerPlugin(scalafixSemanticdb),
8388
Test / parallelExecution := false,
8489
Compile / doc / scalacOptions ++=
@@ -95,7 +100,6 @@ lazy val defaultSettings = Defaults.coreDefaultSettings ++ Seq(
95100
Test / testOptions := Seq(Tests.Filter(s => s.endsWith("Test"))),
96101
libraryDependencies ++= Seq(
97102
"junit" % "junit" % "4.12" % "test",
98-
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
99-
"org.scala-lang.modules" %% "scala-xml" % "1.0.5" % "test"
103+
"org.scalatest" %% "scalatest" % "3.0.8" % "test"
100104
)
101105
) ++ GraphSonatype.settings

constrained/src/main/scala/scalax/collection/constrained/constraints/Acyclic.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class Acyclic[N, E[X] <: EdgeLikeIn[X], G <: Graph[N, E]](override val self: G)
7575
if (graphAdd.isCyclic)
7676
PreCheckResult(Abort)
7777
else {
78-
val found = (for (n <- p.toOuterNodes) yield self find n) filter (_.isDefined)
79-
val dockingNodes = Set()
78+
val found = (for (n <- p.toOuterNodes) yield self find n) filter (_.isDefined)
8079
Result(PostCheck, (found map (_.get)) toSet)
8180
}
8281
} else PreCheckResult(PostCheck)

constrained/src/main/scala/scalax/collection/constrained/immutable/AdjacencyListGraph.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ trait AdjacencyListGraph[
5555
n,
5656
forced = false,
5757
(outerNode: N, innerNode: NodeT) => {
58-
var newNodes = nodes.toOuter.toBuffer
59-
var newEdges = edges.toOuter.toBuffer
58+
val newNodes = nodes.toOuter.toBuffer
59+
val newEdges = edges.toOuter.toBuffer
6060
nodes.subtract(
6161
innerNode,
6262
rippleDelete = false,

core/src/main/scala/scalax/collection/GraphBase.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ trait GraphBase[N, E[X] <: EdgeLikeIn[X]] extends Serializable { selfGraph =>
498498
* @return set of connecting edges including hooks.
499499
*/
500500
def adjacents: Set[EdgeT] = {
501-
var a = new mutable.EqHashMap[EdgeT, Null]
501+
val a = new mutable.EqHashMap[EdgeT, Null]
502502
this foreach (n => n.edges foreach (e => a put (e, null)))
503503
a -= this
504504
new immutable.EqSet(a)

core/src/main/scala/scalax/collection/GraphTraversalImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ trait GraphTraversalImpl[N, E[X] <: EdgeLikeIn[X]]
607607
def foreach[U](f: S => U): Unit = {
608608
enclosed(0) foreach f
609609
var i = upper
610-
var size = i
610+
val size = i
611611
while (i > 0) {
612612
i -= 1
613613
f(s(i))

core/src/main/scala/scalax/collection/State.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ protected trait State[N, E[X] <: EdgeLikeIn[X]] {
2020
import State._
2121

2222
/** Flags in `inUse` refer to required but unclosed handles. */
23-
private var inUse = new FlagStore
23+
private val inUse = new FlagStore
2424

2525
/** Flags in `dirty` refer to released handles with dirty flags at the nodes. */
26-
private var dirty = new FlagStore
26+
private val dirty = new FlagStore
2727
private val monitor = new Object with Serializable
2828

2929
protected def dump(store: FlagStore): ExtBitSet = {

core/src/main/scala/scalax/collection/TraverserImpl.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import scala.collection.FilteredSet
66
import scala.collection.generic.FilterMonadic
77
import scala.collection.mutable.{ArrayBuffer, PriorityQueue, Queue, ArrayStack => Stack, Map => MMap}
88
import scala.language.higherKinds
9-
import scala.math.abs
109

1110
import scalax.collection.GraphPredef.EdgeLikeIn
1211
import immutable.SortedArraySet
@@ -162,7 +161,6 @@ trait TraverserImpl[N, E[X] <: EdgeLikeIn[X]] {
162161
case a: ArraySet[A] => a.sorted(ordering)
163162
case t =>
164163
@inline def newArray(len: Int): Array[A] = new Array[B](len).asInstanceOf[Array[A]]
165-
val size = abs(maxOrEst)
166164
var cnt = 0
167165
val arr =
168166
if (maxOrEst >= 0) {

core/src/main/scala/scalax/collection/immutable/AdjacencyListBase.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ trait AdjacencyListBase[
3535

3636
def edges: ArraySet[EdgeT]
3737

38-
final private def sizeHint(edgesSize: Int): Int =
39-
if (isHyper) size * 2
40-
else if (isDirected)
41-
if (size < 8) size
42-
else (size / 4) * 3
43-
else size
44-
4538
@inline final protected def nodeEqThis = (n: NodeT) => n eq this
4639
protected[collection] object Adj extends Serializable { // lazy adjacents
4740
@transient protected[collection] var _aHook: Option[(NodeT, EdgeT)] = _

core/src/main/scala/scalax/collection/mutable/EqHashMap.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class EqHashMap[K <: AnyRef, V](_sizeHint: Int = EqHash.defCapacity)
4242
override def remove(key: K): Option[V] = (index(key): @switch) match {
4343
case i if i < 0 => None
4444
case i =>
45-
val item = table(i)
4645
_size -= 1
4746
val oldValue = table(i + 1)
4847
table(i + 1) = null

core/src/main/scala/scalax/collection/mutable/EqHashSet.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class EqHashSet[A <: AnyRef](_sizeHint: Int = EqHash.defCapacity)
5959
override def remove(elem: A): Boolean = (index(elem): @switch) match {
6060
case i if i < 0 => false
6161
case i =>
62-
val item = table(i)
6362
_size -= 1
6463
table(i) = null
6564
closeDeletion(i)

0 commit comments

Comments
 (0)