Bug 284808 - bad errorhandling in invokeInternalBuilder
Summary: bad errorhandling in invokeInternalBuilder
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-27 19:00 EDT by Miwako Tokugawa CLA
Modified: 2020-09-04 15:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miwako Tokugawa CLA 2009-07-27 19:00:16 EDT
Build ID: I20090528-2000

Steps To Reproduce:
Hi. I have a a problem with GeneratedMakefileBuilder. invokeInternalBuilder(the one that takes IResource[] as the first argument) failing out when the calls are made as
invokeInternalBuilder(../*initconsole=*/true);
invokeInternalBuilder(../*initconsole=*/false);

In the second call, "consoleOutStream" is null, so 
consoleOutStream.write (buf.toString(),getBytes());
fails. I tried executing the same code by selecting "Build Selected File(s)"  from the project context menu with two files and noticed the second call was made with /*initconsole=*/false as well, but that consoleOutStream is not null (so the code works).
I still haven't figured out what is causing this now. (I don't think I'm doing anything wrong.. but I'm not 100% confident).

But is there any reason that this function shouldn't catch nullpointer exception?

More information:
Comment 1 Miwako Tokugawa CLA 2009-07-28 13:19:19 EDT
Please ignore what I said but this:
> But is there any reason that this function shouldn't catch nullpointer
> exception?
Comment 2 Miwako Tokugawa CLA 2009-08-31 15:49:27 EDT
In addition, 
though the catch block in this function 
(catch (Exception e) {
  if (consoleOutStream!=null) {
   StringBuffer buf = new StringBuffer(); etc.
builds a String buffer, the buffer doesn't seem to be printed out in the Console View as far as I can tell and this results in the view displaying just
**** Internal Builder is used for build

I don't know if you always see this time.
I see it when buildResource is null.
Comment 3 Miwako Tokugawa CLA 2009-08-31 15:50:46 EDT
Sorry,I meant "this problem" by  "this time"