From 96d530e7127c89db9991080e6268c6e8430d0619 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 8 Jul 2014 10:47:41 +0200 Subject: Findbugs.not-written.null: Fix referencing non-written fields (never written or due branching) - AWT TextRenderer: Add throw new InternalError("fontRenderContext never initialized!"); FIXME! - GLContextImpl.hasFBOImpl(): Fix serious NPE issue if extCache is null - GLDrawableFactoryImpl.createOffscreenDrawableImpl(..): - Fix NPE issue w/ null drawable - Fix resetting GammaRamp by ensuring originalGammaRamp will be set at 1st setGammaRamp(..) - AndroidGLMediaPlayerAPI14: Fix NPE: Use already resolved local referenced - EGLDrawableFactory: Fix NPE: Only operate on non null surface! - ALAudioSink.dequeueBuffer(..): Only resolve releasedBuffer elements if not null - --- src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java index 660d3bc6a..1c9eacec0 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java @@ -1582,7 +1582,7 @@ public class TextRenderer { class GlyphProducer { final int undefined = -2; - FontRenderContext fontRenderContext; + FontRenderContext fontRenderContext = null; // FIXME: Never initialized! List glyphsOutput = new ArrayList(); HashMap fullGlyphVectorCache = new HashMap(); HashMap glyphMetricsCache = new HashMap(); @@ -1675,6 +1675,9 @@ public class TextRenderer { // Have to do this the hard / uncached way singleUnicode[0] = unicodeID; + if( null == fontRenderContext ) { // FIXME: Never initialized! + throw new InternalError("fontRenderContext never initialized!"); + } final GlyphVector gv = font.createGlyphVector(fontRenderContext, singleUnicode); return gv.getGlyphMetrics(0).getAdvance(); -- cgit v1.2.3