_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q30600 | TraitASTTransformation.copyClassAnnotations | train | private static void copyClassAnnotations(final ClassNode cNode, final ClassNode helper) {
List<AnnotationNode> annotations = cNode.getAnnotations();
for (AnnotationNode annotation : annotations) {
if (!annotation.getClassNode().equals(Traits.TRAIT_CLASSNODE)) {
helper.addAnno... | java | {
"resource": ""
} |
q30601 | DataSet.each | train | public void each(@ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
eachRow(getSql(), getParameters(), closure);
} | java | {
"resource": ""
} |
q30602 | DataSet.rows | train | public List rows(int offset, int maxRows) throws SQLException {
return rows(getSql(), getParameters(), offset, maxRows);
} | java | {
"resource": ""
} |
q30603 | DataSet.firstRow | train | public Object firstRow() throws SQLException {
List rows = rows();
if (rows.isEmpty()) return null;
return (rows.get(0));
} | java | {
"resource": ""
} |
q30604 | AnnotationCollectorTransform.addError | train | protected void addError(String message, ASTNode node, SourceUnit source) {
source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException(
message, node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()
), so... | java | {
"resource": ""
} |
q30605 | AnnotationCollectorTransform.getSerializeClass | train | private static ClassNode getSerializeClass(ClassNode alias) {
List<AnnotationNode> annotations = alias.getAnnotations(ClassHelper.make(AnnotationCollector.class));
if (!annotations.isEmpty()) {
AnnotationNode annotationNode = annotations.get(0);
Expression member = annotationNode... | java | {
"resource": ""
} |
q30606 | AnnotationCollectorTransform.getTargetAnnotationList | train | protected List<AnnotationNode> getTargetAnnotationList(AnnotationNode collector, AnnotationNode aliasAnnotationUsage, SourceUnit source) {
List<AnnotationNode> stored = getStoredTargetList(aliasAnnotationUsage, source);
List<AnnotationNode> targetList = getTargetListFromValue(collector, aliasAnnotat... | java | {
"resource": ""
} |
q30607 | AnnotationCollectorTransform.visit | train | public List<AnnotationNode> visit(AnnotationNode collector, AnnotationNode aliasAnnotationUsage, AnnotatedNode aliasAnnotated, SourceUnit source) {
List<AnnotationNode> ret = getTargetAnnotationList(collector, aliasAnnotationUsage, source);
Set<String> unusedNames = new HashSet<String>(aliasAnnotationU... | java | {
"resource": ""
} |
q30608 | Attribute.namespaceURI | train | public String namespaceURI() {
if (namespacePrefix == null || namespacePrefix.isEmpty()) return "";
String uri = namespaceTagHints.get(namespacePrefix);
return uri == null ? "" : uri;
} | java | {
"resource": ""
} |
q30609 | Weighers.asEntryWeigher | train | public static <K, V> EntryWeigher<K, V> asEntryWeigher(
final Weigher<? super V> weigher) {
return (weigher == singleton())
? Weighers.<K, V>entrySingleton()
: new EntryWeigherView<K, V>(weigher);
} | java | {
"resource": ""
} |
q30610 | ReturnAdder.addReturnIfNeeded | train | @Deprecated
public static void addReturnIfNeeded(MethodNode node) {
ReturnAdder adder = new ReturnAdder();
adder.visitMethod(node);
} | java | {
"resource": ""
} |
q30611 | LRUProtectionStorage.touch | train | public synchronized void touch(final Object key, final Object value) {
remove(key);
put(key, value);
} | java | {
"resource": ""
} |
q30612 | LRUProtectionStorage.get | train | @Override
public synchronized Object get(final Object key) {
final Object value = remove(key);
if (value != null) put(key, value);
return value;
} | java | {
"resource": ""
} |
q30613 | ReflectionUtils.getCallingClass | train | public static Class getCallingClass(int matchLevel, Collection<String> extraIgnoredPackages) {
Class[] classContext = HELPER.getClassContext();
int depth = 0;
try {
Class c;
// this super class stuff is for Java 1.4 support only
// it isn't needed on a 5.0 VM... | java | {
"resource": ""
} |
q30614 | CSTNode.isOneOf | train | public boolean isOneOf(int[] types) {
int meaning = getMeaning();
for (int i = 0; i < types.length; i++) {
if (Types.ofType(meaning, types[i])) {
return true;
}
}
return false;
} | java | {
"resource": ""
} |
q30615 | CSTNode.getMeaningAs | train | public int getMeaningAs(int[] types) {
for (int i = 0; i < types.length; i++) {
if (isA(types[i])) {
return types[i];
}
}
return Types.UNKNOWN;
} | java | {
"resource": ""
} |
q30616 | CSTNode.matches | train | boolean matches(int type, int child1, int child2) {
return matches(type, child1) && get(2, true).isA(child2);
} | java | {
"resource": ""
} |
q30617 | CSTNode.getRoot | train | public Token getRoot(boolean safe) {
Token root = getRoot();
if (root == null && safe) {
root = Token.NULL;
}
return root;
} | java | {
"resource": ""
} |
q30618 | CSTNode.addChildrenOf | train | public void addChildrenOf(CSTNode of) {
for (int i = 1; i < of.size(); i++) {
add(of.get(i));
}
} | java | {
"resource": ""
} |
q30619 | Closure.ncurry | train | public Closure<V> ncurry(int n, final Object argument) {
return ncurry(n, new Object[]{argument});
} | java | {
"resource": ""
} |
q30620 | Closure.dehydrate | train | @SuppressWarnings("unchecked")
public Closure<V> dehydrate() {
Closure<V> result = (Closure<V>) this.clone();
result.delegate = null;
result.owner = null;
result.thisObject = null;
return result;
} | java | {
"resource": ""
} |
q30621 | BenchmarkInterceptor.beforeInvoke | train | public Object beforeInvoke(Object object, String methodName, Object[] arguments) {
if (!calls.containsKey(methodName)) calls.put(methodName, new LinkedList());
((List) calls.get(methodName)).add(System.currentTimeMillis());
return null;
} | java | {
"resource": ""
} |
q30622 | BenchmarkInterceptor.afterInvoke | train | public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {
((List) calls.get(methodName)).add(System.currentTimeMillis());
return result;
} | java | {
"resource": ""
} |
q30623 | TypeHelper.getWrapperClass | train | protected static Class getWrapperClass(Class c) {
if (c == Integer.TYPE) {
c = Integer.class;
} else if (c == Byte.TYPE) {
c = Byte.class;
} else if (c == Long.TYPE) {
c = Long.class;
} else if (c == Double.TYPE) {
c = Double.class;
... | java | {
"resource": ""
} |
q30624 | TypeHelper.argumentClassIsParameterClass | train | protected static boolean argumentClassIsParameterClass(Class argumentClass, Class parameterClass) {
if (argumentClass == parameterClass) return true;
if (getWrapperClass(parameterClass) == argumentClass) return true;
return false;
} | java | {
"resource": ""
} |
q30625 | TypeHelper.replaceWithMoreSpecificType | train | protected static MethodType replaceWithMoreSpecificType(Object[] args, MethodType callSiteType) {
for (int i=0; i<args.length; i++) {
// if argument null, take the static type
if (args[i]==null) continue;
if (callSiteType.parameterType(i).isPrimitive()) continue;
... | java | {
"resource": ""
} |
q30626 | Groovydoc.setPackagenames | train | public void setPackagenames(String packages) {
StringTokenizer tok = new StringTokenizer(packages, ",");
while (tok.hasMoreTokens()) {
String packageName = tok.nextToken();
packageNames.add(packageName);
}
} | java | {
"resource": ""
} |
q30627 | fasta.random | train | public static final double random(double max) {
last = (last * IA + IC) % IM;
return max * last / IM;
} | java | {
"resource": ""
} |
q30628 | JsonLexer.readingConstant | train | private JsonToken readingConstant(JsonTokenType type, JsonToken token) {
try {
int numCharsToRead = ((String) type.getValidator()).length();
char[] chars = new char[numCharsToRead];
reader.read(chars);
String stringRead = new String(chars);
if (string... | java | {
"resource": ""
} |
q30629 | JsonLexer.skipWhitespace | train | public int skipWhitespace() {
try {
int readChar = 20;
char c = SPACE;
while (Character.isWhitespace(c)) {
reader.mark(1);
readChar = reader.read();
c = (char) readChar;
}
reader.reset();
retu... | java | {
"resource": ""
} |
q30630 | StaticTypesTypeChooser.getTarget | train | private static VariableExpression getTarget(VariableExpression ve) {
if (ve.getAccessedVariable() == null || ve.getAccessedVariable() == ve || (!(ve.getAccessedVariable() instanceof VariableExpression)))
return ve;
return getTarget((VariableExpression) ve.getAccessedVariable());
} | java | {
"resource": ""
} |
q30631 | AbstractReaderSource.getLine | train | public String getLine(int lineNumber, Janitor janitor) {
// If the source is already open and is passed the line we
// want, close it.
if (lineSource != null && number > lineNumber) {
cleanup();
}
// If the line source is closed, try to open it.
if (lineSourc... | java | {
"resource": ""
} |
q30632 | GroovyRowResult.getAt | train | public Object getAt(int index) {
try {
// a negative index will count backwards from the last column.
if (index < 0)
index += result.size();
Iterator it = result.values().iterator();
int i = 0;
Object obj = null;
while ((obj... | java | {
"resource": ""
} |
q30633 | GroovyRowResult.put | train | @SuppressWarnings("unchecked")
public Object put(Object key, Object value) {
// avoid different case keys being added by explicit remove
Object orig = remove(key);
result.put(key, value);
return orig;
} | java | {
"resource": ""
} |
q30634 | NioGroovyMethods.withObjectOutputStream | train | public static <T> T withObjectOutputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectOutputStream(self), closure);
} | java | {
"resource": ""
} |
q30635 | NioGroovyMethods.newObjectInputStream | train | public static ObjectInputStream newObjectInputStream(Path self, final ClassLoader classLoader) throws IOException {
return IOGroovyMethods.newObjectInputStream(Files.newInputStream(self), classLoader);
} | java | {
"resource": ""
} |
q30636 | NioGroovyMethods.withObjectInputStream | train | public static <T> T withObjectInputStream(Path self, ClassLoader classLoader, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectInputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectInputStream(self, classLoader), closure);
} | java | {
"resource": ""
} |
q30637 | NioGroovyMethods.getText | train | public static String getText(Path self, String charset) throws IOException {
return IOGroovyMethods.getText(newReader(self, charset));
} | java | {
"resource": ""
} |
q30638 | NioGroovyMethods.setBytes | train | public static void setBytes(Path self, byte[] bytes) throws IOException {
IOGroovyMethods.setBytes(Files.newOutputStream(self), bytes);
} | java | {
"resource": ""
} |
q30639 | NioGroovyMethods.leftShift | train | public static Path leftShift(Path self, byte[] bytes) throws IOException {
append(self, bytes);
return self;
} | java | {
"resource": ""
} |
q30640 | NioGroovyMethods.write | train | public static void write(Path self, String text, String charset) throws IOException {
write(self, text, charset, false);
} | java | {
"resource": ""
} |
q30641 | NioGroovyMethods.append | train | public static void append(Path self, Object text) throws IOException {
append(self, text, Charset.defaultCharset().name(), false);
} | java | {
"resource": ""
} |
q30642 | NioGroovyMethods.append | train | public static void append(Path self, Object text, String charset) throws IOException {
append(self, text, charset, false);
} | java | {
"resource": ""
} |
q30643 | NioGroovyMethods.eachDir | train | public static void eachDir(Path self, @ClosureParams(value = SimpleType.class, options = "java.nio.file.Path") Closure closure) throws IOException { // throws FileNotFoundException, IllegalArgumentException {
eachFile(self, FileType.DIRECTORIES, closure);
} | java | {
"resource": ""
} |
q30644 | NioGroovyMethods.renameTo | train | public static boolean renameTo(final Path self, URI newPathName) {
try {
Files.move(self, Paths.get(newPathName));
return true;
} catch (IOException e) {
return false;
}
} | java | {
"resource": ""
} |
q30645 | NioGroovyMethods.newWriter | train | public static BufferedWriter newWriter(Path self) throws IOException {
return Files.newBufferedWriter(self, Charset.defaultCharset());
} | java | {
"resource": ""
} |
q30646 | NioGroovyMethods.newWriter | train | public static BufferedWriter newWriter(Path self, String charset, boolean append) throws IOException {
return newWriter(self, charset, append, false);
} | java | {
"resource": ""
} |
q30647 | NioGroovyMethods.withWriter | train | public static <T> T withWriter(Path self, String charset, @ClosureParams(value = SimpleType.class, options = "java.io.Writer") Closure<T> closure) throws IOException {
return withWriter(self, charset, false, closure);
} | java | {
"resource": ""
} |
q30648 | NioGroovyMethods.withWriterAppend | train | public static <T> T withWriterAppend(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.Writer") Closure<T> closure) throws IOException {
return withWriterAppend(self, Charset.defaultCharset().name(), closure);
} | java | {
"resource": ""
} |
q30649 | NioGroovyMethods.newPrintWriter | train | public static PrintWriter newPrintWriter(Path self, String charset) throws IOException {
return new GroovyPrintWriter(newWriter(self, charset));
} | java | {
"resource": ""
} |
q30650 | NioGroovyMethods.eachByte | train | public static void eachByte(Path self, int bufferLen, @ClosureParams(value = FromString.class, options = "byte[],Integer") Closure closure) throws IOException {
BufferedInputStream is = newInputStream(self);
IOGroovyMethods.eachByte(is, bufferLen, closure);
} | java | {
"resource": ""
} |
q30651 | SimpleGroovyDoc.compareTo | train | public int compareTo(Object that) {
if (that instanceof GroovyDoc) {
return name.compareTo(((GroovyDoc) that).name());
} else {
throw new ClassCastException(String.format("Cannot compare object of type %s.", that.getClass()));
}
} | java | {
"resource": ""
} |
q30652 | InvokerHelper.setProperties | train | public static void setProperties(Object object, Map map) {
MetaClass mc = getMetaClass(object);
for (Object o : map.entrySet()) {
Map.Entry entry = (Map.Entry) o;
String key = entry.getKey().toString();
Object value = entry.getValue();
setPropertySafe(obje... | java | {
"resource": ""
} |
q30653 | InvokerHelper.write | train | public static void write(Writer out, Object object) throws IOException {
if (object instanceof String) {
out.write((String) object);
} else if (object instanceof Object[]) {
out.write(toArrayString((Object[]) object));
} else if (object instanceof Map) {
out.w... | java | {
"resource": ""
} |
q30654 | InvokerHelper.append | train | public static void append(Appendable out, Object object) throws IOException {
if (object instanceof String) {
out.append((String) object);
} else if (object instanceof Object[]) {
out.append(toArrayString((Object[]) object));
} else if (object instanceof Map) {
... | java | {
"resource": ""
} |
q30655 | Groovyc.setSrcdir | train | public void setSrcdir(Path srcDir) {
if (src == null) {
src = srcDir;
} else {
src.append(srcDir);
}
} | java | {
"resource": ""
} |
q30656 | Groovyc.setSourcepath | train | public void setSourcepath(Path sourcepath) {
if (compileSourcepath == null) {
compileSourcepath = sourcepath;
} else {
compileSourcepath.append(sourcepath);
}
} | java | {
"resource": ""
} |
q30657 | BindPath.updatePath | train | public synchronized void updatePath(PropertyChangeListener listener, Object newObject, Set updateSet) {
if (currentObject != newObject) {
removeListeners();
}
if ((children != null) && (children.length > 0)) {
try {
Object newValue = null;
... | java | {
"resource": ""
} |
q30658 | BindPath.addAllListeners | train | public void addAllListeners(PropertyChangeListener listener, Object newObject, Set updateSet) {
addListeners(listener, newObject, updateSet);
if ((children != null) && (children.length > 0)) {
try {
Object newValue = null;
if (newObject != null) {
... | java | {
"resource": ""
} |
q30659 | BindPath.addListeners | train | public void addListeners(PropertyChangeListener listener, Object newObject, Set updateSet) {
removeListeners();
if (newObject != null) {
// check for local synthetics
TriggerBinding syntheticTrigger = getSyntheticTriggerBinding(newObject);
MetaClass mc = InvokerHelper... | java | {
"resource": ""
} |
q30660 | BindPath.removeListeners | train | public void removeListeners() {
if (globalListener != null) {
try {
InvokerHelper.invokeMethod(currentObject, "removePropertyChangeListener", globalListener);
} catch (Exception e) {
//LOGME ignore the failure
}
globalListener = nul... | java | {
"resource": ""
} |
q30661 | MacroCallTransformingVisitor.tryMacroMethod | train | private boolean tryMacroMethod(MethodCallExpression call, ExtensionMethodNode macroMethod, Object[] macroArguments) {
Expression result = (Expression) InvokerHelper.invokeStaticMethod(
macroMethod.getExtensionMethodNode().getDeclaringClass().getTypeClass(),
macroMethod.getName(),
... | java | {
"resource": ""
} |
q30662 | CachedField.setProperty | train | public void setProperty(final Object object, Object newValue) {
AccessPermissionChecker.checkAccessPermission(field);
final Object goalValue = DefaultTypeTransformation.castToType(newValue, field.getType());
if (isFinal()) {
throw new GroovyRuntimeException("Cannot set the property ... | java | {
"resource": ""
} |
q30663 | PluginDefaultGroovyMethods.putAt | train | public static void putAt(StringBuilder self, IntRange range, Object value) {
RangeInfo info = subListBorders(self.length(), range);
self.replace(info.from, info.to, value.toString());
} | java | {
"resource": ""
} |
q30664 | XmlParser.parse | train | public Node parse(File file) throws IOException, SAXException {
InputSource input = new InputSource(new FileInputStream(file));
input.setSystemId("file://" + file.getAbsolutePath());
getXMLReader().parse(input);
return parent;
} | java | {
"resource": ""
} |
q30665 | XmlParser.parse | train | public Node parse(InputSource input) throws IOException, SAXException {
getXMLReader().parse(input);
return parent;
} | java | {
"resource": ""
} |
q30666 | XmlParser.parse | train | public Node parse(String uri) throws IOException, SAXException {
InputSource is = new InputSource(uri);
getXMLReader().parse(is);
return parent;
} | java | {
"resource": ""
} |
q30667 | XmlParser.getElementName | train | protected Object getElementName(String namespaceURI, String localName, String qName) {
String name = localName;
String prefix = "";
if ((name == null) || (name.length() < 1)) {
name = qName;
}
if (namespaceURI == null || namespaceURI.length() <= 0) {
retur... | java | {
"resource": ""
} |
q30668 | ClosureSignatureHint.pickGenericType | train | public static ClassNode pickGenericType(ClassNode type, int gtIndex) {
final GenericsType[] genericsTypes = type.getGenericsTypes();
if (genericsTypes==null || genericsTypes.length<gtIndex) {
return ClassHelper.OBJECT_TYPE;
}
return genericsTypes[gtIndex].getType();
} | java | {
"resource": ""
} |
q30669 | ClosureSignatureHint.pickGenericType | train | public static ClassNode pickGenericType(MethodNode node, int parameterIndex, int gtIndex) {
final Parameter[] parameters = node.getParameters();
final ClassNode type = parameters[parameterIndex].getOriginType();
return pickGenericType(type, gtIndex);
} | java | {
"resource": ""
} |
q30670 | ClosureSignatureHint.findClassNode | train | protected ClassNode findClassNode(final SourceUnit sourceUnit, final CompilationUnit compilationUnit, final String className) {
if (className.endsWith("[]")) {
return findClassNode(sourceUnit, compilationUnit, className.substring(0, className.length() - 2)).makeArray();
}
ClassNode c... | java | {
"resource": ""
} |
q30671 | AssertionRenderer.render | train | public static String render(String text, ValueRecorder recorder) {
return new AssertionRenderer(text, recorder).render();
} | java | {
"resource": ""
} |
q30672 | IndyGuardsFiltersAndSignatures.setBeanProperties | train | public static Object setBeanProperties(MetaClass mc, Object bean, Map properties) {
for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = (Map.Entry) iter.next();
String key = entry.getKey().toString();
Object value = entry.getValue();
... | java | {
"resource": ""
} |
q30673 | IndyGuardsFiltersAndSignatures.isSameMetaClass | train | public static boolean isSameMetaClass(MetaClass mc, Object receiver) {
//TODO: remove this method if possible by switchpoint usage
return receiver instanceof GroovyObject && mc==((GroovyObject)receiver).getMetaClass();
} | java | {
"resource": ""
} |
q30674 | IndyGuardsFiltersAndSignatures.sameClass | train | public static boolean sameClass(Class c, Object o) {
if (o==null) return false;
return o.getClass() == c;
} | java | {
"resource": ""
} |
q30675 | DefaultGroovyStaticMethods.start | train | public static Thread start(Thread self, Closure closure) {
return createThread(null, false, closure);
} | java | {
"resource": ""
} |
q30676 | DefaultGroovyStaticMethods.start | train | public static Thread start(Thread self, String name, Closure closure) {
return createThread(name, false, closure);
} | java | {
"resource": ""
} |
q30677 | DefaultGroovyStaticMethods.startDaemon | train | public static Thread startDaemon(Thread self, Closure closure) {
return createThread(null, true, closure);
} | java | {
"resource": ""
} |
q30678 | DefaultGroovyStaticMethods.startDaemon | train | public static Thread startDaemon(Thread self, String name, Closure closure) {
return createThread(name, true, closure);
} | java | {
"resource": ""
} |
q30679 | TraitComposer.createSuperForwarder | train | private static void createSuperForwarder(ClassNode targetNode, MethodNode forwarder, final Map<String,ClassNode> genericsSpec) {
List<ClassNode> interfaces = new ArrayList<ClassNode>(Traits.collectAllInterfacesReverseOrder(targetNode, new LinkedHashSet<ClassNode>()));
String name = forwarder.getName();
... | java | {
"resource": ""
} |
q30680 | AsmClassGenerator.visitConstantExpression | train | public void visitConstantExpression(ConstantExpression expression) {
final String constantName = expression.getConstantName();
if (controller.isStaticConstructor() || constantName == null) {
controller.getOperandStack().pushConstant(expression);
} else {
controller.getMet... | java | {
"resource": ""
} |
q30681 | AsmClassGenerator.visitBooleanExpression | train | public void visitBooleanExpression(BooleanExpression expression) {
controller.getCompileStack().pushBooleanExpression();
int mark = controller.getOperandStack().getStackLength();
Expression inner = expression.getExpression();
inner.visit(this);
controller.getOperandStack().castTo... | java | {
"resource": ""
} |
q30682 | AsmClassGenerator.visitClassExpression | train | public void visitClassExpression(ClassExpression expression) {
ClassNode type = expression.getType();
MethodVisitor mv = controller.getMethodVisitor();
if (BytecodeHelper.isClassLiteralPossible(type) || BytecodeHelper.isSameCompilationUnit(controller.getClassNode(), type)) {
if (cont... | java | {
"resource": ""
} |
q30683 | AsmClassGenerator.visitAnnotationAttributes | train | private void visitAnnotationAttributes(AnnotationNode an, AnnotationVisitor av) {
Map<String, Object> constantAttrs = new HashMap<String, Object>();
Map<String, PropertyExpression> enumAttrs = new HashMap<String, PropertyExpression>();
Map<String, Object> atAttrs = new HashMap<String, Object>();... | java | {
"resource": ""
} |
q30684 | NewifyASTTransformation.determineClasses | train | private ListExpression determineClasses(Expression expr, boolean searchSourceUnit) {
ListExpression list = new ListExpression();
if (expr instanceof ClassExpression) {
list.addExpression(expr);
} else if (expr instanceof VariableExpression && searchSourceUnit) {
VariableE... | java | {
"resource": ""
} |
q30685 | MethodNodeUtils.methodDescriptorWithoutReturnType | train | public static String methodDescriptorWithoutReturnType(MethodNode mNode) {
StringBuilder sb = new StringBuilder();
sb.append(mNode.getName()).append(':');
for (Parameter p : mNode.getParameters()) {
sb.append(ClassNodeUtils.formatTypeName(p.getType())).append(',');
}
... | java | {
"resource": ""
} |
q30686 | MethodNodeUtils.methodDescriptor | train | public static String methodDescriptor(MethodNode mNode) {
StringBuilder sb = new StringBuilder(mNode.getName().length() + mNode.getParameters().length * 10);
sb.append(mNode.getReturnType().getName());
sb.append(' ');
sb.append(mNode.getName());
sb.append('(');
for (int i... | java | {
"resource": ""
} |
q30687 | MethodNodeUtils.getPropertyName | train | public static String getPropertyName(MethodNode mNode) {
String name = mNode.getName();
if (name.startsWith("set") || name.startsWith("get") || name.startsWith("is")) {
String pname = decapitalize(name.substring(name.startsWith("is") ? 2 : 3));
if (!pname.isEmpty()) {
... | java | {
"resource": ""
} |
q30688 | WideningCategories.isIntCategory | train | public static boolean isIntCategory(ClassNode type) {
return type==byte_TYPE || type==char_TYPE ||
type==int_TYPE || type==short_TYPE;
} | java | {
"resource": ""
} |
q30689 | WideningCategories.lowestUpperBound | train | public static ClassNode lowestUpperBound(List<ClassNode> nodes) {
if (nodes.size()==1) return nodes.get(0);
return lowestUpperBound(nodes.get(0), lowestUpperBound(nodes.subList(1, nodes.size())));
} | java | {
"resource": ""
} |
q30690 | WideningCategories.lowestUpperBound | train | public static ClassNode lowestUpperBound(ClassNode a, ClassNode b) {
ClassNode lub = lowestUpperBound(a, b, null, null);
if (lub==null || !lub.isUsingGenerics()) return lub;
// types may be parameterized. If so, we must ensure that generic type arguments
// are made compatible
i... | java | {
"resource": ""
} |
q30691 | WideningCategories.parameterizeLowestUpperBound | train | private static ClassNode parameterizeLowestUpperBound(final ClassNode lub, final ClassNode a, final ClassNode b, final ClassNode fallback) {
if (!lub.isUsingGenerics()) return lub;
// a common super type exists, all we have to do is to parameterize
// it according to the types provided by the tw... | java | {
"resource": ""
} |
q30692 | WideningCategories.keepLowestCommonInterfaces | train | private static List<ClassNode> keepLowestCommonInterfaces(List<ClassNode> fromA, List<ClassNode> fromB) {
if (fromA==null||fromB==null) return EMPTY_CLASSNODE_LIST;
Set<ClassNode> common = new HashSet<ClassNode>(fromA);
common.retainAll(fromB);
List<ClassNode> result = new ArrayList<Clas... | java | {
"resource": ""
} |
q30693 | WideningCategories.buildTypeWithInterfaces | train | private static ClassNode buildTypeWithInterfaces(ClassNode baseType1, ClassNode baseType2, Collection<ClassNode> interfaces) {
boolean noInterface = interfaces.isEmpty();
if (noInterface) {
if (baseType1.equals(baseType2)) return baseType1;
if (baseType1.isDerivedFrom(baseType2))... | java | {
"resource": ""
} |
q30694 | WideningCategories.areEqualWithGenerics | train | private static boolean areEqualWithGenerics(ClassNode a, ClassNode b) {
if (a==null) return b==null;
if (!a.equals(b)) return false;
if (a.isUsingGenerics() && !b.isUsingGenerics()) return false;
GenericsType[] gta = a.getGenericsTypes();
GenericsType[] gtb = b.getGenericsTypes()... | java | {
"resource": ""
} |
q30695 | JsonSlurper.parse | train | public Object parse(char [] chars) {
if (chars == null) {
throw new IllegalArgumentException("chars must not be null");
}
Object content;
content = createParser().parse(chars);
return content;
} | java | {
"resource": ""
} |
q30696 | ValueHolder.addPropertyChangeListener | train | public void addPropertyChangeListener(PropertyChangeListener listener) {
if ( propertyChangeSupport == null ) {
propertyChangeSupport = new PropertyChangeSupport(this);
}
propertyChangeSupport.addPropertyChangeListener(listener);
} | java | {
"resource": ""
} |
q30697 | Numbers.parseInteger | train | public static Number parseInteger(AST reportNode, String text) {
// remove place holder underscore before starting
text = text.replace("_", "");
char c = ' ';
int length = text.length();
//
// Strip off the sign, if present
boolean negative = false;
if... | java | {
"resource": ""
} |
q30698 | Numbers.parseDecimal | train | public static Number parseDecimal(String text) {
text = text.replace("_", "");
int length = text.length();
//
// Strip off any type specifier and convert it to lower
// case, if present.
char type = 'x';
if (isNumericTypeSpecifier(text.charAt(length - 1), true)... | java | {
"resource": ""
} |
q30699 | ExpandoMetaClass.registerBeanProperty | train | public void registerBeanProperty(final String property, final Object newValue) {
performOperationOnMetaClass(new Callable() {
public void call() {
Class type = newValue == null ? Object.class : newValue.getClass();
MetaBeanProperty mbp = newValue instanceof MetaBeanP... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.