Navigation Menu

Skip to content

Commit

Permalink
fix procedure syntax warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Jun 24, 2017
1 parent 412dd4a commit 04dd2f4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Expand Up @@ -80,7 +80,7 @@ class BufferReader(val buf: Array[Byte]) {

/** skip next 'n' bytes
*/
def skip(n: Int) { bp += n }
def skip(n: Int): Unit = { bp += n }

/** Do read operattion `op` at position `n`
*/
Expand Down
Expand Up @@ -50,13 +50,13 @@ abstract class ClassfileParser(definitions: Definitions) {
parseAll(clazz)
}

protected def parseAll(clazz: ClassInfo) {
protected def parseAll(clazz: ClassInfo): Unit = {
parseHeader()
thepool = new ConstantPool
parseClass(clazz)
}

protected def parseHeader() {
protected def parseHeader(): Unit = {
val magic = in.nextInt
if (magic != JAVA_MAGIC)
throw new IOException("class file '" + parsedClass.file + "' "
Expand Down Expand Up @@ -223,7 +223,7 @@ abstract class ClassfileParser(definitions: Definitions) {
result
}

def parseClass(clazz: ClassInfo) {
def parseClass(clazz: ClassInfo): Unit = {
clazz.flags = in.nextChar
val nameIdx = in.nextChar
val externalName = pool.getClassName(nameIdx)
Expand All @@ -248,14 +248,14 @@ abstract class ClassfileParser(definitions: Definitions) {
if (clazz.isScalaUnsafe && !clazz.isImplClass) methods.withoutStatic else methods
}

def skipAttributes() {
def skipAttributes(): Unit = {
val attrCount = in.nextChar
for (i <- 0 until attrCount) {
in.skip(2); in.skip(in.nextInt)
}
}

def parseAttributes(c: ClassInfo) {
def parseAttributes(c: ClassInfo): Unit = {
val attrCount = in.nextChar
for (i <- 0 until attrCount) {
val attrIndex = in.nextChar
Expand Down Expand Up @@ -288,7 +288,7 @@ abstract class ClassfileParser(definitions: Definitions) {
}

/** Return true iff TraitSetter annotation found among attributes */
def parseAttributes(m: MemberInfo) {
def parseAttributes(m: MemberInfo): Unit = {
val maybeTraitSetter = MemberInfo.maybeSetter(m.bytecodeName)
val attrCount = in.nextChar
for (i <- 0 until attrCount) {
Expand Down Expand Up @@ -323,7 +323,7 @@ abstract class ClassfileParser(definitions: Definitions) {

/** Skip a single annotation
*/
def skipAnnotation(annotIndex: Int, attrEnd: Int) {
def skipAnnotation(annotIndex: Int, attrEnd: Int): Unit = {
try {
if (in.bp + 2 <= attrEnd) {
val nargs = in.nextChar
Expand All @@ -340,7 +340,7 @@ abstract class ClassfileParser(definitions: Definitions) {

/** Skip a single annotation argument
*/
def skipAnnotArg(attrEnd: Int) {
def skipAnnotArg(attrEnd: Int): Unit = {
if (in.bp + 3 <= attrEnd) {
val tag = in.nextByte.toChar
val index = in.nextChar
Expand Down
Expand Up @@ -37,7 +37,7 @@ object Config {
map(s => s.helpSyntax.format().padTo(21, ' ') + " " + s.helpDescription).
toList.sorted.mkString("Usage: " + cmd + " <options>\nwhere possible options include:\n ", "\n ", "\n")

def setup(s: Settings) {
def setup(s: Settings): Unit = {
settings = s
}

Expand Down
Expand Up @@ -21,11 +21,11 @@ trait WithAccessModifier extends HasAccessFlags {
(!isPublic && that.isPublic) || (isPrivate && that.isProtected)
}

protected def ensureLoaded() {}
protected def ensureLoaded(): Unit = {}

def accessModifier = {
if(isProtected) "protected"
else if(isPrivate) "private"
else ""
}
}
}
2 changes: 1 addition & 1 deletion project/Build.scala
Expand Up @@ -32,7 +32,7 @@ object BuildSettings {
git.useGitDescribe := true,
licenses := Seq("Apache License v2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("http://github.com/typesafehub/migration-manager")),
scalacOptions := Seq("-feature", "-deprecation", "-Xlint")
scalacOptions := Seq("-feature", "-deprecation", "-Xlint", "-Xfuture")
)

def sbtPublishSettings: Seq[Def.Setting[_]] = Seq(
Expand Down
Expand Up @@ -39,7 +39,7 @@ class MiMaLib(classpath: CompilerClassPath, val log: Logging = ConsoleLogging) {
}


private def comparePackages(oldpkg: PackageInfo, newpkg: PackageInfo) {
private def comparePackages(oldpkg: PackageInfo, newpkg: PackageInfo): Unit = {
for (oldclazz <- oldpkg.accessibleClasses) {
log.info("Analyzing class "+oldclazz.bytecodeName)
newpkg.classes get oldclazz.bytecodeName match {
Expand All @@ -55,7 +55,7 @@ class MiMaLib(classpath: CompilerClassPath, val log: Logging = ConsoleLogging) {
}
}

private def traversePackages(oldpkg: PackageInfo, newpkg: PackageInfo) {
private def traversePackages(oldpkg: PackageInfo, newpkg: PackageInfo): Unit = {
log.info("Traversing package " + oldpkg.fullName)
comparePackages(oldpkg, newpkg)
indented {
Expand Down

0 comments on commit 04dd2f4

Please sign in to comment.