sonatype-lift[bot] commented on code in PR #1747:
URL: https://github.com/apache/groovy/pull/1747#discussion_r922569947


##########
src/test/groovy/IllegalAccessTests.groovy:
##########
@@ -0,0 +1,88 @@
+/*
+ *  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 groovy
+
+import org.junit.Before
+import org.junit.Test
+
+import static groovy.test.GroovyAssert.assertScript
+import static groovy.test.GroovyAssert.isAtLeastJdk
+import static org.junit.Assume.assumeTrue
+
+/**
+ * Tests for permissive member access.  Typically such access is only allowed 
in
+ * Java via means such as reflection.
+ *
+ * In JDK versions < 9, Groovy supports permissive access and no warnings are 
given by the JDK.
+ * In JDK versions in 9..15, Groovy supports permissive access but the JDK 
gives illegal access warnings.
+ * In JDK versions > 16, permissive access is restricted and Groovy's support 
for this feature is limited.
+ */
+final class IllegalAccessTests {
+
+    @Before
+    void setUp() {
+        assumeTrue(!isAtLeastJdk('16.0') && isAtLeastJdk('9.0') && 
!Boolean.getBoolean('groovy.force.illegal.access'))

Review Comment:
   *BooleanGetBoolean:*  Violation in class groovy.IllegalAccessTests. 
Boolean.getBoolean(String) is a confusing API for reading System properties. 
Prefer the System.getProperty(String) API.
   
   Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
   Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the 
above finding from this PR.
   Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all 
the findings from this PR and from the status bar in Github.
   
   When talking to LiftBot, you need to **refresh** the page to see its 
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get 
to know more about LiftBot commands.
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not 
relevant](https://www.sonatype.com/lift-comment-rating?comment=298936332&lift_comment_rating=1)
 ] - [ [😕 Won't 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936332&lift_comment_rating=2)
 ] - [ [😑 Not critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936332&lift_comment_rating=3)
 ] - [ [🙂 Critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936332&lift_comment_rating=4)
 ] - [ [😊 Critical, fixing 
now](https://www.sonatype.com/lift-comment-rating?comment=298936332&lift_comment_rating=5)
 ]



##########
src/test/groovy/RegularExpressionsTest.groovy:
##########
@@ -337,19 +354,22 @@ class RegularExpressionsTest extends GroovyTestCase {
         assert numbers == '123'
     }
 
+    @Test
     void testFirst() {
         assert "cheesecheese" =~ "cheese"
         assert "cheesecheese" =~ /cheese/
         assert "cheese" == /cheese/   /*they are both string syntaxes*/

Review Comment:
   *ComparisonOfTwoConstants:*  Comparing two constants or constant literals is 
useless and may indicate a bug: (cheese == cheese)
   
   Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
   Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the 
above finding from this PR.
   Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all 
the findings from this PR and from the status bar in Github.
   
   When talking to LiftBot, you need to **refresh** the page to see its 
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get 
to know more about LiftBot commands.
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not 
relevant](https://www.sonatype.com/lift-comment-rating?comment=298936350&lift_comment_rating=1)
 ] - [ [😕 Won't 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936350&lift_comment_rating=2)
 ] - [ [😑 Not critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936350&lift_comment_rating=3)
 ] - [ [🙂 Critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936350&lift_comment_rating=4)
 ] - [ [😊 Critical, fixing 
now](https://www.sonatype.com/lift-comment-rating?comment=298936350&lift_comment_rating=5)
 ]



##########
src/test/groovy/StaticImportTest.groovy:
##########
@@ -350,13 +563,13 @@ class API {
 }
 
 class StaticImportParent {
-  static pfield = 42
-  static pmethod() { 'hello from parent' }
+    static pfield = 42
+    static pmethod() { 'hello from parent' }
 }
 
 class StaticImportChild extends StaticImportParent {
-  static cfield = 21
-  static cmethod() { 'hello from child' }
+    static cfield = 21
+    static cmethod() { 'hello from child' }
 }
 
 class Outer1 {

Review Comment:
   *EmptyClass:*  Class 'Outer1' is empty (has no methods, fields or 
properties). Why would you need a class like this?
   
   Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
   Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the 
above finding from this PR.
   Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all 
the findings from this PR and from the status bar in Github.
   
   When talking to LiftBot, you need to **refresh** the page to see its 
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get 
to know more about LiftBot commands.
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not 
relevant](https://www.sonatype.com/lift-comment-rating?comment=298936362&lift_comment_rating=1)
 ] - [ [😕 Won't 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936362&lift_comment_rating=2)
 ] - [ [😑 Not critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936362&lift_comment_rating=3)
 ] - [ [🙂 Critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=298936362&lift_comment_rating=4)
 ] - [ [😊 Critical, fixing 
now](https://www.sonatype.com/lift-comment-rating?comment=298936362&lift_comment_rating=5)
 ]



-- 
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