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 String launchEditor(AnalysisEngineMetaData aAnalysisEngineMetaData, String aStyleMapXml,
CAS cas) {
analysisEngineMetaData = aAnalysisEngineMetaData;
// create an ArrayList of style entries used by the GUI
ArrayList styleList = createStyleList(aAnalysisEngineMetaData, aStyleMapXml);
/... | String function(AnalysisEngineMetaData aAnalysisEngineMetaData, String aStyleMapXml, CAS cas) { analysisEngineMetaData = aAnalysisEngineMetaData; ArrayList styleList = createStyleList(aAnalysisEngineMetaData, aStyleMapXml); if (launchGUI(styleList, cas)) { return generateStyleMap(styleList); } else { return null; } } | /**
* Displays the StyleMapEditor GUI and allows the user to edit a style map. When the user has
* finished, the new style map is returned.
*
* @param aAnalysisEngineMetaData
* Metadata for the AnalysisEngine whose style map is to be edited. This contains the
* AE's capabilities and ... | Displays the StyleMapEditor GUI and allows the user to edit a style map. When the user has finished, the new style map is returned | launchEditor | {
"repo_name": "apache/uima-uimaj",
"path": "uimaj-tools/src/main/java/org/apache/uima/tools/stylemap/StyleMapEditor.java",
"license": "apache-2.0",
"size": 28849
} | [
"java.util.ArrayList",
"org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData"
] | import java.util.ArrayList; import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData; | import java.util.*; import org.apache.uima.analysis_engine.metadata.*; | [
"java.util",
"org.apache.uima"
] | java.util; org.apache.uima; | 2,500,516 |
public static Object getSimpleProperty(Object bean, String name)
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
return PropertyUtilsBean.getInstance().getSimpleProperty(bean, name);
} | static Object function(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return PropertyUtilsBean.getInstance().getSimpleProperty(bean, name); } | /**
* <p>Return the value of the specified simple property of the specified
* bean, with no type conversions.</p>
*
* <p>For more details see <code>PropertyUtilsBean</code>.</p>
*
* @see PropertyUtilsBean#getSimpleProperty
*/ | Return the value of the specified simple property of the specified bean, with no type conversions. For more details see <code>PropertyUtilsBean</code> | getSimpleProperty | {
"repo_name": "ProfilingLabs/Usemon2",
"path": "usemon-agent-commons-java/src/main/java/com/usemon/lib/org/apache/commons/beanutils/PropertyUtils.java",
"license": "mpl-2.0",
"size": 18359
} | [
"java.lang.reflect.InvocationTargetException"
] | import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,397,556 |
public int getIssueThreshold() {
int result = 0;
try {
result = config.getIssueThreshold();
} catch (NumberFormatException e) {
throw new StashConfigurationException("Unable to get " + StashPlugin.STASH_ISSUE_THRESHOLD
+ " from plugin configuration", e);
}
return result;
} | int function() { int result = 0; try { result = config.getIssueThreshold(); } catch (NumberFormatException e) { throw new StashConfigurationException(STR + StashPlugin.STASH_ISSUE_THRESHOLD + STR, e); } return result; } | /**
* Mandatory Issue Threshold option.
*
* @throws StashConfigurationException if unable to get parameter as Integer
*/ | Mandatory Issue Threshold option | getIssueThreshold | {
"repo_name": "AmadeusITGroup/sonar-stash",
"path": "src/main/java/org/sonar/plugins/stash/StashRequestFacade.java",
"license": "mit",
"size": 13637
} | [
"org.sonar.plugins.stash.exceptions.StashConfigurationException"
] | import org.sonar.plugins.stash.exceptions.StashConfigurationException; | import org.sonar.plugins.stash.exceptions.*; | [
"org.sonar.plugins"
] | org.sonar.plugins; | 830,750 |
public void addDragGestureHandler(DragHandler[] handler, Key[] key, Entity entity, Button button,
Orientation orient, Object[] param) {
ChartGestureHandler h =
ChartGestureHandler.createDragDiffHandler(handler, key, entity, button, orient, param);
addGestureHandler(h);
}
| void function(DragHandler[] handler, Key[] key, Entity entity, Button button, Orientation orient, Object[] param) { ChartGestureHandler h = ChartGestureHandler.createDragDiffHandler(handler, key, entity, button, orient, param); addGestureHandler(h); } | /**
* Add drag handlers for each key (key and handler have to be ordered)
*
* @param g
* @param handler
*/ | Add drag handlers for each key (key and handler have to be ordered) | addDragGestureHandler | {
"repo_name": "DrewG/mzmine2",
"path": "src/main/java/net/sf/mzmine/chartbasics/gestures/ChartGestureMouseAdapter.java",
"license": "gpl-2.0",
"size": 12420
} | [
"net.sf.mzmine.chartbasics.gestures.ChartGesture",
"net.sf.mzmine.chartbasics.gestures.ChartGestureDragDiffHandler",
"net.sf.mzmine.chartbasics.gestures.ChartGestureHandler"
] | import net.sf.mzmine.chartbasics.gestures.ChartGesture; import net.sf.mzmine.chartbasics.gestures.ChartGestureDragDiffHandler; import net.sf.mzmine.chartbasics.gestures.ChartGestureHandler; | import net.sf.mzmine.chartbasics.gestures.*; | [
"net.sf.mzmine"
] | net.sf.mzmine; | 811,752 |
public static IComplexNDArray truncate(IComplexNDArray nd, int n, int dimension) {
if (nd.isVector()) {
IComplexNDArray truncated = Nd4j.createComplex(new int[]{n});
for (int i = 0; i < n; i++)
truncated.put(i, nd.getScalar(i));
return truncated;
... | static IComplexNDArray function(IComplexNDArray nd, int n, int dimension) { if (nd.isVector()) { IComplexNDArray truncated = Nd4j.createComplex(new int[]{n}); for (int i = 0; i < n; i++) truncated.put(i, nd.getScalar(i)); return truncated; } if (nd.size(dimension) > n) { int[] targetShape = ArrayUtil.copy(nd.shape()); ... | /**
* Truncates an ndarray to the specified shape.
* If the shape is the same or greater, it just returns
* the original array
*
* @param nd the ndarray to truncate
* @param n the number of elements to truncate to
* @return the truncated ndarray
*/ | Truncates an ndarray to the specified shape. If the shape is the same or greater, it just returns the original array | truncate | {
"repo_name": "wlin12/JNN",
"path": "src/org/nd4j/linalg/util/ComplexNDArrayUtil.java",
"license": "apache-2.0",
"size": 7915
} | [
"java.util.ArrayList",
"java.util.List",
"org.nd4j.linalg.api.complex.IComplexDouble",
"org.nd4j.linalg.api.complex.IComplexNDArray",
"org.nd4j.linalg.factory.Nd4j"
] | import java.util.ArrayList; import java.util.List; import org.nd4j.linalg.api.complex.IComplexDouble; import org.nd4j.linalg.api.complex.IComplexNDArray; import org.nd4j.linalg.factory.Nd4j; | import java.util.*; import org.nd4j.linalg.api.complex.*; import org.nd4j.linalg.factory.*; | [
"java.util",
"org.nd4j.linalg"
] | java.util; org.nd4j.linalg; | 2,187,866 |
public void serialize(QName name, Attributes attributes,
Object value, SerializationContext context)
throws IOException
{
DataHandler dh= (DataHandler)value;
//Add the attachment content to the message.
Attachments attachments= context.getCurrentMessage(... | void function(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { DataHandler dh= (DataHandler)value; Attachments attachments= context.getCurrentMessage().getAttachmentsImpl(); if (attachments == null) { throw new IOException(Messages.getMessage(STR)); } SOAPConstants soa... | /**
* Serialize a JAF DataHandler quantity.
*/ | Serialize a JAF DataHandler quantity | serialize | {
"repo_name": "hugosato/apache-axis",
"path": "src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java",
"license": "apache-2.0",
"size": 4676
} | [
"java.io.IOException",
"javax.activation.DataHandler",
"javax.xml.namespace.QName",
"org.apache.axis.Constants",
"org.apache.axis.Part",
"org.apache.axis.attachments.Attachments",
"org.apache.axis.encoding.SerializationContext",
"org.apache.axis.soap.SOAPConstants",
"org.apache.axis.utils.Messages",... | import java.io.IOException; import javax.activation.DataHandler; import javax.xml.namespace.QName; import org.apache.axis.Constants; import org.apache.axis.Part; import org.apache.axis.attachments.Attachments; import org.apache.axis.encoding.SerializationContext; import org.apache.axis.soap.SOAPConstants; import org.ap... | import java.io.*; import javax.activation.*; import javax.xml.namespace.*; import org.apache.axis.*; import org.apache.axis.attachments.*; import org.apache.axis.encoding.*; import org.apache.axis.soap.*; import org.apache.axis.utils.*; import org.xml.sax.*; import org.xml.sax.helpers.*; | [
"java.io",
"javax.activation",
"javax.xml",
"org.apache.axis",
"org.xml.sax"
] | java.io; javax.activation; javax.xml; org.apache.axis; org.xml.sax; | 2,711,581 |
public void generateCall(JavaWriter out, String retVar,
String var, String []args)
throws IOException
{
_next.generateCall(out, retVar, var, args);
} | void function(JavaWriter out, String retVar, String var, String []args) throws IOException { _next.generateCall(out, retVar, var, args); } | /**
* Generates the code for the method call.
*
* @param out the writer to the output stream.
* @param retVar the variable to hold the return value
* @param var the object to be called
* @param args the method arguments
*/ | Generates the code for the method call | generateCall | {
"repo_name": "dlitz/resin",
"path": "modules/kernel/src/com/caucho/java/gen/FilterCallChain.java",
"license": "gpl-2.0",
"size": 2249
} | [
"com.caucho.java.JavaWriter",
"java.io.IOException"
] | import com.caucho.java.JavaWriter; import java.io.IOException; | import com.caucho.java.*; import java.io.*; | [
"com.caucho.java",
"java.io"
] | com.caucho.java; java.io; | 2,414,115 |
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
... | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } | /**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Handles the HTTP <code>GET</code> method | doGet | {
"repo_name": "Kepyy/HealthMate",
"path": "src/java/GetMediciness.java",
"license": "apache-2.0",
"size": 3182
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 2,896,200 |
private void drawBoxGridsTicksLabels(Graphics2D g) {
Point tickpos;
boolean x_left, y_left;
int x[], y[], i;
x = new int[5];
y = new int[5];
if (projector == null) {
return;
}
factor_x = factor_y = 1;
projection = proj... | void function(Graphics2D g) { Point tickpos; boolean x_left, y_left; int x[], y[], i; x = new int[5]; y = new int[5]; if (projector == null) { return; } factor_x = factor_y = 1; projection = projector.project(0, 0, -10); x[0] = projection.x; projection = projector.project(10.5f, 0, -10); y_left = projection.x > x[0]; i... | /**
* Draws bounding box, axis grids, axis ticks, axis labels, base plane.
*
* @param g the graphics context to draw
*/ | Draws bounding box, axis grids, axis ticks, axis labels, base plane | drawBoxGridsTicksLabels | {
"repo_name": "meteoinfo/meteoinfolib",
"path": "src/org/meteoinfo/chart/plot/Plot3D.java",
"license": "lgpl-3.0",
"size": 77286
} | [
"java.awt.Dimension",
"java.awt.Graphics2D",
"java.awt.Point",
"java.util.List",
"org.meteoinfo.chart.ChartText",
"org.meteoinfo.data.DataMath",
"org.meteoinfo.drawing.Draw"
] | import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Point; import java.util.List; import org.meteoinfo.chart.ChartText; import org.meteoinfo.data.DataMath; import org.meteoinfo.drawing.Draw; | import java.awt.*; import java.util.*; import org.meteoinfo.chart.*; import org.meteoinfo.data.*; import org.meteoinfo.drawing.*; | [
"java.awt",
"java.util",
"org.meteoinfo.chart",
"org.meteoinfo.data",
"org.meteoinfo.drawing"
] | java.awt; java.util; org.meteoinfo.chart; org.meteoinfo.data; org.meteoinfo.drawing; | 2,766,885 |
public static Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) {
int width = bm.getWidth();
int height = bm.getHeight();
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
// CREATE A MATRIX FOR THE MANIPULATION
... | static Bitmap function(Bitmap bm, int newWidth, int newHeight) { int width = bm.getWidth(); int height = bm.getHeight(); float scaleWidth = ((float) newWidth) / width; float scaleHeight = ((float) newHeight) / height; Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); Bitmap resizedBitmap = Bitmap... | /**
* Resize bitmap method
* @param bm Bitmap
* @param newWidth int
* @param newHeight int
* @return Bitmap
*/ | Resize bitmap method | getResizedBitmap | {
"repo_name": "michelelacorte/AndroidAppShortcuts",
"path": "library/src/main/java/it/michelelacorte/androidshortcuts/util/Utils.java",
"license": "apache-2.0",
"size": 14313
} | [
"android.graphics.Bitmap",
"android.graphics.Matrix"
] | import android.graphics.Bitmap; import android.graphics.Matrix; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 433,412 |
@MonitorableStatusValue( name = "local_errors", description = "Total number of requests that failed since the service was started due to problems within the service itself." )
public long getLocalErrors( ) {
return localErrors.get( );
} | @MonitorableStatusValue( name = STR, description = STR ) long function( ) { return localErrors.get( ); } | /**
* Returns the number of local errors received
* since the contract was operational.
* @return the number of local errors
*/ | Returns the number of local errors received since the contract was operational | getLocalErrors | {
"repo_name": "Talvish/Tales",
"path": "product/services/src/com/talvish/tales/contracts/services/ContractStatus.java",
"license": "apache-2.0",
"size": 10545
} | [
"com.talvish.tales.system.status.MonitorableStatusValue"
] | import com.talvish.tales.system.status.MonitorableStatusValue; | import com.talvish.tales.system.status.*; | [
"com.talvish.tales"
] | com.talvish.tales; | 166,513 |
public String createHierarchy(DevelopmentProposal initialChild, String userId) throws ProposalHierarchyException; | String function(DevelopmentProposal initialChild, String userId) throws ProposalHierarchyException; | /**
* This method takes a proposal, creates a Hierarchy
* and links the proposal as the initial child.
*
* @param initialChild
* @return the proposal number of the new hierarchy
* @throws ProposalHierarchyException if the proposal is already a member of a hierarchy
*/ | This method takes a proposal, creates a Hierarchy and links the proposal as the initial child | createHierarchy | {
"repo_name": "sanjupolus/KC6.oLatest",
"path": "coeus-impl/src/main/java/org/kuali/coeus/propdev/impl/hierarchy/ProposalHierarchyService.java",
"license": "agpl-3.0",
"size": 12260
} | [
"org.kuali.coeus.propdev.impl.core.DevelopmentProposal"
] | import org.kuali.coeus.propdev.impl.core.DevelopmentProposal; | import org.kuali.coeus.propdev.impl.core.*; | [
"org.kuali.coeus"
] | org.kuali.coeus; | 267,581 |
@JSONMethod({ "containerNoid", "x", "y", "orientation" })
public void PUT(User from, OptInteger containerNoid, OptInteger x, OptInteger y, OptInteger orientation) {
generic_PUT(from, containerNoid.value(THE_REGION), x.value(avatar(from).x), y.value(avatar(from).y),
orientation.value(avatar(f... | @JSONMethod({ STR, "x", "y", STR }) void function(User from, OptInteger containerNoid, OptInteger x, OptInteger y, OptInteger orientation) { generic_PUT(from, containerNoid.value(THE_REGION), x.value(avatar(from).x), y.value(avatar(from).y), orientation.value(avatar(from).orientation)); } | /**
* Verb (Generic): Put this item into some container or on the ground.
*
* @param from
* User representing the connection making the request.
* @param containerNoid
* The Habitat Noid for the target container THE_REGION is
* default.
* @param x... | Verb (Generic): Put this item into some container or on the ground | PUT | {
"repo_name": "frandallfarmer/neohabitat",
"path": "src/main/java/org/made/neohabitat/mods/Matchbook.java",
"license": "mit",
"size": 4615
} | [
"org.elkoserver.foundation.json.JSONMethod",
"org.elkoserver.foundation.json.OptInteger",
"org.elkoserver.server.context.User"
] | import org.elkoserver.foundation.json.JSONMethod; import org.elkoserver.foundation.json.OptInteger; import org.elkoserver.server.context.User; | import org.elkoserver.foundation.json.*; import org.elkoserver.server.context.*; | [
"org.elkoserver.foundation",
"org.elkoserver.server"
] | org.elkoserver.foundation; org.elkoserver.server; | 2,119,283 |
public void grantVoice(String nickname) throws XMPPException {
changeRole(nickname, "participant", null);
} | void function(String nickname) throws XMPPException { changeRole(nickname, STR, null); } | /**
* Grants voice to a visitor in the room. In a moderated room, a moderator may want to manage
* who does and does not have "voice" in the room. To have voice means that a room occupant
* is able to send messages to the room occupants.
*
* @param nickname the nickname of the visitor to grant ... | Grants voice to a visitor in the room. In a moderated room, a moderator may want to manage who does and does not have "voice" in the room. To have voice means that a room occupant is able to send messages to the room occupants | grantVoice | {
"repo_name": "masach/FaceWhat",
"path": "FacewhatDroid/asmack/org/jivesoftware/smackx/muc/MultiUserChat.java",
"license": "gpl-3.0",
"size": 122766
} | [
"org.jivesoftware.smack.XMPPException"
] | import org.jivesoftware.smack.XMPPException; | import org.jivesoftware.smack.*; | [
"org.jivesoftware.smack"
] | org.jivesoftware.smack; | 2,805,503 |
@GetMapping("/_search/dish-categories")
@Timed
public ResponseEntity<List<DishCategory>> searchDishCategories(@RequestParam String query, @ApiParam Pageable pageable) {
log.debug("REST request to search for a page of DishCategories for query {}", query);
Page<DishCategory> page = dishCategor... | @GetMapping(STR) ResponseEntity<List<DishCategory>> function(@RequestParam String query, @ApiParam Pageable pageable) { log.debug(STR, query); Page<DishCategory> page = dishCategorySearchRepository.search(queryStringQuery(query), pageable); HttpHeaders headers = PaginationUtil.generateSearchPaginationHttpHeaders(query,... | /**
* SEARCH /_search/dish-categories?query=:query : search for the dishCategory corresponding
* to the query.
*
* @param query the query of the dishCategory search
* @param pageable the pagination information
* @return the result of the search
*/ | SEARCH /_search/dish-categories?query=:query : search for the dishCategory corresponding to the query | searchDishCategories | {
"repo_name": "goxhaj/gastronomee",
"path": "src/main/java/com/gastronomee/web/rest/DishCategoryResource.java",
"license": "apache-2.0",
"size": 10556
} | [
"com.gastronomee.domain.DishCategory",
"com.gastronomee.web.rest.util.PaginationUtil",
"io.swagger.annotations.ApiParam",
"java.util.List",
"org.springframework.data.domain.Page",
"org.springframework.data.domain.Pageable",
"org.springframework.http.HttpHeaders",
"org.springframework.http.HttpStatus",... | import com.gastronomee.domain.DishCategory; import com.gastronomee.web.rest.util.PaginationUtil; import io.swagger.annotations.ApiParam; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springfram... | import com.gastronomee.domain.*; import com.gastronomee.web.rest.util.*; import io.swagger.annotations.*; import java.util.*; import org.springframework.data.domain.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*; | [
"com.gastronomee.domain",
"com.gastronomee.web",
"io.swagger.annotations",
"java.util",
"org.springframework.data",
"org.springframework.http",
"org.springframework.web"
] | com.gastronomee.domain; com.gastronomee.web; io.swagger.annotations; java.util; org.springframework.data; org.springframework.http; org.springframework.web; | 2,215,810 |
public List<ArrayComprehensionLoop> getLoops() {
return loops;
}
/**
* Sets loop list
* @throws IllegalArgumentException if loops is {@code null} | List<ArrayComprehensionLoop> function() { return loops; } /** * Sets loop list * @throws IllegalArgumentException if loops is {@code null} | /**
* Returns loop list
*/ | Returns loop list | getLoops | {
"repo_name": "tntim96/rhino-jscover-repackaged",
"path": "src/jscover/mozilla/javascript/ast/ArrayComprehension.java",
"license": "mpl-2.0",
"size": 4343
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 340,716 |
protected void setSelectedState(int type) {
if (state == type)
return;
state = type;
if (type == EditPart.SELECTED_PRIMARY)
showPrimarySelection();
else if (type == EditPart.SELECTED)
showSelection();
else
hideSelection();
} | void function(int type) { if (state == type) return; state = type; if (type == EditPart.SELECTED_PRIMARY) showPrimarySelection(); else if (type == EditPart.SELECTED) showSelection(); else hideSelection(); } | /**
* Sets the internal selection value. This method is called automatically by
* the listener. If the selection value is changed, the appropriate method
* is called to show the specified selection type.
*
* @param type
* the type of selection the EditPolicy should display
*/ | Sets the internal selection value. This method is called automatically by the listener. If the selection value is changed, the appropriate method is called to show the specified selection type | setSelectedState | {
"repo_name": "ghillairet/gef-gwt",
"path": "src/main/java/org/eclipse/gef/editpolicies/SelectionEditPolicy.java",
"license": "epl-1.0",
"size": 4551
} | [
"org.eclipse.gef.EditPart"
] | import org.eclipse.gef.EditPart; | import org.eclipse.gef.*; | [
"org.eclipse.gef"
] | org.eclipse.gef; | 1,740,728 |
public ServiceFuture<ApplicationSecurityGroupInner> createOrUpdateAsync(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback<ApplicationSecurityGroupInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithService... | ServiceFuture<ApplicationSecurityGroupInner> function(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, final ServiceCallback<ApplicationSecurityGroupInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupNam... | /**
* Creates or updates an application security group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationSecurityGroupName The name of the application security group.
* @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operati... | Creates or updates an application security group | createOrUpdateAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/network/v2020_05_01/implementation/ApplicationSecurityGroupsInner.java",
"license": "mit",
"size": 69161
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,339,803 |
public Chunk provideChunk(int x, int z)
{
this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L);
ChunkPrimer chunkprimer = new ChunkPrimer();
this.setBlocksInChunk(x, z, chunkprimer);
this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGenerato... | Chunk function(int x, int z) { this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); this.setBlocksInChunk(x, z, chunkprimer); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16,... | /**
* Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
* specified chunk from the map seed and chunk seed
*/ | Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the specified chunk from the map seed and chunk seed | provideChunk | {
"repo_name": "VikingGoth/SoulWarden",
"path": "src/main/java/vikinggoth/soulwarden/world/dimension/ChunkProviderStygia.java",
"license": "gpl-3.0",
"size": 17342
} | [
"net.minecraft.world.chunk.Chunk",
"net.minecraft.world.chunk.ChunkPrimer"
] | import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.ChunkPrimer; | import net.minecraft.world.chunk.*; | [
"net.minecraft.world"
] | net.minecraft.world; | 155,006 |
Long getBytesDeserialized() throws IOException;
| Long getBytesDeserialized() throws IOException; | /**
* Returns the total Bytes that have been deserialized by this endpoint
* during its lifetime.
*
* @return total Bytes deserialized.
* @throws IOException Throws IOException.
*/ | Returns the total Bytes that have been deserialized by this endpoint during its lifetime | getBytesDeserialized | {
"repo_name": "SOASTA/BlazeDS",
"path": "modules/core/src/java/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java",
"license": "lgpl-3.0",
"size": 3961
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,053,378 |
public List getBrowserList();
| List function(); | /**
* Returns a list of browsers to be used for browser targetting.
* This list will always contain at least one item:
* {@link #BROWSER_DEFAULT BROWSER_DEFAULT}.
*
* @return List
*/ | Returns a list of browsers to be used for browser targetting. This list will always contain at least one item: <code>#BROWSER_DEFAULT BROWSER_DEFAULT</code> | getBrowserList | {
"repo_name": "srnsw/xena",
"path": "plugins/website/ext/src/browserlauncher2-1_3/source/edu/stanford/ejalbert/launching/IBrowserLaunching.java",
"license": "gpl-3.0",
"size": 6350
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 47,423 |
@Test
public void testConnectionsExistOnPoolCreation() {
Assert.assertTrue(pool.totalConnections() > 0);
}
| void function() { Assert.assertTrue(pool.totalConnections() > 0); } | /**
* When pool is created, it should have some connections ready to serve.
*/ | When pool is created, it should have some connections ready to serve | testConnectionsExistOnPoolCreation | {
"repo_name": "nikhilbaradwaj/connection_pool",
"path": "src/test/java/com/nbaradwaj/connectionpool/ConnectionPoolTest.java",
"license": "mit",
"size": 3491
} | [
"junit.framework.Assert"
] | import junit.framework.Assert; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 2,622,176 |
private String dateString(Date date) {
SimpleDateFormat fmt = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance();
fmt.setTimeZone(TimeZone.getTimeZone("GMT"));
fmt.applyPattern("EEE, d MMM yyyy HH:mm:ss z");
return fmt.format(date);
} | String function(Date date) { SimpleDateFormat fmt = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(); fmt.setTimeZone(TimeZone.getTimeZone("GMT")); fmt.applyPattern(STR); return fmt.format(date); } | /**
* Returns the given date as a string using the official format defined
* by the HTTP specification
* @param date A date object
* @return A date string using the oficial HTTP format
*/ | Returns the given date as a string using the official format defined by the HTTP specification | dateString | {
"repo_name": "quintesse/java-webserv",
"path": "src/main/java/org/codejive/websrv/protocol/http/HttpResponseImpl.java",
"license": "gpl-3.0",
"size": 15516
} | [
"java.text.SimpleDateFormat",
"java.util.Date",
"java.util.TimeZone"
] | import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 2,441,658 |
public String getCatalogName(int column) throws SQLException {
Field f = getField(column);
String database = f.getDatabaseName();
return (database == null) ? "" : database; //$NON-NLS-1$
} | String function(int column) throws SQLException { Field f = getField(column); String database = f.getDatabaseName(); return (database == null) ? "" : database; } | /**
* What's a column's table's catalog name?
*
* @param column
* the first column is 1, the second is 2...
*
* @return catalog name, or "" if not applicable
*
* @throws SQLException
* if a database access error occurs
*/ | What's a column's table's catalog name | getCatalogName | {
"repo_name": "yyuu/libmysql-java",
"path": "src/com/mysql/jdbc/ResultSetMetaData.java",
"license": "gpl-2.0",
"size": 22734
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,248,531 |
public void setMtGoodsInfoRepository(MtGoodsInfoRepository mtGoodsInfoRepository) {
this.mtGoodsInfoRepository = mtGoodsInfoRepository;
} | void function(MtGoodsInfoRepository mtGoodsInfoRepository) { this.mtGoodsInfoRepository = mtGoodsInfoRepository; } | /**
* Setter method for property <tt>mtGoodsInfoRepository</tt>.
*
* @param mtGoodsInfoRepository value to be assigned to property mtGoodsInfoRepository
*/ | Setter method for property mtGoodsInfoRepository | setMtGoodsInfoRepository | {
"repo_name": "danlley/myteay",
"path": "myteay-core-service/src/main/java/com/myteay/core/service/components/impl/MtGoodsInfoComponentsImpl.java",
"license": "gpl-3.0",
"size": 4834
} | [
"com.myteay.core.model.dinner.repository.MtGoodsInfoRepository"
] | import com.myteay.core.model.dinner.repository.MtGoodsInfoRepository; | import com.myteay.core.model.dinner.repository.*; | [
"com.myteay.core"
] | com.myteay.core; | 1,065,697 |
@Test
public void testPropertyFilterIsNotDefined() throws Exception {
Element element = parseFile(new File(baseDir + "/test5.xml"));
CalendarFilter filter = new CalendarFilter(element);
ComponentFilter compFilter = filter.getFilter();
Assert.assertNotNull(compFilter);
... | void function() throws Exception { Element element = parseFile(new File(baseDir + STR)); CalendarFilter filter = new CalendarFilter(element); ComponentFilter compFilter = filter.getFilter(); Assert.assertNotNull(compFilter); Assert.assertEquals(STR, compFilter.getName()); Assert.assertEquals(1, compFilter.getComponentF... | /**
* Tests property filter is not defined.
* @throws Exception - if something is wrong this exception is thrown.
*/ | Tests property filter is not defined | testPropertyFilterIsNotDefined | {
"repo_name": "1and1/cosmo",
"path": "cosmo-core/src/test/unit/java/org/unitedinternet/cosmo/calendar/CalendarQueryFilterTest.java",
"license": "apache-2.0",
"size": 15454
} | [
"java.io.File",
"org.junit.Assert",
"org.unitedinternet.cosmo.calendar.query.CalendarFilter",
"org.unitedinternet.cosmo.calendar.query.ComponentFilter",
"org.unitedinternet.cosmo.calendar.query.PropertyFilter",
"org.unitedinternet.cosmo.calendar.query.TimeRangeFilter",
"org.w3c.dom.Element"
] | import java.io.File; import org.junit.Assert; import org.unitedinternet.cosmo.calendar.query.CalendarFilter; import org.unitedinternet.cosmo.calendar.query.ComponentFilter; import org.unitedinternet.cosmo.calendar.query.PropertyFilter; import org.unitedinternet.cosmo.calendar.query.TimeRangeFilter; import org.w3c.dom.E... | import java.io.*; import org.junit.*; import org.unitedinternet.cosmo.calendar.query.*; import org.w3c.dom.*; | [
"java.io",
"org.junit",
"org.unitedinternet.cosmo",
"org.w3c.dom"
] | java.io; org.junit; org.unitedinternet.cosmo; org.w3c.dom; | 683,743 |
public void addSelectionListener(SelectionListener l) {
model.addSelectionListener(l);
} | void function(SelectionListener l) { model.addSelectionListener(l); } | /**
* Invoked to indicate interest in future selection events
*
* @param l the selection listener to be added
*/ | Invoked to indicate interest in future selection events | addSelectionListener | {
"repo_name": "sannysanoff/CodenameOne",
"path": "CodenameOne/src/com/codename1/ui/List.java",
"license": "gpl-2.0",
"size": 85315
} | [
"com.codename1.ui.events.SelectionListener"
] | import com.codename1.ui.events.SelectionListener; | import com.codename1.ui.events.*; | [
"com.codename1.ui"
] | com.codename1.ui; | 164,608 |
@Auditable(
parameters = {"engineId", "workflowDefinition", "mimetype", "name"},
recordable = {true, false, true, true})
public WorkflowDeployment deployDefinition(String engineId, InputStream workflowDefinition, String mimetype, String name); | @Auditable( parameters = {STR, STR, STR, "name"}, recordable = {true, false, true, true}) WorkflowDeployment function(String engineId, InputStream workflowDefinition, String mimetype, String name); | /**
* Deploy a Workflow Definition to the Alfresco Repository
*
* @param engineId the bpm engine id
* @param workflowDefinition the workflow definition
* @param mimetype the mimetype of the workflow definition
* @param name a name representing the deployment
* @return workfl... | Deploy a Workflow Definition to the Alfresco Repository | deployDefinition | {
"repo_name": "daniel-he/community-edition",
"path": "projects/repository/source/java/org/alfresco/service/cmr/workflow/WorkflowService.java",
"license": "lgpl-3.0",
"size": 25805
} | [
"java.io.InputStream",
"org.alfresco.service.Auditable"
] | import java.io.InputStream; import org.alfresco.service.Auditable; | import java.io.*; import org.alfresco.service.*; | [
"java.io",
"org.alfresco.service"
] | java.io; org.alfresco.service; | 942,592 |
public OutputStream getOutputStream(String name, String world) throws IOException {
return this.getConfiguration(name, world).getOutputStream();
} | OutputStream function(String name, String world) throws IOException { return this.getConfiguration(name, world).getOutputStream(); } | /**
* Returns the output stream for the given configuration file in the given world.
*
* @param name The name of the configuration file.
* @param world The world where this configuration applies.
* @return The OutputStream to write data into.
* @throws IOException If an IO-Operation fai... | Returns the output stream for the given configuration file in the given world | getOutputStream | {
"repo_name": "StuxSoftware/SimpleDev",
"path": "Configuration/src/main/java/net/stuxcrystal/simpledev/configuration/storage/ModuleConfigurationLoader.java",
"license": "apache-2.0",
"size": 14613
} | [
"java.io.IOException",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,725,232 |
boolean contains(@NotNull PackageId id) throws IOException; | boolean contains(@NotNull PackageId id) throws IOException; | /**
* Checks if this registry contains the package with the given id.
* @param id the package id.
* @return {@code true} if the package is registered.
* @throws IOException if an I/O error occurs.
*/ | Checks if this registry contains the package with the given id | contains | {
"repo_name": "apache/jackrabbit-filevault",
"path": "vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/registry/PackageRegistry.java",
"license": "apache-2.0",
"size": 6764
} | [
"java.io.IOException",
"org.apache.jackrabbit.vault.packaging.PackageId",
"org.jetbrains.annotations.NotNull"
] | import java.io.IOException; import org.apache.jackrabbit.vault.packaging.PackageId; import org.jetbrains.annotations.NotNull; | import java.io.*; import org.apache.jackrabbit.vault.packaging.*; import org.jetbrains.annotations.*; | [
"java.io",
"org.apache.jackrabbit",
"org.jetbrains.annotations"
] | java.io; org.apache.jackrabbit; org.jetbrains.annotations; | 1,324,197 |
public void setSiteService(SiteService siteService)
{
this.siteService = siteService;
}
| void function(SiteService siteService) { this.siteService = siteService; } | /**
* Set site service
*
* @param siteService the site service
*/ | Set site service | setSiteService | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/repository/source/java/org/alfresco/repo/admin/patch/impl/SitePermissionRefactorPatch.java",
"license": "lgpl-3.0",
"size": 5846
} | [
"org.alfresco.service.cmr.site.SiteService"
] | import org.alfresco.service.cmr.site.SiteService; | import org.alfresco.service.cmr.site.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 1,460,715 |
public Node replaceChild(Node newChild, Node oldChild)
throws DOMException {
// Adopt orphan doctypes
if (newChild.getOwnerDocument() == null &&
newChild instanceof DocumentTypeImpl) {
((DocumentTypeImpl) newChild).ownerDocument = this;
}
if (errorChecking &... | Node function(Node newChild, Node oldChild) throws DOMException { if (newChild.getOwnerDocument() == null && newChild instanceof DocumentTypeImpl) { ((DocumentTypeImpl) newChild).ownerDocument = this; } if (errorChecking &&((docType != null && oldChild.getNodeType() != Node.DOCUMENT_TYPE_NODE && newChild.getNodeType() ... | /**
* Since we cache the docElement (and, currently, docType),
* replaceChild has to update the cache
*
* REVISIT: According to the spec it is not allowed to alter neither the
* document element nor the document type in any way
*/ | Since we cache the docElement (and, currently, docType), replaceChild has to update the cache document element nor the document type in any way | replaceChild | {
"repo_name": "BIORIMP/biorimp",
"path": "BIO-RIMP/test_data/code/xerces/src/org/apache/xerces/dom/CoreDocumentImpl.java",
"license": "gpl-2.0",
"size": 97493
} | [
"org.w3c.dom.DOMException",
"org.w3c.dom.Node"
] | import org.w3c.dom.DOMException; import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 504,685 |
public static ArrayList<DateTime> getFullWeeks(int month, int year,
int startDayOfWeek) {
ArrayList<DateTime> datetimeList = new ArrayList<DateTime>();
DateTime firstDateOfMonth = new DateTime(year, month, 1, 0, 0, 0, 0);
DateTime lastDateOfMonth = firstDateOfMonth.plusMonths(1).minusDays(1);
// Add dat... | static ArrayList<DateTime> function(int month, int year, int startDayOfWeek) { ArrayList<DateTime> datetimeList = new ArrayList<DateTime>(); DateTime firstDateOfMonth = new DateTime(year, month, 1, 0, 0, 0, 0); DateTime lastDateOfMonth = firstDateOfMonth.plusMonths(1).minusDays(1); int weekdayOfFirstDate = firstDateOfM... | /**
* Retrieve all the dates for a given calendar month Include previous month,
* current month and next month.
*
* @param month
* @param year
* @param startDayOfWeek
* : calendar can start from customized date instead of Sunday
* @return
*/ | Retrieve all the dates for a given calendar month Include previous month, current month and next month | getFullWeeks | {
"repo_name": "shutoff/car-alarm",
"path": "src/main/java/ru/shutoff/caralarm/CalendarHelper.java",
"license": "apache-2.0",
"size": 3949
} | [
"java.util.ArrayList",
"org.joda.time.DateTime"
] | import java.util.ArrayList; import org.joda.time.DateTime; | import java.util.*; import org.joda.time.*; | [
"java.util",
"org.joda.time"
] | java.util; org.joda.time; | 2,145,954 |
@Override
public void initialize(URL url, ResourceBundle rb) {
Debug.print("GRAPH CONTROLLER-----------------------------------------------------------------");
if (piechart != null) {
piechart.visibleProperty().set(true);
end.setValue(LocalDate.now());
... | void function(URL url, ResourceBundle rb) { Debug.print(STR); if (piechart != null) { piechart.visibleProperty().set(true); end.setValue(LocalDate.now()); start.setValue(LocalDate.parse(STR)); initialTitle(); KeyActions(); if (helpGeneral != null) { helpKeyAction(); } } } | /**
* Called on controller start
*
* @param url
* @param rb
*/ | Called on controller start | initialize | {
"repo_name": "FastenYourSeatbelts/luggage-system",
"path": "src/luggage/controllers/LuggageGraphController.java",
"license": "mit",
"size": 22579
} | [
"java.time.LocalDate",
"java.util.ResourceBundle"
] | import java.time.LocalDate; import java.util.ResourceBundle; | import java.time.*; import java.util.*; | [
"java.time",
"java.util"
] | java.time; java.util; | 929,974 |
public static BTNode<String> beginningTree( )
{
BTNode<String> root;
BTNode<String> child;
final String ROOT_QUESTION = "Are you a mammal?";
final String LEFT_QUESTION = "Are you bigger than a cat?";
final String RIGHT_QUESTION = "Do you live underwater?";
final Str... | static BTNode<String> function( ) { BTNode<String> root; BTNode<String> child; final String ROOT_QUESTION = STR; final String LEFT_QUESTION = STR; final String RIGHT_QUESTION = STR; final String ANIMAL1 = STR; final String ANIMAL2 = "Mouse"; final String ANIMAL3 = "Trout"; final String ANIMAL4 = "Robin"; root = new BTN... | /**
* Construct a small taxonomy tree with four animals.
* @param - none
* @return
* a reference to the root of a taxonomy tree with the animals:
* kangaroo, mouse, trout, robin.
* @exception OutOfMemoryError
* Indicates that there is insufficient memory to create the tree.
**/ | Construct a small taxonomy tree with four animals | beginningTree | {
"repo_name": "brian-o/CS-CourseWork",
"path": "CS272/Lab9/src/AnimalGuess.java",
"license": "gpl-3.0",
"size": 9728
} | [
"edu.colorado.nodes.BTNode"
] | import edu.colorado.nodes.BTNode; | import edu.colorado.nodes.*; | [
"edu.colorado.nodes"
] | edu.colorado.nodes; | 2,650,773 |
private void checkExpressionOperands(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue,
final IReferenceChain referenceChain) {
if (value == null) {
return;
}
value.setLoweridToReference(timestamp);
Type_type tempType = value.getExpressionReturntype(timestamp, expectedValue... | void function(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) { if (value == null) { return; } value.setLoweridToReference(timestamp); Type_type tempType = value.getExpressionReturntype(timestamp, expectedValue); switch (tempType) { case TYPE_CHARSTRI... | /**
* Checks the parameters of the expression and if they are valid in
* their position in the expression or not.
*
* @param timestamp
* the timestamp of the actual semantic check cycle.
* @param expectedValue
* the kind of value expected.
* @param referenceChain
* ... | Checks the parameters of the expression and if they are valid in their position in the expression or not | checkExpressionOperands | {
"repo_name": "alovassy/titan.EclipsePlug-ins",
"path": "org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/values/expressions/Str2FloatExpression.java",
"license": "epl-1.0",
"size": 6784
} | [
"org.eclipse.titan.designer.AST",
"org.eclipse.titan.designer.parsers.CompilationTimeStamp"
] | import org.eclipse.titan.designer.AST; import org.eclipse.titan.designer.parsers.CompilationTimeStamp; | import org.eclipse.titan.designer.*; import org.eclipse.titan.designer.parsers.*; | [
"org.eclipse.titan"
] | org.eclipse.titan; | 870,177 |
private void updateQueryByParameter(PRPAIN201305UV02QUQIMT021001UV01ControlActProcess controlActProcess) {
if((controlActProcess.getQueryByParameter() != null) && (controlActProcess.getQueryByParameter().getValue() != null) && (controlActProcess.getQueryByParameter().getValue().getParameterList() != null)) {
... | void function(PRPAIN201305UV02QUQIMT021001UV01ControlActProcess controlActProcess) { if((controlActProcess.getQueryByParameter() != null) && (controlActProcess.getQueryByParameter().getValue() != null) && (controlActProcess.getQueryByParameter().getValue().getParameterList() != null)) { PRPAMT201306UV02ParameterList pa... | /**
* Update query by parameter values as needed
*
* @param controlActProcess
*/ | Update query by parameter values as needed | updateQueryByParameter | {
"repo_name": "AurionProject/Aurion",
"path": "Product/Production/Services/PatientDiscoveryCore/src/main/java/gov/hhs/fha/nhinc/compliance/PatientDiscoveryRequestComplianceChecker.java",
"license": "bsd-3-clause",
"size": 12158
} | [
"org.hl7.v3.PRPAIN201305UV02QUQIMT021001UV01ControlActProcess",
"org.hl7.v3.PRPAMT201306UV02ParameterList"
] | import org.hl7.v3.PRPAIN201305UV02QUQIMT021001UV01ControlActProcess; import org.hl7.v3.PRPAMT201306UV02ParameterList; | import org.hl7.v3.*; | [
"org.hl7.v3"
] | org.hl7.v3; | 772,116 |
public void dragNDrop(WebDriverElement dropControl)
throws CandybeanException {
logger.info("Dragging element: " + this.toString()
+ " to element: " + dropControl.toString());
Actions action = new Actions(this.wd);
action.dragAndDrop(this.we, dropControl.we).build().perform();
}
| void function(WebDriverElement dropControl) throws CandybeanException { logger.info(STR + this.toString() + STR + dropControl.toString()); Actions action = new Actions(this.wd); action.dragAndDrop(this.we, dropControl.we).build().perform(); } | /**
* Drag this element and drop onto another element.
*
* @param dropControl
* target of the drag and drop
*/ | Drag this element and drop onto another element | dragNDrop | {
"repo_name": "Eriten/candybean",
"path": "src/main/java/com/sugarcrm/candybean/automation/webdriver/WebDriverElement.java",
"license": "agpl-3.0",
"size": 11176
} | [
"com.sugarcrm.candybean.exceptions.CandybeanException",
"org.openqa.selenium.interactions.Actions"
] | import com.sugarcrm.candybean.exceptions.CandybeanException; import org.openqa.selenium.interactions.Actions; | import com.sugarcrm.candybean.exceptions.*; import org.openqa.selenium.interactions.*; | [
"com.sugarcrm.candybean",
"org.openqa.selenium"
] | com.sugarcrm.candybean; org.openqa.selenium; | 2,103,757 |
@Generated
@StructureField(order = 4, isGetter = false)
public native void setAq_minfree(int value); | @StructureField(order = 4, isGetter = false) native void function(int value); | /**
* Minimum filesystem percent free space.
*/ | Minimum filesystem percent free space | setAq_minfree | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/struct/au_qctrl.java",
"license": "apache-2.0",
"size": 2352
} | [
"org.moe.natj.c.ann.StructureField"
] | import org.moe.natj.c.ann.StructureField; | import org.moe.natj.c.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,507,809 |
@Override public void enterGtExpr(@NotNull IntlyParser.GtExprContext ctx) { } | @Override public void enterGtExpr(@NotNull IntlyParser.GtExprContext ctx) { } | /**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/ | The default implementation does nothing | exitSubExpr | {
"repo_name": "johnbradley/Intly",
"path": "src/intly/parser/IntlyBaseListener.java",
"license": "bsd-2-clause",
"size": 8238
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,730,307 |
@Test
public void whenAnyAttributeIsMissingAnSVGExceptionIsThrown() {
final Attributes attributes = Mockito.mock(Attributes.class);
when(attributes.getLength()).thenReturn(1);
when(attributes.getValue(0)).thenReturn("50.0");
when(attributes.getQName(0)).thenReturn(CoreAttribut... | void function() { final Attributes attributes = Mockito.mock(Attributes.class); when(attributes.getLength()).thenReturn(1); when(attributes.getValue(0)).thenReturn("50.0"); when(attributes.getQName(0)).thenReturn(CoreAttributeMapper.RADIUS_X.getName()); assertResultFails(SVGEllipse::new, SVGEllipse.ELEMENT_NAME, attrib... | /**
* Ensures that a {@link SVGException} is thrown of one of the attributes is missing.
*/ | Ensures that a <code>SVGException</code> is thrown of one of the attributes is missing | whenAnyAttributeIsMissingAnSVGExceptionIsThrown | {
"repo_name": "Xyanid/svgFX",
"path": "src/test/java/de/saxsys/svgfx/core/elements/SVGEllipseTest.java",
"license": "apache-2.0",
"size": 8253
} | [
"de.saxsys.svgfx.core.SVGDocumentDataProvider",
"de.saxsys.svgfx.core.SVGException",
"de.saxsys.svgfx.core.attributes.CoreAttributeMapper",
"de.saxsys.svgfx.core.utils.TestUtils",
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.mockito.Mockito",
"org.xml.sax.Attributes"
] | import de.saxsys.svgfx.core.SVGDocumentDataProvider; import de.saxsys.svgfx.core.SVGException; import de.saxsys.svgfx.core.attributes.CoreAttributeMapper; import de.saxsys.svgfx.core.utils.TestUtils; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.mockito.Mockito; import org.xml.sax.Attributes; | import de.saxsys.svgfx.core.*; import de.saxsys.svgfx.core.attributes.*; import de.saxsys.svgfx.core.utils.*; import org.hamcrest.*; import org.junit.*; import org.mockito.*; import org.xml.sax.*; | [
"de.saxsys.svgfx",
"org.hamcrest",
"org.junit",
"org.mockito",
"org.xml.sax"
] | de.saxsys.svgfx; org.hamcrest; org.junit; org.mockito; org.xml.sax; | 1,298,121 |
public Set<String> getAnnotationNames() {
return annotations == null ? null : annotations.keySet();
} | Set<String> function() { return annotations == null ? null : annotations.keySet(); } | /**
* Returns the set of annotation names for this type
* @return
*/ | Returns the set of annotation names for this type | getAnnotationNames | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/drools-master/drools-compiler/src/main/java/org/drools/compiler/lang/descr/AnnotatedBaseDescr.java",
"license": "mit",
"size": 5523
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 723,587 |
@Override
protected HttpResponse getHttpResponse() {
return this.response;
} | HttpResponse function() { return this.response; } | /**
* Overridden to allow the response that the request will return to be set on the Mock object.
*
* @return The HTTP response that the request will return.
*/ | Overridden to allow the response that the request will return to be set on the Mock object | getHttpResponse | {
"repo_name": "mfrisbey/WebServer",
"path": "WebServerLib/src/test/java/com/frisbey/webserver/test/mock/MockGetRequest.java",
"license": "gpl-2.0",
"size": 2851
} | [
"com.frisbey.webserver.HttpResponse"
] | import com.frisbey.webserver.HttpResponse; | import com.frisbey.webserver.*; | [
"com.frisbey.webserver"
] | com.frisbey.webserver; | 2,125,038 |
Optional<Customer> findById(Long id); | Optional<Customer> findById(Long id); | /**
* Special customization of {@link CrudRepository#findOne(java.io.Serializable)} to return a JDK 8 {@link Optional}.
*
* @param id
* @return
*/ | Special customization of <code>CrudRepository#findOne(java.io.Serializable)</code> to return a JDK 8 <code>Optional</code> | findById | {
"repo_name": "thomasdarimont/spring-data-examples",
"path": "jpa/java8/src/main/java/example/springdata/jpa/java8/CustomerRepository.java",
"license": "apache-2.0",
"size": 2641
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 2,738,444 |
@Ignore("NotSupported")
@Test
public void testPersistentPartitionedRegionWithGatewaySenderPersistenceEnabled_Restart2() {
// create locator on local site
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
// create locator on remote site
Integer nyPort = (Integ... | @Ignore(STR) void function() { Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort)); createCacheInVMs(nyPort, vm2, vm3); createReceiverInVMs(vm2, vm3); createCacheInVMs(lnPort, vm4, vm5, vm6, ... | /**
* Enable persistence for PR and GatewaySender. Close the local site. Create the local cache.
* Don't create back the partitioned region but create just the sender. Check if the remote site
* receives all the events. NOTE: This use case is not supported yet. For ParallelGatewaySender to
* start, it must ... | Enable persistence for PR and GatewaySender. Close the local site. Create the local cache. Don't create back the partitioned region but create just the sender. Check if the remote site start, it must be associated with a partitioned region | testPersistentPartitionedRegionWithGatewaySenderPersistenceEnabled_Restart2 | {
"repo_name": "pdxrunner/geode",
"path": "geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java",
"license": "apache-2.0",
"size": 70917
} | [
"org.apache.geode.internal.cache.wan.WANTestBase",
"org.apache.geode.test.dunit.LogWriterUtils",
"org.junit.Ignore"
] | import org.apache.geode.internal.cache.wan.WANTestBase; import org.apache.geode.test.dunit.LogWriterUtils; import org.junit.Ignore; | import org.apache.geode.internal.cache.wan.*; import org.apache.geode.test.dunit.*; import org.junit.*; | [
"org.apache.geode",
"org.junit"
] | org.apache.geode; org.junit; | 2,704,931 |
@RequestMapping(method = RequestMethod.GET, value = { "error/403" })
public String show403Page(Model model) {
logger.debug("Page Request: /error/403.do");
return "403";
}
| @RequestMapping(method = RequestMethod.GET, value = { STR }) String function(Model model) { logger.debug(STR); return "403"; } | /**
* Handles requests to the /403.do page
**/ | Handles requests to the /403.do page | show403Page | {
"repo_name": "amadoru/starterkit-hibernate-springmvc-tiles",
"path": "src/main/java/com/example/starter/controller/AuthenticationController.java",
"license": "mit",
"size": 1318
} | [
"org.springframework.ui.Model",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] | import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; | import org.springframework.ui.*; import org.springframework.web.bind.annotation.*; | [
"org.springframework.ui",
"org.springframework.web"
] | org.springframework.ui; org.springframework.web; | 578,088 |
public Person getWithDepartments(Integer personId);
| Person function(Integer personId); | /**
* Returns a person identified by it's id. Person contains general info attributes and it's departments.
*
* @author dd
* @param personId
*/ | Returns a person identified by it's id. Person contains general info attributes and it's departments | getWithDepartments | {
"repo_name": "CodeSphere/termitaria",
"path": "TermitariaOM/JavaSource/ro/cs/om/model/dao/IDaoPerson.java",
"license": "agpl-3.0",
"size": 11283
} | [
"ro.cs.om.entity.Person"
] | import ro.cs.om.entity.Person; | import ro.cs.om.entity.*; | [
"ro.cs.om"
] | ro.cs.om; | 2,491,932 |
protected void firePopupMenuWillBecomeVisible()
{
PopupMenuListener[] ll = comboBox.getPopupMenuListeners();
for (int i = 0; i < ll.length; i++)
ll[i].popupMenuWillBecomeVisible(new PopupMenuEvent(comboBox));
} | void function() { PopupMenuListener[] ll = comboBox.getPopupMenuListeners(); for (int i = 0; i < ll.length; i++) ll[i].popupMenuWillBecomeVisible(new PopupMenuEvent(comboBox)); } | /**
* This method fires PopupMenuEvent indicating that combo box's popup list
* of items will become visible
*/ | This method fires PopupMenuEvent indicating that combo box's popup list of items will become visible | firePopupMenuWillBecomeVisible | {
"repo_name": "unofficial-opensource-apple/gcc_40",
"path": "libjava/javax/swing/plaf/basic/BasicComboPopup.java",
"license": "gpl-2.0",
"size": 30895
} | [
"javax.swing.event.PopupMenuEvent",
"javax.swing.event.PopupMenuListener"
] | import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 1,750,919 |
public void copyFrom(QueryTreeNode node) throws StandardException {
super.copyFrom(node);
SavepointNode other = (SavepointNode)node;
this.statementType = other.statementType;
this.savepointName = other.savepointName;
} | void function(QueryTreeNode node) throws StandardException { super.copyFrom(node); SavepointNode other = (SavepointNode)node; this.statementType = other.statementType; this.savepointName = other.savepointName; } | /**
* Fill this node with a deep copy of the given node.
*/ | Fill this node with a deep copy of the given node | copyFrom | {
"repo_name": "xiexingguang/sql-parser",
"path": "src/main/java/com/foundationdb/sql/parser/SavepointNode.java",
"license": "apache-2.0",
"size": 3723
} | [
"com.foundationdb.sql.StandardException"
] | import com.foundationdb.sql.StandardException; | import com.foundationdb.sql.*; | [
"com.foundationdb.sql"
] | com.foundationdb.sql; | 1,494,714 |
@Test
public void testRepeatWithFixedDelay(PrintWriter out) throws Exception {
DBIncrementTask task = new DBIncrementTask("testRepeatWithFixedDelay");
task.getExecutionProperties().put(AutoPurge.PROPERTY_NAME, AutoPurge.NEVER.toString());
TaskStatus<?> status = scheduler.scheduleAtFixedR... | void function(PrintWriter out) throws Exception { DBIncrementTask task = new DBIncrementTask(STR); task.getExecutionProperties().put(AutoPurge.PROPERTY_NAME, AutoPurge.NEVER.toString()); TaskStatus<?> status = scheduler.scheduleAtFixedRate(task, -109, 209, TimeUnit.MILLISECONDS); try { boolean canceled = status.isCance... | /**
* Schedule a repeating task with a fixed delay. Verify that it runs successfully a few times. Then cancel it.
*/ | Schedule a repeating task with a fixed delay. Verify that it runs successfully a few times. Then cancel it | testRepeatWithFixedDelay | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.concurrent.persistent_fat/test-applications/schedtest/src/web/SchedulerFATServlet.java",
"license": "epl-1.0",
"size": 196518
} | [
"com.ibm.websphere.concurrent.persistent.AutoPurge",
"com.ibm.websphere.concurrent.persistent.TaskStatus",
"java.io.PrintWriter",
"java.util.Date",
"java.util.concurrent.TimeUnit"
] | import com.ibm.websphere.concurrent.persistent.AutoPurge; import com.ibm.websphere.concurrent.persistent.TaskStatus; import java.io.PrintWriter; import java.util.Date; import java.util.concurrent.TimeUnit; | import com.ibm.websphere.concurrent.persistent.*; import java.io.*; import java.util.*; import java.util.concurrent.*; | [
"com.ibm.websphere",
"java.io",
"java.util"
] | com.ibm.websphere; java.io; java.util; | 2,398,516 |
public void testRemoveLast() {
ArrayDeque q = populatedDeque(SIZE);
for (int i = SIZE - 1; i >= 0; --i) {
assertEquals(i, q.removeLast());
}
try {
q.removeLast();
shouldThrow();
} catch (NoSuchElementException success) {}
assertNull... | void function() { ArrayDeque q = populatedDeque(SIZE); for (int i = SIZE - 1; i >= 0; --i) { assertEquals(i, q.removeLast()); } try { q.removeLast(); shouldThrow(); } catch (NoSuchElementException success) {} assertNull(q.peekLast()); } | /**
* removeLast() removes last element, or throws NSEE if empty
*/ | removeLast() removes last element, or throws NSEE if empty | testRemoveLast | {
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/libcore/jsr166-tests/src/test/java/jsr166/ArrayDequeTest.java",
"license": "apache-2.0",
"size": 26347
} | [
"java.util.ArrayDeque",
"java.util.NoSuchElementException"
] | import java.util.ArrayDeque; import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 542,429 |
public ServiceCall listAsync(final PoolListOptions poolListOptions, final ListOperationCallback<CloudPool> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (t... | ServiceCall function(final PoolListOptions poolListOptions, final ListOperationCallback<CloudPool> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { serviceCallback.failure(new IllegalArgumentException(STR... | /**
* Lists all of the pools in the specified account.
*
* @param poolListOptions Additional parameters for the operation
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return th... | Lists all of the pools in the specified account | listAsync | {
"repo_name": "pomortaz/azure-sdk-for-java",
"path": "azure-batch/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java",
"license": "mit",
"size": 237401
} | [
"com.microsoft.azure.ListOperationCallback",
"com.microsoft.azure.batch.protocol.models.CloudPool",
"com.microsoft.azure.batch.protocol.models.PoolListOptions",
"com.microsoft.rest.DateTimeRfc1123",
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.Validator",
"org.joda.time.DateTime"
] | import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.batch.protocol.models.CloudPool; import com.microsoft.azure.batch.protocol.models.PoolListOptions; import com.microsoft.rest.DateTimeRfc1123; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.Validator; import org.joda.time.Date... | import com.microsoft.azure.*; import com.microsoft.azure.batch.protocol.models.*; import com.microsoft.rest.*; import org.joda.time.*; | [
"com.microsoft.azure",
"com.microsoft.rest",
"org.joda.time"
] | com.microsoft.azure; com.microsoft.rest; org.joda.time; | 657,905 |
Call<ResponseBody> delete503Async(Boolean booleanValue, final ServiceCallback<Void> serviceCallback); | Call<ResponseBody> delete503Async(Boolean booleanValue, final ServiceCallback<Void> serviceCallback); | /**
* Return 503 status code, then 200 after retry
*
* @param booleanValue Simple boolean value true
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link Call} object
*/ | Return 503 status code, then 200 after retry | delete503Async | {
"repo_name": "BretJohnson/autorest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/http/HttpRetry.java",
"license": "mit",
"size": 6657
} | [
"com.microsoft.rest.ServiceCallback",
"com.squareup.okhttp.ResponseBody"
] | import com.microsoft.rest.ServiceCallback; import com.squareup.okhttp.ResponseBody; | import com.microsoft.rest.*; import com.squareup.okhttp.*; | [
"com.microsoft.rest",
"com.squareup.okhttp"
] | com.microsoft.rest; com.squareup.okhttp; | 1,186,299 |
public CustomType getCustomType(String modelName, String typeName, Parameters parameters);
| CustomType function(String modelName, String typeName, Parameters parameters); | /**
* Gets the {@code org.alfresco.rest.api.model.CustomType} representation of
* the given model's type
*
* @param modelName the model name
* @param typeName the model's type name
* @param parameters the {@link Parameters} object to get the parameters passed into the request
*... | Gets the org.alfresco.rest.api.model.CustomType representation of the given model's type | getCustomType | {
"repo_name": "Kast0rTr0y/community-edition",
"path": "projects/remote-api/source/java/org/alfresco/rest/api/CustomModels.java",
"license": "lgpl-3.0",
"size": 9139
} | [
"org.alfresco.rest.api.model.CustomType",
"org.alfresco.rest.framework.resource.parameters.Parameters"
] | import org.alfresco.rest.api.model.CustomType; import org.alfresco.rest.framework.resource.parameters.Parameters; | import org.alfresco.rest.api.model.*; import org.alfresco.rest.framework.resource.parameters.*; | [
"org.alfresco.rest"
] | org.alfresco.rest; | 2,445,077 |
public void flush() throws IOException {
flushBuffer(false, false);
} | void function() throws IOException { flushBuffer(false, false); } | /**
* Checksums all complete data chunks and flushes them to the underlying
* stream. If there is a trailing partial chunk, it is not flushed and is
* maintained in the buffer.
*/ | Checksums all complete data chunks and flushes them to the underlying stream. If there is a trailing partial chunk, it is not flushed and is maintained in the buffer | flush | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSOutputSummer.java",
"license": "apache-2.0",
"size": 8734
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 971,461 |
public void setEventPrice(BigDecimal eventPrice) {
this.eventPrice = eventPrice;
} | void function(BigDecimal eventPrice) { this.eventPrice = eventPrice; } | /**
* Sets the price for the event.
*
* @param eventPrice
* the event price
*/ | Sets the price for the event | setEventPrice | {
"repo_name": "opetrovski/development",
"path": "oscm-extsvc/javasrc/org/oscm/vo/VOPricedEvent.java",
"license": "apache-2.0",
"size": 3325
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,573,288 |
public void TextAlignment(int alignment) {
this.textAlignment = alignment;
switch (alignment) {
case Component.ALIGNMENT_NORMAL:
paint.setTextAlign(Paint.Align.LEFT);
break;
case Component.ALIGNMENT_CENTER:
paint.setTextAlign(Paint.Align.CENTER);
break;
... | void function(int alignment) { this.textAlignment = alignment; switch (alignment) { case Component.ALIGNMENT_NORMAL: paint.setTextAlign(Paint.Align.LEFT); break; case Component.ALIGNMENT_CENTER: paint.setTextAlign(Paint.Align.CENTER); break; case Component.ALIGNMENT_OPPOSITE: paint.setTextAlign(Paint.Align.RIGHT); brea... | /**
* Specifies the alignment of the canvas's text: center, normal
* (starting at the specified point in DrawText() or DrawAngle()),
* or opposite (ending at the specified point in DrawText() or
* DrawAngle()).
*
* @param alignment one of {@link Component#ALIGNMENT_NORMAL},
* ... | Specifies the alignment of the canvas's text: center, normal (starting at the specified point in DrawText() or DrawAngle()), or opposite (ending at the specified point in DrawText() or DrawAngle()) | TextAlignment | {
"repo_name": "roadlabs/alternate-java-bridge-library",
"path": "src/com/xiledsystems/AlternateJavaBridgelib/components/altbridge/Canvas.java",
"license": "apache-2.0",
"size": 50623
} | [
"android.graphics.Paint",
"com.xiledsystems.AlternateJavaBridgelib"
] | import android.graphics.Paint; import com.xiledsystems.AlternateJavaBridgelib; | import android.graphics.*; import com.xiledsystems.*; | [
"android.graphics",
"com.xiledsystems"
] | android.graphics; com.xiledsystems; | 88,830 |
@Test
public void testGetAvailableIssueTracker() {
try {
IssueTracker it = new IssueTracker(1L, "url", "name");
service.saveIssueTracker(it);
List<IssueTracker> list = service.getAvailableIssueTracker();
Assert.assertNotNull(list);
Assert.asse... | void function() { try { IssueTracker it = new IssueTracker(1L, "url", "name"); service.saveIssueTracker(it); List<IssueTracker> list = service.getAvailableIssueTracker(); Assert.assertNotNull(list); Assert.assertTrue(list.size() > 0); } catch (Exception e) { Assert.fail(); } } | /**
* Tests getting a list of available Issue Tracker.
*/ | Tests getting a list of available Issue Tracker | testGetAvailableIssueTracker | {
"repo_name": "tita/tita",
"path": "tita-business/src/test/java/at/ac/tuwien/ifs/tita/test/service/user/UserServiceTest.java",
"license": "apache-2.0",
"size": 12893
} | [
"at.ac.tuwien.ifs.tita.entity.conv.IssueTracker",
"java.util.List",
"junit.framework.Assert",
"org.junit.Assert"
] | import at.ac.tuwien.ifs.tita.entity.conv.IssueTracker; import java.util.List; import junit.framework.Assert; import org.junit.Assert; | import at.ac.tuwien.ifs.tita.entity.conv.*; import java.util.*; import junit.framework.*; import org.junit.*; | [
"at.ac.tuwien",
"java.util",
"junit.framework",
"org.junit"
] | at.ac.tuwien; java.util; junit.framework; org.junit; | 419,650 |
public static String AskForInput() {
Scanner kbd = new Scanner(System.in);
System.out.print("Enter any string (type 'q' to quit): ");
String input = kbd.nextLine();
if (!input.equals("q")) {
return input;
} else {
System.out.println("You've quit the program.");
System.exit(1); //... | static String function() { Scanner kbd = new Scanner(System.in); System.out.print(STR); String input = kbd.nextLine(); if (!input.equals("q")) { return input; } else { System.out.println(STR); System.exit(1); return ""; } } | /**
* Asks the user for a string input. If input is q, kills the program.
*/ | Asks the user for a string input. If input is q, kills the program | AskForInput | {
"repo_name": "LabLayers/CIS-1068",
"path": "05 Lab Strings + Arrays/StringParse.java",
"license": "mit",
"size": 1759
} | [
"java.util.Scanner"
] | import java.util.Scanner; | import java.util.*; | [
"java.util"
] | java.util; | 1,246,864 |
public void setAsseretionFailureHandler(Consumer<String> assertionFailureHandler) {
this.assertionFailureHandler = assertionFailureHandler;
} | void function(Consumer<String> assertionFailureHandler) { this.assertionFailureHandler = assertionFailureHandler; } | /**
* Sets the assertion failure handler. The default handler is null, which means
* that assertion failures are logged but otherwise no action is taken. Note it
* is recommended to call this before calling beginLogging to ensure that all
* assertion failures are caught.
*/ | Sets the assertion failure handler. The default handler is null, which means that assertion failures are logged but otherwise no action is taken. Note it is recommended to call this before calling beginLogging to ensure that all assertion failures are caught | setAsseretionFailureHandler | {
"repo_name": "josephmjoy/robotics",
"path": "java_robotutils/src/com/rinworks/robotutils/StructuredLogger.java",
"license": "mit",
"size": 45478
} | [
"java.util.function.Consumer"
] | import java.util.function.Consumer; | import java.util.function.*; | [
"java.util"
] | java.util; | 453,764 |
public void add(Object... values) {
add(Arrays.asList(values));
} | void function(Object... values) { add(Arrays.asList(values)); } | /**
* Convenience function to add multiple values in one call.
*
* @param values The data to add.
*/ | Convenience function to add multiple values in one call | add | {
"repo_name": "google/closure-templates",
"path": "java/src/com/google/template/soy/data/SoyListData.java",
"license": "apache-2.0",
"size": 12544
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,910,173 |
public ActionInformation getActionInformation(TestDescriptor testDescriptor, TestInformation testInformation, EventDescriptor actionDescriptor); | ActionInformation function(TestDescriptor testDescriptor, TestInformation testInformation, EventDescriptor actionDescriptor); | /**
* Creates {@link ActionInformation} object for the specified action
* @param testDescriptor
* @param testInformation
* @param actionDescriptor
* @return
*/ | Creates <code>ActionInformation</code> object for the specified action | getActionInformation | {
"repo_name": "ishubin/oculus-experior",
"path": "src/main/java/net/mindengine/oculus/experior/test/resolvers/actions/ActionResolver.java",
"license": "apache-2.0",
"size": 2786
} | [
"net.mindengine.oculus.experior.test.descriptors.ActionInformation",
"net.mindengine.oculus.experior.test.descriptors.EventDescriptor",
"net.mindengine.oculus.experior.test.descriptors.TestDescriptor",
"net.mindengine.oculus.experior.test.descriptors.TestInformation"
] | import net.mindengine.oculus.experior.test.descriptors.ActionInformation; import net.mindengine.oculus.experior.test.descriptors.EventDescriptor; import net.mindengine.oculus.experior.test.descriptors.TestDescriptor; import net.mindengine.oculus.experior.test.descriptors.TestInformation; | import net.mindengine.oculus.experior.test.descriptors.*; | [
"net.mindengine.oculus"
] | net.mindengine.oculus; | 1,218,995 |
@ApiModelProperty(
value = "Total amounts required by law to subtract from the employee's earnings")
public Double getTotalStatutoryDeductions() {
return totalStatutoryDeductions;
} | @ApiModelProperty( value = STR) Double function() { return totalStatutoryDeductions; } | /**
* Total amounts required by law to subtract from the employee's earnings
*
* @return totalStatutoryDeductions
*/ | Total amounts required by law to subtract from the employee's earnings | getTotalStatutoryDeductions | {
"repo_name": "XeroAPI/Xero-Java",
"path": "src/main/java/com/xero/models/payrollnz/PaySlip.java",
"license": "mit",
"size": 39847
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 2,590,896 |
private void initActionBar() {
Window window = getWindow();
// Initializing the window decor can change window feature flags.
// Make sure that we have the correct set before performing the test below.
window.getDecorView();
if (isChild() || !window.hasFeature(Window.FEATUR... | void function() { Window window = getWindow(); window.getDecorView(); if (isChild() !window.hasFeature(Window.FEATURE_ACTION_BAR) mActionBar != null) { return; } mActionBar = new ActionBarImpl(this); mActionBar.setDefaultDisplayHomeAsUpEnabled(mEnableDefaultActionBarUp); } | /**
* Creates a new ActionBar, locates the inflated ActionBarView,
* initializes the ActionBar with the view, and sets mActionBar.
*/ | Creates a new ActionBar, locates the inflated ActionBarView, initializes the ActionBar with the view, and sets mActionBar | initActionBar | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "frameworks/base/core/java/android/app/Activity.java",
"license": "gpl-2.0",
"size": 222627
} | [
"android.view.Window",
"com.android.internal.app.ActionBarImpl"
] | import android.view.Window; import com.android.internal.app.ActionBarImpl; | import android.view.*; import com.android.internal.app.*; | [
"android.view",
"com.android.internal"
] | android.view; com.android.internal; | 1,431,587 |
public void setContainerDataSource(Container.Indexed container) {
defaultContainer = false;
internalSetContainerDataSource(container);
} | void function(Container.Indexed container) { defaultContainer = false; internalSetContainerDataSource(container); } | /**
* Sets the grid data source.
*
* @param container
* The container data source. Cannot be null.
* @throws IllegalArgumentException
* if the data source is null
*/ | Sets the grid data source | setContainerDataSource | {
"repo_name": "synes/vaadin",
"path": "server/src/com/vaadin/ui/Grid.java",
"license": "apache-2.0",
"size": 239096
} | [
"com.vaadin.data.Container"
] | import com.vaadin.data.Container; | import com.vaadin.data.*; | [
"com.vaadin.data"
] | com.vaadin.data; | 1,974,312 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String resourceName, String agentPoolName, Context context); | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginDelete( String resourceGroupName, String resourceName, String agentPoolName, Context context); | /**
* Deletes an agent pool in the specified managed cluster.
*
* @param resourceGroupName The name of the resource group.
* @param resourceName The name of the managed cluster resource.
* @param agentPoolName The name of the agent pool.
* @param context The context to associate with this ... | Deletes an agent pool in the specified managed cluster | beginDelete | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/fluent/AgentPoolsClient.java",
"license": "mit",
"size": 34328
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.SyncPoller"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; | [
"com.azure.core"
] | com.azure.core; | 342,599 |
public List<YangNode> getNestedReferenceResoulutionList() {
return nestedReferenceResoulutionList;
} | List<YangNode> function() { return nestedReferenceResoulutionList; } | /**
* Get the list of nested reference's which required resolution.
*
* @return list of nested reference's which required resolution.
*/ | Get the list of nested reference's which required resolution | getNestedReferenceResoulutionList | {
"repo_name": "sonu283304/onos",
"path": "utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java",
"license": "apache-2.0",
"size": 21148
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,680,033 |
@Method(selector = "customEventInterstitialWillLeaveApplication:")
void willLeaveApplication (GADCustomEventInterstitial customEvent); | @Method(selector = STR) void willLeaveApplication (GADCustomEventInterstitial customEvent); | /** Your Custom Event should call this method when a user action will result in App switching.
* @param customEvent */ | Your Custom Event should call this method when a user action will result in App switching | willLeaveApplication | {
"repo_name": "tianqiujie/robovm-ios-bindings",
"path": "admob/mediation/GADCustomEventInterstitialDelegate.java",
"license": "mit",
"size": 2772
} | [
"org.robovm.objc.annotation.Method"
] | import org.robovm.objc.annotation.Method; | import org.robovm.objc.annotation.*; | [
"org.robovm.objc"
] | org.robovm.objc; | 2,828,679 |
@Override
public ObjectSpecification getSpecification() {
return null;
} | ObjectSpecification function() { return null; } | /**
* Always returns <tt>null</tt>.
*/ | Always returns null | getSpecification | {
"repo_name": "kidaa/isis",
"path": "core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionImpl.java",
"license": "apache-2.0",
"size": 23358
} | [
"org.apache.isis.core.metamodel.spec.ObjectSpecification"
] | import org.apache.isis.core.metamodel.spec.ObjectSpecification; | import org.apache.isis.core.metamodel.spec.*; | [
"org.apache.isis"
] | org.apache.isis; | 2,423,934 |
public static List<String> readKnownParameterValues(MapFile mapFile, String parameter) {
List<String> result = new ArrayList<>();
for (String k : mapFile.keys()) {
int pos = k.indexOf(";parameters=");
if (pos > 0) {
String paramId = parameter + "=";
... | static List<String> function(MapFile mapFile, String parameter) { List<String> result = new ArrayList<>(); for (String k : mapFile.keys()) { int pos = k.indexOf(STR); if (pos > 0) { String paramId = parameter + "="; pos = k.indexOf(parameter + "=", pos + 1); if (pos > 0) { pos += paramId.length(); int end = k.indexOf("... | /**
* Returns the known parameter values from a map file. [public for testing]
*
* @param mapFile the map file
* @param parameter the parameter
* @return the known values as strings (regardless of type)
*/ | Returns the known parameter values from a map file. [public for testing] | readKnownParameterValues | {
"repo_name": "QualiMaster/Infrastructure",
"path": "MonitoringLayer/src/eu/qualimaster/monitoring/profiling/SeparateObservableAlgorithmProfile.java",
"license": "apache-2.0",
"size": 11977
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,253,026 |
public static void logStack(final String output, final int size) {
log(output);
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
for (int i = 3; i < Math.min(stackTrace.length, 3 + size); i++) { // MAGIC_NUMBER
Log.i(Application.TAG, "[" + (i - 2) + "] " + stackTrace[i].toString());
... | static void function(final String output, final int size) { log(output); StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); for (int i = 3; i < Math.min(stackTrace.length, 3 + size); i++) { Log.i(Application.TAG, "[" + (i - 2) + STR + stackTrace[i].toString()); } } | /**
* Make a log entry, including the end of the stack trace.
*
* @param output The base log entry.
* @param size The number of stack trace elements.
*/ | Make a log entry, including the end of the stack trace | logStack | {
"repo_name": "jeisfeld/Augendiagnose",
"path": "AugendiagnoseIdea/augendiagnoseLib/src/main/java/de/jeisfeld/augendiagnoselib/util/Logger.java",
"license": "gpl-2.0",
"size": 3263
} | [
"android.util.Log",
"de.jeisfeld.augendiagnoselib.Application"
] | import android.util.Log; import de.jeisfeld.augendiagnoselib.Application; | import android.util.*; import de.jeisfeld.augendiagnoselib.*; | [
"android.util",
"de.jeisfeld.augendiagnoselib"
] | android.util; de.jeisfeld.augendiagnoselib; | 386,060 |
protected String getStringValue(CmsObject cms, I_CmsXmlContentValueLocation location, String defaultValue) {
if (location == null) {
return defaultValue;
}
return location.asString(cms);
}
| String function(CmsObject cms, I_CmsXmlContentValueLocation location, String defaultValue) { if (location == null) { return defaultValue; } return location.asString(cms); } | /**
* Converts a (possibly null) content value location to a string.<p>
*
* @param cms the current CMS context
* @param location the content value location
* @param defaultValue the value to return if the location is null
*
* @return the string value of the content value locati... | Converts a (possibly null) content value location to a string | getStringValue | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java",
"license": "lgpl-2.1",
"size": 15551
} | [
"org.opencms.file.CmsObject"
] | import org.opencms.file.CmsObject; | import org.opencms.file.*; | [
"org.opencms.file"
] | org.opencms.file; | 2,190,629 |
private void resetUniqueNodesVariables(HashMap<Integer, UniqueNodes> uniqueNodesVariables, UniqueNodes uniqueNodes) {
for (Entry<Integer, UniqueNodes> entry : uniqueNodesVariables.entrySet()) {
uniqueNodesVariables.put(entry.getKey(), uniqueNodes);
}
} | void function(HashMap<Integer, UniqueNodes> uniqueNodesVariables, UniqueNodes uniqueNodes) { for (Entry<Integer, UniqueNodes> entry : uniqueNodesVariables.entrySet()) { uniqueNodesVariables.put(entry.getKey(), uniqueNodes); } } | /**
* Sets all the variables to UniqueNodes.
*
* @param uniqueNodesVariables
* @param uniqueNodes
*/ | Sets all the variables to UniqueNodes | resetUniqueNodesVariables | {
"repo_name": "sjaco002/vxquery",
"path": "vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/RemoveUnusedSortDistinctNodesRule.java",
"license": "apache-2.0",
"size": 22032
} | [
"java.util.HashMap",
"java.util.Map",
"org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.uniquenodes.UniqueNodes"
] | import java.util.HashMap; import java.util.Map; import org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.uniquenodes.UniqueNodes; | import java.util.*; import org.apache.vxquery.compiler.rewriter.rules.propagationpolicies.uniquenodes.*; | [
"java.util",
"org.apache.vxquery"
] | java.util; org.apache.vxquery; | 1,534,518 |
protected int calculateRankCrossing(int i, mxGraphHierarchyModel model)
{
int totalCrossings = 0;
mxGraphHierarchyRank rank = model.ranks.get(new Integer(i));
mxGraphHierarchyRank previousRank = model.ranks.get(new Integer(i - 1));
// Create an array of connections between these two levels
int currentRan... | int function(int i, mxGraphHierarchyModel model) { int totalCrossings = 0; mxGraphHierarchyRank rank = model.ranks.get(new Integer(i)); mxGraphHierarchyRank previousRank = model.ranks.get(new Integer(i - 1)); int currentRankSize = rank.size(); int previousRankSize = previousRank.size(); int[][] connections = new int[cu... | /**
* Calculates the number of edges crossings between the specified rank and
* the rank below it
*
* @param i
* the topmost rank of the pair ( higher rank value )
* @param model
* the internal hierarchy model of the graph
* @return the number of edges crossings with the rank bene... | Calculates the number of edges crossings between the specified rank and the rank below it | calculateRankCrossing | {
"repo_name": "alect/Puzzledice",
"path": "Tools/PuzzleMapEditor/src/com/mxgraph/layout/hierarchical/stage/mxMedianHybridCrossingReduction.java",
"license": "mit",
"size": 18511
} | [
"java.util.Collection",
"java.util.Iterator"
] | import java.util.Collection; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,150,027 |
public StoragePool storagePoolLookupByName(String name) throws LibvirtException {
StoragePoolPointer ptr = libvirt.virStoragePoolLookupByName(VCP, name);
ErrorHandler.processError(libvirt, ptr);
return new StoragePool(this, ptr);
} | StoragePool function(String name) throws LibvirtException { StoragePoolPointer ptr = libvirt.virStoragePoolLookupByName(VCP, name); ErrorHandler.processError(libvirt, ptr); return new StoragePool(this, ptr); } | /**
* Fetch a storage pool based on its unique name
*
* @param name
* name of pool to fetch
* @return StoragePool object
* @throws LibvirtException
*/ | Fetch a storage pool based on its unique name | storagePoolLookupByName | {
"repo_name": "lstoll/libvirt-java",
"path": "src/main/java/org/libvirt/Connect.java",
"license": "lgpl-2.1",
"size": 53252
} | [
"org.libvirt.jna.StoragePoolPointer"
] | import org.libvirt.jna.StoragePoolPointer; | import org.libvirt.jna.*; | [
"org.libvirt.jna"
] | org.libvirt.jna; | 2,740,572 |
protected static String getAnchor(String hRef, String text, String method, String currentFlowKey, int current,
String perspective) {
StringBuilder result = new StringBuilder();
result.append("<a href='").append(hRef).append("?method=").append(method).append("¤tFlowKey=").append(
... | static String function(String hRef, String text, String method, String currentFlowKey, int current, String perspective) { StringBuilder result = new StringBuilder(); result.append(STR).append(hRef).append(STR).append(method).append(STR).append( currentFlowKey).append(STR).append(current); if (perspective != null) { res... | /**
* Function to get the link property on previous and next.
*
* @param hRef
* page to which it is going on click.
* @param text
* text to be displayed.
* @param currentFlowKey
* @param paramName1
* current.
* @param paramvalue1
* ... | Function to get the link property on previous and next | getAnchor | {
"repo_name": "maduhu/mifos-head",
"path": "application/src/main/java/org/mifos/framework/components/tabletag/PageScroll.java",
"license": "apache-2.0",
"size": 5413
} | [
"org.mifos.accounts.loan.util.helpers.RequestConstants"
] | import org.mifos.accounts.loan.util.helpers.RequestConstants; | import org.mifos.accounts.loan.util.helpers.*; | [
"org.mifos.accounts"
] | org.mifos.accounts; | 2,544,838 |
@Test
public final void awsS3PropertiesTest() {
Map<String, String> map = new HashMap<>();
map.put(TieredStorageConfiguration.BLOB_STORE_PROVIDER_KEY, JCloudBlobStoreProvider.AWS_S3.getDriver());
map.put("managedLedgerOffloadRegion", "us-east-1");
map.put("managedLedgerOffloadBuc... | final void function() { Map<String, String> map = new HashMap<>(); map.put(TieredStorageConfiguration.BLOB_STORE_PROVIDER_KEY, JCloudBlobStoreProvider.AWS_S3.getDriver()); map.put(STR, STR); map.put(STR, STR); map.put(STR, "1"); map.put(STR, "500"); map.put(STR, "http: TieredStorageConfiguration config = new TieredStor... | /**
* Confirm that we can configure AWS using the new properties
*/ | Confirm that we can configure AWS using the new properties | awsS3PropertiesTest | {
"repo_name": "yahoo/pulsar",
"path": "tiered-storage/jcloud/src/test/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/TieredStorageConfigurationTests.java",
"license": "apache-2.0",
"size": 10077
} | [
"java.util.HashMap",
"java.util.Map",
"org.testng.Assert"
] | import java.util.HashMap; import java.util.Map; import org.testng.Assert; | import java.util.*; import org.testng.*; | [
"java.util",
"org.testng"
] | java.util; org.testng; | 2,031,856 |
public Builder unadjustedEndDate(LocalDate unadjustedEndDate) {
JodaBeanUtils.notNull(unadjustedEndDate, "unadjustedEndDate");
this.unadjustedEndDate = unadjustedEndDate;
return this;
} | Builder function(LocalDate unadjustedEndDate) { JodaBeanUtils.notNull(unadjustedEndDate, STR); this.unadjustedEndDate = unadjustedEndDate; return this; } | /**
* Sets the unadjusted end date.
* <p>
* The end date before any business day adjustment is applied.
* <p>
* When building, this will default to the end date if not specified.
* @param unadjustedEndDate the new value, not null
* @return this, for chaining, not null
*/ | Sets the unadjusted end date. The end date before any business day adjustment is applied. When building, this will default to the end date if not specified | unadjustedEndDate | {
"repo_name": "nssales/Strata",
"path": "modules/finance/src/main/java/com/opengamma/strata/finance/rate/swap/KnownAmountPaymentPeriod.java",
"license": "apache-2.0",
"size": 22652
} | [
"java.time.LocalDate",
"org.joda.beans.JodaBeanUtils"
] | import java.time.LocalDate; import org.joda.beans.JodaBeanUtils; | import java.time.*; import org.joda.beans.*; | [
"java.time",
"org.joda.beans"
] | java.time; org.joda.beans; | 724,668 |
@Generated
@CVariable()
@MappedReturn(ObjCStringMapper.class)
public static native String GCKeyEight(); | @CVariable() @MappedReturn(ObjCStringMapper.class) static native String function(); | /**
* 8 or *
*/ | 8 or | GCKeyEight | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/gamecontroller/c/GameController.java",
"license": "apache-2.0",
"size": 61506
} | [
"org.moe.natj.c.ann.CVariable",
"org.moe.natj.general.ann.MappedReturn",
"org.moe.natj.objc.map.ObjCStringMapper"
] | import org.moe.natj.c.ann.CVariable; import org.moe.natj.general.ann.MappedReturn; import org.moe.natj.objc.map.ObjCStringMapper; | import org.moe.natj.c.ann.*; import org.moe.natj.general.ann.*; import org.moe.natj.objc.map.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,250,343 |
// Implementation of integer encoding used for crypto
public static BigInteger decodeInteger(byte[] pArray) {
return new BigInteger(1, decodeBase64(pArray));
} | static BigInteger function(byte[] pArray) { return new BigInteger(1, decodeBase64(pArray)); } | /**
* Decode a byte64-encoded integer according to crypto
* standards such as W3C's XML-Signature
*
* @param pArray a byte array containing base64 character data
* @return A BigInteger
*/ | Decode a byte64-encoded integer according to crypto standards such as W3C's XML-Signature | decodeInteger | {
"repo_name": "loadtestgo/pizzascript",
"path": "util/src/main/java/com/loadtestgo/util/Base64.java",
"license": "bsd-3-clause",
"size": 26011
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 2,678,269 |
@NotNull
@ObjectiveCName("requestCompleteOAuthCommandWithCode:")
public Command<AuthState> requestCompleteOAuth(String code) {
return modules.getAuthModule().requestCompleteOauth(code);
} | @ObjectiveCName(STR) Command<AuthState> function(String code) { return modules.getAuthModule().requestCompleteOauth(code); } | /**
* Request complete OAuth
*
* @param code code from oauth
* @return Command for execution
*/ | Request complete OAuth | requestCompleteOAuth | {
"repo_name": "EaglesoftZJ/actor-platform",
"path": "actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java",
"license": "agpl-3.0",
"size": 86315
} | [
"com.google.j2objc.annotations.ObjectiveCName",
"im.actor.core.viewmodel.Command"
] | import com.google.j2objc.annotations.ObjectiveCName; import im.actor.core.viewmodel.Command; | import com.google.j2objc.annotations.*; import im.actor.core.viewmodel.*; | [
"com.google.j2objc",
"im.actor.core"
] | com.google.j2objc; im.actor.core; | 1,247,228 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
Connection conn = null;
P... | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(STR); try (PrintWriter out = response.getWriter()) { Connection conn = null; PreparedStatement ps = null; ResultSet rs; String name = request.getParameter("name"); try { Class.forName(J... | /**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods | processRequest | {
"repo_name": "chechiachang/blue-villa",
"path": "src/main/java/com/ccc/bm/action/GetUserInfoAction.java",
"license": "mit",
"size": 4520
} | [
"com.ccc.bm.entity.JdbcConn",
"com.ccc.bm.entity.User",
"java.io.IOException",
"java.io.PrintWriter",
"java.sql.Connection",
"java.sql.DriverManager",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletReq... | import com.ccc.bm.entity.JdbcConn; import com.ccc.bm.entity.User; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.servlet.ServletException; import j... | import com.ccc.bm.entity.*; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; | [
"com.ccc.bm",
"java.io",
"java.sql",
"javax.servlet"
] | com.ccc.bm; java.io; java.sql; javax.servlet; | 1,542,345 |
@Test
public void testGetBox() throws SQLException {
Statement stmt = _conn.createStatement();
PGbox expected = new PGbox(1.0d, 2.0d, 3.0d, 4.0d);
stmt.executeUpdate(TestUtil.insertSQL("table1","box_column","box '((1, 2), (3, 4))'"));
ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "b... | void function() throws SQLException { Statement stmt = _conn.createStatement(); PGbox expected = new PGbox(1.0d, 2.0d, 3.0d, 4.0d); stmt.executeUpdate(TestUtil.insertSQL(STR,STR,STR)); ResultSet rs = stmt.executeQuery(TestUtil.selectSQL(STR, STR)); try { assertTrue(rs.next()); assertEquals(expected, rs.getObject(STR, P... | /**
* Test the behavior getObject for box columns.
*/ | Test the behavior getObject for box columns | testGetBox | {
"repo_name": "zemian/pgjdbc",
"path": "pgjdbc/src/test/java/org/postgresql/test/jdbc4/jdbc41/GetObjectTest.java",
"license": "bsd-2-clause",
"size": 34052
} | [
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement",
"org.junit.Assert",
"org.postgresql.geometric.PGbox",
"org.postgresql.test.TestUtil"
] | import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import org.junit.Assert; import org.postgresql.geometric.PGbox; import org.postgresql.test.TestUtil; | import java.sql.*; import org.junit.*; import org.postgresql.geometric.*; import org.postgresql.test.*; | [
"java.sql",
"org.junit",
"org.postgresql.geometric",
"org.postgresql.test"
] | java.sql; org.junit; org.postgresql.geometric; org.postgresql.test; | 224,375 |
private void validateField(BoundField field) {
Objects.requireNonNull(field, "`field` must be non-null");
if (this.schema != field.schema)
throw new SchemaException("Attempt to access field '" + field.def.name + "' from a different schema instance.");
if (field.index > values.len... | void function(BoundField field) { Objects.requireNonNull(field, STR); if (this.schema != field.schema) throw new SchemaException(STR + field.def.name + STR); if (field.index > values.length) throw new SchemaException(STR + field.index); } | /**
* Ensure the user doesn't try to access fields from the wrong schema
*
* @throws SchemaException If validation fails
*/ | Ensure the user doesn't try to access fields from the wrong schema | validateField | {
"repo_name": "sslavic/kafka",
"path": "clients/src/main/java/org/apache/kafka/common/protocol/types/Struct.java",
"license": "apache-2.0",
"size": 17015
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 633,973 |
private IJavaProject[] getEJBProjects() {
try {
IJavaProject[] allProjects = JavaCore.create(ResourcesPlugin.getWorkspace()
.getRoot())
.getJavaProjects();
Collec... | IJavaProject[] function() { try { IJavaProject[] allProjects = JavaCore.create(ResourcesPlugin.getWorkspace() .getRoot()) .getJavaProjects(); Collection ejbAwareProjects = new ArrayList(); for (int i = 0; i < allProjects.length; i++) { IJavaProject project = allProjects[i]; EJBProjectProperties properties = new EJBProj... | /**
* This method returns a list of Java projects which are EJB enabled.
* So far, all Java projects are EJB enabled (no project nature has been developed).
* @return
*/ | This method returns a list of Java projects which are EJB enabled. So far, all Java projects are EJB enabled (no project nature has been developed) | getEJBProjects | {
"repo_name": "linnet/eclipse-tools",
"path": "dk.kamstruplinnet.implementors.ejb/src/dk/kamstruplinnet/implementors/ejb/EJBImplementorsPlugin.java",
"license": "epl-1.0",
"size": 5681
} | [
"java.util.ArrayList",
"java.util.Collection",
"org.eclipse.core.resources.ResourcesPlugin",
"org.eclipse.jdt.core.IJavaProject",
"org.eclipse.jdt.core.JavaCore",
"org.eclipse.jdt.core.JavaModelException"
] | import java.util.ArrayList; import java.util.Collection; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; | import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.jdt.core.*; | [
"java.util",
"org.eclipse.core",
"org.eclipse.jdt"
] | java.util; org.eclipse.core; org.eclipse.jdt; | 1,757,141 |
public static long getEntries(
final Connector connector,
final String namespace,
final Index index )
throws AccumuloException,
AccumuloSecurityException,
IOException {
long counter = 0L;
final AccumuloOperations operations = new BasicAccumuloOperations(
connector,
namespace);
final A... | static long function( final Connector connector, final String namespace, final Index index ) throws AccumuloException, AccumuloSecurityException, IOException { long counter = 0L; final AccumuloOperations operations = new BasicAccumuloOperations( connector, namespace); final AccumuloIndexStore indexStore = new AccumuloI... | /**
* Get number of entries per index.
*
* @param namespace
* @param index
* @return
* @throws AccumuloException
* @throws AccumuloSecurityException
* @throws IOException
*/ | Get number of entries per index | getEntries | {
"repo_name": "ruks/geowave",
"path": "extensions/datastores/accumulo/src/main/java/mil/nga/giat/geowave/datastore/accumulo/util/AccumuloUtils.java",
"license": "apache-2.0",
"size": 37115
} | [
"java.io.IOException",
"mil.nga.giat.geowave.core.store.CloseableIterator",
"mil.nga.giat.geowave.core.store.index.Index",
"mil.nga.giat.geowave.datastore.accumulo.AccumuloOperations",
"mil.nga.giat.geowave.datastore.accumulo.BasicAccumuloOperations",
"mil.nga.giat.geowave.datastore.accumulo.metadata.Accu... | import java.io.IOException; import mil.nga.giat.geowave.core.store.CloseableIterator; import mil.nga.giat.geowave.core.store.index.Index; import mil.nga.giat.geowave.datastore.accumulo.AccumuloOperations; import mil.nga.giat.geowave.datastore.accumulo.BasicAccumuloOperations; import mil.nga.giat.geowave.datastore.accum... | import java.io.*; import mil.nga.giat.geowave.core.store.*; import mil.nga.giat.geowave.core.store.index.*; import mil.nga.giat.geowave.datastore.accumulo.*; import mil.nga.giat.geowave.datastore.accumulo.metadata.*; import mil.nga.giat.geowave.datastore.accumulo.query.*; import org.apache.accumulo.core.client.*; | [
"java.io",
"mil.nga.giat",
"org.apache.accumulo"
] | java.io; mil.nga.giat; org.apache.accumulo; | 203,264 |
WithReadLocations withoutReadReplication(Region region);
} | WithReadLocations withoutReadReplication(Region region); } | /**
* A georeplication location for the DocumentDB account.
* @param region the region for the location
* @return the next stage
*/ | A georeplication location for the DocumentDB account | withoutReadReplication | {
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-documentdb/src/main/java/com/microsoft/azure/management/documentdb/DocumentDBAccount.java",
"license": "mit",
"size": 11496
} | [
"com.microsoft.azure.management.resources.fluentcore.arm.Region"
] | import com.microsoft.azure.management.resources.fluentcore.arm.Region; | import com.microsoft.azure.management.resources.fluentcore.arm.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,835,500 |
public synchronized Relationship nextMostConsciousRelationship(Vertex type, Set<Vertex> ignoring, float min, boolean inverse) {
Collection<Relationship> relationships = getRelationships(type);
if (relationships == null) {
return null;
}
Relationship highest = null;
float highestLevel = 0;
float highes... | synchronized Relationship function(Vertex type, Set<Vertex> ignoring, float min, boolean inverse) { Collection<Relationship> relationships = getRelationships(type); if (relationships == null) { return null; } Relationship highest = null; float highestLevel = 0; float highestCorrectness = 0; for (Relationship relationsh... | /**
* Return the target vertex inversely/negatively related by the type, with the high consciousness level.
* The level is multiplied by the relationship correctness.
*/ | Return the target vertex inversely/negatively related by the type, with the high consciousness level. The level is multiplied by the relationship correctness | nextMostConsciousRelationship | {
"repo_name": "BOTlibre/BOTlibre",
"path": "micro-ai-engine/android/source/org/botlibre/knowledge/BasicVertex.java",
"license": "epl-1.0",
"size": 152940
} | [
"java.util.Collection",
"java.util.Set",
"java.util.logging.Level",
"org.botlibre.api.knowledge.Relationship",
"org.botlibre.api.knowledge.Vertex"
] | import java.util.Collection; import java.util.Set; import java.util.logging.Level; import org.botlibre.api.knowledge.Relationship; import org.botlibre.api.knowledge.Vertex; | import java.util.*; import java.util.logging.*; import org.botlibre.api.knowledge.*; | [
"java.util",
"org.botlibre.api"
] | java.util; org.botlibre.api; | 910,051 |
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
} | KeyNamePair function() { return new KeyNamePair(get_ID(), getName()); } | /** Get Record ID/ColumnName
@return ID/ColumnName pair
*/ | Get Record ID/ColumnName | getKeyNamePair | {
"repo_name": "pplatek/adempiere",
"path": "base/src/org/compiere/model/X_Test.java",
"license": "gpl-2.0",
"size": 13317
} | [
"org.compiere.util.KeyNamePair"
] | import org.compiere.util.KeyNamePair; | import org.compiere.util.*; | [
"org.compiere.util"
] | org.compiere.util; | 1,520,046 |
public static void registerMenuItem(JMenu menu) {
moduleMenus.add(menu);
}
| static void function(JMenu menu) { moduleMenus.add(menu); } | /**
* Add a new menu to the main toolbar.
*
* @param menu the menu to be added
*/ | Add a new menu to the main toolbar | registerMenuItem | {
"repo_name": "ckaestne/LEADT",
"path": "workspace/argouml_diagrams/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java",
"license": "gpl-3.0",
"size": 43960
} | [
"javax.swing.JMenu"
] | import javax.swing.JMenu; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 592,196 |
@Override
public TTransport getTransport(TTransport base) throws TTransportException {
WeakReference<TSaslServerTransport> ret = transportMap.get(base);
if (ret == null || ret.get() == null) {
LOGGER.debug("transport map does not contain key", base);
ret = new WeakReference<TSaslServ... | TTransport function(TTransport base) throws TTransportException { WeakReference<TSaslServerTransport> ret = transportMap.get(base); if (ret == null ret.get() == null) { LOGGER.debug(STR, base); ret = new WeakReference<TSaslServerTransport>(new TSaslServerTransport(serverDefinitionMap, base)); try { ret.get().open(); } ... | /**
* Get a new <code>TSaslServerTransport</code> instance, or reuse the
* existing one if a <code>TSaslServerTransport</code> has already been
* created before using the given <code>TTransport</code> as an underlying
* transport. This ensures that a given underlying transport instance
* receiv... | Get a new <code>TSaslServerTransport</code> instance, or reuse the existing one if a <code>TSaslServerTransport</code> has already been created before using the given <code>TTransport</code> as an underlying transport. This ensures that a given underlying transport instance receives the same <code>TSaslServerTransport<... | getTransport | {
"repo_name": "strava/thrift",
"path": "lib/java/src/org/apache/thrift/transport/TSaslServerTransport.java",
"license": "apache-2.0",
"size": 8533
} | [
"java.lang.ref.WeakReference"
] | import java.lang.ref.WeakReference; | import java.lang.ref.*; | [
"java.lang"
] | java.lang; | 342,426 |
public void setUrlPathHelper(UrlPathHelper urlPathHelper) {
Assert.notNull(urlPathHelper, "UrlPathHelper must not be null");
this.urlPathHelper = urlPathHelper;
} | void function(UrlPathHelper urlPathHelper) { Assert.notNull(urlPathHelper, STR); this.urlPathHelper = urlPathHelper; } | /**
* Set the UrlPathHelper to use to match FlashMap instances to requests.
*/ | Set the UrlPathHelper to use to match FlashMap instances to requests | setUrlPathHelper | {
"repo_name": "leogoing/spring_jeesite",
"path": "spring-webmvc-4.0/org/springframework/web/servlet/support/AbstractFlashMapManager.java",
"license": "apache-2.0",
"size": 8671
} | [
"org.springframework.util.Assert",
"org.springframework.web.util.UrlPathHelper"
] | import org.springframework.util.Assert; import org.springframework.web.util.UrlPathHelper; | import org.springframework.util.*; import org.springframework.web.util.*; | [
"org.springframework.util",
"org.springframework.web"
] | org.springframework.util; org.springframework.web; | 938,651 |
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(type);
dest.writeString(id);
if (metadata == null)
dest.writeInt(-1);
else {
dest.writeInt(metadata.size());
for (HashMap.Entry<String, String> entry : metadata.entr... | void function(Parcel dest, int flags) { dest.writeString(type); dest.writeString(id); if (metadata == null) dest.writeInt(-1); else { dest.writeInt(metadata.size()); for (HashMap.Entry<String, String> entry : metadata.entrySet()) { dest.writeString(entry.getKey()); dest.writeString(entry.getValue()); } } } | /**
* Writes the <code>AbstractObject</code> to a parcel.
*
* @param dest The parcel to which the application should be written.
* @param flags Additional flags about how the object should be written.
*/ | Writes the <code>AbstractObject</code> to a parcel | writeToParcel | {
"repo_name": "MD2Korg/mCerebrum-DataKitAPI",
"path": "datakitapi/src/main/java/org/md2k/datakitapi/source/AbstractObject.java",
"license": "bsd-2-clause",
"size": 5751
} | [
"android.os.Parcel",
"java.util.HashMap"
] | import android.os.Parcel; import java.util.HashMap; | import android.os.*; import java.util.*; | [
"android.os",
"java.util"
] | android.os; java.util; | 2,763,177 |
List<User> getPresentUsers(String locationId, String siteId); | List<User> getPresentUsers(String locationId, String siteId); | /**
* Access a List of users (User) now present in a location.
*
* @param locationId
* A presence location id.
* @param siteId
* A siteId (added when integrating PrivacyManager)
*
* @return The a List of users (User) now present in the location (may be empty).
*/ | Access a List of users (User) now present in a location | getPresentUsers | {
"repo_name": "ouit0408/sakai",
"path": "presence/presence-api/api/src/java/org/sakaiproject/presence/api/PresenceService.java",
"license": "apache-2.0",
"size": 4708
} | [
"java.util.List",
"org.sakaiproject.user.api.User"
] | import java.util.List; import org.sakaiproject.user.api.User; | import java.util.*; import org.sakaiproject.user.api.*; | [
"java.util",
"org.sakaiproject.user"
] | java.util; org.sakaiproject.user; | 1,127,768 |
void publish(Set<String> validResources, List<ExternalView> externalViews, T shardMap); | void publish(Set<String> validResources, List<ExternalView> externalViews, T shardMap); | /**
* Publish a shardMap of type T.
*/ | Publish a shardMap of type T | publish | {
"repo_name": "pinterest/rocksplicator",
"path": "cluster_management/src/main/java/com/pinterest/rocksplicator/publisher/ShardMapPublisher.java",
"license": "apache-2.0",
"size": 1113
} | [
"java.util.List",
"java.util.Set",
"org.apache.helix.model.ExternalView"
] | import java.util.List; import java.util.Set; import org.apache.helix.model.ExternalView; | import java.util.*; import org.apache.helix.model.*; | [
"java.util",
"org.apache.helix"
] | java.util; org.apache.helix; | 505,431 |
@Path("{hostName}/host_components")
public HostComponentService getHostComponentHandler(@PathParam("hostName") String hostName) {
return new HostComponentService(m_clusterName, hostName);
} | @Path(STR) HostComponentService function(@PathParam(STR) String hostName) { return new HostComponentService(m_clusterName, hostName); } | /**
* Get the host_components sub-resource.
*
* @param hostName host name
* @return the host_components service
*/ | Get the host_components sub-resource | getHostComponentHandler | {
"repo_name": "radicalbit/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java",
"license": "apache-2.0",
"size": 15855
} | [
"javax.ws.rs.Path",
"javax.ws.rs.PathParam"
] | import javax.ws.rs.Path; import javax.ws.rs.PathParam; | import javax.ws.rs.*; | [
"javax.ws"
] | javax.ws; | 2,294,678 |
private TypedNullConstant createStringNullExpr(int precision) {
return new TypedNullConstant(Types.withPrecision(MinorType.VARCHAR, TypeProtos.DataMode.OPTIONAL, precision));
}
} | TypedNullConstant function(int precision) { return new TypedNullConstant(Types.withPrecision(MinorType.VARCHAR, TypeProtos.DataMode.OPTIONAL, precision)); } } | /**
* Create nullable varchar major type with given precision
* and wraps it in typed null constant.
*
* @param precision precision value
* @return typed null constant instance
*/ | Create nullable varchar major type with given precision and wraps it in typed null constant | createStringNullExpr | {
"repo_name": "johnnywale/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java",
"license": "apache-2.0",
"size": 34691
} | [
"org.apache.drill.common.expression.TypedNullConstant",
"org.apache.drill.common.types.TypeProtos",
"org.apache.drill.common.types.Types"
] | import org.apache.drill.common.expression.TypedNullConstant; import org.apache.drill.common.types.TypeProtos; import org.apache.drill.common.types.Types; | import org.apache.drill.common.expression.*; import org.apache.drill.common.types.*; | [
"org.apache.drill"
] | org.apache.drill; | 1,022,288 |
private void writeUser(ZipOutputStream zout) throws IOException {
ZipEntry entry = new ZipEntry("user/");
zout.putNextEntry(entry);
zout.closeEntry();
List<User> allUser = userService.getUsers();
for (User user : allUser) {
try {
writeUser(user,... | void function(ZipOutputStream zout) throws IOException { ZipEntry entry = new ZipEntry("user/"); zout.putNextEntry(entry); zout.closeEntry(); List<User> allUser = userService.getUsers(); for (User user : allUser) { try { writeUser(user, zout); } catch (Exception e) { log.info(STR + user.getLogin()); e.printStackTrace()... | /**
* Create the items/ directory in the ZIP file and write all content item XML representations to it.
* @param items
* @param zout
* @throws IOException
*/ | Create the items/ directory in the ZIP file and write all content item XML representations to it | writeUser | {
"repo_name": "fregaham/KiWi",
"path": "src/action/kiwi/service/importexport/exporter/KiWiExporterImpl.java",
"license": "bsd-3-clause",
"size": 26314
} | [
"java.io.IOException",
"java.util.List",
"java.util.zip.ZipEntry",
"java.util.zip.ZipOutputStream",
"kiwi.model.user.User"
] | import java.io.IOException; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import kiwi.model.user.User; | import java.io.*; import java.util.*; import java.util.zip.*; import kiwi.model.user.*; | [
"java.io",
"java.util",
"kiwi.model.user"
] | java.io; java.util; kiwi.model.user; | 2,578,352 |
public static long readUnsignedInt(ByteBuffer buffer) {
return buffer.getInt() & 0xffffffffL;
} | static long function(ByteBuffer buffer) { return buffer.getInt() & 0xffffffffL; } | /**
* Read an unsigned integer from the current position in the buffer, incrementing the position by 4 bytes
*
* @param buffer The buffer to read from
* @return The integer read, as a long to avoid signedness
*/ | Read an unsigned integer from the current position in the buffer, incrementing the position by 4 bytes | readUnsignedInt | {
"repo_name": "lemonJun/TakinMQ",
"path": "takinmq-kclient/src/main/java/org/apache/kafka/common/utils/Utils.java",
"license": "apache-2.0",
"size": 29556
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,314,124 |
public void createHierarchy(String parent, String[] children) throws KeeperException {
String parentZNode = ZKUtil.joinZNode(hierarchyZNode, parent);
ZKUtil.createWithParents(zkw, parentZNode);
for (String child : children) {
ZKUtil.createWithParents(zkw, ZKUtil.joinZNode(parentZNode, child));
}... | void function(String parent, String[] children) throws KeeperException { String parentZNode = ZKUtil.joinZNode(hierarchyZNode, parent); ZKUtil.createWithParents(zkw, parentZNode); for (String child : children) { ZKUtil.createWithParents(zkw, ZKUtil.joinZNode(parentZNode, child)); } } | /**
* Creates the hierarchy.
*
* <pre>
* Parent | --child1 | --child2
* </pre>
*
* @param parent
* @param children
* @throws KeeperException
*/ | Creates the hierarchy. <code> Parent | --child1 | --child2 </code> | createHierarchy | {
"repo_name": "intel-hadoop/CSBT",
"path": "csbt-client/src/main/java/org/apache/hadoop/hbase/crosssite/CrossSiteZNodes.java",
"license": "apache-2.0",
"size": 33331
} | [
"org.apache.hadoop.hbase.zookeeper.ZKUtil",
"org.apache.zookeeper.KeeperException"
] | import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.zookeeper.KeeperException; | import org.apache.hadoop.hbase.zookeeper.*; import org.apache.zookeeper.*; | [
"org.apache.hadoop",
"org.apache.zookeeper"
] | org.apache.hadoop; org.apache.zookeeper; | 144,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.