method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static <T> boolean isSubset ( Set<T> set, Set<T> subset) throws Exception { if (subset != null && set == null) { return false; } if (subset == null || set == null) { return true; } if (subset.isEmpty() == false && set.isEmpty() == true) { return false; } if (subset.isEmpty() == true || set.isEmpty() == true) { return true; } for (T t : subset) { if (set.contains(t) == false) { return false; } } return true; }
static <T> boolean function ( Set<T> set, Set<T> subset) throws Exception { if (subset != null && set == null) { return false; } if (subset == null set == null) { return true; } if (subset.isEmpty() == false && set.isEmpty() == true) { return false; } if (subset.isEmpty() == true set.isEmpty() == true) { return true; } for (T t : subset) { if (set.contains(t) == false) { return false; } } return true; }
/** * isSubset * checks if a Set is a subset of another Set * @param set: main Set * @param subset: check is is Set is a subset of "set" * @return true if subset is a sub-set of set and false otherwise * @throws Exception */
isSubset checks if a Set is a subset of another Set
isSubset
{ "repo_name": "vangav/vos_backend", "path": "src/com/vangav/backend/data_structures_and_algorithms/algorithms/SubsetInl.java", "license": "mit", "size": 2827 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
701,434
public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException { // keep track of the entity depth fEntityDepth++; // must reset entity scanner fEntityScanner = fEntityManager.getEntityScanner(); fEntityStore = fEntityManager.getEntityStore() ; } // startEntity(String,XMLResourceIdentifier,String)
void function(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException { fEntityDepth++; fEntityScanner = fEntityManager.getEntityScanner(); fEntityStore = fEntityManager.getEntityStore() ; }
/** * This method notifies of the start of an entity. The document entity * has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" * parameter entity names start with '%'; and general entities are just * specified by their name. * * @param name The name of the entity. * @param identifier The resource identifier. * @param encoding The auto-detected IANA encoding name of the entity * stream. This value will be null in those situations * where the entity encoding is not auto-detected (e.g. * internal entities or a document entity that is * parsed from a java.io.Reader). * * @throws XNIException Thrown by handler to signal an error. */
This method notifies of the start of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name
startEntity
{ "repo_name": "PrincetonUniversity/NVJVM", "path": "build/linux-amd64/jaxp/drop/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java", "license": "gpl-2.0", "size": 56304 }
[ "com.sun.org.apache.xerces.internal.xni.Augmentations", "com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier", "com.sun.org.apache.xerces.internal.xni.XNIException" ]
import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; import com.sun.org.apache.xerces.internal.xni.XNIException;
import com.sun.org.apache.xerces.internal.xni.*;
[ "com.sun.org" ]
com.sun.org;
218,000
public String getBase64UUID(Random random) { final byte[] randomBytes = new byte[16]; random.nextBytes(randomBytes); randomBytes[6] &= 0x0f; randomBytes[6] |= 0x40; randomBytes[8] &= 0x3f; randomBytes[8] |= 0x80; return Base64.getUrlEncoder().withoutPadding().encodeToString(randomBytes); }
String function(Random random) { final byte[] randomBytes = new byte[16]; random.nextBytes(randomBytes); randomBytes[6] &= 0x0f; randomBytes[6] = 0x40; randomBytes[8] &= 0x3f; randomBytes[8] = 0x80; return Base64.getUrlEncoder().withoutPadding().encodeToString(randomBytes); }
/** * Returns a Base64 encoded version of a Version 4.0 compatible UUID * randomly initialized by the given {@link java.util.Random} instance * as defined here: http://www.ietf.org/rfc/rfc4122.txt */
Returns a Base64 encoded version of a Version 4.0 compatible UUID randomly initialized by the given <code>java.util.Random</code> instance as defined here: HREF
getBase64UUID
{ "repo_name": "EvilMcJerkface/crate", "path": "server/src/main/java/org/elasticsearch/common/RandomBasedUUIDGenerator.java", "license": "apache-2.0", "size": 2409 }
[ "java.util.Base64", "java.util.Random" ]
import java.util.Base64; import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
2,344,518
public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException { contentHandler.startElement(FormsConstants.INSTANCE_NS, WIDGETS_EL, FormsConstants.INSTANCE_PREFIX_COLON + WIDGETS_EL, XMLUtils.EMPTY_ATTRIBUTES); Iterator widgetIt = widgets.iterator(); while (widgetIt.hasNext()) { Widget widget = (Widget)widgetIt.next(); widget.generateSaxFragment(contentHandler, locale); } contentHandler.endElement(FormsConstants.INSTANCE_NS, WIDGETS_EL, FormsConstants.INSTANCE_PREFIX_COLON + WIDGETS_EL); }
void function(ContentHandler contentHandler, Locale locale) throws SAXException { contentHandler.startElement(FormsConstants.INSTANCE_NS, WIDGETS_EL, FormsConstants.INSTANCE_PREFIX_COLON + WIDGETS_EL, XMLUtils.EMPTY_ATTRIBUTES); Iterator widgetIt = widgets.iterator(); while (widgetIt.hasNext()) { Widget widget = (Widget)widgetIt.next(); widget.generateSaxFragment(contentHandler, locale); } contentHandler.endElement(FormsConstants.INSTANCE_NS, WIDGETS_EL, FormsConstants.INSTANCE_PREFIX_COLON + WIDGETS_EL); }
/** * Generates the SAXfragments of the contained widgets * * @param contentHandler * @param locale * @throws SAXException * * @see Widget#generateSaxFragment(ContentHandler, Locale) */
Generates the SAXfragments of the contained widgets
generateSaxFragment
{ "repo_name": "apache/cocoon", "path": "blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/WidgetList.java", "license": "apache-2.0", "size": 5762 }
[ "java.util.Iterator", "java.util.Locale", "org.apache.cocoon.forms.FormsConstants", "org.apache.cocoon.xml.XMLUtils", "org.xml.sax.ContentHandler", "org.xml.sax.SAXException" ]
import java.util.Iterator; import java.util.Locale; import org.apache.cocoon.forms.FormsConstants; import org.apache.cocoon.xml.XMLUtils; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException;
import java.util.*; import org.apache.cocoon.forms.*; import org.apache.cocoon.xml.*; import org.xml.sax.*;
[ "java.util", "org.apache.cocoon", "org.xml.sax" ]
java.util; org.apache.cocoon; org.xml.sax;
156,028
public static String[][] decodeStringDoubleArray(String value) { ArrayList<ArrayList<String>> newList = new ArrayList<ArrayList<String>>(); StringBuilder sb = new StringBuilder(); ArrayList<String> thisEntry = new ArrayList<String>(); boolean escaped = false; for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); if (!escaped && c == '\\') { escaped = true; continue; } else if (!escaped && c == ':') { thisEntry.add(sb.toString()); sb = new StringBuilder(); } else if (!escaped && c == ';') { thisEntry.add(sb.toString()); sb = new StringBuilder(); newList.add(thisEntry); thisEntry = new ArrayList<String>(); } else { sb.append(c); } escaped = false; } if (sb.length() > 0) { thisEntry.add(sb.toString()); } if (!thisEntry.isEmpty()) { newList.add(thisEntry); } // Convert to String[][]: String[][] res = new String[newList.size()][]; for (int i = 0; i < res.length; i++) { res[i] = new String[newList.get(i).size()]; for (int j = 0; j < res[i].length; j++) { res[i][j] = newList.get(i).get(j); } } return res; }
static String[][] function(String value) { ArrayList<ArrayList<String>> newList = new ArrayList<ArrayList<String>>(); StringBuilder sb = new StringBuilder(); ArrayList<String> thisEntry = new ArrayList<String>(); boolean escaped = false; for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); if (!escaped && c == '\\') { escaped = true; continue; } else if (!escaped && c == ':') { thisEntry.add(sb.toString()); sb = new StringBuilder(); } else if (!escaped && c == ';') { thisEntry.add(sb.toString()); sb = new StringBuilder(); newList.add(thisEntry); thisEntry = new ArrayList<String>(); } else { sb.append(c); } escaped = false; } if (sb.length() > 0) { thisEntry.add(sb.toString()); } if (!thisEntry.isEmpty()) { newList.add(thisEntry); } String[][] res = new String[newList.size()][]; for (int i = 0; i < res.length; i++) { res[i] = new String[newList.get(i).size()]; for (int j = 0; j < res[i].length; j++) { res[i][j] = newList.get(i).get(j); } } return res; }
/** * Decodes an encoded double String array back into array form. The array * is assumed to be square, and delimited by the characters ';' (first dim) and * ':' (second dim). * @param value The encoded String to be decoded. * @return The decoded String array. */
Decodes an encoded double String array back into array form. The array is assumed to be square, and delimited by the characters ';' (first dim) and ':' (second dim)
decodeStringDoubleArray
{ "repo_name": "robymus/jabref", "path": "src/main/java/net/sf/jabref/logic/util/strings/StringUtil.java", "license": "gpl-2.0", "size": 21429 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
255,844
@Override public void paintComponent(final Graphics g) { final Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); final Dimension size = getSize(); final Insets insets = getInsets(); final double xx = insets.left; final double yy = insets.top; final double ww = size.getWidth() - insets.left - insets.right; final double hh = size.getHeight() - insets.top - insets.bottom; // calculate point one final Point2D one = new Point2D.Double(xx + 6, yy + hh / 2); // calculate point two final Point2D two = new Point2D.Double(xx + ww - 6, yy + hh / 2); // draw a circle at point one final Ellipse2D circle1 = new Ellipse2D.Double(one.getX() - 5, one.getY() - 5, 10, 10); final Ellipse2D circle2 = new Ellipse2D.Double(two.getX() - 6, two.getY() - 5, 10, 10); // draw a circle at point two g2.draw(circle1); g2.fill(circle1); g2.draw(circle2); g2.fill(circle2); // draw a line connecting the points final Line2D line = new Line2D.Double(one, two); if (this.stroke != null) { g2.setStroke(this.stroke); g2.draw(line); } }
void function(final Graphics g) { final Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); final Dimension size = getSize(); final Insets insets = getInsets(); final double xx = insets.left; final double yy = insets.top; final double ww = size.getWidth() - insets.left - insets.right; final double hh = size.getHeight() - insets.top - insets.bottom; final Point2D one = new Point2D.Double(xx + 6, yy + hh / 2); final Point2D two = new Point2D.Double(xx + ww - 6, yy + hh / 2); final Ellipse2D circle1 = new Ellipse2D.Double(one.getX() - 5, one.getY() - 5, 10, 10); final Ellipse2D circle2 = new Ellipse2D.Double(two.getX() - 6, two.getY() - 5, 10, 10); g2.draw(circle1); g2.fill(circle1); g2.draw(circle2); g2.fill(circle2); final Line2D line = new Line2D.Double(one, two); if (this.stroke != null) { g2.setStroke(this.stroke); g2.draw(line); } }
/** * Draws a line using the sample stroke. * * @param g the graphics device. */
Draws a line using the sample stroke
paintComponent
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/main/java/org/jfree/chart/ui/StrokeSample.java", "license": "lgpl-2.1", "size": 5852 }
[ "java.awt.Dimension", "java.awt.Graphics", "java.awt.Graphics2D", "java.awt.Insets", "java.awt.RenderingHints", "java.awt.geom.Ellipse2D", "java.awt.geom.Line2D", "java.awt.geom.Point2D" ]
import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.RenderingHints; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import java.awt.geom.Point2D;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
29,705
@Test(expected = IllegalArgumentException.class) public void createDuplicatePort() { target.createPort(PORT); target.createPort(PORT); }
@Test(expected = IllegalArgumentException.class) void function() { target.createPort(PORT); target.createPort(PORT); }
/** * Tests if creating a duplicate port fails with an exception. */
Tests if creating a duplicate port fails with an exception
createDuplicatePort
{ "repo_name": "oplinkoms/onos", "path": "apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/impl/OpenstackNetworkManagerTest.java", "license": "apache-2.0", "size": 25526 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
834,663
public void columnReorder(ColumnReorderEvent event); } public static class ColumnCollapseEvent extends Component.Event { public static final Method METHOD = ReflectTools.findMethod( ColumnCollapseListener.class, "columnCollapseStateChange", ColumnCollapseEvent.class); private Object propertyId; public ColumnCollapseEvent(Component source, Object propertyId) { super(source); this.propertyId = propertyId; }
void function(ColumnReorderEvent event); } public static class ColumnCollapseEvent extends Component.Event { public static final Method METHOD = ReflectTools.findMethod( ColumnCollapseListener.class, STR, ColumnCollapseEvent.class); private Object propertyId; public ColumnCollapseEvent(Component source, Object propertyId) { super(source); this.propertyId = propertyId; }
/** * This method is triggered when the column has been reordered * * @param event */
This method is triggered when the column has been reordered
columnReorder
{ "repo_name": "oalles/vaadin", "path": "server/src/com/vaadin/ui/Table.java", "license": "apache-2.0", "size": 221060 }
[ "com.vaadin.util.ReflectTools", "java.lang.reflect.Method" ]
import com.vaadin.util.ReflectTools; import java.lang.reflect.Method;
import com.vaadin.util.*; import java.lang.reflect.*;
[ "com.vaadin.util", "java.lang" ]
com.vaadin.util; java.lang;
1,659,470
@SuppressWarnings({"unchecked"}) public static <T> IgniteClosure<T, T> identity() { return IDENTITY; }
@SuppressWarnings({STR}) static <T> IgniteClosure<T, T> function() { return IDENTITY; }
/** * Gets identity closure, i.e. the closure that returns its variable value. * * @param <T> Type of the variable and return value for the closure. * @return Identity closure, i.e. the closure that returns its variable value. */
Gets identity closure, i.e. the closure that returns its variable value
identity
{ "repo_name": "f7753/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java", "license": "apache-2.0", "size": 159864 }
[ "org.apache.ignite.lang.IgniteClosure" ]
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.lang.*;
[ "org.apache.ignite" ]
org.apache.ignite;
607,182
public ApplicationContext getReadOnlyApplicationContext() { return this.applicationContext; }
ApplicationContext function() { return this.applicationContext; }
/** * Gets the application context. Will not start a subsystem. * * @return the application context or null */
Gets the application context. Will not start a subsystem
getReadOnlyApplicationContext
{ "repo_name": "Tybion/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/management/subsystems/ChildApplicationContextFactory.java", "license": "lgpl-3.0", "size": 36909 }
[ "org.springframework.context.ApplicationContext" ]
import org.springframework.context.ApplicationContext;
import org.springframework.context.*;
[ "org.springframework.context" ]
org.springframework.context;
2,164,321
public static String hexEncode(final ClassID classID) { return hexEncode(classID.getBytes()); }
static String function(final ClassID classID) { return hexEncode(classID.getBytes()); }
/** * <p>Converts a class ID into its hexadecimal notation.</p> */
Converts a class ID into its hexadecimal notation
hexEncode
{ "repo_name": "srnsw/xena", "path": "plugins/project/ext/src/poi-3.2-FINAL/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java", "license": "gpl-3.0", "size": 7218 }
[ "org.apache.poi.hpsf.ClassID" ]
import org.apache.poi.hpsf.ClassID;
import org.apache.poi.hpsf.*;
[ "org.apache.poi" ]
org.apache.poi;
235,659
@Generated @Selector("ABRecordWithAddressBook:") public native ConstVoidPtr ABRecordWithAddressBook(ConstVoidPtr addressBook);
@Selector(STR) native ConstVoidPtr function(ConstVoidPtr addressBook);
/** * ABRecordWithAddressBook * <p> * Returns the ABRecordRef that represents this participant. * <p> * This method returns the ABRecordRef that represents this participant, * if a match can be found based on email address in the address book * passed. If we cannot find the participant, nil is returned. */
ABRecordWithAddressBook Returns the ABRecordRef that represents this participant. This method returns the ABRecordRef that represents this participant, if a match can be found based on email address in the address book passed. If we cannot find the participant, nil is returned
ABRecordWithAddressBook
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/eventkit/EKParticipant.java", "license": "apache-2.0", "size": 7577 }
[ "org.moe.natj.general.ptr.ConstVoidPtr", "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.general.ptr.ConstVoidPtr; import org.moe.natj.objc.ann.Selector;
import org.moe.natj.general.ptr.*; import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
2,409,926
@Override public void flush() throws IOException { super.flush(); // Flush the current buffer if (useSocketBuffer) { socketBuffer.flushBuffer(); } }
void function() throws IOException { super.flush(); if (useSocketBuffer) { socketBuffer.flushBuffer(); } }
/** * Flush the response. * * @throws IOException an underlying I/O error occurred */
Flush the response
flush
{ "repo_name": "mayonghui2112/helloWorld", "path": "sourceCode/apache-tomcat-7.0.82-src/java/org/apache/coyote/http11/InternalOutputBuffer.java", "license": "apache-2.0", "size": 6541 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,446,354
@Entrypoint static void checkcast(Object object, int id) throws ClassCastException, NoClassDefFoundError { if (object == null) { return; // null may be cast to any type } TypeReference tRef = TypeReference.getTypeRef(id); RVMType lhsType = tRef.peekType(); if (lhsType == null) { lhsType = tRef.resolve(); } RVMType rhsType = ObjectModel.getObjectType(object); if (lhsType == rhsType) { return; // exact match } // not an exact match, do more involved lookups // if (!isAssignableWith(lhsType, rhsType)) { throw new ClassCastException("Cannot cast a(n) " + rhsType + " to a(n) " + lhsType); } }
static void checkcast(Object object, int id) throws ClassCastException, NoClassDefFoundError { if (object == null) { return; } TypeReference tRef = TypeReference.getTypeRef(id); RVMType lhsType = tRef.peekType(); if (lhsType == null) { lhsType = tRef.resolve(); } RVMType rhsType = ObjectModel.getObjectType(object); if (lhsType == rhsType) { return; } throw new ClassCastException(STR + rhsType + STR + lhsType); } }
/** * Throw exception unless object is instance of target * class/array or implements target interface. * @param object object to be tested * @param id of type reference corresponding to target class/array/interface */
Throw exception unless object is instance of target class/array or implements target interface
checkcast
{ "repo_name": "ut-osa/laminar", "path": "jikesrvm-3.0.0/rvm/src/org/jikesrvm/runtime/RuntimeEntrypoints.java", "license": "bsd-3-clause", "size": 41085 }
[ "org.jikesrvm.classloader.RVMType", "org.jikesrvm.classloader.TypeReference", "org.jikesrvm.objectmodel.ObjectModel" ]
import org.jikesrvm.classloader.RVMType; import org.jikesrvm.classloader.TypeReference; import org.jikesrvm.objectmodel.ObjectModel;
import org.jikesrvm.classloader.*; import org.jikesrvm.objectmodel.*;
[ "org.jikesrvm.classloader", "org.jikesrvm.objectmodel" ]
org.jikesrvm.classloader; org.jikesrvm.objectmodel;
196,136
private KeelResponse getKeelResultList(String model, String listName, long userUniqueId, String searchCondition, String listSearchCategory) { KeelResponse res = null; ModelRequest req = null; try { req = ModelTools.createModelRequest(); Model listingModel = (Model) req.getService(Model.ROLE, model, (Context) keelIritgoAuthMap.get(new Long( userUniqueId))); ((KeelContextualizable) req).setKeelContext((Context) keelIritgoAuthMap.get(new Long(userUniqueId))); req.setParameter("listId", "list"); req.setParameter("recordsPerPage", new Integer(100)); req.setParameter("listSearch", searchCondition); req.setParameter("aktario", "true"); if (! listSearchCategory.equals("")) { req.setParameter("listSearchCategory", listSearchCategory); req.setParameter(listName + "SearchCategory", listSearchCategory); } res = listingModel.execute(req); } catch (Exception x) { Log.log("system", "ConnectorServerManager.doQuery", "Keel error, unknown model (" + model + ")? Error: " + x, Log.FATAL); return null; } finally { ModelTools.releaseModelRequest(req); } return res; }
KeelResponse function(String model, String listName, long userUniqueId, String searchCondition, String listSearchCategory) { KeelResponse res = null; ModelRequest req = null; try { req = ModelTools.createModelRequest(); Model listingModel = (Model) req.getService(Model.ROLE, model, (Context) keelIritgoAuthMap.get(new Long( userUniqueId))); ((KeelContextualizable) req).setKeelContext((Context) keelIritgoAuthMap.get(new Long(userUniqueId))); req.setParameter(STR, "list"); req.setParameter(STR, new Integer(100)); req.setParameter(STR, searchCondition); req.setParameter(STR, "true"); if (! listSearchCategory.equals(STRlistSearchCategorySTRSearchCategorySTRsystemSTRConnectorServerManager.doQuerySTRKeel error, unknown model (STR)? Error: " + x, Log.FATAL); return null; } finally { ModelTools.releaseModelRequest(req); } return res; }
/** * Return a keel response from the given model. * * @param String The model name. * @param String The name from the List. * @param long User unique id. * @return KeelResponse object */
Return a keel response from the given model
getKeelResultList
{ "repo_name": "iritgo/iritgo-aktera", "path": "aktera-aktario-aktario/src/main/java/de/iritgo/aktera/aktario/akteraconnector/ConnectorServerManager.java", "license": "apache-2.0", "size": 31210 }
[ "de.iritgo.aktario.core.logger.Log", "de.iritgo.aktera.context.KeelContextualizable", "de.iritgo.aktera.model.KeelResponse", "de.iritgo.aktera.model.Model", "de.iritgo.aktera.model.ModelRequest", "de.iritgo.aktera.tools.ModelTools", "org.apache.avalon.framework.context.Context" ]
import de.iritgo.aktario.core.logger.Log; import de.iritgo.aktera.context.KeelContextualizable; import de.iritgo.aktera.model.KeelResponse; import de.iritgo.aktera.model.Model; import de.iritgo.aktera.model.ModelRequest; import de.iritgo.aktera.tools.ModelTools; import org.apache.avalon.framework.context.Context;
import de.iritgo.aktario.core.logger.*; import de.iritgo.aktera.context.*; import de.iritgo.aktera.model.*; import de.iritgo.aktera.tools.*; import org.apache.avalon.framework.context.*;
[ "de.iritgo.aktario", "de.iritgo.aktera", "org.apache.avalon" ]
de.iritgo.aktario; de.iritgo.aktera; org.apache.avalon;
225,652
public UpdateResult processFast(Object[] args) throws IgniteCheckedException { if (fastUpdate != null) return fastUpdate.execute(cacheContext().cache(), args); return null; }
UpdateResult function(Object[] args) throws IgniteCheckedException { if (fastUpdate != null) return fastUpdate.execute(cacheContext().cache(), args); return null; }
/** * Process fast DML operation if possible. * * @param args QUery arguments. * @return Update result or {@code null} if fast update is not applicable for plan. * @throws IgniteCheckedException If failed. */
Process fast DML operation if possible
processFast
{ "repo_name": "NSAmelchev/ignite", "path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlan.java", "license": "apache-2.0", "size": 23354 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.query.h2.UpdateResult" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.query.h2.UpdateResult;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.query.h2.*;
[ "org.apache.ignite" ]
org.apache.ignite;
979,585
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<NetworkInterfaceIpConfigurationInner>> getVirtualMachineScaleSetIpConfigurationWithResponseAsync( String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<NetworkInterfaceIpConfigurationInner>> getVirtualMachineScaleSetIpConfigurationWithResponseAsync( String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, String expand);
/** * Get the specified network interface ip configuration in a virtual machine scale set. * * @param resourceGroupName The name of the resource group. * @param virtualMachineScaleSetName The name of the virtual machine scale set. * @param virtualmachineIndex The virtual machine index. * @param networkInterfaceName The name of the network interface. * @param ipConfigurationName The name of the ip configuration. * @param expand Expands referenced resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified network interface ip configuration in a virtual machine scale set along with {@link * Response} on successful completion of {@link Mono}. */
Get the specified network interface ip configuration in a virtual machine scale set
getVirtualMachineScaleSetIpConfigurationWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/NetworkInterfacesClient.java", "license": "mit", "size": 71039 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceIpConfigurationInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,862,004
private void parseRules(File grammarFile) throws FileNotFoundException { nameToSymbol.put("EPSILON", epsilon); Scanner data = new Scanner(grammarFile); int code = 1; int ruleNumber = 0; while (data.hasNext()) { StringTokenizer t = new StringTokenizer(data.nextLine()); String symbolName = t.nextToken(); if (!nameToSymbol.containsKey(symbolName)) { Symbol s = new NonTerminal(code, symbolName); if (code == 1) startSymbol = (NonTerminal) s; nameToSymbol.put(symbolName, s); alphabet.add(s); code++; } t.nextToken();// -> NonTerminal leftSide = (NonTerminal) nameToSymbol.get(symbolName); while (t.hasMoreTokens()) { List<Symbol> rightSide = new ArrayList<Symbol>(); do { symbolName = t.nextToken(); if (!symbolName.equals("|")) { if (!nameToSymbol.containsKey(symbolName)) { Symbol s; if (Character.isUpperCase(symbolName.charAt(0))) s = new NonTerminal(code++, symbolName); else s = new Terminal(code++, symbolName); nameToSymbol.put(symbolName, s); alphabet.add(s); } rightSide.add(nameToSymbol.get(symbolName)); } } while (!symbolName.equals("|") && t.hasMoreTokens()); rules.add(new Rule(ruleNumber++, leftSide, rightSide.toArray(new Symbol[] {}))); } } }
void function(File grammarFile) throws FileNotFoundException { nameToSymbol.put(STR, epsilon); Scanner data = new Scanner(grammarFile); int code = 1; int ruleNumber = 0; while (data.hasNext()) { StringTokenizer t = new StringTokenizer(data.nextLine()); String symbolName = t.nextToken(); if (!nameToSymbol.containsKey(symbolName)) { Symbol s = new NonTerminal(code, symbolName); if (code == 1) startSymbol = (NonTerminal) s; nameToSymbol.put(symbolName, s); alphabet.add(s); code++; } t.nextToken(); NonTerminal leftSide = (NonTerminal) nameToSymbol.get(symbolName); while (t.hasMoreTokens()) { List<Symbol> rightSide = new ArrayList<Symbol>(); do { symbolName = t.nextToken(); if (!symbolName.equals(" ")) { if (!nameToSymbol.containsKey(symbolName)) { Symbol s; if (Character.isUpperCase(symbolName.charAt(0))) s = new NonTerminal(code++, symbolName); else s = new Terminal(code++, symbolName); nameToSymbol.put(symbolName, s); alphabet.add(s); } rightSide.add(nameToSymbol.get(symbolName)); } } while (!symbolName.equals(" ") && t.hasMoreTokens()); rules.add(new Rule(ruleNumber++, leftSide, rightSide.toArray(new Symbol[] {}))); } } }
/** * Constructs grammar rules from file * * @param grammarFile * file with grammar rules * @throws FileNotFoundException * if file with the specified pathname does not exist */
Constructs grammar rules from file
parseRules
{ "repo_name": "OpenSoftwareSolutions/scriptplayground", "path": "modules/cfg-parser/src/org/oss/cfg/parser/Parser.java", "license": "unlicense", "size": 14713 }
[ "java.io.File", "java.io.FileNotFoundException", "java.util.ArrayList", "java.util.List", "java.util.Scanner", "java.util.StringTokenizer" ]
import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.StringTokenizer;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
206,616
public List<String> getExtensions() { return extensions; } /** * {@inheritDoc}
List<String> function() { return extensions; } /** * {@inheritDoc}
/** * Gets the managed extensions. * * @return the list of extensions. */
Gets the managed extensions
getExtensions
{ "repo_name": "ow2-chameleon/core", "path": "src/main/java/org/ow2/chameleon/core/services/ExtensionBasedDeployer.java", "license": "apache-2.0", "size": 2253 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,512,141
public void testRetrieve() throws Exception { List<String> fields = Arrays.asList(new String[] {"name", "ownerId"}); IdName newAccountIdName = createAccount(); RestResponse response = restClient.sendSync(RestRequest.getRequestForRetrieve(TestCredentials.API_VERSION, "account", newAccountIdName.id, fields)); checkResponse(response, HttpStatus.SC_OK, false); JSONObject jsonResponse = response.asJSONObject(); checkKeys(jsonResponse, "attributes", "Name", "OwnerId", "Id"); assertEquals("Wrong row returned", newAccountIdName.name, jsonResponse.getString("Name")); }
void function() throws Exception { List<String> fields = Arrays.asList(new String[] {"name", STR}); IdName newAccountIdName = createAccount(); RestResponse response = restClient.sendSync(RestRequest.getRequestForRetrieve(TestCredentials.API_VERSION, STR, newAccountIdName.id, fields)); checkResponse(response, HttpStatus.SC_OK, false); JSONObject jsonResponse = response.asJSONObject(); checkKeys(jsonResponse, STR, "Name", STR, "Id"); assertEquals(STR, newAccountIdName.name, jsonResponse.getString("Name")); }
/** * Testing a retrieve call to the server. * Create new account then retrieve it. * @throws Exception */
Testing a retrieve call to the server. Create new account then retrieve it
testRetrieve
{ "repo_name": "kchitalia/SalesforceMobileSDK-Android", "path": "libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/rest/RestClientTest.java", "license": "apache-2.0", "size": 31647 }
[ "com.salesforce.androidsdk.TestCredentials", "java.util.Arrays", "java.util.List", "org.apache.http.HttpStatus", "org.json.JSONObject" ]
import com.salesforce.androidsdk.TestCredentials; import java.util.Arrays; import java.util.List; import org.apache.http.HttpStatus; import org.json.JSONObject;
import com.salesforce.androidsdk.*; import java.util.*; import org.apache.http.*; import org.json.*;
[ "com.salesforce.androidsdk", "java.util", "org.apache.http", "org.json" ]
com.salesforce.androidsdk; java.util; org.apache.http; org.json;
1,170,503
public static void createInputFile(final FileSystem fs, final Path path, final Set<Path> toCompactDirs) throws IOException { // Extract the list of store dirs List<Path> storeDirs = new LinkedList<Path>(); for (Path compactDir: toCompactDirs) { if (isFamilyDir(fs, compactDir)) { storeDirs.add(compactDir); } else if (isRegionDir(fs, compactDir)) { for (Path familyDir: FSUtils.getFamilyDirs(fs, compactDir)) { storeDirs.add(familyDir); } } else if (isTableDir(fs, compactDir)) { // Lookup regions for (Path regionDir: FSUtils.getRegionDirs(fs, compactDir)) { for (Path familyDir: FSUtils.getFamilyDirs(fs, regionDir)) { storeDirs.add(familyDir); } } } else { throw new IOException( "Specified path is not a table, region or family directory. path=" + compactDir); } } // Write Input File FSDataOutputStream stream = fs.create(path); LOG.info("Create input file=" + path + " with " + storeDirs.size() + " dirs to compact."); try { final byte[] newLine = Bytes.toBytes("\n"); for (Path storeDir: storeDirs) { stream.write(Bytes.toBytes(storeDir.toString())); stream.write(newLine); } } finally { stream.close(); } } }
static void function(final FileSystem fs, final Path path, final Set<Path> toCompactDirs) throws IOException { List<Path> storeDirs = new LinkedList<Path>(); for (Path compactDir: toCompactDirs) { if (isFamilyDir(fs, compactDir)) { storeDirs.add(compactDir); } else if (isRegionDir(fs, compactDir)) { for (Path familyDir: FSUtils.getFamilyDirs(fs, compactDir)) { storeDirs.add(familyDir); } } else if (isTableDir(fs, compactDir)) { for (Path regionDir: FSUtils.getRegionDirs(fs, compactDir)) { for (Path familyDir: FSUtils.getFamilyDirs(fs, regionDir)) { storeDirs.add(familyDir); } } } else { throw new IOException( STR + compactDir); } } FSDataOutputStream stream = fs.create(path); LOG.info(STR + path + STR + storeDirs.size() + STR); try { final byte[] newLine = Bytes.toBytes("\n"); for (Path storeDir: storeDirs) { stream.write(Bytes.toBytes(storeDir.toString())); stream.write(newLine); } } finally { stream.close(); } } }
/** * Create the input file for the given directories to compact. * The file is a TextFile with each line corrisponding to a * store files directory to compact. */
Create the input file for the given directories to compact. The file is a TextFile with each line corrisponding to a store files directory to compact
createInputFile
{ "repo_name": "zqxjjj/NobidaBase", "path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java", "license": "apache-2.0", "size": 18499 }
[ "java.io.IOException", "java.util.LinkedList", "java.util.List", "java.util.Set", "org.apache.hadoop.fs.FSDataOutputStream", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path", "org.apache.hadoop.hbase.util.Bytes", "org.apache.hadoop.hbase.util.FSUtils" ]
import java.io.IOException; import java.util.LinkedList; import java.util.List; import java.util.Set; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils;
import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
863,387
@Override public void storeAll(Map<Long, T> map) { for (Map.Entry<Long, T> entry : map.entrySet()) { store(entry.getKey(), entry.getValue()); } }
void function(Map<Long, T> map) { for (Map.Entry<Long, T> entry : map.entrySet()) { store(entry.getKey(), entry.getValue()); } }
/** * Stores multiple entries. Implementation of this method can optimize the * store operation by storing all entries in one database connection for instance. * * @param map map of entries to store */
Stores multiple entries. Implementation of this method can optimize the store operation by storing all entries in one database connection for instance
storeAll
{ "repo_name": "emre-aydin/hazelcast", "path": "hazelcast/src/test/java/com/hazelcast/collection/impl/queue/QueueStoreTest.java", "license": "apache-2.0", "size": 24872 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,508,933
@return A Mixer that is considered appropriate, or null if none is found. */ private static Mixer getFirstMixer(MixerProvider provider, Line.Info info, boolean isMixingRequired) { Mixer.Info[] infos = provider.getMixerInfo(); for (int j = 0; j < infos.length; j++) { Mixer mixer = provider.getMixer(infos[j]); if (isAppropriateMixer(mixer, info, isMixingRequired)) { return mixer; } } return null; } /** Checks if a Mixer is appropriate. A Mixer is considered appropriate if it support the given line type. If isMixingRequired is true and the line type is an output one (SourceDataLine, Clip), the mixer is appropriate if it supports at least 2 (concurrent) lines of the given type.
@return A Mixer that is considered appropriate, or null if none is found. */ static Mixer function(MixerProvider provider, Line.Info info, boolean isMixingRequired) { Mixer.Info[] infos = provider.getMixerInfo(); for (int j = 0; j < infos.length; j++) { Mixer mixer = provider.getMixer(infos[j]); if (isAppropriateMixer(mixer, info, isMixingRequired)) { return mixer; } } return null; } /** Checks if a Mixer is appropriate. A Mixer is considered appropriate if it support the given line type. If isMixingRequired is true and the line type is an output one (SourceDataLine, Clip), the mixer is appropriate if it supports at least 2 (concurrent) lines of the given type.
/** From a given MixerProvider, return the first appropriate Mixer. @param provider The MixerProvider to check for Mixers. @param info The type of line the returned Mixer is required to support. @param isMixingRequired If true, only Mixers that support mixing are returned for line types of SourceDataLine and Clip. @return A Mixer that is considered appropriate, or null if none is found. */
From a given MixerProvider, return the first appropriate Mixer
getFirstMixer
{ "repo_name": "wangsongpeng/jdk-src", "path": "src/main/java/javax/sound/sampled/AudioSystem.java", "license": "apache-2.0", "size": 63644 }
[ "javax.sound.sampled.spi.MixerProvider" ]
import javax.sound.sampled.spi.MixerProvider;
import javax.sound.sampled.spi.*;
[ "javax.sound" ]
javax.sound;
380,751
public void setBaseLinesVisible(boolean flag) { this.baseLinesVisible = flag; notifyListeners(new RendererChangeEvent(this)); }
void function(boolean flag) { this.baseLinesVisible = flag; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the base 'lines visible' flag and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param flag the flag. * * @see #getBaseLinesVisible() */
Sets the base 'lines visible' flag and sends a <code>RendererChangeEvent</code> to all registered listeners
setBaseLinesVisible
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/jfreechart-1.0.5/source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java", "license": "lgpl-3.0", "size": 44950 }
[ "org.jfree.chart.event.RendererChangeEvent" ]
import org.jfree.chart.event.RendererChangeEvent;
import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
501,314
public void waitForState(ApplicationAttemptId attemptId, RMAppAttemptState finalState, int timeoutMsecs) throws InterruptedException { drainEventsImplicitly(); RMApp app = getRMContext().getRMApps().get(attemptId.getApplicationId()); Assert.assertNotNull("app shouldn't be null", app); RMAppAttempt attempt = app.getRMAppAttempt(attemptId); MockRM.waitForState(attempt, finalState, timeoutMsecs); }
void function(ApplicationAttemptId attemptId, RMAppAttemptState finalState, int timeoutMsecs) throws InterruptedException { drainEventsImplicitly(); RMApp app = getRMContext().getRMApps().get(attemptId.getApplicationId()); Assert.assertNotNull(STR, app); RMAppAttempt attempt = app.getRMAppAttempt(attemptId); MockRM.waitForState(attempt, finalState, timeoutMsecs); }
/** * Wait until an attempt has reached a specified state. * The timeout can be specified by the parameter. * @param attemptId the id of an attempt * @param finalState the attempt state waited * @param timeoutMsecs the length of timeout in milliseconds * @throws InterruptedException * if interrupted while waiting for the state transition */
Wait until an attempt has reached a specified state. The timeout can be specified by the parameter
waitForState
{ "repo_name": "WIgor/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java", "license": "apache-2.0", "size": 50169 }
[ "org.apache.hadoop.yarn.api.records.ApplicationAttemptId", "org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp", "org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt", "org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState", "org.junit.Assert" ]
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState; import org.junit.Assert;
import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.*; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
1,132,947
public static <K, V> Map<K, V> of(Map<K, V> map) { return new MRUMapCache<>(map); }
static <K, V> Map<K, V> function(Map<K, V> map) { return new MRUMapCache<>(map); }
/** * Wraps the specified map with a most recently used cache * * @param map * @param <K> * @param <V> * @return */
Wraps the specified map with a most recently used cache
of
{ "repo_name": "JBYoshi/SpongeCommon", "path": "src/main/java/co/aikar/util/MRUMapCache.java", "license": "mit", "size": 3678 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,403,880
public Charset getCharacterSet() { return (Charset) getParameter(CHARACTER_SET); }
Charset function() { return (Charset) getParameter(CHARACTER_SET); }
/** * Get the charset of the page being tracked * * @return the charset */
Get the charset of the page being tracked
getCharacterSet
{ "repo_name": "BCsorba/piwik-java-tracking-api", "path": "src/main/java/org/piwik/java/tracking/PiwikRequest.java", "license": "bsd-3-clause", "size": 65386 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
2,058,505
private static String humanHelper(int flags, int mask, int what) { StringBuffer sb = new StringBuffer(80); int extra = flags & ~mask; flags &= mask; if ((flags & ACC_PUBLIC) != 0) { sb.append("|public"); } if ((flags & ACC_PRIVATE) != 0) { sb.append("|private"); } if ((flags & ACC_PROTECTED) != 0) { sb.append("|protected"); } if ((flags & ACC_STATIC) != 0) { sb.append("|static"); } if ((flags & ACC_FINAL) != 0) { sb.append("|final"); } if ((flags & ACC_SYNCHRONIZED) != 0) { if (what == CONV_CLASS) { sb.append("|super"); } else { sb.append("|synchronized"); } } if ((flags & ACC_VOLATILE) != 0) { if (what == CONV_METHOD) { sb.append("|bridge"); } else { sb.append("|volatile"); } } if ((flags & ACC_TRANSIENT) != 0) { if (what == CONV_METHOD) { sb.append("|varargs"); } else { sb.append("|transient"); } } if ((flags & ACC_NATIVE) != 0) { sb.append("|native"); } if ((flags & ACC_INTERFACE) != 0) { sb.append("|interface"); } if ((flags & ACC_ABSTRACT) != 0) { sb.append("|abstract"); } if ((flags & ACC_STRICT) != 0) { sb.append("|strictfp"); } if ((flags & ACC_SYNTHETIC) != 0) { sb.append("|synthetic"); } if ((flags & ACC_ANNOTATION) != 0) { sb.append("|annotation"); } if ((flags & ACC_ENUM) != 0) { sb.append("|enum"); } if ((flags & ACC_CONSTRUCTOR) != 0) { sb.append("|constructor"); } if ((flags & ACC_DECLARED_SYNCHRONIZED) != 0) { sb.append("|declared_synchronized"); } if ((extra != 0) || (sb.length() == 0)) { sb.append('|'); sb.append(Hex.u2(extra)); } return sb.substring(1); }
static String function(int flags, int mask, int what) { StringBuffer sb = new StringBuffer(80); int extra = flags & ~mask; flags &= mask; if ((flags & ACC_PUBLIC) != 0) { sb.append(STR); } if ((flags & ACC_PRIVATE) != 0) { sb.append(STR); } if ((flags & ACC_PROTECTED) != 0) { sb.append(STR); } if ((flags & ACC_STATIC) != 0) { sb.append(STR); } if ((flags & ACC_FINAL) != 0) { sb.append(STR); } if ((flags & ACC_SYNCHRONIZED) != 0) { if (what == CONV_CLASS) { sb.append(STR); } else { sb.append(STR); } } if ((flags & ACC_VOLATILE) != 0) { if (what == CONV_METHOD) { sb.append(STR); } else { sb.append(STR); } } if ((flags & ACC_TRANSIENT) != 0) { if (what == CONV_METHOD) { sb.append(STR); } else { sb.append(STR); } } if ((flags & ACC_NATIVE) != 0) { sb.append(STR); } if ((flags & ACC_INTERFACE) != 0) { sb.append(STR); } if ((flags & ACC_ABSTRACT) != 0) { sb.append(STR); } if ((flags & ACC_STRICT) != 0) { sb.append(STR); } if ((flags & ACC_SYNTHETIC) != 0) { sb.append(STR); } if ((flags & ACC_ANNOTATION) != 0) { sb.append(STR); } if ((flags & ACC_ENUM) != 0) { sb.append(STR); } if ((flags & ACC_CONSTRUCTOR) != 0) { sb.append(STR); } if ((flags & ACC_DECLARED_SYNCHRONIZED) != 0) { sb.append(STR); } if ((extra != 0) (sb.length() == 0)) { sb.append(' '); sb.append(Hex.u2(extra)); } return sb.substring(1); }
/** * Helper to return a human-oriented string representing the given * access flags. * * @param flags the defined flags * @param mask mask for the "defined" bits * @param what what the flags represent (one of {@code CONV_*}) * @return {@code non-null;} human-oriented string */
Helper to return a human-oriented string representing the given access flags
humanHelper
{ "repo_name": "geekboxzone/lollipop_external_dexmaker", "path": "src/dx/java/com/android/dx/rop/code/AccessFlags.java", "license": "apache-2.0", "size": 11450 }
[ "com.android.dx.util.Hex" ]
import com.android.dx.util.Hex;
import com.android.dx.util.*;
[ "com.android.dx" ]
com.android.dx;
1,376,286
public Properties getCurrentProperties() throws Exception { return serverImpl.getCurrentProperties(); }
Properties function() throws Exception { return serverImpl.getCurrentProperties(); }
/** * Get current Network server properties * * @return Properties object containing Network server properties * @exception Exception throws an exception if an error occurs */
Get current Network server properties
getCurrentProperties
{ "repo_name": "xuzhikethinker/t4f-data", "path": "sql/jpa/datanucleus/src/main/java/aos/server/db/DatabaseServerControlRunnable.java", "license": "apache-2.0", "size": 24039 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
1,856,623
protected boolean adjustVertical() { if (mLabelHorizontalHeight == null) { return false; } double minY = mGraphView.getViewport().getMinY(false); double maxY = mGraphView.getViewport().getMaxY(false); if (minY == maxY) { return false; } // TODO find the number of labels int numVerticalLabels = mNumVerticalLabels; double newMinY; double exactSteps; if (mGraphView.getViewport().isYAxisBoundsManual()) { newMinY = minY; double rangeY = maxY - newMinY; exactSteps = rangeY / (numVerticalLabels - 1); } else { // find good steps boolean adjusting = true; newMinY = minY; exactSteps = 0d; while (adjusting) { double rangeY = maxY - newMinY; exactSteps = rangeY / (numVerticalLabels - 1); exactSteps = humanRound(exactSteps, true); // adjust viewport // wie oft passt STEP in minY rein? int count = 0; if (newMinY >= 0d) { // positive number while (newMinY - exactSteps >= 0) { newMinY -= exactSteps; count++; } newMinY = exactSteps * count; } else { // negative number count++; while (newMinY + exactSteps < 0) { newMinY += exactSteps; count++; } newMinY = exactSteps * count * -1; } // wenn minY sich geändert hat, steps nochmal berechnen // wenn nicht, fertig if (newMinY == minY) { adjusting = false; } else { minY = newMinY; } } } double newMaxY = newMinY + (numVerticalLabels - 1) * exactSteps; mGraphView.getViewport().setMinY(newMinY); mGraphView.getViewport().setMaxY(newMaxY); if (!mGraphView.getViewport().isYAxisBoundsManual()) { mGraphView.getViewport().setYAxisBoundsStatus(Viewport.AxisBoundsStatus.AUTO_ADJUSTED); } if (mStepsVertical != null) { mStepsVertical.clear(); } else { mStepsVertical = new LinkedHashMap<Integer, Double>(numVerticalLabels); } int height = mGraphView.getGraphContentHeight(); double v = newMaxY; int p = mGraphView.getGraphContentTop(); // start int pixelStep = height / (numVerticalLabels - 1); for (int i = 0; i < numVerticalLabels; i++) { mStepsVertical.put(p, v); p += pixelStep; v -= exactSteps; } return true; }
boolean function() { if (mLabelHorizontalHeight == null) { return false; } double minY = mGraphView.getViewport().getMinY(false); double maxY = mGraphView.getViewport().getMaxY(false); if (minY == maxY) { return false; } int numVerticalLabels = mNumVerticalLabels; double newMinY; double exactSteps; if (mGraphView.getViewport().isYAxisBoundsManual()) { newMinY = minY; double rangeY = maxY - newMinY; exactSteps = rangeY / (numVerticalLabels - 1); } else { boolean adjusting = true; newMinY = minY; exactSteps = 0d; while (adjusting) { double rangeY = maxY - newMinY; exactSteps = rangeY / (numVerticalLabels - 1); exactSteps = humanRound(exactSteps, true); int count = 0; if (newMinY >= 0d) { while (newMinY - exactSteps >= 0) { newMinY -= exactSteps; count++; } newMinY = exactSteps * count; } else { count++; while (newMinY + exactSteps < 0) { newMinY += exactSteps; count++; } newMinY = exactSteps * count * -1; } if (newMinY == minY) { adjusting = false; } else { minY = newMinY; } } } double newMaxY = newMinY + (numVerticalLabels - 1) * exactSteps; mGraphView.getViewport().setMinY(newMinY); mGraphView.getViewport().setMaxY(newMaxY); if (!mGraphView.getViewport().isYAxisBoundsManual()) { mGraphView.getViewport().setYAxisBoundsStatus(Viewport.AxisBoundsStatus.AUTO_ADJUSTED); } if (mStepsVertical != null) { mStepsVertical.clear(); } else { mStepsVertical = new LinkedHashMap<Integer, Double>(numVerticalLabels); } int height = mGraphView.getGraphContentHeight(); double v = newMaxY; int p = mGraphView.getGraphContentTop(); int pixelStep = height / (numVerticalLabels - 1); for (int i = 0; i < numVerticalLabels; i++) { mStepsVertical.put(p, v); p += pixelStep; v -= exactSteps; } return true; }
/** * calculates the vertical steps. This will * automatically change the bounds to nice * human-readable min/max. * * @return true if it is ready */
calculates the vertical steps. This will automatically change the bounds to nice human-readable min/max
adjustVertical
{ "repo_name": "nartex/GraphView", "path": "library/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java", "license": "gpl-2.0", "size": 47157 }
[ "java.util.LinkedHashMap" ]
import java.util.LinkedHashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,864,924
private boolean updateName(FileAwareInputStream fileAwareInputStream, boolean firstEntrySeen, String newFileName) { if (!firstEntrySeen) { fileAwareInputStream.getFile().setDestination( new Path(fileAwareInputStream.getFile().getDestination().getParent(), newFileName)); fileAwareInputStream.getFile().setRelativeDestination( new Path(fileAwareInputStream.getFile().getRelativeDestination().getParent(), newFileName)); firstEntrySeen = true; } return firstEntrySeen; }
boolean function(FileAwareInputStream fileAwareInputStream, boolean firstEntrySeen, String newFileName) { if (!firstEntrySeen) { fileAwareInputStream.getFile().setDestination( new Path(fileAwareInputStream.getFile().getDestination().getParent(), newFileName)); fileAwareInputStream.getFile().setRelativeDestination( new Path(fileAwareInputStream.getFile().getRelativeDestination().getParent(), newFileName)); firstEntrySeen = true; } return firstEntrySeen; }
/** * If this is the first entry in the tar, reset the destination file name to the name of the first entry in the tar. * It is required to change the name of the destination file because the untarred file/dir name is NOT known to the * source */
If this is the first entry in the tar, reset the destination file name to the name of the first entry in the tar. It is required to change the name of the destination file because the untarred file/dir name is NOT known to the source
updateName
{ "repo_name": "Hanmourang/Gobblin", "path": "gobblin-data-management/src/main/java/gobblin/data/management/copy/writer/TarArchiveInputStreamDataWriter.java", "license": "apache-2.0", "size": 4710 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
718,089
public void writeByte(byte b) throws IOException { out.write(Type.BYTE.code); out.write(b); }
void function(byte b) throws IOException { out.write(Type.BYTE.code); out.write(b); }
/** * Writes a byte as a typed bytes sequence. * * @param b * the byte to be written * @throws IOException */
Writes a byte as a typed bytes sequence
writeByte
{ "repo_name": "BUPTAnderson/apache-hive-2.1.1-src", "path": "contrib/src/java/org/apache/hadoop/hive/contrib/util/typedbytes/TypedBytesOutput.java", "license": "apache-2.0", "size": 8487 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,130,705
Module with(Iterable<? extends Module> overrides); } private static final class RealOverriddenModuleBuilder implements OverriddenModuleBuilder { private final ImmutableSet<Module> baseModules; private RealOverriddenModuleBuilder(Iterable<? extends Module> baseModules) { // TODO: infer type once JI-9019884 is fixed this.baseModules = ImmutableSet.<Module>copyOf(baseModules); }
Module with(Iterable<? extends Module> overrides); } private static final class RealOverriddenModuleBuilder implements OverriddenModuleBuilder { private final ImmutableSet<Module> baseModules; private RealOverriddenModuleBuilder(Iterable<? extends Module> baseModules) { this.baseModules = ImmutableSet.<Module>copyOf(baseModules); }
/** * See the EDSL example at {@link Modules#override(Module[]) override()}. */
See the EDSL example at <code>Modules#override(Module[]) override()</code>
with
{ "repo_name": "vingupta3/elasticsearch", "path": "core/src/main/java/org/elasticsearch/common/inject/util/Modules.java", "license": "apache-2.0", "size": 12005 }
[ "com.google.common.collect.ImmutableSet", "org.elasticsearch.common.inject.Module" ]
import com.google.common.collect.ImmutableSet; import org.elasticsearch.common.inject.Module;
import com.google.common.collect.*; import org.elasticsearch.common.inject.*;
[ "com.google.common", "org.elasticsearch.common" ]
com.google.common; org.elasticsearch.common;
717,273
public final void setBook(Book book) { this.book = book; }
final void function(Book book) { this.book = book; }
/** * Set the book to fill. * * @param book The book to fill. */
Set the book to fill
setBook
{ "repo_name": "wichtounet/jtheque-books-module", "path": "src/main/java/org/jtheque/books/services/impl/utils/web/analyzers/AbstractBookAnalyzer.java", "license": "apache-2.0", "size": 8183 }
[ "org.jtheque.books.persistence.od.able.Book" ]
import org.jtheque.books.persistence.od.able.Book;
import org.jtheque.books.persistence.od.able.*;
[ "org.jtheque.books" ]
org.jtheque.books;
2,664,438
public static void save(PApplet papp, MStyledString ss, String fname){ OutputStream os; ObjectOutputStream oos; try { os = papp.createOutput(fname); oos = new ObjectOutputStream(os); oos.writeObject(ss); os.close(); oos.close(); } catch (IOException e) { e.printStackTrace(); } }
static void function(PApplet papp, MStyledString ss, String fname){ OutputStream os; ObjectOutputStream oos; try { os = papp.createOutput(fname); oos = new ObjectOutputStream(os); oos.writeObject(ss); os.close(); oos.close(); } catch (IOException e) { e.printStackTrace(); } }
/** * Save the named StyleString in the named file. * * @param papp * @param ss the styled string * @param fname */
Save the named StyleString in the named file
save
{ "repo_name": "chcbaram/Processing_RokitDrone", "path": "libraries/GameControlPlus/src/org/gamecontrolplus/gui/MStyledString.java", "license": "mit", "size": 34027 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "java.io.OutputStream" ]
import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,879,872
public List<ZKListener> getListeners() { return new ArrayList<>(listeners); }
List<ZKListener> function() { return new ArrayList<>(listeners); }
/** * Get a copy of current registered listeners */
Get a copy of current registered listeners
getListeners
{ "repo_name": "HubSpot/hbase", "path": "hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java", "license": "apache-2.0", "size": 26565 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
444,288
public void synchronize(List<QueryControllerEntity> queryEntities) { if (queryEntities.size() > 0) { for (QueryControllerEntity queryEntity : queryEntities) { if (queryEntity instanceof QueryControllerGroup) { QueryControllerGroup group = (QueryControllerGroup) queryEntity; QueryGroupTreeElement queryGroupEle = new QueryGroupTreeElement(group.getID()); Vector<QueryControllerQuery> queries = group.getQueries(); for (QueryControllerQuery query : queries) { QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery()); insertNodeInto(queryTreeEle, queryGroupEle, queryGroupEle.getChildCount()); } insertNodeInto(queryGroupEle, (DefaultMutableTreeNode) root, root.getChildCount()); } else { QueryControllerQuery query = (QueryControllerQuery) queryEntity; QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery()); insertNodeInto(queryTreeEle, (DefaultMutableTreeNode) root, root.getChildCount()); } } } }
void function(List<QueryControllerEntity> queryEntities) { if (queryEntities.size() > 0) { for (QueryControllerEntity queryEntity : queryEntities) { if (queryEntity instanceof QueryControllerGroup) { QueryControllerGroup group = (QueryControllerGroup) queryEntity; QueryGroupTreeElement queryGroupEle = new QueryGroupTreeElement(group.getID()); Vector<QueryControllerQuery> queries = group.getQueries(); for (QueryControllerQuery query : queries) { QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery()); insertNodeInto(queryTreeEle, queryGroupEle, queryGroupEle.getChildCount()); } insertNodeInto(queryGroupEle, (DefaultMutableTreeNode) root, root.getChildCount()); } else { QueryControllerQuery query = (QueryControllerQuery) queryEntity; QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery()); insertNodeInto(queryTreeEle, (DefaultMutableTreeNode) root, root.getChildCount()); } } } }
/** * Takes all the existing nodes and constructs the tree. */
Takes all the existing nodes and constructs the tree
synchronize
{ "repo_name": "srapisarda/ontop", "path": "ontop-protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryControllerTreeModel.java", "license": "apache-2.0", "size": 9821 }
[ "it.unibz.inf.ontop.querymanager.QueryControllerEntity", "it.unibz.inf.ontop.querymanager.QueryControllerGroup", "it.unibz.inf.ontop.querymanager.QueryControllerQuery", "java.util.List", "java.util.Vector", "javax.swing.tree.DefaultMutableTreeNode" ]
import it.unibz.inf.ontop.querymanager.QueryControllerEntity; import it.unibz.inf.ontop.querymanager.QueryControllerGroup; import it.unibz.inf.ontop.querymanager.QueryControllerQuery; import java.util.List; import java.util.Vector; import javax.swing.tree.DefaultMutableTreeNode;
import it.unibz.inf.ontop.querymanager.*; import java.util.*; import javax.swing.tree.*;
[ "it.unibz.inf", "java.util", "javax.swing" ]
it.unibz.inf; java.util; javax.swing;
2,221,892
protected RegionConfiguration createRegionConfiguration() { RegionConfiguration configuration = new RegionConfiguration(); configuration.setRegionName((String) properties.get(CacheProperty.REGION_NAME)); configuration .setRegionAttributesId((String) properties.get(CacheProperty.REGION_ATTRIBUTES_ID)); configuration.setEnableGatewayDeltaReplication( (Boolean) properties.get(CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION)); configuration.setEnableGatewayReplication( (Boolean) properties.get(CacheProperty.ENABLE_GATEWAY_REPLICATION)); configuration .setEnableDebugListener((Boolean) properties.get(CacheProperty.ENABLE_DEBUG_LISTENER)); // Need to set max inactive interval to tell the server to use our custom expiry configuration.setMaxInactiveInterval(0); configuration.setCustomExpiry(new SessionCustomExpiry()); return configuration; }
RegionConfiguration function() { RegionConfiguration configuration = new RegionConfiguration(); configuration.setRegionName((String) properties.get(CacheProperty.REGION_NAME)); configuration .setRegionAttributesId((String) properties.get(CacheProperty.REGION_ATTRIBUTES_ID)); configuration.setEnableGatewayDeltaReplication( (Boolean) properties.get(CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION)); configuration.setEnableGatewayReplication( (Boolean) properties.get(CacheProperty.ENABLE_GATEWAY_REPLICATION)); configuration .setEnableDebugListener((Boolean) properties.get(CacheProperty.ENABLE_DEBUG_LISTENER)); configuration.setMaxInactiveInterval(0); configuration.setCustomExpiry(new SessionCustomExpiry()); return configuration; }
/** * Build up a {@code RegionConfiguraton} object from parameters originally passed in as filter * initialization parameters. * * @return a {@code RegionConfiguration} object */
Build up a RegionConfiguraton object from parameters originally passed in as filter initialization parameters
createRegionConfiguration
{ "repo_name": "pivotal-amurmann/geode", "path": "extensions/geode-modules-session-internal/src/main/java/org/apache/geode/modules/session/internal/common/AbstractSessionCache.java", "license": "apache-2.0", "size": 3629 }
[ "org.apache.geode.modules.util.RegionConfiguration", "org.apache.geode.modules.util.SessionCustomExpiry" ]
import org.apache.geode.modules.util.RegionConfiguration; import org.apache.geode.modules.util.SessionCustomExpiry;
import org.apache.geode.modules.util.*;
[ "org.apache.geode" ]
org.apache.geode;
1,553,006
@Test @Category({ ValidatesRunner.class, UsesTimersInParDo.class, DataflowPortabilityApiUnsupported.class }) public void testEventTimeTimerMultipleKeys() throws Exception { final String timerId = "foo"; final String stateId = "sizzle"; final int offset = 5000; final int timerOutput = 4093; DoFn<KV<String, Integer>, KV<String, Integer>> fn = new DoFn<KV<String, Integer>, KV<String, Integer>>() { @TimerId(timerId) private final TimerSpec spec = TimerSpecs.timer(TimeDomain.EVENT_TIME); @StateId(stateId) private final StateSpec<ValueState<String>> stateSpec = StateSpecs.value(StringUtf8Coder.of());
@Category({ ValidatesRunner.class, UsesTimersInParDo.class, DataflowPortabilityApiUnsupported.class }) void function() throws Exception { final String timerId = "foo"; final String stateId = STR; final int offset = 5000; final int timerOutput = 4093; DoFn<KV<String, Integer>, KV<String, Integer>> fn = new DoFn<KV<String, Integer>, KV<String, Integer>>() { @TimerId(timerId) private final TimerSpec spec = TimerSpecs.timer(TimeDomain.EVENT_TIME); @StateId(stateId) private final StateSpec<ValueState<String>> stateSpec = StateSpecs.value(StringUtf8Coder.of());
/** * Tests that event time timers for multiple keys both fire. This particularly exercises * implementations that may GC in ways not simply governed by the watermark. */
Tests that event time timers for multiple keys both fire. This particularly exercises implementations that may GC in ways not simply governed by the watermark
testEventTimeTimerMultipleKeys
{ "repo_name": "markflyhigh/incubator-beam", "path": "sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ParDoTest.java", "license": "apache-2.0", "size": 144563 }
[ "org.apache.beam.sdk.coders.Coder", "org.apache.beam.sdk.coders.StringUtf8Coder", "org.apache.beam.sdk.state.StateSpec", "org.apache.beam.sdk.state.StateSpecs", "org.apache.beam.sdk.state.TimeDomain", "org.apache.beam.sdk.state.TimerSpec", "org.apache.beam.sdk.state.TimerSpecs", "org.apache.beam.sdk.state.ValueState", "org.apache.beam.sdk.testing.DataflowPortabilityApiUnsupported", "org.apache.beam.sdk.testing.UsesTimersInParDo", "org.apache.beam.sdk.testing.ValidatesRunner", "org.junit.experimental.categories.Category" ]
import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.state.StateSpec; import org.apache.beam.sdk.state.StateSpecs; import org.apache.beam.sdk.state.TimeDomain; import org.apache.beam.sdk.state.TimerSpec; import org.apache.beam.sdk.state.TimerSpecs; import org.apache.beam.sdk.state.ValueState; import org.apache.beam.sdk.testing.DataflowPortabilityApiUnsupported; import org.apache.beam.sdk.testing.UsesTimersInParDo; import org.apache.beam.sdk.testing.ValidatesRunner; import org.junit.experimental.categories.Category;
import org.apache.beam.sdk.coders.*; import org.apache.beam.sdk.state.*; import org.apache.beam.sdk.testing.*; import org.junit.experimental.categories.*;
[ "org.apache.beam", "org.junit.experimental" ]
org.apache.beam; org.junit.experimental;
601,717
@Override public final String format(final Date date) { if (date == null) return ""; if (Math.abs(date.getTime() - last_time) < 1000) return last_format; synchronized (FORMAT_ISO8601) { last_format = FORMAT_ISO8601.format(date); last_time = date.getTime(); } return last_format; }
final String function(final Date date) { if (date == null) return ""; if (Math.abs(date.getTime() - last_time) < 1000) return last_format; synchronized (FORMAT_ISO8601) { last_format = FORMAT_ISO8601.format(date); last_time = date.getTime(); } return last_format; }
/** * Creates a String representation of a Date using the format defined * in ISO8601/W3C datetime * The result will be in UTC/GMT, e.g. "2007-12-19T10:20:30Z". * * @param date The Date instance to transform. * @return A fixed width (20 chars) ISO8601 date String. */
Creates a String representation of a Date using the format defined in ISO8601/W3C datetime The result will be in UTC/GMT, e.g. "2007-12-19T10:20:30Z"
format
{ "repo_name": "automenta/kelondro", "path": "src/main/java/yacy/cora/date/ISO8601Formatter.java", "license": "lgpl-2.1", "size": 8492 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,002,387
public void oneShot(View emiter, int numParticles) { oneShot(emiter, numParticles, new LinearInterpolator()); }
void function(View emiter, int numParticles) { oneShot(emiter, numParticles, new LinearInterpolator()); }
/** * Launches particles in one Shot * * @param emiter View from which center the particles will be emited * @param numParticles number of particles launched on the one shot */
Launches particles in one Shot
oneShot
{ "repo_name": "DanDits/WhatsThat", "path": "leonidlib/src/main/java/com/plattysoft/leonids/ParticleSystem.java", "license": "apache-2.0", "size": 25060 }
[ "android.view.View", "android.view.animation.LinearInterpolator" ]
import android.view.View; import android.view.animation.LinearInterpolator;
import android.view.*; import android.view.animation.*;
[ "android.view" ]
android.view;
1,221,704
public String getTimeStamp() throws ArrayIndexOutOfBoundsException { String timeStamp = this.quotesTimeStamp; if (!this.widget.showShortTime()) { String date = new SimpleDateFormat("dd MMM").format(new Date()).toUpperCase(); // Check if we should use yesterdays date or today's time String[] parts = timeStamp.split(" "); String fullDate = parts[0] + " " + parts[1]; if (fullDate.equals(date)) { timeStamp = parts[2]; } else { timeStamp = fullDate; } } return timeStamp; }
String function() throws ArrayIndexOutOfBoundsException { String timeStamp = this.quotesTimeStamp; if (!this.widget.showShortTime()) { String date = new SimpleDateFormat(STR).format(new Date()).toUpperCase(); String[] parts = timeStamp.split(" "); String fullDate = parts[0] + " " + parts[1]; if (fullDate.equals(date)) { timeStamp = parts[2]; } else { timeStamp = fullDate; } } return timeStamp; }
/** * Returns the current date and time as String * * @return the current date */
Returns the current date and time as String
getTimeStamp
{ "repo_name": "Skrittles/SPMinistocks", "path": "src/nitezh/ministock/activities/widget/WidgetView.java", "license": "mit", "size": 41794 }
[ "java.text.SimpleDateFormat", "java.util.Date" ]
import java.text.SimpleDateFormat; import java.util.Date;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,866,123
public Map<String, Set<IAchievement>> getAllAchievementByEvent() { return controller.getAllByEvents(); }
Map<String, Set<IAchievement>> function() { return controller.getAllByEvents(); }
/** * Returns all defined achievements sorted by event subsciprions. * * @return {@link Map} of event name and {@link IAchievement} pairs. */
Returns all defined achievements sorted by event subsciprions
getAllAchievementByEvent
{ "repo_name": "csongradyp/BadgeR", "path": "badger.integration/src/main/java/net/csongradyp/badger/Badger.java", "license": "mit", "size": 8108 }
[ "java.util.Map", "java.util.Set", "net.csongradyp.badger.domain.IAchievement" ]
import java.util.Map; import java.util.Set; import net.csongradyp.badger.domain.IAchievement;
import java.util.*; import net.csongradyp.badger.domain.*;
[ "java.util", "net.csongradyp.badger" ]
java.util; net.csongradyp.badger;
2,756,337
public List<CorporationKillmailsResponse> getCorporationsCorporationIdKillmailsRecent(Integer corporationId, String datasource, String ifNoneMatch, Integer page, String token) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'corporationId' is set if (corporationId == null) { throw new ApiException(400, "Missing the required parameter 'corporationId' when calling getCorporationsCorporationIdKillmailsRecent"); } // create path and map variables String localVarPath = "/v1/corporations/{corporation_id}/killmails/recent/".replaceAll("\\{format\\}", "json") .replaceAll("\\{" + "corporation_id" + "\\}", apiClient.escapeString(corporationId.toString())); // query params List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); localVarQueryParams.addAll(apiClient.parameterToPairs("", "datasource", datasource)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "token", token)); if (ifNoneMatch != null) localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch)); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "evesso" }; GenericType<List<CorporationKillmailsResponse>> localVarReturnType = new GenericType<List<CorporationKillmailsResponse>>() { }; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); }
List<CorporationKillmailsResponse> function(Integer corporationId, String datasource, String ifNoneMatch, Integer page, String token) throws ApiException { Object localVarPostBody = null; if (corporationId == null) { throw new ApiException(400, STR); } String localVarPath = STR.replaceAll(STR, "json") .replaceAll("\\{" + STR + "\\}", apiClient.escapeString(corporationId.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); localVarQueryParams.addAll(apiClient.parameterToPairs(STRdatasource", datasource)); localVarQueryParams.addAll(apiClient.parameterToPairs(STRpage", page)); localVarQueryParams.addAll(apiClient.parameterToPairs(STRtokenSTRIf-None-MatchSTRapplication/jsonSTRapplication/jsonSTRevessoSTRGET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); }
/** * Get a corporation&#39;s recent kills and losses Get a list of a * corporation&#39;s kills and losses going back 90 days --- This route is * cached for up to 300 seconds --- Requires one of the following EVE * corporation role(s): Director SSO Scope: * esi-killmails.read_corporation_killmails.v1 * * @param corporationId * An EVE corporation ID (required) * @param datasource * The server name you would like data from (optional, default to * tranquility) * @param ifNoneMatch * ETag from a previous request. A 304 will be returned if this * matches the current ETag (optional) * @param page * Which page of results to return (optional, default to 1) * @param token * Access token to use if unable to set a header (optional) * @return List&lt;CorporationKillmailsResponse&gt; * @throws ApiException * if fails to make API call */
Get a corporation&#39;s recent kills and losses Get a list of a corporation&#39;s kills and losses going back 90 days --- This route is cached for up to 300 seconds --- Requires one of the following EVE corporation role(s): Director SSO Scope: esi-killmails.read_corporation_killmails.v1
getCorporationsCorporationIdKillmailsRecent
{ "repo_name": "GoldenGnu/eve-esi", "path": "src/main/java/net/troja/eve/esi/api/KillmailsApi.java", "license": "apache-2.0", "size": 10332 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map", "net.troja.eve.esi.ApiException", "net.troja.eve.esi.Pair", "net.troja.eve.esi.model.CorporationKillmailsResponse" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.troja.eve.esi.ApiException; import net.troja.eve.esi.Pair; import net.troja.eve.esi.model.CorporationKillmailsResponse;
import java.util.*; import net.troja.eve.esi.*; import net.troja.eve.esi.model.*;
[ "java.util", "net.troja.eve" ]
java.util; net.troja.eve;
2,115,927
protected ResolvedValue createResult(final ValueSpecification valueSpecification, final ParameterizedFunction parameterizedFunction, final Set<ValueSpecification> functionInputs, final Set<ValueSpecification> functionOutputs) { return new ResolvedValue(valueSpecification, parameterizedFunction, functionInputs, functionOutputs); }
ResolvedValue function(final ValueSpecification valueSpecification, final ParameterizedFunction parameterizedFunction, final Set<ValueSpecification> functionInputs, final Set<ValueSpecification> functionOutputs) { return new ResolvedValue(valueSpecification, parameterizedFunction, functionInputs, functionOutputs); }
/** * Creates a result instance. * <p> * The {@code valueSpecification} specification must be a normalized/canonical form. * * @param valueSpecification * the resolved value specification, as it will appear in the dependency graph, not null * @param parameterizedFunction * the function identifier and parameters, not null * @param functionInputs * the resolved input specifications, as they will appear in the dependency graph, not null * @param functionOutputs * the resolved output specifications, as they will appear in the dependency graph, not null * @return the resolved value */
Creates a result instance. The valueSpecification specification must be a normalized/canonical form
createResult
{ "repo_name": "McLeodMoores/starling", "path": "projects/engine/src/main/java/com/opengamma/engine/depgraph/ResolveTask.java", "license": "apache-2.0", "size": 12035 }
[ "com.opengamma.engine.function.ParameterizedFunction", "com.opengamma.engine.value.ValueSpecification", "java.util.Set" ]
import com.opengamma.engine.function.ParameterizedFunction; import com.opengamma.engine.value.ValueSpecification; import java.util.Set;
import com.opengamma.engine.function.*; import com.opengamma.engine.value.*; import java.util.*;
[ "com.opengamma.engine", "java.util" ]
com.opengamma.engine; java.util;
2,457,684
public static Object invokeMethod(Method method, Object target) { return invokeMethod(method, target, null); }
static Object function(Method method, Object target) { return invokeMethod(method, target, null); }
/** * Invoke the specified {@link Method} against the supplied target object * with no arguments. The target object can be <code>null</code> when * invoking a static {@link Method}. * <p>Thrown exceptions are handled via a call to {@link #handleReflectionException}. * @param method the method to invoke * @param target the target object to invoke the method on * @return the invocation result, if any * @see #invokeMethod(java.lang.reflect.Method, Object, Object[]) */
Invoke the specified <code>Method</code> against the supplied target object with no arguments. The target object can be <code>null</code> when invoking a static <code>Method</code>. Thrown exceptions are handled via a call to <code>#handleReflectionException</code>
invokeMethod
{ "repo_name": "qiuhd2015/Hpgsc-RPC", "path": "hpgsc-rpc/src/main/java/org/hdl/hggsc/rpc/utils/ReflectionUtils.java", "license": "mit", "size": 22350 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
106,987
protected String getUploadUri() { return CmsCoreProvider.get().link(I_CmsUploadConstants.UPLOAD_ACTION_JSP_URI); }
String function() { return CmsCoreProvider.get().link(I_CmsUploadConstants.UPLOAD_ACTION_JSP_URI); }
/** * Returns the upload JSP uri.<p> * * @return the upload JSP uri */
Returns the upload JSP uri
getUploadUri
{ "repo_name": "serrapos/opencms-core", "path": "src-gwt/org/opencms/ade/upload/client/ui/A_CmsUploadDialog.java", "license": "lgpl-2.1", "size": 47638 }
[ "org.opencms.gwt.client.CmsCoreProvider" ]
import org.opencms.gwt.client.CmsCoreProvider;
import org.opencms.gwt.client.*;
[ "org.opencms.gwt" ]
org.opencms.gwt;
2,373,802
public Verb getMethod() { return method; }
Verb function() { return method; }
/** * Get request method. * * @return Request HTTP method */
Get request method
getMethod
{ "repo_name": "rockihack/Stud.IP-FileSync", "path": "src/de/uni/hannover/studip/sync/models/JacksonRequest.java", "license": "gpl-3.0", "size": 2908 }
[ "org.scribe.model.Verb" ]
import org.scribe.model.Verb;
import org.scribe.model.*;
[ "org.scribe.model" ]
org.scribe.model;
2,169,588
protected void parseSYNCCTL() throws DRDAProtocolException { reader.markCollection(); int codePoint = reader.getCodePoint(CodePoint.SYNCTYPE); int syncType = parseSYNCTYPE(); int xaflags = 0; boolean readXAFlags = false; Xid xid = null; // The value -1 means no value of timeout received long xaTimeout = -1; boolean readXATimeout = false; codePoint = reader.getCodePoint(); while (codePoint != -1) { switch(codePoint) { case CodePoint.XID: xid = parseXID(); break; case CodePoint.XAFLAGS: xaflags = parseXAFlags(); readXAFlags =true; break; case CodePoint.TIMEOUT: xaTimeout = parseXATimeout(); readXATimeout = true; break; case CodePoint.RLSCONV: connThread.codePointNotSupported(codePoint); default: connThread.invalidCodePoint(codePoint); } codePoint = reader.getCodePoint(); } { connThread.trace("syncType = " + syncTypeToString(syncType)); connThread.trace("xid = " + xid); connThread.trace("xaflags =" + xaflagsToString(xaflags)); } if (syncType != CodePoint.SYNCTYPE_INDOUBT) { if (xid == null) connThread.missingCodePoint(CodePoint.XID); // All but Recover and forget require xaFlags if (syncType != CodePoint.SYNCTYPE_REQ_FORGET && ! readXAFlags) if (SanityManager.DEBUG) connThread.missingCodePoint(CodePoint.XAFLAGS); } switch (syncType) { case CodePoint.SYNCTYPE_NEW_UOW: // new unit of work for XA // formatId -1 is just a local connection startXATransaction(xid, xaflags, xaTimeout); break; case CodePoint.SYNCTYPE_END_UOW: // End unit of work endXA(xid,xaflags); break; case CodePoint.SYNCTYPE_PREPARE: prepareXATransaction(xid); // Prepare to commit break; case CodePoint.SYNCTYPE_MIGRATE: // migrate to resync server sync type connThread.codePointNotSupported(codePoint); break; case CodePoint.SYNCTYPE_REQ_COMMIT: // request to commit sync type commitTransaction(xid,xaflags); break; case CodePoint.SYNCTYPE_COMMITTED: // commit sync type commitTransaction(xid, xaflags); break; case CodePoint.SYNCTYPE_REQ_FORGET: // request to forget sync type forgetXATransaction(xid); break; case CodePoint.SYNCTYPE_ROLLBACK: //rollback sync type rollbackTransaction(xid, true); break; case CodePoint.SYNCTYPE_INDOUBT: //recover sync type if (readXAFlags) recoverXA(xaflags); else recoverXA(); break; default: connThread.invalidCodePoint(codePoint); } }
void function() throws DRDAProtocolException { reader.markCollection(); int codePoint = reader.getCodePoint(CodePoint.SYNCTYPE); int syncType = parseSYNCTYPE(); int xaflags = 0; boolean readXAFlags = false; Xid xid = null; long xaTimeout = -1; boolean readXATimeout = false; codePoint = reader.getCodePoint(); while (codePoint != -1) { switch(codePoint) { case CodePoint.XID: xid = parseXID(); break; case CodePoint.XAFLAGS: xaflags = parseXAFlags(); readXAFlags =true; break; case CodePoint.TIMEOUT: xaTimeout = parseXATimeout(); readXATimeout = true; break; case CodePoint.RLSCONV: connThread.codePointNotSupported(codePoint); default: connThread.invalidCodePoint(codePoint); } codePoint = reader.getCodePoint(); } { connThread.trace(STR + syncTypeToString(syncType)); connThread.trace(STR + xid); connThread.trace(STR + xaflagsToString(xaflags)); } if (syncType != CodePoint.SYNCTYPE_INDOUBT) { if (xid == null) connThread.missingCodePoint(CodePoint.XID); if (syncType != CodePoint.SYNCTYPE_REQ_FORGET && ! readXAFlags) if (SanityManager.DEBUG) connThread.missingCodePoint(CodePoint.XAFLAGS); } switch (syncType) { case CodePoint.SYNCTYPE_NEW_UOW: startXATransaction(xid, xaflags, xaTimeout); break; case CodePoint.SYNCTYPE_END_UOW: endXA(xid,xaflags); break; case CodePoint.SYNCTYPE_PREPARE: prepareXATransaction(xid); break; case CodePoint.SYNCTYPE_MIGRATE: connThread.codePointNotSupported(codePoint); break; case CodePoint.SYNCTYPE_REQ_COMMIT: commitTransaction(xid,xaflags); break; case CodePoint.SYNCTYPE_COMMITTED: commitTransaction(xid, xaflags); break; case CodePoint.SYNCTYPE_REQ_FORGET: forgetXATransaction(xid); break; case CodePoint.SYNCTYPE_ROLLBACK: rollbackTransaction(xid, true); break; case CodePoint.SYNCTYPE_INDOUBT: if (readXAFlags) recoverXA(xaflags); else recoverXA(); break; default: connThread.invalidCodePoint(codePoint); } }
/** * Parse SYNCCTL - Parse SYNCCTL command for XAMGR lvl 7 * */
Parse SYNCCTL - Parse SYNCCTL command for XAMGR lvl 7
parseSYNCCTL
{ "repo_name": "scnakandala/derby", "path": "java/drda/org/apache/derby/impl/drda/DRDAXAProtocol.java", "license": "apache-2.0", "size": 24371 }
[ "javax.transaction.xa.Xid", "org.apache.derby.shared.common.sanity.SanityManager" ]
import javax.transaction.xa.Xid; import org.apache.derby.shared.common.sanity.SanityManager;
import javax.transaction.xa.*; import org.apache.derby.shared.common.sanity.*;
[ "javax.transaction", "org.apache.derby" ]
javax.transaction; org.apache.derby;
2,639,363
public short addTo(final long k, final short incr) { // The starting point. int pos = (int)it.unimi.dsi.fastutil.HashCommon.murmurHash3(k) & mask; // There's always an unused entry. while( used[ pos ] ) { if ( ( (key[ pos ]) == (k) ) ) { final short oldValue = value[ pos ]; value[ pos ] += incr; return oldValue; } pos = ( pos + 1 ) & mask; } used[ pos ] = true; key[ pos ] = k; value[ pos ] = (short)(defRetValue + incr); if ( size == 0 ) { first = last = pos; // Special case of SET_UPPER_LOWER( link[ pos ], -1, -1 ); link[ pos ] = -1L; } else { link[ last ] ^= ( ( link[ last ] ^ ( pos & 0xFFFFFFFFL ) ) & 0xFFFFFFFFL ); link[ pos ] = ( ( last & 0xFFFFFFFFL ) << 32 ) | ( -1 & 0xFFFFFFFFL ); last = pos; } if ( ++size >= maxFill ) rehash( arraySize( size + 1, f ) ); if ( ASSERTS ) checkTable(); return defRetValue; }
short function(final long k, final short incr) { int pos = (int)it.unimi.dsi.fastutil.HashCommon.murmurHash3(k) & mask; while( used[ pos ] ) { if ( ( (key[ pos ]) == (k) ) ) { final short oldValue = value[ pos ]; value[ pos ] += incr; return oldValue; } pos = ( pos + 1 ) & mask; } used[ pos ] = true; key[ pos ] = k; value[ pos ] = (short)(defRetValue + incr); if ( size == 0 ) { first = last = pos; link[ pos ] = -1L; } else { link[ last ] ^= ( ( link[ last ] ^ ( pos & 0xFFFFFFFFL ) ) & 0xFFFFFFFFL ); link[ pos ] = ( ( last & 0xFFFFFFFFL ) << 32 ) ( -1 & 0xFFFFFFFFL ); last = pos; } if ( ++size >= maxFill ) rehash( arraySize( size + 1, f ) ); if ( ASSERTS ) checkTable(); return defRetValue; }
/** Adds an increment to value currently associated with a key. * * <P>Note that this method respects the {@linkplain #defaultReturnValue() default return value} semantics: when * called with a key that does not currently appears in the map, the key * will be associated with the default return value plus * the given increment. * * @param k the key. * @param incr the increment. * @return the old value, or the {@linkplain #defaultReturnValue() default return value} if no value was present for the given key. */
Adds an increment to value currently associated with a key. Note that this method respects the #defaultReturnValue() default return value semantics: when called with a key that does not currently appears in the map, the key will be associated with the default return value plus the given increment
addTo
{ "repo_name": "karussell/fastutil", "path": "src/it/unimi/dsi/fastutil/longs/Long2ShortLinkedOpenHashMap.java", "license": "apache-2.0", "size": 48445 }
[ "it.unimi.dsi.fastutil.HashCommon" ]
import it.unimi.dsi.fastutil.HashCommon;
import it.unimi.dsi.fastutil.*;
[ "it.unimi.dsi" ]
it.unimi.dsi;
1,231,416
public boolean checkSweDataArrayObservationsFor(String offeringIdentifier, Session session) { return checkObservationFor(SweDataArrayObservation.class, offeringIdentifier, session); }
boolean function(String offeringIdentifier, Session session) { return checkObservationFor(SweDataArrayObservation.class, offeringIdentifier, session); }
/** * Check if there are geometry observations for the offering * * @param offeringIdentifier * Offering identifier * @param session * Hibernate session * @return If there are observations or not */
Check if there are geometry observations for the offering
checkSweDataArrayObservationsFor
{ "repo_name": "geomatico/52n-sos-4.0", "path": "hibernate/common/src/main/java/org/n52/sos/ds/hibernate/dao/ObservationDAO.java", "license": "gpl-2.0", "size": 26233 }
[ "org.hibernate.Session", "org.n52.sos.ds.hibernate.entities.SweDataArrayObservation" ]
import org.hibernate.Session; import org.n52.sos.ds.hibernate.entities.SweDataArrayObservation;
import org.hibernate.*; import org.n52.sos.ds.hibernate.entities.*;
[ "org.hibernate", "org.n52.sos" ]
org.hibernate; org.n52.sos;
2,771,046
public Person getLeadResearcher() { return getStartingPerson(); }
Person function() { return getStartingPerson(); }
/** * Gets the lead researcher for the mission. * * @return the researcher. */
Gets the lead researcher for the mission
getLeadResearcher
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/person/ai/mission/FieldStudyMission.java", "license": "gpl-3.0", "size": 14589 }
[ "org.mars_sim.msp.core.person.Person" ]
import org.mars_sim.msp.core.person.Person;
import org.mars_sim.msp.core.person.*;
[ "org.mars_sim.msp" ]
org.mars_sim.msp;
1,497,657
@NonNull public CachedEngineFragmentBuilder handleDeeplinking(@NonNull Boolean handleDeeplinking) { this.handleDeeplinking = handleDeeplinking; return this; } /** * Whether or not this {@code FlutterFragment} should automatically attach its {@code Activity}
CachedEngineFragmentBuilder function(@NonNull Boolean handleDeeplinking) { this.handleDeeplinking = handleDeeplinking; return this; } /** * Whether or not this {@code FlutterFragment} should automatically attach its {@code Activity}
/** * Whether to handle the deeplinking from the {@code Intent} automatically if the {@code * getInitialRoute} returns null. */
Whether to handle the deeplinking from the Intent automatically if the getInitialRoute returns null
handleDeeplinking
{ "repo_name": "flutter/engine", "path": "shell/platform/android/io/flutter/embedding/android/FlutterFragment.java", "license": "bsd-3-clause", "size": 57179 }
[ "android.app.Activity", "androidx.annotation.NonNull" ]
import android.app.Activity; import androidx.annotation.NonNull;
import android.app.*; import androidx.annotation.*;
[ "android.app", "androidx.annotation" ]
android.app; androidx.annotation;
2,209,201
try (Socket socket = new Socket(hostname, port)) { return true; } catch (IOException e) { return false; } }
try (Socket socket = new Socket(hostname, port)) { return true; } catch (IOException e) { return false; } }
/** * Validates whether a network address is reachable. * * @param hostname host name of the network address * @param port port of the network address * @return whether the network address is reachable */
Validates whether a network address is reachable
isAddressReachable
{ "repo_name": "riversand963/alluxio", "path": "core/server/common/src/main/java/alluxio/cli/validation/Utils.java", "license": "apache-2.0", "size": 6621 }
[ "java.io.IOException", "java.net.Socket" ]
import java.io.IOException; import java.net.Socket;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
2,528,534
private Object getValue(final String key, final Object value) { if (value instanceof BigDecimal) { switch (fieldMap.get(key).type().typeId()) { case LONG: return ((BigDecimal) value).longValue(); case INTEGER: return ((BigDecimal) value).intValue(); case DOUBLE: return ((BigDecimal) value).doubleValue(); case FLOAT: return ((BigDecimal) value).floatValue(); case DECIMAL: return value; default: throw new IllegalArgumentException("Cannot convert the given big decimal value to an Iceberg type"); } } return value; }
Object function(final String key, final Object value) { if (value instanceof BigDecimal) { switch (fieldMap.get(key).type().typeId()) { case LONG: return ((BigDecimal) value).longValue(); case INTEGER: return ((BigDecimal) value).intValue(); case DOUBLE: return ((BigDecimal) value).doubleValue(); case FLOAT: return ((BigDecimal) value).floatValue(); case DECIMAL: return value; default: throw new IllegalArgumentException(STR); } } return value; }
/** * Transform the value type to iceberg type. * * @param key the input filter key * @param value the input filter value * @return iceberg type */
Transform the value type to iceberg type
getValue
{ "repo_name": "Netflix/metacat", "path": "metacat-connector-hive/src/main/java/com/netflix/metacat/connector/hive/util/IcebergFilterGenerator.java", "license": "apache-2.0", "size": 9559 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,319,175
public Collection<KickstartCommand> getCommands() { return this.commands; }
Collection<KickstartCommand> function() { return this.commands; }
/** * Getter for commands * @return Returns commands */
Getter for commands
getCommands
{ "repo_name": "renner/spacewalk", "path": "java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java", "license": "gpl-2.0", "size": 48300 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,804,505
private boolean verifySetCssNameMapping(NodeTraversal t, Node methodName, Node firstArg) { DiagnosticType diagnostic = null; if (firstArg == null) { diagnostic = NULL_ARGUMENT_ERROR; } else if (!firstArg.isObjectLit()) { diagnostic = EXPECTED_OBJECTLIT_ERROR; } else if (firstArg.getNext() != null) { Node secondArg = firstArg.getNext(); if (!secondArg.isString()) { diagnostic = EXPECTED_STRING_ERROR; } else if (secondArg.getNext() != null) { diagnostic = TOO_MANY_ARGUMENTS_ERROR; } } if (diagnostic != null) { compiler.report( t.makeError(methodName, diagnostic, methodName.getQualifiedName())); return false; } return true; }
boolean function(NodeTraversal t, Node methodName, Node firstArg) { DiagnosticType diagnostic = null; if (firstArg == null) { diagnostic = NULL_ARGUMENT_ERROR; } else if (!firstArg.isObjectLit()) { diagnostic = EXPECTED_OBJECTLIT_ERROR; } else if (firstArg.getNext() != null) { Node secondArg = firstArg.getNext(); if (!secondArg.isString()) { diagnostic = EXPECTED_STRING_ERROR; } else if (secondArg.getNext() != null) { diagnostic = TOO_MANY_ARGUMENTS_ERROR; } } if (diagnostic != null) { compiler.report( t.makeError(methodName, diagnostic, methodName.getQualifiedName())); return false; } return true; }
/** * Verifies that setCssNameMapping is called with the correct methods. * * @return Whether the arguments checked out okay */
Verifies that setCssNameMapping is called with the correct methods
verifySetCssNameMapping
{ "repo_name": "superkonduktr/closure-compiler", "path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java", "license": "apache-2.0", "size": 54718 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
249,234
public SpringApplicationBuilder child(Class<?>... sources) { SpringApplicationBuilder child = new SpringApplicationBuilder(); child.sources(sources); // Copy environment stuff from parent to child child.properties(this.defaultProperties).environment(this.environment) .additionalProfiles(this.additionalProfiles); child.parent = this; // It's not possible if embedded web server are enabled to support web contexts as // parents because the servlets cannot be initialized at the right point in // lifecycle. web(WebApplicationType.NONE); // Probably not interested in multiple banners bannerMode(Banner.Mode.OFF); // Make sure sources get copied over this.application.addPrimarySources(this.sources); return child; }
SpringApplicationBuilder function(Class<?>... sources) { SpringApplicationBuilder child = new SpringApplicationBuilder(); child.sources(sources); child.properties(this.defaultProperties).environment(this.environment) .additionalProfiles(this.additionalProfiles); child.parent = this; web(WebApplicationType.NONE); bannerMode(Banner.Mode.OFF); this.application.addPrimarySources(this.sources); return child; }
/** * Create a child application with the provided sources. Default args and environment * are copied down into the child, but everything else is a clean sheet. * @param sources the sources for the application (Spring configuration) * @return the child application builder */
Create a child application with the provided sources. Default args and environment are copied down into the child, but everything else is a clean sheet
child
{ "repo_name": "bclozel/spring-boot", "path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java", "license": "apache-2.0", "size": 17359 }
[ "org.springframework.boot.Banner", "org.springframework.boot.WebApplicationType" ]
import org.springframework.boot.Banner; import org.springframework.boot.WebApplicationType;
import org.springframework.boot.*;
[ "org.springframework.boot" ]
org.springframework.boot;
929,084
Collections.sort(input, new Comparator<Shape>() {
Collections.sort(input, new Comparator<Shape>() {
/** * RWordle-L algorithm. * * @param input * List of shapes to be layouted. * @return List of layouted shapes. */
RWordle-L algorithm
generateLayoutLinear
{ "repo_name": "HendrikStrobelt/ditop_server", "path": "src/main/java/de/hs8/graphics/RWordle.java", "license": "bsd-3-clause", "size": 6183 }
[ "java.awt.Shape", "java.util.Collections", "java.util.Comparator" ]
import java.awt.Shape; import java.util.Collections; import java.util.Comparator;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
1,860,906
@ServiceMethod(returns = ReturnType.SINGLE) Response<ApplicationSecurityGroupInner> getByResourceGroupWithResponse( String resourceGroupName, String applicationSecurityGroupName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) Response<ApplicationSecurityGroupInner> getByResourceGroupWithResponse( String resourceGroupName, String applicationSecurityGroupName, Context context);
/** * Gets information about the specified application security group. * * @param resourceGroupName The name of the resource group. * @param applicationSecurityGroupName The name of the application security group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the specified application security group along with {@link Response}. */
Gets information about the specified application security group
getByResourceGroupWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationSecurityGroupsClient.java", "license": "mit", "size": 25248 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,594,524
public List<GlobalProperty> getGlobalPropertiesBySuffix(String suffix);
List<GlobalProperty> function(String suffix);
/** * Gets all global properties that end with <code>suffix</code>. * * @param prefix The end of the property name to match. * @return a <code>List</code> of <code>GlobalProperty</code>s that match <code>.*suffix</code> * @since 1.6 * @should return all relevant global properties in the database */
Gets all global properties that end with <code>suffix</code>
getGlobalPropertiesBySuffix
{ "repo_name": "Winbobob/openmrs-core", "path": "api/src/main/java/org/openmrs/api/AdministrationService.java", "license": "mpl-2.0", "size": 24849 }
[ "java.util.List", "org.openmrs.GlobalProperty" ]
import java.util.List; import org.openmrs.GlobalProperty;
import java.util.*; import org.openmrs.*;
[ "java.util", "org.openmrs" ]
java.util; org.openmrs;
670,754
private Character findMismatches(String s) { Deque<Character> state = new ArrayDeque<Character>(); for (Character c : s.toCharArray()) { if (NESTING_OPENINGS.contains(c)) { state.push(NESTING_PAIRS.get(c)); } else if (NESTING_CLOSINGS.contains(c)) { if (state.isEmpty() || !state.peek().equals(c)) { return c; } state.pop(); } } if (!state.isEmpty()) { return state.pop(); } return null; }
Character function(String s) { Deque<Character> state = new ArrayDeque<Character>(); for (Character c : s.toCharArray()) { if (NESTING_OPENINGS.contains(c)) { state.push(NESTING_PAIRS.get(c)); } else if (NESTING_CLOSINGS.contains(c)) { if (state.isEmpty() !state.peek().equals(c)) { return c; } state.pop(); } } if (!state.isEmpty()) { return state.pop(); } return null; }
/** * looks for mismatched ()s, []s, and {}s * * @reurn Character representing the mismatched item, or null if there * are no mismatches */
looks for mismatched ()s, []s, and {}s
findMismatches
{ "repo_name": "xenomachina/gxp", "path": "java/src/com/google/gxp/compiler/codegen/OutputLanguageUtil.java", "license": "apache-2.0", "size": 7318 }
[ "java.util.ArrayDeque", "java.util.Deque" ]
import java.util.ArrayDeque; import java.util.Deque;
import java.util.*;
[ "java.util" ]
java.util;
356,610
public DateHolder setBeginOfMonth() { calendar.set(Calendar.DAY_OF_MONTH, 1); setBeginOfDay(); return this; }
DateHolder function() { calendar.set(Calendar.DAY_OF_MONTH, 1); setBeginOfDay(); return this; }
/** * Sets the date to the beginning of the month (first day of month) and calls setBeginOfDay. * @see #setBeginOfDay() */
Sets the date to the beginning of the month (first day of month) and calls setBeginOfDay
setBeginOfMonth
{ "repo_name": "micromata/projectforge-webapp", "path": "src/main/java/org/projectforge/common/DateHolder.java", "license": "gpl-3.0", "size": 21653 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
655,287
void fillListsOfExecutions(List<AuthenticationExecutionModel> executionsToProcess, List<AuthenticationExecutionModel> requiredList, List<AuthenticationExecutionModel> alternativeList) { for (AuthenticationExecutionModel execution : executionsToProcess) { if (isConditionalAuthenticator(execution)) { continue; } else if (execution.isRequired() || execution.isConditional()) { requiredList.add(execution); } else if (execution.isAlternative()) { alternativeList.add(execution); } } if (!requiredList.isEmpty() && !alternativeList.isEmpty()) { List<String> alternativeIds = alternativeList.stream() .map(AuthenticationExecutionModel::getAuthenticator) .collect(Collectors.toList()); logger.warnf("REQUIRED and ALTERNATIVE elements at same level! Those alternative executions will be ignored: %s", alternativeIds); alternativeList.clear(); } }
void fillListsOfExecutions(List<AuthenticationExecutionModel> executionsToProcess, List<AuthenticationExecutionModel> requiredList, List<AuthenticationExecutionModel> alternativeList) { for (AuthenticationExecutionModel execution : executionsToProcess) { if (isConditionalAuthenticator(execution)) { continue; } else if (execution.isRequired() execution.isConditional()) { requiredList.add(execution); } else if (execution.isAlternative()) { alternativeList.add(execution); } } if (!requiredList.isEmpty() && !alternativeList.isEmpty()) { List<String> alternativeIds = alternativeList.stream() .map(AuthenticationExecutionModel::getAuthenticator) .collect(Collectors.toList()); logger.warnf(STR, alternativeIds); alternativeList.clear(); } }
/** * Just iterates over executionsToProcess and fill "requiredList" and "alternativeList" according to it */
Just iterates over executionsToProcess and fill "requiredList" and "alternativeList" according to it
fillListsOfExecutions
{ "repo_name": "mhajas/keycloak", "path": "services/src/main/java/org/keycloak/authentication/DefaultAuthenticationFlow.java", "license": "apache-2.0", "size": 29088 }
[ "java.util.List", "java.util.stream.Collectors", "org.keycloak.models.AuthenticationExecutionModel" ]
import java.util.List; import java.util.stream.Collectors; import org.keycloak.models.AuthenticationExecutionModel;
import java.util.*; import java.util.stream.*; import org.keycloak.models.*;
[ "java.util", "org.keycloak.models" ]
java.util; org.keycloak.models;
2,008,379
public static boolean addLastCause(@Nullable Throwable e, @Nullable Throwable cause, IgniteLogger log) { if (e == null || cause == null) return false; for (Throwable t = e; t != null; t = t.getCause()) { if (t == cause) return false; if (t.getCause() == null || t.getCause() == t) { try { t.initCause(cause); } catch (IllegalStateException ignored) { error(log, "Failed to add cause to the end of cause chain (cause is printed here but will " + "not be propagated to callee): " + e, "Failed to add cause to the end of cause chain: " + e, cause); } return true; } } return false; }
static boolean function(@Nullable Throwable e, @Nullable Throwable cause, IgniteLogger log) { if (e == null cause == null) return false; for (Throwable t = e; t != null; t = t.getCause()) { if (t == cause) return false; if (t.getCause() == null t.getCause() == t) { try { t.initCause(cause); } catch (IllegalStateException ignored) { error(log, STR + STR + e, STR + e, cause); } return true; } } return false; }
/** * Adds cause to the end of cause chain. * * @param e Error to add cause to. * @param cause Cause to add. * @param log Logger to log failure when cause can not be added. * @return {@code True} if cause was added. */
Adds cause to the end of cause chain
addLastCause
{ "repo_name": "SomeFire/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 374177 }
[ "org.apache.ignite.IgniteLogger", "org.jetbrains.annotations.Nullable" ]
import org.apache.ignite.IgniteLogger; import org.jetbrains.annotations.Nullable;
import org.apache.ignite.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
211,430
private BlogTO createTopicTO(EditTopicMessage message, Blog existingTopic) { Topic topic = message.getTopic(); BlogTO topicTO = new BlogTO(); topicTO.setCreatorUserId(securityHelper.assertCurrentUserId()); String description = message.isUpdateDescription() ? topic .getDescription() : existingTopic.getDescription(); String title = message.isUpdateTitle() ? topic.getTitle() : existingTopic.getTitle(); String alias = message.isUpdateAlias() ? topic.getTopicAlias() : existingTopic.getNameIdentifier(); topicTO.setDescription(description); topicTO.setTitle(title); topicTO.setNameIdentifier(alias); Tag[] newTags = topic.getTags() != null ? topic.getTags() : new Tag[0]; Set<com.communote.server.model.tag.Tag> existingTags = existingTopic .getTags() != null ? existingTopic.getTags() : new HashSet<com.communote.server.model.tag.Tag>(); topicTO.setTags(TopicMessageHandlerUtils.extractTagTOs(newTags, existingTags, getTagsExtractionPolicy(message))); // topic properties processing StringProperty[] newProperties = topic.getProperties() == null ? new StringProperty[0] : topic.getProperties(); topicTO.setProperties(TopicMessageHandlerUtils.extractPropertiesTO( newProperties, getPropertiesExtractionPolicy(message))); return topicTO; }
BlogTO function(EditTopicMessage message, Blog existingTopic) { Topic topic = message.getTopic(); BlogTO topicTO = new BlogTO(); topicTO.setCreatorUserId(securityHelper.assertCurrentUserId()); String description = message.isUpdateDescription() ? topic .getDescription() : existingTopic.getDescription(); String title = message.isUpdateTitle() ? topic.getTitle() : existingTopic.getTitle(); String alias = message.isUpdateAlias() ? topic.getTopicAlias() : existingTopic.getNameIdentifier(); topicTO.setDescription(description); topicTO.setTitle(title); topicTO.setNameIdentifier(alias); Tag[] newTags = topic.getTags() != null ? topic.getTags() : new Tag[0]; Set<com.communote.server.model.tag.Tag> existingTags = existingTopic .getTags() != null ? existingTopic.getTags() : new HashSet<com.communote.server.model.tag.Tag>(); topicTO.setTags(TopicMessageHandlerUtils.extractTagTOs(newTags, existingTags, getTagsExtractionPolicy(message))); StringProperty[] newProperties = topic.getProperties() == null ? new StringProperty[0] : topic.getProperties(); topicTO.setProperties(TopicMessageHandlerUtils.extractPropertiesTO( newProperties, getPropertiesExtractionPolicy(message))); return topicTO; }
/** * * creates topic TO * * @param message * edit topic message * @param existingTopic * existing topic * @return topic TO */
creates topic TO
createTopicTO
{ "repo_name": "Communote/communote-server", "path": "communote/plugins/communote-message-queue/communote-plugins-mq-message-core/src/main/java/com/communote/plugins/mq/message/core/handler/EditTopicMessageHandler.java", "license": "apache-2.0", "size": 14097 }
[ "com.communote.plugins.mq.message.core.data.property.StringProperty", "com.communote.plugins.mq.message.core.data.tag.Tag", "com.communote.plugins.mq.message.core.data.topic.Topic", "com.communote.plugins.mq.message.core.message.topic.EditTopicMessage", "com.communote.server.api.core.blog.BlogTO", "com.communote.server.model.blog.Blog", "java.util.HashSet", "java.util.Set" ]
import com.communote.plugins.mq.message.core.data.property.StringProperty; import com.communote.plugins.mq.message.core.data.tag.Tag; import com.communote.plugins.mq.message.core.data.topic.Topic; import com.communote.plugins.mq.message.core.message.topic.EditTopicMessage; import com.communote.server.api.core.blog.BlogTO; import com.communote.server.model.blog.Blog; import java.util.HashSet; import java.util.Set;
import com.communote.plugins.mq.message.core.data.property.*; import com.communote.plugins.mq.message.core.data.tag.*; import com.communote.plugins.mq.message.core.data.topic.*; import com.communote.plugins.mq.message.core.message.topic.*; import com.communote.server.api.core.blog.*; import com.communote.server.model.blog.*; import java.util.*;
[ "com.communote.plugins", "com.communote.server", "java.util" ]
com.communote.plugins; com.communote.server; java.util;
611,097
public List<MessageCommand> poll() throws FaultException, IOException;
List<MessageCommand> function() throws FaultException, IOException;
/** * Polls the corus server to which this instance connects. * * @return A {@link List} of {@link MessageCommand}s returned by the Corus server. * @throws FaultException if the Corus server a generated a SOAP fault. * @throws IOException if a problem occurs while internally sending the request to * the Corus server. */
Polls the corus server to which this instance connects
poll
{ "repo_name": "sapia-oss/corus_iop", "path": "modules/client/src/main/java/org/sapia/corus/interop/client/InteropProtocol.java", "license": "apache-2.0", "size": 3355 }
[ "java.io.IOException", "java.util.List", "org.sapia.corus.interop.api.message.MessageCommand" ]
import java.io.IOException; import java.util.List; import org.sapia.corus.interop.api.message.MessageCommand;
import java.io.*; import java.util.*; import org.sapia.corus.interop.api.message.*;
[ "java.io", "java.util", "org.sapia.corus" ]
java.io; java.util; org.sapia.corus;
1,507,508
public static JustifyContent getThis(final String cssValue) { final String enumString = TagStringUtil.toUpperCase(cssValue).replace('-', '_'); JustifyContent correspondingObject = null; try { correspondingObject = valueOf(enumString); } catch (final IllegalArgumentException e) { } return correspondingObject; }
static JustifyContent function(final String cssValue) { final String enumString = TagStringUtil.toUpperCase(cssValue).replace('-', '_'); JustifyContent correspondingObject = null; try { correspondingObject = valueOf(enumString); } catch (final IllegalArgumentException e) { } return correspondingObject; }
/** * gets the corresponding object for the given {@code cssValue} or null for * invalid cssValue. * * @param cssValue the css property value without including * <code>!important</code> in it. * @return the corresponding object for the given {@code cssValue} or null for * invalid cssValue. * @since 1.0.0 * @author WFF */
gets the corresponding object for the given cssValue or null for invalid cssValue
getThis
{ "repo_name": "webfirmframework/wff", "path": "wffweb/src/main/java/com/webfirmframework/wffweb/css/css3/JustifyContent.java", "license": "apache-2.0", "size": 4103 }
[ "com.webfirmframework.wffweb.util.TagStringUtil" ]
import com.webfirmframework.wffweb.util.TagStringUtil;
import com.webfirmframework.wffweb.util.*;
[ "com.webfirmframework.wffweb" ]
com.webfirmframework.wffweb;
380,442
private void removeCalendar(String calName, Jedis jedis) throws JobPersistenceException { String calendarHashKey = createCalendarHashKey(calName); // checking if there are triggers pointing to this calendar String calendarTriggersSetkey = createCalendarTriggersSetKey(calName); if (jedis.scard(calendarTriggersSetkey) > 0) throw new JobPersistenceException("there are triggers pointing to: " + calendarHashKey + ", calendar can't be removed"); // removing the calendar jedis.del(calendarHashKey); jedis.srem(CALENDARS_SET, calendarHashKey); }
void function(String calName, Jedis jedis) throws JobPersistenceException { String calendarHashKey = createCalendarHashKey(calName); String calendarTriggersSetkey = createCalendarTriggersSetKey(calName); if (jedis.scard(calendarTriggersSetkey) > 0) throw new JobPersistenceException(STR + calendarHashKey + STR); jedis.del(calendarHashKey); jedis.srem(CALENDARS_SET, calendarHashKey); }
/** * Removes the calendar from redis. * * @param calName the calendar name * @param jedis thread-safe redis connection * @throws JobPersistenceException */
Removes the calendar from redis
removeCalendar
{ "repo_name": "RedisLabs/redis-quartz", "path": "src/main/java/com/redislabs/quartz/RedisJobStore.java", "license": "mit", "size": 83014 }
[ "org.quartz.JobPersistenceException", "redis.clients.jedis.Jedis" ]
import org.quartz.JobPersistenceException; import redis.clients.jedis.Jedis;
import org.quartz.*; import redis.clients.jedis.*;
[ "org.quartz", "redis.clients.jedis" ]
org.quartz; redis.clients.jedis;
1,401,901
public List<UserId> getUserIds() { return this.userIds; }
List<UserId> function() { return this.userIds; }
/** * Gets the user ids. <value>The user ids.</value> * * @return the user ids */
Gets the user ids. The user ids
getUserIds
{ "repo_name": "govind487/pa-ewsapi-3.0", "path": "src/main/java/microsoft/exchange/webservices/data/GetDelegateRequest.java", "license": "mit", "size": 4199 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,689,959
public URL getOpenWeatherMapUrl(int cityId) { OpenWeatherMapUrl openWeatherMapUrl = new OpenWeatherMapUrl(); switch (this) { case CURRENT_WEATHER: return openWeatherMapUrl.generateCurrentWeatherByCityIdUrl(cityId); case DAILY_WEATHER_FORECAST: return openWeatherMapUrl.generateDailyWeatherForecastUrl(cityId, DEFAULT_DAYS_COUNT_FOR_DAILY_FORECAST); case THREE_HOURLY_WEATHER_FORECAST: return openWeatherMapUrl .generateThreeHourlyWeatherForecastUrl(cityId); default: throw new IllegalWeatherInfoTypeArgumentException(this); } } public static final Parcelable.Creator<WeatherInfoType> CREATOR = new Parcelable.Creator<WeatherInfoType>() {
URL function(int cityId) { OpenWeatherMapUrl openWeatherMapUrl = new OpenWeatherMapUrl(); switch (this) { case CURRENT_WEATHER: return openWeatherMapUrl.generateCurrentWeatherByCityIdUrl(cityId); case DAILY_WEATHER_FORECAST: return openWeatherMapUrl.generateDailyWeatherForecastUrl(cityId, DEFAULT_DAYS_COUNT_FOR_DAILY_FORECAST); case THREE_HOURLY_WEATHER_FORECAST: return openWeatherMapUrl .generateThreeHourlyWeatherForecastUrl(cityId); default: throw new IllegalWeatherInfoTypeArgumentException(this); } } public static final Parcelable.Creator<WeatherInfoType> CREATOR = new Parcelable.Creator<WeatherInfoType>() {
/** * Obtains an Open Weather Map url for this weather info type. * * @param cityId * an Open Weather Map city ID * @return a url containing the weather information for the specified city */
Obtains an Open Weather Map url for this weather info type
getOpenWeatherMapUrl
{ "repo_name": "Kestutis-Z/UK-Weather-repo", "path": "UKWeather/src/com/haringeymobile/ukweather/WeatherInfoType.java", "license": "apache-2.0", "size": 4997 }
[ "android.os.Parcelable", "com.haringeymobile.ukweather.data.OpenWeatherMapUrl" ]
import android.os.Parcelable; import com.haringeymobile.ukweather.data.OpenWeatherMapUrl;
import android.os.*; import com.haringeymobile.ukweather.data.*;
[ "android.os", "com.haringeymobile.ukweather" ]
android.os; com.haringeymobile.ukweather;
2,388,698
@Nonnull public java.util.concurrent.CompletableFuture<UserConsentRequest> postAsync(@Nonnull final UserConsentRequest newUserConsentRequest) { final String requestUrl = getBaseRequest().getRequestUrl().toString(); return new UserConsentRequestRequestBuilder(requestUrl, getBaseRequest().getClient(), null) .buildRequest(getBaseRequest().getHeaders()) .postAsync(newUserConsentRequest); }
java.util.concurrent.CompletableFuture<UserConsentRequest> function(@Nonnull final UserConsentRequest newUserConsentRequest) { final String requestUrl = getBaseRequest().getRequestUrl().toString(); return new UserConsentRequestRequestBuilder(requestUrl, getBaseRequest().getClient(), null) .buildRequest(getBaseRequest().getHeaders()) .postAsync(newUserConsentRequest); }
/** * Creates a new UserConsentRequest * @param newUserConsentRequest the UserConsentRequest to create * @return a future with the created object */
Creates a new UserConsentRequest
postAsync
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/UserConsentRequestCollectionRequest.java", "license": "mit", "size": 6071 }
[ "com.microsoft.graph.models.UserConsentRequest", "javax.annotation.Nonnull" ]
import com.microsoft.graph.models.UserConsentRequest; import javax.annotation.Nonnull;
import com.microsoft.graph.models.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
1,136,558
@FIXVersion(introduced = "4.1", retired = "4.3") @TagNumRef(tagNum = TagNum.StrikePrice) public void setStrikePrice(Double strikePrice) { getSafeInstrument().setStrikePrice(strikePrice); }
@FIXVersion(introduced = "4.1", retired = "4.3") @TagNumRef(tagNum = TagNum.StrikePrice) void function(Double strikePrice) { getSafeInstrument().setStrikePrice(strikePrice); }
/** * Message field setter. * @param strikePrice field value */
Message field setter
setStrikePrice
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/OrderModificationRequestMsg.java", "license": "gpl-3.0", "size": 149491 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
1,390,165
public void updateUser(final String userId, final JSONObject user) throws ServiceException { final Transaction transaction = userRepository.beginTransaction(); try { userRepository.update(userId, user); transaction.commit(); archiveMgmtService.refreshTeams(System.currentTimeMillis()); } catch (final RepositoryException e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.ERROR, "Updates a user[id=" + userId + "] failed", e); throw new ServiceException(e); } }
void function(final String userId, final JSONObject user) throws ServiceException { final Transaction transaction = userRepository.beginTransaction(); try { userRepository.update(userId, user); transaction.commit(); archiveMgmtService.refreshTeams(System.currentTimeMillis()); } catch (final RepositoryException e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.ERROR, STR + userId + STR, e); throw new ServiceException(e); } }
/** * Updates the specified user by the given user id. * * @param userId the given user id * @param user the specified user * @throws ServiceException service exception */
Updates the specified user by the given user id
updateUser
{ "repo_name": "FangStarNet/symphonyx", "path": "src/main/java/org/b3log/symphony/service/UserMgmtService.java", "license": "apache-2.0", "size": 33888 }
[ "org.b3log.latke.logging.Level", "org.b3log.latke.repository.RepositoryException", "org.b3log.latke.repository.Transaction", "org.b3log.latke.service.ServiceException", "org.json.JSONObject" ]
import org.b3log.latke.logging.Level; import org.b3log.latke.repository.RepositoryException; import org.b3log.latke.repository.Transaction; import org.b3log.latke.service.ServiceException; import org.json.JSONObject;
import org.b3log.latke.logging.*; import org.b3log.latke.repository.*; import org.b3log.latke.service.*; import org.json.*;
[ "org.b3log.latke", "org.json" ]
org.b3log.latke; org.json;
542,540
public void testUnsupportedMethods() { ListView subView = new ListView(mActivity); try { mAdapterView.addView(subView); fail("addView(View) is not supported in AdapterView."); } catch (UnsupportedOperationException e) { //expected } try { mAdapterView.addView(subView, 0); fail("addView(View, int) is not supported in AdapterView."); } catch (UnsupportedOperationException e) { //expected } try { mAdapterView.addView(subView, (ViewGroup.LayoutParams) null); fail("addView(View, ViewGroup.LayoutParams) is not supported in AdapterView."); } catch (UnsupportedOperationException e) { //expected } try { mAdapterView.addView(subView, 0, (ViewGroup.LayoutParams) null); fail("addView(View, int, ViewGroup.LayoutParams) is not supported in AdapterView."); } catch (UnsupportedOperationException e) { //expected } try { mAdapterView.removeViewAt(0); fail("removeViewAt(int) is not supported in AdapterView"); } catch (UnsupportedOperationException e) { //expected } try { mAdapterView.removeAllViews(); fail("removeAllViews() is not supported in AdapterView"); } catch (UnsupportedOperationException e) { //expected } try { mAdapterView.removeView(subView); fail("removeView(View) is not supported in AdapterView"); } catch (UnsupportedOperationException e) { //expected }
void function() { ListView subView = new ListView(mActivity); try { mAdapterView.addView(subView); fail(STR); } catch (UnsupportedOperationException e) { } try { mAdapterView.addView(subView, 0); fail(STR); } catch (UnsupportedOperationException e) { } try { mAdapterView.addView(subView, (ViewGroup.LayoutParams) null); fail(STR); } catch (UnsupportedOperationException e) { } try { mAdapterView.addView(subView, 0, (ViewGroup.LayoutParams) null); fail(STR); } catch (UnsupportedOperationException e) { } try { mAdapterView.removeViewAt(0); fail(STR); } catch (UnsupportedOperationException e) { } try { mAdapterView.removeAllViews(); fail(STR); } catch (UnsupportedOperationException e) { } try { mAdapterView.removeView(subView); fail(STR); } catch (UnsupportedOperationException e) { }
/** * test not supported methods, all should throw UnsupportedOperationException */
test not supported methods, all should throw UnsupportedOperationException
testUnsupportedMethods
{ "repo_name": "wiki2014/Learning-Summary", "path": "alps/cts/tests/tests/widget/src/android/widget/cts/AdapterViewTest.java", "license": "gpl-3.0", "size": 18951 }
[ "android.view.ViewGroup", "android.widget.ListView" ]
import android.view.ViewGroup; import android.widget.ListView;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,438,460
// fredt@users 20020130 - comment by fredt // to remove this deprecated method we need to rewrite the Grid class as a // ScrollPane component // sqlbob: I believe that changing to the JDK1.1 event handler // would require browsers to use the Java plugin. public boolean handleEvent(Event e) { switch (e.id) { case Event.SCROLL_LINE_UP : case Event.SCROLL_LINE_DOWN : case Event.SCROLL_PAGE_UP : case Event.SCROLL_PAGE_DOWN : case Event.SCROLL_ABSOLUTE : iX = sbHoriz.getValue(); iY = iRowHeight * sbVert.getValue(); repaint(); return true; } return super.handleEvent(e); }
boolean function(Event e) { switch (e.id) { case Event.SCROLL_LINE_UP : case Event.SCROLL_LINE_DOWN : case Event.SCROLL_PAGE_UP : case Event.SCROLL_PAGE_DOWN : case Event.SCROLL_ABSOLUTE : iX = sbHoriz.getValue(); iY = iRowHeight * sbVert.getValue(); repaint(); return true; } return super.handleEvent(e); }
/** * Method declaration * * * @param e */
Method declaration
handleEvent
{ "repo_name": "Julien35/dev-courses", "path": "tutoriel-spring-mvc/lib/hsqldb/src/org/hsqldb/util/Grid.java", "license": "mit", "size": 14907 }
[ "java.awt.Event" ]
import java.awt.Event;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,144,627
ListSelectionListener getInterfaceListener();
ListSelectionListener getInterfaceListener();
/** * Provides a ListSelectionListener for the interface list. * * @return ListSelectionListener for the interface list */
Provides a ListSelectionListener for the interface list
getInterfaceListener
{ "repo_name": "s13372/SORCER", "path": "sos/sos-cataloger/src/main/java/sorcer/core/provider/cataloger/ui/SignatureDispatchment.java", "license": "apache-2.0", "size": 4549 }
[ "javax.swing.event.ListSelectionListener" ]
import javax.swing.event.ListSelectionListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
2,286,295
public List<UserItemsProvider> getUserItemsProviders() { List<UserItemsProvider> answer = new ArrayList<UserItemsProvider>(); for (Module module : modules.values()) { if (module instanceof UserItemsProvider) { answer.add((UserItemsProvider) module); } } return answer; }
List<UserItemsProvider> function() { List<UserItemsProvider> answer = new ArrayList<UserItemsProvider>(); for (Module module : modules.values()) { if (module instanceof UserItemsProvider) { answer.add((UserItemsProvider) module); } } return answer; }
/** * Returns a list with all the modules that provide "discoverable" items associated with * users. * * @return a list with all the modules that provide "discoverable" items associated with * users. */
Returns a list with all the modules that provide "discoverable" items associated with users
getUserItemsProviders
{ "repo_name": "coodeer/g3server", "path": "src/java/org/jivesoftware/openfire/XMPPServer.java", "license": "apache-2.0", "size": 58703 }
[ "java.util.ArrayList", "java.util.List", "org.jivesoftware.openfire.container.Module", "org.jivesoftware.openfire.disco.UserItemsProvider" ]
import java.util.ArrayList; import java.util.List; import org.jivesoftware.openfire.container.Module; import org.jivesoftware.openfire.disco.UserItemsProvider;
import java.util.*; import org.jivesoftware.openfire.container.*; import org.jivesoftware.openfire.disco.*;
[ "java.util", "org.jivesoftware.openfire" ]
java.util; org.jivesoftware.openfire;
1,307,419
public Rcli<CLIENT> client(String apiVersion) throws CadiException { Rcli<CLIENT> client = clients.get(apiVersion); if(client==null) { client = rclient(initURI(),ss); client.apiVersion(apiVersion) .readTimeout(connTimeout); clients.put(apiVersion, client); } return client; }
Rcli<CLIENT> function(String apiVersion) throws CadiException { Rcli<CLIENT> client = clients.get(apiVersion); if(client==null) { client = rclient(initURI(),ss); client.apiVersion(apiVersion) .readTimeout(connTimeout); clients.put(apiVersion, client); } return client; }
/** * Use this call to get the appropriate client based on configuration (DME2, HTTP, future) * * @param apiVersion * @return * @throws CadiException */
Use this call to get the appropriate client based on configuration (DME2, HTTP, future)
client
{ "repo_name": "att/AAF", "path": "cadi/aaf/src/main/java/com/att/cadi/aaf/v2_0/AAFCon.java", "license": "bsd-3-clause", "size": 10693 }
[ "com.att.cadi.CadiException", "com.att.cadi.client.Rcli" ]
import com.att.cadi.CadiException; import com.att.cadi.client.Rcli;
import com.att.cadi.*; import com.att.cadi.client.*;
[ "com.att.cadi" ]
com.att.cadi;
986,668
public int aggregateUsages() throws DAOException;
int function() throws DAOException;
/** * Aggregates usages per day/user - inserting into the daily table * @return the number of rows added to the aggregate data table */
Aggregates usages per day/user - inserting into the daily table
aggregateUsages
{ "repo_name": "openmrs/openmrs-module-usagestatistics", "path": "api/src/main/java/org/openmrs/module/usagestatistics/db/UsageStatisticsDAO.java", "license": "mpl-2.0", "size": 7382 }
[ "org.openmrs.api.db.DAOException" ]
import org.openmrs.api.db.DAOException;
import org.openmrs.api.db.*;
[ "org.openmrs.api" ]
org.openmrs.api;
2,648,090
public boolean createValueFile(byte[] payload) { byte[] apdu = new byte[23]; apdu[0] = (byte) 0x90; apdu[1] = (byte) 0xCC; apdu[2] = 0x00; apdu[3] = 0x00; apdu[4] = 0x11; System.arraycopy(payload, 0, apdu, 5, 17); apdu[22] = 0x00; preprocess(apdu, CommunicationSetting.PLAIN); CommandAPDU command = new CommandAPDU(apdu); ResponseAPDU response = transmit(command); code = response.getSW2(); feedback(command, response); return postprocess(response.getBytes(), CommunicationSetting.PLAIN) != null; }
boolean function(byte[] payload) { byte[] apdu = new byte[23]; apdu[0] = (byte) 0x90; apdu[1] = (byte) 0xCC; apdu[2] = 0x00; apdu[3] = 0x00; apdu[4] = 0x11; System.arraycopy(payload, 0, apdu, 5, 17); apdu[22] = 0x00; preprocess(apdu, CommunicationSetting.PLAIN); CommandAPDU command = new CommandAPDU(apdu); ResponseAPDU response = transmit(command); code = response.getSW2(); feedback(command, response); return postprocess(response.getBytes(), CommunicationSetting.PLAIN) != null; }
/** * Create a value file, used for the storage and * manipulation of a 32-bit signed integer value. * * @param payload 17-byte byte array, with the following contents: * <br>file number (1 byte), * <br>communication settings (1 byte), * <br>access rights (2 bytes), * <br>lower limit (4 bytes), * <br>upper limit (4 bytes), * <br>value (4 bytes), * <br>limited credit enabled (1 byte) * @return {@code true} on success, {@code false} otherwise */
Create a value file, used for the storage and manipulation of a 32-bit signed integer value
createValueFile
{ "repo_name": "Andrade/nfcjlib", "path": "src/nfcjlib/core/DESFireEV1.java", "license": "bsd-3-clause", "size": 79050 }
[ "javax.smartcardio.CommandAPDU", "javax.smartcardio.ResponseAPDU" ]
import javax.smartcardio.CommandAPDU; import javax.smartcardio.ResponseAPDU;
import javax.smartcardio.*;
[ "javax.smartcardio" ]
javax.smartcardio;
1,732,566
@RequestMapping(value = "/company/{name}", method = RequestMethod.GET) public ResponseEntity<List<CompanyInfo>> getCompanies(@PathVariable("name") final String name) { logger.debug("QuoteController.getCompanies: retrieving companies for: " + name); List<CompanyInfo> companies = service.getCompanyInfo(name); logger.info(String.format("Retrieved companies with search parameter: %s - list: {}", name), companies); return new ResponseEntity<List<CompanyInfo>>(companies, HttpStatus.OK); }
@RequestMapping(value = STR, method = RequestMethod.GET) ResponseEntity<List<CompanyInfo>> function(@PathVariable("name") final String name) { logger.debug(STR + name); List<CompanyInfo> companies = service.getCompanyInfo(name); logger.info(String.format(STR, name), companies); return new ResponseEntity<List<CompanyInfo>>(companies, HttpStatus.OK); }
/** * Searches for companies that have a name or symbol matching the parameter. * * @param name * The name or symbol to search for. * @return The list of companies that match the search parameter. */
Searches for companies that have a name or symbol matching the parameter
getCompanies
{ "repo_name": "stayup-io/cf-SpringBootTrader", "path": "springboottrades-quotes/src/main/java/io/pivotal/quotes/controller/QuoteV1Controller.java", "license": "apache-2.0", "size": 5143 }
[ "io.pivotal.quotes.domain.CompanyInfo", "java.util.List", "org.springframework.http.HttpStatus", "org.springframework.http.ResponseEntity", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import io.pivotal.quotes.domain.CompanyInfo; import java.util.List; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import io.pivotal.quotes.domain.*; import java.util.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "io.pivotal.quotes", "java.util", "org.springframework.http", "org.springframework.web" ]
io.pivotal.quotes; java.util; org.springframework.http; org.springframework.web;
1,660,358
public void setTemProfileService(TemProfileService temProfileService) { this.temProfileService = temProfileService; }
void function(TemProfileService temProfileService) { this.temProfileService = temProfileService; }
/** * Sets the temProfileService attribute value. * @param temProfileService The temProfileService to set. */
Sets the temProfileService attribute value
setTemProfileService
{ "repo_name": "kuali/kfs", "path": "kfs-tem/src/main/java/org/kuali/kfs/module/tem/batch/service/impl/ExpenseImportByTravelerServiceImpl.java", "license": "agpl-3.0", "size": 27957 }
[ "org.kuali.kfs.module.tem.service.TemProfileService" ]
import org.kuali.kfs.module.tem.service.TemProfileService;
import org.kuali.kfs.module.tem.service.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,305,697
public void testKeySetOrder() { ConcurrentSkipListMap map = map5(); Set s = map.keySet(); Iterator i = s.iterator(); Integer last = (Integer)i.next(); assertEquals(last, one); int count = 1; while (i.hasNext()) { Integer k = (Integer)i.next(); assertTrue(last.compareTo(k) < 0); last = k; ++count; } assertEquals(5, count); }
void function() { ConcurrentSkipListMap map = map5(); Set s = map.keySet(); Iterator i = s.iterator(); Integer last = (Integer)i.next(); assertEquals(last, one); int count = 1; while (i.hasNext()) { Integer k = (Integer)i.next(); assertTrue(last.compareTo(k) < 0); last = k; ++count; } assertEquals(5, count); }
/** * keySet is ordered */
keySet is ordered
testKeySetOrder
{ "repo_name": "md-5/jdk10", "path": "test/jdk/java/util/concurrent/tck/ConcurrentSkipListMapTest.java", "license": "gpl-2.0", "size": 41793 }
[ "java.util.Iterator", "java.util.Set", "java.util.concurrent.ConcurrentSkipListMap" ]
import java.util.Iterator; import java.util.Set; import java.util.concurrent.ConcurrentSkipListMap;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,977,494
return taxationElsewhereBox1IncomeWageAndPensionCountryCode; } /** * Sets the value of the taxationElsewhereBox1IncomeWageAndPensionCountryCode property. * * @param value * allowed object is * {@link IsoCountryCodes3CharactersItemType }
return taxationElsewhereBox1IncomeWageAndPensionCountryCode; } /** * Sets the value of the taxationElsewhereBox1IncomeWageAndPensionCountryCode property. * * @param value * allowed object is * {@link IsoCountryCodes3CharactersItemType }
/** * Gets the value of the taxationElsewhereBox1IncomeWageAndPensionCountryCode property. * * @return * possible object is * {@link IsoCountryCodes3CharactersItemType } * */
Gets the value of the taxationElsewhereBox1IncomeWageAndPensionCountryCode property
getTaxationElsewhereBox1IncomeWageAndPensionCountryCode
{ "repo_name": "beemsoft/techytax", "path": "techytax-xbrl/src/main/java/nl/nltaxonomie/nt13/bd/_20181212/dictionary/bd_tuples/TaxationElsewhereBox1IncomeWageAndPensionSpecification.java", "license": "gpl-2.0", "size": 6812 }
[ "nl.nltaxonomie.nt13.sbr._20180301.dictionary.iso3166_countrycodes_2017_11_23.IsoCountryCodes3CharactersItemType" ]
import nl.nltaxonomie.nt13.sbr._20180301.dictionary.iso3166_countrycodes_2017_11_23.IsoCountryCodes3CharactersItemType;
import nl.nltaxonomie.nt13.sbr.*;
[ "nl.nltaxonomie.nt13" ]
nl.nltaxonomie.nt13;
2,247,198
String tempString = schemaString.replace(".", "_"); tempString = tempString.substring(1, tempString.length() - 1); Schema temp = org.apache.pig.impl.util.Utils.getSchemaFromString(tempString); return processSchema(Util.translateSchema(temp)); }
String tempString = schemaString.replace(".", "_"); tempString = tempString.substring(1, tempString.length() - 1); Schema temp = org.apache.pig.impl.util.Utils.getSchemaFromString(tempString); return processSchema(Util.translateSchema(temp)); }
/** * Produces a list of Lipstick SchemaElements from a string representation of a schema. * * @param schemaString the schema string * @return a list of schema elements * @throws ParserException the parser exception */
Produces a list of Lipstick SchemaElements from a string representation of a schema
processSchema
{ "repo_name": "Peilong/Lipstick", "path": "lipstick-console/src/main/java/com/netflix/lipstick/model/Utils.java", "license": "apache-2.0", "size": 2884 }
[ "org.apache.pig.impl.logicalLayer.schema.Schema", "org.apache.pig.newplan.logical.Util" ]
import org.apache.pig.impl.logicalLayer.schema.Schema; import org.apache.pig.newplan.logical.Util;
import org.apache.pig.impl.*; import org.apache.pig.newplan.logical.*;
[ "org.apache.pig" ]
org.apache.pig;
497,663
public void updateButtons() { m_ButtonApprove.setEnabled((m_TextExpression.getText().length() > 0) && (m_ComboBoxType.getSelectedIndex() != -1)); m_ButtonCancel.setEnabled(true); } } public enum ExpressionType { VARIABLE, BOOLEAN, NUMERIC, STRING } protected TableModel m_ExpressionsModel; protected BaseTableWithButtons m_Table; protected JButton m_ButtonAdd; protected JButton m_ButtonEdit; protected JButton m_ButtonRemove; protected JButton m_ButtonRemoveAll; protected JButton m_ButtonRefresh; protected JButton m_ButtonRefreshAll; protected ExpressionDialog m_DialogExpression;
void function() { m_ButtonApprove.setEnabled((m_TextExpression.getText().length() > 0) && (m_ComboBoxType.getSelectedIndex() != -1)); m_ButtonCancel.setEnabled(true); } } public enum ExpressionType { VARIABLE, BOOLEAN, NUMERIC, STRING } protected TableModel m_ExpressionsModel; protected BaseTableWithButtons m_Table; protected JButton m_ButtonAdd; protected JButton m_ButtonEdit; protected JButton m_ButtonRemove; protected JButton m_ButtonRemoveAll; protected JButton m_ButtonRefresh; protected JButton m_ButtonRefreshAll; protected ExpressionDialog m_DialogExpression;
/** * Updates the status of the buttons. */
Updates the status of the buttons
updateButtons
{ "repo_name": "automenta/adams-core", "path": "src/main/java/adams/gui/tools/ExpressionWatchPanel.java", "license": "gpl-3.0", "size": 19645 }
[ "javax.swing.JButton" ]
import javax.swing.JButton;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
715,741
public InterMineObject getObject() { return obj; }
InterMineObject function() { return obj; }
/** * Returns the InterMineObject of the constraint. * * @return the InterMineObject */
Returns the InterMineObject of the constraint
getObject
{ "repo_name": "julie-sullivan/phytomine", "path": "intermine/objectstore/main/src/org/intermine/objectstore/query/ContainsConstraint.java", "license": "lgpl-2.1", "size": 6476 }
[ "org.intermine.model.InterMineObject" ]
import org.intermine.model.InterMineObject;
import org.intermine.model.*;
[ "org.intermine.model" ]
org.intermine.model;
958,222
public Container getContainer() { return (container); }
Container function() { return (container); }
/** * Return the Container with which this Logger has been associated. */
Return the Container with which this Logger has been associated
getContainer
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.43/WebappLoader.java", "license": "mit", "size": 39913 }
[ "org.apache.catalina.Container" ]
import org.apache.catalina.Container;
import org.apache.catalina.*;
[ "org.apache.catalina" ]
org.apache.catalina;
578,051
public void setSet(Set<PropertyValue> set) { setObject(set); } //---------------------------------------------------------------------------- // Util //----------------------------------------------------------------------------
void function(Set<PropertyValue> set) { setObject(set); }
/** * Sets the wrapped value as {@code Set} value. * * @param set value */
Sets the wrapped value as Set value
setSet
{ "repo_name": "dbs-leipzig/gradoop", "path": "gradoop-common/src/main/java/org/gradoop/common/model/impl/properties/PropertyValue.java", "license": "apache-2.0", "size": 18472 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,441,579
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public void activation(DraftKnowledgesEntity entity) { activation(entity.getDraftId()); }
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) void function(DraftKnowledgesEntity entity) { activation(entity.getDraftId()); }
/** * Ativation. * if delete flag is exists and delete flag is true, delete flug is false to activate. * @param entity entity */
Ativation. if delete flag is exists and delete flag is true, delete flug is false to activate
activation
{ "repo_name": "support-project/knowledge", "path": "src/main/java/org/support/project/knowledge/dao/gen/GenDraftKnowledgesDao.java", "license": "apache-2.0", "size": 17829 }
[ "org.support.project.aop.Aspect", "org.support.project.knowledge.entity.DraftKnowledgesEntity" ]
import org.support.project.aop.Aspect; import org.support.project.knowledge.entity.DraftKnowledgesEntity;
import org.support.project.aop.*; import org.support.project.knowledge.entity.*;
[ "org.support.project" ]
org.support.project;
452,124
private double getCountAllDim(final String sbKu, final Integer from, final Integer till) { final List<SbPartObjGeschl> gemList = gemPartMap.get(sbKu); int count = 0; for (final SbPartObjGeschl tmp : gemList) { if (!tmp.getArt().equals("p") && valueBetween(tmp.getDim(), from, till)) { ++count; } } return count; }
double function(final String sbKu, final Integer from, final Integer till) { final List<SbPartObjGeschl> gemList = gemPartMap.get(sbKu); int count = 0; for (final SbPartObjGeschl tmp : gemList) { if (!tmp.getArt().equals("p") && valueBetween(tmp.getDim(), from, till)) { ++count; } } return count; }
/** * DOCUMENT ME! * * @param sbKu DOCUMENT ME! * @param from DOCUMENT ME! * @param till DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getCountAllDim
{ "repo_name": "cismet/watergis-client", "path": "src/main/java/de/cismet/watergis/reports/GerinneGSbReport.java", "license": "lgpl-3.0", "size": 87145 }
[ "de.cismet.watergis.reports.types.SbPartObjGeschl", "java.util.List" ]
import de.cismet.watergis.reports.types.SbPartObjGeschl; import java.util.List;
import de.cismet.watergis.reports.types.*; import java.util.*;
[ "de.cismet.watergis", "java.util" ]
de.cismet.watergis; java.util;
2,254,498
protected boolean isBrowser(String userAgentHeader) { if (userAgentHeader == null) return false; if (patterns != null) { for (int i = 0; i < patterns.length; i++) { Matcher m = patterns[i].matcher(userAgentHeader); if (m.matches()) { return "1".equals(match[i]); } } return true; } return true; }
boolean function(String userAgentHeader) { if (userAgentHeader == null) return false; if (patterns != null) { for (int i = 0; i < patterns.length; i++) { Matcher m = patterns[i].matcher(userAgentHeader); if (m.matches()) { return "1".equals(match[i]); } } return true; } return true; }
/** * If this method returns true, the user agent is a browser * * @param header * @return */
If this method returns true, the user agent is a browser
isBrowser
{ "repo_name": "marktriggs/nyu-sakai-10.4", "path": "kernel/kernel-util/src/main/java/org/sakaiproject/util/BasicAuth.java", "license": "apache-2.0", "size": 7963 }
[ "java.util.regex.Matcher" ]
import java.util.regex.Matcher;
import java.util.regex.*;
[ "java.util" ]
java.util;
350,764
private boolean checkIfIgnored(final GraphRewrite event, FileModel file, List<String> patterns) { boolean ignored = false; if (patterns != null && !patterns.isEmpty()) { for (String pattern : patterns) { if (file.getFilePath().matches(pattern)) { IgnoredFileModel ignoredFileModel = GraphService.addTypeToModel(event.getGraphContext(), file, IgnoredFileModel.class); ignoredFileModel.setIgnoredRegex(pattern); LOG.info("File/Directory placed in " + file.getFilePath() + " was ignored, because matched [" + pattern + "]."); ignored = true; break; } } } return ignored; }
boolean function(final GraphRewrite event, FileModel file, List<String> patterns) { boolean ignored = false; if (patterns != null && !patterns.isEmpty()) { for (String pattern : patterns) { if (file.getFilePath().matches(pattern)) { IgnoredFileModel ignoredFileModel = GraphService.addTypeToModel(event.getGraphContext(), file, IgnoredFileModel.class); ignoredFileModel.setIgnoredRegex(pattern); LOG.info(STR + file.getFilePath() + STR + pattern + "]."); ignored = true; break; } } } return ignored; }
/** * Checks if the {@link FileModel#getFilePath()} + {@link FileModel#getFileName()} is ignored by any of the specified regular expressions. */
Checks if the <code>FileModel#getFilePath()</code> + <code>FileModel#getFileName()</code> is ignored by any of the specified regular expressions
checkIfIgnored
{ "repo_name": "OndraZizka/windup", "path": "rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/UnzipArchiveToOutputFolder.java", "license": "epl-1.0", "size": 12969 }
[ "java.util.List", "org.jboss.windup.config.GraphRewrite", "org.jboss.windup.graph.model.resource.FileModel", "org.jboss.windup.graph.model.resource.IgnoredFileModel", "org.jboss.windup.graph.service.GraphService" ]
import java.util.List; import org.jboss.windup.config.GraphRewrite; import org.jboss.windup.graph.model.resource.FileModel; import org.jboss.windup.graph.model.resource.IgnoredFileModel; import org.jboss.windup.graph.service.GraphService;
import java.util.*; import org.jboss.windup.config.*; import org.jboss.windup.graph.model.resource.*; import org.jboss.windup.graph.service.*;
[ "java.util", "org.jboss.windup" ]
java.util; org.jboss.windup;
1,404,365
private boolean isCritical(final X509Certificate certificate, final String extensionOid) { final Set<String> criticalOids = certificate.getCriticalExtensionOIDs(); if (criticalOids == null || criticalOids.isEmpty()) { return false; } return criticalOids.contains(extensionOid); }
boolean function(final X509Certificate certificate, final String extensionOid) { final Set<String> criticalOids = certificate.getCriticalExtensionOIDs(); if (criticalOids == null criticalOids.isEmpty()) { return false; } return criticalOids.contains(extensionOid); }
/** * Checks if critical extension oids contain the extension oid. * * @param certificate the certificate * @param extensionOid the extension oid * @return true, if critical */
Checks if critical extension oids contain the extension oid
isCritical
{ "repo_name": "icanfly/cas", "path": "cas-server-support-x509/src/main/java/org/jasig/cas/adaptors/x509/authentication/handler/support/X509CredentialsAuthenticationHandler.java", "license": "apache-2.0", "size": 12405 }
[ "java.security.cert.X509Certificate", "java.util.Set" ]
import java.security.cert.X509Certificate; import java.util.Set;
import java.security.cert.*; import java.util.*;
[ "java.security", "java.util" ]
java.security; java.util;
826,293
public AnnotationGraphics getAnnotationgraphics(){ return item.getAnnotationgraphics(); }
AnnotationGraphics function(){ return item.getAnnotationgraphics(); }
/** * Return the encapsulate Low Level API object. */
Return the encapsulate Low Level API object
getAnnotationgraphics
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/hlcorestructure/hlapi/DeclarationHLAPI.java", "license": "epl-1.0", "size": 11245 }
[ "fr.lip6.move.pnml.symmetricnet.hlcorestructure.AnnotationGraphics" ]
import fr.lip6.move.pnml.symmetricnet.hlcorestructure.AnnotationGraphics;
import fr.lip6.move.pnml.symmetricnet.hlcorestructure.*;
[ "fr.lip6.move" ]
fr.lip6.move;
2,501,533
private boolean intersectsPixelClosure(Coordinate p0, Coordinate p1) { li.computeIntersection(p0, p1, corner[0], corner[1]); if (li.hasIntersection()) return true; li.computeIntersection(p0, p1, corner[1], corner[2]); if (li.hasIntersection()) return true; li.computeIntersection(p0, p1, corner[2], corner[3]); if (li.hasIntersection()) return true; li.computeIntersection(p0, p1, corner[3], corner[0]); if (li.hasIntersection()) return true; return false; }
boolean function(Coordinate p0, Coordinate p1) { li.computeIntersection(p0, p1, corner[0], corner[1]); if (li.hasIntersection()) return true; li.computeIntersection(p0, p1, corner[1], corner[2]); if (li.hasIntersection()) return true; li.computeIntersection(p0, p1, corner[2], corner[3]); if (li.hasIntersection()) return true; li.computeIntersection(p0, p1, corner[3], corner[0]); if (li.hasIntersection()) return true; return false; }
/** * Test whether the given segment intersects * the closure of this hot pixel. * This is NOT the test used in the standard snap-rounding * algorithm, which uses the partially closed tolerance square * instead. * This routine is provided for testing purposes only. * * @param p0 the start point of a line segment * @param p1 the end point of a line segment * @return <code>true</code> if the segment intersects the closure of the pixel's tolerance square */
Test whether the given segment intersects the closure of this hot pixel. This is NOT the test used in the standard snap-rounding algorithm, which uses the partially closed tolerance square instead. This routine is provided for testing purposes only
intersectsPixelClosure
{ "repo_name": "Semantive/jts", "path": "src/main/java/com/vividsolutions/jts/noding/snapround/HotPixel.java", "license": "lgpl-3.0", "size": 10453 }
[ "com.vividsolutions.jts.geom.Coordinate" ]
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.*;
[ "com.vividsolutions.jts" ]
com.vividsolutions.jts;
2,627,447
public Channel<SpecificConnectorSendInterceptor> getSpecificChannel();
Channel<SpecificConnectorSendInterceptor> function();
/** * Returns the {@link Channel} which delivers {@link Event}s to a specific {@link BridgeConnector}. * It is invoked by the last interceptor of the global connector send channel ({@link #getGlobalChannel()}). * * @return The channel which delivers events to a specific bridge connector. */
Returns the <code>Channel</code> which delivers <code>Event</code>s to a specific <code>BridgeConnector</code>. It is invoked by the last interceptor of the global connector send channel (<code>#getGlobalChannel()</code>)
getSpecificChannel
{ "repo_name": "QuarterCode/EventBridge", "path": "src/main/java/com/quartercode/eventbridge/bridge/module/ConnectorSenderModule.java", "license": "lgpl-3.0", "size": 4613 }
[ "com.quartercode.eventbridge.channel.Channel" ]
import com.quartercode.eventbridge.channel.Channel;
import com.quartercode.eventbridge.channel.*;
[ "com.quartercode.eventbridge" ]
com.quartercode.eventbridge;
2,523,589
public void addConfiguration(Configuration configuration) { Preconditions.checkNotNull(configuration); this.configuration.addAll(configuration); }
void function(Configuration configuration) { Preconditions.checkNotNull(configuration); this.configuration.addAll(configuration); }
/** * Adds the given key-value configuration to the underlying configuration. It overwrites * existing keys. * * @param configuration key-value configuration to be added */
Adds the given key-value configuration to the underlying configuration. It overwrites existing keys
addConfiguration
{ "repo_name": "tzulitai/flink", "path": "flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java", "license": "apache-2.0", "size": 11949 }
[ "org.apache.flink.configuration.Configuration", "org.apache.flink.util.Preconditions" ]
import org.apache.flink.configuration.Configuration; import org.apache.flink.util.Preconditions;
import org.apache.flink.configuration.*; import org.apache.flink.util.*;
[ "org.apache.flink" ]
org.apache.flink;
1,532,345
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> deleteAsync(String resourceGroupName, String lockName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> deleteAsync(String resourceGroupName, String lockName);
/** * To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* * actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions. * * @param resourceGroupName The name of the resource group containing the lock. * @param lockName The name of lock to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */
To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions
deleteAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java", "license": "mit", "size": 66646 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.*;
[ "com.azure.core" ]
com.azure.core;
231,828