无法找到匹配的构造函数:java.time.ZonedDateTime()
unable to find matching constructor for: java.time.ZonedDateTime()
我有一个非常简单的代码库,我觉得这里真的很傻。为什么我收到错误 groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.time.ZonedDateTime()
import org.testng.annotations.Test
import java.time.ZonedDateTime
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
class timeTests {
Logger log = LogManager.getLogger(this.class.getName())
def startTime(){
return new ZonedDateTime().now()
}
def endTime(){
def start = startTime()
def end = start.plusSeconds(5)
return end
}
@Test
void test(){
log.info(endTime())
}
}
示例取自:https://www.geeksforgeeks.org/zoneddatetime-now-method-in-java-with-examples/
构造函数不存在。使用 ZonedDateTime.now()
或等效项之一。见相关JavaDoc.
我有一个非常简单的代码库,我觉得这里真的很傻。为什么我收到错误 groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.time.ZonedDateTime()
import org.testng.annotations.Test
import java.time.ZonedDateTime
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
class timeTests {
Logger log = LogManager.getLogger(this.class.getName())
def startTime(){
return new ZonedDateTime().now()
}
def endTime(){
def start = startTime()
def end = start.plusSeconds(5)
return end
}
@Test
void test(){
log.info(endTime())
}
}
示例取自:https://www.geeksforgeeks.org/zoneddatetime-now-method-in-java-with-examples/
构造函数不存在。使用 ZonedDateTime.now()
或等效项之一。见相关JavaDoc.