Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,24 @@ class SbomPlugin implements Plugin<Project> {
]

private static Map<String, String> LICENSE_MAPPING = [
'pkg:maven/org.antlr/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/jline/[email protected]?type=jar' : 'BSD-2-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-2-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.liquibase.ext/[email protected]?type=jar': 'Apache-2.0', // maps incorrectly because of https://github.com/liquibase/liquibase/issues/2445 & the base pom does not define a license
'pkg:maven/com.oracle.coherence.ce/[email protected]?type=pom': 'UPL-1.0', // does not have map based on license id
'pkg:maven/com.oracle.coherence.ce/[email protected]?type=pom': 'UPL-1.0', // does not have map based on license id
'pkg:maven/jline/[email protected]?type=jar' : 'BSD-2-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/opensymphony/[email protected]?type=jar' : 'OpenSymphony', // custom license approved by legal LEGAL-707
'pkg:maven/org.jruby/[email protected]?type=jar' : 'BSD-3-Clause'// https://web.archive.org/web/20240822213507/http://www.jcraft.com/jzlib/LICENSE.txt shows it's a 3 clause
'pkg:maven/org.antlr/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/[email protected]?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jruby/[email protected]?type=jar' : 'BSD-3-Clause', // https://web.archive.org/web/20240822213507/http://www.jcraft.com/jzlib/LICENSE.txt shows it's a 3 clause
'pkg:maven/org.liquibase.ext/[email protected]?type=jar': 'Apache-2.0', // maps incorrectly because of https://github.com/liquibase/liquibase/issues/2445 & the base pom does not define a license
]

// we don't distribute these so these licenses are considered acceptable, but we still prefer ASF licenses.
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ repositories {
maven {
url = 'https://repository.apache.org/content/groups/staging'
content {
includeModuleByRegex('org[.]apache[.]grails[.]gradle', 'grails-publish')
includeModuleByRegex('org[.]apache[.]((grails[.]gradle)|groovy)', 'grails-publish|groovy.*')
}
mavenContent {
releasesOnly()
Expand Down
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ext {
'bootstrap.version' : '5.3.7',
'commons-codec.version' : '1.18.0',
'geb-spock.version' : '8.0.0',
'groovy.version' : '4.0.29',
'groovy.version' : '5.0.2',
'h2.version' : '2.3.232',
'jackson.version' : '2.19.1',
'jquery.version' : '3.7.1',
Expand All @@ -83,7 +83,7 @@ ext {
'rxjava2.version' : '2.2.21',
'rxjava3.version' : '3.1.11',
'selenium.version' : '4.34.0',
'spock.version' : '2.3-groovy-4.0',
'spock.version' : '2.4-groovy-5.0-SNAPSHOT',
'sitemesh.version' : '2.6.0',
'starter-sitemesh.version' : '3.2.2',
]
Expand Down
11 changes: 11 additions & 0 deletions gradle/functional-test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,22 @@ configurations.configureEach {
}
}

tasks.named('compileTestGroovy') {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.named('compileGroovy') {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

List<String> debugArguments = [
'-Xmx2g', '-Xdebug', '-Xnoagent', '-Djava.compiler=NONE',
'-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'
]
tasks.withType(Test).configureEach { Test task ->

systemProperty('spock.iKnowWhatImDoing.disableGroovyVersionCheck', 'true')

boolean isHibernate5 = !project.name.startsWith('grails-test-examples-hibernate5')
boolean isMongo = !project.name.startsWith('grails-test-examples-mongodb')

Expand Down
9 changes: 9 additions & 0 deletions gradle/test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ dependencies {
add('testRuntimeOnly', 'org.junit.platform:junit-platform-launcher')
}

tasks.named('compileTestGroovy') {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.named('compileGroovy') {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.withType(Test).configureEach {
systemProperty('spock.iKnowWhatImDoing.disableGroovyVersionCheck', 'true')
onlyIf {
![
'onlyFunctionalTests',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package grails.async

import grails.async.decorator.PromiseDecorator
import spock.lang.PendingFeatureIf
import spock.lang.Specification
import spock.util.concurrent.PollingConditions

Expand All @@ -42,7 +43,7 @@ class PromiseSpec extends Specification {
result == '*10*'

}

void 'Test promise timeout handling'() {

when: 'a promise that takes a while is created'
Expand Down Expand Up @@ -145,6 +146,10 @@ class PromiseSpec extends Specification {
}
}

@PendingFeatureIf({
// Cannot cast object '4' with class 'java.lang.Integer' to class 'java.lang.Throwable'
GroovySystem.version.startsWith('5')
})
void 'Test promise chaining'() {

when: 'a promise is chained'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class GparsPromiseSpec extends Specification {
then: 'the result is decorated'
result == '*10*'
}

void 'Test promise timeout handling'() {

when: 'a promise that takes longer than the timeout'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RxJavaPromiseSpec extends Specification {
result == '*10*'

}

void 'Test promise timeout handling'() {

when: 'a promise that takes a while is created'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,18 @@ import java.util.regex.Pattern
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import groovy.transform.EqualsAndHashCode
import groovy.util.logging.Slf4j
import org.codehaus.groovy.runtime.DefaultGroovyMethods

import org.slf4j.Logger
import org.slf4j.LoggerFactory

/**
* @deprecated This class is deprecated to reduce complexity, improve performance, and increase maintainability. Use {@code config.getProperty(String key, Class<T> targetType)} instead.
*/
@Slf4j
@Deprecated
@EqualsAndHashCode
@CompileStatic
class NavigableMap implements Map<String, Object>, Cloneable {

private static final Logger LOG = LoggerFactory.getLogger(NavigableMap)

private static final Pattern SPLIT_PATTERN = ~/\./
private static final String SPRING_PROFILES = 'spring.profiles.active'
private static final String SPRING = 'spring'
Expand Down Expand Up @@ -359,6 +356,9 @@ class NavigableMap implements Map<String, Object>, Cloneable {
return new NullSafeNavigator(this, [name].asImmutable())
}
Object result = get(name)
if (!(result instanceof NavigableMap)) {
log.warn("Accessing config key '{}' through dot notation is deprecated, and it will be removed in a future release. Use 'config.getProperty(key, targetClass)' instead.", name)
}
return result
}

Expand Down Expand Up @@ -461,18 +461,18 @@ class NavigableMap implements Map<String, Object>, Cloneable {
}
if (value instanceof Collection) {
if (forceStrings) {
flatConfig.put(fullKey, ((Collection) value).join(','))
((Map<Object, Object>) flatConfig).put(fullKey, ((Collection) value).join(','))
} else {
flatConfig.put(fullKey, value)
((Map<Object, Object>) flatConfig).put(fullKey, value)
}
int index = 0
for (Object item: (Collection) value) {
String collectionKey = "${fullKey}[${index}]".toString()
flatConfig.put(collectionKey, forceStrings ? String.valueOf(item) : item)
((Map<Object, Object>) flatConfig).put(collectionKey, forceStrings ? String.valueOf(item) : item)
index++
}
} else {
flatConfig.put(fullKey, forceStrings ? String.valueOf(value) : value)
((Map<Object, Object>) flatConfig).put(fullKey, forceStrings ? String.valueOf(value) : value)
}
}
}
Expand All @@ -492,6 +492,7 @@ class NavigableMap implements Map<String, Object>, Cloneable {
/**
* @deprecated This class should be avoided due to known performance reasons. Use {@code config.getProperty(String key, Class<T> targetType)} instead of dot based navigation.
*/
@Slf4j
@Deprecated
@CompileStatic
static class NullSafeNavigator implements Map<String, Object> {
Expand All @@ -501,9 +502,7 @@ class NavigableMap implements Map<String, Object>, Cloneable {
NullSafeNavigator(NavigableMap parent, List<String> path) {
this.parent = parent
this.path = path
if (LOG.isWarnEnabled()) {
LOG.warn("Accessing config key '{}' through dot notation has known performance issues, consider using 'config.getProperty(key, targetClass)' instead.", path)
}
log.warn("Accessing config key '{}' through dot notation has known performance issues, consider using 'config.getProperty(key, targetClass)' instead.", path)
}

Object getAt(Object key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ import java.util.regex.Pattern
* @author Tom Bujok
* @since 2.3
*/
@IgnoreIf({ !GrailsConsole.instance.isAnsiEnabled() })
@IgnoreIf({
!GrailsConsole.instance.isAnsiEnabled()
})
class GrailsConsoleSpec extends Specification {

static final String RESET = Pattern.quote(Ansi.ansi().reset().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import grails.compiler.ast.ClassInjector

import org.codehaus.groovy.control.MultipleCompilationErrorsException
import org.grails.compiler.injection.GrailsAwareClassLoader
import org.grails.compiler.web.ControllerActionTransformer

import spock.lang.Specification

class ControllerActionTransformerCompilationErrorsSpec extends Specification {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Set;

import org.apache.groovy.ast.tools.AnnotatedNodeUtils;
import org.apache.groovy.util.BeanUtils;
import org.codehaus.groovy.ast.AnnotationNode;
import org.codehaus.groovy.ast.ClassHelper;
import org.codehaus.groovy.ast.ClassNode;
Expand All @@ -53,7 +54,6 @@
import org.codehaus.groovy.ast.stmt.ThrowStatement;
import org.codehaus.groovy.classgen.GeneratorContext;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.runtime.MetaClassHelper;
import org.codehaus.groovy.syntax.Token;
import org.codehaus.groovy.syntax.Types;

Expand Down Expand Up @@ -343,8 +343,8 @@ protected void addApiLookupFieldAndSetter(ClassNode classNode, ClassNode impleme
if (fieldNode == null || !fieldNode.getDeclaringClass().equals(classNode)) {
fieldNode = new FieldNode(apiProperty, Modifier.PRIVATE | Modifier.STATIC, implementationNode, classNode, initialValueExpression);
classNode.addField(fieldNode);

String setterName = "set" + MetaClassHelper.capitalize(apiProperty);
String setterName = "set" + BeanUtils.capitalize(apiProperty);
Parameter setterParameter = new Parameter(implementationNode, apiProperty);
BlockStatement setterBody = new BlockStatement();
setterBody.addStatement(new ExpressionStatement(new BinaryExpression(new AttributeExpression(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import groovy.transform.TypeChecked;
import groovy.transform.TypeCheckingMode;
import org.apache.groovy.ast.tools.AnnotatedNodeUtils;
import org.apache.groovy.util.BeanUtils;
import org.codehaus.groovy.ast.ASTNode;
import org.codehaus.groovy.ast.AnnotatedNode;
import org.codehaus.groovy.ast.AnnotationNode;
Expand Down Expand Up @@ -84,7 +85,6 @@
import org.codehaus.groovy.control.Janitor;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
import org.codehaus.groovy.runtime.MetaClassHelper;
import org.codehaus.groovy.syntax.SyntaxException;
import org.codehaus.groovy.syntax.Token;
import org.codehaus.groovy.syntax.Types;
Expand Down Expand Up @@ -1371,7 +1371,7 @@ public static MethodCallExpression buildGetPropertyExpression(final Expression o
* @return The method call expression
*/
public static MethodCallExpression buildGetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final boolean useBooleanGetter) {
String methodName = (useBooleanGetter ? "is" : "get") + MetaClassHelper.capitalize(propertyName);
String methodName = (useBooleanGetter ? "is" : "get") + BeanUtils.capitalize(propertyName);
MethodCallExpression methodCallExpression = new MethodCallExpression(objectExpression, methodName, MethodCallExpression.NO_ARGUMENTS);
MethodNode getterMethod = targetClassNode.getGetterMethod(methodName);
if (getterMethod != null) {
Expand All @@ -1390,7 +1390,7 @@ public static MethodCallExpression buildGetPropertyExpression(final Expression o
* @return The method call expression
*/
public static MethodCallExpression buildSetPropertyExpression(final Expression objectExpression, final String propertyName, final ClassNode targetClassNode, final Expression valueExpression) {
String methodName = "set" + MetaClassHelper.capitalize(propertyName);
String methodName = "set" + BeanUtils.capitalize(propertyName);
MethodCallExpression methodCallExpression = new MethodCallExpression(objectExpression, methodName, new ArgumentListExpression(valueExpression));
MethodNode setterMethod = targetClassNode.getSetterMethod(methodName);
if (setterMethod != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
package org.grails.plugins

import grails.core.DefaultGrailsApplication
import org.grails.plugins.BinaryGrailsPlugin
import org.grails.plugins.BinaryGrailsPluginDescriptor
import org.springframework.core.io.ByteArrayResource
import org.springframework.core.io.FileSystemResource
import org.springframework.core.io.Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import java.text.ParseException

import spock.lang.Specification

import java.text.SimpleDateFormat
import static java.util.Calendar.*

class DateConversionHelperSpec extends Specification {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class CookieTenantResolverSpec extends Specification {
e.message == "Tenant could not be resolved outside a web request"
}


void "Test not tenant id found"() {
setup:
def request = new MockHttpServletRequest("GET", "/foo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.grails.datastore.mapping.multitenancy.web

import org.grails.datastore.mapping.core.connections.ConnectionSource
import org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException
import org.springframework.mock.web.MockHttpServletRequest
import org.springframework.web.context.request.RequestContextHolder
Expand All @@ -39,7 +38,6 @@ class SessionTenantResolverSpec extends Specification {
e.message == "Tenant could not be resolved outside a web request"
}


void "Test not tenant id found"() {
setup:
def request = new MockHttpServletRequest("GET", "/foo")
Expand Down
2 changes: 2 additions & 0 deletions grails-forge/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pluginManagement {
url = 'https://central.sonatype.com/repository/maven-snapshots'
content {
includeVersionByRegex('cloud[.]wondrify.*', '.*', '.*-SNAPSHOT')
includeGroup('org.spockframework')
}
mavenContent {
snapshotsOnly()
Expand Down Expand Up @@ -129,6 +130,7 @@ dependencyResolutionManagement {
url = 'https://central.sonatype.com/repository/maven-snapshots'
content {
includeVersionByRegex('cloud[.]wondrify.*', '.*', '.*-SNAPSHOT')
includeGroup('org.spockframework')
}
mavenContent {
snapshotsOnly()
Expand Down
2 changes: 1 addition & 1 deletion grails-gradle/buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repositories {
maven {
url = 'https://repository.apache.org/content/groups/staging'
content {
includeModuleByRegex('org[.]apache[.]grails[.]gradle', 'grails-publish')
includeModuleByRegex('org[.]apache[.]((grails[.]gradle)|groovy)', 'grails-publish|groovy.*')
}
mavenContent {
releasesOnly()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ class CommandLineParserSpec extends Specification {
cl.optionValue('include-sources') == 'file with spaces.xml'
}


void "Test that parseString with unbalanced double quotes throws ParseException"() {
when:
def parser = new CommandLineParser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class ResourceProfileSpec extends Specification {
deps[0].artifact.version == '2.0'
}


void "Test dependency exclusions"() {
given:"A resource profile"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class PubSubSpec extends Specification {

}


@Rollback
void 'Test synchronous event listener'() {

Expand Down
Loading
Loading