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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@Deprecated public int go() throws IOException { try { return run(argv_); } catch (Exception ex) { throw new IOException(ex.getMessage()); } }
int function() throws IOException { try { return run(argv_); } catch (Exception ex) { throw new IOException(ex.getMessage()); } }
/** * This is the method that actually * intializes the job conf and submits the job * to the jobtracker * @throws IOException * @deprecated use {@link #run(String[])} instead. */
This is the method that actually intializes the job conf and submits the job to the jobtracker
go
{ "repo_name": "NJUJYB/disYarn", "path": "hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java", "license": "apache-2.0", "size": 41535 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
106,781
EList<ParameterTemplate> getParameterTemplates();
EList<ParameterTemplate> getParameterTemplates();
/** * Returns the value of the '<em><b>Parameter Templates</b></em>' containment reference list. * The list contents are of type {@link com.odcgroup.page.metamodel.ParameterTemplate}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Parameter Templates</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Parameter Templates</em>' containment reference list. * @see com.odcgroup.page.metamodel.MetaModelPackage#getEventTemplate_ParameterTemplates() * @model containment="true" * @generated */
Returns the value of the 'Parameter Templates' containment reference list. The list contents are of type <code>com.odcgroup.page.metamodel.ParameterTemplate</code>. If the meaning of the 'Parameter Templates' containment reference list isn't clear, there really should be more of a description here...
getParameterTemplates
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/page/core/com.odcgroup.page.metamodel/src/generated/java/com/odcgroup/page/metamodel/EventTemplate.java", "license": "epl-1.0", "size": 4171 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
80,978
private ClassOrInterfaceTypeDetails getControllerDetails(JavaType controller) { ClassOrInterfaceTypeDetails existing = getTypeLocationService() .getTypeDetails(controller); Validate.notNull(existing, "Can't get Type details"); return existing; }
ClassOrInterfaceTypeDetails function(JavaType controller) { ClassOrInterfaceTypeDetails existing = getTypeLocationService() .getTypeDetails(controller); Validate.notNull(existing, STR); return existing; }
/** * This method gets class details * * @param controller * @return */
This method gets class details
getControllerDetails
{ "repo_name": "osroca/gvnix", "path": "addon-monitoring/src/main/java/org/gvnix/addon/monitoring/MonitoringOperationsImpl.java", "license": "gpl-3.0", "size": 42288 }
[ "org.apache.commons.lang3.Validate", "org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails", "org.springframework.roo.model.JavaType" ]
import org.apache.commons.lang3.Validate; import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails; import org.springframework.roo.model.JavaType;
import org.apache.commons.lang3.*; import org.springframework.roo.classpath.details.*; import org.springframework.roo.model.*;
[ "org.apache.commons", "org.springframework.roo" ]
org.apache.commons; org.springframework.roo;
2,878,823
public boolean isTranslationsDisabled() { return bundleTranslations == TriState.NO; }
boolean function() { return bundleTranslations == TriState.NO; }
/** * Returns whether translations were explicitly disabled. */
Returns whether translations were explicitly disabled
isTranslationsDisabled
{ "repo_name": "iamthearm/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java", "license": "apache-2.0", "size": 12738 }
[ "com.google.devtools.common.options.TriState" ]
import com.google.devtools.common.options.TriState;
import com.google.devtools.common.options.*;
[ "com.google.devtools" ]
com.google.devtools;
283,033
public synchronized void add(int index, int[] elemIds, long scn) throws Exception { store.expandCapacity(index); byte[] upd = null; byte[] dat = store.get(index); if (dat == null) { upd = new byte[NUM_BYTES_IN_INT * elemIds.length]; ByteBuffer bb = ByteBuffer.wrap(upd); for(int i = 0; i < elemIds.length; i++) { bb.putInt(elemIds[i]); } } else { ByteBuffer bb = ByteBuffer.wrap(dat); int safeLen = dat.length - (dat.length % NUM_BYTES_IN_INT); upd = new byte[safeLen + NUM_BYTES_IN_INT * elemIds.length]; bb = ByteBuffer.wrap(upd); bb.put(dat, 0, safeLen); for(int i = 0; i < elemIds.length; i++) { bb.putInt(elemIds[i]); } } // Update store store.set(index, upd, scn); internalPersist(scn); }
synchronized void function(int index, int[] elemIds, long scn) throws Exception { store.expandCapacity(index); byte[] upd = null; byte[] dat = store.get(index); if (dat == null) { upd = new byte[NUM_BYTES_IN_INT * elemIds.length]; ByteBuffer bb = ByteBuffer.wrap(upd); for(int i = 0; i < elemIds.length; i++) { bb.putInt(elemIds[i]); } } else { ByteBuffer bb = ByteBuffer.wrap(dat); int safeLen = dat.length - (dat.length % NUM_BYTES_IN_INT); upd = new byte[safeLen + NUM_BYTES_IN_INT * elemIds.length]; bb = ByteBuffer.wrap(upd); bb.put(dat, 0, safeLen); for(int i = 0; i < elemIds.length; i++) { bb.putInt(elemIds[i]); } } store.set(index, upd, scn); internalPersist(scn); }
/** * Adds an array of element IDs to the specified <code>index</code> * * @param index - the array store index * @param elemIds - the array of element IDs * @param scn - the monotonically increasing System Change Number (SCN) * @throws Exception */
Adds an array of element IDs to the specified <code>index</code>
add
{ "repo_name": "linkedin/cleo", "path": "src/main/java/cleo/search/store/KratiArrayStoreInts.java", "license": "apache-2.0", "size": 6798 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
863,037
public ResourceEnvRefType<SessionBeanType<T>> createResourceEnvRef() { return new ResourceEnvRefTypeImpl<SessionBeanType<T>>(this, "resource-env-ref", childNode); }
ResourceEnvRefType<SessionBeanType<T>> function() { return new ResourceEnvRefTypeImpl<SessionBeanType<T>>(this, STR, childNode); }
/** * Creates a new <code>resource-env-ref</code> element * @return the new created instance of <code>ResourceEnvRefType<SessionBeanType<T>></code> */
Creates a new <code>resource-env-ref</code> element
createResourceEnvRef
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar32/SessionBeanTypeImpl.java", "license": "epl-1.0", "size": 107840 }
[ "org.jboss.shrinkwrap.descriptor.api.ejbjar32.SessionBeanType", "org.jboss.shrinkwrap.descriptor.api.javaee7.ResourceEnvRefType", "org.jboss.shrinkwrap.descriptor.impl.javaee7.ResourceEnvRefTypeImpl" ]
import org.jboss.shrinkwrap.descriptor.api.ejbjar32.SessionBeanType; import org.jboss.shrinkwrap.descriptor.api.javaee7.ResourceEnvRefType; import org.jboss.shrinkwrap.descriptor.impl.javaee7.ResourceEnvRefTypeImpl;
import org.jboss.shrinkwrap.descriptor.api.ejbjar32.*; import org.jboss.shrinkwrap.descriptor.api.javaee7.*; import org.jboss.shrinkwrap.descriptor.impl.javaee7.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,761,657
public void setServiceStatus(DIR.ServiceStatus status) throws OSDDrainException { ServiceSet sSet = null; try { sSet = dirClient.xtreemfs_service_get_by_uuid(null, RPCAuthentication.authNone, RPCAuthentication.userService, osdUUID.toString()); } catch (Exception e) { Logging.logError(Logging.LEVEL_WARN, this, e); throw new OSDDrainException(e.getMessage(), ErrorState.SET_SERVICE_STATUS); } if (sSet.getServicesCount() == 0) { System.out.println("no OSD with UUID " + this.osdUUID + " registered at directory service"); System.exit(1); } Service serv = sSet.getServices(0); String serviceStatus = KeyValuePairs.getValue(serv.getData().getDataList(), HeartbeatThread.STATUS_ATTR); if (serviceStatus == null) { System.out.println("Service " + this.osdUUID + " is not registered at DIR."); System.exit(3); } if (Integer.valueOf(serviceStatus) == status.getNumber()) { Logging.logMessage(Logging.LEVEL_DEBUG, Logging.Category.tool, status, "Service %s is already in status %s ", this.osdUUID, status.name()); return; } // Build new Service with status= SERVICE_STATUS_TO_BE_REMOVED and // update DIR List<KeyValuePair> data = serv.getData().getDataList(); List<KeyValuePair> data2 = new LinkedList<KeyValuePair>(); for (KeyValuePair kvp : data) { data2.add(KeyValuePair.newBuilder().setKey(kvp.getKey()).setValue(kvp.getValue()).build()); } KeyValuePairs.putValue(data2, HeartbeatThread.STATUS_ATTR, Integer.toString(status.ordinal())); KeyValuePairs.putValue(data2, HeartbeatThread.DO_NOT_SET_LAST_UPDATED, Boolean.toString(true)); ServiceDataMap dataMap = ServiceDataMap.newBuilder().addAllData(data2).build(); serv = serv.toBuilder().setData(dataMap).build(); try { dirClient.xtreemfs_service_register(null, RPCAuthentication.authNone, RPCAuthentication.userService, serv); } catch (Exception e) { if (Logging.isDebug()) { Logging.logError(Logging.LEVEL_WARN, this, e); } throw new OSDDrainException(e.getMessage(), ErrorState.SET_SERVICE_STATUS); } } /** * Returns a {@link LinkedList} of all fileIDs the OSD which will be removed has * * @return {@link LinkedList}
void function(DIR.ServiceStatus status) throws OSDDrainException { ServiceSet sSet = null; try { sSet = dirClient.xtreemfs_service_get_by_uuid(null, RPCAuthentication.authNone, RPCAuthentication.userService, osdUUID.toString()); } catch (Exception e) { Logging.logError(Logging.LEVEL_WARN, this, e); throw new OSDDrainException(e.getMessage(), ErrorState.SET_SERVICE_STATUS); } if (sSet.getServicesCount() == 0) { System.out.println(STR + this.osdUUID + STR); System.exit(1); } Service serv = sSet.getServices(0); String serviceStatus = KeyValuePairs.getValue(serv.getData().getDataList(), HeartbeatThread.STATUS_ATTR); if (serviceStatus == null) { System.out.println(STR + this.osdUUID + STR); System.exit(3); } if (Integer.valueOf(serviceStatus) == status.getNumber()) { Logging.logMessage(Logging.LEVEL_DEBUG, Logging.Category.tool, status, STR, this.osdUUID, status.name()); return; } List<KeyValuePair> data = serv.getData().getDataList(); List<KeyValuePair> data2 = new LinkedList<KeyValuePair>(); for (KeyValuePair kvp : data) { data2.add(KeyValuePair.newBuilder().setKey(kvp.getKey()).setValue(kvp.getValue()).build()); } KeyValuePairs.putValue(data2, HeartbeatThread.STATUS_ATTR, Integer.toString(status.ordinal())); KeyValuePairs.putValue(data2, HeartbeatThread.DO_NOT_SET_LAST_UPDATED, Boolean.toString(true)); ServiceDataMap dataMap = ServiceDataMap.newBuilder().addAllData(data2).build(); serv = serv.toBuilder().setData(dataMap).build(); try { dirClient.xtreemfs_service_register(null, RPCAuthentication.authNone, RPCAuthentication.userService, serv); } catch (Exception e) { if (Logging.isDebug()) { Logging.logError(Logging.LEVEL_WARN, this, e); } throw new OSDDrainException(e.getMessage(), ErrorState.SET_SERVICE_STATUS); } } /** * Returns a {@link LinkedList} of all fileIDs the OSD which will be removed has * * @return {@link LinkedList}
/** * Sets a new status to the Service with uuid. Throws Exception if something went wrong and does nothing * if the current status is equivalent to the new status. * * @param uuid * @param status * @throws Exception */
Sets a new status to the Service with uuid. Throws Exception if something went wrong and does nothing if the current status is equivalent to the new status
setServiceStatus
{ "repo_name": "jswrenn/xtreemfs", "path": "java/servers/src/org/xtreemfs/osd/drain/OSDDrain.java", "license": "bsd-3-clause", "size": 58891 }
[ "java.util.LinkedList", "java.util.List", "org.xtreemfs.common.HeartbeatThread", "org.xtreemfs.common.KeyValuePairs", "org.xtreemfs.foundation.logging.Logging", "org.xtreemfs.foundation.pbrpc.client.RPCAuthentication", "org.xtreemfs.osd.drain.OSDDrainException", "org.xtreemfs.pbrpc.generatedinterfaces.DIR", "org.xtreemfs.pbrpc.generatedinterfaces.GlobalTypes" ]
import java.util.LinkedList; import java.util.List; import org.xtreemfs.common.HeartbeatThread; import org.xtreemfs.common.KeyValuePairs; import org.xtreemfs.foundation.logging.Logging; import org.xtreemfs.foundation.pbrpc.client.RPCAuthentication; import org.xtreemfs.osd.drain.OSDDrainException; import org.xtreemfs.pbrpc.generatedinterfaces.DIR; import org.xtreemfs.pbrpc.generatedinterfaces.GlobalTypes;
import java.util.*; import org.xtreemfs.common.*; import org.xtreemfs.foundation.logging.*; import org.xtreemfs.foundation.pbrpc.client.*; import org.xtreemfs.osd.drain.*; import org.xtreemfs.pbrpc.generatedinterfaces.*;
[ "java.util", "org.xtreemfs.common", "org.xtreemfs.foundation", "org.xtreemfs.osd", "org.xtreemfs.pbrpc" ]
java.util; org.xtreemfs.common; org.xtreemfs.foundation; org.xtreemfs.osd; org.xtreemfs.pbrpc;
2,669,946
Vector3d delta = new Vector3d(); delta.sub(destination,poseNow); acceleration=Math.min(settings.getMaxAcceleration(), acceleration); double len = delta.length(); double seconds = len / feedrate; int segments = (int)Math.ceil(seconds * settings.getSegmentsPerSecond()); int maxSeg = (int)Math.ceil(len / settings.getMinSegmentLength()); if(segments>maxSeg) segments=maxSeg; if(segments<1) segments=1; Vector3d deltaSegment = new Vector3d(delta); deltaSegment.scale(1.0/segments); Vector3d temp = new Vector3d(poseNow); while(--segments>0) { temp.add(deltaSegment); bufferSegment(temp,feedrate,acceleration,deltaSegment); } bufferSegment(destination,feedrate,acceleration,deltaSegment); }
Vector3d delta = new Vector3d(); delta.sub(destination,poseNow); acceleration=Math.min(settings.getMaxAcceleration(), acceleration); double len = delta.length(); double seconds = len / feedrate; int segments = (int)Math.ceil(seconds * settings.getSegmentsPerSecond()); int maxSeg = (int)Math.ceil(len / settings.getMinSegmentLength()); if(segments>maxSeg) segments=maxSeg; if(segments<1) segments=1; Vector3d deltaSegment = new Vector3d(delta); deltaSegment.scale(1.0/segments); Vector3d temp = new Vector3d(poseNow); while(--segments>0) { temp.add(deltaSegment); bufferSegment(temp,feedrate,acceleration,deltaSegment); } bufferSegment(destination,feedrate,acceleration,deltaSegment); }
/** * Add this destination to the queue and attempt to optimize travel between destinations. * @param destination destination (mm) * @param feedrate (mm/s) * @param acceleration (mm/s/s) */
Add this destination to the queue and attempt to optimize travel between destinations
bufferLine
{ "repo_name": "MarginallyClever/Makelangelo-software", "path": "src/main/java/com/marginallyclever/makelangelo/plotter/marlinSimulation/MarlinSimulation.java", "license": "gpl-2.0", "size": 19456 }
[ "javax.vecmath.Vector3d" ]
import javax.vecmath.Vector3d;
import javax.vecmath.*;
[ "javax.vecmath" ]
javax.vecmath;
953,515
int getPrefixMatchLinePointer(final int offset, final CharSequence prefix, final String fileName) throws IOException;
int getPrefixMatchLinePointer(final int offset, final CharSequence prefix, final String fileName) throws IOException;
/** * Search for a line whose index word <em>begins with</em> {@code prefix} (case insensitive). * @return The file offset of the start of the matching line, or {@code -1} if * no such line exists. * @throws IOException */
Search for a line whose index word begins with prefix (case insensitive)
getPrefixMatchLinePointer
{ "repo_name": "nezda/yawni", "path": "api/src/main/java/org/yawni/wordnet/FileManagerInterface.java", "license": "apache-2.0", "size": 7646 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,690,955
public static <C extends TreeNode<C>> boolean contains( List<C> nodeList, Class cl) { for (C node: nodeList) if (node.contains(cl)) return true; return false; }
static <C extends TreeNode<C>> boolean function( List<C> nodeList, Class cl) { for (C node: nodeList) if (node.contains(cl)) return true; return false; }
/** * Return true if any node in nodeList contains children of class cl. */
Return true if any node in nodeList contains children of class cl
contains
{ "repo_name": "imay/palo", "path": "fe/src/main/java/org/apache/doris/common/TreeNode.java", "license": "apache-2.0", "size": 6925 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,287,823
public List<String> getPDFPaths() { int n = getDisplayTabCount(); pdf.clear(); for (int i = 0; i<n; i++) { String path = getDisplayTab(i).getPath(); if (path.toLowerCase().endsWith(".pdf")) { //$NON-NLS-1$ pdf.add(path); } } return pdf; }
List<String> function() { int n = getDisplayTabCount(); pdf.clear(); for (int i = 0; i<n; i++) { String path = getDisplayTab(i).getPath(); if (path.toLowerCase().endsWith(".pdf")) { pdf.add(path); } } return pdf; }
/** * Gets the list of pdf documents associated with this node. * @return a list of PDF documents (may be empty) */
Gets the list of pdf documents associated with this node
getPDFPaths
{ "repo_name": "OpenSourcePhysics/osp", "path": "src/org/opensourcephysics/tools/LaunchNode.java", "license": "gpl-3.0", "size": 58827 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,952,951
public void setActiveModul ( final String modulName ) { final Modul modul = ((View) this).base.getModul( modulName ); if ( modul != null && ( ((View) this).activeModul == null || !((View) this).activeModul.equals( modul ) ) ) { // Toolbar if ( ((View) this).activeModul != null ) { ((View) this).pnToolbar.remove( ((View) this).activeModul.getView().getToolbar() ); } ((View) this).pnToolbar.add( modul.getView().getToolbar(), BorderLayout.NORTH ); ((View) this).pnToolbar.repaint(); // Sidebar if ( ((View) this).activeModul != null ) { ((View) this).pnSidepanel.remove( ((View) this).activeModul.getView().getSidepanel() ); } ((View) this).pnSidepanel.add( modul.getView().getSidepanel(), BorderLayout.CENTER ); ((View) this).lbLoadedModulSidepanel.setText( modul.getName() ); // Main-Panel ((View) this).spContent.setRightComponent( modul.getView().getMainContent() ); // Statusbar ((View) this).statusbar.modulToStatusbar( modul ); // ((View) this).spContent.setDividerLocation( Math.max( 152, ((View) this).spContent.getLastDividerLocation() ) ); ((View) this).activeModul = modul; } }
void function ( final String modulName ) { final Modul modul = ((View) this).base.getModul( modulName ); if ( modul != null && ( ((View) this).activeModul == null !((View) this).activeModul.equals( modul ) ) ) { if ( ((View) this).activeModul != null ) { ((View) this).pnToolbar.remove( ((View) this).activeModul.getView().getToolbar() ); } ((View) this).pnToolbar.add( modul.getView().getToolbar(), BorderLayout.NORTH ); ((View) this).pnToolbar.repaint(); if ( ((View) this).activeModul != null ) { ((View) this).pnSidepanel.remove( ((View) this).activeModul.getView().getSidepanel() ); } ((View) this).pnSidepanel.add( modul.getView().getSidepanel(), BorderLayout.CENTER ); ((View) this).lbLoadedModulSidepanel.setText( modul.getName() ); ((View) this).spContent.setRightComponent( modul.getView().getMainContent() ); ((View) this).statusbar.modulToStatusbar( modul ); ((View) this).spContent.setDividerLocation( Math.max( 152, ((View) this).spContent.getLastDividerLocation() ) ); ((View) this).activeModul = modul; } }
/** * Set an modul on focus. * * @param modulName The modul which will be active. */
Set an modul on focus
setActiveModul
{ "repo_name": "SergiyKolesnikov/fuji", "path": "examples/Devolution/build/Everything/View.java", "license": "lgpl-3.0", "size": 11449 }
[ "java.awt.BorderLayout" ]
import java.awt.BorderLayout;
import java.awt.*;
[ "java.awt" ]
java.awt;
5,914
public CSVFile report(Assignment<Exam, ExamPlacement> assignment) { CSVFile csv = new CSVFile(); csv.setHeader(new CSVField[] { new CSVField("Section/Course"), new CSVField("Period"), new CSVField("Day"), new CSVField("Time"), new CSVField("Room"), new CSVField("Student"), new CSVField("Type"), new CSVField("Section/Course"), new CSVField("Period"), new CSVField("Time"), new CSVField("Room"), new CSVField("Distance") }); boolean isDayBreakBackToBack = ((StudentBackToBackConflicts)iModel.getCriterion(StudentBackToBackConflicts.class)).isDayBreakBackToBack(); double backToBackDistance = ((StudentDistanceBackToBackConflicts)iModel.getCriterion(StudentDistanceBackToBackConflicts.class)).getBackToBackDistance(); TreeSet<ExamOwner> courseSections = new TreeSet<ExamOwner>(); for (Exam exam : iModel.variables()) { courseSections.addAll(getOwners(exam)); } for (ExamOwner cs : courseSections) { Exam exam = cs.getExam(); ExamPlacement placement = assignment.getValue(exam); if (placement == null) continue; String roomsThisExam = ""; for (ExamRoomPlacement room : placement.getRoomPlacements()) { if (roomsThisExam.length() > 0) roomsThisExam += ", "; roomsThisExam += room.getName(); }
CSVFile function(Assignment<Exam, ExamPlacement> assignment) { CSVFile csv = new CSVFile(); csv.setHeader(new CSVField[] { new CSVField(STR), new CSVField(STR), new CSVField("Day"), new CSVField("Time"), new CSVField("Room"), new CSVField(STR), new CSVField("Type"), new CSVField(STR), new CSVField(STR), new CSVField("Time"), new CSVField("Room"), new CSVField(STR) }); boolean isDayBreakBackToBack = ((StudentBackToBackConflicts)iModel.getCriterion(StudentBackToBackConflicts.class)).isDayBreakBackToBack(); double backToBackDistance = ((StudentDistanceBackToBackConflicts)iModel.getCriterion(StudentDistanceBackToBackConflicts.class)).getBackToBackDistance(); TreeSet<ExamOwner> courseSections = new TreeSet<ExamOwner>(); for (Exam exam : iModel.variables()) { courseSections.addAll(getOwners(exam)); } for (ExamOwner cs : courseSections) { Exam exam = cs.getExam(); ExamPlacement placement = assignment.getValue(exam); if (placement == null) continue; String roomsThisExam = STR, "; roomsThisExam += room.getName(); }
/** * generate report * @param assignment current assignment * @return resultant report */
generate report
report
{ "repo_name": "UniTime/cpsolver", "path": "src/org/cpsolver/exam/reports/ExamStudentConflictsBySectionCourse.java", "license": "lgpl-3.0", "size": 13062 }
[ "java.util.TreeSet", "org.cpsolver.exam.criteria.StudentBackToBackConflicts", "org.cpsolver.exam.criteria.StudentDistanceBackToBackConflicts", "org.cpsolver.exam.model.Exam", "org.cpsolver.exam.model.ExamOwner", "org.cpsolver.exam.model.ExamPlacement", "org.cpsolver.ifs.assignment.Assignment", "org.cpsolver.ifs.util.CSVFile" ]
import java.util.TreeSet; import org.cpsolver.exam.criteria.StudentBackToBackConflicts; import org.cpsolver.exam.criteria.StudentDistanceBackToBackConflicts; import org.cpsolver.exam.model.Exam; import org.cpsolver.exam.model.ExamOwner; import org.cpsolver.exam.model.ExamPlacement; import org.cpsolver.ifs.assignment.Assignment; import org.cpsolver.ifs.util.CSVFile;
import java.util.*; import org.cpsolver.exam.criteria.*; import org.cpsolver.exam.model.*; import org.cpsolver.ifs.assignment.*; import org.cpsolver.ifs.util.*;
[ "java.util", "org.cpsolver.exam", "org.cpsolver.ifs" ]
java.util; org.cpsolver.exam; org.cpsolver.ifs;
2,325,409
azure .eventHubs() .manager() .serviceClient() .getEventHubs() .getAuthorizationRuleWithResponse( "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE); }
azure .eventHubs() .manager() .serviceClient() .getEventHubs() .getAuthorizationRuleWithResponse( STR, STR, STR, STR, Context.NONE); }
/** * Sample code: EventHubAuthorizationRuleGet. * * @param azure The entry point for accessing resource management APIs in Azure. */
Sample code: EventHubAuthorizationRuleGet
eventHubAuthorizationRuleGet
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetAuthorizationRuleSamples.java", "license": "mit", "size": 1082 }
[ "com.azure.core.util.Context" ]
import com.azure.core.util.Context;
import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
987,578
public void testExtendsAuraApplicationEvents() throws Exception { ArrayList<String> failures = new ArrayList<String>(); verifyExtendsAuraEvents("APPLICATION", "aura:doneRendering", failures); verifyExtendsAuraEvents("APPLICATION", "aura:doneWaiting", failures); verifyExtendsAuraEvents("APPLICATION", "aura:locationChange", failures); verifyExtendsAuraEvents("APPLICATION", "aura:noAccess", failures); verifyExtendsAuraEvents("APPLICATION", "aura:systemError", failures); verifyExtendsAuraEvents("APPLICATION", "aura:waiting", failures); if (!failures.isEmpty()) { String message = "\n"; for (int i = 0; i < failures.size(); i++) { message += failures.get(i); if (i != failures.size() - 1) { message += ",\n"; } } fail("Test failed with " + failures.size() + " errors:" + message); } }
void function() throws Exception { ArrayList<String> failures = new ArrayList<String>(); verifyExtendsAuraEvents(STR, STR, failures); verifyExtendsAuraEvents(STR, STR, failures); verifyExtendsAuraEvents(STR, STR, failures); verifyExtendsAuraEvents(STR, STR, failures); verifyExtendsAuraEvents(STR, STR, failures); verifyExtendsAuraEvents(STR, STR, failures); if (!failures.isEmpty()) { String message = "\n"; for (int i = 0; i < failures.size(); i++) { message += failures.get(i); if (i != failures.size() - 1) { message += ",\n"; } } fail(STR + failures.size() + STR + message); } }
/** * Verify Extending an Application Event works * @throws Exception */
Verify Extending an Application Event works
testExtendsAuraApplicationEvents
{ "repo_name": "lhong375/aura", "path": "aura-impl/src/test/java/org/auraframework/impl/root/parser/handler/EventAccessAttributeEnforcementTest.java", "license": "apache-2.0", "size": 5597 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,025,637
@Override protected VterminalConfig mergeConfig(VterminalConfig cur) { String desc = config.getDescription(); if (desc == null) { desc = cur.getDescription(); } return createConfig(desc); }
VterminalConfig function(VterminalConfig cur) { String desc = config.getDescription(); if (desc == null) { desc = cur.getDescription(); } return createConfig(desc); }
/** * Merge the vTerminal configuration specified by the RPC with the current * configuration. * * @param cur The current configuration of the target vTerminal. * @return A {@link VterminalConfig} instance. */
Merge the vTerminal configuration specified by the RPC with the current configuration
mergeConfig
{ "repo_name": "opendaylight/vtn", "path": "manager/implementation/src/main/java/org/opendaylight/vtn/manager/internal/vnode/UpdateVterminalTask.java", "license": "epl-1.0", "size": 8529 }
[ "org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.vterminal.rev150907.vtn.vterminal.info.VterminalConfig" ]
import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.vterminal.rev150907.vtn.vterminal.info.VterminalConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.vterminal.rev150907.vtn.vterminal.info.*;
[ "org.opendaylight.yang" ]
org.opendaylight.yang;
1,991,967
@SuppressWarnings("fallthrough") final String inferSymbol(final char operation, final Unit<?> other) { String ts = symbol; boolean inverse = false; boolean allowExponents = false; switch (operation) { case DIVIDE: inverse = (ts != null && ts.isEmpty()); // Fall through case MULTIPLY: allowExponents = true; break; } if (inverse || isValidSymbol(ts, allowExponents, allowExponents)) { if (other != null) { final String os = other.getSymbol(); if (isValidSymbol(os, allowExponents, false)) { if (inverse) ts = SystemUnit.ONE; return (ts + operation + os).intern(); } } else if (!allowExponents) { assert Characters.isSuperScript(operation) : operation; return (ts + operation).intern(); } } return null; }
@SuppressWarnings(STR) final String inferSymbol(final char operation, final Unit<?> other) { String ts = symbol; boolean inverse = false; boolean allowExponents = false; switch (operation) { case DIVIDE: inverse = (ts != null && ts.isEmpty()); case MULTIPLY: allowExponents = true; break; } if (inverse isValidSymbol(ts, allowExponents, allowExponents)) { if (other != null) { final String os = other.getSymbol(); if (isValidSymbol(os, allowExponents, false)) { if (inverse) ts = SystemUnit.ONE; return (ts + operation + os).intern(); } } else if (!allowExponents) { assert Characters.isSuperScript(operation) : operation; return (ts + operation).intern(); } } return null; }
/** * Infers a symbol for a unit resulting from an arithmetic operation between two units. * The left operand is {@code this} unit and the right operand is the {@code other} unit. * * @param operation {@link #MULTIPLY}, {@link #DIVIDE} or an exponent. * @param other the left operand used in the operation, or {@code null} if {@code operation} is an exponent. * @return the symbol for the operation result, or {@code null} if no suggestion. */
Infers a symbol for a unit resulting from an arithmetic operation between two units. The left operand is this unit and the right operand is the other unit
inferSymbol
{ "repo_name": "apache/sis", "path": "core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java", "license": "apache-2.0", "size": 22474 }
[ "javax.measure.Unit", "org.apache.sis.util.Characters" ]
import javax.measure.Unit; import org.apache.sis.util.Characters;
import javax.measure.*; import org.apache.sis.util.*;
[ "javax.measure", "org.apache.sis" ]
javax.measure; org.apache.sis;
2,435,850
protected Task createIterationWrapper(final String description) { final GroupStep group = new GroupStep(); group.setProject(getProject()); group.setTaskName("iteration wrapper"); group.setLocation(getLocation()); group.setOwningTarget(getOwningTarget()); group.setDescription(description); final RuntimeConfigurable wrapper = new RuntimeConfigurable(group, "group"); wrapper.setAttribute("description", description); // copy the children: both the UnknownElement and the associated RuntimeConfigurable final Enumeration e = getRuntimeConfigurableWrapper().getChildren(); while (e.hasMoreElements()) { final RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement(); final UnknownElement unknownElement = (UnknownElement) r.getProxy(); final UnknownElement copy = copy(unknownElement); group.addTask(copy); wrapper.addChild(copy.getWrapper()); } return group; }
Task function(final String description) { final GroupStep group = new GroupStep(); group.setProject(getProject()); group.setTaskName(STR); group.setLocation(getLocation()); group.setOwningTarget(getOwningTarget()); group.setDescription(description); final RuntimeConfigurable wrapper = new RuntimeConfigurable(group, "group"); wrapper.setAttribute(STR, description); final Enumeration e = getRuntimeConfigurableWrapper().getChildren(); while (e.hasMoreElements()) { final RuntimeConfigurable r = (RuntimeConfigurable) e.nextElement(); final UnknownElement unknownElement = (UnknownElement) r.getProxy(); final UnknownElement copy = copy(unknownElement); group.addTask(copy); wrapper.addChild(copy.getWrapper()); } return group; }
/** * Create a new task wrapping the tasks of this wrapper to execute them * @param description the description for the wrapper task * @return the task holding the subtasks */
Create a new task wrapping the tasks of this wrapper to execute them
createIterationWrapper
{ "repo_name": "lukecampbell/webtest", "path": "src/main/java/com/canoo/webtest/steps/control/MultipleExecutionStepContainer.java", "license": "apache-2.0", "size": 3063 }
[ "java.util.Enumeration", "org.apache.tools.ant.RuntimeConfigurable", "org.apache.tools.ant.Task", "org.apache.tools.ant.UnknownElement" ]
import java.util.Enumeration; import org.apache.tools.ant.RuntimeConfigurable; import org.apache.tools.ant.Task; import org.apache.tools.ant.UnknownElement;
import java.util.*; import org.apache.tools.ant.*;
[ "java.util", "org.apache.tools" ]
java.util; org.apache.tools;
1,395,313
@Deprecated public Type inOut() { return setExchangePattern(ExchangePattern.InOut); }
Type function() { return setExchangePattern(ExchangePattern.InOut); }
/** * <a href="http://camel.apache.org/exchange-pattern.html">ExchangePattern:</a> * set the exchange's ExchangePattern {@link ExchangePattern} to be InOut * * @return the builder * @deprecated use {@link #setExchangePattern(org.apache.camel.ExchangePattern)} instead */
ExchangePattern: set the exchange's ExchangePattern <code>ExchangePattern</code> to be InOut
inOut
{ "repo_name": "gilfernandes/camel", "path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java", "license": "apache-2.0", "size": 165071 }
[ "org.apache.camel.ExchangePattern" ]
import org.apache.camel.ExchangePattern;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
2,369,417
public void setTarget(Set<String> target) { ColumnDescription columndesc = new ColumnDescription(ManagerColumn.TARGET.columnName(), "setTarget", VersionNum.VERSION100); super.setDataHandler(columndesc, target); }
void function(Set<String> target) { ColumnDescription columndesc = new ColumnDescription(ManagerColumn.TARGET.columnName(), STR, VersionNum.VERSION100); super.setDataHandler(columndesc, target); }
/** * Add a Column entity which column name is "target" to the Row entity of * attributes. * @param target the column data which column name is "target" */
Add a Column entity which column name is "target" to the Row entity of attributes
setTarget
{ "repo_name": "kuangrewawa/OnosFw", "path": "ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/table/Manager.java", "license": "apache-2.0", "size": 10757 }
[ "java.util.Set", "org.onosproject.ovsdb.rfc.tableservice.ColumnDescription" ]
import java.util.Set; import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
import java.util.*; import org.onosproject.ovsdb.rfc.tableservice.*;
[ "java.util", "org.onosproject.ovsdb" ]
java.util; org.onosproject.ovsdb;
2,509,372
public void setRealm(@Nullable final String realm) { this.realm = realm; }
void function(@Nullable final String realm) { this.realm = realm; }
/** * Specifies the realm to use for the GSSAPI bind request. * * @param realm The realm to use for the GSSAPI bind request. It may be * {@code null} if the request should attempt to use the * default realm from the system configuration. */
Specifies the realm to use for the GSSAPI bind request
setRealm
{ "repo_name": "UnboundID/ldapsdk", "path": "src/com/unboundid/ldap/sdk/GSSAPIBindRequestProperties.java", "license": "gpl-2.0", "size": 37081 }
[ "com.unboundid.util.Nullable" ]
import com.unboundid.util.Nullable;
import com.unboundid.util.*;
[ "com.unboundid.util" ]
com.unboundid.util;
1,294,659
void checkUserIsSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws UserNotAdminException;
void checkUserIsSecurityAdmin(PerunSession sess, SecurityTeam securityTeam, User user) throws UserNotAdminException;
/** * check if user is security admin of given security team * throw exception if is not * * @param sess * @param securityTeam * @param user * @throws UserNotAdminException * @throws InternalErrorException */
check if user is security admin of given security team throw exception if is not
checkUserIsSecurityAdmin
{ "repo_name": "zlamalp/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/SecurityTeamsManagerBl.java", "license": "bsd-2-clause", "size": 9400 }
[ "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.SecurityTeam", "cz.metacentrum.perun.core.api.User", "cz.metacentrum.perun.core.api.exceptions.UserNotAdminException" ]
import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.SecurityTeam; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.exceptions.UserNotAdminException;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
130,303
void storeCSAR(Csar csar, Path tmpPath);
void storeCSAR(Csar csar, Path tmpPath);
/** * Store an CSAR into the repository. This method will perform a move of the temporary file to save IO disk operations * * @param csar The archive to store. * @param tmpPath the path to the temporary directory where the CSAR is located. The file will be moved to its new location inside the repository. */
Store an CSAR into the repository. This method will perform a move of the temporary file to save IO disk operations
storeCSAR
{ "repo_name": "alien4cloud/alien4cloud", "path": "alien4cloud-core/src/main/java/org/alien4cloud/tosca/catalog/repository/ICsarRepositry.java", "license": "apache-2.0", "size": 1888 }
[ "java.nio.file.Path", "org.alien4cloud.tosca.model.Csar" ]
import java.nio.file.Path; import org.alien4cloud.tosca.model.Csar;
import java.nio.file.*; import org.alien4cloud.tosca.model.*;
[ "java.nio", "org.alien4cloud.tosca" ]
java.nio; org.alien4cloud.tosca;
151,650
public static String getStringForWeatherCondition(Context context, int weatherId) { // Based on weather code data found at: // http://bugs.openweathermap.org/projects/api/wiki/Weather_Condition_Codes int stringId; if (weatherId >= 200 && weatherId <= 232) { stringId = R.string.condition_2xx; } else if (weatherId >= 300 && weatherId <= 321) { stringId = R.string.condition_3xx; } else switch (weatherId) { case 500: stringId = R.string.condition_500; break; case 501: stringId = R.string.condition_501; break; case 502: stringId = R.string.condition_502; break; case 503: stringId = R.string.condition_503; break; case 504: stringId = R.string.condition_504; break; case 511: stringId = R.string.condition_511; break; case 520: stringId = R.string.condition_520; break; case 531: stringId = R.string.condition_531; break; case 600: stringId = R.string.condition_600; break; case 601: stringId = R.string.condition_601; break; case 602: stringId = R.string.condition_602; break; case 611: stringId = R.string.condition_611; break; case 612: stringId = R.string.condition_612; break; case 615: stringId = R.string.condition_615; break; case 616: stringId = R.string.condition_616; break; case 620: stringId = R.string.condition_620; break; case 621: stringId = R.string.condition_621; break; case 622: stringId = R.string.condition_622; break; case 701: stringId = R.string.condition_701; break; case 711: stringId = R.string.condition_711; break; case 721: stringId = R.string.condition_721; break; case 731: stringId = R.string.condition_731; break; case 741: stringId = R.string.condition_741; break; case 751: stringId = R.string.condition_751; break; case 761: stringId = R.string.condition_761; break; case 762: stringId = R.string.condition_762; break; case 771: stringId = R.string.condition_771; break; case 781: stringId = R.string.condition_781; break; case 800: stringId = R.string.condition_800; break; case 801: stringId = R.string.condition_801; break; case 802: stringId = R.string.condition_802; break; case 803: stringId = R.string.condition_803; break; case 804: stringId = R.string.condition_804; break; case 900: stringId = R.string.condition_900; break; case 901: stringId = R.string.condition_901; break; case 902: stringId = R.string.condition_902; break; case 903: stringId = R.string.condition_903; break; case 904: stringId = R.string.condition_904; break; case 905: stringId = R.string.condition_905; break; case 906: stringId = R.string.condition_906; break; case 951: stringId = R.string.condition_951; break; case 952: stringId = R.string.condition_952; break; case 953: stringId = R.string.condition_953; break; case 954: stringId = R.string.condition_954; break; case 955: stringId = R.string.condition_955; break; case 956: stringId = R.string.condition_956; break; case 957: stringId = R.string.condition_957; break; case 958: stringId = R.string.condition_958; break; case 959: stringId = R.string.condition_959; break; case 960: stringId = R.string.condition_960; break; case 961: stringId = R.string.condition_961; break; case 962: stringId = R.string.condition_962; break; default: return context.getString(R.string.condition_unknown, weatherId); } return context.getString(stringId); }
static String function(Context context, int weatherId) { int stringId; if (weatherId >= 200 && weatherId <= 232) { stringId = R.string.condition_2xx; } else if (weatherId >= 300 && weatherId <= 321) { stringId = R.string.condition_3xx; } else switch (weatherId) { case 500: stringId = R.string.condition_500; break; case 501: stringId = R.string.condition_501; break; case 502: stringId = R.string.condition_502; break; case 503: stringId = R.string.condition_503; break; case 504: stringId = R.string.condition_504; break; case 511: stringId = R.string.condition_511; break; case 520: stringId = R.string.condition_520; break; case 531: stringId = R.string.condition_531; break; case 600: stringId = R.string.condition_600; break; case 601: stringId = R.string.condition_601; break; case 602: stringId = R.string.condition_602; break; case 611: stringId = R.string.condition_611; break; case 612: stringId = R.string.condition_612; break; case 615: stringId = R.string.condition_615; break; case 616: stringId = R.string.condition_616; break; case 620: stringId = R.string.condition_620; break; case 621: stringId = R.string.condition_621; break; case 622: stringId = R.string.condition_622; break; case 701: stringId = R.string.condition_701; break; case 711: stringId = R.string.condition_711; break; case 721: stringId = R.string.condition_721; break; case 731: stringId = R.string.condition_731; break; case 741: stringId = R.string.condition_741; break; case 751: stringId = R.string.condition_751; break; case 761: stringId = R.string.condition_761; break; case 762: stringId = R.string.condition_762; break; case 771: stringId = R.string.condition_771; break; case 781: stringId = R.string.condition_781; break; case 800: stringId = R.string.condition_800; break; case 801: stringId = R.string.condition_801; break; case 802: stringId = R.string.condition_802; break; case 803: stringId = R.string.condition_803; break; case 804: stringId = R.string.condition_804; break; case 900: stringId = R.string.condition_900; break; case 901: stringId = R.string.condition_901; break; case 902: stringId = R.string.condition_902; break; case 903: stringId = R.string.condition_903; break; case 904: stringId = R.string.condition_904; break; case 905: stringId = R.string.condition_905; break; case 906: stringId = R.string.condition_906; break; case 951: stringId = R.string.condition_951; break; case 952: stringId = R.string.condition_952; break; case 953: stringId = R.string.condition_953; break; case 954: stringId = R.string.condition_954; break; case 955: stringId = R.string.condition_955; break; case 956: stringId = R.string.condition_956; break; case 957: stringId = R.string.condition_957; break; case 958: stringId = R.string.condition_958; break; case 959: stringId = R.string.condition_959; break; case 960: stringId = R.string.condition_960; break; case 961: stringId = R.string.condition_961; break; case 962: stringId = R.string.condition_962; break; default: return context.getString(R.string.condition_unknown, weatherId); } return context.getString(stringId); }
/** * Helper method to provide the string according to the weather * condition id returned by the OpenWeatherMap call. * @param context Android context * @param weatherId from OpenWeatherMap API response * @return string for the weather condition. null if no relation is found. */
Helper method to provide the string according to the weather condition id returned by the OpenWeatherMap call
getStringForWeatherCondition
{ "repo_name": "mladenbabic/Advanced_Android_Development_Wear", "path": "app/src/main/java/com/example/android/sunshine/app/Utility.java", "license": "apache-2.0", "size": 25868 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,759,960
public static Document createDocument() { Document result = new Document(); result.setContent(new DocumentContent()); return result; }
static Document function() { Document result = new Document(); result.setContent(new DocumentContent()); return result; }
/** * Creates the document. * * @return the document. */
Creates the document
createDocument
{ "repo_name": "lorislab/appky", "path": "appky-application/src/main/java/org/lorislab/appky/application/factory/ApplicationObjectFactory.java", "license": "apache-2.0", "size": 9591 }
[ "org.lorislab.appky.application.model.Document", "org.lorislab.appky.application.model.DocumentContent" ]
import org.lorislab.appky.application.model.Document; import org.lorislab.appky.application.model.DocumentContent;
import org.lorislab.appky.application.model.*;
[ "org.lorislab.appky" ]
org.lorislab.appky;
1,722,844
public int mkd(String pathname) throws IOException { return sendCommand(FTPCmd.MKD, pathname); }
int function(String pathname) throws IOException { return sendCommand(FTPCmd.MKD, pathname); }
/*** * A convenience method to send the FTP MKD command to the server, * receive the reply, and return the reply code. * * @param pathname The pathname of the new directory to create. * @return The reply code received from the server. * @exception FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/
A convenience method to send the FTP MKD command to the server, receive the reply, and return the reply code
mkd
{ "repo_name": "gcolin/syncfolders", "path": "src/main/java/org/apache/commons/net/ftp/FTP.java", "license": "apache-2.0", "size": 76110 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
974,609
@Override public Enumeration<Option> listOptions() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option("\tnumber of clusters. (default = 2).", "N", 1, "-N <num>")); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
Enumeration<Option> function() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option(STR, "N", 1, STR)); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */
Returns an enumeration describing the available options
listOptions
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "src/weka/clusterers/FarthestFirst.java", "license": "gpl-3.0", "size": 17794 }
[ "java.util.Collections", "java.util.Enumeration", "java.util.Vector" ]
import java.util.Collections; import java.util.Enumeration; import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
296,690
public String[] nextKeys(int bufferSize) throws IOException { return getKeys(null, true, bufferSize); }
String[] function(int bufferSize) throws IOException { return getKeys(null, true, bufferSize); }
/** * This retrieves keys from the chunks until their accumulated size is less * than or equal to @param bufferSize * * @param bufferSize * -- the limit of sizes of keys (in bytes) * @return array of valid keys whose aggregated size are less than @param * bufferSize * @throws IOException */
This retrieves keys from the chunks until their accumulated size is less than or equal to @param bufferSize
nextKeys
{ "repo_name": "neuraldump/true-north", "path": "src/tn/common/fs/TextFileChannelImpl.java", "license": "mit", "size": 12664 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
815,779
public void writeBytesReference(@Nullable BytesReference bytes) throws IOException { if (bytes == null) { writeVInt(0); return; } writeVInt(bytes.length()); bytes.writeTo(this); }
void function(@Nullable BytesReference bytes) throws IOException { if (bytes == null) { writeVInt(0); return; } writeVInt(bytes.length()); bytes.writeTo(this); }
/** * Writes the bytes reference, including a length header. */
Writes the bytes reference, including a length header
writeBytesReference
{ "repo_name": "achow/elasticsearch", "path": "core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java", "license": "apache-2.0", "size": 19049 }
[ "java.io.IOException", "org.elasticsearch.common.Nullable", "org.elasticsearch.common.bytes.BytesReference" ]
import java.io.IOException; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.bytes.BytesReference;
import java.io.*; import org.elasticsearch.common.*; import org.elasticsearch.common.bytes.*;
[ "java.io", "org.elasticsearch.common" ]
java.io; org.elasticsearch.common;
1,142,877
public Enumeration<TreePath> getVisiblePathsFrom(TreePath path) { TreeStateNode node = getNodeForPath(path, true, false); if(node != null) { return new VisibleTreeStateNodeEnumeration(node); } return null; }
Enumeration<TreePath> function(TreePath path) { TreeStateNode node = getNodeForPath(path, true, false); if(node != null) { return new VisibleTreeStateNodeEnumeration(node); } return null; }
/** * Returns an <code>Enumerator</code> that increments over the visible paths * starting at the passed in location. The ordering of the enumeration * is based on how the paths are displayed. * * @param path the location in the <code>TreePath</code> to start * @return an <code>Enumerator</code> that increments over the visible * paths */
Returns an <code>Enumerator</code> that increments over the visible paths starting at the passed in location. The ordering of the enumeration is based on how the paths are displayed
getVisiblePathsFrom
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java", "license": "gpl-2.0", "size": 63231 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
653,934
public InputStream getBodyAsStream() throws IOException { return bodyAsStream; }
InputStream function() throws IOException { return bodyAsStream; }
/** * Get a stream from which to read the body of the HTTP request or response. * This is designed to support efficient streaming of a large message. * The caller must close the returned stream, to release the underlying * resources such as the TCP connection for an HTTP response. * * @return a stream from which to read the body, or null to indicate there * is no body. */
Get a stream from which to read the body of the HTTP request or response. This is designed to support efficient streaming of a large message. The caller must close the returned stream, to release the underlying resources such as the TCP connection for an HTTP response
getBodyAsStream
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/oauth/net/oauth/OAuthMessage.java", "license": "gpl-2.0", "size": 13676 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,414,169
public void checkCollisions() { if (modules.size() <= 0) { throw new IllegalStateException("No collision modules are registered!"); } for (Iterator<CollisionModule> iter = modules.iterator(); iter.hasNext();) { checkCollisions0(iter.next()); } }
void function() { if (modules.size() <= 0) { throw new IllegalStateException(STR); } for (Iterator<CollisionModule> iter = modules.iterator(); iter.hasNext();) { checkCollisions0(iter.next()); } }
/** * Checks all possible collisions, using all registered modules and invoking * proper listeners. * * @throws IllegalStateException if no collision modules were registered. */
Checks all possible collisions, using all registered modules and invoking proper listeners
checkCollisions
{ "repo_name": "molszewski/dante", "path": "module/Simulation/src/net/java/dante/sim/engine/collision/CollisionDetector.java", "license": "lgpl-3.0", "size": 7394 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,441,754
@ServiceMethod(returns = ReturnType.SINGLE) public Response<Void> deleteWithResponse(String resourceGroupName, String actionGroupName, Context context) { return deleteWithResponseAsync(resourceGroupName, actionGroupName, context).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) Response<Void> function(String resourceGroupName, String actionGroupName, Context context) { return deleteWithResponseAsync(resourceGroupName, actionGroupName, context).block(); }
/** * Delete an action group. * * @param resourceGroupName The name of the resource group. * @param actionGroupName The name of the action group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */
Delete an action group
deleteWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/ActionGroupsClientImpl.java", "license": "mit", "size": 60371 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
2,197,080
public boolean deleteDocument(String pool, String docUid) { Collection<DocumentStorage> c = registry.getDocumentStoragesOfPool(pool); if ( c == null ) { log.warn("Storage pool '"+pool+"' does not exist!"); return false; } return deleteDocumentfromStorages(docUid, c); }
boolean function(String pool, String docUid) { Collection<DocumentStorage> c = registry.getDocumentStoragesOfPool(pool); if ( c == null ) { log.warn(STR+pool+STR); return false; } return deleteDocumentfromStorages(docUid, c); }
/** * Delete document. * Deletes the document with docUid from given pool. * Documents stored on other pools are NOT deleted! * * @param docUid * @return true if at least one document is deleted from given pool */
Delete document. Deletes the document with docUid from given pool. Documents stored on other pools are NOT deleted
deleteDocument
{ "repo_name": "medicayun/medicayundicom", "path": "dcm4chee-docstore/tags/DCM4CHEE_XDS_1_0_1/dcm4chee-docstore-store/src/main/java/org/dcm4chee/docstore/DocumentStore.java", "license": "apache-2.0", "size": 16161 }
[ "java.util.Collection", "org.dcm4chee.docstore.spi.DocumentStorage" ]
import java.util.Collection; import org.dcm4chee.docstore.spi.DocumentStorage;
import java.util.*; import org.dcm4chee.docstore.spi.*;
[ "java.util", "org.dcm4chee.docstore" ]
java.util; org.dcm4chee.docstore;
2,426,863
@Override public SplashPotion fromMC(EntityPotion entityMC) { return new SplashPotion(entityMC); } } // instance utilities
SplashPotion function(EntityPotion entityMC) { return new SplashPotion(entityMC); } }
/** This method is used to create a new instance of {@link Entity Corundum Entity} to wrap around the given {@link Minecraft net.minecraft.entity.Entity}. * * @param entityMC * is the Minecraft Entity that will wrapped with a new {@link Entity Corundum Entity} <tt>Object</tt>. * @return a new Entity created using the given {@link net.minecraft.entity.Entity Minecraft Entity}. */
This method is used to create a new instance of <code>Entity Corundum Entity</code> to wrap around the given <code>Minecraft net.minecraft.entity.Entity</code>
fromMC
{ "repo_name": "vitruvianAnalogy/Corundum", "path": "Corundum/org/corundummc/entities/nonliving/projectiles/throwable/SplashPotion.java", "license": "mit", "size": 1667 }
[ "net.minecraft.entity.projectile.EntityPotion" ]
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.entity.projectile.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
182,394
public OpenMapRealMatrix subtract(OpenMapRealMatrix m) { // Safety check. MatrixUtils.checkAdditionCompatible(this, m); final OpenMapRealMatrix out = new OpenMapRealMatrix(this); for (OpenIntToDoubleHashMap.Iterator iterator = m.entries.iterator(); iterator.hasNext();) { iterator.advance(); final int row = iterator.key() / columns; final int col = iterator.key() - row * columns; out.setEntry(row, col, getEntry(row, col) - iterator.value()); } return out; }
OpenMapRealMatrix function(OpenMapRealMatrix m) { MatrixUtils.checkAdditionCompatible(this, m); final OpenMapRealMatrix out = new OpenMapRealMatrix(this); for (OpenIntToDoubleHashMap.Iterator iterator = m.entries.iterator(); iterator.hasNext();) { iterator.advance(); final int row = iterator.key() / columns; final int col = iterator.key() - row * columns; out.setEntry(row, col, getEntry(row, col) - iterator.value()); } return out; }
/** * Subtract {@code m} from this matrix. * * @param m Matrix to be subtracted. * @return {@code this} - {@code m}. * @throws org.apache.commons.math3.exception.DimensionMismatchException * if {@code m} is not the same size as this matrix. */
Subtract m from this matrix
subtract
{ "repo_name": "SpoonLabs/astor", "path": "examples/math_20/src/main/java/org/apache/commons/math3/linear/OpenMapRealMatrix.java", "license": "gpl-2.0", "size": 9370 }
[ "org.apache.commons.math3.util.OpenIntToDoubleHashMap" ]
import org.apache.commons.math3.util.OpenIntToDoubleHashMap;
import org.apache.commons.math3.util.*;
[ "org.apache.commons" ]
org.apache.commons;
700,707
public synchronized <T extends EventListener> void add(Class<T> t, T l) { if (l==null) { // In an ideal world, we would do an assertion here // to help developers know they are probably doing // something wrong return; } if (!t.isInstance(l)) { throw new IllegalArgumentException("Listener " + l + " is not of type " + t); } if (listenerList == NULL_ARRAY) { // if this is the first listener added, // initialize the lists listenerList = new Object[] { t, l }; } else { // Otherwise copy the array and add the new listener int i = listenerList.length; Object[] tmp = new Object[i+2]; System.arraycopy(listenerList, 0, tmp, 0, i); tmp[i] = t; tmp[i+1] = l; listenerList = tmp; } }
synchronized <T extends EventListener> void function(Class<T> t, T l) { if (l==null) { return; } if (!t.isInstance(l)) { throw new IllegalArgumentException(STR + l + STR + t); } if (listenerList == NULL_ARRAY) { listenerList = new Object[] { t, l }; } else { int i = listenerList.length; Object[] tmp = new Object[i+2]; System.arraycopy(listenerList, 0, tmp, 0, i); tmp[i] = t; tmp[i+1] = l; listenerList = tmp; } }
/** * Adds the listener as a listener of the specified type. * @param t the type of the listener to be added * @param l the listener to be added */
Adds the listener as a listener of the specified type
add
{ "repo_name": "thawee/musixmate", "path": "library/jaudiotagger226/src/main/java/org/jaudiotagger/utils/tree/EventListenerList.java", "license": "apache-2.0", "size": 9101 }
[ "java.util.EventListener" ]
import java.util.EventListener;
import java.util.*;
[ "java.util" ]
java.util;
2,362,764
@SuppressWarnings("unchecked") public static WebAsset publishAsset(WebAsset currWebAsset) throws DotStateException, DotDataException, DotSecurityException { Logger.debug(WebAssetFactory.class, "Publishing asset!!!!"); // gets the identifier for this asset Identifier identifier = APILocator.getIdentifierAPI().find(currWebAsset); // gets the current working asset WebAsset workingwebasset = null; // gets the current working asset workingwebasset = (WebAsset) APILocator.getVersionableAPI().findWorkingVersion(identifier, APILocator.getUserAPI().getSystemUser(), false); if (!InodeUtils.isSet(workingwebasset.getInode())) { workingwebasset = currWebAsset; } Logger.debug(WebAssetFactory.class, "workingwebasset=" + workingwebasset.getInode()); WebAsset livewebasset = null; // gets the current working asset livewebasset = (WebAsset) APILocator.getVersionableAPI().findLiveVersion(identifier, APILocator.getUserAPI().getSystemUser(), false); if(workingwebasset.isDeleted()){ throw new DotStateException("You may not publish deleted assets!!!"); } // sets new working to live APILocator.getVersionableAPI().setLive(workingwebasset); workingwebasset.setModDate(new java.util.Date()); // persists the webasset HibernateUtil.saveOrUpdate(workingwebasset); Logger.debug(WebAssetFactory.class, "HibernateUtil.saveOrUpdate(workingwebasset)"); return livewebasset; }
@SuppressWarnings(STR) static WebAsset function(WebAsset currWebAsset) throws DotStateException, DotDataException, DotSecurityException { Logger.debug(WebAssetFactory.class, STR); Identifier identifier = APILocator.getIdentifierAPI().find(currWebAsset); WebAsset workingwebasset = null; workingwebasset = (WebAsset) APILocator.getVersionableAPI().findWorkingVersion(identifier, APILocator.getUserAPI().getSystemUser(), false); if (!InodeUtils.isSet(workingwebasset.getInode())) { workingwebasset = currWebAsset; } Logger.debug(WebAssetFactory.class, STR + workingwebasset.getInode()); WebAsset livewebasset = null; livewebasset = (WebAsset) APILocator.getVersionableAPI().findLiveVersion(identifier, APILocator.getUserAPI().getSystemUser(), false); if(workingwebasset.isDeleted()){ throw new DotStateException(STR); } APILocator.getVersionableAPI().setLive(workingwebasset); workingwebasset.setModDate(new java.util.Date()); HibernateUtil.saveOrUpdate(workingwebasset); Logger.debug(WebAssetFactory.class, STR); return livewebasset; }
/** * This method is odd. You send it an asset, but that may not be the one * that get published. The method will get the identifer of the asset you * send it and find the working version of the asset and make that the live * version. * * @param currWebAsset * This asset's identifier will be used to find the "working" * asset. * @return This method returns the OLD live asset or null. Wierd. * @throws DotSecurityException * @throws DotDataException */
This method is odd. You send it an asset, but that may not be the one that get published. The method will get the identifer of the asset you send it and find the working version of the asset and make that the live version
publishAsset
{ "repo_name": "ggonzales/ksl", "path": "src/com/dotmarketing/factories/WebAssetFactory.java", "license": "gpl-3.0", "size": 79551 }
[ "com.dotmarketing.beans.Identifier", "com.dotmarketing.beans.WebAsset", "com.dotmarketing.business.APILocator", "com.dotmarketing.business.DotStateException", "com.dotmarketing.db.HibernateUtil", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.dotmarketing.util.InodeUtils", "com.dotmarketing.util.Logger", "java.util.Date" ]
import com.dotmarketing.beans.Identifier; import com.dotmarketing.beans.WebAsset; import com.dotmarketing.business.APILocator; import com.dotmarketing.business.DotStateException; import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.util.InodeUtils; import com.dotmarketing.util.Logger; import java.util.Date;
import com.dotmarketing.beans.*; import com.dotmarketing.business.*; import com.dotmarketing.db.*; import com.dotmarketing.exception.*; import com.dotmarketing.util.*; import java.util.*;
[ "com.dotmarketing.beans", "com.dotmarketing.business", "com.dotmarketing.db", "com.dotmarketing.exception", "com.dotmarketing.util", "java.util" ]
com.dotmarketing.beans; com.dotmarketing.business; com.dotmarketing.db; com.dotmarketing.exception; com.dotmarketing.util; java.util;
1,488,925
public static Object[] readAll(InputStream stream) throws Exception { ObjectInputStream ois; Vector<Object> result; if (!(stream instanceof BufferedInputStream)) stream = new BufferedInputStream(stream); ois = new ObjectInputStream(stream); result = new Vector<Object>(); try { while (true) { result.add(ois.readObject()); } } catch (IOException e) { // ignored } ois.close(); return result.toArray(new Object[result.size()]); }
static Object[] function(InputStream stream) throws Exception { ObjectInputStream ois; Vector<Object> result; if (!(stream instanceof BufferedInputStream)) stream = new BufferedInputStream(stream); ois = new ObjectInputStream(stream); result = new Vector<Object>(); try { while (true) { result.add(ois.readObject()); } } catch (IOException e) { } ois.close(); return result.toArray(new Object[result.size()]); }
/** * deserializes from the given stream and returns the object from it. * * @param stream the stream to deserialize from * @return the deserialized object * @throws Exception if deserialization fails */
deserializes from the given stream and returns the object from it
readAll
{ "repo_name": "sp4x/kd-cloud", "path": "weka-stripped/src/main/java/weka/core/SerializationHelper.java", "license": "agpl-3.0", "size": 10364 }
[ "java.io.BufferedInputStream", "java.io.IOException", "java.io.InputStream", "java.io.ObjectInputStream", "java.util.Vector" ]
import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.util.Vector;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,365,649
public int getNumberOfRegistrators() { Node metaNode = this.document.getElementsByTagName( "number-of-registrators").item(0); if (metaNode == null) { return 0; } if (!metaNode.getTextContent().equals("")) { return Integer.valueOf(metaNode.getTextContent()); } else { return 0; } }
int function() { Node metaNode = this.document.getElementsByTagName( STR).item(0); if (metaNode == null) { return 0; } if (!metaNode.getTextContent().equals("")) { return Integer.valueOf(metaNode.getTextContent()); } else { return 0; } }
/** * Get the current number of registrators in the represented event * * @return Current number of registrators */
Get the current number of registrators in the represented event
getNumberOfRegistrators
{ "repo_name": "Novanoid/Tourney", "path": "Application/src/usspg31/tourney/model/filemanagement/MetaDocument.java", "license": "gpl-3.0", "size": 3960 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
357,597
private void validateOrderNumber(DBconnection conn) throws SQLException, InvalidActionException { try { conn.setQuery("SELECT COUNT(*) from Orders where order_number = ?"); conn.setQueryVariable(1, get_order_number()); ResultSet results = conn.getResultSet(); if (results.next()) { if (results.getInt(1) > 0) { throw new InvalidActionException("Cannot store order with " + "order_number: " + get_order_number() + " because order_number " + "already exists"); } } } finally { conn.releaseResources(); } }
void function(DBconnection conn) throws SQLException, InvalidActionException { try { conn.setQuery(STR); conn.setQueryVariable(1, get_order_number()); ResultSet results = conn.getResultSet(); if (results.next()) { if (results.getInt(1) > 0) { throw new InvalidActionException(STR + STR + get_order_number() + STR + STR); } } } finally { conn.releaseResources(); } }
/** * Validates object to ensure that same order number is not uses twice. * @param conn the JDBC connection wrapper * @throws SQLException when there is a database problem * * @throws InvalidActionException if order number is stored twice */
Validates object to ensure that same order number is not uses twice
validateOrderNumber
{ "repo_name": "tair/tairwebapp", "path": "src/org/tair/tfc/TfcOrders.java", "license": "gpl-3.0", "size": 31263 }
[ "java.sql.ResultSet", "java.sql.SQLException", "org.tair.utilities.InvalidActionException" ]
import java.sql.ResultSet; import java.sql.SQLException; import org.tair.utilities.InvalidActionException;
import java.sql.*; import org.tair.utilities.*;
[ "java.sql", "org.tair.utilities" ]
java.sql; org.tair.utilities;
2,103,685
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
void function(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
/** * Create contents of the button bar. * @param parent */
Create contents of the button bar
createButtonsForButtonBar
{ "repo_name": "DaveVoorhis/Rel", "path": "DBrowser/src/org/reldb/dbrowser/ui/content/rel/var/grids/RvaEditorDialog.java", "license": "apache-2.0", "size": 2100 }
[ "org.eclipse.jface.dialogs.IDialogConstants", "org.eclipse.swt.widgets.Composite" ]
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swt.widgets.Composite;
import org.eclipse.jface.dialogs.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.jface", "org.eclipse.swt" ]
org.eclipse.jface; org.eclipse.swt;
1,638,929
private void fetchFlowEntry() { // Simple keys are allowed after ','. this.allowSimpleKey = true; // Reset possible simple key on the current level. removePossibleSimpleKey(); // Add FLOW-ENTRY. Mark startMark = reader.getMark(); reader.forward(); Mark endMark = reader.getMark(); Token token = new FlowEntryToken(startMark, endMark); this.tokens.add(token); }
void function() { this.allowSimpleKey = true; removePossibleSimpleKey(); Mark startMark = reader.getMark(); reader.forward(); Mark endMark = reader.getMark(); Token token = new FlowEntryToken(startMark, endMark); this.tokens.add(token); }
/** * Fetch an entry in the flow style. Flow-style entries occur either * immediately after the start of a collection, or else after a comma. * * @see http://www.yaml.org/spec/1.1/#id863975 */
Fetch an entry in the flow style. Flow-style entries occur either immediately after the start of a collection, or else after a comma
fetchFlowEntry
{ "repo_name": "PRECISE/ROSLab", "path": "lib/snakeyaml-src/src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java", "license": "apache-2.0", "size": 82647 }
[ "org.yaml.snakeyaml.error.Mark", "org.yaml.snakeyaml.tokens.FlowEntryToken", "org.yaml.snakeyaml.tokens.Token" ]
import org.yaml.snakeyaml.error.Mark; import org.yaml.snakeyaml.tokens.FlowEntryToken; import org.yaml.snakeyaml.tokens.Token;
import org.yaml.snakeyaml.error.*; import org.yaml.snakeyaml.tokens.*;
[ "org.yaml.snakeyaml" ]
org.yaml.snakeyaml;
1,356,467
void onError(final Displayer displayer, ClientRuntimeError error);
void onError(final Displayer displayer, ClientRuntimeError error);
/** * Invoked when some error occurs. * @param displayer The Displayer instance event comes from. * @param error The error instance. */
Invoked when some error occurs
onError
{ "repo_name": "dgutierr/dashbuilder", "path": "dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/DisplayerListener.java", "license": "apache-2.0", "size": 3419 }
[ "org.dashbuilder.common.client.error.ClientRuntimeError" ]
import org.dashbuilder.common.client.error.ClientRuntimeError;
import org.dashbuilder.common.client.error.*;
[ "org.dashbuilder.common" ]
org.dashbuilder.common;
216,789
public synchronized void addOldEntry(Tradable t) throws Exception { if (oldEntries.get(t.getPrice()) == null) { ArrayList<Tradable> newTrades = new ArrayList<>(); oldEntries.put(t.getPrice(), newTrades); t.setCancelledVolume(t.getRemainingVolume()); t.setRemainingVolume(0); } else { ArrayList<Tradable> tradables = oldEntries.get(t.getPrice()); tradables.add(t); } }
synchronized void function(Tradable t) throws Exception { if (oldEntries.get(t.getPrice()) == null) { ArrayList<Tradable> newTrades = new ArrayList<>(); oldEntries.put(t.getPrice(), newTrades); t.setCancelledVolume(t.getRemainingVolume()); t.setRemainingVolume(0); } else { ArrayList<Tradable> tradables = oldEntries.get(t.getPrice()); tradables.add(t); } }
/** * This method will add the tradable passed in to the old Entries hash map. * * @param t tradable to be added to old entries * @throws Exception */
This method will add the tradable passed in to the old Entries hash map
addOldEntry
{ "repo_name": "highlanderkev/StockExVirtuoso", "path": "src/book/ProductBook.java", "license": "mit", "size": 16804 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
538,912
public static boolean isSAMLAuthenticationRequestValidityPeriodEnabled() { return Boolean.parseBoolean(IdentityUtil.getProperty(SAMLSSOConstants .SAML2_AUTHENTICATION_REQUEST_VALIDITY_PERIOD_ENABLED)); }
static boolean function() { return Boolean.parseBoolean(IdentityUtil.getProperty(SAMLSSOConstants .SAML2_AUTHENTICATION_REQUEST_VALIDITY_PERIOD_ENABLED)); }
/** * Check whether SAML Authentication request validity period enabled * @return */
Check whether SAML Authentication request validity period enabled
isSAMLAuthenticationRequestValidityPeriodEnabled
{ "repo_name": "wso2-extensions/identity-inbound-auth-saml", "path": "components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java", "license": "apache-2.0", "size": 115944 }
[ "org.wso2.carbon.identity.core.util.IdentityUtil", "org.wso2.carbon.identity.sso.saml.SAMLSSOConstants" ]
import org.wso2.carbon.identity.core.util.IdentityUtil; import org.wso2.carbon.identity.sso.saml.SAMLSSOConstants;
import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.identity.sso.saml.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
2,234,095
public Future<Void> updateTopic(String newTopic);
Future<Void> function(String newTopic);
/** * Updates the topic of the channel. If you want to update the name and * position too, use {@link #update(String, String, int)}. Otherwise the * first update will be overridden (except you wait for it to finish using * {@link Future#get()}). * * @param newTopic * The new topic of the channel. * @return A future which tells us whether the update was successful or not. */
Updates the topic of the channel. If you want to update the name and position too, use <code>#update(String, String, int)</code>. Otherwise the first update will be overridden (except you wait for it to finish using <code>Future#get()</code>)
updateTopic
{ "repo_name": "shawishi/Javacord", "path": "src/main/java/de/btobastian/javacord/entities/Channel.java", "license": "lgpl-3.0", "size": 6521 }
[ "java.util.concurrent.Future" ]
import java.util.concurrent.Future;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
8,120
@SuppressWarnings("rawtypes") @Override public Object getAdapter(Class key) { if (key.equals(IContentOutlinePage.class)) { return showOutlineView() ? getContentOutlinePage() : null; } else if (key.equals(IPropertySheetPage.class)) { return getPropertySheetPage(); } else if (key.equals(IGotoMarker.class)) { return this; } else { return super.getAdapter(key); } }
@SuppressWarnings(STR) Object function(Class key) { if (key.equals(IContentOutlinePage.class)) { return showOutlineView() ? getContentOutlinePage() : null; } else if (key.equals(IPropertySheetPage.class)) { return getPropertySheetPage(); } else if (key.equals(IGotoMarker.class)) { return this; } else { return super.getAdapter(key); } }
/** * This is how the framework determines which interfaces we implement. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This is how the framework determines which interfaces we implement.
getAdapter
{ "repo_name": "adbrucker/SecureBPMN", "path": "designer/src/org.activiti.designer.model.editor/src/org/eclipse/dd/di/presentation/DiEditor.java", "license": "apache-2.0", "size": 46094 }
[ "org.eclipse.ui.ide.IGotoMarker", "org.eclipse.ui.views.contentoutline.IContentOutlinePage", "org.eclipse.ui.views.properties.IPropertySheetPage" ]
import org.eclipse.ui.ide.IGotoMarker; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.ide.*; import org.eclipse.ui.views.contentoutline.*; import org.eclipse.ui.views.properties.*;
[ "org.eclipse.ui" ]
org.eclipse.ui;
60,639
int insertSelective(Blog record);
int insertSelective(Blog record);
/** * This method was generated by MyBatis Generator. This method corresponds to the database table BLOG * @mbg.generated Thu Aug 01 13:39:48 CST 2019 */
This method was generated by MyBatis Generator. This method corresponds to the database table BLOG
insertSelective
{ "repo_name": "alphatan/workspace_java", "path": "spring-boot-web-mybatis-h2database-flyway-http2-demo/src/main/java/com/at/springboot/mybatis/mapper/BlogMapper.java", "license": "apache-2.0", "size": 2819 }
[ "com.at.springboot.mybatis.po.Blog" ]
import com.at.springboot.mybatis.po.Blog;
import com.at.springboot.mybatis.po.*;
[ "com.at.springboot" ]
com.at.springboot;
1,499,455
public boolean hasEmptyFields(Container aTop, String message) { boolean result = hasEmptyFields(aTop); if (result) { if (message.equals("")) { message = new String(NbBundle.getMessage(CommonBundleResolver.class, "Fields not filled")); } NotifyDescriptor.Message nd = new NotifyDescriptor.Message(message, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(nd); } return result; }
boolean function(Container aTop, String message) { boolean result = hasEmptyFields(aTop); if (result) { if (message.equals(STRFields not filled")); } NotifyDescriptor.Message nd = new NotifyDescriptor.Message(message, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(nd); } return result; }
/** * Look for Emptyfield * @param aTop Given container (JPanel), to search recursive the Textfields * @param message Message to set to the MessageDialog * @return True, if found empty fields */
Look for Emptyfield
hasEmptyFields
{ "repo_name": "tedvals/mywms", "path": "rich.client/los.clientsuite/LOS Common/src/de/linogistix/common/gui/component/other/LiveHelp.java", "license": "gpl-3.0", "size": 19911 }
[ "java.awt.Container", "org.openide.DialogDisplayer", "org.openide.NotifyDescriptor" ]
import java.awt.Container; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor;
import java.awt.*; import org.openide.*;
[ "java.awt", "org.openide" ]
java.awt; org.openide;
2,307,468
SSOIdentityManagerService getSSOIdentityManager();
SSOIdentityManagerService getSSOIdentityManager();
/** * Gets the SSO Identity Manager used by this agent. */
Gets the SSO Identity Manager used by this agent
getSSOIdentityManager
{ "repo_name": "atricore/josso1", "path": "core/josso-agent-j14compat/src/main/java/org/josso/agent/SSOAgent.java", "license": "lgpl-2.1", "size": 3099 }
[ "org.josso.gateway.identity.service.SSOIdentityManagerService" ]
import org.josso.gateway.identity.service.SSOIdentityManagerService;
import org.josso.gateway.identity.service.*;
[ "org.josso.gateway" ]
org.josso.gateway;
1,501,308
private void processIdent(DetailAST ast) { final DetailAST parent = ast.getParent(); final int parentType = parent.getType(); if (parentType != TokenTypes.DOT && parentType != TokenTypes.METHOD_DEF || parentType == TokenTypes.DOT && ast.getNextSibling() != null) { referenced.add(ast.getText()); } }
void function(DetailAST ast) { final DetailAST parent = ast.getParent(); final int parentType = parent.getType(); if (parentType != TokenTypes.DOT && parentType != TokenTypes.METHOD_DEF parentType == TokenTypes.DOT && ast.getNextSibling() != null) { referenced.add(ast.getText()); } }
/** * Collects references made by IDENT. * @param ast the IDENT node to process */
Collects references made by IDENT
processIdent
{ "repo_name": "naver/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheck.java", "license": "lgpl-2.1", "size": 9914 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST", "com.puppycrawl.tools.checkstyle.api.TokenTypes" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
335,196
public TaskReport[] getSetupTaskReports(JobID jobid) throws IOException;
TaskReport[] function(JobID jobid) throws IOException;
/** * Grab a bunch of info on the setup tasks that make up the job */
Grab a bunch of info on the setup tasks that make up the job
getSetupTaskReports
{ "repo_name": "hanhlh/hadoop-0.20.2_FatBTree", "path": "src/mapred/org/apache/hadoop/mapred/JobSubmissionProtocol.java", "license": "apache-2.0", "size": 8286 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,638,679
boolean isTraversable(ConnectPoint src, ConnectPoint dst); // TODO: Further enhance this interface to support the virtual intent programming across this boundary.
boolean isTraversable(ConnectPoint src, ConnectPoint dst);
/** * Indicates whether or not the specified connect points on the underlying * network are traversable/reachable. * * @param src source connection point * @param dst destination connection point * @return true if the destination is reachable from the source */
Indicates whether or not the specified connect points on the underlying network are traversable/reachable
isTraversable
{ "repo_name": "osinstom/onos", "path": "incubator/api/src/main/java/org/onosproject/incubator/net/virtual/provider/VirtualNetworkProvider.java", "license": "apache-2.0", "size": 2323 }
[ "org.onosproject.net.ConnectPoint" ]
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.*;
[ "org.onosproject.net" ]
org.onosproject.net;
2,233,787
public Timestamp getParameterAsTimestamp() { if (m_Parameter == null) return null; if (m_Parameter instanceof Timestamp) return (Timestamp) m_Parameter; return null; } // getParameterAsTimestamp
Timestamp function() { if (m_Parameter == null) return null; if (m_Parameter instanceof Timestamp) return (Timestamp) m_Parameter; return null; }
/** * Method getParameter as Timestamp * @return Object */
Method getParameter as Timestamp
getParameterAsTimestamp
{ "repo_name": "erpcya/adempierePOS", "path": "base/src/org/compiere/process/ProcessInfoParameter.java", "license": "gpl-2.0", "size": 7761 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,156,918
@Test public void testGetAllForStoragePool() { List<storage_domain_static> result = dao.getAllForStoragePool(EXISTING_POOL_ID); assertNotNull(result); assertFalse(result.isEmpty()); }
void function() { List<storage_domain_static> result = dao.getAllForStoragePool(EXISTING_POOL_ID); assertNotNull(result); assertFalse(result.isEmpty()); }
/** * Ensures the right collection of domains are returned. */
Ensures the right collection of domains are returned
testGetAllForStoragePool
{ "repo_name": "raksha-rao/gluster-ovirt", "path": "backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageDomainStaticDAOTest.java", "license": "apache-2.0", "size": 6697 }
[ "java.util.List", "org.junit.Assert" ]
import java.util.List; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
2,393,572
public void shutdown() { this.ignite.close(); Ignition.stopAll(true); }
void function() { this.ignite.close(); Ignition.stopAll(true); }
/** * Make sure we shutdown Ignite when the context is destroyed. */
Make sure we shutdown Ignite when the context is destroyed
shutdown
{ "repo_name": "robertoschwald/cas", "path": "support/cas-server-support-ignite-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/IgniteTicketRegistry.java", "license": "apache-2.0", "size": 7274 }
[ "org.apache.ignite.Ignition" ]
import org.apache.ignite.Ignition;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
898,581
private static String renderSubscriptionForUI(AndesSubscription subscription, int pendingMessageCount) throws AndesException { String nodeId = subscription.getSubscribedNode().split("/")[1]; if (!StringUtils.isBlank(nodeId)) { String subscriptionIdentifier = "1_" + nodeId + "@" + subscription.getTargetQueue(); //in case of topic whats in v2 is : topicSubscriber.getDestination() + "@" + // topicSubscriber.boundTopicName; -- return subscriptionIdentifier + "|" + subscription.getTargetQueue() + "|" + subscription .getTargetQueueBoundExchangeName() + "|" + subscription.getTargetQueue() + "|" + subscription.isDurable() + "|" + subscription.hasExternalSubscriptions() + "|" + pendingMessageCount + "|" + subscription.getSubscribedNode(); } else { throw new AndesException("Invalid format in Subscriber Node ID : " + subscription .getSubscribedNode() + ". Delimiter should be /."); } }
static String function(AndesSubscription subscription, int pendingMessageCount) throws AndesException { String nodeId = subscription.getSubscribedNode().split("/")[1]; if (!StringUtils.isBlank(nodeId)) { String subscriptionIdentifier = "1_" + nodeId + "@" + subscription.getTargetQueue(); return subscriptionIdentifier + " " + subscription.getTargetQueue() + " " + subscription .getTargetQueueBoundExchangeName() + " " + subscription.getTargetQueue() + " " + subscription.isDurable() + " " + subscription.hasExternalSubscriptions() + " " + pendingMessageCount + " " + subscription.getSubscribedNode(); } else { throw new AndesException(STR + subscription .getSubscribedNode() + STR); } }
/** * This method returns the formatted subscription string to be compatible with the UI processor. * <p/> * Format of the string : "subscriptionInfo = subscriptionIdentifier | * subscribedQueueOrTopicName | subscriberQueueBoundExchange | subscriberQueueName | * isDurable | isActive | numberOfMessagesRemainingForSubscriber | subscriberNodeAddress" * * @param subscription AndesSubscription object that is to be translated to UI view * @param pendingMessageCount Number of pending messages of subscription * @return String representation of the subscription meta information and pending message count */
This method returns the formatted subscription string to be compatible with the UI processor. Format of the string : "subscriptionInfo = subscriptionIdentifier | subscribedQueueOrTopicName | subscriberQueueBoundExchange | subscriberQueueName | isDurable | isActive | numberOfMessagesRemainingForSubscriber | subscriberNodeAddress"
renderSubscriptionForUI
{ "repo_name": "pamod/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/server/information/management/SubscriptionManagementInformationMBean.java", "license": "apache-2.0", "size": 6688 }
[ "org.apache.commons.lang.StringUtils", "org.wso2.andes.kernel.AndesException", "org.wso2.andes.kernel.AndesSubscription" ]
import org.apache.commons.lang.StringUtils; import org.wso2.andes.kernel.AndesException; import org.wso2.andes.kernel.AndesSubscription;
import org.apache.commons.lang.*; import org.wso2.andes.kernel.*;
[ "org.apache.commons", "org.wso2.andes" ]
org.apache.commons; org.wso2.andes;
1,296,081
@RequestMapping(value = "/deployments/{name}", method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) public void deploy(@PathVariable("name") String name, @RequestParam(required = false) String properties) throws Exception { StreamDefinition stream = this.repository.findOne(name); Assert.notNull(stream, String.format("no stream defined: %s", name)); deployStream(stream); }
@RequestMapping(value = STR, method = RequestMethod.POST) @ResponseStatus(HttpStatus.CREATED) void function(@PathVariable("name") String name, @RequestParam(required = false) String properties) throws Exception { StreamDefinition stream = this.repository.findOne(name); Assert.notNull(stream, String.format(STR, name)); deployStream(stream); }
/** * Request deployment of an existing stream definition. The name must be included in the path. * * @param name the name of an existing stream definition (required) * @param properties the deployment properties for the stream as a comma-delimited list of key=value pairs */
Request deployment of an existing stream definition. The name must be included in the path
deploy
{ "repo_name": "Sbodiu-pivotal/spring-cloud-data", "path": "spring-cloud-data-admin/src/main/java/org/springframework/cloud/data/admin/controller/StreamController.java", "license": "apache-2.0", "size": 10389 }
[ "org.springframework.cloud.data.core.StreamDefinition", "org.springframework.http.HttpStatus", "org.springframework.util.Assert", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.RequestParam", "org.springframework.web.bind.annotation.ResponseStatus" ]
import org.springframework.cloud.data.core.StreamDefinition; import org.springframework.http.HttpStatus; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.cloud.data.core.*; import org.springframework.http.*; import org.springframework.util.*; import org.springframework.web.bind.annotation.*;
[ "org.springframework.cloud", "org.springframework.http", "org.springframework.util", "org.springframework.web" ]
org.springframework.cloud; org.springframework.http; org.springframework.util; org.springframework.web;
1,121,630
static public String convertUriToPath(Context context, Uri uri) { String path = null; if (null != uri) { String scheme = uri.getScheme(); if (null == scheme || scheme.equals("") || scheme.equals(ContentResolver.SCHEME_FILE)) { path = uri.getPath(); } else if (scheme.equals("http")) { path = uri.toString(); } else if (scheme.equals(ContentResolver.SCHEME_CONTENT)) { String[] projection = new String[] {MediaStore.MediaColumns.DATA}; Cursor cursor = null; try { cursor = context.getContentResolver().query(uri, projection, null, null, null); if (null == cursor || 0 == cursor.getCount() || !cursor.moveToFirst()) { throw new IllegalArgumentException("Given Uri could not be found" + " in media store"); } int pathIndex = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA); path = cursor.getString(pathIndex); } catch (SQLiteException e) { throw new IllegalArgumentException("Given Uri is not formatted in a way " + "so that it can be found in media store."); } finally { if (null != cursor) { cursor.close(); } } } else { throw new IllegalArgumentException("Given Uri scheme is not supported"); } } return path; }
static String function(Context context, Uri uri) { String path = null; if (null != uri) { String scheme = uri.getScheme(); if (null == scheme scheme.equals(STRhttpSTRGiven Uri could not be foundSTR in media storeSTRGiven Uri is not formatted in a way STRso that it can be found in media store.STRGiven Uri scheme is not supported"); } } return path; }
/** * This method expects uri in the following format * content://media/<table_name>/<row_index> (or) * file://sdcard/test.mp4 * http://test.com/test.mp4 * * Here <table_name> shall be "video" or "audio" or "images" * <row_index> the index of the content in given table */
This method expects uri in the following format content://media// (or) file://sdcard/test.mp4 HREF Here shall be "video" or "audio" or "images" the index of the content in given table
convertUriToPath
{ "repo_name": "indashnet/InDashNet.Open.UN2000", "path": "android/frameworks/opt/mms/src/java/com/google/android/mms/pdu/PduPersister.java", "license": "apache-2.0", "size": 65275 }
[ "android.content.Context", "android.net.Uri" ]
import android.content.Context; import android.net.Uri;
import android.content.*; import android.net.*;
[ "android.content", "android.net" ]
android.content; android.net;
2,603,365
public void generateUpdateWhere(CharBuffer cb) { generateInternalWhere(cb, false); } // // private/protected
void function(CharBuffer cb) { generateInternalWhere(cb, false); }
/** * Generates the (update) where expression. */
Generates the (update) where expression
generateUpdateWhere
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/amber/expr/fun/LowerFunExpr.java", "license": "gpl-2.0", "size": 2545 }
[ "com.caucho.util.CharBuffer" ]
import com.caucho.util.CharBuffer;
import com.caucho.util.*;
[ "com.caucho.util" ]
com.caucho.util;
1,371,899
private static void openFile(Context context, Uri uri, String filename, String mimeType) { if(openApk(context, uri, filename)) { return; } EMLog.d(TAG, "openFile filename = "+filename + " mimeType = "+mimeType); EMLog.d(TAG, "openFile uri = "+ (uri != null ? uri.toString() : "uri is null")); Intent intent = new Intent(Intent.ACTION_VIEW); setIntentByType(context, filename, intent); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setDataAndType(uri, mimeType); try { context.startActivity(intent); } catch (Exception e) { e.printStackTrace(); EMLog.e(TAG, e.getMessage()); Toast.makeText(context, "Can't find proper app to open this file", Toast.LENGTH_LONG).show(); } }
static void function(Context context, Uri uri, String filename, String mimeType) { if(openApk(context, uri, filename)) { return; } EMLog.d(TAG, STR+filename + STR+mimeType); EMLog.d(TAG, STR+ (uri != null ? uri.toString() : STR)); Intent intent = new Intent(Intent.ACTION_VIEW); setIntentByType(context, filename, intent); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setDataAndType(uri, mimeType); try { context.startActivity(intent); } catch (Exception e) { e.printStackTrace(); EMLog.e(TAG, e.getMessage()); Toast.makeText(context, STR, Toast.LENGTH_LONG).show(); } }
/** * Open file * @param context * @param uri * @param filename * @param mimeType */
Open file
openFile
{ "repo_name": "HyphenateInc/Hyphenate-Demo-Android", "path": "app/src/main/java/io/agora/easeui/utils/EaseCompat.java", "license": "apache-2.0", "size": 14873 }
[ "android.content.Context", "android.content.Intent", "android.net.Uri", "android.widget.Toast", "io.agora.util.EMLog" ]
import android.content.Context; import android.content.Intent; import android.net.Uri; import android.widget.Toast; import io.agora.util.EMLog;
import android.content.*; import android.net.*; import android.widget.*; import io.agora.util.*;
[ "android.content", "android.net", "android.widget", "io.agora.util" ]
android.content; android.net; android.widget; io.agora.util;
2,419,369
private void printTimingDistribution(PhaseStatistics phaseStat) { if (!phaseStat.isEmpty()) { lnOpen("tr"); element("td", "class", "left", "colspan", "4", "Total time (across all threads) spent on:"); close(); // tr lnOpen("tr"); element("th", "Type"); element("th", "Total"); element("th", "Count"); element("th", "Average"); close(); // tr for (ProfilerTask taskType : phaseStat) { lnOpen("tr", "class", "phase-task-statistics"); element("td", taskType); element("td", prettyPercentage(phaseStat.getTotalRelativeDuration(taskType))); element("td", phaseStat.getCount(taskType)); element("td", TimeUtilities.prettyTime(phaseStat.getMeanDuration(taskType))); close(); // tr } } }
void function(PhaseStatistics phaseStat) { if (!phaseStat.isEmpty()) { lnOpen("tr"); element("td", "class", "left", STR, "4", STR); close(); lnOpen("tr"); element("th", "Type"); element("th", "Total"); element("th", "Count"); element("th", STR); close(); for (ProfilerTask taskType : phaseStat) { lnOpen("tr", "class", STR); element("td", taskType); element("td", prettyPercentage(phaseStat.getTotalRelativeDuration(taskType))); element("td", phaseStat.getCount(taskType)); element("td", TimeUtilities.prettyTime(phaseStat.getMeanDuration(taskType))); close(); } } }
/** * Print the table rows for the {@link ProfilerTask} types and their execution times. */
Print the table rows for the <code>ProfilerTask</code> types and their execution times
printTimingDistribution
{ "repo_name": "ButterflyNetwork/bazel", "path": "src/main/java/com/google/devtools/build/lib/profiler/output/PhaseHtml.java", "license": "apache-2.0", "size": 10081 }
[ "com.google.devtools.build.lib.profiler.ProfilerTask", "com.google.devtools.build.lib.profiler.statistics.PhaseStatistics", "com.google.devtools.build.lib.util.TimeUtilities" ]
import com.google.devtools.build.lib.profiler.ProfilerTask; import com.google.devtools.build.lib.profiler.statistics.PhaseStatistics; import com.google.devtools.build.lib.util.TimeUtilities;
import com.google.devtools.build.lib.profiler.*; import com.google.devtools.build.lib.profiler.statistics.*; import com.google.devtools.build.lib.util.*;
[ "com.google.devtools" ]
com.google.devtools;
1,229,931
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getTokenizerRuntime( IDataSourceIndex<I, S> dataSource, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, ILogicalExpression filterExpr, RecordDescriptor recordDesc, JobGenContext context, JobSpecification spec, boolean bulkload) throws AlgebricksException;
Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> function( IDataSourceIndex<I, S> dataSource, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IVariableTypeEnvironment typeEnv, List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys, ILogicalExpression filterExpr, RecordDescriptor recordDesc, JobGenContext context, JobSpecification spec, boolean bulkload) throws AlgebricksException;
/** * Creates the TokenizeOperator for IndexInsertDeletePOperator, which tokenizes * secondary key into [token, number of token] pair in a length-partitioned index. * In case of non length-partitioned index, it tokenizes secondary key into [token]. * * @param dataSource * Target secondary index. * @param propagatedSchema * Output schema of the insert/delete operator to be created. * @param inputSchemas * Output schemas of the insert/delete operator to be created. * @param typeEnv * Type environment of the original IndexInsertDeleteOperator operator. * @param primaryKeys * Variables for the dataset's primary keys that the dataSource secondary index belongs to. * @param secondaryKeys * Variables for the secondary-index keys. * @param filterExpr * Filtering expression to be pushed inside the runtime op. * Such a filter may, e.g., exclude NULLs from being inserted/deleted. * @param recordDesc * Output record descriptor of the runtime op to be created. * @param context * Job generation context. * @param spec * Target job specification. * @return * A Hyracks IOperatorDescriptor and its partition constraint. * @throws AlgebricksException */
Creates the TokenizeOperator for IndexInsertDeletePOperator, which tokenizes secondary key into [token, number of token] pair in a length-partitioned index. In case of non length-partitioned index, it tokenizes secondary key into [token]
getTokenizerRuntime
{ "repo_name": "kisskys/incubator-asterixdb", "path": "hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/metadata/IMetadataProvider.java", "license": "apache-2.0", "size": 12142 }
[ "java.util.List", "org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint", "org.apache.hyracks.algebricks.common.exceptions.AlgebricksException", "org.apache.hyracks.algebricks.common.utils.Pair", "org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression", "org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable", "org.apache.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment", "org.apache.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema", "org.apache.hyracks.algebricks.core.jobgen.impl.JobGenContext", "org.apache.hyracks.api.dataflow.IOperatorDescriptor", "org.apache.hyracks.api.dataflow.value.RecordDescriptor", "org.apache.hyracks.api.job.JobSpecification" ]
import java.util.List; import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint; import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException; import org.apache.hyracks.algebricks.common.utils.Pair; import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression; import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable; import org.apache.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment; import org.apache.hyracks.algebricks.core.algebra.operators.logical.IOperatorSchema; import org.apache.hyracks.algebricks.core.jobgen.impl.JobGenContext; import org.apache.hyracks.api.dataflow.IOperatorDescriptor; import org.apache.hyracks.api.dataflow.value.RecordDescriptor; import org.apache.hyracks.api.job.JobSpecification;
import java.util.*; import org.apache.hyracks.algebricks.common.constraints.*; import org.apache.hyracks.algebricks.common.exceptions.*; import org.apache.hyracks.algebricks.common.utils.*; import org.apache.hyracks.algebricks.core.algebra.base.*; import org.apache.hyracks.algebricks.core.algebra.expressions.*; import org.apache.hyracks.algebricks.core.algebra.operators.logical.*; import org.apache.hyracks.algebricks.core.jobgen.impl.*; import org.apache.hyracks.api.dataflow.*; import org.apache.hyracks.api.dataflow.value.*; import org.apache.hyracks.api.job.*;
[ "java.util", "org.apache.hyracks" ]
java.util; org.apache.hyracks;
2,814,746
public void enqueueMessage(Msg m, DeviceFeature f) { enqueueDelayedMessage(m, f, 0); }
void function(Msg m, DeviceFeature f) { enqueueDelayedMessage(m, f, 0); }
/** * Enqueues message to be sent at the next possible time * * @param m message to be sent * @param f device feature that sent this message (so we can associate the response message with it) */
Enqueues message to be sent at the next possible time
enqueueMessage
{ "repo_name": "paolodenti/openhab", "path": "bundles/binding/org.openhab.binding.insteonplm/src/main/java/org/openhab/binding/insteonplm/internal/device/InsteonDevice.java", "license": "epl-1.0", "size": 19906 }
[ "org.openhab.binding.insteonplm.internal.message.Msg" ]
import org.openhab.binding.insteonplm.internal.message.Msg;
import org.openhab.binding.insteonplm.internal.message.*;
[ "org.openhab.binding" ]
org.openhab.binding;
878,477
@Nonnull BeanContextManager getManager();
BeanContextManager getManager();
/** * Return current bean context manager */
Return current bean context manager
getManager
{ "repo_name": "alesharik/AlesharikWebServer", "path": "base/src/com/alesharik/webserver/base/bean/InvocationContext.java", "license": "gpl-3.0", "size": 1363 }
[ "com.alesharik.webserver.base.bean.context.BeanContextManager" ]
import com.alesharik.webserver.base.bean.context.BeanContextManager;
import com.alesharik.webserver.base.bean.context.*;
[ "com.alesharik.webserver" ]
com.alesharik.webserver;
87,775
protected boolean checkMidTierGraph(StructuredGraph graph) { return true; }
boolean function(StructuredGraph graph) { return true; }
/** * Can be overridden by unit tests to verify properties of the graph. * * @param graph the graph at the end of MidTier */
Can be overridden by unit tests to verify properties of the graph
checkMidTierGraph
{ "repo_name": "davleopo/graal-core", "path": "graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java", "license": "gpl-2.0", "size": 41197 }
[ "com.oracle.graal.nodes.StructuredGraph" ]
import com.oracle.graal.nodes.StructuredGraph;
import com.oracle.graal.nodes.*;
[ "com.oracle.graal" ]
com.oracle.graal;
847,331
public Editor edit() throws IOException { return DiskLruCache.this.edit(key, sequenceNumber); }
Editor function() throws IOException { return DiskLruCache.this.edit(key, sequenceNumber); }
/** * Returns an editor for this snapshot's entry, or null if either the * entry has changed since this snapshot was created or if another edit * is in progress. */
Returns an editor for this snapshot's entry, or null if either the entry has changed since this snapshot was created or if another edit is in progress
edit
{ "repo_name": "ZhenisMadiyar/ProToi", "path": "library_image_loader/src/main/java/com/nostra13/universalimageloader/cache/disc/impl/ext/DiskLruCache.java", "license": "apache-2.0", "size": 29973 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
283,530
public static HtdsTileset read(final InputStream stream, final int width, final int height) throws IOException { MsqHeader header; HuffmanInputStream huffmanStream; List<Pic> tiles; int quantity; // Read the next MSQ header and validate it header = MsqHeader.read(stream); if (header == null) { // No more tilesets, abort. return null; } if (header.getType() != MsqType.Compressed) { throw new IOException( "Expected MSQ block of HTDS stream to be compressed"); } // Calculate the number of tiles quantity = header.getSize() * 2 / width / height; // Read the tiles tiles = new ArrayList<Pic>(quantity); huffmanStream = new HuffmanInputStream(stream); for (int i = 0; i < quantity; i++) { tiles.add(Pic.read(huffmanStream, width, height)); } return new HtdsTileset(tiles); }
static HtdsTileset function(final InputStream stream, final int width, final int height) throws IOException { MsqHeader header; HuffmanInputStream huffmanStream; List<Pic> tiles; int quantity; header = MsqHeader.read(stream); if (header == null) { return null; } if (header.getType() != MsqType.Compressed) { throw new IOException( STR); } quantity = header.getSize() * 2 / width / height; tiles = new ArrayList<Pic>(quantity); huffmanStream = new HuffmanInputStream(stream); for (int i = 0; i < quantity; i++) { tiles.add(Pic.read(huffmanStream, width, height)); } return new HtdsTileset(tiles); }
/** * Reads a HTDS tileset from a stream. Width and height of the tiles must be * specified because no image dimensions can be read from the stream. * * This method returns null if no more tilesets are found on the stream. * * @param stream * The input stream * @param width * The tile width * @param height * The tile height * @return The tileset or null if no more tilesets are found * @throws IOException * When file operation fails. */
Reads a HTDS tileset from a stream. Width and height of the tiles must be specified because no image dimensions can be read from the stream. This method returns null if no more tilesets are found on the stream
read
{ "repo_name": "delMar43/wlandsuite", "path": "src/main/java/de/ailis/wlandsuite/htds/HtdsTileset.java", "license": "mit", "size": 9433 }
[ "de.ailis.wlandsuite.huffman.HuffmanInputStream", "de.ailis.wlandsuite.msq.MsqHeader", "de.ailis.wlandsuite.msq.MsqType", "de.ailis.wlandsuite.pic.Pic", "java.io.IOException", "java.io.InputStream", "java.util.ArrayList", "java.util.List" ]
import de.ailis.wlandsuite.huffman.HuffmanInputStream; import de.ailis.wlandsuite.msq.MsqHeader; import de.ailis.wlandsuite.msq.MsqType; import de.ailis.wlandsuite.pic.Pic; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List;
import de.ailis.wlandsuite.huffman.*; import de.ailis.wlandsuite.msq.*; import de.ailis.wlandsuite.pic.*; import java.io.*; import java.util.*;
[ "de.ailis.wlandsuite", "java.io", "java.util" ]
de.ailis.wlandsuite; java.io; java.util;
2,208,700
public final OperationsClient getOperationsClient() { return operationsClient; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Performs asynchronous video annotation. Progress and results can be retrieved through the * `google.longrunning.Operations` interface. `Operation.metadata` contains * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * * <p>Sample code: * * <pre>{@code * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = * VideoIntelligenceServiceClient.create()) { * String inputUri = "inputUri470706498"; * List<Feature> features = new ArrayList<>(); * AnnotateVideoResponse response = * videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); * }
final OperationsClient function() { return operationsClient; } /** * Performs asynchronous video annotation. Progress and results can be retrieved through the * `google.longrunning.Operations` interface. `Operation.metadata` contains * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` * (results). * * <p>Sample code: * * <pre>{ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = * VideoIntelligenceServiceClient.create()) { * String inputUri = STR; * List<Feature> features = new ArrayList<>(); * AnnotateVideoResponse response = * videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get(); * }
/** * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call
getOperationsClient
{ "repo_name": "googleapis/java-video-intelligence", "path": "google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/VideoIntelligenceServiceClient.java", "license": "apache-2.0", "size": 13781 }
[ "com.google.longrunning.Operation", "com.google.longrunning.OperationsClient", "java.util.List" ]
import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; import java.util.List;
import com.google.longrunning.*; import java.util.*;
[ "com.google.longrunning", "java.util" ]
com.google.longrunning; java.util;
1,901,717
private File findFileName(FTPClient ftp) { FTPFile [] theFiles = null; final int maxIterations = 1000; for (int counter = 1; counter < maxIterations; counter++) { File localFile = FILE_UTILS.createTempFile( "ant" + Integer.toString(counter), ".tmp", null, false, false); String fileName = localFile.getName(); boolean found = false; try { if (theFiles == null) { theFiles = ftp.listFiles(); } for (int counter2 = 0; counter2 < theFiles.length; counter2++) { if (theFiles[counter2] != null && theFiles[counter2].getName().equals(fileName)) { found = true; break; } } } catch (IOException ioe) { throw new BuildException(ioe, getLocation()); } if (!found) { localFile.deleteOnExit(); return localFile; } } return null; }
File function(FTPClient ftp) { FTPFile [] theFiles = null; final int maxIterations = 1000; for (int counter = 1; counter < maxIterations; counter++) { File localFile = FILE_UTILS.createTempFile( "ant" + Integer.toString(counter), ".tmp", null, false, false); String fileName = localFile.getName(); boolean found = false; try { if (theFiles == null) { theFiles = ftp.listFiles(); } for (int counter2 = 0; counter2 < theFiles.length; counter2++) { if (theFiles[counter2] != null && theFiles[counter2].getName().equals(fileName)) { found = true; break; } } } catch (IOException ioe) { throw new BuildException(ioe, getLocation()); } if (!found) { localFile.deleteOnExit(); return localFile; } } return null; }
/** * find a suitable name for local and remote temporary file */
find a suitable name for local and remote temporary file
findFileName
{ "repo_name": "Mayo-WE01051879/mayosapp", "path": "Build/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java", "license": "mit", "size": 102160 }
[ "java.io.File", "java.io.IOException", "org.apache.commons.net.ftp.FTPClient", "org.apache.commons.net.ftp.FTPFile", "org.apache.tools.ant.BuildException" ]
import java.io.File; import java.io.IOException; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.tools.ant.BuildException;
import java.io.*; import org.apache.commons.net.ftp.*; import org.apache.tools.ant.*;
[ "java.io", "org.apache.commons", "org.apache.tools" ]
java.io; org.apache.commons; org.apache.tools;
1,362,688
public void testGenerateTagsAllReqFieldsAdViewNoCookies() throws XmlRpcException, MalformedURLException { Map<String, Object> generateTagsParameters = new HashMap<String, Object>(); Object[] XMLRPCMethodParameters = new Object[] { sessionId, zoneId, CODE_TYPES[4], generateTagsParameters }; final String result = (String) client .execute(ZONE_GENERATE_TAGS_METHOD, XMLRPCMethodParameters); assertNotNull(result); }
void function() throws XmlRpcException, MalformedURLException { Map<String, Object> generateTagsParameters = new HashMap<String, Object>(); Object[] XMLRPCMethodParameters = new Object[] { sessionId, zoneId, CODE_TYPES[4], generateTagsParameters }; final String result = (String) client .execute(ZONE_GENERATE_TAGS_METHOD, XMLRPCMethodParameters); assertNotNull(result); }
/** * Test method with all required fields for adviewnocookies. * * @throws XmlRpcException * @throws MalformedURLException */
Test method with all required fields for adviewnocookies
testGenerateTagsAllReqFieldsAdViewNoCookies
{ "repo_name": "adqio/revive-adserver", "path": "www/api/v2/xmlrpc/tests/unit/src/test/java/org/openx/zone/TestZoneGenerateTags.java", "license": "gpl-2.0", "size": 10388 }
[ "java.net.MalformedURLException", "java.util.HashMap", "java.util.Map", "org.apache.xmlrpc.XmlRpcException" ]
import java.net.MalformedURLException; import java.util.HashMap; import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
import java.net.*; import java.util.*; import org.apache.xmlrpc.*;
[ "java.net", "java.util", "org.apache.xmlrpc" ]
java.net; java.util; org.apache.xmlrpc;
2,131,849
protected String getNextXmlChunk() throws IOException { String charCountStr = fileReader.readLine(); if (charCountStr != null) { int toRead = Integer.parseInt(charCountStr); char[] charBuff = new char[toRead]; int count = 0; int len = 0; while (count < toRead) { len = fileReader.read(charBuff, count, charBuff.length - count); count += len; } return new String(charBuff); } else { return null; } }
String function() throws IOException { String charCountStr = fileReader.readLine(); if (charCountStr != null) { int toRead = Integer.parseInt(charCountStr); char[] charBuff = new char[toRead]; int count = 0; int len = 0; while (count < toRead) { len = fileReader.read(charBuff, count, charBuff.length - count); count += len; } return new String(charBuff); } else { return null; } }
/** * Reads the next chunk of XML from the file * * @return Null if no more XML is found */
Reads the next chunk of XML from the file
getNextXmlChunk
{ "repo_name": "NCIP/cagrid", "path": "cagrid/Software/core/caGrid/projects/wsEnum/src/java/utils/gov/nih/nci/cagrid/wsenum/utils/BaseSerializedObjectIterator.java", "license": "bsd-3-clause", "size": 6591 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
614,063
public ServiceResponse<Void> getIntOneMillion(Integer intQuery) throws ErrorException, IOException { Call<ResponseBody> call = service.getIntOneMillion(intQuery); return getIntOneMillionDelegate(call.execute(), null); }
ServiceResponse<Void> function(Integer intQuery) throws ErrorException, IOException { Call<ResponseBody> call = service.getIntOneMillion(intQuery); return getIntOneMillionDelegate(call.execute(), null); }
/** * Get '1000000' integer value. * * @param intQuery '1000000' integer value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponse} object if successful. */
Get '1000000' integer value
getIntOneMillion
{ "repo_name": "vulcansteel/autorest", "path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/url/QueriesOperationsImpl.java", "license": "mit", "size": 70298 }
[ "com.microsoft.rest.ServiceResponse", "com.squareup.okhttp.ResponseBody", "java.io.IOException" ]
import com.microsoft.rest.ServiceResponse; import com.squareup.okhttp.ResponseBody; import java.io.IOException;
import com.microsoft.rest.*; import com.squareup.okhttp.*; import java.io.*;
[ "com.microsoft.rest", "com.squareup.okhttp", "java.io" ]
com.microsoft.rest; com.squareup.okhttp; java.io;
697,760
public boolean validateCustomPolicy(String userID, String appKey, String resourceKey, String apiKey, String subscriptionKey, String apiContext, String apiVersion, String appTenant, String apiTenant, String appId, String clientIp, Map<String, String> keyTemplateMap, MessageContext messageContext) { if (keyTemplateMap != null && keyTemplateMap.size() > 0) { for (String key : keyTemplateMap.keySet()) { key = key.replaceAll("\\$resourceKey", resourceKey); key = key.replaceAll("\\$userId", userID); key = key.replaceAll("\\$apiContext", apiContext); key = key.replaceAll("\\$apiVersion", apiVersion); key = key.replaceAll("\\$appTenant", appTenant); key = key.replaceAll("\\$apiTenant", apiTenant); key = key.replaceAll("\\$appId", appId); if (clientIp != null) { key = key.replaceAll("\\$clientIp", APIUtil.ipToBigInteger(clientIp).toString()); } if (getThrottleDataHolder().isThrottled(key)) { long timestamp = getThrottleDataHolder().getThrottleNextAccessTimestamp(key); messageContext.setProperty(APIThrottleConstants.THROTTLED_NEXT_ACCESS_TIMESTAMP, timestamp); return true; } } } return false; }
boolean function(String userID, String appKey, String resourceKey, String apiKey, String subscriptionKey, String apiContext, String apiVersion, String appTenant, String apiTenant, String appId, String clientIp, Map<String, String> keyTemplateMap, MessageContext messageContext) { if (keyTemplateMap != null && keyTemplateMap.size() > 0) { for (String key : keyTemplateMap.keySet()) { key = key.replaceAll(STR, resourceKey); key = key.replaceAll(STR, userID); key = key.replaceAll(STR, apiContext); key = key.replaceAll(STR, apiVersion); key = key.replaceAll(STR, appTenant); key = key.replaceAll(STR, apiTenant); key = key.replaceAll(STR, appId); if (clientIp != null) { key = key.replaceAll(STR, APIUtil.ipToBigInteger(clientIp).toString()); } if (getThrottleDataHolder().isThrottled(key)) { long timestamp = getThrottleDataHolder().getThrottleNextAccessTimestamp(key); messageContext.setProperty(APIThrottleConstants.THROTTLED_NEXT_ACCESS_TIMESTAMP, timestamp); return true; } } } return false; }
/** * Validate custom policy is handle by this method. This method call is an expensive operation * and should not enabled by default. If we enabled this policy then all APIs available in system * will have to go through this check. * * @return */
Validate custom policy is handle by this method. This method call is an expensive operation and should not enabled by default. If we enabled this policy then all APIs available in system will have to go through this check
validateCustomPolicy
{ "repo_name": "wso2/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/throttling/ThrottleHandler.java", "license": "apache-2.0", "size": 63186 }
[ "java.util.Map", "org.apache.synapse.MessageContext", "org.wso2.carbon.apimgt.impl.utils.APIUtil" ]
import java.util.Map; import org.apache.synapse.MessageContext; import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import java.util.*; import org.apache.synapse.*; import org.wso2.carbon.apimgt.impl.utils.*;
[ "java.util", "org.apache.synapse", "org.wso2.carbon" ]
java.util; org.apache.synapse; org.wso2.carbon;
2,424,826
@Test(timeout = 120000) public void testGetFileStatus() throws Exception { final Path zone = new Path("zone"); final Path slashZone = new Path("/", zone); fs.mkdirs(slashZone); dfsAdmin.createEncryptionZone(slashZone, TEST_KEY); final Path base = new Path("base"); final Path reservedRaw = new Path("/.reserved/raw"); final Path baseRaw = new Path(reservedRaw, base); final int len = 8192; DFSTestUtil.createFile(fs, baseRaw, len, (short) 1, 0xFEED); assertPathEquals(new Path("/", base), baseRaw); final Path ezEncFile = new Path(slashZone, base); final Path ezRawEncFile = new Path(new Path(reservedRaw, zone), base); DFSTestUtil.createFile(fs, ezEncFile, len, (short) 1, 0xFEED); assertPathEquals(ezEncFile, ezRawEncFile); }
@Test(timeout = 120000) void function() throws Exception { final Path zone = new Path("zone"); final Path slashZone = new Path("/", zone); fs.mkdirs(slashZone); dfsAdmin.createEncryptionZone(slashZone, TEST_KEY); final Path base = new Path("base"); final Path reservedRaw = new Path(STR); final Path baseRaw = new Path(reservedRaw, base); final int len = 8192; DFSTestUtil.createFile(fs, baseRaw, len, (short) 1, 0xFEED); assertPathEquals(new Path("/", base), baseRaw); final Path ezEncFile = new Path(slashZone, base); final Path ezRawEncFile = new Path(new Path(reservedRaw, zone), base); DFSTestUtil.createFile(fs, ezEncFile, len, (short) 1, 0xFEED); assertPathEquals(ezEncFile, ezRawEncFile); }
/** * Tests that getFileStatus on raw and non raw resolve to the same * file. */
Tests that getFileStatus on raw and non raw resolve to the same file
testGetFileStatus
{ "repo_name": "tecknowledgeable/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestReservedRawPaths.java", "license": "apache-2.0", "size": 13487 }
[ "org.apache.hadoop.fs.Path", "org.junit.Test" ]
import org.apache.hadoop.fs.Path; import org.junit.Test;
import org.apache.hadoop.fs.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
2,747,479
public final Vec2 getExtents() { final Vec2 center = new Vec2(upperBound); center.subLocal(lowerBound); center.mulLocal(.5f); return center; }
final Vec2 function() { final Vec2 center = new Vec2(upperBound); center.subLocal(lowerBound); center.mulLocal(.5f); return center; }
/** * Get the extents of the AABB (half-widths). * * @return */
Get the extents of the AABB (half-widths)
getExtents
{ "repo_name": "neilpanchal/PBox2D", "path": "src/com/jbox2d/collision/AABB.java", "license": "mit", "size": 9568 }
[ "com.jbox2d.common.Vec2" ]
import com.jbox2d.common.Vec2;
import com.jbox2d.common.*;
[ "com.jbox2d.common" ]
com.jbox2d.common;
2,039,671
public void setRegionPersistence(RegionPersistence regionPersistence) { this.regionPersistence = regionPersistence; }
void function(RegionPersistence regionPersistence) { this.regionPersistence = regionPersistence; }
/** * Sets the region persistence. * * @param regionPersistence the region persistence */
Sets the region persistence
setRegionPersistence
{ "repo_name": "fraunhoferfokus/govapps", "path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/LegalDetailsServiceBaseImpl.java", "license": "bsd-3-clause", "size": 32799 }
[ "de.fraunhofer.fokus.movepla.service.persistence.RegionPersistence" ]
import de.fraunhofer.fokus.movepla.service.persistence.RegionPersistence;
import de.fraunhofer.fokus.movepla.service.persistence.*;
[ "de.fraunhofer.fokus" ]
de.fraunhofer.fokus;
1,886,118
protected URI generateJarUri(Path directory, String jarFile) { StringBuilder uriString = new StringBuilder("jar:"); uriString.append(directory.toUri().toString()); uriString.append(jarFile); return URI.create(uriString.toString()); }
URI function(Path directory, String jarFile) { StringBuilder uriString = new StringBuilder("jar:"); uriString.append(directory.toUri().toString()); uriString.append(jarFile); return URI.create(uriString.toString()); }
/** * generate a jar URI by using the syntax defined in java.net.JarURLConnection for example * jar:file:/tmp/ear11111111/myappli-1.0.0-SNAPSHOT.ear */
generate a jar URI by using the syntax defined in java.net.JarURLConnection for example jar:file:/tmp/ear11111111/myappli-1.0.0-SNAPSHOT.ear
generateJarUri
{ "repo_name": "Orange-OpenSource/elpaaso-core", "path": "cloud-paas/cloud-paas-archive/src/main/java/com/francetelecom/clara/cloud/archive/ManageArchiveImpl.java", "license": "apache-2.0", "size": 13479 }
[ "java.net.URI", "java.nio.file.Path" ]
import java.net.URI; import java.nio.file.Path;
import java.net.*; import java.nio.file.*;
[ "java.net", "java.nio" ]
java.net; java.nio;
1,274,016
@NotNull String getNodeText(@NotNull PsiElement element, boolean useFullName);
String getNodeText(@NotNull PsiElement element, boolean useFullName);
/** * Returns the text representing the specified PSI element in the Find Usages tree. * * @param element the element for which the node text is requested. * @param useFullName if true, the returned text should use fully qualified names * @return the text representing the element. */
Returns the text representing the specified PSI element in the Find Usages tree
getNodeText
{ "repo_name": "jexp/idea2", "path": "platform/lang-api/src/com/intellij/lang/findUsages/FindUsagesProvider.java", "license": "apache-2.0", "size": 3193 }
[ "com.intellij.psi.PsiElement", "org.jetbrains.annotations.NotNull" ]
import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull;
import com.intellij.psi.*; import org.jetbrains.annotations.*;
[ "com.intellij.psi", "org.jetbrains.annotations" ]
com.intellij.psi; org.jetbrains.annotations;
2,879,339
public static void clearKeysForSave(RuleBaseValues rule) { rule.setId(null); rule.setActivationDate(null); rule.setDeactivationDate(null); rule.setCurrentInd(false); rule.setVersionNbr(null); rule.setObjectId(null); rule.setVersionNumber(0L); }
static void function(RuleBaseValues rule) { rule.setId(null); rule.setActivationDate(null); rule.setDeactivationDate(null); rule.setCurrentInd(false); rule.setVersionNbr(null); rule.setObjectId(null); rule.setVersionNumber(0L); }
/** * Since editing of a Rule should actually result in a rule with a new ID and new * entries in the rule and rule responsibility tables, we need to clear out * the primary keys of the rule and related objects. */
Since editing of a Rule should actually result in a rule with a new ID and new entries in the rule and rule responsibility tables, we need to clear out the primary keys of the rule and related objects
clearKeysForSave
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/rule/web/WebRuleUtils.java", "license": "apache-2.0", "size": 29824 }
[ "org.kuali.rice.kew.rule.RuleBaseValues" ]
import org.kuali.rice.kew.rule.RuleBaseValues;
import org.kuali.rice.kew.rule.*;
[ "org.kuali.rice" ]
org.kuali.rice;
1,598,351
protected void setFixture(RenderObject<?> fixture) { this.fixture = fixture; }
void function(RenderObject<?> fixture) { this.fixture = fixture; }
/** * Sets the fixture for this Render Object test case. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @generated */
Sets the fixture for this Render Object test case.
setFixture
{ "repo_name": "jarrah42/eavp", "path": "org.eclipse.eavp.geometry.view.model.tests/src/org/eclipse/eavp/geometry/view/model/tests/RenderObjectTest.java", "license": "epl-1.0", "size": 6994 }
[ "org.eclipse.eavp.geometry.view.model.RenderObject" ]
import org.eclipse.eavp.geometry.view.model.RenderObject;
import org.eclipse.eavp.geometry.view.model.*;
[ "org.eclipse.eavp" ]
org.eclipse.eavp;
695,774
private Void write() { Table table = null; TableDescriptor tableDesc = null; try { table = connection.getTable(region.getTable()); tableDesc = table.getDescriptor(); byte[] rowToCheck = region.getStartKey(); if (rowToCheck.length == 0) { rowToCheck = new byte[]{0x0}; } int writeValueSize = connection.getConfiguration() .getInt(HConstants.HBASE_CANARY_WRITE_VALUE_SIZE_KEY, 10); for (ColumnFamilyDescriptor column : tableDesc.getColumnFamilies()) { Put put = new Put(rowToCheck); byte[] value = new byte[writeValueSize]; Bytes.random(value); put.addColumn(column.getName(), HConstants.EMPTY_BYTE_ARRAY, value); LOG.debug("Writing to {} {} {} {}", tableDesc.getTableName(), region.getRegionNameAsString(), column.getNameAsString(), Bytes.toStringBinary(rowToCheck)); try { long startTime = EnvironmentEdgeManager.currentTime(); table.put(put); long time = EnvironmentEdgeManager.currentTime() - startTime; this.readWriteLatency.add(time); sink.publishWriteTiming(serverName, region, column, time); } catch (Exception e) { sink.publishWriteFailure(serverName, region, column, e); } } table.close(); } catch (IOException e) { sink.publishWriteFailure(serverName, region, e); sink.updateWriteFailures(region.getRegionNameAsString(), serverName.getHostname()); } return null; } } static class RegionServerTask implements Callable<Void> { private Connection connection; private String serverName; private RegionInfo region; private RegionServerStdOutSink sink; private AtomicLong successes; RegionServerTask(Connection connection, String serverName, RegionInfo region, RegionServerStdOutSink sink, AtomicLong successes) { this.connection = connection; this.serverName = serverName; this.region = region; this.sink = sink; this.successes = successes; }
Void function() { Table table = null; TableDescriptor tableDesc = null; try { table = connection.getTable(region.getTable()); tableDesc = table.getDescriptor(); byte[] rowToCheck = region.getStartKey(); if (rowToCheck.length == 0) { rowToCheck = new byte[]{0x0}; } int writeValueSize = connection.getConfiguration() .getInt(HConstants.HBASE_CANARY_WRITE_VALUE_SIZE_KEY, 10); for (ColumnFamilyDescriptor column : tableDesc.getColumnFamilies()) { Put put = new Put(rowToCheck); byte[] value = new byte[writeValueSize]; Bytes.random(value); put.addColumn(column.getName(), HConstants.EMPTY_BYTE_ARRAY, value); LOG.debug(STR, tableDesc.getTableName(), region.getRegionNameAsString(), column.getNameAsString(), Bytes.toStringBinary(rowToCheck)); try { long startTime = EnvironmentEdgeManager.currentTime(); table.put(put); long time = EnvironmentEdgeManager.currentTime() - startTime; this.readWriteLatency.add(time); sink.publishWriteTiming(serverName, region, column, time); } catch (Exception e) { sink.publishWriteFailure(serverName, region, column, e); } } table.close(); } catch (IOException e) { sink.publishWriteFailure(serverName, region, e); sink.updateWriteFailures(region.getRegionNameAsString(), serverName.getHostname()); } return null; } } static class RegionServerTask implements Callable<Void> { private Connection connection; private String serverName; private RegionInfo region; private RegionServerStdOutSink sink; private AtomicLong successes; RegionServerTask(Connection connection, String serverName, RegionInfo region, RegionServerStdOutSink sink, AtomicLong successes) { this.connection = connection; this.serverName = serverName; this.region = region; this.sink = sink; this.successes = successes; }
/** * Check writes for the canary table */
Check writes for the canary table
write
{ "repo_name": "ndimiduk/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java", "license": "apache-2.0", "size": 73736 }
[ "java.io.IOException", "java.util.concurrent.Callable", "java.util.concurrent.atomic.AtomicLong", "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.client.ColumnFamilyDescriptor", "org.apache.hadoop.hbase.client.Connection", "org.apache.hadoop.hbase.client.Put", "org.apache.hadoop.hbase.client.RegionInfo", "org.apache.hadoop.hbase.client.Table", "org.apache.hadoop.hbase.client.TableDescriptor", "org.apache.hadoop.hbase.util.Bytes", "org.apache.hadoop.hbase.util.EnvironmentEdgeManager" ]
import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import java.io.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,453,115
void validateDynamicParam(SqlDynamicParam dynamicParam);
void validateDynamicParam(SqlDynamicParam dynamicParam);
/** * Validates a dynamic parameter. * * @param dynamicParam Dynamic parameter */
Validates a dynamic parameter
validateDynamicParam
{ "repo_name": "glimpseio/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java", "license": "apache-2.0", "size": 24006 }
[ "org.apache.calcite.sql.SqlDynamicParam" ]
import org.apache.calcite.sql.SqlDynamicParam;
import org.apache.calcite.sql.*;
[ "org.apache.calcite" ]
org.apache.calcite;
237,915
public static NodeId createUnknownNodeId(String host) { return NodeId.newInstance(host, -1); } private static class UnknownNode implements Node { private String host; public UnknownNode(String host) { this.host = host; }
static NodeId function(String host) { return NodeId.newInstance(host, -1); } private static class UnknownNode implements Node { private String host; public UnknownNode(String host) { this.host = host; }
/** * A NodeId instance needed upon startup for populating inactive nodes Map. * It only knows the hostname/ip and marks the port to -1 or invalid. */
A NodeId instance needed upon startup for populating inactive nodes Map. It only knows the hostname/ip and marks the port to -1 or invalid
createUnknownNodeId
{ "repo_name": "robzor92/hops", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/NodesListManager.java", "license": "apache-2.0", "size": 20063 }
[ "org.apache.hadoop.net.Node", "org.apache.hadoop.yarn.api.records.NodeId" ]
import org.apache.hadoop.net.Node; import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.net.*; import org.apache.hadoop.yarn.api.records.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
63,688
public void actionPerformed(ActionEvent event) { String command = event.getActionCommand(); if (command.equals("PaletteChoice")) { attemptPaletteSelection(); } else if (command.equals("invertPalette")) { this.invertPalette = this.invertPaletteCheckBox.isSelected(); } else if (command.equals("stepPalette")) { this.stepPalette = this.stepPaletteCheckBox.isSelected(); } else { super.actionPerformed(event); // pass to super-class for handling } }
void function(ActionEvent event) { String command = event.getActionCommand(); if (command.equals(STR)) { attemptPaletteSelection(); } else if (command.equals(STR)) { this.invertPalette = this.invertPaletteCheckBox.isSelected(); } else if (command.equals(STR)) { this.stepPalette = this.stepPaletteCheckBox.isSelected(); } else { super.actionPerformed(event); } }
/** * Handles actions from within the property panel. * * @param event the event. */
Handles actions from within the property panel
actionPerformed
{ "repo_name": "SOCR/HTML5_WebSite", "path": "SOCR2.8/src/jfreechart/org/jfree/chart/editor/DefaultColorBarEditor.java", "license": "lgpl-3.0", "size": 8311 }
[ "java.awt.event.ActionEvent" ]
import java.awt.event.ActionEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
2,176,096
public Observable<ServiceResponseWithHeaders<Void, HeaderResponseEnumHeaders>> responseEnumWithServiceResponseAsync(String scenario) { if (scenario == null) { throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); }
Observable<ServiceResponseWithHeaders<Void, HeaderResponseEnumHeaders>> function(String scenario) { if (scenario == null) { throw new IllegalArgumentException(STR); }
/** * Get a response with header values "GREY" or null. * * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" * @return the {@link ServiceResponseWithHeaders} object if successful. */
Get a response with header values "GREY" or null
responseEnumWithServiceResponseAsync
{ "repo_name": "yugangw-msft/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/implementation/HeadersImpl.java", "license": "mit", "size": 118072 }
[ "com.microsoft.rest.ServiceResponseWithHeaders" ]
import com.microsoft.rest.ServiceResponseWithHeaders;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
397,251
protected String fixParameterName(String paramNameIn) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { //Fixed for 5.5+ if (((paramNameIn == null) || (paramNameIn.length() == 0)) && (!hasParametersView())) { throw SQLError.createSQLException( ((Messages.getString("CallableStatement.0") + paramNameIn) == null) //$NON-NLS-1$ ? Messages.getString("CallableStatement.15") : Messages.getString("CallableStatement.16"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); //$NON-NLS-1$ //$NON-NLS-2$ } if ((paramNameIn == null) && (hasParametersView())) { paramNameIn = "nullpn"; }; if (this.connection.getNoAccessToProcedureBodies()) { throw SQLError.createSQLException("No access to parameters by name when connection has been configured not to access procedure bodies", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } return mangleParameterName(paramNameIn); } }
String function(String paramNameIn) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { if (((paramNameIn == null) (paramNameIn.length() == 0)) && (!hasParametersView())) { throw SQLError.createSQLException( ((Messages.getString(STR) + paramNameIn) == null) ? Messages.getString(STR) : Messages.getString(STR), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } if ((paramNameIn == null) && (hasParametersView())) { paramNameIn = STR; }; if (this.connection.getNoAccessToProcedureBodies()) { throw SQLError.createSQLException(STR, SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } return mangleParameterName(paramNameIn); } }
/** * Adds 'at' symbol to beginning of parameter names if needed. * * @param paramNameIn * the parameter name to 'fix' * * @return the parameter name with an 'a' prepended, if needed * * @throws SQLException * if the parameter name is null or empty. */
Adds 'at' symbol to beginning of parameter names if needed
fixParameterName
{ "repo_name": "seadsystem/SchemaSpy", "path": "src/com/mysql/jdbc/CallableStatement.java", "license": "gpl-2.0", "size": 78297 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,116,921
public Map<String, NodeState> getChildren() { return children; }
Map<String, NodeState> function() { return children; }
/** * Returns the map of child nodes for iteration. * * @return The internal child map. */
Returns the map of child nodes for iteration
getChildren
{ "repo_name": "vespa-engine/vespa", "path": "documentapi/src/main/java/com/yahoo/documentapi/messagebus/systemstate/rule/NodeState.java", "license": "apache-2.0", "size": 10265 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,543,739
default Optional<? extends Result<? extends Immutable>> unify(ITerm term1, ITerm term2) throws OccursException { try { return unify(term1, term2, Predicate1.never()); } catch(RigidException e) { throw new IllegalStateException(e); } }
default Optional<? extends Result<? extends Immutable>> unify(ITerm term1, ITerm term2) throws OccursException { try { return unify(term1, term2, Predicate1.never()); } catch(RigidException e) { throw new IllegalStateException(e); } }
/** * Unify the two input terms. Return an updated unifier, or throw if the terms cannot be unified. */
Unify the two input terms. Return an updated unifier, or throw if the terms cannot be unified
unify
{ "repo_name": "metaborg/nabl", "path": "nabl2.terms/src/main/java/mb/nabl2/terms/unification/u/IUnifier.java", "license": "apache-2.0", "size": 12862 }
[ "java.util.Optional", "org.metaborg.util.functions.Predicate1" ]
import java.util.Optional; import org.metaborg.util.functions.Predicate1;
import java.util.*; import org.metaborg.util.functions.*;
[ "java.util", "org.metaborg.util" ]
java.util; org.metaborg.util;
2,030,936
public void setArguments(Vector arguments) { this.arguments = arguments; }
void function(Vector arguments) { this.arguments = arguments; }
/** * The arguments are the field defs of the parameters names and types to the procedure. */
The arguments are the field defs of the parameters names and types to the procedure
setArguments
{ "repo_name": "gameduell/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/tools/schemaframework/StoredProcedureDefinition.java", "license": "epl-1.0", "size": 17002 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
151,864
public synchronized void shutdownSender() throws NotificationServiceException { GenericLogger logger = getLogger(); if ( !isSenderTransportCalled ) { logger.error(TAG, "Sender service wasn't started"); throw new NotificationServiceException("Sender service wasn't started"); } logger.debug(TAG, "Stopping sender transport"); stopSenderTransport(logger); }//stopSender
synchronized void function() throws NotificationServiceException { GenericLogger logger = getLogger(); if ( !isSenderTransportCalled ) { logger.error(TAG, STR); throw new NotificationServiceException(STR); } logger.debug(TAG, STR); stopSenderTransport(logger); }
/** * Verifies that sender transport was started, then calls stopSenderTransport() * @throws NotificationServiceException */
Verifies that sender transport was started, then calls stopSenderTransport()
shutdownSender
{ "repo_name": "hybridgroup/alljoyn", "path": "alljoyn/services/notification/java/NotificationService/src/org/alljoyn/ns/transport/Transport.java", "license": "isc", "size": 17800 }
[ "org.alljoyn.ns.NotificationServiceException", "org.alljoyn.ns.commons.GenericLogger" ]
import org.alljoyn.ns.NotificationServiceException; import org.alljoyn.ns.commons.GenericLogger;
import org.alljoyn.ns.*; import org.alljoyn.ns.commons.*;
[ "org.alljoyn.ns" ]
org.alljoyn.ns;
1,891,675
public static UIFSplitPane createStrippedSplitPane( int orientation, Component leftComponent, Component rightComponent) { UIFSplitPane split = new UIFSplitPane(orientation, leftComponent, rightComponent); split.setBorder(EMPTY_BORDER); split.setOneTouchExpandable(false); return split; } // Accessing Properties **************************************************
static UIFSplitPane function( int orientation, Component leftComponent, Component rightComponent) { UIFSplitPane split = new UIFSplitPane(orientation, leftComponent, rightComponent); split.setBorder(EMPTY_BORDER); split.setOneTouchExpandable(false); return split; }
/** * Constructs a <code>UIFSplitPane</code>, * i.e. a <code>JSplitPane</code> that has no borders. * Also disabled the one touch exandable property. * * @param orientation <code>JSplitPane.HORIZONTAL_SPLIT</code> or * <code>JSplitPane.VERTICAL_SPLIT</code> * @param leftComponent the <code>Component</code> that will * appear on the left of a horizontally-split pane, * or at the top of a vertically-split pane * @param rightComponent the <code>Component</code> that will * appear on the right of a horizontally-split pane, * or at the bottom of a vertically-split pane * @throws IllegalArgumentException if <code>orientation</code> * is not one of: HORIZONTAL_SPLIT or VERTICAL_SPLIT */
Constructs a <code>UIFSplitPane</code>, i.e. a <code>JSplitPane</code> that has no borders. Also disabled the one touch exandable property
createStrippedSplitPane
{ "repo_name": "argonium/jsnip", "path": "src/io/miti/ui/component/UIFSplitPane.java", "license": "mit", "size": 11121 }
[ "java.awt.Component" ]
import java.awt.Component;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,742,115
void addJavaSnippetInfoToApplicableTempFiles(String curEnumName, YangPluginConfig pluginConfig) throws IOException { addAttributesForEnumClass(getEnumJavaAttribute(curEnumName), pluginConfig); }
void addJavaSnippetInfoToApplicableTempFiles(String curEnumName, YangPluginConfig pluginConfig) throws IOException { addAttributesForEnumClass(getEnumJavaAttribute(curEnumName), pluginConfig); }
/** * Adds the new attribute info to the target generated temporary files. * * @param curEnumName the attribute name that needs to be added to temporary * files * @throws IOException IO operation fail */
Adds the new attribute info to the target generated temporary files
addJavaSnippetInfoToApplicableTempFiles
{ "repo_name": "VinodKumarS-Huawei/ietf96yang", "path": "utils/yangutils/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaEnumerationFragmentFiles.java", "license": "apache-2.0", "size": 11052 }
[ "java.io.IOException", "org.onosproject.yangutils.utils.io.impl.YangPluginConfig" ]
import java.io.IOException; import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
import java.io.*; import org.onosproject.yangutils.utils.io.impl.*;
[ "java.io", "org.onosproject.yangutils" ]
java.io; org.onosproject.yangutils;
131,392
@Test @Ignore public void testWrite() throws Exception { when(mockWriteService.createWriter(any())).thenReturn(new FakeWriter()); writePipeline .apply("Generate sequence", GenerateSequence.from(0).to(numberRecords)) .apply( "Write records to Kudu", KuduIO.write() .withMasterAddresses("ignored") .withTable("ignored") .withFormatFn(new GenerateUpsert()) // ignored (mocking Operation is pointless) .withKuduService(mockWriteService)); writePipeline.run().waitUntilFinish(); for (int i = 1; i <= targetParallelism; i++) { expectedWriteLogs.verifyDebug(String.format(FakeWriter.LOG_OPEN_SESSION, i)); expectedWriteLogs.verifyDebug( String.format(FakeWriter.LOG_WRITE, i)); // at least one per writer expectedWriteLogs.verifyDebug(String.format(FakeWriter.LOG_CLOSE_SESSION, i)); } // verify all entries written for (int n = 0; n < numberRecords; n++) { expectedWriteLogs.verifyDebug( String.format(FakeWriter.LOG_WRITE_VALUE, n)); // at least one per writer } } private static class FakeWriter implements KuduService.Writer<Long> { private static final Logger LOG = LoggerFactory.getLogger(FakeWriter.class); static final String LOG_OPEN_SESSION = "FakeWriter[%d] openSession"; static final String LOG_WRITE = "FakeWriter[%d] write"; static final String LOG_WRITE_VALUE = "FakeWriter value[%d]"; static final String LOG_CLOSE_SESSION = "FakeWriter[%d] closeSession"; // share a counter across instances to uniquely identify the writers private static final AtomicInteger counter = new AtomicInteger(0); private transient int id = 0; // set on deserialization
void function() throws Exception { when(mockWriteService.createWriter(any())).thenReturn(new FakeWriter()); writePipeline .apply(STR, GenerateSequence.from(0).to(numberRecords)) .apply( STR, KuduIO.write() .withMasterAddresses(STR) .withTable(STR) .withFormatFn(new GenerateUpsert()) .withKuduService(mockWriteService)); writePipeline.run().waitUntilFinish(); for (int i = 1; i <= targetParallelism; i++) { expectedWriteLogs.verifyDebug(String.format(FakeWriter.LOG_OPEN_SESSION, i)); expectedWriteLogs.verifyDebug( String.format(FakeWriter.LOG_WRITE, i)); expectedWriteLogs.verifyDebug(String.format(FakeWriter.LOG_CLOSE_SESSION, i)); } for (int n = 0; n < numberRecords; n++) { expectedWriteLogs.verifyDebug( String.format(FakeWriter.LOG_WRITE_VALUE, n)); } } private static class FakeWriter implements KuduService.Writer<Long> { private static final Logger LOG = LoggerFactory.getLogger(FakeWriter.class); static final String LOG_OPEN_SESSION = STR; static final String LOG_WRITE = STR; static final String LOG_WRITE_VALUE = STR; static final String LOG_CLOSE_SESSION = STR; private static final AtomicInteger counter = new AtomicInteger(0); private transient int id = 0;
/** * Test the write path using a {@link FakeWriter} and verifies the expected log statements are * written. This test ensures that the {@link KuduIO} correctly respects parallelism by * deserializing writers and that each writer is opening and closing Kudu sessions. */
Test the write path using a <code>FakeWriter</code> and verifies the expected log statements are written. This test ensures that the <code>KuduIO</code> correctly respects parallelism by deserializing writers and that each writer is opening and closing Kudu sessions
testWrite
{ "repo_name": "lukecwik/incubator-beam", "path": "sdks/java/io/kudu/src/test/java/org/apache/beam/sdk/io/kudu/KuduIOTest.java", "license": "apache-2.0", "size": 11280 }
[ "java.util.concurrent.atomic.AtomicInteger", "org.apache.beam.sdk.io.GenerateSequence", "org.apache.beam.sdk.io.kudu.KuduTestUtils", "org.mockito.Mockito", "org.slf4j.Logger", "org.slf4j.LoggerFactory" ]
import java.util.concurrent.atomic.AtomicInteger; import org.apache.beam.sdk.io.GenerateSequence; import org.apache.beam.sdk.io.kudu.KuduTestUtils; import org.mockito.Mockito; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import java.util.concurrent.atomic.*; import org.apache.beam.sdk.io.*; import org.apache.beam.sdk.io.kudu.*; import org.mockito.*; import org.slf4j.*;
[ "java.util", "org.apache.beam", "org.mockito", "org.slf4j" ]
java.util; org.apache.beam; org.mockito; org.slf4j;
2,676,509
EClass getCallFunction();
EClass getCallFunction();
/** * Returns the meta object for class '{@link org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.CallFunction <em>Call Function</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Call Function</em>'. * @see org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.CallFunction * @generated */
Returns the meta object for class '<code>org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.CallFunction Call Function</code>'.
getCallFunction
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.testlanguages/src-gen/org/eclipse/xtext/testlanguages/backtracking/beeLangTestLanguage/BeeLangTestLanguagePackage.java", "license": "epl-1.0", "size": 161651 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
682,299
public void addRow(Expression[] expr) { list.add(expr); }
void function(Expression[] expr) { list.add(expr); }
/** * Add a row to this merge statement. * * @param expr the list of values */
Add a row to this merge statement
addRow
{ "repo_name": "ferquies/2dam", "path": "AD/Tema 2/h2/src/main/org/h2/command/dml/Merge.java", "license": "gpl-3.0", "size": 10027 }
[ "org.h2.expression.Expression" ]
import org.h2.expression.Expression;
import org.h2.expression.*;
[ "org.h2.expression" ]
org.h2.expression;
695,979
synchronized void receiveProbe (final InetAddress odinAgentAddr, final MACAddress clientHwAddress, String ssid) { if (odinAgentAddr == null || clientHwAddress == null || clientHwAddress.isBroadcast() || clientHwAddress.isMulticast() || agentManager.isTracked(odinAgentAddr) == false || poolManager.getNumNetworks() == 0) { return; } updateAgentLastHeard(odinAgentAddr); if (ssid.equals("")) { // FIXMeE: Are you sure this is right, the client can delete the network. // we just send probe responses IOdinAgent agent = agentManager.getAgent(odinAgentAddr); MACAddress bssid = poolManager.generateBssidForClient(clientHwAddress); // FIXME: Sub-optimal. We'll end up generating redundant probe requests Set<String> ssidSet = new TreeSet<String> (); for (String pool: poolManager.getPoolsForAgent(odinAgentAddr)) { if (pool.equals(PoolManager.GLOBAL_POOL)) //??????? continue; ssidSet.addAll(poolManager.getSsidListForPool(pool)); } executor.execute(new OdinAgentSendProbeResponseRunnable(agent, clientHwAddress, bssid, ssidSet)); return; } for (String pool: poolManager.getPoolsForAgent(odinAgentAddr)) { if (poolManager.getSsidListForPool(pool).contains(ssid)) { OdinClient oc = clientManager.getClient(clientHwAddress); // Hearing from this client for the first time if (oc == null) { List<String> ssidList = new ArrayList<String> (); ssidList.addAll(poolManager.getSsidListForPool(pool)); Lvap lvap = new Lvap (poolManager.generateBssidForClient(clientHwAddress), ssidList); //FIXME: WHy not before also? -- because only when you connect to the network u store it. try { oc = new OdinClient(clientHwAddress, InetAddress.getByName("0.0.0.0"), lvap); } catch (UnknownHostException e) { e.printStackTrace(); } clientManager.addClient(oc); } Lvap lvap = oc.getLvap(); assert (lvap != null); if (lvap.getAgent() == null) { // client is connecting for the // first time, had explicitly // disconnected, or knocked // out at as a result of an agent // failure.pr first time connections handoffClientToApInternal(PoolManager.GLOBAL_POOL, clientHwAddress, odinAgentAddr); } poolManager.mapClientToPool(oc, pool); return; } } }
synchronized void receiveProbe (final InetAddress odinAgentAddr, final MACAddress clientHwAddress, String ssid) { if (odinAgentAddr == null clientHwAddress == null clientHwAddress.isBroadcast() clientHwAddress.isMulticast() agentManager.isTracked(odinAgentAddr) == false poolManager.getNumNetworks() == 0) { return; } updateAgentLastHeard(odinAgentAddr); if (ssid.equals(STR0.0.0.0"), lvap); } catch (UnknownHostException e) { e.printStackTrace(); } clientManager.addClient(oc); } Lvap lvap = oc.getLvap(); assert (lvap != null); if (lvap.getAgent() == null) { handoffClientToApInternal(PoolManager.GLOBAL_POOL, clientHwAddress, odinAgentAddr); } poolManager.mapClientToPool(oc, pool); return; } } }
/** * Handle a probe message from an agent, triggered * by a particular client. * * @param odinAgentAddr InetAddress of agent * @param clientHwAddress MAC address of client that performed probe scan */
Handle a probe message from an agent, triggered by a particular client
receiveProbe
{ "repo_name": "Wi5/odin-wi5-controller", "path": "src/main/java/net/floodlightcontroller/odin/master/OdinMaster.java", "license": "apache-2.0", "size": 58489 }
[ "java.net.InetAddress", "java.net.UnknownHostException", "net.floodlightcontroller.util.MACAddress" ]
import java.net.InetAddress; import java.net.UnknownHostException; import net.floodlightcontroller.util.MACAddress;
import java.net.*; import net.floodlightcontroller.util.*;
[ "java.net", "net.floodlightcontroller.util" ]
java.net; net.floodlightcontroller.util;
360,329
@Nullable public static Player getPlayer(Object player) { if (player instanceof Player) return (Player)player; if (player instanceof IPlayerReference) return ((IPlayerReference)player).getPlayer(); if (player instanceof UUID) return getPlayer((UUID)player); if (player instanceof String) return getPlayer((String)player); return null; }
static Player function(Object player) { if (player instanceof Player) return (Player)player; if (player instanceof IPlayerReference) return ((IPlayerReference)player).getPlayer(); if (player instanceof UUID) return getPlayer((UUID)player); if (player instanceof String) return getPlayer((String)player); return null; }
/** * Get {@link Player} instance from provided object. * * <p>Attempts to retrieve the {@link Player} object from one of the following * types of objects:</p> * * <ul> * <li>{@link org.bukkit.entity.Player}</li> * <li>{@link IPlayerReference}</li> * <li>{@link java.util.UUID} (player ID)</li> * <li>{@link java.lang.String} (player name)</li> * </ul> * * @param player The object that represents a {@link Player}. * * @return The {@link Player} or null if not found. */
Get <code>Player</code> instance from provided object. Attempts to retrieve the <code>Player</code> object from one of the following types of objects: <code>org.bukkit.entity.Player</code> <code>IPlayerReference</code> <code>java.util.UUID</code> (player ID) <code>java.lang.String</code> (player name)
getPlayer
{ "repo_name": "JCThePants/NucleusFramework", "path": "src/com/jcwhatever/nucleus/utils/player/PlayerUtils.java", "license": "mit", "size": 17812 }
[ "com.jcwhatever.nucleus.mixins.IPlayerReference", "org.bukkit.entity.Player" ]
import com.jcwhatever.nucleus.mixins.IPlayerReference; import org.bukkit.entity.Player;
import com.jcwhatever.nucleus.mixins.*; import org.bukkit.entity.*;
[ "com.jcwhatever.nucleus", "org.bukkit.entity" ]
com.jcwhatever.nucleus; org.bukkit.entity;
573,652
public static void removeFromListStr(HttpSession session, String attr, List ids) { List pendingIds = (List) session.getAttribute(attr); if (pendingIds == null) { pendingIds = new ArrayList(); } session.setAttribute(attr, grepStrIds(pendingIds, ids)); }
static void function(HttpSession session, String attr, List ids) { List pendingIds = (List) session.getAttribute(attr); if (pendingIds == null) { pendingIds = new ArrayList(); } session.setAttribute(attr, grepStrIds(pendingIds, ids)); }
/** * Remove the given ids from the array of pending ids stored under * the named session attribute. * * @param session the http session * @param attr the name of the session attribute * @param ids the ids to be removed */
Remove the given ids from the array of pending ids stored under the named session attribute
removeFromListStr
{ "repo_name": "cc14514/hq6", "path": "hq-web/src/main/java/org/hyperic/hq/ui/util/SessionUtils.java", "license": "unlicense", "size": 25054 }
[ "java.util.ArrayList", "java.util.List", "javax.servlet.http.HttpSession" ]
import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpSession;
import java.util.*; import javax.servlet.http.*;
[ "java.util", "javax.servlet" ]
java.util; javax.servlet;
2,201,176