[jira] [Resolved] (NETBEANS-6132) java.lang.OutOfMemoryError: Java heap space
[ https://issues.apache.org/jira/browse/NETBEANS-6132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Laszlo Kishalmi resolved NETBEANS-6132. --- Resolution: Duplicate > java.lang.OutOfMemoryError: Java heap space > --- > > Key: NETBEANS-6132 > URL: https://issues.apache.org/jira/browse/NETBEANS-6132 > Project: NetBeans > Issue Type: Bug >Affects Versions: 12.4 > Environment: Windows 10, 10.0, amd64 > OpenJDK 64-Bit Server VM, 16.0.1+9-24, OpenJDK Runtime Environment, > 16.0.1+9-24 > >Reporter: John Doe >Priority: Major > Attachments: IDE.log, UI.log > > > just started my NetBeans IDE 12.4 with a pre-existed php-project, after start > i see the exception-message. -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Updated] (NETBEANS-6008) Update FlatLAF to 1.6 as 1.4 has several regressions
[ https://issues.apache.org/jira/browse/NETBEANS-6008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ASF GitHub Bot updated NETBEANS-6008: - Labels: pull-request-available (was: ) > Update FlatLAF to 1.6 as 1.4 has several regressions > > > Key: NETBEANS-6008 > URL: https://issues.apache.org/jira/browse/NETBEANS-6008 > Project: NetBeans > Issue Type: Improvement > Components: FlatLaf >Affects Versions: 12.5 >Reporter: Markus Sunela >Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > The current FlatLaf version, 1.4, has several regressions compared to the old > 1.1.2. For example [https://github.com/JFormDesigner/FlatLaf/issues/371] > causes severe problems in our software built on NetBeans platform. > FlatLaf has just released a new version 1.6 that addresses many regressions. > The new version should be used in NetBeans: > [https://github.com/JFormDesigner/FlatLaf/releases/tag/1.6|https://github.com/JFormDesigner/FlatLaf/releases/tag/1.6.]. -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Updated] (NETBEANS-6130) Fix wrong Groovy library name
[ https://issues.apache.org/jira/browse/NETBEANS-6130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ASF GitHub Bot updated NETBEANS-6130: - Labels: pull-request-available (was: ) > Fix wrong Groovy library name > - > > Key: NETBEANS-6130 > URL: https://issues.apache.org/jira/browse/NETBEANS-6130 > Project: NetBeans > Issue Type: Bug > Components: projects - Libraries >Affects Versions: 12.5 >Reporter: José Contreras >Assignee: José Contreras >Priority: Trivial > Labels: pull-request-available > Fix For: 12.6 > > Attachments: Screenshot from 2021-10-14 15-40-10.png, Screenshot from > 2021-10-14 15-40-50.png > > Time Spent: 10m > Remaining Estimate: 0h > > Wrong version number in the library. > It is 2.5.11 > Should be 3.0.8 -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[netbeans] branch master updated (35a7889 -> 88ef37e)
This is an automated email from the ASF dual-hosted git repository. matthiasblaesing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git. from 35a7889 [NETBEANS-6107] Bumped Gradle Tooling to 7.3-rc-1 with Java 17 support. new 52d4ec1 Remove JARs fom repository to simplify release review new c15fa76 Add MANIFEST.mf to fake JARs new 6ae59da Build NBMs for autoupdate tests instead of using pre-build binaries new 5ffd3ed Remove ZIP files as much as possible new 88ef37e Merge pull request #3162 from matthiasblaesing/remove_jars The 6005 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../test/unit/data/nottaDir-4_1_2.jar |1 - .../test/unit/data/subdir/nottaDir-5.0.jar |1 - .../netbeans/modules/glassfish/spi/UtilsTest.java | 11 +- .../test/unit/data/nottaDir-4_1_2.jar |1 - .../test/unit/data/subdir/nottaDir-5.0.jar |1 - .../org/netbeans/modules/payara/spi/UtilsTest.java | 14 +- ide/git/build.xml |6 + ide/git/test/qa-functional/data/files/pp.zip | Bin 322 -> 0 bytes .../src/org/netbeans/test/git/utils/TestKit.java |2 +- .../data/{biglist.zip => biglist.txt.gz} | Bin .../org/netbeans/test/ide/VCSClassLoadingTest.java | 31 +- ide/mercurial/build.xml| 14 + .../test/qa-functional/data/JavaApp_repo.zip | Bin 11992 -> 0 bytes .../test/qa-functional/data/JavaApp_repo/hgignore |4 + ide/mercurial/test/qa-functional/data/files/pp.zip | Bin 322 -> 0 bytes ide/subversion/build.xml |7 +- .../test/qa-functional/data/files/pp.zip | Bin 322 -> 0 bytes ...serData.zip => svn_workingcopy_sample_data.zip} | Bin ide/xml.schema.model/build.xml | 30 + .../model/resources/cyclic_dependencies/A.xsd} | 18 +- .../model/resources/cyclic_dependencies/B.xsd} | 27 +- .../model/resources/cyclic_dependencies/C.xsd} | 16 +- .../model/resources/cyclic_dependencies/D.xsd} | 16 +- .../model/resources/cyclic_dependencies/E.xsd} | 17 +- .../model/resources/cyclic_dependencies/F.xsd} | 16 +- .../xml/schema/model/resources/performance1/A.xsd} | 18 +- .../xml/schema/model/resources/performance1/C.xsd} | 30 +- .../resources/performance1/unresolvedIncludes.xsd | 130 +++ .../xml/schema/model/resources/performance2/A.xsd | 1149 .../xml/schema/model/resources/performance2/B.xsd | 127 +++ .../xml/schema/model/resources/performance2/C.xsd | 140 +++ .../xml/schema/model/resources/resolve1/T1B.xsd} | 15 +- .../xml/schema/model/resources/resolve1/T1C.xsd} | 16 +- .../xml/schema/model/resources/resolve1/T1D.xsd} | 15 +- .../xml/schema/model/resources/resolve10/T10B.xsd} | 16 +- .../xml/schema/model/resources/resolve10/T10C.xsd} | 10 +- .../xml/schema/model/resources/resolve10/T10D.xsd} | 11 +- .../xml/schema/model/resources/resolve10/T10E.xsd} | 16 +- .../xml/schema/model/resources/resolve11/T11B.xsd} | 14 +- .../xml/schema/model/resources/resolve11/T11C.xsd} | 10 +- .../xml/schema/model/resources/resolve11/T11D.xsd} | 11 +- .../xml/schema/model/resources/resolve11/T11E.xsd} | 16 +- .../xml/schema/model/resources/resolve12/T12B.xsd} | 15 +- .../xml/schema/model/resources/resolve12/T12C.xsd} | 12 +- .../xml/schema/model/resources/resolve12/T12D.xsd} |9 +- .../xml/schema/model/resources/resolve12/T12E.xsd} | 15 +- .../xml/schema/model/resources/resolve12/T12F.xsd} | 13 +- .../xml/schema/model/resources/resolve13/T13B.xsd} | 14 +- .../xml/schema/model/resources/resolve13/T13C.xsd} | 11 +- .../xml/schema/model/resources/resolve13/T13D.xsd} |8 +- .../xml/schema/model/resources/resolve13/T13E.xsd} | 15 +- .../xml/schema/model/resources/resolve13/T13F.xsd} | 11 +- .../xml/schema/model/resources/resolve14/T14B.xsd} | 13 +- .../xml/schema/model/resources/resolve14/T14C.xsd} | 14 +- .../xml/schema/model/resources/resolve14/T14D.xsd} | 10 +- .../xml/schema/model/resources/resolve14/T14E.xsd} | 16 +- .../xml/schema/model/resources/resolve15/T15B.xsd} | 13 +- .../xml/schema/model/resources/resolve15/T15C.xsd} | 14 +- .../xml/schema/model/resources/resolve15/T15D.xsd} | 13 +- .../xml/schema/model/resources/resolve15/T15E.xsd} |9 +- .../xml/schema/model/resources/resolve15/T15F.xsd} | 13 +- .../xml/schema/model/resources/resolve15/T15G.xsd} | 18 +- .../xml/schema/model/resources/resolve2/T2A.xsd} | 17 +- .../xml/schema/model/resources/resolve2/T2B.xsd} | 14 +- .../xml/schema/model/resources/resolve2/T2C.xsd} | 17 +- .../xml/schema/model/resources/resolve3/T
[netbeans] 04/06: Working YAML Parser without auto-recovery.
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git commit c3e2a0293142578085cc5b8853b75945063efe74 Author: Laszlo Kishalmi AuthorDate: Tue Oct 12 18:10:41 2021 -0700 Working YAML Parser without auto-recovery. --- .../modules/languages/yaml/YamlParser.java | 26 +++ .../modules/languages/yaml/YamlParserResult.java | 2 +- .../modules/languages/yaml/YamlSection.java| 81 ++ .../test/unit/data/testfiles/error3.yaml.errors| 2 +- .../test/unit/data/testfiles/error4.yaml | 7 ++ .../test/unit/data/testfiles/error4.yaml.errors| 1 + .../modules/languages/yaml/YamlParserTest.java | 4 ++ 7 files changed, 91 insertions(+), 32 deletions(-) diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java index 01bef63..ff230f4 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java @@ -38,7 +38,6 @@ import org.netbeans.modules.parsing.api.Task; import org.netbeans.modules.parsing.spi.ParseException; import org.netbeans.modules.parsing.spi.SourceModificationEvent; import org.openide.util.NbBundle; -import org.snakeyaml.engine.v2.exceptions.MarkedYamlEngineException; import org.snakeyaml.engine.v2.exceptions.ParserException; import org.snakeyaml.engine.v2.exceptions.ScannerException; @@ -90,7 +89,7 @@ public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { } private YamlParserResult resultForTooLargeFile(Snapshot snapshot) { -YamlParserResult result = new YamlParserResult(snapshot, false); +YamlParserResult result = new YamlParserResult(snapshot); // FIXME this can violate contract of DefaultError (null fo) DefaultError error = new DefaultError(null, NbBundle.getMessage(YamlParser.class, "TooLarge"), null, snapshot.getSource().getFileObject(), 0, 0, Severity.WARNING); @@ -177,7 +176,7 @@ public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { replaceCommonSpecialCharacters(sb); //source = replaceInlineRegexBrackets(source); -YamlParserResult result = new YamlParserResult(snapshot, false); +YamlParserResult result = new YamlParserResult(snapshot); Deque sources = new LinkedList<>(); sources.push(new YamlSection(sb.toString())); @@ -189,22 +188,13 @@ public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { result.addStructure(items); } catch (ScannerException se) { result.addError(section.processScannerException(snapshot, se)); -YamlSection after = section.after(se.getProblemMark().get().getIndex()); -YamlSection before = section.before(se.getContextMark().get().getIndex()); -if (!after.isEmpty()) sources.push(after); -if (!before.isEmpty()) sources.push(before); -if ((before.getLength() + after.getLength()) == section.getLength()) { -LOGGER.info("Chanche to loop forever"); -} +//YamlSection after = section.after(se.getProblemMark().get().getIndex()); +//YamlSection before = section.before(se.getContextMark().get().getIndex()); +//if (!after.isEmpty()) sources.push(after); +//if (!before.isEmpty()) sources.push(before); } catch (ParserException pe ){ result.addError(section.processParserException(snapshot, pe)); -YamlSection after = section.after(pe.getProblemMark().get().getIndex()); -YamlSection before = section.before(pe.getProblemMark().get().getIndex()); -if (!after.isEmpty()) sources.push(after); -if (!before.isEmpty()) sources.push(before); -if ((before.getLength() + after.getLength()) == section.getLength()) { -LOGGER.info("Chanche to loop forever"); -} +//sources.addAll(section.splitOnParserException(pe)); } catch (Exception ex) { String message = ex.getMessage(); if (message != null && message.length() > 0) { @@ -291,7 +281,7 @@ public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { lastResult = parse(source, snapshot); } catch (Exception ioe) { -lastResult = new YamlParserResult(snapshot, false); +lastResult = new YamlParserResult(snapshot); } } } diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParserResult.java b/ide/languages.yaml/src/org/netbeans/m
[netbeans] 02/06: Replace JRuby YAML parser to SnakeYaml
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git commit a6ba4ab4ad16a8e85b537ef19a3cfe2834c7 Author: Laszlo Kishalmi AuthorDate: Mon Oct 4 23:21:19 2021 -0700 Replace JRuby YAML parser to SnakeYaml --- ide/languages.yaml/nbproject/project.xml | 15 +- .../modules/languages/yaml/YamlParser.java | 145 ++-- .../modules/languages/yaml/YamlParserResult.java | 60 +-- .../modules/languages/yaml/YamlScanner.java| 193 - .../languages/yaml/YamlSemanticAnalyzer.java | 84 +++-- 5 files changed, 86 insertions(+), 411 deletions(-) diff --git a/ide/languages.yaml/nbproject/project.xml b/ide/languages.yaml/nbproject/project.xml index 2941904..09f58a9 100644 --- a/ide/languages.yaml/nbproject/project.xml +++ b/ide/languages.yaml/nbproject/project.xml @@ -35,21 +35,12 @@ -org.netbeans.libs.bytelist + org.netbeans.libs.snakeyaml_engine -1 -0.1 - - - -org.netbeans.libs.jvyamlb - - - -1 -0.2.2 +2 +2.3 diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java index 6b6d85b..86db263 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java @@ -18,30 +18,14 @@ */ package org.netbeans.modules.languages.yaml; -import java.io.ByteArrayOutputStream; -import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.event.ChangeListener; -import org.jruby.util.ByteList; -import org.jvyamlb.Composer; -import org.jvyamlb.ParserImpl; -import org.jvyamlb.PositioningComposerImpl; -import org.jvyamlb.PositioningParserImpl; -import org.jvyamlb.PositioningScannerImpl; -import org.jvyamlb.ResolverImpl; -import org.jvyamlb.YAMLConfig; -import org.jvyamlb.events.Event; -import org.jvyamlb.exceptions.PositionedComposerException; -import org.jvyamlb.exceptions.PositionedParserException; -import org.jvyamlb.exceptions.PositionedScannerException; -import org.jvyamlb.nodes.Node; import org.netbeans.api.lexer.Token; import org.netbeans.api.lexer.TokenHierarchy; import org.netbeans.api.lexer.TokenId; @@ -54,6 +38,12 @@ import org.netbeans.modules.parsing.spi.ParseException; import org.netbeans.modules.parsing.spi.Parser; import org.netbeans.modules.parsing.spi.SourceModificationEvent; import org.openide.util.NbBundle; +import org.snakeyaml.engine.v2.api.LoadSettings; +import org.snakeyaml.engine.v2.composer.Composer; +import org.snakeyaml.engine.v2.nodes.Node; +import org.snakeyaml.engine.v2.parser.ParserImpl; +import org.snakeyaml.engine.v2.scanner.ScannerImpl; +import org.snakeyaml.engine.v2.scanner.StreamReader; /** * Parser for YAML. Delegates to the YAML parser shipped with JRuby (jvyamlb) @@ -103,7 +93,7 @@ public class YamlParser extends Parser { } private YamlParserResult resultForTooLargeFile(Snapshot snapshot) { -YamlParserResult result = new YamlParserResult(Collections.emptyList(), this, snapshot, false, null, null); +YamlParserResult result = new YamlParserResult(Collections.emptyList(), this, snapshot, false); // FIXME this can violate contract of DefaultError (null fo) DefaultError error = new DefaultError(null, NbBundle.getMessage(YamlParser.class, "TooLarge"), null, snapshot.getSource().getFileObject(), 0, 0, Severity.WARNING); @@ -203,122 +193,23 @@ public class YamlParser extends Parser { if (isTooLarge(source)) { return resultForTooLargeFile(snapshot); } -ByteList byteList; -int[] byteToUtf8 = null; -int[] utf8toByte = null; - -byte[] bytes = source.getBytes("UTF-8"); // NOI18N -if (bytes.length == source.length()) { -// No position translations necessary - this should be fast -byteList = new ByteList(bytes); -} else { -// There's some encoding happening of unicode characters. -// I need to produce func
[netbeans] 01/06: Added snakeyaml-engine 2.3 as a library project
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git commit 4fdfacecf4fdc2c38631d843cbaae89ea636cc1b Author: Laszlo Kishalmi AuthorDate: Mon Oct 4 07:54:23 2021 -0700 Added snakeyaml-engine 2.3 as a library project --- ide/libs.snakeyaml_engine/build.xml| 24 +++ ide/libs.snakeyaml_engine/external/binaries-list | 17 ++ .../external/snakeyaml-engine-2.3-license.txt | 207 + ide/libs.snakeyaml_engine/manifest.mf | 4 + .../nbproject/project.properties | 21 +++ ide/libs.snakeyaml_engine/nbproject/project.xml| 38 .../libs/snakeyaml_engine/Bundle.properties| 22 +++ nbbuild/cluster.properties | 1 + 8 files changed, 334 insertions(+) diff --git a/ide/libs.snakeyaml_engine/build.xml b/ide/libs.snakeyaml_engine/build.xml new file mode 100644 index 000..0bce4dc --- /dev/null +++ b/ide/libs.snakeyaml_engine/build.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/ide/libs.snakeyaml_engine/external/binaries-list b/ide/libs.snakeyaml_engine/external/binaries-list new file mode 100644 index 000..2b6a948 --- /dev/null +++ b/ide/libs.snakeyaml_engine/external/binaries-list @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +E6EAAFDC8DEA303778E3459707DA0E3D71E969EF org.snakeyaml:snakeyaml-engine:2.3 diff --git a/ide/libs.snakeyaml_engine/external/snakeyaml-engine-2.3-license.txt b/ide/libs.snakeyaml_engine/external/snakeyaml-engine-2.3-license.txt new file mode 100644 index 000..1dba14a --- /dev/null +++ b/ide/libs.snakeyaml_engine/external/snakeyaml-engine-2.3-license.txt @@ -0,0 +1,207 @@ +Name: snakeyaml-engine +Description: YAML 1.2 parser, reader, writer library +Origin: GitHub +Version: 2.3 +License: Apache-2.0 + + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bi
[netbeans] 06/06: Added unittest for YamlSection.
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git commit 3b2b6c82ebec310198ea4fa5f4f1defcf5732099 Author: Laszlo Kishalmi AuthorDate: Sat Oct 16 11:13:06 2021 -0700 Added unittest for YamlSection. --- .../modules/languages/yaml/YamlSection.java| 57 - .../modules/languages/yaml/YamlSectionTest.java| 259 + 2 files changed, 308 insertions(+), 8 deletions(-) diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlSection.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlSection.java index 8ad1ed8..131e7af 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlSection.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlSection.java @@ -21,6 +21,7 @@ package org.netbeans.modules.languages.yaml; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import java.util.Objects; import java.util.Optional; import org.netbeans.modules.csl.api.Severity; import org.netbeans.modules.csl.api.StructureItem; @@ -78,10 +79,10 @@ public class YamlSection { while ((index > 0) && Character.isWhitespace(source.charAt(index))) { index--; } -while ((index > 0) && !Character.isWhitespace(source.charAt(index))) { +while ((index > -1) && !Character.isWhitespace(source.charAt(index))) { index--; } -return before(index); +return before(index + 1); } public YamlSection trimHead() { @@ -228,16 +229,26 @@ public class YamlSection { } } +List split(int a) { +List ret = new LinkedList<>(); +YamlSection before = a < source.length() ? before(a) : trimTail(); +YamlSection after = a > 0 ? after(a) : trimHead(); +if (!after.isEmpty()) { +ret.add(after); +} +if (!before.isEmpty()) { +ret.add(before); +} +return ret; +} + List split(int a, int b) { +if (a == b){ +return split(a); +} List ret = new LinkedList<>(); YamlSection before = before(a); YamlSection after = after(b); -if (before.isEmpty()) { -after = after.trimHead(); -} -if (after.isEmpty()) { -before = before.trimTail(); -} if (!after.isEmpty()) { ret.add(after); } @@ -252,6 +263,36 @@ public class YamlSection { } @Override +public int hashCode() { +int hash = 7; +hash = 79 * hash + this.offset; +hash = 79 * hash + Objects.hashCode(this.source); +return hash; +} + +@Override +public boolean equals(Object obj) { +if (this == obj) { +return true; +} +if (obj == null) { +return false; +} +if (getClass() != obj.getClass()) { +return false; +} +final YamlSection other = (YamlSection) obj; +if (this.offset != other.offset) { +return false; +} +if (!Objects.equals(this.source, other.source)) { +return false; +} +return true; +} + + +@Override public String toString() { return "" + offset + ":" + source; } diff --git a/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlSectionTest.java b/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlSectionTest.java new file mode 100644 index 000..3940b0e --- /dev/null +++ b/ide/languages.yaml/test/unit/src/org/netbeans/modules/languages/yaml/YamlSectionTest.java @@ -0,0 +1,259 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ +package org.netbeans.modules.languages.yaml; + +import java.util.Iterator; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; +import org.netbeans.modules.csl.api.StructureIt
[netbeans] 03/06: Made the new parser work against the tests
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git commit cae021baef6c203a6951af77d2aa517fffd0e333 Author: Laszlo Kishalmi AuthorDate: Tue Oct 12 11:44:08 2021 -0700 Made the new parser work against the tests --- .../modules/languages/yaml/YamlParser.java | 167 + .../modules/languages/yaml/YamlParserResult.java | 34 +--- .../modules/languages/yaml/YamlScanner.java| 183 +++ .../modules/languages/yaml/YamlSection.java| 187 +++ .../languages/yaml/YamlSemanticAnalyzer.java | 67 +++ .../modules/languages/yaml/YamlStructureItem.java | 200 + .../test/unit/data/testfiles/error.yaml.errors | 2 +- .../test/unit/data/testfiles/error2.yaml.errors| 2 +- .../test/unit/data/testfiles/error3.yaml.errors| 2 +- .../unit/data/testfiles/fixture3.yml.structure | 2 - .../test/unit/data/testfiles/test5.yaml.structure | 12 +- .../modules/languages/yaml/YamlParserTest.java | 44 +++-- 12 files changed, 553 insertions(+), 349 deletions(-) diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java index 86db263..01bef63 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java @@ -18,8 +18,8 @@ */ package org.netbeans.modules.languages.yaml; -import java.util.ArrayList; -import java.util.Collections; +import java.util.Deque; +import java.util.LinkedList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -31,26 +31,23 @@ import org.netbeans.api.lexer.TokenHierarchy; import org.netbeans.api.lexer.TokenId; import org.netbeans.api.lexer.TokenSequence; import org.netbeans.modules.csl.api.Severity; +import org.netbeans.modules.csl.api.StructureItem; import org.netbeans.modules.csl.spi.DefaultError; import org.netbeans.modules.parsing.api.Snapshot; import org.netbeans.modules.parsing.api.Task; import org.netbeans.modules.parsing.spi.ParseException; -import org.netbeans.modules.parsing.spi.Parser; import org.netbeans.modules.parsing.spi.SourceModificationEvent; import org.openide.util.NbBundle; -import org.snakeyaml.engine.v2.api.LoadSettings; -import org.snakeyaml.engine.v2.composer.Composer; -import org.snakeyaml.engine.v2.nodes.Node; -import org.snakeyaml.engine.v2.parser.ParserImpl; -import org.snakeyaml.engine.v2.scanner.ScannerImpl; -import org.snakeyaml.engine.v2.scanner.StreamReader; +import org.snakeyaml.engine.v2.exceptions.MarkedYamlEngineException; +import org.snakeyaml.engine.v2.exceptions.ParserException; +import org.snakeyaml.engine.v2.exceptions.ScannerException; /** * Parser for YAML. Delegates to the YAML parser shipped with JRuby (jvyamlb) * * @author Tor Norbye */ -public class YamlParser extends Parser { +public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { private static final Logger LOGGER = Logger.getLogger(YamlParser.class.getName()); /** @@ -93,7 +90,7 @@ public class YamlParser extends Parser { } private YamlParserResult resultForTooLargeFile(Snapshot snapshot) { -YamlParserResult result = new YamlParserResult(Collections.emptyList(), this, snapshot, false); +YamlParserResult result = new YamlParserResult(snapshot, false); // FIXME this can violate contract of DefaultError (null fo) DefaultError error = new DefaultError(null, NbBundle.getMessage(YamlParser.class, "TooLarge"), null, snapshot.getSource().getFileObject(), 0, 0, Severity.WARNING); @@ -102,68 +99,56 @@ public class YamlParser extends Parser { } // package private for unit tests -static String replacePhpFragments(String source) { -// this is a hack. The right solution would be to create a toplevel language, which -// will have embeded yaml and php. -// This code replaces php fragments with space, because jruby parser fails -// on this. -int startReplace = source.indexOf(" -1) { -int endReplace = result.indexOf("?>", startReplace); -if (endReplace > -1) { -endReplace = endReplace + 1; -StringBuilder spaces = new StringBuilder(endReplace - startReplace); -for (int i = 0; i <= endReplace - startReplace; i++) { -spaces.append(' '); +int endReplace = source.indexOf(endToken, startReplace) + 1; +if (endReplace > startReplace) { +for (int i = startReplace; i <= endReplace; i++) { +source.setCharAt(i, ' '); } -result.replace(startReplace, endR
[netbeans] 05/06: Made the YAML parser recover from errors.
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a commit to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git commit 2e9400a80231a4c16325a346d32bf7c3fba29c9c Author: Laszlo Kishalmi AuthorDate: Wed Oct 13 15:50:06 2021 -0700 Made the YAML parser recover from errors. --- .../modules/languages/yaml/YamlParser.java | 55 ++ .../modules/languages/yaml/YamlParserResult.java | 11 - .../modules/languages/yaml/YamlSection.java| 36 +- 3 files changed, 70 insertions(+), 32 deletions(-) diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java index ff230f4..9ce1ecf 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParser.java @@ -18,7 +18,6 @@ */ package org.netbeans.modules.languages.yaml; -import java.util.Deque; import java.util.LinkedList; import java.util.List; import java.util.logging.Level; @@ -103,7 +102,6 @@ public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { if (startReplace == -1) { return; } - while (startReplace > -1) { int endReplace = source.indexOf(endToken, startReplace) + 1; if (endReplace > startReplace) { @@ -178,28 +176,45 @@ public class YamlParser extends org.netbeans.modules.parsing.spi.Parser { YamlParserResult result = new YamlParserResult(snapshot); -Deque sources = new LinkedList<>(); +LinkedList sources = new LinkedList<>(); sources.push(new YamlSection(sb.toString())); +int sourceLength = Integer.MAX_VALUE; +int stallCounter = 0; while (!sources.isEmpty()) { +int len = 0; +for (YamlSection source : sources) { +len += source.length(); +} -YamlSection section = sources.pop(); -try { -List items = section.collectItems(); -result.addStructure(items); -} catch (ScannerException se) { -result.addError(section.processScannerException(snapshot, se)); -//YamlSection after = section.after(se.getProblemMark().get().getIndex()); -//YamlSection before = section.before(se.getContextMark().get().getIndex()); -//if (!after.isEmpty()) sources.push(after); -//if (!before.isEmpty()) sources.push(before); -} catch (ParserException pe ){ -result.addError(section.processParserException(snapshot, pe)); -//sources.addAll(section.splitOnParserException(pe)); -} catch (Exception ex) { -String message = ex.getMessage(); -if (message != null && message.length() > 0) { -result.addError(processError(message, snapshot, 0)); +if (len < sourceLength) { +sourceLength = len; +stallCounter = 0; +} else { +stallCounter++; +} +if (stallCounter < 2) { +YamlSection section = sources.pop(); +try { +List items = section.collectItems(); +result.addStructure(items); +} catch (ScannerException se) { +result.addError(section.processException(snapshot, se)); +for (YamlSection part : section.splitOnException(se)) { +sources.push(part); +} +} catch (ParserException pe ){ +result.addError(section.processException(snapshot, pe)); +for (YamlSection part : section.splitOnException(pe)) { +sources.push(part); +} +} catch (Exception ex) { +String message = ex.getMessage(); +if (message != null && message.length() > 0) { +result.addError(processError(message, snapshot, 0)); +} } +} else { +sources.clear(); } } return result; diff --git a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParserResult.java b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParserResult.java index 4010e73..08f8b7e 100644 --- a/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParserResult.java +++ b/ide/languages.yaml/src/org/netbeans/modules/languages/yaml/YamlParserResult.java @@ -41,7 +41,16 @@ public class YamlParserResult extends ParserResult { } public void addError(Error error) { -errors.add(error); +boolean al
[netbeans] branch use-snakeyaml-parser-improved created (now 3b2b6c8)
This is an automated email from the ASF dual-hosted git repository. lkishalmi pushed a change to branch use-snakeyaml-parser-improved in repository https://gitbox.apache.org/repos/asf/netbeans.git. at 3b2b6c8 Added unittest for YamlSection. This branch includes the following new commits: new 4fdface Added snakeyaml-engine 2.3 as a library project new a6ba4ab Replace JRuby YAML parser to SnakeYaml new cae021b Made the new parser work against the tests new c3e2a02 Working YAML Parser without auto-recovery. new 2e9400a Made the YAML parser recover from errors. new 3b2b6c8 Added unittest for YamlSection. The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Created] (NETBEANS-6133) Copying parameters from the previous version to the new one
Andrey created NETBEANS-6133: Summary: Copying parameters from the previous version to the new one Key: NETBEANS-6133 URL: https://issues.apache.org/jira/browse/NETBEANS-6133 Project: NetBeans Issue Type: Improvement Affects Versions: 12.4, 12.1, 12.5 Environment: Windows 10, netbeans-12.5-bin.zip Reporter: Andrey When unpacking the new version, I replaced in the netbeans.conf file netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/12.5" on netbeans_default_userdir="C:/Develop/netbeans_userdir/netbeans/12.5 " In the ${DEFAULT_USERDIR_ROOT} directory there was information on version 12.1. In the catalog C:/Develop/netbeans_userdir/netbeans/12.5 there is information on version 12.4. But netbeans at the first launch suggested copying the settings not from C:/Develop/netbeans_userdir/netbeans/12.5 but from ${DEFAULT_USERDIR_ROOT}. That is, 12.1. It would be great if, already at the first start, netbeans would get the previous settings from the directory specified in netbeans.conf -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists