Skip to content

Fix unused imports #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions jvm/src/test/scala/scala/xml/ReuseNodesTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package scala.xml

import scala.xml.transform._
import org.junit.Test
import org.junit.Assert.assertTrue
import org.junit.Assert.assertEquals
import org.junit.Assert.assertSame
import org.junit.experimental.theories.Theories
import org.junit.experimental.theories.Theory
Expand Down
4 changes: 0 additions & 4 deletions jvm/src/test/scala/scala/xml/XMLSyntaxTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals

class XMLSyntaxTestJVM {
Expand Down
5 changes: 0 additions & 5 deletions jvm/src/test/scala/scala/xml/XMLTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ package scala.xml
import language.postfixOps

import org.junit.{Test => UnitTest}
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals
import scala.xml.parsing.ConstructingParser
import java.io.StringWriter
import java.io.BufferedOutputStream
import java.io.ByteArrayOutputStream
import java.io.StringReader
import scala.collection.Iterable
Expand Down Expand Up @@ -495,7 +491,6 @@ class XMLTestJVM {
}

import java.io.{ Console => _, _ }
import scala.io._
import scala.xml.parsing._
@UnitTest
def dontLoop: Unit = {
Expand Down
3 changes: 0 additions & 3 deletions jvm/src/test/scala/scala/xml/parsing/PiParsingTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package scala.xml.parsing

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.xml.JUnitAssertsForXML.assertEquals

class PiParsingTestJVM {
Expand Down
4 changes: 1 addition & 3 deletions jvm/src/test/scala/scala/xml/parsing/Ticket0632Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ package scala.xml.parsing

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.xml.JUnitAssertsForXML.assertEquals

class Ticket0632TestJVM {

import scala.io.Source.fromString
import scala.xml.parsing.ConstructingParser.fromSource
import scala.xml.{NodeSeq, TopScope}
import scala.xml.TopScope
private def parse(s:String) = fromSource(fromString(s), false).element(TopScope)

@Test
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/scala/xml/MetaData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package xml

import Utility.sbToString
import scala.annotation.tailrec
import scala.collection.{ AbstractIterable, Iterator }
import scala.collection.AbstractIterable

/**
* Copyright 2008 Google Inc. All Rights Reserved.
Expand Down
1 change: 0 additions & 1 deletion shared/src/main/scala/scala/xml/NodeSeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ object NodeSeq {
* @version 1.0
*/
abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with SeqLike[Node, NodeSeq] with Equality {
import NodeSeq.seqToNodeSeq // import view magic for NodeSeq wrappers

/** Creates a list buffer as builder for this class */
override protected[this] def newBuilder = NodeSeq.newBuilder
Expand Down
3 changes: 1 addition & 2 deletions shared/src/main/scala/scala/xml/Utility.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package scala
package xml

import scala.collection.mutable
import parsing.XhtmlEntities
import scala.language.implicitConversions

/**
Expand Down Expand Up @@ -105,7 +104,7 @@ object Utility extends AnyRef with parsing.TokenTests {
val escMap = pairs map { case (s, c) => c -> ("&%s;" format s) }
val unescMap = pairs ++ Map("apos" -> '\'')
}
import Escapes.{ escMap, unescMap }
import Escapes.unescMap
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the claim that escMap was unused was a bit apocryphal on the compiler's part.

Can the compiler determine if an import is unused by other source files as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm wrong. The implementation really didn't use escMap. It's that #102 wanted to start using it again, and couldn't find it. We're good here!


/**
* Appends escaped string to `s`.
Expand Down
3 changes: 1 addition & 2 deletions shared/src/main/scala/scala/xml/XML.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
package scala
package xml

import parsing.NoBindingFactoryAdapter
import factory.XMLLoader
import java.io.{ File, FileDescriptor, FileInputStream, FileOutputStream }
import java.io.{ InputStream, Reader, StringReader, Writer }
import java.io.{ InputStream, Reader, StringReader }
import java.nio.channels.Channels
import scala.util.control.Exception.ultimately

Expand Down
4 changes: 1 addition & 3 deletions shared/src/main/scala/scala/xml/dtd/impl/DetWordAutom.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
package scala
package xml.dtd.impl

import scala.collection.{ mutable, immutable }

/**
* A deterministic automaton. States are integers, where
* 0 is always the only initial state. Transitions are represented
Expand All @@ -26,7 +24,7 @@ import scala.collection.{ mutable, immutable }
private[dtd] abstract class DetWordAutom[T <: AnyRef] {
val nstates: Int
val finals: Array[Int]
val delta: Array[mutable.Map[T, Int]]
val delta: Array[scala.collection.mutable.Map[T, Int]]
val default: Array[Int]

def isFinal(q: Int) = finals(q) != 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.collection.{ immutable, mutable }
private[dtd] abstract class WordBerrySethi extends BaseBerrySethi {
override val lang: WordExp

import lang.{ Alt, Eps, Letter, RegExp, Sequ, Star, _labelT }
import lang.{ Eps, Letter, RegExp, Sequ, _labelT }

protected var labels: mutable.HashSet[_labelT] = _
// don't let this fool you, only labelAt is a real, surjective mapping
Expand Down
3 changes: 0 additions & 3 deletions shared/src/main/scala/scala/xml/factory/NodeFactory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ package scala
package xml
package factory

import parsing.{ FactoryAdapter, NoBindingFactoryAdapter }
import java.io.{ InputStream, Reader, StringReader, File, FileDescriptor, FileInputStream }

trait NodeFactory[A <: Node] {
val ignoreComments = false
val ignoreProcInstr = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ package xml
package include.sax

import java.io.InputStream
import scala.util.matching.Regex

/**
* `EncodingHeuristics` reads from a stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import scala.xml.include._
import org.xml.sax.{ Attributes, XMLReader, Locator }
import org.xml.sax.helpers.{ XMLReaderFactory, XMLFilterImpl, NamespaceSupport, AttributesImpl }

import java.io.{ InputStream, BufferedInputStream, InputStreamReader, IOException, UnsupportedEncodingException }
import java.io.{ BufferedInputStream, InputStreamReader, IOException, UnsupportedEncodingException }
import java.util.Stack
import java.net.{ URL, MalformedURLException }

Expand Down
4 changes: 2 additions & 2 deletions shared/src/main/scala/scala/xml/include/sax/XIncluder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ package xml
package include.sax

import scala.collection.mutable
import org.xml.sax.{ ContentHandler, XMLReader, Locator, Attributes }
import org.xml.sax.{ ContentHandler, Locator, Attributes }
import org.xml.sax.ext.LexicalHandler
import java.io.{ File, OutputStream, OutputStreamWriter, Writer, IOException }
import java.io.{ OutputStream, OutputStreamWriter, IOException }

/**
* XIncluder is a SAX `ContentHandler` that writes its XML document onto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package scala
package xml
package parsing

import java.io.{ InputStream, Reader, File, FileDescriptor, FileInputStream }
import scala.collection.{ mutable, Iterator }
import org.xml.sax.Attributes
import org.xml.sax.helpers.DefaultHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ package scala
package xml
package parsing

import scala.io.Source
import scala.annotation.switch
import Utility.Escapes.{ pairs => unescape }

import Utility.SU

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ package xml
package persistent

import java.io.{ File, FileOutputStream }
import java.nio.ByteBuffer
import java.nio.channels.Channels
import java.lang.Thread

Expand Down
5 changes: 0 additions & 5 deletions shared/src/test/scala/scala/xml/AttributeTest.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals

class AttributeTest {
Expand Down
3 changes: 0 additions & 3 deletions shared/src/test/scala/scala/xml/MetaDataTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertEquals

class MetaDataTest {
Expand Down
3 changes: 0 additions & 3 deletions shared/src/test/scala/scala/xml/PrintEmptyElementsTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import JUnitAssertsForXML.assertEquals

class PrintEmptyElementsTest {
Expand Down
3 changes: 0 additions & 3 deletions shared/src/test/scala/scala/xml/UtilityTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals
Expand Down
7 changes: 1 addition & 6 deletions shared/src/test/scala/scala/xml/XMLEmbeddingTest.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals

class XMLEmbeddingTest {
Expand All @@ -20,4 +15,4 @@ class XMLEmbeddingTest {
assertEquals("{}{}{}", za.text)
}

}
}
3 changes: 0 additions & 3 deletions shared/src/test/scala/scala/xml/XMLSyntaxTest.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package scala.xml

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals
Expand Down
10 changes: 0 additions & 10 deletions shared/src/test/scala/scala/xml/XMLTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ package scala.xml
import language.postfixOps

import org.junit.{Test => UnitTest}
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assert.assertEquals
// import scala.xml.parsing.ConstructingParser
import java.io.StringWriter
import java.io.BufferedOutputStream
import java.io.ByteArrayOutputStream
import java.io.StringReader
import scala.collection.Iterable
import scala.xml.Utility.sort

Expand All @@ -23,8 +17,6 @@ object XMLTest {
}

class XMLTest {
import XMLTest.{ e, sc }

@UnitTest
def nodeSeq: Unit = {
val p = <foo>
Expand Down Expand Up @@ -248,8 +240,6 @@ class XMLTest {
assertTrue(x.toString.matches(".*xmlns:dog=\"http://dog.com\".*"));
}

import NodeSeq.seqToNodeSeq

val ax = <hello foo="bar" x:foo="baz" xmlns:x="the namespace from outer space">
<world/>
</hello>
Expand Down
8 changes: 0 additions & 8 deletions shared/src/test/scala/scala/xml/parsing/PiParsingTest.scala
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
package scala.xml.parsing

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.xml.JUnitAssertsForXML.assertEquals

class PiParsingTest {


import scala.io.Source.fromString
import scala.xml.TopScope

@Test
def piNoWSLiteral: Unit = {
val expected = "<foo>a<?pi?>b</foo>"
assertEquals(expected, <foo>a<?pi?>b</foo>)
}


@Test
def piLiteral: Unit = {
val expected = "<foo> a <?pi?> b </foo>"
Expand Down
6 changes: 0 additions & 6 deletions shared/src/test/scala/scala/xml/parsing/Ticket0632Test.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
package scala.xml.parsing

import org.junit.Test
import org.junit.Ignore
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.xml.JUnitAssertsForXML.assertEquals

class Ticket0632Test {

import scala.io.Source.fromString
import scala.xml.{NodeSeq, TopScope}

@Test
def singleAmp: Unit = {
val expected = "<foo x=\"&amp;\"/>"
Expand Down