scala-ide/scala-ide — pull request #449 by huitseeker (2013-06-25 14:36:23+00:00)
Title: Tuned ``MainClassVerifier`` to consider classfiles instead of sourcefile...

...s

The Problem
+++++++++++

With the former implementation, an error was reported every time the _package
name in the source did not match the source's physical location_. This is too
eager, in fact the two don't need to be in sync for the user to be able to
launch a Scala Application.

However, despite the error dialog, the Scala Main class was still run. The
reason for this is that there was a double bug! (I'm gonna name tihs one
*hadouken-bug*) [This
line](https://github.com/scala-ide/scala-ide/pull/444/files#L2L122) was always
returning ``true``. What that line wanted to check is the ``IStatus.severity``
field, but it was actually comparing the ``IStatus.code`` (the IStatus
interface is definitely not the cleanest API ever, can't really blame people
for getting confused...).

The Solution
++++++++++++

The minimal condition for running a Scala Application is that the class' Main
binary exists. Hence, I've updated the code to reflect this requirement.

Moreover, if a class file for the ``mainTypeName`` exist, but no companion
module class file can be found, an error is now reported to inform the user
that he needs to change the class declaration into an object.

Fix #1001760