Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ dependencies {
testImplementation projects.groovyDateutil
testImplementation projects.groovyTestJunit6 // for groovy.junit6.plugin.ForkedJvm
testImplementation "net.jcip:jcip-annotations:${versions.jcipAnnotations}"
testImplementation "com.thoughtworks.qdox:qdox:${versions.qdox}"
testImplementation "com.github.javaparser:javaparser-core:${versions.javaParser}"
testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
testImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"

Expand All @@ -147,8 +147,6 @@ dependencies {
tools "org.codehaus.plexus:plexus-utils:4.0.3"
// end
tools "org.ow2.asm:asm:${versions.asm}"
tools "com.thoughtworks.qdox:qdox:${versions.qdox}"

spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0'

testRuntimeOnly(project(':')) {
Expand Down
7 changes: 0 additions & 7 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
<trusted-key id="74CEFDCEADFB95278EDEDF71E5B3BB879D1EC979" group="me.sunlan"/>
<trusted-key id="76E94E8FF0AB5AF3B6F8366972FEFD1572EB75E1" group="org.spockframework"/>
<trusted-key id="7B79ADD11F8A779FE90FD3D0893A028475557671" group="com.gradle"/>
<trusted-key id="7E6557B314B189FD4EA5B680FE66BCA17E67AE6F" group="com.thoughtworks.qdox" name="qdox" version="2.2.0"/>
<trusted-key id="82F94BBDF95C247BBD21396B9A0B94DEC0FFA7EE" group="org.webjars" name="jquery" version="3.7.1"/>
<trusted-key id="8446B9E902A3F3DDEE711FDB8E26FF248BC7AEAD" group="com.github.jnr"/>
<trusted-key id="84789D24DF77A32433CE1F079EB80E92EB2135B1" group="^org[.]apache($|([.].*))" regex="true"/>
Expand Down Expand Up @@ -840,12 +839,6 @@
<sha512 value="cd57377d61d66ac2ab6ab90483252385fe2bbb9e13dee07913362a64ffe97b16082df981dbe469df3f67ad946827be6f4355d63003a393bda62a0fc8b54a590b" origin="Generated by Gradle" reason="A key couldn't be downloaded"/>
</artifact>
</component>
<component group="com.thoughtworks.qdox" name="qdox" version="2.2.0">
<artifact name="qdox-2.2.0.jar">
<pgp value="7E6557B314B189FD4EA5B680FE66BCA17E67AE6F"/>
<sha512 value="3fec9532bd0fcbe695ac6c4c3ae54bdd83b35ec031ea81ac853a49d548d6c14bfab92e626545b90564f8424cc22d9c2c682615cf0a461273b60f127184095758" origin="Generated by Gradle" reason="A key couldn't be downloaded"/>
</artifact>
</component>
<component group="com.thoughtworks.xstream" name="xstream" version="1.4.18">
<artifact name="xstream-1.4.18.jar">
<sha512 value="141c0aa3bd2e0d82cd37e6c2403f09f447aa51344fdf76c2f64b0952b1297ac99156b672628f310b4208d2387f047e62afefead519ba9eee37a7495850814b19" origin="Generated by Gradle"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.codehaus.groovy.tools.stubgenerator

import groovy.transform.CompileStatic

/**
* Category methods that keep stub-generator assertions concise while using JavaParser-backed views.
*/
class JavaParserCategory {

/**
* Access a parsed class by fully qualified name.
*/
static JavaSourceClass getAt(JavaSourceClass[] self, String className) {
def clazz = self.find { JavaSourceClass jc -> jc.fullyQualifiedName == className }
assert clazz, "No stub class found for name $className, among ${self.collect { it.fullyQualifiedName }}"
clazz
}

/**
* Access one or several parsed methods by name.
*/
static getAt(JavaSourceMethod[] self, String methodName) {
getAt(self.toList(), methodName)
}

static getAt(List<JavaSourceMethod> self, String methodName) {
def methods = self.findAll { JavaSourceMethod method -> method.name == methodName }
methods.size() == 1 ? methods[0] : methods
}

@CompileStatic
static List<JavaSourceMethod> getMethods(JavaSourceClass self) {
self.methods
}
}
Loading
Loading