method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void setMin(double min) { double roundedMin = getRoundedValue(min); getState().minValue = roundedMin; if (getMax() < roundedMin) { getState().maxValue = roundedMin; } if (getValue() < roundedMin) { setValue(roundedMin); } } /** * Gets the current orientation of the slider (horizontal or vertical). * * @return {@link SliderOrientation#HORIZONTAL} or * {@link SliderOrientation#VERTICAL}
void function(double min) { double roundedMin = getRoundedValue(min); getState().minValue = roundedMin; if (getMax() < roundedMin) { getState().maxValue = roundedMin; } if (getValue() < roundedMin) { setValue(roundedMin); } } /** * Gets the current orientation of the slider (horizontal or vertical). * * @return {@link SliderOrientation#HORIZONTAL} or * {@link SliderOrientation#VERTICAL}
/** * Sets the minimum slider value. If the current value of the slider is * smaller than this, the value is set to the new minimum. * * @param min * The new minimum slider value */
Sets the minimum slider value. If the current value of the slider is smaller than this, the value is set to the new minimum
setMin
{ "repo_name": "Darsstar/framework", "path": "server/src/main/java/com/vaadin/ui/Slider.java", "license": "apache-2.0", "size": 11102 }
[ "com.vaadin.shared.ui.slider.SliderOrientation" ]
import com.vaadin.shared.ui.slider.SliderOrientation;
import com.vaadin.shared.ui.slider.*;
[ "com.vaadin.shared" ]
com.vaadin.shared;
2,303,341
public void setRootViewId(int id) { mRootView = (ViewGroup) mInflater.inflate(id, null); mTrack = (ViewGroup) mRootView.findViewById(R.id.tracks); mArrowDown = (ImageView) mRootView.findViewById(R.id.arrow_down); mArrowUp = (ImageView) mRootView.findViewById(R.id.arrow_up); mScroller = (ScrollView) mRootView.findViewById(R.id.scroller); //This was previously defined on show() method, moved here to prevent force close that occurred //when tapping fastly on a view to show quickaction dialog. //Thanx to zammbi (github.com/zammbi) mRootView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); setContentView(mRootView); }
void function(int id) { mRootView = (ViewGroup) mInflater.inflate(id, null); mTrack = (ViewGroup) mRootView.findViewById(R.id.tracks); mArrowDown = (ImageView) mRootView.findViewById(R.id.arrow_down); mArrowUp = (ImageView) mRootView.findViewById(R.id.arrow_up); mScroller = (ScrollView) mRootView.findViewById(R.id.scroller); mRootView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); setContentView(mRootView); }
/** * Set root view. * * @param id Layout resource id */
Set root view
setRootViewId
{ "repo_name": "ethragur/SMRTMS", "path": "app/src/main/java/net/londatiga/android/QuickAction.java", "license": "gpl-2.0", "size": 11187 }
[ "android.view.ViewGroup", "android.widget.ImageView", "android.widget.ScrollView" ]
import android.view.ViewGroup; import android.widget.ImageView; import android.widget.ScrollView;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
413,836
public boolean load() { if (!Files.exists(deobfMapFile)) { return false; } LOG.info("Loading obfuscation map from: {}", deobfMapFile.toAbsolutePath()); try { List<String> lines = Files.readAllLines(deobfMapFile, MAP_FILE_CHARSET); for (String l : lines) { l = l.trim(); if (l.isEmpty() || l.startsWith("#")) { continue; } String[] va = splitAndTrim(l); if (va.length != 2) { continue; } String origName = va[0]; String alias = va[1]; switch (l.charAt(0)) { case 'p': pkgPresetMap.put(origName, alias); break; case 'c': clsPresetMap.put(origName, alias); break; case 'f': fldPresetMap.put(origName, alias); break; case 'm': mthPresetMap.put(origName, alias); break; case 'v': // deprecated break; } } return true; } catch (Exception e) { LOG.error("Failed to load deobfuscation map file '{}'", deobfMapFile.toAbsolutePath(), e); return false; } }
boolean function() { if (!Files.exists(deobfMapFile)) { return false; } LOG.info(STR, deobfMapFile.toAbsolutePath()); try { List<String> lines = Files.readAllLines(deobfMapFile, MAP_FILE_CHARSET); for (String l : lines) { l = l.trim(); if (l.isEmpty() l.startsWith("#")) { continue; } String[] va = splitAndTrim(l); if (va.length != 2) { continue; } String origName = va[0]; String alias = va[1]; switch (l.charAt(0)) { case 'p': pkgPresetMap.put(origName, alias); break; case 'c': clsPresetMap.put(origName, alias); break; case 'f': fldPresetMap.put(origName, alias); break; case 'm': mthPresetMap.put(origName, alias); break; case 'v': break; } } return true; } catch (Exception e) { LOG.error(STR, deobfMapFile.toAbsolutePath(), e); return false; } }
/** * Loads deobfuscator presets */
Loads deobfuscator presets
load
{ "repo_name": "skylot/jadx", "path": "jadx-core/src/main/java/jadx/core/deobf/DeobfPresets.java", "license": "apache-2.0", "size": 5219 }
[ "java.nio.file.Files", "java.util.List" ]
import java.nio.file.Files; import java.util.List;
import java.nio.file.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
2,899,165
@see org.hl7.rim.QuerySpec#setResponsePriorityCode */ public void setResponsePriorityCode(CS responsePriorityCode) { if(responsePriorityCode instanceof org.hl7.hibernate.ClonableCollection) responsePriorityCode = ((org.hl7.hibernate.ClonableCollection<CS>) responsePriorityCode).cloneHibernateCollectionIfNecessary(); _responsePriorityCode = responsePriorityCode; }
@see org.hl7.rim.QuerySpec#setResponsePriorityCode */ void function(CS responsePriorityCode) { if(responsePriorityCode instanceof org.hl7.hibernate.ClonableCollection) responsePriorityCode = ((org.hl7.hibernate.ClonableCollection<CS>) responsePriorityCode).cloneHibernateCollectionIfNecessary(); _responsePriorityCode = responsePriorityCode; }
/** Sets the property responsePriorityCode. @see org.hl7.rim.QuerySpec#setResponsePriorityCode */
Sets the property responsePriorityCode
setResponsePriorityCode
{ "repo_name": "markusgumbel/dshl7", "path": "hl7-javasig/gencode/org/hl7/rim/impl/QuerySpecImpl.java", "license": "apache-2.0", "size": 9375 }
[ "org.hl7.rim.QuerySpec" ]
import org.hl7.rim.QuerySpec;
import org.hl7.rim.*;
[ "org.hl7.rim" ]
org.hl7.rim;
2,132,212
private void paintCurrentValues(Graphics2D g, FontMetrics fontMetrics) { g.setColor(fontColor); String s = ""+model.getStartValue(); g.drawString(s, startLabelRect.x, fontMetrics.getHeight()); //g.translate(startLabelRect.x, 0); //paintHorizontalLabel(g, fontMetrics, model.getStartValue()); //g.translate(-startLabelRect.x, 0); s = ""+model.getEndValue(); g.drawString(s, startLabelRect.y, fontMetrics.getHeight()); //g.translate(endLabelRect.x, 0); //paintHorizontalLabel(g, fontMetrics, model.getEndValue()); //g.translate(-endLabelRect.x, 0); }
void function(Graphics2D g, FontMetrics fontMetrics) { g.setColor(fontColor); String s = STR"+model.getEndValue(); g.drawString(s, startLabelRect.y, fontMetrics.getHeight()); }
/** * Paints the current values. * * @param g The graphics context. * @param fontMetrics Information on how to render the font. */
Paints the current values
paintCurrentValues
{ "repo_name": "jballanc/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/ui/slider/TwoKnobsSliderUI.java", "license": "gpl-2.0", "size": 22559 }
[ "java.awt.FontMetrics", "java.awt.Graphics2D" ]
import java.awt.FontMetrics; import java.awt.Graphics2D;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,295,997
if (this.processorFactoryList == null) { this.processorFactoryList = new ArrayList<>(); } return this.processorFactoryList; }
if (this.processorFactoryList == null) { this.processorFactoryList = new ArrayList<>(); } return this.processorFactoryList; }
/** * This method gets the {@link List} of {@link #addProcessorFactory(DetectorStreamProcessorFactory) registered} * {@link DetectorStreamProcessorFactory}-instances. * * @return the processorFactoryList */
This method gets the <code>List</code> of <code>#addProcessorFactory(DetectorStreamProcessorFactory) registered</code> <code>DetectorStreamProcessorFactory</code>-instances
getProcessorFactoryList
{ "repo_name": "m-m-m/util", "path": "io/src/main/java/net/sf/mmm/util/io/base/AbstractDetectorStreamProvider.java", "license": "apache-2.0", "size": 3859 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,588,769
@Override public void push(Group group) { if (group != null) { String groupName = group.getName(); Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName); ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); Repository[] repositories = obrService.listRepositories(); for (Repository repository : repositories) { if (isAllowed(group, Constants.URLS_CONFIG_CATEGORY, repository.getURI().toString(), EventType.OUTBOUND)) { LOGGER.debug("CELLAR OBR: adding repository {} to the cluster", repository.getURI().toString()); // update cluster state clusterUrls.add(repository.getURI().toString()); // send cluster event ClusterObrUrlEvent urlEvent = new ClusterObrUrlEvent(repository.getURI().toString(), Constants.URL_ADD_EVENT_TYPE); urlEvent.setSourceGroup(group); urlEvent.setSourceNode(clusterManager.getNode()); urlEvent.setLocal(clusterManager.getNode()); eventProducer.produce(urlEvent); // update OBR bundles in the cluster group Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName); Resource[] resources = repository.getResources(); for (Resource resource : resources) { LOGGER.debug("CELLAR OBR: adding bundle {} to the cluster", resource.getPresentationName()); ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString()); clusterBundles.add(info); } } else { LOGGER.trace("CELLAR OBR: URL {} is marked BLOCKED OUTBOUND for cluster group {}", repository.getURI().toString(), groupName); } } } finally { Thread.currentThread().setContextClassLoader(originalClassLoader); } } }
void function(Group group) { if (group != null) { String groupName = group.getName(); Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName); ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); Repository[] repositories = obrService.listRepositories(); for (Repository repository : repositories) { if (isAllowed(group, Constants.URLS_CONFIG_CATEGORY, repository.getURI().toString(), EventType.OUTBOUND)) { LOGGER.debug(STR, repository.getURI().toString()); clusterUrls.add(repository.getURI().toString()); ClusterObrUrlEvent urlEvent = new ClusterObrUrlEvent(repository.getURI().toString(), Constants.URL_ADD_EVENT_TYPE); urlEvent.setSourceGroup(group); urlEvent.setSourceNode(clusterManager.getNode()); urlEvent.setLocal(clusterManager.getNode()); eventProducer.produce(urlEvent); Set<ObrBundleInfo> clusterBundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName); Resource[] resources = repository.getResources(); for (Resource resource : resources) { LOGGER.debug(STR, resource.getPresentationName()); ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString()); clusterBundles.add(info); } } else { LOGGER.trace(STR, repository.getURI().toString(), groupName); } } } finally { Thread.currentThread().setContextClassLoader(originalClassLoader); } } }
/** * Push the local OBR URLs to a cluster group. * * @param group the cluster group. */
Push the local OBR URLs to a cluster group
push
{ "repo_name": "mcculls/karaf-cellar", "path": "obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java", "license": "apache-2.0", "size": 8616 }
[ "java.util.Set", "org.apache.felix.bundlerepository.Repository", "org.apache.felix.bundlerepository.Resource", "org.apache.karaf.cellar.core.Configurations", "org.apache.karaf.cellar.core.Group", "org.apache.karaf.cellar.core.event.EventType" ]
import java.util.Set; import org.apache.felix.bundlerepository.Repository; import org.apache.felix.bundlerepository.Resource; import org.apache.karaf.cellar.core.Configurations; import org.apache.karaf.cellar.core.Group; import org.apache.karaf.cellar.core.event.EventType;
import java.util.*; import org.apache.felix.bundlerepository.*; import org.apache.karaf.cellar.core.*; import org.apache.karaf.cellar.core.event.*;
[ "java.util", "org.apache.felix", "org.apache.karaf" ]
java.util; org.apache.felix; org.apache.karaf;
777,064
public FetchFieldsContext fetchFieldsContext() { return searchContext.fetchFieldsContext(); }
FetchFieldsContext function() { return searchContext.fetchFieldsContext(); }
/** * Configuration for the 'fields' response */
Configuration for the 'fields' response
fetchFieldsContext
{ "repo_name": "ern/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/fetch/FetchContext.java", "license": "apache-2.0", "size": 7098 }
[ "org.elasticsearch.search.fetch.subphase.FetchFieldsContext" ]
import org.elasticsearch.search.fetch.subphase.FetchFieldsContext;
import org.elasticsearch.search.fetch.subphase.*;
[ "org.elasticsearch.search" ]
org.elasticsearch.search;
1,599,001
@Test public void additionalCasesTest() { // testing with string property with null fields StringProperty stringProperty = new StringProperty(null, "value"); stringProperty.setGroup("group"); propertyTest(stringProperty); stringProperty = new StringProperty("key", null); stringProperty.setGroup("group"); propertyTest(stringProperty); stringProperty = new StringProperty("key", "value"); propertyTest(stringProperty); // testing with biggest number property with null fields DoubleProperty doubleProperty = new DoubleProperty(null, Double.MAX_VALUE); doubleProperty.setGroup("group"); propertyTest(doubleProperty); doubleProperty = new DoubleProperty("key", null); doubleProperty.setGroup("group"); propertyTest(doubleProperty); doubleProperty = new DoubleProperty("key", Double.MAX_VALUE); propertyTest(doubleProperty); // testing with date property with null fields DateProperty dateProperty = new DateProperty(null, new Date()); dateProperty.setGroup("group"); propertyTest(dateProperty); dateProperty = new DateProperty("key", null); dateProperty.setGroup("group"); propertyTest(dateProperty); dateProperty = new DateProperty("key", new Date()); propertyTest(dateProperty); }
void function() { StringProperty stringProperty = new StringProperty(null, "value"); stringProperty.setGroup("group"); propertyTest(stringProperty); stringProperty = new StringProperty("key", null); stringProperty.setGroup("group"); propertyTest(stringProperty); stringProperty = new StringProperty("key", "value"); propertyTest(stringProperty); DoubleProperty doubleProperty = new DoubleProperty(null, Double.MAX_VALUE); doubleProperty.setGroup("group"); propertyTest(doubleProperty); doubleProperty = new DoubleProperty("key", null); doubleProperty.setGroup("group"); propertyTest(doubleProperty); doubleProperty = new DoubleProperty("key", Double.MAX_VALUE); propertyTest(doubleProperty); DateProperty dateProperty = new DateProperty(null, new Date()); dateProperty.setGroup("group"); propertyTest(dateProperty); dateProperty = new DateProperty("key", null); dateProperty.setGroup("group"); propertyTest(dateProperty); dateProperty = new DateProperty("key", new Date()); propertyTest(dateProperty); }
/** * Additional cases test for better code coverage. */
Additional cases test for better code coverage
additionalCasesTest
{ "repo_name": "Squadity/bb-gest", "path": "nosql/mongo/test/junit/net/bolbat/gest/nosql/mongo/util/PropertyMapperTest.java", "license": "mit", "size": 4240 }
[ "java.util.Date", "net.bolbat.kit.property.DateProperty", "net.bolbat.kit.property.DoubleProperty", "net.bolbat.kit.property.StringProperty" ]
import java.util.Date; import net.bolbat.kit.property.DateProperty; import net.bolbat.kit.property.DoubleProperty; import net.bolbat.kit.property.StringProperty;
import java.util.*; import net.bolbat.kit.property.*;
[ "java.util", "net.bolbat.kit" ]
java.util; net.bolbat.kit;
2,007,719
public INDArray[] output(Pair<String, INDArray>... inputs) { return output(0, inputs); }
INDArray[] function(Pair<String, INDArray>... inputs) { return output(0, inputs); }
/** * This method sends inference request to the GraphServer instance, and returns result as array of INDArrays * * PLEASE NOTE: This call will be routed to default graph with id 0 * @param inputs graph inputs with their string ides * @return */
This method sends inference request to the GraphServer instance, and returns result as array of INDArrays
output
{ "repo_name": "deeplearning4j/deeplearning4j", "path": "nd4j/nd4j-remote/nd4j-grpc-client/src/main/java/org/nd4j/remote/grpc/GraphInferenceGrpcClient.java", "license": "apache-2.0", "size": 7602 }
[ "org.nd4j.common.primitives.Pair", "org.nd4j.linalg.api.ndarray.INDArray" ]
import org.nd4j.common.primitives.Pair; import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.common.primitives.*; import org.nd4j.linalg.api.ndarray.*;
[ "org.nd4j.common", "org.nd4j.linalg" ]
org.nd4j.common; org.nd4j.linalg;
552,227
Map<String, DataObject> getDataObjectsLocal(String executionId, Collection<String> dataObjectNames, String locale, boolean withLocalizationFallback);
Map<String, DataObject> getDataObjectsLocal(String executionId, Collection<String> dataObjectNames, String locale, boolean withLocalizationFallback);
/** * The DataObjects for the given dataObjectNames only taking the given execution scope into account, not looking in outer scopes. * * @param executionId * id of execution, cannot be null. * @param dataObjectNames * the collection of DataObject names that should be retrieved. * @param locale * locale the DataObject name and description should be returned in (if available). * @param withLocalizationFallback * When true localization will fallback to more general locales if the specified locale is not found. * @return the DataObjects or an empty map if no DataObjects are found. * @throws FlowableObjectNotFoundException * when no execution is found for the given executionId. */
The DataObjects for the given dataObjectNames only taking the given execution scope into account, not looking in outer scopes
getDataObjectsLocal
{ "repo_name": "marcus-nl/flowable-engine", "path": "modules/flowable-engine/src/main/java/org/flowable/engine/RuntimeService.java", "license": "apache-2.0", "size": 61256 }
[ "java.util.Collection", "java.util.Map", "org.flowable.engine.runtime.DataObject" ]
import java.util.Collection; import java.util.Map; import org.flowable.engine.runtime.DataObject;
import java.util.*; import org.flowable.engine.runtime.*;
[ "java.util", "org.flowable.engine" ]
java.util; org.flowable.engine;
367,900
@Override UnmodifiableBlockVolume getBlockView(Vector3i newMin, Vector3i newMax);
UnmodifiableBlockVolume getBlockView(Vector3i newMin, Vector3i newMax);
/** * Returns a new volume that is the same or smaller than the current * volume. This does not copy the blocks, it only provides a new view * of the storage. * * @param newMin The new minimum coordinates in this volume * @param newMax The new maximum coordinates in this volume * @return The new volume with the new bounds * @throws PositionOutOfBoundsException If the new minimum and maximum * are outside the current volume */
Returns a new volume that is the same or smaller than the current volume. This does not copy the blocks, it only provides a new view of the storage
getBlockView
{ "repo_name": "joshgarde/SpongeAPI", "path": "src/main/java/org/spongepowered/api/world/extent/UnmodifiableBlockVolume.java", "license": "mit", "size": 2990 }
[ "com.flowpowered.math.vector.Vector3i" ]
import com.flowpowered.math.vector.Vector3i;
import com.flowpowered.math.vector.*;
[ "com.flowpowered.math" ]
com.flowpowered.math;
1,366,996
public Connector getConnector(SecurityContext ctx, boolean recreate, boolean permitNull) throws DSOutOfServiceException { try { isNetworkUp(true); // Need safe version? } catch (Exception e1) { if (permitNull) { if (log != null) log.warn( this, new LogMessage( "Failed to check network. Returning null connector", e1)); return null; } throw new DSOutOfServiceException("Network not available", e1, ConnectionStatus.NETWORK); } if (!isNetworkUp(true)) { if (permitNull) { if (log != null) log.warn(this, "Network down. Returning null connector"); return null; } throw new DSOutOfServiceException( "Network down. Returning null connector", ConnectionStatus.NETWORK); } if (ctx == null) { if (permitNull) { if (log != null) log.warn(this, "Null SecurityContext"); return null; } throw new DSOutOfServiceException("Null SecurityContext"); } Connector c = null; List<Connector> clist = groupConnectorMap.get(ctx.getGroupID()); if (clist.size() > 0) { c = clist.get(0); if (c.needsKeepAlive()) { // Check if network is up before keeping service otherwise // we block until timeout. try { isNetworkUp(true); } catch (Exception e) { throw new DSOutOfServiceException("Network down.", e, ConnectionStatus.NETWORK); } if (!c.keepSessionAlive()) { throw new DSOutOfServiceException( "Network down. Session not alive", ConnectionStatus.LOST_CONNECTION); } } } // We are going to create a connector and activate a session. if (c == null) { if (recreate) c = createConnector(ctx, permitNull); else { if (permitNull) { if (log != null) log.warn(this, "Cannot re-create. Returning null connector"); return null; } throw new DSOutOfServiceException("Not allowed to recreate"); } } ExperimenterData exp = ctx.getExperimenterData(); if (exp != null && ctx.isSudo()) { try { c = c.getConnector(exp.getUserName()); } catch (Throwable e) { throw new DSOutOfServiceException("Could not derive connector", e); } } return c; }
Connector function(SecurityContext ctx, boolean recreate, boolean permitNull) throws DSOutOfServiceException { try { isNetworkUp(true); } catch (Exception e1) { if (permitNull) { if (log != null) log.warn( this, new LogMessage( STR, e1)); return null; } throw new DSOutOfServiceException(STR, e1, ConnectionStatus.NETWORK); } if (!isNetworkUp(true)) { if (permitNull) { if (log != null) log.warn(this, STR); return null; } throw new DSOutOfServiceException( STR, ConnectionStatus.NETWORK); } if (ctx == null) { if (permitNull) { if (log != null) log.warn(this, STR); return null; } throw new DSOutOfServiceException(STR); } Connector c = null; List<Connector> clist = groupConnectorMap.get(ctx.getGroupID()); if (clist.size() > 0) { c = clist.get(0); if (c.needsKeepAlive()) { try { isNetworkUp(true); } catch (Exception e) { throw new DSOutOfServiceException(STR, e, ConnectionStatus.NETWORK); } if (!c.keepSessionAlive()) { throw new DSOutOfServiceException( STR, ConnectionStatus.LOST_CONNECTION); } } } if (c == null) { if (recreate) c = createConnector(ctx, permitNull); else { if (permitNull) { if (log != null) log.warn(this, STR); return null; } throw new DSOutOfServiceException(STR); } } ExperimenterData exp = ctx.getExperimenterData(); if (exp != null && ctx.isSudo()) { try { c = c.getConnector(exp.getUserName()); } catch (Throwable e) { throw new DSOutOfServiceException(STR, e); } } return c; }
/** * Returns the connector corresponding to the passed context. * * @param ctx * The security context. * @param recreate * whether or not to allow the recreation of the * {@link Connector}. A {@link DSOutOfServiceException} is thrown * if this is set to false and no {@link Connector} is available. * @param permitNull * whether or not to throw a {@link DSOutOfServiceException} if * no {@link Connector} is available by the end of the execution. * @return */
Returns the connector corresponding to the passed context
getConnector
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/blitz/src/omero/gateway/Gateway.java", "license": "gpl-2.0", "size": 45421 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,661,134
private void writeAttributes (Attributes atts) throws IOException, SAXException { int len = atts.getLength(); for (int i = 0; i < len; i++) { char ch[] = atts.getValue(i).toCharArray(); write(' '); writeName(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), false); write("=\""); writeEsc(ch, 0, ch.length, true); write('"'); } }
void function (Attributes atts) throws IOException, SAXException { int len = atts.getLength(); for (int i = 0; i < len; i++) { char ch[] = atts.getValue(i).toCharArray(); write(' '); writeName(atts.getURI(i), atts.getLocalName(i), atts.getQName(i), false); write("=\"STR'); } }
/** * Write out an attribute list, escaping values. * * The names will have prefixes added to them. * * @param atts The attribute list to write. * @exception SAXException If there is an error writing * the attribute list, this method will throw an * IOException wrapped in a SAXException. */
Write out an attribute list, escaping values. The names will have prefixes added to them
writeAttributes
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java", "license": "mit", "size": 34960 }
[ "java.io.IOException", "org.xml.sax.Attributes", "org.xml.sax.SAXException" ]
import java.io.IOException; import org.xml.sax.Attributes; import org.xml.sax.SAXException;
import java.io.*; import org.xml.sax.*;
[ "java.io", "org.xml.sax" ]
java.io; org.xml.sax;
2,399,389
public boolean isEdge(GeometryIndex index) { return false; }
boolean function(GeometryIndex index) { return false; }
/** * Does the given index point to an edge or not? We look at the deepest level to check this. * * @param index * The index to check. * @return true or false. */
Does the given index point to an edge or not? We look at the deepest level to check this
isEdge
{ "repo_name": "geomajas/geomajas-project-client-gwt", "path": "plugin/editing/editing-javascript-api/src/main/java/org/geomajas/plugin/editing/jsapi/client/service/JsGeometryIndexService.java", "license": "agpl-3.0", "size": 11965 }
[ "org.geomajas.plugin.editing.client.service.GeometryIndex" ]
import org.geomajas.plugin.editing.client.service.GeometryIndex;
import org.geomajas.plugin.editing.client.service.*;
[ "org.geomajas.plugin" ]
org.geomajas.plugin;
1,299,665
@Test public void shouldCreateClauseWithGivenConditionAndMessage() { // Given final String condition = "age >= 0"; final String message = "persons age cannot be negative"; // When final Clause clause = ContractFactory.clause(condition, message); // Then Assert.assertEquals("The created clause has a wrong condition", clause.value(), condition); Assert.assertEquals("The created clause has a wrong message", clause.message(), message); Assert.assertEquals("The created clause has a wrong exception", clause.exception(), IllegalArgumentException.class); Assert.assertEquals("The created clause has a wrong annotation type", clause.annotationType(), Clause.class); }
void function() { final String condition = STR; final String message = STR; final Clause clause = ContractFactory.clause(condition, message); Assert.assertEquals(STR, clause.value(), condition); Assert.assertEquals(STR, clause.message(), message); Assert.assertEquals(STR, clause.exception(), IllegalArgumentException.class); Assert.assertEquals(STR, clause.annotationType(), Clause.class); }
/** * Ensures that the returned clause contains the given condition and message. */
Ensures that the returned clause contains the given condition and message
shouldCreateClauseWithGivenConditionAndMessage
{ "repo_name": "sebhoss/annotated-contracts", "path": "contract-core/contract-testutils/src/test/java/com/github/sebhoss/contract/utils/ContractFactoryClauseCreationTest.java", "license": "unlicense", "size": 6415 }
[ "com.github.sebhoss.contract.annotation.Clause", "org.junit.Assert" ]
import com.github.sebhoss.contract.annotation.Clause; import org.junit.Assert;
import com.github.sebhoss.contract.annotation.*; import org.junit.*;
[ "com.github.sebhoss", "org.junit" ]
com.github.sebhoss; org.junit;
2,183,015
void onRightClick(World world, LivingEntity entity);
void onRightClick(World world, LivingEntity entity);
/** * On item is right clicked, i.e. used. * * @param world world object. * @param entity entity object. */
On item is right clicked, i.e. used
onRightClick
{ "repo_name": "athrane/bassebombecraft", "path": "src/main/java/bassebombecraft/item/action/RightClickedItemAction.java", "license": "gpl-3.0", "size": 753 }
[ "net.minecraft.entity.LivingEntity", "net.minecraft.world.World" ]
import net.minecraft.entity.LivingEntity; import net.minecraft.world.World;
import net.minecraft.entity.*; import net.minecraft.world.*;
[ "net.minecraft.entity", "net.minecraft.world" ]
net.minecraft.entity; net.minecraft.world;
2,045,397
@Test public void testSave() { // Fetch the file from cache table List<RepoFileMetaData> listOfRepoFiles = repoFileMetaDataDao .getRepoListForStorageDomain(FixturesTool.STORAGE_DOAMIN_NFS_ISO, FileTypeExtension.ISO); assertNotNull(listOfRepoFiles); assertSame(listOfRepoFiles.isEmpty(), true); RepoFileMetaData newRepoFileMap = getNewIsoRepoFile(); repoFileMetaDataDao.addRepoFileMap(newRepoFileMap); listOfRepoFiles = repoFileMetaDataDao .getRepoListForStorageDomain(FixturesTool.STORAGE_DOAMIN_NFS_ISO, FileTypeExtension.ISO); assertSame(listOfRepoFiles.isEmpty(), false); }
void function() { List<RepoFileMetaData> listOfRepoFiles = repoFileMetaDataDao .getRepoListForStorageDomain(FixturesTool.STORAGE_DOAMIN_NFS_ISO, FileTypeExtension.ISO); assertNotNull(listOfRepoFiles); assertSame(listOfRepoFiles.isEmpty(), true); RepoFileMetaData newRepoFileMap = getNewIsoRepoFile(); repoFileMetaDataDao.addRepoFileMap(newRepoFileMap); listOfRepoFiles = repoFileMetaDataDao .getRepoListForStorageDomain(FixturesTool.STORAGE_DOAMIN_NFS_ISO, FileTypeExtension.ISO); assertSame(listOfRepoFiles.isEmpty(), false); }
/** * Ensures that saving a domain works as expected. */
Ensures that saving a domain works as expected
testSave
{ "repo_name": "derekhiggins/ovirt-engine", "path": "backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/RepoFileMetaDataDAOTest.java", "license": "apache-2.0", "size": 13014 }
[ "java.util.List", "org.junit.Assert", "org.ovirt.engine.core.common.businessentities.FileTypeExtension", "org.ovirt.engine.core.common.businessentities.RepoFileMetaData" ]
import java.util.List; import org.junit.Assert; import org.ovirt.engine.core.common.businessentities.FileTypeExtension; import org.ovirt.engine.core.common.businessentities.RepoFileMetaData;
import java.util.*; import org.junit.*; import org.ovirt.engine.core.common.businessentities.*;
[ "java.util", "org.junit", "org.ovirt.engine" ]
java.util; org.junit; org.ovirt.engine;
86,172
@Test public void testGenerateDomainLimit() throws Exception { ArrayList<URLCrawlDatum> list = new ArrayList<URLCrawlDatum>(); list.add(createURLCrawlDatum("http://a.example.com/index.html", 1, 1)); list.add(createURLCrawlDatum("http://b.example.com/index.html", 1, 1)); list.add(createURLCrawlDatum("http://c.example.com/index.html", 1, 1)); createCrawlDB(list); Configuration myConfiguration = new Configuration(conf); myConfiguration.setInt(Generator.GENERATOR_MAX_COUNT, 2); myConfiguration.set(Generator.GENERATOR_COUNT_MODE, Generator.GENERATOR_COUNT_VALUE_DOMAIN); Path generatedSegment = generateFetchlist(Integer.MAX_VALUE, myConfiguration, false); Path fetchlistPath = new Path(new Path(generatedSegment, CrawlDatum.GENERATE_DIR_NAME), "part-00000"); ArrayList<URLCrawlDatum> fetchList = readContents(fetchlistPath); // verify we got right amount of records Assert.assertEquals(1, fetchList.size()); myConfiguration = new Configuration(myConfiguration); myConfiguration.setInt(Generator.GENERATOR_MAX_COUNT, 3); generatedSegment = generateFetchlist(Integer.MAX_VALUE, myConfiguration, false); fetchlistPath = new Path(new Path(generatedSegment, CrawlDatum.GENERATE_DIR_NAME), "part-00000"); fetchList = readContents(fetchlistPath); // verify we got right amount of records Assert.assertEquals(2, fetchList.size()); myConfiguration = new Configuration(myConfiguration); myConfiguration.setInt(Generator.GENERATOR_MAX_COUNT, 4); generatedSegment = generateFetchlist(Integer.MAX_VALUE, myConfiguration, false); fetchlistPath = new Path(new Path(generatedSegment, CrawlDatum.GENERATE_DIR_NAME), "part-00000"); fetchList = readContents(fetchlistPath); // verify we got right amount of records Assert.assertEquals(3, fetchList.size()); }
void function() throws Exception { ArrayList<URLCrawlDatum> list = new ArrayList<URLCrawlDatum>(); list.add(createURLCrawlDatum(STRhttp: list.add(createURLCrawlDatum(STRpart-00000STRpart-00000STRpart-00000"); fetchList = readContents(fetchlistPath); Assert.assertEquals(3, fetchList.size()); }
/** * Test that generator obeys the property "generator.max.count" and * "generator.count.per.domain". * * @throws Exception */
Test that generator obeys the property "generator.max.count" and "generator.count.per.domain"
testGenerateDomainLimit
{ "repo_name": "gitriver/nutch-learning", "path": "src/test/org/apache/nutch/crawl/TestGenerator.java", "license": "apache-2.0", "size": 12188 }
[ "java.util.ArrayList", "org.apache.nutch.crawl.CrawlDBTestUtil", "org.junit.Assert" ]
import java.util.ArrayList; import org.apache.nutch.crawl.CrawlDBTestUtil; import org.junit.Assert;
import java.util.*; import org.apache.nutch.crawl.*; import org.junit.*;
[ "java.util", "org.apache.nutch", "org.junit" ]
java.util; org.apache.nutch; org.junit;
1,153,775
@Override public int read(final char[] cbuf, final int off, final int len) throws UncheckedIOException { try { return super.read(cbuf, off, len); } catch (final IOException e) { throw uncheck(e); } }
int function(final char[] cbuf, final int off, final int len) throws UncheckedIOException { try { return super.read(cbuf, off, len); } catch (final IOException e) { throw uncheck(e); } }
/** * Calls this method's super and rethrow {@link IOException} as {@link UncheckedIOException}. */
Calls this method's super and rethrow <code>IOException</code> as <code>UncheckedIOException</code>
read
{ "repo_name": "apache/commons-io", "path": "src/main/java/org/apache/commons/io/input/UncheckedFilterReader.java", "license": "apache-2.0", "size": 4999 }
[ "java.io.IOException", "java.io.UncheckedIOException" ]
import java.io.IOException; import java.io.UncheckedIOException;
import java.io.*;
[ "java.io" ]
java.io;
1,543,878
int updateByExampleSelective(@Param("record") Passreset record, @Param("example") PassresetExample example);
int updateByExampleSelective(@Param(STR) Passreset record, @Param(STR) PassresetExample example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table public.passreset * * @mbggenerated Sat Apr 09 16:44:25 CST 2016 */
This method was generated by MyBatis Generator. This method corresponds to the database table public.passreset
updateByExampleSelective
{ "repo_name": "zjlywjh001/PhrackCTF-Platform-Personal", "path": "src/main/java/top/phrack/ctf/models/dao/PassresetMapper.java", "license": "apache-2.0", "size": 3098 }
[ "org.apache.ibatis.annotations.Param", "top.phrack.ctf.pojo.Passreset", "top.phrack.ctf.pojo.PassresetExample" ]
import org.apache.ibatis.annotations.Param; import top.phrack.ctf.pojo.Passreset; import top.phrack.ctf.pojo.PassresetExample;
import org.apache.ibatis.annotations.*; import top.phrack.ctf.pojo.*;
[ "org.apache.ibatis", "top.phrack.ctf" ]
org.apache.ibatis; top.phrack.ctf;
288,654
public static GradoopAccumuloConfig getAcConfig(String prefix) { return GradoopAccumuloConfig.getDefaultConfig() .set(ACCUMULO_USER, "root") .set(ACCUMULO_INSTANCE, accumulo.getInstanceName()) .set(ZOOKEEPER_HOSTS, accumulo.getZooKeepers()) .set(ACCUMULO_PASSWD, accumulo.getConfig().getRootPassword()) .set(ACCUMULO_TABLE_PREFIX, TEST_NAMESPACE_PREFIX + "." + prefix); //those are configure default ⤵ //.set(ACCUMULO_AUTHORIZATIONS, Authorizations.EMPTY) //.set(GRADOOP_BATCH_SCANNER_THREADS, 10) //.set(GRADOOP_ITERATOR_PRIORITY, 0xf); //or you can change to your own test env, please copy gradoop-accumulo jar to your accumulo //runtime lib dir => $ACCUMULO_HOME/lib/ext //return GradoopAccumuloConfig.getDefaultConfig(env) // .set(ZOOKEEPER_HOSTS, "docker2:2181") // .set(ACCUMULO_INSTANCE, "instance") // .set(ACCUMULO_PASSWD, "root") // .set(ACCUMULO_USER, "root") // .set(ACCUMULO_TABLE_PREFIX, TEST_NAMESPACE_PREFIX + "." + prefix); }
static GradoopAccumuloConfig function(String prefix) { return GradoopAccumuloConfig.getDefaultConfig() .set(ACCUMULO_USER, "root") .set(ACCUMULO_INSTANCE, accumulo.getInstanceName()) .set(ZOOKEEPER_HOSTS, accumulo.getZooKeepers()) .set(ACCUMULO_PASSWD, accumulo.getConfig().getRootPassword()) .set(ACCUMULO_TABLE_PREFIX, TEST_NAMESPACE_PREFIX + "." + prefix); }
/** * Get gradoop accumulo configure * * @param prefix store prefix * @return gradoop accumulo configure */
Get gradoop accumulo configure
getAcConfig
{ "repo_name": "galpha/gradoop", "path": "gradoop-store/gradoop-accumulo/src/test/java/org/gradoop/storage/impl/accumulo/AccumuloTestSuite.java", "license": "apache-2.0", "size": 5507 }
[ "org.gradoop.storage.accumulo.config.GradoopAccumuloConfig" ]
import org.gradoop.storage.accumulo.config.GradoopAccumuloConfig;
import org.gradoop.storage.accumulo.config.*;
[ "org.gradoop.storage" ]
org.gradoop.storage;
2,571,782
private CmsDeleteResourceBean getBrokenLinks(CmsResource entryResource) throws CmsException { CmsDeleteResourceBean result = null; CmsListInfoBean info = null; List<CmsBrokenLinkBean> brokenLinks = null; CmsObject cms = getCmsObject(); String resourceSitePath = cms.getSitePath(entryResource); ensureSession(); List<CmsResource> descendants = new ArrayList<CmsResource>(); HashSet<CmsUUID> deleteIds = new HashSet<CmsUUID>(); descendants.add(entryResource); if (entryResource.isFolder()) { descendants.addAll(cms.readResources(resourceSitePath, CmsResourceFilter.IGNORE_EXPIRATION)); } for (CmsResource deleteRes : descendants) { deleteIds.add(deleteRes.getStructureId()); } Multimap<CmsResource, CmsResource> linkMap = HashMultimap.create(); for (CmsResource resource : descendants) { List<CmsResource> linkSources = getLinkSources(cms, resource, deleteIds); for (CmsResource source : linkSources) { linkMap.put(source, resource); } } brokenLinks = getBrokenLinkBeans(linkMap); info = getPageInfo(entryResource); result = new CmsDeleteResourceBean(resourceSitePath, info, brokenLinks); return result; }
CmsDeleteResourceBean function(CmsResource entryResource) throws CmsException { CmsDeleteResourceBean result = null; CmsListInfoBean info = null; List<CmsBrokenLinkBean> brokenLinks = null; CmsObject cms = getCmsObject(); String resourceSitePath = cms.getSitePath(entryResource); ensureSession(); List<CmsResource> descendants = new ArrayList<CmsResource>(); HashSet<CmsUUID> deleteIds = new HashSet<CmsUUID>(); descendants.add(entryResource); if (entryResource.isFolder()) { descendants.addAll(cms.readResources(resourceSitePath, CmsResourceFilter.IGNORE_EXPIRATION)); } for (CmsResource deleteRes : descendants) { deleteIds.add(deleteRes.getStructureId()); } Multimap<CmsResource, CmsResource> linkMap = HashMultimap.create(); for (CmsResource resource : descendants) { List<CmsResource> linkSources = getLinkSources(cms, resource, deleteIds); for (CmsResource source : linkSources) { linkMap.put(source, resource); } } brokenLinks = getBrokenLinkBeans(linkMap); info = getPageInfo(entryResource); result = new CmsDeleteResourceBean(resourceSitePath, info, brokenLinks); return result; }
/** * Internal method to get the broken links information for the given resource.<p> * * @param entryResource the resource * * @return the broken links information * * @throws CmsException if something goes wrong */
Internal method to get the broken links information for the given resource
getBrokenLinks
{ "repo_name": "sbonoc/opencms-core", "path": "src/org/opencms/gwt/CmsVfsService.java", "license": "lgpl-2.1", "size": 80757 }
[ "com.google.common.collect.HashMultimap", "com.google.common.collect.Multimap", "java.util.ArrayList", "java.util.HashSet", "java.util.List", "org.opencms.file.CmsObject", "org.opencms.file.CmsResource", "org.opencms.file.CmsResourceFilter", "org.opencms.gwt.shared.CmsBrokenLinkBean", "org.opencms.gwt.shared.CmsDeleteResourceBean", "org.opencms.gwt.shared.CmsListInfoBean", "org.opencms.main.CmsException", "org.opencms.util.CmsUUID" ]
import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.gwt.shared.CmsBrokenLinkBean; import org.opencms.gwt.shared.CmsDeleteResourceBean; import org.opencms.gwt.shared.CmsListInfoBean; import org.opencms.main.CmsException; import org.opencms.util.CmsUUID;
import com.google.common.collect.*; import java.util.*; import org.opencms.file.*; import org.opencms.gwt.shared.*; import org.opencms.main.*; import org.opencms.util.*;
[ "com.google.common", "java.util", "org.opencms.file", "org.opencms.gwt", "org.opencms.main", "org.opencms.util" ]
com.google.common; java.util; org.opencms.file; org.opencms.gwt; org.opencms.main; org.opencms.util;
1,202,445
@SuppressLint("MissingPermission") @RequiresPermission(Manifest.permission.CAMERA) public synchronized CameraSource start() throws IOException { if (camera != null) { return this; } camera = createCamera(); dummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME); camera.setPreviewTexture(dummySurfaceTexture); usingSurfaceTexture = true; camera.startPreview(); processingThread = new Thread(processingRunnable); processingRunnable.setActive(true); processingThread.start(); return this; }
@SuppressLint(STR) @RequiresPermission(Manifest.permission.CAMERA) synchronized CameraSource function() throws IOException { if (camera != null) { return this; } camera = createCamera(); dummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME); camera.setPreviewTexture(dummySurfaceTexture); usingSurfaceTexture = true; camera.startPreview(); processingThread = new Thread(processingRunnable); processingRunnable.setActive(true); processingThread.start(); return this; }
/** * Opens the camera and starts sending preview frames to the underlying detector. The preview * frames are not displayed. * * @throws IOException if the camera's preview texture or display could not be initialized */
Opens the camera and starts sending preview frames to the underlying detector. The preview frames are not displayed
start
{ "repo_name": "JimSeker/googleplayAPI", "path": "FirebaseAPI/MLFaceTrackerDemo/app/src/main/java/edu/cs4730/mlfacetrackerdemo/common/CameraSource.java", "license": "apache-2.0", "size": 28410 }
[ "android.annotation.SuppressLint", "android.graphics.SurfaceTexture", "androidx.annotation.RequiresPermission", "java.io.IOException" ]
import android.annotation.SuppressLint; import android.graphics.SurfaceTexture; import androidx.annotation.RequiresPermission; import java.io.IOException;
import android.annotation.*; import android.graphics.*; import androidx.annotation.*; import java.io.*;
[ "android.annotation", "android.graphics", "androidx.annotation", "java.io" ]
android.annotation; android.graphics; androidx.annotation; java.io;
1,075,179
public SyntheticButton getCollisionEventHandler() { if ( collisionEventHandler == null ) { collisionEventHandler = new SyntheticButton( "collision" ); } return collisionEventHandler; }
SyntheticButton function() { if ( collisionEventHandler == null ) { collisionEventHandler = new SyntheticButton( STR ); } return collisionEventHandler; }
/** * Creates a synthetic button that is triggered when this node collides with another node. * <p> * Note: if this event handler is obtained it <i>must</i> be used with an InputHandler which is updated regularly * * @return a synthetic button that is triggered on a collision event that involves this node * @see PhysicsSpace#getCollisionEventHandler() */
Creates a synthetic button that is triggered when this node collides with another node. Note: if this event handler is obtained it must be used with an InputHandler which is updated regularly
getCollisionEventHandler
{ "repo_name": "jogjayr/InTEL-Project", "path": "JMEPhysics/src/com/jmex/physics/PhysicsNode.java", "license": "gpl-3.0", "size": 27098 }
[ "com.jme.input.util.SyntheticButton" ]
import com.jme.input.util.SyntheticButton;
import com.jme.input.util.*;
[ "com.jme.input" ]
com.jme.input;
1,814,986
public long set(long instant, String text, Locale locale) { int value = convertText(text, locale); return set(instant, value); }
long function(long instant, String text, Locale locale) { int value = convertText(text, locale); return set(instant, value); }
/** * Sets a value in the milliseconds supplied from a human-readable, text value. * If the specified locale is null, the default locale is used. * <p> * This implementation uses <code>convertText(String, Locale)</code> and * {@link #set(long, int)}. * <p> * Note: subclasses that override this method should also override * getAsText. * * @param instant the milliseconds from 1970-01-01T00:00:00Z to set in * @param text the text value to set * @param locale the locale to use for selecting a text symbol, null for default * @return the updated milliseconds * @throws IllegalArgumentException if the text value is invalid */
Sets a value in the milliseconds supplied from a human-readable, text value. If the specified locale is null, the default locale is used. This implementation uses <code>convertText(String, Locale)</code> and <code>#set(long, int)</code>. Note: subclasses that override this method should also override getAsText
set
{ "repo_name": "syntelos/gap-data", "path": "types/lib/joda-time/src/org/joda/time/field/BaseDateTimeField.java", "license": "lgpl-3.0", "size": 40710 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
2,880,740
protected int findNamePoint(String name, int start) { // Binary search int i = 0; if (nodes != null) { int first = start; int last = nodes.size() - 1; while (first <= last) { i = (first + last) / 2; int test = name.compareTo(((Node)(nodes.get(i))).getNodeName()); if (test == 0) { return i; // Name found } else if (test < 0) { last = i - 1; } else { first = i + 1; } } if (first > i) { i = first; } } return -1 - i; // not-found has to be encoded. } // findNamePoint(String):int
int function(String name, int start) { int i = 0; if (nodes != null) { int first = start; int last = nodes.size() - 1; while (first <= last) { i = (first + last) / 2; int test = name.compareTo(((Node)(nodes.get(i))).getNodeName()); if (test == 0) { return i; } else if (test < 0) { last = i - 1; } else { first = i + 1; } } if (first > i) { i = first; } } return -1 - i; }
/** * Subroutine: Locate the named item, or the point at which said item * should be added. * * @param name Name of a node to look up. * * @return If positive or zero, the index of the found item. * If negative, index of the appropriate point at which to insert * the item, encoded as -1-index and hence reconvertable by subtracting * it from -1. (Encoding because I don't want to recompare the strings * but don't want to burn bytes on a datatype to hold a flagged value.) */
Subroutine: Locate the named item, or the point at which said item should be added
findNamePoint
{ "repo_name": "RackerWilliams/xercesj", "path": "src/org/apache/xerces/dom/NamedNodeMapImpl.java", "license": "apache-2.0", "size": 21189 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
247,119
public Object lookupTestMethod(TestAddress address) { return testAddressToMethodMap.get(address); }
Object function(TestAddress address) { return testAddressToMethodMap.get(address); }
/** * Looks up a test method for a given address. * * @param address * test method address used by probe * @return test method wrapper - the type is only known to the test driver. */
Looks up a test method for a given address
lookupTestMethod
{ "repo_name": "koma-akdb/org.ops4j.pax.exam2", "path": "core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/reactors/ReactorManager.java", "license": "apache-2.0", "size": 16857 }
[ "org.ops4j.pax.exam.TestAddress" ]
import org.ops4j.pax.exam.TestAddress;
import org.ops4j.pax.exam.*;
[ "org.ops4j.pax" ]
org.ops4j.pax;
1,510,552
public void start() { // do nothing } private Choice localeMenu; private Choice displayMenu; private Locale[] locales; private Label monthLabel; private Button prevYear; private Button prevMonth; private Button gotoToday; private Button nextMonth; private Button nextYear; private CalendarPanel calendarPanel; private static final Locale kFirstLocale = Locale.US;
void function() { } private Choice localeMenu; private Choice displayMenu; private Locale[] locales; private Label monthLabel; private Button prevYear; private Button prevMonth; private Button gotoToday; private Button nextMonth; private Button nextYear; private CalendarPanel calendarPanel; private static final Locale kFirstLocale = Locale.US;
/** * Called to start the applet. You never need to call this method * directly, it is called when the applet's document is visited. */
Called to start the applet. You never need to call this method directly, it is called when the applet's document is visited
start
{ "repo_name": "Miracle121/quickdic-dictionary.dictionary", "path": "jars/icu4j-52_1/demos/src/com/ibm/icu/dev/demo/holiday/HolidayCalendarDemo.java", "license": "apache-2.0", "size": 26245 }
[ "java.awt.Button", "java.awt.Choice", "java.awt.Label", "java.util.Locale" ]
import java.awt.Button; import java.awt.Choice; import java.awt.Label; import java.util.Locale;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
1,850,565
private static void assertWeekIterator(final Iterator<?> it, final Calendar start, final Calendar end) { Calendar cal = (Calendar) it.next(); assertCalendarsEquals("", start, cal, 0); Calendar last = null; int count = 1; while (it.hasNext()) { //Check this is just a date (no time component) assertCalendarsEquals("", cal, DateUtils.truncate(cal, Calendar.DATE), 0); last = cal; cal = (Calendar) it.next(); count++; //Check that this is one day more than the last date last.add(Calendar.DATE, 1); assertCalendarsEquals("", last, cal, 0); } assertFalse("There were " + count + " days in this iterator", count % 7 != 0); assertCalendarsEquals("", end, cal, 0); }
static void function(final Iterator<?> it, final Calendar start, final Calendar end) { Calendar cal = (Calendar) it.next(); assertCalendarsEquals(STRSTRSTRThere were STR days in this iteratorSTR", end, cal, 0); }
/** * This checks that this is a 7 divisble iterator of Calendar objects * that are dates (no time), and exactly 1 day spaced after each other * (in addition to the proper start and stop dates) */
This checks that this is a 7 divisble iterator of Calendar objects that are dates (no time), and exactly 1 day spaced after each other (in addition to the proper start and stop dates)
assertWeekIterator
{ "repo_name": "ManfredTremmel/gwt-commons-lang3", "path": "src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java", "license": "apache-2.0", "size": 80915 }
[ "java.util.Calendar", "java.util.Iterator" ]
import java.util.Calendar; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
302,344
@Test public void testLightweightStackTraceRecorder() throws IOException { MimicDesugaringStrategy strategy = new MimicDesugaringStrategy(); ExceptionForTest receiver = new ExceptionForTest(strategy); FileNotFoundException suppressed = new FileNotFoundException(); strategy.addSuppressed(receiver, suppressed); String trace = printStackTraceStderrToString(() -> strategy.printStackTrace(receiver)); assertThat(trace).contains(SUPPRESSED_PREFIX); assertThat(countOccurrences(trace, SUPPRESSED_PREFIX)).isEqualTo(1); }
void function() throws IOException { MimicDesugaringStrategy strategy = new MimicDesugaringStrategy(); ExceptionForTest receiver = new ExceptionForTest(strategy); FileNotFoundException suppressed = new FileNotFoundException(); strategy.addSuppressed(receiver, suppressed); String trace = printStackTraceStderrToString(() -> strategy.printStackTrace(receiver)); assertThat(trace).contains(SUPPRESSED_PREFIX); assertThat(countOccurrences(trace, SUPPRESSED_PREFIX)).isEqualTo(1); }
/** * LightweightStackTraceRecorder tracks the calls of various printStackTrace(*), and ensures that * * <p>suppressed exceptions are printed only once. */
LightweightStackTraceRecorder tracks the calls of various printStackTrace(*), and ensures that suppressed exceptions are printed only once
testLightweightStackTraceRecorder
{ "repo_name": "aehlig/bazel", "path": "src/test/java/com/google/devtools/build/android/desugar/runtime/ThrowableExtensionTest.java", "license": "apache-2.0", "size": 17510 }
[ "com.google.common.truth.Truth", "com.google.devtools.build.android.desugar.runtime.ThrowableExtension", "java.io.FileNotFoundException", "java.io.IOException" ]
import com.google.common.truth.Truth; import com.google.devtools.build.android.desugar.runtime.ThrowableExtension; import java.io.FileNotFoundException; import java.io.IOException;
import com.google.common.truth.*; import com.google.devtools.build.android.desugar.runtime.*; import java.io.*;
[ "com.google.common", "com.google.devtools", "java.io" ]
com.google.common; com.google.devtools; java.io;
1,725,972
public MendelMessage wrap(Event e) throws IOException;
MendelMessage function(Event e) throws IOException;
/** * Wraps an {@link Event} up in a {@link MendelMessage}, ready to be * transmitted across the network. */
Wraps an <code>Event</code> up in a <code>MendelMessage</code>, ready to be transmitted across the network
wrap
{ "repo_name": "CameronTolooee/Mendel", "path": "src/mendel/event/EventWrapper.java", "license": "bsd-2-clause", "size": 2080 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,988,687
public void saveState(FacesContext facesContext, Object state) { }
void function(FacesContext facesContext, Object state) { }
/** * Execute additional operations like save the state on a cache when server * side state saving is used. */
Execute additional operations like save the state on a cache when server side state saving is used
saveState
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/MyfacesResponseStateManager.java", "license": "epl-1.0", "size": 1973 }
[ "javax.faces.context.FacesContext" ]
import javax.faces.context.FacesContext;
import javax.faces.context.*;
[ "javax.faces" ]
javax.faces;
1,503,556
EClass getXCommSubsystem();
EClass getXCommSubsystem();
/** * Returns the meta object for class '{@link satellite.XCommSubsystem <em>XComm Subsystem</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>XComm Subsystem</em>'. * @see satellite.XCommSubsystem * @generated */
Returns the meta object for class '<code>satellite.XCommSubsystem XComm Subsystem</code>'.
getXCommSubsystem
{ "repo_name": "viatra/VIATRA-Generator", "path": "Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java", "license": "epl-1.0", "size": 35024 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
101,804
private void findChangesInPositioning(IJavaScriptElement element, int depth) { if (depth >= this.maxDepth || this.added.contains(element) || this.removed.contains(element)) return; if (!isPositionedCorrectly(element)) { this.delta.changed(element, IJavaScriptElementDelta.F_REORDER); } if (element instanceof IParent) { JavaElementInfo info = null; try { info = (JavaElementInfo)((JavaElement)element).getElementInfo(); } catch (JavaScriptModelException npe) { return; } IJavaScriptElement[] children = info.getChildren(); if (children != null) { int length = children.length; for(int i = 0; i < length; i++) { this.findChangesInPositioning(children[i], depth + 1); } } } }
void function(IJavaScriptElement element, int depth) { if (depth >= this.maxDepth this.added.contains(element) this.removed.contains(element)) return; if (!isPositionedCorrectly(element)) { this.delta.changed(element, IJavaScriptElementDelta.F_REORDER); } if (element instanceof IParent) { JavaElementInfo info = null; try { info = (JavaElementInfo)((JavaElement)element).getElementInfo(); } catch (JavaScriptModelException npe) { return; } IJavaScriptElement[] children = info.getChildren(); if (children != null) { int length = children.length; for(int i = 0; i < length; i++) { this.findChangesInPositioning(children[i], depth + 1); } } } }
/** * Looks for changed positioning of elements. */
Looks for changed positioning of elements
findChangesInPositioning
{ "repo_name": "boniatillo-com/PhaserEditor", "path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElementDeltaBuilder.java", "license": "epl-1.0", "size": 14709 }
[ "org.eclipse.wst.jsdt.core.IJavaScriptElement", "org.eclipse.wst.jsdt.core.IJavaScriptElementDelta", "org.eclipse.wst.jsdt.core.IParent", "org.eclipse.wst.jsdt.core.JavaScriptModelException" ]
import org.eclipse.wst.jsdt.core.IJavaScriptElement; import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta; import org.eclipse.wst.jsdt.core.IParent; import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.*;
[ "org.eclipse.wst" ]
org.eclipse.wst;
1,069,376
public List<AssertionIDRequestService> getAssertionIDRequestServices();
List<AssertionIDRequestService> function();
/** * Gets a list of Assertion ID request services. * * @return list of Assertion ID request services */
Gets a list of Assertion ID request services
getAssertionIDRequestServices
{ "repo_name": "danpal/OpenSAML", "path": "src/main/java/org/opensaml/saml2/metadata/AttributeAuthorityDescriptor.java", "license": "apache-2.0", "size": 2681 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,241,583
public void setDbHelper(DbHelper dbHelper) { this.dbHelper = dbHelper; }
void function(DbHelper dbHelper) { this.dbHelper = dbHelper; }
/** * Remove this for , turning into a proper singleton * */
Remove this for , turning into a proper singleton
setDbHelper
{ "repo_name": "nitinarv/StudyGroupX", "path": "app/src/main/java/com/sgxp/studyproject/Center.java", "license": "apache-2.0", "size": 1945 }
[ "com.sgxp.listactivitycursortest.DbHelper" ]
import com.sgxp.listactivitycursortest.DbHelper;
import com.sgxp.listactivitycursortest.*;
[ "com.sgxp.listactivitycursortest" ]
com.sgxp.listactivitycursortest;
709,569
public final MAccount getAccount() { return m_account; } // getAccount
final MAccount function() { return m_account; }
/** * Get GL Journal Account * * @return account */
Get GL Journal Account
getAccount
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.acct.base/src/main/java-legacy/org/compiere/acct/DocLine.java", "license": "gpl-2.0", "size": 31573 }
[ "org.compiere.model.MAccount" ]
import org.compiere.model.MAccount;
import org.compiere.model.*;
[ "org.compiere.model" ]
org.compiere.model;
1,587,876
public ByteBuffer getWriteBuf() { return this.crf.writeBuf; } private static final int MAX_CHANNEL_RETRIES = 5;
ByteBuffer function() { return this.crf.writeBuf; } private static final int MAX_CHANNEL_RETRIES = 5;
/** * test hook */
test hook
getWriteBuf
{ "repo_name": "pdxrunner/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/OverflowOplog.java", "license": "apache-2.0", "size": 52312 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
215,973
private Reader getReader(String filename) throws IOException { // If this is a custom export, just use the given filename: String dir; if (customExport) { dir = ""; } else { dir = LAYOUT_PREFIX + (directory == null ? "" : directory + '/'); } // Attempt to get a Reader for the file path given, either by // loading it as a resource (from within jar), or as a normal file. If // unsuccessful (e.g. file not found), an IOException is thrown. String name = dir + filename; Reader reader; // Try loading as a resource first. This works for files inside the jar: URL reso = Globals.class.getResource(name); // If that didn't work, try loading as a normal file URL: try { if (reso == null) { File f = new File(name); reader = new FileReader(f); } else { reader = new InputStreamReader(reso.openStream()); } } catch (FileNotFoundException ex) { throw new IOException("Cannot find layout file: '" + name + "'."); } return reader; } /** * Perform the export of {@code database}. * * @param databaseContext the database to export from. * @param file the file to write the resulting export to * @param encoding The encoding of the database * @param entries Contains all entries that should be exported. * @throws IOException if a problem occurred while trying to write to {@code writer}
Reader function(String filename) throws IOException { String dir; if (customExport) { dir = STRSTRCannot find layout file: 'STR'."); } return reader; } /** * Perform the export of {@code database}. * * @param databaseContext the database to export from. * @param file the file to write the resulting export to * @param encoding The encoding of the database * @param entries Contains all entries that should be exported. * @throws IOException if a problem occurred while trying to write to {@code writer}
/** * This method should return a reader from which the given layout file can * be read. * <p> * <p> * Subclasses of ExportFormat are free to override and provide their own * implementation. * * @param filename the filename * @return a newly created reader * @throws IOException if the reader could not be created */
This method should return a reader from which the given layout file can be read. Subclasses of ExportFormat are free to override and provide their own implementation
getReader
{ "repo_name": "matheusvervloet/DC-UFSCar-ES2-201601-Grupo3", "path": "src/main/java/net/sf/jabref/exporter/ExportFormat.java", "license": "gpl-2.0", "size": 14740 }
[ "java.io.IOException", "java.io.Reader" ]
import java.io.IOException; import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
1,125,145
public Bundle getExportingBundle();
Bundle function();
/** * Returns the bundle exporting the package associated with this <tt>ExportedPackage</tt> object. * * @return The exporting bundle, or <tt>null</tt> if this <tt>ExportedPackage</tt> object * has become stale. */
Returns the bundle exporting the package associated with this ExportedPackage object
getExportingBundle
{ "repo_name": "maxliaops/Oscar", "path": "src/org/osgi/service/packageadmin/ExportedPackage.java", "license": "bsd-3-clause", "size": 4378 }
[ "org.osgi.framework.Bundle" ]
import org.osgi.framework.Bundle;
import org.osgi.framework.*;
[ "org.osgi.framework" ]
org.osgi.framework;
1,199,208
return ADMValidator.LENGTH_ID; }
return ADMValidator.LENGTH_ID; }
/** * Returns the maximum allowed length for a id field. <br> * * @see ADMValidator.LENGTH_ID. */
Returns the maximum allowed length for a id field.
getMaxLength
{ "repo_name": "opetrovski/development", "path": "oscm-portal/javasrc/org/oscm/ui/validator/IdCharValidator.java", "license": "apache-2.0", "size": 1274 }
[ "org.oscm.validator.ADMValidator" ]
import org.oscm.validator.ADMValidator;
import org.oscm.validator.*;
[ "org.oscm.validator" ]
org.oscm.validator;
1,445,729
private ElkRectangle computePortLabelBox(final LPort dummyPort, final double labelLabelSpacing) { if (dummyPort.getLabels().isEmpty()) { return null; } else { ElkRectangle result = new ElkRectangle(); for (LLabel label : dummyPort.getLabels()) { KVector labelSize = label.getSize(); result.width = Math.max(result.width, labelSize.x); result.height += labelSize.y; } result.height += (dummyPort.getLabels().size() - 1) * labelLabelSpacing; return result; } }
ElkRectangle function(final LPort dummyPort, final double labelLabelSpacing) { if (dummyPort.getLabels().isEmpty()) { return null; } else { ElkRectangle result = new ElkRectangle(); for (LLabel label : dummyPort.getLabels()) { KVector labelSize = label.getSize(); result.width = Math.max(result.width, labelSize.x); result.height += labelSize.y; } result.height += (dummyPort.getLabels().size() - 1) * labelLabelSpacing; return result; } }
/** * Returns the amount of space required to place the labels later, or {@code null} if there are no labels. */
Returns the amount of space required to place the labels later, or null if there are no labels
computePortLabelBox
{ "repo_name": "eNBeWe/elk", "path": "plugins/org.eclipse.elk.alg.layered/src/org/eclipse/elk/alg/layered/intermediate/LabelAndNodeSizeProcessor.java", "license": "epl-1.0", "size": 8773 }
[ "org.eclipse.elk.alg.layered.graph.LLabel", "org.eclipse.elk.alg.layered.graph.LPort", "org.eclipse.elk.core.math.ElkRectangle", "org.eclipse.elk.core.math.KVector" ]
import org.eclipse.elk.alg.layered.graph.LLabel; import org.eclipse.elk.alg.layered.graph.LPort; import org.eclipse.elk.core.math.ElkRectangle; import org.eclipse.elk.core.math.KVector;
import org.eclipse.elk.alg.layered.graph.*; import org.eclipse.elk.core.math.*;
[ "org.eclipse.elk" ]
org.eclipse.elk;
2,463,818
public List<Address> getAddressesOfType(String type) { List<Address> answer = new ArrayList<Address>(addresses.size()); for (Iterator<Address> it = addresses.iterator(); it.hasNext();) { Address address = (Address) it.next(); if (address.getType().equals(type)) { answer.add(address); } } return answer; }
List<Address> function(String type) { List<Address> answer = new ArrayList<Address>(addresses.size()); for (Iterator<Address> it = addresses.iterator(); it.hasNext();) { Address address = (Address) it.next(); if (address.getType().equals(type)) { answer.add(address); } } return answer; }
/** * Returns the list of addresses that matches the specified type. Examples of address * type are: TO, CC, BCC, etc.. * * @param type Examples of address type are: TO, CC, BCC, etc. * @return the list of addresses that matches the specified type. */
Returns the list of addresses that matches the specified type. Examples of address type are: TO, CC, BCC, etc.
getAddressesOfType
{ "repo_name": "luchuangbin/test1", "path": "src/org/jivesoftware/smackx/packet/MultipleAddresses.java", "license": "apache-2.0", "size": 6462 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,209,573
@Test public void testGetPtuIndexZero() { LocalDateTime timestamp = new LocalDateTime().withYear(2014).withMonthOfYear(11).withDayOfMonth(26).withHourOfDay(0) .withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0); assertEquals(1, PtuUtil.getPtuIndex(timestamp, PTU_DURATION)); }
void function() { LocalDateTime timestamp = new LocalDateTime().withYear(2014).withMonthOfYear(11).withDayOfMonth(26).withHourOfDay(0) .withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0); assertEquals(1, PtuUtil.getPtuIndex(timestamp, PTU_DURATION)); }
/** * Tests PtuUtil.getPtuIndex method. */
Tests PtuUtil.getPtuIndex method
testGetPtuIndexZero
{ "repo_name": "USEF-Foundation/ri.usef.energy", "path": "usef-build/usef-core/usef-core-planboard/src/test/java/energy/usef/core/util/PtuUtilTest.java", "license": "apache-2.0", "size": 6122 }
[ "org.joda.time.LocalDateTime", "org.junit.Assert" ]
import org.joda.time.LocalDateTime; import org.junit.Assert;
import org.joda.time.*; import org.junit.*;
[ "org.joda.time", "org.junit" ]
org.joda.time; org.junit;
986,905
ActionResult execute( ImmutableList<String> command, ImmutableSortedMap<String, String> commandEnvironment, Digest inputsRootDigest, Set<Path> outputs) throws IOException, InterruptedException;
ActionResult execute( ImmutableList<String> command, ImmutableSortedMap<String, String> commandEnvironment, Digest inputsRootDigest, Set<Path> outputs) throws IOException, InterruptedException;
/** * This should run the command with the provided environment and inputs. * * <p>Returns an ActionResult with exit code, outputs, stdout/stderr, etc. */
This should run the command with the provided environment and inputs. Returns an ActionResult with exit code, outputs, stdout/stderr, etc
execute
{ "repo_name": "clonetwin26/buck", "path": "src/com/facebook/buck/rules/modern/builders/RemoteExecutionService.java", "license": "apache-2.0", "size": 1487 }
[ "com.facebook.buck.rules.modern.builders.thrift.ActionResult", "com.facebook.buck.rules.modern.builders.thrift.Digest", "com.google.common.collect.ImmutableList", "com.google.common.collect.ImmutableSortedMap", "java.io.IOException", "java.nio.file.Path", "java.util.Set" ]
import com.facebook.buck.rules.modern.builders.thrift.ActionResult; import com.facebook.buck.rules.modern.builders.thrift.Digest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSortedMap; import java.io.IOException; import java.nio.file.Path; import java.util.Set;
import com.facebook.buck.rules.modern.builders.thrift.*; import com.google.common.collect.*; import java.io.*; import java.nio.file.*; import java.util.*;
[ "com.facebook.buck", "com.google.common", "java.io", "java.nio", "java.util" ]
com.facebook.buck; com.google.common; java.io; java.nio; java.util;
2,340,401
public void meQuiescing(SICoreConnection conn) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "meQuiescing", conn); JMSException jmse = (JMSException)JmsErrorUtils.newThrowable(JMSException.class, "ME_QUIESCE_CWSIA0342", null, tc); connection.reportException(jmse); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "meQuiescing"); }
void function(SICoreConnection conn) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, STR, conn); JMSException jmse = (JMSException)JmsErrorUtils.newThrowable(JMSException.class, STR, null, tc); connection.reportException(jmse); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, STR); }
/** * Called when ME begins shutdown.<p> * * The conn parameter is ignored. The JMS API uses a 1 to 1 mapping of ConnectionListenerImpl * to JMS Connection instances, so we should only ever receive calls for our own connection. * * @see com.ibm.wsspi.sib.core.SICoreConnectionListener#meQuiescing(com.ibm.wsspi.sib.core.SICoreConnection) */
Called when ME begins shutdown. The conn parameter is ignored. The JMS API uses a 1 to 1 mapping of ConnectionListenerImpl to JMS Connection instances, so we should only ever receive calls for our own connection
meQuiescing
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConnectionListenerImpl.java", "license": "epl-1.0", "size": 6829 }
[ "com.ibm.websphere.ras.TraceComponent", "com.ibm.ws.sib.utils.ras.SibTr", "com.ibm.wsspi.sib.core.SICoreConnection", "javax.jms.JMSException" ]
import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.sib.utils.ras.SibTr; import com.ibm.wsspi.sib.core.SICoreConnection; import javax.jms.JMSException;
import com.ibm.websphere.ras.*; import com.ibm.ws.sib.utils.ras.*; import com.ibm.wsspi.sib.core.*; import javax.jms.*;
[ "com.ibm.websphere", "com.ibm.ws", "com.ibm.wsspi", "javax.jms" ]
com.ibm.websphere; com.ibm.ws; com.ibm.wsspi; javax.jms;
772,179
private String getSignatureFromNameAndType(int index) throws InvalidClassFileFormatException { checkConstantPoolIndex(index); Constant constant = constantPool[index]; checkConstantTag(constant, IClassConstants.CONSTANT_NameAndType); return getUtf8String((Integer) constant.data[1]); }
String function(int index) throws InvalidClassFileFormatException { checkConstantPoolIndex(index); Constant constant = constantPool[index]; checkConstantTag(constant, IClassConstants.CONSTANT_NameAndType); return getUtf8String((Integer) constant.data[1]); }
/** * Get the signature from a CONSTANT_NameAndType. * * @param index the index of the CONSTANT_NameAndType * @return the signature * @throws InvalidClassFileFormatException */
Get the signature from a CONSTANT_NameAndType
getSignatureFromNameAndType
{ "repo_name": "optivo-org/fingbugs-1.3.9-optivo", "path": "src/java/edu/umd/cs/findbugs/classfile/engine/ClassParser.java", "license": "lgpl-2.1", "size": 17283 }
[ "edu.umd.cs.findbugs.classfile.IClassConstants", "edu.umd.cs.findbugs.classfile.InvalidClassFileFormatException" ]
import edu.umd.cs.findbugs.classfile.IClassConstants; import edu.umd.cs.findbugs.classfile.InvalidClassFileFormatException;
import edu.umd.cs.findbugs.classfile.*;
[ "edu.umd.cs" ]
edu.umd.cs;
1,774,181
public int help() throws IOException { return sendCommand(FTPCmd.HELP); }
int function() throws IOException { return sendCommand(FTPCmd.HELP); }
/** * A convenience method to send the FTP HELP command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws 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. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. */
A convenience method to send the FTP HELP command to the server, receive the reply, and return the reply code
help
{ "repo_name": "apache/commons-net", "path": "src/main/java/org/apache/commons/net/ftp/FTP.java", "license": "apache-2.0", "size": 80585 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,111,567
public static <S, E> void insertAfterStep(final Step<S, E> insertStep, final Step<?, S> beforeStep, final Traversal.Admin<?, ?> traversal) { traversal.addStep(stepIndex(beforeStep, traversal) + 1, insertStep); }
static <S, E> void function(final Step<S, E> insertStep, final Step<?, S> beforeStep, final Traversal.Admin<?, ?> traversal) { traversal.addStep(stepIndex(beforeStep, traversal) + 1, insertStep); }
/** * Insert a step after a specified step instance. * * @param insertStep the step to insert * @param beforeStep the step to insert the new step after * @param traversal the traversal on which the action should occur */
Insert a step after a specified step instance
insertAfterStep
{ "repo_name": "jorgebay/tinkerpop", "path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java", "license": "apache-2.0", "size": 33065 }
[ "org.apache.tinkerpop.gremlin.process.traversal.Step", "org.apache.tinkerpop.gremlin.process.traversal.Traversal" ]
import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.*;
[ "org.apache.tinkerpop" ]
org.apache.tinkerpop;
1,056,842
CompletableFuture<FlagResult> setPermission(ClaimFlag flag, String source, String target, Tristate value, Context context);
CompletableFuture<FlagResult> setPermission(ClaimFlag flag, String source, String target, Tristate value, Context context);
/** * Sets {@link ClaimFlag} permission for source and target on default subject with {@link Context}. * * @param flag The claim flag * @param source The source id * @param target The target id * @param value The new value * @param context The claim context * @return The result of set */
Sets <code>ClaimFlag</code> permission for source and target on default subject with <code>Context</code>
setPermission
{ "repo_name": "MinecraftPortCentral/GriefPrevention", "path": "src/api/java/me/ryanhamshire/griefprevention/api/claim/Claim.java", "license": "mit", "size": 32388 }
[ "java.util.concurrent.CompletableFuture", "org.spongepowered.api.service.context.Context", "org.spongepowered.api.util.Tristate" ]
import java.util.concurrent.CompletableFuture; import org.spongepowered.api.service.context.Context; import org.spongepowered.api.util.Tristate;
import java.util.concurrent.*; import org.spongepowered.api.service.context.*; import org.spongepowered.api.util.*;
[ "java.util", "org.spongepowered.api" ]
java.util; org.spongepowered.api;
1,982,792
public boolean fireCanCustomObjectSpawnEvent(CustomObject object, LocalWorld world, int x, int y, int z) { boolean success = true; for (EventHandler handler : cancelableEventHandlers) { if (!handler.canCustomObjectSpawn(object, world, x, y, z, !success)) { success = false; } } for (EventHandler handler : monitoringEventHandlers) { handler.canCustomObjectSpawn(object, world, x, y, z, !success); } return success; }
boolean function(CustomObject object, LocalWorld world, int x, int y, int z) { boolean success = true; for (EventHandler handler : cancelableEventHandlers) { if (!handler.canCustomObjectSpawn(object, world, x, y, z, !success)) { success = false; } } for (EventHandler handler : monitoringEventHandlers) { handler.canCustomObjectSpawn(object, world, x, y, z, !success); } return success; }
/** * Fires the canCustomObjectSpawn event. * <p> * @see EventHandler#canCustomObjectSpawn(CustomObject, LocalWorld, int, * int, int, boolean) * @return True if the event handlers allow that the object is spawned, * false otherwise. */
Fires the canCustomObjectSpawn event.
fireCanCustomObjectSpawnEvent
{ "repo_name": "whichonespink44/TerrainControl", "path": "common/src/main/java/com/khorn/terraincontrol/TerrainControlEngine.java", "license": "mit", "size": 10609 }
[ "com.khorn.terraincontrol.customobjects.CustomObject", "com.khorn.terraincontrol.events.EventHandler" ]
import com.khorn.terraincontrol.customobjects.CustomObject; import com.khorn.terraincontrol.events.EventHandler;
import com.khorn.terraincontrol.customobjects.*; import com.khorn.terraincontrol.events.*;
[ "com.khorn.terraincontrol" ]
com.khorn.terraincontrol;
2,689,446
void resetNamespace() throws IOException { ((BackupStorage)getFSImage()).reset(); }
void resetNamespace() throws IOException { ((BackupStorage)getFSImage()).reset(); }
/** * Reset node namespace state in memory and in storage directories. * @throws IOException */
Reset node namespace state in memory and in storage directories
resetNamespace
{ "repo_name": "jayantgolhar/Hadoop-0.21.0", "path": "hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java", "license": "apache-2.0", "size": 13412 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,723,529
void setProperties(Properties props);
void setProperties(Properties props);
/** * Sets the properties to be used when the connection is made. The standard keys for the properties are defined in * this interface * * @param props */
Sets the properties to be used when the connection is made. The standard keys for the properties are defined in this interface
setProperties
{ "repo_name": "witcxc/saiku", "path": "saiku-core/saiku-service/src/main/java/org/saiku/datasources/connection/ISaikuConnection.java", "license": "apache-2.0", "size": 2812 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
221,057
public void engineSetProperty(String key, String value) { if (properties == null) { properties = new HashMap<String, String>(); } properties.put(key, value); }
void function(String key, String value) { if (properties == null) { properties = new HashMap<String, String>(); } properties.put(key, value); }
/** * Method engineSetProperty * * @param key * @param value */
Method engineSetProperty
engineSetProperty
{ "repo_name": "Legostaev/xmlsec-gost", "path": "src/main/java/org/apache/xml/security/keys/keyresolver/KeyResolverSpi.java", "license": "apache-2.0", "size": 9058 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,879,305
@SuppressWarnings("unchecked") public static Series<? extends Parameter> unmodifiableSeries( Series<? extends Parameter> series) { if (Edition.CURRENT != Edition.GWT) { return new Form(java.util.Collections.unmodifiableList(series .getDelegate())); } return new Form((List<Parameter>) series.getDelegate()); } public Series() { super(); } public Series(int initialCapacity) { super(initialCapacity); } public Series(List<E> delegate) { super(delegate); }
@SuppressWarnings(STR) static Series<? extends Parameter> function( Series<? extends Parameter> series) { if (Edition.CURRENT != Edition.GWT) { return new Form(java.util.Collections.unmodifiableList(series .getDelegate())); } return new Form((List<Parameter>) series.getDelegate()); } public Series() { super(); } public Series(int initialCapacity) { super(initialCapacity); } public Series(List<E> delegate) { super(delegate); }
/** * Returns an unmodifiable view of the specified series. Attempts to call a * modification method will throw an UnsupportedOperationException. * * @param series * The series for which an unmodifiable view should be returned. * @return The unmodifiable view of the specified series. */
Returns an unmodifiable view of the specified series. Attempts to call a modification method will throw an UnsupportedOperationException
unmodifiableSeries
{ "repo_name": "theanuradha/debrief", "path": "org.mwc.asset.comms/docs/restlet_src/org.restlet/org/restlet/util/Series.java", "license": "epl-1.0", "size": 18811 }
[ "java.util.List", "org.restlet.data.Form", "org.restlet.data.Parameter", "org.restlet.engine.Edition" ]
import java.util.List; import org.restlet.data.Form; import org.restlet.data.Parameter; import org.restlet.engine.Edition;
import java.util.*; import org.restlet.data.*; import org.restlet.engine.*;
[ "java.util", "org.restlet.data", "org.restlet.engine" ]
java.util; org.restlet.data; org.restlet.engine;
1,671,904
Map<String, Integer> getIntInvalidNull();
Map<String, Integer> getIntInvalidNull();
/** * Get integer dictionary value {"0": 1, "1": null, "2": 0}. * * @return the Map&lt;String, Integer&gt; object if successful. */
Get integer dictionary value {"0": 1, "1": null, "2": 0}
getIntInvalidNull
{ "repo_name": "anudeepsharma/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydictionary/Dictionarys.java", "license": "mit", "size": 79030 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
788,723
public GXMatrix load(FloatBuffer buf) { for(int i = 0; i < 16; i++) m[i] = buf.get(); return this; }
GXMatrix function(FloatBuffer buf) { for(int i = 0; i < 16; i++) m[i] = buf.get(); return this; }
/** * Load from a float buffer. The buffer stores the matrix in column major * (OpenGL) order. * * @param buf A float buffer to read from * @return this */
Load from a float buffer. The buffer stores the matrix in column major (OpenGL) order
load
{ "repo_name": "ds84182/OpenGX", "path": "src/main/java/ds/mods/opengx/gx/GXMatrix.java", "license": "lgpl-3.0", "size": 13073 }
[ "java.nio.FloatBuffer" ]
import java.nio.FloatBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
988,233
public List<TimePeriod> getAllFightPeriods() { return getFightPeriods(fights); }
List<TimePeriod> function() { return getFightPeriods(fights); }
/** * Get the active time periods from all fights. If fights overlap then the time periods are merged. * @return The created time periods */
Get the active time periods from all fights. If fights overlap then the time periods are merged
getAllFightPeriods
{ "repo_name": "setjmp2013/WowLogParser", "path": "src/wowlogparserbase/FightCollection.java", "license": "gpl-2.0", "size": 13649 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,450,631
public void createHeaderList(final Map<Integer, Integer> mapSupport) { // create an array to store the header list with // all the items stored in the map received as parameter headerList = new ArrayList<Integer>(mapItemNodes.keySet());
void function(final Map<Integer, Integer> mapSupport) { headerList = new ArrayList<Integer>(mapItemNodes.keySet());
/** * Method for creating the list of items in the header table, * in descending order of support. * @param mapSupport the frequencies of each item (key: item value: support) */
Method for creating the list of items in the header table, in descending order of support
createHeaderList
{ "repo_name": "YinYanfei/CadalWorkspace", "path": "ca/pfv/spmf/algorithms/frequentpatterns/fpgrowth/FPTree.java", "license": "gpl-3.0", "size": 5364 }
[ "java.util.ArrayList", "java.util.Map" ]
import java.util.ArrayList; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,956,915
ConnectionRejected doFilter(HttpServletRequest servletRequest);
ConnectionRejected doFilter(HttpServletRequest servletRequest);
/** * Method for rejecting connections based on the current request * * @param servletRequest * The servlet request holding the request headers */
Method for rejecting connections based on the current request
doFilter
{ "repo_name": "topicusonderwijs/wicket", "path": "wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/IWebSocketConnectionFilter.java", "license": "apache-2.0", "size": 1489 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
1,875,024
public void setSettings(@Nullable ApplicationSettings settings) { if (settings == null) { this.settings = null; clearPersistence(); return; } if (!settings.equals(this.settings)) { this.settings = settings; storeToPersistence(); } }
void function(@Nullable ApplicationSettings settings) { if (settings == null) { this.settings = null; clearPersistence(); return; } if (!settings.equals(this.settings)) { this.settings = settings; storeToPersistence(); } }
/** * This is used to set end write new settings * @param settings -- new settings * null forces clear persistence please use it carefully */
This is used to set end write new settings
setSettings
{ "repo_name": "shromyak/AlienClock", "path": "app/src/main/java/com/svyat/sample/alienclock/settings/AlienSettingsManager.java", "license": "mit", "size": 2718 }
[ "android.support.annotation.Nullable", "com.svyat.sample.alienclock.model.ApplicationSettings" ]
import android.support.annotation.Nullable; import com.svyat.sample.alienclock.model.ApplicationSettings;
import android.support.annotation.*; import com.svyat.sample.alienclock.model.*;
[ "android.support", "com.svyat.sample" ]
android.support; com.svyat.sample;
1,594,575
@SuppressWarnings("unchecked") protected List<SufficientFundsItem> summarizeTransactions(List<? extends Transaction> transactions) { Map<String, SufficientFundsItem> items = new HashMap<String, SufficientFundsItem>(); SystemOptions currentYear = optionsService.getCurrentYearOptions(); // loop over the given transactions, grouping into SufficientFundsItem objects // which are keyed by the appropriate chart/account/SF type, and derived object value // see getSufficientFundsObjectCode() for the "object" used for grouping for (Iterator iter = transactions.iterator(); iter.hasNext();) { Transaction tran = (Transaction) iter.next(); SystemOptions year = tran.getOption(); if (year == null) { year = currentYear; } if (ObjectUtils.isNull(tran.getAccount())) { throw new IllegalArgumentException("Invalid account: " + tran.getChartOfAccountsCode() + "-" + tran.getAccountNumber()); } SufficientFundsItem sfi = new SufficientFundsItem(year, tran, getSufficientFundsObjectCode(tran.getFinancialObject(), tran.getAccount().getAccountSufficientFundsCode())); sfi.setDocumentTypeCode(tran.getFinancialDocumentTypeCode()); if (items.containsKey(sfi.getKey())) { SufficientFundsItem item = (SufficientFundsItem) items.get(sfi.getKey()); item.add(tran); } else { items.put(sfi.getKey(), sfi); } } return new ArrayList<SufficientFundsItem>(items.values()); }
@SuppressWarnings(STR) List<SufficientFundsItem> function(List<? extends Transaction> transactions) { Map<String, SufficientFundsItem> items = new HashMap<String, SufficientFundsItem>(); SystemOptions currentYear = optionsService.getCurrentYearOptions(); for (Iterator iter = transactions.iterator(); iter.hasNext();) { Transaction tran = (Transaction) iter.next(); SystemOptions year = tran.getOption(); if (year == null) { year = currentYear; } if (ObjectUtils.isNull(tran.getAccount())) { throw new IllegalArgumentException(STR + tran.getChartOfAccountsCode() + "-" + tran.getAccountNumber()); } SufficientFundsItem sfi = new SufficientFundsItem(year, tran, getSufficientFundsObjectCode(tran.getFinancialObject(), tran.getAccount().getAccountSufficientFundsCode())); sfi.setDocumentTypeCode(tran.getFinancialDocumentTypeCode()); if (items.containsKey(sfi.getKey())) { SufficientFundsItem item = (SufficientFundsItem) items.get(sfi.getKey()); item.add(tran); } else { items.put(sfi.getKey(), sfi); } } return new ArrayList<SufficientFundsItem>(items.values()); }
/** * For each transaction, fetches the appropriate sufficient funds item to check against * * @param transactions a list of Transactions * @return a List of corresponding SufficientFundsItem */
For each transaction, fetches the appropriate sufficient funds item to check against
summarizeTransactions
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/gl/service/impl/SufficientFundsServiceImpl.java", "license": "apache-2.0", "size": 23669 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.Iterator", "java.util.List", "java.util.Map", "org.kuali.kfs.gl.businessobject.Transaction", "org.kuali.kfs.sys.businessobject.SufficientFundsItem", "org.kuali.kfs.sys.businessobject.SystemOptions", "org.kuali.rice.krad.util.ObjectUtils" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.kuali.kfs.gl.businessobject.Transaction; import org.kuali.kfs.sys.businessobject.SufficientFundsItem; import org.kuali.kfs.sys.businessobject.SystemOptions; import org.kuali.rice.krad.util.ObjectUtils;
import java.util.*; import org.kuali.kfs.gl.businessobject.*; import org.kuali.kfs.sys.businessobject.*; import org.kuali.rice.krad.util.*;
[ "java.util", "org.kuali.kfs", "org.kuali.rice" ]
java.util; org.kuali.kfs; org.kuali.rice;
2,050,677
public boolean findIfResourceExists(String name) { //Search This Classloader _LOG_.log(Level.INFO, "Searching Local For Resource: " + name); boolean Exists = fireResourceExists(name); if(Exists) { _LOG_.log(Level.INFO, "Local Found Resource: " + name); return true; } else { _LOG_.log(Level.INFO, "Resource: " + name + " Not Found In Local"); return false; } }
boolean function(String name) { _LOG_.log(Level.INFO, STR + name); boolean Exists = fireResourceExists(name); if(Exists) { _LOG_.log(Level.INFO, STR + name); return true; } else { _LOG_.log(Level.INFO, STR + name + STR); return false; } }
/** * Does Not Search Parent/System ClassLoader or System ClassLoader Use * Method resourceExists(String) * * @param name * @return */
Does Not Search Parent/System ClassLoader or System ClassLoader Use Method resourceExists(String)
findIfResourceExists
{ "repo_name": "J-P-77/utilities", "path": "src/jp77/beta/utillib/classloader/v2/MyClassloader.java", "license": "mit", "size": 21471 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
1,120,853
public static int logErrorString(String tag, String message) { int result = 0; // If log is enabled, the print the log result = Log.e(tag, " " + message); return result; }
static int function(String tag, String message) { int result = 0; result = Log.e(tag, " " + message); return result; }
/** * Logs application debug messages. * * @param tag The log tag. * @param message The error message to write to console. */
Logs application debug messages
logErrorString
{ "repo_name": "nidhinvv/BubbleAlert", "path": "bubblealertlib/src/main/java/com/dkv/bubblealertlib/AppLog.java", "license": "mit", "size": 1703 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,117,616
public ClusterInner withSubnet(ResourceId subnet) { this.subnet = subnet; return this; }
ClusterInner function(ResourceId subnet) { this.subnet = subnet; return this; }
/** * Set the subnet value. * * @param subnet the subnet value to set * @return the ClusterInner object itself. */
Set the subnet value
withSubnet
{ "repo_name": "hovsepm/azure-sdk-for-java", "path": "batchai/resource-manager/v2017_09_01_preview/src/main/java/com/microsoft/azure/management/batchai/v2017_09_01_preview/implementation/ClusterInner.java", "license": "mit", "size": 11441 }
[ "com.microsoft.azure.management.batchai.v2017_09_01_preview.ResourceId" ]
import com.microsoft.azure.management.batchai.v2017_09_01_preview.ResourceId;
import com.microsoft.azure.management.batchai.v2017_09_01_preview.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,928,624
@Nonnull public static CoreVBO createAndSendStaticVBO( @Nonnull final CoreGL gl, @Nonnull final BufferFactory bufferFactory, @Nonnull final float[] data) { CoreVBO result = new CoreVBO(gl, bufferFactory, gl.GL_STATIC_DRAW(), data); result.send(); return result; }
static CoreVBO function( @Nonnull final CoreGL gl, @Nonnull final BufferFactory bufferFactory, @Nonnull final float[] data) { CoreVBO result = new CoreVBO(gl, bufferFactory, gl.GL_STATIC_DRAW(), data); result.send(); return result; }
/** * This provides the same functionality as * {@link #createStaticVBO(de.lessvoid.nifty.batch.spi.core.CoreGL, de.lessvoid.nifty.batch.spi.BufferFactory, float[])}, * but automatically sends the specified vertex data to the GPU. */
This provides the same functionality as <code>#createStaticVBO(de.lessvoid.nifty.batch.spi.core.CoreGL, de.lessvoid.nifty.batch.spi.BufferFactory, float[])</code>, but automatically sends the specified vertex data to the GPU
createAndSendStaticVBO
{ "repo_name": "gouessej/nifty-gui", "path": "nifty-core/src/main/java/de/lessvoid/nifty/batch/core/CoreVBO.java", "license": "bsd-2-clause", "size": 6349 }
[ "de.lessvoid.nifty.batch.spi.BufferFactory", "de.lessvoid.nifty.batch.spi.core.CoreGL", "javax.annotation.Nonnull" ]
import de.lessvoid.nifty.batch.spi.BufferFactory; import de.lessvoid.nifty.batch.spi.core.CoreGL; import javax.annotation.Nonnull;
import de.lessvoid.nifty.batch.spi.*; import de.lessvoid.nifty.batch.spi.core.*; import javax.annotation.*;
[ "de.lessvoid.nifty", "javax.annotation" ]
de.lessvoid.nifty; javax.annotation;
767,203
public static void storeObject(File file, Serializable object) throws IOException { try (FileOutputStream fileOutputStream = new FileOutputStream(file); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) { objectOutputStream.writeObject(object); } }
static void function(File file, Serializable object) throws IOException { try (FileOutputStream fileOutputStream = new FileOutputStream(file); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) { objectOutputStream.writeObject(object); } }
/** * Stores any {@link Serializable} object into a file. * * @param file is the file where the object is to be stored to. * @param object is the objec which is to be stored. * @throws IOException is thrown in cases of IO issues. */
Stores any <code>Serializable</code> object into a file
storeObject
{ "repo_name": "PureSolTechnologies/license-maven-plugin", "path": "src/main/java/com/puresoltechnologies/maven/plugins/license/internal/IOUtilities.java", "license": "apache-2.0", "size": 14929 }
[ "java.io.File", "java.io.FileOutputStream", "java.io.IOException", "java.io.ObjectOutputStream", "java.io.Serializable" ]
import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable;
import java.io.*;
[ "java.io" ]
java.io;
2,057,997
public static void v(@NonNull final String tag, @NonNull final String message) { logger.v(tag, message); }
static functionoid v(@NonNull final String tag, @NonNull final String message) { logger.v(tag, message); }
/** * Delegates to {@link Logger#v(String, String)}. */
Delegates to <code>Logger#v(String, String)</code>
v
{ "repo_name": "universum-studios/android_fragments", "path": "library-core/src/main/java/universum/studios/android/fragment/FragmentsLogging.java", "license": "apache-2.0", "size": 5548 }
[ "androidx.annotation.NonNull" ]
import androidx.annotation.NonNull;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
2,364,380
private void importNetwork() { JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory( new File( System.getProperty( "user.dir" ) ) ); if( JFileChooser.APPROVE_OPTION == fc.showOpenDialog( this ) ) { _activeConfig = fc.getSelectedFile(); _logger.debug( "selected file: " + _activeConfig.getAbsolutePath() ); _networkTree.setNetworkConfiguration( _activeConfig ); } }
void function() { JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory( new File( System.getProperty( STR ) ) ); if( JFileChooser.APPROVE_OPTION == fc.showOpenDialog( this ) ) { _activeConfig = fc.getSelectedFile(); _logger.debug( STR + _activeConfig.getAbsolutePath() ); _networkTree.setNetworkConfiguration( _activeConfig ); } }
/** * Imports a project file that may contain more than one network definitions. */
Imports a project file that may contain more than one network definitions
importNetwork
{ "repo_name": "alunkeit/ancat", "path": "ancat/ui/MainFrame.java", "license": "gpl-3.0", "size": 19090 }
[ "java.io.File", "javax.swing.JFileChooser" ]
import java.io.File; import javax.swing.JFileChooser;
import java.io.*; import javax.swing.*;
[ "java.io", "javax.swing" ]
java.io; javax.swing;
948,577
@Override public List<? extends TestAction> getTestAction(TestObject testObject) { if (testObject instanceof CaseResult) { CaseResult test = (CaseResult) testObject; if(test.isFailed()) { return Collections.singletonList(new JiraTestAction(this, test)); } } return Collections.emptyList(); }
List<? extends TestAction> function(TestObject testObject) { if (testObject instanceof CaseResult) { CaseResult test = (CaseResult) testObject; if(test.isFailed()) { return Collections.singletonList(new JiraTestAction(this, test)); } } return Collections.emptyList(); }
/** * Method for creating test actions associated with tests * @param testObject * @return a test action */
Method for creating test actions associated with tests
getTestAction
{ "repo_name": "andreituicu/JenkinsJiraPlugin", "path": "JiraIssue/src/main/java/org/jenkinsci/plugins/jiraissue/JiraTestData.java", "license": "apache-2.0", "size": 1833 }
[ "hudson.tasks.junit.CaseResult", "hudson.tasks.junit.TestAction", "hudson.tasks.junit.TestObject", "java.util.Collections", "java.util.List" ]
import hudson.tasks.junit.CaseResult; import hudson.tasks.junit.TestAction; import hudson.tasks.junit.TestObject; import java.util.Collections; import java.util.List;
import hudson.tasks.junit.*; import java.util.*;
[ "hudson.tasks.junit", "java.util" ]
hudson.tasks.junit; java.util;
2,212,889
public static String addressMapToString( Map<String, Map<String, InetSocketAddress>> map) { StringBuilder b = new StringBuilder(); for (Map.Entry<String, Map<String, InetSocketAddress>> entry : map.entrySet()) { String nsId = entry.getKey(); Map<String, InetSocketAddress> nnMap = entry.getValue(); b.append("Nameservice <").append(nsId).append(">:").append("\n"); for (Map.Entry<String, InetSocketAddress> e2 : nnMap.entrySet()) { b.append(" NN ID ").append(e2.getKey()) .append(" => ").append(e2.getValue()).append("\n"); } } return b.toString(); }
static String function( Map<String, Map<String, InetSocketAddress>> map) { StringBuilder b = new StringBuilder(); for (Map.Entry<String, Map<String, InetSocketAddress>> entry : map.entrySet()) { String nsId = entry.getKey(); Map<String, InetSocketAddress> nnMap = entry.getValue(); b.append(STR).append(nsId).append(">:").append("\n"); for (Map.Entry<String, InetSocketAddress> e2 : nnMap.entrySet()) { b.append(STR).append(e2.getKey()) .append(STR).append(e2.getValue()).append("\n"); } } return b.toString(); }
/** * Format the given map, as returned by other functions in this class, * into a string suitable for debugging display. The format of this string * should not be considered an interface, and is liable to change. */
Format the given map, as returned by other functions in this class, into a string suitable for debugging display. The format of this string should not be considered an interface, and is liable to change
addressMapToString
{ "repo_name": "plusplusjiajia/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java", "license": "apache-2.0", "size": 69159 }
[ "java.net.InetSocketAddress", "java.util.Map" ]
import java.net.InetSocketAddress; import java.util.Map;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
2,820,608
public List<TRoleListType> getTRoleListTypes(Connection con) throws TorqueException { if (collTRoleListTypes == null) { collTRoleListTypes = getTRoleListTypes(new Criteria(10), con); } return collTRoleListTypes; }
List<TRoleListType> function(Connection con) throws TorqueException { if (collTRoleListTypes == null) { collTRoleListTypes = getTRoleListTypes(new Criteria(10), con); } return collTRoleListTypes; }
/** * If this collection has already been initialized, returns * the collection. Otherwise returns the results of * getTRoleListTypes(new Criteria(),Connection) * This method takes in the Connection also as input so that * referenced objects can also be obtained using a Connection * that is taken as input */
If this collection has already been initialized, returns the collection. Otherwise returns the results of getTRoleListTypes(new Criteria(),Connection) This method takes in the Connection also as input so that referenced objects can also be obtained using a Connection that is taken as input
getTRoleListTypes
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/persist/BaseTRole.java", "license": "gpl-3.0", "size": 116851 }
[ "java.sql.Connection", "java.util.List", "org.apache.torque.TorqueException", "org.apache.torque.util.Criteria" ]
import java.sql.Connection; import java.util.List; import org.apache.torque.TorqueException; import org.apache.torque.util.Criteria;
import java.sql.*; import java.util.*; import org.apache.torque.*; import org.apache.torque.util.*;
[ "java.sql", "java.util", "org.apache.torque" ]
java.sql; java.util; org.apache.torque;
1,970,774
public static Object newInstance(String className, Class[] parameterClasses, Object[] parameterObjects) { // get a class object Class clas = null; try { clas=ClassUtils.loadClass(className); } catch (java.lang.ClassNotFoundException C) {System.err.println(C);} Constructor con; con= ClassUtils.getConstructorOnType(clas, parameterClasses); Object theObject=null; try { theObject=con.newInstance(parameterObjects); } catch(java.lang.InstantiationException E) {System.err.println(E);} catch(java.lang.IllegalAccessException A) {System.err.println(A);} catch(java.lang.reflect.InvocationTargetException T) {System.err.println(T);} return theObject; }
static Object function(String className, Class[] parameterClasses, Object[] parameterObjects) { Class clas = null; try { clas=ClassUtils.loadClass(className); } catch (java.lang.ClassNotFoundException C) {System.err.println(C);} Constructor con; con= ClassUtils.getConstructorOnType(clas, parameterClasses); Object theObject=null; try { theObject=con.newInstance(parameterObjects); } catch(java.lang.InstantiationException E) {System.err.println(E);} catch(java.lang.IllegalAccessException A) {System.err.println(A);} catch(java.lang.reflect.InvocationTargetException T) {System.err.println(T);} return theObject; }
/** * creates a new instance of an object, based on the classname as string, the classes * and the actual parameters. */
creates a new instance of an object, based on the classname as string, the classes and the actual parameters
newInstance
{ "repo_name": "smhoekstra/iaf", "path": "JavaSource/nl/nn/adapterframework/util/ClassUtils.java", "license": "apache-2.0", "size": 16016 }
[ "java.lang.reflect.Constructor", "java.lang.reflect.InvocationTargetException" ]
import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
424,515
void scheduleTaskNow(Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException;
void scheduleTaskNow(Task task, OperationResult parentResult) throws SchemaException, ObjectNotFoundException;
/** * Schedules a RUNNABLE task or CLOSED single-run task to be run immediately. (If the task will really start immediately, * depends e.g. on whether a scheduler is started, whether there are available threads, and so on.) * * @param task * @param parentResult */
Schedules a RUNNABLE task or CLOSED single-run task to be run immediately. (If the task will really start immediately, depends e.g. on whether a scheduler is started, whether there are available threads, and so on.)
scheduleTaskNow
{ "repo_name": "rpudil/midpoint", "path": "repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java", "license": "apache-2.0", "size": 26766 }
[ "com.evolveum.midpoint.schema.result.OperationResult", "com.evolveum.midpoint.util.exception.ObjectNotFoundException", "com.evolveum.midpoint.util.exception.SchemaException" ]
import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.util.exception.*;
[ "com.evolveum.midpoint" ]
com.evolveum.midpoint;
105,939
// F = m * a, so multiply gravity by mass private Vec2 forceOfGravity(Mass m) { float mass = m.getBody().getMass(); return new Vec2(gravity.x * mass * g_multiplier, gravity.y * mass * g_multiplier); }
Vec2 function(Mass m) { float mass = m.getBody().getMass(); return new Vec2(gravity.x * mass * g_multiplier, gravity.y * mass * g_multiplier); }
/** * Gravity is applied to masses by calculating the force acting on them and * then applying it to that mass. Calculations occur independently of * application of the force. * * @param m * The mass for which gravity is being calculated * @return A Vec2 object that stores the x and y components of the gravity * vector separately. */
Gravity is applied to masses by calculating the force acting on them and then applying it to that mass. Calculations occur independently of application of the force
forceOfGravity
{ "repo_name": "chinnychin19/CS308_Proj2", "path": "src/jboxGlue/OurWorld.java", "license": "mit", "size": 8200 }
[ "org.jbox2d.common.Vec2" ]
import org.jbox2d.common.Vec2;
import org.jbox2d.common.*;
[ "org.jbox2d.common" ]
org.jbox2d.common;
91,948
public static String normalizePath(String path) { if (Strings.isEmpty(path)) { return ""; } path = path.trim(); if (!path.startsWith("/")) { path = "/" + path; } if (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } return path; }
static String function(String path) { if (Strings.isEmpty(path)) { return STR/STR/STR/")) { path = path.substring(0, path.length() - 1); } return path; }
/** * Makes sure the path starts with a slash and does not end with a slash. Empty or null paths * are normalized into an empty string. * * @param path * path to normalize * @return normalized path */
Makes sure the path starts with a slash and does not end with a slash. Empty or null paths are normalized into an empty string
normalizePath
{ "repo_name": "dashorst/wicket", "path": "wicket-request/src/main/java/org/apache/wicket/request/UrlUtils.java", "license": "apache-2.0", "size": 2407 }
[ "org.apache.wicket.util.string.Strings" ]
import org.apache.wicket.util.string.Strings;
import org.apache.wicket.util.string.*;
[ "org.apache.wicket" ]
org.apache.wicket;
1,171,663
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // 获得JSP页面的请求参数 String username = request.getParameter("username"); String password = request.getParameter("pwd"); String username1 = null; String password1 = null; String code = request.getParameter("code"); // 获得JSP页面的时间信息 String timelength = request.getParameter("timelength"); int days = 0; if (timelength != null) { days = Integer.parseInt(timelength); } if (days != 0) { Cookie usernamecookie = new Cookie("username", username); Cookie passwordcookie = new Cookie("pwd", password); usernamecookie.setMaxAge(days * 24 * 3600); passwordcookie.setMaxAge(days * 24 * 3600); response.addCookie(usernamecookie); response.addCookie(passwordcookie); } if (code != null && code.equals("exit")) { Cookie[] cookies = request.getCookies(); try { for (int i = 0; i < cookies.length; i++) { if (cookies[i].getName().equals("username") || cookies[i].getName().equals("password")) { cookies[i].setValue(null); cookies[i].setMaxAge(0); response.addCookie(cookies[i]); } } } catch (Exception ex) { System.out.println("清空Cookies发生异常!"); } request.getRequestDispatcher("login.jsp") .forward(request, response); return; } // 调用Service层的业务逻辑方法 EmployeeService service = new EmployeeService(); int flag = service.login(username, password); // 根据业务逻辑方法不同返回值,跳转到不同页面,同时传递不同的提示信息属性 if (flag == 1) { // 获得会话对象 HttpSession session = request.getSession(); // 把登录成功的员工姓名保存到会话中 session.setAttribute("employeename", service.getLoginedEmployee() .getEmployeename()); // 把登录成功的员工帐户名保存到会话中 session.setAttribute("username", service.getLoginedEmployee() .getUsername()); // 根据角色跳转到不同页面 // 1、管理员 2、普通员工 String role = service.getLoginedEmployee().getRole(); if (role.equals("1")) { request.getRequestDispatcher("n_admin_index.jsp").forward(request, response); } if (role.equals("2")) { request.getRequestDispatcher("n_user_index.jsp").forward( request, response); } } else { if (flag == 0) { request.setAttribute("msg", "正在审核,请耐心等待。"); } if (flag == 2) { request.setAttribute("msg", "审核未通过,请核实后重新注册。"); } if (flag == 3) { request.setAttribute("msg", "用户名或密码错误,请重试。"); } request.getRequestDispatcher("n_login.jsp") .forward(request, response); } }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String username = request.getParameter(STR); String password = request.getParameter("pwd"); String username1 = null; String password1 = null; String code = request.getParameter("code"); String timelength = request.getParameter(STR); int days = 0; if (timelength != null) { days = Integer.parseInt(timelength); } if (days != 0) { Cookie usernamecookie = new Cookie(STR, username); Cookie passwordcookie = new Cookie("pwd", password); usernamecookie.setMaxAge(days * 24 * 3600); passwordcookie.setMaxAge(days * 24 * 3600); response.addCookie(usernamecookie); response.addCookie(passwordcookie); } if (code != null && code.equals("exit")) { Cookie[] cookies = request.getCookies(); try { for (int i = 0; i < cookies.length; i++) { if (cookies[i].getName().equals(STR) cookies[i].getName().equals(STR)) { cookies[i].setValue(null); cookies[i].setMaxAge(0); response.addCookie(cookies[i]); } } } catch (Exception ex) { System.out.println(STR); } request.getRequestDispatcher(STR) .forward(request, response); return; } EmployeeService service = new EmployeeService(); int flag = service.login(username, password); if (flag == 1) { HttpSession session = request.getSession(); session.setAttribute(STR, service.getLoginedEmployee() .getEmployeename()); session.setAttribute(STR, service.getLoginedEmployee() .getUsername()); String role = service.getLoginedEmployee().getRole(); if (role.equals("1")) { request.getRequestDispatcher(STR).forward(request, response); } if (role.equals("2")) { request.getRequestDispatcher(STR).forward( request, response); } } else { if (flag == 0) { request.setAttribute("msg", STR); } if (flag == 2) { request.setAttribute("msg", STR); } if (flag == 3) { request.setAttribute("msg", STR); } request.getRequestDispatcher(STR) .forward(request, response); } }
/** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to * post. * * @param request * the request send by the client to the server * @param response * the response send by the server to the client * @throws ServletException * if an error occurred * @throws IOException * if an error occurred */
The doPost method of the servlet. This method is called when a form has its tag value method equals to post
doPost
{ "repo_name": "Course-MeetingSystem17-06/TheMeetingSystem", "path": "src/servlet/LoginServlet.java", "license": "mit", "size": 4209 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.Cookie", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "javax.servlet.http.HttpSession" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,926,479
List<DiskImage> getAllSnapshotsForImageGroup(Guid id);
List<DiskImage> getAllSnapshotsForImageGroup(Guid id);
/** * Retrieves all snapshots associated with the given image group. * * @param id * the image group id * @return the list of snapshots */
Retrieves all snapshots associated with the given image group
getAllSnapshotsForImageGroup
{ "repo_name": "OpenUniversity/ovirt-engine", "path": "backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDao.java", "license": "apache-2.0", "size": 4296 }
[ "java.util.List", "org.ovirt.engine.core.common.businessentities.storage.DiskImage", "org.ovirt.engine.core.compat.Guid" ]
import java.util.List; import org.ovirt.engine.core.common.businessentities.storage.DiskImage; import org.ovirt.engine.core.compat.Guid;
import java.util.*; import org.ovirt.engine.core.common.businessentities.storage.*; import org.ovirt.engine.core.compat.*;
[ "java.util", "org.ovirt.engine" ]
java.util; org.ovirt.engine;
2,423,613
public void vibrate(long time) { // Start the vibration, 0 defaults to half a second. if (time == 0) { time = 500; } Vibrator vibrator = (Vibrator) this.cordova.getActivity().getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(time); }
void function(long time) { if (time == 0) { time = 500; } Vibrator vibrator = (Vibrator) this.cordova.getActivity().getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(time); }
/** * Vibrates the device for the specified amount of time. * * @param time Time to vibrate in ms. */
Vibrates the device for the specified amount of time
vibrate
{ "repo_name": "cljack-public/phonegap", "path": "framework/src/org/apache/cordova/Notification.java", "license": "apache-2.0", "size": 13190 }
[ "android.content.Context", "android.os.Vibrator" ]
import android.content.Context; import android.os.Vibrator;
import android.content.*; import android.os.*;
[ "android.content", "android.os" ]
android.content; android.os;
712,494
public boolean containOnlyDigitalGoods() { for (ShoppingCartItem cartItem : this.cartLines) { GenericValue product = cartItem.getProduct(); try { GenericValue productType = product.getRelatedOne("ProductType", true); if (productType == null || !"N".equals(productType.getString("isPhysical"))) { return false; } } catch (GenericEntityException e) { Debug.logError(e, "Error looking up ProductType: " + e.toString(), module); // consider this not a digital good if we don't have "proof" return false; } } return true; }
boolean function() { for (ShoppingCartItem cartItem : this.cartLines) { GenericValue product = cartItem.getProduct(); try { GenericValue productType = product.getRelatedOne(STR, true); if (productType == null !"N".equals(productType.getString(STR))) { return false; } } catch (GenericEntityException e) { Debug.logError(e, STR + e.toString(), module); return false; } } return true; }
/** * Check to see if the cart contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera. * This is determined by making sure no Product has a type where ProductType.isPhysical!=N. */
Check to see if the cart contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera. This is determined by making sure no Product has a type where ProductType.isPhysical!=N
containOnlyDigitalGoods
{ "repo_name": "ofbizfriends/vogue", "path": "applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java", "license": "apache-2.0", "size": 230583 }
[ "org.ofbiz.base.util.Debug", "org.ofbiz.entity.GenericEntityException", "org.ofbiz.entity.GenericValue" ]
import org.ofbiz.base.util.Debug; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue;
import org.ofbiz.base.util.*; import org.ofbiz.entity.*;
[ "org.ofbiz.base", "org.ofbiz.entity" ]
org.ofbiz.base; org.ofbiz.entity;
2,076,765
protected static void moveItems(JList list, int moveby, int direction) { int[] indices; int i; Object o; DefaultListModel model; model = (DefaultListModel) list.getModel(); switch (direction) { case MOVE_UP: indices = list.getSelectedIndices(); for (i = 0; i < indices.length; i++) { if (indices[i] == 0) continue; o = model.remove(indices[i]); indices[i] -= moveby; model.insertElementAt(o, indices[i]); } list.setSelectedIndices(indices); break; case MOVE_DOWN: indices = list.getSelectedIndices(); for (i = indices.length - 1; i >= 0; i--) { if (indices[i] == model.getSize() - 1) continue; o = model.remove(indices[i]); indices[i] += moveby; model.insertElementAt(o, indices[i]); } list.setSelectedIndices(indices); break; default: System.err.println( JListHelper.class.getName() + ": direction '" + direction + "' is unknown!"); } }
static void function(JList list, int moveby, int direction) { int[] indices; int i; Object o; DefaultListModel model; model = (DefaultListModel) list.getModel(); switch (direction) { case MOVE_UP: indices = list.getSelectedIndices(); for (i = 0; i < indices.length; i++) { if (indices[i] == 0) continue; o = model.remove(indices[i]); indices[i] -= moveby; model.insertElementAt(o, indices[i]); } list.setSelectedIndices(indices); break; case MOVE_DOWN: indices = list.getSelectedIndices(); for (i = indices.length - 1; i >= 0; i--) { if (indices[i] == model.getSize() - 1) continue; o = model.remove(indices[i]); indices[i] += moveby; model.insertElementAt(o, indices[i]); } list.setSelectedIndices(indices); break; default: System.err.println( JListHelper.class.getName() + STR + direction + STR); } }
/** * moves the selected items by a certain amount of items in a given direction. * * @param list the JList to work on * @param moveby the number of items to move by * @param direction the direction to move in * @see #MOVE_UP * @see #MOVE_DOWN */
moves the selected items by a certain amount of items in a given direction
moveItems
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-core/src/main/java/adams/gui/core/JListHelper.java", "license": "gpl-3.0", "size": 5173 }
[ "javax.swing.DefaultListModel", "javax.swing.JList" ]
import javax.swing.DefaultListModel; import javax.swing.JList;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,191,229
@Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (ToscaPackage.Literals.SOURCE_INTERFACES_TYPE__INTERFACE, ToscaFactory.eINSTANCE.createTInterface())); }
void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (ToscaPackage.Literals.SOURCE_INTERFACES_TYPE__INTERFACE, ToscaFactory.eINSTANCE.createTInterface())); }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object.
collectNewChildDescriptors
{ "repo_name": "patrickneubauer/XMLIntellEdit", "path": "use-cases/TOSCA/eu.artist.tosca.edit/src/tosca/provider/SourceInterfacesTypeItemProvider.java", "license": "mit", "size": 4866 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,782,571
private Observable<String> getAuthToken(final ChallengeOptions challengeOptions) { return Observable.create(sub -> { try { challengeAuthentication(token -> { if (!TextUtils.isEmpty(token)) { sub.onNext(token); sub.onCompleted(); } else { sub.onError(new ComapiException("Null authentication token received from 3rd party.")); } }, challengeOptions); } catch (Throwable e) { sub.onError(e); } }); }
Observable<String> function(final ChallengeOptions challengeOptions) { return Observable.create(sub -> { try { challengeAuthentication(token -> { if (!TextUtils.isEmpty(token)) { sub.onNext(token); sub.onCompleted(); } else { sub.onError(new ComapiException(STR)); } }, challengeOptions); } catch (Throwable e) { sub.onError(e); } }); }
/** * Observable for a task to obtain an authentication token. * * @param challengeOptions Encapsulates challenge details - nonce, and expected user id for the token. * @return Observable for a task to obtain an authentication token. */
Observable for a task to obtain an authentication token
getAuthToken
{ "repo_name": "comapi/comapi-sdk-android", "path": "COMAPI/foundation/src/main/java/com/comapi/internal/network/SessionController.java", "license": "mit", "size": 19806 }
[ "android.text.TextUtils", "com.comapi.internal.ComapiException" ]
import android.text.TextUtils; import com.comapi.internal.ComapiException;
import android.text.*; import com.comapi.internal.*;
[ "android.text", "com.comapi.internal" ]
android.text; com.comapi.internal;
2,868,943
static boolean isDefinitionNode(Node n) { Node parent = n.getParent(); if (parent == null) { return false; } if (NodeUtil.isVarDeclaration(n) && (n.isFromExterns() || n.hasChildren())) { return true; } else if (parent.isFunction() && parent.getFirstChild() == n) { if (!NodeUtil.isFunctionExpression(parent)) { return true; } else if (!n.getString().isEmpty()) { return true; } } else if (parent.isAssign() && parent.getFirstChild() == n) { return true; } else if (NodeUtil.isObjectLitKey(n)) { return true; } else if (parent.isParamList()) { return true; } else if (parent.getToken() == Token.COLON && parent.getFirstChild() == n && n.isFromExterns()) { Node grandparent = parent.getParent(); checkState(grandparent.getToken() == Token.LB); checkState(grandparent.getParent().getToken() == Token.LC); return true; } else if (n.isFromExterns() && parent.isExprResult() && n.isGetProp() && n.isQualifiedName()) { return true; } return false; } abstract static class Definition { private final boolean isExtern; Definition(boolean isExtern) { this.isExtern = isExtern; }
static boolean isDefinitionNode(Node n) { Node parent = n.getParent(); if (parent == null) { return false; } if (NodeUtil.isVarDeclaration(n) && (n.isFromExterns() n.hasChildren())) { return true; } else if (parent.isFunction() && parent.getFirstChild() == n) { if (!NodeUtil.isFunctionExpression(parent)) { return true; } else if (!n.getString().isEmpty()) { return true; } } else if (parent.isAssign() && parent.getFirstChild() == n) { return true; } else if (NodeUtil.isObjectLitKey(n)) { return true; } else if (parent.isParamList()) { return true; } else if (parent.getToken() == Token.COLON && parent.getFirstChild() == n && n.isFromExterns()) { Node grandparent = parent.getParent(); checkState(grandparent.getToken() == Token.LB); checkState(grandparent.getParent().getToken() == Token.LC); return true; } else if (n.isFromExterns() && parent.isExprResult() && n.isGetProp() && n.isQualifiedName()) { return true; } return false; } abstract static class Definition { private final boolean isExtern; Definition(boolean isExtern) { this.isExtern = isExtern; }
/** * This logic must match {@link getDefinition}. * * @return Whether a definition object can be created. */
This logic must match <code>getDefinition</code>
isDefinitionNode
{ "repo_name": "GerHobbelt/closure-compiler", "path": "src/com/google/javascript/jscomp/DefinitionsRemover.java", "license": "apache-2.0", "size": 13463 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node", "com.google.javascript.rhino.Token" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
318,093
long findJobCountByQueryCriteria(DeadLetterJobQueryImpl jobQuery);
long findJobCountByQueryCriteria(DeadLetterJobQueryImpl jobQuery);
/** * Same as {@link #findJobsByQueryCriteria(DeadLetterJobQueryImpl, Page)}, but only returns a count * and not the instances itself. */
Same as <code>#findJobsByQueryCriteria(DeadLetterJobQueryImpl, Page)</code>, but only returns a count and not the instances itself
findJobCountByQueryCriteria
{ "repo_name": "Activiti/Activiti", "path": "activiti-core/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/DeadLetterJobEntityManager.java", "license": "apache-2.0", "size": 1792 }
[ "org.activiti.engine.impl.DeadLetterJobQueryImpl" ]
import org.activiti.engine.impl.DeadLetterJobQueryImpl;
import org.activiti.engine.impl.*;
[ "org.activiti.engine" ]
org.activiti.engine;
689,765
private void startContentSynchronizations( List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client ) { RemoteOperationResult contentsResult = null; for (SynchronizeFileOperation op: filesToSyncContents) { contentsResult = op.execute(mStorageManager, mContext); // async if (!contentsResult.isSuccess()) { if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) { mConflictsFound++; } else { mFailsInFavouritesFound++; if (contentsResult.getException() != null) { Log_OC.e(TAG, "Error while synchronizing favourites : " + contentsResult.getLogMessage(), contentsResult.getException()); } else { Log_OC.e(TAG, "Error while synchronizing favourites : " + contentsResult.getLogMessage()); } } } // won't let these fails break the synchronization process } }
void function( List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client ) { RemoteOperationResult contentsResult = null; for (SynchronizeFileOperation op: filesToSyncContents) { contentsResult = op.execute(mStorageManager, mContext); if (!contentsResult.isSuccess()) { if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) { mConflictsFound++; } else { mFailsInFavouritesFound++; if (contentsResult.getException() != null) { Log_OC.e(TAG, STR + contentsResult.getLogMessage(), contentsResult.getException()); } else { Log_OC.e(TAG, STR + contentsResult.getLogMessage()); } } } } }
/** * Performs a list of synchronization operations, determining if a download or upload is needed * or if exists conflict due to changes both in local and remote contents of the each file. * * If download or upload is needed, request the operation to the corresponding service and goes * on. * * @param filesToSyncContents Synchronization operations to execute. * @param client Interface to the remote ownCloud server. */
Performs a list of synchronization operations, determining if a download or upload is needed or if exists conflict due to changes both in local and remote contents of the each file. If download or upload is needed, request the operation to the corresponding service and goes on
startContentSynchronizations
{ "repo_name": "varesa/owncloud_android", "path": "src/com/owncloud/android/operations/SynchronizeFolderOperation.java", "license": "gpl-2.0", "size": 25498 }
[ "com.owncloud.android.lib.common.OwnCloudClient", "com.owncloud.android.lib.common.operations.RemoteOperationResult", "java.util.List" ]
import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import java.util.List;
import com.owncloud.android.lib.common.*; import com.owncloud.android.lib.common.operations.*; import java.util.*;
[ "com.owncloud.android", "java.util" ]
com.owncloud.android; java.util;
2,004,576
@Test public void testPutEntityAsync() throws IOException { TimelineWriter writer = mock(TimelineWriter.class); TimelineCollector collector = new TimelineCollectorForTest(writer); TimelineEntities entities = generateTestEntities(1, 1); collector.putEntitiesAsync( entities, UserGroupInformation.createRemoteUser("test-user")); verify(writer, times(1)).write( anyString(), anyString(), anyString(), anyString(), anyLong(), anyString(), any(TimelineEntities.class)); verify(writer, never()).flush(); } private static class TimelineCollectorForTest extends TimelineCollector { private final TimelineCollectorContext context = new TimelineCollectorContext(); TimelineCollectorForTest(TimelineWriter writer) { super("TimelineCollectorForTest"); setWriter(writer); }
void function() throws IOException { TimelineWriter writer = mock(TimelineWriter.class); TimelineCollector collector = new TimelineCollectorForTest(writer); TimelineEntities entities = generateTestEntities(1, 1); collector.putEntitiesAsync( entities, UserGroupInformation.createRemoteUser(STR)); verify(writer, times(1)).write( anyString(), anyString(), anyString(), anyString(), anyLong(), anyString(), any(TimelineEntities.class)); verify(writer, never()).flush(); } private static class TimelineCollectorForTest extends TimelineCollector { private final TimelineCollectorContext context = new TimelineCollectorContext(); TimelineCollectorForTest(TimelineWriter writer) { super(STR); setWriter(writer); }
/** * Test TimelineCollector's interaction with TimelineWriter upon * putEntityAsync() calls. */
Test TimelineCollector's interaction with TimelineWriter upon putEntityAsync() calls
testPutEntityAsync
{ "repo_name": "ronny-macmaster/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/collector/TestTimelineCollector.java", "license": "apache-2.0", "size": 11017 }
[ "java.io.IOException", "org.apache.hadoop.security.UserGroupInformation", "org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntities", "org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter", "org.mockito.Matchers", "org.mockito.Mockito" ]
import java.io.IOException; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntities; import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter; import org.mockito.Matchers; import org.mockito.Mockito;
import java.io.*; import org.apache.hadoop.security.*; import org.apache.hadoop.yarn.api.records.timelineservice.*; import org.apache.hadoop.yarn.server.timelineservice.storage.*; import org.mockito.*;
[ "java.io", "org.apache.hadoop", "org.mockito" ]
java.io; org.apache.hadoop; org.mockito;
2,814,820
private SortedSet<RegisteredListener> getEventListeners(Event.Type type) { SortedSet<RegisteredListener> eventListeners = listeners.get(type); if (eventListeners != null) { return eventListeners; } eventListeners = new TreeSet<RegisteredListener>(comparer); listeners.put(type, eventListeners); return eventListeners; }
SortedSet<RegisteredListener> function(Event.Type type) { SortedSet<RegisteredListener> eventListeners = listeners.get(type); if (eventListeners != null) { return eventListeners; } eventListeners = new TreeSet<RegisteredListener>(comparer); listeners.put(type, eventListeners); return eventListeners; }
/** * Returns a SortedSet of RegisteredListener for the specified event type creating a new queue if needed * * @param type EventType to lookup * @return SortedSet<RegisteredListener> the looked up or create queue matching the requested type */
Returns a SortedSet of RegisteredListener for the specified event type creating a new queue if needed
getEventListeners
{ "repo_name": "gaessaki/Bukkit", "path": "src/main/java/org/bukkit/plugin/SimplePluginManager.java", "license": "gpl-3.0", "size": 9695 }
[ "java.util.SortedSet", "java.util.TreeSet", "org.bukkit.event.Event" ]
import java.util.SortedSet; import java.util.TreeSet; import org.bukkit.event.Event;
import java.util.*; import org.bukkit.event.*;
[ "java.util", "org.bukkit.event" ]
java.util; org.bukkit.event;
2,421,179
@JsonProperty("detail") private String detail; public Error resourceValidationErrors( List<ResourceValidationErrorsElement> resourceValidationErrors) { this.resourceValidationErrors = resourceValidationErrors; return this; }
@JsonProperty(STR) String detail; public Error function( List<ResourceValidationErrorsElement> resourceValidationErrors) { this.resourceValidationErrors = resourceValidationErrors; return this; }
/** * Array of elements of resource validation errors * * @param resourceValidationErrors List&lt;ResourceValidationErrorsElement&gt; * @return Error */
Array of elements of resource validation errors
resourceValidationErrors
{ "repo_name": "XeroAPI/Xero-Java", "path": "src/main/java/com/xero/models/assets/Error.java", "license": "mit", "size": 7807 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "java.util.List" ]
import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List;
import com.fasterxml.jackson.annotation.*; import java.util.*;
[ "com.fasterxml.jackson", "java.util" ]
com.fasterxml.jackson; java.util;
2,223,096
protected static void debug(Chunk parentChunk, int level, Integer chunkID, long chunkLength, int position, long limit) { try { for (int i = 0; i < level; i++) { System.out.print(" "); } Object child = parentChunk.getSubChunk(chunkID); int id = ((short) chunkID.intValue()) & 0xFFFF; System.out.println(parentChunk + " is " + (child == null ? "skipping" : "LOADING") + ": [id=" + byteString(id) + ", object= <" + parentChunk.getSubChunk(chunkID) + ">, chunkLength=" + chunkLength + ", position=" + position + " limit=" + limit + "]"); } catch (Exception e) { // We're debugging.. its ok e.printStackTrace(); } }
static void function(Chunk parentChunk, int level, Integer chunkID, long chunkLength, int position, long limit) { try { for (int i = 0; i < level; i++) { System.out.print(" "); } Object child = parentChunk.getSubChunk(chunkID); int id = ((short) chunkID.intValue()) & 0xFFFF; System.out.println(parentChunk + STR + (child == null ? STR : STR) + STR + byteString(id) + STR + parentChunk.getSubChunk(chunkID) + STR + chunkLength + STR + position + STR + limit + "]"); } catch (Exception e) { e.printStackTrace(); } }
/** * prints some handy information... the chunk hierarchy. */
prints some handy information... the chunk hierarchy
debug
{ "repo_name": "windybell/jME3-3dsmax-plugins", "path": "jME3-Max3dsPlugin/src/com/jme3/asset/max3ds/Debug.java", "license": "gpl-2.0", "size": 1459 }
[ "com.jme3.asset.max3ds.chunks.Chunk" ]
import com.jme3.asset.max3ds.chunks.Chunk;
import com.jme3.asset.max3ds.chunks.*;
[ "com.jme3.asset" ]
com.jme3.asset;
1,615,630
public static int deleteSearch(final String username, final String requestName, final String request) { try { return SavedSearchDataService.getInstance().deleteSearch(username, requestName, request); } catch (final Exception e) { logger.error(e); e.printStackTrace(); return CodesReturned.PROBLEMCONNECTIONDATABASE.getValue(); } }
static int function(final String username, final String requestName, final String request) { try { return SavedSearchDataService.getInstance().deleteSearch(username, requestName, request); } catch (final Exception e) { logger.error(e); e.printStackTrace(); return CodesReturned.PROBLEMCONNECTIONDATABASE.getValue(); } }
/** * delete a search * * @param username * of the user * @param requestName * the request name * @param request * the search request * @return Search.ALREADYPERFORMED if the search was already deleted, * Search.ALLOK if all was ok and * Search.CodesReturned.PROBLEMCONNECTIONDATABASE if there's an * error */
delete a search
deleteSearch
{ "repo_name": "francelabs/datafari", "path": "datafari-webapp/src/main/java/com/francelabs/datafari/user/SavedSearch.java", "license": "apache-2.0", "size": 3645 }
[ "com.francelabs.datafari.exception.CodesReturned", "com.francelabs.datafari.service.db.SavedSearchDataService" ]
import com.francelabs.datafari.exception.CodesReturned; import com.francelabs.datafari.service.db.SavedSearchDataService;
import com.francelabs.datafari.exception.*; import com.francelabs.datafari.service.db.*;
[ "com.francelabs.datafari" ]
com.francelabs.datafari;
1,105,700
@Override public DocumentCollection FTSearchRange(String query, int maxDocs, int sortOpt, int otherOpt, int start) { // TODO Auto-generated method stub return null; }
DocumentCollection function(String query, int maxDocs, int sortOpt, int otherOpt, int start) { return null; }
/** * Not implemented yet. */
Not implemented yet
FTSearchRange
{ "repo_name": "hyarthi/project-red", "path": "src/java/org.openntf.red.main/src/org/openntf/red/impl/Database.java", "license": "apache-2.0", "size": 36930 }
[ "org.openntf.red.DocumentCollection" ]
import org.openntf.red.DocumentCollection;
import org.openntf.red.*;
[ "org.openntf.red" ]
org.openntf.red;
2,729,934
public StateMachineProxyBuilder setEventFactory(EventFactory eventFactory) { this.eventFactory = eventFactory; return this; }
StateMachineProxyBuilder function(EventFactory eventFactory) { this.eventFactory = eventFactory; return this; }
/** * Sets the {@link EventFactory} to be used. The default is to use a {@link DefaultEventFactory}. * * @param eventFactory * the {@link EventFactory} to use. * @return this {@link StateMachineProxyBuilder} for method chaining. */
Sets the <code>EventFactory</code> to be used. The default is to use a <code>DefaultEventFactory</code>
setEventFactory
{ "repo_name": "martinabsmeier/maITsm", "path": "src/main/java/de/ma/it/common/sm/StateMachineProxyBuilder.java", "license": "gpl-3.0", "size": 8703 }
[ "de.ma.it.common.sm.event.EventFactory" ]
import de.ma.it.common.sm.event.EventFactory;
import de.ma.it.common.sm.event.*;
[ "de.ma.it" ]
de.ma.it;
2,466,248
@Nullable Navigatable getErrorNavigatable(@NotNull Location<?> location, @NotNull String stacktrace);
Navigatable getErrorNavigatable(@NotNull Location<?> location, @NotNull String stacktrace);
/** * Used for navigation from tests view to the editor if "open failed line" option is selected */
Used for navigation from tests view to the editor if "open failed line" option is selected
getErrorNavigatable
{ "repo_name": "ingokegel/intellij-community", "path": "platform/smRunner/src/com/intellij/execution/testframework/sm/SMStacktraceParserEx.java", "license": "apache-2.0", "size": 1097 }
[ "com.intellij.execution.Location", "com.intellij.pom.Navigatable", "org.jetbrains.annotations.NotNull" ]
import com.intellij.execution.Location; import com.intellij.pom.Navigatable; import org.jetbrains.annotations.NotNull;
import com.intellij.execution.*; import com.intellij.pom.*; import org.jetbrains.annotations.*;
[ "com.intellij.execution", "com.intellij.pom", "org.jetbrains.annotations" ]
com.intellij.execution; com.intellij.pom; org.jetbrains.annotations;
1,123,050
public static String getDeviceVirtualID() { String m_szDevIDShort = "35" + //we make this look like a valid IMEI Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10 + Build.USER.length() % 10; //13 digits return m_szDevIDShort; }
static String function() { String m_szDevIDShort = "35" + Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10 + Build.USER.length() % 10; return m_szDevIDShort; }
/** * Try to generate unique string for a device * * @return */
Try to generate unique string for a device
getDeviceVirtualID
{ "repo_name": "SEA2015-GROUP7/projectTetViet", "path": "appTemplate/src/tetviet/utils/getUniqueDeviceId.java", "license": "mit", "size": 5417 }
[ "android.os.Build" ]
import android.os.Build;
import android.os.*;
[ "android.os" ]
android.os;
222,855
@Override public void initialize(URL arg0, ResourceBundle arg1) { fpBottomPane.setDisable(true); ObservableList<WebCamInfo> options = FXCollections.observableArrayList(); int webCamCounter = 0; for (Webcam webcam : Webcam.getWebcams()) { WebCamInfo webCamInfo = new WebCamInfo(); webCamInfo.setWebCamIndex(webCamCounter); webCamInfo.setWebCamName(webcam.getName()); options.add(webCamInfo); webCamCounter++; } cbCameraOptions.setItems(options); String cameraListPromptText = "Choose Camera"; cbCameraOptions.setPromptText(cameraListPromptText); cbCameraOptions.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<WebCamInfo>() {
void function(URL arg0, ResourceBundle arg1) { fpBottomPane.setDisable(true); ObservableList<WebCamInfo> options = FXCollections.observableArrayList(); int webCamCounter = 0; for (Webcam webcam : Webcam.getWebcams()) { WebCamInfo webCamInfo = new WebCamInfo(); webCamInfo.setWebCamIndex(webCamCounter); webCamInfo.setWebCamName(webcam.getName()); options.add(webCamInfo); webCamCounter++; } cbCameraOptions.setItems(options); String cameraListPromptText = STR; cbCameraOptions.setPromptText(cameraListPromptText); cbCameraOptions.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<WebCamInfo>() {
/** * The method to initialize the gui method. * @param arg0 URL * @param arg1 ResBundle */
The method to initialize the gui method
initialize
{ "repo_name": "CandyAI/FacialRec", "path": "src/main/java/gui/webCamPreviewController.java", "license": "mit", "size": 7701 }
[ "com.github.sarxos.webcam.Webcam", "java.util.ResourceBundle" ]
import com.github.sarxos.webcam.Webcam; import java.util.ResourceBundle;
import com.github.sarxos.webcam.*; import java.util.*;
[ "com.github.sarxos", "java.util" ]
com.github.sarxos; java.util;
1,914,298
void add(RemoteEvent event) throws IOException;
void add(RemoteEvent event) throws IOException;
/** * Writes the given <tt>RemoteEvent</tt> to the underlying * storage mechanism, if possible. If an <tt>IOException</tt> * occurs, then the write cannot be guaranteed. * * @exception IOException if an I/O error occurs */
Writes the given RemoteEvent to the underlying storage mechanism, if possible. If an IOException occurs, then the write cannot be guaranteed
add
{ "repo_name": "cdegroot/river", "path": "src/com/sun/jini/mercury/EventLog.java", "license": "apache-2.0", "size": 5757 }
[ "java.io.IOException", "net.jini.core.event.RemoteEvent" ]
import java.io.IOException; import net.jini.core.event.RemoteEvent;
import java.io.*; import net.jini.core.event.*;
[ "java.io", "net.jini.core" ]
java.io; net.jini.core;
846,040
public static boolean isSimple(GeoPackageDataType dataType) { return dataType != GeoPackageDataType.BLOB; }
static boolean function(GeoPackageDataType dataType) { return dataType != GeoPackageDataType.BLOB; }
/** * Determine if the data type is a simple type: TEXT, INTEGER, or REAL * storage classes * * @param dataType * data type * @return true if a simple column */
Determine if the data type is a simple type: TEXT, INTEGER, or REAL storage classes
isSimple
{ "repo_name": "ngageoint/geopackage-core-java", "path": "src/main/java/mil/nga/geopackage/extension/related/simple/SimpleAttributesTable.java", "license": "mit", "size": 9386 }
[ "mil.nga.geopackage.db.GeoPackageDataType" ]
import mil.nga.geopackage.db.GeoPackageDataType;
import mil.nga.geopackage.db.*;
[ "mil.nga.geopackage" ]
mil.nga.geopackage;
2,752,241
@Override public void start() throws IOException { super.start(); try { setPool(new RxTaskPool(getMaxThreads(),getMinThreads(),this)); } catch (Exception x) { log.fatal(sm.getString("nioReceiver.threadpool.fail"), x); if ( x instanceof IOException ) throw (IOException)x; else throw new IOException(x.getMessage()); } try { getBind(); bind(); String channelName = ""; if (getChannel().getName() != null) channelName = "[" + getChannel().getName() + "]"; Thread t = new Thread(this, "NioReceiver" + channelName); t.setDaemon(true); t.start(); } catch (Exception x) { log.fatal(sm.getString("nioReceiver.start.fail"), x); if ( x instanceof IOException ) throw (IOException)x; else throw new IOException(x.getMessage()); } }
void function() throws IOException { super.start(); try { setPool(new RxTaskPool(getMaxThreads(),getMinThreads(),this)); } catch (Exception x) { log.fatal(sm.getString(STR), x); if ( x instanceof IOException ) throw (IOException)x; else throw new IOException(x.getMessage()); } try { getBind(); bind(); String channelName = STR[STR]STRNioReceiverSTRnioReceiver.start.fail"), x); if ( x instanceof IOException ) throw (IOException)x; else throw new IOException(x.getMessage()); } }
/** * Start cluster receiver. * * @throws IOException If the receiver fails to start * * @see org.apache.catalina.tribes.ChannelReceiver#start() */
Start cluster receiver
start
{ "repo_name": "Nickname0806/Test_Q4", "path": "java/org/apache/catalina/tribes/transport/nio/NioReceiver.java", "license": "apache-2.0", "size": 18152 }
[ "java.io.IOException", "org.apache.catalina.tribes.transport.RxTaskPool" ]
import java.io.IOException; import org.apache.catalina.tribes.transport.RxTaskPool;
import java.io.*; import org.apache.catalina.tribes.transport.*;
[ "java.io", "org.apache.catalina" ]
java.io; org.apache.catalina;
1,488,511