Skip to content

Rename function if user already has a function with the same name #103

Description

@timlg07

See TestService::addHiddenTestMethodToUserTest.

Example error:

de.tim_greller.susserver.exception.CompilationException: Compilation failed.
/GreenHouseTest.java:45: error: method testAutomatic() is already defined in class GreenHouseTest
public void testAutomatic() {
^
      at de.tim_greller.susserver.model.execution.compilation.InMemoryCompiler.compile([InMemoryCompiler.java:89](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.model.execution.compilation.InMemoryCompiler#89))
      at de.tim_greller.susserver.service.execution.ExecutionService.compile([ExecutionService.java:165](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.execution.ExecutionService#165))
      at de.tim_greller.susserver.service.execution.ExecutionService.compile([ExecutionService.java:143](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.execution.ExecutionService#143))
      at de.tim_greller.susserver.service.execution.ExecutionService.execute([ExecutionService.java:64](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.execution.ExecutionService#64))
      at jdk.internal.reflect.GeneratedMethodAccessor1832.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl#43))
      at java.base/java.lang.reflect.Method.invoke([Method.java:568](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.lang.reflect.Method#568))
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection([AopUtils.java:343](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.support.AopUtils#343))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint([ReflectiveMethodInvocation.java:196](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#196))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:163](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#163))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at net.bull.javamelody.MonitoringSpringInterceptor.invoke([MonitoringSpringInterceptor.java:76](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=net.bull.javamelody.MonitoringSpringInterceptor#76))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#184))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept([CglibAopProxy.java:708](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor#708))
      at de.tim_greller.susserver.service.execution.ExecutionService$$SpringCGLIB$$0.execute(<generated>)
      at de.tim_greller.susserver.service.game.ComponentStatusService.executeTests([ComponentStatusService.java:127](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.game.ComponentStatusService#127))
      at de.tim_greller.susserver.service.game.ComponentStatusService.attackCut([ComponentStatusService.java:116](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.game.ComponentStatusService#116))
      at jdk.internal.reflect.GeneratedMethodAccessor1971.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl#43))
      at java.base/java.lang.reflect.Method.invoke([Method.java:568](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.lang.reflect.Method#568))
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection([AopUtils.java:343](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.support.AopUtils#343))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint([ReflectiveMethodInvocation.java:196](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#196))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:163](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#163))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at net.bull.javamelody.MonitoringSpringInterceptor.invoke([MonitoringSpringInterceptor.java:76](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=net.bull.javamelody.MonitoringSpringInterceptor#76))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#184))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept([CglibAopProxy.java:708](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor#708))
      at de.tim_greller.susserver.service.game.ComponentStatusService$$SpringCGLIB$$0.attackCut(<generated>)
      at de.tim_greller.susserver.service.game.GameProgressionService.gameLoop([GameProgressionService.java:202](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.game.GameProgressionService#202))
      at de.tim_greller.susserver.service.game.GameProgressionService.handleGameStarted([GameProgressionService.java:91](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.game.GameProgressionService#91))
      at de.tim_greller.susserver.service.game.EventService.handleEvent([EventService.java:61](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.service.game.EventService#61))
      at jdk.internal.reflect.GeneratedMethodAccessor1775.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl#43))
      at java.base/java.lang.reflect.Method.invoke([Method.java:568](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.lang.reflect.Method#568))
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection([AopUtils.java:343](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.support.AopUtils#343))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint([ReflectiveMethodInvocation.java:196](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#196))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:163](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#163))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at net.bull.javamelody.MonitoringSpringInterceptor.invoke([MonitoringSpringInterceptor.java:76](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=net.bull.javamelody.MonitoringSpringInterceptor#76))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#184))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept([CglibAopProxy.java:708](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor#708))
      at de.tim_greller.susserver.service.game.EventService$$SpringCGLIB$$0.handleEvent(<generated>)
      at de.tim_greller.susserver.controller.ws.EventController.handleClientEvent([EventController.java:54](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=de.tim_greller.susserver.controller.ws.EventController#54))
      at jdk.internal.reflect.GeneratedMethodAccessor1768.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl#43))
      at java.base/java.lang.reflect.Method.invoke([Method.java:568](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.lang.reflect.Method#568))
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection([AopUtils.java:343](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.support.AopUtils#343))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint([ReflectiveMethodInvocation.java:196](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#196))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:163](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#163))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at net.bull.javamelody.MonitoringSpringInterceptor.invoke([MonitoringSpringInterceptor.java:76](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=net.bull.javamelody.MonitoringSpringInterceptor#76))
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.ReflectiveMethodInvocation#184))
      at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed([CglibAopProxy.java:756](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation#756))
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept([CglibAopProxy.java:708](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor#708))
      at de.tim_greller.susserver.controller.ws.EventController$$SpringCGLIB$$0.handleClientEvent(<generated>)
      at jdk.internal.reflect.GeneratedMethodAccessor1768.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl#43))
      at java.base/java.lang.reflect.Method.invoke([Method.java:568](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.lang.reflect.Method#568))
      at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke([InvocableHandlerMethod.java:169](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.handler.invocation.InvocableHandlerMethod#169))
      at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke([InvocableHandlerMethod.java:119](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.handler.invocation.InvocableHandlerMethod#119))
      at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMatch([AbstractMethodMessageHandler.java:567](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler#567))
      at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch([SimpAnnotationMethodMessageHandler.java:511](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler#511))
      at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch([SimpAnnotationMethodMessageHandler.java:93](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler#93))
      at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessageInternal([AbstractMethodMessageHandler.java:522](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler#522))
      at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessage([AbstractMethodMessageHandler.java:457](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler#457))
      at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run([ExecutorSubscribableChannel.java:144](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask#144))
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker([ThreadPoolExecutor.java:1136](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.util.concurrent.ThreadPoolExecutor#1136))
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run([ThreadPoolExecutor.java:635](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.util.concurrent.ThreadPoolExecutor$Worker#635))
      at java.base/java.lang.Thread.run([Thread.java:840](https://sojourner-under-sabotage.se2.fim.uni-passau.de/monitoring?part=source&class=java.base/java.lang.Thread#840))

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions