Eclipse will run your project even when it won't compile

Someone told me that Eclipse will run your project even if it has
errors. It replaces in your bytecode all methods which contain syntax
errors with method containing only "throw new InternalError()" or
something like that, which is fine in a lot of cases. I think this would
be a cool addition to IDEA, what do you think?

27 comments

Someone told me that Eclipse will run your project even if it has
errors. It replaces in your bytecode all methods which contain syntax
errors with method containing only "throw new InternalError()" or
something like that, which is fine in a lot of cases. I think this would
be a cool addition to IDEA, what do you think?

Only if it's turned off by default :).
And only after other feature requests/issues that are pushed back since years are solved :).
(too many to mention them :)).

Ahmed.

0

It's true, I'd much rather see refactoring improvements than this.

Ahmed Mohombe wrote:
>> Someone told me that Eclipse will run your project even if it has
>> errors. It replaces in your bytecode all methods which contain syntax
>> errors with method containing only "throw new InternalError()" or
>> something like that, which is fine in a lot of cases. I think this
>> would be a cool addition to IDEA, what do you think?

Only if it's turned off by default :).
And only after other feature requests/issues that are pushed back since
years are solved :).
(too many to mention them :)).

Ahmed.

0

Seems possible, since Eclipse has it's own compiler. For IDEA, that would seem to require adding a flag to javac or jikes.

Kind of a sweet idea, actually, particularly if integrated with a read-eval-print loop plugin like the old Scrappy attempt.

--Dave Griffith

0

This should (in theory) be possible with IDEA too, now Demetra supports
the Eclipse compiler: http://www.jetbrains.net/jira/browse/IDEADEV-3373

Bas

0

That would be very useful indeed!

0

Forgive me for being ignorant, but what's so great about the Eclipse compiler?

-Gordon

0

E.g.: it can be configured to reject some dangerous constructs like
autounboxing.

Tom

0

It looks like you want to vote for
http://jetbrains.net/jira/browse/IDEABKL-2928, "Allow user to specify
that certain inspections be run upon compilation and printed as
compilation warnings"

Tom wrote:

E.g.: it can be configured to reject some dangerous constructs like
autounboxing.

Tom

0

It will be possible in Demetra if you
- select Eclipse as a compiler in IDEA
- turn off 'Make before run' check box

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Keith Lea" <keith@cs.oswego.edu> wrote in message
news:dpmfp2$26l$1@is.intellij.net...

Someone told me that Eclipse will run your project even if it has
errors. It replaces in your bytecode all methods which contain syntax
errors with method containing only "throw new InternalError()" or
something like that, which is fine in a lot of cases. I think this would
be a cool addition to IDEA, what do you think?






Attachment(s):
error.JPG
0


I gotta say, that's a pretty confusing and counter-intuitive way of configuring this. What if I do want to make before running, but run anyway even if I couldn't make?

--Dave Griffith

0

Hmm,

Strange feature, but maybe usefull. I'm still think that 'manual error fixing' is best solution, that use compiler to cutout error code from method body. In case of notcompilable code you MUST force bugmaker to fix it. Such feature is like and punk glasses. You have compiled project, but it still not works...

What is so good in this idea?

Thanks!

0

It useful mostly for prototyping probably, but for me it useless too

0

Hello Alexey,

AE> bugmaker to fix it. Such feature is like and punk glasses. You have
AE> compiled project, but it still not works...
AE>
AE> What is so good in this idea?

For instance, someone else can mess things up in a section of the code you
don't work with at a given time (and you just, blissfully, updated your code
base before cruise control could notify you of the problem). That can stop
you from running your code (or even unit testing, unless you deselect make
before running, which is still globat at this time) even if you didn't care
about that part.

When working with a big codebase, many modules and a lot of people messing
with them one could find this feature to be a real timesaver every now and
then.

Best,
Andrei


0

Exactly in this case i'm speak to air "shit happen, let's fix it quickly".
But, in case of BIG multi officed team it maybe usefull, i guess.

0

I often start writing a class which is not used yet and implements some
interface. But the code doesn't compile. Why does it need to compile for
me to run the rest of my project? It doesn't.

Alexey Efimov wrote:

Hmm,

Strange feature, but maybe usefull. I'm still think that 'manual
error fixing' is best solution, that use compiler to cutout error
code from method body. In case of notcompilable code you MUST force
bugmaker to fix it. Such feature is like and punk glasses. You have
compiled project, but it still not works...

What is so good in this idea?

Thanks!

0

It must. Becose why you need to get working application, if something in application is broken, but broken in runtime?

And another one is strange - is too difficult to have not compiled code in IDEA. Two reasons:
1. You will never find it since it have been closed and incremental compilation is not done.
2. If you look on error you just press Alt+Enter to fix it - it quick.

The such kind of compiler is needed, then someone 'Bad Mister' commit into VCS not compilable code. And second, to get incremental compilation of project you must collect all errors in class. Javac will stop on first error in class and you will never get all errors. To get all errors, you MUST have such code replacement.

But using this feature in real development is not very good, i guess.

0

Next step compiled this way commercial products with implementations on demand :)

0

Alexey Efimov wrote:

It must. Becose why you need to get working application, if something
in application is broken, but broken in runtime?


It's a class which is never once referenced in the application.

0

Groovy or Beanshell better for this :)

0

Yes, like test sniplet, but I don't write many tests. I write code in
very intellij style. I write the high-level code first, calling methods
which don't exist and instantiating classes that don't exist, then
alt+enter to create them. Sometimes I'm not finished with this process
but I want to test the part of it that I have implemented.

Alexey Efimov wrote:

Like Test sniplet?

0

What is the advantage of running code that won't compile (as opposed to fixing the reason it won't compile and then running it)?

0

Exploratory coding, particularly if you have a read-eval-print-loop tool to work with. You get some of the quick feedback advantages the dynamic coding folks claim, without having to give up the safety advantages of Java (you certainly don't ship with that compiler flag turned on).

In IDEA, you can mostly just use any old JUnit test case window as a read-eval-print-loop (Ctrl-F10 rules). With this compiler flag, You could write a test case and run it, even if the sum total of the production code wouldn't compile. As long as the functionality that I wish to test works, my test will pass. Anything that cuts time out of the write-a-test/write-code/test loop is all to the good, in terms of agility.

--Dave Griffith

0

In IDEA, when the message window pops up showing the comiler errors, you can right-click the filename and select "exclude from compile". It's not the same thing, of course, but it may work for you depending on the situation. I've had to use it on occasion when people on my team check in code that shouldn't be there. :P

0

Please sign in to leave a comment.