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
EClass getModel();
EClass getModel();
/** * Returns the meta object for class '{@link xmbase.Model <em>Model</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Model</em>'. * @see xmbase.Model * @generated */
Returns the meta object for class '<code>xmbase.Model Model</code>'.
getModel
{ "repo_name": "abstratt/xm", "path": "xmodel/src-gen/xmbase/XmbasePackage.java", "license": "agpl-3.0", "size": 53166 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,084,669
protected void search() throws IOException { new CliReader().listSearchables(); }
void function() throws IOException { new CliReader().listSearchables(); }
/** * Starts a search operation (i.e., list the available web sites we can * search on). * * @throws IOException * in case of I/O errors */
Starts a search operation (i.e., list the available web sites we can search on)
search
{ "repo_name": "nikiroo/fanfix", "path": "src/be/nikiroo/fanfix/Main.java", "license": "gpl-3.0", "size": 31420 }
[ "be.nikiroo.fanfix.reader.CliReader", "java.io.IOException" ]
import be.nikiroo.fanfix.reader.CliReader; import java.io.IOException;
import be.nikiroo.fanfix.reader.*; import java.io.*;
[ "be.nikiroo.fanfix", "java.io" ]
be.nikiroo.fanfix; java.io;
1,719,813
@SuppressWarnings({"ForLoopReplaceableByForEach", "IfMayBeConditional"}) private MiniFuture miniFuture(IgniteUuid miniId) { // We iterate directly over the futs collection here to avoid copy. synchronized (sync) { int size = futuresCountNoLock(); // Avoid iterator creation. for (int i = 0; i < size; i++) { IgniteInternalFuture<Boolean> fut = future(i); if (!isMini(fut)) continue; MiniFuture mini = (MiniFuture)fut; if (mini.futureId().equals(miniId)) { if (!mini.isDone()) return mini; else return null; } } } return null; }
@SuppressWarnings({STR, STR}) MiniFuture function(IgniteUuid miniId) { synchronized (sync) { int size = futuresCountNoLock(); for (int i = 0; i < size; i++) { IgniteInternalFuture<Boolean> fut = future(i); if (!isMini(fut)) continue; MiniFuture mini = (MiniFuture)fut; if (mini.futureId().equals(miniId)) { if (!mini.isDone()) return mini; else return null; } } } return null; }
/** * Finds pending mini future by the given mini ID. * * @param miniId Mini ID to find. * @return Mini future. */
Finds pending mini future by the given mini ID
miniFuture
{ "repo_name": "afinka77/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java", "license": "apache-2.0", "size": 62757 }
[ "org.apache.ignite.internal.IgniteInternalFuture", "org.apache.ignite.lang.IgniteUuid" ]
import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.internal.*; import org.apache.ignite.lang.*;
[ "org.apache.ignite" ]
org.apache.ignite;
333,325
public void lookupRepositoryReferences( Repository repository ) throws KettleException;
void function( Repository repository ) throws KettleException;
/** * Look up the references after import * * @param repository * the repository to reference. */
Look up the references after import
lookupRepositoryReferences
{ "repo_name": "apratkin/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/step/StepMetaInterface.java", "license": "apache-2.0", "size": 29826 }
[ "org.pentaho.di.core.exception.KettleException", "org.pentaho.di.repository.Repository" ]
import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.repository.Repository;
import org.pentaho.di.core.exception.*; import org.pentaho.di.repository.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,076,620
public void setChart(JFreeChart chart) { // stop listening for changes to the existing chart if (this.chart != null) { this.chart.removeChangeListener(this); this.chart.removeProgressListener(this); } // add the new chart this.chart = chart; if (chart != null) { this.chart.addChangeListener(this); this.chart.addProgressListener(this); Plot plot = chart.getPlot(); this.domainZoomable = false; this.rangeZoomable = false; if (plot instanceof Zoomable) { Zoomable z = (Zoomable) plot; this.domainZoomable = z.isDomainZoomable(); this.rangeZoomable = z.isRangeZoomable(); this.orientation = z.getOrientation(); } } else { this.domainZoomable = false; this.rangeZoomable = false; } if (this.useBuffer) { this.refreshBuffer = true; } repaint(); }
void function(JFreeChart chart) { if (this.chart != null) { this.chart.removeChangeListener(this); this.chart.removeProgressListener(this); } this.chart = chart; if (chart != null) { this.chart.addChangeListener(this); this.chart.addProgressListener(this); Plot plot = chart.getPlot(); this.domainZoomable = false; this.rangeZoomable = false; if (plot instanceof Zoomable) { Zoomable z = (Zoomable) plot; this.domainZoomable = z.isDomainZoomable(); this.rangeZoomable = z.isRangeZoomable(); this.orientation = z.getOrientation(); } } else { this.domainZoomable = false; this.rangeZoomable = false; } if (this.useBuffer) { this.refreshBuffer = true; } repaint(); }
/** * Sets the chart that is displayed in the panel. * * @param chart the chart (<code>null</code> permitted). */
Sets the chart that is displayed in the panel
setChart
{ "repo_name": "ibestvina/multithread-centiscape", "path": "CentiScaPe2.1/src/main/java/org/jfree/chart/ChartPanel.java", "license": "mit", "size": 88952 }
[ "org.jfree.chart.plot.Plot", "org.jfree.chart.plot.Zoomable" ]
import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.Zoomable;
import org.jfree.chart.plot.*;
[ "org.jfree.chart" ]
org.jfree.chart;
485,911
@Test public void test_hashCode1() { ProteinPowder c1 = new ProteinPowder(86028807, 15, "chocolate"); ProteinPowder c2 = new ProteinPowder(86028807, 15, "chocolate"); assertTrue(c1.hashCode()==c2.hashCode()); }
void function() { ProteinPowder c1 = new ProteinPowder(86028807, 15, STR); ProteinPowder c2 = new ProteinPowder(86028807, 15, STR); assertTrue(c1.hashCode()==c2.hashCode()); }
/** Test case 1 for .hashCode @see ProteinPowder#hashCode */
Test case 1 for .hashCode
test_hashCode1
{ "repo_name": "UCSB-CS56-W14/W14-lab05", "path": "src/edu/ucsb/cs56/w14/lab05/loganortega/ProteinPowderTest.java", "license": "mit", "size": 2372 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,225,316
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } xmlWriter.writeAttribute(namespace,attName,attValue); }
void function(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } xmlWriter.writeAttribute(namespace,attName,attValue); }
/** * Util method to write an attribute with the ns prefix */
Util method to write an attribute with the ns prefix
writeAttribute
{ "repo_name": "zzsoszz/axiswebservice_demo", "path": "opensource_axis2.1.6.2/org/apache/axis2/databinding/types/xsd/NormalizedString.java", "license": "apache-2.0", "size": 21646 }
[ "javax.xml.stream.XMLStreamWriter" ]
import javax.xml.stream.XMLStreamWriter;
import javax.xml.stream.*;
[ "javax.xml" ]
javax.xml;
1,499,221
public void setFile(final String absFilePath) throws IOException { this.absoluteFilePath = absFilePath; this.resetReader(); if (new File(this.absoluteFilePath).length() == 0) { throw new IOException("Empty file given: " + this.absoluteFilePath); } if (this.splitLines) { if (inSplit == null) this.tryFindSplit(); this.resetReader(); } }
void function(final String absFilePath) throws IOException { this.absoluteFilePath = absFilePath; this.resetReader(); if (new File(this.absoluteFilePath).length() == 0) { throw new IOException(STR + this.absoluteFilePath); } if (this.splitLines) { if (inSplit == null) this.tryFindSplit(); this.resetReader(); } }
/** * Sets the file. * * @param absFilePath the new file * @throws IOException Signals that an I/O exception has occurred. */
Sets the file
setFile
{ "repo_name": "wiwie/Wiutils", "path": "src/de/wiwie/wiutils/utils/parse/TextFileParser.java", "license": "gpl-3.0", "size": 19339 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,910,369
public static String insertItem(String playlistId, String videoId) throws IOException { // Define a resourceId that identifies the video being added to the // playlist. ResourceId resourceId = new ResourceId(); resourceId.setKind("youtube#video"); resourceId.setVideoId(videoId); // Set fields included in the playlistItem resource's "snippet" part. PlaylistItemSnippet playlistItemSnippet = new PlaylistItemSnippet(); playlistItemSnippet.setTitle("Test video " + Calendar.getInstance().getTime()); playlistItemSnippet.setPlaylistId(playlistId); playlistItemSnippet.setResourceId(resourceId); // Create the playlistItem resource and set its snippet to the // object created above. PlaylistItem playlistItem = new PlaylistItem(); playlistItem.setSnippet(playlistItemSnippet); // Call the API to add the playlist item to the specified playlist. // In the API call, the first argument identifies the resource parts // that the API response should contain, and the second argument is // the playlist item being inserted. YouTube.PlaylistItems.Insert playlistItemsInsertCommand = youtube .playlistItems().insert("snippet,contentDetails", playlistItem); PlaylistItem returnedPlaylistItem = playlistItemsInsertCommand .execute(); log.debug("New PlaylistItem name: " + returnedPlaylistItem.getSnippet().getTitle()); log.debug(" -Video id: " + returnedPlaylistItem.getSnippet().getResourceId() .getVideoId()); log.debug(" -Posted: " + returnedPlaylistItem.getSnippet().getPublishedAt()); log.debug(" -Channel: " + returnedPlaylistItem.getSnippet().getChannelId()); return returnedPlaylistItem.getId(); }
static String function(String playlistId, String videoId) throws IOException { ResourceId resourceId = new ResourceId(); resourceId.setKind(STR); resourceId.setVideoId(videoId); PlaylistItemSnippet playlistItemSnippet = new PlaylistItemSnippet(); playlistItemSnippet.setTitle(STR + Calendar.getInstance().getTime()); playlistItemSnippet.setPlaylistId(playlistId); playlistItemSnippet.setResourceId(resourceId); PlaylistItem playlistItem = new PlaylistItem(); playlistItem.setSnippet(playlistItemSnippet); YouTube.PlaylistItems.Insert playlistItemsInsertCommand = youtube .playlistItems().insert(STR, playlistItem); PlaylistItem returnedPlaylistItem = playlistItemsInsertCommand .execute(); log.debug(STR + returnedPlaylistItem.getSnippet().getTitle()); log.debug(STR + returnedPlaylistItem.getSnippet().getResourceId() .getVideoId()); log.debug(STR + returnedPlaylistItem.getSnippet().getPublishedAt()); log.debug(STR + returnedPlaylistItem.getSnippet().getChannelId()); return returnedPlaylistItem.getId(); }
/** * Create a playlist item with the specified video ID and add it to the * specified playlist. * * @param playlistId * assign to newly created playlistitem * @param videoId * YouTube video id to add to playlistitem * @return The ID that YouTube uses to uniquely identify the playlist item. * The value returned may be null. * @throws IOException */
Create a playlist item with the specified video ID and add it to the specified playlist
insertItem
{ "repo_name": "KurentoLegacy/kmf-content-demo", "path": "src/main/java/com/kurento/demo/cpbrazil/youtube/Playlists.java", "license": "lgpl-2.1", "size": 4691 }
[ "com.google.api.services.youtube.YouTube", "com.google.api.services.youtube.model.PlaylistItem", "com.google.api.services.youtube.model.PlaylistItemSnippet", "com.google.api.services.youtube.model.ResourceId", "java.io.IOException", "java.util.Calendar" ]
import com.google.api.services.youtube.YouTube; import com.google.api.services.youtube.model.PlaylistItem; import com.google.api.services.youtube.model.PlaylistItemSnippet; import com.google.api.services.youtube.model.ResourceId; import java.io.IOException; import java.util.Calendar;
import com.google.api.services.youtube.*; import com.google.api.services.youtube.model.*; import java.io.*; import java.util.*;
[ "com.google.api", "java.io", "java.util" ]
com.google.api; java.io; java.util;
802,869
private void parse() throws InvalidConfigurationException { while (current < value.length()) { if (atVariableStart()) { parseVariableChunk(); } else { parseStringChunk(); } } }
void function() throws InvalidConfigurationException { while (current < value.length()) { if (atVariableStart()) { parseVariableChunk(); } else { parseStringChunk(); } } }
/** * Parses the string. * * @throws InvalidConfigurationException if there is a parsing error. */
Parses the string
parse
{ "repo_name": "mrdomino/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java", "license": "apache-2.0", "size": 61196 }
[ "com.google.devtools.build.lib.analysis.config.InvalidConfigurationException" ]
import com.google.devtools.build.lib.analysis.config.InvalidConfigurationException;
import com.google.devtools.build.lib.analysis.config.*;
[ "com.google.devtools" ]
com.google.devtools;
1,956,633
public static Date createDate(String str) { Date date = null; if(date == null) { System.err.println("Unable to parse: "+str); } return date; }
static Date function(String str) { Date date = null; if(date == null) { System.err.println(STR+str); } return date; }
/** * <p>Returns the date represented by <code>str</code>.</p> * * @param str the date string * @return The date if <code>str</code> is a valid date string, * otherwise return null. */
Returns the date represented by <code>str</code>
createDate
{ "repo_name": "henrysher/bootchart", "path": "lib/org/apache/commons/cli/TypeHandler.java", "license": "gpl-2.0", "size": 8575 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,301,386
public static boolean isAccessorPair(TMember member, TMember member2) { return (member instanceof TGetter && member2 instanceof TSetter) || (member instanceof TSetter && member2 instanceof TGetter); }
static boolean function(TMember member, TMember member2) { return (member instanceof TGetter && member2 instanceof TSetter) (member instanceof TSetter && member2 instanceof TGetter); }
/** * Returns true if one of the members is a getter and the other one is a setter. No further validation such as name * or owner comparison is done as this is expected to be done in the client already. */
Returns true if one of the members is a getter and the other one is a setter. No further validation such as name or owner comparison is done as this is expected to be done in the client already
isAccessorPair
{ "repo_name": "lbeurerkellner/n4js", "path": "plugins/org.eclipse.n4js.ts/src/org/eclipse/n4js/ts/utils/TypeUtils.java", "license": "epl-1.0", "size": 59084 }
[ "org.eclipse.n4js.ts.types.TGetter", "org.eclipse.n4js.ts.types.TMember", "org.eclipse.n4js.ts.types.TSetter" ]
import org.eclipse.n4js.ts.types.TGetter; import org.eclipse.n4js.ts.types.TMember; import org.eclipse.n4js.ts.types.TSetter;
import org.eclipse.n4js.ts.types.*;
[ "org.eclipse.n4js" ]
org.eclipse.n4js;
2,643,268
public int getCaseIndex(int accessor, String name) { JMFFieldDef field = getFieldDef(accessor); if (!(field instanceof JSVariant)) return -1; JMFType target = findVariantChildByName((JSVariant)field, name); if (target != null) return getEffectiveSiblingPosition(target); else return -1; }
int function(int accessor, String name) { JMFFieldDef field = getFieldDef(accessor); if (!(field instanceof JSVariant)) return -1; JMFType target = findVariantChildByName((JSVariant)field, name); if (target != null) return getEffectiveSiblingPosition(target); else return -1; }
/** * Resolve a case name to a case index * * @param accessor the accessor of a JSVariant in the schema in whose scope the case * name is to be resolved * @param name the case name to be resolved * @return the case index associated with the name or -1 if either the accessor does not * refer to a JSVariant in this schema or the name doesn't name one of its cases */
Resolve a case name to a case index
getCaseIndex
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java", "license": "epl-1.0", "size": 27045 }
[ "com.ibm.ws.sib.mfp.jmf.JMFFieldDef", "com.ibm.ws.sib.mfp.jmf.JMFType" ]
import com.ibm.ws.sib.mfp.jmf.JMFFieldDef; import com.ibm.ws.sib.mfp.jmf.JMFType;
import com.ibm.ws.sib.mfp.jmf.*;
[ "com.ibm.ws" ]
com.ibm.ws;
2,644,454
@Override public void tokenize(String s) { m_Tokens = new ArrayList<String>(Arrays.asList(s.split("\\s"))); }
void function(String s) { m_Tokens = new ArrayList<String>(Arrays.asList(s.split("\\s"))); }
/** * Sets the string to tokenize. Tokenization happens immediately. * * @param s the string to tokenize */
Sets the string to tokenize. Tokenization happens immediately
tokenize
{ "repo_name": "fracpete/nlp-weka-package", "path": "src/main/java/weka/core/tokenizers/WhiteSpaceTokenizer.java", "license": "gpl-3.0", "size": 2576 }
[ "java.util.ArrayList", "java.util.Arrays" ]
import java.util.ArrayList; import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,514,055
public Observable<ServiceResponse<PublicIPPrefixInner>> updateTagsWithServiceResponseAsync(String resourceGroupName, String publicIpPrefixName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (publicIpPrefixName == null) { throw new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2019-04-01"; final Map<String, String> tags = null; TagsObject parameters = new TagsObject(); parameters.withTags(null); Observable<Response<ResponseBody>> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<PublicIPPrefixInner>() { }.getType()); }
Observable<ServiceResponse<PublicIPPrefixInner>> function(String resourceGroupName, String publicIpPrefixName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (publicIpPrefixName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } final String apiVersion = STR; final Map<String, String> tags = null; TagsObject parameters = new TagsObject(); parameters.withTags(null); Observable<Response<ResponseBody>> observable = service.updateTags(resourceGroupName, publicIpPrefixName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<PublicIPPrefixInner>() { }.getType()); }
/** * Updates public IP prefix tags. * * @param resourceGroupName The name of the resource group. * @param publicIpPrefixName The name of the public IP prefix. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
Updates public IP prefix tags
updateTagsWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/implementation/PublicIPPrefixesInner.java", "license": "mit", "size": 78189 }
[ "com.google.common.reflect.TypeToken", "com.microsoft.azure.management.network.v2019_04_01.TagsObject", "com.microsoft.rest.ServiceResponse", "java.util.Map" ]
import com.google.common.reflect.TypeToken; import com.microsoft.azure.management.network.v2019_04_01.TagsObject; import com.microsoft.rest.ServiceResponse; import java.util.Map;
import com.google.common.reflect.*; import com.microsoft.azure.management.network.v2019_04_01.*; import com.microsoft.rest.*; import java.util.*;
[ "com.google.common", "com.microsoft.azure", "com.microsoft.rest", "java.util" ]
com.google.common; com.microsoft.azure; com.microsoft.rest; java.util;
941,107
@Override public void failedStep(BatchJobExecution jobExecution, BatchStepExecution stepExecution, String flowFileId, String componentId) { nifiBulletinExceptionExtractor.addErrorMessagesToStep(stepExecution, flowFileId, componentId); }
void function(BatchJobExecution jobExecution, BatchStepExecution stepExecution, String flowFileId, String componentId) { nifiBulletinExceptionExtractor.addErrorMessagesToStep(stepExecution, flowFileId, componentId); }
/** * Fails the step identified by the parameters given * * @param jobExecution the job execution * @param stepExecution the step execution * @param flowFileId the id of the flow file * @param componentId the id of the component */
Fails the step identified by the parameters given
failedStep
{ "repo_name": "peter-gergely-horvath/kylo", "path": "services/operational-metadata-service/operational-metadata-integration-service/src/main/java/com/thinkbiganalytics/metadata/jobrepo/nifi/provenance/ProvenanceEventReceiver.java", "license": "apache-2.0", "size": 14576 }
[ "com.thinkbiganalytics.metadata.api.jobrepo.job.BatchJobExecution", "com.thinkbiganalytics.metadata.api.jobrepo.step.BatchStepExecution" ]
import com.thinkbiganalytics.metadata.api.jobrepo.job.BatchJobExecution; import com.thinkbiganalytics.metadata.api.jobrepo.step.BatchStepExecution;
import com.thinkbiganalytics.metadata.api.jobrepo.job.*; import com.thinkbiganalytics.metadata.api.jobrepo.step.*;
[ "com.thinkbiganalytics.metadata" ]
com.thinkbiganalytics.metadata;
1,739,430
public boolean isPluginDownloaded(String pluginFilename) { return new File(pluginDirectory + File.separator + pluginFilename).exists(); }
boolean function(String pluginFilename) { return new File(pluginDirectory + File.separator + pluginFilename).exists(); }
/** * Returns true if the specified filename, that belongs to a plugin, exists. * * @param pluginFilename the filename of the plugin to create or update. * @return true if the specified filename, that belongs to a plugin, exists. */
Returns true if the specified filename, that belongs to a plugin, exists
isPluginDownloaded
{ "repo_name": "AndrewChanChina/pps1", "path": "src/java/org/jivesoftware/openfire/container/PluginManager.java", "license": "apache-2.0", "size": 52260 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,541,606
public void testGetLogicalStyle02() { final StyleContext context = new StyleContext(); final Style style = context.addStyle("aStyle", null); final AbstractElement par = (AbstractElement) doc.getParagraphElement(5); doc.writeLock(); try { par.addAttribute(AttributeSet.ResolveAttribute, style); assertSame(style, doc.getLogicalStyle(5)); } finally { doc.writeUnlock(); } }
void function() { final StyleContext context = new StyleContext(); final Style style = context.addStyle(STR, null); final AbstractElement par = (AbstractElement) doc.getParagraphElement(5); doc.writeLock(); try { par.addAttribute(AttributeSet.ResolveAttribute, style); assertSame(style, doc.getLogicalStyle(5)); } finally { doc.writeUnlock(); } }
/** * Checks that logical style is ResolveAttribute of paragraph. */
Checks that logical style is ResolveAttribute of paragraph
testGetLogicalStyle02
{ "repo_name": "freeVM/freeVM", "path": "enhanced/archive/classlib/java6/modules/swing/src/test/api/java/common/javax/swing/text/DefaultStyledDocument_ElementsAndAttributesTest.java", "license": "apache-2.0", "size": 17621 }
[ "javax.swing.text.AbstractDocument" ]
import javax.swing.text.AbstractDocument;
import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
131,371
public static Properties getDeploymentProperties() { Path infraPropsFile = Paths.get(INPUTS_LOCATION + File.separator + INFRASTRUCTURE_PROPERTIES); Path deployPropsFile = Paths.get(INPUTS_LOCATION + File.separator + DEPLOYMENT_PROPERTIES); Path jobPropsFile = Paths.get(INPUTS_LOCATION + File.separator + JOB_PROPERTIES); Properties props = new Properties(); loadProperties(infraPropsFile, props); loadProperties(deployPropsFile, props); loadProperties(jobPropsFile, props); return props; }
static Properties function() { Path infraPropsFile = Paths.get(INPUTS_LOCATION + File.separator + INFRASTRUCTURE_PROPERTIES); Path deployPropsFile = Paths.get(INPUTS_LOCATION + File.separator + DEPLOYMENT_PROPERTIES); Path jobPropsFile = Paths.get(INPUTS_LOCATION + File.separator + JOB_PROPERTIES); Properties props = new Properties(); loadProperties(infraPropsFile, props); loadProperties(deployPropsFile, props); loadProperties(jobPropsFile, props); return props; }
/** * This is a utility method to load the deployment details. * The deployment details are available as key-value pairs in {@link #INFRASTRUCTURE_PROPERTIES}, * {@link #DEPLOYMENT_PROPERTIES}, and {@link #JOB_PROPERTIES} under the * {@link #INPUTS_LOCATION}. * * This method loads these files into one single properties, and return it. * * @return properties the deployment properties */
This is a utility method to load the deployment details. The deployment details are available as key-value pairs in <code>#INFRASTRUCTURE_PROPERTIES</code>, <code>#DEPLOYMENT_PROPERTIES</code>, and <code>#JOB_PROPERTIES</code> under the <code>#INPUTS_LOCATION</code>. This method loads these files into one single properties, and return it
getDeploymentProperties
{ "repo_name": "wso2/product-ei", "path": "product-scenarios/scenarios-commons/src/main/java/org/wso2/carbon/esb/scenario/test/common/ScenarioTestBase.java", "license": "apache-2.0", "size": 20631 }
[ "java.io.File", "java.nio.file.Path", "java.nio.file.Paths", "java.util.Properties" ]
import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties;
import java.io.*; import java.nio.file.*; import java.util.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
481,847
public static <D extends DataStore<K,T>, K, T extends Persistent> D createDataStore(Class<D> dataStoreClass , Class<K> keyClass, Class<T> persistent, Object auth) throws GoraException { return createDataStore(dataStoreClass, keyClass, persistent, auth, createProps(), null); }
static <D extends DataStore<K,T>, K, T extends Persistent> D function(Class<D> dataStoreClass , Class<K> keyClass, Class<T> persistent, Object auth) throws GoraException { return createDataStore(dataStoreClass, keyClass, persistent, auth, createProps(), null); }
/** * Instantiate a new {@link DataStore}. Uses default properties. Uses 'null' schema. * * @param dataStoreClass The datastore implementation class. * @param keyClass The key class. * @param persistent The value class. * @param conf {@link Configuration} to be used be the store. * @return A new store instance. * @throws GoraException */
Instantiate a new <code>DataStore</code>. Uses default properties. Uses 'null' schema
createDataStore
{ "repo_name": "lewismc/gora-maven-archetype", "path": "gora-core/src/main/java/org/apache/gora/store/ws/impl/WSDataStoreFactory.java", "license": "apache-2.0", "size": 15751 }
[ "org.apache.gora.persistency.Persistent", "org.apache.gora.store.DataStore", "org.apache.gora.util.GoraException" ]
import org.apache.gora.persistency.Persistent; import org.apache.gora.store.DataStore; import org.apache.gora.util.GoraException;
import org.apache.gora.persistency.*; import org.apache.gora.store.*; import org.apache.gora.util.*;
[ "org.apache.gora" ]
org.apache.gora;
2,358,137
private void assertUrlPatternDoesMatch(String content, String expectedProtocolPrefix, String expectedHostPart, String expectedPathPart, String expectedPathParameter, String expectedQueryPart, String expectedFragmentIdentifer) { Matcher matcher = UrlHelper.URL_PATTERN.matcher(content); Assert.assertTrue(matcher.find()); String group1 = matcher.group(1); String group2 = matcher.group(2); String group3 = matcher.group(3); String group4 = matcher.group(4); String group5 = matcher.group(5); String group6 = matcher.group(6); Assert.assertEquals(expectedProtocolPrefix, group1); Assert.assertEquals(expectedHostPart, group2); if (expectedPathPart != null) { Assert.assertEquals(group3, expectedPathPart); } else { Assert.assertNull(group3); } if (expectedPathParameter != null) { Assert.assertEquals(group4, expectedPathParameter); } else { Assert.assertNull(group4); } if (expectedQueryPart != null) { Assert.assertEquals(group5, expectedQueryPart); } else { Assert.assertNull(group5); } if (expectedFragmentIdentifer != null) { Assert.assertEquals(group6, expectedFragmentIdentifer); } else { Assert.assertNull(group6); } }
void function(String content, String expectedProtocolPrefix, String expectedHostPart, String expectedPathPart, String expectedPathParameter, String expectedQueryPart, String expectedFragmentIdentifer) { Matcher matcher = UrlHelper.URL_PATTERN.matcher(content); Assert.assertTrue(matcher.find()); String group1 = matcher.group(1); String group2 = matcher.group(2); String group3 = matcher.group(3); String group4 = matcher.group(4); String group5 = matcher.group(5); String group6 = matcher.group(6); Assert.assertEquals(expectedProtocolPrefix, group1); Assert.assertEquals(expectedHostPart, group2); if (expectedPathPart != null) { Assert.assertEquals(group3, expectedPathPart); } else { Assert.assertNull(group3); } if (expectedPathParameter != null) { Assert.assertEquals(group4, expectedPathParameter); } else { Assert.assertNull(group4); } if (expectedQueryPart != null) { Assert.assertEquals(group5, expectedQueryPart); } else { Assert.assertNull(group5); } if (expectedFragmentIdentifer != null) { Assert.assertEquals(group6, expectedFragmentIdentifer); } else { Assert.assertNull(group6); } }
/** * Tests that the URL is matched correctly. * * @param content * the content that contains the URL * @param expectedProtocolPrefix * expected protocol prefix including www if present (e.g. http://www.) * @param expectedHostPart * expect host part including port if necessary * @param expectedPathPart * expected path part. Can be null. * @param expectedPathParameter * expected path parameter including ; character. Can be null. * @param expectedQueryPart * expected query part including ? character. Can be null. * @param expectedFragmentIdentifer * expected fragment identifier including # character. Can be null. */
Tests that the URL is matched correctly
assertUrlPatternDoesMatch
{ "repo_name": "Communote/communote-server", "path": "communote/commons/src/test/java/com/communote/common/util/UrlHelperTest.java", "license": "apache-2.0", "size": 25305 }
[ "java.util.regex.Matcher", "org.testng.Assert" ]
import java.util.regex.Matcher; import org.testng.Assert;
import java.util.regex.*; import org.testng.*;
[ "java.util", "org.testng" ]
java.util; org.testng;
879,539
public void setReader(Reader r) { this.reader = r; readpos = 0; unread.clear(); peekc = NEED_CHAR; pushedBack = false; forceLower = false; lineno = 0; startpos = endpos = -1; ttype = TT_NOTHING; }
void function(Reader r) { this.reader = r; readpos = 0; unread.clear(); peekc = NEED_CHAR; pushedBack = false; forceLower = false; lineno = 0; startpos = endpos = -1; ttype = TT_NOTHING; }
/** * Sets the reader for the tokenizer. * * @param r */
Sets the reader for the tokenizer
setReader
{ "repo_name": "sebkur/montemedia", "path": "src/main/org/monte/media/io/StreamPosTokenizer.java", "license": "lgpl-3.0", "size": 38984 }
[ "java.io.Reader" ]
import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
2,212,477
public String[] getPathSegments() { ArrayList<String> list = new ArrayList<String>(); fillPathSegments(list); return list.toArray(new String[list.size()]); }
String[] function() { ArrayList<String> list = new ArrayList<String>(); fillPathSegments(list); return list.toArray(new String[list.size()]); }
/** * Returns the path as a list of segments. */
Returns the path as a list of segments
getPathSegments
{ "repo_name": "lrscp/AndroidFileExplorer", "path": "src/org/eclipse/swt/examples/fileviewer/FileListingService.java", "license": "apache-2.0", "size": 31526 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,711,677
JasperDesign designSummary(final ReportInfo report) throws Exception;
JasperDesign designSummary(final ReportInfo report) throws Exception;
/** * Populate the design of a report. Report's main content container is a design. * * @param report in * @return {@link JasperDesign} out * @throws Exception because there is a lot of under-the-hood I/O and reflection going on. */
Populate the design of a report. Report's main content container is a design
designSummary
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/tem/report/service/TravelReportFactoryService.java", "license": "agpl-3.0", "size": 2865 }
[ "net.sf.jasperreports.engine.design.JasperDesign", "org.kuali.kfs.sys.report.ReportInfo" ]
import net.sf.jasperreports.engine.design.JasperDesign; import org.kuali.kfs.sys.report.ReportInfo;
import net.sf.jasperreports.engine.design.*; import org.kuali.kfs.sys.report.*;
[ "net.sf.jasperreports", "org.kuali.kfs" ]
net.sf.jasperreports; org.kuali.kfs;
2,478,068
List<PluginDescriptor> getPlugins();
List<PluginDescriptor> getPlugins();
/** * Get all plugins defined in the module descriptor * * @return a list of module revision id that references plugins */
Get all plugins defined in the module descriptor
getPlugins
{ "repo_name": "apache/ant-easyant-core", "path": "src/main/java/org/apache/easyant/core/descriptor/EasyAntModuleDescriptor.java", "license": "apache-2.0", "size": 4031 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,911,164
public static LazyOptional<ICable> getCable(IBlockReader world, BlockPos pos, @Nullable Direction side) { return TileHelpers.getCapability(world, pos, side, CableConfig.CAPABILITY); }
static LazyOptional<ICable> function(IBlockReader world, BlockPos pos, @Nullable Direction side) { return TileHelpers.getCapability(world, pos, side, CableConfig.CAPABILITY); }
/** * Get the cable capability at the given position. * @param world The world. * @param pos The position. * @param side The side. * @return The optional cable capability. */
Get the cable capability at the given position
getCable
{ "repo_name": "CyclopsMC/IntegratedDynamics", "path": "src/main/java/org/cyclops/integrateddynamics/core/helper/CableHelpers.java", "license": "mit", "size": 19683 }
[ "javax.annotation.Nullable", "net.minecraft.util.Direction", "net.minecraft.util.math.BlockPos", "net.minecraft.world.IBlockReader", "net.minecraftforge.common.util.LazyOptional", "org.cyclops.cyclopscore.helper.TileHelpers", "org.cyclops.integrateddynamics.api.block.cable.ICable", "org.cyclops.integrateddynamics.capability.cable.CableConfig" ]
import javax.annotation.Nullable; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraftforge.common.util.LazyOptional; import org.cyclops.cyclopscore.helper.TileHelpers; import org.cyclops.integrateddynamics.api.block.cable.ICable; import org.cyclops.integrateddynamics.capability.cable.CableConfig;
import javax.annotation.*; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.world.*; import net.minecraftforge.common.util.*; import org.cyclops.cyclopscore.helper.*; import org.cyclops.integrateddynamics.api.block.cable.*; import org.cyclops.integrateddynamics.capability.cable.*;
[ "javax.annotation", "net.minecraft.util", "net.minecraft.world", "net.minecraftforge.common", "org.cyclops.cyclopscore", "org.cyclops.integrateddynamics" ]
javax.annotation; net.minecraft.util; net.minecraft.world; net.minecraftforge.common; org.cyclops.cyclopscore; org.cyclops.integrateddynamics;
1,261,523
public void destroy() throws ClientError, ServerError, ClientProtocolException, IOException { delete(); }
void function() throws ClientError, ServerError, ClientProtocolException, IOException { delete(); }
/** * synonym for delete * * @throws ClientError * @throws ServerError * @throws ClientProtocolException * @throws IOException */
synonym for delete
destroy
{ "repo_name": "jactiveresource/jactiveresource", "path": "src/main/java/org/jactiveresource/ActiveResource.java", "license": "bsd-3-clause", "size": 4775 }
[ "java.io.IOException", "org.apache.http.client.ClientProtocolException" ]
import java.io.IOException; import org.apache.http.client.ClientProtocolException;
import java.io.*; import org.apache.http.client.*;
[ "java.io", "org.apache.http" ]
java.io; org.apache.http;
2,534,953
public Set<String> getRootDocuments() { return Collections.unmodifiableSet(rootDocuments); }
Set<String> function() { return Collections.unmodifiableSet(rootDocuments); }
/** * Returns a read-only set of root document system IDs. */
Returns a read-only set of root document system IDs
getRootDocuments
{ "repo_name": "samskivert/ikvm-openjdk", "path": "build/linux-amd64/impsrc/com/sun/tools/internal/xjc/reader/internalizer/DOMForest.java", "license": "gpl-2.0", "size": 20734 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
936,404
String buildFullPath(HomeworkBaseModel model, String studentName) throws NullPointerException; // ======================== Thesis =============================
String buildFullPath(HomeworkBaseModel model, String studentName) throws NullPointerException;
/** * Make homework archives persistence full directory. * @param model * @param studentName * @return * @throws NullPointerException */
Make homework archives persistence full directory
buildFullPath
{ "repo_name": "lhfei/forestry-university-app", "path": "src/main/java/cn/lhfei/fu/service/IFilePathBuilder.java", "license": "gpl-2.0", "size": 2261 }
[ "cn.lhfei.fu.web.model.HomeworkBaseModel" ]
import cn.lhfei.fu.web.model.HomeworkBaseModel;
import cn.lhfei.fu.web.model.*;
[ "cn.lhfei.fu" ]
cn.lhfei.fu;
1,483,395
public ArticleResponse body(int articleNumber) throws IOException { return articleImpl(BODY, Integer.toString(articleNumber)); }
ArticleResponse function(int articleNumber) throws IOException { return articleImpl(BODY, Integer.toString(articleNumber)); }
/** * Send an article body retrieval request to the server. * @param articleNumber the article number of the article to body * @return an article response consisting of the article number and * message-id, and an iterator over the lines of the article body */
Send an article body retrieval request to the server
body
{ "repo_name": "SeekingFor/jfniki", "path": "alien/src/gnu/inet/nntp/NNTPConnection.java", "license": "gpl-2.0", "size": 42972 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,708,267
PagingResults<Network> getNetworks(PagingRequest pagingRequest);
PagingResults<Network> getNetworks(PagingRequest pagingRequest);
/** * Get the currently authenticated user's network memberships, sorted in ascending order by networkId * */
Get the currently authenticated user's network memberships, sorted in ascending order by networkId
getNetworks
{ "repo_name": "nguyentienlong/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/tenant/NetworksService.java", "license": "lgpl-3.0", "size": 1355 }
[ "org.alfresco.query.PagingRequest", "org.alfresco.query.PagingResults" ]
import org.alfresco.query.PagingRequest; import org.alfresco.query.PagingResults;
import org.alfresco.query.*;
[ "org.alfresco.query" ]
org.alfresco.query;
793,226
private void initializeMenu() { IMenuManager menuManager = getViewSite().getActionBars() .getMenuManager(); }
void function() { IMenuManager menuManager = getViewSite().getActionBars() .getMenuManager(); }
/** * Initialize the menu. */
Initialize the menu
initializeMenu
{ "repo_name": "ruslanrf/wpps", "path": "wpps_plugins/tuwien.dbai.wpps.ui/src/tuwien/dbai/wpps/ui/views/TestView.java", "license": "gpl-2.0", "size": 1345 }
[ "org.eclipse.jface.action.IMenuManager" ]
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
1,235,878
public Date getSimpleDate() { return simpleDate; }
Date function() { return simpleDate; }
/** * Get Date value. * * @return The simpleDate. */
Get Date value
getSimpleDate
{ "repo_name": "openmrs/openmrs-module-datacomparison", "path": "api/src/main/java/org/openmrs/module/datacomparison/SimpleObject.java", "license": "mpl-2.0", "size": 2697 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
218,231
@Deprecated public static MatrixSource asIdentitySource(int size) { return new IdentityMatrixSource(size); }
static MatrixSource function(int size) { return new IdentityMatrixSource(size); }
/** * Creates an identity matrix source of given {@code size}. * * @param size the source size * * @return an identity matrix source */
Creates an identity matrix source of given size
asIdentitySource
{ "repo_name": "rabbanyk/CommunityEvaluation", "path": "libs/la4j-0.5.0/src/main/java/org/la4j/matrix/Matrices.java", "license": "mit", "size": 26855 }
[ "org.la4j.matrix.source.IdentityMatrixSource", "org.la4j.matrix.source.MatrixSource" ]
import org.la4j.matrix.source.IdentityMatrixSource; import org.la4j.matrix.source.MatrixSource;
import org.la4j.matrix.source.*;
[ "org.la4j.matrix" ]
org.la4j.matrix;
2,907,027
private boolean isViableNode(int x, int y, int z) { TileEntity tile = pointer.getWorldObj().getTileEntity(x, y, z); if(MultiblockManager.areEqual(tile, pointer)) { return true; } return false; }
boolean function(int x, int y, int z) { TileEntity tile = pointer.getWorldObj().getTileEntity(x, y, z); if(MultiblockManager.areEqual(tile, pointer)) { return true; } return false; }
/** * Whether or not the block at the specified location is a viable node for a multiblock structure. * @param x - x coordinate * @param y - y coordinate * @param z - z coordinate * @return */
Whether or not the block at the specified location is a viable node for a multiblock structure
isViableNode
{ "repo_name": "Microsoft/vsminecraft", "path": "minecraftpkg/MekanismModSample/src/main/java/mekanism/common/multiblock/UpdateProtocol.java", "license": "mit", "size": 11245 }
[ "net.minecraft.tileentity.TileEntity" ]
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.*;
[ "net.minecraft.tileentity" ]
net.minecraft.tileentity;
1,057,988
@Override public void renderHead(final Component component, HtmlHeaderContainer container) { if (!(component instanceof WebMarkupContainer)) { throw new WicketRuntimeException(Classes.simpleName(component.getClass()) + " can only be associated with WebMarkupContainer."); } renderHeadFromAssociatedMarkupFile((WebMarkupContainer)component, container); }
void function(final Component component, HtmlHeaderContainer container) { if (!(component instanceof WebMarkupContainer)) { throw new WicketRuntimeException(Classes.simpleName(component.getClass()) + STR); } renderHeadFromAssociatedMarkupFile((WebMarkupContainer)component, container); }
/** * Render the header from the associated markup file */
Render the header from the associated markup file
renderHead
{ "repo_name": "mafulafunk/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/markup/html/panel/AssociatedMarkupSourcingStrategy.java", "license": "apache-2.0", "size": 11796 }
[ "org.apache.wicket.Component", "org.apache.wicket.WicketRuntimeException", "org.apache.wicket.markup.html.WebMarkupContainer", "org.apache.wicket.markup.html.internal.HtmlHeaderContainer", "org.apache.wicket.util.lang.Classes" ]
import org.apache.wicket.Component; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.internal.HtmlHeaderContainer; import org.apache.wicket.util.lang.Classes;
import org.apache.wicket.*; import org.apache.wicket.markup.html.*; import org.apache.wicket.markup.html.internal.*; import org.apache.wicket.util.lang.*;
[ "org.apache.wicket" ]
org.apache.wicket;
1,552,945
public String applyMacroes(String line,BufferedReader input){ try { String[] st = line.replaceAll("==>"," ==> ").split("[ ]+"); // any number of spaces are single separator if (st.length < 4) return line; if (st[2].equals("==>")){ // combine together all parts following '==>' into 'value' String value = ""; String spacer = ""; for (int x=3;x<st.length;x++){ value = value + spacer + st[x]; spacer = " "; } // if macro is continued on next line then get it while (line.endsWith("_")||line.endsWith(",")) { if (value.endsWith("_")) value = value.substring(0,value.length()-1); String line2 = input.readLine(); value = value + line2.trim(); line = line + line2.trim(); } // if macro contains comment then remove it int cmtInd = getCommentIndex(value); if (cmtInd > -1) { //System.out.println("applyMacroes: removed comment in:" + line); value = value.substring(0,cmtInd); } // '==>' in 'add' or 'with' constructs is not a macro so, in this // case, do nothing. String[] st2 = value.replaceAll("==>"," ==> ").split("[ ]+"); // any number of spaces are single separator for (int x=0;x<st2.length;x++){ if (st2[x].equals("add") || st2[x].equals("with")) return line; } // macros may themselves contain other macros, so substitute // any existing macros. value = SubstituteMacro(value); macros.put(st[1],value); return "-- "+line; } else if (st[1].equals("--") || st[1].equals("++")){ // don't apply macros to comments return line; } else { line = SubstituteMacro(line); } } catch (IOException ioException) { System.err.println("cannot process: " + line +" due to "+ ioException); } return line; }
String function(String line,BufferedReader input){ try { String[] st = line.replaceAll("==>",STR).split(STR); if (st.length < 4) return line; if (st[2].equals("==>")){ String value = STRSTR STR_STR,STR_STR==>",STR).split(STR); for (int x=0;x<st2.length;x++){ if (st2[x].equals("addSTRwithSTR-- STR--STR++STRcannot process: STR due to "+ ioException); } return line; }
/** * a macro can be defined by '==>' or keyword 'Macro' * * if line starts with 'ID ==>' then store macro otherwise * apply macro * * @param line possibly containing macro definition or which * may be expanded using existing macros. * @param input * @return line with macros applied. */
a macro can be defined by '==>' or keyword 'Macro' if line starts with 'ID ==>' then store macro otherwise apply macro
applyMacroes
{ "repo_name": "martinbaker/euclideanspace", "path": "com.euclideanspace.spad.builder/src/com/euclideanspace/spad/builder/EclipseSPADWriter.java", "license": "agpl-3.0", "size": 17930 }
[ "java.io.BufferedReader" ]
import java.io.BufferedReader;
import java.io.*;
[ "java.io" ]
java.io;
2,807,829
public static void main(String[] args) throws Exception{ // use port if specified int port; InetAddress bindaddr; if( args.length == 0 ){ port = 8080; bindaddr = InetAddress.getLoopbackAddress(); }else if( args.length == 1 ){ int colon = args[0].indexOf(':'); if( colon == -1 ){ bindaddr = InetAddress.getLoopbackAddress(); port = Integer.parseInt(args[0]); }else{ bindaddr = InetAddress.getByName(args[0].substring(0, colon)); port = Integer.parseInt(args[0].substring(colon+1)); } }else{ System.err.println("Too many command line arguments!"); System.err.println("Usage: "+HttpServer.class.getCanonicalName()+" [[hostname:]port]"); System.exit(-1); return; } // load hsql driver Class.forName("org.hsqldb.jdbcDriver"); // start server final HttpServer server = new HttpServer(new DefaultConfiguration()); // add shutdown hook
static void function(String[] args) throws Exception{ int port; InetAddress bindaddr; if( args.length == 0 ){ port = 8080; bindaddr = InetAddress.getLoopbackAddress(); }else if( args.length == 1 ){ int colon = args[0].indexOf(':'); if( colon == -1 ){ bindaddr = InetAddress.getLoopbackAddress(); port = Integer.parseInt(args[0]); }else{ bindaddr = InetAddress.getByName(args[0].substring(0, colon)); port = Integer.parseInt(args[0].substring(colon+1)); } }else{ System.err.println(STR); System.err.println(STR+HttpServer.class.getCanonicalName()+STR); System.exit(-1); return; } Class.forName(STR); final HttpServer server = new HttpServer(new DefaultConfiguration());
/** * Run a standalone broker server from the command line. * * @param args command line arguments: port can be specified optionally * @throws Exception any error */
Run a standalone broker server from the command line
main
{ "repo_name": "aktin/broker", "path": "broker-admin/src/main/java/org/aktin/broker/admin/standalone/HttpServer.java", "license": "apache-2.0", "size": 9164 }
[ "java.net.InetAddress" ]
import java.net.InetAddress;
import java.net.*;
[ "java.net" ]
java.net;
2,093,086
public void switchFragment(Fragment fragment, @AnimRes final int enter, @AnimRes final int exit, @AnimRes final int popEnter, @AnimRes final int popExit) { baseSwitchFragment(fragment, transaction -> transaction.setCustomAnimations(enter, exit, popEnter, popExit)); }
void function(Fragment fragment, @AnimRes final int enter, @AnimRes final int exit, @AnimRes final int popEnter, @AnimRes final int popExit) { baseSwitchFragment(fragment, transaction -> transaction.setCustomAnimations(enter, exit, popEnter, popExit)); }
/** * Switch fragment. * * @param fragment fragment to switch to * @param enter capsule_enter animation * @param exit capsule_exit animation * @param popEnter pop capsule_enter animation * @param popExit pop exist animation * @see #switchFragment(Fragment) #switchFragment(Fragment) */
Switch fragment
switchFragment
{ "repo_name": "AllanWang/Capsule", "path": "capsule/src/main/java/ca/allanwang/capsule/library/activities/FragmentManagerActivity.java", "license": "apache-2.0", "size": 4264 }
[ "android.support.annotation.AnimRes", "android.support.v4.app.Fragment" ]
import android.support.annotation.AnimRes; import android.support.v4.app.Fragment;
import android.support.annotation.*; import android.support.v4.app.*;
[ "android.support" ]
android.support;
2,118,146
public synchronized void restoreFromCheckpoint(CheckpointInputStream input) throws IOException { LOG.info("Restoring rocksdb from checkpoint"); long startNano = System.nanoTime(); Preconditions.checkState(input.getType() == CheckpointType.ROCKS, "Unexpected checkpoint type in RocksStore: " + input.getType()); stopDb(); FileUtils.deletePathRecursively(mDbPath); TarUtils.readTarGz(Paths.get(mDbPath), input); try { createDb(); } catch (RocksDBException e) { throw new IOException(e); } LOG.info("Restored rocksdb checkpoint in {}ms", (System.nanoTime() - startNano) / Constants.MS_NANO); }
synchronized void function(CheckpointInputStream input) throws IOException { LOG.info(STR); long startNano = System.nanoTime(); Preconditions.checkState(input.getType() == CheckpointType.ROCKS, STR + input.getType()); stopDb(); FileUtils.deletePathRecursively(mDbPath); TarUtils.readTarGz(Paths.get(mDbPath), input); try { createDb(); } catch (RocksDBException e) { throw new IOException(e); } LOG.info(STR, (System.nanoTime() - startNano) / Constants.MS_NANO); }
/** * Restores the database from a checkpoint. * * @param input the checkpoint stream to restore from */
Restores the database from a checkpoint
restoreFromCheckpoint
{ "repo_name": "maobaolong/alluxio", "path": "core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksStore.java", "license": "apache-2.0", "size": 7735 }
[ "com.google.common.base.Preconditions", "java.io.IOException", "java.nio.file.Paths", "org.rocksdb.RocksDBException" ]
import com.google.common.base.Preconditions; import java.io.IOException; import java.nio.file.Paths; import org.rocksdb.RocksDBException;
import com.google.common.base.*; import java.io.*; import java.nio.file.*; import org.rocksdb.*;
[ "com.google.common", "java.io", "java.nio", "org.rocksdb" ]
com.google.common; java.io; java.nio; org.rocksdb;
405,705
default void restore(InputStream input) throws IOException { restore(input, false); }
default void restore(InputStream input) throws IOException { restore(input, false); }
/** * Restore database. * * @see #backup(OutputStream) */
Restore database
restore
{ "repo_name": "sonatype/nexus-public", "path": "components/nexus-orient/src/main/java/org/sonatype/nexus/orient/DatabaseExternalizer.java", "license": "epl-1.0", "size": 2611 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,264,247
ObjectStreamClass[] genDescs() { ClassLoader ldr = ProxyClassDesc.class.getClassLoader(); Class[] ifaces = new Class[3]; Class[] a = new Class[] { A1.class, A2.class, A3.class, A4.class, A5.class }; Class[] b = new Class[] { B1.class, B2.class, B3.class, B4.class, B5.class }; Class[] c = new Class[] { C1.class, C2.class, C3.class, C4.class, C5.class }; ObjectStreamClass[] descs = new ObjectStreamClass[a.length * b.length * c.length]; int n = 0; for (int i = 0; i < a.length; i++) { ifaces[0] = a[i]; for (int j = 0; j < b.length; j++) { ifaces[1] = b[j]; for (int k = 0; k < c.length; k++) { ifaces[2] = c[k]; Class proxyClass = Proxy.getProxyClass(ldr, ifaces); descs[n++] = ObjectStreamClass.lookup(proxyClass); } } } return descs; }
ObjectStreamClass[] genDescs() { ClassLoader ldr = ProxyClassDesc.class.getClassLoader(); Class[] ifaces = new Class[3]; Class[] a = new Class[] { A1.class, A2.class, A3.class, A4.class, A5.class }; Class[] b = new Class[] { B1.class, B2.class, B3.class, B4.class, B5.class }; Class[] c = new Class[] { C1.class, C2.class, C3.class, C4.class, C5.class }; ObjectStreamClass[] descs = new ObjectStreamClass[a.length * b.length * c.length]; int n = 0; for (int i = 0; i < a.length; i++) { ifaces[0] = a[i]; for (int j = 0; j < b.length; j++) { ifaces[1] = b[j]; for (int k = 0; k < c.length; k++) { ifaces[2] = c[k]; Class proxyClass = Proxy.getProxyClass(ldr, ifaces); descs[n++] = ObjectStreamClass.lookup(proxyClass); } } } return descs; }
/** * Generate proxy class descriptors. */
Generate proxy class descriptors
genDescs
{ "repo_name": "andreagenso/java2scala", "path": "test/J2s/java/openjdk-6-src-b27/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyClassDesc.java", "license": "apache-2.0", "size": 4238 }
[ "java.io.ObjectStreamClass", "java.lang.reflect.Proxy" ]
import java.io.ObjectStreamClass; import java.lang.reflect.Proxy;
import java.io.*; import java.lang.reflect.*;
[ "java.io", "java.lang" ]
java.io; java.lang;
1,138,334
public Stroke getRangeGridlineStroke() { return this.rangeGridlineStroke; }
Stroke function() { return this.rangeGridlineStroke; }
/** * Returns the stroke for the grid lines (if any) plotted against the range * axis. * * @return The stroke (never <code>null</code>). * * @see #setRangeGridlineStroke(Stroke) */
Returns the stroke for the grid lines (if any) plotted against the range axis
getRangeGridlineStroke
{ "repo_name": "martingwhite/astor", "path": "examples/chart_11/source/org/jfree/chart/plot/FastScatterPlot.java", "license": "gpl-2.0", "size": 34448 }
[ "java.awt.Stroke" ]
import java.awt.Stroke;
import java.awt.*;
[ "java.awt" ]
java.awt;
829,930
public void setTimes(String src, long mtime, long atime) throws IOException { if ( !accessTimeTouchable && atime != -1) { throw new AccessTimeException("setTimes is not allowed for accessTime"); } setTimesInternal(src, mtime, atime); getEditLog().logSync(false); }
void function(String src, long mtime, long atime) throws IOException { if ( !accessTimeTouchable && atime != -1) { throw new AccessTimeException(STR); } setTimesInternal(src, mtime, atime); getEditLog().logSync(false); }
/** * stores the modification and access time for this inode. * The access time is precise upto an hour. The transaction, if needed, is * written to the edits log but is not flushed. */
stores the modification and access time for this inode. The access time is precise upto an hour. The transaction, if needed, is written to the edits log but is not flushed
setTimes
{ "repo_name": "nvoron23/hadoop-20", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java", "license": "apache-2.0", "size": 358914 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,537,943
protected void addDeviceAlert(String hardwareId, Item item, OpenClosedType value) throws SiteWhereAgentException { addDeviceAlert(hardwareId, item, TYPE_OPENHAB_OPENCLOSED, value.toString()); }
void function(String hardwareId, Item item, OpenClosedType value) throws SiteWhereAgentException { addDeviceAlert(hardwareId, item, TYPE_OPENHAB_OPENCLOSED, value.toString()); }
/** * Send an alert for an {@link OpenClosedType}. * * @param hardwareId * @param item * @param value * @throws SiteWhereAgentException */
Send an alert for an <code>OpenClosedType</code>
addDeviceAlert
{ "repo_name": "computergeek1507/openhab", "path": "bundles/persistence/org.openhab.persistence.sitewhere/src/main/java/org/openhab/persistence/sitewhere/internal/SiteWherePersistenceService.java", "license": "epl-1.0", "size": 13964 }
[ "com.sitewhere.agent.SiteWhereAgentException", "org.openhab.core.items.Item", "org.openhab.core.library.types.OpenClosedType" ]
import com.sitewhere.agent.SiteWhereAgentException; import org.openhab.core.items.Item; import org.openhab.core.library.types.OpenClosedType;
import com.sitewhere.agent.*; import org.openhab.core.items.*; import org.openhab.core.library.types.*;
[ "com.sitewhere.agent", "org.openhab.core" ]
com.sitewhere.agent; org.openhab.core;
669,977
@Test public void testProfileNameWithJustSpaces() { checkExpectedException( "ProfileNameWithSpaces.tst", AmazonClientException.class, "Should throw an exception as there is a profile mentioned with no profile name."); }
void function() { checkExpectedException( STR, AmazonClientException.class, STR); }
/** * Tests loading profile with a profile name having only spaces. An * exception should be thrown in this case. */
Tests loading profile with a profile name having only spaces. An exception should be thrown in this case
testProfileNameWithJustSpaces
{ "repo_name": "trasa/aws-sdk-java", "path": "aws-java-sdk-core/src/test/java/com/amazonaws/auth/profile/CredentialProfilesTest.java", "license": "apache-2.0", "size": 9351 }
[ "com.amazonaws.AmazonClientException" ]
import com.amazonaws.AmazonClientException;
import com.amazonaws.*;
[ "com.amazonaws" ]
com.amazonaws;
99,373
private RateLimiter getRateLimiter(Settings repositorySettings, String setting, ByteSizeValue defaultRate) { ByteSizeValue maxSnapshotBytesPerSec = repositorySettings.getAsBytesSize(setting, defaultRate); if (maxSnapshotBytesPerSec.getBytes() <= 0) { return null; } else { return new RateLimiter.SimpleRateLimiter(maxSnapshotBytesPerSec.getMbFrac()); } }
RateLimiter function(Settings repositorySettings, String setting, ByteSizeValue defaultRate) { ByteSizeValue maxSnapshotBytesPerSec = repositorySettings.getAsBytesSize(setting, defaultRate); if (maxSnapshotBytesPerSec.getBytes() <= 0) { return null; } else { return new RateLimiter.SimpleRateLimiter(maxSnapshotBytesPerSec.getMbFrac()); } }
/** * Configures RateLimiter based on repository and global settings * * @param repositorySettings repository settings * @param setting setting to use to configure rate limiter * @param defaultRate default limiting rate * @return rate limiter or null of no throttling is needed */
Configures RateLimiter based on repository and global settings
getRateLimiter
{ "repo_name": "scorpionvicky/elasticsearch", "path": "server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java", "license": "apache-2.0", "size": 138915 }
[ "org.apache.lucene.store.RateLimiter", "org.elasticsearch.common.settings.Settings", "org.elasticsearch.common.unit.ByteSizeValue" ]
import org.apache.lucene.store.RateLimiter; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeValue;
import org.apache.lucene.store.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.common.unit.*;
[ "org.apache.lucene", "org.elasticsearch.common" ]
org.apache.lucene; org.elasticsearch.common;
2,185,241
@Override public void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex) { mCharts[seriesIndex].setScreenR(getScreenR()); mCharts[seriesIndex].setCalcRange(getCalcRange(mDataset.getSeriesAt(seriesIndex) .getScaleNumber()), 0); mCharts[seriesIndex].drawSeries(canvas, paint, points, seriesRenderer, yAxisValue, 0, startIndex); }
void function(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex) { mCharts[seriesIndex].setScreenR(getScreenR()); mCharts[seriesIndex].setCalcRange(getCalcRange(mDataset.getSeriesAt(seriesIndex) .getScaleNumber()), 0); mCharts[seriesIndex].drawSeries(canvas, paint, points, seriesRenderer, yAxisValue, 0, startIndex); }
/** * The graphical representation of a series. * * @param canvas the canvas to paint to * @param paint the paint to be used for drawing * @param points the array of points to be used for drawing the series * @param seriesRenderer the series renderer * @param yAxisValue the minimum value of the y axis * @param seriesIndex the index of the series currently being drawn * @param startIndex the start index of the rendering points */
The graphical representation of a series
drawSeries
{ "repo_name": "jrieke/ioiometer", "path": "app/src/main/java/org/achartengine/chart/CombinedXYChart.java", "license": "mit", "size": 6583 }
[ "android.graphics.Canvas", "android.graphics.Paint", "java.util.List", "org.achartengine.renderer.XYSeriesRenderer" ]
import android.graphics.Canvas; import android.graphics.Paint; import java.util.List; import org.achartengine.renderer.XYSeriesRenderer;
import android.graphics.*; import java.util.*; import org.achartengine.renderer.*;
[ "android.graphics", "java.util", "org.achartengine.renderer" ]
android.graphics; java.util; org.achartengine.renderer;
67,886
@Test public void testDemoData(){ MRRTReportService mrrtReportService = getService(); MRRTTemplateService mrrtTemplateService = Context.getService(MRRTTemplateService.class); List<MRRTReport> reports = mrrtReportService.getAll(); assertNotNull(reports); for(MRRTReport report: reports){ logger.log(Level.INFO,"Report ID {0}", new Object[]{report.getId()}); try { logger.log(Level.INFO,"Report XML : \n {0}", new Object[]{mrrtTemplateService.clobToString(report.getXml())}); } catch (SQLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } Assert.assertEquals(2,reports.size()); logger.log(Level.CONFIG,"Test Data Configured Properly"); }
void function(){ MRRTReportService mrrtReportService = getService(); MRRTTemplateService mrrtTemplateService = Context.getService(MRRTTemplateService.class); List<MRRTReport> reports = mrrtReportService.getAll(); assertNotNull(reports); for(MRRTReport report: reports){ logger.log(Level.INFO,STR, new Object[]{report.getId()}); try { logger.log(Level.INFO,STR, new Object[]{mrrtTemplateService.clobToString(report.getXml())}); } catch (SQLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } Assert.assertEquals(2,reports.size()); logger.log(Level.CONFIG,STR); }
/** * Test if the demo data is loaded correctly for the other tests to run correctly. * By default, this means, {@link MRRTTemplateService#create(MRRTTemplate)}, {@link MRRTTemplateService#saveOrUpdate(MRRTTemplate)}, {@link MRRTTemplateService#getAll()} work fine and need not to tested separately */
Test if the demo data is loaded correctly for the other tests to run correctly. By default, this means, <code>MRRTTemplateService#create(MRRTTemplate)</code>, <code>MRRTTemplateService#saveOrUpdate(MRRTTemplate)</code>, <code>MRRTTemplateService#getAll()</code> work fine and need not to tested separately
testDemoData
{ "repo_name": "maany/openmrs-module-radiology-fhir-support", "path": "api/src/test/java/org/openmrs/module/radiologyfhirsupport/api/MRRTReportServiceTest.java", "license": "mpl-2.0", "size": 28023 }
[ "java.io.IOException", "java.sql.SQLException", "java.util.List", "java.util.logging.Level", "org.junit.Assert", "org.openmrs.api.context.Context", "org.openmrs.module.radiologyfhirsupport.MRRTReport" ]
import java.io.IOException; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import org.junit.Assert; import org.openmrs.api.context.Context; import org.openmrs.module.radiologyfhirsupport.MRRTReport;
import java.io.*; import java.sql.*; import java.util.*; import java.util.logging.*; import org.junit.*; import org.openmrs.api.context.*; import org.openmrs.module.radiologyfhirsupport.*;
[ "java.io", "java.sql", "java.util", "org.junit", "org.openmrs.api", "org.openmrs.module" ]
java.io; java.sql; java.util; org.junit; org.openmrs.api; org.openmrs.module;
1,789,955
static Map<String, Object> getParametersToSave(Map<String, Object> fromMap, List<String> savedParameterNamesList) { final Map<String, Object> savedParametersMap = new HashMap<String, Object>(); if ((savedParameterNamesList != null) && (fromMap != null)) { for (final String parameterName : savedParameterNamesList) { if (fromMap.get(parameterName) != null) { savedParametersMap.put(parameterName, fromMap.get(parameterName)); } } } return savedParametersMap; }
static Map<String, Object> getParametersToSave(Map<String, Object> fromMap, List<String> savedParameterNamesList) { final Map<String, Object> savedParametersMap = new HashMap<String, Object>(); if ((savedParameterNamesList != null) && (fromMap != null)) { for (final String parameterName : savedParameterNamesList) { if (fromMap.get(parameterName) != null) { savedParametersMap.put(parameterName, fromMap.get(parameterName)); } } } return savedParametersMap; }
/** * Saves the parameters in a map to be saved in the session * * @param fromMap * @param savedParameterNamesList * @return */
Saves the parameters in a map to be saved in the session
getParametersToSave
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/admin/customize/category/report/execute/ReportExecuteBL.java", "license": "gpl-3.0", "size": 17294 }
[ "java.util.HashMap", "java.util.List", "java.util.Map" ]
import java.util.HashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,414,221
public String retrieveTitle() throws TimeServiceException { Log.d(TAG, "Retrieving Alarm title, objPath: '" + objectPath + "'"); try { String title = getRemoteAlarm().getTitle(); Log.d(TAG, "Retrieved title: '" + title + "', objPath: '" + objectPath + "'"); return title; } catch(BusException be) { throw new TimeServiceException("Failed to call Alarm.getTitle()", be); } }
String function() throws TimeServiceException { Log.d(TAG, STR + objectPath + "'"); try { String title = getRemoteAlarm().getTitle(); Log.d(TAG, STR + title + STR + objectPath + "'"); return title; } catch(BusException be) { throw new TimeServiceException(STR, be); } }
/** * Retrieve title from the {@link TimeServiceServer} Alarm object. * Title is an optional textual description of what this Alarm is set for. * @return Alarm title * @throws TimeServiceException Is thrown if failed to retrieve the alarm title */
Retrieve title from the <code>TimeServiceServer</code> Alarm object. Title is an optional textual description of what this Alarm is set for
retrieveTitle
{ "repo_name": "gcampax/alljoyn", "path": "alljoyn/services/time/java/TimeService/src/org/allseen/timeservice/client/Alarm.java", "license": "isc", "size": 10294 }
[ "android.util.Log", "org.alljoyn.bus.BusException", "org.allseen.timeservice.TimeServiceException" ]
import android.util.Log; import org.alljoyn.bus.BusException; import org.allseen.timeservice.TimeServiceException;
import android.util.*; import org.alljoyn.bus.*; import org.allseen.timeservice.*;
[ "android.util", "org.alljoyn.bus", "org.allseen.timeservice" ]
android.util; org.alljoyn.bus; org.allseen.timeservice;
965,575
@Override protected void processGeometryWithGeometricShapeFactory(GeometricShapeFactory shapeFactory, Geometry geometry, ArcPolygonOptions options, Reader reader, Writer writer) throws Exception { double startAngle = options.getStartAngle(); double angleExtent = options.getAngleExtent(); if (options.isDegrees()) { startAngle = Math.toRadians(startAngle); angleExtent = Math.toRadians(angleExtent); } Geometry outputGeometry = shapeFactory.createArcPolygon(startAngle, angleExtent); writer.write(writeGeometry(outputGeometry, options)); } public static class ArcPolygonOptions extends ShapeFactoryOptions { @Option(name = "-a", aliases = "--startAngle", usage = "The start angle (in radians)", required = true) private double startAngle; @Option(name = "-e", aliases= "--angleExtent", usage = "The size of angle (in radians)", required = true) private double angleExtent; @Option(name = "-d", aliases = "--degrees", usage = "The flag for whether given angle measures are in degrees (true) or radians (false)", required = false) private boolean degrees;
void function(GeometricShapeFactory shapeFactory, Geometry geometry, ArcPolygonOptions options, Reader reader, Writer writer) throws Exception { double startAngle = options.getStartAngle(); double angleExtent = options.getAngleExtent(); if (options.isDegrees()) { startAngle = Math.toRadians(startAngle); angleExtent = Math.toRadians(angleExtent); } Geometry outputGeometry = shapeFactory.createArcPolygon(startAngle, angleExtent); writer.write(writeGeometry(outputGeometry, options)); } public static class ArcPolygonOptions extends ShapeFactoryOptions { @Option(name = "-a", aliases = STR, usage = STR, required = true) private double startAngle; @Option(name = "-e", aliases= STR, usage = STR, required = true) private double angleExtent; @Option(name = "-d", aliases = STR, usage = STR, required = false) private boolean degrees;
/** * Create an arc polygon * @param shapeFactory The preconfigured GeometricShapeFactory * @param geometry The input Geometry * @param options The ArcPolygonOptions * @param reader The java.io.Reader * @param writer The java.io.Writer * @throws Exception if an error occurs */
Create an arc polygon
processGeometryWithGeometricShapeFactory
{ "repo_name": "jericks/geometrycommands", "path": "src/main/java/org/geometrycommands/ArcPolygonCommand.java", "license": "mit", "size": 4367 }
[ "java.io.Reader", "java.io.Writer", "org.geometrycommands.ArcPolygonCommand", "org.kohsuke.args4j.Option", "org.locationtech.jts.geom.Geometry", "org.locationtech.jts.util.GeometricShapeFactory" ]
import java.io.Reader; import java.io.Writer; import org.geometrycommands.ArcPolygonCommand; import org.kohsuke.args4j.Option; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.util.GeometricShapeFactory;
import java.io.*; import org.geometrycommands.*; import org.kohsuke.args4j.*; import org.locationtech.jts.geom.*; import org.locationtech.jts.util.*;
[ "java.io", "org.geometrycommands", "org.kohsuke.args4j", "org.locationtech.jts" ]
java.io; org.geometrycommands; org.kohsuke.args4j; org.locationtech.jts;
59,385
public void addSuperProperty(String propertyName) throws OntologyChangeException, NoSuchEntityException { addSuperProperty(getOntology().getDataProperty(propertyName)); }
void function(String propertyName) throws OntologyChangeException, NoSuchEntityException { addSuperProperty(getOntology().getDataProperty(propertyName)); }
/** * Adds a super-property axiom. * @param propertyName * A property expression. * @throws OntologyChangeException * If the axiom cannot be added. * @throws NoSuchEntityException * If the property cannot be found. **/
Adds a super-property axiom
addSuperProperty
{ "repo_name": "SPDSS/adss", "path": "it.polito.security.ontologies/src/it/polito/security/ontologies/OntologyDataProperty.java", "license": "epl-1.0", "size": 18357 }
[ "it.polito.security.ontologies.exceptions.NoSuchEntityException", "it.polito.security.ontologies.exceptions.OntologyChangeException" ]
import it.polito.security.ontologies.exceptions.NoSuchEntityException; import it.polito.security.ontologies.exceptions.OntologyChangeException;
import it.polito.security.ontologies.exceptions.*;
[ "it.polito.security" ]
it.polito.security;
995,940
protected IFigure setupContentPane(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); layout.setSpacing(5); nodeShape.setLayoutManager(layout); } return nodeShape; // use nodeShape itself as contentPane }
IFigure function(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); layout.setSpacing(5); nodeShape.setLayoutManager(layout); } return nodeShape; }
/** * Default implementation treats passed figure as content pane. * Respects layout one may have set for generated figure. * @param nodeShape instance of generated figure class * @generated */
Default implementation treats passed figure as content pane. Respects layout one may have set for generated figure
setupContentPane
{ "repo_name": "nwnpallewela/devstudio-tooling-esb", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/parts/MessageMediatorEditPart.java", "license": "apache-2.0", "size": 7015 }
[ "org.eclipse.draw2d.IFigure", "org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout" ]
import org.eclipse.draw2d.IFigure; import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
import org.eclipse.draw2d.*; import org.eclipse.gmf.runtime.draw2d.ui.figures.*;
[ "org.eclipse.draw2d", "org.eclipse.gmf" ]
org.eclipse.draw2d; org.eclipse.gmf;
2,792,187
// public ProblemList<?> getQualityProblems() { ProblemList<Model> tmpProblemList = new ProblemList<Model>(); if(this.problemSampler != null && this.problemSampler.size() > 0) { for(ProblemReport pr : this.problemSampler.getItems()){ tmpProblemList.getProblemList().add(pr.createProblemModel()); } } else { tmpProblemList = new ProblemList<Model>(); } return tmpProblemList; }
ProblemList<?> function() { ProblemList<Model> tmpProblemList = new ProblemList<Model>(); if(this.problemSampler != null && this.problemSampler.size() > 0) { for(ProblemReport pr : this.problemSampler.getItems()){ tmpProblemList.getProblemList().add(pr.createProblemModel()); } } else { tmpProblemList = new ProblemList<Model>(); } return tmpProblemList; }
/** * Returns list of problematic quads * * @return list of problematic quads */
Returns list of problematic quads
getQualityProblems
{ "repo_name": "diachron/quality", "path": "lod-qualitymetrics/lod-qualitymetrics-intrinsic/src/main/java/eu/diachron/qualitymetrics/intrinsic/consistency/AdvancedEntitiesAsMembersOfDisjointClasses.java", "license": "mit", "size": 8994 }
[ "com.hp.hpl.jena.rdf.model.Model", "de.unibonn.iai.eis.luzzu.datatypes.ProblemList" ]
import com.hp.hpl.jena.rdf.model.Model; import de.unibonn.iai.eis.luzzu.datatypes.ProblemList;
import com.hp.hpl.jena.rdf.model.*; import de.unibonn.iai.eis.luzzu.datatypes.*;
[ "com.hp.hpl", "de.unibonn.iai" ]
com.hp.hpl; de.unibonn.iai;
233,896
azure.networks().manager().serviceClient().getSubnets().list("subnet-test", "vnetname", Context.NONE); }
azure.networks().manager().serviceClient().getSubnets().list(STR, STR, Context.NONE); }
/** * Sample code: List subnets. * * @param azure The entry point for accessing resource management APIs in Azure. */
Sample code: List subnets
listSubnets
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/SubnetsListSamples.java", "license": "mit", "size": 815 }
[ "com.azure.core.util.Context" ]
import com.azure.core.util.Context;
import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
1,147,614
@Pure double getTangentX();
@Pure double getTangentX();
/** Replies the X coordinate of the direction vector. * If this point is not part of a polyline, the direction vector is null. * * @return the x coordinate of the direction vector. */
Replies the X coordinate of the direction vector. If this point is not part of a polyline, the direction vector is null
getTangentX
{ "repo_name": "gallandarakhneorg/afc", "path": "core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/OrientedPoint2D.java", "license": "apache-2.0", "size": 7080 }
[ "org.eclipse.xtext.xbase.lib.Pure" ]
import org.eclipse.xtext.xbase.lib.Pure;
import org.eclipse.xtext.xbase.lib.*;
[ "org.eclipse.xtext" ]
org.eclipse.xtext;
1,257,314
@GET @Path("/vertices/properties/{id}") @Produces({MediaType.APPLICATION_JSON}) public Response getVertexProperties(@PathParam("id") final String vertexId, @DefaultValue("false") @QueryParam("relationships") final String relationships) { checkIfMetadataMappingServiceIsEnabled(); LOG.info("Get vertex for vertexId= {}", vertexId); validateInputs("Invalid argument: vertex id passed is null or empty.", vertexId); try { Vertex vertex = findVertex(vertexId); Map<String, String> vertexProperties = getVertexProperties(vertex, Boolean.valueOf(relationships)); JSONObject response = new JSONObject(); response.put(RESULTS, new JSONObject(vertexProperties)); response.put(TOTAL_SIZE, vertexProperties.size()); return Response.ok(response).build(); } catch (JSONException e) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(JSONObject.quote("An error occurred: " + e.getMessage())).build()); } }
@Path(STR) @Produces({MediaType.APPLICATION_JSON}) Response function(@PathParam("id") final String vertexId, @DefaultValue("false") @QueryParam(STR) final String relationships) { checkIfMetadataMappingServiceIsEnabled(); LOG.info(STR, vertexId); validateInputs(STR, vertexId); try { Vertex vertex = findVertex(vertexId); Map<String, String> vertexProperties = getVertexProperties(vertex, Boolean.valueOf(relationships)); JSONObject response = new JSONObject(); response.put(RESULTS, new JSONObject(vertexProperties)); response.put(TOTAL_SIZE, vertexProperties.size()); return Response.ok(response).build(); } catch (JSONException e) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(JSONObject.quote(STR + e.getMessage())).build()); } }
/** * Get properties for a single vertex with a unique id. * This is NOT a rexster API. * <p/> * GET http://host/graphs/lineage/vertices/properties/id */
Get properties for a single vertex with a unique id. This is NOT a rexster API. GET HREF
getVertexProperties
{ "repo_name": "InMobi/incubator-falcon", "path": "prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java", "license": "apache-2.0", "size": 22030 }
[ "com.tinkerpop.blueprints.Vertex", "java.util.Map", "javax.ws.rs.DefaultValue", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.QueryParam", "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.codehaus.jettison.json.JSONException", "org.codehaus.jettison.json.JSONObject" ]
import com.tinkerpop.blueprints.Vertex; import java.util.Map; import javax.ws.rs.DefaultValue; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject;
import com.tinkerpop.blueprints.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.codehaus.jettison.json.*;
[ "com.tinkerpop.blueprints", "java.util", "javax.ws", "org.codehaus.jettison" ]
com.tinkerpop.blueprints; java.util; javax.ws; org.codehaus.jettison;
356,119
public Path getExpandDirectory() { if (_expandDirectory != null) return _expandDirectory; else return _path; }
Path function() { if (_expandDirectory != null) return _expandDirectory; else return _path; }
/** * Gets the war expand directory. */
Gets the war expand directory
getExpandDirectory
{ "repo_name": "gruppo4/quercus-upstream", "path": "modules/resin/src/com/caucho/env/deploy/ExpandDeployGenerator.java", "license": "gpl-2.0", "size": 22467 }
[ "com.caucho.vfs.Path" ]
import com.caucho.vfs.Path;
import com.caucho.vfs.*;
[ "com.caucho.vfs" ]
com.caucho.vfs;
1,708,234
private Vector<Object> reactionToVector(Reaction r){ SpatialReactionPlugin srp = (SpatialReactionPlugin) r.getPlugin("spatial"); Vector<Object> v = new Vector<Object>(); v.add(r.getId()); v.add(r.getReversible()); v.add(srp.getIsLocal()); if (r.isSetKineticLaw()) { v.add(r.getKineticLaw().getMath().toFormula()); } else { v.addElement(""); } v.add(listMemberToString(r.getListOfReactants())); v.add(listMemberToString(r.getListOfProducts())); v.add(listMemberToString(r.getListOfModifiers())); return v; }
Vector<Object> function(Reaction r){ SpatialReactionPlugin srp = (SpatialReactionPlugin) r.getPlugin(STR); Vector<Object> v = new Vector<Object>(); v.add(r.getId()); v.add(r.getReversible()); v.add(srp.getIsLocal()); if (r.isSetKineticLaw()) { v.add(r.getKineticLaw().getMath().toFormula()); } else { v.addElement(""); } v.add(listMemberToString(r.getListOfReactants())); v.add(listMemberToString(r.getListOfProducts())); v.add(listMemberToString(r.getListOfModifiers())); return v; }
/** * Converts Reaction to a Vector. The converted vector will contain reaction information as follows: * <ul> * <li>String:Id</li> * <li>boolean:reversible</li> * <li>boolean:isLocal to SpatialReactionPlugin</li> * <li>KineticLaw:kinetic law</li> * <li>String:list of reactants converted to string by listMemberToString(ListOf&lt;?&gt;)</li> * <li>String:list of products converted to string by listMemberToString(ListOf&lt;?&gt;)</li> * <li>String:list of modifiers converted to string by listMemberToString(ListOf&lt;?&gt;)</li> * </ul> * * @param r the JSBML Reaction object * @return the converted vector */
Converts Reaction to a Vector. The converted vector will contain reaction information as follows: String:Id boolean:reversible boolean:isLocal to SpatialReactionPlugin KineticLaw:kinetic law String:list of reactants converted to string by listMemberToString(ListOf&lt;?&gt;) String:list of products converted to string by listMemberToString(ListOf&lt;?&gt;) String:list of modifiers converted to string by listMemberToString(ListOf&lt;?&gt;)
reactionToVector
{ "repo_name": "spatialsimulator/XitoSBML", "path": "src/main/java/jp/ac/keio/bio/fun/xitosbml/pane/ReactionTable.java", "license": "apache-2.0", "size": 6351 }
[ "java.util.Vector", "org.sbml.jsbml.Reaction", "org.sbml.jsbml.ext.spatial.SpatialReactionPlugin" ]
import java.util.Vector; import org.sbml.jsbml.Reaction; import org.sbml.jsbml.ext.spatial.SpatialReactionPlugin;
import java.util.*; import org.sbml.jsbml.*; import org.sbml.jsbml.ext.spatial.*;
[ "java.util", "org.sbml.jsbml" ]
java.util; org.sbml.jsbml;
1,223,729
public void scrollRectToVisible(Rectangle rect) { if (fixedSelection < FIXED_NONE_BOUNDRY) { //Dimension elemSize = getElementSize(); Rectangle toScroll; if (orientation != HORIZONTAL) { toScroll = new Rectangle(getScrollX(), rect.getY(), rect.getSize().getWidth(), rect.getSize().getHeight() + itemGap); } else { toScroll = new Rectangle(rect.getX(), getScrollY(), rect.getSize().getWidth() + itemGap, rect.getSize().getHeight()); } super.scrollRectToVisible(toScroll, this); } }
void function(Rectangle rect) { if (fixedSelection < FIXED_NONE_BOUNDRY) { Rectangle toScroll; if (orientation != HORIZONTAL) { toScroll = new Rectangle(getScrollX(), rect.getY(), rect.getSize().getWidth(), rect.getSize().getHeight() + itemGap); } else { toScroll = new Rectangle(rect.getX(), getScrollY(), rect.getSize().getWidth() + itemGap, rect.getSize().getHeight()); } super.scrollRectToVisible(toScroll, this); } }
/** * Makes sure the selected index is visible if it is not in the current view * rect the list will scroll so it fits within * * @param rect the rectangle area to scroll to */
Makes sure the selected index is visible if it is not in the current view rect the list will scroll so it fits within
scrollRectToVisible
{ "repo_name": "shannah/cn1", "path": "CodenameOne/src/com/codename1/ui/List.java", "license": "gpl-2.0", "size": 83072 }
[ "com.codename1.ui.geom.Rectangle" ]
import com.codename1.ui.geom.Rectangle;
import com.codename1.ui.geom.*;
[ "com.codename1.ui" ]
com.codename1.ui;
1,429,548
private static String computePushTag(final MXSession session) { String tag = DEFAULT_PUSHER_FILE_TAG + "_" + Math.abs(session.getMyUserId().hashCode()); // tag max length : 32 bytes if (tag.length() > 32) { tag = Math.abs(tag.hashCode()) + ""; } return tag; }
static String function(final MXSession session) { String tag = DEFAULT_PUSHER_FILE_TAG + "_" + Math.abs(session.getMyUserId().hashCode()); if (tag.length() > 32) { tag = Math.abs(tag.hashCode()) + ""; } return tag; }
/** * Compute the profileTag for a session * * @param session the session * @return the profile tag */
Compute the profileTag for a session
computePushTag
{ "repo_name": "vector-im/riot-android", "path": "vector/src/main/java/im/vector/push/PushManager.java", "license": "apache-2.0", "size": 55873 }
[ "org.matrix.androidsdk.MXSession" ]
import org.matrix.androidsdk.MXSession;
import org.matrix.androidsdk.*;
[ "org.matrix.androidsdk" ]
org.matrix.androidsdk;
1,721,039
public void revoke(String contextId) { Iterator<Permit> i = permits.iterator(); while (i.hasNext()) { Permit permit = i.next(); if (permit.id().equals(contextId)) { permit.revoke(); i.remove(); } } }
void function(String contextId) { Iterator<Permit> i = permits.iterator(); while (i.hasNext()) { Permit permit = i.next(); if (permit.id().equals(contextId)) { permit.revoke(); i.remove(); } } }
/** * Release the specified permit and remove it from this set. */
Release the specified permit and remove it from this set
revoke
{ "repo_name": "unchartedsoftware/influent", "path": "influent-server/src/main/java/influent/server/clustering/utils/ClusterContextCache.java", "license": "apache-2.0", "size": 11009 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,523,562
public void setKemidPayoutInstructions(List<KemidPayoutInstruction> kemidPayoutInstructions) { this.kemidPayoutInstructions = kemidPayoutInstructions; }
void function(List<KemidPayoutInstruction> kemidPayoutInstructions) { this.kemidPayoutInstructions = kemidPayoutInstructions; }
/** * Sets the kemidPayoutInstructions. * * @param kemidPayoutInstructions */
Sets the kemidPayoutInstructions
setKemidPayoutInstructions
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/endow/businessobject/KEMID.java", "license": "agpl-3.0", "size": 29057 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,552,086
EList<Scenario> getScenarios();
EList<Scenario> getScenarios();
/** * Returns the value of the '<em><b>Scenarios</b></em>' containment reference list. * The list contents are of type {@link org.tud.inf.st.mbt.scenario.Scenario}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Scenarios</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Scenarios</em>' containment reference list. * @see org.tud.inf.st.mbt.scenario.ScenarioPackage#getSpatialBase_Scenarios() * @model containment="true" * @generated */
Returns the value of the 'Scenarios' containment reference list. The list contents are of type <code>org.tud.inf.st.mbt.scenario.Scenario</code>. If the meaning of the 'Scenarios' containment reference list isn't clear, there really should be more of a description here...
getScenarios
{ "repo_name": "paetti1988/qmate", "path": "MATE/org.tud.inf.st.mbt.emf/src-gen/org/tud/inf/st/mbt/scenario/SpatialBase.java", "license": "apache-2.0", "size": 4632 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
304,962
@Test public void testDateFormat() { SerializationConfig serializationConfig = objectMapper.getSerializationConfig(); DeserializationConfig deserializationConfig = objectMapper.getDeserializationConfig(); DateFormat serializationDateFormat = serializationConfig.getDateFormat(); DateFormat deserializationDateFormat = deserializationConfig.getDateFormat(); assertThat(serializationDateFormat, instanceOf(StdDateFormat.class)); assertThat(deserializationDateFormat, instanceOf(StdDateFormat.class)); }
void function() { SerializationConfig serializationConfig = objectMapper.getSerializationConfig(); DeserializationConfig deserializationConfig = objectMapper.getDeserializationConfig(); DateFormat serializationDateFormat = serializationConfig.getDateFormat(); DateFormat deserializationDateFormat = deserializationConfig.getDateFormat(); assertThat(serializationDateFormat, instanceOf(StdDateFormat.class)); assertThat(deserializationDateFormat, instanceOf(StdDateFormat.class)); }
/** * Tests whether the dateFormat is ISO8601 */
Tests whether the dateFormat is ISO8601
testDateFormat
{ "repo_name": "buehner/shogun2", "path": "src/shogun-core-main/src/test/java/de/terrestris/shoguncore/util/json/ShogunCoreJsonObjectMapperTest.java", "license": "apache-2.0", "size": 3075 }
[ "com.fasterxml.jackson.databind.DeserializationConfig", "com.fasterxml.jackson.databind.SerializationConfig", "com.fasterxml.jackson.databind.util.StdDateFormat", "java.text.DateFormat", "org.hamcrest.CoreMatchers", "org.junit.Assert" ]
import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.SerializationConfig; import com.fasterxml.jackson.databind.util.StdDateFormat; import java.text.DateFormat; import org.hamcrest.CoreMatchers; import org.junit.Assert;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.util.*; import java.text.*; import org.hamcrest.*; import org.junit.*;
[ "com.fasterxml.jackson", "java.text", "org.hamcrest", "org.junit" ]
com.fasterxml.jackson; java.text; org.hamcrest; org.junit;
2,654,832
public List<IState> undoExecution () { return memory.undoExecution(); }
List<IState> function () { return memory.undoExecution(); }
/** * Returns the Model a previous State * from before the last Execution had been * made * * @return List<IState> */
Returns the Model a previous State from before the last Execution had been made
undoExecution
{ "repo_name": "as577/slogo", "path": "src/slogo/model/Model.java", "license": "mit", "size": 2897 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,144,800
public static void loadData(Driver driver, String tableName, Path relativeTestResourcePath){ String dataAbsPath = TestTools.getResourceFile(relativeTestResourcePath).getAbsolutePath(); String loadDataSql = String.format("LOAD DATA LOCAL INPATH '%s' OVERWRITE INTO TABLE %s", dataAbsPath, tableName); executeQuery(driver, loadDataSql); }
static void function(Driver driver, String tableName, Path relativeTestResourcePath){ String dataAbsPath = TestTools.getResourceFile(relativeTestResourcePath).getAbsolutePath(); String loadDataSql = String.format(STR, dataAbsPath, tableName); executeQuery(driver, loadDataSql); }
/** * Load data from test resources file into table. * * @param driver hive driver * @param tableName destination * @param relativeTestResourcePath path to test resource */
Load data from test resources file into table
loadData
{ "repo_name": "arina-ielchiieva/drill", "path": "contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/HiveTestUtilities.java", "license": "apache-2.0", "size": 5484 }
[ "java.nio.file.Path", "org.apache.drill.test.TestTools", "org.apache.hadoop.hive.ql.Driver" ]
import java.nio.file.Path; import org.apache.drill.test.TestTools; import org.apache.hadoop.hive.ql.Driver;
import java.nio.file.*; import org.apache.drill.test.*; import org.apache.hadoop.hive.ql.*;
[ "java.nio", "org.apache.drill", "org.apache.hadoop" ]
java.nio; org.apache.drill; org.apache.hadoop;
2,711,599
public void addAll(final String... attendeeURIs) { addAll(Arrays.asList(attendeeURIs)); }
void function(final String... attendeeURIs) { addAll(Arrays.asList(attendeeURIs)); }
/** * Adds one or several attendees to an event scheduled in a calendar. The attendees are specified * by one of their URI that can be an email address. If some of the attendees to add are already * present, then they are not added. * @param attendeeURIs the URI of the attendees to add. */
Adds one or several attendees to an event scheduled in a calendar. The attendees are specified by one of their URI that can be an email address. If some of the attendees to add are already present, then they are not added
addAll
{ "repo_name": "CecileBONIN/Silverpeas-Core", "path": "lib-core/src/main/java/com/silverpeas/calendar/CalendarEventAttendees.java", "license": "agpl-3.0", "size": 4694 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,336,842
public void saveMetaStoreObjects( Repository repository, IMetaStore metaStore ) throws MetaStoreException { }
void function( Repository repository, IMetaStore metaStore ) throws MetaStoreException { }
/** * This method needs to be called to store those objects which are used and referenced in the transformation metadata * but not saved in the XML serialization. For example, the Kettle data service definition is referenced by name but * not stored when getXML() is called. * * @param metaStore * The store to save to * @throws MetaStoreException * in case there is an error. */
This method needs to be called to store those objects which are used and referenced in the transformation metadata but not saved in the XML serialization. For example, the Kettle data service definition is referenced by name but not stored when getXML() is called
saveMetaStoreObjects
{ "repo_name": "nantunes/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/TransMeta.java", "license": "apache-2.0", "size": 223158 }
[ "org.pentaho.di.repository.Repository", "org.pentaho.metastore.api.IMetaStore", "org.pentaho.metastore.api.exceptions.MetaStoreException" ]
import org.pentaho.di.repository.Repository; import org.pentaho.metastore.api.IMetaStore; import org.pentaho.metastore.api.exceptions.MetaStoreException;
import org.pentaho.di.repository.*; import org.pentaho.metastore.api.*; import org.pentaho.metastore.api.exceptions.*;
[ "org.pentaho.di", "org.pentaho.metastore" ]
org.pentaho.di; org.pentaho.metastore;
1,589,599
protected String serializeDocument(Document doc) { File file = doc.getFile(); String path = file == null ? null : file.getAbsolutePath(); return path; }
String function(Document doc) { File file = doc.getFile(); String path = file == null ? null : file.getAbsolutePath(); return path; }
/** * Convert a Document into a String. The default implementation just * converts the Document's File into a file path. * <p> * If this returns null (which it will do for Documents that don't have a * File) then nothing is saved. */
Convert a Document into a String. The default implementation just converts the Document's File into a file path. If this returns null (which it will do for Documents that don't have a File) then nothing is saved
serializeDocument
{ "repo_name": "mickleness/pumpernickel", "path": "src/main/java/com/pump/desktop/doc/DocumentAutoLoader.java", "license": "mit", "size": 5555 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,572,426
public CmsUUID publishProject(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException { CmsRequestContext context = cms.getRequestContext(); CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { // check if the current user has the required publish permissions checkPublishPermissions(dbc, publishList); m_driverManager.publishProject(cms, dbc, publishList, report); } finally { dbc.clear(); } return publishList.getPublishHistoryId(); }
CmsUUID function(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException { CmsRequestContext context = cms.getRequestContext(); CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkPublishPermissions(dbc, publishList); m_driverManager.publishProject(cms, dbc, publishList, report); } finally { dbc.clear(); } return publishList.getPublishHistoryId(); }
/** * Publishes the resources of a specified publish list.<p> * * @param cms the current request context * @param publishList a publish list * @param report an instance of <code>{@link I_CmsReport}</code> to print messages * * @return the publish history id of the published project * * @throws CmsException if something goes wrong * * @see #fillPublishList(CmsRequestContext, CmsPublishList) */
Publishes the resources of a specified publish list
publishProject
{ "repo_name": "sbonoc/opencms-core", "path": "src/org/opencms/db/CmsSecurityManager.java", "license": "lgpl-2.1", "size": 287876 }
[ "org.opencms.file.CmsObject", "org.opencms.file.CmsRequestContext", "org.opencms.main.CmsException", "org.opencms.util.CmsUUID" ]
import org.opencms.file.CmsObject; import org.opencms.file.CmsRequestContext; import org.opencms.main.CmsException; import org.opencms.util.CmsUUID;
import org.opencms.file.*; import org.opencms.main.*; import org.opencms.util.*;
[ "org.opencms.file", "org.opencms.main", "org.opencms.util" ]
org.opencms.file; org.opencms.main; org.opencms.util;
2,580,101
private void initAll() { System.out.println("\nTest Orm generate entity"); System.out.println( "########################################" + "######################################"); getHarmony().findAndExecute(ProjectCommand.INIT_ANDROID, null, null); makeEntities(); getHarmony().findAndExecute(OrmCommand.GENERATE_ENTITIES, new String[] {}, null); final OrmCommand command = (OrmCommand) Harmony.getInstance().getCommand( OrmCommand.class); command.generateMetas(); parsedMetadata = ApplicationMetadata.INSTANCE; }
void function() { System.out.println(STR); System.out.println( STR + STR); getHarmony().findAndExecute(ProjectCommand.INIT_ANDROID, null, null); makeEntities(); getHarmony().findAndExecute(OrmCommand.GENERATE_ENTITIES, new String[] {}, null); final OrmCommand command = (OrmCommand) Harmony.getInstance().getCommand( OrmCommand.class); command.generateMetas(); parsedMetadata = ApplicationMetadata.INSTANCE; }
/** * Initialize everything for the test. */
Initialize everything for the test
initAll
{ "repo_name": "TACTfactory/harmony-core", "path": "src/com/tactfactory/harmony/test/orm/OrmInitEntitiesTest.java", "license": "mit", "size": 9700 }
[ "com.tactfactory.harmony.Harmony", "com.tactfactory.harmony.command.OrmCommand", "com.tactfactory.harmony.command.ProjectCommand", "com.tactfactory.harmony.meta.ApplicationMetadata" ]
import com.tactfactory.harmony.Harmony; import com.tactfactory.harmony.command.OrmCommand; import com.tactfactory.harmony.command.ProjectCommand; import com.tactfactory.harmony.meta.ApplicationMetadata;
import com.tactfactory.harmony.*; import com.tactfactory.harmony.command.*; import com.tactfactory.harmony.meta.*;
[ "com.tactfactory.harmony" ]
com.tactfactory.harmony;
708,552
public static StringRedactor createFromJsonString(String json) throws IOException { StringRedactor sr = new StringRedactor(); if ((json == null) || json.isEmpty()) { sr.policy = RedactionPolicy.emptyRedactionPolicy(); return sr; } ObjectMapper mapper = new ObjectMapper(); RedactionPolicy policy = mapper.readValue(json, RedactionPolicy.class); policy.postProcess(); sr.policy = policy; return sr; }
static StringRedactor function(String json) throws IOException { StringRedactor sr = new StringRedactor(); if ((json == null) json.isEmpty()) { sr.policy = RedactionPolicy.emptyRedactionPolicy(); return sr; } ObjectMapper mapper = new ObjectMapper(); RedactionPolicy policy = mapper.readValue(json, RedactionPolicy.class); policy.postProcess(); sr.policy = policy; return sr; }
/** * Create a StringRedactor based on the JSON found in the given String. * The format is identical to that described in createFromJsonFile(). * @param json String containing json formatted rules. * @return A freshly allocated StringRedactor * @throws JsonParseException, JsonMappingException, IOException */
Create a StringRedactor based on the JSON found in the given String. The format is identical to that described in createFromJsonFile()
createFromJsonString
{ "repo_name": "rockmkd/datacollector", "path": "container/src/main/java/org/cloudera/log4j/redactor/StringRedactor.java", "license": "apache-2.0", "size": 9257 }
[ "com.fasterxml.jackson.databind.ObjectMapper", "java.io.IOException" ]
import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException;
import com.fasterxml.jackson.databind.*; import java.io.*;
[ "com.fasterxml.jackson", "java.io" ]
com.fasterxml.jackson; java.io;
618,944
public boolean hasChangeSetComputed() { File changelogFile = new File(getRootDir(), "changelog.xml"); return changelogFile.exists(); }
boolean function() { File changelogFile = new File(getRootDir(), STR); return changelogFile.exists(); }
/** * Returns true if the changelog is already computed. */
Returns true if the changelog is already computed
hasChangeSetComputed
{ "repo_name": "stefanbrausch/hudson-main", "path": "core/src/main/java/hudson/model/AbstractBuild.java", "license": "mit", "size": 41793 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,227,824
public Set<ProgramWorkflow> getAllWorkflows() { if (allWorkflows == null) { allWorkflows = new HashSet<ProgramWorkflow>(); } return allWorkflows; }
Set<ProgramWorkflow> function() { if (allWorkflows == null) { allWorkflows = new HashSet<ProgramWorkflow>(); } return allWorkflows; }
/** * Get all workflows...including the retired ones * * @return Returns a Set&lt;ProgramWorkflow&gt; of all workflows */
Get all workflows...including the retired ones
getAllWorkflows
{ "repo_name": "maany/openmrs-core", "path": "api/src/main/java/org/openmrs/Program.java", "license": "mpl-2.0", "size": 5084 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,601,487
public static <T> SequenceChangeEvent<T> newRemoveInstanceAtIndex(AlignmentModel<T> source, String sequenceID, Collection<T> deletedContent, Integer index) { return new SequenceChangeEvent<T>(source, sequenceID, ListChangeType.DELETION, deletedContent, null, index); }
static <T> SequenceChangeEvent<T> function(AlignmentModel<T> source, String sequenceID, Collection<T> deletedContent, Integer index) { return new SequenceChangeEvent<T>(source, sequenceID, ListChangeType.DELETION, deletedContent, null, index); }
/** * Creates a new instance of this event indicating the removal of a sequence and records the index of the deleted sequence. * The index is necessary if the deleted sequence should be added again in the same position. * * @param source the alignment model from which the sequence was removed * @param sequenceID the ID of the sequence that was removed * @param deletedContent a collection containing the tokens that were contained in the sequence * (The collection implementation used here should ideally be as memory-efficient as the ones used by {@code source} internally. * If {@code null} is passed here, an empty collection will be used.) * @param index the index of the deleted sequence * @return the new event instance */
Creates a new instance of this event indicating the removal of a sequence and records the index of the deleted sequence. The index is necessary if the deleted sequence should be added again in the same position
newRemoveInstanceAtIndex
{ "repo_name": "bioinfweb/LibrAlign", "path": "main/info.bioinfweb.libralign.core/src/info/bioinfweb/libralign/model/events/SequenceChangeEvent.java", "license": "lgpl-3.0", "size": 6230 }
[ "info.bioinfweb.commons.collections.ListChangeType", "info.bioinfweb.libralign.model.AlignmentModel", "java.util.Collection" ]
import info.bioinfweb.commons.collections.ListChangeType; import info.bioinfweb.libralign.model.AlignmentModel; import java.util.Collection;
import info.bioinfweb.commons.collections.*; import info.bioinfweb.libralign.model.*; import java.util.*;
[ "info.bioinfweb.commons", "info.bioinfweb.libralign", "java.util" ]
info.bioinfweb.commons; info.bioinfweb.libralign; java.util;
601,478
private void loadMap() { mapOpt = MapOptions.newInstance(); map = new MapWidget(mapOpt); wrapperPanel.add(map); map.addDragEndHandler(dragEndMapHandler); map.addClickHandler(clickMapHanler); map.addIdleHandler(idleMapHandler); // This method call of the Paintable interface sets the component // style name in DOM tree setStyleName(CLASSNAME); // Update all the uidl requests that have been made if (stack != null) { for(UIDL uidl : stack) { updateFromUIDL(uidl, client); } } stack = null; }
void function() { mapOpt = MapOptions.newInstance(); map = new MapWidget(mapOpt); wrapperPanel.add(map); map.addDragEndHandler(dragEndMapHandler); map.addClickHandler(clickMapHanler); map.addIdleHandler(idleMapHandler); setStyleName(CLASSNAME); if (stack != null) { for(UIDL uidl : stack) { updateFromUIDL(uidl, client); } } stack = null; }
/** * Once the API has been loaded, the MapWidget can be initialized. This * method will initialize the MapWidget and place it inside the wrapper from * the composite root. */
Once the API has been loaded, the MapWidget can be initialized. This method will initialize the MapWidget and place it inside the wrapper from the composite root
loadMap
{ "repo_name": "wilds/GoogleMapWidgetV3", "path": "src/com/wildboar/vaadin/addon/googlemap/client/VGoogleMap.java", "license": "apache-2.0", "size": 53817 }
[ "com.google.gwt.maps.client.MapOptions", "com.google.gwt.maps.client.MapWidget" ]
import com.google.gwt.maps.client.MapOptions; import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.*;
[ "com.google.gwt" ]
com.google.gwt;
2,003,986
public static String generateCustomWordPassword(int numberOfLetters, String[] dict, ArrayList<String> customWords, int numberOfCustomWords){ // Add the custom words to a local list for manipulation ArrayList<String> customWordList = customWords; //instance of a random number so that we can select random numbers Random rand = new Random(); // Flag for exiting the custom word choosing loop boolean customWordLoopFlag = false; // Counter for the custom word choosing loop to check for infinite looping int custCounter = 0; // Strings to check the word length against String custOutputCheck = ""; String custOutput = ""; //ArrayList to hold the custom words once they are chosen ArrayList<String> custOutputArray = new ArrayList<String>(); //ArrayList to hold the normal words once they are chosen ArrayList<String> normalWordList = new ArrayList<String>(); //Create a empty string to hold the value to be returned. String output = ""; //Create a string to test if the output is too long, set it to the empty string of output String outputcheck = custOutput; //boolean flag to check if the loop needs to be exited out of boolean escapeLoop = false; //Create a counter to measure how many times we have gone through the loop, start at zero int counter = 0; //Final Password output string String actualOutput = ""; //Custom word choosing loop do{ //incriment our inifate loop counter custCounter++; //create a new random number bounded to the size of the dictionary int randomNum = rand.nextInt((customWordList.size())); //use the random number to select an entry from the dictionary and assign it to the output check string custOutputCheck += customWordList.get(randomNum); //if the output check is the correct length set it as the output and exit the loop if(custOutputArray.size() + 1 == numberOfCustomWords){ //sets the output to be the value of the output check custOutput = custOutputCheck; //Add the actual word to the output list custOutputArray.add(customWordList.get(randomNum)); //sets the loop output check to be true, causing the loop to exit customWordLoopFlag = true; //if the output check is less then the correct length add it to the output }else if(custOutputCheck.length() < numberOfLetters){ //sets the output to be the same value as the output check custOutput = custOutputCheck; //Add the actual word to the output list custOutputArray.add(customWordList.get(randomNum)); //Remove the word from the custom word list to ensure that it is not picked again customWordList.remove(randomNum); //else the output check is too long and the loop needs to try again }else{ //set the value of output check back to the value of output custOutputCheck = custOutput; } //if the loop has run a bunch of times and can't make the correct length and the loop is not set to exit this loop, and accept that there will be one fewer custom words if((custCounter > 10000 && !customWordLoopFlag) || numberOfCustomWords == 0 || customWordList.size() == 0){ //sets the loop output check to be true, causing the loop to exit customWordLoopFlag = true; } //looping condition }while(customWordLoopFlag == false); //do-while loop to choose the normal words do{ //increment the counter by 1 counter++; //create a new random number bounded to the size of the dictionary int randomNum = rand.nextInt((dict.length) +1); //use the random number to select an entry from the dictionary and assign it to the output check string outputcheck += dict[randomNum]; //if the output check is the correct length set it as the output and exit the loop if(outputcheck.length() == numberOfLetters){ //sets the output to be the value of the output check output = outputcheck; //Add the word to the wordlist for normal words normalWordList.add(dict[randomNum]); //sets the loop output check to be true, causing the loop to exit escapeLoop = true; //if the output check is less then the correct length add it to the output }else if(outputcheck.length() < numberOfLetters){ //sets the output to be the same value as the output check output = outputcheck; //Add the word to the wordlist for normal words normalWordList.add(dict[randomNum]); //else the output check is too long and the loop needs to try again }else{ //set the value of output check back to the value of output outputcheck = output; } //if the loop has run a bunch of times and can't make the correct length and the loop is not set to exit this loop, generate the remaining values if(counter > 1000000 && !escapeLoop){ //set the output to have random charters attached to the end, based off the number remaining normalWordList.add(generateRandomPassword(numberOfLetters - outputcheck.length())); //sets the loop output check to be true, causing the loop to exit escapeLoop = true; } //condition for the loop to keep going, so long as the escapeLoop flag is false it will keep looping }while(!escapeLoop); //Password building loop, while there is still items in the arrays keep going while(custOutputArray.size() + normalWordList.size() != 0){ //select a random number either 0/1 int randomNum = rand.nextInt((2) +1); //if the number is 1 and we still have custom words to add if(randomNum == 1 && custOutputArray.size() != 0){ // select a random number based off the size of the array randomNum = rand.nextInt((custOutputArray.size())); // Add the selected word to the output actualOutput += custOutputArray.get(randomNum); // remove the word from the list custOutputArray.remove(randomNum); //if the number was any other number or we are out of custom words and we still have normal words }else if(normalWordList.size() !=0){ // select a random number based off the size of the array randomNum = rand.nextInt((normalWordList.size())); // Add the selected word to the output actualOutput += normalWordList.get(randomNum); // remove the word from the list normalWordList.remove(randomNum); } } //return the outputted password return actualOutput; }
static String function(int numberOfLetters, String[] dict, ArrayList<String> customWords, int numberOfCustomWords){ ArrayList<String> customWordList = customWords; Random rand = new Random(); boolean customWordLoopFlag = false; int custCounter = 0; String custOutputCheck = STRSTRSTR"; do{ custCounter++; int randomNum = rand.nextInt((customWordList.size())); custOutputCheck += customWordList.get(randomNum); if(custOutputArray.size() + 1 == numberOfCustomWords){ custOutput = custOutputCheck; custOutputArray.add(customWordList.get(randomNum)); customWordLoopFlag = true; }else if(custOutputCheck.length() < numberOfLetters){ custOutput = custOutputCheck; custOutputArray.add(customWordList.get(randomNum)); customWordList.remove(randomNum); }else{ custOutputCheck = custOutput; } if((custCounter > 10000 && !customWordLoopFlag) numberOfCustomWords == 0 customWordList.size() == 0){ customWordLoopFlag = true; } }while(customWordLoopFlag == false); do{ counter++; int randomNum = rand.nextInt((dict.length) +1); outputcheck += dict[randomNum]; if(outputcheck.length() == numberOfLetters){ output = outputcheck; normalWordList.add(dict[randomNum]); escapeLoop = true; }else if(outputcheck.length() < numberOfLetters){ output = outputcheck; normalWordList.add(dict[randomNum]); }else{ outputcheck = output; } if(counter > 1000000 && !escapeLoop){ normalWordList.add(generateRandomPassword(numberOfLetters - outputcheck.length())); escapeLoop = true; } }while(!escapeLoop); while(custOutputArray.size() + normalWordList.size() != 0){ int randomNum = rand.nextInt((2) +1); if(randomNum == 1 && custOutputArray.size() != 0){ randomNum = rand.nextInt((custOutputArray.size())); actualOutput += custOutputArray.get(randomNum); custOutputArray.remove(randomNum); }else if(normalWordList.size() !=0){ randomNum = rand.nextInt((normalWordList.size())); actualOutput += normalWordList.get(randomNum); normalWordList.remove(randomNum); } } return actualOutput; }
/** * This function is used to generate a password made of both normal words and custom words * The idea being that you have a fixed normal set of words while allowing the user to add there own words. * * @param int numberOfLetters, Indicates how many charters long the password should be in total * @param String[] dict. An array of "normal" words * @param ArrayList<String> customWords, An arraylist containing all the custom words the user has inputted to select from * @param int numberOfCustomWords, Sets the number of custom words to be used in the mix of custom and "normal" words * * @return String, returns a string of the generated password. * * if it is unable to use exact words to generate a password of the correct length random chars will be used to fill the rest of the password * * The order of words and custom words should also be random as well * * */
This function is used to generate a password made of both normal words and custom words The idea being that you have a fixed normal set of words while allowing the user to add there own words
generateCustomWordPassword
{ "repo_name": "benjlin/Programmers-Toolbox", "path": "Java/GeneratePassword.java", "license": "mit", "size": 12160 }
[ "java.util.ArrayList", "java.util.Random" ]
import java.util.ArrayList; import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
172,550
@RolesAllowed("user") public int[] renderAsPackedInt(PlaneDef pd) { rwl.writeLock().lock(); try { final Map<byte[], Integer> overlays = getMasks(pd); if (overlays.size() > 0) { renderer.setOverlays(overlays); } errorIfInvalidState(); checkPlaneDef(pd); if (resolutionLevel != null) { renderer.setResolutionLevel(resolutionLevel); } return renderer.renderAsPackedInt(pd, null); } catch (IOException e) { log.error("IO error while rendering.", e); throw new ResourceError(e.getMessage()); } catch (QuantizationException e) { log.error("Quantization exception while rendering.", e); throw new InternalException(e.getMessage()); } finally { rwl.writeLock().unlock(); } }
@RolesAllowed("user") int[] function(PlaneDef pd) { rwl.writeLock().lock(); try { final Map<byte[], Integer> overlays = getMasks(pd); if (overlays.size() > 0) { renderer.setOverlays(overlays); } errorIfInvalidState(); checkPlaneDef(pd); if (resolutionLevel != null) { renderer.setResolutionLevel(resolutionLevel); } return renderer.renderAsPackedInt(pd, null); } catch (IOException e) { log.error(STR, e); throw new ResourceError(e.getMessage()); } catch (QuantizationException e) { log.error(STR, e); throw new InternalException(e.getMessage()); } finally { rwl.writeLock().unlock(); } }
/** * Implemented as specified by the {@link RenderingEngine} interface. * * @see RenderingEngine#render(PlaneDef) */
Implemented as specified by the <code>RenderingEngine</code> interface
renderAsPackedInt
{ "repo_name": "MontpellierRessourcesImagerie/openmicroscopy", "path": "components/server/src/ome/services/RenderingBean.java", "license": "gpl-2.0", "size": 81669 }
[ "java.io.IOException", "java.util.Map" ]
import java.io.IOException; import java.util.Map;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,306,077
@Override public void executeSymbolically(Frame frame) throws NoExceptionHandlerFoundException, SymbolicExecutionException { try { Stack<Object> stack = frame.getOperandStack(); Objectref objectref = (Objectref) stack.pop(); // Runtime exception: objectref is null. if (objectref == null) throw new VmRuntimeException(frame.getVm().generateExc("java.lang.NullPointerException")); // Synchronized? ifSynchronizedExitMonitor(frame); // Handle the exception. SymbolicExceptionHandler handler = new SymbolicExceptionHandler(frame, objectref); handler.handleException(); } catch (VmRuntimeException e) { SymbolicExceptionHandler handler = new SymbolicExceptionHandler(frame, e); try { handler.handleException(); } catch (ExecutionException e2) { executionFailedSymbolically(e2); } } catch (ExecutionException e) { executionFailedSymbolically(e); } }
void function(Frame frame) throws NoExceptionHandlerFoundException, SymbolicExecutionException { try { Stack<Object> stack = frame.getOperandStack(); Objectref objectref = (Objectref) stack.pop(); if (objectref == null) throw new VmRuntimeException(frame.getVm().generateExc(STR)); ifSynchronizedExitMonitor(frame); SymbolicExceptionHandler handler = new SymbolicExceptionHandler(frame, objectref); handler.handleException(); } catch (VmRuntimeException e) { SymbolicExceptionHandler handler = new SymbolicExceptionHandler(frame, e); try { handler.handleException(); } catch (ExecutionException e2) { executionFailedSymbolically(e2); } } catch (ExecutionException e) { executionFailedSymbolically(e); } }
/** * Execute the instruction symbolically. * @param frame The currently executed frame. * @throws NoExceptionHandlerFoundException If no handler could be found. * @throws SymbolicExecutionException Thrown in case of fatal problems during the symbolic execution. */
Execute the instruction symbolically
executeSymbolically
{ "repo_name": "wwu-pi/muggl", "path": "muggl-core/src/de/wwu/muggl/instructions/bytecode/Athrow.java", "license": "gpl-3.0", "size": 5780 }
[ "de.wwu.muggl.vm.Frame", "de.wwu.muggl.vm.exceptions.NoExceptionHandlerFoundException", "de.wwu.muggl.vm.exceptions.VmRuntimeException", "de.wwu.muggl.vm.execution.ExecutionException", "de.wwu.muggl.vm.impl.symbolic.SymbolicExecutionException", "de.wwu.muggl.vm.impl.symbolic.exceptions.SymbolicExceptionHandler", "de.wwu.muggl.vm.initialization.Objectref", "java.util.Stack" ]
import de.wwu.muggl.vm.Frame; import de.wwu.muggl.vm.exceptions.NoExceptionHandlerFoundException; import de.wwu.muggl.vm.exceptions.VmRuntimeException; import de.wwu.muggl.vm.execution.ExecutionException; import de.wwu.muggl.vm.impl.symbolic.SymbolicExecutionException; import de.wwu.muggl.vm.impl.symbolic.exceptions.SymbolicExceptionHandler; import de.wwu.muggl.vm.initialization.Objectref; import java.util.Stack;
import de.wwu.muggl.vm.*; import de.wwu.muggl.vm.exceptions.*; import de.wwu.muggl.vm.execution.*; import de.wwu.muggl.vm.impl.symbolic.*; import de.wwu.muggl.vm.impl.symbolic.exceptions.*; import de.wwu.muggl.vm.initialization.*; import java.util.*;
[ "de.wwu.muggl", "java.util" ]
de.wwu.muggl; java.util;
1,290,565
public interface EGLConfigChooser { EGLConfig chooseConfig(EGL10 egl, EGLDisplay display);
interface EGLConfigChooser { EGLConfig function(EGL10 egl, EGLDisplay display);
/** * Choose a configuration from the list. Implementors typically * implement this method by calling * {@link EGL10#eglChooseConfig} and iterating through the results. Please consult the * EGL specification available from The Khronos Group to learn how to call eglChooseConfig. * * @param egl the EGL10 for the current display. * @param display the current display. * @return the chosen configuration. */
Choose a configuration from the list. Implementors typically implement this method by calling <code>EGL10#eglChooseConfig</code> and iterating through the results. Please consult the EGL specification available from The Khronos Group to learn how to call eglChooseConfig
chooseConfig
{ "repo_name": "ChillingVan/android-openGL-canvas", "path": "canvasgl/src/main/java/com/chillingvan/canvasgl/glview/texture/gles/GLThread.java", "license": "apache-2.0", "size": 46103 }
[ "javax.microedition.khronos.egl.EGLConfig", "javax.microedition.khronos.egl.EGLDisplay" ]
import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.*;
[ "javax.microedition" ]
javax.microedition;
262,367
public void addDiagnosticInfo(TaskAttemptID taskId, String diagInfo) { List<String> diagHistory = taskDiagnosticData.get(taskId); if (diagHistory == null) { diagHistory = new ArrayList<String>(); taskDiagnosticData.put(taskId, diagHistory); } diagHistory.add(diagInfo); }
void function(TaskAttemptID taskId, String diagInfo) { List<String> diagHistory = taskDiagnosticData.get(taskId); if (diagHistory == null) { diagHistory = new ArrayList<String>(); taskDiagnosticData.put(taskId, diagHistory); } diagHistory.add(diagInfo); }
/** * Save diagnostic information for a given task. * * @param taskId id of the task * @param diagInfo diagnostic information for the task */
Save diagnostic information for a given task
addDiagnosticInfo
{ "repo_name": "rvadali/fb-raid-refactoring", "path": "src/mapred/org/apache/hadoop/mapred/TaskInProgress.java", "license": "apache-2.0", "size": 52366 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,372,956
private final boolean handleBlockedWrite(ByteBuffer buffer, DistributionMessage msg) throws ConnectionException { if (!addToQueue(buffer, msg, true)) { return false; } else { startNioPusher(); return true; } } private final Object nioPusherSync = new Object();
final boolean function(ByteBuffer buffer, DistributionMessage msg) throws ConnectionException { if (!addToQueue(buffer, msg, true)) { return false; } else { startNioPusher(); return true; } } private final Object nioPusherSync = new Object();
/** * Return true if it was able to handle a block write of the given buffer. * Return false if it is still the caller is still responsible for writing it. * @throws ConnectionException if the conduit has stopped */
Return true if it was able to handle a block write of the given buffer. Return false if it is still the caller is still responsible for writing it
handleBlockedWrite
{ "repo_name": "sshcherbakov/incubator-geode", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java", "license": "apache-2.0", "size": 165201 }
[ "com.gemstone.gemfire.distributed.internal.DistributionMessage", "java.nio.ByteBuffer" ]
import com.gemstone.gemfire.distributed.internal.DistributionMessage; import java.nio.ByteBuffer;
import com.gemstone.gemfire.distributed.internal.*; import java.nio.*;
[ "com.gemstone.gemfire", "java.nio" ]
com.gemstone.gemfire; java.nio;
1,432,860
public void eInit(SarlScript script, String name, IJvmTypeProvider context) { this.builder.eInit(script, name, context); }
void function(SarlScript script, String name, IJvmTypeProvider context) { this.builder.eInit(script, name, context); }
/** Initialize the Ecore element when inside a script. */
Initialize the Ecore element when inside a script
eInit
{ "repo_name": "jgfoster/sarl", "path": "main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/appenders/SarlCapacitySourceAppender.java", "license": "apache-2.0", "size": 4533 }
[ "io.sarl.lang.sarl.SarlScript", "org.eclipse.xtext.common.types.access.IJvmTypeProvider" ]
import io.sarl.lang.sarl.SarlScript; import org.eclipse.xtext.common.types.access.IJvmTypeProvider;
import io.sarl.lang.sarl.*; import org.eclipse.xtext.common.types.access.*;
[ "io.sarl.lang", "org.eclipse.xtext" ]
io.sarl.lang; org.eclipse.xtext;
1,398,008
@Override public void setPropertiesFromResultSet(EntityCustomFieldDef entity, Cursor cursor) throws EwpException { String id = cursor.getString(cursor.getColumnIndex("TenantId")); if (id != null && !"".equals(id)) { entity.setTenantId(UUID.fromString(id)); } String entityCustomFieldId = cursor.getString(cursor.getColumnIndex("EntityFieldDetailsId")); if (entityCustomFieldId != null && !"".equals(entityCustomFieldId)) { entity.setEntityId(UUID.fromString(entityCustomFieldId)); } String applicationId = cursor.getString(cursor.getColumnIndex("ApplicationId")); if (applicationId != null) { entity.setApplicationId(applicationId); } String customLbl = cursor.getString(cursor.getColumnIndex("CustomLabel")); if (customLbl != null) { entity.setCustomLabel(customLbl); } String order = cursor.getString(cursor.getColumnIndex("DisplayOrder")); if (order != null && !"".equals(order)) { entity.setDisplayOrder(Integer.parseInt(order)); } String parentEntityId = cursor.getString(cursor.getColumnIndex("ParentEntityId")); if (parentEntityId != null && !"".equals(parentEntityId)) { entity.setParentEntityId(UUID.fromString(parentEntityId)); } String watermark = cursor.getString(cursor.getColumnIndex("Watermark")); if (watermark != null) { entity.setWatermark(watermark); } String hintText = cursor.getString(cursor.getColumnIndex("HintText")); if (hintText != null) { entity.setHintText(hintText); } String groupName = cursor.getString(cursor.getColumnIndex("GroupId")); if (groupName != null && !"".equals(groupName)) { entity.setGroupId(Integer.parseInt(groupName)); } String fieldCode = cursor.getString(cursor.getColumnIndex("EntityFieldId")); if (fieldCode != null && !"".equals(fieldCode)) { entity.setFieldCode(Integer.parseInt(fieldCode)); } String fieldDataType = cursor.getString(cursor.getColumnIndex("FieldDataType")); if (fieldDataType != null && !"".equals(fieldDataType)) { entity.setFieldDataType(Integer.parseInt(fieldDataType)); } String fieldType = cursor.getString(cursor.getColumnIndex("FieldType")); if (fieldType != null && !"".equals(fieldType)) { entity.setFieldType(Integer.parseInt(fieldType)); } String fieldClass = cursor.getString(cursor.getColumnIndex("FieldClass")); if (fieldClass != null) { entity.setFieldClass(Integer.parseInt(fieldClass)); } Boolean include = cursor.getInt(cursor.getColumnIndex("Include")) == 1; if (include != null) { entity.setInclude(include); } Boolean required = cursor.getInt(cursor.getColumnIndex("REQUIRED")) == 1; if (required != null) { entity.setRequired(required); } String entityType = cursor.getString(cursor.getColumnIndex("EntityType")); if (entityType != null && !"".equals(entityType)) { entity.setEntityType(Integer.parseInt(entityType)); } String defaultValue = cursor.getString(cursor.getColumnIndex("DefaultValue")); if (defaultValue != null) { entity.setDefaultValue(defaultValue); } String createdBy = cursor.getString(cursor.getColumnIndex("CreatedBy")); if (createdBy != null && !"".equals(createdBy)) { entity.setCreatedBy(UUID.fromString(createdBy).toString());//check } String strDate = cursor.getString(cursor.getColumnIndex("CreatedDate")); if (strDate != null && !"".equals(strDate)) { entity.setCreatedAt(Utils.dateFromString(strDate, true, true)); } String updatedBy = cursor.getString(cursor.getColumnIndex("ModifiedBy")); if (updatedBy != null && !"".equals(updatedBy)) { entity.setUpdatedBy(UUID.fromString(updatedBy).toString());//check } String strModifiedDate = cursor.getString(cursor.getColumnIndex("ModifiedDate")); if (strModifiedDate != null && !"".equals(strModifiedDate)) { entity.setUpdatedAt(Utils.dateFromString(strModifiedDate, true, true)); } entity.setDirty(false); }
void function(EntityCustomFieldDef entity, Cursor cursor) throws EwpException { String id = cursor.getString(cursor.getColumnIndex(STR)); if (id != null && !STREntityFieldDetailsIdSTRSTRApplicationIdSTRCustomLabelSTRDisplayOrderSTRSTRParentEntityIdSTRSTRWatermarkSTRHintTextSTRGroupIdSTRSTREntityFieldIdSTRSTRFieldDataTypeSTRSTRFieldTypeSTRSTRFieldClassSTRIncludeSTRREQUIREDSTREntityTypeSTRSTRDefaultValueSTRCreatedBySTRSTRCreatedDateSTRSTRModifiedBySTRSTRModifiedDateSTR".equals(strModifiedDate)) { entity.setUpdatedAt(Utils.dateFromString(strModifiedDate, true, true)); } entity.setDirty(false); }
/** * Set property value from database ResultSet. * * @param cursor {@see #android.database.Cursor} database cursor for database. * @throws com.eworkplaceapps.platform.exception.EwpException */
Set property value from database ResultSet
setPropertiesFromResultSet
{ "repo_name": "rishabh05/ED", "path": "platform/src/main/java/com/eworkplaceapps/platform/customfield/EntityCustomFieldDefData.java", "license": "apache-2.0", "size": 13003 }
[ "android.database.Cursor", "com.eworkplaceapps.platform.exception.EwpException", "com.eworkplaceapps.platform.utils.Utils" ]
import android.database.Cursor; import com.eworkplaceapps.platform.exception.EwpException; import com.eworkplaceapps.platform.utils.Utils;
import android.database.*; import com.eworkplaceapps.platform.exception.*; import com.eworkplaceapps.platform.utils.*;
[ "android.database", "com.eworkplaceapps.platform" ]
android.database; com.eworkplaceapps.platform;
480,878
public void setTimeDuration(String name, long value, TimeUnit unit) { set(name, value + ParsedTimeDuration.unitFor(unit).suffix()); }
void function(String name, long value, TimeUnit unit) { set(name, value + ParsedTimeDuration.unitFor(unit).suffix()); }
/** * Set the value of <code>name</code> to the given time duration. This * is equivalent to <code>set(&lt;name&gt;, value + &lt;time suffix&gt;)</code>. * @param name Property name * @param value Time duration * @param unit Unit of time */
Set the value of <code>name</code> to the given time duration. This is equivalent to <code>set(&lt;name&gt;, value + &lt;time suffix&gt;)</code>
setTimeDuration
{ "repo_name": "zimmermatt/flink", "path": "flink-filesystems/flink-s3-fs-hadoop/src/main/java/org/apache/hadoop/conf/Configuration.java", "license": "apache-2.0", "size": 102541 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,081,268
@PutMapping("{id}") public Mono<HttpEntity<ItemResponse>> updateItem(@PathVariable("id") @Id String id, @RequestBody @Valid ItemUpdateRequest itemUpdate) { return Mono.just(ResponseEntity.ok( new ItemResponse(id, itemUpdate.getDescription(), null, null, null, null))); }
@PutMapping("{id}") Mono<HttpEntity<ItemResponse>> function(@PathVariable("id") @Id String id, @RequestBody @Valid ItemUpdateRequest itemUpdate) { return Mono.just(ResponseEntity.ok( new ItemResponse(id, itemUpdate.getDescription(), null, null, null, null))); }
/** * Updates existing item. * <p> * An example of returning a Mono with {@link ResponseEntity}. * * @param id Item ID. * @param itemUpdate Item information. * @return response */
Updates existing item. An example of returning a Mono with <code>ResponseEntity</code>
updateItem
{ "repo_name": "ScaCap/spring-auto-restdocs", "path": "samples/java-webflux/src/main/java/capital/scalable/restdocs/example/items/ItemResource.java", "license": "apache-2.0", "size": 3401 }
[ "capital.scalable.restdocs.example.constraints.Id", "javax.validation.Valid", "org.springframework.http.HttpEntity", "org.springframework.http.ResponseEntity", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.PutMapping", "org.springframework.web.bind.annotation.RequestBody" ]
import capital.scalable.restdocs.example.constraints.Id; import javax.validation.Valid; import org.springframework.http.HttpEntity; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody;
import capital.scalable.restdocs.example.constraints.*; import javax.validation.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "capital.scalable.restdocs", "javax.validation", "org.springframework.http", "org.springframework.web" ]
capital.scalable.restdocs; javax.validation; org.springframework.http; org.springframework.web;
2,580,504
protected void drawStackVertical(List values, Comparable category, Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset) { int column = dataset.getColumnIndex(category); double barX0 = domainAxis.getCategoryMiddle(column, dataset.getColumnCount(), dataArea, plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0; double barW = state.getBarWidth(); // a list to store the series index and bar region, so we can draw // all the labels at the end... List itemLabelList = new ArrayList(); // draw the blocks boolean inverted = rangeAxis.isInverted(); int blockCount = values.size() - 1; for (int k = 0; k < blockCount; k++) { int index = (inverted ? blockCount - k - 1 : k); Object[] prev = (Object[]) values.get(index); Object[] curr = (Object[]) values.get(index + 1); int series; if (curr[0] == null) { series = -((Integer) prev[0]).intValue() - 1; } else { series = ((Integer) curr[0]).intValue(); if (series < 0) { series = -((Integer) prev[0]).intValue() - 1; } } double v0 = ((Double) prev[1]).doubleValue(); double vv0 = rangeAxis.valueToJava2D(v0, dataArea, plot.getRangeAxisEdge()); double v1 = ((Double) curr[1]).doubleValue(); double vv1 = rangeAxis.valueToJava2D(v1, dataArea, plot.getRangeAxisEdge()); Shape[] faces = createVerticalBlock(barX0, barW, vv0, vv1, inverted); Paint fillPaint = getItemPaint(series, column); Paint fillPaintDark = PaintAlpha.darker(fillPaint); boolean drawOutlines = isDrawBarOutline(); Paint outlinePaint = fillPaint; if (drawOutlines) { outlinePaint = getItemOutlinePaint(series, column); g2.setStroke(getItemOutlineStroke(series, column)); } for (int f = 0; f < 6; f++) { if (f == 5) { g2.setPaint(fillPaint); } else { g2.setPaint(fillPaintDark); } g2.fill(faces[f]); if (drawOutlines) { g2.setPaint(outlinePaint); g2.draw(faces[f]); } } itemLabelList.add(new Object[] {new Integer(series), faces[5].getBounds2D(), BooleanUtilities.valueOf(v0 < getBase())}); // add an item entity, if this information is being collected EntityCollection entities = state.getEntityCollection(); if (entities != null) { addItemEntity(entities, dataset, series, column, faces[5]); } } for (int i = 0; i < itemLabelList.size(); i++) { Object[] record = (Object[]) itemLabelList.get(i); int series = ((Integer) record[0]).intValue(); Rectangle2D bar = (Rectangle2D) record[1]; boolean neg = ((Boolean) record[2]).booleanValue(); CategoryItemLabelGenerator generator = getItemLabelGenerator(series, column); if (generator != null && isItemLabelVisible(series, column)) { drawItemLabel(g2, dataset, series, column, plot, generator, bar, neg); } } }
void function(List values, Comparable category, Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset) { int column = dataset.getColumnIndex(category); double barX0 = domainAxis.getCategoryMiddle(column, dataset.getColumnCount(), dataArea, plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0; double barW = state.getBarWidth(); List itemLabelList = new ArrayList(); boolean inverted = rangeAxis.isInverted(); int blockCount = values.size() - 1; for (int k = 0; k < blockCount; k++) { int index = (inverted ? blockCount - k - 1 : k); Object[] prev = (Object[]) values.get(index); Object[] curr = (Object[]) values.get(index + 1); int series; if (curr[0] == null) { series = -((Integer) prev[0]).intValue() - 1; } else { series = ((Integer) curr[0]).intValue(); if (series < 0) { series = -((Integer) prev[0]).intValue() - 1; } } double v0 = ((Double) prev[1]).doubleValue(); double vv0 = rangeAxis.valueToJava2D(v0, dataArea, plot.getRangeAxisEdge()); double v1 = ((Double) curr[1]).doubleValue(); double vv1 = rangeAxis.valueToJava2D(v1, dataArea, plot.getRangeAxisEdge()); Shape[] faces = createVerticalBlock(barX0, barW, vv0, vv1, inverted); Paint fillPaint = getItemPaint(series, column); Paint fillPaintDark = PaintAlpha.darker(fillPaint); boolean drawOutlines = isDrawBarOutline(); Paint outlinePaint = fillPaint; if (drawOutlines) { outlinePaint = getItemOutlinePaint(series, column); g2.setStroke(getItemOutlineStroke(series, column)); } for (int f = 0; f < 6; f++) { if (f == 5) { g2.setPaint(fillPaint); } else { g2.setPaint(fillPaintDark); } g2.fill(faces[f]); if (drawOutlines) { g2.setPaint(outlinePaint); g2.draw(faces[f]); } } itemLabelList.add(new Object[] {new Integer(series), faces[5].getBounds2D(), BooleanUtilities.valueOf(v0 < getBase())}); EntityCollection entities = state.getEntityCollection(); if (entities != null) { addItemEntity(entities, dataset, series, column, faces[5]); } } for (int i = 0; i < itemLabelList.size(); i++) { Object[] record = (Object[]) itemLabelList.get(i); int series = ((Integer) record[0]).intValue(); Rectangle2D bar = (Rectangle2D) record[1]; boolean neg = ((Boolean) record[2]).booleanValue(); CategoryItemLabelGenerator generator = getItemLabelGenerator(series, column); if (generator != null && isItemLabelVisible(series, column)) { drawItemLabel(g2, dataset, series, column, plot, generator, bar, neg); } } }
/** * Draws a stack of bars for one category, with a vertical orientation. * * @param values the value list. * @param category the category. * @param g2 the graphics device. * @param state the state. * @param dataArea the data area (adjusted for the 3D effect). * @param plot the plot. * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the dataset. * * @since 1.0.4 */
Draws a stack of bars for one category, with a vertical orientation
drawStackVertical
{ "repo_name": "ceabie/jfreechart", "path": "source/org/jfree/chart/renderer/category/StackedBarRenderer3D.java", "license": "lgpl-2.1", "size": 33923 }
[ "java.awt.Graphics2D", "java.awt.Paint", "java.awt.Shape", "java.awt.geom.Rectangle2D", "java.util.ArrayList", "java.util.List", "org.jfree.chart.axis.CategoryAxis", "org.jfree.chart.axis.ValueAxis", "org.jfree.chart.entity.EntityCollection", "org.jfree.chart.labels.CategoryItemLabelGenerator", "org.jfree.chart.plot.CategoryPlot", "org.jfree.chart.util.PaintAlpha", "org.jfree.data.category.CategoryDataset", "org.jfree.util.BooleanUtilities" ]
import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.List; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.labels.CategoryItemLabelGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.util.PaintAlpha; import org.jfree.data.category.CategoryDataset; import org.jfree.util.BooleanUtilities;
import java.awt.*; import java.awt.geom.*; import java.util.*; import org.jfree.chart.axis.*; import org.jfree.chart.entity.*; import org.jfree.chart.labels.*; import org.jfree.chart.plot.*; import org.jfree.chart.util.*; import org.jfree.data.category.*; import org.jfree.util.*;
[ "java.awt", "java.util", "org.jfree.chart", "org.jfree.data", "org.jfree.util" ]
java.awt; java.util; org.jfree.chart; org.jfree.data; org.jfree.util;
1,210,929
@NonNull private static String getChannelFromManifest(@NonNull Context ctx) { try { ApplicationInfo info = ctx.getPackageManager() .getApplicationInfo(BuildConfig.APPLICATION_ID, PackageManager.GET_META_DATA); String channel = info.metaData.getString(Prefs.getAppChannelKey()); return channel != null ? channel : ""; } catch (Throwable t) { return ""; } } private ReleaseUtil() { }
@NonNull static String function(@NonNull Context ctx) { try { ApplicationInfo info = ctx.getPackageManager() .getApplicationInfo(BuildConfig.APPLICATION_ID, PackageManager.GET_META_DATA); String channel = info.metaData.getString(Prefs.getAppChannelKey()); return channel != null ? channel : STR"; } } private ReleaseUtil() { }
/** * Returns the distribution channel for the app from AndroidManifest.xml * @return The channel (the empty string if not defined) */
Returns the distribution channel for the app from AndroidManifest.xml
getChannelFromManifest
{ "repo_name": "SAGROUP2/apps-android-wikipedia", "path": "app/src/main/java/org/wikipedia/util/ReleaseUtil.java", "license": "apache-2.0", "size": 2566 }
[ "android.content.Context", "android.content.pm.ApplicationInfo", "android.content.pm.PackageManager", "android.support.annotation.NonNull", "org.wikipedia.BuildConfig", "org.wikipedia.settings.Prefs" ]
import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.support.annotation.NonNull; import org.wikipedia.BuildConfig; import org.wikipedia.settings.Prefs;
import android.content.*; import android.content.pm.*; import android.support.annotation.*; import org.wikipedia.*; import org.wikipedia.settings.*;
[ "android.content", "android.support", "org.wikipedia", "org.wikipedia.settings" ]
android.content; android.support; org.wikipedia; org.wikipedia.settings;
1,035,362
public void setTitle(final String title) { this.title = Objects.requireNonNull(title, "title must not be null!"); }
void function(final String title) { this.title = Objects.requireNonNull(title, STR); }
/** * Sets the title of the Tweetwall. * * @param title the new title */
Sets the title of the Tweetwall
setTitle
{ "repo_name": "reinhapa/TweetwallFX", "path": "config/src/main/java/org/tweetwallfx/config/TweetwallSettings.java", "license": "mit", "size": 5699 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,873,356
@ObjectiveCName("formatNotificationText:") public String formatNotificationText(Notification pendingNotification) { return formatContentText(pendingNotification.getSender(), pendingNotification.getContentDescription().getContentType(), pendingNotification.getContentDescription().getText(), pendingNotification.getContentDescription().getRelatedUser()); }
@ObjectiveCName(STR) String function(Notification pendingNotification) { return formatContentText(pendingNotification.getSender(), pendingNotification.getContentDescription().getContentType(), pendingNotification.getContentDescription().getText(), pendingNotification.getContentDescription().getRelatedUser()); }
/** * Formatting Pending notification text * * @param pendingNotification pending notification * @return formatted notification */
Formatting Pending notification text
formatNotificationText
{ "repo_name": "ljshj/actor-platform", "path": "actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/i18n/I18nEngine.java", "license": "mit", "size": 19858 }
[ "com.google.j2objc.annotations.ObjectiveCName", "im.actor.core.entity.Notification" ]
import com.google.j2objc.annotations.ObjectiveCName; import im.actor.core.entity.Notification;
import com.google.j2objc.annotations.*; import im.actor.core.entity.*;
[ "com.google.j2objc", "im.actor.core" ]
com.google.j2objc; im.actor.core;
2,177,499
public Application createApplication(final Application application) throws GenieException { if (application == null) { throw new GeniePreconditionException("No application passed in. Unable to validate."); } application.validate(); final HttpRequest request = BaseGenieClient.buildRequest( Verb.POST, BASE_CONFIG_APPLICATION_REST_URL, null, application); return (Application) this.executeRequest(request, null, Application.class); }
Application function(final Application application) throws GenieException { if (application == null) { throw new GeniePreconditionException(STR); } application.validate(); final HttpRequest request = BaseGenieClient.buildRequest( Verb.POST, BASE_CONFIG_APPLICATION_REST_URL, null, application); return (Application) this.executeRequest(request, null, Application.class); }
/** * Create a new application configuration. * * @param application the object encapsulating the new application * configuration to create * @return The application that was created * @throws GenieException For any other error. */
Create a new application configuration
createApplication
{ "repo_name": "gorcz/genie", "path": "genie-client/src/main/java/com/netflix/genie/client/ApplicationServiceClient.java", "license": "apache-2.0", "size": 23032 }
[ "com.netflix.client.http.HttpRequest", "com.netflix.genie.common.client.BaseGenieClient", "com.netflix.genie.common.exceptions.GenieException", "com.netflix.genie.common.exceptions.GeniePreconditionException", "com.netflix.genie.common.model.Application" ]
import com.netflix.client.http.HttpRequest; import com.netflix.genie.common.client.BaseGenieClient; import com.netflix.genie.common.exceptions.GenieException; import com.netflix.genie.common.exceptions.GeniePreconditionException; import com.netflix.genie.common.model.Application;
import com.netflix.client.http.*; import com.netflix.genie.common.client.*; import com.netflix.genie.common.exceptions.*; import com.netflix.genie.common.model.*;
[ "com.netflix.client", "com.netflix.genie" ]
com.netflix.client; com.netflix.genie;
1,607,322
protected void serializeDelimiter(int delimiter) { buffer[length++] = delimiter; firstDelimiter = false; } /** * Serializes an {@link IeeeAddress} * * @param address the {@link IeeeAddress}
void function(int delimiter) { buffer[length++] = delimiter; firstDelimiter = false; } /** * Serializes an {@link IeeeAddress} * * @param address the {@link IeeeAddress}
/** * Serializes a specified delimiter between two fields. * * @param delimiter the delimiter to serialize */
Serializes a specified delimiter between two fields
serializeDelimiter
{ "repo_name": "cschwer/com.zsmartsystems.zigbee", "path": "com.zsmartsystems.zigbee.dongle.telegesis/src/main/java/com/zsmartsystems/zigbee/dongle/telegesis/internal/protocol/TelegesisFrame.java", "license": "epl-1.0", "size": 16206 }
[ "com.zsmartsystems.zigbee.IeeeAddress" ]
import com.zsmartsystems.zigbee.IeeeAddress;
import com.zsmartsystems.zigbee.*;
[ "com.zsmartsystems.zigbee" ]
com.zsmartsystems.zigbee;
233,975
public static String repeat(Character c, int repetitions) { if (repetitions==0) return ""; else if (repetitions==1) return c.toString(); char[] chars=new char[repetitions]; Arrays.fill(chars, c); return new String(chars); }
static String function(Character c, int repetitions) { if (repetitions==0) return ""; else if (repetitions==1) return c.toString(); char[] chars=new char[repetitions]; Arrays.fill(chars, c); return new String(chars); }
/** * Repeats a string a number of times * * @param c character * @param repetitions nr of repetitions * @return resulting string */
Repeats a string a number of times
repeat
{ "repo_name": "klehmann/domino-jna", "path": "domino-jna/src/main/java/com/mindoo/domino/jna/utils/StringUtil.java", "license": "apache-2.0", "size": 6246 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
812,572
public List<List<Integer>> getAlignRes();
List<List<Integer>> function();
/** * Returns the double List containing the aligned residues for each * structure. * <p> * alignRes.get(structure).get(residue) = alignRes.get(size).get(length). * * @return List a double List of aligned residues for each structure. * @see #setAlignRes() */
Returns the double List containing the aligned residues for each structure. alignRes.get(structure).get(residue) = alignRes.get(size).get(length)
getAlignRes
{ "repo_name": "heuermh/biojava", "path": "biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/Block.java", "license": "lgpl-2.1", "size": 4889 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
116,069
boolean isOwner( User user, int teiId, int programId );
boolean isOwner( User user, int teiId, int programId );
/** * Check whether the user is part of the owner org unit for the tracked * entity instance - program combination. * * @param user The user with which access has to be checked for. * @param teiId the tracked entity instance id * @param programId the program id * @return true if the user has access, false otherwise. */
Check whether the user is part of the owner org unit for the tracked entity instance - program combination
isOwner
{ "repo_name": "msf-oca-his/dhis-core", "path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackerOwnershipAccessManager.java", "license": "bsd-3-clause", "size": 10241 }
[ "org.hisp.dhis.user.User" ]
import org.hisp.dhis.user.User;
import org.hisp.dhis.user.*;
[ "org.hisp.dhis" ]
org.hisp.dhis;
1,591,671
private Node tryFoldAssignment(Node subtree) { Preconditions.checkState(subtree.isAssign()); Node left = subtree.getFirstChild(); Node right = subtree.getLastChild(); // Only names if (left.isName() && right.isName() && left.getString().equals(right.getString())) { subtree.getParent().replaceChild(subtree, right.detachFromParent()); reportCodeChange(); return right; } return subtree; }
Node function(Node subtree) { Preconditions.checkState(subtree.isAssign()); Node left = subtree.getFirstChild(); Node right = subtree.getLastChild(); if (left.isName() && right.isName() && left.getString().equals(right.getString())) { subtree.getParent().replaceChild(subtree, right.detachFromParent()); reportCodeChange(); return right; } return subtree; }
/** * Try removing identity assignments * @return the replacement node, if changed, or the original if not */
Try removing identity assignments
tryFoldAssignment
{ "repo_name": "wenzowski/closure-compiler", "path": "src/com/google/javascript/jscomp/PeepholeRemoveDeadCode.java", "license": "apache-2.0", "size": 31782 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
2,541,677
private CmsClientDateBean formatDate(long date, Locale locale) { return new CmsClientDateBean(date, formatDateTime(date)); }
CmsClientDateBean function(long date, Locale locale) { return new CmsClientDateBean(date, formatDateTime(date)); }
/** * Converts a date to a date bean.<p> * * @param date the date to convert * @param locale the locale to use for the conversion * * @return the date bean */
Converts a date to a date bean
formatDate
{ "repo_name": "victos/opencms-core", "path": "src/org/opencms/gwt/CmsVfsService.java", "license": "lgpl-2.1", "size": 81131 }
[ "java.util.Locale", "org.opencms.gwt.shared.CmsClientDateBean" ]
import java.util.Locale; import org.opencms.gwt.shared.CmsClientDateBean;
import java.util.*; import org.opencms.gwt.shared.*;
[ "java.util", "org.opencms.gwt" ]
java.util; org.opencms.gwt;
1,147,115
public ImmutableList<ConfigurationFragmentFactory> getConfigurationFragments() { return configurationFragmentFactories; }
ImmutableList<ConfigurationFragmentFactory> function() { return configurationFragmentFactories; }
/** * Returns the set of configuration fragments provided by this module. */
Returns the set of configuration fragments provided by this module
getConfigurationFragments
{ "repo_name": "akira-baruah/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java", "license": "apache-2.0", "size": 34995 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.analysis.config.ConfigurationFragmentFactory" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.analysis.config.ConfigurationFragmentFactory;
import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.config.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
228,541