Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367254

Summary: IllegalArgumentException when parsing a source file
Product: z_Archived Reporter: Piotr Sulecki <piotr.sulecki>
Component: WindowBuilderAssignee: Konstantin Scheglov <Konstantin.Scheglov>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: clayberg
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The full crash report. none

Description Piotr Sulecki CLA 2011-12-20 17:20:07 EST
Build Identifier: 20110916-0149

When parsing the MainWindow source file, WindowBuilder reports:


Internal Error
WindowBuilder encountered unexpected internal error. 

This could be caused by a WindowBuilder bug or by a misconfiguration issue, conflict, partial update, etc.

java.lang.IllegalArgumentException: Width (0) and height (49) cannot be <= 0

The funny thing is, when I comment out lines 140-141 in the source file, the file parses ok. The code in question is:

		this.genotypeCanvas = new Canvas();
		this.scrollPane.setRowHeaderView(this.genotypeCanvas);

What's even more interesting, commenting out two similar lines initializing two other canvas (for the column header and for the viewport itself) does not help at all. The full WindowBuilder report (including the source file in question) is attached.

Reproducible: Always

Steps to Reproduce:
1. Open the MainWindow.java file in WindowBuilder,
2. ...voila!
3. You can switch to the source view, and recreate the crash easily by switching back to the design view. Try to comment out the two lines mentioned above, and the crash disappears.
Comment 1 Piotr Sulecki CLA 2011-12-20 17:22:53 EST
Created attachment 208646 [details]
The full crash report.

What really matters here is the MainWindow.java file.
Comment 2 Eric Clayberg CLA 2011-12-20 22:18:24 EST
Use code hiding tags for a simple work around...

http://code.google.com/javadevtools/wbpro/preferences/preferences_code_parsing.html
Comment 3 Piotr Sulecki CLA 2011-12-21 05:49:03 EST
True, Eric, the code hiding tags do work, so the bug is not as severe as I thought it was. That said, the bug is still there.
Comment 4 Konstantin Scheglov CLA 2011-12-28 10:23:09 EST
Fixed in trunk.

We already have tweak in WindowBuilder to create image 1x1 instead of 0x0, but actually we should not even try to create image of such component and can just return such 1x1 image as is, empty. Because some components may just fail when we ask them to paint with size 0x0.