Skip to content

Commit f57b692

Browse files
committed
Restore formatting & fix bad merges
1 parent 2b6cd05 commit f57b692

10 files changed

Lines changed: 90 additions & 82 deletions

File tree

grails-async/plugin/src/main/groovy/org/grails/async/transform/internal/DefaultDelegateAsyncTransactionalMethodTransformer.groovy

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,29 @@ class DefaultDelegateAsyncTransactionalMethodTransformer implements DelegateAsyn
102102
}
103103
final promiseLookupExpression = new BinaryExpression(new PropertyExpression(EXPRESSION_THIS, FIELD_NAME_PROMISE_DECORATORS), Token.newSymbol(Types.LEFT_SQUARE_BRACKET, -1, -1), new ConstantExpression(currentIndex))
104104
setTransactionManagerMethodBody.addStatement(
105-
new ExpressionStatement(
105+
new ExpressionStatement(
106106
new BinaryExpression(
107-
promiseLookupExpression,
108-
OPERATOR_ASSIGNMENT,
109-
new MethodCallExpression(
110-
new ClassExpression(new ClassNode(TransactionalAsyncTransformUtils).getPlainNodeReference()),
111-
'createTransactionalPromiseDecorator',
112-
new ArgumentListExpression(new VariableExpression(VARIABLE_TRANSACTION_MANAGER),
113-
new MethodCallExpression(
114-
new ClassExpression(delegateClassNode),
115-
'getDeclaredMethod', methodLookupArguments
116-
)
117-
)
118-
)
107+
promiseLookupExpression,
108+
OPERATOR_ASSIGNMENT,
109+
new MethodCallExpression(
110+
new ClassExpression(new ClassNode(TransactionalAsyncTransformUtils).getPlainNodeReference()),
111+
'createTransactionalPromiseDecorator',
112+
new ArgumentListExpression(new VariableExpression(VARIABLE_TRANSACTION_MANAGER),
113+
new MethodCallExpression(
114+
new ClassExpression(delegateClassNode),
115+
'getDeclaredMethod', methodLookupArguments
116+
)
117+
)
118+
)
119119

120120
)
121-
)
122-
)
121+
)
122+
)
123123

124124
promiseDecorators.addExpression(promiseLookupExpression)
125+
125126
}
127+
126128
}
127129

128130
static BlockStatement getSetTransactionManagerMethodBody(ClassNode classNode) {
@@ -147,25 +149,26 @@ class DefaultDelegateAsyncTransactionalMethodTransformer implements DelegateAsyn
147149
def parameters = [transactionManagerParameter] as Parameter[]
148150
final txMgrParam = new VariableExpression(transactionManagerParameter)
149151
methodBody.addStatement(
150-
new ExpressionStatement(
152+
new ExpressionStatement(
151153
new BinaryExpression(
152-
new PropertyExpression(EXPRESSION_THIS, FIELD_NAME_TRANSACTION_MANAGER),
153-
OPERATOR_ASSIGNMENT,
154-
txMgrParam
155-
)
156-
)
154+
new PropertyExpression(EXPRESSION_THIS, FIELD_NAME_TRANSACTION_MANAGER),
155+
OPERATOR_ASSIGNMENT,
156+
txMgrParam
157157
)
158+
)
159+
)
158160
methodBody.addStatement(
159-
new ExpressionStatement(
161+
new ExpressionStatement(
160162
new DeclarationExpression(
161-
new VariableExpression(VARIABLE_TRANSACTION_MANAGER, INTERFACE_TRANSACTION_MANAGER),
162-
OPERATOR_ASSIGNMENT,
163-
txMgrParam
164-
)
165-
)
163+
new VariableExpression(VARIABLE_TRANSACTION_MANAGER, INTERFACE_TRANSACTION_MANAGER),
164+
OPERATOR_ASSIGNMENT,
165+
txMgrParam
166166
)
167+
)
168+
)
167169
method = new MethodNode(METHOD_NAME_SET_TRANSACTION_MANAGER, Modifier.PUBLIC, ClassHelper.VOID_TYPE, parameters, [] as ClassNode[], methodBody)
168170
classNode.addMethod(method)
171+
169172
}
170173

171174
return (BlockStatement) method.getCode()

grails-async/plugin/src/main/groovy/org/grails/plugins/web/async/ControllersAsyncGrailsPlugin.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ class ControllersAsyncGrailsPlugin extends Plugin {
3333

3434
def grailsVersion = '7.0.0-SNAPSHOT > *'
3535
def loadAfter = ['controllers']
36-
Closure doWithSpring() { {
37-
38-
->
36+
Closure doWithSpring() {
37+
{ ->
3938
asyncPromiseResponseActionResultTransformer(AsyncActionResultTransformer)
4039
grailsPromiseFactory(PromiseFactoryBean)
4140
}

grails-async/plugin/src/main/groovy/org/grails/plugins/web/async/GrailsAsyncContext.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class GrailsAsyncContext implements AsyncContext {
7575

7676
void complete() {
7777
delegate.complete()
78-
}
78+
}
7979

8080
protected Collection<PersistenceContextInterceptor> getPersistenceInterceptors(GrailsWebRequest webRequest) {
8181
def servletContext = webRequest.servletContext

grails-async/plugin/src/test/groovy/grails/async/services/AsyncTransactionalServiceSpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import org.springframework.transaction.annotation.Transactional
2929
import org.springframework.transaction.support.SimpleTransactionStatus
3030
import spock.lang.Specification
3131

32-
3332
class AsyncTransactionalServiceSpec extends Specification {
3433

3534
void 'Test that an async transactional service is transaction manager aware'() {

grails-core/src/main/groovy/grails/core/DefaultGrailsApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class DefaultGrailsApplication extends AbstractGrailsApplication implemen
9999
protected static final Pattern GETCLASS_PATTERN = Pattern.compile("(get)(\\w+)Class");
100100

101101
protected Class<?>[] allClasses = new Class[0];
102-
protected static final Log log = LogFactory.getLog(DefaultGrailsApplication.class);
102+
protected static Log log = LogFactory.getLog(DefaultGrailsApplication.class);
103103

104104
protected Set<Class<?>> loadedClasses = new LinkedHashSet<>();
105105
protected ArtefactHandler[] artefactHandlers;

grails-datamapping-core-test/src/test/groovy/grails/gorm/services/ServiceImplSpec.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package grails.gorm.services
2020

21+
import spock.lang.Requires
22+
2123
import grails.gorm.annotation.Entity
2224
import grails.gorm.validation.PersistentEntityValidator
2325
import grails.validation.ValidationException
@@ -56,7 +58,7 @@ class ServiceImplSpec extends Specification {
5658

5759
}
5860

59-
@spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || System.getProperty('mongodb.gorm.suite') == 'true' })
61+
@Requires({ System.getProperty('hibernate5.gorm.suite') == 'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || System.getProperty('mongodb.gorm.suite') == 'true' })
6062
void "test list products"() {
6163
given:
6264
Product p1 = new Product(name: "Apple", type:"Fruit").save(flush:true)
@@ -327,7 +329,7 @@ class ServiceImplSpec extends Specification {
327329

328330
}
329331

330-
@spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || System.getProperty('mongodb.gorm.suite') == 'true' })
332+
@Requires({ System.getProperty('hibernate5.gorm.suite') == 'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || System.getProperty('mongodb.gorm.suite') == 'true' })
331333
void "test interface projection"() {
332334
given:
333335
ProductService productService = datastore.getService(ProductService)

grails-datamapping-core-test/src/test/groovy/org/apache/grails/data/simple/core/GrailsDataCoreTckManager.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class GrailsDataCoreTckManager extends GrailsDataTckManager {
4343

4444
@Override
4545
Session createSession() {
46-
System.setProperty('core.gorm.suite', 'true')
4746
def ctx = new GenericApplicationContext()
4847
ctx.refresh()
4948
def simple = new SimpleMapDatastore(ctx)

grails-datamapping-core/src/main/groovy/grails/gorm/DetachedCriteria.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package grails.gorm
2121

2222
import groovy.transform.CompileStatic
23+
import groovy.util.logging.Slf4j
2324

2425
import jakarta.persistence.criteria.JoinType
2526

@@ -41,6 +42,7 @@ import org.grails.datastore.mapping.query.api.QueryableCriteria
4142
* @author Graeme Rocher
4243
* @since 1.0
4344
*/
45+
@Slf4j
4446
@CompileStatic
4547
class DetachedCriteria<T> extends AbstractDetachedCriteria<T> implements GormOperations<T>, QueryableCriteria<T>, Iterable<T> {
4648

0 commit comments

Comments
 (0)