Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367254 - IllegalArgumentException when parsing a source file
Summary: IllegalArgumentException when parsing a source file
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Scheglov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 17:20 EST by Piotr Sulecki CLA
Modified: 2021-06-04 16:45 EDT (History)
1 user (show)

See Also:


Attachments
The full crash report. (49.35 KB, application/x-zip-compressed)
2011-12-20 17:22 EST, Piotr Sulecki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.