/*
 * This file is part of libbluray
 * Copyright (C) 2010  William Hahne
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 */
package javax.tv.graphics;

import java.awt.Container;
import javax.tv.xlet.XletContext;
import org.havi.ui.HScene;
import org.havi.ui.HSceneFactory;

public class TVContainer {
    public static Container getRootContainer(XletContext context)
    {
        if (context == null) {
            throw new NullPointerException();
        }

        HScene scene = HSceneFactory.getInstance().getDefaultHScene();
        return scene;
    }
}

@@ -859,17 +859,25 @@
 i.HScene
-;
+Factory;%0A
 %0Aimport 
@@ -880,37 +880,39 @@
 ort org.
-havi.ui.HSceneFactory
+videolan.BDJXletContext
 ;%0A%0Apubli
@@ -1105,50 +1105,391 @@
     
-HScene scene = HSceneFactory.getInstance()
+if (!(context instanceof BDJXletContext) %7C%7C (BDJXletContext)context != BDJXletContext.getCurrentContext()) %7B%0A            org.videolan.Logger.getLogger(TVContainer.class.getName()).error(%22wrong context%22);%0A        %7D%0A%0A        /* GEM: return instance of org.havi.ui.HScene or NULL */%0A        HSceneFactory sf = HSceneFactory.getInstance();%0A        if (sf != null) %7B%0A            return sf
 .get
@@ -1501,24 +1501,34 @@
 ltHScene();%0A
+        %7D%0A
         retu
@@ -1534,13 +1534,12 @@
 urn 
-scene
+null
 ;%0A  

Fix possible null pointer dereference