You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/04/30 15:29:00 UTC
[jira] [Comment Edited] (GROOVY-10598) BUG! exception in phase 'instruction selection' unexpected NullPointerException
[ https://issues.apache.org/jira/browse/GROOVY-10598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530401#comment-17530401 ]
Eric Milles edited comment on GROOVY-10598 at 4/30/22 3:28 PM:
---------------------------------------------------------------
I think what you have is a binary expression within a class that implements a trait and is either type-checked or statically compiled. The operator is not one of these and so null is the method name returned:
{code:java}
case EQUAL:
case NOT_EQUAL:
case LOGICAL_AND:
case LOGICAL_OR:
case COMPARE_NOT_IDENTICAL:
case COMPARE_IDENTICAL:
case MATCH_REGEX:
case KEYWORD_INSTANCEOF:
case COMPARE_NOT_INSTANCEOF:
case COMPARE_EQUAL:
case COMPARE_NOT_EQUAL:
case COMPARE_TO:
case COMPARE_GREATER_THAN:
case COMPARE_GREATER_THAN_EQUAL:
case COMPARE_LESS_THAN:
case COMPARE_LESS_THAN_EQUAL:
case BITWISE_AND:
case BITWISE_AND_EQUAL:
case BITWISE_OR:
case BITWISE_OR_EQUAL:
case BITWISE_XOR:
case BITWISE_XOR_EQUAL:
case PLUS:
case PLUS_EQUAL:
case MINUS:
case MINUS_EQUAL:
case MULTIPLY:
case MULTIPLY_EQUAL:
case DIVIDE:
case DIVIDE_EQUAL:
case INTDIV:
case INTDIV_EQUAL:
case MOD:
case MOD_EQUAL:
case POWER:
case POWER_EQUAL:
case LEFT_SHIFT:
case LEFT_SHIFT_EQUAL:
case RIGHT_SHIFT:
case RIGHT_SHIFT_EQUAL:
case RIGHT_SHIFT_UNSIGNED:
case RIGHT_SHIFT_UNSIGNED_EQUAL:
case FIND_REGEX:
case KEYWORD_IN:
case COMPARE_NOT_IN:
{code}
was (Author: emilles):
I think what you have is a binary expression within a class that implements a trait and is either type-checked or statically compiled. The operator is not one of these and so null is the method name returned:
{code:java}
switch (op) {
case COMPARE_EQUAL:
case COMPARE_NOT_EQUAL:
// this is only correct in this context here, normally
// we would have to compile against compareTo if available
// but since we don't compile here, this one is enough
return "equals";
case COMPARE_TO:
case COMPARE_GREATER_THAN:
case COMPARE_GREATER_THAN_EQUAL:
case COMPARE_LESS_THAN:
case COMPARE_LESS_THAN_EQUAL:
return "compareTo";
case BITWISE_AND:
case BITWISE_AND_EQUAL:
return "and";
case BITWISE_OR:
case BITWISE_OR_EQUAL:
return "or";
case BITWISE_XOR:
case BITWISE_XOR_EQUAL:
return "xor";
case PLUS:
case PLUS_EQUAL:
return "plus";
case MINUS:
case MINUS_EQUAL:
return "minus";
case MULTIPLY:
case MULTIPLY_EQUAL:
return "multiply";
case DIVIDE:
case DIVIDE_EQUAL:
return "div";
case INTDIV:
case INTDIV_EQUAL:
return "intdiv";
case MOD:
case MOD_EQUAL:
return "mod";
case POWER:
case POWER_EQUAL:
return "power";
case LEFT_SHIFT:
case LEFT_SHIFT_EQUAL:
return "leftShift";
case RIGHT_SHIFT:
case RIGHT_SHIFT_EQUAL:
return "rightShift";
case RIGHT_SHIFT_UNSIGNED:
case RIGHT_SHIFT_UNSIGNED_EQUAL:
return "rightShiftUnsigned";
case KEYWORD_IN:
return "isCase";
case COMPARE_NOT_IN:
return "isNotCase";
default:
return null;
}
{code}
> BUG! exception in phase 'instruction selection' unexpected NullPointerException
> -------------------------------------------------------------------------------
>
> Key: GROOVY-10598
> URL: https://issues.apache.org/jira/browse/GROOVY-10598
> Project: Groovy
> Issue Type: Bug
> Components: groovy-jdk
> Affects Versions: 5.x
> Environment: Windows 10, Powershell, IntelliJ 2020.3
> Reporter: Daniel Geiselman
> Assignee: Eric Milles
> Priority: Major
>
> I am getting this in my gradle build after upgrading Gradle to 6.9.2 and Grails to
> classpath "org.grails:grails-gradle-plugin:5.1.4"
> implementation 'org.grails:grails-dependencies:5.1.7'
> implementation 'org.grails:grails-web-boot:5.1.7'
> implementation 'org.grails:grails-gradle-plugin:5.1.4'
> implementation 'org.grails:grails-core:5.1.7'
> runtimeOnly 'org.grails.plugins:hibernate:4.3.10.7'
> implementation 'org.grails.plugins:spring-security-core:5.0.0'
> implementation group: 'org.grails.plugins', name: 'cache', version: '5.0.1'
> testImplementation 'org.grails:grails-plugin-testing:3.3.0.M2'
> testImplementation 'org.grails:grails-test-mixins:3.3.0'
> testImplementation group: 'org.grails.plugins', name: 'geb', version: '2.0.0'
> compileOnly 'org.grails:grails-console:5.1.7'
>
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> Execution failed for task ':compileTestGroovy'.
> > BUG! exception in phase 'instruction selection' in source unit 'C:\SVNWorkspace\wholesaler-card-utility\src\test\groovy\com\moo\wholesaler\admin\AuditLoggingControllerSpec.groovy' unexpected NullPointerException
>
> When I try to use IntelliJ to debug the code so I can step in and find where it is giving this, it gives me the same failure without hitting a break point.
>
> Any advice will be helpful.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)