Skip to content

StackOverflowError when placing a "static" keyword #1099

@mauromol

Description

@mauromol

Consider this class:

package test64

import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic

@CompileStatic
class Test64 {

	@CompileDynamic
	static enum ShippingAddressSynchType {
		ACCOUNTING {
			@Override
			void synch(Test64 customer) {
				truncate('foo', 2)
			}
		};

		void synch(Test64 customer) { }

		private String truncate(String input, int maxLength) {
			if(!input)
				return input
			if(input.length() > maxLength)
				input = input[0..maxLength - 1]
			return input
		}
	}
}

Now change the truncate(...) declaration by adding the static keyword and hit Ctrl+S:

private static String truncate(String input, int maxLength) {

BOOM!
You have to close the IDE, possibly kill it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions