# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/matthias/NetBeansProjects/core-main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: db/libsrc/org/netbeans/lib/ddl/DatabaseSpecificationFactory.java --- db/libsrc/org/netbeans/lib/ddl/DatabaseSpecificationFactory.java +++ db/libsrc/org/netbeans/lib/ddl/DatabaseSpecificationFactory.java @@ -95,14 +95,6 @@ public DatabaseSpecification createSpecification(Connection c) throws DatabaseProductNotFoundException, SQLException; - - /** Returns debug-mode flag - */ - public boolean isDebugMode(); - - /** Sets debug-mode flag - */ - public void setDebugMode(boolean mode); } /* Index: db/libsrc/org/netbeans/lib/ddl/impl/AbstractCommand.java --- db/libsrc/org/netbeans/lib/ddl/impl/AbstractCommand.java +++ db/libsrc/org/netbeans/lib/ddl/impl/AbstractCommand.java @@ -56,20 +56,19 @@ import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.util.NbBundle; -import org.openide.windows.IOProvider; -import org.openide.windows.OutputWriter; import org.netbeans.lib.ddl.DatabaseSpecification; import org.netbeans.lib.ddl.DDLCommand; import org.netbeans.lib.ddl.DDLException; import org.netbeans.lib.ddl.util.CommandFormatter; -import org.openide.windows.InputOutput; /** * Basic implementation of DDLCommand. This class can be used for really simple * commands with format and without arguments. Heavilly subclassed. */ public class AbstractCommand implements Serializable, DDLCommand { + private static final Logger LOG = Logger.getLogger(AbstractCommand.class.getName()); + /** Command owner */ private DatabaseSpecification spec; @@ -208,25 +207,11 @@ return; } - //In case of debug mode print command - if (spec.getSpecificationFactory().isDebugMode()) { + // Output command to log -- log function contain short circuit filters, so + // the call should be cheap not to need another guard + LOG.fine(fcmd); try { - InputOutput io = IOProvider.getDefault().getIO(NbBundle.getBundle("org.netbeans.lib.ddl.resources.Bundle").getString("LBL_Output_Window"), false); - io.select(); - OutputWriter ow = io.getOut(); //NOI18N - if (ow != null) { - ow.println(fcmd); - ow.println(" "); //NOI18N - } else - throw new Exception(); - - } catch (Exception e) { - Logger.getLogger("global").log(Level.INFO, e.getMessage() + "\n" + fcmd); //NOI18N - } - } - - try { fcon = spec.getJDBCConnection(); if (fcon == null) { fcon = spec.openJDBCConnection(); Index: db/libsrc/org/netbeans/lib/ddl/impl/SpecificationFactory.java --- db/libsrc/org/netbeans/lib/ddl/impl/SpecificationFactory.java +++ db/libsrc/org/netbeans/lib/ddl/impl/SpecificationFactory.java @@ -253,18 +253,6 @@ return spec; } - /** Returns debug-mode flag - */ - public boolean isDebugMode() { - return debug; - } - - /** Sets debug-mode flag - */ - public void setDebugMode(boolean mode) { - debug = mode; - } - /** Returns array of driver products supported by system. * It returns string array only, if you need a Specification instance, use * appropriate createDriverSpecification method. Index: db/src/org/netbeans/modules/db/explorer/action/DisableDebugAction.java --- db/src/org/netbeans/modules/db/explorer/action/DisableDebugAction.java +++ db/src/org/netbeans/modules/db/explorer/action/DisableDebugAction.java @@ -1,74 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - * - * Portions Copyrighted 2009 Sun Microsystems, Inc. - */ - -package org.netbeans.modules.db.explorer.action; - -import org.netbeans.modules.db.explorer.node.RootNode; -import org.openide.nodes.Node; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * - * @author Rob Englander - */ -public class DisableDebugAction extends BaseAction { - @Override - public String getName() { - return NbBundle.getMessage (DisableDebugAction.class, "DisableDebug"); // NOI18N - } - - @Override - public HelpCtx getHelpCtx() { - return new HelpCtx(DisableDebugAction.class); - } - - protected boolean enable(Node[] activatedNodes) { - return RootNode.instance().getSpecificationFactory().isDebugMode(); - } - - @Override - protected void performAction(Node[] activatedNodes) { - RootNode.instance().getSpecificationFactory().setDebugMode(false); - } - -} Index: db/src/org/netbeans/modules/db/explorer/action/EnableDebugAction.java --- db/src/org/netbeans/modules/db/explorer/action/EnableDebugAction.java +++ db/src/org/netbeans/modules/db/explorer/action/EnableDebugAction.java @@ -1,74 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - * - * Portions Copyrighted 2009 Sun Microsystems, Inc. - */ - -package org.netbeans.modules.db.explorer.action; - -import org.netbeans.modules.db.explorer.node.RootNode; -import org.openide.nodes.Node; -import org.openide.util.HelpCtx; -import org.openide.util.NbBundle; - -/** - * - * @author Rob Englander - */ -public class EnableDebugAction extends BaseAction { - @Override - public String getName() { - return NbBundle.getMessage (EnableDebugAction.class, "EnableDebug"); // NOI18N - } - - @Override - public HelpCtx getHelpCtx() { - return new HelpCtx(EnableDebugAction.class); - } - - protected boolean enable(Node[] activatedNodes) { - return !RootNode.instance().getSpecificationFactory().isDebugMode(); - } - - @Override - protected void performAction(Node[] activatedNodes) { - RootNode.instance().getSpecificationFactory().setDebugMode(true); - } - -} Index: db/src/org/netbeans/modules/db/resources/mf-layer.xml --- db/src/org/netbeans/modules/db/resources/mf-layer.xml +++ db/src/org/netbeans/modules/db/resources/mf-layer.xml @@ -65,16 +65,6 @@ - - - - - - - - - -