Skip to content

Commit

Permalink
Eclipse 4.34 (M3) JDT Patch for Groovy-Eclipse
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Nov 8, 2024
1 parent d21e790 commit 1c704ec
Show file tree
Hide file tree
Showing 1,043 changed files with 12,727 additions and 8,530 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2021 the original author or authors.
* Copyright 2009-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -121,19 +121,23 @@ public void testSealed2() {
"1. ERROR in Foo.groovy (at line 1)\n" +
"\t@groovy.transform.Sealed(permittedSubclasses=[Bar,Baz])\n" +
"\t ^^^\n" +
"Permitted class Bar does not declare Foo as direct super class\n" +
(javaModelSealedSupport2()
? "Permitted type Bar does not declare Foo as a direct supertype\n"
: "Permitted class Bar does not declare Foo as direct super class\n") +
"----------\n" +
"----------\n" +
"1. ERROR in Baz.groovy (at line 1)\n" +
"\tclass Baz extends Foo {\n" +
"\t ^^^\n" +
"The class Baz with a sealed direct superclass or a sealed direct superinterface Foo should be declared either final, sealed, or non-sealed\n" +
"The class Baz with a sealed direct super" + (javaModelSealedSupport2() ? "type" : "class or a sealed direct superinterface") +
" Foo should be declared either final, sealed, or non-sealed\n" +
"----------\n" +
"----------\n" +
"1. ERROR in Boo.groovy (at line 1)\n" +
"\tclass Boo extends Foo {\n" +
"\t ^^^\n" +
"The class Boo with a sealed direct superclass or a sealed direct superinterface Foo should be declared either final, sealed, or non-sealed\n" +
"The class Boo with a sealed direct super" + (javaModelSealedSupport2() ? "type" : "class or a sealed direct superinterface") +
" Foo should be declared either final, sealed, or non-sealed\n" +
"----------\n" +
"2. ERROR in Boo.groovy (at line 1)\n" +
"\tclass Boo extends Foo {\n" +
Expand All @@ -143,7 +147,9 @@ public void testSealed2() {
"3. ERROR in Boo.groovy (at line 1)\n" +
"\tclass Boo extends Foo {\n" +
"\t ^^^\n" +
"The type Boo extending a sealed class Foo should be a permitted subtype of Foo\n" +
(javaModelSealedSupport2()
? "The class Boo cannot extend the class Foo as it is not a permitted subtype of Foo\n"
: "The type Boo extending a sealed class Foo should be a permitted subtype of Foo\n") +
"----------\n");
}

Expand Down Expand Up @@ -176,7 +182,8 @@ public void testSealed3() {
"1. ERROR in p\\Baz.java (at line 2)\n" +
"\tclass Baz extends Foo {\n" +
"\t ^^^\n" +
"The class Baz with a sealed direct superclass or a sealed direct superinterface Foo should be declared either final, sealed, or non-sealed\n" +
"The class Baz with a sealed direct super" + (javaModelSealedSupport2() ? "type" : "class or a sealed direct superinterface") +
" Foo should be declared either final, sealed, or non-sealed\n" +
"----------\n");
}

Expand All @@ -187,4 +194,9 @@ private static boolean javaModelSealedSupport() {
return org.eclipse.jdt.core.JavaCore.getPlugin().getBundle().getVersion()
.compareTo(org.osgi.framework.Version.parseVersion("3.28")) >= 0;
}

private static boolean javaModelSealedSupport2() {
return org.eclipse.jdt.core.JavaCore.getPlugin().getBundle().getVersion()
.compareTo(org.osgi.framework.Version.parseVersion("3.40")) >= 0;
}
}
2 changes: 1 addition & 1 deletion groovy-eclipse.setup
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
<repository
url="https://download.eclipse.org/eclipse/updates/4.34"/>
<repository
url="https://download.eclipse.org/eclipse/updates/4.34-I-builds/I20240926-1800"/>
url="https://download.eclipse.org/eclipse/updates/4.34-I-builds/I20241107-0510"/>
</repositoryList>
<repositoryList
name="2024-09">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</license>

<requires>
<import feature="org.eclipse.jdt" version="3.20.0.v20240926-1800" patch="true"/>
<import feature="org.eclipse.jdt" version="3.20.0.v20241107-0648" patch="true"/>
</requires>

<plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ formatter_profile=_Jdtcore [built-in + Indent switch body + LineWidth\:120]
formatter_settings_version=11
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=true
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=
org.eclipse.jdt.ui.keywordthis=true
org.eclipse.jdt.ui.ondemandthreshold=10
org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=10
sp_cleanup.add_all=false
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
Expand All @@ -62,52 +67,140 @@ sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=false
sp_cleanup.add_missing_override_annotations_interface_methods=false
sp_cleanup.add_serial_version_id=false
sp_cleanup.also_simplify_lambda=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.array_with_curly=false
sp_cleanup.arrays_fill=false
sp_cleanup.bitwise_conditional_expression=false
sp_cleanup.boolean_literal=false
sp_cleanup.boolean_value_rather_than_comparison=false
sp_cleanup.break_loop=false
sp_cleanup.collection_cloning=false
sp_cleanup.comparing_on_criteria=false
sp_cleanup.comparison_statement=false
sp_cleanup.controlflow_merge=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false
sp_cleanup.convert_to_switch_expressions=false
sp_cleanup.correct_indentation=false
sp_cleanup.do_while_rather_than_while=false
sp_cleanup.double_negation=false
sp_cleanup.else_if=false
sp_cleanup.embedded_if=false
sp_cleanup.evaluate_nullable=false
sp_cleanup.extract_increment=false
sp_cleanup.format_source_code=false
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.hash=false
sp_cleanup.if_condition=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.instanceof=false
sp_cleanup.instanceof_keyword=false
sp_cleanup.invert_equals=false
sp_cleanup.join=false
sp_cleanup.lazy_logical_operator=false
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.map_cloning=false
sp_cleanup.merge_conditional_blocks=false
sp_cleanup.multi_catch=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.no_string_creation=false
sp_cleanup.no_super=false
sp_cleanup.number_suffix=false
sp_cleanup.objects_equals=false
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=false
sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
sp_cleanup.operand_factorization=false
sp_cleanup.organize_imports=true
sp_cleanup.overridden_assignment=false
sp_cleanup.overridden_assignment_move_decl=false
sp_cleanup.plain_replacement=false
sp_cleanup.precompile_regex=false
sp_cleanup.primitive_comparison=false
sp_cleanup.primitive_parsing=false
sp_cleanup.primitive_rather_than_wrapper=false
sp_cleanup.primitive_serialization=false
sp_cleanup.pull_out_if_from_if_else=false
sp_cleanup.pull_up_assignment=false
sp_cleanup.push_down_negation=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.reduce_indentation=false
sp_cleanup.redundant_comparator=false
sp_cleanup.redundant_falling_through_block_end=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=false
sp_cleanup.remove_redundant_semicolons=false
sp_cleanup.remove_redundant_type_arguments=false
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_array_creation=false
sp_cleanup.remove_unnecessary_casts=false
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=false
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_method_parameters=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.replace_deprecated_calls=false
sp_cleanup.return_expression=false
sp_cleanup.simplify_boolean_if_else=false
sp_cleanup.simplify_lambda_expression_and_method_ref=false
sp_cleanup.single_used_field=false
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.standard_comparison=false
sp_cleanup.static_inner_class=false
sp_cleanup.strictly_equal_or_different=false
sp_cleanup.stringbuffer_to_stringbuilder=false
sp_cleanup.stringbuilder=false
sp_cleanup.stringbuilder_for_local_vars=false
sp_cleanup.stringconcat_stringbuffer_stringbuilder=false
sp_cleanup.stringconcat_to_textblock=false
sp_cleanup.substring=false
sp_cleanup.switch=false
sp_cleanup.system_property=false
sp_cleanup.system_property_boolean=false
sp_cleanup.system_property_file_encoding=false
sp_cleanup.system_property_file_separator=false
sp_cleanup.system_property_javaspecversion=false
sp_cleanup.system_property_javaversion=false
sp_cleanup.system_property_line_separator=false
sp_cleanup.system_property_path_separator=false
sp_cleanup.ternary_operator=false
sp_cleanup.try_with_resource=false
sp_cleanup.unlooped_while=false
sp_cleanup.unreachable_block=false
sp_cleanup.update_ibm_copyright_to_current_year=true
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_autoboxing=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_directly_map_method=false
sp_cleanup.use_lambda=false
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_string_is_blank=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
sp_cleanup.use_unboxing=false
sp_cleanup.use_var=false
sp_cleanup.useless_continue=false
sp_cleanup.useless_return=false
sp_cleanup.valueof_rather_than_instantiation=false
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ src.includes = about.html,\
#GROOVY add
compilerArg = --limit-modules java.base
#GROOVY end
jars.extra.classpath = lib/javax20api.jar,platform:/plugin/org.apache.ant/lib/ant.jar
jars.extra.classpath = lib/javax23api.jar,platform:/plugin/org.apache.ant/lib/ant.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Commandline.Argument;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.antadapter.AntAdapterMessages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.util.Arrays;
import java.util.List;

import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,11 @@ public interface IProblem {
/** @since 3.1 */
int DiscouragedReference = TypeRelated + 280;

/**
* @since 3.40
*/
int LambdaParameterIsNeverUsed = Internal + 281;

int InterfaceCannotHaveInitializers = TypeRelated + 300;
int DuplicateModifierForType = TypeRelated + 301;
int IllegalModifierForClass = TypeRelated + 302;
Expand Down Expand Up @@ -2226,6 +2231,8 @@ public interface IProblem {
int PreviewAPIUsed = Compliance + 1108;
/** @since 3.39*/
int JavaVersionNotSupported = Compliance + 1109;
/** @since 3.40*/
int JavaVersionTooRecent = Compliance + 1110;

/** @since 3.13 */
int UnlikelyCollectionMethodArgumentType = 1200;
Expand Down Expand Up @@ -2310,41 +2317,63 @@ public interface IProblem {
/* Java14 errors - begin */
/** @since 3.21 */
int SwitchExpressionsYieldIncompatibleResultExpressionTypes = TypeRelated + 1700;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldEmptySwitchBlock = Syntax + 1701;
/** @since 3.21 */
int SwitchExpressionsYieldNoResultExpression = Internal + 1702;
/** @since 3.21 */
int SwitchExpressionaYieldSwitchLabeledBlockCompletesNormally = Internal + 1703;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldLastStatementCompletesNormally = Internal + 1704;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldTrailingSwitchLabels = Internal + 1705;
/** @since 3.21 */
int SwitchPreviewMixedCase = Syntax + 1706;
/** @since 3.21 */
int SwitchExpressionsYieldMissingDefaultCase = Syntax + 1707;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldMissingValue = Syntax + 1708;
/** @since 3.21 */
int SwitchExpressionsYieldMissingEnumConstantCase = Syntax + 1709;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldIllegalLastStatement = Internal + 1710;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldBreakNotAllowed = Syntax + 1711;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldUnqualifiedMethodWarning = Syntax + 1712;
/** @since 3.21 */
int SwitchExpressionsYieldUnqualifiedMethodError = Syntax + 1713;
/** @since 3.21 */
int SwitchExpressionsYieldOutsideSwitchExpression = Syntax + 1714;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldRestrictedGeneralWarning = Internal + 1715;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldIllegalStatement = Internal + 1716;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldTypeDeclarationWarning = Internal + 1717;
/** @since 3.21 */
/** @since 3.21
* @deprecated no longer issued - will be removed
*/
int SwitchExpressionsYieldTypeDeclarationError = Internal + 1718;
/** @since 3.22 */
int MultiConstantCaseLabelsNotSupported = Syntax + 1719;
Expand Down Expand Up @@ -2531,7 +2560,9 @@ public interface IProblem {
int SealedPermittedTypeOutsideOfPackage = TypeRelated + 1859;
/** @since 3.28 */
int SealedSealedTypeMissingPermits = TypeRelated + 1860;
/** @since 3.28 */
/** @since 3.28
* @deprecated problem no longer generated
*/
int SealedInterfaceIsSealedAndNonSealed = TypeRelated + 1861;
/** @since 3.28 */
int SealedDisAllowedNonSealedModifierInInterface = TypeRelated + 1862;
Expand All @@ -2541,11 +2572,19 @@ public interface IProblem {
int SealedLocalDirectSuperTypeSealed = TypeRelated + 1864;
/** @since 3.28 */
int SealedAnonymousClassCannotExtendSealedType = TypeRelated + 1865;
/** @since 3.28 */
/** @since 3.28
* @deprecated problem no longer generated
*/
int SealedSuperTypeInDifferentPackage = TypeRelated + 1866;
/** @since 3.28 */
/** @since 3.28
* @deprecated problem no longer generated
*/
int SealedSuperTypeDisallowed = TypeRelated + 1867;
/* Java15 errors - end */
/**
* @since 3.40
*/
int FunctionalInterfaceMayNotbeSealed = TypeRelated + 1868;
/* Java17 Sealed types errors - end */

/**
* @since 3.28
Expand Down
Loading

0 comments on commit 1c704ec

Please sign in to comment.