borinquenkid commented on code in PR #16586:
URL: https://github.com/apache/grails-core/pull/16586#discussion_r4365071495


##########
grails-core/src/main/groovy/grails/util/Pair.groovy:
##########
@@ -17,60 +17,65 @@
  *  under the License.
  */
 
-package grails.util;
+package grails.util
 
-public class Pair<A, B> {
-    final A aValue;
-    final B bValue;
+import groovy.transform.CompileStatic
 
-    public Pair(A aValue, B bValue) {
-        this.aValue = aValue;
-        this.bValue = bValue;
+@CompileStatic
+class Pair<A, B> {
+
+    final A aValue

Review Comment:
   Fixed in 477cbb0040: `Pair` and `Triple` keep `@PackageScope final` fields, 
so no `getAValue()`/`getBValue()` is generated next to 
`getaValue()`/`getbValue()`. A new case pins the package-private shape.



##########
grails-core/src/test/groovy/org/grails/core/io/SimpleMapResourceLoaderSpec.groovy:
##########
@@ -0,0 +1,48 @@
+/*
+ *  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
+ *
+ *    https://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.grails.core.io
+
+import spock.lang.Specification
+
+import org.springframework.core.io.ByteArrayResource
+
+class SimpleMapResourceLoaderSpec extends Specification {
+
+    void 'getResource returns a resource registered in the backing map'() {
+        given:
+        def loader = new SimpleMapResourceLoader()
+        def resource = new ByteArrayResource('content'.bytes)
+
+        when:
+        loader.getResources().put('/foo.txt', resource)
+
+        then:
+        loader.getResource('/foo.txt').is(resource)
+        loader.getResource('/missing.txt') == null
+    }
+
+    void 'getClassLoader returns the class loader that loaded this class'() {
+        given:
+        def loader = new SimpleMapResourceLoader()
+
+        expect:
+        loader.getClassLoader() == SimpleMapResourceLoader.classLoader

Review Comment:
   Fixed in 477cbb0040: the spec compares against 
`loader.getClass().getClassLoader()`, which is independent of the 
implementation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to