From 60b1305cad1f3cf1aa1bc0fbdf583d19ba04c7d4 Mon Sep 17 00:00:00 2001 From: Konstantin Nisht Date: Wed, 23 Aug 2023 16:49:38 +0200 Subject: [PATCH] [groovy] IDEA-330543: Update bundled groovy to 3.0.19 Required for migration to JBR 21 GitOrigin-RevId: bf73e7dbe92f9a652fae04ff2c58c84885057e87 --- .../libraries/org_codehaus_groovy_groovy.xml | 10 +- .../org_codehaus_groovy_groovy_ant.xml | 10 +- .../org_codehaus_groovy_groovy_json.xml | 10 +- .../org_codehaus_groovy_groovy_jsr223.xml | 10 +- .../org_codehaus_groovy_groovy_templates.xml | 10 +- .../org_codehaus_groovy_groovy_xml.xml | 10 +- .../custom/CustomFileTypeLexerTest.groovy | 17 +-- .../lang/highlighting/GrAssignAutoTest.groovy | 101 ++++++++++++------ 8 files changed, 100 insertions(+), 78 deletions(-) diff --git a/.idea/libraries/org_codehaus_groovy_groovy.xml b/.idea/libraries/org_codehaus_groovy_groovy.xml index 53f93f1537c3..62a107961d2c 100644 --- a/.idea/libraries/org_codehaus_groovy_groovy.xml +++ b/.idea/libraries/org_codehaus_groovy_groovy.xml @@ -1,18 +1,18 @@ - + - - 044569c20b1438263470585627da1b2c9722f1fb8d89f94e78c0ff219abd0146 + + 7ad326b0a7e49791f552313e35df7406c1a46bb6faf7908c2ecbb74daeff23fb - + - + \ No newline at end of file diff --git a/.idea/libraries/org_codehaus_groovy_groovy_ant.xml b/.idea/libraries/org_codehaus_groovy_groovy_ant.xml index 56c6ea1a80de..e18fcce16a7d 100644 --- a/.idea/libraries/org_codehaus_groovy_groovy_ant.xml +++ b/.idea/libraries/org_codehaus_groovy_groovy_ant.xml @@ -1,18 +1,18 @@ - + - - 6b98dcf1309448d48b5a9762e94073fbee17cc45ff2b91b3d74a34b4945517c7 + + 4bb1ef7f1dc01950e910b7dbc04010a999fc11f41a6dda02a7228036dd0a2379 - + - + \ No newline at end of file diff --git a/.idea/libraries/org_codehaus_groovy_groovy_json.xml b/.idea/libraries/org_codehaus_groovy_groovy_json.xml index 421ac4c0203b..bf6d782ced7b 100644 --- a/.idea/libraries/org_codehaus_groovy_groovy_json.xml +++ b/.idea/libraries/org_codehaus_groovy_groovy_json.xml @@ -1,18 +1,18 @@ - + - - 921972defd8a89a5ab442f5ae57b1760755d7fe339dce46fe140e79a6e63e066 + + 6f4b1f79e8745b1546b96d248f50f1122e0697b6d33bbdd3af362ebc8fd19df3 - + - + \ No newline at end of file diff --git a/.idea/libraries/org_codehaus_groovy_groovy_jsr223.xml b/.idea/libraries/org_codehaus_groovy_groovy_jsr223.xml index 09cd7e483f6b..3f0e8fc4ef1e 100644 --- a/.idea/libraries/org_codehaus_groovy_groovy_jsr223.xml +++ b/.idea/libraries/org_codehaus_groovy_groovy_jsr223.xml @@ -1,18 +1,18 @@ - + - - d834f8d0e07fa73f5a59f700903180c1d834acde8ca03dd79641ef1460c82a4e + + 3a01fc77e1813aa032fd1db371d6f436e5c6fa6ee78f0f538002522e584fd522 - + - + \ No newline at end of file diff --git a/.idea/libraries/org_codehaus_groovy_groovy_templates.xml b/.idea/libraries/org_codehaus_groovy_groovy_templates.xml index 2c5c8729cbcf..cef8e908bb1b 100644 --- a/.idea/libraries/org_codehaus_groovy_groovy_templates.xml +++ b/.idea/libraries/org_codehaus_groovy_groovy_templates.xml @@ -1,18 +1,18 @@ - + - - abfb7190631a35fc96e023bfcd4658f3f7d4ae76c488ef1b972a54b29809ddc2 + + 5d094c043aa9beaa090b75c6ab4e9bbb07de0d7b3e39f292f12c50ddae0f8f3d - + - + \ No newline at end of file diff --git a/.idea/libraries/org_codehaus_groovy_groovy_xml.xml b/.idea/libraries/org_codehaus_groovy_groovy_xml.xml index 91c7f7d4915d..9ae268b7a331 100644 --- a/.idea/libraries/org_codehaus_groovy_groovy_xml.xml +++ b/.idea/libraries/org_codehaus_groovy_groovy_xml.xml @@ -1,18 +1,18 @@ - + - - 8faea983f0d871bd2d2f28150747edf9047dd4d716700a0276eaa905a5cd0816 + + 1527f7c7778dda9c87c8c905b81aba865e5dc7b92932bf2d04b85e96b3f8ad9e - + - + \ No newline at end of file diff --git a/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.groovy b/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.groovy index 088de2b29398..1a14dd9b5f9a 100644 --- a/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.groovy +++ b/platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.groovy @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * 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. - */ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.highlighter.custom import com.intellij.lang.cacheBuilder.WordOccurrence @@ -458,6 +444,7 @@ IDENTIFIER ('foo') def expectedWords = ['a', 'b', 'c', 'd', 'e$', 'foo'] scanner.processWords(text, { WordOccurrence w -> + assert w instanceof WordOccurrence // groovy 3.0.19 bug words.add(w.baseText.subSequence(w.start, w.end)) } as Processor) assert words == expectedWords diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignAutoTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignAutoTest.groovy index faf459c8b1e4..f1f93cf6db3d 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignAutoTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GrAssignAutoTest.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.plugins.groovy.lang.highlighting import com.intellij.codeInspection.InspectionProfileEntry @@ -15,6 +15,7 @@ import org.jetbrains.plugins.groovy.codeInspection.assignment.GroovyAssignabilit import org.jetbrains.plugins.groovy.util.Slow import static org.assertj.core.api.Assertions.assertThat + /** * Character and char are skipped intentionally. * Double and Double[] are skipped intentionally. @@ -90,27 +91,24 @@ class GrAssignAutoTest extends GrHighlightingTestBase { } ''', typesXTypes, - [], - ["boolean -> int", "boolean -> double", "boolean -> short", "boolean -> byte", - "List -> boolean[]", "List -> int[]", "List -> double[]", "List -> String[]", "List -> Integer[]", "List -> List[]", "List -> Object[]", "List -> Thread[]", - "List -> int[]", "List -> Integer[]", "List -> List[]", "List -> Thread[]", - "List -> int[]", "List -> double[]", "List -> Integer[]", "List -> List[]", "List -> Thread[]", - "List -> List[]", "List -> Thread[]", - "List -> int[]", "List -> double[]", "List -> Integer[]", "List -> List[]", "List -> Thread[]", - "List -> int[]", "List -> double[]", "List -> Integer[]", "List -> List[]", "List -> Thread[]", - "List -> int[]", "List -> double[]", "List -> Integer[]", "List -> List[]", + ['List -> boolean[]', 'List -> double[]', 'List -> String[]', 'List -> Object[]', 'List -> boolean[]', 'List -> String[]','List -> Object[]', + 'List -> boolean[]', 'List -> int[]', 'List -> double[]', 'List -> String[]', 'List -> Integer[]', 'List -> Object[]', + 'List -> boolean[]', 'List -> String[]', 'List -> Object[]', + 'List -> boolean[]', 'List -> String[]', 'List -> Object[]', 'List -> boolean[]', + 'List -> String[]','List -> Object[]', 'List -> Thread[]', + 'Set -> boolean[]', 'Set -> String[]', 'Set -> Object[]', + 'Set -> boolean[]', 'Set -> int[]', 'Set -> double[]', 'Set -> String[]', 'Set -> Integer[]', 'Set -> Object[]', + 'Set -> boolean[]', 'Set -> String[]', 'Set -> Object[]', + 'Set -> boolean[]', 'Set -> String[]', 'Set -> Object[]', 'Set -> Thread[]'], + ["boolean -> int", "boolean -> double", "boolean -> short", "boolean -> byte", "boolean[] -> String[]", "boolean[] -> Object[]", "boolean[] -> int[]", "boolean[] -> double[]", - "int[] -> boolean[]", - "double[] -> boolean[]", - "Integer[] -> String[]", - "List[] -> String[]", - "Object[] -> String[]", - "Thread[] -> String[]", - "Set -> boolean[]", "Set -> int[]", "Set -> double[]", "Set -> String[]", "Set -> Integer[]", "Set -> List[]", "Set -> Object[]", "Set -> Thread[]", - "Set -> int[]", "Set -> double[]", "Set -> Integer[]", "Set -> List[]", "Set -> Thread[]", - "Set -> List[]", "Set -> Thread[]", - "Set -> int[]", "Set -> double[]", "Set -> Integer[]", "Set -> List[]", "Set -> Thread[]", - "Set -> int[]", "Set -> double[]", "Set -> Integer[]", "Set -> List[]"] + "int[] -> boolean[]", "int[] -> String[]", "int[] -> Integer[]", "int[] -> Object[]", + "double[] -> boolean[]", "double[] -> Integer[]", "double[] -> Object[]", "double[] -> String[]", + "Integer[] -> String[]", "Integer[] -> boolean[]", "Integer[] -> int[]", "Integer[] -> double[]", + "String[] -> boolean[]", + "List[] -> String[]", "List[] -> boolean[]", + "Object[] -> String[]", "Object[] -> boolean[]", + "Thread[] -> String[]", "Thread[] -> boolean[]"] } @@ -123,14 +121,33 @@ class GrAssignAutoTest extends GrHighlightingTestBase { ''', typesXTypes, [], - ['boolean -> int', 'boolean -> double', 'boolean -> short', 'boolean -> byte', - 'boolean[] -> int[]', 'boolean[] -> double[]', - 'int[] -> boolean[]', - 'double[] -> boolean[]', - 'Integer[] -> String[]', - 'List[] -> String[]', - 'Object[] -> String[]', - 'Thread[] -> String[]'] + ["boolean -> int", + "boolean -> double", + "boolean -> short", + "boolean -> byte", + "boolean[] -> int[]", + "boolean[] -> double[]", + "boolean[] -> String[]", + "boolean[] -> Object[]", + "int[] -> boolean[]", + "int[] -> String[]", + "int[] -> Integer[]", + "int[] -> Object[]", + "double[] -> boolean[]", + "double[] -> String[]", + "double[] -> Integer[]", + "double[] -> Object[]", + "String[] -> boolean[]", + "Integer[] -> boolean[]", + "Integer[] -> int[]", + "Integer[] -> double[]", + "Integer[] -> String[]", + "List[] -> boolean[]", + "List[] -> String[]", + "Object[] -> boolean[]", + "Object[] -> String[]", + "Thread[] -> boolean[]", + "Thread[] -> String[]"] } void testParameterMethodCall() { @@ -145,7 +162,7 @@ class GrAssignAutoTest extends GrHighlightingTestBase { ''', typesXTypes, ['int -> double[]', 'short -> int[]', 'short -> double[]', 'byte -> int[]', 'byte -> double[]', 'short -> Integer[]', 'byte -> Integer[]'], - ['int[] -> double[]'] + [] } void testReturnAssignValue() { @@ -175,10 +192,28 @@ class GrAssignAutoTest extends GrHighlightingTestBase { } ''', valuesXTypes, - ['[0L] -> BigInteger', '(Void)null -> Object'], + ['[0L] -> BigInteger', '(Void)null -> Object', '[1] -> int', '[1] -> double', '[0L] -> double', '[1.2f] -> double', '["str"] -> int', '["str"] -> double', '["str"] -> short', '["str"] -> byte', 'new ArrayList<>() -> boolean[]', 'new ArrayList<>() -> String[]', 'new ArrayList<>() -> Object[]'], [ - '[] -> int', '[] -> double', '[] -> short', '[] -> byte', - 'new ArrayList<>() -> int[]', 'new ArrayList<>() -> double[]', 'new ArrayList<>() -> Integer[]', 'new ArrayList<>() -> List[]', 'new ArrayList<>() -> Thread[]' + "[1] -> List", "[1] -> Set", "[1] -> Set", "[1] -> Set", + "[0L] -> List", + "[0L] -> Set", + "[0L] -> Set", + "[1.1] -> List", + "[1.1] -> Set", + "[1.1] -> Set", + "[1.2f] -> List", + "[1.2f] -> Set", + "[1.2f] -> Set", + "[\"str\"] -> List", + "[\"str\"] -> Set", + "[\"str\"] -> Set", + "[\"str\"] -> Set", + "[new Object()] -> Set", + "[new Object()] -> Set", + "[new Thread()] -> List", + "[new Thread()] -> Set", + "[new Thread()] -> Set", + "[new Thread()] -> Set" ] }