Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-01-20 05:23:42 -0500
committerTom Schindl2014-01-20 05:23:42 -0500
commit4331cfefb19c3f8265eca3f6a90bdce1132115f4 (patch)
treea3660ac698918dbc1daf5b7e45389db2b298ea65
parentceddc4ca3a3a8af7c9805873599e7f2987b4e800 (diff)
downloadorg.eclipse.efxclipse-4331cfefb19c3f8265eca3f6a90bdce1132115f4.tar.gz
org.eclipse.efxclipse-4331cfefb19c3f8265eca3f6a90bdce1132115f4.tar.xz
org.eclipse.efxclipse-4331cfefb19c3f8265eca3f6a90bdce1132115f4.zip
fixed possible NPEs
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.panes/.settings/org.eclipse.jdt.core.prefs113
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/GridLayoutPane.java4
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/RowLayoutPane.java119
3 files changed, 200 insertions, 36 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.panes/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.ui.panes/.settings/org.eclipse.jdt.core.prefs
index f42de363a..5671530f4 100755
--- a/bundles/runtime/org.eclipse.fx.ui.panes/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/runtime/org.eclipse.fx.ui.panes/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,114 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/GridLayoutPane.java b/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/GridLayoutPane.java
index 910b092ce..978a5214d 100755
--- a/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/GridLayoutPane.java
+++ b/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/GridLayoutPane.java
@@ -580,7 +580,9 @@ public class GridLayoutPane extends AbstractLayoutPane<GridData> {
// clean up cache
for (int i = 0; i < flushLength; i++) {
- flush [i].cacheWidth = flush [i].cacheHeight = -1;
+ if( flush != null ) {
+ flush [i].cacheWidth = flush [i].cacheHeight = -1;
+ }
}
int totalDefaultWidth = 0;
diff --git a/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/RowLayoutPane.java b/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/RowLayoutPane.java
index a455df35c..8a7b14f32 100755
--- a/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/RowLayoutPane.java
+++ b/bundles/runtime/org.eclipse.fx.ui.panes/src/org/eclipse/fx/ui/panes/RowLayoutPane.java
@@ -248,8 +248,12 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
}
if (wrap && (i != 0) && (x + childWidth > width)) {
wrapped = true;
- if (move && (justify.get() || fill.get() || center.get()))
- wraps[i - 1] = maxHeight;
+ if (move && (justify.get() || fill.get() || center.get())) {
+ if( wraps != null ) {
+ wraps[i - 1] = maxHeight;
+ }
+ }
+
x = marginLeft.get() + marginWidth.get();
y += spacing.get() + maxHeight;
if (pack.get())
@@ -261,7 +265,9 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
if (move) {
double childX = x + clientX, childY = y + clientY;
if (justify.get() || fill.get() || center.get()) {
- bounds[i] = new BoundingBox(childX, childY, childWidth, childHeight);
+ if( bounds != null ) {
+ bounds[i] = new BoundingBox(childX, childY, childWidth, childHeight);
+ }
} else {
child.resizeRelocate(childX, childY, childWidth, childHeight);
}
@@ -280,27 +286,40 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
} else {
if (fill.get() || justify.get() || center.get()) {
int last = 0;
- if (count > 0)
- wraps[count - 1] = maxHeight;
+ if (count > 0) {
+ if( wraps != null ) {
+ wraps[count - 1] = maxHeight;
+ }
+ }
+
for (int i = 0; i < count; i++) {
- if (wraps[i] != 0) {
+ if ( wraps != null && wraps[i] != 0) {
int wrapCount = i - last + 1;
if (justify.get()) {
int wrapX = 0;
for (int j = last; j <= i; j++) {
- wrapX += bounds[j].getWidth() + spacing.get();
+ if( bounds != null ) {
+ wrapX += bounds[j].getWidth() + spacing.get();
+ }
}
space = Math.max(0, (width - wrapX) / (wrapCount + 1));
margin = Math.max(0, ((width - wrapX) % (wrapCount + 1)) / 2);
}
for (int j = last; j <= i; j++) {
- if (justify.get())
- bounds[j] = changeX(bounds[j], (space * (j - last + 1)) + margin);
+ if (justify.get()) {
+ if( bounds != null ) {
+ bounds[j] = changeX(bounds[j], (space * (j - last + 1)) + margin);
+ }
+ }
if (fill.get()) {
- bounds[j] = changeHeight(bounds[j], wraps[i]);
+ if( bounds != null ) {
+ bounds[j] = changeHeight(bounds[j], wraps[i]);
+ }
} else {
if (center.get()) {
- bounds[j] = changeY(bounds[j], Math.max(0, (wraps[i] - bounds[j].getHeight()) / 2));
+ if( bounds != null ) {
+ bounds[j] = changeY(bounds[j], Math.max(0, (wraps[i] - bounds[j].getHeight()) / 2));
+ }
}
}
}
@@ -311,17 +330,26 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
}
for (int i = 0; i < count; i++) {
if (!wrapped) {
- if (justify.get())
- bounds[i] = changeX(bounds[i], (space * (i + 1)) + margin);
+ if (justify.get()) {
+ if( bounds != null ) {
+ bounds[i] = changeX(bounds[i], (space * (i + 1)) + margin);
+ }
+ }
if (fill.get()) {
- bounds[i] = changeHeight(bounds[i], maxHeight);
+ if( bounds != null ) {
+ bounds[i] = changeHeight(bounds[i], maxHeight);
+ }
} else {
if (center.get()) {
- bounds[i] = changeY(bounds[i], Math.max(0, (maxHeight - bounds[i].getHeight()) / 2));
+ if( bounds != null ) {
+ bounds[i] = changeY(bounds[i], Math.max(0, (maxHeight - bounds[i].getHeight()) / 2));
+ }
}
}
}
- children[i].resizeRelocate(bounds[i].getMinX(), bounds[i].getMinY(), bounds[i].getWidth(), bounds[i].getHeight());
+ if( bounds != null ) {
+ children[i].resizeRelocate(bounds[i].getMinX(), bounds[i].getMinY(), bounds[i].getWidth(), bounds[i].getHeight());
+ }
}
}
return new Size(maxX, y + maxHeight + marginBottom.get() + marginHeight.get());
@@ -373,8 +401,12 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
}
if (wrap && (i != 0) && (y + childHeight > height)) {
wrapped = true;
- if (move && (justify.get() || fill.get() || center.get()))
- wraps[i - 1] = maxWidth;
+ if (move && (justify.get() || fill.get() || center.get())) {
+ if( wraps != null ) {
+ wraps[i - 1] = maxWidth;
+ }
+ }
+
x += spacing.get() + maxWidth;
y = marginTop.get() + marginHeight.get();
if (pack.get())
@@ -386,7 +418,9 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
if (move) {
double childX = x + clientX, childY = y + clientY;
if (justify.get() || fill.get() || center.get()) {
- bounds[i] = new BoundingBox(childX, childY, childWidth, childHeight);
+ if( bounds != null ) {
+ bounds[i] = new BoundingBox(childX, childY, childWidth, childHeight);
+ }
} else {
child.resizeRelocate(childX, childY, childWidth, childHeight);
}
@@ -405,27 +439,39 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
} else {
if (fill.get() || justify.get() || center.get()) {
int last = 0;
- if (count > 0)
- wraps[count - 1] = maxWidth;
+ if (count > 0) {
+ if( wraps != null ) {
+ wraps[count - 1] = maxWidth;
+ }
+ }
for (int i = 0; i < count; i++) {
- if (wraps[i] != 0) {
+ if (wraps != null && wraps[i] != 0) {
int wrapCount = i - last + 1;
if (justify.get()) {
int wrapY = 0;
for (int j = last; j <= i; j++) {
- wrapY += bounds[j].getHeight() + spacing.get();
+ if( bounds != null ) {
+ wrapY += bounds[j].getHeight() + spacing.get();
+ }
}
space = Math.max(0, (height - wrapY) / (wrapCount + 1));
margin = Math.max(0, ((height - wrapY) % (wrapCount + 1)) / 2);
}
for (int j = last; j <= i; j++) {
- if (justify.get())
- bounds[j] = changeY(bounds[j], (space * (j - last + 1)) + margin);
+ if (justify.get()) {
+ if( bounds != null ) {
+ bounds[j] = changeY(bounds[j], (space * (j - last + 1)) + margin);
+ }
+ }
if (fill.get()) {
- bounds[j] = changeWidth(bounds[j], wraps[i]);
+ if( bounds != null ) {
+ bounds[j] = changeWidth(bounds[j], wraps[i]);
+ }
} else {
if (center.get()) {
- bounds[j] = changeX(bounds[j], Math.max(0, (wraps[i] - bounds[j].getWidth()) / 2));
+ if( bounds != null ) {
+ bounds[j] = changeX(bounds[j], Math.max(0, (wraps[i] - bounds[j].getWidth()) / 2));
+ }
}
}
}
@@ -436,18 +482,27 @@ public class RowLayoutPane extends AbstractLayoutPane<RowData> {
}
for (int i = 0; i < count; i++) {
if (!wrapped) {
- if (justify.get())
- bounds[i] = changeY(bounds[i], (space * (i + 1)) + margin);
+ if (justify.get()) {
+ if( bounds != null ) {
+ bounds[i] = changeY(bounds[i], (space * (i + 1)) + margin);
+ }
+ }
if (fill.get()) {
- bounds[i] = changeWidth(bounds[i], maxWidth);
+ if( bounds != null ) {
+ bounds[i] = changeWidth(bounds[i], maxWidth);
+ }
} else {
if (center.get()) {
- bounds[i] = changeX(bounds[i], Math.max(0, (maxWidth - bounds[i].getWidth()) / 2));
+ if( bounds != null ) {
+ bounds[i] = changeX(bounds[i], Math.max(0, (maxWidth - bounds[i].getWidth()) / 2));
+ }
}
}
}
- children[i].resizeRelocate(bounds[i].getMinX(), bounds[i].getMinY(), bounds[i].getWidth(), bounds[i].getHeight());
+ if( bounds != null ) {
+ children[i].resizeRelocate(bounds[i].getMinX(), bounds[i].getMinY(), bounds[i].getWidth(), bounds[i].getHeight());
+ }
}
}
return new Size(x + maxWidth + marginRight.get() + marginWidth.get(), maxY);

Back to the top