debian/0000775000000000000000000000000012035513100007156 5ustar debian/copyright0000664000000000000000000036222711720272354011142 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59 Name: netbeans Source: http://dlc.sun.com.edgesuite.net/netbeans/ Files: * Copyright: Copyright 1997-2010 Oracle and/or its affiliates. Portions Copyrighted 1997-2009 Sun Microsystems, Inc. License: CDDL-1 or GPL-2 with CLASSPATH exception "CLASSPATH" EXCEPTION TO THE GPL VERSION 2 . Certain source files distributed by Oracle Corp. are subject to the following clarification and special exception to the GPL Version 2, but only where Oracle has expressly included in the particular source file's header the words "Oracle designates this particular file as subject to the "Classpath" exception as provided by Oracle in the License file that accompanied this code." . Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination. . As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. Files: debian/* Copyright: 2008-2010, Yulia Novozhilova 2011, Andrew Ross License: GPL-2 Files: apisupport.feedreader/feedreader-suite/*, apisupport.paintapp/PaintApp-suite/*, cnd.makeproject/samples_src/*, j2ee.samples/samples_src/AnnotOvdInterceptor/*, j2ee.samples/samples_src/InterceptorStateless/*, j2ee.samples/samples_src/LotteryAnnotation/*, j2ee.samples/samples_src/WebJpa/*, j2ee.samples/samples_src/JsfJpa/*, j2ee.samples/samples_src/JsfJpaCrud/*, j2ee.samples/samples_src/DukeStateful/*, j2ee.samples/samples_src/ServletStateless/*, java.examples/anagrams/*, java.examples/DocumentEditor/*, java.examples/MarsRoverViewer/*, java.examples/GUIFormExamples/*, java.examples/ClientEditor/*, maven.samples/samples_src/MavenCalculatorClient/*, maven.samples/samples_src/MavenCalculator/*, mobility.midpexamples/*, websvc.metro.samples/samples_src/*, websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/orderprocessor/boundary/OrderResource.java, Copyright: 2009-2010, Oracle License: BSD-3-clause Copyright (c) 2010, Oracle. All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . * Neither the name of Oracle nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: j2ee.samples/samples_src/LotteryAnnotation/LotteryAnnotation-war/web/index.html Copyright: 2007, Sun Microsystems, Inc. License: BSD-3-clause Copyright (c) 2007, Sun Microsystems, Inc. All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . * Neither the name of Sun Microsystems, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: web.core.syntax/tlddoc/* Copyright: 2003-2004, Sun Microsystems, Inc. License: BSD-3-clause Copyright (c) 2003-2004, Sun Microsystems, Inc. All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Sun Microsystems, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: beans/src/org/netbeans/modules/beans/BeanUtils.java, beans/src/org/netbeans/modules/beans/TmpPattern.java, beans/src/org/netbeans/modules/beans/BeanNavigatorJavaSourceFactory.java, beans/src/org/netbeans/modules/beans/BeanPanel.java, beans/src/org/netbeans/modules/beans/ClassPattern.java, css.editor/src/org/netbeans/modules/css/formatting/api/embedding/JoinedTokenSequence.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeParserNoEx.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenImpl.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/LLkParserNoEx.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharScannerNoEx.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Context.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/MatchExceptionState.java, cnd.callgraph/src/org/netbeans/modules/cnd/callgraph/impl/CallGraphScene.java, cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/trace/TraceModelBase.java, db/src/org/netbeans/modules/db/resources/connection-1_1.dtd, editor.structure/src/org/netbeans/modules/editor/structure/formatting/TextBounds.java, editor.structure/src/org/netbeans/modules/editor/structure/formatting/JoinedTokenSequence.java, editor.structure/src/org/netbeans/modules/editor/structure/formatting/TransferData.java, glassfish.common/src/org/netbeans/modules/glassfish/common/nodes/actions/DeployDirectoryAction.java, languages/src/org/netbeans/modules/languages/TokenType.java, languages/src/org/netbeans/modules/languages/Rule.java, languages/src/org/netbeans/modules/languages/features/ASTBrowserTopComponent.java, languages/src/org/netbeans/modules/languages/features/TokensBrowserTopComponent.java, languages/src/org/netbeans/modules/languages/features/HighlighterSupport.java, languages/src/org/netbeans/modules/languages/features/TokensBrowserAction.java, languages/src/org/netbeans/modules/languages/features/ASTBrowserAction.java, libs.freemarker/src/org/netbeans/libs/freemarker/RsrcLoader.java, lib.terminalemulator/demosrc/buildtool/BuildTool.java, lib.terminalemulator/demosrc/buildtool/Junk.java, lib.terminalemulator/demosrc/telnet/TelnetApp.java, project.libraries/src/org/netbeans/spi/project/libraries/LibraryStorageArea.java, project.libraries/src/org/netbeans/spi/project/libraries/ArealLibraryProvider.java, project.libraries/src/org/netbeans/api/project/libraries/LibraryChooser.java, project.libraries/src/org/netbeans/api/project/libraries/LibraryChooserGUI.java, projectuiapi/src/org/netbeans/modules/project/uiapi/SavingProjectDataPanel.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGActionListener.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGRadioButton.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGTextField.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGAbstractButton.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGComponent.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGButtonGroup.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/input/NumPadInputHandler.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/input/InputHandler.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGForm.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGCheckBox.java, vmd.components.svg/nb_svg_midp_components/src/org/netbeans/microedition/svg/SVGButton.java, vmd.flow/src/org/netbeans/modules/vmd/api/flow/visual/OrthogonalCollisionsCollector.java, web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplateIterator.java, web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplateClientPanel.java, web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplateClientIterator.java, web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplatePanelVisual.java, web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplateClientPanelVisual.java, web.jsf/src/org/netbeans/modules/web/jsf/wizards/TemplatePanel.java, php.dbgp/src/org/netbeans/modules/php/dbgp/ModelNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/ViewModelSupport.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/CallStackModel.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/ObjectVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/ScriptWatchEvaluating.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/NullVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/ScalarTypeVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/BaseVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/AbstractVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/StringVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/VariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/ContextNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/ArrayVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/ResourceVariableNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/nodes/AbstractModelNode.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/WatchesActionsProvider.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/VariablesModel.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/AbstractIDEBridge.java, php.dbgp/src/org/netbeans/modules/php/dbgp/models/WatchesModel.java, php.dbgp/src/org/netbeans/modules/php/dbgp/annotations/CallStackAnnotation.java, php.dbgp/src/org/netbeans/modules/php/dbgp/actions/StepOverActionProvider.java, php.dbgp/src/org/netbeans/modules/php/dbgp/actions/StepIntoActionProvider.java, php.dbgp/src/org/netbeans/modules/php/dbgp/actions/StepOutActionProvider.java, php.dbgp/src/org/netbeans/modules/php/dbgp/actions/RunToCursorActionProvider.java, php.dbgp/src/org/netbeans/modules/php/dbgp/actions/ContinueActionProvider.java, php.editor/src/org/netbeans/modules/php/editor/palette/PHPPaletteFactory.java, php.editor/src/org/netbeans/modules/php/editor/palette/PHPPaletteActions.java, spi.quicksearch/arch.xml, o.n.swing.outline/arch.xml, core.startup/src/org/netbeans/core/startup/instance-mime-resolver.xml, core.startup/arch.xml, nbjunit/test/unit/src/org/netbeans/junit/TestBundle.properties, core.ui/arch.xml, libs.nbi.ant/stub/build.properties, api.annotations.common/arch.xml, spi.actions/arch.xml, nbi/engine/nbproject/genfiles.properties, sendopts/test/unit/src/org/netbeans/api/sendopts/StreamingTest.java, Copyright: 1997-2007, Sun Microsystems, Inc. License: CDDL-1 Files: db/src/org/netbeans/modules/db/util/Base64.java Copyright: 2000-2009 Sun Microsystems, Inc. License: GPL-2 with CLASSPATH exception This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the LICENSE file that accompanied this code. . This code 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 General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). . You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. . Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, CA 95054 USA or visit www.sun.com if you need additional information or have any questions. Files: websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/orderprocessor/entity/Order.java, websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/orderprocessor/boundary/OrderService.java, websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/orderprocessor/control/BillingService.java, websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/orderprocessor/control/Warehouse.java, websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/orderprocessor/control/DeliveryService.java, websvc.rest.samples/LeanServiceECBComponentWithAjax/src/java/com/abien/business/audits/CallAudit.java, websvc.rest.samples/LeanServiceECBComponentWithAjax/test/com/abien/business/orderprocessor/boundary/OrderServiceTest.java Copyright: 12 July 2009 Adam Bien, blog.adam-bien.com License GPL-2+ This file is part of javaee-patterns. . javaee-patterns is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . javaee-patterns 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 General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . Files: db.dataview/src/org/netbeans/modules/db/dataview/util/BasicDateTimePickerUI.java, db.dataview/src/org/netbeans/modules/db/dataview/util/JXDateTimePicker.java Copyright: 2004 Sun Microsystems, Inc. License LGPL-2.1 Files: html.editor/src/org/netbeans/modules/html/editor/hints/HintsAdvancedOption.java, java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEConfigurationProvider.java, javascript.hints/src/org/netbeans/modules/javascript/hints/infrastructure/HintsAdvancedOption.java, mobility.j2meunit/src/org/netbeans/modules/mobility/j2meunit/J2MEUnitPlugin.java, projectui/src/org/netbeans/modules/project/ui/actions/ActiveConfigAction.java, refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/VarUsageVisitor.java, vmd.inspector/src/org/netbeans/modules/vmd/inspector/InspectorPanel.java, vmd.inspector/src/org/netbeans/modules/vmd/inspector/InspectorUI.java, web.core.syntax/src/org/netbeans/modules/web/core/syntax/folding/*, web.el/src/org/netbeans/modules/web/el/hints/HintsAdvancedOption.java, xml.lexer/src/org/netbeans/api/xml/lexer/XMLTokenId.java, xml.lexer/src/org/netbeans/lib/xml/lexer/XMLLexer.java, php.editor/src/org/netbeans/modules/php/editor/verification/HintsAdvancedOption.java, Copyright: 1997-2006 Sun Microsystems, Inc. License: SPL-1 Files: cnd.antlr/src/org/netbeans/modules/cnd/antlr/ActionElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/actions/java/action.g, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ActionTransInfo.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/AlternativeBlock.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/AlternativeElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Alternative.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ANTLRError.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ANTLRException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/antlr.g, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ANTLRGrammarParseBehavior.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ANTLRHashString.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ANTLRStringBuffer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Factory.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ASTIterator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ASTNULLType.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ASTPair.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ASTVisitor.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/BaseAST.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/BlockContext.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/BlockEndElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/BlockWithImpliedExitPath.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ByteBuffer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharBuffer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharFormatter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharLiteralElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharQueue.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharRangeElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharScanner.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharStreamException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CharStreamIOException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CodeGenerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/ASTEnumeration.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/AST.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/Enumerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/ASTArray.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/ASTEnumerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/BitSet.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/IndexedVector.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/IntRange.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/LLCell.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/LLEnumeration.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/LList.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/VectorEnumerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/impl/Vector.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/collections/Stack.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CommonAST.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CommonASTWithHiddenTokens.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CommonHiddenStreamToken.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/CommonToken.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/debug/misc/ASTFrame.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/debug/misc/JTreeASTModel.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/debug/misc/JTreeASTPanel.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/debug/ParseTreeDebugParser.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/DefaultFileLineFormatter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/DefaultToolErrorHandler.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/DefineGrammarSymbols.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/DiagnosticCodeGenerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/DocBookCodeGenerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/DumpASTVisitor.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ExceptionHandler.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ExceptionSpec.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/FileCopyException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/FileLineFormatter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/GrammarAnalyzer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/GrammarAtom.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/GrammarElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Grammar.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/GrammarSymbol.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/HTMLCodeGenerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ImportVocabTokenManager.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/InputBuffer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/JavaBlockFinishingInfo.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/JavaCharFormatter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/JavaCodeGenerator.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/LexerGrammar.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/LexerSharedInputState.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/LLkAnalyzer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/LLkGrammarAnalyzer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/LLkParser.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Lookahead.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/MakeGrammar.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/MismatchedCharException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/MismatchedTokenException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/NameSpace.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/NoViableAltException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/NoViableAltForCharException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/OneOrMoreBlock.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ParserGrammar.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Parser.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ParserSharedInputState.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ParseTree.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ParseTreeRule.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ParseTreeToken.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/GrammarFile.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/Grammar.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/Hierarchy.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/Option.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/preproc.g, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/Rule.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/preprocessor/Tool.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/PreservingFileWriter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/RecognitionException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/RuleBlock.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/RuleEndElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/RuleRefElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/RuleSymbol.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/SemanticException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/SimpleTokenManager.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/StringLiteralElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/StringLiteralSymbol.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/SynPredBlock.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/tokdef.g, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenBuffer.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Token.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenManager.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenQueue.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenRangeElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenRefElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamBasicFilter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamHiddenTokenFilter.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamIOException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStream.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamRecognitionException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamRetryException.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamRewriteEngine.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenStreamSelector.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenSymbol.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TokenWithIndex.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ToolErrorHandler.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/Tool.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeBlockContext.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeParser.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeParserSharedInputState.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeSpecifierNode.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/TreeWalkerGrammar.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/WildcardElement.java, cnd.antlr/src/org/netbeans/modules/cnd/antlr/ZeroOrMoreBlock.java Copyright: 2010 Terence Parr Licsense: BSD-3-clause Copyright (c) 2010 Terence Parr All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: html.validation/src/org/netbeans/modules/html/validation/ValidationTransaction.java, html.validation/src/org/netbeans/modules/html/validation/NbMessageEmitter.java, html.validation/src/org/netbeans/modules/html/validation/patched/BufferingRootNamespaceSniffer.java, html.validation/src/org/netbeans/modules/html/validation/patched/RootNamespaceSniffer.java Copyright: 2005, 2006 Henri Sivonen 2007-2010 Mozilla Foundation License: OTHER-1 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Files: php.samples/samples_src/Jobeet/plugins/sfDoctrineGuardPlugin/*, php.samples/samples_src/Jobeet/plugins/sfFormExtraPlugin/*, php.samples/samples_src/Jobeet/test/bootstrap/unit.php, php.samples/samples_src/Jobeet/test/bootstrap/functional.php Copyright: 2004-2008 Fabien Potencier 2006-2008 Jonathan H. Wage License: OTHER-2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Files: php.samples/samples_src/Jobeet/lib/vendor/Zend/* Copyright: 2005-2010, Zend Technologies USA, Inc. License: NEWBSD All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . * Neither the name of Zend Technologies USA, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: html.validation/src/org/netbeans/modules/html/validation/ValidationTransaction.java, html.validation/src/org/netbeans/modules/html/validation/NbMessageEmitter.java, html.validation/src/org/netbeans/modules/html/validation/patched/BufferingRootNamespaceSniffer.java, html.validation/src/org/netbeans/modules/html/validation/patched/RootNamespaceSniffer.java Copyright: 1997-1999 Netscape Communications Corporation License: MPL-1.1 or GPL-2 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ . Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. . The Original Code is Rhino code, released May 6, 1999. . The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by the Initial Developer are Copyright (C) 1997-1999 the Initial Developer. All Rights Reserved. . Contributor(s): Igor Bukanov Bob Jervis Norris Boyd . Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replacing them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the GPL. Files: web.examples/appdev/src/mypackage/Hello.java, web.examples/servlets/*, web.examples/jsp/*, web.struts/src/org/netbeans/modules/web/struts/resources/validator_1_2_0.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/struts-config_1_1.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/tiles-config_1_3.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/validator_1_1.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/validator_1_3_0.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/struts-config_1_3.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/tiles-config_1_1.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/struts-config_1_2.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/struts-config_1_0.dtd, web.struts/src/org/netbeans/modules/web/struts/resources/validator_1_1_3.dtd, Copyright: 1999,2004 The Apache Software Foundation License: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Files: web.examples/jstl/* Copyright: 1999-2003 The Apache Software Foundation License Apache-1.1 The Apache Software License, Version 1.1 . Copyright (c) 1999-2003 The Apache Software Foundation. All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . 3. The end-user documentation included with the redistribution, if any, must include the following acknowlegement: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowlegement may appear in the software itself, if and wherever such third-party acknowlegements normally appear. . 4. The names "The Jakarta Project", "Tomcat", and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact apache@apache.org. . 5. Products derived from this software may not be called "Apache" nor may "Apache" appear in their names without prior written permission of the Apache Group. . THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================== . This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation. For more information on the Apache Software Foundation, please see . Files: php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/StateStack.java Copyright: 2006 Zend Corporation and IBM Corporation. License: EPL-1 Eclipse Public License - v 1.0 . THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. . 1. DEFINITIONS . "Contribution" means: . a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and . b) in the case of each subsequent Contributor: . i) changes to the Program, and . ii) additions to the Program; . where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. . "Contributor" means any person or entity that distributes the Program. . "Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. . "Program" means the Contributions distributed in accordance with this Agreement. . "Recipient" means anyone who receives the Program under this Agreement, including all Contributors. . 2. GRANT OF RIGHTS . a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. . b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. . c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. . d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. . 3. REQUIREMENTS . A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: . a) it complies with the terms and conditions of this Agreement; and . b) its license agreement: . i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; . ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; . iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and . iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. . When the Program is made available in source code form: . a) it must be made available under this Agreement; and . b) a copy of this Agreement must be included with each copy of the Program. . Contributors may not remove or alter any copyright notices contained within the Program. . Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. . 4. COMMERCIAL DISTRIBUTION . Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. . For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. . 5. NO WARRANTY . EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. . 6. DISCLAIMER OF LIABILITY . EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. . 7. GENERAL . If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. . If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. . All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. . Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. . This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. Files: ./options.keymap/build.xml, ./openide.awt/test/unit/src/org/openide/awt/ActionsTest.java, ./o.n.bootstrap/test/unit/src/org/netbeans/ModuleMixedOnClasspathTest.java, ./o.n.bootstrap/test/unit/src/org/netbeans/ModuleFactoryTest.java, ./o.n.bootstrap/test/unit/src/org/netbeans/ModuleFactoryAlienTest.java, ./o.n.bootstrap/src/org/netbeans/ModuleFactory.java, ./apisupport.harness/jnlp-src/org/netbeans/modules/apisupport/jnlplauncher/RuntimePolicy.java, ./apisupport.harness/test/unit/src/org/netbeans/modules/apisupport/jnlplauncher/FixPolicyTest.java Copyright: Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved. Portions Copyrihgt 2005-2006 Nokia License: CDDL-1 or GPL-2 with CLASSPATH exception Files: ./core.windows/test/unit/src/org/netbeans/core/windows/view/ui/CustomMenuBarTest.java, ./core.startup/test/unit/src/org/netbeans/core/startup/layers/CustomWritableSystemFileSystemTest.java Copyright: Copyright 1997-2010 Oracle and/or its affiliates. Portions Copyrighted 2007 Nokia Siemens Networks Oy License: CDDL-1 or GPL-2 with CLASSPATH exception Files: ./nbjunit/test/unit/src/org/netbeans/junit/TestBundle.properties Copyright: Copyright (C) 2006 Jaroslav Tulach. License: CDDL-1 Files: ./openide.util/test/unit/src/org/openide/util/UtilitiesTranslate29878.txt, ./nbbuild/test/unit/src/org/netbeans/nbbuild/testdist/TestDistFilterTest.java Copyright: Copyright 1997-2010 Oracle and/or its affiliates. Portions Copyright 1997-2006 Sun Microsystems, Inc. License: CDDL-1 Files: ./openide.loaders/test/unit/src/org/openide/loaders/DataShadowLookupTest.java, ./nbbuild/test/unit/src/org/netbeans/nbbuild/CheckLicenseXmlExample.xml, ./nbbuild/test/unit/src/org/netbeans/nbbuild/ShorterPathsTest.xml, ./nbbuild/test/unit/src/org/netbeans/nbbuild/CheckLicenseHtmlExample.xml, ./nbbuild/test/unit/src/org/netbeans/nbbuild/CheckLicensePropertiesExample.properties Copyright: Copyright 1997-2006 Sun Microsystems, Inc. License: SPL-1 Files: ./o.n.core/external/nsProxyAutoConfig.js Copyright: Copyright (C) 1998 Netscape Communications Corporation. Contributor(s): Akhil Arora Tomi Leppikangas Darin Fisher License: MPL-1.1 or GPL-2 or LGPL-2.1 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ . Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. . Alternatively, the contents of this file may be used under the terms of either the GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL. License: GPL-2 On Debian systems the full text of the GNU General Public License can be found in the `/usr/share/common-licenses/GPL-2' file. License LGPL-2.1 On Debian systems the full text of the GNU General Public License can be found in the `/usr/share/common-licenses/LGPL-2.1' file. License Apache-2.0 On Debian systems the full text of the Apache License Version 2.0 can be found in the `/usr/share/common-licenses/Apache-2.0' file. License: SPL-1 SUN PUBLIC LICENSE Version 1.0 . 1. Definitions. . 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. . 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. . 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. . 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof and corresponding documentation released with the source code. . 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. . 1.5. "Executable" means Covered Code in any form other than Source Code. . 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. . 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. . 1.8. "License" means this document. . 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. . 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: . A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. . B. Any new file that contains any part of the Original Code or previous Modifications. . 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. . 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. . 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated documentation, interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. . 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. . 2. Source Code License. . 2.1 The Initial Developer Grant. . The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: . (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and . (b) under Patent Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). . (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. . (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. . 2.2. Contributor Grant. . Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license . (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and . (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). . (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. . (d) notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. . 3. Distribution Obligations. . 3.1. Application of License. . The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. . 3.2. Availability of Source Code. . Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. . 3.3. Description of Modifications. . You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. . 3.4. Intellectual Property Matters. . (a) Third Party Claims. . If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. . (b) Contributor APIs. . If Contributor's Modifications include an application programming interface ("API") and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. . (c) Representations. . Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. . 3.5. Required Notices. . You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. . 3.6. Distribution of Executable Versions. . You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. . 3.7. Larger Works. . You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. . 4. Inability to Comply Due to Statute or Regulation. . If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. . 5. Application of this License. . This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. . 6. Versions of the License. . 6.1. New Versions. . Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. . 6.2. Effect of New Versions. . Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Sun. No one other than Sun has the right to modify the terms applicable to Covered Code created under this License. . 6.3. Derivative Works. . If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must: (a) rename Your license so that the phrases "Sun," "Sun Public License," or "SPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Sun Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) . 7. DISCLAIMER OF WARRANTY. . COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. . 8. TERMINATION. . 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. . 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: . (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. . (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. . 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. . 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. . 9. LIMITATION OF LIABILITY. . UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. . 10. U.S. GOVERNMENT END USERS. . The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. . 11. MISCELLANEOUS. . This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. . 12. RESPONSIBILITY FOR CLAIMS. . As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. . 13. MULTIPLE-LICENSED CODE. . Initial Developer may designate portions of the Covered Code as ?Multiple-Licensed?. ?Multiple-Licensed? means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. . Exhibit A -Sun Public License Notice. . The contents of this file are subject to the Sun Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. A copy of the License is available at http://www.sun.com/ . The Original Code is _________________. The Initial Developer of the Original Code is ___________. Portions created by ______ are Copyright (C)_________. All Rights Reserved. . Contributor(s): ______________________________________. . Alternatively, the contents of this file may be used under the terms of the _____ license (the ?[___] License?), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the SPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the SPL or the [___] License." . [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] License: MPL-1.1 MOZILLA PUBLIC LICENSE Version 1.1 . --------------- . 1. Definitions. . 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. . 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. . 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. . 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. . 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. . 1.5. "Executable" means Covered Code in any form other than Source Code. . 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. . 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. . 1.8. "License" means this document. . 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. . 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. . B. Any new file that contains any part of the Original Code or previous Modifications. . 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. . 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. . 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. . 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. . 2. Source Code License. . 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and . (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). . (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. . (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. . 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license . (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and . (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). . (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. . (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. . 3. Distribution Obligations. . 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. . 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. . 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. . 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. . (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. . (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. . 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. . 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. . 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. . 4. Inability to Comply Due to Statute or Regulation. . If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. . 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. . 6. Versions of the License. . 6.1. New Versions. Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. . 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. . 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) . 7. DISCLAIMER OF WARRANTY. . COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. . 8. TERMINATION. . 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. . 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: . (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. . (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. . 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. . 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. . 9. LIMITATION OF LIABILITY. . UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. . 10. U.S. GOVERNMENT END USERS. . The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. . 11. MISCELLANEOUS. . This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. . 12. RESPONSIBILITY FOR CLAIMS. . As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. . 13. MULTIPLE-LICENSED CODE. . Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. . EXHIBIT A -Mozilla Public License. . ``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ . Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. . The Original Code is ______________________________________. . The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. . Contributor(s): ______________________________________. . Alternatively, the contents of this file may be used under the terms of the _____ license (the "[___] License"), in which case the provisions of [______] License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." . [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] License: CDDL-1 COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 . 1. Definitions. . 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. . 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. . 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. . 1.4. "Executable" means the Covered Software in any form other than Source Code. . 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. . 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. . 1.7. "License" means this document. . 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. . 1.9. "Modifications" means the Source Code and Executable form of any of the following: . A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; . B. Any new file that contains any part of the Original Software or previous Modification; or . C. Any new file that is contributed or otherwise made available under the terms of this License. . 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. . 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. . 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. . 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. . 2. License Grants. . 2.1. The Initial Developer Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: . (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and . (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). . (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. . (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. . 2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: . (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and . (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). . (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. . (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. . 3. Distribution Obligations. . 3.1. Availability of Source Code. . Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. . 3.2. Modifications. . The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. . 3.3. Required Notices. . You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. . 3.4. Application of Additional Terms. . You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. . 3.5. Distribution of Executable Versions. . You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. . 3.6. Larger Works. . You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. . 4. Versions of the License. . 4.1. New Versions. . Oracle Corp. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. . 4.2. Effect of New Versions. . You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. . 4.3. Modified Versions. . When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. . 5. DISCLAIMER OF WARRANTY. . COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. . 6. TERMINATION. . 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. . 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. . 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. . 7. LIMITATION OF LIABILITY. . UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. . 8. U.S. GOVERNMENT END USERS. . The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. . 9. MISCELLANEOUS. . This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. . 10. RESPONSIBILITY FOR CLAIMS. . As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. debian/libnb-java5-java.lintian-overrides0000664000000000000000000000040511720272354015563 0ustar # Netbeans builds lots of codeless jars on purpose, so don't warn us about them libnb-java5-java: codeless-jar # It is a library of sorts, although it installs as a netbeans cluster rather # than in /usr/share/java libnb-java5-java: javalib-but-no-public-jars debian/changelog0000664000000000000000000001535712035513026011052 0ustar netbeans (7.0.1+dfsg1-5ubuntu2) quantal; urgency=low * Keep the build dependency on default-jdk to find jni.h. -- Matthias Klose Thu, 11 Oct 2012 11:48:20 +0200 netbeans (7.0.1+dfsg1-5ubuntu1) quantal; urgency=low * Explicitly build using OpenJDK 6, to fix the build failure. 7.0.1 is not ready to build using Java 7. -- Matthias Klose Wed, 19 Sep 2012 18:23:18 +0200 netbeans (7.0.1+dfsg1-5) unstable; urgency=low * Include junit library definitions. * Make libnb-platform13-java depend on antlr3. (Closes: #651214) * Avoid including javadoc twice in libnb-platform13-java-doc. * Replace dependency libpg-java with libpostgresql-jdbc-java (Closes: #659397) * Add symlink to jaxp-1.4.jar (Closes: #653915) -- Andrew Ross Wed, 15 Feb 2012 20:36:14 +0000 netbeans (7.0.1+dfsg1-4) unstable; urgency=low * Patch core.osgi to use osgi-core 4.3. (Closes: #649750) * Correct binary package names and install locations. (Closes: #646856) * Install AbsoluteLayout.jar in a separate package. (Closes: #646857) -- Andrew Ross Thu, 01 Dec 2011 21:59:37 +0000 netbeans (7.0.1+dfsg1-3) unstable; urgency=low * Use libosgi-core-java and libosgi-compendium-java for osgi. * Use libflute-java instead of libflute-1.3-jfree-java. -- Andrew Ross Sun, 16 Oct 2011 20:53:51 +0100 netbeans (7.0.1+dfsg1-2) unstable; urgency=low * Handle rename of libcommons-net-java to libcommons-net1-java. * Netbeans should depend on a JDK. (Closes: #499870) * Provide netbeans-ide and netbeans-platform. -- Andrew Ross Sun, 11 Sep 2011 22:45:45 +0100 netbeans (7.0.1+dfsg1-1) unstable; urgency=low * New upstream release * Build NetBeans platform from this source too. (Closes: #610927) * Bump to Standards-Version 3.9.2. * Added myself to Uploaders. * Build Windows launcher using mingw. * Move utilility libraries to their own packages. (Closes: #490433) * Also close some bugs which were fixed in the 6.9 series which never entered the Debian archives: - Use packaged swinglayout.jar. (Closes: #448922) - Depend on generic Java. (Closes: #499417) - Package for Debian Main. (Closes: #531952) * Update Copyright file to cover all files correctly. -- Andrew Ross Tue, 02 Aug 2011 23:58:58 +0100 netbeans (6.9-1) unstable; urgency=low * New upstream version based off of Ubuntu packages. (Closes: #543907) (Closes: #478762) * Add Debian Java team as Maintainer, Yulia and myself as Uploaders. * Update packaging to use 3.0 (quilt) source format. * Update packaging to use dh with javahelper. * Bump to Standards-Version 3.9.1. * Refresh all patches. * Use Java SwingWorker included in standard JDK distribution. * Migrate to junit4. * Migrate to libservlet2.5-java. * Migrate to use Better Swing Application Framework. * Use standard svnclientadapter from subclipse. * Migrate to ini4j-0.5.2-SNAPSHOT. -- Andres Mejia Sun, 23 Jan 2011 15:42:29 -0500 netbeans (6.9-0ubuntu2) maverick; urgency=low * Bug fix upload: - correct netbeans-6.9~updatecenters.patch to point to Ubuntu UC -- Yulia Novozhilova Fri, 20 Aug 2010 17:19:59 +0400 netbeans (6.9-0ubuntu1) maverick; urgency=low * New upstream release (LP: #595000) * debian/control/Standards-Versions is updated to 3.9.0 * debian/copyright file is updated -- Yulia Novozhilova Thu, 05 Aug 2010 12:17:51 +0400 netbeans (6.8-0ubuntu4) lucid; urgency=low * Update Center is switched to the Ubuntu specific one (LP: #544459) - patches/01-updatecenters.patch is updated -- Yulia Novozhilova Wed, 31 Mar 2010 15:19:29 +0400 netbeans (6.8-0ubuntu3) lucid; urgency=low * debian/patches/l10n.patch is added (LP: #527547) * debiian/rules is updated to build l10n * debian/control dependency to default-jdk-doc | sun-java6-doc is added for libnb-java3-java package (LP: #545563) -- Yulia Novozhilova Fri, 26 Mar 2010 16:26:52 +0300 netbeans (6.8-0ubuntu2) lucid; urgency=low * Bug fix upload - debian/patches/14-config.patch added (LP: #315499) -- Yulia Novozhilova Wed, 17 Feb 2010 15:44:50 +0300 netbeans (6.8-0ubuntu1) lucid; urgency=low * New upstream release (LP: #495478) * postinstall script is removed (LP: #464939) * control/Standards-Versions is updated to 3.8.4 * debian/copyright file is updated to point to the correct location -- Yulia Novozhilova Fri, 12 Feb 2010 20:36:32 +0300 netbeans (6.7.1-0ubuntu1) karmic; urgency=low * New upstream release (LP: #381814) * Fixed upstream bugs: - (LP: #336349) - (LP: #354144) - (LP: #357579) - (LP: #366740) - (LP: #401407) * control/Standards-Versions is updated to 3.8.3 * control/Section is updated to java for *-java -- Yulia Novozhilova Mon, 13 Jul 2009 19:05:01 +0400 netbeans (6.5-0ubuntu2.1) jaunty; urgency=low * Bug fix upload (LP: #353080) - Added a critical patch 96-fix-lucene.patch -- Yulia Novozhilova Mon, 25 May 2009 23:28:08 +0400 netbeans (6.5-0ubuntu2) jaunty; urgency=low * Added bugfix patches from 6.5.1 for NetBeans IDE (LP: #345562) * 40-ide-launcher.patch is updated (LP: #307103) * debian/rules: commons-logging jar's version changed from 1.0.4 to 1.1. -- Yulia Novozhilova Tue, 31 Mar 2009 18:34:02 +0400 netbeans (6.5-0ubuntu1) jaunty; urgency=low * New upstream release. (LP: #251173) -Added "Conflicts: netbeans-ide" to control (LP: #257307) -Added watch file and get-orig-source target to rules file -- Yulia Novozhilova Fri, 26 Sep 2008 18:51:50 +0400 netbeans (6.1-0ubuntu1) intrepid; urgency=low * New upstream release. (LP: #253016) - Updated Standards-Version to 3.8.0 - Patches updated. (LP: #206324) - Cleaned up debian/rules - Updated postinstall script. (LP: #254587) -- Yulia Novozhilova Tue, 29 Jul 2008 19:43:23 +0400 netbeans (6.0.1-0ubuntu2) hardy; urgency=low * Bug fix upload (LP: #201332) - Replace GPLv2 text in debian/copyright by reference to /usr/share/common-licenses/GPL-2 - Update dependency to openjdk6 - Refine package descriptions - Add IDE Update Center specific to Ubuntu packages -- Marek Slama Fri, 07 Mar 2008 18:00:00 +0100 netbeans (6.0.1-0ubuntu1) hardy; urgency=low * Initial version. (LP: #187708) -- Marek Slama Tue, 29 Jan 2008 14:11:22 +0100 debian/source/0000775000000000000000000000000011720272354010473 5ustar debian/source/format0000664000000000000000000000001411720272354011701 0ustar 3.0 (quilt) debian/libnb-platform13-java.lintian-overrides0000664000000000000000000000061111720272354016544 0ustar # Netbeans builds lots of codeless jars on purpose, so don't warn us about them libnb-platform13-java: codeless-jar # This is a library package in the sense that it doesn't by itself provide an # application. But the jar files don't live in /usr/share/java since they are # specific to the NetBeans platform and need to live in a "cluster" libnb-platform13-java: javalib-but-no-public-jars debian/compat0000664000000000000000000000000211720272354010371 0ustar 7 debian/productid0000664000000000000000000000000611720272354011107 0ustar NBUBU debian/orig-tar.sh0000775000000000000000000001071511720272354011262 0ustar #!/bin/bash -e VERSION=$2 FILE=$3 FILENAME=`basename $FILE` BASE=`basename $FILE .zip` DIR=`dirname $FILE` if [ "x$BASE.zip" != "x$FILENAME" ] then # The file isn't the real file, but we can use it to find the real # file and download it. SITE="http://dlc.sun.com.edgesuite.net/netbeans/$VERSION/final/zip/" DL_FILE=`perl -ne 'if(/HREF="(netbeans-[0-9.]+-\d+-src.zip)"/) {print $1."\n" }' $FILE` rm -f $FILE FILE="$DIR/$DL_FILE" if [ ! -e $FILE ] then echo "Downloading real file $DL_FILE from $SITE" wget -O "$FILE" "$SITE/$DL_FILE" fi fi TAR=../netbeans_$VERSION+dfsg1.orig.tar.gz # Resolve symbolic links FILE=`readlink -f $FILE` BASE="netbeans-$VERSION" echo "Extracting zip file..." mkdir $BASE unzip -q -d $BASE $FILE echo "Cleaning source code..." # Remove jar files - we'll use debian packaged jars from # /usr/share/java find $BASE/ -name "*.jar" -type f -execdir rm \{\} \; # Remove windows executables and libraries - we'll try and build those # which we need. find $BASE/ \( -name "*.exe" -o -name "*.dll" -o -name "*.res" \) -execdir rm \{\} \; # Remove Visual Studio files find $BASE/ \( -name "*.sln" -o -name "*.suo" -o -name "*.ncb" -o -name "*.idb" \) -execdir rm \{\} \; # Remove Mac specific files. We can't regenerate these. find $BASE/ \( -name "*.dylib" -o -name "*.dmg" -o -name "objects.nib" \) -execdir rm \{\} \; # Remove shared library (.so) files. Hopefully we don't need them find $BASE/ -name "*.so" -type f -execdir rm \{\} \; # remove unzipsfx binaries find $BASE/ -name "unzipsfx" -type f -execdir rm \{\} \; # Remove files containing serialized java objects (maybe we can # re-create these if we need) find $BASE/ -name "*.ser" -type f -execdir rm \{\} \; # Remove class files find $BASE/ -name "*.class" -type f -execdir rm \{\} \; # Remove some files where it's not clear how they were generated, and # which we (hopefully) don't need find $BASE/ -name "url.url" -type f -execdir rm \{\} \; find $BASE/ -name "unrecognized" -type f -execdir rm \{\} \; # Remove all the .nbm files. They are only used in unit testing, and # we'd ideally need to generate them as part of the build. find $BASE/ -name "*.nbm" -type f -execdir rm \{\} \; # Remove object files find $BASE/ -name "*.o" -type f -execdir rm \{\} \; # Remove .data files find $BASE/ -name "*.data" -type f -execdir rm \{\} \; # Remove data files find $BASE/ -name "data" -type f -execdir rm \{\} \; # Remove .bin files find $BASE/ -name "*.bin" -type f -execdir rm \{\} \; # Remove .cfs files find $BASE/ -name "*.cfs" -type f -execdir rm \{\} \; # Remove .gen files find $BASE/ -name "*.gen" -type f -execdir rm \{\} \; # Remove .gen files find $BASE/ -name "segments_2" -type f -execdir rm \{\} \; # Remove some ELF binaries rm -rf $BASE/dlight.tools/release/tools/* find $BASE/cnd.gizmo/test/unit/data/org/netbeans/modules/cnd/gizmo/addr2line/ -not -name "*.bash" -type f -execdir rm \{\} \; find $BASE/ -name "*.sl" -type f -execdir rm \{\} \; find $BASE/ -name "*.jnilib" -type f -execdir rm \{\} \; find $BASE/dlight.nativeexecution/release/bin/nativeexecution/ -not -name "*.sh" -type f -execdir rm \{\} \; rm -f $BASE/cnd.dwarfdiscovery/test/unit/data/org/netbeans/modules/cnd/dwarfdiscovery/provider/* # Remove framemaker files and the pdf they build, since we can't edit them # with software in Debian. rm -f $BASE/usersguide/tutorials/j2ee-tut/fm/* # remove .gz files. We could re-create at least some if we need, but they're only # used in unit tests. find $BASE/ -name "*.gz" -type f -execdir rm \{\} \; # Remove .warContent files since they are binary files we can't build. find $BASE/ -name "*.warContent" -type f -execdir rm \{\} \; # Remove .jts media files as we don't appear to have a codec for them find $BASE/ -name "*.jts" -type f -execdir rm \{\} \; # Remove .pdf media files. We can recreate the ones in ide.branding find $BASE/ -name "*.pdf" -type f -execdir rm \{\} \; # Remove binary .out files. find $BASE/ -name "*.out" -type f -execdir rm \{\} \; # Remove zip files. We'll have to reproduce some. find $BASE/ -name "*.zip" -type f -execdir rm \{\} \; find $BASE/ -name "*.cap" -type f -execdir rm \{\} \; find $BASE/ -name "*.eap" -type f -execdir rm \{\} \; find $BASE/ -name "*.war" -type f -execdir rm \{\} \; find $BASE/ -name "*.ear" -type f -execdir rm \{\} \; # Remove bits of a version control repository rm -rf $BASE/versioning.util/test/unit/data/ # Make our ".orig.tar.gz" tar -czf $TAR $BASE # Remove our unpack directory rm -rf $BASE echo "Done." debian/control0000664000000000000000000001761512035512737010612 0ustar Source: netbeans Section: java Priority: optional Maintainer: Debian Java Maintainers Uploaders: Yulia Novozhilova , Andres Mejia , Andrew Ross Build-Depends: debhelper (>= 7.0.50~), javahelper, ant (>= 1.7.0), ant-optional (>= 1.7.0), default-jdk, openjdk-6-jdk, mingw32, maven-repo-helper, w3c-dtd-xhtml, javacc, libjemmy2-java, javahelp2, libbindex-java, libswing-layout-java (>= 1.0.3), libjna-java (>= 3.2.7-2~), libfelix-framework-java, libfelix-main-java, libosgi-core-java, libosgi-compendium-java, antlr3 (>= 3.2), libstringtemplate-java, junit4 (>= 4.6), libhamcrest-java, libcommons-codec-java, libbytelist-java, libcommons-logging-java, libcommons-net1-java, libflute-java, libfreemarker-java, libini4j-java (>=0.5), liboro-java, libjsch-java (>= 0.1.42), libjvyamlb-java (>= 0.2.5-2~), libjzlib-java (>= 1.0.7), liblucene2-java (>= 2.4.1), libxml-commons-resolver1.1-java (>= 1.2-3), libsac-java, libservlet2.5-java, libsvnclientadapter-java, libsvn-java, libsvnkit-java, libswingx1-java, libtrilead-ssh2-java, libsimple-validation-java, libxerces2-java, libpostgresql-jdbc-java, libmysql-java, libbetter-appframework-java, libbeansbinding-java, libcglib-java, libnb-javaparser-java (>= 7.0.1~), junit Standards-Version: 3.9.2 Homepage: http://netbeans.org/ Vcs-Browser: http://git.debian.org/?p=pkg-java/netbeans.git Vcs-Git: git://git.debian.org/git/pkg-java/netbeans.git Package: libnb-platform13-java Architecture: all Depends: ${misc:Depends}, ${java:Depends}, javahelp2, libswing-layout-java (>= 1.0.3), libjna-java(>= 3.2.7-2~), junit4 (>= 4.6), libfelix-framework-java, libfelix-main-java, libosgi-core-java, libosgi-compendium-java, libnb-org-openide-util-java, antlr3 (>= 3.2), libnb-org-openide-util-lookup-java, libnb-org-openide-modules-java Suggests: libnb-platform13-java-doc Provides: netbeans-platform Replaces: netbeans-platform Conflicts: netbeans-platform Description: NetBeans Platform for building rich desktop applications in Java The NetBeans Platform is a framework for building rich desktop applications in Java. It provides the code that is required to connect actions to menu items, toolbar items, keyboard shortcuts and more. It is the core of the NetBeans IDE. . This package provides the platform itself. Package: libnb-platform-devel-java Architecture: all Depends: ${misc:Depends}, ${java:Depends}, libnb-platform13-java, ant, libjemmy2-java, javahelp2, libbindex-java, Replaces: libnb-platform8-devel-java, libnb-platform7-devel-java Conflicts: libnb-platform8-devel-java, libnb-platform7-devel-java Description: Build harness for NetBeans Platform The NetBeans Platform is a framework for building rich desktop applications in Java. It provides the code that is required to connect actions to menu items, toolbar items, keyboard shortcuts and more. It is the core of the NetBeans IDE. . This package contains the NetBeans Platform Harness containing the build scripts and ant tasks required to build an application on top of NetBeans Platform. Package: libnb-platform13-java-doc Architecture: all Section: doc Depends: ${misc:Depends} Recommends: ${java:Recommends} Suggests: libnb-platform13-java Enhances: libnb-platform13-java Description: NetBeans Platform javadoc NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package provides one master javadoc to all of them. Package: libnb-org-openide-util-java Architecture: all Depends: ${misc:Depends}, ${java:Depends}, libnb-org-openide-util-lookup-java Provides: libopenide-util-java Replaces: libopenide-util-java Conflicts: libopenide-util-java Description: Utility classes from the NetBeans Platform The NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package provides some utility functions used by the modules that make up the platform. Package: libnb-org-openide-util-lookup-java Architecture: all Depends: ${misc:Depends}, ${java:Depends} Description: Utility lookup classes from the NetBeans Platform The NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package provides some utility functions for lookups and is used by the modules that make up the platform. Package: libnb-org-openide-modules-java Architecture: all Depends: ${misc:Depends}, ${java:Depends}, libnb-org-openide-util-java, libnb-org-openide-util-lookup-java Description: Utility classes for modules from the NetBeans Platform The NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package provides some utility functions for managing NetBeans modules. Package: libnb-absolutelayout-java Architecture: all Depends: ${misc:Depends}, ${java:Depends} Description: Java LayoutManager to allow placement in absolute positions This library is part of the Netbeans platform and provides an implementation of the java.awt.LayoutManager interface. This implementation allows you to position components by their absolute position. Package: netbeans Architecture: all Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0), openjdk-6-jdk | java6-sdk | java7-sdk, libnb-ide14-java (= ${binary:Version}), libnb-java5-java (= ${binary:Version}), libnb-apisupport3-java (= ${binary:Version}) Conflicts: netbeans5.5, netbeans-ide Replaces: netbeans5.5, netbeans-ide Provides: netbeans-ide Description: Extensible Java IDE Integrated Development Environment for software developers. It supports development of desktop, enterprise, web, and mobile applications. Package includes the Base IDE, Java Development Tools and Plug-in Development Tools. Support for PHP, Ruby, C/C++, Java EE and others can be added. Package: libnb-ide14-java Architecture: all Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0), antlr3 (>= 3.2), libcommons-codec-java, libbytelist-java, libcommons-logging-java, libcommons-net1-java, libflute-java, libfreemarker-java, libini4j-java (>= 0.5), liboro-java, libjsch-java (>= 0.1.42), libjvyamlb-java (>= 0.2.5-2~), libjzlib-java (>= 1.0.7), liblucene2-java (>= 2.4.1), libxml-commons-resolver1.1-java (>= 1.2-3), libsac-java, libservlet2.5-java, libsvnclientadapter-java, libsvn-java, libsvnkit-java, libswingx1-java, libtrilead-ssh2-java, libsimple-validation-java, libxerces2-java, libpostgresql-jdbc-java, libmysql-java Description: Common Integrated Development Environment Libraries for NetBeans The NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package contains independent libraries for use in the NetBeans IDE. Package: libnb-java5-java Architecture: all Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0), libnb-ide14-java (= ${binary:Version}), libnb-absolutelayout-java, junit, junit-doc, junit4-doc, libbetter-appframework-java, libbeansbinding-java, libcglib-java, libnb-javaparser-java (>= 7.0.1~), ant (>= 1.7.0), ant-optional (>= 1.7.0) Description: Common Java Related Libraries for NetBeans The NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package contains common libraries for the NetBeans Java IDE. Package: libnb-apisupport3-java Architecture: all Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0), libnb-platform-devel-java (>= 7.0), libnb-ide14-java (= ${binary:Version}), libnb-java5-java (= ${binary:Version}) Description: Common NetBeans Platform Development Related Libraries for NetBeans The NetBeans Platform is a set of modules, each providing their own APIs and working together or in a standalone mode. This package contains common libraries for development of NetBeans Platform modular extensions. debian/watch0000664000000000000000000000024111720272354010221 0ustar version=3 opts=dversionmangle=s/\+dfsg\d*$//,downloadurlmangle=s/$/final\/zip/ \ http://dlc.sun.com.edgesuite.net/netbeans/ ([0-9.]*)/ debian debian/orig-tar.sh debian/linked-jars0000664000000000000000000001012011720272354011313 0ustar $JAVADIR/jemmy2.jar jemmy/external harness/modules/ext jemmy-2.3.0.0.jar $JAVADIR/jsearch.jar apisupport.harness/external harness/antlib jsearch-2.0_05.jar $JAVADIR/bindex.jar apisupport.harness/external harness/antlib bindex-2.2.jar $JAVADIR/swing-layout.jar o.jdesktop.layout/external platform/modules/ext swing-layout-1.0.4.jar $JAVADIR/jhall.jar javahelp/external platform/modules/ext jhall-2.0_05.jar $JAVADIR/jna.jar libs.jna/external platform/modules/ext jna-3.2.7.jar $JAVADIR/jna-platform.jar core.nativeaccess/external platform/modules/ext platform-3.2.7.jar $JAVADIR/org.apache.felix.framework.jar libs.felix/external platform/modules/ext felix-2.0.3.jar $JAVADIR/org.apache.felix.main.jar libs.felix/external platform/modules/ext felix-main-2.0.2.jar $JAVADIR/osgi.compendium.jar libs.osgi/external platform/modules/ext osgi.cmpn-4.2.jar $JAVADIR/osgi.core.jar libs.osgi/external platform/modules/ext osgi.core-4.2.jar $JAVADIR/antlr3.jar libs.antlr3.devel/external platform/modules/ext antlr-3.1.3.jar $JAVADIR/stringtemplate.jar libs.antlr3.devel/external platform/modules/ext stringtemplate-3.2.jar $JAVADIR/junit4.jar libs.junit4/external platform/modules/ext junit-4.8.2.jar $JAVADIR/hamcrest-core.jar libs.junit4/external platform/modules/ext hamcrest-core.jar $JAVADIR/antlr3-runtime.jar libs.antlr3.runtime/external ide/modules/ext antlr-runtime-3.1.3.jar $JAVADIR/commons-codec.jar libs.commons_codec/external ide/modules/ext apache-commons-codec-1.3.jar $JAVADIR/bytelist.jar libs.bytelist/external ide/modules/ext bytelist-0.1.jar $JAVADIR/commons-logging.jar libs.commons_logging/external ide/modules/ext commons-logging-1.1.jar $JAVADIR/commons-net.jar libs.commons_net/external ide/modules/ext commons-net-1.4.1.jar $JAVADIR/flute.jar css.visual/external ide/modules/ext flute-1.3.jar $JAVADIR/freemarker.jar libs.freemarker/external ide/modules/ext freemarker-2.3.8.jar $JAVADIR/ini4j.jar libs.ini4j/external ide/modules/ext ini4j-0.5.1.jar $JAVADIR/oro.jar libs.jakarta_oro/external ide/modules/ext jakarta-oro-2.0.8.jar $JAVADIR/jsch.jar libs.jsch/external ide/modules/ext jsch-0.1.44.jar $JAVADIR/jvyamlb.jar libs.jvyamlb/external ide/modules/ext jvyamlb-0.2.3.jar $JAVADIR/jzlib.jar libs.jzlib/external ide/modules/ext jzlib-1.0.7.jar $JAVADIR/lucene-core.jar libs.lucene/external ide/modules/ext lucene-core-3.0.3.jar $JAVADIR/xml-resolver-1.2.jar o.apache.xml.resolver/external ide/modules/ext resolver-1.2.jar $JAVADIR/sac.jar css.visual/external ide/modules/ext sac-1.3.jar $JAVADIR/servlet-api-2.5.jar servletapi/external ide/modules/ext servlet-2.2.jar $JAVADIR/svnClientAdapter.jar libs.svnClientAdapter/external ide/modules/ext svnClientAdapter-main-1.6.13.jar $JAVADIR/svn-javahl.jar libs.svnClientAdapter.javahl/external ide/modules/ext svnjavahl-1.6.0.jar $JAVADIR/svnkit.jar libs.svnClientAdapter.svnkit/external ide/modules/ext svnkit-1.3.4.jar $JAVADIR/svnkit-javahl.jar libs.svnClientAdapter.svnkit/external ide/modules/ext svnkit-javahl.jar $JAVADIR/swingx1.jar libs.swingx/external ide/modules/ext swingx-0.9.5.jar $JAVADIR/trilead-ssh2.jar libs.svnClientAdapter.svnkit/external ide/modules/ext trilead.jar $JAVADIR/simple-validation.jar swing.validation/external ide/modules/ext ValidationAPI.jar $JAVADIR/xercesImpl.jar libs.xerces/external ide/modules/ext xerces-2.8.0.jar $JAVADIR/jaxp-1.4.jar libs.xerces/external ide/modules/ext jaxp-1.4.jar $JAVADIR/postgresql-jdbc3.jar db.drivers/external ide/modules/ext postgresql-8.3-603.jdbc3.jar $JAVADIR/mysql-connector-java.jar db.drivers/external ide/modules/ext mysql-connector-java-5.1.13-bin.jar $JAVADIR/bsaf.jar swingapp/external java/modules/ext appframework-1.0.3.jar $JAVADIR/beansbinding.jar o.jdesktop.beansbinding/external java/modules/ext beansbinding-1.2.1.jar $JAVADIR/cglib.jar libs.cglib/external java/modules/ext cglib-2.2.jar $JAVADIR/javac-api.jar libs.javacapi/external java/modules/ext javac-api-nb-7.0-b07.jar $JAVADIR/javac-impl.jar libs.javacimpl/external java/modules/ext javac-impl-nb-7.0-b07.jar $JAVA_HOME/jre/lib/rt.jar swingapp/external java/modules/ext swing-worker-1.1.jar $JAVADIR/junit.jar junitlib/external java/modules/ext junit-3.8.2.jar debian/libnb-org-openide-modules-java.lintian-overrides0000664000000000000000000000022511720272354020433 0ustar # Netbeans has it's own way to set the classpath, and it breaks things if we # set it separately. libnb-org-openide-modules-java: missing-classpath debian/libnb-platform-devel-java.lintian-overrides0000664000000000000000000000062211720272354017477 0ustar # Netbeans builds lots of codeless jars on purpose, so don't warn us about them libnb-platform-devel-java: codeless-jar # This is a library package in the sense that it doesn't by itself provide an # application. But the jar files don't live in /usr/share/java since they are # specific to the NetBeans platform and need to live in a "cluster" libnb-platform-devel-java: javalib-but-no-public-jars debian/libnb-apisupport3-java.lintian-overrides0000664000000000000000000000063711720272354017055 0ustar # Netbeans builds lots of codeless jars on purpose, so don't warn us about them libnb-apisupport3-java: codeless-jar # Netbeans has it's own way to set the classpath, and it breaks things if we # set it separately. libnb-apisupport3-java: missing-classpath # It is a library of sorts, although it installs as a netbeans cluster rather # than in /usr/share/java libnb-apisupport3-java: javalib-but-no-public-jars debian/netbeans.desktop0000664000000000000000000000040711720272354012366 0ustar [Desktop Entry] Name=NetBeans IDE 7.0.1 Comment=Integrated Development Environment TryExec=/usr/bin/netbeans Exec=/usr/bin/netbeans Icon=/usr/share/netbeans/7.0.1/nb/netbeans.png Categories=Development;IDE;Java; Terminal=false Type=Application StartupNotify=true debian/patches/0000775000000000000000000000000011720272354010622 5ustar debian/patches/netbeans~o.a.tools.ant.patch0000664000000000000000000000310511720272354016155 0ustar We're using packaged ant, so no need to unzip. Index: netbeans-7.0+dfsg1/o.apache.tools.ant.module/external/build.xml =================================================================== --- netbeans-7.0+dfsg1.orig/o.apache.tools.ant.module/external/build.xml 2011-07-04 10:21:45.664204539 +0100 +++ netbeans-7.0+dfsg1/o.apache.tools.ant.module/external/build.xml 2011-07-04 10:21:58.674204440 +0100 @@ -45,7 +45,7 @@ --> - + Index: netbeans-7.0+dfsg1/o.apache.tools.ant.module/build.xml =================================================================== --- netbeans-7.0+dfsg1.orig/o.apache.tools.ant.module/build.xml 2011-07-04 10:22:14.294202648 +0100 +++ netbeans-7.0+dfsg1/o.apache.tools.ant.module/build.xml 2011-07-04 10:23:16.714203155 +0100 @@ -79,14 +79,14 @@ - + debian/patches/netbeans~no-rhino.patch0000664000000000000000000000333311720272354015314 0ustar Build without Rhino. Index: netbeans-7.0.1+dfsg1/html.editor/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/html.editor/nbproject/project.xml 2011-07-28 20:45:36.000000000 +0100 +++ netbeans-7.0.1+dfsg1/html.editor/nbproject/project.xml 2011-08-02 23:39:34.664164190 +0100 @@ -333,9 +333,9 @@ unit - + org.netbeans.api.xml Index: netbeans-7.0.1+dfsg1/web.jsf.editor/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.jsf.editor/nbproject/project.xml 2011-07-28 20:47:16.000000000 +0100 +++ netbeans-7.0.1+dfsg1/web.jsf.editor/nbproject/project.xml 2011-08-02 23:39:34.664164190 +0100 @@ -404,9 +404,9 @@ unit - + org.netbeans.libs.junit4 debian/patches/netbeans~svnclient.patch0000664000000000000000000001310511720272354015566 0ustar Use the packaged SVN client libraries. Index: netbeans-7.0+dfsg1/libs.svnClientAdapter/nbproject/project.xml =================================================================== --- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter/nbproject/project.xml 2011-06-29 20:36:57.542215632 +0100 +++ netbeans-7.0+dfsg1/libs.svnClientAdapter/nbproject/project.xml 2011-06-29 20:37:22.709715583 +0100 @@ -81,6 +81,8 @@ org.netbeans.libs.svnclientadapter org.tigris.subversion.svnclientadapter org.tigris.subversion.svnclientadapter.utils + org.tigris.subversion.svnclientadapter.javahl + org.tigris.subversion.svnclientadapter.svnkit ext/svnClientAdapter-main-1.6.13.jar Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.xml =================================================================== --- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.javahl/nbproject/project.xml 2011-06-29 20:36:57.512215360 +0100 +++ netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.xml 2011-06-29 20:36:59.420548683 +0100 @@ -95,8 +95,8 @@ - ext/svnClientAdapter-javahl-1.6.13.jar - external/svnClientAdapter-javahl-1.6.13.jar + ext/svnClientAdapter-main-1.6.13.jar + ext/svnjavahl-1.6.0.jar Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.properties =================================================================== --- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.javahl/nbproject/project.properties 2011-06-29 20:36:57.482215322 +0100 +++ netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.properties 2011-06-29 20:36:59.430548565 +0100 @@ -43,7 +43,7 @@ is.eager=true javac.source=1.6 -release.external/svnClientAdapter-javahl-1.6.13.jar=modules/ext/svnClientAdapter-javahl-1.6.13.jar +#release.external/svnClientAdapter-javahl-1.6.13.jar=modules/ext/svnClientAdapter-javahl-1.6.13.jar release.external/svnjavahl-1.6.0.jar=modules/ext/svnjavahl-1.6.0.jar # Hidden class found: org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments in method protected byte[] org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine.execBytes(org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments,boolean) throws java.lang.Exception in class org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.xml =================================================================== --- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.svnkit/nbproject/project.xml 2011-06-29 20:40:32.111381291 +0100 +++ netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.xml 2011-06-29 20:44:53.912215278 +0100 @@ -95,18 +95,18 @@ - + ext/svnkit-1.3.4.jar external/svnkit-1.3.4.jar - + ext/svnkit-javahl.jar external/svnkit-javahl.jar Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.properties =================================================================== --- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.svnkit/nbproject/project.properties 2011-06-29 20:41:04.219715631 +0100 +++ netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.properties 2011-06-29 20:45:11.059716185 +0100 @@ -43,10 +43,10 @@ is.eager=true javac.source=1.6 -release.external/svnClientAdapter-svnkit-1.6.13.jar=modules/ext/svnClientAdapter-svnkit-1.6.13.jar +#release.external/svnClientAdapter-svnkit-1.6.13.jar=modules/ext/svnClientAdapter-svnkit-1.6.13.jar release.external/svnkit-javahl.jar=modules/ext/svnkit-javahl.jar release.external/svnkit-1.3.4.jar=modules/ext/svnkit-1.3.4.jar -release.external/sqljet-1.0.3.jar=modules/ext/sqljet-1.0.3.jar +#release.external/sqljet-1.0.3.jar=modules/ext/sqljet-1.0.3.jar release.external/trilead.jar=modules/ext/trilead.jar sigtest.gen.fail.on.error=false debian/patches/netbeans~nocopy.patch0000664000000000000000000000541611720272354015076 0ustar Don't copy some files, since we don't actually include them. Index: netbeans-7.0.1+dfsg1/css.editor/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/css.editor/nbproject/project.properties 2011-07-28 20:45:12.000000000 +0100 +++ netbeans-7.0.1+dfsg1/css.editor/nbproject/project.properties 2011-08-02 23:38:53.533331296 +0100 @@ -40,7 +40,7 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. -release.external/css21-spec.zip=docs/css21-spec.zip +#release.external/css21-spec.zip=docs/css21-spec.zip jnlp.indirect.jars=docs/css21-spec.zip javac.compilerargs=-Xlint -Xlint:-serial Index: netbeans-7.0.1+dfsg1/html.editor/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/html.editor/nbproject/project.properties 2011-07-28 20:45:36.000000000 +0100 +++ netbeans-7.0.1+dfsg1/html.editor/nbproject/project.properties 2011-08-02 23:38:53.533331296 +0100 @@ -40,7 +40,7 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. -release.external/html-4.01.zip=docs/html-4.01.zip +#release.external/html-4.01.zip=docs/html-4.01.zip javac.compilerargs=-Xlint:unchecked javac.source=1.6 Index: netbeans-7.0.1+dfsg1/o.jdesktop.beansbinding/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.jdesktop.beansbinding/nbproject/project.properties 2011-07-28 20:46:16.000000000 +0100 +++ netbeans-7.0.1+dfsg1/o.jdesktop.beansbinding/nbproject/project.properties 2011-08-02 23:39:26.623331369 +0100 @@ -42,6 +42,6 @@ is.autoload=true release.external/beansbinding-1.2.1.jar=modules/ext/beansbinding-1.2.1.jar -release.external/beansbinding-1.2.1-doc.zip=docs/beansbinding-1.2.1-doc.zip -jnlp.indirect.jars=docs/beansbinding-1.2.1-doc.zip +#release.external/beansbinding-1.2.1-doc.zip=docs/beansbinding-1.2.1-doc.zip +#jnlp.indirect.jars=docs/beansbinding-1.2.1-doc.zip spec.version.base=1.11.1 Index: netbeans-7.0.1+dfsg1/derby/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/derby/nbproject/project.properties 2011-08-03 22:22:06.911925268 +0100 +++ netbeans-7.0.1+dfsg1/derby/nbproject/project.properties 2011-08-03 22:22:20.671092067 +0100 @@ -43,6 +43,6 @@ javac.source=1.6 javac.compilerargs=-Xlint:unchecked -release.external/derbysampledb.zip=modules/ext/derbysampledb.zip -jnlp.indirect.jars=\ - modules/ext/derbysampledb.zip +#release.external/derbysampledb.zip=modules/ext/derbysampledb.zip +#jnlp.indirect.jars=\ +# modules/ext/derbysampledb.zip debian/patches/netbeans~cluster-properties.patch0000664000000000000000000001272411720272354017442 0ustar Modify the list of modules included in the Debian package. Index: netbeans/nbbuild/cluster.properties =================================================================== --- netbeans.orig/nbbuild/cluster.properties 2011-09-10 11:16:30.140862511 +0100 +++ netbeans/nbbuild/cluster.properties 2011-09-10 11:17:31.649195606 +0100 @@ -95,9 +95,7 @@ clusters.config.java.list=\ ${clusters.config.platform.list},\ nb.cluster.ide,\ - nb.cluster.websvccommon,\ nb.cluster.java,\ - nb.cluster.profiler,\ nb.cluster.nb clusters.config.enterprise.list=\ @@ -218,9 +216,6 @@ api.debugger,\ api.java.classpath,\ api.xml,\ - bugtracking,\ - bugtracking.bridge,\ - bugzilla,\ core.browser,\ core.ide,\ csl.api,\ @@ -266,7 +261,6 @@ editor.util,\ extbrowser,\ extexecution,\ - extexecution.destroy,\ glassfish.common,\ gototest,\ gsf.codecoverage,\ @@ -275,18 +269,11 @@ html.editor,\ html.editor.lib,\ html.lexer,\ - html.parser,\ - html.validation,\ - httpserver,\ hudson,\ hudson.mercurial,\ hudson.subversion,\ ide.kit,\ image,\ - javascript.editing,\ - javascript.hints,\ - javascript.kit,\ - javascript.refactoring,\ jellytools.ide,\ jumpto,\ languages,\ @@ -298,8 +285,6 @@ lib.cvsclient,\ lib.terminalemulator,\ libs.antlr3.runtime,\ - libs.bugtracking,\ - libs.bugzilla,\ libs.bytelist,\ libs.commons_codec,\ libs.commons_logging,\ @@ -307,12 +292,10 @@ libs.freemarker,\ libs.ini4j,\ libs.jakarta_oro,\ - libs.jaxb,\ libs.jsch,\ libs.jvyamlb,\ libs.jzlib,\ libs.lucene,\ - libs.smack,\ libs.svnClientAdapter,\ libs.svnClientAdapter.javahl,\ libs.svnClientAdapter.svnkit,\ @@ -321,7 +304,6 @@ localhistory,\ mercurial,\ o.apache.xml.resolver,\ - o.mozilla.rhino.patched,\ o.n.swing.dirchooser,\ o.openidex.util,\ options.editor,\ @@ -344,7 +326,6 @@ spellchecker.apimodule,\ spellchecker.bindings.htmlxml,\ spellchecker.bindings.properties,\ - spellchecker.dictionary_en,\ spellchecker.kit,\ spi.debugger.ui,\ spi.editor.hints,\ @@ -373,7 +354,6 @@ xml.axi,\ xml.catalog,\ xml.core,\ - xml.jaxb.api,\ xml.lexer,\ xml.multiview,\ xml.retriever,\ @@ -393,7 +373,6 @@ nb.cluster.java.depends=\ nb.cluster.ide,\ nb.cluster.platform,\ - nb.cluster.websvccommon,\ nb.cluster.harness nb.cluster.java=\ ant.browsetask,\ @@ -413,23 +392,14 @@ form,\ form.j2ee,\ form.kit,\ - hibernate,\ - hibernatelib,\ hudson.ant,\ - hudson.maven,\ i18n,\ i18n.form,\ j2ee.core.utilities,\ - j2ee.eclipselink,\ - j2ee.eclipselinkmodelgen,\ - j2ee.jpa.refactoring,\ - j2ee.jpa.verification,\ j2ee.metadata,\ j2ee.metadata.model.support,\ j2ee.persistence,\ - j2ee.persistence.kit,\ j2ee.persistenceapi,\ - j2ee.toplinklib,\ java.api.common,\ java.debug,\ java.editor,\ @@ -459,34 +429,13 @@ libs.cglib,\ libs.javacapi,\ libs.javacimpl,\ - libs.springframework,\ - maven,\ - maven.coverage,\ - maven.embedder,\ - maven.grammar,\ - maven.graph,\ - maven.hints,\ - maven.indexer,\ - maven.junit,\ - maven.kit,\ - maven.model,\ - maven.osgi,\ - maven.persistence,\ - maven.repository,\ - maven.search,\ - maven.spring,\ o.apache.tools.ant.module,\ o.jdesktop.beansbinding,\ projectimport.eclipse.core,\ projectimport.eclipse.j2se,\ refactoring.java,\ spellchecker.bindings.java,\ - spring.beans,\ swingapp,\ - websvc.jaxws21,\ - websvc.jaxws21api,\ - websvc.saas.codegen.java,\ - xml.jaxb,\ xml.tools.java validation.nb.cluster.java=\ java.kit @@ -500,15 +449,11 @@ nb.cluster.apisupport=\ apisupport.ant,\ apisupport.crudsample,\ - apisupport.feedreader,\ - apisupport.installer,\ - apisupport.installer.maven,\ apisupport.kit,\ apisupport.osgidemo,\ apisupport.paintapp,\ apisupport.project,\ - apisupport.refactoring,\ - maven.apisupport + apisupport.refactoring nb.cluster.enterprise.dir=enterprise nb.cluster.enterprise.depends=\ @@ -632,7 +577,6 @@ nb.cluster.harness nb.cluster.nb=\ autoupdate.pluginimporter,\ - bugzilla.exceptionreporter,\ ide.branding,\ ide.branding.kit,\ lib.uihandler,\ @@ -917,7 +861,6 @@ nb.cluster.stableuc=\ apisupport.apidocs,\ apisupport.tc.cobertura,\ - bugtracking.kenai,\ db.mysql.sakila,\ j2ee.sun.appsrv81,\ jconsole,\ @@ -926,7 +869,6 @@ jmx.common,\ junitlib,\ kenai,\ - kenai.maven,\ kenai.ui,\ libs.jira,\ libs.svnjavahlwin32,\ debian/patches/netbeans~include-junit.patch0000664000000000000000000010000211720272354016324 0ustar Include the junitlib module as part of the java cluster. This provides the necessary references to the junit jars (junit.jar and junit4.jar) in order to use the junit testing framework. This module would otherwise have to be downloaded from the Netbeans site. Index: netbeans/nbbuild/cluster.properties =================================================================== --- netbeans.orig/nbbuild/cluster.properties 2011-12-22 19:48:15.312713133 +0000 +++ netbeans/nbbuild/cluster.properties 2011-12-22 19:48:15.472713052 +0000 @@ -426,6 +426,7 @@ jellytools,\ jellytools.java,\ junit,\ + junitlib,\ libs.cglib,\ libs.javacapi,\ libs.javacimpl,\ @@ -867,7 +868,6 @@ jira,\ jmx,\ jmx.common,\ - junitlib,\ kenai,\ kenai.ui,\ libs.jira,\ Index: netbeans/junitlib/build.xml =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/build.xml 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,6 @@ + + + + + + Index: netbeans/junitlib/manifest.mf =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/manifest.mf 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: org.netbeans.modules.junitlib +OpenIDE-Module-Layer: org/netbeans/modules/junitlib/layer.xml +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/junitlib/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + Index: netbeans/junitlib/src/org/netbeans/modules/junitlib/junit-3.8.2.xml =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/src/org/netbeans/modules/junitlib/junit-3.8.2.xml 2011-12-22 20:02:43.922716077 +0000 @@ -0,0 +1,15 @@ + + + + junit + j2se + org.netbeans.modules.junitlib.Bundle + + classpath + jar:nbinst://org.netbeans.modules.junitlib/modules/ext/junit-3.8.2.jar!/ + + + javadoc + file:/usr/share/doc/junit-doc/doc/api/ + + Index: netbeans/junitlib/src/org/netbeans/modules/junitlib/layer.xml =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/src/org/netbeans/modules/junitlib/layer.xml 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + Index: netbeans/junitlib/src/org/netbeans/modules/junitlib/Bundle.properties =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/src/org/netbeans/modules/junitlib/Bundle.properties 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,7 @@ +OpenIDE-Module-Name=JUnit +OpenIDE-Module-Display-Category=Java SE +OpenIDE-Module-Short-Description=Bundles the JUnit testing library. +OpenIDE-Module-Long-Description=\ + Includes the JUnit unit testing library and corresponding library definitions. 3.x and 4.x versions are both included. +junit=JUnit 3.8.2 +junit_4=JUnit 4.8.2 Index: netbeans/junitlib/src/org/netbeans/modules/junitlib/junit-4.8.2.xml =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/src/org/netbeans/modules/junitlib/junit-4.8.2.xml 2011-12-22 20:17:04.572712891 +0000 @@ -0,0 +1,15 @@ + + + + junit_4 + j2se + org.netbeans.modules.junitlib.Bundle + + classpath + jar:nbinst://org.netbeans.libs.junit4/modules/ext/junit-4.8.2.jar!/ + + + javadoc + file:/usr/share/doc/junit4/api/ + + Index: netbeans/junitlib/external/junit-3.8.2-license.txt =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/external/junit-3.8.2-license.txt 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,220 @@ +Name: JUnit +Version: 3.8.2 +License: CPL-1.0 +OSR: 1221 +Origin: http://www.junit.org/index.htm +Description: JUnit is a regression testing framework +Files: junit-3.8.2-api.zip, junit-3.8.2.jar + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and such +derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed +Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. +This patent license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other combinations +which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to +its Contributions set forth herein, no assurances are provided by any +Contributor that the Program does not infringe the patent or other intellectual +property rights of any other entity. Each Contributor disclaims any liability to +Recipient for claims brought by any other entity based on infringement of +intellectual property rights or otherwise. As a condition to exercising the +rights and licenses granted hereunder, each Recipient hereby assumes sole +responsibility to secure any other intellectual property rights needed, if any. +For example, if a third party patent license is required to allow Recipient to +distribute the Program, it is Recipient's responsibility to acquire that license +before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its +own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title and +non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by +that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, +and informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the +Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to +control, and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may participate in +any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its exercise of +rights under this Agreement, including but not limited to the risks and costs of +program errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to +a patent applicable to software (including a cross-claim or counterclaim in a +lawsuit), then any patent licenses granted by that Contributor to such Recipient +under this Agreement shall terminate as of the date such litigation is filed. In +addition, if Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the Program +itself (excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +IBM is the initial Agreement Steward. IBM may assign the responsibility to serve +as the Agreement Steward to a suitable separate entity. Each new version of the +Agreement will be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the Agreement +under which it was received. In addition, after a new version of the Agreement +is published, Contributor may elect to distribute the Program (including its +Contributions) under the new version. Except as expressly stated in Sections +2(a) and 2(b) above, Recipient receives no rights or licenses to the +intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial in +any resulting litigation. Index: netbeans/junitlib/external/junit-4.8.2-license.txt =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/external/junit-4.8.2-license.txt 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,220 @@ +Name: JUnit +Version: 4.8.2 +License: CPL-1.0 +OSR: 6529 +Origin: http://www.junit.org/index.htm +Description: JUnit is a regression testing framework +Files: junit-4.8.2-api.zip, junit-4.8.2-src.jar + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and such +derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed +Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. +This patent license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the +Licensed Patents. The patent license shall not apply to any other combinations +which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to +its Contributions set forth herein, no assurances are provided by any +Contributor that the Program does not infringe the patent or other intellectual +property rights of any other entity. Each Contributor disclaims any liability to +Recipient for claims brought by any other entity based on infringement of +intellectual property rights or otherwise. As a condition to exercising the +rights and licenses granted hereunder, each Recipient hereby assumes sole +responsibility to secure any other intellectual property rights needed, if any. +For example, if a third party patent license is required to allow Recipient to +distribute the Program, it is Recipient's responsibility to acquire that license +before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its +own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title and +non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by +that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, +and informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the +Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to +control, and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may participate in +any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its exercise of +rights under this Agreement, including but not limited to the risks and costs of +program errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to +a patent applicable to software (including a cross-claim or counterclaim in a +lawsuit), then any patent licenses granted by that Contributor to such Recipient +under this Agreement shall terminate as of the date such litigation is filed. In +addition, if Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the Program +itself (excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue and +survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +IBM is the initial Agreement Steward. IBM may assign the responsibility to serve +as the Agreement Steward to a suitable separate entity. Each new version of the +Agreement will be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the Agreement +under which it was received. In addition, after a new version of the Agreement +is published, Contributor may elect to distribute the Program (including its +Contributions) under the new version. Except as expressly stated in Sections +2(a) and 2(b) above, Recipient receives no rights or licenses to the +intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial in +any resulting litigation. Index: netbeans/junitlib/release/modules/ext/junit-3.8.2.jar.external =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/release/modules/ext/junit-3.8.2.jar.external 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,3 @@ +CRC:857334496 +URL:m2:/junit:junit:3.8.2:jar +URL:http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar Index: netbeans/junitlib/release/docs/junit-3.8.2-api.zip.external =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/release/docs/junit-3.8.2-api.zip.external 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,3 @@ +CRC:1744174913 +URL:m2:/junit:junit:3.8.2:jar:javadoc +URL:http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2-javadoc.jar Index: netbeans/junitlib/release/docs/junit-4.8.2-api.zip.external =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/release/docs/junit-4.8.2-api.zip.external 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,3 @@ +CRC:1619551478 +URL:m2:/junit:junit:4.8.2:jar:javadoc +URL:http://repo1.maven.org/maven2/junit/junit/4.8.2/junit-4.8.2-javadoc.jar Index: netbeans/junitlib/nbproject/project.properties =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/nbproject/project.properties 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,7 @@ +javac.source=1.6 +javac.compilerargs=-Xlint -Xlint:-serial +release.external/junit-3.8.2.jar=modules/ext/junit-3.8.2.jar +#release.external/junit-3.8.2-api.zip=docs/junit-3.8.2-api.zip +#release.external/junit-4.8.2-api.zip=docs/junit-4.8.2-api.zip +#release.external/junit-4.8.2-src.jar=docs/junit-4.8.2-src.jar +nbm.target.cluster=java Index: netbeans/junitlib/nbproject/project.xml =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ netbeans/junitlib/nbproject/project.xml 2011-12-22 19:48:15.472713052 +0000 @@ -0,0 +1,18 @@ + + + org.netbeans.modules.apisupport.project + + + org.netbeans.modules.junitlib + + + org.netbeans.libs.junit4 + + 1.13 + + + + + + + debian/patches/netbeans~db.patch0000664000000000000000000000521011720272354014144 0ustar Build the db modules against swingx1 and using the packaged javacc. Index: netbeans/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java =================================================================== --- netbeans.orig/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java 2011-09-10 11:21:52.311695694 +0100 +++ netbeans/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java 2011-09-10 11:23:22.239194373 +0100 @@ -70,6 +70,7 @@ import org.jdesktop.swingx.renderer.CheckBoxProvider; import org.jdesktop.swingx.renderer.FormatStringValue; import org.jdesktop.swingx.renderer.JRendererCheckBox; +import org.jdesktop.swingx.renderer.StringValues; import org.jdesktop.swingx.table.DatePickerCellEditor; import org.netbeans.modules.db.dataview.meta.DBColumn; import org.netbeans.modules.db.dataview.output.DataView; @@ -141,9 +142,9 @@ protected void setDefaultCellRenderers() { setDefaultRenderer(Object.class, new ResultSetCellRenderer()); setDefaultRenderer(String.class, new ResultSetCellRenderer()); - setDefaultRenderer(Number.class, new ResultSetCellRenderer(FormatStringValue.NUMBER_TO_STRING, JLabel.RIGHT)); + setDefaultRenderer(Number.class, new ResultSetCellRenderer(StringValues.NUMBER_TO_STRING, JLabel.RIGHT)); setDefaultRenderer(Boolean.class, new ResultSetCellRenderer(new CheckBoxProvider())); - setDefaultRenderer(java.sql.Date.class, new ResultSetCellRenderer(FormatStringValue.DATE_TO_STRING)); + setDefaultRenderer(java.sql.Date.class, new ResultSetCellRenderer(StringValues.DATE_TO_STRING)); setDefaultRenderer(java.sql.Time.class, new ResultSetCellRenderer(ResultSetCellRenderer.TIME_TO_STRING)); setDefaultRenderer(java.sql.Timestamp.class, new ResultSetCellRenderer(ResultSetCellRenderer.DATETIME_TO_STRING)); setDefaultRenderer(java.util.Date.class, new ResultSetCellRenderer(ResultSetCellRenderer.DATETIME_TO_STRING)); Index: netbeans/db.sql.visualeditor/build.xml =================================================================== --- netbeans.orig/db.sql.visualeditor/build.xml 2011-09-10 11:29:36.230029068 +0100 +++ netbeans/db.sql.visualeditor/build.xml 2011-09-10 11:31:49.299196227 +0100 @@ -16,9 +16,9 @@ - + + javacchome="/usr/share/java/"> debian/patches/netbeans~empty-binaries-list.patch0000664000000000000000000012552511720272354017474 0ustar Empty all the binaries-list files so nothing gets downloaded. Index: netbeans-7.0.1+dfsg1/apisupport.feedreader/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/apisupport.feedreader/external/binaries-list 2011-07-28 20:44:52.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar -EA66BB8EBA805BAD567DB5A6730F96AC89062601 rome-0.6.jar -7408D747109A701926646E859C8907D3A7C9B26E rome-fetcher-0.6.jar Index: netbeans-7.0.1+dfsg1/apisupport.harness/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/apisupport.harness/external/binaries-list 2011-07-28 20:44:52.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -D4EF66C1CC8A5B3C97E0CC7C210227AAEC1F1086 jsearch-2.0_05.jar -A806D99716C5E9441BFD8B401176FDDEFC673022 bindex-2.2.jar Index: netbeans-7.0.1+dfsg1/cnd.modelimpl/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/cnd.modelimpl/external/binaries-list 2011-07-28 20:45:04.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -296C195B720404C2683BA2F65E2A423DD0611B8B open-fortran-parser-0.7.1.2.zip - Index: netbeans-7.0.1+dfsg1/core.nativeaccess/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/core.nativeaccess/external/binaries-list 2011-07-28 20:45:12.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -AF109BEA46056EF1D09172A96E968ADFA8CE74F1 platform-3.2.7.jar Index: netbeans-7.0.1+dfsg1/css.editor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/css.editor/external/binaries-list 2011-07-28 20:45:12.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -901D8F815922C435D985DA3814D20E34CC7622CB css21-spec.zip \ No newline at end of file Index: netbeans-7.0.1+dfsg1/css.visual/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/css.visual/external/binaries-list 2011-07-28 20:45:14.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -B7D59DC172005598B55699B1A75605B13C14F1FD flute-1.3.jar -3764096F289F38736CCC6755D97A5848FCE7D125 sac-1.3.jar Index: netbeans-7.0.1+dfsg1/db.drivers/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/db.drivers/external/binaries-list 2011-07-28 20:45:14.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -631249C6055BE15A1FAB26B3C28A3E5C6F3D97E0 mysql-connector-java-5.1.13-bin.jar -33D531C3C53055DDCBEA3D88BFA093466FFEF924 postgresql-8.3-603.jdbc3.jar - Index: netbeans-7.0.1+dfsg1/db.sql.visualeditor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/db.sql.visualeditor/external/binaries-list 2011-07-28 20:45:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -EE416CB5D6AA88473EFE487F42DC1410360F7948 javacc-3.2.jar Index: netbeans-7.0.1+dfsg1/db/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/db/external/binaries-list 2011-07-28 20:45:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -F787C9B484CD7526F866C21D8925C4DACE467F8A derby-10.2.2.0.jar -97771BE04E7452FC197EB875D2591A7E91F274D0 derby-10.2.2.0.zip Index: netbeans-7.0.1+dfsg1/dlight.dtrace/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/dlight.dtrace/external/binaries-list 2011-07-28 20:45:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -F1AF5929CD612475CCF186F69E268F0CAAA2A90E dtracectrl-0.1.zip Index: netbeans-7.0.1+dfsg1/dlight.libs.h2/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/dlight.libs.h2/external/binaries-list 2011-07-28 20:45:20.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -623DE5A3A60FEA313099D7C42256B146E2BEE9B2 h2-1.0.79.jar Index: netbeans-7.0.1+dfsg1/extexecution.destroy/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/extexecution.destroy/external/binaries-list 2011-07-28 20:45:26.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -C9757EFB2CFBA523A7375A78FA9ECFAF0D0AC505 winp-1.14-patched.jar -2E07375E5CA3A452472F0E87FB33F243F7A5C08C libpam4j-1.1.jar -E66876EB5F33AA0E57F035F1AADD8C44FEAE7FCB processtreekiller-1.0.1.jar -A8762D07E76CFDE2395257A5DA47BA7C1DBD3DCE commons-io-1.4.jar - Index: netbeans-7.0.1+dfsg1/groovy.editor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/groovy.editor/external/binaries-list 2011-07-28 20:45:32.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -559C961A6CE793FAC94C8040253EA1FBD32B668B groovy-all-1.6.4.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/hibernatelib/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/hibernatelib/external/binaries-list 2011-07-28 20:45:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -C8A5E0D558EA7E7349F9D32B838553D5E7DD214F hibernate-3.2.5-lib.zip Index: netbeans-7.0.1+dfsg1/html.editor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/html.editor/external/binaries-list 2011-07-28 20:45:36.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -23123BB29025254556B6E573023FCDF0F6715A66 html-4.01.zip Index: netbeans-7.0.1+dfsg1/html.parser/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/html.parser/external/binaries-list 2011-07-28 20:45:38.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -D528B44AE7593D2275927396BF930B28078C5220 htmlparser-1.2.1.jar -4388C34B9F085A42FBEA06C5B00FDF0A251171EC html5doc.zip -E796ACB5645C08FF0F9D2A6A2F76673CE1217EBB icu4j-4_0.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/html.validation/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/html.validation/external/binaries-list 2011-07-28 20:45:38.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -2D859791FBF7D880591864BD4004D8442A8A3B81 commons-logging-1.1.1.jar -DA6E46D20241CCC81EDB3525A241114B95177FD7 commons-logging-api-1.1.1.jar -77DB1AFF3C0730C144D30C9935A1CD8DCD2488A9 html5-datatypes.jar -A2862B7795EF0E0F0716BEC84528FA3B629E479C io-xml-util.jar -0DCC973606CBD9737541AA5F3E76DED6E3F4D0D0 iri.jar -C0C5653D2200F2BD2E834B26DFDBC830D07FA0F4 jing.jar -71F7D2D5A3CF17CECBD15049A856BC0245C95C56 js.jar -F0A0D2E29ED910808C33135A3A5A51BBA6358F7B log4j-1.2.15.jar -A1C0ED8C43A306E3FB7676E7463204B9DA9BE290 non-schema.jar -7A5A7DF07297A86A944D4D0562C685585B0734EF validator.jar -4A7F02539072972FB8FED9C734AF40B7108B60B0 saxon9B.jar -FACC6D84B0B0A650B1D44FED941E9ADD9F326862 isorelax20041111.jar Index: netbeans-7.0.1+dfsg1/httpserver/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/httpserver/external/binaries-list 2011-07-28 20:45:38.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -CD5B5996B46CB8D96C8F0F89A7A734B3C01F3DF7 tomcat-webserver-3.2.jar Index: netbeans-7.0.1+dfsg1/j2ee.dd/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2ee.dd/external/binaries-list 2011-07-28 20:45:44.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -D2F2B34B7D0A13256D491B14590ED23CA0E49B46 javaee-api-5.jar Index: netbeans-7.0.1+dfsg1/j2ee.eclipselink/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2ee.eclipselink/external/binaries-list 2011-07-28 20:45:46.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -8C9BFFBCB34DB6E9C9C03413623F05375D44CE49 eclipselink-2.2.0.jar -3BCA561B1B7B284B3D3C097F92A9CD47FF485058 eclipselink-javax.persistence-2.0.jar Index: netbeans-7.0.1+dfsg1/j2ee.eclipselinkmodelgen/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2ee.eclipselinkmodelgen/external/binaries-list 2011-07-28 20:45:46.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -263D76EEB2FA35AE240DE31CFDE83C04096AE19E eclipselink-jpa-modelgen-2.2.0.jar Index: netbeans-7.0.1+dfsg1/j2ee.platform/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2ee.platform/external/binaries-list 2011-07-28 20:45:48.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -DC9A229C4AB1788D0C20D937A82FB64CE2911171 javaee6-doc-api.zip Index: netbeans-7.0.1+dfsg1/j2ee.toplinklib/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2ee.toplinklib/external/binaries-list 2011-07-28 20:45:52.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -59FAD2A4D4A1CFECED8149854EEEC3A7B9668927 glassfish-persistence-v2-build-58g.jar -907363E301E2279930C82BEB466BF2053C6E993B glassfish-persistence-v2ur1-build-09d.jar Index: netbeans-7.0.1+dfsg1/j2eeapis/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2eeapis/external/binaries-list 2011-07-28 20:45:52.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -EC24BF46E047E735ED802DFA8B9FCA2ED8FB11B0 jsr88javax.jar Index: netbeans-7.0.1+dfsg1/j2me.cdc.project.ricoh/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/j2me.cdc.project.ricoh/external/binaries-list 2011-07-28 20:45:52.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -397F4731A9F9B6EB1907E224911C77EA3AA27A8B commons-codec-1.3.jar -336A280D178BB957E5233189F0F32E067366C4E5 commons-httpclient-3.0.jar -793B8D020D81284E0B67FB635C17026121F06433 RicohAntTasks-2.0.jar Index: netbeans-7.0.1+dfsg1/javacard.apdu.io/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/javacard.apdu.io/external/binaries-list 2011-07-28 20:45:58.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9C1A8BC9D3270D184F1D1BCC5F60AA81D46E1ADF apduio.jar Index: netbeans-7.0.1+dfsg1/javacard.ri.bundle/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/javacard.ri.bundle/external/binaries-list 2011-07-28 20:46:00.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -6243337E93F5841D4FFB404011AA076BFEB1590A javacard_ri.zip Index: netbeans-7.0.1+dfsg1/javacard.ri.platform/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/javacard.ri.platform/external/binaries-list 2011-07-28 20:46:00.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -33DCFAE258453BDD3D8A042F6ECF80656A82B8DD anttasks.jar Index: netbeans-7.0.1+dfsg1/javaee.api/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/javaee.api/external/binaries-list 2011-07-28 20:46:00.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -D6F416983EA13C334D5C599A9045414ECAF5D66D javaee-api-6.0.jar -EBEC44255251E6D3B8DDBAF701F732DAF0238CBF javaee-web-api-6.0.jar -B290091E71DEED6CE7F9EB40523D49C26399A2B4 javax.annotation.jar -EB77D3664EEA27D67B799ED28CB766B4D0971505 jaxb-api-osgi.jar -A5744971ACE1F44A0FC71CCB93DE530CB3022965 webservices-api-osgi.jar Index: netbeans-7.0.1+dfsg1/javahelp/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/javahelp/external/binaries-list 2011-07-28 20:46:00.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -CA70822C47A67FC3A11670270567C2D01566DAE1 jhall-2.0_05.jar Index: netbeans-7.0.1+dfsg1/javascript.editing/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/javascript.editing/external/binaries-list 2011-07-28 20:46:00.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -098B14300B35E1053AA9945FF2C1CDA164F43B33 js-domstubs.zip -5756AA27E54A3EC6C8CDAE32F49BCA7BC139EB15 jsstubs.zip -CD33537FD47E801E01B427997F3DE4016159B414 preindexed.zip -C56F4F5C42102A67F56EB8F12D0219E92E5307C2 sdocs.zip Index: netbeans-7.0.1+dfsg1/jemmy/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/jemmy/external/binaries-list 2011-07-28 20:46:02.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -418FC62C8A6EF5311987B01FE389B1F88EFDDCA2 jemmy-2.3.0.0.jar Index: netbeans-7.0.1+dfsg1/libs.antlr3.devel/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.antlr3.devel/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1E18576780EB117E410E7A262453A99B01E55B02 antlr-3.1.3.jar -6FE2E3BB57DAEBD1555494818909F9664376DD6C stringtemplate-3.2.jar Index: netbeans-7.0.1+dfsg1/libs.antlr3.runtime/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.antlr3.runtime/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -3154E3DFD5B7466DF8F5151A95BE70584F74F76C antlr-runtime-3.1.3.jar - Index: netbeans-7.0.1+dfsg1/libs.bugtracking/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.bugtracking/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -7D3CCD3ED4DB57F2B746F5ABAF86D10F222AEB87 org.eclipse.mylyn.commons.core_3.3.1.jar -02C39E6C02E2386D4936245F90AC4BFA5A7BCD49 org.eclipse.mylyn.commons.net_3.3.0.jar -DF522A06BF4EFD99A12C545C294D940CF6A2E01D org.eclipse.mylyn.tasks.core_3.3.1.jar -964CD74171F427720480EFDEC40A7C7F6E58426A commons-httpclient-3.1.jar -0EECDAC8C86BC84B4BDFC24371BA8C785A1FC552 commons-lang-2.3.jar Index: netbeans-7.0.1+dfsg1/libs.bugzilla/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.bugzilla/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -94408B54D039DA036A668C6B331EF944AF2E90EC org.eclipse.mylyn.bugzilla.core_3.3.1.jar Index: netbeans-7.0.1+dfsg1/libs.bytelist/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.bytelist/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -886FAF4B85054DD6E50D9B3438542F432B5F9251 bytelist-0.1.jar Index: netbeans-7.0.1+dfsg1/libs.cglib/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.cglib/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -97D03461DC1C04FFC636DCB2579AAE7724A78EF2 cglib-2.2.jar Index: netbeans-7.0.1+dfsg1/libs.commons_codec/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.commons_codec/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -FD32786786E2ADB664D5ECC965DA47629DCA14BA apache-commons-codec-1.3.jar Index: netbeans-7.0.1+dfsg1/libs.commons_fileupload/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.commons_fileupload/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2366159E25523D99E96D05211A2FA5399C938735 commons-fileupload-1.0.jar Index: netbeans-7.0.1+dfsg1/libs.commons_logging/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.commons_logging/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -BA24D5DE831911B684C92CD289ED5FF826271824 commons-logging-1.1.jar Index: netbeans-7.0.1+dfsg1/libs.commons_net/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.commons_net/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -ABB932ADB2C10790C1EAA4365D3AC2A1AC7CB700 commons-net-1.4.1.jar Index: netbeans-7.0.1+dfsg1/libs.elimpl/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.elimpl/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2EA8E5BDC70E1B1D738140E52E4793385B2567A3 el-impl.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/libs.felix/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.felix/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -08676C719D33D26DF4F3988E210A04D7F11183B7 felix-2.0.3.jar -BD5615C6A15497B60A0AAA9A04D4F05E2BC42D07 felix-main-2.0.2.jar Index: netbeans-7.0.1+dfsg1/libs.freemarker/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.freemarker/external/binaries-list 2011-07-28 20:46:06.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -4C7CF4ED0436A450EA759C2DFD7485A6929CC401 freemarker-2.3.8.jar Index: netbeans-7.0.1+dfsg1/libs.glassfish_logging/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.glassfish_logging/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -D813E05A06B587CD0FE36B00442EAB03C1431AA9 glassfish-logging-2.0.jar Index: netbeans-7.0.1+dfsg1/libs.ini4j/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.ini4j/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -8E737D82ECAC9BA6100A9BBA71E92A381B75EFDC ini4j-0.5.1.jar Index: netbeans-7.0.1+dfsg1/libs.jakarta_oro/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.jakarta_oro/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -5592374F834645C4AE250F4C9FBB314C9369D698 jakarta-oro-2.0.8.jar Index: netbeans-7.0.1+dfsg1/libs.javacup/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.javacup/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -1DE46CC85D147D9F91AF59D4A0107091C8B112D6 java-cup-11a.jar Index: netbeans-7.0.1+dfsg1/libs.jaxb/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.jaxb/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -2EC69BD69B66B0DABEA392DE713A11F975001760 jaxb-impl.jar -F02664A059617D060BEC3EBA0BC002B2102AEB84 jaxb1-impl.jar -64D468922B85A9626178AEDF564FFDBDE980B3EC jaxb-xjc.jar -27FAE927B5B9AE53A5B0ED825575DD8217CE7042 jaxb-api-doc.zip Index: netbeans-7.0.1+dfsg1/libs.jna/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.jna/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -4F25AA7292F70E721A9B96A6ED49365BA6E03EAB jna-3.2.7.jar Index: netbeans-7.0.1+dfsg1/libs.junit4/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.junit4/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -C94F54227B08100974C36170DCB53329435FE5AD junit-4.8.2.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/libs.jvyamlb/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.jvyamlb/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -46B7DB09C148A16ED8D6186D05D25C693DE63CA8 jvyamlb-0.2.3.jar Index: netbeans-7.0.1+dfsg1/libs.jzlib/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.jzlib/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -F406B7784A0DA5C4670B038BF55A4DCD4AF30AEB jzlib-1.0.7.jar Index: netbeans-7.0.1+dfsg1/libs.lucene/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.lucene/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -335F7EA0E28A4A1358AA745F4BD2037E8AFE44FC lucene-core-3.0.3.jar Index: netbeans-7.0.1+dfsg1/libs.osgi/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.osgi/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -986195A7E31034EE73F7A896A36B24169692F142 osgi.core-4.2.jar -972E6455724DC6ADB1C1912F53B5E3D7DF20C5FD osgi.cmpn-4.2.jar Index: netbeans-7.0.1+dfsg1/libs.smack/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.smack/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -916A0FE08D840A08C950F49FB59B961E14D673B8 smack.jar -BA1365C7E5F3CF7F7641B354677B3F54A6EA5A15 smackx.jar Index: netbeans-7.0.1+dfsg1/libs.springframework/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.springframework/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2D0D28E05BD6B6452DAAFE2B5CCB69A84EA63E5D spring-2.5.6.SEC01.jar -D88A41174C5F85D1B791D6A8E0F8B8A1C459D6C0 spring-framework-3.0.2.RELEASE.zip Index: netbeans-7.0.1+dfsg1/libs.svnClientAdapter.javahl/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.svnClientAdapter.javahl/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -0B9606F570B28FFC4FCE6C7222B88B3DCEFB1A36 svnClientAdapter-javahl-1.6.13.jar -0A79F5191E5F3FE372E8B88EA1B32D6D044CCA99 svnjavahl-1.6.0.jar Index: netbeans-7.0.1+dfsg1/libs.svnClientAdapter.svnkit/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.svnClientAdapter.svnkit/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -0AE20EC02958F193ADAB4C272ACCF6FE3196DCA0 svnClientAdapter-svnkit-1.6.13.jar -AB271CFC19469D9088BE306685A7AC8787373F99 svnkit-javahl.jar -636C6FF256A978B786D7502F43E788448E9DAB4B svnkit-1.3.4.jar -538D727A9A0874019FB11280F07CE3F43EE723BC sqljet-1.0.3.jar -68B82D7246FD90E0FC70BB9C8F10611489BF371A trilead.jar Index: netbeans-7.0.1+dfsg1/libs.svnClientAdapter/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.svnClientAdapter/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -A11623D2AF72A99C1509EC2A0ADA2DACBEE9A8E4 svnClientAdapter-main-1.6.13.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/libs.swingx/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.swingx/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7C6ED64C55164C5AE0394E11303CA95CB24166AF swingx-0.9.5.jar Index: netbeans-7.0.1+dfsg1/libs.xerces/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.xerces/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -6E60617C9D81EA1EF96913C226900BC2D1E69C37 xerces-2.8.0.jar Index: netbeans-7.0.1+dfsg1/maven.embedder/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/maven.embedder/external/binaries-list 2011-07-28 20:46:08.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar -653A6AD1EF786BC577FC20F56E5F2B1D30423805 maven-dependency-tree-1.2.jar -A511890049A6A9B8D675F4417721337580CBD2F9 apache-maven-3.0.3-bin.zip Index: netbeans-7.0.1+dfsg1/mobility.antext/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/mobility.antext/external/binaries-list 2011-07-28 20:46:10.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -943CD5C8802B2A3A64A010EFB86EC19BAC142E40 ant-contrib-1.0b3.jar Index: netbeans-7.0.1+dfsg1/mobility.deployment.webdav/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/mobility.deployment.webdav/external/binaries-list 2011-07-28 20:46:10.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -B96ED57072F0D2E6F66DD016E72B8AE9B043D143 commons-httpclient-3.0.1.jar -CEF99941E945D543DF0711F2C6AEF765B50F8501 jakarta-slide-ant-webdav-2.1.jar -D1B5BA3BFE8DCFAF08A0468F8879EF1D0E998038 jakarta-slide-webdavlib-2.1.jar -A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar Index: netbeans-7.0.1+dfsg1/mobility.j2meunit/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/mobility.j2meunit/external/binaries-list 2011-07-28 20:46:10.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -2FB485DD8C5EFC7972037781BFFF0CE31316FCE6 jmunit-1.2.1-api.zip -BD84F1A4C0789070CC62A8D2DBA75121A57C069C jmunit4cldc10-1.2.1.jar -D76B8334DCBDBE93297AA5C02B17D9A856E72246 jmunit4cldc11-1.2.1.jar Index: netbeans-7.0.1+dfsg1/nbbuild/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/nbbuild/external/binaries-list 2011-07-28 20:46:12.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -E160D64FA4680FD5C581A0F5AB516D88FB09AD47 apitest.jar - Index: netbeans-7.0.1+dfsg1/o.apache.tools.ant.module/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.apache.tools.ant.module/external/binaries-list 2011-07-28 20:46:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -FF23DBB427D09AAEC3998B50D740C42B6A3FCD61 ant-libs-1.8.2.zip -058F5EB0A15A7F6E48895F64F4AFBF7E00760AA9 ant-misc-1.8.2.zip Index: netbeans-7.0.1+dfsg1/o.apache.xml.resolver/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.apache.xml.resolver/external/binaries-list 2011-07-28 20:46:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -B0D0FCBAC68826D2AFA3C7C89FC4D57B95A000C3 resolver-1.2.jar Index: netbeans-7.0.1+dfsg1/o.jdesktop.beansbinding/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.jdesktop.beansbinding/external/binaries-list 2011-07-28 20:46:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -F7BD95641780C2AAE8CB9BED1686441A1CE5E749 beansbinding-1.2.1-doc.zip -C4F88C2CFC1F3F72451CDE2AA3BB1F40879801FD beansbinding-1.2.1.jar Index: netbeans-7.0.1+dfsg1/o.jdesktop.layout/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.jdesktop.layout/external/binaries-list 2011-07-28 20:46:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -1C7FE319052EF49126CF07D0DB6953CB7007229E swing-layout-1.0.4-doc.zip -69D72835E165439CF7816EFDA65868FD4E0C6E2A swing-layout-1.0.4.jar -D2503D2217868ABAE1A5E7480A9CCA1DB3522464 swing-layout-1.0.4-src.zip Index: netbeans-7.0.1+dfsg1/o.mozilla.rhino.patched/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.mozilla.rhino.patched/external/binaries-list 2011-07-28 20:46:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -1162833E0FE87B69B99B1F7DEB3A6C386EAB6F84 rhino1_7R2rc1.zip Index: netbeans-7.0.1+dfsg1/o.n.mobility.lib.activesync/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/o.n.mobility.lib.activesync/external/binaries-list 2011-07-28 20:46:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -3A5C68B301F42D3E8D89976F90D4E2AE6F2984B6 nbactivesync-5.0.jar -84FE71831D0F320106B25776C3630001800FB35E nbactivesync.dll Index: netbeans-7.0.1+dfsg1/php.editor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/php.editor/external/binaries-list 2011-07-28 20:46:26.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -40BC40A6E6DBD598900E8FAB87E460FCC601275C predefined_vars.zip Index: netbeans-7.0.1+dfsg1/php.phpdoc.documentation/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/php.phpdoc.documentation/external/binaries-list 2011-07-28 20:46:28.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0702230EB3354A1687E4496D73A94F33A1E343BD phpdocdesc.zip Index: netbeans-7.0.1+dfsg1/php.project/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/php.project/external/binaries-list 2011-07-28 20:46:28.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -C3E8FC2F69123F598F29F930DC39F5B55A08824C phpsigfiles.zip -06D0F78D33106A7E5D33B414BE4CA0CE474D969A preindexed-php.zip Index: netbeans-7.0.1+dfsg1/servletapi/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/servletapi/external/binaries-list 2011-07-28 20:46:48.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -85F9EE8921A08E5478118005D5829C6A1637374B servlet-2.2.jar Index: netbeans-7.0.1+dfsg1/servletjspapi/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/servletjspapi/external/binaries-list 2011-07-28 20:46:48.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -B9FA9CDC7FA5203E1DB5C4DBAAED0133596D524F servlet3.0-jsp2.2-api.jar Index: netbeans-7.0.1+dfsg1/spellchecker.dictionary_en/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/spellchecker.dictionary_en/external/binaries-list 2011-07-28 20:46:48.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -F90E3DA5259DB07F36E6987EFDED647A5231DE76 ispell-enwl-3.1.20.zip Index: netbeans-7.0.1+dfsg1/spring.webmvc/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/spring.webmvc/external/binaries-list 2011-07-28 20:46:54.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -1A48EDCF8DCFC76882C821931EB0529DB9AF5D9B spring-webmvc-2.5.6.SEC01.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/svg.perseus/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/svg.perseus/external/binaries-list 2011-07-28 20:47:02.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2EF44D925014E2EF76416535CC0F3A7C7E9F4AE1 perseus-nb-1.0.jar Index: netbeans-7.0.1+dfsg1/swing.validation/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/swing.validation/external/binaries-list 2011-07-28 20:47:02.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -55CD0B272084EB80B8C91F3A0617BB602B4EF2DF ValidationAPI.jar Index: netbeans-7.0.1+dfsg1/swingapp/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/swingapp/external/binaries-list 2011-07-28 20:47:02.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -B456600D274B835E1E7DDB16FD843DDAB2ED3EF1 appframework-1.0.3-doc.zip -338045FEFF6E61DF237AAFD11B6F3FE1A3B4E60E appframework-1.0.3.jar -DC9F8D6F7236087924AAD28FBEC794A087DD1B3D swing-worker-1.1.jar Index: netbeans-7.0.1+dfsg1/web.core.syntax/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.core.syntax/external/binaries-list 2011-07-28 20:47:14.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -F6E990DF59BD1FD2058320002A853A5411A45CD4 syntaxref20.zip Index: netbeans-7.0.1+dfsg1/web.jsf.editor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.jsf.editor/external/binaries-list 2011-07-28 20:47:16.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -93A58E37BA1D014375B1578F3D904736CB2D408F jsf-api-docs.zip Index: netbeans-7.0.1+dfsg1/web.jsf12/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.jsf12/external/binaries-list 2011-07-28 20:47:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -B9DB1A789C301F1D31DD6CC524DA2EBD7F89190D jsf-1.2.zip Index: netbeans-7.0.1+dfsg1/web.jspparser/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.jspparser/external/binaries-list 2011-07-28 20:47:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -7763236B189D9B910E2BDBA6822E6EB4DDDAC41B glassfish-jspparser-3.0.jar Index: netbeans-7.0.1+dfsg1/web.jstl11/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.jstl11/external/binaries-list 2011-07-28 20:47:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -3375E43C620DF4F1114959400FF9BB90D12A2FEB jstl-1.1.2.jar -A17E8A4D9A1F7FCC5EED606721C9ED6B7F18ACF7 standard-1.1.2.jar Index: netbeans-7.0.1+dfsg1/web.monitor/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.monitor/external/binaries-list 2011-07-28 20:47:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2C033740B8F78C1081AF25C0173FC57317D2783A servlet-2.3.jar Index: netbeans-7.0.1+dfsg1/web.primefaces/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.primefaces/external/binaries-list 2011-07-28 20:47:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -C31A6E33D7D6E77C8123A0830D929187A9707147 primefaces-2.2.1.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/web.struts/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.struts/external/binaries-list 2011-07-28 20:47:18.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -E11C2384FDEAE4F96E433C2A0339DCFC5202CC17 struts-1.3.8-javadoc.zip -A3F62096FB53E14CF09B006458333792890CE429 struts-1.3.8-lib.zip Index: netbeans-7.0.1+dfsg1/websvc.jaxws21/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/websvc.jaxws21/external/binaries-list 2011-07-28 20:47:20.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2F43A634A42CC4FD2EF9E24B488AFFD6984D3411 jaxws-2.2.zip -8ECD169E9E308C258287E4F28B03B6D6F1E55F47 jaxws-api-doc.zip Index: netbeans-7.0.1+dfsg1/websvc.jaxws21api/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/websvc.jaxws21api/external/binaries-list 2011-07-28 20:47:20.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -23E69F0F17757673C573EBD9899727B82EF7DB7F jaxws-2.2-api.zip Index: netbeans-7.0.1+dfsg1/websvc.metro.lib/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/websvc.metro.lib/external/binaries-list 2011-07-28 20:47:20.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -FDECFB78184C7D19E7E20130A7D7E88C1DF0BDD1 metro-1.4-doc.zip -16CD40905B389B27AFD81DAFF8F163CEC810FBC6 metro-2.0.zip Index: netbeans-7.0.1+dfsg1/websvc.restlib/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/websvc.restlib/external/binaries-list 2011-07-28 20:47:24.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -BD6C7BD1452456F2F6B2A8CF6C4166493A24ABED jersey-1.3.zip -955396DB8CE0477C6BD70BA830FF84CB9B7AB47B jersey-client-1.3-javadoc.jar -A27843863A5EAE9DDFF1C70F7A95D3BFC2A59D99 jersey-core-1.1.5.1-javadoc.jar -6E3105315F3100F65D66355B04BA6B6C2B8480D3 jersey-json-1.3-javadoc.jar -F10ED4F2ECC7724F7C25D586DC9F25377581CCFC jersey-multipart-1.3-javadoc.jar -123A7BAAE06D938E5E4533ED745EEE7377E73ED8 jersey-spring-1.3-javadoc.jar -BAEA0B9171897175B0B3E20BDF532EF4CFD44CEE oauth-client-1.3-javadoc.jar -4855C8481C6951F39DC117C44CA8EE70BF2B003F oauth-signature-1.3-javadoc.jar -FFE3425E304F0836912D2B8ABFB5302100B39423 jsr311-api-1.1.1-javadoc.jar Index: netbeans-7.0.1+dfsg1/xml.jaxb.api/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/xml.jaxb.api/external/binaries-list 2011-07-28 20:47:28.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -D107B729E3CCD30E84A5E0229F900BF95DB10FC1 activation.jar -BCF23B1D858C6F69D67C851D497984D25345D0B1 jaxb-api.jar -8B7A70786148944EF061FCA58B5467D05DAE07BA jsr173_api.jar Index: netbeans-7.0.1+dfsg1/cnd.discovery/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/cnd.discovery/external/binaries-list 2011-08-04 21:48:10.658409190 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -5C917BCC015510DC6C7E3B511DB85B2978C0774C cnd-build-trace-1.0.zip \ No newline at end of file Index: netbeans-7.0.1+dfsg1/cnd.remote/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/cnd.remote/external/binaries-list 2011-08-04 21:48:10.568408997 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -84F10BEAA967E2896F0B43B0BBD08D834841F554 cnd-rfs-1.0.zip Index: netbeans-7.0.1+dfsg1/derby/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/derby/external/binaries-list 2011-08-04 21:48:10.538414649 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -C9A6304FAA121C97CB2458B93D30B1FD6F0F7691 derbysampledb.zip - Index: netbeans-7.0.1+dfsg1/libs.javacapi/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.javacapi/external/binaries-list 2011-08-04 21:48:10.598410325 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -ADD5DE96BF7F30DAA4EC41D70610CF72A16F58FD javac-api-nb-7.0-b07.jar Index: netbeans-7.0.1+dfsg1/libs.javacimpl/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.javacimpl/external/binaries-list 2011-08-04 21:48:10.498413320 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -AA6FD013C506BAC98BCE1174EACAD00383650342 javac-impl-nb-7.0-b07.jar Index: netbeans-7.0.1+dfsg1/libs.jsch/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.jsch/external/binaries-list 2011-08-04 21:48:10.688408788 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -563D2C4728DA8351559154925B5903C259382C5B jsch-0.1.44.jar \ No newline at end of file Index: netbeans-7.0.1+dfsg1/maven.indexer/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/maven.indexer/external/binaries-list 2011-08-04 21:48:10.628409381 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -AF599F03E590A5992EE56F363DBD8F0F32B8787E indexer-artifact-4.1.0.jar -CAF99EFBB25E9183609D6FBA4F63D85E7606903F indexer-core-4.1.0.jar Index: netbeans-7.0.1+dfsg1/web.jsf20/external/binaries-list =================================================================== --- netbeans-7.0.1+dfsg1.orig/web.jsf20/external/binaries-list 2011-08-04 21:48:10.408409015 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -1D74DA79DC71C52D1B7916853BDD51F346A85359 jsf-2.1.zip debian/patches/netbeans-platform~properties.patch0000664000000000000000000000164211720272354017602 0ustar We don't include the swing layout source zip. diff -Nur netbeans-platform-6.9/o.jdesktop.layout/nbproject/project.properties netbeans-platform-6.9.new/o.jdesktop.layout/nbproject/project.properties --- netbeans-platform-6.9/o.jdesktop.layout/nbproject/project.properties 2010-05-31 20:58:16.000000000 +0400 +++ netbeans-platform-6.9.new/o.jdesktop.layout/nbproject/project.properties 2010-06-10 09:34:11.689150157 +0400 @@ -42,6 +42,6 @@ is.autoload=true release.external/swing-layout-1.0.4.jar=modules/ext/swing-layout-1.0.4.jar -release.external/swing-layout-1.0.4-doc.zip=docs/swing-layout-1.0.4-doc.zip -release.external/swing-layout-1.0.4-src.zip=docs/swing-layout-1.0.4-src.zip +#release.external/swing-layout-1.0.4-doc.zip=docs/swing-layout-1.0.4-doc.zip +#release.external/swing-layout-1.0.4-src.zip=docs/swing-layout-1.0.4-src.zip jnlp.indirect.jars=docs/swing-layout-1.0.4-doc.zip, docs/swing-layout-1.0.4-src.zip debian/patches/netbeans-platform~windowslauncher.patch0000664000000000000000000001630411720272354020623 0ustar Use mingw32 to build the windows launchers. These are useful if the Netbeans platform is used to build another application on Debian which you want to be able to run on a Windows system. Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/Makefile =================================================================== --- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/windows/Makefile 2011-06-13 21:39:36.107758898 +0100 +++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/Makefile 2011-06-14 23:46:57.388989761 +0100 @@ -34,7 +34,7 @@ MKDIR=mkdir CP=cp CCADMIN=CCadmin -RANLIB=ranlib +RANLIB=i586-mingw32msvc-ranlib # build build: .build-post @@ -48,8 +48,8 @@ cp nbexec.dll ../../../nbbuild/netbeans/platform/lib/ nbexec.exe: nbexecexe.cpp nbexecloader.h utilsfuncs.cpp nbexec_exe.rc - windres.exe -Ocoff nbexec_exe.rc nbexec_exe.res - g++ -s -mno-cygwin nbexecexe.cpp utilsfuncs.cpp nbexec_exe.res -o nbexec.exe + i586-mingw32msvc-windres -Ocoff nbexec_exe.rc nbexec_exe.res + i586-mingw32msvc-g++ -s -mno-cygwin nbexecexe.cpp utilsfuncs.cpp nbexec_exe.res -o nbexec.exe # clean clean: .clean-post Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk =================================================================== --- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk 2011-06-13 21:39:36.137760501 +0100 +++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk 2011-06-14 23:47:19.998990498 +0100 @@ -11,12 +11,12 @@ MKDIR=mkdir CP=cp CCADMIN=CCadmin -RANLIB=ranlib -CC=gcc -CCC=g++ -CXX=g++ +RANLIB=i586-mingw32msvc-ranlib +CC=i586-mingw32msvc-gcc +CCC=i586-mingw32msvc-g++ +CXX=i586-mingw32msvc-g++ FC= -AS=as +AS=i586-mingw32msvc-as # Macros CND_PLATFORM=Cygwin-Windows @@ -65,22 +65,22 @@ ${OBJECTDIR}/platformlauncher.o: nbproject/Makefile-${CND_CONF}.mk platformlauncher.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp + $(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp ${OBJECTDIR}/nbexec.o: nbproject/Makefile-${CND_CONF}.mk nbexec.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp + $(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp ${OBJECTDIR}/nbexec.res: nbproject/Makefile-${CND_CONF}.mk nbexec.rc version.h ${MKDIR} -p ${OBJECTDIR} @echo Compiling Resource files... - windres.exe -Ocoff nbexec.rc ${OBJECTDIR}/nbexec.res + i586-mingw32msvc-windres -Ocoff nbexec.rc ${OBJECTDIR}/nbexec.res ${OBJECTDIR}/nbexecexe.o: nbproject/Makefile-${CND_CONF}.mk nbexecexe.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp + $(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp : nbproject/Makefile-${CND_CONF}.mk nbexec_exe.rc @echo @@ -89,12 +89,12 @@ ${OBJECTDIR}/jvmlauncher.o: nbproject/Makefile-${CND_CONF}.mk jvmlauncher.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp + $(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp ${OBJECTDIR}/utilsfuncs.o: nbproject/Makefile-${CND_CONF}.mk utilsfuncs.cpp ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp + $(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp # Subprojects .build-subprojects: Index: libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/Makefile =================================================================== --- libnb-platform-java-7.0+dfsg1.orig/apisupport.harness/windows-launcher-src/Makefile 2011-06-14 23:46:57.338990509 +0100 +++ libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/Makefile 2011-06-14 23:56:49.309005828 +0100 @@ -34,7 +34,7 @@ MKDIR=mkdir CP=cp CCADMIN=CCadmin -RANLIB=ranlib +RANLIB=i586-mingw32msvc-ranlib # build @@ -47,10 +47,11 @@ # Add your post 'build' code here... app.res : app.rc - windres -o$@ -Ocoff app.rc + i586-mingw32msvc-windres -o$@ -Ocoff app.rc # clean clean: .clean-post + rm -f app.res .clean-pre: # Add your pre 'clean' code here... Index: libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/nbproject/Makefile-Release.mk =================================================================== --- libnb-platform-java-7.0+dfsg1.orig/apisupport.harness/windows-launcher-src/nbproject/Makefile-Release.mk 2011-06-14 23:46:57.358990425 +0100 +++ libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/nbproject/Makefile-Release.mk 2011-06-14 23:47:19.998990498 +0100 @@ -11,10 +11,10 @@ MKDIR=mkdir CP=cp CCADMIN=CCadmin -RANLIB=ranlib -CC=gcc.exe -CCC=g++.exe -CXX=g++.exe +RANLIB=i586-mingw32msvc-ranlib +CC=i586-mingw32msvc-gcc +CCC=i586-mingw32msvc-g++ +CXX=i586-mingw32msvc-g++ FC= AS= @@ -84,7 +84,7 @@ # Clean Targets .clean-conf: ${RM} -r build/Release - ${RM} ../release/launchers/app.exe.exe + ${RM} ../release/launchers/app.exe # Subprojects .clean-subprojects: Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/jvmlauncher.h =================================================================== --- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/windows/jvmlauncher.h 2011-06-14 23:46:57.428989809 +0100 +++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/jvmlauncher.h 2011-06-15 18:56:36.509511571 +0100 @@ -50,6 +50,18 @@ #include #include #include + +// Use the definitions below rather than the linux jdk ones +#define _JAVASOFT_JNI_MD_H_ +// imports, exports, and calling conventions need to match those used in a dll +#define JNIEXPORT __declspec(dllexport) +#define JNIIMPORT __declspec(dllimport) +#define JNICALL __stdcall +// Correct types for the windows platform +typedef long jint; +typedef __int64 jlong; +typedef signed char jbyte; + #include "jni.h" #include "utilsfuncs.h" debian/patches/netbeans~build.patch0000664000000000000000000000222511720272354014661 0ustar Build process changes. Index: netbeans-7.0+dfsg1/nbbuild/build.xml =================================================================== --- netbeans-7.0+dfsg1.orig/nbbuild/build.xml 2011-07-08 23:34:20.569768712 +0100 +++ netbeans-7.0+dfsg1/nbbuild/build.xml 2011-07-10 10:58:36.542404713 +0100 @@ -142,7 +142,7 @@ - + @@ -293,7 +293,7 @@ - + debian/patches/netbeans~ide-launcher.patch0000664000000000000000000000571511720272354016131 0ustar Update the launcher to work in Debian. Index: netbeans-7.0.1+dfsg1/ide/launcher/unix/netbeans =================================================================== --- netbeans-7.0.1+dfsg1.orig/ide/launcher/unix/netbeans 2011-07-28 20:45:40.000000000 +0100 +++ netbeans-7.0.1+dfsg1/ide/launcher/unix/netbeans 2011-08-02 23:42:39.694164784 +0100 @@ -41,6 +41,17 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. +# The Startup Notification Protocol Specification established by freedesktop.org +# recommends to unset the DESKTOP_STARTUP_ID environment variable to avoid +# possible reuse by some process started later by this process, e.g. when a browser +# will be started after clicking a hyperlink in the NetBeans. +if [ ! -z $DESKTOP_STARTUP_ID ] ; then + # Save a value for later using in the NB_DESKTOP_STARTUP_ID + NB_DESKTOP_STARTUP_ID=$DESKTOP_STARTUP_ID; export NB_DESKTOP_STARTUP_ID + + unset DESKTOP_STARTUP_ID +fi + # # resolve symlinks # @@ -57,16 +68,18 @@ fi done -progdir=`dirname "$PRG"` +#progdir=`dirname "$PRG"` +# Patch for Debian/Ubuntu/Fedora where launcher is in /usr/bin +progdir=/usr/share/netbeans/7.0.1/bin if [ -f "$progdir"/../etc/netbeans.conf ] ; then . "$progdir"/../etc/netbeans.conf fi # following should be done just in RPM or Solaris Launcher -# if [ -f /etc/netbeans.conf ] ; then -# . /etc/netbeans.conf -# fi +if [ -f /etc/netbeans.conf ] ; then + . /etc/netbeans.conf +fi # #68373: look for userdir, but do not modify "$@" @@ -194,7 +207,7 @@ --branding nb \ --clusters '"$netbeans_clusters"' \ -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade \ - -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense \ + --cp:p /usr/share/java/log4j-1.2.jar \ ${netbeans_default_options} \ '"$@"' ;; Index: netbeans-7.0.1+dfsg1/ide/launcher/netbeans.conf =================================================================== --- netbeans-7.0.1+dfsg1.orig/ide/launcher/netbeans.conf 2011-07-28 20:45:40.000000000 +0100 +++ netbeans-7.0.1+dfsg1/ide/launcher/netbeans.conf 2011-08-02 23:43:19.783332097 +0100 @@ -3,7 +3,7 @@ # Options used by NetBeans launcher by default, can be overridden by explicit # command line switches: -netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true" +netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.pmoffscreen=false" # Note that default -Xmx and -XX:MaxPermSize are selected for you automatically. # You can find these values in var/log/messages.log file in your userdir. # The automatically selected value can be overridden by specifying -J-Xmx or debian/patches/netbeans~old-java-modules.patch0000664000000000000000000120654411720272354016740 0ustar Use an older version of some java modules since the latest ones only build with JDK 7. Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/DelegateMethodGenerator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/DelegateMethodGenerator.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/DelegateMethodGenerator.java 2011-08-04 21:48:28.718408699 +0100 @@ -119,26 +119,21 @@ } catch (IOException ioe) { return ret; } - TypeElement typeElement = (TypeElement) controller.getTrees().getElement(path); - if (typeElement == null || !typeElement.getKind().isClass()) - return ret; List descriptions = computeUsableFieldsDescriptions(controller, path); if (!descriptions.isEmpty()) { Collections.reverse(descriptions); - ret.add(new DelegateMethodGenerator(component, ElementHandle.create(typeElement), ElementNode.Description.create(descriptions))); + ret.add(new DelegateMethodGenerator(component, ElementNode.Description.create(descriptions))); } return ret; } } private JTextComponent component; - private ElementHandle handle; private ElementNode.Description description; /** Creates a new instance of DelegateMethodGenerator */ - private DelegateMethodGenerator(JTextComponent component, ElementHandle handle, ElementNode.Description description) { + private DelegateMethodGenerator(JTextComponent component, ElementNode.Description description) { this.component = component; - this.handle = handle; this.description = description; } @@ -163,21 +158,15 @@ ModificationResult mr = js.runModificationTask(new Task() { public void run(WorkingCopy copy) throws IOException { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - Element e = handle.resolve(copy); - TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset); + TreePath path = copy.getTreeUtilities().pathFor(caretOffset); path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path); - if (path == null) { - String message = NbBundle.getMessage(DelegateMethodGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N - org.netbeans.editor.Utilities.setStatusBoldText(component, message); - } else { - int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); - ElementHandle handle = panel.getDelegateField(); - VariableElement delegate = handle != null ? (VariableElement)handle.resolve(copy) : null; - ArrayList methods = new ArrayList(); - for (ElementHandle elementHandle : panel.getDelegateMethods()) - methods.add((ExecutableElement)elementHandle.resolve(copy)); - generateDelegatingMethods(copy, path, delegate, methods, idx); - } + int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); + ElementHandle handle = panel.getDelegateField(); + VariableElement delegate = handle != null ? (VariableElement)handle.resolve(copy) : null; + ArrayList methods = new ArrayList(); + for (ElementHandle elementHandle : panel.getDelegateMethods()) + methods.add((ExecutableElement)elementHandle.resolve(copy)); + generateDelegatingMethods(copy, path, delegate, methods, idx); } }); GeneratorUtils.guardedCommit(component, mr); @@ -231,6 +220,10 @@ static List computeUsableFieldsDescriptions(CompilationInfo info, TreePath path) { Elements elements = info.getElements(); + TypeElement typeElement = (TypeElement) info.getTrees().getElement(path); + if (typeElement == null || !typeElement.getKind().isClass()) { + return Collections.emptyList(); + } Trees trees = info.getTrees(); Scope scope = trees.getScope(path); Map> map = new LinkedHashMap>(); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java 2011-08-04 21:48:28.718408699 +0100 @@ -45,6 +45,7 @@ import org.netbeans.spi.editor.codegen.CodeGenerator; import com.sun.source.tree.ClassTree; +import com.sun.source.tree.Tree; import com.sun.source.util.TreePath; import java.awt.Dialog; import java.io.IOException; @@ -212,19 +213,13 @@ ModificationResult mr = js.runModificationTask(new Task() { public void run(WorkingCopy copy) throws IOException { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - Element e = description.getElementHandle().resolve(copy); - TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset); + TreePath path = copy.getTreeUtilities().pathFor(caretOffset); path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path); - if (path == null) { - String message = NbBundle.getMessage(GetterSetterGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N - org.netbeans.editor.Utilities.setStatusBoldText(component, message); - } else { - int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); - ArrayList variableElements = new ArrayList(); - for (ElementHandle elementHandle : panel.getVariables()) - variableElements.add((VariableElement)elementHandle.resolve(copy)); - GeneratorUtils.generateGettersAndSetters(copy, path, variableElements, type, idx); - } + int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); + ArrayList variableElements = new ArrayList(); + for (ElementHandle elementHandle : panel.getVariables()) + variableElements.add((VariableElement)elementHandle.resolve(copy)); + GeneratorUtils.generateGettersAndSetters(copy, path, variableElements, type, idx); } }); GeneratorUtils.guardedCommit(component, mr); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ImplementOverrideMethodGenerator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/ImplementOverrideMethodGenerator.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ImplementOverrideMethodGenerator.java 2011-08-04 21:48:28.718408699 +0100 @@ -110,7 +110,7 @@ for (Map.Entry> entry : map.entrySet()) implementDescriptions.add(ElementNode.Description.create(controller, entry.getKey(), entry.getValue(), false, false)); if (!implementDescriptions.isEmpty()) - ret.add(new ImplementOverrideMethodGenerator(component, ElementHandle.create(typeElement), ElementNode.Description.create(implementDescriptions), true)); + ret.add(new ImplementOverrideMethodGenerator(component, ElementNode.Description.create(implementDescriptions), true)); map = new LinkedHashMap>(); ArrayList orderedElements = new ArrayList(); for (ExecutableElement method : GeneratorUtils.findOverridable(controller, typeElement)) { @@ -128,20 +128,18 @@ for (Element e : orderedElements) overrideDescriptions.add(ElementNode.Description.create(controller, e, map.get( e ), false, false)); if (!overrideDescriptions.isEmpty()) - ret.add(new ImplementOverrideMethodGenerator(component, ElementHandle.create(typeElement), ElementNode.Description.create(overrideDescriptions), false)); + ret.add(new ImplementOverrideMethodGenerator(component, ElementNode.Description.create(overrideDescriptions), false)); return ret; } } private JTextComponent component; - private ElementHandle handle; private ElementNode.Description description; private boolean isImplement; /** Creates a new instance of OverrideMethodGenerator */ - private ImplementOverrideMethodGenerator(JTextComponent component, ElementHandle handle, ElementNode.Description description, boolean isImplement) { + private ImplementOverrideMethodGenerator(JTextComponent component, ElementNode.Description description, boolean isImplement) { this.component = component; - this.handle = handle; this.description = description; this.isImplement = isImplement; } @@ -164,22 +162,18 @@ ModificationResult mr = js.runModificationTask(new Task() { public void run(WorkingCopy copy) throws IOException { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - Element e = handle.resolve(copy); - TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset); + TreePath path = copy.getTreeUtilities().pathFor(caretOffset); path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path); - if (path == null) { - String message = NbBundle.getMessage(ImplementOverrideMethodGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N - org.netbeans.editor.Utilities.setStatusBoldText(component, message); - } else { - int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); - ArrayList methodElements = new ArrayList(); - for (ElementHandle elementHandle : panel.getSelectedMethods()) - methodElements.add((ExecutableElement)elementHandle.resolve(copy)); - if (isImplement) - GeneratorUtils.generateAbstractMethodImplementations(copy, path, methodElements, idx); - else - GeneratorUtils.generateMethodOverrides(copy, path, methodElements, idx); - } + if (path == null) + return; + int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); + ArrayList methodElements = new ArrayList(); + for (ElementHandle elementHandle : panel.getSelectedMethods()) + methodElements.add((ExecutableElement)elementHandle.resolve(copy)); + if (isImplement) + GeneratorUtils.generateAbstractMethodImplementations(copy, path, methodElements, idx); + else + GeneratorUtils.generateMethodOverrides(copy, path, methodElements, idx); } }); GeneratorUtils.guardedCommit(component, mr); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java 2011-08-04 21:48:28.718408699 +0100 @@ -158,30 +158,26 @@ public void run(WorkingCopy copy) throws IOException { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - Element e = description.getElementHandle().resolve(copy); - TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset); + TreePath path = copy.getTreeUtilities().pathFor(caretOffset); path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path); - if (path == null) { - String message = NbBundle.getMessage(ToStringGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N - org.netbeans.editor.Utilities.setStatusBoldText(component, message); + if (path == null) + return; + ClassTree cls = (ClassTree) path.getLeaf(); + int idx = GeneratorUtils.findClassMemberIndex(copy, cls, caretOffset); + ArrayList fields = new ArrayList(); + for (ElementHandle elementHandle : panel.getVariables()) { + VariableElement field = (VariableElement) elementHandle.resolve(copy); + if (field == null) + return; + fields.add(field); + } + MethodTree mth = createToStringMethod(copy, fields, cls.getSimpleName().toString()); + if (idx >= 0) { + cls = copy.getTreeMaker().insertClassMember(cls, idx, mth); } else { - ClassTree cls = (ClassTree) path.getLeaf(); - int idx = GeneratorUtils.findClassMemberIndex(copy, cls, caretOffset); - ArrayList fields = new ArrayList(); - for (ElementHandle elementHandle : panel.getVariables()) { - VariableElement field = (VariableElement) elementHandle.resolve(copy); - if (field == null) - return; - fields.add(field); - } - MethodTree mth = createToStringMethod(copy, fields, cls.getSimpleName().toString()); - if (idx >= 0) { - cls = copy.getTreeMaker().insertClassMember(cls, idx, mth); - } else { - cls = copy.getTreeMaker().addClassMember(cls, mth); - } - copy.rewrite(path.getLeaf(), cls); + cls = copy.getTreeMaker().addClassMember(cls, mth); } + copy.rewrite(path.getLeaf(), cls); } }); GeneratorUtils.guardedCommit(component, mr); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties 2011-08-04 21:48:28.718408699 +0100 @@ -90,6 +90,5 @@ A11Y_Generate_ImplementOverride=Implement/Override Method Dialog ERR_CannotApplyGuarded=Cannot apply changes due to guarded block -ERR_CannotFindOriginalClass=Cannot find original class LBL_Get_Available_Methods=Gathering of Available Methods Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ConstructorGenerator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/ConstructorGenerator.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ConstructorGenerator.java 2011-08-04 21:48:28.728434605 +0100 @@ -144,21 +144,19 @@ fieldsDescription = ElementNode.Description.create(controller, typeElement, fieldDescriptions, false, false); } if (constructorHandle != null || constructorDescription != null || fieldsDescription != null) - ret.add(new ConstructorGenerator(component, ElementHandle.create(typeElement), constructorHandle, constructorDescription, fieldsDescription)); + ret.add(new ConstructorGenerator(component, constructorHandle, constructorDescription, fieldsDescription)); return ret; } } private JTextComponent component; - private ElementHandle typeHandle; private ElementHandle constructorHandle; private ElementNode.Description constructorDescription; private ElementNode.Description fieldsDescription; /** Creates a new instance of ConstructorGenerator */ - private ConstructorGenerator(JTextComponent component, ElementHandle typeHandle, ElementHandle constructorHandle, ElementNode.Description constructorDescription, ElementNode.Description fieldsDescription) { + private ConstructorGenerator(JTextComponent component, ElementHandle constructorHandle, ElementNode.Description constructorDescription, ElementNode.Description fieldsDescription) { this.component = component; - this.typeHandle = typeHandle; this.constructorHandle = constructorHandle; this.constructorDescription = constructorDescription; this.fieldsDescription = fieldsDescription; @@ -196,36 +194,30 @@ ModificationResult mr = js.runModificationTask(new Task() { public void run(WorkingCopy copy) throws IOException { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - Element e = typeHandle.resolve(copy); - TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset); + TreePath path = copy.getTreeUtilities().pathFor(caretOffset); path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path); - if (path == null) { - String message = NbBundle.getMessage(ConstructorGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N - org.netbeans.editor.Utilities.setStatusBoldText(component, message); - } else { - int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); - ArrayList variableElements = new ArrayList(); - if (fieldHandles != null) { - for (ElementHandle elementHandle : fieldHandles) { - VariableElement field = (VariableElement) elementHandle.resolve(copy); - if (field == null) - return; - variableElements.add(field); - } - } - if (constrHandles != null && !constrHandles.isEmpty()) { - ArrayList constrElements = new ArrayList(); - for (ElementHandle elementHandle : constrHandles) { - ExecutableElement constr = (ExecutableElement)elementHandle.resolve(copy); - if (constr == null) - return; - constrElements.add(constr); - } - GeneratorUtils.generateConstructors(copy, path, variableElements, constrElements, idx); - } else { - GeneratorUtils.generateConstructor(copy, path, variableElements, constructorHandle != null ? (ExecutableElement)constructorHandle.resolve(copy) : null, idx); + int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); + ArrayList variableElements = new ArrayList(); + if (fieldHandles != null) { + for (ElementHandle elementHandle : fieldHandles) { + VariableElement field = (VariableElement) elementHandle.resolve(copy); + if (field == null) + return; + variableElements.add(field); } } + if (constrHandles != null && !constrHandles.isEmpty()) { + ArrayList constrElements = new ArrayList(); + for (ElementHandle elementHandle : constrHandles) { + ExecutableElement constr = (ExecutableElement)elementHandle.resolve(copy); + if (constr == null) + return; + constrElements.add(constr); + } + GeneratorUtils.generateConstructors(copy, path, variableElements, constrElements, idx); + } else { + GeneratorUtils.generateConstructor(copy, path, variableElements, constructorHandle != null ? (ExecutableElement)constructorHandle.resolve(copy) : null, idx); + } } }); GeneratorUtils.guardedCommit(component, mr); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/EqualsHashCodeGenerator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/EqualsHashCodeGenerator.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/EqualsHashCodeGenerator.java 2011-08-04 21:48:28.728434605 +0100 @@ -346,31 +346,25 @@ ModificationResult mr = js.runModificationTask(new Task() { public void run(WorkingCopy copy) throws IOException { copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); - Element e = description.getElementHandle().resolve(copy); - TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset); + TreePath path = copy.getTreeUtilities().pathFor(caretOffset); path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path); - if (path == null) { - String message = NbBundle.getMessage(EqualsHashCodeGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N - org.netbeans.editor.Utilities.setStatusBoldText(component, message); - } else { - int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); - ArrayList equalsElements = new ArrayList(); - if( generateEquals ) { - for (ElementHandle elementHandle : panel.getEqualsVariables()) - equalsElements.add((VariableElement)elementHandle.resolve(copy)); - } - ArrayList hashCodeElements = new ArrayList(); - if( generateHashCode ) { - for (ElementHandle elementHandle : panel.getHashCodeVariables()) - hashCodeElements.add((VariableElement)elementHandle.resolve(copy)); + int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset); + ArrayList equalsElements = new ArrayList(); + if( generateEquals ) { + for (ElementHandle elementHandle : panel.getEqualsVariables()) + equalsElements.add((VariableElement)elementHandle.resolve(copy)); } - generateEqualsAndHashCode( - copy, path, - generateEquals ? equalsElements : null, - generateHashCode ? hashCodeElements : null, - idx - ); + ArrayList hashCodeElements = new ArrayList(); + if( generateHashCode ) { + for (ElementHandle elementHandle : panel.getHashCodeVariables()) + hashCodeElements.add((VariableElement)elementHandle.resolve(copy)); } + generateEqualsAndHashCode( + copy, path, + generateEquals ? equalsElements : null, + generateHashCode ? hashCodeElements : null, + idx + ); } }); GeneratorUtils.guardedCommit(component, mr); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java 2011-08-04 21:48:28.728434605 +0100 @@ -49,17 +49,18 @@ import com.sun.source.tree.ImportTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree; +import com.sun.source.tree.Tree.Kind; import com.sun.source.tree.VariableTree; import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.util.ArrayList; -import java.util.Collections; import java.util.ConcurrentModificationException; -import java.util.Iterator; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TreeMap; import java.util.WeakHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -127,11 +128,9 @@ Object od = doc.getProperty(Document.StreamDescriptionProperty); if (od instanceof DataObject) { - FileObject file = ((DataObject)od).getPrimaryFile(); - - currentFolds = new ArrayList(); - task = JavaElementFoldTask.getTask(file); - task.setJavaElementFoldManager(JavaElementFoldManager.this, file); + currentFolds = new HashMap(); + task = JavaElementFoldTask.getTask(((DataObject)od).getPrimaryFile()); + task.setJavaElementFoldManager(JavaElementFoldManager.this); } } @@ -163,7 +162,7 @@ public synchronized void release() { if (task != null) - task.setJavaElementFoldManager(null, null); + task.setJavaElementFoldManager(null); task = null; file = null; @@ -196,12 +195,8 @@ private Reference manager; - synchronized void setJavaElementFoldManager(JavaElementFoldManager manager, FileObject file) { + synchronized void setJavaElementFoldManager(JavaElementFoldManager manager) { this.manager = new WeakReference(manager); - - if (file != null) { - JavaElementFoldManagerTaskFactory.doRefresh(file); - } } public void run(final CompilationInfo info) { @@ -235,8 +230,7 @@ if (v.stopped || isCancelled()) return ; - - Collections.sort(v.folds); + SwingUtilities.invokeLater(jefm.new CommitFolds(v.folds)); long endTime = System.currentTimeMillis(); @@ -274,82 +268,66 @@ try { if (currentFolds == null) return ; + + Map added = new TreeMap(); + List removed = new ArrayList(currentFolds.keySet()); + + for (FoldInfo i : infos) { + if (currentFolds.containsKey(i)) { + removed.remove(i); + continue ; + } + + int start = i.start.getOffset(); + int end = i.end.getOffset(); - List updatedFolds = new ArrayList(infos.size()); - Iterator itExisting = currentFolds.iterator(); - Iterator itNew = infos.iterator(); - FoldInfo currentExisting = itExisting.hasNext() ? itExisting.next() : null; - FoldInfo currentNew = itNew.hasNext() ? itNew.next() : null; - - while (currentExisting != null || currentNew != null) { - int order = currentExisting != null && currentNew != null ? currentExisting.compareTo(currentNew) : currentExisting != null ? -1 : 1; - - if (order < 0) { - //fold removed: - operation.removeFromHierarchy(currentExisting.fold, tr); - - if (importsFold == currentExisting.fold) { - importsFold = null; - } - - if (initialCommentFold == currentExisting.fold) { - initialCommentFold = null; - } + // XXX: In some situations infos contains duplicate folds and we don't + // want to add the same multiple times. The situation that I came across + // was with having an empty enum subclass with javadoc. The javadoc fold + // was added twice - once from visitClass and second time from visitMethod + // for the node, which for some reason has the same offset as the + // the enum inner class. + + if (end > start && + (end - start) > (i.template.getStartGuardedLength() + i.template.getEndGuardedLength()) && + !added.containsKey(i)) + { + Fold f = operation.addToHierarchy(i.template.getType(), + i.template.getDescription(), + i.collapseByDefault, + start, + end, + i.template.getStartGuardedLength(), + i.template.getEndGuardedLength(), + i, + tr); + + added.put(i, f); - currentExisting = itExisting.hasNext() ? itExisting.next() : null; - } else { - //added or remains: - if (order > 0) { - //added: - int start = currentNew.start.getOffset(); - int end = currentNew.end.getOffset(); - - if (end > start && - (end - start) > (currentNew.template.getStartGuardedLength() + currentNew.template.getEndGuardedLength())) { - Fold f = operation.addToHierarchy(currentNew.template.getType(), - currentNew.template.getDescription(), - currentNew.collapseByDefault, - start, - end, - currentNew.template.getStartGuardedLength(), - currentNew.template.getEndGuardedLength(), - currentNew, - tr); - - currentNew.fold = f; - - if (currentNew.template == IMPORTS_FOLD_TEMPLATE) { - importsFold = f; - } - - if (currentNew.template == INITIAL_COMMENT_FOLD_TEMPLATE) { - initialCommentFold = f; - } - - updatedFolds.add(currentNew); - } - } else { - updatedFolds.add(currentExisting); - currentExisting = itExisting.hasNext() ? itExisting.next() : null; + if (i.template == IMPORTS_FOLD_TEMPLATE) { + importsFold = f; } - - FoldInfo newNew = itNew.hasNext() ? itNew.next() : null; - - // XXX: In some situations infos contains duplicate folds and we don't - // want to add the same multiple times. The situation that I came across - // was with having an empty enum subclass with javadoc. The javadoc fold - // was added twice - once from visitClass and second time from visitMethod - // for the node, which for some reason has the same offset as the - // the enum inner class. - while (newNew != null && currentNew.compareTo(newNew) == 0) { - newNew = itNew.hasNext() ? itNew.next() : null; + if (i.template == INITIAL_COMMENT_FOLD_TEMPLATE) { + initialCommentFold = f; } - - currentNew = newNew; } } - currentFolds = updatedFolds; + for (FoldInfo i : removed) { + Fold f = currentFolds.remove(i); + + operation.removeFromHierarchy(f, tr); + + if (importsFold == f ) { + importsFold = null; + } + + if (initialCommentFold == f) { + initialCommentFold = null; + } + } + + currentFolds.putAll(added); } catch (BadLocationException e) { Exceptions.printStackTrace(e); } finally { @@ -365,9 +343,8 @@ new Object[] {file, endTime - startTime}); } } - - //@GuardedBy(FoldOperation.openTransaction()) - private List currentFolds; //in natural order + + private Map currentFolds; private Fold initialCommentFold; private Fold importsFold; @@ -560,12 +537,10 @@ protected static final class FoldInfo implements Comparable { - private final Position start; - private final Position end; - private final FoldTemplate template; - private final boolean collapseByDefault; - //@GUardedBy(FoldOperation.openTransaction()) - private Fold fold; + private Position start; + private Position end; + private FoldTemplate template; + private boolean collapseByDefault; public FoldInfo(Document doc, int start, int end, FoldTemplate template, boolean collapseByDefault) throws BadLocationException { this.start = doc.createPosition(start); @@ -574,6 +549,19 @@ this.collapseByDefault = collapseByDefault; } + @Override + public int hashCode() { + return 1; + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof FoldInfo)) + return false; + + return compareTo(o) == 0; + } + public int compareTo(Object o) { FoldInfo remote = (FoldInfo) o; @@ -592,15 +580,10 @@ if (end.getOffset() > remote.end.getOffset()) { return 1; } - - //XXX: abusing the length of the fold description to implement ordering (the exact order does not matter in this case): - return template.getDescription().length() - remote.template.getDescription().length(); - } - - @Override - public String toString() { - return "FoldInfo[" + start.getOffset() + ", " + end.getOffset() + ", " + template.getDescription() + "]"; + + return 0; } + } } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManagerTaskFactory.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManagerTaskFactory.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManagerTaskFactory.java 2011-08-04 21:48:28.728434605 +0100 @@ -45,12 +45,11 @@ import org.netbeans.api.java.source.CancellableTask; import org.netbeans.api.java.source.CompilationInfo; +import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.api.java.source.JavaSource.Priority; -import org.netbeans.api.java.source.JavaSourceTaskFactory; import org.netbeans.api.java.source.support.EditorAwareJavaSourceTaskFactory; import org.openide.filesystems.FileObject; -import org.openide.util.Lookup; /** * @@ -59,6 +58,7 @@ @org.openide.util.lookup.ServiceProvider(service=org.netbeans.api.java.source.JavaSourceTaskFactory.class) public class JavaElementFoldManagerTaskFactory extends EditorAwareJavaSourceTaskFactory { + /** Creates a new instance of JavaElementFoldManagerTaskFactory */ public JavaElementFoldManagerTaskFactory() { super(Phase.PARSED, Priority.NORMAL); } @@ -66,12 +66,5 @@ public CancellableTask createTask(FileObject file) { return JavaElementFoldManager.JavaElementFoldTask.getTask(file); } - - public static void doRefresh(FileObject file) { - for (JavaSourceTaskFactory f : Lookup.getDefault().lookupAll(JavaSourceTaskFactory.class)) { - if (f instanceof JavaElementFoldManagerTaskFactory) { - ((JavaElementFoldManagerTaskFactory) f).reschedule(file); - } - } - } + } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/hyperlink/JavaHyperlinkProvider.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/hyperlink/JavaHyperlinkProvider.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/hyperlink/JavaHyperlinkProvider.java 2011-08-04 21:48:28.728434605 +0100 @@ -88,7 +88,7 @@ case ALT_HYPERLINK: JTextComponent focused = EditorRegistry.focusedComponent(); - if (focused != null && focused.getDocument() == doc) { + if (focused.getDocument() == doc) { focused.setCaretPosition(offset); GoToImplementation.goToImplementation(focused); } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml 2011-08-04 21:48:28.728434605 +0100 @@ -378,7 +378,7 @@ ${cursor} } ]]> - Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/rename/InstantRenamePerformer.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/rename/InstantRenamePerformer.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/rename/InstantRenamePerformer.java 2011-08-04 21:48:28.728434605 +0100 @@ -43,23 +43,15 @@ */ package org.netbeans.modules.java.editor.rename; -import com.sun.source.tree.BreakTree; -import com.sun.source.tree.ContinueTree; -import com.sun.source.tree.LabeledStatementTree; -import com.sun.source.tree.StatementTree; import com.sun.source.tree.Tree.Kind; import com.sun.source.util.TreePath; -import com.sun.source.util.TreePathScanner; import java.awt.Color; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.IOException; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashSet; -import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.logging.Level; @@ -68,7 +60,6 @@ import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; -import javax.lang.model.element.Name; import javax.lang.model.element.TypeElement; import javax.lang.model.util.ElementFilter; import javax.lang.model.util.ElementScanner6; @@ -76,8 +67,6 @@ import javax.swing.event.CaretEvent; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.event.UndoableEditEvent; -import javax.swing.event.UndoableEditListener; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.Document; @@ -85,7 +74,6 @@ import javax.swing.text.Position; import javax.swing.text.Position.Bias; import javax.swing.text.StyleConstants; -import javax.swing.undo.AbstractUndoableEdit; import javax.swing.undo.CannotUndoException; import javax.swing.undo.UndoableEdit; import org.netbeans.api.editor.mimelookup.MimeLookup; @@ -181,13 +169,7 @@ region = new SyncDocumentRegion(doc, regions); if (doc instanceof BaseDocument) { - BaseDocument bdoc = ((BaseDocument) doc); - bdoc.setPostModificationDocumentListener(this); - - UndoableEdit undo = new CancelInstantRenameUndoableEdit(this); - for (UndoableEditListener l : bdoc.getUndoableEditListeners()) { - l.undoableEditHappened(new UndoableEditEvent(doc, undo)); - } + ((BaseDocument) doc).setPostModificationDocumentListener(this); } target.addKeyListener(this); @@ -322,19 +304,6 @@ : info.getTrees().getElement(path); if (el == null) { - if (EnumSet.of(Kind.LABELED_STATEMENT, Kind.BREAK, Kind.CONTINUE).contains(path.getLeaf().getKind())) { - Token span = org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, doc, path); - if (span != null && span.offset(null) <= adjustedCaret[0] && adjustedCaret[0] <= span.offset(null) + span.length()) { - if (path.getLeaf().getKind() != Kind.LABELED_STATEMENT) { - StatementTree tgt = info.getTreeUtilities().getBreakContinueTarget(path); - path = tgt != null ? info.getTrees().getPath(info.getCompilationUnit(), tgt) : null; - } - if (path != null) { - wasResolved[0] = true; - return collectLabels(info, doc, path); - } - } - } wasResolved[0] = false; return null; } @@ -402,31 +371,6 @@ return null; } - private static Set collectLabels(final CompilationInfo info, final Document document, final TreePath labeledStatement) { - final Set result = new LinkedHashSet(); - if (labeledStatement.getLeaf().getKind() == Kind.LABELED_STATEMENT) { - result.add(org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, document, labeledStatement)); - final Name label = ((LabeledStatementTree)labeledStatement.getLeaf()).getLabel(); - new TreePathScanner () { - @Override - public Void visitBreak(BreakTree node, Void p) { - if (node.getLabel() != null && label.contentEquals(node.getLabel())) { - result.add(org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, document, getCurrentPath())); - } - return super.visitBreak(node, p); - } - @Override - public Void visitContinue(ContinueTree node, Void p) { - if (node.getLabel() != null && label.contentEquals(node.getLabel())) { - result.add(org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, document, getCurrentPath())); - } - return super.visitContinue(node, p); - } - }.scan(labeledStatement, null); - } - return result; - } - private static boolean allowInstantRename(Element e, ElementUtilities eu) { if (org.netbeans.modules.java.editor.semantic.Utilities.isPrivateElement(e)) { return true; @@ -845,26 +789,5 @@ return bag; } - - private static class CancelInstantRenameUndoableEdit extends AbstractUndoableEdit { - - private final Reference performer; - - public CancelInstantRenameUndoableEdit(InstantRenamePerformer performer) { - this.performer = new WeakReference(performer); - } - - @Override public boolean isSignificant() { - return false; - } - - @Override public void undo() throws CannotUndoException { - InstantRenamePerformer perf = performer.get(); - - if (perf != null) { - perf.release(); - } - } - } } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionItem.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionItem.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionItem.java 2011-08-04 21:48:28.728434605 +0100 @@ -363,20 +363,7 @@ } public boolean instantSubstitution(JTextComponent component) { - if (component != null) { - try { - int caretOffset = component.getSelectionEnd(); - if (caretOffset > substitutionOffset) { - String text = component.getDocument().getText(substitutionOffset, caretOffset - substitutionOffset); - if (!getInsertPrefix().toString().startsWith(text)) { - return false; - } - } - } - catch (BadLocationException ble) {} - } - defaultAction(component); - return true; + return delegate.instantSubstitution(component); } public int getSortPriority() { Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/MarkOccurrencesHighlighter.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/semantic/MarkOccurrencesHighlighter.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/MarkOccurrencesHighlighter.java 2011-08-04 21:48:28.738408732 +0100 @@ -43,12 +43,9 @@ */ package org.netbeans.modules.java.editor.semantic; -import com.sun.source.tree.BreakTree; import com.sun.source.tree.ClassTree; import com.sun.source.tree.CompilationUnitTree; -import com.sun.source.tree.ContinueTree; import com.sun.source.tree.DoWhileLoopTree; -import com.sun.source.tree.EnhancedForLoopTree; import com.sun.source.tree.ForLoopTree; import com.sun.source.tree.ImportTree; import com.sun.source.tree.LabeledStatementTree; @@ -62,7 +59,6 @@ import com.sun.source.tree.WhileLoopTree; import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; -import com.sun.source.util.TreePathScanner; import java.awt.Color; import java.util.ArrayList; @@ -79,7 +75,6 @@ import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; -import javax.lang.model.element.Name; import javax.lang.model.element.TypeElement; import javax.lang.model.util.ElementFilter; import javax.swing.event.DocumentEvent; @@ -394,17 +389,8 @@ Tree tree =tp.getLeaf(); - if (node.getBoolean(MarkOccurencesSettings.BREAK_CONTINUE, true)) { - if (tree.getKind() == Kind.BREAK || tree.getKind() == Kind.CONTINUE) { - return detectBreakOrContinueTarget(info, doc, tp, caretPosition); - } else if (tree.getKind() == Kind.LABELED_STATEMENT) { - int[] span = Utilities.findIdentifierSpan(tp, info, doc); - if (span[0] <= caretPosition && caretPosition <= span[1]) { - List ret = detectLabel(info, doc, tp); - ret.add(span); - return ret; - } - } + if (node.getBoolean(MarkOccurencesSettings.BREAK_CONTINUE, true) && (tree.getKind() == Kind.BREAK || tree.getKind() == Kind.CONTINUE)) { + return detectBreakOrContinueTarget(info, doc, tp); } Element el; @@ -604,7 +590,7 @@ return highlights; } - private List detectBreakOrContinueTarget(CompilationInfo info, Document document, TreePath breakOrContinue, int caretPosition) { + private List detectBreakOrContinueTarget(CompilationInfo info, Document document, TreePath breakOrContinue) { List result = new ArrayList(); StatementTree target = info.getTreeUtilities().getBreakContinueTarget(breakOrContinue); @@ -612,7 +598,7 @@ return null; TokenSequence ts = info.getTokenHierarchy().tokenSequence(JavaTokenId.language()); - + ts.move((int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), target)); if (ts.moveNext()) { @@ -634,10 +620,6 @@ if (((ForLoopTree) statement).getStatement().getKind() == Kind.BLOCK) block = ((ForLoopTree) statement).getStatement(); break; - case ENHANCED_FOR_LOOP: - if (((EnhancedForLoopTree) statement).getStatement().getKind() == Kind.BLOCK) - block = ((EnhancedForLoopTree) statement).getStatement(); - break; case DO_WHILE_LOOP: if (((DoWhileLoopTree) statement).getStatement().getKind() == Kind.BLOCK) block = ((DoWhileLoopTree) statement).getStatement(); @@ -651,37 +633,9 @@ result.add(new int[] {ts.offset(), ts.offset() + ts.token().length()}); } } - - if (target.getKind() == Kind.LABELED_STATEMENT && isIn(caretPosition, Utilities.findIdentifierSpan(info, document, breakOrContinue))) { - result.addAll(detectLabel(info, document, info.getTrees().getPath(info.getCompilationUnit(), target))); - } return result; } - - private List detectLabel(final CompilationInfo info, final Document document, final TreePath labeledStatement) { - final List result = new ArrayList(); - if (labeledStatement.getLeaf().getKind() == Kind.LABELED_STATEMENT) { - final Name label = ((LabeledStatementTree)labeledStatement.getLeaf()).getLabel(); - new TreePathScanner () { - @Override - public Void visitBreak(BreakTree node, Void p) { - if (node.getLabel() != null && label.contentEquals(node.getLabel())) { - result.add(Utilities.findIdentifierSpan(getCurrentPath(), info, document)); - } - return super.visitBreak(node, p); - } - @Override - public Void visitContinue(ContinueTree node, Void p) { - if (node.getLabel() != null && label.contentEquals(node.getLabel())) { - result.add(Utilities.findIdentifierSpan(getCurrentPath(), info, document)); - } - return super.visitContinue(node, p); - } - }.scan(labeledStatement, null); - } - return result; - } static OffsetsBag getHighlightsBag(Document doc) { OffsetsBag bag = (OffsetsBag) doc.getProperty(MarkOccurrencesHighlighter.class); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/Utilities.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/semantic/Utilities.java 2011-07-28 20:45:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/Utilities.java 2011-08-04 21:48:28.738408732 +0100 @@ -44,12 +44,9 @@ package org.netbeans.modules.java.editor.semantic; import com.sun.source.tree.ArrayTypeTree; -import com.sun.source.tree.BreakTree; import com.sun.source.tree.IdentifierTree; import com.sun.source.tree.ClassTree; import com.sun.source.tree.CompilationUnitTree; -import com.sun.source.tree.ContinueTree; -import com.sun.source.tree.LabeledStatementTree; import com.sun.source.tree.MemberSelectTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.ParameterizedTypeTree; @@ -60,7 +57,6 @@ import com.sun.source.util.TreePath; import java.util.ArrayList; import java.util.Collections; -import java.util.EnumSet; import java.util.HashMap; import java.util.logging.Level; import javax.swing.text.BadLocationException; @@ -285,58 +281,7 @@ if (class2Kind.get(ParameterizedTypeTree.class).contains(leaf.getKind())) { return findIdentifierSpanImpl(info, new TreePath(decl, ((ParameterizedTypeTree) leaf).getType())); } - if (class2Kind.get(BreakTree.class).contains(leaf.getKind())) { - Name name = ((BreakTree) leaf).getLabel(); - - if (name == null || name.length() == 0) - return null; - - SourcePositions positions = info.getTrees().getSourcePositions(); - CompilationUnitTree cu = info.getCompilationUnit(); - int start = (int)positions.getStartPosition(cu, leaf); - int end = (int)positions.getEndPosition(cu, leaf); - - if (start == (-1) || end == (-1)) { - return null; - } - - return findTokenWithText(info, name.toString(), start, end); - } - if (class2Kind.get(ContinueTree.class).contains(leaf.getKind())) { - Name name = ((ContinueTree) leaf).getLabel(); - - if (name == null || name.length() == 0) - return null; - - SourcePositions positions = info.getTrees().getSourcePositions(); - CompilationUnitTree cu = info.getCompilationUnit(); - int start = (int)positions.getStartPosition(cu, leaf); - int end = (int)positions.getEndPosition(cu, leaf); - - if (start == (-1) || end == (-1)) { - return null; - } - - return findTokenWithText(info, name.toString(), start, end); - } - if (class2Kind.get(LabeledStatementTree.class).contains(leaf.getKind())) { - Name name = ((LabeledStatementTree) leaf).getLabel(); - - if (name == null || name.length() == 0) - return null; - - SourcePositions positions = info.getTrees().getSourcePositions(); - CompilationUnitTree cu = info.getCompilationUnit(); - int start = (int)positions.getStartPosition(cu, leaf); - int end = (int)positions.getStartPosition(cu, ((LabeledStatementTree) leaf).getStatement()); - - if (start == (-1) || end == (-1)) { - return null; - } - - return findTokenWithText(info, name.toString(), start, end); - } - throw new IllegalArgumentException("Only MethodDecl, VariableDecl, MemberSelectTree, IdentifierTree, ClassDecl, BreakTree, ContinueTree, and LabeledStatementTree are accepted by this method. Got: " + leaf.getKind()); + throw new IllegalArgumentException("Only MethodDecl, VariableDecl, MemberSelectTree, IdentifierTree and ClassDecl are accepted by this method. Got: " + leaf.getKind()); } public static int[] findIdentifierSpan( final TreePath decl, final CompilationInfo info, final Document doc) { @@ -564,11 +509,18 @@ return false; } - - private static final Set LOCAL_ELEMENT_KINDS = EnumSet.of(ElementKind.PARAMETER, ElementKind.LOCAL_VARIABLE, ElementKind.EXCEPTION_PARAMETER, ElementKind.RESOURCE_VARIABLE); - + public static boolean isPrivateElement(Element el) { - return LOCAL_ELEMENT_KINDS.contains(el.getKind()) || el.getModifiers().contains(Modifier.PRIVATE); + if (el.getKind() == ElementKind.PARAMETER) + return true; + + if (el.getKind() == ElementKind.LOCAL_VARIABLE) + return true; + + if (el.getKind() == ElementKind.EXCEPTION_PARAMETER) + return true; + + return el.getModifiers().contains(Modifier.PRIVATE); } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/SemanticHighlighter.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/semantic/SemanticHighlighter.java 2011-07-28 20:45:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/SemanticHighlighter.java 2011-08-04 21:48:28.738408732 +0100 @@ -55,6 +55,7 @@ import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.CompoundAssignmentTree; import com.sun.source.tree.ConditionalExpressionTree; +import com.sun.source.tree.DisjunctiveTypeTree; import com.sun.source.tree.EnhancedForLoopTree; import com.sun.source.tree.ExpressionStatementTree; import com.sun.source.tree.ExpressionTree; @@ -76,7 +77,6 @@ import com.sun.source.tree.TypeCastTree; import com.sun.source.tree.TypeParameterTree; import com.sun.source.tree.UnaryTree; -import com.sun.source.tree.UnionTypeTree; import com.sun.source.tree.VariableTree; import com.sun.source.tree.WildcardTree; import com.sun.source.util.SourcePositions; @@ -1412,11 +1412,11 @@ } @Override - public Void visitUnionType(UnionTypeTree node, EnumSet p) { + public Void visitDisjunctiveType(DisjunctiveTypeTree node, EnumSet p) { for (Tree tree : node.getTypeAlternatives()) { handlePossibleIdentifier(new TreePath(getCurrentPath(), tree), EnumSet.of(UseTypes.CLASS_USE)); } - return super.visitUnionType(node, p); + return super.visitDisjunctiveType(node, p); } @Override Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateProcessor.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateProcessor.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateProcessor.java 2011-08-04 21:48:28.738408732 +0100 @@ -380,7 +380,8 @@ if (tpe != null) return tpe.getSimpleName().toString(); } - tm = resolveCapturedType(tm); + if (tm.getKind() == TypeKind.TYPEVAR) + tm = ((TypeVariable)tm).getUpperBound(); String value = Utilities.getTypeName(cInfo, tm, true).toString(); if (value != null) { param2hints.put(param, TYPE); @@ -394,7 +395,8 @@ } else if (ITERABLE_ELEMENT_TYPE.equals(entry.getKey())) { TypeMirror tm = iterableElementType(param.getInsertTextOffset() + 1); if (tm != null && tm.getKind() != TypeKind.ERROR) { - tm = resolveCapturedType(tm); + if (tm.getKind() == TypeKind.TYPEVAR) + tm = ((TypeVariable)tm).getUpperBound(); String value = Utilities.getTypeName(cInfo, tm, true).toString(); if (value != null) { param2hints.put(param, ITERABLE_ELEMENT_TYPE); @@ -406,7 +408,8 @@ } else if (LEFT_SIDE_TYPE.equals(entry.getKey())) { TypeMirror tm = assignmentSideType(param.getInsertTextOffset() + 1, true); if (tm != null && tm.getKind() != TypeKind.ERROR) { - tm = resolveCapturedType(tm); + if (tm.getKind() == TypeKind.TYPEVAR) + tm = ((TypeVariable)tm).getUpperBound(); String value = Utilities.getTypeName(cInfo, tm, true).toString(); if (value != null) { param2hints.put(param, LEFT_SIDE_TYPE); @@ -418,7 +421,8 @@ } else if (RIGHT_SIDE_TYPE.equals(entry.getKey())) { TypeMirror tm = assignmentSideType(param.getInsertTextOffset() + 1, false); if (tm != null && tm.getKind() != TypeKind.ERROR) { - tm = resolveCapturedType(tm); + if (tm.getKind() == TypeKind.TYPEVAR) + tm = ((TypeVariable)tm).getUpperBound(); String value = Utilities.getTypeName(cInfo, tm, true).toString(); if (value != null) { param2hints.put(param, RIGHT_SIDE_TYPE); @@ -434,7 +438,6 @@ param2types.remove(param); return ""; //NOI18N } else if (tm.getKind() != TypeKind.ERROR) { - tm = resolveCapturedType(tm); String value = Utilities.getTypeName(cInfo, tm, true).toString(); if (value != null) { param2hints.put(param, CAST); @@ -454,7 +457,8 @@ } else if (UNCAUGHT_EXCEPTION_TYPE.equals(entry.getKey())) { TypeMirror tm = uncaughtExceptionType(param.getInsertTextOffset() + 1); if (tm != null && tm.getKind() != TypeKind.ERROR) { - tm = resolveCapturedType(tm); + if (tm.getKind() == TypeKind.TYPEVAR) + tm = ((TypeVariable)tm).getUpperBound(); String value = Utilities.getTypeName(cInfo, tm, true).toString(); if (value != null) { param2hints.put(param, UNCAUGHT_EXCEPTION_TYPE); @@ -621,7 +625,6 @@ } } } - return cInfo.getTreeUtilities().parseType(typeName, enclClass); } } catch (Exception e) { } @@ -856,15 +859,6 @@ } } - private TypeMirror resolveCapturedType(TypeMirror type) { - if (type.getKind() == TypeKind.TYPEVAR) { - WildcardType wildcard = SourceUtils.resolveCapturedType(type); - if (wildcard != null) - return wildcard.getExtendsBound(); - } - return type; - } - private boolean initParsing() { if (cInfo == null) { JTextComponent c = request.getComponent(); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/SelectCodeElementAction.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/SelectCodeElementAction.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/SelectCodeElementAction.java 2011-08-04 21:48:28.738408732 +0100 @@ -150,18 +150,16 @@ public void selectNext() { if (selectionInfos == null) { final JavaSource js = JavaSource.forDocument(target.getDocument()); - if (js != null) { - cancel = new AtomicBoolean(); - ProgressUtils.runOffEventDispatchThread(new Runnable() { - public void run() { - try { - js.runUserActionTask(SelectionHandler.this, true); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - } + cancel = new AtomicBoolean(); + ProgressUtils.runOffEventDispatchThread(new Runnable() { + public void run() { + try { + js.runUserActionTask(SelectionHandler.this, true); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); } - }, name, cancel, false); - } + } + }, name, cancel, false); } run(); } @@ -221,7 +219,7 @@ } public void run() { - if (selectionInfos != null && selIndex < selectionInfos.length - 1) { + if (selIndex < selectionInfos.length - 1) { select(selectionInfos[++selIndex]); } } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java 2011-08-04 21:48:28.738408732 +0100 @@ -241,8 +241,8 @@ } } - public static final JavaCompletionItem createInitializeAllConstructorItem(CompilationInfo info, Iterable fields, ExecutableElement superConstructor, TypeElement parent, int substitutionOffset) { - return new InitializeAllConstructorItem(info, fields, superConstructor, parent, substitutionOffset); + public static final JavaCompletionItem createInitializeAllConstructorItem(CompilationInfo info, Iterable fields, TypeElement parent, int substitutionOffset) { + return new InitializeAllConstructorItem(info, fields, parent, substitutionOffset); } public static final String COLOR_END = ""; //NOI18N @@ -3148,13 +3148,12 @@ private List> fieldHandles; private ElementHandle parentHandle; - private ElementHandle superConstructorHandle; private String simpleName; private List params; private String sortText; private String leftText; - private InitializeAllConstructorItem(CompilationInfo info, Iterable fields, ExecutableElement superConstructor, TypeElement parent, int substitutionOffset) { + private InitializeAllConstructorItem(CompilationInfo info, Iterable fields, TypeElement parent, int substitutionOffset) { super(substitutionOffset); this.fieldHandles = new ArrayList>(); this.parentHandle = ElementHandle.create(parent); @@ -3163,10 +3162,6 @@ this.fieldHandles.add(ElementHandle.create(ve)); this.params.add(new ParamDesc(null, Utilities.getTypeName(info, ve.asType(), false).toString(), ve.getSimpleName().toString())); } - this.superConstructorHandle = ElementHandle.create(superConstructor); - for (VariableElement ve : superConstructor.getParameters()) { - this.params.add(new ParamDesc(null, Utilities.getTypeName(info, ve.asType(), false).toString(), ve.getSimpleName().toString())); - } this.simpleName = parent.getSimpleName().toString(); } @@ -3261,12 +3256,11 @@ else break; } - ExecutableElement superConstructor = superConstructorHandle.resolve(copy); TreeMaker make = copy.getTreeMaker(); ClassTree clazz = (ClassTree) tp.getLeaf(); GeneratorUtilities gu = GeneratorUtilities.get(copy); - ClassTree decl = make.insertClassMember(clazz, idx, gu.createConstructor(parent, fieldElements, superConstructor)); //NOI18N + ClassTree decl = make.insertClassMember(clazz, idx, gu.createConstructor(parent, fieldElements, null)); //NOI18N copy.rewrite(clazz, decl); } @@ -3360,13 +3354,7 @@ int endPos = (int)sp.getEndPosition(tp.getCompilationUnit(), t); TokenSequence ts = findLastNonWhitespaceToken(controller, embeddedOffset, endPos); if (ts != null) { - if (ts.token().id() == JavaTokenId.SEMICOLON) { - ret[0] = -1; - } else if (ts.moveNext()) { - ret[0] = ts.token().id() == JavaTokenId.LINE_COMMENT || ts.token().id() == JavaTokenId.WHITESPACE && ts.token().text().toString().contains("\n") ? ts.offset() : offset; - } else { - ret[0] = ts.offset() + ts.token().length(); - } + ret[0] = ts.token().id() == JavaTokenId.SEMICOLON ? -1 : ts.offset() + ts.token().length(); } } else { TokenSequence ts = controller.getTokenHierarchy().tokenSequence(JavaTokenId.language()); Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaKit.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaKit.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaKit.java 2011-08-04 21:48:28.748408787 +0100 @@ -103,7 +103,7 @@ private static final Logger LOGGER = Logger.getLogger(JavaKit.class.getName()); -// private static final Object sourceLevelKey = new Object(); + private static final Object sourceLevelKey = new Object(); public JavaKit(){ } @@ -112,20 +112,20 @@ return JAVA_MIME_TYPE; } -// /** Create new instance of syntax coloring scanner -// * @param doc document to operate on. It can be null in the cases the syntax -// * creation is not related to the particular document -// */ -// public Syntax createSyntax(Document doc) { -// // XXX: sourcelevel can be subject of changes, ignored by this cache -// // Should not be a problem here however. Covered by #171330. -// String sourceLevel = (String) doc.getProperty(sourceLevelKey); -// if (sourceLevel == null) { -// sourceLevel = getSourceLevel((BaseDocument) doc); -// doc.putProperty(sourceLevelKey, sourceLevel); -// } -// return new JavaSyntax(sourceLevel); -// } + /** Create new instance of syntax coloring scanner + * @param doc document to operate on. It can be null in the cases the syntax + * creation is not related to the particular document + */ + public Syntax createSyntax(Document doc) { + // XXX: sourcelevel can be subject of changes, ignored by this cache + // Should not be a problem here however. Covered by #171330. + String sourceLevel = (String) doc.getProperty(sourceLevelKey); + if (sourceLevel == null) { + sourceLevel = getSourceLevel((BaseDocument) doc); + doc.putProperty(sourceLevelKey, sourceLevel); + } + return new JavaSyntax(sourceLevel); + } public String getSourceLevel(BaseDocument doc) { DataObject dob = NbEditorUtilities.getDataObject(doc); @@ -516,10 +516,9 @@ public void actionPerformed(ActionEvent evt, JTextComponent target) { try { super.actionPerformed(evt, target); - Document doc = target.getDocument(); - if (isJavadocTouched && !org.netbeans.lib.editor.util.swing.DocumentUtilities.isWriteLocked(doc)) { - // XXX temporary solution until the editor will provide a SPI to plug. See issue #115739 - // This must run outside the document lock + // XXX temporary solution until the editor will provide a SPI to plug. See issue #115739 + // This must run outside the document lock + if (isJavadocTouched) { Lookup.Result res = MimeLookup.getLookup(MimePath.parse("text/x-javadoc")).lookupResult(TextAction.class); ActionEvent newevt = new ActionEvent(target, ActionEvent.ACTION_PERFORMED, "fix-javadoc"); for (TextAction action : res.allInstances()) { @@ -527,6 +526,7 @@ } } else { //Complete block comment + Document doc = target.getDocument(); int start = ((AbstractDocument) doc).getParagraphElement(target.getCaretPosition()).getStartOffset(); int end = ((AbstractDocument) doc).getParagraphElement(target.getCaretPosition()).getEndOffset(); //Check if line with just one * surrounded by spaces is already entered Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/CamelCaseOperations.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/CamelCaseOperations.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/CamelCaseOperations.java 2011-08-04 21:48:28.748408787 +0100 @@ -44,16 +44,14 @@ package org.netbeans.modules.editor.java; -import java.util.List; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.swing.text.JTextComponent; -import org.netbeans.api.java.lexer.JavaTokenId; -import org.netbeans.api.lexer.Token; -import org.netbeans.api.lexer.TokenHierarchy; -import org.netbeans.api.lexer.TokenSequence; import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.SyntaxSupport; +import org.netbeans.editor.TokenItem; import org.netbeans.editor.Utilities; +import org.netbeans.editor.ext.ExtSyntaxSupport; import org.openide.util.Exceptions; /** @@ -63,25 +61,25 @@ /* package */ class CamelCaseOperations { static int nextCamelCasePosition(JTextComponent textComponent) throws BadLocationException { + SyntaxSupport syntaxSupport = Utilities.getSyntaxSupport(textComponent); + if (syntaxSupport == null) { + // no syntax support available :( + return -1; + } + // get current caret position int offset = textComponent.getCaretPosition(); - Document doc = textComponent.getDocument(); - TokenHierarchy th = doc != null ? TokenHierarchy.get(doc) : null; - List> embeddedSequences = th != null ? th.embeddedTokenSequences(offset, false) : null; - TokenSequence seq = embeddedSequences != null ? embeddedSequences.get(embeddedSequences.size() - 1) : null; - - if (seq != null) seq.move(offset); - - Token t = seq != null && seq.moveNext() ? seq.offsetToken() : null; + // get token chain at the offset + 1 ( + 1 so that the following uppercase char is skipped + TokenItem tokenItem = ((ExtSyntaxSupport) syntaxSupport).getTokenChain(offset, offset + 1); // is this an identifier - if (t != null && t.id() == JavaTokenId.IDENTIFIER) { // NOI18N - String image = t.text().toString(); + if (tokenItem != null && ("identifier".equals(tokenItem.getTokenID().getName()))) { // NOI18N + String image = tokenItem.getImage(); if (image != null && image.length() > 0) { int length = image.length(); // is caret at the end of the identifier - if (offset != (t.offset(th) + length)) { - int offsetInImage = offset - t.offset(th); + if (offset != (tokenItem.getOffset() + length)) { + int offsetInImage = offset - tokenItem.getOffset(); int start = offsetInImage + 1; if (Character.isUpperCase(image.charAt(offsetInImage))) { // if starting from a Uppercase char, first skip over follwing upper case chars @@ -97,11 +95,11 @@ char charAtI = image.charAt(i); if (Character.isUpperCase(charAtI)) { // return offset of next uppercase char in the identifier - return t.offset(th) + i; + return tokenItem.getOffset() + i; } } } - return t.offset(th) + image.length(); + return tokenItem.getOffset() + image.length(); } } @@ -110,36 +108,39 @@ } static int previousCamelCasePosition(JTextComponent textComponent) throws BadLocationException { + SyntaxSupport syntaxSupport = Utilities.getSyntaxSupport(textComponent); + if (syntaxSupport == null) { + // no syntax support available :( + return -1; + } + // get current caret position int offset = textComponent.getCaretPosition(); - Document doc = textComponent.getDocument(); - TokenHierarchy th = doc != null ? TokenHierarchy.get(doc) : null; - List> embeddedSequences = th != null ? th.embeddedTokenSequences(offset, false) : null; - TokenSequence seq = embeddedSequences != null ? embeddedSequences.get(embeddedSequences.size() - 1) : null; - if (seq != null) seq.move(offset); + // Are we at the beginning of the document + if (offset == 0) { + return -1; + } - Token t = seq != null && seq.moveNext() ? seq.offsetToken() : null; + // get token chain at the offset + TokenItem tokenItem = ((ExtSyntaxSupport) syntaxSupport).getTokenChain(offset - 1, offset); // is this an identifier - if (t != null) { - if (t.offset(th) == offset) { - t = seq.movePrevious() ? seq.offsetToken() : null; - } - if (t != null && t.id() == JavaTokenId.IDENTIFIER) { // NOI18N - String image = t.text().toString(); + if (tokenItem != null) { + if ("identifier".equals(tokenItem.getTokenID().getName())) { // NOI18N + String image = tokenItem.getImage(); if (image != null && image.length() > 0) { int length = image.length(); - int offsetInImage = offset - 1 - t.offset(th); + int offsetInImage = offset - 1 - tokenItem.getOffset(); if (Character.isUpperCase(image.charAt(offsetInImage))) { for (int i = offsetInImage - 1; i >= 0; i--) { char charAtI = image.charAt(i); if (!Character.isUpperCase(charAtI)) { // return offset of previous uppercase char in the identifier - return t.offset(th) + i + 1; + return tokenItem.getOffset() + i + 1; } } - return t.offset(th); + return tokenItem.getOffset(); } else { for (int i = offsetInImage - 1; i >= 0; i--) { char charAtI = image.charAt(i); @@ -149,27 +150,27 @@ char charAtJ = image.charAt(j); if (!Character.isUpperCase(charAtJ)) { // return offset of previous uppercase char in the identifier - return t.offset(th) + j + 1; + return tokenItem.getOffset() + j + 1; } } - return t.offset(th); + return tokenItem.getOffset(); } } } - return t.offset(th); + return tokenItem.getOffset(); } - } else if (t != null && t.id() == JavaTokenId.WHITESPACE) { // NOI18N - Token whitespaceToken = t; - while (whitespaceToken != null && whitespaceToken.id() == JavaTokenId.WHITESPACE) { - int wsOffset = whitespaceToken.offset(th); + } else if ("whitespace".equals(tokenItem.getTokenID().getName())) { // NOI18N + TokenItem whitespaceTokenItem = tokenItem; + while (whitespaceTokenItem != null && "whitespace".equals(whitespaceTokenItem.getTokenID().getName())) { + int wsOffset = whitespaceTokenItem.getOffset(); if (wsOffset == 0) { //#145250: at the very beginning of a file return 0; } - whitespaceToken = seq.movePrevious() ? seq.offsetToken() : null; + whitespaceTokenItem =((ExtSyntaxSupport) syntaxSupport).getTokenChain(wsOffset - 1, wsOffset); } - if (whitespaceToken != null) { - return whitespaceToken.offset(th) + whitespaceToken.length(); + if (whitespaceTokenItem != null) { + return whitespaceTokenItem.getOffset() + whitespaceTokenItem.getImage().length(); } } } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java 2011-08-04 21:48:28.748408787 +0100 @@ -456,7 +456,7 @@ // Search would stop on an extra opening left brace if found int braceBalance = 0; // balance of '{' and '}' int bracketBalance = -1; // balance of the brackets or parenthesis - int numOfSemi = 0; + int lastRBracketIndex = javaTS.index(); boolean finished = false; while (!finished && javaTS.movePrevious()) { JavaTokenId id = javaTS.token().id(); @@ -499,31 +499,9 @@ case RBRACE: braceBalance--; break; - - case SEMICOLON: - numOfSemi++; - break; } } - if (bracketBalance == 0 && numOfSemi < 2) { - finished = false; - while (!finished && javaTS.movePrevious()) { - switch (javaTS.token().id()) { - case WHITESPACE: - case LINE_COMMENT: - case BLOCK_COMMENT: - case JAVADOC_COMMENT: - break; - case FOR: - bracketBalance--; - default: - finished = true; - break; - } - } - } - skipClosingBracket = bracketBalance != 0; //commented out due to #147683: Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java 2011-08-04 21:48:28.758408099 +0100 @@ -644,8 +644,8 @@ case CATCH: insideCatch(env); break; - case UNION_TYPE: - insideUnionType(env); + case DISJUNCTIVE_TYPE: + insideDisjunctiveType(env); break; case IF: insideIf(env); @@ -1831,10 +1831,10 @@ } } - private void insideUnionType(Env env) throws IOException { + private void insideDisjunctiveType(Env env) throws IOException { TreePath path = env.getPath(); String prefix = env.getPrefix(); - UnionTypeTree dtt = (UnionTypeTree)path.getLeaf(); + DisjunctiveTypeTree dtt = (DisjunctiveTypeTree)path.getLeaf(); CompilationController controller = env.getController(); TokenSequence last = findLastNonWhitespaceToken(env, dtt, env.getOffset()); if (last != null && last.token().id() == JavaTokenId.BAR) { @@ -2356,8 +2356,8 @@ results.add(JavaCompletionItem.createVariableItem(env.getController(), name, anchorOffset, true, false)); return; } - if (et.getKind() == Tree.Kind.UNION_TYPE) { - for(Tree t : ((UnionTypeTree)et).getTypeAlternatives()) { + if (et.getKind() == Tree.Kind.DISJUNCTIVE_TYPE) { + for(Tree t : ((DisjunctiveTypeTree)et).getTypeAlternatives()) { et = t; exPath = new TreePath(exPath, t); } @@ -3733,52 +3733,27 @@ if (e.getKind().isField()) initializedFields.add((VariableElement)e); } - Map ctors2generate = new LinkedHashMap(); GeneratorUtils.scanForFieldsAndConstructors(controller, clsPath, initializedFields, uninitializedFields, constructors); - for (ExecutableElement ctor : ElementFilter.constructorsIn(((DeclaredType)te.getSuperclass()).asElement().getEnclosedElements())) { - if (!ctor.getModifiers().contains(Modifier.PRIVATE)) { - ctors2generate.put(ctor, new boolean[] {true, !uninitializedFields.isEmpty()}); - } - } + boolean hasDefaultConstructor = false; + boolean hasConstrutorForAllUnintialized = false; for (ExecutableElement ee : constructors) { - if (!controller.getElementUtilities().isSynthetic(ee)) { - List parameters = ee.getParameters(); - for (Map.Entry entry : ctors2generate.entrySet()) { - int size = entry.getKey().getParameters().size(); - if (size >= 0 && parameters.size() == size) { - Iterator proposed = entry.getKey().getParameters().iterator(); - Iterator original = parameters.iterator(); - boolean same = true; - while (same && proposed.hasNext() && original.hasNext()) - same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType()); - if (same) - entry.getValue()[0] = false; - } else if (!uninitializedFields.isEmpty()) { - size += uninitializedFields.size(); - if (size > 0 && parameters.size() == size) { - Iterator proposed = uninitializedFields.iterator(); - Iterator original = parameters.iterator(); - boolean same = true; - while (same && proposed.hasNext() && original.hasNext()) - same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType()); - if (same) { - proposed = entry.getKey().getParameters().iterator(); - while (same && proposed.hasNext() && original.hasNext()) - same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType()); - if (same) - entry.getValue()[1] = false; - } - } - } - } - } - } - for (Map.Entry entry : ctors2generate.entrySet()) { - if (entry.getValue()[0]) - results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), Collections.emptySet(), entry.getKey(), te, anchorOffset)); - if (entry.getValue()[1]) - results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), uninitializedFields, entry.getKey(), te, anchorOffset)); - } + List parameters = ee.getParameters(); + if (parameters.isEmpty() && !controller.getElementUtilities().isSynthetic(ee)) + hasDefaultConstructor = true; + if (parameters.size() == uninitializedFields.size() && !uninitializedFields.isEmpty()) { + Iterator proposed = uninitializedFields.iterator(); + Iterator original = parameters.iterator(); + boolean same = true; + while (same && proposed.hasNext() && original.hasNext()) + same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType()); + if (same) + hasConstrutorForAllUnintialized = true; + } + } + if (!uninitializedFields.isEmpty() && !hasConstrutorForAllUnintialized) + results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), uninitializedFields, te, anchorOffset)); + if (!hasDefaultConstructor) + results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), Collections.emptySet(), te, anchorOffset)); } } Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java 2011-08-04 21:48:28.758408099 +0100 @@ -370,9 +370,15 @@ return null; } + TypeMirror parentTypeForAnonymous = null; + if (controller.getElementUtilities().isSynthetic(el) && el.getKind() == ElementKind.CONSTRUCTOR) { //check for annonymous innerclasses: - el = handlePossibleAnonymousInnerClass(controller, el); + TypeMirror[] classTypeRef = new TypeMirror[] {classType }; + + el = handlePossibleAnonymousInnerClass(controller, el, classTypeRef); + + classType = parentTypeForAnonymous = classTypeRef[0]; } if (isError(el)) { @@ -383,7 +389,7 @@ return null; } - return new Context(classType, el); + return new Context(classType, parentTypeForAnonymous, el); } private static String computeTooltip(CompilationInfo controller, Context resolved, String key) { @@ -391,6 +397,8 @@ if (resolved.resolved.getKind() == ElementKind.CONSTRUCTOR && resolved.classType != null && resolved.classType.getKind() == TypeKind.DECLARED) { v.printExecutable(((ExecutableElement) resolved.resolved), (DeclaredType) resolved.classType, true); + } else if (resolved.resolved.getKind() == ElementKind.INTERFACE && resolved.parentTypeForAnonymous != null && resolved.parentTypeForAnonymous.getKind() == TypeKind.DECLARED) { + v.printType(((TypeElement) resolved.resolved), (DeclaredType) resolved.classType, true); } else { v.visit(resolved.resolved, true); } @@ -454,9 +462,12 @@ return new int [] {ts.offset(), ts.offset() + t.length()}; } - private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, final Element el) { + private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, final Element el, TypeMirror[] classTypeRef) { Element encl = el.getEnclosingElement(); Element doubleEncl = encl != null ? encl.getEnclosingElement() : null; + TypeMirror classType = classTypeRef[0]; + + classTypeRef[0] = null; if ( doubleEncl != null && !doubleEncl.getKind().isClass() @@ -470,6 +481,25 @@ NewClassTree nct = (NewClassTree) enclTreePath.getParentPath().getLeaf(); if (nct.getClassBody() != null) { + List sup = classType != null && classType.getKind() == TypeKind.DECLARED + ? info.getTypes().directSupertypes(classType) : Collections.emptyList(); + TypeElement jlObject = info.getElements().getTypeElement("java.lang.Object"); + + if (jlObject != null) { + TypeMirror jlObjectType = jlObject.asType(); + TypeMirror parent = null; + + for(TypeMirror tm : sup) { + if (info.getTypes().isSameType(tm, jlObjectType)) { + continue; + } + assert parent == null; + parent = tm; + } + + classTypeRef[0] = parent; + } + Element parentElement = info.getTrees().getElement(new TreePath(enclTreePath, nct.getIdentifier())); if (parentElement == null || parentElement.getKind().isInterface()) { @@ -955,9 +985,11 @@ public static final class Context { public final TypeMirror classType; + public final TypeMirror parentTypeForAnonymous; public final Element resolved; - public Context(TypeMirror classType, Element resolved) { + public Context(TypeMirror classType, TypeMirror parentTypeForAnonymous, Element resolved) { this.classType = classType; + this.parentTypeForAnonymous = parentTypeForAnonymous; this.resolved = resolved; } } Index: netbeans-7.0.1+dfsg1/java.editor/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/nbproject/project.properties 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/nbproject/project.properties 2011-08-04 21:48:28.758408099 +0100 @@ -42,7 +42,7 @@ javadoc.title=Java Editor -spec.version.base=2.34.1 +spec.version.base=2.32.1 test.qa-functional.cp.extra=${editor.dir}/modules/org-netbeans-modules-editor-fold.jar javac.source=1.6 #test.unit.cp.extra= @@ -91,8 +91,7 @@ org/netbeans/modules/java/editor/semantic/DetectorTest.class,\ org/netbeans/modules/java/editor/semantic/MarkOccDetTest.class,\ org/netbeans/modules/java/editor/semantic/UnusedImportsTest.class,\ - org/netbeans/modules/editor/java/GoToSupportTest.class,\ - org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.class + org/netbeans/modules/editor/java/GoToSupportTest.class test.timeout=1200000 Index: netbeans-7.0.1+dfsg1/java.editor/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/nbproject/project.xml 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/nbproject/project.xml 2011-08-04 21:48:28.758408099 +0100 @@ -55,7 +55,7 @@ 1 - 1.33.1 + 1.18 @@ -64,7 +64,7 @@ 1 - 1.29.1 + 1.24 @@ -73,7 +73,7 @@ 1 - 1.24.1 + 1.16 @@ -88,7 +88,7 @@ 3 - 1.57.1.5.13.10 + 1.53 @@ -97,7 +97,7 @@ 0-1 - 1.18.1 + 1.6 @@ -123,7 +123,7 @@ 0-1 - 1.4.1.1.5.13.10 + 1.0 @@ -149,7 +149,7 @@ 2 - 1.24.1 + 1.19 @@ -158,7 +158,7 @@ 3 - 3.9.1.13.10 + 3.1 @@ -167,7 +167,7 @@ 1 - 1.43.1.10 + 1.35 @@ -176,7 +176,7 @@ 1 - 1.22.1 + 1.6 @@ -185,7 +185,7 @@ 1 - 1.36.1 + 1.19 @@ -202,7 +202,7 @@ 1 - 1.20.1 + 1.9 @@ -211,7 +211,7 @@ 1 - 1.14.1 + 1.2 @@ -219,7 +219,7 @@ - 1.18.1.1 + 1.9 @@ -227,7 +227,7 @@ - 0.79.1.17.15.6 + 0.67 @@ -236,7 +236,7 @@ 1 - 1.22.1.1.17 + 1.20 @@ -245,7 +245,7 @@ 2 - 1.39.1.1 + 1.25 @@ -254,7 +254,7 @@ 1 - 1.22.1 + 1.5 @@ -263,7 +263,7 @@ 1 - 1.25.1 + 1.20 @@ -272,7 +272,7 @@ 1 - 1.42.1.6 + 1.26 @@ -281,7 +281,7 @@ 1 - 1.36.1 + 1.13 @@ -289,7 +289,7 @@ - 1.16.1 + 1.0 @@ -298,7 +298,7 @@ 0-1 - 1.18.1.7.10 + 1.7 @@ -306,7 +306,7 @@ - 7.31.1 + 6.2 @@ -314,7 +314,7 @@ - 7.20.1 + 6.2 @@ -322,7 +322,7 @@ - 6.35.1 + 6.8 @@ -330,7 +330,7 @@ - 7.47.1 + 6.2 @@ -338,7 +338,7 @@ - 7.21.1 + 4.11 @@ -346,7 +346,7 @@ - 7.23.1 + 6.2 @@ -354,7 +354,7 @@ - 7.21.1 + 6.2 @@ -362,7 +362,7 @@ - 6.37.1 + 6.16 @@ -370,7 +370,7 @@ - 8.15.1 + 8.0 @@ -378,7 +378,7 @@ - 8.8.1 + 8.0 @@ -386,7 +386,7 @@ - 6.40.1 + 6.2 Index: netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/java/editor/view/JavaViewHierarchyRandomTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/test/unit/src/org/netbeans/modules/java/editor/view/JavaViewHierarchyRandomTest.java 2011-07-28 20:45:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/java/editor/view/JavaViewHierarchyRandomTest.java 2011-08-04 21:48:28.758408099 +0100 @@ -45,7 +45,6 @@ package org.netbeans.modules.java.editor.view; import java.awt.Color; -import java.awt.Font; import java.awt.Rectangle; import java.util.ArrayList; import java.util.Arrays; @@ -66,7 +65,6 @@ import javax.swing.text.BadLocationException; import javax.swing.text.DefaultEditorKit; import javax.swing.text.Document; -import javax.swing.text.Position; import javax.swing.text.Position.Bias; import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; @@ -89,6 +87,7 @@ import org.netbeans.spi.editor.highlighting.HighlightsSequence; import org.netbeans.spi.editor.highlighting.ZOrder; import org.netbeans.spi.editor.mimelookup.MimeDataProvider; +import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.RequestProcessor; import org.openide.util.Task; @@ -106,7 +105,6 @@ public JavaViewHierarchyRandomTest(String testName) { super(testName); List includes = new ArrayList(); -// includes.add("testToolTipView"); // includes.add("testSimpleBadListener"); // includes.add("testRemoveNewline"); // includes.add("testGap"); @@ -145,7 +143,6 @@ Logger.getLogger("org.netbeans.modules.editor.lib2.view.EditorBoxViewChildren").setLevel(Level.FINE); Logger.getLogger("org.netbeans.editor.BaseDocument.EDT").setLevel(Level.FINE); Logger.getLogger("org.netbeans.editor.BaseCaret.EDT").setLevel(Level.FINE); - ViewHierarchyRandomTesting.setDirectViewRebuild(true); } @Override @@ -360,7 +357,7 @@ RandomTestContainer.Context context = container.context(); // ViewHierarchyRandomTesting.disableHighlighting(container); DocumentTesting.setSameThreadInvoke(context, true); // Do not post to EDT - DocumentTesting.insert(context, 0, "abc\ndef\nghi\n"); + DocumentTesting.insert(context, 0, "abc\ndef\ng\thi\n\nj\tkl\nmno\n\np\tqr\n stuv \n\nwxyz"); final JEditorPane[] toolTipPaneRef = new JEditorPane[1]; final BadLocationException[] excRef = new BadLocationException[1]; final JFrame[] toolTipFrameRef = new JFrame[1]; @@ -371,32 +368,17 @@ toolTipPaneRef[0] = toolTipPane; toolTipPane.setEditorKit(pane.getEditorKit()); try { - Position startPos = doc.createPosition(4); // Line begining - Position endPos = doc.createPosition(8); // Line boundary too - toolTipPane.putClientProperty("document-view-start-position", startPos); - toolTipPane.putClientProperty("document-view-end-position", endPos); - toolTipPane.setDocument(doc); - JFrame toolTipFrame = new JFrame("ToolTip Frame"); - toolTipFrameRef[0] = toolTipFrame; - toolTipFrame.getContentPane().add(new JScrollPane(toolTipPane)); - toolTipFrame.setSize(100, 100); - toolTipFrame.setVisible(true); - - doc.insertString(4, "o", null); - toolTipPane.setFont(new Font("Monospaced", Font.PLAIN, 22)); // Force VH rebuild - toolTipPane.modelToView(6); - doc.remove(3, 3); - doc.insertString(4, "ab", null); - - assert (endPos.getOffset() == 8); - doc.remove(7, 2); - toolTipPane.setFont(new Font("Monospaced", Font.PLAIN, 23)); // Force VH rebuild - toolTipPane.modelToView(6); - + toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(4)); + toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(20)); } catch (BadLocationException ex) { excRef[0] = ex; } - + toolTipPane.setDocument(doc); + JFrame toolTipFrame = new JFrame("ToolTip Frame"); + toolTipFrameRef[0] = toolTipFrame; + toolTipFrame.getContentPane().add(new JScrollPane(toolTipPane)); + toolTipFrame.setSize(100, 100); + toolTipFrame.setVisible(true); } }; SwingUtilities.invokeAndWait(tooltipRun); @@ -404,13 +386,14 @@ throw new IllegalStateException(excRef[0]); } + DocumentTesting.insert(context, 10, "abc\ndef\ng"); + DocumentTesting.remove(context, 15, 4); + DocumentTesting.insert(context, 4, "abc\ndef\ng"); + DocumentTesting.insert(context, 20, "abc\ndef\ng"); DocumentTesting.setSameThreadInvoke(context, false); - DocumentTesting.undo(context, 2); - DocumentTesting.undo(context, 1); - DocumentTesting.undo(context, 1); + DocumentTesting.undo(context, 4); DocumentTesting.redo(context, 4); - // Hide tooltip's frame SwingUtilities.invokeLater(new Runnable() { @Override public void run() { @@ -778,7 +761,7 @@ toolTipPane.setEditorKit(pane.getEditorKit()); try { toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(4)); - toolTipPane.putClientProperty("document-view-end-position", doc.createPosition(20)); + toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(20)); } catch (BadLocationException ex) { excRef[0] = ex; } @@ -790,7 +773,7 @@ toolTipFrame.setVisible(true); } }; - SwingUtilities.invokeAndWait(tooltipRun); +// Uncomment for #196814 fixing SwingUtilities.invokeAndWait(tooltipRun); if (excRef[0] != null) { throw new IllegalStateException(excRef[0]); } @@ -834,7 +817,7 @@ toolTipPane.setEditorKit(pane.getEditorKit()); try { toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(4)); - toolTipPane.putClientProperty("document-view-end-position", doc.createPosition(20)); + toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(20)); } catch (BadLocationException ex) { excRef[0] = ex; } @@ -846,7 +829,7 @@ toolTipFrame.setVisible(true); } }; - SwingUtilities.invokeAndWait(tooltipRun); +// Uncomment for #196814 fixing SwingUtilities.invokeAndWait(tooltipRun); if (excRef[0] != null) { throw new IllegalStateException(excRef[0]); } Index: netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java 2011-07-28 20:45:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java 2011-08-04 21:48:28.758408099 +0100 @@ -974,6 +974,72 @@ assertEquals(golden, tooltip); } + public void testTooltipForConciseConstructorCall2() throws Exception { + String code = "package test; public class Test {java.util.List l = new java.util.Arr|ayList<>() {};}"; + int offset = code.indexOf('|'); + code = code.replaceAll(Pattern.quote("|"), ""); + assertNotSame(-1, offset); + String golden = "public ArrayList<java.lang.String>()"; + + String tooltip = performTest(code, offset, new OrigUiUtilsCaller() { + public void open(FileObject fo, int pos) { + fail("Should not be called."); + } + public void beep() { + fail("Should not be called."); + } + public void open(ClasspathInfo info, Element el) { + fail("Should not be called."); + } + }, true); + + assertEquals(golden, tooltip); + } + + public void testTooltipForConciseConstructorCall3() throws Exception { + String code = "package test; public class Test {java.util.List l = new java.util.L|ist<>() {};}"; + int offset = code.indexOf('|'); + code = code.replaceAll(Pattern.quote("|"), ""); + assertNotSame(-1, offset); + String golden = "public abstract interface java.util.List<java.lang.String>"; + + String tooltip = performTest(code, offset, new OrigUiUtilsCaller() { + public void open(FileObject fo, int pos) { + fail("Should not be called."); + } + public void beep() { + fail("Should not be called."); + } + public void open(ClasspathInfo info, Element el) { + fail("Should not be called."); + } + }, true); + + assertEquals(golden, tooltip); + } + + public void testTooltipForConciseConstructorCall4() throws Exception { + String code = "package test; public class Test {java.util.List l = new java.util.LinkedL|ist<>(java.util.Arrays.asList(\"\")) {};}"; + int offset = code.indexOf('|'); + code = code.replaceAll(Pattern.quote("|"), ""); + assertNotSame(-1, offset); + String golden = "public LinkedList<java.lang.String>(java.util.Collection<? extends java.lang.String> arg0)"; + + String tooltip = performTest(code, offset, new OrigUiUtilsCaller() { + public void open(FileObject fo, int pos) { + fail("Should not be called."); + } + public void beep() { + fail("Should not be called."); + } + public void open(ClasspathInfo info, Element el) { + fail("Should not be called."); + } + }, true); + + assertEquals(golden, tooltip); + } + private FileObject source; private String performTest(String sourceCode, final int offset, final OrigUiUtilsCaller validator, boolean tooltip) throws Exception { Index: netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java 2011-07-28 20:45:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java 2011-08-04 21:48:28.768407458 +0100 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved. + * 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. @@ -27,7 +27,7 @@ * Contributor(s): * * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun * Microsystems, Inc. All Rights Reserved. * * If you wish your version of this file to be governed by only the CDDL @@ -61,7 +61,8 @@ import org.netbeans.api.lexer.Language; import org.netbeans.junit.NbTestCase; import org.netbeans.lib.editor.util.CharSequenceUtilities; -import org.openide.awt.AcceleratorBinding; +import org.openide.modules.ModuleInfo; +import org.openide.util.Lookup; /** @@ -79,9 +80,7 @@ @Override protected void setUp() throws Exception { super.setUp(); - Preferences prefs = MimeLookup.getLookup(JavaKit.JAVA_MIME_TYPE).lookup(Preferences.class); - prefs.putBoolean(SimpleValueNames.COMPLETION_PAIR_CHARACTERS, true); - Class.forName(AcceleratorBinding.class.getName(), true, AcceleratorBinding.class.getClassLoader()); + Lookup.getDefault().lookup(ModuleInfo.class); } // ------- Tests for completion of right parenthesis ')' ------------- @@ -204,167 +203,99 @@ public void testTypeAddRightBraceIfLeftBrace() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) {|\n" + - " }\n" + - "}\n" + "if (true) {|" ); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) {\n" + - " |\n" + - " }\n" + - " }\n" + - "}\n" + "if (true) {\n" + + " |\n" + + "}" ); } public void testTypeAddRightBraceIfLeftBraceWhiteSpace() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) { \t|\n" + - " }\n" + - "}\n" + "if (true) { \t|" ); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) { \t\n" + - " |\n" + - " }\n" + - " }\n" + - "}\n" + "if (true) { \t\n" + + " |\n" + + "}" ); } public void testTypeAddRightBraceIfLeftBraceLineComment() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) { // line-comment|\n" + - " }\n" + - "}\n" + "if (true) { // line-comment|" ); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) { // line-comment\n" + - " |\n" + - " }\n" + - " }\n" + - "}\n" + "if (true) { // line-comment\n" + + " |\n" + + "}" ); } public void testTypeAddRightBraceIfLeftBraceBlockComment() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) { /* block-comment */|\n" + - " }\n" + - "}\n" + "if (true) { /* block-comment */|" ); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) { /* block-comment */\n" + - " |\n" + - " }\n" + - " }\n" + - "}\n" + "if (true) { /* block-comment */\n" + + " |\n" + + "}" ); } public void testTypeAddRightBraceIfLeftBraceAlreadyPresent() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) {|\n" + - " }\n" + - " }\n" + - "}\n" + "if (true) {|\n" + + "}" ); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) {\n" + - " |\n" + - " }\n" + - " }\n" + - "}\n" + "if (true) {\n" + + " |\n" + + "}" ); } - public void XtestTypeAddRightBraceCaretInComment() { - Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) { /* unclosed-block-comment|\n" + - " */\n" + - " }\n" + - "}\n" + public void testTypeAddRightBraceCaretInComment() { + Context ctx = new Context(new JavaKit(), + "if (true) { /* unclosed-block-comment|\n" + + " */" ); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) { /* unclosed-block-comment\n" + - " * |\n" + - " */\n" + - " }\n" + - "}\n" + "if (true) { /* unclosed-block-comment\n" + + " * |\n" + + " */" ); } public void testTypeAddRightBraceMultiLine() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) {| System.out.println(\n" + - " \"\");\n" + - " }\n" + - "}\n" - ); + "if (true) {| System.out.println(\n" + + "\"\");\n"); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) {\n" + - " System.out.println(\n" + - " \"\");\n" + - " }\n" + - "}\n" - ); + "if (true) {\n" + + " System.out.println(\n" + + "\"\");\n"); } public void testTypeAddRightBraceSingleLine() { Context ctx = new Context(new JavaKit(), - "class Test {\n" + - " {\n" + - " if (true) {| System.out.println(\"\");\n" + - " }\n" + - "}\n" - ); + "if (true) {| System.out.println(\"\");\n"); ctx.typeChar('\n'); ctx.assertDocumentTextEquals( - "class Test {\n" + - " {\n" + - " if (true) {\n" + - " System.out.println(\"\");\n" + - " }\n" + - " }\n" + - "}\n" - ); + "if (true) {\n" + + " System.out.println(\"\");\n" + + "}\n"); } @@ -863,66 +794,6 @@ ); } - public void testSkipWhenBalanced198194a() throws Exception { - Context ctx = new Context(new JavaKit(), - "for (int i = a(|); i < 10; i++)" - ); - ctx.typeChar(')'); - ctx.assertDocumentTextEquals( - "for (int i = a()|; i < 10; i++)" - ); - } - - public void testSkipWhenNotBalanced198194a() throws Exception { - Context ctx = new Context(new JavaKit(), - "for (int i = a(|; i < 10; i++)" - ); - ctx.typeChar(')'); - ctx.assertDocumentTextEquals( - "for (int i = a()|; i < 10; i++)" - ); - } - - public void testSkipWhenBalanced198194b() throws Exception { - Context ctx = new Context(new JavaKit(), - "for (int i = a(); i < 10; i = a(|))" - ); - ctx.typeChar(')'); - ctx.assertDocumentTextEquals( - "for (int i = a(); i < 10; i = a()|)" - ); - } - - public void testSkipWhenNotBalanced198194b() throws Exception { - Context ctx = new Context(new JavaKit(), - "for (int i = a(); i < 10; i = a(|)" - ); - ctx.typeChar(')'); - ctx.assertDocumentTextEquals( - "for (int i = a(); i < 10; i = a()|)" - ); - } - - public void testSkipWhenNotBalanced198194c() throws Exception { - Context ctx = new Context(new JavaKit(), - "for (int i = a(); i < 10; i++) a(|;" - ); - ctx.typeChar(')'); - ctx.assertDocumentTextEquals( - "for (int i = a(); i < 10; i++) a()|;" - ); - } - - public void testSkipWhenBalanced198194c() throws Exception { - Context ctx = new Context(new JavaKit(), - "for (int i = a(); i < 10; i++) a(|);" - ); - ctx.typeChar(')'); - ctx.assertDocumentTextEquals( - "for (int i = a(); i < 10; i++) a()|;" - ); - } - public void testKeepBalance148878() throws Exception { Context ctx = new Context(new JavaKit(), "Map[|] m = new HashMap[1];" Index: netbeans-7.0.1+dfsg1/java.kit/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.kit/nbproject/project.xml 2011-08-04 21:48:28.588416313 +0100 +++ netbeans-7.0.1+dfsg1/java.kit/nbproject/project.xml 2011-08-04 21:48:28.768407458 +0100 @@ -58,14 +58,14 @@ org.netbeans.modules.java.debug - 1.19.1.1.15.17 + 1.17.1 org.netbeans.modules.java.editor 1 - 2.34.1.8.1.1 + 2.32.1 @@ -100,7 +100,7 @@ org.netbeans.modules.java.hints 1 - 1.54.1.5.8.17.6 + 1.49.1 @@ -127,7 +127,7 @@ org.netbeans.modules.java.navigation 1 - 1.21.1 + 1.20.1 Index: netbeans-7.0.1+dfsg1/java.debug/src/org/netbeans/modules/java/debug/TreeNode.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.debug/src/org/netbeans/modules/java/debug/TreeNode.java 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.debug/src/org/netbeans/modules/java/debug/TreeNode.java 2011-08-04 21:48:28.768407458 +0100 @@ -58,6 +58,7 @@ import com.sun.source.tree.CompoundAssignmentTree; import com.sun.source.tree.ConditionalExpressionTree; import com.sun.source.tree.ContinueTree; +import com.sun.source.tree.DisjunctiveTypeTree; import com.sun.source.tree.DoWhileLoopTree; import com.sun.source.tree.EmptyStatementTree; import com.sun.source.tree.EnhancedForLoopTree; @@ -88,7 +89,6 @@ import com.sun.source.tree.TypeCastTree; import com.sun.source.tree.TypeParameterTree; import com.sun.source.tree.UnaryTree; -import com.sun.source.tree.UnionTypeTree; import com.sun.source.tree.VariableTree; import com.sun.source.tree.WhileLoopTree; import com.sun.source.tree.WildcardTree; @@ -397,12 +397,12 @@ } @Override - public Void visitUnionType(UnionTypeTree tree, List d) { + public Void visitDisjunctiveType(DisjunctiveTypeTree tree, List d) { List below = new ArrayList(); addCorrespondingType(below); addCorrespondingComments(below); - super.visitUnionType(tree, below); + super.visitDisjunctiveType(tree, below); d.add(new TreeNode(info, getCurrentPath(), below)); return null; Index: netbeans-7.0.1+dfsg1/java.debug/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.debug/nbproject/project.properties 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.debug/nbproject/project.properties 2011-08-04 21:48:28.768407458 +0100 @@ -40,6 +40,6 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. javac.source=1.6 -spec.version.base=1.19.1 +spec.version.base=1.17.1 requires.nb.javac=true Index: netbeans-7.0.1+dfsg1/java.debug/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.debug/nbproject/project.xml 2011-07-28 20:45:52.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.debug/nbproject/project.xml 2011-08-04 21:48:28.768407458 +0100 @@ -11,7 +11,7 @@ 1 - 1.9.1 + 1.4 @@ -20,7 +20,7 @@ 1 - 1.33.1 + 1.18 @@ -29,7 +29,7 @@ 1 - 1.29.1 + 1.0 @@ -53,7 +53,7 @@ 3 - 3.9.1.13.10 + 3.1 @@ -62,7 +62,7 @@ 1 - 1.43.1.10 + 1.4 @@ -71,7 +71,7 @@ 1 - 1.36.1 + 1.11 @@ -88,7 +88,7 @@ 1 - 1.36.1 + 1.14 @@ -97,7 +97,7 @@ 1 - 1.17.1 + 1.1 @@ -105,7 +105,7 @@ - 6.35.1 + 6.8 @@ -113,7 +113,7 @@ - 7.47.1 + 6.3 @@ -121,7 +121,7 @@ - 7.21.1 + 5.7 @@ -129,7 +129,7 @@ - 7.21.1 + 6.6 @@ -137,7 +137,7 @@ - 6.37.1 + 6.16 @@ -145,7 +145,7 @@ - 8.15.1 + 8.0 @@ -153,7 +153,7 @@ - 8.8.1 + 8.0 Index: netbeans-7.0.1+dfsg1/java.hints/manifest.mf =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/manifest.mf 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/manifest.mf 2011-08-04 21:48:28.768407458 +0100 @@ -1,6 +1,6 @@ Manifest-version: 1.0 OpenIDE-Module: org.netbeans.modules.java.hints/1 -OpenIDE-Module-Implementation-Version: 5 +OpenIDE-Module-Implementation-Version: 4 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/hints/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/java/hints/resources/layer.xml AutoUpdate-Show-In-Client: false Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/StaticAccess.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/StaticAccess.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/StaticAccess.java 2011-08-04 21:48:28.768407458 +0100 @@ -94,7 +94,7 @@ return null; } Element el = info.getTypes().asElement(tm); - if (el == null || (!el.getKind().isClass() && !el.getKind().isInterface())) { + if (el == null || el.getKind() != ElementKind.CLASS) { return null; } @@ -135,7 +135,10 @@ return null; } - int[] span = info.getTreeUtilities().findNameSpan(mst); + int[] span = { + (int)info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), expression), + (int)info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), expression), + }; if (span[0] == (-1) || span[1] == (-1)) { return null; Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ExportNonAccessibleElement.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/ExportNonAccessibleElement.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ExportNonAccessibleElement.java 2011-08-04 21:48:28.768407458 +0100 @@ -57,6 +57,7 @@ import javax.lang.model.element.VariableElement; import javax.lang.model.type.ArrayType; import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.DisjunctiveType; import javax.lang.model.type.ErrorType; import javax.lang.model.type.ExecutableType; import javax.lang.model.type.NoType; @@ -66,7 +67,6 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; import javax.lang.model.type.TypeVisitor; -import javax.lang.model.type.UnionType; import javax.lang.model.type.WildcardType; import javax.swing.JComponent; import org.netbeans.api.java.source.Task; @@ -350,7 +350,7 @@ } @Override - public Boolean visitUnion(UnionType tm, Void p) { + public Boolean visitDisjunctive(DisjunctiveType tm, Void p) { for (TypeMirror t : tm.getAlternatives()) { if (stop) { return false; Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ConvertAnonymousToInner.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/ConvertAnonymousToInner.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ConvertAnonymousToInner.java 2011-08-04 21:48:28.768407458 +0100 @@ -166,9 +166,6 @@ public List run(CompilationInfo compilationInfo, TreePath treePath) { int pos = CaretAwareJavaSourceTaskFactory.getLastPosition(compilationInfo.getFileObject()); int[] selection = SelectionAwareJavaSourceTaskFactory.getLastSelection(compilationInfo.getFileObject()); - - if (selection == null) return null; - Fix f = computeFix(compilationInfo, selection[0], selection[1], true); if (f == null) Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/HideField.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/HideField.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/HideField.java 2011-08-04 21:48:28.768407458 +0100 @@ -42,8 +42,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.prefs.Preferences; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; @@ -66,7 +64,6 @@ import org.openide.loaders.DataObjectNotFoundException; import org.openide.util.Exceptions; import org.openide.util.NbBundle; -import org.openide.util.Utilities; /** * @@ -188,7 +185,7 @@ protected static synchronized Iterable getAllMembers(CompilationInfo info, TypeElement clazz) { class CleaningWR extends WeakReference implements Runnable { public CleaningWR(CompilationInfo info) { - super(info, Utilities.activeReferenceQueue()); + super(info); } @Override public void run() { synchronized (HideField.class) { @@ -206,13 +203,7 @@ if (origInfo == info) { map = allMembersCacheTo; } else { - allMembersCacheFrom = new CleaningWR(info); map = allMembersCacheTo = new HashMap>(); - - if (info.getFileObject() != null) { - Logger.getLogger("TIMER").log(Level.FINE, "HideField.allMembersCacheTo", //NOI18N - new Object[] {info.getFileObject(), map}); - } } Iterable members = map.get(clazz); Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/UtilityClass.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/UtilityClass.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/UtilityClass.java 2011-08-04 21:48:28.778408976 +0100 @@ -59,7 +59,6 @@ import javax.lang.model.element.VariableElement; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.Types; import javax.swing.JComponent; import org.netbeans.api.java.source.Task; import org.netbeans.api.java.source.CompilationInfo; @@ -154,17 +153,8 @@ if (e.getKind() != ElementKind.CONSTRUCTOR) { return null; } - TypeElement jlThrowable = compilationInfo.getElements().getTypeElement("java.lang.Throwable"); - if (jlThrowable == null) {//no bootclasspath? - better do nothing: - return null; - } ExecutableElement x = (ExecutableElement)e; - Element enclosingType = x.getEnclosingElement(); - Types t = compilationInfo.getTypes(); - if (t.isSubtype(t.erasure(enclosingType.asType()), t.erasure(jlThrowable.asType()))) { - return null;//#197721 - } - List allElements = enclosingType.getEnclosedElements(); + List allElements = x.getEnclosingElement().getEnclosedElements(); List enclosedElements = new ArrayList(allElements.size()); for (Element el : allElements) { Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/bugs/CollectionRemove.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/bugs/CollectionRemove.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/bugs/CollectionRemove.java 2011-08-04 21:48:28.778408976 +0100 @@ -45,7 +45,6 @@ import com.sun.source.tree.MemberSelectTree; import com.sun.source.tree.MethodInvocationTree; import com.sun.source.tree.Scope; -import com.sun.source.tree.Tree.Kind; import com.sun.source.util.TreePath; import java.util.Iterator; import java.util.LinkedList; @@ -232,15 +231,6 @@ warningKey = "HINT_SuspiciousCallIncompatibleTypes"; //NOI18N } - ExecutableElement checkMethodElement = resolveMethod(ctx.getInfo(), checkMethod); - ExecutableElement enclosingMethod = findEnclosingMethod(ctx.getInfo(), ctx.getPath()); - - if ( enclosingMethod != null - && checkMethodElement != null - && ctx.getInfo().getElements().overrides(enclosingMethod, checkMethodElement, (TypeElement) checkMethodElement.getEnclosingElement())) { - continue; - } - String semiFQN = checkMethod.substring(0, checkMethod.indexOf('(')); String warning = NbBundle.getMessage(CollectionRemove.class, @@ -314,22 +304,6 @@ return null; } - private static ExecutableElement findEnclosingMethod(CompilationInfo info, TreePath path) { - while (path != null && path.getLeaf().getKind() != Kind.CLASS && path.getLeaf().getKind() != Kind.METHOD) { - path = path.getParentPath(); - } - - if (path != null && path.getLeaf().getKind() == Kind.METHOD) { - Element el = info.getTrees().getElement(path); - - if (el != null && el.getKind() == ElementKind.METHOD) { - return (ExecutableElement) el; - } - } - - return null; - } - public static final class CollectionRemoveCustomizerImpl extends OneCheckboxCustomizerProvider { public CollectionRemoveCustomizerImpl() { super(NbBundle.getMessage(CollectionRemove.class, "LBL_CollectionRemoveCustomizer.warnForCastable"), Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/JoinCatches.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jdk/JoinCatches.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/JoinCatches.java 2011-08-04 21:48:28.778408976 +0100 @@ -164,7 +164,7 @@ for (CatchTree ct : tt.getCatches()) { if (c == first) { - wc.rewrite(ct.getParameter().getType(), wc.getTreeMaker().UnionType(disjointTypes)); + wc.rewrite(ct.getParameter().getType(), wc.getTreeMaker().DisjunctiveType(disjointTypes)); } if (duplicates.contains(c++)) continue; Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/UseSpecificCatch.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jdk/UseSpecificCatch.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/UseSpecificCatch.java 2011-08-04 21:48:28.778408976 +0100 @@ -173,7 +173,7 @@ VariableTree excVar = ((CatchTree) tp.getLeaf()).getParameter(); - wc.rewrite(excVar.getType(), wc.getTreeMaker().UnionType(exceptions)); + wc.rewrite(excVar.getType(), wc.getTreeMaker().DisjunctiveType(exceptions)); } } Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Bundle.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/perf/Bundle.properties 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Bundle.properties 2011-08-04 21:48:28.778408976 +0100 @@ -108,7 +108,7 @@ DN_org.netbeans.modules.java.hints.perf.Tiny.enumSet=Set replaceable with EnumSet DESC_org.netbeans.modules.java.hints.perf.Tiny.enumSet=Finds instantiations of Sets that can be replaced with EnumSet DN_org.netbeans.modules.java.hints.perf.Tiny.enumMap=Map replaceable with EnumMap -DESC_org.netbeans.modules.java.hints.perf.Tiny.enumMap=Finds instantiations of Maps that can be replaced with EnumMap +DESC_org.netbeans.modules.java.hints.perf.Tiny.enumMap=Finds instantiations of Maps that can be replaced with EnumSet ERR_Tiny_enumSet=Set can be replaced with java.util.EnumSet ERR_Tiny_enumMap=Map can be replaced with java.util.EnumMap FIX_Tiny_enumMap=Replace Map with java.util.EnumMap Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java 2011-08-04 21:48:28.778408976 +0100 @@ -247,7 +247,7 @@ String displayName = NbBundle.getMessage(Tiny.class, "FIX_Tiny_enumMap"); fixes = new Fix[] { - JavaFix.rewriteFix(ctx, displayName, ctx.getPath(), "new java.util.EnumMap<$param, $to>($param.class)") + JavaFix.rewriteFix(ctx, displayName, ctx.getPath(), "new $coll<$param, $to>($param.class)") }; } else { fixes = new Fix[0]; Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/MatcherUtilities.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/MatcherUtilities.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/MatcherUtilities.java 2011-08-04 21:48:28.778408976 +0100 @@ -51,7 +51,6 @@ import org.netbeans.api.annotations.common.NonNull; import org.netbeans.modules.java.hints.jackpot.impl.Utilities; import org.netbeans.modules.java.hints.introduce.CopyFinder; -import org.netbeans.modules.java.hints.introduce.CopyFinder.Options; /** * @@ -69,7 +68,7 @@ Tree patternTree = Utilities.parseAndAttribute(ctx.getInfo(), pattern, s); TreePath patternTreePath = new TreePath(new TreePath(ctx.getInfo().getCompilationUnit()), patternTree); - return CopyFinder.isDuplicate(ctx.getInfo(), patternTreePath, variable, true, ctx, fillInVariables, null, new AtomicBoolean()/*XXX*/, Options.ALLOW_VARIABLES_IN_PATTERN); + return CopyFinder.isDuplicate(ctx.getInfo(), patternTreePath, variable, true, ctx, fillInVariables, new AtomicBoolean()/*XXX*/); } } Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/impl/pm/CopyFinderBasedBulkSearch.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jackpot/impl/pm/CopyFinderBasedBulkSearch.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/impl/pm/CopyFinderBasedBulkSearch.java 2011-08-04 21:48:28.778408976 +0100 @@ -56,7 +56,6 @@ import javax.lang.model.type.TypeMirror; import org.netbeans.api.java.source.CompilationInfo; import org.netbeans.modules.java.hints.introduce.CopyFinder; -import org.netbeans.modules.java.hints.introduce.CopyFinder.Options; /** * @@ -75,7 +74,7 @@ for (Entry e : ((BulkPatternImpl) pattern).pattern2Code.entrySet()) { - for (TreePath r : CopyFinder.computeDuplicates(info, new TreePath(topLevel, e.getKey()), toSearch, false, new AtomicBoolean(), Collections.emptyMap(), Options.ALLOW_VARIABLES_IN_PATTERN).keySet()) { + for (TreePath r : CopyFinder.computeDuplicates(info, new TreePath(topLevel, e.getKey()), toSearch, false, new AtomicBoolean(), Collections.emptyMap()).keySet()) { Collection c = result.get(e.getValue()); if (c == null) { Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/analyzer/Analyzer.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/analyzer/Analyzer.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/analyzer/Analyzer.java 2011-08-04 21:48:28.778408976 +0100 @@ -79,7 +79,6 @@ import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; -import org.openide.util.UserQuestionException; import org.openide.util.lookup.Lookups; /** @@ -140,14 +139,7 @@ DataObject d = DataObject.find(cc.getFileObject()); EditorCookie ec = d.getLookup().lookup(EditorCookie.class); - Document doc; - - try { - doc = ec.openDocument(); - } catch (UserQuestionException uqe) { - uqe.confirmed(); - doc = ec.openDocument(); - } + Document doc = ec.openDocument(); try { handle.progress(FileUtil.getFileDisplayName(cc.getFileObject())); Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/CopyFinder.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/introduce/CopyFinder.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/CopyFinder.java 2011-08-04 21:48:28.778408976 +0100 @@ -74,7 +74,6 @@ import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; import com.sun.source.util.TreeScanner; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.EnumSet; @@ -118,26 +117,23 @@ private boolean nocheckOnAllowVariablesRemap = false; private AtomicBoolean cancel; private static final String CLASS = "class"; //NOI18N - private final Set options; private Map designedTypeHack; - private CopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel, Options... options) { + private CopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel) { this.searchingFor = searchingFor; this.info = info; this.cancel = cancel; - this.options = EnumSet.noneOf(Options.class); - this.options.addAll(Arrays.asList(options)); } public static Map computeDuplicates(CompilationInfo info, TreePath searchingFor, TreePath scope, AtomicBoolean cancel, Map designedTypeHack) { return computeDuplicates(info, searchingFor, scope, true, cancel, designedTypeHack); } - public static Map computeDuplicates(final CompilationInfo info, TreePath searchingFor, TreePath scope, boolean fullElementVerify, AtomicBoolean cancel, Map designedTypeHack, Options... options) { + public static Map computeDuplicates(final CompilationInfo info, TreePath searchingFor, TreePath scope, boolean fullElementVerify, AtomicBoolean cancel, Map designedTypeHack) { CopyFinder f = fullElementVerify - ? new CopyFinder(searchingFor, info, cancel, options) - : new UnattributedCopyFinder(searchingFor, info, cancel, options); + ? new CopyFinder(searchingFor, info, cancel) + : new UnattributedCopyFinder(searchingFor, info, cancel); f.designedTypeHack = designedTypeHack; @@ -151,9 +147,11 @@ return null; } - CopyFinder f = new CopyFinder(searchingFor, info, cancel, Options.ALLOW_VARIABLES_IN_PATTERN); + CopyFinder f = new CopyFinder(searchingFor, info, cancel); f.allowGoDeeper = false; + + f.designedTypeHack = designedTypeHack; if (f.scan(scope, searchingFor)) { @@ -175,14 +173,14 @@ return isDuplicate(info, one, second, fullElementVerify, inVariables, fillInVariables, null, cancel); } - public static boolean isDuplicate(final CompilationInfo info, TreePath one, TreePath second, boolean fullElementVerify, HintContext inVariables, boolean fillInVariables, Set variablesWithAllowedRemap, AtomicBoolean cancel, Options... options) { + public static boolean isDuplicate(final CompilationInfo info, TreePath one, TreePath second, boolean fullElementVerify, HintContext inVariables, boolean fillInVariables, Set variablesWithAllowedRemap, AtomicBoolean cancel) { if (one.getLeaf().getKind() != second.getLeaf().getKind()) { return false; } CopyFinder f = fullElementVerify - ? new CopyFinder(one, info, cancel, options) - : new UnattributedCopyFinder(one, info, cancel, options); + ? new CopyFinder(one, info, cancel) + : new UnattributedCopyFinder(one, info, cancel); if (inVariables != null) { if (fillInVariables) { @@ -345,7 +343,7 @@ if (p != null && p.getLeaf().getKind() == Kind.IDENTIFIER) { String ident = ((IdentifierTree) p.getLeaf()).getName().toString(); - if (ident.startsWith("$") && options.contains(Options.ALLOW_VARIABLES_IN_PATTERN)) { + if (ident.startsWith("$")) { if (bindState.variables2Names.containsKey(ident)) { if (node.getKind() == Kind.IDENTIFIER) return ((IdentifierTree) node).getName().toString().equals(bindState.variables2Names.get(ident)); @@ -379,10 +377,8 @@ boolean oldAllowGoDeeper = allowGoDeeper; try { - options.remove(Options.ALLOW_VARIABLES_IN_PATTERN); return scan(node, original); } finally { - options.add(Options.ALLOW_VARIABLES_IN_PATTERN); allowGoDeeper = oldAllowGoDeeper; } } @@ -501,7 +497,7 @@ if (p.getLeaf().getKind() == Kind.IDENTIFIER) { String ident = ((IdentifierTree) p.getLeaf()).getName().toString(); - if (ident.startsWith("$") && options.contains(Options.ALLOW_VARIABLES_IN_PATTERN)) { + if (ident.startsWith("$")) { return scan(node, p); } } @@ -1556,8 +1552,8 @@ } private static final class UnattributedCopyFinder extends CopyFinder { - private UnattributedCopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel, Options... options) { - super(searchingFor, info, cancel, options); + private UnattributedCopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel) { + super(searchingFor, info, cancel); } @Override protected VerifyResult verifyElements(TreePath node, TreePath p) { @@ -1576,8 +1572,4 @@ return Collections.singleton(new TreePath(tp, thisTree)); } } - - public enum Options { - ALLOW_VARIABLES_IN_PATTERN - } } Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceHint.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceHint.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceHint.java 2011-08-04 21:48:28.788408634 +0100 @@ -49,11 +49,13 @@ import com.sun.source.tree.BreakTree; import com.sun.source.tree.CaseTree; import com.sun.source.tree.ClassTree; +import com.sun.source.tree.CompoundAssignmentTree; import com.sun.source.tree.ContinueTree; import com.sun.source.tree.DoWhileLoopTree; import com.sun.source.tree.ExpressionTree; import com.sun.source.tree.ForLoopTree; import com.sun.source.tree.IdentifierTree; +import com.sun.source.tree.IfTree; import com.sun.source.tree.MethodInvocationTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.ModifiersTree; @@ -69,6 +71,7 @@ import com.sun.source.tree.UnaryTree; import com.sun.source.tree.VariableTree; import com.sun.source.tree.WhileLoopTree; +import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; import com.sun.source.util.TreePathScanner; import java.awt.Color; @@ -82,14 +85,11 @@ import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; -import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; import javax.lang.model.element.Element; @@ -125,12 +125,9 @@ import org.netbeans.api.java.source.support.CaretAwareJavaSourceTaskFactory; import org.netbeans.api.java.source.support.SelectionAwareJavaSourceTaskFactory; import org.netbeans.api.lexer.TokenSequence; -import org.netbeans.lib.editor.util.swing.DocumentUtilities; import org.netbeans.modules.java.editor.codegen.GeneratorUtils; import org.netbeans.modules.java.hints.errors.Utilities; -import org.netbeans.modules.java.hints.infrastructure.JavaHintsPositionRefresher; import org.netbeans.modules.java.hints.introduce.CopyFinder.MethodDuplicateDescription; -import org.netbeans.modules.java.hints.introduce.Flow.FlowResult; import org.netbeans.spi.editor.highlighting.HighlightsLayer; import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; import org.netbeans.spi.editor.highlighting.ZOrder; @@ -355,11 +352,6 @@ HintsController.setErrors(info.getFileObject(), IntroduceHint.class.getName(), Collections.emptyList()); } else { HintsController.setErrors(info.getFileObject(), IntroduceHint.class.getName(), computeError(info, selection[0], selection[1], null, new EnumMap(IntroduceKind.class), cancel)); - - Document doc = info.getSnapshot().getSource().getDocument(false); - long version = doc != null ? DocumentUtilities.getDocumentVersion(doc) : 0; - - JavaHintsPositionRefresher.introduceHintsUpdated(doc, version, selection[0], selection[1]); } } @@ -410,7 +402,7 @@ return false; } - public static List computeError(CompilationInfo info, int start, int end, Map fixesMap, Map errorMessage, AtomicBoolean cancel) { + static List computeError(CompilationInfo info, int start, int end, Map fixesMap, Map errorMessage, AtomicBoolean cancel) { List hints = new LinkedList(); List fixes = new LinkedList(); TreePath resolved = validateSelection(info, start, end); @@ -457,7 +449,7 @@ prepareTypeVars(method, info, typeVar2Def, typeVars); - ScanStatement scanner = new ScanStatement(info, resolved.getLeaf(), resolved.getLeaf(), typeVar2Def, Collections.>emptyMap(), cancel); + ScanStatement scanner = new ScanStatement(info, resolved.getLeaf(), resolved.getLeaf(), typeVar2Def, cancel); if (methodEl != null && (methodEl.getKind() == ElementKind.METHOD || methodEl.getKind() == ElementKind.CONSTRUCTOR)) { ExecutableElement ee = (ExecutableElement) methodEl; @@ -470,7 +462,7 @@ List params = new LinkedList(); boolean error186980 = false; - for (VariableElement ve : scanner.usedLocalVariables.keySet()) { + for (VariableElement ve : scanner.usedLocalVariables) { TreePath path = info.getTrees().getPath(ve); if (path == null) { error186980 = true; @@ -489,7 +481,7 @@ exceptionHandles.add(TypeMirrorHandle.create(tm)); } - int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, Collections.singletonList(resolved), new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables.keySet(), cancel).size(); + int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, Collections.singletonList(resolved), new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables, cancel).size(); typeVars.retainAll(scanner.usedTypeVariables); @@ -573,14 +565,7 @@ Element methodEl = info.getTrees().getElement(method); List parentStatements = CopyFinder.getStatements(block); List statementsToWrap = parentStatements.subList(statements[0], statements[1] + 1); - FlowResult flow = Flow.assignmentsForUse(info, method, cancel); - - if (flow == null || cancel.get()) { - return null; - } - - Map> assignmentsForUse = flow.getAssignmentsForUse(); - ScanStatement scanner = new ScanStatement(info, statementsToWrap.get(0), statementsToWrap.get(statementsToWrap.size() - 1), typeVar2Def, assignmentsForUse, cancel); + ScanStatement scanner = new ScanStatement(info, statementsToWrap.get(0), statementsToWrap.get(statementsToWrap.size() - 1), typeVar2Def, cancel); Set exceptions = new HashSet(); int index = 0; TypeMirror methodReturnType = info.getTypes().getNoType(TypeKind.VOID); @@ -615,42 +600,16 @@ errorMessage.put(IntroduceKind.CREATE_METHOD, exitsError); return null; } - - Map mergedVariableUse = new LinkedHashMap(scanner.usedLocalVariables); - - for (Entry e : scanner.usedAfterSelection.entrySet()) { - if (cancel.get()) return null; - - Boolean usedLocal = mergedVariableUse.get(e.getKey()); - - if (usedLocal == null && Flow.definitellyAssigned(info, e.getKey(), pathsOfStatementsToWrap, cancel)) { - mergedVariableUse.put(e.getKey(), true); - } else { - mergedVariableUse.put(e.getKey(), !(usedLocal == Boolean.FALSE) && e.getValue()); - } - } - - if (cancel.get()) return null; - - Set additionalLocalVariables = new LinkedHashSet(); - Set paramsVariables = new LinkedHashSet(); - - for (Entry e : mergedVariableUse.entrySet()) { - if (e.getValue()) { - additionalLocalVariables.add(e.getKey()); - } else { - paramsVariables.add(e.getKey()); - additionalLocalVariables.remove(e.getKey()); - } - } List params = new LinkedList(); - for (VariableElement ve : paramsVariables) { + for (VariableElement ve : scanner.usedLocalVariables) { params.add(TreePathHandle.create(info.getTrees().getPath(ve), info)); } - additionalLocalVariables.removeAll(paramsVariables);//needed? + List additionalLocalVariables = new LinkedList(scanner.selectionWrittenLocalVariables); + + additionalLocalVariables.removeAll(scanner.usedLocalVariables); additionalLocalVariables.removeAll(scanner.selectionLocalVariables); List additionaLocalTypes = new LinkedList(); @@ -672,10 +631,10 @@ TreePathHandle returnAssignTo; boolean declareVariableForReturnValue; - int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, pathsOfStatementsToWrap, new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables.keySet(), cancel).size(); + int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, pathsOfStatementsToWrap, new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables, cancel).size(); - if (!scanner.usedAfterSelection.isEmpty()) { - VariableElement result = scanner.usedAfterSelection.keySet().iterator().next(); + if (!scanner.usedSelectionLocalVariables.isEmpty()) { + VariableElement result = scanner.usedSelectionLocalVariables.iterator().next(); returnType = result.asType(); returnAssignTo = TreePathHandle.create(info.getTrees().getPath(result), info); @@ -1088,13 +1047,13 @@ private Tree firstInSelection; private Tree lastInSelection; private Set localVariables = new HashSet(); - private Map usedLocalVariables = new LinkedHashMap(); /*true if all uses have been definitelly assigned inside selection*/ + private Set usedLocalVariables = new LinkedHashSet(); private Set selectionLocalVariables = new HashSet(); - private Map usedAfterSelection = new LinkedHashMap(); /*true if all uses have been definitelly assigned inside selection*/ + private Set selectionWrittenLocalVariables = new HashSet(); + private Set usedSelectionLocalVariables = new HashSet(); private Set selectionExits = new HashSet(); private Set treesSeensInSelection = new HashSet(); private final Map typeVar2Def; - private final Map> assignmentsForUse; private Set usedTypeVariables = new HashSet(); private boolean hasReturns = false; private boolean hasBreaks = false; @@ -1103,12 +1062,11 @@ private boolean stopSecondPass = false; private final AtomicBoolean cancel; - public ScanStatement(CompilationInfo info, Tree firstInSelection, Tree lastInSelection, Map typeVar2Def, Map> assignmentsForUse, AtomicBoolean cancel) { + public ScanStatement(CompilationInfo info, Tree firstInSelection, Tree lastInSelection, Map typeVar2Def, AtomicBoolean cancel) { this.info = info; this.firstInSelection = firstInSelection; this.lastInSelection = lastInSelection; this.typeVar2Def = typeVar2Def; - this.assignmentsForUse = assignmentsForUse; this.cancel = cancel; } @@ -1161,6 +1119,14 @@ @Override public Void visitAssignment(AssignmentTree node, Void p) { + if (phase == PHASE_INSIDE_SELECTION) { + Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable())); + + if (e != null && LOCAL_VARIABLES.contains(e.getKind()) && localVariables.contains(e)) { + selectionWrittenLocalVariables.add((VariableElement) e); + } + } + //make sure the variable on the left side is not considered to be read //#162163: but dereferencing array is a read if (node.getVariable() != null && node.getVariable().getKind() != Kind.IDENTIFIER) { @@ -1171,6 +1137,36 @@ } @Override + public Void visitCompoundAssignment(CompoundAssignmentTree node, Void p) { + if (phase == PHASE_INSIDE_SELECTION) { + Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable())); + + if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { + selectionWrittenLocalVariables.add((VariableElement) e); + } + } + + return super.visitCompoundAssignment(node, p); + } + + @Override + public Void visitUnary(UnaryTree node, Void p) { + Kind k = node.getKind(); + + if (k == Kind.POSTFIX_DECREMENT || k == Kind.POSTFIX_INCREMENT || k == Kind.PREFIX_DECREMENT || k == Kind.PREFIX_INCREMENT) { + //#109663: + if (phase == PHASE_INSIDE_SELECTION) { + Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getExpression())); + + if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { + selectionWrittenLocalVariables.add((VariableElement) e); + } + } + } + return super.visitUnary(node, p); + } + + @Override public Void visitIdentifier(IdentifierTree node, Void p) { Element e = info.getTrees().getElement(getCurrentPath()); @@ -1178,42 +1174,13 @@ if (LOCAL_VARIABLES.contains(e.getKind())) { switch (phase) { case PHASE_INSIDE_SELECTION: - if (localVariables.contains(e) && !usedLocalVariables.containsKey(e)) { - Iterable writes = assignmentsForUse.get(getCurrentPath().getLeaf()); - boolean definitellyAssignedInSelection = true; - - if (writes != null) { - for (TreePath w : writes) { - if (w == null || !treesSeensInSelection.contains(w.getLeaf())) { - definitellyAssignedInSelection = false; - break; - } - } - } else { - definitellyAssignedInSelection = false; - } - - usedLocalVariables.put((VariableElement) e, definitellyAssignedInSelection); + if (localVariables.contains(e)) { + usedLocalVariables.add((VariableElement) e); } break; case PHASE_AFTER_SELECTION: - Iterable writes = assignmentsForUse.get(getCurrentPath().getLeaf()); - boolean assignedInSelection = false; - boolean definitellyAssignedInSelection = true; - - if (writes != null) { - for (TreePath w : writes) { - if (w != null && treesSeensInSelection.contains(w.getLeaf())) { - assignedInSelection = true; - } - if (w == null || !treesSeensInSelection.contains(w.getLeaf())) { - definitellyAssignedInSelection = false; - } - } - } - - if (assignedInSelection) { - usedAfterSelection.put((VariableElement) e, definitellyAssignedInSelection); + if (selectionLocalVariables.contains(e) || selectionWrittenLocalVariables.contains(e)) { + usedSelectionLocalVariables.add((VariableElement) e); } break; } @@ -1331,7 +1298,7 @@ return "ERR_Too_Many_Different_Exits"; // NOI18N } - if ((exitsFromAllBranches ? 0 : i) + usedAfterSelection.size() > 1) { + if ((exitsFromAllBranches ? 0 : i) + usedSelectionLocalVariables.size() > 1) { return "ERR_Too_Many_Return_Values"; // NOI18N } @@ -1896,8 +1863,8 @@ Tree returnTypeTree = make.Type(returnType); ExpressionTree invocation = make.MethodInvocation(Collections.emptyList(), make.Identifier(name), realArguments); - Callable ret = null; - final VariableElement returnAssignTo; + ReturnTree ret = null; + VariableElement returnAssignTo = null; if (IntroduceMethodFix.this.returnAssignTo != null) { returnAssignTo = (VariableElement) IntroduceMethodFix.this.returnAssignTo.resolveElement(copy); @@ -1905,16 +1872,10 @@ if (returnAssignTo == null) { return; //TODO... } - } else { - returnAssignTo = null; } if (returnAssignTo != null) { - ret = new Callable() { - @Override public ReturnTree call() throws Exception { - return make.Return(make.Identifier(returnAssignTo.getSimpleName())); - } - }; + ret = make.Return(make.Identifier(returnAssignTo.getSimpleName())); if (declareVariableForReturnValue) { nueStatements.add(make.Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), returnAssignTo.getSimpleName(), returnTypeTree, invocation)); invocation = null; @@ -1934,19 +1895,15 @@ assert handle != null; - if (exitsFromAllBranches && handle.getLeaf().getKind() == Kind.RETURN && returnAssignTo == null && returnType.getKind() != TypeKind.VOID) { + if (exitsFromAllBranches && handle.getLeaf().getKind() == Kind.RETURN) { nueStatements.add(make.Return(invocation)); } else { if (ret == null) { - ret = new Callable() { - @Override public ReturnTree call() throws Exception { - if (exitsFromAllBranches) { - return make.Return(null); - } else { - return make.Return(make.Literal(true)); - } - } - }; + if (exitsFromAllBranches) { + ret = make.Return(null); + } else { + ret = make.Return(make.Literal(true)); + } } for (TreePathHandle h : exists) { @@ -1956,12 +1913,7 @@ return ; //TODO... } - ReturnTree r = ret.call(); - - GeneratorUtilities.get(copy).copyComments(resolved.getLeaf(), r, false); - GeneratorUtilities.get(copy).copyComments(resolved.getLeaf(), r, true); - - copy.rewrite(resolved.getLeaf(), r); + copy.rewrite(resolved.getLeaf(), ret); } StatementTree branch = null; @@ -1990,7 +1942,7 @@ invocation = null; } else { if (ret != null) { - methodStatements.add(ret.call()); + methodStatements.add(ret); } } Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java 2011-08-04 21:48:28.788408634 +0100 @@ -323,9 +323,7 @@ "compiler.err.report.access", "compiler.err.does.not.override.abstract", "compiler.err.abstract.cant.be.instantiated", - "compiler.warn.missing.SVUID", - "compiler.warn.has.been.deprecated", - "compiler.warn.raw.class.use" + "compiler.warn.missing.SVUID" )); private static final Set WHITESPACE = EnumSet.of(JavaTokenId.BLOCK_COMMENT, JavaTokenId.JAVADOC_COMMENT, JavaTokenId.LINE_COMMENT, JavaTokenId.WHITESPACE); Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresher.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresher.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresher.java 2011-08-04 21:48:28.788408634 +0100 @@ -48,7 +48,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import java.util.EnumMap; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -62,18 +61,14 @@ import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.Task; -import org.netbeans.api.java.source.support.SelectionAwareJavaSourceTaskFactory; import org.netbeans.api.progress.ProgressUtils; import org.netbeans.editor.BaseDocument; import org.netbeans.editor.Utilities; import org.netbeans.lib.editor.util.swing.DocumentUtilities; -import org.netbeans.modules.java.hints.introduce.IntroduceHint; -import org.netbeans.modules.java.hints.introduce.IntroduceKind; import org.netbeans.modules.java.hints.jackpot.impl.hints.HintsInvoker; import org.netbeans.modules.java.hints.jackpot.impl.hints.HintsTask; import org.netbeans.spi.editor.hints.Context; import org.netbeans.spi.editor.hints.ErrorDescription; -import org.netbeans.spi.editor.hints.Fix; import org.netbeans.spi.editor.hints.LazyFixList; import org.netbeans.spi.editor.hints.PositionRefresher; import org.openide.util.Exceptions; @@ -149,7 +144,7 @@ //SuggestionsTask if ((version > 0 && holder.suggestions < version) || holder.suggestionsCaret != position) { LOG.fine("Computing suggestions"); - eds.put(HintsTask.KEY_SUGGESTIONS, new HintsInvoker(controller, position, ctx.getCancel()).computeHints(controller)); + eds.put(HintsTask.KEY_SUGGESTIONS, new HintsInvoker(controller, position, new AtomicBoolean()).computeHints(controller)); } else { LOG.fine("Suggestions already computed"); } @@ -165,7 +160,7 @@ int rowStart = Utilities.getRowStart((BaseDocument) doc, position); int rowEnd = Utilities.getRowEnd((BaseDocument) doc, position); - eds.put(HintsTask.KEY_HINTS, new HintsInvoker(controller, rowStart, rowEnd, ctx.getCancel()).computeHints(controller)); + eds.put(HintsTask.KEY_HINTS, new HintsInvoker(controller, rowStart, rowEnd, new AtomicBoolean()).computeHints(controller)); } else { LOG.fine("Hints already computed"); } @@ -174,25 +169,6 @@ return; } - //IntroduceHints: - int[] selection = SelectionAwareJavaSourceTaskFactory.getLastSelection(controller.getFileObject()); - - if (selection != null) { - if ((version > 0 && holder.introduce < version) || holder.introduceSelStart != selection[0] || holder.introduceSelEnd != selection[1]) { - LOG.fine("Computing introduce hints"); - - eds.put(IntroduceHint.class.getName(), IntroduceHint.computeError(controller, selection[0], selection[1], new EnumMap(IntroduceKind.class), new EnumMap(IntroduceKind.class), ctx.getCancel())); - } else { - LOG.fine("Introduce hints already computed"); - } - } else { - LOG.fine("No selection, not computing introduce hints"); - } - - if (ctx.isCanceled()) { - return; - } - //ErrorHints if (version > 0 && holder.errors < version) { LOG.fine("Computing errors"); @@ -234,13 +210,6 @@ getHolder(doc).suggestionsCaret = caret; } - public static void introduceHintsUpdated(Document doc, long version, int selStart, int selEnd) { - if (doc == null) return; - getHolder(doc).introduce = version; - getHolder(doc).introduceSelStart = selStart; - getHolder(doc).introduceSelEnd = selEnd; - } - public static void errorsUpdated(Document doc, long version, List errors) { if (doc == null) return; getHolder(doc).errors = version; @@ -262,9 +231,6 @@ private int suggestionsCaret; private long hints; private long errors; - private long introduce; - private long introduceSelStart; - private long introduceSelEnd; private List errorsContent; } } Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/ChangeTypeFix.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/errors/ChangeTypeFix.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/ChangeTypeFix.java 2011-08-04 21:48:28.788408634 +0100 @@ -124,4 +124,8 @@ return s; } + static { + NbBundle.setBranding("test"); + } + } Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java 2011-08-04 21:48:28.788408634 +0100 @@ -1119,10 +1119,7 @@ } public static Visibility forTree(Tree t) { switch (t.getKind()) { - case ANNOTATION_TYPE: - case CLASS: - case ENUM: - case INTERFACE: return forModifiers(((ClassTree) t).getModifiers()); + case CLASS: return forModifiers(((ClassTree) t).getModifiers()); case VARIABLE: return forModifiers(((VariableTree) t).getModifiers()); case METHOD: return forModifiers(((MethodTree) t).getModifiers()); default: return null; Index: netbeans-7.0.1+dfsg1/java.hints/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/nbproject/project.properties 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/nbproject/project.properties 2011-08-04 21:48:28.788408634 +0100 @@ -40,7 +40,7 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. -spec.version.base=1.54.1 +spec.version.base=1.49.1 javac.source=1.6 Index: netbeans-7.0.1+dfsg1/java.hints/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/nbproject/project.xml 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/nbproject/project.xml 2011-08-04 21:48:28.788408634 +0100 @@ -43,6 +43,8 @@ Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder. --> + org.netbeans.modules.apisupport.project @@ -55,7 +57,7 @@ 1 - 1.9.1 + 1.4 @@ -64,7 +66,7 @@ 1 - 1.33.1 + 1.18 @@ -73,7 +75,7 @@ 1 - 1.29.1 + 1.24 @@ -82,7 +84,7 @@ 1 - 1.24.1 + 1.16 @@ -90,7 +92,7 @@ - 7.6.1.3 + 7.3 @@ -99,7 +101,7 @@ 1 - 0.22.1.15 + 0.14 @@ -108,7 +110,7 @@ 3 - 3.2.1 + 3.0 @@ -117,7 +119,7 @@ 3 - 1.57.1.5.13.10 + 1.53 @@ -126,7 +128,7 @@ 1 - 2.16.1.1 + 2.3 @@ -135,7 +137,7 @@ 3 - 3.9.1.13.10 + 3.1 @@ -144,7 +146,7 @@ 1 - 1.43.1.10 + 1.8 @@ -153,7 +155,7 @@ 1 - 1.22.1 + 1.15 @@ -162,7 +164,7 @@ 1 - 1.36.1 + 1.28 @@ -171,7 +173,7 @@ 1 - 1.42.1 + 1.33 @@ -186,9 +188,8 @@ org.netbeans.modules.java.hints.processor - - 1.7.1.1.15 + 1.1 @@ -197,7 +198,7 @@ 1 - 1.14.1 + 1.0 @@ -206,7 +207,7 @@ 1 - 1.21.1 + 1.16 @@ -214,7 +215,7 @@ - 1.18.1.1 + 1.12 @@ -231,7 +232,7 @@ 2 - 1.39.1.1 + 1.25 @@ -240,7 +241,7 @@ 1 - 1.22.1 + 1.5 @@ -249,7 +250,7 @@ 1 - 1.25.1 + 1.20 @@ -267,7 +268,7 @@ 1 - 1.36.1 + 1.28 @@ -276,7 +277,7 @@ 1 - 1.51.1.8 + 1.40 @@ -285,7 +286,7 @@ 1 - 1.23.1 + 1.18 @@ -293,7 +294,7 @@ - 1.16.1 + 1.9 @@ -302,7 +303,7 @@ 1 - 1.20.1.1 + 1.10 @@ -311,7 +312,7 @@ 0-1 - 1.18.1.7.10 + 1.13 @@ -319,7 +320,7 @@ - 6.22.1 + 6.15 @@ -327,7 +328,7 @@ - 7.31.1 + 6.10 @@ -335,7 +336,7 @@ - 7.20.1 + 7.0 @@ -343,7 +344,7 @@ - 6.35.1 + 6.22 @@ -351,7 +352,7 @@ - 7.47.1 + 7.19 @@ -365,7 +366,7 @@ - 7.23.1 + 7.3 @@ -373,7 +374,7 @@ - 7.21.1 + 6.2 @@ -381,7 +382,7 @@ - 6.37.1 + 6.16 @@ -389,7 +390,7 @@ - 8.15.1 + 8.10 @@ -397,7 +398,7 @@ - 8.8.1 + 8.0 @@ -405,7 +406,7 @@ - 6.40.1 + 6.16 Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/StaticAccessTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/StaticAccessTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/StaticAccessTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -83,7 +83,7 @@ String golden = (before + after).replace('\n', ' ').replace("b.value", "Boolean.value"); performFixTest("test/Test.java", before + after, before.length(), - "3:6-3:13:verifier:AS1valueOf", + "3:4-3:5:verifier:AS1valueOf", "MSG_StaticAccessText", golden ); @@ -107,7 +107,7 @@ performFixTest("test/Test.java", before + after, before.length(), - "3:6-3:13:verifier:AS1valueOf", + "3:4-3:5:verifier:AS1valueOf", "MSG_StaticAccessText", golden ); @@ -143,7 +143,7 @@ String after = "UE;"; performAnalysisTest("test/Test.java", before + after, before.length(), - "0:52-0:56:verifier:AS0TRUE" + "0:50-0:51:verifier:AS0TRUE" ); } public void testOkAccessingStaticField() throws Exception { @@ -163,7 +163,7 @@ String after = "UE;"; performAnalysisTest("test/Test.java", before + after, before.length(), - "0:78-0:82:verifier:AS0TRUE" + "0:74-0:77:verifier:AS0TRUE" ); } public void testOkToCallEqualsOnString() throws Exception { @@ -190,7 +190,7 @@ "}"; performAnalysisTest("test/Test.java", before + after, before.length(), - "2:2-2:6:verifier:AS1test" + "2:0-2:1:verifier:AS1test" ); } @@ -233,33 +233,6 @@ performAnalysisTest("test/Test.java", code); } - - public void testInterface198646() throws Exception { - String code = "package test; class Test {\n" + - "public void run(A a) {\n" + - "int i = a.I|II;\n" + - "}\n" + - "}\n" + - "interface A {\n" + - " public static final int III = 0;\n" + - "}"; - - performAnalysisTest("test/Test.java", code, "2:10-2:13:verifier:AS0III"); - } - - public void testEnum198646() throws Exception { - String code = "package test; class Test {\n" + - "public void run(A a) {\n" + - "int i = a.I|II;\n" + - "}\n" + - "}\n" + - "enum A {\n" + - " A;\n" + - " public static final int III = 0;\n" + - "}"; - - performAnalysisTest("test/Test.java", code, "2:10-2:13:verifier:AS0III"); - } protected List computeErrors(CompilationInfo info, TreePath path) { SourceUtilsTestUtil.setSourceLevel(info.getFileObject(), sourceLevel); Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/UtilityClassWithConstructorTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/UtilityClassWithConstructorTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/UtilityClassWithConstructorTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -139,15 +139,6 @@ "}"); } - public void testException197721() throws Exception { - performAnalysisTest("test/Test.java", - "package test; public class Test extends Exception {\n" + - " private static final long serialVersionUID = 1L;\n" + - " public Te|st() { }\n" + - " public Test(int i) { }\n" + - "}"); - } - protected List computeErrors(CompilationInfo info, TreePath path) { SourceUtilsTestUtil.setSourceLevel(info.getFileObject(), sourceLevel); return UtilityClass.withConstructor().run(info, path); Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/TestUtilities.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/TestUtilities.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/TestUtilities.java 2011-08-04 21:48:28.798408740 +0100 @@ -42,12 +42,8 @@ } public static String detectOffsets(String source, int[] positionOrSpan) { - return detectOffsets(source, positionOrSpan, "\\|"); - } - - public static String detectOffsets(String source, int[] positionOrSpan, String delimiter) { //for now, the position/span delimiter is '|', without possibility of escaping: - String[] split = source.split(delimiter); + String[] split = source.split("\\|"); Assert.assertTrue("incorrect number of position markers (|)", positionOrSpan.length == split.length - 1); Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/CollectionRemoveTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/CollectionRemoveTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/CollectionRemoveTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -242,16 +242,6 @@ "}"); } - public void testInsideItsOverride196606() throws Exception { - performAnalysisTest("test/Test.java", - "package test;" + - "public class Test extends java.util.ArrayList {" + - " @Override public boolean remove(Object o) {" + - " return super.remove(o);\n" + - " }" + - "}"); - } - static { NbBundle.setBranding("test"); } Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/encapsulation/ClassEncapsulationTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/encapsulation/ClassEncapsulationTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/encapsulation/ClassEncapsulationTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -155,16 +155,6 @@ "}"); } - public void test197590() throws Exception { - performAnalysisTest("test/Test.java", - "package test;\n" + - "public class Test {\n" + - " private enum A {\n"+ - " E\n"+ - " }\n"+ - "}"); - } - public void testEnumIgnore() throws Exception { Preferences p = RulesManager.getPreferences(ClassEncapsulation.class.getName() + ".publicCls", HintsSettings.getCurrentProfileId()); Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/perf/TinyTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/perf/TinyTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/perf/TinyTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -344,10 +344,9 @@ "3:16-3:86:verifier:ERR_Tiny_enumMap", "FIX_Tiny_enumMap", ("package test;\n" + - "import java.util.EnumMap;\n" + "public class Test {\n" + " private java.util.Map test() {\n" + - " return new EnumMap(java.lang.annotation.RetentionPolicy.class);\n" + + " return new java.util.HashMap(java.lang.annotation.RetentionPolicy.class);\n" + " }\n" + "}\n").replaceAll("[\t\n ]+", " ")); } Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/CopyFinderTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/CopyFinderTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/CopyFinderTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -63,7 +63,6 @@ import org.netbeans.junit.NbTestCase; import org.netbeans.junit.NbTestSuite; import org.netbeans.modules.java.hints.introduce.CopyFinder.MethodDuplicateDescription; -import org.netbeans.modules.java.hints.introduce.CopyFinder.Options; import org.netbeans.modules.java.hints.introduce.CopyFinder.VariableAssignments; import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch; import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch.BulkPattern; @@ -796,26 +795,6 @@ true); } - public void testDisableVariablesWhenVerifyingDuplicates1() throws Exception { - performVariablesTest("package test; public class Test { public void test() { int $i = 1, $j = 2; int k = $i + $i; } }", - "$i + $i", - new Pair[] {new Pair("$i", new int[] {83, 85})}, - new Pair[0], - new Pair[0], - false, - true); - } - - public void testDisableVariablesWhenVerifyingDuplicates2() throws Exception { - performVariablesTest("package test; public class Test { public void test() { int $i = 1, $j = 2; int k = $i + $i; } }", - "$i + $i", - new Pair[] {new Pair("$i", new int[] {83, 85})}, - new Pair[0], - new Pair[0], - false, - false); - } - protected void prepareTest(String code) throws Exception { prepareTest(code, -1); } @@ -1064,7 +1043,7 @@ } protected Map computeDuplicates(CompilationInfo info, TreePath searchingFor, TreePath scope, AtomicBoolean cancel, Map designedTypeHack) { - return CopyFinder.computeDuplicates(info, searchingFor, scope, true, cancel, designedTypeHack, Options.ALLOW_VARIABLES_IN_PATTERN); + return CopyFinder.computeDuplicates(info, searchingFor, scope, cancel, designedTypeHack); } private void performRemappingTest(String code, String... remappableVariables) throws Exception { @@ -1144,7 +1123,7 @@ } protected Collection computeDuplicates(TreePath path) { - return CopyFinder.computeDuplicates(info, path, new TreePath(info.getCompilationUnit()), new AtomicBoolean(), null).keySet(); + return computeDuplicates(info, path, new TreePath(info.getCompilationUnit()), new AtomicBoolean(), null).keySet(); } public static final class Pair { Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -972,52 +972,20 @@ new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true)); } - public void testIntroduceMethod114371() throws Exception { - performFixTest("package test;\n" + - "public class Test {\n" + - " public static void test(boolean arg) {\n" + - " int c = 0;\n" + - " \n" + - " |if (arg) c = 3;|\n" + - " \n" + - " System.err.println(c);\n" + - " }\n" + - "}", - "package test; public class Test { public static void test(boolean arg) { int c = 0; c = name(arg, c); System.err.println(c); } private static int name(boolean arg, int c) { if (arg) c = 3; return c; } }", - new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true)); - } - - public void testIntroduceMethod179258() throws Exception { - performFixTest("package test;\n" + - "public class Test {\n" + - " public static void test() {\n" + - " String test = null;\n" + - " |test = \"foo\";\n" + - " if (test == null) {\n" + - " System.err.println(1);\n" + - " } else {\n" + - " System.err.println(2);\n" + - " }|\n" + - " }\n" + - "}", - ("package test;\n" + - "public class Test {\n" + - " public static void test() {\n" + - " String test = null;\n" + - " name();\n" + - " }\n" + - " private static void name() {\n" + - " String test;\n" + - " test = \"foo\";\n" + - " if (test == null) {\n" + - " System.err.println(1);\n" + - " } else {\n" + - " System.err.println(2);\n" + - " }\n" + - " }\n" + - "}").replaceAll("[ \t\n]+", " "), - new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true)); - } +// public void testIntroduceMethod114371() throws Exception { +// performFixTest("package test;\n" + +// "public class Test {\n" + +// " public static void test(boolean arg) {\n" + +// " int c = 0;\n" + +// " \n" + +// " |if (arg) c = 3;|\n" + +// " \n" + +// " System.err.println(c);\n" + +// " }\n" + +// "}", +// "package test; public class Test { public static void test(boolean arg) { int c = 0; c = name(arg); System.err.println(c); } private static int name(boolean arg, int c) { if (arg) { c = 3; } return c; } }", +// new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true)); +// } public void testIntroduceMethod116199() throws Exception { performFixTest("package test;\n" + @@ -1427,53 +1395,6 @@ 3, 0); } - public void test196683() throws Exception { - performFixTest("package test;\n" + - "import java.util.ArrayList;\n" + - "public class Test {\n" + - " public void loop(int a) {\n" + - " String s= \"\";\n" + - " while(--a>0) {\n" + - " |//6\n" + - " if (a%3 != 0) {\n" + - " s = s+\"--, \";\n" + - " return;\n" + - " }\n" + - " //7\n" + - " s = s+a+\", \";\n" + - " return;\n" + - " //8|\n" + - " }\n" + - " System.err.println(s);\n" + - " }\n" + - "}", - ("package test;\n" + - "import java.util.ArrayList;\n" + - "public class Test {\n" + - " public void loop(int a) {\n" + - " String s= \"\";\n" + - " while(--a>0) {\n" + - " foo(a, s);\n" + - " return;\n" + - " }\n" + - " System.err.println(s);\n" + - " }\n" + - " private void foo(int a, String s) {\n" + - " //6\n" + - " if (a%3 != 0) {\n" + - " s = s+\"--, \";\n" + - " return;\n" + - " }\n" + - " //7\n" + - " s = s+a+\", \";\n" + - " return;\n" + - " //8\n" + - " }\n" + - "}").replaceAll("[ \t\n]+", " "), - new DialogDisplayerImpl3("foo", EnumSet.of(Modifier.PRIVATE), true), - 1, 0); - } - public void test193775() throws Exception { performCheckFixesTest("package test; import java.util.Collection; import java.util.Map.Entry; public class Test { public void test(|Collection e|) {} }"); } Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresherTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresherTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresherTest.java 2011-08-04 21:48:28.798408740 +0100 @@ -207,7 +207,7 @@ public void testHintCount173282() throws Exception { performTest("test/Test.java", "class Test { static int statField; int field; public void method() { \n|String field = \"\"; \nSystem.out.println(field); Integer.parseInt(\"1\"); if(\"\"== \"\") { System.out.println(\"ok\"); } this.statField = 23; } }", - new String[] {"2:53-2:60:verifier:Comparing Strings using == or !=", "1:7-1:12:verifier:Local variable hides a field", "2:97-2:106:verifier:AS0statField"}); + new String[] {"2:53-2:60:verifier:Comparing Strings using == or !=", "1:7-1:12:verifier:Local variable hides a field", "2:92-2:96:verifier:AS0statField"}); } public void testEmptyStatement() throws Exception { Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ChangeTypeTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ChangeTypeTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ChangeTypeTest.java 2011-08-04 21:48:28.808408834 +0100 @@ -49,7 +49,6 @@ import java.util.List; import org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase; import org.netbeans.spi.editor.hints.Fix; -import org.openide.util.NbBundle; /** @@ -209,8 +208,4 @@ return ((ChangeTypeFix) f).getText(); } - static { - NbBundle.setBranding("test"); - } - } Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java 2011-07-28 20:45:56.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java 2011-08-04 21:48:28.808408834 +0100 @@ -44,7 +44,6 @@ package org.netbeans.modules.java.hints.errors; import org.netbeans.modules.java.hints.infrastructure.*; -import org.openide.util.NbBundle; /** * @author Jan Lahoda @@ -462,8 +461,4 @@ performTest("org.netbeans.test.java.hints.MakeClassAbstract3", "abstract", 3, 1); } - static { - NbBundle.setBranding("test"); - } - } Index: netbeans-7.0.1+dfsg1/java.navigation/manifest.mf =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.navigation/manifest.mf 2011-07-28 20:45:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.navigation/manifest.mf 2011-08-04 21:48:28.808408834 +0100 @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.java.navigation/1 OpenIDE-Module-Layer: org/netbeans/modules/java/navigation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/navigation/Bundle.properties -OpenIDE-Module-Specification-Version: 1.21.1 +OpenIDE-Module-Specification-Version: 1.20.1 AutoUpdate-Show-In-Client: false Index: netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java 2011-07-28 20:45:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java 2011-08-04 21:48:28.808408834 +0100 @@ -235,7 +235,7 @@ return null; boolean inherited = isParentInherited || (null != parent && !parent.equals( e.getEnclosingElement() )); - Description d = new Description( ui, e.getSimpleName().toString(), ElementHandle.create(e), e.getKind(), inherited ); + Description d = new Description( ui, e.getSimpleName().toString(), ElementHandle.create(e), e.getKind(), TreePathHandle.create(e, info), inherited ); if( e instanceof TypeElement ) { d.subs = new HashSet(); @@ -250,7 +250,10 @@ d.modifiers = e.getModifiers(); d.pos = getPosition(e, info, pos); - d.cpInfo = info.getClasspathInfo(); + + if( inherited ) { + d.cpInfo = info.getClasspathInfo(); + } return d; } Index: netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java 2011-07-28 20:45:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java 2011-08-04 21:48:28.808408834 +0100 @@ -77,7 +77,6 @@ import org.openide.util.datatransfer.PasteType; import org.openide.util.lookup.AbstractLookup; import org.openide.util.lookup.InstanceContent; -import org.openide.util.lookup.InstanceContent.Convertor; /** Node representing an Element * @@ -93,7 +92,7 @@ /** Creates a new instance of TreeNode */ public ElementNode( Description description ) { - super(description.subs == null ? Children.LEAF: new ElementChilren(description.subs, description.ui.getFilters()), prepareLookup(description)); + super(description.subs == null ? Children.LEAF: new ElementChilren(description.subs, description.ui.getFilters()), description.treePathHandle==null ? null : prepareLookup(description)); this.description = description; setDisplayName( description.name ); } @@ -286,63 +285,44 @@ private static Lookup prepareLookup(Description d) { InstanceContent ic = new InstanceContent(); - ic.add(d, ConvertDescription2TreePathHandle); - ic.add(d, ConvertDescription2FileObject); - ic.add(d, ConvertDescription2DataObject); + ic.add(d.treePathHandle); + ic.add(d, new InstanceContent.Convertor() { + public FileObject convert(Description d) { + return d.getFileObject(); + } + public Class type(Description obj) { + return FileObject.class; + } + public String id(Description obj) { + return "IL[" + obj.toString(); + } + public String displayName(Description obj) { + return id(obj); + } + }); + ic.add(d,new InstanceContent.Convertor(){ + public DataObject convert(Description d) { + try { + final FileObject fo = d.getFileObject(); + return fo == null ? null : DataObject.find(fo); + } catch (DataObjectNotFoundException ex) { + return null; + } + } + public Class type(Description obj) { + return DataObject.class; + } + public String id(Description obj) { + return "IL[" + obj.toString(); + } + public String displayName(Description obj) { + return id(obj); + } + }); return new AbstractLookup(ic); } - private static final Convertor ConvertDescription2TreePathHandle = new InstanceContent.Convertor() { - @Override public TreePathHandle convert(Description obj) { - return TreePathHandle.from(obj.elementHandle, obj.cpInfo); - } - @Override public Class type(Description obj) { - return TreePathHandle.class; - } - @Override public String id(Description obj) { - return "IL[" + obj.toString(); - } - @Override public String displayName(Description obj) { - return id(obj); - } - }; - - private static final Convertor ConvertDescription2FileObject = new InstanceContent.Convertor() { - public FileObject convert(Description d) { - return d.getFileObject(); - } - public Class type(Description obj) { - return FileObject.class; - } - public String id(Description obj) { - return "IL[" + obj.toString(); - } - public String displayName(Description obj) { - return id(obj); - } - }; - - private static final Convertor ConvertDescription2DataObject = new InstanceContent.Convertor(){ - public DataObject convert(Description d) { - try { - final FileObject fo = d.getFileObject(); - return fo == null ? null : DataObject.find(fo); - } catch (DataObjectNotFoundException ex) { - return null; - } - } - public Class type(Description obj) { - return DataObject.class; - } - public String id(Description obj) { - return "IL[" + obj.toString(); - } - public String displayName(Description obj) { - return id(obj); - } - }; - private static final class ElementChilren extends Children.Keys { public ElementChilren(Collection descriptions, ClassMemberFilters filters ) { @@ -376,6 +356,7 @@ final String name; final ElementHandle elementHandle; + final TreePathHandle treePathHandle; final ElementKind kind; Set modifiers; Collection subs; @@ -388,6 +369,7 @@ this.ui = ui; this.name = null; this.elementHandle = null; + this.treePathHandle = null; this.kind = null; this.isInherited = false; } @@ -396,12 +378,14 @@ String name, ElementHandle elementHandle, ElementKind kind, + TreePathHandle tpHandle, boolean inherited ) { this.ui = ui; this.name = name; this.elementHandle = elementHandle; this.kind = kind; this.isInherited = inherited; + this.treePathHandle = tpHandle; } public FileObject getFileObject() { @@ -430,12 +414,12 @@ return false; } - if (this.name != d.name && (this.name == null || !this.name.equals(d.name))) { + if ( !name.equals(d.name) ) { // System.out.println("- name"); return false; } - - if (this.elementHandle != d.elementHandle && (this.elementHandle == null || !this.elementHandle.equals(d.elementHandle))) { + + if ( !this.elementHandle.signatureEquals(d.elementHandle) ) { return false; } Index: netbeans-7.0.1+dfsg1/java.navigation/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.navigation/nbproject/project.xml 2011-07-28 20:45:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.navigation/nbproject/project.xml 2011-08-04 21:48:28.808408834 +0100 @@ -55,7 +55,15 @@ 1 - 1.17.1 + 1.4 + + + + org.openide.text + + + + 6.16 @@ -64,7 +72,7 @@ 1 - 1.33.1 + 1.18 @@ -73,7 +81,7 @@ 1 - 1.29.1 + 1.0 @@ -81,7 +89,7 @@ - 7.6.1.3 + 0.5 @@ -90,7 +98,7 @@ 3 - 1.57.1.5.13.10 + 1.53 @@ -99,7 +107,7 @@ 3 - 3.9.1.13.10 + 3.1 @@ -108,7 +116,7 @@ 1 - 1.43.1.10 + 1.4 @@ -117,7 +125,7 @@ 1 - 1.22.1 + 1.10 @@ -126,7 +134,7 @@ 1 - 1.36.1 + 1.19 @@ -135,7 +143,7 @@ 1 - 1.14.1 + 1.2 @@ -143,7 +151,7 @@ - 0.79.1.17.15.6 + 0.3.0 @@ -152,7 +160,7 @@ 1 - 1.22.1.1.17 + 1.0 @@ -161,7 +169,7 @@ 2 - 1.39.1.1 + 1.22 @@ -170,7 +178,7 @@ 1 - 1.36.1 + 1.12 @@ -179,7 +187,7 @@ 1 - 1.51.1.8 + 1.22 @@ -187,7 +195,7 @@ - 1.16.1 + 1.3 @@ -203,7 +211,7 @@ - 7.31.1 + 6.2 @@ -211,7 +219,7 @@ - 6.35.1 + 6.21 @@ -219,7 +227,7 @@ - 7.47.1 + 6.2 @@ -227,7 +235,7 @@ - 7.21.1 + 4.15 @@ -235,15 +243,7 @@ - 7.21.1 - - - - org.openide.text - - - - 6.37.1 + 6.2 @@ -251,7 +251,7 @@ - 8.15.1 + 8.0 @@ -259,7 +259,7 @@ - 8.8.1 + 8.0 @@ -267,7 +267,7 @@ - 6.40.1 + 6.2 Index: netbeans-7.0.1+dfsg1/java.navigation/test/unit/src/org/netbeans/modules/java/navigation/ElementNodeTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.navigation/test/unit/src/org/netbeans/modules/java/navigation/ElementNodeTest.java 2011-07-28 20:45:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.navigation/test/unit/src/org/netbeans/modules/java/navigation/ElementNodeTest.java 2011-08-04 21:48:28.808408834 +0100 @@ -85,7 +85,7 @@ counter.incrementAndGet(); return info.getFileObject(); } - }, "test", ElementHandle.create(el), el.getKind(), false); + }, "test", ElementHandle.create(el), el.getKind(), tph, false); d.cpInfo = info.getClasspathInfo(); @@ -96,7 +96,7 @@ assertEquals(info.getFileObject(), n.getLookup().lookup(FileObject.class)); assertEquals(1, counter.get()); - assertEquals(tph.resolve(info).getLeaf(), n.getLookup().lookup(TreePathHandle.class).resolve(info).getLeaf()); + assertEquals(tph, n.getLookup().lookup(TreePathHandle.class)); } public void testNoFileObject() throws Exception { @@ -114,7 +114,7 @@ counter.incrementAndGet(); return null; } - }, "test", ElementHandle.create(el), el.getKind(), false); + }, "test", ElementHandle.create(el), el.getKind(), TreePathHandle.create(tp, info), false); d.cpInfo = info.getClasspathInfo(); @@ -134,8 +134,6 @@ private CompilationInfo info; private void prepareTest(String filename, String code) throws Exception { - clearWorkDir(); - File work = getWorkDir(); FileObject workFO = FileUtil.toFileObject(work); Index: netbeans-7.0.1+dfsg1/javadoc/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/javadoc/nbproject/project.xml 2011-07-28 20:46:00.000000000 +0100 +++ netbeans-7.0.1+dfsg1/javadoc/nbproject/project.xml 2011-08-04 21:48:28.808408834 +0100 @@ -117,7 +117,7 @@ 1 - 1.54.1.5.8.17.6 + 1.49.1 Index: netbeans-7.0.1+dfsg1/beans/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/beans/nbproject/project.xml 2011-07-28 20:44:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/beans/nbproject/project.xml 2011-08-04 21:48:28.808408834 +0100 @@ -142,7 +142,7 @@ org.netbeans.modules.java.navigation 1 - 1.21.1 + 1.20.1 Index: netbeans-7.0.1+dfsg1/apisupport.refactoring/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/apisupport.refactoring/nbproject/project.xml 2011-07-28 20:44:54.000000000 +0100 +++ netbeans-7.0.1+dfsg1/apisupport.refactoring/nbproject/project.xml 2011-08-04 21:48:28.808408834 +0100 @@ -117,7 +117,7 @@ 1 - 1.54.1.5.8.17.6 + 1.49.1 Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/Flow.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/introduce/Flow.java 2011-08-05 18:22:09.049993145 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,867 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2011 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]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun - * Microsystems, Inc. All Rights Reserved. - * - * 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. - */ - -package org.netbeans.modules.java.hints.introduce; - -import com.sun.source.tree.AnnotationTree; -import com.sun.source.tree.ArrayAccessTree; -import com.sun.source.tree.ArrayTypeTree; -import com.sun.source.tree.AssertTree; -import com.sun.source.tree.AssignmentTree; -import com.sun.source.tree.BinaryTree; -import com.sun.source.tree.BlockTree; -import com.sun.source.tree.BreakTree; -import com.sun.source.tree.CaseTree; -import com.sun.source.tree.CatchTree; -import com.sun.source.tree.ClassTree; -import com.sun.source.tree.CompilationUnitTree; -import com.sun.source.tree.CompoundAssignmentTree; -import com.sun.source.tree.ConditionalExpressionTree; -import com.sun.source.tree.ContinueTree; -import com.sun.source.tree.DoWhileLoopTree; -import com.sun.source.tree.EmptyStatementTree; -import com.sun.source.tree.EnhancedForLoopTree; -import com.sun.source.tree.ErroneousTree; -import com.sun.source.tree.ExpressionStatementTree; -import com.sun.source.tree.ForLoopTree; -import com.sun.source.tree.IdentifierTree; -import com.sun.source.tree.IfTree; -import com.sun.source.tree.ImportTree; -import com.sun.source.tree.InstanceOfTree; -import com.sun.source.tree.LabeledStatementTree; -import com.sun.source.tree.LiteralTree; -import com.sun.source.tree.MemberSelectTree; -import com.sun.source.tree.MethodInvocationTree; -import com.sun.source.tree.MethodTree; -import com.sun.source.tree.ModifiersTree; -import com.sun.source.tree.NewArrayTree; -import com.sun.source.tree.NewClassTree; -import com.sun.source.tree.ParameterizedTypeTree; -import com.sun.source.tree.ParenthesizedTree; -import com.sun.source.tree.PrimitiveTypeTree; -import com.sun.source.tree.ReturnTree; -import com.sun.source.tree.StatementTree; -import com.sun.source.tree.SwitchTree; -import com.sun.source.tree.SynchronizedTree; -import com.sun.source.tree.ThrowTree; -import com.sun.source.tree.Tree; -import com.sun.source.tree.Tree.Kind; -import com.sun.source.tree.TryTree; -import com.sun.source.tree.TypeCastTree; -import com.sun.source.tree.TypeParameterTree; -import com.sun.source.tree.UnaryTree; -import com.sun.source.tree.UnionTypeTree; -import com.sun.source.tree.VariableTree; -import com.sun.source.tree.WhileLoopTree; -import com.sun.source.tree.WildcardTree; -import com.sun.source.util.TreePath; -import com.sun.source.util.TreePathScanner; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import javax.lang.model.element.VariableElement; -import org.netbeans.api.java.source.CompilationInfo; -import org.netbeans.api.java.source.support.CancellableTreePathScanner; - -/** - * - * @author lahvac - */ -public class Flow { - - public static FlowResult assignmentsForUse(CompilationInfo info, AtomicBoolean cancel) { - return assignmentsForUse(info, new TreePath(info.getCompilationUnit()), cancel); - } - - public static FlowResult assignmentsForUse(CompilationInfo info, TreePath from, AtomicBoolean cancel) { - Map> result = new HashMap>(); - VisitorImpl v = new VisitorImpl(info, cancel); - - v.scan(from, null); - - if (cancel.get()) return null; - - for (Entry e : v.use2Values.entrySet()) { - result.put(e.getKey(), e.getValue() != null ? e.getValue().assignments : Collections.emptyList()); - } - - v.deadBranches.remove(null); - - return new FlowResult(result, v.deadBranches); - } - - public static final class FlowResult { - private final Map> assignmentsForUse; - private final Set deadBranches; - private FlowResult(Map> assignmentsForUse, Set deadBranches) { - this.assignmentsForUse = assignmentsForUse; - this.deadBranches = deadBranches; - } - public Map> getAssignmentsForUse() { - return assignmentsForUse; - } - public Set getDeadBranches() { - return deadBranches; - } - } - - public static boolean definitellyAssigned(CompilationInfo info, VariableElement var, Iterable trees, AtomicBoolean cancel) { - VisitorImpl v = new VisitorImpl(info, cancel); - - v.variable2State.put(var, State.create(null)); - - for (TreePath tp : trees) { - if (cancel.get()) return false; - - v.scan(tp, null); - - if (!v.variable2State.get(var).assignments.contains(null)) return true; - } - - return false; - } - - private static final class VisitorImpl extends CancellableTreePathScanner { - - private final CompilationInfo info; - - private Map variable2State = new HashMap(); - private Map use2Values = new IdentityHashMap(); - private Map>> resumeAfter = new IdentityHashMap>>(); - private boolean inParameters; - private Tree nearestMethod; - private Set currentMethodVariables = Collections.newSetFromMap(new IdentityHashMap()); - private final Set deadBranches = new HashSet(); - - public VisitorImpl(CompilationInfo info, AtomicBoolean cancel) { - super(cancel); - this.info = info; - } - - @Override - public Boolean scan(Tree tree, Void p) { - Boolean result = super.scan(tree, p); - - Collection> toResume = resumeAfter.remove(tree); - - if (toResume != null) { - for (Map s : toResume) { - variable2State = mergeOr(variable2State, s); - } - } - - return result; - } - - @Override - public Boolean visitAssignment(AssignmentTree node, Void p) { - switch (node.getVariable().getKind()) { - case MEMBER_SELECT: - scan(((MemberSelectTree) node.getVariable()).getExpression(), null); //XXX: this will not create a correct TreePath - break; - case ARRAY_ACCESS: - scan(node.getVariable(), null); - break; - case IDENTIFIER: - break; - default: - //#198233: ignore - } - - scan(node.getExpression(), p); - - Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable())); - - if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { - variable2State.put((VariableElement) e, State.create(new TreePath(getCurrentPath(), node.getExpression()))); - } - - return null; - } - - @Override - public Boolean visitCompoundAssignment(CompoundAssignmentTree node, Void p) { - switch (node.getVariable().getKind()) { - case MEMBER_SELECT: - scan(((MemberSelectTree) node.getVariable()).getExpression(), null); //XXX: this will not create a correct TreePath - break; - case ARRAY_ACCESS: - scan(node.getVariable(), null); - break; - case IDENTIFIER: - break; - default: - //#198975: ignore - } - - scan(node.getExpression(), p); - - Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable())); - - if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { - use2Values.put(node.getVariable(), variable2State.get((VariableElement) e)); //XXX - variable2State.put((VariableElement) e, State.create(getCurrentPath())); - } - - return null; - } - - @Override - public Boolean visitVariable(VariableTree node, Void p) { - super.visitVariable(node, p); - - Element e = info.getTrees().getElement(getCurrentPath()); - - if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { - variable2State.put((VariableElement) e, State.create(node.getInitializer() != null ? new TreePath(getCurrentPath(), node.getInitializer()) : inParameters ? getCurrentPath() : null)); - currentMethodVariables.add((VariableElement) e); - } - - return null; - } - - @Override - public Boolean visitMemberSelect(MemberSelectTree node, Void p) { - super.visitMemberSelect(node, p); - - Element e = info.getTrees().getElement(getCurrentPath()); - - if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { - use2Values.put(node, variable2State.get((VariableElement) e)); - } - - return null; - } - - @Override - public Boolean visitLiteral(LiteralTree node, Void p) { - Object val = node.getValue(); - - if (val instanceof Boolean) { - return (Boolean) val; - } else { - return null; - } - } - - @Override - public Boolean visitIf(IfTree node, Void p) { - Boolean result = scan(node.getCondition(), p); - - if (result != null) { - if (result) { - scan(node.getThenStatement(), null); - deadBranches.add(node.getElseStatement()); - } else { - scan(node.getElseStatement(), null); - deadBranches.add(node.getThenStatement()); - } - - return null; - } - - Map oldVariable2State = variable2State; - - variable2State = new HashMap(oldVariable2State); - - scan(node.getThenStatement(), null); - - if (node.getElseStatement() != null) { - Map variableStatesAfterThen = new HashMap(variable2State); - - variable2State = new HashMap(oldVariable2State); - - scan(node.getElseStatement(), null); - - variable2State = mergeOr(variable2State, variableStatesAfterThen); - } else { - variable2State = mergeOr(variable2State, oldVariable2State); - } - - return null; - } - - @Override - public Boolean visitBinary(BinaryTree node, Void p) { - Boolean left = scan(node.getLeftOperand(), p); - - if (left != null && (node.getKind() == Kind.CONDITIONAL_AND || node.getKind() == Kind.CONDITIONAL_OR)) { - if (left) { - if (node.getKind() == Kind.CONDITIONAL_AND) { - return scan(node.getRightOperand(), p); - } else { - return true; - } - } else { - if (node.getKind() == Kind.CONDITIONAL_AND) { - return false; - } else { - return scan(node.getRightOperand(), p); - } - } - } - - Map oldVariable2State = variable2State; - - variable2State = new HashMap(oldVariable2State); - - Boolean right = scan(node.getRightOperand(), p); - - variable2State = mergeOr(variable2State, oldVariable2State); - - if (left == null || right == null) { - return null; - } - - switch (node.getKind()) { - case AND: case CONDITIONAL_AND: return left && right; - case OR: case CONDITIONAL_OR: return left || right; - case EQUAL_TO: return left == right; - case NOT_EQUAL_TO: return left != right; - } - - return null; - } - - @Override - public Boolean visitConditionalExpression(ConditionalExpressionTree node, Void p) { - Boolean result = scan(node.getCondition(), p); - - if (result != null) { - if (result) { - scan(node.getTrueExpression(), null); - } else { - scan(node.getFalseExpression(), null); - } - - return null; - } - - Map oldVariable2State = variable2State; - - variable2State = new HashMap(oldVariable2State); - - scan(node.getTrueExpression(), null); - - if (node.getFalseExpression() != null) { - Map variableStatesAfterThen = new HashMap(variable2State); - - variable2State = new HashMap(oldVariable2State); - - scan(node.getFalseExpression(), null); - - variable2State = mergeOr(variable2State, variableStatesAfterThen); - } else { - variable2State = mergeOr(variable2State, oldVariable2State); - } - - return null; - } - - @Override - public Boolean visitIdentifier(IdentifierTree node, Void p) { - super.visitIdentifier(node, p); - - Element e = info.getTrees().getElement(getCurrentPath()); - - if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { - use2Values.put(node, variable2State.get((VariableElement) e)); - } - - return null; - } - - @Override - public Boolean visitUnary(UnaryTree node, Void p) { - Boolean val = super.visitUnary(node, p); - - if (val != null && node.getKind() == Kind.LOGICAL_COMPLEMENT) { - return !val; - } - - if ( node.getKind() == Kind.PREFIX_DECREMENT - || node.getKind() == Kind.PREFIX_INCREMENT - || node.getKind() == Kind.POSTFIX_DECREMENT - || node.getKind() == Kind.POSTFIX_INCREMENT) { - Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getExpression())); - - if (e != null && LOCAL_VARIABLES.contains(e.getKind())) { - State prev = variable2State.get((VariableElement) e); - - use2Values.put(node.getExpression(), prev); - variable2State.put((VariableElement) e, State.create(getCurrentPath())); - } - } - - - return null; - } - - @Override - public Boolean visitMethod(MethodTree node, Void p) { - Tree oldNearestMethod = nearestMethod; - Set oldCurrentMethodVariables = currentMethodVariables; - - nearestMethod = node; - currentMethodVariables = Collections.newSetFromMap(new IdentityHashMap()); - - try { - scan(node.getModifiers(), p); - scan(node.getReturnType(), p); - scan(node.getTypeParameters(), p); - - inParameters = true; - - try { - scan(node.getParameters(), p); - } finally { - inParameters = false; - } - - scan(node.getThrows(), p); - scan(node.getBody(), p); - scan(node.getDefaultValue(), p); - } finally { - nearestMethod = oldNearestMethod; - currentMethodVariables = oldCurrentMethodVariables; - } - - return null; - } - - @Override - public Boolean visitWhileLoop(WhileLoopTree node, Void p) { - Boolean condValue = scan(node.getCondition(), null); - - if (condValue != null) { - if (condValue) { - //XXX: handle possibly infinite loop - } else { - //will not run at all, skip: - return null; - } - } - - Map beforeLoop = variable2State; - - variable2State = new HashMap(beforeLoop); - - scan(node.getStatement(), null); - - beforeLoop = new HashMap(variable2State = mergeOr(beforeLoop, variable2State)); - - scan(node.getCondition(), null); - scan(node.getStatement(), null); - - variable2State = beforeLoop; - - return null; - } - - @Override - public Boolean visitDoWhileLoop(DoWhileLoopTree node, Void p) { - Map beforeLoop = variable2State; - - variable2State = new HashMap(beforeLoop); - - scan(node.getStatement(), null); - Boolean condValue = scan(node.getCondition(), null); - - if (condValue != null) { - if (condValue) { - //XXX: handle possibly infinite loop - } else { - //will not run more than once, skip: - return null; - } - } - - beforeLoop = new HashMap(variable2State = mergeOr(beforeLoop, variable2State)); - - scan(node.getStatement(), null); - scan(node.getCondition(), null); - - variable2State = beforeLoop; - - return null; - } - - @Override - public Boolean visitForLoop(ForLoopTree node, Void p) { - scan(node.getInitializer(), null); - Boolean condValue = scan(node.getCondition(), null); - - if (condValue != null) { - if (condValue) { - //XXX: handle possibly infinite loop - } else { - //will not run at all, skip: - return null; - } - } - - Map beforeLoop = variable2State; - - variable2State = new HashMap(beforeLoop); - - scan(node.getStatement(), null); - scan(node.getUpdate(), null); - - beforeLoop = new HashMap(variable2State = mergeOr(beforeLoop, variable2State)); - - scan(node.getCondition(), null); - scan(node.getStatement(), null); - scan(node.getUpdate(), null); - - variable2State = mergeOr(beforeLoop, variable2State); - - return null; - } - - public Boolean visitTry(TryTree node, Void p) { - scan(node.getResources(), null); - - Map oldVariable2State = variable2State; - - variable2State = new HashMap(oldVariable2State); - - scan(node.getBlock(), null); - - HashMap afterBlockVariable2State = new HashMap(variable2State); - - for (CatchTree ct : node.getCatches()) { - Map variable2StateBeforeCatch = variable2State; - - variable2State = new HashMap(oldVariable2State); - - scan(ct, null); - - variable2State = mergeOr(variable2StateBeforeCatch, variable2State); - } - - if (node.getFinallyBlock() != null) { - variable2State = mergeOr(mergeOr(oldVariable2State, variable2State), afterBlockVariable2State); - - scan(node.getFinallyBlock(), null); - } - - return null; - } - - public Boolean visitReturn(ReturnTree node, Void p) { - super.visitReturn(node, p); - variable2State = new HashMap(variable2State); - //performance: limit ammount of held variables and their mapping: - for (VariableElement ve : currentMethodVariables) { - variable2State.remove(ve); - } - resumeAfter(nearestMethod, variable2State); - variable2State = new HashMap(); - return null; - } - - public Boolean visitBreak(BreakTree node, Void p) { - super.visitBreak(node, p); - - StatementTree target = info.getTreeUtilities().getBreakContinueTarget(getCurrentPath()); - - resumeAfter(target, variable2State); - - variable2State = new HashMap(); - - return null; - } - - public Boolean visitSwitch(SwitchTree node, Void p) { - scan(node.getExpression(), null); - - Map origVariable2State = new HashMap(variable2State); - - variable2State = new HashMap(); - - boolean exhaustive = false; - - for (CaseTree ct : node.getCases()) { - variable2State = mergeOr(variable2State, origVariable2State); - - if (ct.getExpression() == null) { - exhaustive = true; - } - - scan(ct, null); - } - - if (!exhaustive) { - variable2State = mergeOr(variable2State, origVariable2State); - } - - return null; - } - - public Boolean visitEnhancedForLoop(EnhancedForLoopTree node, Void p) { - scan(node.getVariable(), null); - scan(node.getExpression(), null); - - Map beforeLoop = variable2State; - - variable2State = new HashMap(beforeLoop); - - scan(node.getStatement(), null); - - beforeLoop = new HashMap(variable2State = mergeOr(beforeLoop, variable2State)); - - scan(node.getStatement(), null); - - variable2State = mergeOr(beforeLoop, variable2State); - - return null; - } - - private void resumeAfter(Tree target, Map state) { - Collection> r = resumeAfter.get(target); - - if (r == null) { - resumeAfter.put(target, r = new ArrayList>()); - } - - r.add(new HashMap(state)); - } - - public Boolean visitWildcard(WildcardTree node, Void p) { - super.visitWildcard(node, p); - return null; - } - - public Boolean visitUnionType(UnionTypeTree node, Void p) { - super.visitUnionType(node, p); - return null; - } - - public Boolean visitTypeParameter(TypeParameterTree node, Void p) { - super.visitTypeParameter(node, p); - return null; - } - - public Boolean visitTypeCast(TypeCastTree node, Void p) { - super.visitTypeCast(node, p); - return null; - } - - public Boolean visitThrow(ThrowTree node, Void p) { - super.visitThrow(node, p); - return null; - } - - public Boolean visitSynchronized(SynchronizedTree node, Void p) { - super.visitSynchronized(node, p); - return null; - } - - public Boolean visitPrimitiveType(PrimitiveTypeTree node, Void p) { - super.visitPrimitiveType(node, p); - return null; - } - - public Boolean visitParenthesized(ParenthesizedTree node, Void p) { - super.visitParenthesized(node, p); - return null; - } - - public Boolean visitParameterizedType(ParameterizedTypeTree node, Void p) { - super.visitParameterizedType(node, p); - return null; - } - - public Boolean visitOther(Tree node, Void p) { - super.visitOther(node, p); - return null; - } - - public Boolean visitNewClass(NewClassTree node, Void p) { - super.visitNewClass(node, p); - return null; - } - - public Boolean visitNewArray(NewArrayTree node, Void p) { - super.visitNewArray(node, p); - return null; - } - - public Boolean visitModifiers(ModifiersTree node, Void p) { - super.visitModifiers(node, p); - return null; - } - - public Boolean visitMethodInvocation(MethodInvocationTree node, Void p) { - super.visitMethodInvocation(node, p); - return null; - } - - public Boolean visitLabeledStatement(LabeledStatementTree node, Void p) { - super.visitLabeledStatement(node, p); - return null; - } - - public Boolean visitInstanceOf(InstanceOfTree node, Void p) { - super.visitInstanceOf(node, p); - return null; - } - - public Boolean visitImport(ImportTree node, Void p) { - super.visitImport(node, p); - return null; - } - - public Boolean visitExpressionStatement(ExpressionStatementTree node, Void p) { - super.visitExpressionStatement(node, p); - return null; - } - - public Boolean visitErroneous(ErroneousTree node, Void p) { - super.visitErroneous(node, p); - return null; - } - - public Boolean visitEmptyStatement(EmptyStatementTree node, Void p) { - super.visitEmptyStatement(node, p); - return null; - } - - public Boolean visitContinue(ContinueTree node, Void p) { - super.visitContinue(node, p); - return null; - } - - public Boolean visitCompilationUnit(CompilationUnitTree node, Void p) { - super.visitCompilationUnit(node, p); - return null; - } - - public Boolean visitClass(ClassTree node, Void p) { - super.visitClass(node, p); - return null; - } - - public Boolean visitCatch(CatchTree node, Void p) { - super.visitCatch(node, p); - return null; - } - - public Boolean visitCase(CaseTree node, Void p) { - super.visitCase(node, p); - return null; - } - - public Boolean visitBlock(BlockTree node, Void p) { - super.visitBlock(node, p); - return null; - } - - public Boolean visitAssert(AssertTree node, Void p) { - super.visitAssert(node, p); - return null; - } - - public Boolean visitArrayType(ArrayTypeTree node, Void p) { - super.visitArrayType(node, p); - return null; - } - - public Boolean visitArrayAccess(ArrayAccessTree node, Void p) { - super.visitArrayAccess(node, p); - return null; - } - - public Boolean visitAnnotation(AnnotationTree node, Void p) { - super.visitAnnotation(node, p); - return null; - } - - private Map mergeOr(Map into, Map what) { - for (Entry e : what.entrySet()) { - State stt = into.get(e.getKey()); - - if (stt != null) { - into.put(e.getKey(), stt.merge(e.getValue())); - } else { - into.put(e.getKey(), e.getValue()); - } - } - - return into; - } - } - - private static final Set LOCAL_VARIABLES = EnumSet.of(ElementKind.EXCEPTION_PARAMETER, ElementKind.LOCAL_VARIABLE, ElementKind.PARAMETER); - - static class State { - private final Set assignments; - private State(Set assignments) { - this.assignments = assignments; - } - public static State create(TreePath assignment) { - return new State(Collections.singleton(assignment)); - } - - public State merge(State value) { - @SuppressWarnings("LocalVariableHidesMemberVariable") - Set assignments = new HashSet(this.assignments); - - assignments.addAll(value.assignments); - - return new State(assignments); - } - } - -} Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/NoClassLoaderProblemCustomizerProvider.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/infrastructure/NoClassLoaderProblemCustomizerProvider.java 2011-08-05 18:24:38.080825099 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 2011 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 2011 Sun Microsystems, Inc. - */ -package org.netbeans.modules.java.hints.infrastructure; - -import java.util.HashMap; -import java.util.Map; -import java.util.prefs.Preferences; -import javax.swing.JComponent; -import javax.swing.JPanel; -import org.netbeans.modules.java.hints.jackpot.spi.CustomizerProvider; - -/**Hack to workaround classloader issues while loading CustomizerProviders from other modules. - * - * @author lahvac - */ -public class NoClassLoaderProblemCustomizerProvider implements CustomizerProvider { - - private static final Map id2CustomizerProvider = new HashMap(); - - public static void register(String id, CustomizerProvider customizer) { - id2CustomizerProvider.put(id, customizer); - } - - @Override - public JComponent getCustomizer(Preferences prefs) { - CustomizerProvider p = id2CustomizerProvider.get(prefs.name()); - - if (p != null) { - return p.getCustomizer(prefs); - } else { - return new JPanel(); - } - } - -} Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/FlowTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/FlowTest.java 2011-08-05 18:25:06.459991592 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,531 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 2011 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 2011 Sun Microsystems, Inc. - */ -package org.netbeans.modules.java.hints.introduce; - -import com.sun.source.tree.Tree; -import com.sun.source.util.TreePath; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.regex.Pattern; -import javax.swing.text.Document; -import static org.junit.Assert.*; -import org.netbeans.api.java.lexer.JavaTokenId; -import org.netbeans.api.java.source.CompilationInfo; -import org.netbeans.api.java.source.JavaSource; -import org.netbeans.api.java.source.JavaSource.Phase; -import org.netbeans.api.java.source.SourceUtilsTestUtil; -import org.netbeans.api.lexer.Language; -import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.java.hints.TestUtilities; -import org.netbeans.modules.java.hints.introduce.Flow.FlowResult; -import org.openide.cookies.EditorCookie; -import org.openide.filesystems.FileObject; -import org.openide.filesystems.FileUtil; -import org.openide.loaders.DataObject; - -/**TODO: mostly tested indirectly through IntroduceHintTest, should be rather tested here - * - * @author lahvac - */ -public class FlowTest extends NbTestCase { - - public FlowTest(String name) { - super(name); - } - - @Override - protected void setUp() throws Exception { - SourceUtilsTestUtil.prepareTest(new String[0], new Object[0]); - super.setUp(); - } - - public void testSimple() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int i) {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " if (i == 0) ii = 3;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "2", - "3"); - } - - public void testBinary1() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int i) {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " boolean b = i == 0 && (ii = 3) != 0;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "2", - "3"); - } - - public void testBinary2() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " boolean b = true && (ii = 3) != 0;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "3"); - } - - public void testBinary3() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " boolean b = false && (ii = 3) != 0;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "2"); - } - - public void testBinary4() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int i) {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " boolean b = i == 0 || (ii = 3) != 0;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "2", - "3"); - } - - public void testBinary5() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " boolean b = false || (ii = 3) != 0;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "3"); - } - - public void testBinary6() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 1;\n" + - " ii = 2;\n" + - " boolean b = true || (ii = 3) != 0;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "2"); - } - - public void test197666() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int i) {\n" + - " int ii = 1;\n" + - " boolean b = i == 1 && true;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "1"); - } - - public void test198233() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 1;\n" + - " boolean b = i == 1 && true;\n" + - " System.err.println(i`i);\n" + - " ===\n" + - " }\n" + - "}\n", - true, - "1"); - } - - public void testIncorrectDeadBranch() throws Exception { - performDeadBranchTest("package test;\n" + - "public class Test {\n" + - " public void i() {\n" + - " if (!i.getAndSet(true)) {\n" + - " System.err.println(\"\");\n" + - " }\n" + - " }\n" + - " private final java.util.concurrent.atomic.AtomicBoolean i = new java.util.concurrent.atomic.AtomicBoolean();\n" + - "}\n"); - } - - public void testTryCatch() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii;\n" + - " try {\n" + - " ii = 1;\n" + - " } catch (Exception e) {\n" + - " ii = 2;\n" + - " }\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "1", - "2"); - } - - public void testTryCatchFinally() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii;\n" + - " try {\n" + - " ii = 1;\n" + - " } catch (Exception e) {\n" + - " ii = 2;\n" + - " } finally {\n" + - " ii = 3;\n" + - " }\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "3"); - } - - public void testTryFinally() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii;\n" + - " try {\n" + - " ii = 1;\n" + - " } finally {\n" + - " ii = 3;\n" + - " }\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "3"); - } - - public void testTryFinally2() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 0;\n" + - " try {\n" + - " ii = 1;\n" + - " } catch (Exception e) {\n" + - " ii = 2;\n" + - " } finally {\n" + - " System.err.println(i`i);\n" + - " }\n" + - " }\n" + - "}\n", - "0", - "1", - "2"); - } - - public void testSwitch1() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int p, int r) {\n" + - " int ii;\n" + - " switch (p) {\n" + - " case 0: ii = 1; break;\n" + - " case 1: if (r > 5) {\n" + - " ii = 5;\n" + - " break;\n" + - " }\n" + - " ii = 2;\n" + - " case 2: ii = 3; break;\n" + - " default: ii = 4; break;\n" + - " }\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "1", - "5", - "3", - "4"); - } - - public void testSwitch2() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int p) {\n" + - " int ii;\n" + - " switch (p) {\n" + - " case 0: ii = 1; break;\n" + - " case 1: ii = 2;\n" + - " case 2: ii = 3; return;\n" + - " default: ii = 4; break;\n" + - " }\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "1", - "4"); - } - - public void testSwitch3() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(int p) {\n" + - " int ii = 0;\n" + - " switch (p) {\n" + - " case 0: ii = 1; break;\n" + - " }\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - "0", - "1"); - } - - public void testSwitch4() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(String str) {\n" + - " final int mm = 1;\n" + - " int b = 0;\n" + - " switch (str.length()) {\n" + - " case 0: break;\n" + - " case 1: b |= m`m; break;\n" + - " }\n" + - " }\n" + - "}\n", - "1"); - } - - public void testForUpdate() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " for (int ii = 0; ii < 100; ii = ii + 1) {\n" + - " System.err.println(i`i);\n" + - " }\n" + - " }\n" + - "}\n", - "0", - "ii + 1"); - } - - public void testForEach() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t(String... args) {\n" + - " boolean ff = true;\n" + - " for (String a : args) {\n" + - " if (!f`f) System.err.println(1);\n" + - " ff = false;\n" + - " }\n" + - " }\n" + - "}\n", - "true", - "false"); - } - - public void testAnonymous() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " final String model = \"\";\n" + - " java.util.Collections.sort(java.util.Collections.emptyList(), new java.util.Comparator() {\n" + - " public int compare(Object o1, Object o2) {\n" + - " return 0;\n" + - " }\n" + - " });\n" + - " System.err.println(mod`el);\n" + - " }\n" + - "}\n", - "\"\""); - } - - public void test198975() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " int ii = 1;\n" + - " ii + +=;\n" + - " System.err.println(i`i);\n" + - " }\n" + - "}\n", - true, - "1"); - } - - public void test199335() throws Exception { - performTest("package test;\n" + - "public class Test {\n" + - " static void t() {\n" + - " List ll = null;\n" + - " for (Object str : ll) {\n" + - " if (str instanceof String) {\n" + - " System.err.println(st`r);\n" + - " }\n" + - " }\n" + - " }\n" + - "}\n", - true, - ""); - } - - private void prepareTest(String code, boolean allowErrors) throws Exception { - clearWorkDir(); - - FileObject workFO = FileUtil.toFileObject(getWorkDir()); - - assertNotNull(workFO); - - FileObject sourceRoot = workFO.createFolder("src"); - FileObject buildRoot = workFO.createFolder("build"); - FileObject cache = workFO.createFolder("cache"); - - FileObject data = FileUtil.createData(sourceRoot, "test/Test.java"); - - org.netbeans.api.java.source.TestUtilities.copyStringToFile(FileUtil.toFile(data), code); - - data.refresh(); - - SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache); - - DataObject od = DataObject.find(data); - EditorCookie ec = od.getCookie(EditorCookie.class); - - assertNotNull(ec); - - doc = ec.openDocument(); - - doc.putProperty(Language.class, JavaTokenId.language()); - doc.putProperty("mimeType", "text/x-java"); - - JavaSource js = JavaSource.forFileObject(data); - - assertNotNull(js); - - info = SourceUtilsTestUtil.getCompilationInfo(js, Phase.RESOLVED); - - assertNotNull(info); - - if (!allowErrors) { - assertTrue(info.getDiagnostics().toString(), info.getDiagnostics().isEmpty()); - } - } - - private CompilationInfo info; - private Document doc; - - private void performTest(String code, String... assignments) throws Exception { - performTest(code, false, assignments); - } - - private void performTest(String code, boolean allowErrors, String... assignments) throws Exception { - int[] span = new int[1]; - - code = TestUtilities.detectOffsets(code, span, "`"); - - prepareTest(code, allowErrors); - - FlowResult flow = Flow.assignmentsForUse(info, new AtomicBoolean()); - TreePath sel = info.getTreeUtilities().pathFor(span[0]); - - Set actual = new HashSet(); - - for (TreePath tp : flow.getAssignmentsForUse().get(sel.getLeaf())) { - if (tp == null) { - actual.add(""); - } else { - actual.add(tp.getLeaf().toString()); - } - } - - assertEquals(new HashSet(Arrays.asList(assignments)), actual); - } - - private void performDeadBranchTest(String code) throws Exception { - List splitted = new LinkedList(Arrays.asList(code.split(Pattern.quote("|")))); - List goldenSpans = new ArrayList(splitted.size() - 1); - StringBuilder realCode = new StringBuilder(); - - realCode.append(splitted.remove(0)); - - for (String s : splitted) { - goldenSpans.add(realCode.length()); - realCode.append(s); - } - - prepareTest(realCode.toString(), false); - - FlowResult flow = Flow.assignmentsForUse(info, new AtomicBoolean()); - - List actual = new ArrayList(2 * flow.getDeadBranches().size()); - - for (Tree dead : flow.getDeadBranches()) { - actual.add((int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), dead)); - actual.add((int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), dead)); - } - - assertEquals(goldenSpans, actual); - } - -} Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.java 2011-08-05 18:27:33.390824824 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 2011 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 2011 Sun Microsystems, Inc. - */ -package org.netbeans.api.java.source.gen; - -import com.sun.source.tree.BlockTree; -import com.sun.source.tree.ClassTree; -import com.sun.source.tree.CompilationUnitTree; -import com.sun.source.tree.MethodTree; -import com.sun.source.tree.StatementTree; -import com.sun.source.tree.Tree; -import java.io.File; -import java.util.LinkedList; -import java.util.List; -import org.junit.Test; -import org.netbeans.api.java.source.JavaSource; -import org.netbeans.api.java.source.Task; -import org.netbeans.api.java.source.TestUtilities; -import org.netbeans.api.java.source.TreeMaker; -import org.netbeans.api.java.source.WorkingCopy; - -/** - * - * @author Ralph Ruijs - */ -public class RewriteMultipleExpressionsTest extends GeneratorTestBase { - - - public RewriteMultipleExpressionsTest(String aName) { - super(aName); - } - - @Test - public void testRewriteMultipleExpressions() throws Exception { - File testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "\n" + - "public class MultipleExpressionsTest {\n" + - " public void testMethod() {\n" + - " printGreeting();\n" + - " printGreeting();\n" + - " printGreeting();\n" + - " }\n" + - " public void printGreeting() {\n" + - " System.out.println(\"Hello World!\");\n" + - " }\n" + - "}\n"); - String golden = "\n" + - "public class MultipleExpressionsTest {\n" + - " public void testMethod() {\n" + - " System.out.println(\"Hello World!\");\n" + - " System.out.println(\"Hello World!\");\n" + - " System.out.println(\"Hello World!\");\n" + - " }\n" + - " public void printGreeting() {\n" + - " System.out.println(\"Hello World!\");\n" + - " }\n" + - "}\n"; - - JavaSource src = getJavaSource(testFile); - Task task = new Task() { - - public void run(WorkingCopy workingCopy) throws Exception { - workingCopy.toPhase(JavaSource.Phase.RESOLVED); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - TreeMaker make = workingCopy.getTreeMaker(); - - List classes = cut.getTypeDecls(); - ClassTree clazz = (ClassTree) classes.get(0); - List trees = clazz.getMembers(); - - MethodTree testMethod = (MethodTree) trees.get(1); - BlockTree body = testMethod.getBody(); - - MethodTree printMethod = (MethodTree) trees.get(2); - BlockTree printBody = printMethod.getBody(); - - List statements = new LinkedList(); - statements.add(printBody.getStatements().get(0)); - statements.add(printBody.getStatements().get(0)); - statements.add(printBody.getStatements().get(0)); - - BlockTree modified = make.Block(statements, false); - - workingCopy.rewrite(body, modified); - } - - }; - - src.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - System.out.println(res); - assertEquals(golden, res); - } - - String getGoldenPckg() { - return ""; - } - - String getSourcePckg() { - return ""; - } -} debian/patches/netbeans-platform~nbi.patch0000664000000000000000000000103311720272354016150 0ustar Don't build the Netbeans Installer modules. Index: netbeans-7.0.1+dfsg1/nbbuild/cluster.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/nbbuild/cluster.properties 2011-08-02 23:37:27.294165081 +0100 +++ netbeans-7.0.1+dfsg1/nbbuild/cluster.properties 2011-08-02 23:37:32.884164057 +0100 @@ -648,8 +648,6 @@ apisupport.harness,\ jellytools.platform,\ jemmy,\ - libs.nbi.ant,\ - libs.nbi.engine,\ nbjunit,\ o.n.insane debian/patches/netbeans~small-ide.patch0000664000000000000000000001332511720272354015434 0ustar Don't include all modules in the build. Index: netbeans/java.kit/nbproject/project.xml =================================================================== --- netbeans.orig/java.kit/nbproject/project.xml 2011-08-27 22:37:46.272952697 +0100 +++ netbeans/java.kit/nbproject/project.xml 2011-08-27 23:01:51.960452704 +0100 @@ -204,7 +204,7 @@ 1.13.1 - + org.netbeans.modules.xml.tools.java Index: netbeans/apisupport.kit/nbproject/project.xml =================================================================== --- netbeans.orig/apisupport.kit/nbproject/project.xml 2011-08-27 22:37:46.252952709 +0100 +++ netbeans/apisupport.kit/nbproject/project.xml 2011-08-27 23:05:21.720452799 +0100 @@ -17,25 +17,25 @@ 1.6.1 - + org.netbeans.modules.apisupport.harness 1.26.1 - + org.netbeans.modules.apisupport.osgidemo Index: netbeans/editor.kit/nbproject/project.xml =================================================================== --- netbeans.orig/editor.kit/nbproject/project.xml 2011-08-27 22:37:46.312952678 +0100 +++ netbeans/editor.kit/nbproject/project.xml 2011-08-27 23:01:51.970452725 +0100 @@ -33,7 +33,7 @@ 1.36.1 - + org.netbeans.modules.image @@ -54,13 +54,13 @@ 1.31.1 - + org.netbeans.modules.languages.diff Index: netbeans/ide.kit/nbproject/project.xml =================================================================== --- netbeans.orig/ide.kit/nbproject/project.xml 2011-08-27 22:37:46.292952513 +0100 +++ netbeans/ide.kit/nbproject/project.xml 2011-08-27 23:01:51.970452725 +0100 @@ -135,13 +135,13 @@ 1.23.1 - + org.netbeans.modules.jumpto debian/patches/netbeans-platform~include-extras.patch0000664000000000000000000000436311720272354020340 0ustar Include the extra modules libs.junit4 and libs.antlr3.devel. Index: netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.junit4/nbproject/project.xml 2011-07-28 20:46:08.000000000 +0100 +++ netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.xml 2011-08-02 23:37:27.294165081 +0100 @@ -63,6 +63,10 @@ org.junit.runners + ext/hamcrest-core.jar + external/hamcrest-core.jar + + ext/junit-4.8.2.jar external/junit-4.8.2.jar Index: netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.junit4/nbproject/project.properties 2011-07-28 20:46:08.000000000 +0100 +++ netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.properties 2011-08-02 23:37:27.294165081 +0100 @@ -42,6 +42,7 @@ is.autoload=true release.external/junit-4.8.2.jar=modules/ext/junit-4.8.2.jar +release.external/hamcrest-core.jar=modules/ext/hamcrest-core.jar nbm.target.cluster=platform sigtest.skip.check=true Index: netbeans-7.0.1+dfsg1/nbbuild/cluster.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/nbbuild/cluster.properties 2011-07-28 20:46:12.000000000 +0100 +++ netbeans-7.0.1+dfsg1/nbbuild/cluster.properties 2011-08-02 23:37:27.294165081 +0100 @@ -166,9 +166,11 @@ javahelp,\ keyring,\ keyring.impl,\ + libs.antlr3.devel,\ libs.felix,\ libs.jna,\ libs.jsr223,\ + libs.junit4,\ libs.osgi,\ masterfs,\ o.jdesktop.layout,\ @@ -929,7 +931,6 @@ kenai.maven,\ kenai.ui,\ libs.jira,\ - libs.junit4,\ libs.svnjavahlwin32,\ loadgenerator,\ mobility.proguard,\ debian/patches/netbeans-platform~osgi-4.3.patch0000664000000000000000000000351011720272354016645 0ustar Handle minor changes to the osgi core API from 4.2 to 4.3. Index: netbeans/core.netigso/src/org/netbeans/core/netigso/Netigso.java =================================================================== --- netbeans.orig/core.netigso/src/org/netbeans/core/netigso/Netigso.java 2011-11-29 21:14:05.244675984 +0000 +++ netbeans/core.netigso/src/org/netbeans/core/netigso/Netigso.java 2011-11-29 21:21:41.413842638 +0000 @@ -112,7 +112,7 @@ if (framework == null) { readBundles(); - Map configMap = new HashMap(); + Map configMap = new HashMap(); final String cache = getNetigsoCache().getPath(); configMap.put(Constants.FRAMEWORK_STORAGE, cache); activator = new NetigsoActivator(); Index: netbeans/core.osgi/src/org/netbeans/core/osgi/Activator.java =================================================================== --- netbeans.orig/core.osgi/src/org/netbeans/core/osgi/Activator.java 2011-11-30 20:54:52.197734467 +0000 +++ netbeans/core.osgi/src/org/netbeans/core/osgi/Activator.java 2011-11-30 20:59:13.197733746 +0000 @@ -324,7 +324,7 @@ } BundleContext context = bundle.getBundleContext(); if (context != null) { - context.registerService(URLStreamHandlerService.class.getName(), new Svc(), props); + context.registerService(URLStreamHandlerService.class.getName(), new Svc(), (Dictionary)props); } else { LOG.log(Level.WARNING, "no context for {0} in state {1}", new Object[] {bundle.getSymbolicName(), bundle.getState()}); } debian/patches/netbeans~xerces.patch0000664000000000000000000000271711720272354015061 0ustar We need jaxp too since it's not part of the xerces jar in Debian. Index: netbeans-7.0.1+dfsg1/libs.xerces/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.xerces/nbproject/project.properties 2011-08-10 19:12:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/libs.xerces/nbproject/project.properties 2012-02-10 21:16:23.432574294 +0000 @@ -42,5 +42,6 @@ is.autoload=true release.external/xerces-2.8.0.jar=modules/ext/xerces-2.8.0.jar +release.external/jaxp-1.4.jar=modules/ext/jaxp-1.4.jar module.jar.verifylinkageignores=org.apache.xerces.util.XMLCatalogResolver spec.version.base=1.22.1 Index: netbeans-7.0.1+dfsg1/libs.xerces/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/libs.xerces/nbproject/project.xml 2011-08-10 19:12:58.000000000 +0100 +++ netbeans-7.0.1+dfsg1/libs.xerces/nbproject/project.xml 2012-02-10 21:16:59.008126975 +0000 @@ -56,6 +56,10 @@ ext/xerces-2.8.0.jar external/xerces-2.8.0.jar + + ext/jaxp-1.4.jar + external/jaxp-1.4.jar + debian/patches/netbeans-platform~launcher.patch0000664000000000000000000000240111720272354017201 0ustar Include the jni path /usr/lib/jni on the library search path. Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/unix/nbexec =================================================================== --- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/unix/nbexec 2011-04-08 00:33:00.000000000 +0100 +++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/unix/nbexec 2011-06-12 21:16:28.031368069 +0100 @@ -180,7 +180,7 @@ fi # if heap dump on OOME is supported enable it -if "${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError > /dev/null 2>&1 ; then +if "${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError &> /dev/null 2>&1 ; then jargs="$jargs -XX:+HeapDumpOnOutOfMemoryError" if echo $jargs | grep -v -- "-XX:HeapDumpPath=" > /dev/null ; then jargs="$jargs -XX:HeapDumpPath=\"${userdir}/var/log/heapdump.hprof\"" @@ -541,7 +541,7 @@ # delete_new_clusters_file rm -f "${restart_file}" - eval ${_NB_PROFILE_CMD} "\"${jdkhome}/bin/java\"" -Djdk.home="\"${jdkhome}\"" -classpath "\"$cp\"" \ + eval ${_NB_PROFILE_CMD} "\"${jdkhome}/bin/java\"" -Djdk.home="\"${jdkhome}\"" -Djava.library.path="/usr/lib/jni" -classpath "\"$cp\"" \ "$jargs" org.netbeans.Main "$args" '<&0' '&' PID=$! trap "kill $PID" EXIT debian/patches/netbeans~xsl.patch0000664000000000000000000000243411720272354014372 0ustar Don't require an httpserver for the XSL module. Index: netbeans/xsl/manifest.mf =================================================================== --- netbeans.orig/xsl/manifest.mf 2011-08-29 13:15:37.285484472 +0100 +++ netbeans/xsl/manifest.mf 2011-08-29 13:15:41.123817710 +0100 @@ -2,6 +2,5 @@ OpenIDE-Module: org.netbeans.modules.xsl/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xsl/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/xsl/resources/mf-layer.xml -OpenIDE-Module-Requires: org.openide.util.HttpServer$Impl AutoUpdate-Show-In-Client: false OpenIDE-Module-Specification-Version: 1.26.1 Index: netbeans/xsl/src/org/netbeans/modules/xsl/ui/TransformPanel.java =================================================================== --- netbeans.orig/xsl/src/org/netbeans/modules/xsl/ui/TransformPanel.java 2011-08-29 14:29:34.304651065 +0100 +++ netbeans/xsl/src/org/netbeans/modules/xsl/ui/TransformPanel.java 2011-08-29 14:32:52.243817699 +0100 @@ -352,7 +352,7 @@ } private void initOutputComboBox(Object defaultOutput) { - outputComboBox.setModel(new DefaultComboBoxModel(new Object[] { defaultOutput, JUST_PREVIEW })); + outputComboBox.setModel(new DefaultComboBoxModel(new Object[] { defaultOutput })); } debian/patches/netbeans~updatecenters.patch0000664000000000000000000000434311720272354016433 0ustar Disable the update centers. Index: netbeans-7.0.1+dfsg1/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml 2011-07-28 20:47:06.000000000 +0100 +++ netbeans-7.0.1+dfsg1/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml 2011-08-02 23:44:50.923331325 +0100 @@ -55,7 +55,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -73,7 +73,7 @@ - + debian/patches/netbeans~old-java.source-module.patch0000664000000000000000000071111011720272354020041 0ustar Use an older version of some java modules since the latest ones only build with JDK 7. Index: netbeans-7.0.1+dfsg1/java.source/apichanges.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/apichanges.xml 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/apichanges.xml 2011-08-03 23:01:41.000000000 +0100 @@ -108,19 +108,6 @@ - - - TreePathHandle can be created from ElementHandle - - - - - - TreePathHandle has a new from(ElementHandle) method. - - - - JavaSource.runModificationTask can run on source-less JavaSources Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java 2011-08-03 23:01:41.000000000 +0100 @@ -309,9 +309,6 @@ final String pkgNameF = pkgName; final String pageNameF = pageName; final CharSequence fragment = buildFragment ? getFragment(element) : null; - if (cancel == null) { - return findJavadoc(classFile, pkgName, pageNameF, fragment, allowRemoteJavadoc); - } final Future future = RP.submit(new Callable() { @Override public TextStream call() throws Exception { @@ -320,7 +317,6 @@ }); do { if (cancel != null && cancel.call()) { - future.cancel(false); break; } try { Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java 2011-08-03 23:01:41.000000000 +0100 @@ -90,8 +90,8 @@ public static void preRegister(final Context context, final ClasspathInfo cpInfo) { context.put(docEnvKey, new Context.Factory() { - public DocEnv make(Context c) { - return new JavadocEnv(c, cpInfo); + public DocEnv make() { + return new JavadocEnv(context, cpInfo); } }); } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java 2011-08-03 23:01:41.000000000 +0100 @@ -60,7 +60,16 @@ /** Creates a new instance of JBrowseModule */ public JBrowseModule() { } - + + public @Override void restored() { + super.restored(); + //XXX: + //#143234: javac caches content of all jar files in a static map, which leads to memory leaks affecting the IDE + //when "internal" execution of javac is used + //the property below disables the caches + //java.project might be a better place (currently does not have a ModuleInstall) + System.setProperty("useJavaUtilZip", "true"); //NOI18N + } public @Override void close () { super.close(); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java 2011-08-03 23:01:41.000000000 +0100 @@ -39,7 +39,6 @@ package org.netbeans.modules.java.source.save; import com.sun.source.tree.AnnotationTree; -import com.sun.source.tree.BinaryTree; import com.sun.source.tree.BlockTree; import com.sun.source.tree.CaseTree; import com.sun.source.tree.ClassTree; @@ -75,7 +74,6 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.ListIterator; import java.util.Map; import java.util.Set; @@ -135,15 +133,11 @@ for (Region region : regions) { HashSet linesToAddStar = new HashSet(); LinkedList startOffsets = getStartOffsets(region); - for(ListIterator it = startOffsets.listIterator(); it.hasNext();) { - int startOffset = it.next(); - int endOffset; - if(it.hasNext()) { - endOffset = it.next(); - it.previous(); - } else { - endOffset = region.getEndOffset(); - } + Iterator it = startOffsets.iterator(); + int startOffset = it.hasNext() ? it.next() : region.getStartOffset(); + int endOffset = -1; + while (endOffset < region.getEndOffset()) { + endOffset = it.hasNext() ? it.next() : region.getEndOffset(); String blockCommentLine = null; int delta = 0; if (cs.addLeadingStarInComment() && ((delta = ts.move(startOffset)) > 0 && ts.moveNext() || ts.movePrevious()) @@ -163,9 +157,10 @@ if (blockCommentLine != null && !blockCommentLine.startsWith("*")) { //NOI18N linesToAddStar.add(startOffset); } + startOffset = endOffset; } while (!startOffsets.isEmpty()) { - int startOffset = startOffsets.removeLast(); + startOffset = startOffsets.removeLast(); Integer newIndent = newIndents.get(startOffset); if (linesToAddStar.contains(startOffset)) { context.modifyIndent(startOffset, 0); @@ -315,34 +310,24 @@ } break; case VARIABLE: - Tree type = ((VariableTree)last).getType(); - if (type != null && type.getKind() != Kind.ERRONEOUS) { - ExpressionTree init = ((VariableTree)last).getInitializer(); - if (init == null || init.getKind() != Kind.NEW_ARRAY - || (token = findFirstNonWhitespaceToken(startOffset, lastPos)) == null - || token.token().id() != JavaTokenId.EQ - || (token = findFirstNonWhitespaceToken(startOffset, endOffset)) == null - || token.token().id() != JavaTokenId.LBRACE) { - if (cs.alignMultilineAssignment()) - currentIndent = getColumn(last); - else - currentIndent += cs.getContinuationIndentSize(); - } else { - switch (cs.getOtherBracePlacement()) { - case NEW_LINE_INDENTED: - currentIndent += cs.getIndentSize(); - break; - case NEW_LINE_HALF_INDENTED: - currentIndent += (cs.getIndentSize() / 2); - break; - } - } - break; + ExpressionTree init = ((VariableTree)last).getInitializer(); + if (init == null || init.getKind() != Kind.NEW_ARRAY + || (token = findFirstNonWhitespaceToken(startOffset, lastPos)) == null + || token.token().id() != JavaTokenId.EQ + || (token = findFirstNonWhitespaceToken(startOffset, endOffset)) == null + || token.token().id() != JavaTokenId.LBRACE) { + currentIndent += cs.getContinuationIndentSize(); } else { - last = ((VariableTree)last).getModifiers(); - if (last == null) - break; + switch (cs.getOtherBracePlacement()) { + case NEW_LINE_INDENTED: + currentIndent += cs.getIndentSize(); + break; + case NEW_LINE_HALF_INDENTED: + currentIndent += (cs.getIndentSize() / 2); + break; + } } + break; case MODIFIERS: Tree t = null; for (Tree ann : ((ModifiersTree)last).getAnnotations()) { @@ -356,10 +341,7 @@ } break; case DO_WHILE_LOOP: - token = findFirstNonWhitespaceToken(startOffset, lastPos); - if (token != null && !EnumSet.of(JavaTokenId.RBRACE, JavaTokenId.SEMICOLON).contains(token.token().id())) { - currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.DO), lastPos, currentIndent); - } + currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.DO), lastPos, currentIndent); break; case ENHANCED_FOR_LOOP: currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN), (int)sp.getEndPosition(cut, ((EnhancedForLoopTree)last).getExpression()), currentIndent); @@ -392,10 +374,7 @@ case IF: token = findFirstNonWhitespaceToken(startOffset, endOffset); if (token == null || token.token().id() != JavaTokenId.ELSE) { - token = findFirstNonWhitespaceToken(startOffset, lastPos); - if (token != null && !EnumSet.of(JavaTokenId.RBRACE, JavaTokenId.SEMICOLON).contains(token.token().id())) { - currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN, JavaTokenId.ELSE), (int)sp.getEndPosition(cut, ((IfTree)last).getCondition()) - 1, currentIndent); - } + currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN, JavaTokenId.ELSE), (int)sp.getEndPosition(cut, ((IfTree)last).getCondition()) - 1, currentIndent); } break; case SYNCHRONIZED: @@ -404,17 +383,14 @@ case TRY: token = findFirstNonWhitespaceToken(startOffset, endOffset); if (token == null || !EnumSet.of(JavaTokenId.CATCH, JavaTokenId.FINALLY).contains(token.token().id())) { - token = findFirstNonWhitespaceToken(startOffset, lastPos); - if (token != null && token.token().id() != JavaTokenId.RBRACE) { - t = null; - for (Tree res : ((TryTree)last).getResources()) { - if (sp.getEndPosition(cut, res) > startOffset) { - break; - } - t = res; + t = null; + for (Tree res : ((TryTree)last).getResources()) { + if (sp.getEndPosition(cut, res) > startOffset) { + break; } - currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.TRY, JavaTokenId.RPAREN, JavaTokenId.FINALLY), t != null ? (int)sp.getEndPosition(cut, t) : lastPos, currentIndent); + t = res; } + currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.TRY, JavaTokenId.RPAREN, JavaTokenId.FINALLY), t != null ? (int)sp.getEndPosition(cut, t) : lastPos, currentIndent); } break; case CATCH: @@ -548,8 +524,7 @@ break; case NEW_ARRAY: token = findFirstNonWhitespaceToken(startOffset, endOffset); - nextTokenId = token != null ? token.token().id() : null; - if (nextTokenId != JavaTokenId.RBRACE) { + if (token == null || token.token().id() != JavaTokenId.RBRACE) { token = findFirstNonWhitespaceToken(startOffset, lastPos); prevTokenId = token != null ? token.token().id() : null; if (prevTokenId != null) { @@ -560,42 +535,12 @@ case COMMA: currentIndent = getMultilineIndent(((NewArrayTree)last).getInitializers(), path, token.offset(), lastLineStartOffset, currentIndent, cs.alignMultilineArrayInit(), false); break; - case RBRACKET: - if (nextTokenId == JavaTokenId.LBRACE) { - switch (cs.getOtherBracePlacement()) { - case NEW_LINE_INDENTED: - currentIndent += cs.getIndentSize(); - break; - case NEW_LINE_HALF_INDENTED: - currentIndent += (cs.getIndentSize() / 2); - break; - } - break; - } default: currentIndent += cs.getContinuationIndentSize(); } } } break; - case NEW_CLASS: - token = findFirstNonWhitespaceToken(startOffset, endOffset); - nextTokenId = token != null ? token.token().id() : null; - token = findFirstNonWhitespaceToken(startOffset, lastPos); - prevTokenId = token != null ? token.token().id() : null; - if (prevTokenId == JavaTokenId.RPAREN && nextTokenId == JavaTokenId.LBRACE) { - switch (cs.getOtherBracePlacement()) { - case NEW_LINE_INDENTED: - currentIndent += cs.getIndentSize(); - break; - case NEW_LINE_HALF_INDENTED: - currentIndent += (cs.getIndentSize() / 2); - break; - } - } else { - currentIndent += cs.getContinuationIndentSize(); - } - break; case METHOD_INVOCATION: token = findFirstNonWhitespaceToken(startOffset, lastPos); if (token != null && token.token().id() == JavaTokenId.COMMA) { @@ -755,12 +700,6 @@ return false; } - private int getColumn(Tree tree) throws BadLocationException { - int startOffset = (int)(sp.getStartPosition(cut, tree)); - int lineStartOffset = context.lineStartOffset(startOffset); - return getCol(context.document().getText(lineStartOffset, startOffset - lineStartOffset)); - } - private int getCurrentIndent(Tree tree) throws BadLocationException { int lineStartOffset = context.lineStartOffset((int)sp.getStartPosition(cut, tree)); Integer newIndent = newIndents.get(lineStartOffset); @@ -768,76 +707,10 @@ } private int getContinuationIndent(LinkedList path, int currentIndent) throws BadLocationException { - for (Tree tree : path) { - switch (tree.getKind()) { - case CLASS: - case INTERFACE: - case ENUM: - case ANNOTATION_TYPE: - case VARIABLE: - case METHOD: - case TRY: - case RETURN: - case BLOCK: - case FOR_LOOP: - case SWITCH: - case THROW: - case WHILE_LOOP: - case IF: - case EXPRESSION_STATEMENT: - case SYNCHRONIZED: - case ASSERT: - case CONTINUE: - case LABELED_STATEMENT: - case ENHANCED_FOR_LOOP: - case BREAK: - case EMPTY_STATEMENT: - case DO_WHILE_LOOP: - return getCurrentIndent(tree) + cs.getContinuationIndentSize(); - case ASSIGNMENT: - case MULTIPLY_ASSIGNMENT: - case DIVIDE_ASSIGNMENT: - case REMAINDER_ASSIGNMENT: - case PLUS_ASSIGNMENT: - case MINUS_ASSIGNMENT: - case LEFT_SHIFT_ASSIGNMENT: - case RIGHT_SHIFT_ASSIGNMENT: - case UNSIGNED_RIGHT_SHIFT_ASSIGNMENT: - case AND_ASSIGNMENT: - case XOR_ASSIGNMENT: - case OR_ASSIGNMENT: - if (cs.alignMultilineAssignment()) - return getColumn(tree); - break; - case AND: - case CONDITIONAL_AND: - case CONDITIONAL_OR: - case DIVIDE: - case EQUAL_TO: - case GREATER_THAN: - case GREATER_THAN_EQUAL: - case LEFT_SHIFT: - case LESS_THAN: - case LESS_THAN_EQUAL: - case MINUS: - case MULTIPLY: - case NOT_EQUAL_TO: - case OR: - case PLUS: - case REMAINDER: - case RIGHT_SHIFT: - case UNSIGNED_RIGHT_SHIFT: - case XOR: - if (cs.alignMultilineBinaryOp()) - return getColumn(tree); - break; - case CONDITIONAL_EXPRESSION: - if (cs.alignMultilineTernaryOp()) - return getColumn(tree); - break; - } - } - return currentIndent + cs.getContinuationIndentSize(); + Tree tree = null; + Iterator it = path.iterator(); + while (it.hasNext() && !((tree = it.next()) instanceof StatementTree || tree.getKind() == Kind.CLASS || tree.getKind() == Kind.METHOD)); + return (tree != null ? getCurrentIndent(tree) : currentIndent) + cs.getContinuationIndentSize(); } private int getStmtIndent(int startOffset, int endOffset, Set expectedTokenIds, int expectedTokenOffset, int currentIndent) { Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java 2011-08-03 23:01:41.000000000 +0100 @@ -223,7 +223,7 @@ continue; if (endOffset < start) continue; - if (endOffset == start && (text == null || !(text.trim().equals("}") || templateEdit && start >= end))) //NOI18N + if (endOffset == start && (text == null || !(text.trim().equals("}") || templateEdit))) //NOI18N continue; if (embeddingOffset >= start) continue; @@ -1658,7 +1658,7 @@ } @Override - public Boolean visitUnionType(UnionTypeTree node, Void p) { + public Boolean visitDisjunctiveType(DisjunctiveTypeTree node, Void p) { List alts = node.getTypeAlternatives(); if (alts != null && !alts.isEmpty()) { wrapList(cs.wrapDisjunctiveCatchTypes(), cs.alignMultilineDisjunctiveCatchTypes(), false, BAR, alts); @@ -2235,14 +2235,12 @@ int alignIndent = cs.alignMultilineBinaryOp() ? col : -1; scan(node.getLeftOperand(), p); if (cs.wrapAfterBinaryOps()) { - boolean containedNewLine = spaces(cs.spaceAroundBinaryOps() ? 1 : 0, false); + spaces(cs.spaceAroundBinaryOps() ? 1 : 0); if (OPERATOR.equals(tokens.token().id().primaryCategory())) { col += tokens.token().length(); lastBlankLines = -1; lastBlankLinesTokenIndex = -1; tokens.moveNext(); - if (containedNewLine) - newline(); } wrapTree(cs.wrapBinaryOps(), alignIndent, cs.spaceAroundBinaryOps() ? 1 : 0, node.getRightOperand()); } else { @@ -2256,15 +2254,11 @@ int alignIndent = cs.alignMultilineTernaryOp() ? col : -1; scan(node.getCondition(), p); if (cs.wrapAfterTernaryOps()) { - boolean containedNewLine = spaces(cs.spaceAroundTernaryOps() ? 1 : 0, false); + spaces(cs.spaceAroundTernaryOps() ? 1 : 0); accept(QUESTION); - if (containedNewLine) - newline(); wrapTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getTrueExpression()); - containedNewLine = spaces(cs.spaceAroundTernaryOps() ? 1 : 0, false); + spaces(cs.spaceAroundTernaryOps() ? 1 : 0); accept(COLON); - if (containedNewLine) - newline(); wrapTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getFalseExpression()); } else { wrapOperatorAndTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getTrueExpression()); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java 2011-08-03 23:01:41.000000000 +0100 @@ -1103,8 +1103,6 @@ parens ? new JavaTokenId[] { JavaTokenId.LPAREN, JavaTokenId.RPAREN } : null, pos, Measure.ARGUMENT, - diffContext.style.spaceBeforeSemi(), - diffContext.style.spaceAfterSemi(), false, ";" //NOI18N ); @@ -1876,7 +1874,7 @@ if (!listsMatch(oldT.getVariables(), newT.getVariables())) { copyTo(bounds[0], oldT.getStartPosition()); if (oldT.isEnum()) { - int pos = diffParameterList(oldT.getVariables(), newT.getVariables(), null, oldT.getStartPosition(), Measure.ARGUMENT, diffContext.style.spaceBeforeComma(), diffContext.style.spaceAfterComma(), true, ","); //NOI18N + int pos = diffParameterList(oldT.getVariables(), newT.getVariables(), null, oldT.getStartPosition(), Measure.ARGUMENT, true, ","); //NOI18N copyTo(pos, bounds[1]); return bounds[1]; } else { @@ -2239,7 +2237,7 @@ int pos, Comparator measure) { - return diffParameterList(oldList, newList, makeAround, pos, measure, diffContext.style.spaceBeforeComma(), diffContext.style.spaceAfterComma(), false, ","); //NOI18N + return diffParameterList(oldList, newList, makeAround, pos, measure, false, ","); //NOI18N } private int diffParameterList( List oldList, @@ -2247,8 +2245,6 @@ JavaTokenId[] makeAround, int pos, Comparator measure, - boolean spaceBefore, - boolean spaceAfter, boolean isEnum, String separator) { @@ -2309,7 +2305,7 @@ // insert new element case INSERT: { if (wasComma) { - if (spaceAfter) { + if (diffContext.style.spaceAfterComma()) { printer.print(" "); } } @@ -2326,7 +2322,7 @@ // just copy existing element case NOCHANGE: if (oldIndex++ == 0 && wasComma) { - if (spaceAfter) { + if (diffContext.style.spaceAfterComma()) { printer.print(" "); } } @@ -2339,17 +2335,10 @@ int start = tokenSequence.offset(); tokenSequence.move(bounds[1]); moveToSrcRelevant(tokenSequence, Direction.FORWARD); - int end; - if (isEnum) { - if ((tokenSequence.token().id() == JavaTokenId.SEMICOLON || tokenSequence.token().id() == JavaTokenId.COMMA)) { - end = tokenSequence.offset(); - } else { - end = bounds[1]; - } - } else if (oldIndex < oldList.size()) { + int end = bounds[1]; + if (isEnum && + (tokenSequence.token().id() == JavaTokenId.SEMICOLON || tokenSequence.token().id() == JavaTokenId.COMMA)) { end = tokenSequence.offset(); - } else { - end = bounds[1]; } copyTo(start, pos = end, printer); wasLeadingDelete = false; @@ -2358,9 +2347,6 @@ break; } if (commaNeeded(result, item)) { - if ((item.operation == Operation.INSERT || (oldIndex == oldList.size() && j + 1 < result.length && result[j + 1].operation == Operation.INSERT)) && spaceBefore) { - printer.print(" "); - } printer.print(separator); wasComma = true; } else { @@ -2535,11 +2521,6 @@ return pos; } - protected int diffUnionType(JCTypeUnion oldT, JCTypeUnion newT, int[] bounds) { - int localPointer = bounds[0]; - return diffParameterList(oldT.alternatives, newT.alternatives, null, localPointer, Measure.MEMBER, diffContext.style.spaceAroundBinaryOps(), diffContext.style.spaceAroundBinaryOps(), false, "|"); - } - private boolean commaNeeded(ResultItem[] arr, ResultItem item) { if (item.operation == Operation.DELETE) { return false; @@ -2701,7 +2682,13 @@ case INSERT: { int pos = estimator.getInsertPos(i); if (pos > localPointer) { - copyTo(localPointer, localPointer = pos); + tokenSequence.move(pos); + moveToDifferentThan(tokenSequence, Direction.BACKWARD, EnumSet.of(JavaTokenId.WHITESPACE)); + tokenSequence.moveNext(); + pos = tokenSequence.offset(); + if (pos > localPointer) { + copyTo(localPointer, localPointer = pos); + } } int oldPos = item.element.getKind() != Kind.VARIABLE ? getOldPos(item.element) : item.element.pos; boolean found = false; @@ -3297,9 +3284,6 @@ retVal = diffModifiers((JCModifiers) oldT, (JCModifiers) newT, parent, elementBounds[0]); copyTo(retVal, elementBounds[1]); break; - case JCTree.TYPEUNION: - retVal = diffUnionType((JCTypeUnion) oldT, (JCTypeUnion) newT, elementBounds); - break; default: // handle special cases like field groups and enum constants if (oldT.getKind() == Kind.OTHER) { Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java 2011-08-03 23:01:41.000000000 +0100 @@ -164,7 +164,7 @@ } } - if (jt == null || units == null || JavaCustomIndexer.NO_ONE_PASS_COMPILE_WORKER) { + if (jt == null || units == null) { return new ParsingOutput(false, file2FQNs, addedTypes, createdFiles, finished, modifiedTypes, aptGenerated); } if (context.isCancelled()) { Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java 2011-08-03 23:01:41.000000000 +0100 @@ -166,7 +166,7 @@ } } - if (units == null || JavaCustomIndexer.NO_ONE_PASS_COMPILE_WORKER) { + if (units == null) { return new ParsingOutput(false, file2FQNs, addedTypes, createdFiles, finished, modifiedTypes, aptGenerated); } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java 2011-08-03 23:01:41.000000000 +0100 @@ -121,7 +121,6 @@ */ public class JavaCustomIndexer extends CustomIndexer { - static final boolean NO_ONE_PASS_COMPILE_WORKER = Boolean.getBoolean(JavaCustomIndexer.class.getName() + ".no.one.pass.compile.worker"); private static final String SOURCE_LEVEL_ROOT = "sourceLevel"; //NOI18N private static final String DIRTY_ROOT = "dirty"; //NOI18N private static final String SOURCE_PATH = "sourcePath"; //NOI18N @@ -539,8 +538,7 @@ return result; } - static boolean addAptGenerated(final Context context, JavaParsingContext javaContext, final String sourceRelative, final Set aptGenerated) throws IOException { - boolean ret = false; + static void addAptGenerated(final Context context, JavaParsingContext javaContext, final String sourceRelative, final Set aptGenerated) throws IOException { final File aptFolder = JavaIndex.getAptFolder(context.getRootURI(), false); if (aptFolder.exists()) { final FileObject root = FileUtil.toFileObject(aptFolder); @@ -555,7 +553,7 @@ if (f.exists() && FileObjects.JAVA.equals(FileObjects.getExtension(f.getName()))) { Indexable i = accessor.create(new FileObjectIndexable(root, fileName)); InferableJavaFileObject ffo = FileObjects.fileFileObject(f, aptFolder, null, javaContext.encoding); - ret |= aptGenerated.add(new CompileTuple(ffo, i, false, true, true)); + aptGenerated.add(new CompileTuple(ffo, i, false, true, true)); } } } catch (IOException ioe) { @@ -564,7 +562,6 @@ } } } - return ret; } static void setErrors(Context context, CompileTuple active, DiagnosticListenerImpl errors) { @@ -587,7 +584,7 @@ return binaryNames; } - private static Map> findDependent(final URL root, final Collection> classes, boolean includeFilesInError) throws IOException { + private static Map> findDependent(final URL root, final Collection> classes, boolean includeFilesInError) throws IOException { //get dependencies Map> deps = IndexingController.getDefault().getRootDependencies(); Map> peers = IndexingController.getDefault().getRootPeers(); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java 2011-08-03 23:01:41.000000000 +0100 @@ -242,7 +242,9 @@ continue; } jt.analyze(types); - boolean aptGenerated = aptEnabled ? JavaCustomIndexer.addAptGenerated(context, javaContext, active.indexable.getRelativePath(), previous.aptGenerated) : false; + if (aptEnabled) { + JavaCustomIndexer.addAptGenerated(context, javaContext, active.indexable.getRelativePath(), previous.aptGenerated); + } if (mem.isLowMemory()) { dumpSymFiles(fileManager, jt, previous.createdFiles); mem.isLowMemory(); @@ -287,10 +289,6 @@ previous.finishedFiles.add(active.indexable); active = null; state = 0; - if (aptGenerated) { - dumpSymFiles(fileManager, jt, previous.createdFiles); - jt = null; - } } catch (CouplingAbort ca) { //Coupling error TreeLoader.dumpCouplingAbort(ca, null); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java 2011-08-03 23:01:41.000000000 +0100 @@ -121,7 +121,8 @@ public Name enclClassName; // the enclosing class name. private int indentSize; private int prec; // visitor argument: the current precedence level. - private boolean printingMethodParams; + private LinkedList pendingComments = null; + private int lastReadCommentIdx = -1; private DiffContext diffContext; private CommentHandlerService comments; @@ -298,9 +299,6 @@ public boolean handlePossibleOldTrees(java.util.List toPrint, boolean includeStartingComments) { for (JCTree t : toPrint) { if (!oldTrees.contains(t)) return false; - if (t.getKind() == Kind.ARRAY_TYPE) { - return false;//XXX #197584: C-like array are cannot be copied as old trees. - } } JCTree firstTree = toPrint.get(0); @@ -762,11 +760,8 @@ print(cs.spaceBeforeMethodDeclParen() ? " (" : "("); if (cs.spaceWithinMethodDeclParens() && tree.params.nonEmpty()) print(' '); - boolean oldPrintingMethodParams = printingMethodParams; - printingMethodParams = true; wrapTrees(tree.params, cs.wrapMethodParams(), cs.alignMultilineMethodParams() ? out.col : out.leftMargin + cs.getContinuationIndentSize()); - printingMethodParams = oldPrintingMethodParams; if (cs.spaceWithinMethodDeclParens() && tree.params.nonEmpty()) needSpace(); print(')'); @@ -1489,7 +1484,7 @@ } @Override - public void visitTypeUnion(JCTypeUnion that) { + public void visitTypeDisjunction(JCTypeDisjunction that) { boolean first = true; for (JCExpression c : that.getTypeAlternatives()) { @@ -1826,16 +1821,14 @@ VeryPretty del = new VeryPretty(diffContext, cs, new HashMap(), new HashMap(), origText, 0); del.reallyPrintAnnotations = true; - del.printingMethodParams = printingMethodParams; del.printAnnotations(annotations); String str = del.out.toString(); - int col = printingMethodParams ? out.leftMargin + cs.getContinuationIndentSize() : out.col; - - str = Reformatter.reformat(str + " class A{}", cs, cs.getRightMargin() - col); - str = str.trim().replaceAll("\n", "\n" + whitespace(col)); + str = Reformatter.reformat(str + " class A{}", cs, cs.getRightMargin() - out.col); + + str = str.trim().replaceAll("\n", "\n" + whitespace(out.col)); adjustSpans(annotations, str); @@ -1850,10 +1843,7 @@ if (annotations.isEmpty()) return ; if (printAnnotationsFormatted(annotations)) { - if (!printingMethodParams) - toColExactly(out.leftMargin); - else - out.needSpace(); + toColExactly(out.leftMargin); return ; } @@ -1876,8 +1866,7 @@ break; } } else { - if (!printingMethodParams) - toColExactly(out.leftMargin); + toColExactly(out.leftMargin); } annotations = annotations.tail; } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java 2011-08-03 23:01:41.000000000 +0100 @@ -127,12 +127,7 @@ return IndexManager.readAccess(new IndexManager.Action() { @Override public Boolean run() throws IOException, InterruptedException { - if (index instanceof Index.WithStatus) { - //Fast path - return ((Index.WithStatus)index).getStatus(false) == Index.Status.EMPTY; - } else { - return !index.exists(); - } + return !PersistentClassIndex.this.index.exists(); } }).booleanValue(); } catch (InterruptedException ie) { @@ -147,11 +142,7 @@ @Override public boolean isValid() { try { - if (index instanceof Index.WithStatus) { - return ((Index.WithStatus)index).getStatus(true) != Index.Status.INVALID; - } else { - return index.isValid(true); - } + return index.isValid(true); } catch (IOException ex) { return false; } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java 2011-08-03 23:01:41.000000000 +0100 @@ -303,12 +303,6 @@ return null; } - File tagFile = new File(targetFolder, TAG_FILE_NAME); - - if (!tagFile.exists()) { - return null; - } - try { SourceUtils.waitScanFinished(); } catch (InterruptedException e) { @@ -317,6 +311,12 @@ return false; } + File tagFile = new File(targetFolder, TAG_FILE_NAME); + + if (!tagFile.exists()) { + return null; + } + delete(targetFolder, false); delete(tagFile, true); @@ -593,7 +593,7 @@ } assert f.isAbsolute(); } - return f; + return FileUtil.normalizeFile(f); } /** Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java 2011-08-03 23:01:41.000000000 +0100 @@ -357,7 +357,7 @@ public Tree visitBlock(BlockTree tree, Object p) { return rewriteChildren(tree); } - public Tree visitUnionType(UnionTypeTree tree, Object p) { + public Tree visitDisjunctiveType(DisjunctiveTypeTree tree, Object p) { return rewriteChildren(tree); } public Tree visitDoWhileLoop(DoWhileLoopTree tree, Object p) { @@ -629,10 +629,10 @@ return tree; } - protected final UnionTypeTree rewriteChildren(UnionTypeTree tree) { + protected final DisjunctiveTypeTree rewriteChildren(DisjunctiveTypeTree tree) { List newComponents = translate(tree.getTypeAlternatives()); if (newComponents!=tree.getTypeAlternatives()) { - UnionTypeTree n = make.UnionType(newComponents); + DisjunctiveTypeTree n = make.DisjunctiveType(newComponents); copyCommentTo(tree,n); copyPosTo(tree,n); tree = n; Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java 2011-08-03 23:01:41.000000000 +0100 @@ -44,7 +44,6 @@ package org.netbeans.modules.java.source.parsing; -import com.sun.tools.javac.api.ClientCodeWrapper.Trusted; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; @@ -72,6 +71,7 @@ import org.netbeans.lib.editor.util.swing.DocumentUtilities; import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation; import org.netbeans.modules.parsing.api.Source; +import org.netbeans.modules.parsing.impl.Utilities; import org.openide.cookies.EditorCookie; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; @@ -85,7 +85,6 @@ * * @author Tomas Zezula */ -@Trusted public class SourceFileObject implements DocumentProvider, InferableJavaFileObject { final Handle handle; Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java 2011-08-03 23:01:41.000000000 +0100 @@ -45,7 +45,6 @@ package org.netbeans.modules.java.source.parsing; -import com.sun.tools.javac.api.ClientCodeWrapper.Trusted; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -78,7 +77,6 @@ import javax.lang.model.element.Modifier; import javax.lang.model.element.NestingKind; import javax.tools.JavaFileObject; -import org.netbeans.api.annotations.common.NonNull; import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.api.queries.FileEncodingQuery; import org.netbeans.modules.java.ClassDataLoader; @@ -105,21 +103,8 @@ */ public class FileObjects { - public static final Comparator SIMPLE_NAME_STRING_COMPARATOR = new Comparator(){ - @Override - public int compare( String o1, String o2 ) { - return getSimpleName( o1 ).compareTo( getSimpleName( o2 ) ); - } - }; - - public static final Comparator SIMPLE_NAME_FILEOBJECT_COMPARATOR = new Comparator(){ - @Override - public int compare( JavaFileObject o1, JavaFileObject o2 ) { - String n1 = getSimpleName( o1 ); - String n2 = getSimpleName( o2 ); - return n1.compareTo( n2 ); - } - }; + public static final Comparator SIMPLE_NAME_STRING_COMPARATOR = new SimpleNameStringComparator(); + public static final Comparator SIMPLE_NAME_FILEOBJECT_COMPARATOR = new SimpleNameFileObjectComparator(); public static final String JAVA = JavaDataLoader.JAVA_EXTENSION; @@ -135,9 +120,7 @@ public static final String RES = "res"; //NOI18N public static final String RESOURCES = "resouces." + FileObjects.RES; //NOI18N - - private static final String encodingName = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding(); - + //todo: If more clients than btrace will need this, create a SPI. private static final Set javaFlavorExt = new HashSet(); static { @@ -195,7 +178,17 @@ assert zipFile != null; return new CachedZipFileObject (zipFile, folder, baseName, mtime); } - + + /** + * Creates {@link JavaFileObject} for a regular {@link File} + * @param file for which the {@link JavaFileObject} should be created + * @pram root - the classpath root owning the file + * @return {@link JavaFileObject}, never returns null + */ + public static InferableJavaFileObject fileFileObject( final File file, final File root, final JavaFileFilterImplementation filter) { + return fileFileObject(file, root, filter, null); + } + /** * Creates {@link JavaFileObject} for a regular {@link File} * @param file for which the {@link JavaFileObject} should be created @@ -203,22 +196,14 @@ * @param encoding - the file's encoding * @return {@link JavaFileObject}, never returns null */ - public static @NonNull InferableJavaFileObject fileFileObject( final @NonNull File file, final @NonNull File root, - final @NullAllowed JavaFileFilterImplementation filter, final @NullAllowed Charset encoding) { + public static InferableJavaFileObject fileFileObject( final File file, final File root, final JavaFileFilterImplementation filter, Charset encoding) { assert file != null; assert root != null; - final String[] pkgNamePair = getFolderAndBaseName(getRelativePath(root,file),File.separatorChar); + String[] pkgNamePair = getFolderAndBaseName(getRelativePath(root,file),File.separatorChar); return new FileBase( file, convertFolder2Package(pkgNamePair[0], File.separatorChar), pkgNamePair[1], filter, encoding); } - - /** - * Creates a FileObject for newly created file - * @param root owning the file - * @param path the path (separated by '/') to target folder relative to root - * @param name of the file - * @return {@link JavaFileObject} - */ - public static @NonNull JavaFileObject templateFileObject (final @NonNull FileObject root, final @NonNull String path, final @NonNull String name) { + + public static JavaFileObject templateFileObject (final FileObject root, final String path, String name) { assert root != null; assert path != null; JavaFileFilterImplementation filter = JavaFileFilterQuery.getFilter(root); @@ -276,12 +261,10 @@ return res; } - @Override protected URL getURL() throws IOException { return path; } - @Override protected String getExt() { String ext = super.getExt(); if (ext == null) { @@ -290,7 +273,6 @@ return ext; } - @Override protected String getName(boolean includeExtension) { String name = super.getName(includeExtension); if (name == null) { @@ -302,7 +284,6 @@ return name; } - @Override protected String getRelativePath() { String relativePath = super.getRelativePath(); if (relativePath == null) { @@ -331,11 +312,6 @@ return false; } - @Override - public int hashCode() { - return path.hashCode(); - } - }; return new SourceFileObject(handle, null); } @@ -416,22 +392,12 @@ return new MemoryFileObject(pkgStr, nameStr, uri, lastModified, (CharBuffer)CharBuffer.allocate( length + 1 ).append( content ).append( ' ' ).flip() ); } } - - /** - * Removes extension from fileName - * @param fileName to remove extension from - * @return the fileName without extension - */ + public static String stripExtension( String fileName ) { int dot = fileName.lastIndexOf("."); return (dot == -1 ? fileName : fileName.substring(0, dot)); } - - /** - * Returns file extension - * @param fileName to get extension from - * @return the file extension or empty string when fileName has no extension - */ + public static String getExtension (final String fileName) { int dot = fileName.lastIndexOf('.'); return (dot == -1 || dot == fileName.length() -1 ) ? "" : fileName.substring(dot+1); //NOI18N @@ -522,14 +488,8 @@ }; } } - - /** - * Returns binary name of given file within a root - * @param file to get binary name for - * @param root the root owning the file - * @return the binary name - */ - public static @NonNull String getBinaryName (final @NonNull File file, final @NonNull File root) { + + public static String getBinaryName (final File file, final File root) { assert file != null && root != null; String fileName = FileObjects.getRelativePath (root, file); int index = fileName.lastIndexOf('.'); //NOI18N @@ -538,90 +498,72 @@ } return fileName.replace(File.separatorChar,'.'); //NOI18N } - - /** - * Converts a package name into folder using '/' as separator character - * @param packageName to be converted - * @return the folder name - */ - public static @NonNull String convertPackage2Folder(final @NonNull String packageName ) { - return convertPackage2Folder(packageName, '/' ); //NOI18N + + public static String getSimpleName( JavaFileObject fo ) { + + String name = getName(fo,true); + int i = name.lastIndexOf( '$' ); + if ( i == -1 ) { + return name; + } + else { + return name.substring( i + 1 ); + } + } + + public static String getSimpleName( String fileName ) { + + String name = getBaseName( fileName ); + + int i = name.lastIndexOf( '$' ); + if ( i == -1 ) { + return name; + } + else { + return name.substring( i + 1 ); + } + } - /** - * Converts a package name into folder using given separator character - * @param packageName to be converted - * @param separatorChar separator - * @return the folder name - */ - public static @NonNull String convertPackage2Folder(final @NonNull String packageName, final char separatorChar) { - return packageName.replace( '.',separatorChar); //NOI18N + public static String convertPackage2Folder( String packageName ) { + return convertPackage2Folder(packageName, '/' ); } - /** - * Converts a folder into package name - * @param folderName to be converted, the folder name components has to be separated by '/' - * @return the package name - */ - public static @NonNull String convertFolder2Package (@NonNull String folderName) { - return convertFolder2Package (folderName, '/'); //NOI18N + public static String convertPackage2Folder(final String packageName, final char separatorChar) { + return packageName.replace( '.',separatorChar); } - /** - * Converts a folder into package name - * @param folderName to be converted - * @param separatorChar separator used in folderName - * @return the package name - */ - public static @NonNull String convertFolder2Package( @NonNull String folderName, char folderSeparator ) { - return folderName.replace( folderSeparator, '.' ); + public static String convertFolder2Package (String packageName) { + return convertFolder2Package (packageName, '/'); //NOI18N + } + + public static String convertFolder2Package( String packageName, char folderSeparator ) { + return packageName.replace( folderSeparator, '.' ); } - /** - * Checks if the given folder is a parent of the given file - * @param folder to test - * @param file to test - * @return true if folder is a parent of given file - */ - public static boolean isParentOf (final @NonNull URL folder, final @NonNull URL file) { + public static boolean isParentOf (final URL folder, final URL file) { assert folder != null && file != null; return file.toExternalForm().startsWith(folder.toExternalForm()); } - - /** - * Resolves a relative path within a given package - * @param packageName in which the relative path should be resolved - * @param relativeName to resolve - * @return a relative path resolved in package as path separated by '/' character - */ - public static @NonNull String getRelativePath (final @NonNull String packageName, final @NonNull String relativeName) { + + public static String getRelativePath (final String packageName, final String relativeName) { if (packageName.isEmpty()) return relativeName; StringBuilder relativePath = new StringBuilder (); - relativePath.append(packageName.replace('.','/')); //NOI18N - relativePath.append('/'); //NOI18N + relativePath.append(packageName.replace('.','/')); + relativePath.append('/'); relativePath.append(relativeName); return relativePath.toString(); } - - /** - * Returns a tuple {parentPath,simpleName} for given fully qualified name - * @param fqn to get the parent name tuple for - * @return a tuple {parentPath, simpleName} - */ - public static @NonNull String[] getParentRelativePathAndName (@NonNull final String fqn) { + + public static String[] getParentRelativePathAndName (final String fqn) { final String[] result = getPackageAndName(fqn); if (result != null) { result[0] = result[0].replace('.','/'); //NOI18N } return result; } - - /** - * Returns a tuple {package,simpleName} for given fully qualified name - * @param fqn to get the package simpleName tuple for - * @return a tuple {package,simpleName} - */ - public static @NonNull String[] getPackageAndName (final @NonNull String fqn) { + + public static String[] getPackageAndName (final String fqn) { if (fqn.charAt(fqn.length()-1) == '.') { return null; } @@ -646,7 +588,7 @@ * @param extension * @return the found kind */ - public static @NonNull JavaFileObject.Kind getKind (final @NullAllowed String extension) { + public static JavaFileObject.Kind getKind (final @NullAllowed String extension) { if (extension == null) { return JavaFileObject.Kind.OTHER; } @@ -665,12 +607,8 @@ } return JavaFileObject.Kind.OTHER; } - - /** - * Recursively deletes the folder - * @param folder to be deleted - */ - public static void deleteRecursively (final @NonNull File folder) { + + public static void deleteRecursively (final File folder) { assert folder != null; if (folder.isDirectory()) { File[] children = folder.listFiles(); @@ -682,103 +620,7 @@ } folder.delete(); } - - /** - * Returns a relative path of given file in given root - * @param root owning the file - * @param fo a file to get the relative path for - * @return the relative path - */ - public static @NonNull String getRelativePath (final @NonNull File root, final @NonNull File fo) { - final String rootPath = root.getAbsolutePath(); - final String foPath = fo.getAbsolutePath(); - assert foPath.startsWith(rootPath) : String.format("getRelativePath(%s, %s)", rootPath, foPath); //NOI18N - int index = rootPath.length(); - if (rootPath.charAt(index - 1) != File.separatorChar) { - index++; - } - int foIndex = foPath.length(); - if (foIndex <= index) { - return ""; //NOI18N - } - return foPath.substring(index); - } - - /** - * Returns a relative path of given file in given root - * @param root owning the file - * @param fo a file to get the relative path for - * @return the relative path - */ - public static @NonNull String getRelativePath (@NonNull final URL root, @NonNull final URL fo) throws URISyntaxException { - final String path = getRelativePath(new File(root.toURI()), new File(fo.toURI())); - return path.replace(File.separatorChar, '/'); //NOI18N - } - - // - private static CharSequence getCharContent(InputStream ins, Charset encoding, JavaFileFilterImplementation filter, long expectedLength, boolean ignoreEncodingErrors) throws IOException { - char[] result; - Reader in; - - if (encoding != null) { - in = new InputStreamReader (ins, encoding); - } else { - in = new InputStreamReader (ins); - } - if (filter != null) { - in = filter.filterReader(in); - } - int red = 0; - try { - int len = (int) expectedLength; - if (len == 0) len++; //len - red would be 0 while reading from the stream - result = new char [len+1]; - int rv; - while ((rv=in.read(result,red,len-red))>=0) { - red += rv; - //In case the filter enlarged the file - if (red == len) { - char[] _tmp = new char[2*len]; - System.arraycopy(result, 0, _tmp, 0, len); - result = _tmp; - len = result.length; - } - } - } finally { - in.close(); - } - result[red++]='\n'; //NOI18N - CharSequence buffer = CharBuffer.wrap (result, 0, red); - return buffer; - } - - private static String getSimpleName(JavaFileObject fo ) { - String name = getName(fo,true); - int i = name.lastIndexOf( '$' ); - if ( i == -1 ) { - return name; - } - else { - return name.substring( i + 1 ); - } - } - - private static String getSimpleName( String fileName ) { - - String name = getBaseName( fileName ); - - int i = name.lastIndexOf( '$' ); - if ( i == -1 ) { - return name; - } - else { - return name.substring( i + 1 ); - } - - } - // - - // + public static abstract class Base implements InferableJavaFileObject { protected final JavaFileObject.Kind kind; @@ -796,22 +638,21 @@ this.kind = FileObjects.getKind (this.ext); } - @Override public JavaFileObject.Kind getKind() { return this.kind; } - @Override public boolean isNameCompatible (String simplename, JavaFileObject.Kind k) { - return this.kind == k && nameWithoutExt.equals(simplename); + if (this.kind != k) { + return false; + } + return nameWithoutExt.equals(simplename); } - @Override public NestingKind getNestingKind() { return null; } - @Override public Modifier getAccessLevel() { return null; } @@ -829,7 +670,6 @@ return this.nameWithoutExt; } - @Override public String getName () { return this.nameWithoutExt + '.' + ext; } @@ -842,7 +682,6 @@ return false; } - @Override public final String inferBinaryName () { final StringBuilder sb = new StringBuilder (); sb.append (this.pkgName); @@ -877,10 +716,8 @@ } } - @Trusted public static class FileBase extends Base { - private static final boolean isWindows = Utilities.isWindows(); protected final File f; private final JavaFileFilterImplementation filter; private final Charset encoding; @@ -934,9 +771,16 @@ @Override public boolean isNameCompatible(String simplename, JavaFileObject.Kind kind) { - return isWindows ? - this.kind == kind && nameWithoutExt.equalsIgnoreCase(simplename) : - super.isNameCompatible(simplename, kind); + boolean res = super.isNameCompatible(simplename, kind); + if (res) { + return res; + } + else if (Utilities.isWindows()) { + return nameWithoutExt.equalsIgnoreCase(simplename); + } + else { + return false; + } } @Override @@ -975,8 +819,74 @@ return f.hashCode(); } } - - @Trusted + + public static class InvalidFileException extends IOException { + + public InvalidFileException () { + super (); + } + + public InvalidFileException (final FileObject fo) { + super (NbBundle.getMessage(FileObjects.class,"FMT_InvalidFile",FileUtil.getFileDisplayName(fo))); + } + } + + public static String getRelativePath (final File root, final File fo) { + final String rootPath = root.getAbsolutePath(); + final String foPath = fo.getAbsolutePath(); + assert foPath.startsWith(rootPath) : String.format("getRelativePath(%s, %s)", rootPath, foPath); + int index = rootPath.length(); + if (rootPath.charAt(index - 1) != File.separatorChar) { + index++; + } + int foIndex = foPath.length(); + if (foIndex <= index) { + return ""; //NOI18N + } + return foPath.substring(index); + } + + public static String getRelativePath (final URL root, final URL fo) throws URISyntaxException { + final String path = getRelativePath(new File(root.toURI()), new File(fo.toURI())); + return path.replace(File.separatorChar, '/'); + } + + public static CharSequence getCharContent(InputStream ins, Charset encoding, JavaFileFilterImplementation filter, long expectedLength, boolean ignoreEncodingErrors) throws IOException { + char[] result; + Reader in; + + if (encoding != null) { + in = new InputStreamReader (ins, encoding); + } else { + in = new InputStreamReader (ins); + } + if (filter != null) { + in = filter.filterReader(in); + } + int red = 0; + try { + int len = (int) expectedLength; + if (len == 0) len++; //len - red would be 0 while reading from the stream + result = new char [len+1]; + int rv; + while ((rv=in.read(result,red,len-red))>=0) { + red += rv; + //In case the filter enlarged the file + if (red == len) { + char[] _tmp = new char[2*len]; + System.arraycopy(result, 0, _tmp, 0, len); + result = _tmp; + len = result.length; + } + } + } finally { + in.close(); + } + result[red++]='\n'; //NOI18N + CharSequence buffer = CharBuffer.wrap (result, 0, red); + return buffer; + } + private static class NewFromTemplateFileObject extends FileBase { public NewFromTemplateFileObject (File f, String packageName, String baseName, JavaFileFilterImplementation filter, Charset encoding) { @@ -1036,7 +946,10 @@ } } - abstract static class ZipFileBase extends Base { + /** A subclass of FileObject representing zip entries. + * XXX: What happens when the archive is deleted or rebuilt? + */ + public abstract static class ZipFileBase extends Base { protected final long mtime; protected final String resName; @@ -1048,19 +961,17 @@ this.resName = baseName; } else { - StringBuilder rn = new StringBuilder (folderName); - rn.append('/'); //NOI18N - rn.append(baseName); - this.resName = rn.toString(); + StringBuilder resName = new StringBuilder (folderName); + resName.append('/'); //NOI18N + resName.append(baseName); + this.resName = resName.toString(); } } - @Override public OutputStream openOutputStream() throws IOException { throw new UnsupportedOperationException(); } - @Override public Reader openReader(boolean b) throws IOException { if (this.getKind() == JavaFileObject.Kind.CLASS) { throw new UnsupportedOperationException(); @@ -1070,23 +981,18 @@ } } - @Override public Writer openWriter() throws IOException { throw new UnsupportedOperationException(); } - @Override public long getLastModified() { return mtime; } - @Override public boolean delete() { throw new UnsupportedOperationException(); } - @Override - @SuppressWarnings("empty-statement") public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { Reader r = openReader(ignoreEncodingErrors); try { @@ -1114,7 +1020,6 @@ } } - @Override public final URI toUri () { URI zdirURI = this.getArchiveURI(); try { @@ -1136,10 +1041,14 @@ } return new URI("jar:"+zdirURI.toString()+"!/"+sb.toString()); //NOI18N } catch (final UnsupportedEncodingException e2) { - throw new IllegalStateException(e2); + final IllegalStateException ne = new IllegalStateException (); + ne.initCause(e2); + throw ne; } catch (final URISyntaxException e2) { - throw new IllegalStateException(e2); + final IllegalStateException ne = new IllegalStateException (); + ne.initCause(e2); + throw ne; } } } @@ -1162,8 +1071,7 @@ protected abstract long getSize() throws IOException; } - - @Trusted + private static class ZipFileObject extends ZipFileBase { @@ -1179,7 +1087,6 @@ } - @Override public InputStream openInputStream() throws IOException { class ZipInputStream extends InputStream { @@ -1208,22 +1115,18 @@ } } - @Override public int read() throws IOException { throw new java.lang.UnsupportedOperationException("Not supported yet."); } - @Override public int read(byte b[], int off, int len) throws IOException { return delegate.read(b, off, len); } - @Override public int available() throws IOException { return this.delegate.available(); } - @Override public void close() throws IOException { try { this.delegate.close(); @@ -1233,19 +1136,17 @@ } - } + }; // long time = System.currentTimeMillis(); ZipFile zf = new ZipFile (archiveFile); // System.out.println("ZF OPEN " + archiveFile.getPath() + " took: " + (System.currentTimeMillis() - time )+ "ms." ); return new BufferedInputStream (new ZipInputStream (zf)); } - @Override public URI getArchiveURI () { return this.archiveFile.toURI(); } - @Override protected long getSize () throws IOException { ZipFile zf = new ZipFile (archiveFile); try { @@ -1256,8 +1157,7 @@ } } } - - @Trusted + private static class FastZipFileObject extends ZipFileObject { private long offset; @@ -1301,8 +1201,7 @@ return super.getSize(); } } - - @Trusted + private static class CachedZipFileObject extends ZipFileBase { private ZipFile zipFile; @@ -1313,17 +1212,14 @@ this.zipFile = zipFile; } - @Override public InputStream openInputStream() throws IOException { return new BufferedInputStream (this.zipFile.getInputStream(new ZipEntry (this.resName))); } - @Override public URI getArchiveURI () { return new File (this.zipFile.getName()).toURI(); } - @Override protected long getSize() throws IOException { ZipEntry ze = this.zipFile.getEntry(this.resName); return ze == null ? 0L : ze.getSize(); @@ -1331,9 +1227,8 @@ } - /** Temporary FileObject for parsing input stream. - */ - @Trusted + /** Temporay FileObject for parsing input stream. + */ private static class MemoryFileObject extends Base { private final long lastModified; @@ -1353,22 +1248,19 @@ /** * Get the character content of the file, if available. - * @param ignoreEncodingErrors if true, encoding errors will be replaced by the + * @param ignoreEncodingErrors if true, encoding errros will be replaced by the * default translation character; otherwise they should be reported as diagnostics. * @throws UnsupportedOperationException if character access is not supported */ - @Override public java.nio.CharBuffer getCharContent(boolean ignoreEncodingErrors) throws java.io.IOException { return cb.duplicate(); } - @Override public boolean delete() { // Do nothing return false; } - @Override public URI toUri () { if (this.uri != null) { return this.uri; @@ -1383,7 +1275,6 @@ return isVirtual; } - @Override public long getLastModified() { return this.lastModified; } @@ -1394,7 +1285,6 @@ * @return an InputStream for this object. * @throws UnsupportedOperationException if the byte access is not supported */ - @Override public InputStream openInputStream() throws java.io.IOException { return new ByteArrayInputStream(cb.toString().getBytes("UTF-8")); } @@ -1405,7 +1295,6 @@ * @return an OutputStream for this object. * @throws UnsupportedOperationException if byte access is not supported */ - @Override public java.io.OutputStream openOutputStream() throws java.io.IOException { throw new UnsupportedOperationException(); } @@ -1417,7 +1306,6 @@ * @throws UnsupportedOperationException if character access is not supported * @throws IOException if an error occurs while opening the reader */ - @Override public java.io.Reader openReader (boolean b) throws java.io.IOException { return new StringReader(this.cb.toString()); } @@ -1427,22 +1315,32 @@ * @throws UnsupportedOperationException if character access is not supported * @throws IOException if an error occurs while opening the writer */ - @Override public java.io.Writer openWriter() throws java.io.IOException { throw new UnsupportedOperationException(); } - } - // - - public static class InvalidFileException extends IOException { - - public InvalidFileException () { - super (); + } + + private static class SimpleNameStringComparator implements Comparator { + + public int compare( String o1, String o2 ) { + return getSimpleName( o1 ).compareTo( getSimpleName( o2 ) ); } - - public InvalidFileException (final FileObject fo) { - super (NbBundle.getMessage(FileObjects.class,"FMT_InvalidFile",FileUtil.getFileDisplayName(fo))); + + } + + private static class SimpleNameFileObjectComparator implements Comparator { + + public int compare( JavaFileObject o1, JavaFileObject o2 ) { + + String n1 = getSimpleName( o1 ); + String n2 = getSimpleName( o2 ); + + return n1.compareTo( n2 ); } + } + + static final String encodingName = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding(); + } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java 2011-08-03 23:01:41.000000000 +0100 @@ -44,7 +44,6 @@ package org.netbeans.modules.java.source.parsing; -import com.sun.tools.javac.api.ClientCodeWrapper.Trusted; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -58,6 +57,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; +import java.util.Stack; import java.util.logging.Level; import java.util.logging.Logger; import javax.tools.FileObject; @@ -71,7 +71,6 @@ * * @author Tomas Zezula */ -@Trusted public class ProxyFileManager implements JavaFileManager { @@ -142,13 +141,26 @@ } else if (location == StandardLocation.SOURCE_PATH && this.sourcePath != null) { if (this.memoryFileManager != null) { - return new JavaFileManager[] { - this.sourcePath, - this.memoryFileManager - }; + if (this.aptSources != null) { + return new JavaFileManager[] { + this.sourcePath, + this.aptSources, + this.memoryFileManager + }; + } + else { + return new JavaFileManager[] { + this.sourcePath, + this.memoryFileManager + }; + } } else { - return new JavaFileManager[] {this.sourcePath}; + if (this.aptSources != null) { + return new JavaFileManager[] {this.sourcePath, this.aptSources}; + } else { + return new JavaFileManager[] {this.sourcePath}; + } } } else if (location == StandardLocation.CLASS_OUTPUT && this.outputhPath != null) { @@ -429,7 +441,6 @@ } } - @Trusted private static final class NullFileObject extends ForwardingInferableJavaFileObject { private NullFileObject (@NonNull final InferableJavaFileObject delegate) { super (delegate); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java 2011-08-03 23:01:41.000000000 +0100 @@ -46,26 +46,19 @@ import java.io.File; import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; import javax.tools.JavaFileObject; -import org.netbeans.api.annotations.common.NonNull; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.queries.FileEncodingQuery; import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation; -import org.netbeans.modules.java.source.indexing.JavaIndex; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; -import org.openide.util.Exceptions; /** * @@ -78,9 +71,6 @@ final File root; final Charset encoding; - - private final AtomicBoolean sourceRootInitialized = new AtomicBoolean(); - private volatile URL sourceRoot; /** Creates a new instance of FolderArchive */ public FolderArchive (final File root) { @@ -100,7 +90,6 @@ } } - @Override public Iterable getFiles(String folderName, ClassPath.Entry entry, Set kinds, JavaFileFilterImplementation filter) throws IOException { assert folderName != null; if (folderName.length()>0) { @@ -132,7 +121,6 @@ return Collections.emptyList(); } - @Override public JavaFileObject create (String relativePath, final JavaFileFilterImplementation filter) throws UnsupportedOperationException { if (File.separatorChar != '/') { //NOI18N relativePath = relativePath.replace('/', File.separatorChar); @@ -141,38 +129,12 @@ return FileObjects.fileFileObject(file, root, filter, encoding); } - @Override public void clear () { } @Override - public JavaFileObject getFile(final @NonNull String name) { - final String path = name.replace('/', File.separatorChar); //NOI18N - File file = new File (this.root, path); - if (file.exists()) { - return FileObjects.fileFileObject(file,this.root,null,encoding); - } - try { - final URL srcRoot = getBaseSourceRoot(this.root.toURI().toURL()); - if (srcRoot != null) { - final File folder = new File(srcRoot.toURI()); - file = new File (folder,path); - if (file.exists()) { - return FileObjects.fileFileObject(file,folder,null,encoding); - } - } - } catch (MalformedURLException e) { - Exceptions.printStackTrace(e); - } catch (URISyntaxException e) { - Exceptions.printStackTrace(e); - } - return null; - } - - private URL getBaseSourceRoot(final URL binRoot) { - if (!sourceRootInitialized.getAndSet(true)) { - sourceRoot = JavaIndex.getSourceRootForClassFolder(binRoot); - } - return sourceRoot; + public JavaFileObject getFile(String name) { + final File file = new File (this.root, name.replace('/', File.separatorChar)); //NOI18N + return file.exists() ? FileObjects.fileFileObject(file,this.root,null,encoding) : null ; } } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java 2011-08-03 23:01:41.000000000 +0100 @@ -55,7 +55,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Map.Entry; import java.util.TreeMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -86,7 +85,6 @@ private CompilationUnitTree compilationUnit; private JavacTaskImpl javacTask; - private DiagnosticListener diagnosticListener; private final ClasspathInfo cpInfo; Pair changedMethod; private final FileObject file; @@ -113,7 +111,6 @@ final FileObject file, final FileObject root, final JavacTaskImpl javacTask, - final DiagnosticListener diagnosticListener, final Snapshot snapshot, final boolean detached) throws IOException { assert parser != null; @@ -126,7 +123,6 @@ assert file == null || snapshot != null; this.jfo = file != null ? JavacParser.jfoProvider.createJavaFileObject(file, root, JavaFileFilterQuery.getFilter(file), snapshot.getText()) : null; this.javacTask = javacTask; - this.diagnosticListener = diagnosticListener; this.isClassFile = false; this.isDetached = detached; } @@ -248,21 +244,13 @@ if (this.jfo == null) { throw new IllegalStateException (); } - Collection>> errors = ((DiagnosticListenerImpl)diagnosticListener).getErrors(jfo).values(); - List> partialReparseErrors = ((DiagnosticListenerImpl)diagnosticListener).partialReparseErrors; - List> affectedErrors = ((DiagnosticListenerImpl)diagnosticListener).affectedErrors; - int errorsSize = 0; - - for (Collection> err : errors) { - errorsSize += err.size(); - } - - List localErrors = new ArrayList(errorsSize + + Collection> errors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).getErrors(jfo).values(); + List> partialReparseErrors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).partialReparseErrors; + List> affectedErrors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).affectedErrors; + List localErrors = new ArrayList(errors.size() + (partialReparseErrors == null ? 0 : partialReparseErrors.size()) + (affectedErrors == null ? 0 : affectedErrors.size())); - for (Collection> err : errors) { - localErrors.addAll(err); - } + localErrors.addAll(errors); if (partialReparseErrors != null) { localErrors.addAll (partialReparseErrors); } @@ -379,20 +367,11 @@ */ public synchronized JavacTaskImpl getJavacTask() { if (javacTask == null) { - diagnosticListener = new DiagnosticListenerImpl(this.jfo); javacTask = JavacParser.createJavacTask(this.file, this.root, this.cpInfo, - this.parser, diagnosticListener, null, isDetached); + this.parser, new DiagnosticListenerImpl(this.jfo), null, isDetached); } return javacTask; } - - /** - * Returns current {@link DiagnosticListener} - * @return listener - */ - DiagnosticListener getDiagnosticListener() { - return diagnosticListener; - } /** * Sets the current {@link JavaSource.Phase} @@ -428,7 +407,7 @@ // Innerclasses ------------------------------------------------------------ static class DiagnosticListenerImpl implements DiagnosticListener { - private final Map>>> source2Errors; + private final Map>> source2Errors; private final JavaFileObject jfo; private volatile List> partialReparseErrors; private volatile List> affectedErrors; @@ -436,7 +415,7 @@ public DiagnosticListenerImpl(final JavaFileObject jfo) { this.jfo = jfo; - this.source2Errors = new HashMap>>>(); + this.source2Errors = new HashMap>>(); } @Override @@ -446,22 +425,15 @@ partialReparseErrors.add(message); } } else { - TreeMap>> errors = getErrors(message.getSource()); - Collection> diags = errors.get((int) message.getPosition()); - - if (diags == null) { - errors.put((int) message.getPosition(), diags = new ArrayList>()); - } - - diags.add(message); + getErrors(message.getSource()).put((int) message.getPosition(), message); } } - private TreeMap>> getErrors(JavaFileObject file) { - TreeMap>> errors = source2Errors.get(file); + private TreeMap> getErrors(JavaFileObject file) { + TreeMap> errors = source2Errors.get(file); if (errors == null) { - source2Errors.put(file, errors = new TreeMap>>()); + source2Errors.put(file, errors = new TreeMap>()); } return errors; @@ -474,20 +446,18 @@ final void startPartialReparse (int from, int to) { if (partialReparseErrors == null) { partialReparseErrors = new ArrayList>(); - TreeMap>> errors = getErrors(jfo); + TreeMap> errors = getErrors(jfo); errors.subMap(from, to).clear(); //Remove errors in changed method durring the partial reparse - Map>> tail = errors.tailMap(to); + Map> tail = errors.tailMap(to); this.affectedErrors = new ArrayList>(tail.size()); - for (Iterator>>> it = tail.entrySet().iterator(); it.hasNext();) { - Entry>> e = it.next(); + for (Iterator>> it = tail.entrySet().iterator(); it.hasNext();) { + Map.Entry> e = it.next(); + final JCDiagnostic diagnostic = (JCDiagnostic)e.getValue(); it.remove(); - for (Diagnostic d : e.getValue()) { - final JCDiagnostic diagnostic = (JCDiagnostic) d; - if (diagnostic == null) { - throw new IllegalStateException("#184910: diagnostic == null " + mapArraysToLists(Thread.getAllStackTraces())); //NOI18N - } - this.affectedErrors.add(new D (diagnostic)); + if (diagnostic == null) { + throw new IllegalStateException("#184910: diagnostic == null " + mapArraysToLists(Thread.getAllStackTraces())); //NOI18N } + this.affectedErrors.add(new D (diagnostic)); } } else { Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java 2011-08-03 23:01:41.000000000 +0100 @@ -74,8 +74,6 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -87,14 +85,12 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.processing.Processor; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.text.Document; -import javax.swing.text.JTextComponent; import javax.tools.Diagnostic; import javax.tools.DiagnosticListener; import javax.tools.JavaCompiler; @@ -102,7 +98,6 @@ import javax.tools.ToolProvider; import org.netbeans.api.annotations.common.NonNull; import org.netbeans.api.annotations.common.NullAllowed; -import org.netbeans.api.editor.EditorRegistry; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.api.java.lexer.JavaTokenId; import org.netbeans.api.java.queries.SourceLevelQuery; @@ -203,11 +198,10 @@ //Incremental parsing support private final boolean supportsReparse; //Incremental parsing support - private final List> positions = - Collections.synchronizedList(new LinkedList>()); + private final List> positions = Collections.synchronizedList(new LinkedList>()); //Incremental parsing support - private final AtomicReference> changedMethod = - new AtomicReference>(); + //@GuardedBy(this) + private Pair changedMethod; //Incremental parsing support private final DocListener listener; //J2ME preprocessor support @@ -353,23 +347,28 @@ init (snapshot, task, true); boolean needsFullReparse = true; if (supportsReparse) { - final Pair _changedMethod = changedMethod.getAndSet(null); + Pair _changedMethod; + synchronized (this) { + _changedMethod = this.changedMethod; + this.changedMethod = null; + } if (_changedMethod != null && ciImpl != null) { LOGGER.log(Level.FINE, "\t:trying partial reparse:\n{0}", _changedMethod.first.getText()); //NOI18N needsFullReparse = !reparseMethod(ciImpl, snapshot, _changedMethod.second, _changedMethod.first.getText()); } } if (needsFullReparse) { - positions.clear(); - ciImpl = createCurrentInfo (this, file, root, snapshot, null, null); + synchronized (positions) { + positions.clear(); + } + ciImpl = createCurrentInfo (this, file, root,snapshot, null); LOGGER.fine("\t:created new javac"); //NOI18N } break; default: init (snapshot, task, false); ciImpl = createCurrentInfo(this, file, root, snapshot, - ciImpl == null ? null : ciImpl.getJavacTask(), - ciImpl == null ? null : ciImpl.getDiagnosticListener()); + ciImpl == null ? null : ciImpl.getJavacTask()); } cachedSnapShot = snapshot; } @@ -460,7 +459,7 @@ if (nct.getCompilationController() == null || nct.getTimeStamp() != parseId) { try { nct.setCompilationController( - JavaSourceAccessor.getINSTANCE().createCompilationController(new CompilationInfoImpl(this, file, root, null, null, cachedSnapShot, true)), + JavaSourceAccessor.getINSTANCE().createCompilationController(new CompilationInfoImpl(this, file, root, null, cachedSnapShot, true)), parseId); } catch (IOException ioe) { throw new ParseException ("Javac Failure", ioe); @@ -617,9 +616,8 @@ final FileObject file, final FileObject root, final Snapshot snapshot, - final JavacTaskImpl javac, - final DiagnosticListener diagnosticListener) throws IOException { - CompilationInfoImpl info = new CompilationInfoImpl(parser, file, root, javac, diagnosticListener, snapshot, false); + final JavacTaskImpl javac) throws IOException { + CompilationInfoImpl info = new CompilationInfoImpl(parser, file, root, javac, snapshot, false); if (file != null) { Logger.getLogger("TIMER").log(Level.FINE, "CompilationInfo", //NOI18N new Object[] {file, info}); @@ -687,8 +685,6 @@ } options.add("-XDide"); // NOI18N, javac runs inside the IDE options.add("-XDsave-parameter-names"); // NOI18N, javac runs inside the IDE - options.add("-XDsuppressAbortOnBadClassFile"); // NOI18N, when a class file cannot be read, produce an error type instead of failing with an exception - options.add("-XDshouldStopPolicy=GENERATE"); // NOI18N, parsing should not stop in phase where an error is found options.add("-g:source"); // NOI18N, Make the compiler to maintian source file info options.add("-g:lines"); // NOI18N, Make the compiler to maintain line table options.add("-g:vars"); // NOI18N, Make the compiler to maintain local variables table @@ -925,7 +921,7 @@ final JavaFileObject prevLogged = l.useSource(cu.getSourceFile()); JCBlock block; try { - DiagnosticListener dl = ci.getDiagnosticListener(); + DiagnosticListener dl = ctx.get(DiagnosticListener.class); assert dl instanceof CompilationInfoImpl.DiagnosticListenerImpl; ((CompilationInfoImpl.DiagnosticListenerImpl)dl).startPartialReparse(origStartPos, origEndPos); long start = System.currentTimeMillis(); @@ -1068,7 +1064,6 @@ th.addTokenHierarchyListener(lexListener = WeakListeners.create(TokenHierarchyListener.class, this,th)); document = doc; } - EditorRegistry.addPropertyChangeListener(new EditorRegistryWeakListener(this)); } @Override @@ -1090,13 +1085,6 @@ //reset document this.document = doc; } - } else if (EditorRegistry.FOCUS_GAINED_PROPERTY.equals(evt.getPropertyName())) { - final Document doc = document; - final JTextComponent focused = EditorRegistry.focusedComponent(); - final Document focusedDoc = focused == null ? null : focused.getDocument(); - if (doc != null && doc == focusedDoc) { - positions.clear(); - } } } @@ -1148,49 +1136,15 @@ if (changedMethod!=null) { positions.add (changedMethod); } - JavacParser.this.changedMethod.set(changedMethod); + synchronized (JavacParser.this) { + JavacParser.this.changedMethod = changedMethod; + } } } } } } - private static final class EditorRegistryWeakListener extends WeakReference implements PropertyChangeListener, Runnable { - private Reference last; - - private EditorRegistryWeakListener(final @NonNull PropertyChangeListener delegate) { - super(delegate,org.openide.util.Utilities.activeReferenceQueue()); - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - final PropertyChangeListener delegate = get(); - final JTextComponent lastCandidate = EditorRegistry.focusedComponent(); - if (delegate != null && lastCandidate != null && lastCandidate != getLast()) { - setLast(lastCandidate); - delegate.propertyChange(evt); - } - } - - @Override - public void run() { - EditorRegistry.removePropertyChangeListener(this); - } - - /** - * @return the last - */ - private JTextComponent getLast() { - return last == null ? null : last.get(); - } - - /** - * @param last the last to set - */ - private void setLast(JTextComponent last) { - this.last = new WeakReference(last); - } - } /** * For unit tests only @@ -1199,7 +1153,7 @@ */ public synchronized void setChangedMethod (final Pair changedMethod) { assert changedMethod != null; - this.changedMethod.set(changedMethod); + this.changedMethod = changedMethod; } /** Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java 2011-08-03 23:01:41.000000000 +0100 @@ -63,8 +63,8 @@ public static void preRegister(final Context context) { context.put(enterKey, new Context.Factory() { - public Enter make(Context c) { - return new ErrorHandlingJavadocEnter(c); + public Enter make() { + return new ErrorHandlingJavadocEnter(context); } }); } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java 2011-08-03 23:01:41.000000000 +0100 @@ -90,7 +90,6 @@ ASTService model; Elements elements; Types types; - private final CommentHandlerService chs; private static final Context.Key contextKey = new Context.Key(); @@ -110,7 +109,6 @@ make = com.sun.tools.javac.tree.TreeMaker.instance(context); elements = JavacElements.instance(context); types = JavacTypes.instance(context); - chs = CommentHandlerService.instance(context); make.toplevel = null; } @@ -207,7 +205,7 @@ return make.at(NOPOS).ClassDef((JCModifiers)modifiers, names.fromString(simpleName.toString()), typarams.toList(), - (JCExpression)extendsClause, + (JCTree)extendsClause, impls.toList(), defs.toList()); @@ -296,11 +294,11 @@ return make.at(NOPOS).Continue(n); } - public UnionTypeTree UnionType(List typeComponents) { + public DisjunctiveTypeTree DisjunctiveType(List typeComponents) { ListBuffer components = new ListBuffer(); for (Tree t : typeComponents) components.append((JCExpression)t); - return make.at(NOPOS).TypeUnion(components.toList()); + return make.at(NOPOS).TypeDisjunction(components.toList()); } public DoWhileLoopTree DoWhileLoop(ExpressionTree condition, StatementTree statement) { @@ -1447,16 +1445,7 @@ REMOVE } - public N setLabel(final N node, final CharSequence aLabel) - throws IllegalArgumentException { - N result = setLabelImpl(node, aLabel); - - chs.copyComments(node, result); - - return result; - } - - private N setLabelImpl(final N node, final CharSequence aLabel) + public N setLabel(final N node, final CharSequence aLabel) throws IllegalArgumentException { // todo (#pf): Shouldn't here be check that names are not the same? @@ -1607,7 +1596,7 @@ return make.at(NOPOS).ClassDef(make.at(NOPOS).Modifiers(modifiers, annotations), names.fromString(simpleName.toString()), typarams.toList(), - (JCExpression)extendsClause, + (JCTree)extendsClause, impls.toList(), defs.toList()); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java 2011-08-03 23:01:41.000000000 +0100 @@ -53,7 +53,6 @@ import com.sun.tools.javac.util.Context; import java.util.*; -import org.netbeans.modules.java.source.query.CommentSet.RelativePosition; /** @@ -116,10 +115,12 @@ if (from != null) { CommentSetImpl to = map.get(toTree); if (to == null) { - map.put(toTree, to = new CommentSetImpl()); - } - for (RelativePosition pos : RelativePosition.values()) { - to.addComments(pos, from.getComments(pos)); + to = (CommentSetImpl)from.clone(); + map.put(toTree, to); + } + else { + to.addPrecedingComments(from.getPrecedingComments()); + to.addTrailingComments(from.getTrailingComments()); } } } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreePathHandle.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TreePathHandle.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreePathHandle.java 2011-08-03 23:01:41.000000000 +0100 @@ -44,8 +44,6 @@ package org.netbeans.api.java.source; -import com.sun.source.tree.ImportTree; -import com.sun.source.tree.MemberSelectTree; import com.sun.source.tree.Tree; import com.sun.source.tree.Tree.Kind; import com.sun.source.util.TreePath; @@ -64,9 +62,6 @@ import java.util.logging.Level; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; -import javax.lang.model.element.Modifier; -import javax.lang.model.element.Name; -import javax.lang.model.element.TypeElement; import javax.swing.text.Position; import javax.swing.text.Position.Bias; import javax.tools.JavaFileObject; @@ -324,20 +319,6 @@ } throw new IllegalStateException("Cannot create PositionRef for file " + file.getPath() + ". CloneableEditorSupport not found"); } - - /**Constructs a TreePathHandle that corresponds to the given ElementHandle. - * - * @param handle an ElementHandle for which the TreePathHandle should be constructed - * @param cpInfo a classpath which is supposed to contain the element described by given the ElementHandle - * @return a newly constructed TreePathHandle - * @since 0.79 - */ - public static @NonNull TreePathHandle from(@NonNull ElementHandle handle, @NonNull ClasspathInfo cpInfo) { - Parameters.notNull("handle", handle); - Parameters.notNull("cpInfo", cpInfo); - - return new TreePathHandle(new ElementDelegate(handle, null, null, cpInfo)); - } @Override public String toString() { @@ -536,10 +517,6 @@ Element el = info.getTrees().getElement(tp); if (el == null) { Logger.getLogger(TreePathHandle.class.toString()).fine("info.getTrees().getElement(tp) returned null for " + tp); - Element staticallyImported = getStaticallyImportedElement(tp, info); - if (staticallyImported!=null) { - return staticallyImported; - } if (enclElIsCorrespondingEl) { Element e = enclosingElement.resolve(info); if (e == null) { @@ -553,54 +530,6 @@ return el; } } - - /** - * special handling of static imports - * see #196685 - * - */ - private Element getStaticallyImportedElement(TreePath treePath, CompilationInfo info) { - if (treePath.getLeaf().getKind() != Tree.Kind.MEMBER_SELECT) - return null; - - MemberSelectTree memberSelectTree = (MemberSelectTree) treePath.getLeaf(); - TreePath tp = treePath; - while (tp!=null) { - Kind treeKind = tp.getLeaf().getKind(); - if (treeKind == Tree.Kind.IMPORT) { - if (!((ImportTree) tp.getLeaf()).isStatic()) { - return null; - } - break; - } else if (treeKind == Tree.Kind.MEMBER_SELECT || treeKind == Tree.Kind.IDENTIFIER) { - tp = tp.getParentPath(); - continue; - } - return null; - } - - Name simpleName = memberSelectTree.getIdentifier(); - if (simpleName == null) { - return null; - } - TreePath declPath = new TreePath(new TreePath(treePath, memberSelectTree), memberSelectTree.getExpression()); - TypeElement decl = (TypeElement) info.getTrees().getElement(declPath); - if (decl==null) { - return null; - } - - for (Element e : info.getElements().getAllMembers((TypeElement) decl)) { - if (!e.getModifiers().contains(Modifier.STATIC)) { - continue; - } - if (!e.getSimpleName().equals(simpleName)) { - continue; - } - return e; - } - return null; - } - /** * Returns the {@link Tree.Kind} of this TreePathHandle, Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementHandle.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ElementHandle.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementHandle.java 2011-08-03 23:01:41.000000000 +0100 @@ -66,7 +66,6 @@ import org.netbeans.modules.java.source.ElementHandleAccessor; import org.netbeans.modules.java.source.usages.ClassFileUtil; import org.openide.util.Parameters; -import org.openide.util.WeakSet; /** * Represents a handle for {@link Element} which can be kept and later resolved @@ -370,8 +369,7 @@ return this.kind; } - private static final WeakSet> NORMALIZATION_CACHE = new WeakSet>(); - + /** * Factory method for creating {@link ElementHandle}. * @param element for which the {@link ElementHandle} should be created. Permitted @@ -384,12 +382,6 @@ * @throws IllegalArgumentException if the element is of an unsupported {@link ElementKind} */ public static @NonNull ElementHandle create (@NonNull final T element) throws IllegalArgumentException { - ElementHandle eh = createImpl(element); - - return (ElementHandle) NORMALIZATION_CACHE.putIfAbsent(eh); - } - - private static @NonNull ElementHandle createImpl (@NonNull final T element) throws IllegalArgumentException { Parameters.notNull("element", element); ElementKind kind = element.getKind(); String[] signatures; Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/AssignComments.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/AssignComments.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/AssignComments.java 2011-08-03 23:01:41.000000000 +0100 @@ -193,8 +193,6 @@ } private void attachComments(Tree tree, CommentsCollection result, CommentSet.RelativePosition position) { - if (!mapComments) return; - CommentSetImpl cs = commentService.getComments(tree); for (Token token : result) { attachComment(position, cs, token); Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreeMaker.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TreeMaker.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreeMaker.java 2011-08-03 23:01:41.000000000 +0100 @@ -460,7 +460,7 @@ } /** - * Creates new UnionTypeTree. + * Creates new DisjunctiveTypeTree. * * @param typeComponents components from which the DisjunctiveTypeTree should be created. * The components should either be {@link ExpressionTree} (qualified or unqualified identifier), @@ -468,8 +468,8 @@ * @return newly created DisjunctiveTypeTree * @since 0.70 */ - public UnionTypeTree UnionType(List typeComponents) { - return delegate.UnionType(typeComponents); + public DisjunctiveTypeTree DisjunctiveType(List typeComponents) { + return delegate.DisjunctiveType(typeComponents); } /** Creates a new DoWhileLoopTree. Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java 2011-08-03 23:01:41.000000000 +0100 @@ -174,7 +174,7 @@ final boolean allowAptRoots = true; //todo: Set by PROCESSOR_PATH != null this.cachedUserSrcClassPath = SourcePath.sources(srcCp, backgroundCompilation); this.cachedAptSrcClassPath = allowAptRoots ? SourcePath.apt(srcCp, backgroundCompilation) : null; - this.cachedSrcClassPath = this.cachedUserSrcClassPath; + this.cachedSrcClassPath = allowAptRoots ? ClassPathSupport.createProxyClassPath(this.cachedUserSrcClassPath,this.cachedAptSrcClassPath) : this.cachedUserSrcClassPath; this.outputClassPath = CacheClassPath.forSourcePath (this.cachedUserSrcClassPath); this.cachedSrcClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedSrcClassPath)); } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java 2011-08-03 23:01:41.000000000 +0100 @@ -240,14 +240,14 @@ } @Override - public Tree visitUnionType(UnionTypeTree node, Boolean p) { + public Tree visitDisjunctiveType(DisjunctiveTypeTree node, Boolean p) { List typeComponents = translateTree(node.getTypeAlternatives()); if (make == null) return node; if (typeComponents != node.getTypeAlternatives()) { - node = make.UnionType(typeComponents); + node = make.DisjunctiveType(typeComponents); } return node; } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementUtilities.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ElementUtilities.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementUtilities.java 2011-08-03 23:01:41.000000000 +0100 @@ -555,7 +555,6 @@ } } Types types = JavacTypes.instance(ctx); - com.sun.tools.javac.code.Types implTypes = com.sun.tools.javac.code.Types.instance(ctx); DeclaredType implType = (DeclaredType)impl.asType(); for (TypeMirror t : types.directSupertypes(element.asType())) { for (ExecutableElement ee : findUnimplementedMethods(impl, (TypeElement) ((DeclaredType) t).asElement())) { @@ -578,7 +577,8 @@ if (subType != null) { undef.remove(existing); MethodSymbol ms = ((MethodSymbol)existing).clone((Symbol)impl); - Type mt = implTypes.createMethodTypeWithReturn((MethodType)ms.type, (Type)subType); + MethodType mt = (MethodType)ms.type.clone(); + mt.restype = (Type)subType; ms.type = mt; undef.add(ms); } Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/SourceUtils.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/SourceUtils.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/SourceUtils.java 2011-08-03 23:01:41.000000000 +0100 @@ -82,7 +82,6 @@ import java.util.concurrent.Future; import java.util.logging.Level; import java.util.logging.Logger; -import javax.lang.model.util.ElementScanner6; import javax.swing.SwingUtilities; import org.netbeans.api.annotations.common.NonNull; @@ -749,32 +748,36 @@ try { final List> result = new LinkedList>(); js.runUserActionTask(new Task() { - @Override public void run(final CompilationController control) throws Exception { if (control.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED).compareTo (JavaSource.Phase.ELEMENTS_RESOLVED)>=0) { - final List types = new ArrayList(); - final ElementScanner6 visitor = new ElementScanner6() { - @Override - public Void visitType(TypeElement e, Void p) { - if (e.getEnclosingElement().getKind() == ElementKind.PACKAGE - || e.getModifiers().contains(Modifier.STATIC)) { - types.add(e); - return super.visitType(e, p); - } else { - return null; - } - } - }; - visitor.scan(control.getTopLevelElements(), null); - for (TypeElement type : types) { - for (ExecutableElement exec : ElementFilter.methodsIn(control.getElements().getAllMembers(type))) { - if (SourceUtils.isMainMethod(exec)) { - result.add (ElementHandle.create(type)); - } - } + new TreePathScanner () { + public @Override Void visitMethod(MethodTree node, Void p) { + ExecutableElement method = (ExecutableElement) control.getTrees().getElement(getCurrentPath()); + if (method != null && SourceUtils.isMainMethod(method) && isAccessible(method.getEnclosingElement())) { + result.add (ElementHandle.create((TypeElement)method.getEnclosingElement())); + } + return null; + } + }.scan(control.getCompilationUnit(), null); + } + } + + private boolean isAccessible (Element element) { + ElementKind kind = element.getKind(); + while (kind != ElementKind.PACKAGE) { + if (!kind.isClass() && !kind.isInterface()) { + return false; + } + Set modifiers = ((TypeElement)element).getModifiers(); + Element parent = element.getEnclosingElement(); + if (parent.getKind() != ElementKind.PACKAGE && !modifiers.contains(Modifier.STATIC)) { + return false; } + element = parent; + kind = element.getKind(); } - } + return true; + } }, true); return result; Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java 2011-08-03 23:01:41.000000000 +0100 @@ -95,10 +95,12 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; import javax.lang.model.type.WildcardType; +import javax.lang.model.util.TypeKindVisitor7; import javax.lang.model.util.Types; import javax.swing.text.Document; import org.netbeans.api.java.lexer.JavaTokenId; +import org.netbeans.api.java.queries.SourceLevelQuery; import org.netbeans.api.lexer.TokenSequence; import org.netbeans.editor.GuardedDocument; import org.netbeans.modules.java.source.builder.CommentHandlerService; @@ -107,6 +109,7 @@ import org.netbeans.modules.java.source.query.CommentSet.RelativePosition; import org.openide.cookies.EditorCookie; import org.openide.loaders.DataObject; +import org.openide.modules.SpecificationVersion; import org.openide.util.Exceptions; /** @@ -355,15 +358,10 @@ TreeMaker make = copy.getTreeMaker(); Set mods = EnumSet.of(clazz.getKind() == ElementKind.ENUM ? Modifier.PRIVATE : Modifier.PUBLIC); List parameters = new ArrayList(); - LinkedList statements = new LinkedList(); + List statements = new ArrayList(); ModifiersTree parameterModifiers = make.Modifiers(EnumSet.noneOf(Modifier.class)); List throwsList = new LinkedList(); List typeParams = new LinkedList(); - for (VariableElement ve : fields) { - TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), ve); - parameters.add(make.Variable(parameterModifiers, ve.getSimpleName(), make.Type(type), null)); - statements.add(make.ExpressionStatement(make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName())))); //NOI18N - } if (constructor != null) { ExecutableType constructorType = clazz.getSuperclass().getKind() == TypeKind.DECLARED ? (ExecutableType) copy.getTypes().asMemberOf((DeclaredType) clazz.getSuperclass(), constructor) : null; if (!constructor.getParameters().isEmpty()) { @@ -378,7 +376,7 @@ parameters.add(make.Variable(parameterModifiers, simpleName, make.Type(type), null)); arguments.add(make.Identifier(simpleName)); } - statements.addFirst(make.ExpressionStatement(make.MethodInvocation(Collections.emptyList(), make.Identifier("super"), arguments))); //NOI18N + statements.add(make.ExpressionStatement(make.MethodInvocation(Collections.emptyList(), make.Identifier("super"), arguments))); //NOI18N } constructorType = constructorType != null ? constructorType : (ExecutableType) constructor.asType(); for (TypeMirror th : constructorType.getThrownTypes()) { @@ -392,8 +390,13 @@ typeParams.add(make.TypeParameter(typeParameterElement.getSimpleName(), boundsList)); } } + for (VariableElement ve : fields) { + TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), ve); + parameters.add(make.Variable(parameterModifiers, ve.getSimpleName(), make.Type(type), null)); + statements.add(make.ExpressionStatement(make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName())))); //NOI18N + } BlockTree body = make.Block(statements, false); - return make.Method(make.Modifiers(mods), "", null, typeParams, parameters, throwsList, body, null, constructor!= null ? constructor.isVarArgs() : false); //NOI18N + return make.Method(make.Modifiers(mods), "", null, typeParams, parameters, throwsList, body, null); //NOI18N } /** @@ -532,7 +535,7 @@ static T importComments(CompilationInfo info, T original, CompilationUnitTree cut) { try { - JCTree.JCCompilationUnit unit = (JCCompilationUnit) cut; + JCTree.JCCompilationUnit unit = (JCCompilationUnit) cut; TokenSequence seq = ((SourceFileObject) unit.getSourceFile()).getTokenHierarchy().tokenSequence(JavaTokenId.language()); TreePath tp = TreePath.getPath(cut, original); Tree toMap = (tp != null && original.getKind() != Kind.COMPILATION_UNIT) ? tp.getParentPath().getLeaf() : original; Index: netbeans-7.0.1+dfsg1/java.source/nbproject/project.properties =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/project.properties 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/nbproject/project.properties 2011-08-03 23:08:30.651929442 +0100 @@ -46,7 +46,7 @@ javadoc.title=Java Source javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=0.80.1 +spec.version.base=0.79.2 test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\ ${o.n.core.dir}/lib/boot.jar:\ @@ -132,8 +132,7 @@ org/netbeans/api/java/source/gen/BlockTest.class,\ org/netbeans/api/java/source/gen/ImportAnalysisTest.class,\ org/netbeans/api/java/source/gen/ImportAnalysis2Test.class,\ - org/netbeans/modules/java/source/save/DiffFacilityTest.class,\ - org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.class + org/netbeans/modules/java/source/save/DiffFacilityTest.class test.config.jet-main.includes=${test.config.generator.includes},\ org/netbeans/api/java/source/TypeUtilitiesTest.class,\ Index: netbeans-7.0.1+dfsg1/java.source/nbproject/project.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/project.xml 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/nbproject/project.xml 2011-08-03 23:01:41.000000000 +0100 @@ -55,7 +55,7 @@ 1 - 1.9.1 + 1.0 @@ -64,7 +64,7 @@ 1 - 1.33.1 + 1.28 @@ -73,7 +73,7 @@ 1 - 1.29.1 + 1.0 @@ -89,7 +89,7 @@ - 7.6.1.3 + 7.0 @@ -107,7 +107,7 @@ 3 - 3.2.1 + 3.0 @@ -124,7 +124,7 @@ 1 - 1.12.1 + 1.0 @@ -133,7 +133,7 @@ 2 - 1.24.1 + 1.11 @@ -142,7 +142,7 @@ 0-1 - 1.5.1 + 1.0 @@ -151,7 +151,7 @@ 3 - 3.9.1.13.10 + 3.1 @@ -160,7 +160,7 @@ 1 - 1.43.1.10 + 1.11 @@ -169,7 +169,7 @@ 1 - 1.22.1 + 1.7 @@ -178,7 +178,7 @@ 1 - 1.36.1 + 1.18 @@ -187,7 +187,7 @@ 1 - 1.42.1 + 1.22 @@ -196,7 +196,7 @@ 1 - 1.14.1 + 1.0 @@ -205,7 +205,7 @@ 1 - 1.21.1 + 1.8 @@ -213,7 +213,7 @@ - 1.18.1.1 + 1.14 @@ -222,7 +222,7 @@ 2 - 1.39.1.1 + 1.25 @@ -231,7 +231,7 @@ 1 - 1.22.1 + 1.5 @@ -240,7 +240,7 @@ 1 - 1.25.1 + 1.20 @@ -257,7 +257,7 @@ - 1.5.1 + 1.2 @@ -266,7 +266,7 @@ 1 - 1.36.1 + 1.13 @@ -275,7 +275,7 @@ 1 - 1.51.1.8 + 1.30 @@ -284,7 +284,7 @@ 1 - 1.23.1 + 1.9 @@ -292,7 +292,7 @@ - 1.16.1 + 1.2 @@ -301,7 +301,7 @@ 1 - 1.15.1.1 + 1.0 @@ -309,7 +309,7 @@ - 7.31.1 + 6.2 @@ -317,7 +317,7 @@ - 7.20.1 + 7.8 @@ -325,7 +325,7 @@ - 7.47.1 + 7.19 @@ -333,7 +333,7 @@ - 7.21.1 + 7.0 @@ -341,7 +341,7 @@ - 7.23.1 + 7.9 @@ -349,7 +349,7 @@ - 7.21.1 + 6.2 @@ -357,7 +357,7 @@ - 6.37.1 + 6.26 @@ -365,7 +365,7 @@ - 8.15.1 + 8.4 @@ -373,7 +373,7 @@ - 8.8.1 + 8.0 @@ -381,7 +381,7 @@ - 6.40.1 + 6.2 @@ -424,7 +424,6 @@ org.netbeans.modules.java.editor - Index: netbeans-7.0.1+dfsg1/java.source/nbproject/org-netbeans-modules-java-source.sig =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/org-netbeans-modules-java-source.sig 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/nbproject/org-netbeans-modules-java-source.sig 2011-08-03 23:01:41.000000000 +0100 @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 0.76.1 +#Version 0.60.0 CLSS public abstract interface com.sun.source.tree.TreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object> meth public abstract {com.sun.source.tree.TreeVisitor%0} visitAnnotation(com.sun.source.tree.AnnotationTree,{com.sun.source.tree.TreeVisitor%1}) @@ -377,14 +377,12 @@ meth public boolean alignMultilineAssignment() meth public boolean alignMultilineBinaryOp() meth public boolean alignMultilineCallArgs() -meth public boolean alignMultilineDisjunctiveCatchTypes() meth public boolean alignMultilineFor() meth public boolean alignMultilineImplements() meth public boolean alignMultilineMethodParams() meth public boolean alignMultilineParenthesized() meth public boolean alignMultilineTernaryOp() meth public boolean alignMultilineThrows() -meth public boolean alignMultilineTryResources() meth public boolean expandTabToSpaces() meth public boolean indentCasesFromSwitch() meth public boolean indentTopLevelClassMembers() @@ -432,7 +430,6 @@ meth public boolean spaceBeforeSynchronizedLeftBrace() meth public boolean spaceBeforeSynchronizedParen() meth public boolean spaceBeforeTryLeftBrace() -meth public boolean spaceBeforeTryParen() meth public boolean spaceBeforeWhile() meth public boolean spaceBeforeWhileLeftBrace() meth public boolean spaceBeforeWhileParen() @@ -447,7 +444,6 @@ meth public boolean spaceWithinParens() meth public boolean spaceWithinSwitchParens() meth public boolean spaceWithinSynchronizedParens() -meth public boolean spaceWithinTryParens() meth public boolean spaceWithinTypeCastParens() meth public boolean spaceWithinWhileParens() meth public boolean specialElseIf() @@ -497,7 +493,6 @@ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapAssignOps() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapBinaryOps() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapChainedMethodCalls() -meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapDisjunctiveCatchTypes() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapDoWhileStatement() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapEnumConstants() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapExtendsImplementsKeyword() @@ -510,7 +505,6 @@ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapTernaryOps() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapThrowsKeyword() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapThrowsList() -meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapTryResources() meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapWhileStatement() meth public static org.netbeans.api.java.source.CodeStyle getDefault(javax.swing.text.Document) meth public static org.netbeans.api.java.source.CodeStyle getDefault(org.netbeans.api.project.Project) @@ -801,7 +795,7 @@ meth protected final void fileObjectsChanged() meth protected final void reschedule(org.openide.filesystems.FileObject) supr java.lang.Object -hfds ACCESSOR2,BEFORE_ADDING_REMOVING_TASKS,FILEOBJECTS_COMPUTATION,LOG,SYNCHRONOUS_EVENTS,WORKER,file2JS,file2Task,filesLock,phase,priority +hfds ACCESSOR2,BEFORE_ADDING_REMOVING_TASKS,FILEOBJECTS_COMPUTATION,LOG,SYNCHRONOUS_EVENTS,WORKER,file2JS,file2Task,phase,priority hcls Accessor2 CLSS public final org.netbeans.api.java.source.ModificationResult @@ -825,7 +819,7 @@ meth public void commit() throws java.io.IOException supr java.lang.Object hfds committed,diffs,sources,tag2Span -hcls CreateChange,FilteringReader,FilteringWriter +hcls CreateChange CLSS public static org.netbeans.api.java.source.ModificationResult$Difference outer org.netbeans.api.java.source.ModificationResult @@ -874,7 +868,6 @@ CLSS public org.netbeans.api.java.source.SourceUtils meth public static boolean checkTypesAssignable(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror) meth public static boolean isMainClass(java.lang.String,org.netbeans.api.java.source.ClasspathInfo) -meth public static boolean isMainClass(java.lang.String,org.netbeans.api.java.source.ClasspathInfo,boolean) meth public static boolean isMainMethod(javax.lang.model.element.ExecutableElement) meth public static boolean isScanInProgress() meth public static java.lang.String resolveImport(org.netbeans.api.java.source.CompilationInfo,com.sun.source.util.TreePath,java.lang.String) throws java.io.IOException @@ -893,8 +886,7 @@ meth public static org.openide.filesystems.FileObject getFile(org.netbeans.api.java.source.ElementHandle,org.netbeans.api.java.source.ClasspathInfo) meth public static void waitScanFinished() throws java.lang.InterruptedException supr java.lang.Object -hfds LOG,MAX_LEN,VOWELS -hcls CaseInsensitiveMatch,CaseSensitiveMatch,Match +hfds LOG,MAX_LEN,PACKAGE_SUMMARY,VOWELS CLSS public abstract interface org.netbeans.api.java.source.Task<%0 extends java.lang.Object> meth public abstract void run({org.netbeans.api.java.source.Task%0}) throws java.lang.Exception @@ -943,21 +935,15 @@ meth public com.sun.source.tree.ClassTree removeClassTypeParameter(com.sun.source.tree.ClassTree,int) meth public com.sun.source.tree.ClassTree setExtends(com.sun.source.tree.ClassTree,com.sun.source.tree.ExpressionTree) meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(com.sun.source.tree.ExpressionTree,java.util.List,java.util.List,javax.tools.JavaFileObject) -meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(java.util.List,com.sun.source.tree.ExpressionTree,java.util.List,java.util.List,javax.tools.JavaFileObject) -meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(java.util.List,org.openide.filesystems.FileObject,java.lang.String,java.util.List,java.util.List) meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(org.openide.filesystems.FileObject,java.lang.String,java.util.List,java.util.List) meth public com.sun.source.tree.CompilationUnitTree addCompUnitImport(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.ImportTree) meth public com.sun.source.tree.CompilationUnitTree addCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.Tree) -meth public com.sun.source.tree.CompilationUnitTree addPackageAnnotation(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.AnnotationTree) meth public com.sun.source.tree.CompilationUnitTree insertCompUnitImport(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.ImportTree) meth public com.sun.source.tree.CompilationUnitTree insertCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.Tree) -meth public com.sun.source.tree.CompilationUnitTree insertPackageAnnotation(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.AnnotationTree) meth public com.sun.source.tree.CompilationUnitTree removeCompUnitImport(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.ImportTree) meth public com.sun.source.tree.CompilationUnitTree removeCompUnitImport(com.sun.source.tree.CompilationUnitTree,int) meth public com.sun.source.tree.CompilationUnitTree removeCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.Tree) meth public com.sun.source.tree.CompilationUnitTree removeCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,int) -meth public com.sun.source.tree.CompilationUnitTree removePackageAnnotation(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.AnnotationTree) -meth public com.sun.source.tree.CompilationUnitTree removePackageAnnotation(com.sun.source.tree.CompilationUnitTree,int) meth public com.sun.source.tree.CompoundAssignmentTree CompoundAssignment(com.sun.source.tree.Tree$Kind,com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree) meth public com.sun.source.tree.ConditionalExpressionTree ConditionalExpression(com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree) meth public com.sun.source.tree.ContinueTree Continue(java.lang.CharSequence) @@ -966,9 +952,6 @@ meth public com.sun.source.tree.EnhancedForLoopTree EnhancedForLoop(com.sun.source.tree.VariableTree,com.sun.source.tree.ExpressionTree,com.sun.source.tree.StatementTree) meth public com.sun.source.tree.ErroneousTree Erroneous(java.util.List) meth public com.sun.source.tree.ExpressionStatementTree ExpressionStatement(com.sun.source.tree.ExpressionTree) -meth public com.sun.source.tree.ExpressionTree QualIdent(java.lang.String) - anno 0 org.netbeans.api.annotations.common.NonNull() - anno 1 org.netbeans.api.annotations.common.NonNull() meth public com.sun.source.tree.ExpressionTree QualIdent(javax.lang.model.element.Element) anno 0 org.netbeans.api.annotations.common.NonNull() anno 1 org.netbeans.api.annotations.common.NonNull() @@ -1062,14 +1045,10 @@ meth public com.sun.source.tree.SwitchTree removeSwitchCase(com.sun.source.tree.SwitchTree,int) meth public com.sun.source.tree.SynchronizedTree Synchronized(com.sun.source.tree.ExpressionTree,com.sun.source.tree.BlockTree) meth public com.sun.source.tree.ThrowTree Throw(com.sun.source.tree.ExpressionTree) -meth public com.sun.source.tree.Tree Type(java.lang.String) - anno 0 org.netbeans.api.annotations.common.NonNull() - anno 1 org.netbeans.api.annotations.common.NonNull() meth public com.sun.source.tree.Tree Type(javax.lang.model.type.TypeMirror) anno 0 org.netbeans.api.annotations.common.NonNull() anno 1 org.netbeans.api.annotations.common.NonNull() meth public com.sun.source.tree.TryTree Try(com.sun.source.tree.BlockTree,java.util.List,com.sun.source.tree.BlockTree) -meth public com.sun.source.tree.TryTree Try(java.util.List,com.sun.source.tree.BlockTree,java.util.List,com.sun.source.tree.BlockTree) meth public com.sun.source.tree.TryTree addTryCatch(com.sun.source.tree.TryTree,com.sun.source.tree.CatchTree) meth public com.sun.source.tree.TryTree insertTryCatch(com.sun.source.tree.TryTree,int,com.sun.source.tree.CatchTree) meth public com.sun.source.tree.TryTree removeTryCatch(com.sun.source.tree.TryTree,com.sun.source.tree.CatchTree) @@ -1108,17 +1087,12 @@ hcls CountingDelegate,Delegate,ElementDelegate,EmptyDelegate,TreeDelegate CLSS public final org.netbeans.api.java.source.TreeUtilities -fld public final static java.util.Set CLASS_TREE_KINDS meth public boolean isAccessible(com.sun.source.tree.Scope,javax.lang.model.element.Element,javax.lang.model.type.TypeMirror) meth public boolean isAnnotation(com.sun.source.tree.ClassTree) - anno 0 java.lang.Deprecated() meth public boolean isClass(com.sun.source.tree.ClassTree) - anno 0 java.lang.Deprecated() meth public boolean isEnum(com.sun.source.tree.ClassTree) - anno 0 java.lang.Deprecated() meth public boolean isEnumConstant(com.sun.source.tree.VariableTree) meth public boolean isInterface(com.sun.source.tree.ClassTree) - anno 0 java.lang.Deprecated() meth public boolean isStaticContext(com.sun.source.tree.Scope) meth public boolean isSynthetic(com.sun.source.util.TreePath) meth public com.sun.source.tree.BlockTree parseStaticBlock(java.lang.String,com.sun.source.util.SourcePositions[]) @@ -1129,10 +1103,6 @@ meth public com.sun.source.tree.Scope scopeFor(int) meth public com.sun.source.tree.StatementTree getBreakContinueTarget(com.sun.source.util.TreePath) meth public com.sun.source.tree.StatementTree parseStatement(java.lang.String,com.sun.source.util.SourcePositions[]) -meth public com.sun.source.tree.Tree translate(com.sun.source.tree.Tree,java.util.Map) - anno 0 org.netbeans.api.annotations.common.NonNull() - anno 1 org.netbeans.api.annotations.common.NonNull() - anno 2 org.netbeans.api.annotations.common.NonNull() meth public com.sun.source.util.TreePath pathFor(com.sun.source.util.TreePath,int) meth public com.sun.source.util.TreePath pathFor(com.sun.source.util.TreePath,int,com.sun.source.util.SourcePositions) meth public com.sun.source.util.TreePath pathFor(int) @@ -1155,7 +1125,7 @@ meth public org.netbeans.api.lexer.TokenSequence tokensFor(com.sun.source.tree.Tree,com.sun.source.util.SourcePositions) supr java.lang.Object hfds ESCAPE_ENCODE,ESCAPE_UNENCODE,EXOTIC_ESCAPE,handler,info -hcls NoImports,UncaughtExceptionsVisitor,UnrelatedTypeMirrorSet +hcls UncaughtExceptionsVisitor,UnrelatedTypeMirrorSet CLSS public final org.netbeans.api.java.source.TypeMirrorHandle<%0 extends javax.lang.model.type.TypeMirror> meth public javax.lang.model.type.TypeKind getKind() @@ -1170,25 +1140,10 @@ hcls PlaceholderType,Visitor CLSS public final org.netbeans.api.java.source.TypeUtilities -innr public final static !enum TypeNameOptions -meth public !varargs java.lang.CharSequence getTypeName(javax.lang.model.type.TypeMirror,org.netbeans.api.java.source.TypeUtilities$TypeNameOptions[]) - anno 0 org.netbeans.api.annotations.common.CheckReturnValue() - anno 0 org.netbeans.api.annotations.common.NonNull() - anno 1 org.netbeans.api.annotations.common.NullAllowed() - anno 2 org.netbeans.api.annotations.common.NonNull() meth public boolean isCastable(javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror) meth public javax.lang.model.type.TypeMirror substitute(javax.lang.model.type.TypeMirror,java.util.List,java.util.List) supr java.lang.Object -hfds CAPTURED_WILDCARD,UNKNOWN,info -hcls TypeNameVisitor - -CLSS public final static !enum org.netbeans.api.java.source.TypeUtilities$TypeNameOptions - outer org.netbeans.api.java.source.TypeUtilities -fld public final static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions PRINT_AS_VARARG -fld public final static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions PRINT_FQN -meth public static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions valueOf(java.lang.String) -meth public static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions[] values() -supr java.lang.Enum +hfds info CLSS public final org.netbeans.api.java.source.TypesEvent meth public java.lang.Iterable> getTypes() @@ -1251,7 +1206,7 @@ anno 1 org.netbeans.api.annotations.common.NonNull() anno 2 org.netbeans.api.annotations.common.NonNull() supr org.netbeans.api.java.source.CompilationController -hfds REWRITE_WHOLE_FILE,afterCommit,changes,externalChanges,instance,overlay,textualChanges,tree2Tag,treeMaker,userInfo +hfds REWRITE_WHOLE_FILE,afterCommit,changes,externalChanges,instance,textualChanges,tree2Tag,treeMaker,userInfo hcls Rewriter,Translator CLSS public org.netbeans.api.java.source.support.CancellableTreePathScanner<%0 extends java.lang.Object, %1 extends java.lang.Object> Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -244,16 +244,6 @@ "package t;\n@Deprecated\npublic class T {\n}\n"); } - public void testNewLineIndentationAfterSimpleAnnotationInsideEmptyClass() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n @Deprecated|\n}\n", - "package t;\npublic class T {\n @Deprecated\n \n}\n"); - } - - public void testLineIndentationAfterSimpleAnnotationInsideEmptyClass() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n @Deprecated\n|\n}\n", - "package t;\npublic class T {\n @Deprecated\n \n}\n"); - } - public void testNewLineIndentationAfterField() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public int i;|\n}\n", "package t;\npublic class T {\n public int i;\n \n}\n"); @@ -702,26 +692,6 @@ } } - public void testNewLineIndentationBeforeWhileInDoWhile() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n do {\n }| while (check());\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n do {\n }\n while (check());\n }\n}\n"); - } - - public void testLineIndentationBeforeWhileInDoWhile() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n do {\n }\n| while (check());\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n do {\n }\n while (check());\n }\n}\n"); - } - - public void testNewLineIndentationBeforeWhileOnNewLineInDoWhile() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n do {\n }|\n while (check());\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n do {\n }\n \n while (check());\n }\n}\n"); - } - - public void testLineIndentationBeforeWhileOnNewLineInDoWhile() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n do {\n }\n|\n while (check());\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n do {\n }\n \n while (check());\n }\n}\n"); - } - public void testNewLineIndentationInsideDoWhileCond() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n do {\n } while (check()|);\n }\n}\n", "package t;\npublic class T {\n public void op() {\n do {\n } while (check()\n );\n }\n}\n"); @@ -918,26 +888,6 @@ "package t;\npublic class T {\n public void op() {\n if (true) {\n }\n else {\n }\n }\n}\n"); } - public void testNewLineIndentationBeforeElseOnNewLine() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n if (true) {\n }|\n else {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n if (true) {\n }\n \n else {\n }\n }\n}\n"); - } - - public void testLineIndentationBeforeElseOnNewLine() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n if (true) {\n }\n|\n else {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n if (true) {\n }\n \n else {\n }\n }\n}\n"); - } - - public void testNewLineIndentationAfterStatementBeforeElseOnNewLine() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n if (true)\n System.out.println();|\n else {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n if (true)\n System.out.println();\n \n else {\n }\n }\n}\n"); - } - - public void testLineIndentationAfterStatementBeforeElseOnNewLine() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n if (true)\n System.out.println();\n|\n else {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n if (true)\n System.out.println();\n \n else {\n }\n }\n}\n"); - } - public void testNewLineIndentationBeforeElseStmt() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n if (true) {\n } else|\n }\n}\n", "package t;\npublic class T {\n public void op() {\n if (true) {\n } else\n \n }\n}\n"); @@ -1104,16 +1054,6 @@ "package t;\npublic class T {\n public void op() {\n try {\n }\n catch (Exception e) {\n }\n }\n}\n"); } - public void testNewLineIndentationBeforeCatchOnNewLine() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n try {\n }|\n catch (Exception e) {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n try {\n }\n \n catch (Exception e) {\n }\n }\n}\n"); - } - - public void testLineIndentationBeforeCatchOnNewLine() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n try {\n }\n|\n catch (Exception e) {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n try {\n }\n \n catch (Exception e) {\n }\n }\n}\n"); - } - public void testNewLineIndentationBeforeCatchBlock() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n try {\n } catch (Exception e)| {\n }\n }\n}\n", "package t;\npublic class T {\n public void op() {\n try {\n } catch (Exception e)\n {\n }\n }\n}\n"); @@ -1156,16 +1096,6 @@ "package t;\npublic class T {\n public void op() {\n try {\n }\n finally {\n }\n }\n}\n"); } - public void testNewLineIndentationBeforeFinallyOnNewLine() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n try {\n }|\n finally {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n try {\n }\n \n finally {\n }\n }\n}\n"); - } - - public void testLineIndentationBeforeFinallyOnNewLine() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n try {\n }\n|\n finally {\n }\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n try {\n }\n \n finally {\n }\n }\n}\n"); - } - public void testNewLineIndentationBeforeFinallyBlock() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n try {\n } finally| {\n }\n }\n}\n", "package t;\npublic class T {\n public void op() {\n try {\n } finally\n {\n }\n }\n}\n"); @@ -1436,38 +1366,6 @@ } } - public void testNewLineIndentationBeforeNewArrayInit() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n int[] arr = new int[]| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n int[] arr = new int[]\n {\n }\n}\n"); - } - - public void testLineIndentationBeforeNewArrayInit() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n int[] arr = new int[]\n| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n int[] arr = new int[]\n {\n }\n}\n"); - } - - public void testNewLineIndentationBeforeHalfIndentedNewArrayInit() throws Exception { - Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class); - preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name()); - try { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n int[] arr = new int[]| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n int[] arr = new int[]\n {\n }\n}\n"); - } finally { - preferences.remove("otherBracePlacement"); - } - } - - public void testLineIndentationBeforeHalfIndentedNewArrayInit() throws Exception { - Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class); - preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name()); - try { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n int[] arr = new int[]\n| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n int[] arr = new int[]\n {\n }\n}\n"); - } finally { - preferences.remove("otherBracePlacement"); - } - } - public void testNewLineIndentationIndideEmptyArrayInit() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n int[] arr = {|\n }\n}\n", "package t;\npublic class T {\n public void op() {\n int[] arr = {\n \n }\n}\n"); @@ -1540,38 +1438,6 @@ } } - public void testNewLineIndentationBeforeNewClassTreeBody() throws Exception { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()\n {\n }\n}\n"); - } - - public void testLineIndentationBeforeNewClassTreeBody() throws Exception { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()\n| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()\n {\n }\n}\n"); - } - - public void testNewLineIndentationBeforeHalfIndentedNewClassTreeBody() throws Exception { - Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class); - preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name()); - try { - performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()\n {\n }\n}\n"); - } finally { - preferences.remove("otherBracePlacement"); - } - } - - public void testLineIndentationBeforeHalfIndentedNewClassTreeBody() throws Exception { - Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class); - preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name()); - try { - performLineIndentationTest("package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()\n| {\n }\n}\n", - "package t;\npublic class T {\n public void op() {\n Runnable r = new Runnable()\n {\n }\n}\n"); - } finally { - preferences.remove("otherBracePlacement"); - } - } - public void testNewLineIndentationAfterLineComment() throws Exception { performNewLineIndentationTest("package t;\npublic class T {\n public void op() {\n System.out.println(); // Comment|\n }\n}\n", "package t;\npublic class T {\n public void op() {\n System.out.println(); // Comment\n \n }\n}\n"); Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -43,11 +43,7 @@ package org.netbeans.modules.java.source.parsing; import java.io.File; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; import javax.lang.model.element.TypeElement; -import javax.tools.Diagnostic; import org.netbeans.api.java.source.ClasspathInfo; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.JavaSource; @@ -56,7 +52,6 @@ import org.netbeans.api.java.source.Task; import org.netbeans.api.java.source.TestUtilities; import org.netbeans.junit.NbTestCase; -import org.netbeans.modules.java.source.tasklist.CompilerSettings; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; @@ -102,31 +97,6 @@ }, true); } - public void test199332() throws Exception { - CompilerSettings.getNode().putBoolean(CompilerSettings.ENABLE_LINT, true); - CompilerSettings.getNode().putBoolean(CompilerSettings.ENABLE_LINT_SERIAL, true); - - FileObject f2 = createFile("test/Test2.java", "package test; class Test2 implements Runnable, java.io.Serializable {}"); - JavaSource js = JavaSource.forFileObject(f2); - - SourceUtilsTestUtil.compileRecursively(sourceRoot); - - js.runUserActionTask(new Task() { - public void run(CompilationController parameter) throws Exception { - assertTrue(Phase.RESOLVED.compareTo(parameter.toPhase(Phase.RESOLVED)) <= 0); - assertEquals(parameter.getDiagnostics().toString(), 2, parameter.getDiagnostics().size()); - - Set codes = new HashSet(); - - for (Diagnostic d : parameter.getDiagnostics()) { - codes.add(d.getCode()); - } - - assertEquals(new HashSet(Arrays.asList("compiler.warn.missing.SVUID", "compiler.err.does.not.override.abstract")), codes); - } - }, true); - } - private FileObject createFile(String path, String content) throws Exception { FileObject file = FileUtil.createData(sourceRoot, path); TestUtilities.copyStringToFile(file, content); Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -90,20 +90,20 @@ public void testRegularGetCharContent () throws Exception { final File wd = this.getWorkDir(); final File testFile = createTestFile (wd); - JavaFileObject jfo = FileObjects.fileFileObject(testFile, wd, null, null); + JavaFileObject jfo = FileObjects.fileFileObject(testFile, wd, null); CharSequence content = jfo.getCharContent(true); String expectedData = DATA+"\n"; assertTrue (expectedData.contentEquals(content)); Filter f = new Filter (null); - jfo = FileObjects.fileFileObject(testFile, wd, f, null); + jfo = FileObjects.fileFileObject(testFile, wd, f); content = jfo.getCharContent(true); expectedData = DATA+"\n"; assertTrue (expectedData.contentEquals(content)); assertEquals(EnumSet.of(Call.READER), f.calls); f = new Filter (PAD); - jfo = FileObjects.fileFileObject(testFile, wd, f, null); + jfo = FileObjects.fileFileObject(testFile, wd, f); content = jfo.getCharContent(true); expectedData = PAD + DATA+"\n"; assertTrue (expectedData.contentEquals(content)); Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java 2011-08-03 23:01:41.000000000 +0100 @@ -50,12 +50,15 @@ import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Set; import javax.tools.JavaFileObject; import org.netbeans.api.java.classpath.ClassPath; import org.netbeans.modules.java.source.TestUtil; import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation; +import org.netbeans.modules.java.source.util.Factory; /** Class which takes a folder and behaves like an archive should behave. * It does not apply any optimalizations. However it is good for comparing @@ -124,7 +127,7 @@ for( File f : files ) { if ( !f.isDirectory() ) { - entries.add( FileObjects.fileFileObject (f, rootFolder, null, null)); + entries.add( FileObjects.fileFileObject (f, rootFolder, null)); } } Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -44,10 +44,8 @@ package org.netbeans.api.java.source; -import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; -import java.io.OutputStream; import java.net.URL; import java.util.Arrays; import java.util.Collections; @@ -70,12 +68,9 @@ import org.netbeans.junit.NbTestCase; import org.netbeans.modules.java.source.ElementHandleAccessor; import org.netbeans.modules.java.source.TestUtil; -import org.netbeans.modules.java.source.usages.ClassIndexManager; import org.netbeans.modules.java.source.usages.ClasspathInfoAccessor; -import org.netbeans.modules.parsing.impl.indexing.CacheFolder; import org.netbeans.spi.java.classpath.support.ClassPathSupport; import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation; -import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; @@ -100,7 +95,41 @@ clearWorkDir(); SourceUtilsTestUtil.prepareTest(new String[0], new Object[] {SFBQImpl.getDefault()}); } + + private void prepareTest() throws Exception { + File work = getWorkDir(); + FileObject workFO = FileUtil.toFileObject(work); + + assertNotNull(workFO); + + FileObject sourceRoot = workFO.createFolder("src"); + FileObject buildRoot = workFO.createFolder("build"); + FileObject cache = workFO.createFolder("cache"); + FileObject packageRoot = sourceRoot.createFolder("sourceutils"); + + SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache); + + String capitalizedName = "T" + getName().substring(1); + + TestUtil.copyFiles(FileUtil.toFile(sourceRoot), "sourceutils/" + capitalizedName + ".java"); + + packageRoot.refresh(); + + FileObject testSource = packageRoot.getFileObject(capitalizedName + ".java"); + + assertNotNull(testSource); + + SourceUtilsTestUtil.compileRecursively(sourceRoot); + + js = JavaSource.forFileObject(testSource); + + assertNotNull(js); + info = SourceUtilsTestUtil.getCompilationInfo(js, JavaSource.Phase.RESOLVED); + + assertNotNull(info); + } + public void testGetEnclosingTypeElement() throws Exception { //only a scatch of the test, add testcases as needed: prepareTest(); @@ -287,15 +316,69 @@ assertEquals (new URL[] {url1, url3, url5}, result); } - + + private void assertEquals (URL[] expected, Set result) { + assertEquals (expected.length,result.size()); + for (URL eurl : expected) { + assertTrue (result.remove(eurl)); + } + assertTrue(result.isEmpty()); + } + + private E findElementBySimpleName(String simpleName, List elements) { + for (E e : elements) { + if (simpleName.contentEquals(e.getSimpleName())) + return e; + } + + fail("Not found element with simple name: " + simpleName); + + throw new Error("Should never be here!"); + } + + public void testGetFQNsForSimpleName() throws Exception { +// The method was removed, +// tzezula: I am going to create an replacement using lucene +// prepareTest(); +// +// List fqnTEs; +// List fqns; +// +// fqnTEs = SourceUtils.getFQNsForSimpleNamePrefix(info, "List", true); +// fqns = new ArrayList(); +// +// for (TypeElement te : fqnTEs) { +// fqns.add(te.getQualifiedName().toString()); +// } +// +// assertTrue(fqns.remove("java.util.List")); +// assertTrue(fqns.remove("java.awt.List")); +// +// //JDK16 specific: +// fqns.remove("com.sun.xml.bind.v2.schemagen.xmlschema.List"); +// +// assertEquals(fqns.toString(), 0, fqns.size()); +// +// fqnTEs = SourceUtils.getFQNsForSimpleNamePrefix(info, "File", true); +// fqns = new ArrayList(); +// +// for (TypeElement te : fqnTEs) { +// fqns.add(te.getQualifiedName().toString()); +// } +// +// assertTrue(fqns.remove("java.io.File")); +// +// assertEquals(fqns.toString(), 0, fqns.size()); + + //XXX: onlyExact + } + + public void testGetFile () throws Exception { File workDir = getWorkDir(); FileObject workFo = FileUtil.toFileObject(workDir); assertNotNull (workFo); FileObject src = workFo.createFolder("src"); - FileObject userDir = workFo.createFolder("ud"); - CacheFolder.setCacheFolder(userDir); - ClassIndexManager.getDefault().createUsagesQuery(src.getURL(), true); FileObject srcInDefPkg = src.createData("Foo","java"); assertNotNull(srcInDefPkg); FileObject sourceFile = src.createFolder("org").createFolder("me").createData("Test", "java"); @@ -326,156 +409,6 @@ result = SourceUtils.getFile(handle,cpInfo); assertNotNull(result); } - - public void testGetMainClasses() throws Exception { - final File wd = getWorkDir(); - final FileObject src = FileUtil.createFolder(new File (wd,"src")); - final FileObject userDir = FileUtil.createFolder(new File (wd,"ud")); - CacheFolder.setCacheFolder(userDir); - final FileObject emptyClass = createFile(src, "C1.java","class C1 {}"); - assertEquals(0, SourceUtils.getMainClasses(emptyClass).size()); - final FileObject classWithMethod = createFile(src, "C2.java","class C2 { public static void test (String... args){} }"); - assertEquals(0, SourceUtils.getMainClasses(classWithMethod).size()); - final FileObject classWithMethod2 = createFile(src, "C3.java","class C3 { static void main (String... args){} }"); - assertEquals(0, SourceUtils.getMainClasses(classWithMethod2).size()); - final FileObject classWithMethod3 = createFile(src, "C4.java","class C4 { public void main (String... args){} }"); - assertEquals(0, SourceUtils.getMainClasses(classWithMethod3).size()); - final FileObject classWithMethod4 = createFile(src, "C5.java","class C5 { public static void main (StringBuilder... args){} }"); - assertEquals(0, SourceUtils.getMainClasses(classWithMethod4).size()); - final FileObject simpleMain = createFile(src, "M1.java","class M1 { public static void main (String... args){} }"); - assertMain(new String[] {"M1"}, SourceUtils.getMainClasses(simpleMain)); - final FileObject simpleMain2 = createFile(src, "M2.java","public class M2 { public static void main (String... args){} }"); - assertMain(new String[] {"M2"}, SourceUtils.getMainClasses(simpleMain2)); - final FileObject innerMain = createFile(src, "M3.java","class M3 { public static class Inner { public static void main (String... args){} } }"); - assertMain(new String[] {"M3.Inner"}, SourceUtils.getMainClasses(innerMain)); - final FileObject innerMain2 = createFile(src, "M4.java","class M4 { protected static class Inner { public static void main (String... args){} } }"); - assertMain(new String[] {"M4.Inner"}, SourceUtils.getMainClasses(innerMain2)); - final FileObject innerMain3 = createFile(src, "M5.java","class M5 { static class Inner { public static void main (String... args){} } }"); - assertMain(new String[] {"M5.Inner"}, SourceUtils.getMainClasses(innerMain3)); - final FileObject innerMain4 = createFile(src, "M6.java","class M6 { private static class Inner { public static void main (String... args){} } }"); - assertMain(new String[] {"M6.Inner"}, SourceUtils.getMainClasses(innerMain4)); - final FileObject innerMain5 = createFile(src, "M7.java","class M7 { class Inner { public static void main (String... args){} } }"); - assertEquals(0, SourceUtils.getMainClasses(innerMain5).size()); - final FileObject innerMain6 = createFile(src, "M8.java","class M8 { class Inner { static class InnerInner {public static void main (String... args){} } } }"); - assertEquals(0, SourceUtils.getMainClasses(innerMain6).size()); - final FileObject innerMain7 = createFile(src, "M9.java","class M9 { static class Inner { static class InnerInner {public static void main (String... args){} } } }"); - assertMain(new String[] {"M9.Inner.InnerInner"}, SourceUtils.getMainClasses(innerMain7)); - final FileObject twoTop = createFile(src, "T1.java","class T1 { public static void main (String... args){}} class T1X {public static void main (String... args){}}"); - assertMain(new String[] {"T1","T1X"}, SourceUtils.getMainClasses(twoTop)); - final FileObject twoTop2 = createFile(src, "T2.java","class T2 { public static void main (String... args){} static class Inner {public static void main (String... args){}}} class T2X {public static void main (String... args){} static class Inner {public static void main (String... args){}}}"); - assertMain(new String[] {"T2","T2X", "T2.Inner", "T2X.Inner"}, SourceUtils.getMainClasses(twoTop2)); - final FileObject inhMain = createFile(src, "D1.java","class D1 { public static void main (String... args){}} class D1X extends D1 {}"); - assertMain(new String[] {"D1","D1X"}, SourceUtils.getMainClasses(inhMain)); - } - - public void testGenerateReadableParameterName() throws Exception { - System.out.println("testGenerateReadableParameterName"); - Match m = new Match("java.lang.Object", "o"); - m.match("java.lang.Runnable", "r") - .match("java.awt.event.ActionListener,java.awt.event.ActionListener","al,al1") - .match("java.io.InputStream", "in") - .match("java.io.OutputStream","out") - .match("java.io.ByteArrayOutputStream","stream") - .match("missingthing.Foodbar", "fdbr") - .match("somepackage.FillUpNoKnownMessageEverywhere", "funkme") - .match("java.lang.Class","type") - .match("java.lang.Class", "type") - .match("org.openide.util.Lookup","lkp") - .match("sun.awt.KeyboardFocusManagerPeerImpl", "kfmpi") - .match("com.foo.BigInterface", "bi") - .match("java.util.concurrent.Callable", "clbl") - .match("int[]", "ints") - .match("short", "s") - .match("java.lang.Integer...", "intgrs") - .match("java.awt.Component[]", "cmpnts") - .match("int,java.lang.Runnable", "i,r") - .match("java.lang.Runnable[]", "rs") - .match("com.foo.Classwithanannoyinglylongname", "c") - .match("com.foo.Classwithanannoyinglylongname,foo.bar.Classwithanotherannoyinglylongname", "c,c1") - .match("com.foo.Classwithanannoyinglylongname,foo.bar.ClasswithLongnameButshortAcronym", "c,clba") - .match("com.foo.ClassWithAnAnnoyinglyLongNameThatGoesOnForever", "c"); - m.assertMatch(); - } - - // - - private void prepareTest() throws Exception { - File work = getWorkDir(); - FileObject workFO = FileUtil.toFileObject(work); - - assertNotNull(workFO); - - FileObject sourceRoot = workFO.createFolder("src"); - FileObject buildRoot = workFO.createFolder("build"); - FileObject cache = workFO.createFolder("cache"); - FileObject packageRoot = sourceRoot.createFolder("sourceutils"); - - SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache); - - String capitalizedName = "T" + getName().substring(1); - - TestUtil.copyFiles(FileUtil.toFile(sourceRoot), "sourceutils/" + capitalizedName + ".java"); - - packageRoot.refresh(); - - FileObject testSource = packageRoot.getFileObject(capitalizedName + ".java"); - - assertNotNull(testSource); - - SourceUtilsTestUtil.compileRecursively(sourceRoot); - - js = JavaSource.forFileObject(testSource); - - assertNotNull(js); - - info = SourceUtilsTestUtil.getCompilationInfo(js, JavaSource.Phase.RESOLVED); - - assertNotNull(info); - } - - private void assertEquals (URL[] expected, Set result) { - assertEquals (expected.length,result.size()); - for (URL eurl : expected) { - assertTrue (result.remove(eurl)); - } - assertTrue(result.isEmpty()); - } - - private E findElementBySimpleName(String simpleName, List elements) { - for (E e : elements) { - if (simpleName.contentEquals(e.getSimpleName())) - return e; - } - - fail("Not found element with simple name: " + simpleName); - - throw new Error("Should never be here!"); - } - - private void assertMain(final String[] expected, final Iterable> result) { - final Set es = new HashSet(Arrays.asList(expected)); - for (ElementHandle r : result) { - assertTrue(es.remove(r.getQualifiedName())); - } - assertTrue(es.isEmpty()); - } - - - private static FileObject createFile (final FileObject folder, final String name, final String content) throws IOException { - final FileObject fo = FileUtil.createData(folder, name); - final FileLock lock = fo.lock(); - try { - final OutputStream out = fo.getOutputStream(lock); - try { - FileUtil.copy(new ByteArrayInputStream(content.getBytes()), out); - } finally { - out.close(); - } - } finally { - lock.releaseLock(); - } - return fo; - } private static class SFBQImpl implements SourceForBinaryQueryImplementation { @@ -518,7 +451,36 @@ return instance; } } - + + public void testGenerateReadableParameterName() throws Exception { + System.out.println("testGenerateReadableParameterName"); + Match m = new Match("java.lang.Object", "o"); + m.match("java.lang.Runnable", "r") + .match("java.awt.event.ActionListener,java.awt.event.ActionListener","al,al1") + .match("java.io.InputStream", "in") + .match("java.io.OutputStream","out") + .match("java.io.ByteArrayOutputStream","stream") + .match("missingthing.Foodbar", "fdbr") + .match("somepackage.FillUpNoKnownMessageEverywhere", "funkme") + .match("java.lang.Class","type") + .match("java.lang.Class", "type") + .match("org.openide.util.Lookup","lkp") + .match("sun.awt.KeyboardFocusManagerPeerImpl", "kfmpi") + .match("com.foo.BigInterface", "bi") + .match("java.util.concurrent.Callable", "clbl") + .match("int[]", "ints") + .match("short", "s") + .match("java.lang.Integer...", "intgrs") + .match("java.awt.Component[]", "cmpnts") + .match("int,java.lang.Runnable", "i,r") + .match("java.lang.Runnable[]", "rs") + .match("com.foo.Classwithanannoyinglylongname", "c") + .match("com.foo.Classwithanannoyinglylongname,foo.bar.Classwithanotherannoyinglylongname", "c,c1") + .match("com.foo.Classwithanannoyinglylongname,foo.bar.ClasswithLongnameButshortAcronym", "c,clba") + .match("com.foo.ClassWithAnAnnoyinglyLongNameThatGoesOnForever", "c"); + m.assertMatch(); + } + private static final class Match { private String[] fqns; private String[] names; @@ -551,5 +513,99 @@ return next; } } - // + +// //tests for SourceUtils.filterSupportedMIMETypes: +// +// @SuppressWarnings("deprecation") +// public void testFilter() throws Exception { +// SourceUtilsTestUtil.setLookup(new Object[] {new JavaSourceProviderImpl(), new ResolverImpl()}, SourceUtilsTest.class.getClassLoader()); +// boolean registered = false; +// +// for (JavaSourceProvider p : Lookup.getDefault().lookupAll(JavaSourceProvider.class)) { +// if (p instanceof JavaSourceProvider) { +// registered = true; +// break; +// } +// } +// +// assertTrue(registered); +// +// FileObject work = FileUtil.toFileObject(getWorkDir()); +// +// FileObject file1 = FileUtil.createData(work, "test.ext1"); +// FileObject file2 = FileUtil.createData(work, "test.ext2"); +// FileObject file3 = FileUtil.createData(work, "test.ext3"); +// FileObject file4 = FileUtil.createData(work, "test.ext4"); +// FileObject file5 = FileUtil.createData(work, "test.txt"); +// FileObject file6 = FileUtil.createData(work, "test.ant"); +// +// assertEquals("text/x-java", FileUtil.getMIMEType(file1)); +// assertEquals("text/jsp", FileUtil.getMIMEType(file2)); +// assertEquals("text/plain", FileUtil.getMIMEType(file3)); +// assertEquals("text/test+x-java", FileUtil.getMIMEType(file4)); +// assertEquals("text/test+x-ant+xml", FileUtil.getMIMEType(file6)); +// +// List files = Arrays.asList(file1, file2, file3, file4, file5, file6); +// +// assertEquals(Arrays.asList(file1, file2, file3, file4, file6), SourceUtils.filterSupportedMIMETypes(files, F1.class)); +// assertEquals(Arrays.asList(file1, file4), SourceUtils.filterSupportedMIMETypes(files, F2.class)); +// assertEquals(Arrays.asList(file4), SourceUtils.filterSupportedMIMETypes(files, F3.class)); +// assertEquals(Arrays.asList(file1, file4), SourceUtils.filterSupportedMIMETypes(files, F4.class)); +// assertEquals(Arrays.asList(file1, file2, file4), SourceUtils.filterSupportedMIMETypes(files, F5.class)); +// } +// +// public static class JavaSourceProviderImpl implements JavaSourceProvider { +// public PositionTranslatingJavaFileFilterImplementation forFileObject(FileObject fo) { +// if ("txt".equals(fo.getExt())) +// return null; +// +// return new PositionTranslatingJavaFileFilterImplementation() { +// public int getOriginalPosition(int javaSourcePosition) { +// return javaSourcePosition; +// } +// public int getJavaSourcePosition(int originalPosition) { +// return originalPosition; +// } +// public Reader filterReader(Reader r) { +// return r; +// } +// public CharSequence filterCharSequence(CharSequence charSequence) { +// return charSequence; +// } +// public Writer filterWriter(Writer w) { +// return w; +// } +// public void addChangeListener(ChangeListener listener) {} +// public void removeChangeListener(ChangeListener listener) {} +// }; +// } +// } +// +// public static class ResolverImpl extends MIMEResolver { +// public String findMIMEType(FileObject fo) { +// String ext = fo.getExt(); +// +// if ("ext1".contains(ext)) return "text/x-java"; +// if ("ext2".contains(ext)) return "text/jsp"; +// if ("ext3".contains(ext)) return "text/plain"; +// if ("ext4".contains(ext)) return "text/test+x-java"; +// if ("ant".contains(ext)) return "text/test+x-ant+xml"; +// +// return null; +// } +// } +// +// @SupportedMimeTypes("*") +// private static class F1 {} +// +// @SupportedMimeTypes("text/x-java") +// private static class F2 {} +// +// @SupportedMimeTypes("text/test+x-java") +// private static class F3 {} +// +// private static class F4 {} +// +// @SupportedMimeTypes({"text/x-java", "text/jsp"}) +// private static class F5 {} } Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -45,14 +45,12 @@ package org.netbeans.api.java.source; import com.sun.source.tree.ClassTree; -import com.sun.source.tree.MethodTree; import com.sun.source.tree.Tree.Kind; import com.sun.source.tree.VariableTree; import com.sun.source.util.TreePath; import java.io.File; import java.io.OutputStream; import java.security.Permission; -import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.junit.NbTestCase; @@ -338,32 +336,6 @@ assertTrue(tp.getLeaf() == resolved.getLeaf()); } - public void testFromElementHandle() throws Exception { - FileObject file = FileUtil.createData(sourceRoot, "test/test.java"); - String code = "package test;\n" + - "public class Test {\n" + - " public static void test() {\n" + - " }\n" + - "}"; - - writeIntoFile(file,code); - - JavaSource js = JavaSource.forFileObject(file); - CompilationInfo info = SourceUtilsTestUtil.getCompilationInfo(js, Phase.RESOLVED); - - ClassTree clazz = (ClassTree) info.getCompilationUnit().getTypeDecls().get(0); - MethodTree method = (MethodTree) clazz.getMembers().get(1); - TreePath tp = TreePath.getPath(info.getCompilationUnit(), method); - Element el = info.getTrees().getElement(tp); - ElementHandle elHandle = ElementHandle.create(el); - TreePathHandle handle = TreePathHandle.from(elHandle, info.getClasspathInfo()); - TreePath resolved = handle.resolve(info); - - assertNotNull(resolved); - - assertTrue(tp.getLeaf() == resolved.getLeaf()); - } - private static final class SecMan extends SecurityManager { @Override Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -331,10 +331,6 @@ performTest("package test;\npublic class Test extends XX {\nprivate int test;\n}\nclass XX {\npublic XX(boolean b){\n}\n}\n", new ConstructorTask(30), new ConstructorValidator()); } - public void testConstructor197192() throws Exception { - performTest("package test;\npublic class Test extends XX {\nprivate int test;\n}\nclass XX {\npublic XX(String... args){\n}\n}\n", new ConstructorTask(30), new ConstructorValidator()); - } - public void testConstructor100341() throws Exception { performTest("package test;\npublic class Test extends java.util.ArrayList {\n}\n", new ALConstructorTask(30), null); } @@ -818,8 +814,6 @@ ExecutableElement ctor = ctors.get(0); assertEquals(supCtor == null ? 1 : 2, ctor.getParameters().size()); - if (supCtor != null) - assertEquals(supCtor.isVarArgs(), ctor.isVarArgs()); } } Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -509,34 +509,6 @@ src.runModificationTask(task); } - - public void test197057() throws Exception { - File testFile = new File(work, "Test.java"); - final String origin = - "package test;\n" + - "public class Test {\n public void aa() {\n//aa\n } public void bb() {\n//bb\n } }\n"; - TestUtilities.copyStringToFile(testFile, origin); - JavaSource src = getJavaSource(testFile); - - Task task = new Task() { - public void run(final WorkingCopy workingCopy) throws Exception { - workingCopy.toPhase(JavaSource.Phase.PARSED); - ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0); - MethodTree a = (MethodTree) clazz.getMembers().get(0); - MethodTree b = (MethodTree) clazz.getMembers().get(1); - - a = GeneratorUtilities.get(workingCopy).importComments(a, workingCopy.getCompilationUnit()); - b = GeneratorUtilities.get(workingCopy).importComments(b, workingCopy.getCompilationUnit()); - - final CommentHandlerService service = CommentHandlerService.instance(workingCopy.impl.getJavacTask().getContext()); - - verify(a.getBody(), CommentSet.RelativePosition.INNER, service, "", "//aa"); - verify(b.getBody(), CommentSet.RelativePosition.INNER, service, "", "//bb"); - } - }; - src.runModificationTask(task); - - } void verify(Tree tree, CommentSet.RelativePosition position, CommentHandler service, String... comments) { assertNotNull("Comments handler service not null", service); Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -88,7 +88,6 @@ import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Handler; import javax.swing.text.BadLocationException; @@ -1209,12 +1208,7 @@ rutStart.await(); res = js.runWhenScanFinished(new T(latch), true); assertEquals(1,latch.getCount()); - try { - res.get(1,TimeUnit.SECONDS); - assertTrue(false); - } catch (TimeoutException te) { - //Pass - } + res.get(1,TimeUnit.SECONDS); assertFalse(res.isDone()); assertFalse (res.isCancelled()); rutLatch.countDown(); @@ -1231,23 +1225,13 @@ rutStart.await(); res = js.runWhenScanFinished(new T(latch), true); assertEquals(1,latch.getCount()); - try { - res.get(1,TimeUnit.SECONDS); - assertTrue(false); - } catch (TimeoutException te) { - //Pass - } + res.get(1,TimeUnit.SECONDS); assertFalse(res.isDone()); assertFalse (res.isCancelled()); assertTrue (res.cancel(false)); rutLatch.countDown(); assertFalse(latch.await(3, TimeUnit.SECONDS)); - try { - res.get(1,TimeUnit.SECONDS); - assertTrue(false); - } catch (TimeoutException te) { - //Pass - } + res.get(1,TimeUnit.SECONDS); assertFalse(res.isDone()); assertTrue (res.isCancelled()); } @@ -2186,7 +2170,7 @@ } - private static class TestIndex implements Index.WithStatus { + private static class TestIndex implements Index { //Activate the TestIndex.await after scan is done //during the scan the prebuildArgs may call the index //and cause deadlock @@ -2197,17 +2181,12 @@ } @Override - public Status getStatus(boolean tryOpen) throws IOException { - return Status.VALID; - } - - @Override - public boolean exists() { + public boolean isValid(boolean tryOpen) throws IOException { return true; } @Override - public boolean isValid(boolean tryOpen) throws IOException { + public boolean exists() { return true; } Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -44,14 +44,11 @@ package org.netbeans.api.java.source.gen; import com.sun.source.tree.*; -import com.sun.source.util.TreeScanner; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.EnumSet; -import java.util.List; import javax.lang.model.element.Modifier; import org.netbeans.api.java.source.Task; import org.netbeans.api.java.source.JavaSource; @@ -114,7 +111,7 @@ TryTree tt = make.Try(make.Block(Collections.emptyList(), false), Collections.singletonList(make.Catch(make.Variable(make.Modifiers(EnumSet.of(Modifier.FINAL)), "ex", - make.UnionType(Arrays.asList(make.Identifier("java.net.MalformedURLException"), + make.DisjunctiveType(Arrays.asList(make.Identifier("java.net.MalformedURLException"), make.Identifier("java.io.IOException")) ), null), @@ -129,202 +126,6 @@ System.err.println(res); assertEquals(golden, res); } - - public void testRenameInMultiCatch() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | FileNotFoundException ex) {\n" + - " }\n" + - " }\n" + - "}\n" - ); - String golden = - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | IOException ex) {\n" + - " }\n" + - " }\n" + - "}\n"; - JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile)); - Task task = new Task() { - - public void run(final WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(Phase.RESOLVED); - final TreeMaker make = workingCopy.getTreeMaker(); - - new TreeScanner() { - @Override public Void visitIdentifier(IdentifierTree node, Void p) { - if (node.getName().contentEquals("FileNotFoundException")) { - workingCopy.rewrite(node, make.Identifier("IOException")); - } - return super.visitIdentifier(node, p); - } - }.scan(workingCopy.getCompilationUnit(), null); - } - - }; - testSource.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - System.err.println(res); - assertEquals(golden, res); - } - - public void testAddLastToMultiCatch() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | FileNotFoundException ex) {\n" + - " }\n" + - " }\n" + - "}\n" - ); - String golden = - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | FileNotFoundException | IOException ex) {\n" + - " }\n" + - " }\n" + - "}\n"; - JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile)); - Task task = new Task() { - - public void run(final WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(Phase.RESOLVED); - final TreeMaker make = workingCopy.getTreeMaker(); - - new TreeScanner() { - @Override public Void visitUnionType(UnionTypeTree node, Void p) { - List alternatives = new ArrayList(node.getTypeAlternatives()); - alternatives.add(make.Identifier("IOException")); - workingCopy.rewrite(node, make.UnionType(alternatives)); - return null; - } - }.scan(workingCopy.getCompilationUnit(), null); - } - - }; - testSource.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - System.err.println(res); - assertEquals(golden, res); - } - - public void testAddFirstToMultiCatch() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | FileNotFoundException ex) {\n" + - " }\n" + - " }\n" + - "}\n" - ); - String golden = - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (IOException | MalformedURLException | FileNotFoundException ex) {\n" + - " }\n" + - " }\n" + - "}\n"; - JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile)); - Task task = new Task() { - - public void run(final WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(Phase.RESOLVED); - final TreeMaker make = workingCopy.getTreeMaker(); - - new TreeScanner() { - @Override public Void visitUnionType(UnionTypeTree node, Void p) { - List alternatives = new ArrayList(node.getTypeAlternatives()); - alternatives.add(0, make.Identifier("IOException")); - workingCopy.rewrite(node, make.UnionType(alternatives)); - return null; - } - }.scan(workingCopy.getCompilationUnit(), null); - } - - }; - testSource.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - System.err.println(res); - assertEquals(golden, res); - } - - public void testAddMiddleToMultiCatch() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | FileNotFoundException ex) {\n" + - " }\n" + - " }\n" + - "}\n" - ); - String golden = - "package hierbas.del.litoral;\n" + - "import java.io.*;\n" + - "import java.net.*;\n" + - "public class Test {\n" + - " public void taragui() {\n" + - " try {\n" + - " } catch (MalformedURLException | IOException | FileNotFoundException ex) {\n" + - " }\n" + - " }\n" + - "}\n"; - JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile)); - Task task = new Task() { - - public void run(final WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(Phase.RESOLVED); - final TreeMaker make = workingCopy.getTreeMaker(); - - new TreeScanner() { - @Override public Void visitUnionType(UnionTypeTree node, Void p) { - List alternatives = new ArrayList(node.getTypeAlternatives()); - alternatives.add(1, make.Identifier("IOException")); - workingCopy.rewrite(node, make.UnionType(alternatives)); - return null; - } - }.scan(workingCopy.getCompilationUnit(), null); - } - - }; - testSource.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - System.err.println(res); - assertEquals(golden, res); - } String getGoldenPckg() { return ""; Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -904,42 +904,6 @@ assertEquals(golden, res); } - public void testParameterAnnotations() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - String code = "package hierbas.del.litoral;\n" + - "\n" + - "public class Test {\n\n" + - " public Test() {\n" + - " }\n\n" + - " public void test() {\n" + - " }\n" + - "}\n"; - - code = Reformatter.reformat(code, CodeStyle.getDefault(FileUtil.toFileObject(testFile))); - TestUtilities.copyStringToFile(testFile, code); - - JavaSource src = getJavaSource(testFile); - Task task = new Task() { - - public void run(final WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(Phase.RESOLVED); - - NewClassTree nct = (NewClassTree) workingCopy.getTreeUtilities().parseExpression("new Object() { public int a(@Test1(a=1) @Test2(b=2) int i, @Test1 @Test2 int j) { return 0; }", new SourcePositions[1]); - ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0); - workingCopy.rewrite(clazz, workingCopy.getTreeMaker().addClassMember(clazz, nct.getClassBody().getMembers().get(0))); - } - - }; - src.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - String formattedRes = Reformatter.reformat(res, CodeStyle.getDefault(FileUtil.toFileObject(testFile))); - System.err.println(res); - res = res.replaceAll("\n[ ]*\n", "\n"); - System.err.println(formattedRes); - formattedRes = formattedRes.replaceAll("\n[ ]*\n", "\n"); //XXX: workaround for a bug in reformatter - assertEquals(formattedRes, res); - } - private void setValues(Preferences p, Map values) { for (Entry e : values.entrySet()) { if (e.getValue() != null) { Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -43,10 +43,6 @@ */ package org.netbeans.api.java.source.gen; -import com.sun.source.util.TreePath; -import org.openide.cookies.EditorCookie; -import org.openide.filesystems.FileUtil; -import org.openide.loaders.DataObject; import java.io.File; import java.io.IOException; import java.util.Collections; @@ -63,7 +59,7 @@ /** * - * @author Pavel Flaska, Jan Becicka + * @author Pavel Flaska */ public class RefactoringRegressionsTest extends GeneratorTestMDRCompat { @@ -736,110 +732,6 @@ assertEquals(golden, res); } - public void test197057() throws Exception { - System.err.println("test197057"); - - - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "package personal;\n" + - "\n" + - "public class Test {\n" + - " private void a() {\n" + - " //a\n" + - " }\n" + - " private void b() {\n" + - " //b\n" + - " }\n" + - "}\n" + - "class A {\n" + - "}\n"); - - - - String golden = - "package personal;\n" + - "\n" + - "public class Test {\n" + - " private void a() {\n" + - " //a\n" + - " }\n" + - " private void b() {\n" + - " //b\n" + - " }\n" + - "}\n" + - "class A {\n\n" + - " private void a() {\n" + - " //a\n" + - " }\n\n" + - " private void b() {\n" + - " //b\n" + - " }\n" + - "}\n"; - - - - JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile)); - Task task = new Task() { - - public void run(WorkingCopy workingCopy) throws java.io.IOException { - workingCopy.toPhase(Phase.RESOLVED); - TreeMaker make = workingCopy.getTreeMaker(); - ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0); - ClassTree dest = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(1); - ClassTree newDest; - - MethodTree a = (MethodTree) clazz.getMembers().get(1); - MethodTree b = (MethodTree) clazz.getMembers().get(2); - - GeneratorUtilities genUtils = GeneratorUtilities.get(workingCopy); - TreePath mpath = workingCopy.getTrees().getPath(workingCopy.getCompilationUnit(), a); - Tree newMethodTree = genUtils.importComments(mpath.getLeaf(), mpath.getCompilationUnit()); - newMethodTree = genUtils.importFQNs(newMethodTree); - - MethodTree oldOne = (MethodTree) newMethodTree; - MethodTree newm = make.Method( - oldOne.getModifiers(), - oldOne.getName(), - oldOne.getReturnType(), - oldOne.getTypeParameters(), - oldOne.getParameters(), - oldOne.getThrows(), - oldOne.getBody(), - (ExpressionTree) oldOne.getDefaultValue()); - //RetoucheUtils.copyJavadoc(methodElm, m, workingCopy); - newDest = genUtils.insertClassMember(dest, newm); - - mpath = workingCopy.getTrees().getPath(workingCopy.getCompilationUnit(), b); - newMethodTree = genUtils.importComments(mpath.getLeaf(), mpath.getCompilationUnit()); - newMethodTree = genUtils.importFQNs(newMethodTree); - - oldOne = (MethodTree) newMethodTree; - newm = make.Method( - oldOne.getModifiers(), - oldOne.getName(), - oldOne.getReturnType(), - oldOne.getTypeParameters(), - oldOne.getParameters(), - oldOne.getThrows(), - oldOne.getBody(), - (ExpressionTree) oldOne.getDefaultValue()); - //RetoucheUtils.copyJavadoc(methodElm, m, workingCopy); - newDest = genUtils.insertClassMember(newDest, newm); - - workingCopy.rewrite(dest, newDest); - } - }; - testSource.runModificationTask(task).commit(); - DataObject d = DataObject.find(FileUtil.toFileObject(testFile)); - EditorCookie ec = d.getLookup().lookup(EditorCookie.class); - ec.saveDocument(); - - String res = TestUtilities.copyFileToString(testFile); - System.err.println(res); - assertEquals(golden, res); - } - String getGoldenPckg() { return ""; } Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -1485,6 +1485,7 @@ ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0); GeneratorUtilities.get(workingCopy).importComments(clazz, cut); ClassTree newClazz = make.setLabel(clazz, clazz.getSimpleName()); + GeneratorUtilities.get(workingCopy).copyComments(clazz, newClazz, true); make.removeComment(newClazz, 0, true); workingCopy.rewrite(clazz, newClazz); } Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java =================================================================== --- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java 2011-08-03 23:01:41.000000000 +0100 +++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java 2011-08-03 23:01:41.000000000 +0100 @@ -604,46 +604,6 @@ Utils.setCodePreferences(origValues); } - public void testCLikeArray() throws Exception { - testFile = new File(getWorkDir(), "Test.java"); - TestUtilities.copyStringToFile(testFile, - "package hierbas.del.litoral;\n\n" + - "public class Test {\n" + - " public int taragui() {\n" + - " int ii[] = null;" + - " }\n" + - "}\n" - ); - String golden = - "package hierbas.del.litoral;\n\n" + - "public class Test {\n" + - " public int taragui(int[] a) {\n" + - " int ii[] = null;" + - " }\n" + - "}\n"; - - JavaSource src = getJavaSource(testFile); - Task task = new Task() { - - public void run(WorkingCopy workingCopy) throws IOException { - workingCopy.toPhase(Phase.RESOLVED); - CompilationUnitTree cut = workingCopy.getCompilationUnit(); - ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0); - MethodTree method = (MethodTree) clazz.getMembers().get(1); - VariableTree var = (VariableTree) method.getBody().getStatements().get(0); - TreeMaker make = workingCopy.getTreeMaker(); - VariableTree param = workingCopy.getTreeMaker().Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), "a", var.getType(), null); - - workingCopy.rewrite(method, make.addMethodParameter(method, param)); - } - - }; - src.runModificationTask(task).commit(); - String res = TestUtilities.copyFileToString(testFile); - System.err.println(res); - assertEquals(golden, res); - } - String getGoldenPckg() { return ""; } debian/patches/netbeans~debugger.jpda.ui.patch0000664000000000000000000000204711720272354016701 0ustar Use the latest api for com.sun.source.util.Trees. Reported upstream at: http://netbeans.org/bugzilla/show_bug.cgi?id=201267 Index: netbeans/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/WatchPanel.java =================================================================== --- netbeans.orig/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/WatchPanel.java 2011-08-23 21:25:07.276130076 +0100 +++ netbeans/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/WatchPanel.java 2011-08-23 21:25:42.546130576 +0100 @@ -43,6 +43,7 @@ */ package org.netbeans.modules.debugger.jpda.ui; +import com.sun.source.tree.CatchTree; import com.sun.source.tree.ClassTree; import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.IdentifierTree; @@ -716,6 +717,11 @@ return trees.getDocComment(path); } + @Override + public TypeMirror getLub(CatchTree tree) { + return trees.getLub(tree); + } + } public static final class DelegatingBorder implements Border { debian/patches/netbeans-platform~suitebuild.patch0000664000000000000000000000224511720272354017557 0ustar Don't fail if we can't find the Windows exe launcher. This lets us build for older netbeans platforms where the package didn't contain Windows launchers. Index: netbeans/apisupport.harness/release/suite.xml =================================================================== --- netbeans.orig/apisupport.harness/release/suite.xml 2011-09-07 19:01:15.758711116 +0100 +++ netbeans/apisupport.harness/release/suite.xml 2011-09-07 19:01:43.127877804 +0100 @@ -322,7 +322,7 @@ - + debian/patches/series0000664000000000000000000000140611720272354012040 0ustar netbeans~empty-binaries-list.patch netbeans-platform~launcher.patch netbeans-platform~nojnabinaries.patch netbeans-platform~windowslauncher.patch netbeans-platform~include-extras.patch netbeans-platform~nbi.patch netbeans-platform~properties.patch netbeans-platform~suitebuild.patch netbeans~nocopy.patch netbeans~no-rhino.patch netbeans~svnclient.patch netbeans~o.a.tools.ant.patch netbeans~no-test-clean.patch netbeans~ide-launcher.patch netbeans~updatecenters.patch netbeans~build.patch netbeans~cluster-properties.patch netbeans~small-ide.patch #netbeans~old-java.source-module.patch #netbeans~old-java-modules.patch netbeans~debugger.jpda.ui.patch netbeans~xsl.patch netbeans~db.patch netbeans-platform~osgi-4.3.patch netbeans~include-junit.patch netbeans~xerces.patch debian/patches/netbeans~no-test-clean.patch0000664000000000000000000000166711720272354016244 0ustar Don't require test dependencies to clean! Index: netbeans-7.0.1+dfsg1/nbbuild/templates/projectized.xml =================================================================== --- netbeans-7.0.1+dfsg1.orig/nbbuild/templates/projectized.xml 2011-08-03 22:31:13.752758220 +0100 +++ netbeans-7.0.1+dfsg1/nbbuild/templates/projectized.xml 2011-08-03 22:31:44.051925479 +0100 @@ -296,9 +296,9 @@ - + debian/patches/netbeans-platform~nojnabinaries.patch0000664000000000000000000000320311720272354020223 0ustar We don't need to install any JNA binaries, since they're already installed. Index: platform/libs.jna/nbproject/project.properties =================================================================== --- platform.orig/libs.jna/nbproject/project.properties 2011-05-22 19:51:45.514338125 +0100 +++ platform/libs.jna/nbproject/project.properties 2011-05-22 21:56:53.854338968 +0100 @@ -41,9 +41,9 @@ # made subject to such option by the copyright holder. release.external/jna-3.2.7.jar=modules/ext/jna-3.2.7.jar -release.external/jna-3.2.7.jar!/com/sun/jna/darwin/libjnidispatch.jnilib=modules/lib/libjnidispatch.jnilib -release.external/jna-3.2.7.jar!/com/sun/jna/linux-amd64/libjnidispatch.so=modules/lib/amd64/Linux/libjnidispatch.so -release.external/jna-3.2.7.jar!/com/sun/jna/linux-i386/libjnidispatch.so=modules/lib/i386/Linux/libjnidispatch.so -release.external/jna-3.2.7.jar!/com/sun/jna/win32-amd64/jnidispatch.dll=modules/lib/amd64/jnidispatch.dll -release.external/jna-3.2.7.jar!/com/sun/jna/win32-x86/jnidispatch.dll=modules/lib/x86/jnidispatch.dll +#release.external/jna-3.2.7.jar!/com/sun/jna/darwin/libjnidispatch.jnilib=modules/lib/libjnidispatch.jnilib +#release.external/jna-3.2.7.jar!/com/sun/jna/linux-amd64/libjnidispatch.so=modules/lib/amd64/Linux/libjnidispatch.so +#release.external/jna-3.2.7.jar!/com/sun/jna/linux-i386/libjnidispatch.so=modules/lib/i386/Linux/libjnidispatch.so +#release.external/jna-3.2.7.jar!/com/sun/jna/win32-amd64/jnidispatch.dll=modules/lib/amd64/jnidispatch.dll +#release.external/jna-3.2.7.jar!/com/sun/jna/win32-x86/jnidispatch.dll=modules/lib/x86/jnidispatch.dll jnlp.indirect.files=modules/lib/**/*jnidispatch* debian/netbeans.lintian-overrides0000664000000000000000000000034711720272354014356 0ustar # Netbeans builds lots of codeless jars on purpose, so don't warn us about them netbeans: codeless-jar # Netbeans has it's own way to set the classpath, and it breaks things if we # set it separately. netbeans: missing-classpath debian/netbeans.manpages0000664000000000000000000000002211720272354012501 0ustar debian/netbeans.1 debian/netbeans.10000664000000000000000000000457611720272354011070 0ustar .\" Hey, EMACS: -*- nroff -*- .\" The first parameter, NAME, should be all caps .\" The second parameter, SECTION, should be 1-8, maybe with subsection .\" Other parameters are allowed: see man(7), man(1) .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .TH "NETBEANS" "1" "January 18, 2008" "" "Java IDE and More" .SH "NAME" NetBeans \- Java IDE .SH "SYNOPSIS" .LP .nf \f3 .fl \fP\f3netbeans\fP [ \f2options\fP ] [ \f2files\fP ] .br .fl .fi .LP .SH "PARAMETERS" .LP .LP .TP 3 options Command\-line options. .TP 3 files Files to be opened in NetBeans IDE. .LP .SH "DESCRIPTION" .B NetBeans is a cross\-platform IDE written in Java. It supports development in Java, and support for other languages can be added. The whole IDE is built around a core framework with APIs, and features are implemented in the form of plugin modules. This clean, modular architecture makes NetBeans a good platform for building development tools and custom IDEs. .SH "OPTIONS" .LP General options: .TP 3 \-\-help List available command line options .TP 3 \-\-jdkhome Path to JDK home used to run IDE .TP 3 \-J Pass to JVM .TP 3 \-\-cp:p Prepend to classpath .TP 3 \-\-cp:a Append to classpath .LP Core options: .TP 3 \-\-laf Use given LookAndFeel class instead of the default .TP 3 \-\-fontsize Set the base font size of the user interface, in points .TP 3 \-\-locale Use specified locale .TP 3 \-\-userdir Use specified directory to store user settings .LP Module reload options: .TP 3 \-\-reload /path/to/module.jar Installs or reinstalls a module JAR file. .LP OpenFile module options: .TP 3 \-\-open FILE Open FILE. .TP 3 \-\-open FILE:LINE Open FILE at line LINE (starting from 1). .SH "AUTHOR" NetBeans was written by the NetBeans Community . .PP This manual page was written by Marek Slama , for the Debian project (but may be used by others). debian/pom/0000775000000000000000000000000011720272354007766 5ustar debian/pom/openide-util.xml0000664000000000000000000000113111720272354013102 0ustar 4.0.0 org.netbeans.api org-openide-util 7.0 org.netbeans.api org-openide-util-lookup 7.0 debian/pom/AbsoluteLayout.xml0000664000000000000000000000116411720272354013466 0ustar 4.0.0 org.netbeans.external AbsoluteLayout 7.0 Maven definition for AbsoluteLayout.jar - external part of NetBeans module. POM and identification for artifact that was not possible to uniquely identify as a maven dependency. debian/pom/openide-modules.xml0000664000000000000000000000136611720272354013607 0ustar 4.0.0 org.netbeans.api org-openide-modules 7.0 org.netbeans.api org-openide-util 7.0 org.netbeans.api org-openide-util-lookup 7.0 debian/pom/openide-util-lookup.xml0000664000000000000000000000063411720272354014420 0ustar 4.0.0 org.netbeans.api org-openide-util-lookup 7.0 debian/rules0000775000000000000000000003012312026372032010244 0ustar #!/usr/bin/make -f DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-$(DEB_HOST_ARCH) #package names pkg-platform := platform13 pkg-lib-platform := libnb-$(pkg-platform) libnb-platform-java := $(pkg-lib-platform)-java libnb-platform-java-doc := $(pkg-lib-platform)-java-doc libnb-platform-devel-java := libnb-platform-devel-java # Included clusters pkg-nb := netbeans base-apisupport := apisupport3 base-ide := ide14 base-java := java5 base-nb := nb base-platform := platform13 pkg-apisupport := libnb-$(base-apisupport)-java pkg-ide := libnb-$(base-ide)-java pkg-java := libnb-$(base-java)-java NBDIR := /usr/share/netbeans export JAVADIR := /usr/share/java JH_JAR := jhall.jar JSEARCH_JAR := jsearch.jar NB_JH_JAR := jhall-2.0_05.jar NB_JSEARCH_JAR := jsearch-2.0_05.jar JAVADOC_WEBSITE := http://bits.netbeans.org/7.0/javadoc NB_INSTALL_DIR := usr/share/netbeans EXT_JAR_LINK_DIR := $(NB_INSTALL_DIR)/$(pkg-platform)/modules/ext/ LIB_DIR := $(NB_INSTALL_DIR)/$(pkg-platform)/lib/ INSTALL := dh_install -p LINK := dh_link -p NB_PLATFORM_BUILD_DIR := $(shell pwd)/nbbuild/netbeans/platform DEB_UPSTREAM_VERSION = $(shell dpkg-parsechangelog | \ grep -e '^Version' | \ perl -pi -e 's/^Version:\s+(.*)\+dfsg\d+-\d+.*$$/$$1/') # Defined function to be used to create symlinks define symlink mkdir -p $(dir $(2)) ln -sf $(1) $(2) endef %: dh $@ --with javahelper #link: # $(shell awk 'NF==4 {printf("echo ln -sf %s %s/%s;\n",$$1,$$2,$$4)}' debian/linked-jars) # $(shell awk 'NF==4 {printf("echo ln -sf %s nbbuild/netbeans/%s/%s;\n",$$1,$$3,$$4)}' debian/linked-jars) override_dh_auto_build: mkdir -p nbbuild/external/xhtml1-dtds ln -sf /usr/share/xml/xhtml/schema/dtd/1.0/xhtml* nbbuild/external/xhtml1-dtds ln -sf /usr/share/xml/entities/xhtml/xhtml* nbbuild/external/xhtml1-dtds # link the required jars $(shell awk 'NF==4 {printf("ln -sf %s %s/%s;\n",$$1,$$2,$$4)}' debian/linked-jars) ######## Remove services and org/eclipse/* from equinox osgi.jar##################### # mkdir debian/jar_tmp; cd debian/jar_tmp; \ # jar -xf $(JAVADIR)/org.eclipse.osgi.jar; \ # rm -rf META-INF/services org/eclipse; \ # jar -cf ../../libs.osgi/external/osgi.core-4.2.jar ./*; # rm -rf debian/jar_tmp #TODO $(call symlink, /usr/share/ant/lib, o.apache.tools.ant.module/external/lib) ################################################################ # Build the Windows launcher cd o.n.bootstrap/launcher/windows && LDFLAGS="" make .build-impl nbexec.exe cd apisupport.harness/windows-launcher-src && LDFLAGS="" make ################################################################ # Build the ide. DISPLAY must be unset to avoid build failures. unset DISPLAY; ant \ -Dpermit.jdk6.builds=true \ -Dbuild.compiler.deprecation=false \ -Dbuild.compiler.debug=false \ -Dext.binaries.downloaded=true \ -Dverify.checkout=false \ -Dcluster.config=basic \ -f nbbuild/build.xml build-nozip ################################################################ # Build javadoc package ant \ -Dbuild.compiler.deprecation=false \ -Dbuild.compiler.debug=false \ -Dverify.checkout=false \ -Dallmodules= \ -Dcluster.config=platform \ -Dconfig.javadoc.cluster=$(pkg-base) \ -Djavadoc.docs.org-netbeans-api-java=$(JAVADOC_WEBSITE)/org-netbeans-api-java/ \ -Djavadoc.docs.org-netbeans-modules-project-ant=$(JAVADOC_WEBSITE)/org-netbeans-modules-project-ant/ \ -Djavadoc.docs.org-netbeans-modules-projectapi=$(JAVADOC_WEBSITE)/org-netbeans-modules-projectapi/ \ -f nbbuild/build.xml build-javadoc # remove the zip files - we only want the extracted files rm -f nbbuild/build/javadoc/*.zip override_dh_auto_install: # recreate links $(shell awk 'NF==4 {printf("ln -sf %s nbbuild/netbeans/%s/%s;\n",$$1,$$3,$$4)}' debian/linked-jars) # Install libraries mh_installjar -plibnb-org-openide-util-java -l debian/pom/openide-util.xml \ nbbuild/netbeans/platform/lib/org-openide-util.jar mh_installpom -plibnb-org-openide-util-java debian/pom/openide-util.xml mh_installjar -plibnb-org-openide-util-lookup-java -l debian/pom/openide-util-lookup.xml \ nbbuild/netbeans/platform/lib/org-openide-util-lookup.jar mh_installpom -plibnb-org-openide-util-lookup-java debian/pom/openide-util-lookup.xml mh_installjar -plibnb-org-openide-modules-java -l debian/pom/openide-modules.xml \ nbbuild/netbeans/platform/lib/org-openide-modules.jar mh_installpom -plibnb-org-openide-modules-java debian/pom/openide-modules.xml mh_installjar -plibnb-absolutelayout-java -l debian/pom/AbsoluteLayout.xml \ nbbuild/netbeans/java/modules/ext/AbsoluteLayout.jar mh_installpom -plibnb-absolutelayout-java debian/pom/AbsoluteLayout.xml # # Install Platform echo > nbbuild/netbeans/platform/.noautoupdate echo > nbbuild/netbeans/platform/.lastModified $(INSTALL)$(libnb-platform-java) nbbuild/netbeans/platform/* $(NB_INSTALL_DIR)/$(pkg-platform) $(INSTALL)$(libnb-platform-java) nbbuild/netbeans/platform/.noautoupdate $(NB_INSTALL_DIR)/$(pkg-platform) $(INSTALL)$(libnb-platform-java) nbbuild/netbeans/platform/.lastModified $(NB_INSTALL_DIR)/$(pkg-platform) $(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-util.jar $(LIB_DIR)/org-openide-util.jar $(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-util-lookup.jar $(LIB_DIR)/org-openide-util-lookup.jar $(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-modules.jar $(LIB_DIR)/org-openide-modules.jar # # Install devel package rm -f nbbuild/netbeans/harness/antlib/$(NB_JSEARCH_JAR) echo > nbbuild/netbeans/harness/.noautoupdate echo > nbbuild/netbeans/harness/.lastModified $(INSTALL)$(libnb-platform-devel-java) nbbuild/netbeans/harness/* $(NB_INSTALL_DIR)/harness $(INSTALL)$(libnb-platform-devel-java) nbbuild/netbeans/harness/.noautoupdate $(NB_INSTALL_DIR)/harness $(INSTALL)$(libnb-platform-devel-java) nbbuild/netbeans/harness/.lastModified $(NB_INSTALL_DIR)/harness # #Fixing permissions chmod 0755 debian/$(libnb-platform-devel-java)/$(NB_INSTALL_DIR)/harness/launchers/app.sh # # Install IDE package files echo > nbbuild/netbeans/ide/.noautoupdate echo > nbbuild/netbeans/ide/.lastModified # #all files are removed from lib because they are in dll formats # rm -rf nbbuild/netbeans/$(base-ide)/modules/lib $(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/* $(NB_INSTALL_DIR)/$(base-ide) $(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/.noautoupdate $(NB_INSTALL_DIR)/$(base-ide) $(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/.lastModified $(NB_INSTALL_DIR)/$(base-ide) # Install Java package files echo > nbbuild/netbeans/java/.noautoupdate echo > nbbuild/netbeans/java/.lastModified # #all doc files are removed because they are in zip and jar formats # rm -rf nbbuild/netbeans/java/docs $(INSTALL)$(pkg-java) nbbuild/netbeans/java/* $(NB_INSTALL_DIR)/$(base-java) $(INSTALL)$(pkg-java) nbbuild/netbeans/java/.noautoupdate $(NB_INSTALL_DIR)/$(base-java) $(INSTALL)$(pkg-java) nbbuild/netbeans/java/.lastModified $(NB_INSTALL_DIR)/$(base-java) # Link in Ant libraries and binaries -rmdir debian/$(pkg-java)/$(NB_INSTALL_DIR)/$(base-java)/ant/lib $(LINK)$(pkg-java) usr/share/ant/bin $(NB_INSTALL_DIR)/$(base-java)/ant/bin $(LINK)$(pkg-java) usr/share/ant/etc $(NB_INSTALL_DIR)/$(base-java)/ant/etc $(LINK)$(pkg-java) usr/share/ant/lib $(NB_INSTALL_DIR)/$(base-java)/ant/lib # Link in AbsoluteLayout jar -rm debian/$(pkg-java)/$(NB_INSTALL_DIR)/$(base-java)/modules/ext/AbsoluteLayout.jar $(LINK)$(pkg-java) usr/share/java/AbsoluteLayout.jar $(NB_INSTALL_DIR)/$(base-java)/modules/ext/AbsoluteLayout.jar # # Install API support package files echo > nbbuild/netbeans/apisupport/.noautoupdate echo > nbbuild/netbeans/apisupport/.lastModified $(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/* $(NB_INSTALL_DIR)/$(base-apisupport) $(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/.noautoupdate $(NB_INSTALL_DIR)/$(base-apisupport) $(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/.lastModified $(NB_INSTALL_DIR)/$(base-apisupport) # # Install Netbeans package files echo > nbbuild/netbeans/nb/.noautoupdate $(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/* $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb $(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.lastModified $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb $(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.noautoupdate $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb $(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/* $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/bin $(INSTALL)$(pkg-nb) nbbuild/netbeans/CREDITS.html usr/share/$(pkg-nb) $(INSTALL)$(pkg-nb) nbbuild/netbeans/README.html usr/share/$(pkg-nb) $(INSTALL)$(pkg-nb) nbbuild/netbeans/netbeans.css usr/share/$(pkg-nb) $(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-platform) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/platform $(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/harness $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/harness $(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-apisupport) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/apisupport $(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-ide) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/ide $(LINK)$(pkg-nb) $(NB_INSTALL_DIR)/$(base-java) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/java # Create file marker to avoid displaying license dialog at first IDE start echo > debian/license_accepted $(INSTALL)$(pkg-nb) debian/license_accepted $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb/var # Install file productid used by autoupdate to report installation type $(INSTALL)$(pkg-nb) debian/productid $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb/config # # Install netbeans.conf $(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf etc $(LINK)$(pkg-nb) etc/netbeans.conf $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.conf # # Install netbeans.clusters $(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.clusters etc $(LINK)$(pkg-nb) etc/netbeans.clusters $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.clusters # # # Save original version of netbeans.conf as postinst patches it # #cp nbbuild/netbeans/etc/netbeans.conf nbbuild/netbeans/etc/netbeans.conf.orig # #$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf.orig $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc # # Install launcher $(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/netbeans usr/bin # Install desktop file $(INSTALL)$(pkg-nb) debian/netbeans.desktop usr/share/applications override_dh_auto_clean: -rm -f *.cdbs-config_list -rm -f stamp-build-$(libnb-platform-java) -rm -f stamp-build-$(libnb-platform-devel-java) -rm -f stamp-build-$(libnb-platform-java-doc) $(call symlink, $(JAVADIR)/$(JH_JAR), javahelp/external/$(NB_JH_JAR)) $(call symlink, $(JAVADIR)/$(JSEARCH_JAR), apisupport.harness/external/$(NB_JSEARCH_JAR)) ant -Dpermit.jdk6.builds=true -f nbbuild/build.xml clean cd o.n.bootstrap/launcher/windows && make clean cd apisupport.harness/windows-launcher-src && make clean mh_clean # remove all the symlinks to jar files we created find . -name "*.jar" -type l -execdir rm -f \{\} \; # -rm -f libs.osgi/external/osgi.core-4.2.jar -rm -rf nbbuild/external/xhtml1-dtds -rm -f nbbuild/nbproject/private/scan-cache-standard.ser # -rm -f nbbuild/nbantext.jar # -rm -rf debian/jar_tmp -rm -f debian/license_accepted # these files are not deleted by ant clean though it should so delete here -rm -f swingapp/src/org/netbeans/modules/swingapp/resources/CRUDShellApp.zip -rm -f swingapp/src/org/netbeans/modules/swingapp/resources/BasicShellApp.zip # TODO - shouldn't have to do this # -rm -rf */build # # -rm -f stamp-build-$(pkg-nb) # -rm -f nbbuild/netbeans/platform # -rm -f nbbuild/netbeans/harness # -rm -f o.apache.tools.ant.module/external/lib override_jh_depends: # Skipping jh_depends run - since we use symlinks to /usr/share/java then # jh_depends gets it wrong. get-orig-source: uscan --download-version $(subst +dfsg\d*,,$(DEB_UPSTREAM_VERSION)) --force-download debian/libnb-ide14-java.lintian-overrides0000664000000000000000000000040511720272354015463 0ustar # Netbeans builds lots of codeless jars on purpose, so don't warn us about them libnb-ide14-java: codeless-jar # It is a library of sorts, although it installs as a netbeans cluster rather # than in /usr/share/java libnb-ide14-java: javalib-but-no-public-jars debian/libnb-org-openide-util-java.lintian-overrides0000664000000000000000000000022211720272354017735 0ustar # Netbeans has it's own way to set the classpath, and it breaks things if we # set it separately. libnb-org-openide-util-java: missing-classpath debian/libnb-platform13-java-doc.javadoc0000664000000000000000000000010311720272354015254 0ustar nbbuild/build/javadoc /usr/share/doc/libnb-platform13-java-doc/api