diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-12 01:31:48 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-12 01:31:48 +0000 |
commit | bee24f7b52be4130dcffb05e0bdbc9f3b7915033 (patch) | |
tree | e54cc4c69473bbde8c599c55eb1e336ee5f968f6 /src | |
parent | c6127f407014183d4d4aec12897485d5d622b76e (diff) | |
download | scala-bee24f7b52be4130dcffb05e0bdbc9f3b7915033.tar.gz scala-bee24f7b52be4130dcffb05e0bdbc9f3b7915033.tar.bz2 scala-bee24f7b52be4130dcffb05e0bdbc9f3b7915033.zip |
Alters four meaningless equality comparison dis...
Alters four meaningless equality comparison discovered by findbugs;
alters because some may still have room for improvement, but all should
be closer to correct than "certainly not." Closes bug #1444.
Diffstat (limited to 'src')
4 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index f9ca8a2d3a..21e22ab569 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -830,7 +830,7 @@ abstract class GenJVM extends SubComponent { ranges = (start, jcode.getPC()) :: ranges; } - if (covered != Nil) + if (!covered.isEmpty) if (settings.debug.value) log("Some covered blocks were not found in method: " + method + " covered: " + covered + " not in " + linearization); diff --git a/src/compiler/scala/tools/nsc/symtab/Scopes.scala b/src/compiler/scala/tools/nsc/symtab/Scopes.scala index aa45870afd..c42c3219ba 100644 --- a/src/compiler/scala/tools/nsc/symtab/Scopes.scala +++ b/src/compiler/scala/tools/nsc/symtab/Scopes.scala @@ -374,7 +374,7 @@ trait Scopes { class ErrorScope(owner: Symbol) extends Scope(null: ScopeEntry) { override def lookupEntry(name: Name): ScopeEntry = { val e = super.lookupEntry(name) - if (e != NoSymbol) e + if (e != NoScopeEntry) e else { enter(if (name.isTermName) owner.newErrorValue(name) else owner.newErrorClass(name)) diff --git a/src/compiler/scala/tools/nsc/transform/Reifiers.scala b/src/compiler/scala/tools/nsc/transform/Reifiers.scala index 682ac1ee8f..224b20d44b 100644 --- a/src/compiler/scala/tools/nsc/transform/Reifiers.scala +++ b/src/compiler/scala/tools/nsc/transform/Reifiers.scala @@ -60,9 +60,9 @@ trait Reifiers { val rsym = reify(sym) val rargs = args map reify val beforeArgs = reflect.PrefixedType(rpre, rsym) - if(rargs.isEmpty) + if (rargs.isEmpty) beforeArgs - else if(beforeArgs == NoType) + else if (rpre == NoType || rsym == NoSymbol) beforeArgs else reflect.AppliedType(beforeArgs, rargs) diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index acee4132af..745979790b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -103,7 +103,7 @@ abstract class RefChecks extends InfoTransform { case List(MixinOverrideError(_, msg)) => unit.error(clazz.pos, msg) case MixinOverrideError(member, msg) :: others => - val others1 = others.map(_.member.name.decode).filter(member.name != _).removeDuplicates + val others1 = others.map(_.member.name.decode).filter(member.name.decode != _).removeDuplicates unit.error( clazz.pos, msg+(if (others1.isEmpty) "" |