Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
39,000
void (Queue<? super Object> mailbox) { LinkedBlockingQueue<String> fromJps = new LinkedBlockingQueue<>(); mailbox.offer(fromJps); // signal that stubs are generated while (true) { try { Object response = fromJps.poll(1, TimeUnit.MINUTES); if (GroovyRtConstants.BUILD_ABORTED.equals(response)) { throw new RuntimeExceptio...
pauseAndWaitForJavac
39,001
GroovyClassLoader (final CompilerConfiguration compilerConfiguration, final AstAwareResourceLoader resourceLoader) { final ClassDependencyLoader checkWellFormed = new ClassDependencyLoader() { @Override protected void loadClassDependencies(Class aClass) throws ClassNotFoundException { if (resourceLoader.getSourceFile(a...
buildClassLoaderFor
39,002
GroovyClassLoader () { return new GroovyClassLoader(Thread.currentThread().getContextClassLoader(), compilerConfiguration) { @Override public Class<?> loadClass(String name, boolean lookupScriptFiles, boolean preferClassOverScript) throws ClassNotFoundException, CompilationFailedException { Class<?> aClass; try { aClas...
run
39,003
void () { this.forStubs = false; }
onContinuation
39,004
List<OutputItem> (final CompilationUnit unit, int throughPhase) { try { unit.compile(throughPhase); return getCompiledFiles(unit); } catch (CompilationFailedException e) { processCompilationException(e); } catch (IOException | GroovyBugError e) { processException(e, ""); } catch (NoClassDefFoundError e) { final String ...
compile
39,005
List<OutputItem> (CompilationUnit compilationUnit, final File stubDirectory) { final List<OutputItem> compiledFiles = new ArrayList<>(); compilationUnit.applyToPrimaryClassNodes(new CompilationUnit.PrimaryClassNodeOperation() { @Override public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)...
getStubOutputItems
39,006
void (ErrorCollector errorCollector) { for (int i = 0; i < errorCollector.getWarningCount(); i++) { WarningMessage warning = errorCollector.getWarning(i); collector.add(new GroovyCompilerMessage( GroovyCompilerMessageCategories.WARNING, warning.getMessage(), null, -1, -1 )); } }
addWarnings
39,007
void (Exception exception) { if (exception instanceof MultipleCompilationErrorsException) { MultipleCompilationErrorsException multipleCompilationErrorsException = (MultipleCompilationErrorsException) exception; ErrorCollector errorCollector = multipleCompilationErrorsException.getErrorCollector(); for (int i = 0; i < ...
processCompilationException
39,008
void (Message message) { if (message instanceof SyntaxErrorMessage) { SyntaxErrorMessage syntaxErrorMessage = (SyntaxErrorMessage) message; addErrorMessage(syntaxErrorMessage.getCause()); } else if (message instanceof ExceptionMessage) { ExceptionMessage exceptionMessage = (ExceptionMessage) message; processException(e...
processException
39,009
void (Throwable exception, String prefix) { if (exception instanceof GroovyRuntimeException) { addErrorMessage((GroovyRuntimeException) exception); return; } if (forStubs) { collector.add(new GroovyCompilerMessage( GroovyCompilerMessageCategories.INFORMATION, GroovyRtConstants.GROOVYC_STUB_GENERATION_FAILED, null, -1, ...
processException
39,010
void (String message, boolean error) { collector.add(new GroovyCompilerMessage(error ? GroovyCompilerMessageCategories.ERROR : GroovyCompilerMessageCategories.WARNING, message, null, -1, -1)); }
addMessageWithoutLocation
39,011
void (SyntaxException exception) { String message = exception.getMessage(); String justMessage = message.substring(0, message.lastIndexOf(LINE_AT)); collector.add(new GroovyCompilerMessage( GroovyCompilerMessageCategories.ERROR, justMessage, exception.getSourceLocator(), exception.getLine(), exception.getStartColumn() ...
addErrorMessage
39,012
void (GroovyRuntimeException exception) { ASTNode astNode = exception.getNode(); ModuleNode module = exception.getModule(); if (module == null) { module = findModule(astNode); } String moduleName = module == null ? "<no module>" : module.getDescription(); int lineNumber = astNode == null ? -1 : astNode.getLineNumber();...
addErrorMessage
39,013
String (GroovyRuntimeException exception) { if (exception.getCause() instanceof ClassNotFoundException) { String className = exception.getCause().getMessage(); return "An error occurred while trying to load a required class " + className + "." + " Please ensure it's present in the project dependencies. " + "See the mes...
getExceptionMessage
39,014
String (GroovyRuntimeException exception) { String message;StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); exception.printStackTrace(writer); message = stringWriter.getBuffer().toString(); return message; }
getStackTrace
39,015
ModuleNode (ASTNode node) { if (node instanceof ModuleNode) { return (ModuleNode)node; } if (node instanceof ClassNode) { return ((ClassNode)node).getModule(); } if (node instanceof AnnotatedNode) { ClassNode declaringClass = ((AnnotatedNode)node).getDeclaringClass(); if (declaringClass != null) { return declaringClass...
findModule
39,016
void (SimpleMessage message) { addMessageWithoutLocation(message.getMessage(), true); }
addErrorMessage
39,017
Collection<String> () { return Collections.unmodifiableCollection(myNames); }
getNames
39,018
int () { return myWeight; }
getWeight
39,019
Type () { return myType; }
getType
39,020
String () { return packaging; }
getPackaging
39,021
String () { return classifier; }
getClassifier
39,022
String () { return RepositoryArtifactData.class.getCanonicalName(); }
getKey
39,023
RepositoryArtifactData (@NotNull RepositoryArtifactData another) { return INSTANCE; }
mergeWith
39,024
boolean () { return myCache; }
useCache
39,025
boolean () { return myLocalOnly; }
isLocalOnly
39,026
Icon (@NotNull String path, int cacheKey, int flags) { return IconManager.getInstance().loadRasterizedIcon(path, FeaturesTrainerIcons.class.getClassLoader(), cacheKey, flags); }
load
39,027
AuthenticationData (String url) { if (!ContainerUtil.exists(PROVIDED_HOSTS, it -> url.contains(it))) { return null; } String userName = System.getProperty("jps.auth.spaceUsername"); String password = System.getProperty("jps.auth.spacePassword"); if (userName != null && password != null) { return new AuthenticationData(...
provideAuthenticationData
39,028
int () { return data; }
getData
39,029
void (int data) { this.data = data; }
setData
39,030
StructureView (int data) { return new StructureView() { { setData(data); } }; }
build
39,031
Path () { return testDataDir; }
getTestDataDir
39,032
Path () { return tempDir; }
getTempDir
39,033
Path () { return targetDir; }
getTargetDir
39,034
ConsoleDecompiler () { return decompiler; }
getDecompiler
39,035
boolean (Path dir) { return Files.isDirectory(dir) && Files.isDirectory(dir.resolve("classes")) && Files.isDirectory(dir.resolve("results")); }
isTestDataDir
39,036
void (Path expected, Path actual) { if (Files.isDirectory(expected)) { try { Files.walkFileTree(expected, new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path expectedFile, BasicFileAttributes attrs) { Path actualFile = actual.resolve(expected.relativize(expectedFile)); assertThat(actualFile).usi...
assertFilesEqual
39,037
FileVisitResult (Path expectedFile, BasicFileAttributes attrs) { Path actualFile = actual.resolve(expected.relativize(expectedFile)); assertThat(actualFile).usingCharset(StandardCharsets.UTF_8).hasSameTextualContentAs(expectedFile, StandardCharsets.UTF_8); return FileVisitResult.CONTINUE; }
visitFile
39,038
void (String className, String methodName) { }
startMethod
39,039
void (String className, String methodName) { }
finishMethod
39,040
void () { if (myAtomicInteger.incrementAndGet() > MIN_CALL_NUMBERS) { throw new CanceledException(new IllegalArgumentException()); } }
check
39,041
void () { doCancellableTest("pkg/TestPrimitiveNarrowing"); }
testCancellablePrimitiveNarrowing
39,042
void () { doCancellableTest("pkg/TestClassFields"); }
testCancellableClassFields
39,043
void () { doCancellableTest("pkg/TestInterfaceFields"); }
testCancellableInterfaceFields
39,044
void () { doCancellableTest("pkg/TestClassLambda"); }
testCancellableClassLambda
39,045
void (String testFile, String... companionFiles) { var decompiler = fixture.getDecompiler(); var classFile = fixture.getTestDataDir().resolve("classes/" + testFile + ".class"); assertThat(classFile).isRegularFile(); for (var file : SingleClassesTest.collectClasses(classFile)) { decompiler.addSource(file.toFile()); } fo...
doCancellableTest
39,046
void () { doTest("java11/TestUnsupportedConstantPoolEntry"); }
testUnsupportedConstantPoolEntry
39,047
void (String testFile, String... companionFiles) { var decompiler = fixture.getDecompiler(); var classFile = fixture.getTestDataDir().resolve("classes/" + testFile + ".class"); assertThat(classFile).isRegularFile(); for (var file : collectClasses(classFile)) { decompiler.addSource(file.toFile()); } for (String companio...
doTest
39,048
List<Path> (Path classFile) { var files = new ArrayList<Path>(); files.add(classFile); var parent = classFile.getParent(); if (parent != null) { var glob = classFile.getFileName().toString().replace(".class", "$*.class"); try (DirectoryStream<Path> inner = Files.newDirectoryStream(parent, glob)) { inner.forEach(files::...
collectClasses
39,049
void (String className, boolean shallBeRenamed) { doTest(Type.ELEMENT_CLASS, className, null, null, shallBeRenamed); }
doTestClassName
39,050
void (String element, String descriptor, boolean shallBeRenamed) { doTest(Type.ELEMENT_FIELD, VALID_CLASS_NAME, element, descriptor, shallBeRenamed); }
doTestFieldName
39,051
void (String element, String descriptor, boolean shallBeRenamed) { doTest(Type.ELEMENT_METHOD, VALID_CLASS_NAME, element, descriptor, shallBeRenamed); }
doTestMethodName
39,052
void (Type elementType, String className, String element, String descriptor, boolean shallBeRenamed) { boolean result = new ConverterHelper().toBeRenamed(elementType, className, element, descriptor); String assertionMessage = shallBeRenamed ? "Identifier { %s, %s, %s, %s } shall be renamed" : "Identifier { %s, %s, %s, ...
doTest
39,053
void () { var classes = fixture.getTempDir().resolve("classes"); unpack(fixture.getTestDataDir().resolve("bulk.jar"), classes); var decompiler = fixture.getDecompiler(); decompiler.addSource(classes.toFile()); decompiler.decompileContext(); assertFilesEqual(fixture.getTestDataDir().resolve("bulk"), fixture.getTargetDir...
testDirectory
39,054
void () { doTestJar("bulk"); }
testJar
39,055
void () { doTestJar("kt25937"); }
testKtJar
39,056
void () { doTestJar("obfuscated"); }
testObfuscated
39,057
void (String name) { var decompiler = fixture.getDecompiler(); var jarName = name + ".jar"; decompiler.addSource(fixture.getTestDataDir().resolve(jarName).toFile()); decompiler.decompileContext(); var unpacked = fixture.getTempDir().resolve("unpacked"); unpack(fixture.getTargetDir().resolve(jarName), unpacked); assertF...
doTestJar
39,058
void (Path archive, Path targetDir) { try (var zip = new ZipFile(archive.toFile())) { var entries = zip.entries(); while (entries.hasMoreElements()) { var entry = entries.nextElement(); if (!entry.isDirectory()) { if (entry.getName().contains("..")) throw new IllegalArgumentException("Invalid entry: " + entry.getName()...
unpack
39,059
void () { String s = ""; class NonCapturingLocalR1 { private final String s; public NonCapturingLocalR1(String s) { this.s = s; } @Override public String toString() { return this.s; } } class CapturingLocalR1 { private final int i; public CapturingLocalR1(int i) { this.i = i; } @Override public String toString() { retu...
run
39,060
String () { return this.s; }
toString
39,061
String () { return s + ":" + i; }
toString
39,062
String () { return null; }
call
39,063
String () { return s; }
call
39,064
void () { String s = ""; class NonCapturingLocalR2 { private final String s; public NonCapturingLocalR2(String s) { this.s = s; } @Override public String toString() { return this.s; } } class CapturingLocalR1 { private final int i; public CapturingLocalR1(int i) { this.i = i; } @Override public String toString() { retu...
run
39,065
String () { return this.s; }
toString
39,066
String () { return s + ":" + i; }
toString
39,067
String () { return null; }
call
39,068
String () { return s; }
call
39,069
void (String s) { class NonCapturingLocalM1 { private final String s; public NonCapturingLocalM1(String s) { this.s = s; } @Override public String toString() { return this.s; } } class CapturingLocalM1 { private final int i; public CapturingLocalM1(int i) { this.i = i; } @Override public String toString() { return s + ...
m1
39,070
String () { return this.s; }
toString
39,071
String () { return s + ":" + i; }
toString
39,072
String () { return null; }
call
39,073
String () { return s; }
call
39,074
void (String s) { class NonCapturingLocalM2 { private final String s; public NonCapturingLocalM2(String s) { this.s = s; } @Override public String toString() { return this.s; } } class CapturingLocalM2 { private final int i; public CapturingLocalM2(int i) { this.i = i; } @Override public String toString() { return s + ...
m2
39,075
String () { return this.s; }
toString
39,076
String () { return s + ":" + i; }
toString
39,077
String () { return null; }
call
39,078
String () { return s; }
call
39,079
void (String[] args) { Loader loader = new Loader(); String resource = loader.getResource(); System.out.println(resource); }
main
39,080
String () { URL resource = this.getClass().getClassLoader().getResource("pkg/res/resource.txt"); if (resource == null) { throw new RuntimeException("Resource missing"); } else { try { File file = new File(resource.toURI()); byte[] bytes = new byte[(int)file.length()]; FileInputStream stream = new FileInputStream(file);...
getResource
39,081
int (@NotNull Function1<? super Continuation<? super Unit>, ? extends Object> block) { Intrinsics.checkParameterIsNotNull(block, "block"); return 1; }
callSuspendBlock
39,082
int () { return 1; }
callSuspendBlockGood
39,083
int () { return Kt25937Kt.callSuspendBlock((Function1)(new Function1<Continuation<? super Unit>, Object>((Continuation)null) { int label; @Nullable public final Object invokeSuspend(@NotNull Object $result) { Object var2 = IntrinsicsKt.getCOROUTINE_SUSPENDED(); switch (this.label) { case 0: ResultKt.throwOnFailure($res...
some1
39,084
Object (@NotNull Object $result) { Object var2 = IntrinsicsKt.getCOROUTINE_SUSPENDED(); switch (this.label) { case 0: ResultKt.throwOnFailure($result); return Unit.INSTANCE; default: throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } }
invokeSuspend
39,085
Continuation<Unit> (@NotNull Continuation<?> completion) { Intrinsics.checkParameterIsNotNull(completion, "completion"); Function1 var2 = new <anonymous constructor>(completion); return var2; }
create
39,086
Object (Object var1) { return ((<undefinedtype>)this.create((Continuation)var1)).invokeSuspend(Unit.INSTANCE); }
invoke
39,087
void (String x) { try { System.out.println("sout1"); } catch (Exception e) { try { System.out.println("sout2"); } catch (Exception e2) { // Empty // Empty // Empty } } finally { System.out.println("finally"); } }
test1
39,088
int (String a) { try { return Integer.parseInt(a); } catch (Exception e) { System.out.println("Error" + e); } finally { System.out.println("Finally"); } return -1; }
test
39,089
void (String x) { try { System.out.println("sout1"); } catch (Exception e) { try { System.out.println("sout2"); } catch (Exception e2) { // Empty // Empty // Empty } } finally { System.out.println("finally"); } }
test1
39,090
int (String a) { try { return Integer.parseInt(a); } catch (Exception e) { System.out.println("Error" + e); } finally { System.out.println("Finally"); } return -1; }
test
39,091
void () { System.out.println("test"); }
test
39,092
void () { class Inner { final String x; public Inner(@Deprecated String x) { this.x = x; } } new Inner("test"); new Inner1Static("test"); new Inner1Static.Inner2Static("test"); }
testStaticMethod
39,093
void () { class Inner { final String x; public Inner(@Deprecated String x) { this.x = x; } } new Inner("test"); new Inner1Static("test"); new Inner1("test"); new Inner1Static.Inner2Static("test"); }
testMethod
39,094
void (Object o) { switch (o) { case String s -> System.out.println("s"); case Integer i -> System.out.println("i"); case Object ob -> System.out.println(o); } }
testObject
39,095
void (Object o) { switch (o) { case String s -> System.out.println("s"); case Integer i -> System.out.println("i"); case Object ob -> System.out.println(o); case null -> System.out.println("null"); } }
testObject2
39,096
void (Object o) { switch (o) { case String s -> System.out.println("s"); case Integer i -> System.out.println("i"); case null -> System.out.println("null"); default -> System.out.println("o"); } }
testObject3
39,097
void (Object o) { switch (o) { case String s -> System.out.println("s"); case Integer i -> System.out.println("i"); default -> System.out.println("o"); } }
testObject4
39,098
void () { TestInterfaceSuper.super.defaultMethod(); }
defaultMethod
39,099
void () { int a = 5; }
run