Comments (8)
Similarly with null Layout Data and layout.type = SWT.VERTICAL; BorderLayout.getMax() also throws NPE as below:
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.swt.layout.BorderLayout.lambda$5(BorderLayout.java:244)
at java.base/java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:212)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.IntPipeline.reduce(IntPipeline.java:496)
at java.base/java.util.stream.IntPipeline.max(IntPipeline.java:459)
at org.eclipse.swt.layout.BorderLayout.getMax(BorderLayout.java:244)
at org.eclipse.swt.layout.BorderLayout.getMax(BorderLayout.java:240)
at org.eclipse.swt.layout.BorderLayout.computeSize(BorderLayout.java:149)
at org.eclipse.swt.widgets.Composite.computeSizeInPixels(Composite.java:217)
at org.eclipse.swt.widgets.Control.computeSize(Control.java:663)
at org.eclipse.swt.widgets.Control.pack(Control.java:2198)
at org.eclipse.swt.widgets.Control.pack(Control.java:2168)
at org.eclipse.swt.snippets.Snippet379.main(Snippet379.java:50)
from eclipse.platform.swt.
I can take a look at this issue and begin working on a fix. Just want to confirm, @laeubi do you have a patch in progress already?
from eclipse.platform.swt.
@joel-majano I haven't yet prepared a patch and contributions are always welcome, so please go ahead
Just add me as a reviewer then, otherwise I'll be looking into this next week. I think the first step would be to enhance the test-case to reproduce this issue.
from eclipse.platform.swt.
I was able to recreate the NPE that Niraj commented on, but to recreate the original issue I have to set SWT.HORIZONTAL and call shell.pack() explicitly (in both cases). Are these the expected failure conditions?
from eclipse.platform.swt.
At least the stacktrace indicates that there is a pack() involved:
at org.eclipse.swt.widgets.Control.pack(Control.java:2198)
from eclipse.platform.swt.
Okay, in that case, I get this issue even if LayoutData is not null. Just taking Snippet 379, adding a shell.pack() call right before shell.open() creates the NPE. SWT.VERTICAL creates an NPE in BorderLayout.getMax() and SWT.HORIZONTAL creates an NPE in BorderLayout.getTotal().
Also, what would be the expected behaviour of pack()? I know BorderLayout has some spacing/margin dimensions specified, so is pack() a valid call with BorderLayout?
from eclipse.platform.swt.
I don't see a reason why pack()
should not be supported.
from eclipse.platform.swt.
Alright, still looking into this, no patch yet.
from eclipse.platform.swt.
Related Issues (20)
- Hang expanding a styled tree widget HOT 18
- gc.fillRectangle not working for macOS HOT 2
- SWT Javadoc bash for 4.28 HOT 1
- Line dashes on Windows 200% display scale (hi-dpi) are half-size HOT 1
- Configure SWT build scripts for 4.29 HOT 1
- StyledText increases row height (depending on text)
- `SIGSEGV` in `swt_fixed_resize` HOT 13
- ControlObservableValueTest misses cleanup
- [mac] github verification build fails randomly
- [Windows Hi-DPI] Progress icon is too big and clipped HOT 5
- eclipse crashes with InjectionException shortly after startup HOT 1
- Eclipse crashes shortly after startup, missing J2EE HOT 10
- eclipse crashes when a hover starts in a java editor HOT 7
- [Windows Hi-DPI] Program icons have black background HOT 7
- [Win32] GC.drawString draws nothing if string is too long HOT 4
- [win] build.bat: error log clearer HOT 6
- Random failing Test_org_eclipse_swt_browser_Browser.* HOT 2
- [cocoa] In tests, Shell sometimes doesn't activate HOT 14
- [GTK] Display.getActiveShell() may report wrong shell HOT 2
- Shell.test_Issue450_NoShellActivateOnSetFocus fails on Mac HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eclipse.platform.swt.