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
private int readDeflated(byte[] buffer, int start, int length) throws IOException { int read = readFromInflater(buffer, start, length); if (read == 0) { if (inf.finished()) { return -1; } else if (inf.needsDictionary()) { throw new ZipException("This archive needs a preset dictionary" + " which is not supported by Commons" + " Compress."); } else if (buf.lengthOfLastRead == -1) { throw new IOException("Truncated ZIP file"); } } crc.update(buffer, start, read); return read; }
int function(byte[] buffer, int start, int length) throws IOException { int read = readFromInflater(buffer, start, length); if (read == 0) { if (inf.finished()) { return -1; } else if (inf.needsDictionary()) { throw new ZipException(STR + STR + STR); } else if (buf.lengthOfLastRead == -1) { throw new IOException(STR); } } crc.update(buffer, start, read); return read; }
/** * Implementation of read for DEFLATED entries. */
Implementation of read for DEFLATED entries
readDeflated
{ "repo_name": "wspeirs/sop4j-base", "path": "src/main/java/com/sop4j/base/apache/compress/archivers/zip/ZipArchiveInputStream.java", "license": "apache-2.0", "size": 37230 }
[ "java.io.IOException", "java.util.zip.ZipException" ]
import java.io.IOException; import java.util.zip.ZipException;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
682,882
public void testSetNullRecordedException() { PortalException pe = new PortalException("Dummy message"); pe.initCause(null); }
void function() { PortalException pe = new PortalException(STR); pe.initCause(null); }
/** * Test that calling the deprecated legacy method * setRecordedException(null) does not throw any exceptions. */
Test that calling the deprecated legacy method setRecordedException(null) does not throw any exceptions
testSetNullRecordedException
{ "repo_name": "apetro/uPortal", "path": "uportal-war/src/test/java/org/apereo/portal/PortalExceptionTest.java", "license": "apache-2.0", "size": 2302 }
[ "org.apereo.portal.PortalException" ]
import org.apereo.portal.PortalException;
import org.apereo.portal.*;
[ "org.apereo.portal" ]
org.apereo.portal;
904,231
public List<Long> df(org.apache.hadoop.thriftfs.api.RequestContext ctx) throws org.apache.thrift.TException;
List<Long> function(org.apache.hadoop.thriftfs.api.RequestContext ctx) throws org.apache.thrift.TException;
/** * Return a list containing: * (index 0) The total storage capacity of the file system (in bytes). * (index 1) The total used space of the file system (in bytes). * (index 2) The available storage of the file system (in bytes). * * @param ctx */
Return a list containing: (index 0) The total storage capacity of the file system (in bytes). (index 1) The total used space of the file system (in bytes). (index 2) The available storage of the file system (in bytes)
df
{ "repo_name": "vmanoria/bluemix-hue-filebrowser", "path": "hue-3.8.1-bluemix/desktop/libs/hadoop/java/src/main/gen-java/org/apache/hadoop/thriftfs/api/Namenode.java", "license": "gpl-2.0", "size": 798351 }
[ "java.util.List", "org.apache.thrift.TException" ]
import java.util.List; import org.apache.thrift.TException;
import java.util.*; import org.apache.thrift.*;
[ "java.util", "org.apache.thrift" ]
java.util; org.apache.thrift;
1,766,623
@Override public void onClick(View view) { if ( onMenu ) { closeMenu(); return; } Button b0 = (Button)view; if ( b0 == mImage ) { if ( mMenu.getVisibility() == View.VISIBLE ) { mMenu.setVisibility( View.GONE ); onMenu = false; } else { mMenu.setVisibility( View.VISIBLE ); onMenu = true; } return; } int k1 = 0; if ( k1 < mNrButton1 && b0 == mButton1[k1++] ) { // TDCONFIG (new TdmConfigDialog( this, this )).show(); // } else if ( k1 < mNrButton1 && b0 == mButton1[k1++] ) { // OPTIONS // Intent intent = new Intent( this, TdManagerPreferences.class ); // startActivity( intent ); // } else if ( k1 < mNrButton1 && b0 == mButton1[k1++] ) { // EXIT // finish(); } } // // @Override // public boolean onItemLongClick( AdapterView<?> parent, View view, int pos, long id ) // { // onItemClick( parent, view, pos, id ); // return true; // }
void function(View view) { if ( onMenu ) { closeMenu(); return; } Button b0 = (Button)view; if ( b0 == mImage ) { if ( mMenu.getVisibility() == View.VISIBLE ) { mMenu.setVisibility( View.GONE ); onMenu = false; } else { mMenu.setVisibility( View.VISIBLE ); onMenu = true; } return; } int k1 = 0; if ( k1 < mNrButton1 && b0 == mButton1[k1++] ) { (new TdmConfigDialog( this, this )).show(); } }
/** implements user taps * @param view tapped view */
implements user taps
onClick
{ "repo_name": "marcocorvi/topodroid", "path": "src/com/topodroid/tdm/TdManagerActivity.java", "license": "gpl-3.0", "size": 13452 }
[ "android.view.View", "android.widget.Button" ]
import android.view.View; import android.widget.Button;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
220,587
protected final IndexResponse index(String index, String type, String id, Map<String, Object> source) { return client().prepareIndex(index, type, id).setSource(source).execute().actionGet(); }
final IndexResponse function(String index, String type, String id, Map<String, Object> source) { return client().prepareIndex(index, type, id).setSource(source).execute().actionGet(); }
/** * Syntactic sugar for: * <pre> * client().prepareIndex(index, type).setSource(source).execute().actionGet(); * </pre> */
Syntactic sugar for: <code> client().prepareIndex(index, type).setSource(source).execute().actionGet(); </code>
index
{ "repo_name": "Ansh90/elasticsearch", "path": "core/src/test/java/org/elasticsearch/test/ESIntegTestCase.java", "license": "apache-2.0", "size": 97784 }
[ "java.util.Map", "org.elasticsearch.action.index.IndexResponse" ]
import java.util.Map; import org.elasticsearch.action.index.IndexResponse;
import java.util.*; import org.elasticsearch.action.index.*;
[ "java.util", "org.elasticsearch.action" ]
java.util; org.elasticsearch.action;
1,766,360
@Override public void setCreator(final String creator) { this.creator = Lists.create(creator); }
void function(final String creator) { this.creator = Lists.create(creator); }
/** * Sets the DublinCore module creator. Convenience method that can be used when there is only * one creator to set. * <p> * * @param creator the DublinCore module creator to set, <b>null</b> if none. * */
Sets the DublinCore module creator. Convenience method that can be used when there is only one creator to set.
setCreator
{ "repo_name": "bibliolabs/rome", "path": "rome/src/main/java/com/rometools/rome/feed/module/DCModuleImpl.java", "license": "apache-2.0", "size": 26632 }
[ "com.rometools.utils.Lists" ]
import com.rometools.utils.Lists;
import com.rometools.utils.*;
[ "com.rometools.utils" ]
com.rometools.utils;
280,069
public boolean sendSingle(String from, Collection<String> to, Collection<String> cc, Collection<String> bcc) { return sendSingle(from, to, cc, bcc, hasHtmlText()); }
boolean function(String from, Collection<String> to, Collection<String> cc, Collection<String> bcc) { return sendSingle(from, to, cc, bcc, hasHtmlText()); }
/** * Sends this email to the recipients specified. * If an HTML format has been included in the template, then a call * with the {@code html} parameter as {@code true} will attempt * to send the email as a multipart/alternative MIME type. * * @param from email sender * @param to email recipients * @param cc email recipients (CC) * @param bcc email recipients (BCC) * @return number of successful messages sent */
Sends this email to the recipients specified. If an HTML format has been included in the template, then a call with the html parameter as true will attempt to send the email as a multipart/alternative MIME type
sendSingle
{ "repo_name": "gforghetti/jenkins-tomcat-wildbook", "path": "src/main/java/org/ecocean/EmailTemplate.java", "license": "gpl-2.0", "size": 37236 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
43,978
public void show(User selectedAssignee) { if (collaborators == null) { load(selectedAssignee); return; } final ArrayList<User> users = new ArrayList<>( collaborators.values()); int checked = -1; if (selectedAssignee != null) for (int i = 0; i < users.size(); i++) if (selectedAssignee.getLogin().equals(users.get(i).getLogin())) checked = i; AssigneeDialogFragment.show(activity, requestCode, activity.getString(R.string.select_assignee), null, users, checked); }
void function(User selectedAssignee) { if (collaborators == null) { load(selectedAssignee); return; } final ArrayList<User> users = new ArrayList<>( collaborators.values()); int checked = -1; if (selectedAssignee != null) for (int i = 0; i < users.size(); i++) if (selectedAssignee.getLogin().equals(users.get(i).getLogin())) checked = i; AssigneeDialogFragment.show(activity, requestCode, activity.getString(R.string.select_assignee), null, users, checked); }
/** * Show dialog with given assignee selected * * @param selectedAssignee */
Show dialog with given assignee selected
show
{ "repo_name": "esironal/PocketHub", "path": "app/src/main/java/com/github/pockethub/ui/issue/AssigneeDialog.java", "license": "apache-2.0", "size": 4131 }
[ "java.util.ArrayList", "org.eclipse.egit.github.core.User" ]
import java.util.ArrayList; import org.eclipse.egit.github.core.User;
import java.util.*; import org.eclipse.egit.github.core.*;
[ "java.util", "org.eclipse.egit" ]
java.util; org.eclipse.egit;
1,199,666
public WebAppStackCollection withValue(List<WebAppStackInner> value) { this.value = value; return this; }
WebAppStackCollection function(List<WebAppStackInner> value) { this.value = value; return this; }
/** * Set the value property: Collection of resources. * * @param value the value value to set. * @return the WebAppStackCollection object itself. */
Set the value property: Collection of resources
withValue
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppStackCollection.java", "license": "mit", "size": 2145 }
[ "com.azure.resourcemanager.appservice.fluent.models.WebAppStackInner", "java.util.List" ]
import com.azure.resourcemanager.appservice.fluent.models.WebAppStackInner; import java.util.List;
import com.azure.resourcemanager.appservice.fluent.models.*; import java.util.*;
[ "com.azure.resourcemanager", "java.util" ]
com.azure.resourcemanager; java.util;
672,747
public String getShortName(OWLEntity e) { return pm.getShortForm(e); }
String function(OWLEntity e) { return pm.getShortForm(e); }
/** * Gets the short name (without namespaces) of an OWL 2 entity. * @param e An OWL 2 entity. * @return Short name of e. */
Gets the short name (without namespaces) of an OWL 2 entity
getShortName
{ "repo_name": "eschwert/DL-Learner", "path": "components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2.java", "license": "gpl-3.0", "size": 63381 }
[ "org.semanticweb.owlapi.model.OWLEntity" ]
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.*;
[ "org.semanticweb.owlapi" ]
org.semanticweb.owlapi;
545,922
public @Nonnull Iterable<NetworkInterface> listNetworkInterfacesInVLAN(@Nonnull String vlanId) throws CloudException, InternalException;
@Nonnull Iterable<NetworkInterface> function(@Nonnull String vlanId) throws CloudException, InternalException;
/** * Lists all network interfaces connected to a specific VLAN. Valid only if the cloud provider supports VLANs. * @param vlanId the VLAN ID for the VLAN in which you are searching * @return all interfaces within the specified VLAN * @throws CloudException an error occurred in the cloud identifying the matching network interfaces * @throws InternalException a local error occurred constructing the cloud query */
Lists all network interfaces connected to a specific VLAN. Valid only if the cloud provider supports VLANs
listNetworkInterfacesInVLAN
{ "repo_name": "maksimov/dasein-cloud-core", "path": "src/main/java/org/dasein/cloud/network/VLANSupport.java", "license": "apache-2.0", "size": 44522 }
[ "javax.annotation.Nonnull", "org.dasein.cloud.CloudException", "org.dasein.cloud.InternalException" ]
import javax.annotation.Nonnull; import org.dasein.cloud.CloudException; import org.dasein.cloud.InternalException;
import javax.annotation.*; import org.dasein.cloud.*;
[ "javax.annotation", "org.dasein.cloud" ]
javax.annotation; org.dasein.cloud;
1,575,154
public static void toStreamEscaped(Writer out, Reader in) throws IOException { if (in == null) return; int ch; while ((ch = in.read()) >= 0) { switch (ch) { case '<': out.write("&lt;"); break; case '>': out.write("&gt;"); break; case '&': out.write("&amp;"); break; case '\'': out.write("&#039;"); break; case '"': out.write("&#034;"); break; default: out.write((char) ch); break; } } }
static void function(Writer out, Reader in) throws IOException { if (in == null) return; int ch; while ((ch = in.read()) >= 0) { switch (ch) { case '<': out.write("&lt;"); break; case '>': out.write("&gt;"); break; case '&': out.write("&amp;"); break; case '\'': out.write(STR); break; case 'STR&#034;"); break; default: out.write((char) ch); break; } } }
/** * Write to the stream escaping XML reserved characters. * * @param out the output stream. * @param in the value to be converted. */
Write to the stream escaping XML reserved characters
toStreamEscaped
{ "repo_name": "CleverCloud/Quercus", "path": "resin/src/main/java/com/caucho/el/Expr.java", "license": "gpl-2.0", "size": 34046 }
[ "java.io.IOException", "java.io.Reader", "java.io.Writer" ]
import java.io.IOException; import java.io.Reader; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
1,958,211
public void testCaseInsensitiveMatching() { DirectFeed feed = new DirectFeed(); feed.setBaseTitle("The Title"); StandardArticle article = new StandardArticle(""); article.setTitle("some article"); feed.appendArticle(article); assertTrue(FeedTitleProperty.INSTANCE.match(article, StringContainsCO.INSTANCE, "title")); }
void function() { DirectFeed feed = new DirectFeed(); feed.setBaseTitle(STR); StandardArticle article = new StandardArticle(STRsome articleSTRtitle")); }
/** * Tests case-insensitive matching of titles. */
Tests case-insensitive matching of titles
testCaseInsensitiveMatching
{ "repo_name": "pitosalas/blogbridge", "path": "test/com/salas/bb/domain/query/articles/TestFeedTitleProperty.java", "license": "gpl-2.0", "size": 1935 }
[ "com.salas.bb.domain.DirectFeed", "com.salas.bb.domain.StandardArticle" ]
import com.salas.bb.domain.DirectFeed; import com.salas.bb.domain.StandardArticle;
import com.salas.bb.domain.*;
[ "com.salas.bb" ]
com.salas.bb;
2,543,122
List<Asset> getPostExportDefineTimeDependentAssets(BundlableNode bundlableNode) throws ModelOperationException;
List<Asset> getPostExportDefineTimeDependentAssets(BundlableNode bundlableNode) throws ModelOperationException;
/** * Returns the list of dependencies that happen to be required at define-time, but which are not needed for the * source-module to actually define itself. * * @param bundlableNode The bundlable node for which a bundle-set is being generated. * @return The list of dependent assets * @throws ModelOperationException for any exception when calculating dependencies and resolving require paths */
Returns the list of dependencies that happen to be required at define-time, but which are not needed for the source-module to actually define itself
getPostExportDefineTimeDependentAssets
{ "repo_name": "janhancic/brjs", "path": "brjs-core/src/main/java/org/bladerunnerjs/api/SourceModule.java", "license": "lgpl-3.0", "size": 1808 }
[ "java.util.List", "org.bladerunnerjs.api.model.exception.ModelOperationException" ]
import java.util.List; import org.bladerunnerjs.api.model.exception.ModelOperationException;
import java.util.*; import org.bladerunnerjs.api.model.exception.*;
[ "java.util", "org.bladerunnerjs.api" ]
java.util; org.bladerunnerjs.api;
1,870,790
public void setLogDir(File logDir) { this.logDir = logDir; }
void function(File logDir) { this.logDir = logDir; }
/** * Set the logs directory. * * @param logDir - Log directory. */
Set the logs directory
setLogDir
{ "repo_name": "genehallman/node-berkeleydb", "path": "deps/db-18.1.40/util/db_gui/envpage/EnvConfig.java", "license": "mit", "size": 2973 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
366,331
public static void setStatus(Status status, VToDo vtodo) { Status currStatus = vtodo.getStatus(); if (currStatus != null) { vtodo.getProperties().remove(currStatus); } if (status != null) { vtodo.getProperties().add(status); } }
static void function(Status status, VToDo vtodo) { Status currStatus = vtodo.getStatus(); if (currStatus != null) { vtodo.getProperties().remove(currStatus); } if (status != null) { vtodo.getProperties().add(status); } }
/** * Update the STATUS property on a VTODO component. * * @param status * status to set. If null, the STATUS property will be removed * @param vtodo * vtodo component to update */
Update the STATUS property on a VTODO component
setStatus
{ "repo_name": "1and1/cosmo", "path": "cosmo-core/src/main/java/org/unitedinternet/cosmo/calendar/ICalendarUtils.java", "license": "apache-2.0", "size": 23897 }
[ "net.fortuna.ical4j.model.component.VToDo", "net.fortuna.ical4j.model.property.Status" ]
import net.fortuna.ical4j.model.component.VToDo; import net.fortuna.ical4j.model.property.Status;
import net.fortuna.ical4j.model.component.*; import net.fortuna.ical4j.model.property.*;
[ "net.fortuna.ical4j" ]
net.fortuna.ical4j;
1,586,405
@Test public void delimiter() throws Exception { testInfo(this.getClass().getSimpleName() + " - delimiter"); try { int prefixes = 3 + random.nextInt(3); // 3-5 prefixes int keys = 2 + random.nextInt(3); // 2-5 keys int uploads = 2 + random.nextInt(3); // 2-4 uploads String delimiter = "/"; // Pick a random delimiter afterwards TreeMap<String, TreeMap<String, List<String>>> prefixKeyVersionMap = new TreeMap<String, TreeMap<String, List<String>>>(); VersionListing versions = null; print("Number of prefixes: " + prefixes); print("Number of keys per prefix: " + keys); print("Number of uploads per key: " + uploads); for (int i = 0; i < prefixes; i++) { String prefix = VALID_CHARS.charAt(random.nextInt(VALID_CHARS.length())) + eucaUUID() + delimiter; print("Prefix name: " + prefix); TreeMap<String, List<String>> keyVersionMap = new TreeMap<String, List<String>>(); // Upload object multiple times using the key for (int j = 0; j < keys; j++) { String key = prefix + VALID_CHARS.charAt(random.nextInt(VALID_CHARS.length())) + eucaUUID(); // Prefix it with any character in LinkedList<String> partialVersionIdList = new LinkedList<String>(); print("Key name: " + key); for (int k = 0; k < uploads; k++) { putObject(bucketName, key, fileToPut, partialVersionIdList); } // Verify the linked list size assertTrue( "Expected version ID list size to be same as the number of uploads which is " + uploads + ", but got " + partialVersionIdList.size(), partialVersionIdList.size() == uploads); // List the object versions and verify them against the put object results versions = listVersions(s3, account, bucketName, key, null, null, null, null, false); verifyVersionSummaries(key, partialVersionIdList, versions.getVersionSummaries()); // Reverse the version ID list and add it to the map Collections.reverse(partialVersionIdList); // Put the key name and version ID list in the map. The map should order the keys in lexicographic order keyVersionMap.put(key, partialVersionIdList); } prefixKeyVersionMap.put(prefix, keyVersionMap); } versions = listVersions(s3, account, bucketName, null, null, null, delimiter, null, false); assertTrue("Expected to not get any version summaries but got a list of size " + versions.getVersionSummaries().size(), versions .getVersionSummaries().size() == 0); assertTrue("Expected common prefixes list to be of size " + prefixKeyVersionMap.size() + ", but got a list of size " + versions.getCommonPrefixes().size(), versions.getCommonPrefixes().size() == prefixKeyVersionMap.size()); for (String prefix : prefixKeyVersionMap.keySet()) { assertTrue("Expected common prefix list to contain " + prefix, versions.getCommonPrefixes().contains(prefix)); } } catch (AmazonServiceException ase) { printException(ase); assertThat(false, "Failed to run delimiter"); } }
void function() throws Exception { testInfo(this.getClass().getSimpleName() + STR); try { int prefixes = 3 + random.nextInt(3); int keys = 2 + random.nextInt(3); int uploads = 2 + random.nextInt(3); String delimiter = "/"; TreeMap<String, TreeMap<String, List<String>>> prefixKeyVersionMap = new TreeMap<String, TreeMap<String, List<String>>>(); VersionListing versions = null; print(STR + prefixes); print(STR + keys); print(STR + uploads); for (int i = 0; i < prefixes; i++) { String prefix = VALID_CHARS.charAt(random.nextInt(VALID_CHARS.length())) + eucaUUID() + delimiter; print(STR + prefix); TreeMap<String, List<String>> keyVersionMap = new TreeMap<String, List<String>>(); for (int j = 0; j < keys; j++) { String key = prefix + VALID_CHARS.charAt(random.nextInt(VALID_CHARS.length())) + eucaUUID(); LinkedList<String> partialVersionIdList = new LinkedList<String>(); print(STR + key); for (int k = 0; k < uploads; k++) { putObject(bucketName, key, fileToPut, partialVersionIdList); } assertTrue( STR + uploads + STR + partialVersionIdList.size(), partialVersionIdList.size() == uploads); versions = listVersions(s3, account, bucketName, key, null, null, null, null, false); verifyVersionSummaries(key, partialVersionIdList, versions.getVersionSummaries()); Collections.reverse(partialVersionIdList); keyVersionMap.put(key, partialVersionIdList); } prefixKeyVersionMap.put(prefix, keyVersionMap); } versions = listVersions(s3, account, bucketName, null, null, null, delimiter, null, false); assertTrue(STR + versions.getVersionSummaries().size(), versions .getVersionSummaries().size() == 0); assertTrue(STR + prefixKeyVersionMap.size() + STR + versions.getCommonPrefixes().size(), versions.getCommonPrefixes().size() == prefixKeyVersionMap.size()); for (String prefix : prefixKeyVersionMap.keySet()) { assertTrue(STR + prefix, versions.getCommonPrefixes().contains(prefix)); } } catch (AmazonServiceException ase) { printException(ase); assertThat(false, STR); } }
/** * Test for verifying common prefixes using a delimiter */
Test for verifying common prefixes using a delimiter
delimiter
{ "repo_name": "sjones4/eutester", "path": "eutester4j/com/eucalyptus/tests/awssdk/S3ListVersionsTests.java", "license": "bsd-2-clause", "size": 87846 }
[ "com.amazonaws.AmazonServiceException", "com.amazonaws.services.s3.model.VersionListing", "com.eucalyptus.tests.awssdk.Eutester4j", "java.util.Collections", "java.util.LinkedList", "java.util.List", "java.util.TreeMap", "org.testng.AssertJUnit" ]
import com.amazonaws.AmazonServiceException; import com.amazonaws.services.s3.model.VersionListing; import com.eucalyptus.tests.awssdk.Eutester4j; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.TreeMap; import org.testng.AssertJUnit;
import com.amazonaws.*; import com.amazonaws.services.s3.model.*; import com.eucalyptus.tests.awssdk.*; import java.util.*; import org.testng.*;
[ "com.amazonaws", "com.amazonaws.services", "com.eucalyptus.tests", "java.util", "org.testng" ]
com.amazonaws; com.amazonaws.services; com.eucalyptus.tests; java.util; org.testng;
1,703,012
public final void setSecurityName(OctetString securityName) { this.securityName = securityName; }
final void function(OctetString securityName) { this.securityName = securityName; }
/** * Sets the security name to be used with this target. * @param securityName * an <code>OctetString</code> instance (must not be <code>null</code>). * @see #getSecurityName() */
Sets the security name to be used with this target
setSecurityName
{ "repo_name": "LoloCDF/Zinlok", "path": "libs/snmp4j-2.4.3/src/main/java/org/snmp4j/AbstractTarget.java", "license": "gpl-3.0", "size": 9271 }
[ "org.snmp4j.smi.OctetString" ]
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.*;
[ "org.snmp4j.smi" ]
org.snmp4j.smi;
2,588,950
public void configureHTTPPipeline(SocketChannel ch, ListenerConfiguration listenerConfiguration) { ChannelPipeline p = ch.pipeline(); // Removed the default encoder since http/2 version upgrade already added to pipeline if (RequestSizeValidationConfiguration.getInstance().isHeaderSizeValidation()) { p.addLast("decoder", new CustomHttpRequestDecoder()); } else { p.addLast("decoder", new HttpRequestDecoder()); } if (RequestSizeValidationConfiguration.getInstance().isRequestSizeValidation()) { p.addLast("custom-aggregator", new CustomHttpObjectAggregator()); } p.addLast("compressor", new HttpContentCompressor()); p.addLast("chunkWriter", new ChunkedWriteHandler()); try { p.addLast("handler", new SourceHandler(connectionManager, listenerConfiguration)); } catch (Exception e) { log.error("Cannot Create SourceHandler ", e); } }
void function(SocketChannel ch, ListenerConfiguration listenerConfiguration) { ChannelPipeline p = ch.pipeline(); if (RequestSizeValidationConfiguration.getInstance().isHeaderSizeValidation()) { p.addLast(STR, new CustomHttpRequestDecoder()); } else { p.addLast(STR, new HttpRequestDecoder()); } if (RequestSizeValidationConfiguration.getInstance().isRequestSizeValidation()) { p.addLast(STR, new CustomHttpObjectAggregator()); } p.addLast(STR, new HttpContentCompressor()); p.addLast(STR, new ChunkedWriteHandler()); try { p.addLast(STR, new SourceHandler(connectionManager, listenerConfiguration)); } catch (Exception e) { log.error(STR, e); } }
/** * Configure the pipeline if user sent HTTP requests * * @param ch Channel * @param listenerConfiguration Listener Configuration */
Configure the pipeline if user sent HTTP requests
configureHTTPPipeline
{ "repo_name": "thusithathilina/carbon-transports", "path": "http/org.wso2.carbon.transport.http.netty/src/main/java/org/wso2/carbon/transport/http/netty/listener/HTTPServerChannelInitializer.java", "license": "apache-2.0", "size": 8593 }
[ "io.netty.channel.ChannelPipeline", "io.netty.channel.socket.SocketChannel", "io.netty.handler.codec.http.HttpContentCompressor", "io.netty.handler.codec.http.HttpRequestDecoder", "io.netty.handler.stream.ChunkedWriteHandler", "org.wso2.carbon.transport.http.netty.config.ListenerConfiguration", "org.wso2.carbon.transport.http.netty.config.RequestSizeValidationConfiguration" ]
import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; import io.netty.handler.codec.http.HttpContentCompressor; import io.netty.handler.codec.http.HttpRequestDecoder; import io.netty.handler.stream.ChunkedWriteHandler; import org.wso2.carbon.transport.http.netty.config.ListenerConfiguration; import org.wso2.carbon.transport.http.netty.config.RequestSizeValidationConfiguration;
import io.netty.channel.*; import io.netty.channel.socket.*; import io.netty.handler.codec.http.*; import io.netty.handler.stream.*; import org.wso2.carbon.transport.http.netty.config.*;
[ "io.netty.channel", "io.netty.handler", "org.wso2.carbon" ]
io.netty.channel; io.netty.handler; org.wso2.carbon;
2,717,893
public final MockResultSet aSimpleMultiColResult(final Integer index) { if (index == null) { return null; } int rsid = index.intValue(); switch(rsid) { case 0: return MockResultSetUtils.buildZerothResultSet(1); case 1: MockResultSet mrs = new MockResultSet("aSimpleMultiColResult:1"); mrs.setResultSetMetaData(MockResultSetUtils.buildMetaData( new ColumnMetaData[] { new ColumnMetaData("col1", Types.INTEGER), new ColumnMetaData("col2", Types.VARCHAR), new ColumnMetaData("col3", Types.INTEGER)})); mrs.addRow(new Object[] {new Integer(1), new String("Larry"), new Integer(31)}); mrs.addRow(new Object[] {new Integer(2), new String("Curly"), new Integer(32)}); LOG.debug("aSimpleMultiColResult:1:" + mrs.toString()); return mrs; default: return null; } }
final MockResultSet function(final Integer index) { if (index == null) { return null; } int rsid = index.intValue(); switch(rsid) { case 0: return MockResultSetUtils.buildZerothResultSet(1); case 1: MockResultSet mrs = new MockResultSet(STR); mrs.setResultSetMetaData(MockResultSetUtils.buildMetaData( new ColumnMetaData[] { new ColumnMetaData("col1", Types.INTEGER), new ColumnMetaData("col2", Types.VARCHAR), new ColumnMetaData("col3", Types.INTEGER)})); mrs.addRow(new Object[] {new Integer(1), new String("Larry"), new Integer(31)}); mrs.addRow(new Object[] {new Integer(2), new String("Curly"), new Integer(32)}); LOG.debug(STR + mrs.toString()); return mrs; default: return null; } }
/** * Returns a single resultset with multiple columns in each row. This * is used to test the functionality of the assert-resultset-equals * assertion. * @param index the result set id. * @return a single MockResult with two rows and three columns. */
Returns a single resultset with multiple columns in each row. This is used to test the functionality of the assert-resultset-equals assertion
aSimpleMultiColResult
{ "repo_name": "ecalo/SQLUnit-5.0-Fork", "path": "test/java/mock/SQLUnitMockDatabase.java", "license": "gpl-3.0", "size": 45758 }
[ "com.mockrunner.mock.jdbc.MockResultSet", "java.sql.Types" ]
import com.mockrunner.mock.jdbc.MockResultSet; import java.sql.Types;
import com.mockrunner.mock.jdbc.*; import java.sql.*;
[ "com.mockrunner.mock", "java.sql" ]
com.mockrunner.mock; java.sql;
210,812
public Contentlet checkin(Contentlet contentlet, Map<Relationship, List<Contentlet>> contentRelationships, List<Category> cats ,List<Permission> permissions, User user,boolean respectFrontendRoles) throws IllegalArgumentException,DotDataException,DotSecurityException, DotContentletStateException, DotContentletValidationException;
Contentlet function(Contentlet contentlet, Map<Relationship, List<Contentlet>> contentRelationships, List<Category> cats ,List<Permission> permissions, User user,boolean respectFrontendRoles) throws IllegalArgumentException,DotDataException,DotSecurityException, DotContentletStateException, DotContentletValidationException;
/** * Will check in a new version of you contentlet. The inode of your contentlet must be 0. * Note that the contentlet argument must be obtained using checkout methods. * @param contentlet - The inode of your contentlet must be 0. * @param contentRelationships - throws IllegalArgumentException if null. Used to set relationships to new contentlet version * @param cats - throws IllegalArgumentException if null. Used to set categories to new contentlet version * @param permissions - throws IllegalArgumentException if null. Used to set permissions to new contentlet version * @param user * @param respectFrontendRoles * @throws IllegalArgumentException * @throws DotDataException * @throws DotSecurityException * @throws DotContentletStateException If inode not = to 0 * @throws DotContentletValidationException If content is not valid */
Will check in a new version of you contentlet. The inode of your contentlet must be 0. Note that the contentlet argument must be obtained using checkout methods
checkin
{ "repo_name": "zhiqinghuang/core", "path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPI.java", "license": "gpl-3.0", "size": 64036 }
[ "com.dotmarketing.beans.Permission", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.dotmarketing.portlets.categories.model.Category", "com.dotmarketing.portlets.contentlet.model.Contentlet", "com.dotmarketing.portlets.structure.model.Relationship", "com.liferay.portal.model.User", "java.util.List", "java.util.Map" ]
import com.dotmarketing.beans.Permission; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.categories.model.Category; import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.dotmarketing.portlets.structure.model.Relationship; import com.liferay.portal.model.User; import java.util.List; import java.util.Map;
import com.dotmarketing.beans.*; import com.dotmarketing.exception.*; import com.dotmarketing.portlets.categories.model.*; import com.dotmarketing.portlets.contentlet.model.*; import com.dotmarketing.portlets.structure.model.*; import com.liferay.portal.model.*; import java.util.*;
[ "com.dotmarketing.beans", "com.dotmarketing.exception", "com.dotmarketing.portlets", "com.liferay.portal", "java.util" ]
com.dotmarketing.beans; com.dotmarketing.exception; com.dotmarketing.portlets; com.liferay.portal; java.util;
1,733,290
// methods ===================================================================== public void execute() throws SQLException { Connection con = null; boolean autoCommit = true; if (getUuids().length > 0) { // intitalize PreparedStatement stJobsDelete = null; PreparedStatement stCompletedJobsDelete = null; PreparedStatement stHistoryDelete = null; ImsMetadataAdminDao adminDao = new ImsMetadataAdminDao(getRequestContext()); try { StringBuffer sbJobsDeleteSql = new StringBuffer(); StringBuffer sbCompletedJobsDeleteSql = new StringBuffer(); StringBuffer sbHistoryDeleteSql = new StringBuffer(); StringBuilder sbUuids = new StringBuilder(); for (String uuid: getUuids()) { if (sbUuids.length() > 0) { sbUuids.append(","); } sbUuids.append("'" + uuid + "'"); } sbJobsDeleteSql.append("delete from " + getHarvestingJobTableName() + " "); sbJobsDeleteSql.append("where HARVEST_ID = ?"); sbCompletedJobsDeleteSql.append("delete from " + getHarvestingJobsCompletedTableName() + " "); sbCompletedJobsDeleteSql.append("where HARVEST_ID = ?"); sbHistoryDeleteSql.append("delete from " + getHarvestingHistoryTableName() + " "); sbHistoryDeleteSql.append("where HARVEST_ID = ?"); // establish the connection ManagedConnection mc = returnConnection(); con = mc.getJdbcConnection(); autoCommit = con.getAutoCommit(); con.setAutoCommit(false); stJobsDelete = con.prepareStatement(sbJobsDeleteSql.toString()); stCompletedJobsDelete = con.prepareStatement(sbCompletedJobsDeleteSql. toString()); stHistoryDelete = con.prepareStatement(sbHistoryDeleteSql.toString()); PreparedStatement[] stmts = new PreparedStatement[]{ stJobsDelete, stCompletedJobsDelete, stHistoryDelete, }; logExpression(stJobsDelete.toString()); logExpression(stCompletedJobsDelete.toString()); logExpression(stHistoryDelete.toString()); int nRowCount = 0; for (String uuid: getUuids()) { nRowCount += executeForOne(adminDao, stmts, uuid); } getActionResult().setNumberOfRecordsModified(nRowCount); con.commit(); } catch (SQLException ex) { if (con!=null) { con.rollback(); } throw ex; } catch (Exception ex) { if (con!=null) { con.rollback(); } throw new SQLException("Error deleting record."); } finally { closeStatement(stJobsDelete); closeStatement(stHistoryDelete); closeStatement(stCompletedJobsDelete); if (con!=null) { con.setAutoCommit(autoCommit); } } } }
void function() throws SQLException { Connection con = null; boolean autoCommit = true; if (getUuids().length > 0) { PreparedStatement stJobsDelete = null; PreparedStatement stCompletedJobsDelete = null; PreparedStatement stHistoryDelete = null; ImsMetadataAdminDao adminDao = new ImsMetadataAdminDao(getRequestContext()); try { StringBuffer sbJobsDeleteSql = new StringBuffer(); StringBuffer sbCompletedJobsDeleteSql = new StringBuffer(); StringBuffer sbHistoryDeleteSql = new StringBuffer(); StringBuilder sbUuids = new StringBuilder(); for (String uuid: getUuids()) { if (sbUuids.length() > 0) { sbUuids.append(","); } sbUuids.append("'" + uuid + "'"); } sbJobsDeleteSql.append(STR + getHarvestingJobTableName() + " "); sbJobsDeleteSql.append(STR); sbCompletedJobsDeleteSql.append(STR + getHarvestingJobsCompletedTableName() + " "); sbCompletedJobsDeleteSql.append(STR); sbHistoryDeleteSql.append(STR + getHarvestingHistoryTableName() + " "); sbHistoryDeleteSql.append(STR); ManagedConnection mc = returnConnection(); con = mc.getJdbcConnection(); autoCommit = con.getAutoCommit(); con.setAutoCommit(false); stJobsDelete = con.prepareStatement(sbJobsDeleteSql.toString()); stCompletedJobsDelete = con.prepareStatement(sbCompletedJobsDeleteSql. toString()); stHistoryDelete = con.prepareStatement(sbHistoryDeleteSql.toString()); PreparedStatement[] stmts = new PreparedStatement[]{ stJobsDelete, stCompletedJobsDelete, stHistoryDelete, }; logExpression(stJobsDelete.toString()); logExpression(stCompletedJobsDelete.toString()); logExpression(stHistoryDelete.toString()); int nRowCount = 0; for (String uuid: getUuids()) { nRowCount += executeForOne(adminDao, stmts, uuid); } getActionResult().setNumberOfRecordsModified(nRowCount); con.commit(); } catch (SQLException ex) { if (con!=null) { con.rollback(); } throw ex; } catch (Exception ex) { if (con!=null) { con.rollback(); } throw new SQLException(STR); } finally { closeStatement(stJobsDelete); closeStatement(stHistoryDelete); closeStatement(stCompletedJobsDelete); if (con!=null) { con.setAutoCommit(autoCommit); } } } }
/** * Executes request. * @throws java.sql.SQLException if request execution fails */
Executes request
execute
{ "repo_name": "usgin/usgin-geoportal", "path": "src/com/esri/gpt/catalog/harvest/repository/HrDeleteRequest.java", "license": "apache-2.0", "size": 6752 }
[ "com.esri.gpt.catalog.arcims.ImsMetadataAdminDao", "com.esri.gpt.framework.sql.ManagedConnection", "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException" ]
import com.esri.gpt.catalog.arcims.ImsMetadataAdminDao; import com.esri.gpt.framework.sql.ManagedConnection; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException;
import com.esri.gpt.catalog.arcims.*; import com.esri.gpt.framework.sql.*; import java.sql.*;
[ "com.esri.gpt", "java.sql" ]
com.esri.gpt; java.sql;
1,738,986
public GVTGlyphVector createGlyphVector(FontRenderContext frc, char[] chars) { StringCharacterIterator sci = new StringCharacterIterator(new String(chars)); return createGlyphVector(frc, sci); }
GVTGlyphVector function(FontRenderContext frc, char[] chars) { StringCharacterIterator sci = new StringCharacterIterator(new String(chars)); return createGlyphVector(frc, sci); }
/** * Returns a new GVTGlyphVector object for the specified array of * characters. * * @param frc The current font render context. * @param chars The array of chars that the glyph vector will represent. * * @return The new glyph vector. */
Returns a new GVTGlyphVector object for the specified array of characters
createGlyphVector
{ "repo_name": "Squeegee/batik", "path": "sources/org/apache/batik/bridge/SVGGVTFont.java", "license": "apache-2.0", "size": 32318 }
[ "java.awt.font.FontRenderContext", "java.text.StringCharacterIterator", "org.apache.batik.gvt.font.GVTGlyphVector" ]
import java.awt.font.FontRenderContext; import java.text.StringCharacterIterator; import org.apache.batik.gvt.font.GVTGlyphVector;
import java.awt.font.*; import java.text.*; import org.apache.batik.gvt.font.*;
[ "java.awt", "java.text", "org.apache.batik" ]
java.awt; java.text; org.apache.batik;
1,870,361
XPropertySet createGridColumn( Object aGridModel, String sColumnService, String sDataField, int nWidth ) throws com.sun.star.uno.Exception { // the container to insert columns into XIndexContainer xColumnContainer = UNO.queryIndexContainer( aGridModel ); // the factory for creating column models XGridColumnFactory xColumnFactory = UnoRuntime.queryInterface( XGridColumnFactory.class, aGridModel ); // (let) create the new col XInterface xNewCol = xColumnFactory.createColumn( sColumnService ); XPropertySet xColProps = UNO.queryPropertySet( xNewCol ); // some props // the field the column is bound to xColProps.setPropertyValue( "DataField", sDataField ); // the "display name" of the column xColProps.setPropertyValue( "Label", sDataField ); // the name of the column within its parent xColProps.setPropertyValue( "Name", sDataField ); if ( nWidth > 0 ) xColProps.setPropertyValue( "Width", Integer.valueOf( nWidth * 10 ) ); // insert xColumnContainer.insertByIndex( xColumnContainer.getCount(), xNewCol ); // outta here return xColProps; }
XPropertySet createGridColumn( Object aGridModel, String sColumnService, String sDataField, int nWidth ) throws com.sun.star.uno.Exception { XIndexContainer xColumnContainer = UNO.queryIndexContainer( aGridModel ); XGridColumnFactory xColumnFactory = UnoRuntime.queryInterface( XGridColumnFactory.class, aGridModel ); XInterface xNewCol = xColumnFactory.createColumn( sColumnService ); XPropertySet xColProps = UNO.queryPropertySet( xNewCol ); xColProps.setPropertyValue( STR, sDataField ); xColProps.setPropertyValue( "Label", sDataField ); xColProps.setPropertyValue( "Name", sDataField ); if ( nWidth > 0 ) xColProps.setPropertyValue( "Width", Integer.valueOf( nWidth * 10 ) ); xColumnContainer.insertByIndex( xColumnContainer.getCount(), xNewCol ); return xColProps; }
/** creates a column in a grid @param xGridModel specifies the model of the grid where the new column should be inserted @param sColumnService specifies the service name of the column to create (e.g. "NumericField") @param sDataField specifies the database field to which the column should be bound @param nWidth specifies the column width (in mm). If 0, no width is set. @return the newly created column */
creates a column in a grid
createGridColumn
{ "repo_name": "beppec56/core", "path": "odk/examples/DevelopersGuide/Forms/DataAwareness.java", "license": "gpl-3.0", "size": 41279 }
[ "com.sun.star.beans.XPropertySet", "com.sun.star.container.XIndexContainer", "com.sun.star.form.XGridColumnFactory", "com.sun.star.uno.UnoRuntime", "com.sun.star.uno.XInterface" ]
import com.sun.star.beans.XPropertySet; import com.sun.star.container.XIndexContainer; import com.sun.star.form.XGridColumnFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface;
import com.sun.star.beans.*; import com.sun.star.container.*; import com.sun.star.form.*; import com.sun.star.uno.*;
[ "com.sun.star" ]
com.sun.star;
2,498,168
public Array<Entity> GetEntities() { _entities.clear(); for (Actor a : _stage.getActors()) { if (!(a instanceof Entity)) continue; _entities.add((Entity) a); } return _entities; }
Array<Entity> function() { _entities.clear(); for (Actor a : _stage.getActors()) { if (!(a instanceof Entity)) continue; _entities.add((Entity) a); } return _entities; }
/** * Gets the entities. * * @return the array */
Gets the entities
GetEntities
{ "repo_name": "DDuarte/feup-lpoo-maze_and_bombermen", "path": "bombermen2/bombermen/src/pt/up/fe/lpoo/bombermen/Game.java", "license": "mit", "size": 9877 }
[ "com.badlogic.gdx.scenes.scene2d.Actor", "com.badlogic.gdx.utils.Array" ]
import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.scenes.scene2d.*; import com.badlogic.gdx.utils.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
1,672,302
public Set<Property> getAllValuesOfprop(final SignalPropertyMultipleMatch partialMatch) { return rawAccumulateAllValuesOfprop(partialMatch.toArray()); }
Set<Property> function(final SignalPropertyMultipleMatch partialMatch) { return rawAccumulateAllValuesOfprop(partialMatch.toArray()); }
/** * Retrieve the set of values that occur in matches for prop. * @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches * */
Retrieve the set of values that occur in matches for prop
getAllValuesOfprop
{ "repo_name": "ELTE-Soft/xUML-RT-Executor", "path": "plugins/hu.eltesoft.modelexecution.validation/src-gen/hu/eltesoft/modelexecution/validation/SignalPropertyMultipleMatcher.java", "license": "epl-1.0", "size": 13700 }
[ "hu.eltesoft.modelexecution.validation.SignalPropertyMultipleMatch", "java.util.Set", "org.eclipse.uml2.uml.Property" ]
import hu.eltesoft.modelexecution.validation.SignalPropertyMultipleMatch; import java.util.Set; import org.eclipse.uml2.uml.Property;
import hu.eltesoft.modelexecution.validation.*; import java.util.*; import org.eclipse.uml2.uml.*;
[ "hu.eltesoft.modelexecution", "java.util", "org.eclipse.uml2" ]
hu.eltesoft.modelexecution; java.util; org.eclipse.uml2;
2,237,986
private HashMap<String, String> parseServerResponse(final String response) { HashMap<String, String> map = new HashMap<String, String>(); String[] pairs = response.split(","); for (String pair : pairs) { String[] parts = pair.split("=", 2); map.put(parts[0], parts[1]); } return map; }
HashMap<String, String> function(final String response) { HashMap<String, String> map = new HashMap<String, String>(); String[] pairs = response.split(","); for (String pair : pairs) { String[] parts = pair.split("=", 2); map.put(parts[0], parts[1]); } return map; }
/** * The server provides back key value pairs using an = sign and delimited * by a command. All keys are also a single character. * For example: a=kg4io3,b=skljsfoiew,c=1203 */
The server provides back key value pairs using an = sign and delimited by a command. All keys are also a single character. For example: a=kg4io3,b=skljsfoiew,c=1203
parseServerResponse
{ "repo_name": "kay-kim/mongo-java-driver", "path": "driver-core/src/main/com/mongodb/connection/ScramSha1Authenticator.java", "license": "apache-2.0", "size": 11423 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,484,217
List<Indicator> getIndicatorsWithoutGroups();
List<Indicator> getIndicatorsWithoutGroups();
/** * Gets all indicators which are not assigned to any groups. */
Gets all indicators which are not assigned to any groups
getIndicatorsWithoutGroups
{ "repo_name": "uonafya/jphes-core", "path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataintegrity/DataIntegrityService.java", "license": "bsd-3-clause", "size": 7902 }
[ "java.util.List", "org.hisp.dhis.indicator.Indicator" ]
import java.util.List; import org.hisp.dhis.indicator.Indicator;
import java.util.*; import org.hisp.dhis.indicator.*;
[ "java.util", "org.hisp.dhis" ]
java.util; org.hisp.dhis;
1,510,353
public ServerKeyType serverKeyType() { return this.innerProperties() == null ? null : this.innerProperties().serverKeyType(); }
ServerKeyType function() { return this.innerProperties() == null ? null : this.innerProperties().serverKeyType(); }
/** * Get the serverKeyType property: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. * * @return the serverKeyType value. */
Get the serverKeyType property: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'
serverKeyType
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EncryptionProtectorInner.java", "license": "mit", "size": 4550 }
[ "com.azure.resourcemanager.synapse.models.ServerKeyType" ]
import com.azure.resourcemanager.synapse.models.ServerKeyType;
import com.azure.resourcemanager.synapse.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
1,199,790
@ServiceMethod(returns = ReturnType.SINGLE) JobResponseInner update(String jobName, String resourceGroupName, UpdateJobParameters body);
@ServiceMethod(returns = ReturnType.SINGLE) JobResponseInner update(String jobName, String resourceGroupName, UpdateJobParameters body);
/** * Updates specific properties of a job. You can call this operation to notify the Import/Export service that the * hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be * used to cancel an existing job. * * @param jobName The name of the import/export job. * @param resourceGroupName The resource group name uniquely identifies the resource group within the user * subscription. * @param body The parameters to update in the job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.storageimportexport.models.ErrorResponseException thrown if the request is * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return contains the job information. */
Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job
update
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/storageimportexport/azure-resourcemanager-storageimportexport/src/main/java/com/azure/resourcemanager/storageimportexport/fluent/JobsClient.java", "license": "mit", "size": 11439 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.storageimportexport.fluent.models.JobResponseInner", "com.azure.resourcemanager.storageimportexport.models.UpdateJobParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.storageimportexport.fluent.models.JobResponseInner; import com.azure.resourcemanager.storageimportexport.models.UpdateJobParameters;
import com.azure.core.annotation.*; import com.azure.resourcemanager.storageimportexport.fluent.models.*; import com.azure.resourcemanager.storageimportexport.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,062,959
private static int selectStyle(char ch) { switch (ch) { case 'S': return SHORT; case 'M': return MEDIUM; case 'L': return LONG; case 'F': return FULL; case '-': return NONE; default: throw new IllegalArgumentException("Invalid style character: " + ch); } } //----------------------------------------------------------------------- static class StyleFormatter implements DateTimePrinter, DateTimeParser { private static final Map<String, DateTimeFormatter> cCache = new HashMap<String, DateTimeFormatter>(); // manual sync private final int iDateStyle; private final int iTimeStyle; private final int iType; StyleFormatter(int dateStyle, int timeStyle, int type) { super(); iDateStyle = dateStyle; iTimeStyle = timeStyle; iType = type; }
static int function(char ch) { switch (ch) { case 'S': return SHORT; case 'M': return MEDIUM; case 'L': return LONG; case 'F': return FULL; case '-': return NONE; default: throw new IllegalArgumentException(STR + ch); } } static class StyleFormatter implements DateTimePrinter, DateTimeParser { private static final Map<String, DateTimeFormatter> cCache = new HashMap<String, DateTimeFormatter>(); private final int iDateStyle; private final int iTimeStyle; private final int iType; StyleFormatter(int dateStyle, int timeStyle, int type) { super(); iDateStyle = dateStyle; iTimeStyle = timeStyle; iType = type; }
/** * Gets the JDK style code from the Joda code. * * @param ch the Joda style code * @return the JDK style code */
Gets the JDK style code from the Joda code
selectStyle
{ "repo_name": "mnn/AutoShutdown", "path": "src/main/java/externalAS/org/joda/time/format/DateTimeFormat.java", "license": "lgpl-2.1", "size": 32767 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,887,780
public IFigure getLayer(Object key) { if (innerLayers == null) return null; IFigure layer = scaledLayers.getLayer(key); if (layer != null) return layer; layer = printableLayers.getLayer(key); if (layer != null) return layer; return innerLayers.getLayer(key); }
IFigure function(Object key) { if (innerLayers == null) return null; IFigure layer = scaledLayers.getLayer(key); if (layer != null) return layer; layer = printableLayers.getLayer(key); if (layer != null) return layer; return innerLayers.getLayer(key); }
/** * Returns the layer indicated by the key. Searches all layered panes. * * @see LayerManager#getLayer(Object) */
Returns the layer indicated by the key. Searches all layered panes
getLayer
{ "repo_name": "ghillairet/gef-gwt", "path": "src/main/java/org/eclipse/gef/editparts/ScalableRootEditPart.java", "license": "epl-1.0", "size": 10760 }
[ "org.eclipse.draw2d.IFigure" ]
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.*;
[ "org.eclipse.draw2d" ]
org.eclipse.draw2d;
950,807
public String[] get(String prefix, String name) { String[] res = {}; lastError = ""; String ns = XMPShema.getNameSpace(prefix, name); if (ns == null) { lastError = "Namespace not found for " + prefix + ":" + name; return res; } XmpProperty property = XMPShema.getProperty(prefix, name); if (property == null) { lastError = "Property not found for " + prefix + ":" + name; return res; } String prop = property.getProperty(); ValueType valueType = property.getValueType(); if (valueType instanceof ValueTypes.Array) { // ValueTypes.Array array = (ValueTypes.Array) valueType; try { int count = xmpMeta.countArrayItems(ns, prop); res = new String[count]; for (int i = 0; i < count; i++) { res[i] = xmpMeta.getArrayItem(ns, prop, i + 1).getValue().toString(); } } catch (XMPException ex) { lastError = ex.getMessage(); } } else if (valueType instanceof Structure) { ValueTypes.Structure str = (Structure) valueType; ArrayList<ValueType> types = str.types; res = new String[types.size()]; for (int k = 0; k < types.size(); k++) { ValueType t = types.get(k); try { XMPProperty structField = xmpMeta.getStructField(ns, str.name, ns, t.name); if (structField != null) { Object value = structField.getValue(); if (value != null) { res[k] = String.valueOf(value); } } else { // res[k] = t.name + ":"; } } catch (XMPException ex) { lastError = ex.getMessage(); // res[k] = lastError; } } } else { res = new String[1]; try { res[0] = xmpMeta.getPropertyString(ns, prop); } catch (XMPException ex) { lastError = ex.getMessage(); return new String[0]; } } return res; }
String[] function(String prefix, String name) { String[] res = {}; lastError = STRNamespace not found for STR:STRProperty not found for STR:" + name; return res; } String prop = property.getProperty(); ValueType valueType = property.getValueType(); if (valueType instanceof ValueTypes.Array) { try { int count = xmpMeta.countArrayItems(ns, prop); res = new String[count]; for (int i = 0; i < count; i++) { res[i] = xmpMeta.getArrayItem(ns, prop, i + 1).getValue().toString(); } } catch (XMPException ex) { lastError = ex.getMessage(); } } else if (valueType instanceof Structure) { ValueTypes.Structure str = (Structure) valueType; ArrayList<ValueType> types = str.types; res = new String[types.size()]; for (int k = 0; k < types.size(); k++) { ValueType t = types.get(k); try { XMPProperty structField = xmpMeta.getStructField(ns, str.name, ns, t.name); if (structField != null) { Object value = structField.getValue(); if (value != null) { res[k] = String.valueOf(value); } } else { } } catch (XMPException ex) { lastError = ex.getMessage(); } } } else { res = new String[1]; try { res[0] = xmpMeta.getPropertyString(ns, prop); } catch (XMPException ex) { lastError = ex.getMessage(); return new String[0]; } } return res; }
/** * get field values from xmp * * @param prefix * namespace prefix * @param name * field name * @return field value(s) or null (check lastError in this case). IF field * is array, then all fields in array are returned, if field is * structure, then values of all structure fields are returned */
get field values from xmp
get
{ "repo_name": "andronix3/SmartXMP", "path": "com/smartg/xmp/XMPCollection.java", "license": "bsd-3-clause", "size": 10432 }
[ "com.adobe.xmp.XMPException", "com.adobe.xmp.properties.XMPProperty", "com.smartg.xmp.ValueTypes", "java.util.ArrayList" ]
import com.adobe.xmp.XMPException; import com.adobe.xmp.properties.XMPProperty; import com.smartg.xmp.ValueTypes; import java.util.ArrayList;
import com.adobe.xmp.*; import com.adobe.xmp.properties.*; import com.smartg.xmp.*; import java.util.*;
[ "com.adobe.xmp", "com.smartg.xmp", "java.util" ]
com.adobe.xmp; com.smartg.xmp; java.util;
1,577,142
public BytesReader getBytesReader() { if (fst == null) { return null; } else { return fst.getBytesReader(); } }
BytesReader function() { if (fst == null) { return null; } else { return fst.getBytesReader(); } }
/** * Returns a {@link BytesReader} to pass to the {@link #get(char[], int, FST.Arc, FST.BytesReader)} method. */
Returns a <code>BytesReader</code> to pass to the <code>#get(char[], int, FST.Arc, FST.BytesReader)</code> method
getBytesReader
{ "repo_name": "visouza/solr-5.0.0", "path": "lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/StemmerOverrideFilter.java", "license": "apache-2.0", "size": 8364 }
[ "org.apache.lucene.util.fst.FST" ]
import org.apache.lucene.util.fst.FST;
import org.apache.lucene.util.fst.*;
[ "org.apache.lucene" ]
org.apache.lucene;
1,865,520
private boolean isFilenameAvailable(String path) { for (String key : downloads.keySet()) { DownloadRequest r = downloads.get(key); if (StringUtils.equals(r.getDestination(), path)) { if (BuildConfig.DEBUG) Log.d(TAG, path + " is already used by another requested download"); return false; } } if (BuildConfig.DEBUG) Log.d(TAG, path + " is available as a download destination"); return true; }
boolean function(String path) { for (String key : downloads.keySet()) { DownloadRequest r = downloads.get(key); if (StringUtils.equals(r.getDestination(), path)) { if (BuildConfig.DEBUG) Log.d(TAG, path + STR); return false; } } if (BuildConfig.DEBUG) Log.d(TAG, path + STR); return true; }
/** * Returns true if a filename is available and false if it has already been * taken by another requested download. */
Returns true if a filename is available and false if it has already been taken by another requested download
isFilenameAvailable
{ "repo_name": "TeodorKostadinov/PodcastApp", "path": "core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java", "license": "mit", "size": 14521 }
[ "android.util.Log", "de.danoeh.antennapod.core.BuildConfig", "de.danoeh.antennapod.core.service.download.DownloadRequest", "org.apache.commons.lang3.StringUtils" ]
import android.util.Log; import de.danoeh.antennapod.core.BuildConfig; import de.danoeh.antennapod.core.service.download.DownloadRequest; import org.apache.commons.lang3.StringUtils;
import android.util.*; import de.danoeh.antennapod.core.*; import de.danoeh.antennapod.core.service.download.*; import org.apache.commons.lang3.*;
[ "android.util", "de.danoeh.antennapod", "org.apache.commons" ]
android.util; de.danoeh.antennapod; org.apache.commons;
2,166,746
@Override public void run() { Long start = System.nanoTime(); try { client.setSoTimeout(10000); } catch (SocketException e) { WebServer.triggerInternalError("Socket Timeout Set failed for socket on port " + client.getLocalPort() + ": " + e.getMessage()); return; } WebServer.logDebug("Connection Established for with id " + requestID); try { in = new BufferedReader(new InputStreamReader(client.getInputStream())); out = new PrintWriter(client.getOutputStream(), true); WebServer.logDebug("Established in and out streams for request " + requestID); } catch (IOException e) { WebServer.triggerInternalError("Read Failed for streams from request " + requestID); return; } String line; int lineNum = 1; while (client.isConnected()) { // reading all lines from request try { while ((line = in.readLine()).length() != 0) { rawRequest += line + "\n"; WebServer.logInfo("Reading Line " + lineNum++ + " from request: " + requestID + ": " + line); } } catch (IOException e) { break; } parseHeaders(rawRequest); Site site = WebServer.matchSite(variables.get("SERVER_PROTOCOL"), variables.get("HTTP_HOST"), client.getLocalPort()); if (site != null) { WebServer.logDebug("Transferring Request to site: " + site.getName()); site.run(this); } else { out.close(); } WebServer.logInfo("Closed Request " + requestID); Double estimated = (System.nanoTime() - start) / 1000000000.0; WebServer.requestTimes.put(getRequestID(), estimated); WebServer.logInfo("Request " + requestID + " was completed in " + estimated + " seconds. Average of " + Utils.sum(WebServer.requestTimes.values().toArray(new Double[0])) + " Seconds / " + WebServer.requestTimes.size() + " Requests is " + Utils.sum(WebServer.requestTimes.values().toArray(new Double[0])) / (WebServer.requestTimes.size())); } }
void function() { Long start = System.nanoTime(); try { client.setSoTimeout(10000); } catch (SocketException e) { WebServer.triggerInternalError(STR + client.getLocalPort() + STR + e.getMessage()); return; } WebServer.logDebug(STR + requestID); try { in = new BufferedReader(new InputStreamReader(client.getInputStream())); out = new PrintWriter(client.getOutputStream(), true); WebServer.logDebug(STR + requestID); } catch (IOException e) { WebServer.triggerInternalError(STR + requestID); return; } String line; int lineNum = 1; while (client.isConnected()) { try { while ((line = in.readLine()).length() != 0) { rawRequest += line + "\n"; WebServer.logInfo(STR + lineNum++ + STR + requestID + STR + line); } } catch (IOException e) { break; } parseHeaders(rawRequest); Site site = WebServer.matchSite(variables.get(STR), variables.get(STR), client.getLocalPort()); if (site != null) { WebServer.logDebug(STR + site.getName()); site.run(this); } else { out.close(); } WebServer.logInfo(STR + requestID); Double estimated = (System.nanoTime() - start) / 1000000000.0; WebServer.requestTimes.put(getRequestID(), estimated); WebServer.logInfo(STR + requestID + STR + estimated + STR + Utils.sum(WebServer.requestTimes.values().toArray(new Double[0])) + STR + WebServer.requestTimes.size() + STR + Utils.sum(WebServer.requestTimes.values().toArray(new Double[0])) / (WebServer.requestTimes.size())); } }
/** * Reads the Request and determines the correct Site to handle this Request. It then has the Site process this * Request */
Reads the Request and determines the correct Site to handle this Request. It then has the Site process this Request
run
{ "repo_name": "EdHurtig/jServe", "path": "src/jServe/Core/Request.java", "license": "gpl-3.0", "size": 7006 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStreamReader", "java.io.PrintWriter", "java.net.SocketException" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.SocketException;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
1,580,589
JavaClass jclass = classParser.parse(); Repository.addClass(jclass); return jclass; } }
JavaClass jclass = classParser.parse(); Repository.addClass(jclass); return jclass; } }
/** * Parse the class file into a JavaClass object. If succesful, the new * JavaClass is entered into the Repository. * * @return the parsed JavaClass * @throws IOException * if the class cannot be parsed */
Parse the class file into a JavaClass object. If succesful, the new JavaClass is entered into the Repository
parse
{ "repo_name": "OpenNTF/FindBug-for-Domino-Designer", "path": "findBugsEclipsePlugin/src/edu/umd/cs/findbugs/ba/RepositoryClassParser.java", "license": "lgpl-3.0", "size": 2679 }
[ "org.apache.bcel.Repository", "org.apache.bcel.classfile.JavaClass" ]
import org.apache.bcel.Repository; import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.*; import org.apache.bcel.classfile.*;
[ "org.apache.bcel" ]
org.apache.bcel;
1,604,369
public void dump (PrintWriter out) { // obtain our maximum count int max = 0; for (int ii = 0; ii < BUCKET_COUNT; ii++) { if (_counts[ii] > max) { max = _counts[ii]; } } // figure out how many digits are needed to display the biggest bucket's size int digits = (int)Math.ceil(Math.log(max) / Math.log(10)); digits = Math.max(digits, 1); // output each bucket in a column of its own for (int rr = 9; rr >= 0; rr--) { // print the "value" of this row out.print(StringUtil.pad("" + (rr+1)*max/10, digits) + " "); for (int ii = 0; ii < BUCKET_COUNT; ii++) { out.print((_counts[ii] * 10 / max > rr) ? "*" : " "); } out.println(""); } out.print(spaces(digits)); for (int ii = 0; ii < BUCKET_COUNT; ii++) { out.print("-"); } out.println(""); out.print(spaces(digits)); for (int ii = 0; ii < BUCKET_COUNT; ii++) { out.print(_percentile[ii]%10); } out.println(""); out.print(spaces(digits)); for (int ii = 0; ii < BUCKET_COUNT; ii++) { out.print((_percentile[ii]/10)%10); } out.println(""); // print out a scale along the very bottom out.println(""); out.println("total: " + _total + " min: " + _min + " max: " + _max + " delta: " + ((float)_max / BUCKET_COUNT)); }
void function (PrintWriter out) { int max = 0; for (int ii = 0; ii < BUCKET_COUNT; ii++) { if (_counts[ii] > max) { max = _counts[ii]; } } int digits = (int)Math.ceil(Math.log(max) / Math.log(10)); digits = Math.max(digits, 1); for (int rr = 9; rr >= 0; rr--) { out.print(StringUtil.pad(STR STR*STR STRSTR-STRSTRSTRSTRSTRtotal: STR min: STR max: STR delta: " + ((float)_max / BUCKET_COUNT)); }
/** * Dumps a text representation of this percentiler to the supplied print stream. */
Dumps a text representation of this percentiler to the supplied print stream
dump
{ "repo_name": "threerings/vilya", "path": "core/src/main/java/com/threerings/parlor/rating/util/Percentiler.java", "license": "lgpl-2.1", "size": 14772 }
[ "com.samskivert.util.StringUtil", "com.threerings.parlor.Log", "java.io.PrintWriter" ]
import com.samskivert.util.StringUtil; import com.threerings.parlor.Log; import java.io.PrintWriter;
import com.samskivert.util.*; import com.threerings.parlor.*; import java.io.*;
[ "com.samskivert.util", "com.threerings.parlor", "java.io" ]
com.samskivert.util; com.threerings.parlor; java.io;
2,263,884
public void testTemplateQueryAsEscapedString() throws Exception { SearchRequest searchRequest = new SearchRequest(); searchRequest.indices("_all"); String query = "{" + " \"template\" : \"{ \\\"size\\\": \\\"{{size}}\\\", \\\"query\\\":{\\\"match_all\\\":{}}}\"," + " \"params\":{" + " \"size\": 1" + " }" + "}"; searchRequest.template(parseTemplate(query)); SearchResponse searchResponse = client().search(searchRequest).get(); assertThat(searchResponse.getHits().hits().length, equalTo(1)); }
void function() throws Exception { SearchRequest searchRequest = new SearchRequest(); searchRequest.indices("_all"); String query = "{" + STRtemplate\STR{ \\\STR: \\\STR, \\\STR:{\\\STR:{}}}\"," + STRparams\":{" + STRsize\STR + STR + "}"; searchRequest.template(parseTemplate(query)); SearchResponse searchResponse = client().search(searchRequest).get(); assertThat(searchResponse.getHits().hits().length, equalTo(1)); }
/** * Test that template can be expressed as a single escaped string. */
Test that template can be expressed as a single escaped string
testTemplateQueryAsEscapedString
{ "repo_name": "kaneshin/elasticsearch", "path": "core/src/test/java/org/elasticsearch/index/query/TemplateQueryIT.java", "license": "apache-2.0", "size": 24336 }
[ "org.elasticsearch.action.search.SearchRequest", "org.elasticsearch.action.search.SearchResponse", "org.hamcrest.Matchers" ]
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.hamcrest.Matchers;
import org.elasticsearch.action.search.*; import org.hamcrest.*;
[ "org.elasticsearch.action", "org.hamcrest" ]
org.elasticsearch.action; org.hamcrest;
644,040
@NotNull @SuppressWarnings("unused") protected List<Table<String, Attribute<String>, List<Attribute<String>>>> extractTableMetadata( @Nullable final List<String> tableNames, @NotNull final Connection connection, final boolean caseSensitiveness, @NotNull final MetadataExtractionListener metadataExtractionListener, @NotNull final MetaLanguageUtils metaLanguageUtils, @NotNull final MetadataTypeManager metadataTypeManager) throws SQLException, QueryJException { @NotNull final List<Table<String, Attribute<String>, List<Attribute<String>>>> result; @Nullable final Log t_Log = UniqueLogFactory.getLog(OracleMetadataManager.class); @Nullable SQLException sqlExceptionToThrow = null; @Nullable ResultSet t_rsResults = null; @Nullable PreparedStatement t_PreparedStatement = null; @Nullable TableIncompleteValueObject t_Table; @NotNull final Map<String, TableIncompleteValueObject> t_mTableMap = new HashMap<>(); @NotNull final Map<String ,List<AttributeIncompleteValueObject>> t_mColumnMap = new HashMap<>(); @NotNull final Map<String, List<AttributeIncompleteValueObject>> t_mPrimaryKeyMap = new HashMap<>(); @NotNull final Map<String, List<ForeignKeyIncompleteValueObject>> t_mForeignKeyMap = new HashMap<>(); @NotNull final Map<String, List<AttributeIncompleteValueObject>> t_mForeignKeyAttributeMap = new HashMap<>(); try { @NotNull final String t_strQuery = "select c.table_name, " + "tc.comments table_comment, " + "c.column_name, " + "uc.comments column_comment, " + "c.data_type, " + "c.data_length, " + "c.data_precision, " + "c.data_scale, " + "c.nullable, " + "c.column_id, " + "cons.position pk_position, " + "fks.constraint_name fk_name, " + "fks.target_table, " + "fks.position fk_position " + "from user_tab_comments tc, user_col_comments uc, " + "user_tab_columns c " + LEFT_OUTER_JOIN + "select ucc.* " + "from user_cons_columns ucc, user_constraints uc " + "where uc.constraint_type = 'P' and uc.status = 'ENABLED' " + "and uc.constraint_name = ucc.constraint_name) cons " + "on c.table_name = cons.table_name and c.column_name = cons.column_name " + LEFT_OUTER_JOIN + "select rcon.constraint_name, " + "col.position, " + "rcol.table_name source_table, " + "con.table_name target_table, " + "rcol.column_name " + "from user_constraints con, " + "user_cons_columns col, " + "user_constraints rcon, " + "user_cons_columns rcol " + "where rcon.constraint_type = 'R' " + "and rcon.r_constraint_name = con.constraint_name " + "and col.table_name = con.table_name " + "and col.constraint_name = con.constraint_name " + "and rcol.table_name = rcon.table_name " + "and rcol.constraint_name = rcon.constraint_name " + "and rcol.position = col.position) fks " + "on c.table_name = fks.source_table and c.column_name = fks.column_name " + "where instr(tc.table_name, '$') = 0 " + "and tc.table_name = c.table_name " + "and tc.table_name = uc.table_name " + "and c.column_name = uc.column_name "; if ( (t_Log != null) && (t_Log.isDebugEnabled())) { t_Log.debug("query:" + t_strQuery); } t_PreparedStatement = connection.prepareStatement(t_strQuery); } catch (@NotNull final SQLException invalidQuery) { sqlExceptionToThrow = invalidQuery; } if (t_PreparedStatement != null) { try { t_rsResults = t_PreparedStatement.executeQuery(); } catch (@NotNull final SQLException queryFailed) { sqlExceptionToThrow = queryFailed; } } if (t_rsResults != null) { try { while (t_rsResults.next()) { processRow( t_rsResults, t_mTableMap, t_mColumnMap, t_mPrimaryKeyMap, t_mForeignKeyMap, t_mForeignKeyAttributeMap, caseSensitiveness, metaLanguageUtils, metadataTypeManager); } } catch (@NotNull final SQLException errorIteratingResults) { sqlExceptionToThrow = errorIteratingResults; } } if (t_rsResults != null) { try { t_rsResults.close(); } catch (@NotNull final SQLException sqlException) { if (t_Log != null) { t_Log.error( "Cannot close the result set.", sqlException); } } } if (t_PreparedStatement != null) { try { t_PreparedStatement.close(); } catch (@NotNull final SQLException sqlException) { if (t_Log != null) { t_Log.error( "Cannot close the statement.", sqlException); } } } if (sqlExceptionToThrow != null) { throw sqlExceptionToThrow; } buildUpTables( t_mTableMap, t_mColumnMap, t_mPrimaryKeyMap, t_mForeignKeyMap, t_mForeignKeyAttributeMap, caseSensitiveness, metaLanguageUtils); result = cloneTables(t_mTableMap.values()); return result; }
@SuppressWarnings(STR) List<Table<String, Attribute<String>, List<Attribute<String>>>> function( @Nullable final List<String> tableNames, @NotNull final Connection connection, final boolean caseSensitiveness, @NotNull final MetadataExtractionListener metadataExtractionListener, @NotNull final MetaLanguageUtils metaLanguageUtils, @NotNull final MetadataTypeManager metadataTypeManager) throws SQLException, QueryJException { @NotNull final List<Table<String, Attribute<String>, List<Attribute<String>>>> result; @Nullable final Log t_Log = UniqueLogFactory.getLog(OracleMetadataManager.class); @Nullable SQLException sqlExceptionToThrow = null; @Nullable ResultSet t_rsResults = null; @Nullable PreparedStatement t_PreparedStatement = null; @Nullable TableIncompleteValueObject t_Table; @NotNull final Map<String, TableIncompleteValueObject> t_mTableMap = new HashMap<>(); @NotNull final Map<String ,List<AttributeIncompleteValueObject>> t_mColumnMap = new HashMap<>(); @NotNull final Map<String, List<AttributeIncompleteValueObject>> t_mPrimaryKeyMap = new HashMap<>(); @NotNull final Map<String, List<ForeignKeyIncompleteValueObject>> t_mForeignKeyMap = new HashMap<>(); @NotNull final Map<String, List<AttributeIncompleteValueObject>> t_mForeignKeyAttributeMap = new HashMap<>(); try { @NotNull final String t_strQuery = STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + LEFT_OUTER_JOIN + STR + STR + STR + STR + STR + LEFT_OUTER_JOIN + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR; if ( (t_Log != null) && (t_Log.isDebugEnabled())) { t_Log.debug(STR + t_strQuery); } t_PreparedStatement = connection.prepareStatement(t_strQuery); } catch (@NotNull final SQLException invalidQuery) { sqlExceptionToThrow = invalidQuery; } if (t_PreparedStatement != null) { try { t_rsResults = t_PreparedStatement.executeQuery(); } catch (@NotNull final SQLException queryFailed) { sqlExceptionToThrow = queryFailed; } } if (t_rsResults != null) { try { while (t_rsResults.next()) { processRow( t_rsResults, t_mTableMap, t_mColumnMap, t_mPrimaryKeyMap, t_mForeignKeyMap, t_mForeignKeyAttributeMap, caseSensitiveness, metaLanguageUtils, metadataTypeManager); } } catch (@NotNull final SQLException errorIteratingResults) { sqlExceptionToThrow = errorIteratingResults; } } if (t_rsResults != null) { try { t_rsResults.close(); } catch (@NotNull final SQLException sqlException) { if (t_Log != null) { t_Log.error( STR, sqlException); } } } if (t_PreparedStatement != null) { try { t_PreparedStatement.close(); } catch (@NotNull final SQLException sqlException) { if (t_Log != null) { t_Log.error( STR, sqlException); } } } if (sqlExceptionToThrow != null) { throw sqlExceptionToThrow; } buildUpTables( t_mTableMap, t_mColumnMap, t_mPrimaryKeyMap, t_mForeignKeyMap, t_mForeignKeyAttributeMap, caseSensitiveness, metaLanguageUtils); result = cloneTables(t_mTableMap.values()); return result; }
/** * Processes the schema. * @param tableNames the table names. * @param connection the database connection. * @param caseSensitiveness whether the checks are case sensitive or not. * @param metadataExtractionListener the metadata extraction listener. * @param metaLanguageUtils the {@link MetaLanguageUtils} instance. * @param metadataTypeManager the {@link MetadataTypeManager} instance. * @return the list of all table names. * @throws SQLException if the extraction fails. * @throws QueryJException if any other error occurs. */
Processes the schema
extractTableMetadata
{ "repo_name": "rydnr/queryj-rt", "path": "queryj-core/src/main/java/org/acmsl/queryj/metadata/engines/oracle/OracleMetadataManager.java", "license": "gpl-2.0", "size": 26710 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "java.util.HashMap", "java.util.List", "java.util.Map", "org.acmsl.commons.logging.UniqueLogFactory", "org.acmsl.queryj.api.MetaLanguageUtils", "org.acmsl.queryj.api.exceptions.QueryJException", "org.acmsl.queryj.metadata.MetadataExtractionListener", "org.acmsl.queryj.metadata.MetadataTypeManager", "org.acmsl.queryj.metadata.vo.Attribute", "org.acmsl.queryj.metadata.vo.AttributeIncompleteValueObject", "org.acmsl.queryj.metadata.vo.ForeignKeyIncompleteValueObject", "org.acmsl.queryj.metadata.vo.Table", "org.acmsl.queryj.metadata.vo.TableIncompleteValueObject", "org.apache.commons.logging.Log", "org.jetbrains.annotations.NotNull", "org.jetbrains.annotations.Nullable" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.acmsl.commons.logging.UniqueLogFactory; import org.acmsl.queryj.api.MetaLanguageUtils; import org.acmsl.queryj.api.exceptions.QueryJException; import org.acmsl.queryj.metadata.MetadataExtractionListener; import org.acmsl.queryj.metadata.MetadataTypeManager; import org.acmsl.queryj.metadata.vo.Attribute; import org.acmsl.queryj.metadata.vo.AttributeIncompleteValueObject; import org.acmsl.queryj.metadata.vo.ForeignKeyIncompleteValueObject; import org.acmsl.queryj.metadata.vo.Table; import org.acmsl.queryj.metadata.vo.TableIncompleteValueObject; import org.apache.commons.logging.Log; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import java.sql.*; import java.util.*; import org.acmsl.commons.logging.*; import org.acmsl.queryj.api.*; import org.acmsl.queryj.api.exceptions.*; import org.acmsl.queryj.metadata.*; import org.acmsl.queryj.metadata.vo.*; import org.apache.commons.logging.*; import org.jetbrains.annotations.*;
[ "java.sql", "java.util", "org.acmsl.commons", "org.acmsl.queryj", "org.apache.commons", "org.jetbrains.annotations" ]
java.sql; java.util; org.acmsl.commons; org.acmsl.queryj; org.apache.commons; org.jetbrains.annotations;
191,268
public void setupReviewButton(HttpServletRequest request, CurationService curatorService, SampleBean sampleBean, SpringSecurityAclService springSecurityAclService) throws Exception { boolean publicData = springSecurityAclService.checkObjectPublic(sampleBean.getDomain().getId(), SecureClassesEnum.SAMPLE.getClazz()); if (!publicData) { DataReviewStatusBean reviewStatus = curatorService.findDataReviewStatusBeanByDataId(sampleBean.getDomain().getId().toString()); if (!SpringSecurityUtil.getPrincipal().isCurator() && (reviewStatus == null || reviewStatus != null && reviewStatus.getReviewStatus().equals(DataReviewStatusBean.RETRACTED_STATUS))) { this.showReviewButton = true; } else { this.showReviewButton = false; } } else { this.showReviewButton = false; } }
void function(HttpServletRequest request, CurationService curatorService, SampleBean sampleBean, SpringSecurityAclService springSecurityAclService) throws Exception { boolean publicData = springSecurityAclService.checkObjectPublic(sampleBean.getDomain().getId(), SecureClassesEnum.SAMPLE.getClazz()); if (!publicData) { DataReviewStatusBean reviewStatus = curatorService.findDataReviewStatusBeanByDataId(sampleBean.getDomain().getId().toString()); if (!SpringSecurityUtil.getPrincipal().isCurator() && (reviewStatus == null reviewStatus != null && reviewStatus.getReviewStatus().equals(DataReviewStatusBean.RETRACTED_STATUS))) { this.showReviewButton = true; } else { this.showReviewButton = false; } } else { this.showReviewButton = false; } }
/** * Logic moved from SampleAction.setUpSubmitForReviewButton() * @param request * @param curatorService * @param sampleBean * @throws Exception */
Logic moved from SampleAction.setUpSubmitForReviewButton()
setupReviewButton
{ "repo_name": "NCIP/cananolab", "path": "software/cananolab-webapp/src/gov/nih/nci/cananolab/restful/view/edit/SampleEditGeneralBean.java", "license": "bsd-3-clause", "size": 12713 }
[ "gov.nih.nci.cananolab.dto.common.DataReviewStatusBean", "gov.nih.nci.cananolab.dto.particle.SampleBean", "gov.nih.nci.cananolab.security.enums.SecureClassesEnum", "gov.nih.nci.cananolab.security.service.SpringSecurityAclService", "gov.nih.nci.cananolab.security.utils.SpringSecurityUtil", "gov.nih.nci.cananolab.service.curation.CurationService", "javax.servlet.http.HttpServletRequest" ]
import gov.nih.nci.cananolab.dto.common.DataReviewStatusBean; import gov.nih.nci.cananolab.dto.particle.SampleBean; import gov.nih.nci.cananolab.security.enums.SecureClassesEnum; import gov.nih.nci.cananolab.security.service.SpringSecurityAclService; import gov.nih.nci.cananolab.security.utils.SpringSecurityUtil; import gov.nih.nci.cananolab.service.curation.CurationService; import javax.servlet.http.HttpServletRequest;
import gov.nih.nci.cananolab.dto.common.*; import gov.nih.nci.cananolab.dto.particle.*; import gov.nih.nci.cananolab.security.enums.*; import gov.nih.nci.cananolab.security.service.*; import gov.nih.nci.cananolab.security.utils.*; import gov.nih.nci.cananolab.service.curation.*; import javax.servlet.http.*;
[ "gov.nih.nci", "javax.servlet" ]
gov.nih.nci; javax.servlet;
2,274,224
public GameObject getObject(int id) { List<GameObject> actualObjects = new ArrayList(); for (int c = 0; c < objects.size(); c++) { boolean add = true; for(int index: spriteIndexes){ if (c == index) { add = false; } } if (add) { actualObjects.add(objects.get(c)); } } for (GameObject g: actualObjects) { if (g.id == id) { return g; } } System.err.println("Error in Layer.getObject(): GameObject not found."); return null; }
GameObject function(int id) { List<GameObject> actualObjects = new ArrayList(); for (int c = 0; c < objects.size(); c++) { boolean add = true; for(int index: spriteIndexes){ if (c == index) { add = false; } } if (add) { actualObjects.add(objects.get(c)); } } for (GameObject g: actualObjects) { if (g.id == id) { return g; } } System.err.println(STR); return null; }
/** * Gets the GameObject with the given ID. * @param id The ID of the GameObject to retrieve (GameObject.id). * @return The GameObject with the given ID. */
Gets the GameObject with the given ID
getObject
{ "repo_name": "YellowLineSoftworks/VIPER-Engine", "path": "src/game/Layer.java", "license": "bsd-3-clause", "size": 16158 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,599,154
@Override public Collection<String> getMenuCategories() { return Arrays.asList(new String[] { MenuFactory.SAMPLERS }); }
Collection<String> function() { return Arrays.asList(new String[] { MenuFactory.SAMPLERS }); }
/** * This is the list of menu categories this gui component will be available * under. This implementation returns * {@link org.apache.jmeter.gui.util.MenuFactory#SAMPLERS}, which is * appropriate for most sampler components. * * @return a Collection of Strings, where each element is one of the * constants defined in MenuFactory */
This is the list of menu categories this gui component will be available under. This implementation returns <code>org.apache.jmeter.gui.util.MenuFactory#SAMPLERS</code>, which is appropriate for most sampler components
getMenuCategories
{ "repo_name": "saketh7/Jmeter", "path": "src/core/org/apache/jmeter/samplers/gui/AbstractSamplerGui.java", "license": "apache-2.0", "size": 2423 }
[ "java.util.Arrays", "java.util.Collection", "org.apache.jmeter.gui.util.MenuFactory" ]
import java.util.Arrays; import java.util.Collection; import org.apache.jmeter.gui.util.MenuFactory;
import java.util.*; import org.apache.jmeter.gui.util.*;
[ "java.util", "org.apache.jmeter" ]
java.util; org.apache.jmeter;
1,293,759
public void commit() throws IOException { if (writer != null) { OutputCommitter outputCommitter = jobConf.getOutputCommitter(); TaskAttemptContext taskCtx = new TaskAttemptContextImpl(jobConf, attempt); if (outputCommitter.needsTaskCommit(taskCtx)) outputCommitter.commitTask(taskCtx); } }
void function() throws IOException { if (writer != null) { OutputCommitter outputCommitter = jobConf.getOutputCommitter(); TaskAttemptContext taskCtx = new TaskAttemptContextImpl(jobConf, attempt); if (outputCommitter.needsTaskCommit(taskCtx)) outputCommitter.commitTask(taskCtx); } }
/** * Commit task. * * @throws IOException In failed. */
Commit task
commit
{ "repo_name": "dlnufox/ignite", "path": "modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v1/HadoopV1OutputCollector.java", "license": "apache-2.0", "size": 4314 }
[ "java.io.IOException", "org.apache.hadoop.mapred.OutputCommitter", "org.apache.hadoop.mapred.TaskAttemptContext", "org.apache.hadoop.mapred.TaskAttemptContextImpl" ]
import java.io.IOException; import org.apache.hadoop.mapred.OutputCommitter; import org.apache.hadoop.mapred.TaskAttemptContext; import org.apache.hadoop.mapred.TaskAttemptContextImpl;
import java.io.*; import org.apache.hadoop.mapred.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,710,414
public static Future<?> removeAllNewFlags() { return dbExec.submit(() -> { final PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setFeedItems(FeedItem.NEW, FeedItem.UNPLAYED); adapter.close(); EventBus.getDefault().post(new UnreadItemsUpdateEvent()); }); }
static Future<?> function() { return dbExec.submit(() -> { final PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setFeedItems(FeedItem.NEW, FeedItem.UNPLAYED); adapter.close(); EventBus.getDefault().post(new UnreadItemsUpdateEvent()); }); }
/** * Sets the 'read'-attribute of all NEW FeedItems to UNPLAYED. */
Sets the 'read'-attribute of all NEW FeedItems to UNPLAYED
removeAllNewFlags
{ "repo_name": "AntennaPod/AntennaPod", "path": "core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java", "license": "gpl-3.0", "size": 40497 }
[ "de.danoeh.antennapod.event.UnreadItemsUpdateEvent", "de.danoeh.antennapod.model.feed.FeedItem", "de.danoeh.antennapod.storage.database.PodDBAdapter", "java.util.concurrent.Future", "org.greenrobot.eventbus.EventBus" ]
import de.danoeh.antennapod.event.UnreadItemsUpdateEvent; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.storage.database.PodDBAdapter; import java.util.concurrent.Future; import org.greenrobot.eventbus.EventBus;
import de.danoeh.antennapod.event.*; import de.danoeh.antennapod.model.feed.*; import de.danoeh.antennapod.storage.database.*; import java.util.concurrent.*; import org.greenrobot.eventbus.*;
[ "de.danoeh.antennapod", "java.util", "org.greenrobot.eventbus" ]
de.danoeh.antennapod; java.util; org.greenrobot.eventbus;
1,442,991
private static void setCurrentInstance(Map<String, ResourceBundle> context) { instance.set(context); }
static void function(Map<String, ResourceBundle> context) { instance.set(context); }
/** * <p>Replace the Map with the argument context.</p> * * @param context the Map to be stored in ThreadLocal storage. */
Replace the Map with the argument context
setCurrentInstance
{ "repo_name": "boggad/jdk9-sample", "path": "sample-catalog/spring-jdk9/src/javax.el.api/javax/el/ELUtil.java", "license": "mit", "size": 12701 }
[ "java.util.Map", "java.util.ResourceBundle" ]
import java.util.Map; import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
2,195,852
EList<ComplexValue> getComplexValues();
EList<ComplexValue> getComplexValues();
/** * Returns the value of the '<em><b>Complex Values</b></em>' containment reference list. * The list contents are of type {@link isostdisots_29002_10ed_1techxmlschemavalueSimplified.ComplexValue}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Complex Values</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>Complex Values</em>' containment reference list. * @see isostdisots_29002_10ed_1techxmlschemavalueSimplified.Isostdisots_29002_10ed_1techxmlschemavalueSimplifiedPackage#getCombination_ComplexValues() * @model containment="true" * @generated */
Returns the value of the 'Complex Values' containment reference list. The list contents are of type <code>isostdisots_29002_10ed_1techxmlschemavalueSimplified.ComplexValue</code>. If the meaning of the 'Complex Values' containment reference list isn't clear, there really should be more of a description here...
getComplexValues
{ "repo_name": "patrickneubauer/XMLIntellEdit", "path": "xmlintelledit/xmltext/src/main/java/isostdisots_29002_10ed_1techxmlschemavalueSimplified/Combination.java", "license": "mit", "size": 22428 }
[ "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;
1,903,286
public DomainObjectContainer container() { final DomainObjectContainer container = dsp.getContainer(); if(container == null) { throw new IllegalStateException( "No DomainObjectContainer available"); } return container; }
DomainObjectContainer function() { final DomainObjectContainer container = dsp.getContainer(); if(container == null) { throw new IllegalStateException( STR); } return container; }
/** * Convenience method, returning the {@link DomainObjectContainer}, * first ensuring that it is available. * * @throws IllegalStateException if not available */
Convenience method, returning the <code>DomainObjectContainer</code>, first ensuring that it is available
container
{ "repo_name": "incodehq/isis", "path": "core/specsupport/src/main/java/org/apache/isis/core/specsupport/scenarios/ScenarioExecution.java", "license": "apache-2.0", "size": 18922 }
[ "org.apache.isis.applib.DomainObjectContainer" ]
import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.*;
[ "org.apache.isis" ]
org.apache.isis;
1,430,775
public boolean validateTransformationMatrix4x4Type_MinLength(List<?> transformationMatrix4x4Type, DiagnosticChain diagnostics, Map<Object, Object> context) { int length = transformationMatrix4x4Type.size(); boolean result = length >= 16; if (!result && diagnostics != null) reportMinLengthViolation(CitygmlPackage.Literals.TRANSFORMATION_MATRIX4X4_TYPE, transformationMatrix4x4Type, length, 16, diagnostics, context); return result; }
boolean function(List<?> transformationMatrix4x4Type, DiagnosticChain diagnostics, Map<Object, Object> context) { int length = transformationMatrix4x4Type.size(); boolean result = length >= 16; if (!result && diagnostics != null) reportMinLengthViolation(CitygmlPackage.Literals.TRANSFORMATION_MATRIX4X4_TYPE, transformationMatrix4x4Type, length, 16, diagnostics, context); return result; }
/** * Validates the MinLength constraint of '<em>Transformation Matrix4x4 Type</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Validates the MinLength constraint of 'Transformation Matrix4x4 Type'.
validateTransformationMatrix4x4Type_MinLength
{ "repo_name": "markus1978/citygml4emf", "path": "de.hub.citygml.emf.ecore/src/net/opengis/citygml/util/CitygmlValidator.java", "license": "apache-2.0", "size": 22089 }
[ "java.util.List", "java.util.Map", "net.opengis.citygml.CitygmlPackage", "org.eclipse.emf.common.util.DiagnosticChain" ]
import java.util.List; import java.util.Map; import net.opengis.citygml.CitygmlPackage; import org.eclipse.emf.common.util.DiagnosticChain;
import java.util.*; import net.opengis.citygml.*; import org.eclipse.emf.common.util.*;
[ "java.util", "net.opengis.citygml", "org.eclipse.emf" ]
java.util; net.opengis.citygml; org.eclipse.emf;
110,435
selectButton.setAction(new ValidatingAction(WMessages.getInstance(selectButton). getValidationErrors(), rbSelect) { @Override public void executeOnValid(final ActionEvent event) { selectAction.execute(event); }
selectButton.setAction(new ValidatingAction(WMessages.getInstance(selectButton). getValidationErrors(), rbSelect) { void function(final ActionEvent event) { selectAction.execute(event); }
/** * If validation passes, invoke the backing action. * * @param event the event which triggered validation. */
If validation passes, invoke the backing action
executeOnValid
{ "repo_name": "Joshua-Barclay/wcomponents", "path": "wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/WDialogExample.java", "license": "gpl-3.0", "size": 21540 }
[ "com.github.bordertech.wcomponents.ActionEvent", "com.github.bordertech.wcomponents.WMessages", "com.github.bordertech.wcomponents.validation.ValidatingAction" ]
import com.github.bordertech.wcomponents.ActionEvent; import com.github.bordertech.wcomponents.WMessages; import com.github.bordertech.wcomponents.validation.ValidatingAction;
import com.github.bordertech.wcomponents.*; import com.github.bordertech.wcomponents.validation.*;
[ "com.github.bordertech" ]
com.github.bordertech;
2,489,536
public static void setMp3Cover(String audioFilePath,String imageFilePath) throws ID3ReadException, IOException, ID3WriteException { boolean save=false; MyID3 myID3 = new MyID3(); File src_file=new File(audioFilePath); MusicMetadataSet src_set = myID3.read(src_file); MusicMetadata metadata = (MusicMetadata) src_set.getSimplified(); if (imageFilePath!=null) { metadata.setPictures(null); metadata.addPicture(new ImageData(com.sdc.file.utils.Util.imageToByteArray(imageFilePath),"image/jpg", "", 0)); save=true; } if(save) { myID3.update(src_file, src_set, metadata); } }
static void function(String audioFilePath,String imageFilePath) throws ID3ReadException, IOException, ID3WriteException { boolean save=false; MyID3 myID3 = new MyID3(); File src_file=new File(audioFilePath); MusicMetadataSet src_set = myID3.read(src_file); MusicMetadata metadata = (MusicMetadata) src_set.getSimplified(); if (imageFilePath!=null) { metadata.setPictures(null); metadata.addPicture(new ImageData(com.sdc.file.utils.Util.imageToByteArray(imageFilePath),STR, "", 0)); save=true; } if(save) { myID3.update(src_file, src_set, metadata); } }
/** * Set the mp3 cover * @param audioFilePath Absolute path of the source audio file * @param imageFilePath Absolute path of the image file * @throws ID3ReadException * @throws IOException * @throws ID3WriteException */
Set the mp3 cover
setMp3Cover
{ "repo_name": "sdecri/Souni", "path": "src/suoni/Utils.java", "license": "gpl-2.0", "size": 30714 }
[ "java.io.File", "java.io.IOException", "org.cmc.music.common.ID3ReadException", "org.cmc.music.common.ID3WriteException", "org.cmc.music.metadata.ImageData", "org.cmc.music.metadata.MusicMetadata", "org.cmc.music.metadata.MusicMetadataSet", "org.cmc.music.myid3.MyID3" ]
import java.io.File; import java.io.IOException; import org.cmc.music.common.ID3ReadException; import org.cmc.music.common.ID3WriteException; import org.cmc.music.metadata.ImageData; import org.cmc.music.metadata.MusicMetadata; import org.cmc.music.metadata.MusicMetadataSet; import org.cmc.music.myid3.MyID3;
import java.io.*; import org.cmc.music.common.*; import org.cmc.music.metadata.*; import org.cmc.music.myid3.*;
[ "java.io", "org.cmc.music" ]
java.io; org.cmc.music;
245,348
protected Injector getInjector() { return this.injector; }
Injector function() { return this.injector; }
/** Replies the injector. * * @return the injector. */
Replies the injector
getInjector
{ "repo_name": "sarl/sarl", "path": "main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java", "license": "apache-2.0", "size": 26754 }
[ "com.google.inject.Injector" ]
import com.google.inject.Injector;
import com.google.inject.*;
[ "com.google.inject" ]
com.google.inject;
1,507,541
public void setNullPolicy(final NullPolicy nullPolicy) { this.nullPolicy = Objects.requireNonNull(nullPolicy, "nullPolicy"); }
void function(final NullPolicy nullPolicy) { this.nullPolicy = Objects.requireNonNull(nullPolicy, STR); }
/** * Set the policy regarding how null parameters are handled. * * @param nullPolicy The null policy */
Set the policy regarding how null parameters are handled
setNullPolicy
{ "repo_name": "SpongePowered/event-impl-gen", "path": "src/main/java/org/spongepowered/eventimplgen/factory/ClassGenerator.java", "license": "mit", "size": 18838 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
175,342
protected Activity xml2While(Activity whileActivity, Element whileElement) { While _while; if (whileActivity instanceof While) { _while = (While) whileActivity; } else { _while = BPELFactory.eINSTANCE.createWhile(); _while.setElement(whileElement); } // Handle condition element Element conditionElement = ReconciliationHelper .getBPELChildElementByLocalName(whileElement, "condition"); if (conditionElement != null && _while.getCondition() == null) { _while.setCondition(xml2Condition(_while.getCondition(), conditionElement)); } else if (conditionElement == null) { _while.setCondition(null); } _while.setActivity(getChildActivity(_while, whileElement)); setStandardAttributes(whileElement, _while); return _while; }
Activity function(Activity whileActivity, Element whileElement) { While _while; if (whileActivity instanceof While) { _while = (While) whileActivity; } else { _while = BPELFactory.eINSTANCE.createWhile(); _while.setElement(whileElement); } Element conditionElement = ReconciliationHelper .getBPELChildElementByLocalName(whileElement, STR); if (conditionElement != null && _while.getCondition() == null) { _while.setCondition(xml2Condition(_while.getCondition(), conditionElement)); } else if (conditionElement == null) { _while.setCondition(null); } _while.setActivity(getChildActivity(_while, whileElement)); setStandardAttributes(whileElement, _while); return _while; }
/** * Converts an XML while element to a BPEL While object. */
Converts an XML while element to a BPEL While object
xml2While
{ "repo_name": "splinter/developer-studio", "path": "bps/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java", "license": "apache-2.0", "size": 140766 }
[ "org.eclipse.bpel.model.Activity", "org.eclipse.bpel.model.BPELFactory", "org.eclipse.bpel.model.While", "org.w3c.dom.Element" ]
import org.eclipse.bpel.model.Activity; import org.eclipse.bpel.model.BPELFactory; import org.eclipse.bpel.model.While; import org.w3c.dom.Element;
import org.eclipse.bpel.model.*; import org.w3c.dom.*;
[ "org.eclipse.bpel", "org.w3c.dom" ]
org.eclipse.bpel; org.w3c.dom;
2,312,723
public static List<Pattern> getNoProxyHostPatterns(String noProxyHost) { if (noProxyHost==null) return Collections.emptyList(); List<Pattern> r = Lists.newArrayList(); for (String s : noProxyHost.split("[ \t\n,|]+")) { if (s.length()==0) continue; r.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*"))); } return r; } /** * @deprecated * Use {@link #createProxy(String)}
static List<Pattern> function(String noProxyHost) { if (noProxyHost==null) return Collections.emptyList(); List<Pattern> r = Lists.newArrayList(); for (String s : noProxyHost.split(STR)) { if (s.length()==0) continue; r.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*"))); } return r; } /** * * Use {@link #createProxy(String)}
/** * Returns the list of properly formatted no proxy host names. */
Returns the list of properly formatted no proxy host names
getNoProxyHostPatterns
{ "repo_name": "gusreiber/jenkins", "path": "core/src/main/java/hudson/ProxyConfiguration.java", "license": "mit", "size": 13540 }
[ "com.google.common.collect.Lists", "java.util.Collections", "java.util.List", "java.util.regex.Pattern" ]
import com.google.common.collect.Lists; import java.util.Collections; import java.util.List; import java.util.regex.Pattern;
import com.google.common.collect.*; import java.util.*; import java.util.regex.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,192,853
void unassign(final byte[] regionName, final boolean force) throws IOException;
void unassign(final byte[] regionName, final boolean force) throws IOException;
/** * Unassign a region from current hosting regionserver. Region will then be assigned to a * regionserver chosen at random. Region could be reassigned back to the same server. Use {@link * #move(byte[], byte[])} if you want to control the region movement. * * @param regionName Region to unassign. Will clear any existing RegionPlan if one found. * @param force If true, force unassign (Will remove region from regions-in-transition too if * present. If results in double assignment use hbck -fix to resolve. To be used by experts). */
Unassign a region from current hosting regionserver. Region will then be assigned to a regionserver chosen at random. Region could be reassigned back to the same server. Use <code>#move(byte[], byte[])</code> if you want to control the region movement
unassign
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java", "license": "apache-2.0", "size": 97415 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
90,710
public static SimpleExpressionsPackage init() { if (isInited) return (SimpleExpressionsPackage)EPackage.Registry.INSTANCE.getEPackage(SimpleExpressionsPackage.eNS_URI); // Obtain or create and register package SimpleExpressionsPackageImpl theSimpleExpressionsPackage = (SimpleExpressionsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SimpleExpressionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SimpleExpressionsPackageImpl()); isInited = true; // Initialize simple dependencies EcorePackage.eINSTANCE.eClass(); // Create package meta-data objects theSimpleExpressionsPackage.createPackageContents(); // Initialize created meta-data theSimpleExpressionsPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theSimpleExpressionsPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(SimpleExpressionsPackage.eNS_URI, theSimpleExpressionsPackage); return theSimpleExpressionsPackage; }
static SimpleExpressionsPackage function() { if (isInited) return (SimpleExpressionsPackage)EPackage.Registry.INSTANCE.getEPackage(SimpleExpressionsPackage.eNS_URI); SimpleExpressionsPackageImpl theSimpleExpressionsPackage = (SimpleExpressionsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SimpleExpressionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SimpleExpressionsPackageImpl()); isInited = true; EcorePackage.eINSTANCE.eClass(); theSimpleExpressionsPackage.createPackageContents(); theSimpleExpressionsPackage.initializePackageContents(); theSimpleExpressionsPackage.freeze(); EPackage.Registry.INSTANCE.put(SimpleExpressionsPackage.eNS_URI, theSimpleExpressionsPackage); return theSimpleExpressionsPackage; }
/** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * * <p>This method is used to initialize {@link SimpleExpressionsPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */
Creates, registers, and initializes the Package for this model, and for any others upon which it depends. This method is used to initialize <code>SimpleExpressionsPackage#eINSTANCE</code> when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
init
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/testlanguages/simpleExpressions/impl/SimpleExpressionsPackageImpl.java", "license": "epl-1.0", "size": 8901 }
[ "org.eclipse.emf.ecore.EPackage", "org.eclipse.emf.ecore.EcorePackage", "org.eclipse.xtext.testlanguages.simpleExpressions.SimpleExpressionsPackage" ]
import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.xtext.testlanguages.simpleExpressions.SimpleExpressionsPackage;
import org.eclipse.emf.ecore.*; import org.eclipse.xtext.testlanguages.*;
[ "org.eclipse.emf", "org.eclipse.xtext" ]
org.eclipse.emf; org.eclipse.xtext;
2,313,206
@Override protected String createKey(Bookmark value) { return value.getName(); }
String function(Bookmark value) { return value.getName(); }
/** * Creates the key for storing the object in the properties. * * @param value the object to create the key from * @return the generated key */
Creates the key for storing the object in the properties
createKey
{ "repo_name": "automenta/adams-core", "path": "src/main/java/adams/gui/tools/FileChooserBookmarksManagementPanel.java", "license": "gpl-3.0", "size": 10864 }
[ "com.googlecode.jfilechooserbookmarks.Bookmark" ]
import com.googlecode.jfilechooserbookmarks.Bookmark;
import com.googlecode.jfilechooserbookmarks.*;
[ "com.googlecode.jfilechooserbookmarks" ]
com.googlecode.jfilechooserbookmarks;
423,530
public int getIndexOf(JPanel panel) { if (panels == null) { return -1; } return panels.indexOf(panel); }
int function(JPanel panel) { if (panels == null) { return -1; } return panels.indexOf(panel); }
/** * Returns the index of the specified panel in this model. * * @param panel - the panel * @return the panel index */
Returns the index of the specified panel in this model
getIndexOf
{ "repo_name": "takisd123/executequery", "path": "src/org/underworldlabs/swing/wizard/DefaultWizardProcessModel.java", "license": "gpl-3.0", "size": 6109 }
[ "javax.swing.JPanel" ]
import javax.swing.JPanel;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
624,023
public static String binaryToString(BinaryObject obj) { int hash = obj.hashCode(); if (obj instanceof BinaryObjectEx) { BinaryObjectEx objEx = (BinaryObjectEx)obj; BinaryType meta; try { meta = ((BinaryObjectEx)obj).rawType(); } catch (BinaryObjectException ignore) { meta = null; } if (meta != null) { if (meta.isEnum()) { try { return obj.deserialize().toString(); } catch (BinaryObjectException ignore) { // NO-op. } } SB buf = new SB(meta.typeName()); if (meta.fieldNames() != null) { buf.a(" [hash=").a(hash); for (String name : meta.fieldNames()) { Object val = objEx.field(name); buf.a(", ").a(name).a('=').a(val); } buf.a(']'); return buf.toString(); } } } return S.toString(obj.getClass().getSimpleName(), "hash", hash, false, "typeId", obj.type().typeId(), true); }
static String function(BinaryObject obj) { int hash = obj.hashCode(); if (obj instanceof BinaryObjectEx) { BinaryObjectEx objEx = (BinaryObjectEx)obj; BinaryType meta; try { meta = ((BinaryObjectEx)obj).rawType(); } catch (BinaryObjectException ignore) { meta = null; } if (meta != null) { if (meta.isEnum()) { try { return obj.deserialize().toString(); } catch (BinaryObjectException ignore) { } } SB buf = new SB(meta.typeName()); if (meta.fieldNames() != null) { buf.a(STR).a(hash); for (String name : meta.fieldNames()) { Object val = objEx.field(name); buf.a(STR).a(name).a('=').a(val); } buf.a(']'); return buf.toString(); } } } return S.toString(obj.getClass().getSimpleName(), "hash", hash, false, STR, obj.type().typeId(), true); }
/** * Convert Binary object to string. * * @param obj Binary object. * @return String representation of Binary object. */
Convert Binary object to string
binaryToString
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/visor/query/VisorQueryUtils.java", "license": "apache-2.0", "size": 17777 }
[ "org.apache.ignite.binary.BinaryObject", "org.apache.ignite.binary.BinaryObjectException", "org.apache.ignite.binary.BinaryType", "org.apache.ignite.internal.binary.BinaryObjectEx", "org.apache.ignite.internal.util.typedef.internal.S" ]
import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.binary.BinaryObjectException; import org.apache.ignite.binary.BinaryType; import org.apache.ignite.internal.binary.BinaryObjectEx; import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.binary.*; import org.apache.ignite.internal.binary.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,126,557
static public void main(String[] sa) throws IOException, FileNotFoundException, InterruptedException { byte[] localBa = new byte[10240]; if (sa.length < 1) { System.err.println(SYNTAX_MSG); System.exit(1); } String progname = sa[0]; System.err.println( "Enter any input that you want passed to SqlTool via stdin\n" + "(end with EOF, like Ctrl-D or Ctrl-Z+ENTER):"); File tmpFile = File.createTempFile("ExecHarness-", ".input"); String specifiedCharSet = System.getProperty("harness.charset"); String charset = ((specifiedCharSet == null) ? DEFAULT_CHARSET : specifiedCharSet); FileOutputStream fos = new FileOutputStream(tmpFile); int i; while ((i = System.in.read(localBa)) > 0) { fos.write(localBa, 0, i); } fos.close(); ExecHarness harness = new ExecHarness(progname); harness.setArgs(shift(sa)); harness.setInput(tmpFile); harness.exec(); tmpFile.delete(); int retval = harness.getExitValue(); System.err.println( "STDOUT ******************************************"); System.out.print(harness.getStdout()); System.err.println( "ERROUT ******************************************"); System.err.print(harness.getErrout()); System.err.println( "*************************************************"); System.err.println(progname + " exited with value " + retval); harness.clear(); System.exit(retval); } File input = null; String program = null; int exitValue = 0; boolean executed = false; // I'm sure there's a better way to do this. Can't think of it right now. String[] mtStringArray = {}; String[] args = mtStringArray; // The extra 1 is so we can request 1 more byte than we want. // If that read is satisfied, we know that we read > MAX_PROG_OUTPUT. private byte[] ba = new byte[MAX_PROG_OUTPUT + 1]; private String stdout = null; private String errout = null; private static final String DEFAULT_CHARSET = "US-ASCII";
static void function(String[] sa) throws IOException, FileNotFoundException, InterruptedException { byte[] localBa = new byte[10240]; if (sa.length < 1) { System.err.println(SYNTAX_MSG); System.exit(1); } String progname = sa[0]; System.err.println( STR + STR); File tmpFile = File.createTempFile(STR, STR); String specifiedCharSet = System.getProperty(STR); String charset = ((specifiedCharSet == null) ? DEFAULT_CHARSET : specifiedCharSet); FileOutputStream fos = new FileOutputStream(tmpFile); int i; while ((i = System.in.read(localBa)) > 0) { fos.write(localBa, 0, i); } fos.close(); ExecHarness harness = new ExecHarness(progname); harness.setArgs(shift(sa)); harness.setInput(tmpFile); harness.exec(); tmpFile.delete(); int retval = harness.getExitValue(); System.err.println( STR); System.out.print(harness.getStdout()); System.err.println( STR); System.err.print(harness.getErrout()); System.err.println( STR); System.err.println(progname + STR + retval); harness.clear(); System.exit(retval); } File input = null; String program = null; int exitValue = 0; boolean executed = false; String[] mtStringArray = {}; String[] args = mtStringArray; private byte[] ba = new byte[MAX_PROG_OUTPUT + 1]; private String stdout = null; private String errout = null; private static final String DEFAULT_CHARSET = STR;
/** * To test the ExecHarness class itself. * (Basically, a sanity check). * * Note that we always exec another process. This makes it safe to * execute Java classes which may call System.exit(). * * @param sa sa[0] is the program to be run. * Remaining arguments will be passed as command-line args * to the sa[0] program. */
To test the ExecHarness class itself. (Basically, a sanity check). Note that we always exec another process. This makes it safe to execute Java classes which may call System.exit()
main
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/hsqldb1733/src/org/hsqldb/test/ExecHarness.java", "license": "lgpl-3.0", "size": 12323 }
[ "java.io.File", "java.io.FileNotFoundException", "java.io.FileOutputStream", "java.io.IOException" ]
import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
681,056
List<?> propertyValues(Class<?> entityClass, String propertyName, String where, String order) throws DataProviderException;
List<?> propertyValues(Class<?> entityClass, String propertyName, String where, String order) throws DataProviderException;
/** * Obtiene los valores de una propiedad. * * @param entityClass * clase entidad * @param propertyName * Nombre de la propiedad * @param where * sentencia de condición HQL. * @param order * sentencia de ordenación HQL. Ej.: 'name, date desc' * @throws excepción * @return list values */
Obtiene los valores de una propiedad
propertyValues
{ "repo_name": "rranz/meccano4j_vaadin", "path": "javalego/javalego_data/src/main/java/com/javalego/data/DataProvider.java", "license": "gpl-3.0", "size": 6967 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,403,122
@SideOnly(Side.CLIENT) public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { return Item.getItemById(0); }
@SideOnly(Side.CLIENT) Item function(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { return Item.getItemById(0); }
/** * Gets an item for the block being called on. Args: world, x, y, z */
Gets an item for the block being called on. Args: world, x, y, z
getItem
{ "repo_name": "jtrent238/jtrent238FoodMod", "path": "src/main/java/com/jtrent238/foodmod/Blockcandyportal.java", "license": "lgpl-2.1", "size": 6333 }
[ "net.minecraft.item.Item", "net.minecraft.world.World" ]
import net.minecraft.item.Item; import net.minecraft.world.World;
import net.minecraft.item.*; import net.minecraft.world.*;
[ "net.minecraft.item", "net.minecraft.world" ]
net.minecraft.item; net.minecraft.world;
1,935,227
public boolean isWarning() { return fSeverity == IStatus.WARNING; }
boolean function() { return fSeverity == IStatus.WARNING; }
/** * Returns if the status' severity is WARNING. */
Returns if the status' severity is WARNING
isWarning
{ "repo_name": "webratio/typescript.java", "path": "eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/ui/preferences/StatusInfo.java", "license": "mit", "size": 4739 }
[ "org.eclipse.core.runtime.IStatus" ]
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.*;
[ "org.eclipse.core" ]
org.eclipse.core;
1,450,729
private JTextField getServiceURL() { if (serviceURL == null) { serviceURL = new JTextField(); } return serviceURL; }
JTextField function() { if (serviceURL == null) { serviceURL = new JTextField(); } return serviceURL; }
/** * This method initializes serviceURL * * @return javax.swing.JTextField */
This method initializes serviceURL
getServiceURL
{ "repo_name": "NCIP/cagrid", "path": "cagrid/Software/core/caGrid/projects/gaards-ui/src/org/cagrid/grape/TargetGridServiceEditor.java", "license": "bsd-3-clause", "size": 16219 }
[ "javax.swing.JTextField" ]
import javax.swing.JTextField;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,890,189
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<BackupShortTermRetentionPolicyInner>, BackupShortTermRetentionPolicyInner> beginUpdate( String resourceGroupName, String serverName, String databaseName, ShortTermRetentionPolicyName policyName, Integer retentionDays);
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<BackupShortTermRetentionPolicyInner>, BackupShortTermRetentionPolicyInner> beginUpdate( String resourceGroupName, String serverName, String databaseName, ShortTermRetentionPolicyName policyName, Integer retentionDays);
/** * Updates a database's short term retention policy. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value * from the Azure Resource Manager API or the portal. * @param serverName The name of the server. * @param databaseName The name of the database. * @param policyName The policy name. Should always be "default". * @param retentionDays The backup retention period in days. This is how many days Point-in-Time Restore will be * supported. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a short term retention policy. */
Updates a database's short term retention policy
beginUpdate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/fluent/BackupShortTermRetentionPoliciesClient.java", "license": "mit", "size": 29597 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.sql.fluent.models.BackupShortTermRetentionPolicyInner", "com.azure.resourcemanager.sql.models.ShortTermRetentionPolicyName" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sql.fluent.models.BackupShortTermRetentionPolicyInner; import com.azure.resourcemanager.sql.models.ShortTermRetentionPolicyName;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.sql.fluent.models.*; import com.azure.resourcemanager.sql.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,566,953
@SuppressWarnings("unchecked") private static IgniteConfiguration getConfiguration(String springCfgPath, @Nullable String logCfgPath) throws IgniteCheckedException { assert springCfgPath != null; File path = GridTestUtils.resolveIgnitePath(springCfgPath); if (path == null) throw new IgniteCheckedException("Spring XML configuration file path is invalid: " + new File(springCfgPath) + ". Note that this path should be either absolute path or a relative path to IGNITE_HOME."); if (!path.isFile()) throw new IgniteCheckedException("Provided file path is not a file: " + path); // Add no-op logger to remove no-appender warning. Appender app = new NullAppender(); Logger.getRootLogger().addAppender(app); ApplicationContext springCtx; try { springCtx = new FileSystemXmlApplicationContext(path.toURI().toURL().toString()); } catch (BeansException | MalformedURLException e) { throw new IgniteCheckedException("Failed to instantiate Spring XML application context: " + e.getMessage(), e); } Map cfgMap; try { // Note: Spring is not generics-friendly. cfgMap = springCtx.getBeansOfType(IgniteConfiguration.class); } catch (BeansException e) { throw new IgniteCheckedException("Failed to instantiate bean [type=" + IgniteConfiguration.class + ", err=" + e.getMessage() + ']', e); } if (cfgMap == null) throw new IgniteCheckedException("Failed to find a single grid factory configuration in: " + path); // Remove previously added no-op logger. Logger.getRootLogger().removeAppender(app); if (cfgMap.size() != 1) throw new IgniteCheckedException("Spring configuration file should contain exactly 1 grid configuration: " + path); IgniteConfiguration cfg = (IgniteConfiguration)F.first(cfgMap.values()); assert cfg != null; if (logCfgPath != null) cfg.setGridLogger(new GridTestLog4jLogger(U.resolveIgniteUrl(logCfgPath))); return cfg; }
@SuppressWarnings(STR) static IgniteConfiguration function(String springCfgPath, @Nullable String logCfgPath) throws IgniteCheckedException { assert springCfgPath != null; File path = GridTestUtils.resolveIgnitePath(springCfgPath); if (path == null) throw new IgniteCheckedException(STR + new File(springCfgPath) + STR); if (!path.isFile()) throw new IgniteCheckedException(STR + path); Appender app = new NullAppender(); Logger.getRootLogger().addAppender(app); ApplicationContext springCtx; try { springCtx = new FileSystemXmlApplicationContext(path.toURI().toURL().toString()); } catch (BeansException MalformedURLException e) { throw new IgniteCheckedException(STR + e.getMessage(), e); } Map cfgMap; try { cfgMap = springCtx.getBeansOfType(IgniteConfiguration.class); } catch (BeansException e) { throw new IgniteCheckedException(STR + IgniteConfiguration.class + STR + e.getMessage() + ']', e); } if (cfgMap == null) throw new IgniteCheckedException(STR + path); Logger.getRootLogger().removeAppender(app); if (cfgMap.size() != 1) throw new IgniteCheckedException(STR + path); IgniteConfiguration cfg = (IgniteConfiguration)F.first(cfgMap.values()); assert cfg != null; if (logCfgPath != null) cfg.setGridLogger(new GridTestLog4jLogger(U.resolveIgniteUrl(logCfgPath))); return cfg; }
/** * Initializes configurations. * * @param springCfgPath Configuration file path. * @param logCfgPath Log file name. * @return List of configurations. * @throws IgniteCheckedException If an error occurs. */
Initializes configurations
getConfiguration
{ "repo_name": "alexzaitzev/ignite", "path": "modules/core/src/test/java/org/apache/ignite/startup/GridRandomCommandLineLoader.java", "license": "apache-2.0", "size": 13274 }
[ "java.io.File", "java.net.MalformedURLException", "java.util.Map", "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.configuration.IgniteConfiguration", "org.apache.ignite.internal.util.typedef.F", "org.apache.ignite.internal.util.typedef.internal.U", "org.apache.ignite.testframework.GridTestUtils", "org.apache.ignite.testframework.junits.logger.GridTestLog4jLogger", "org.apache.log4j.Appender", "org.apache.log4j.Logger", "org.apache.log4j.varia.NullAppender", "org.jetbrains.annotations.Nullable", "org.springframework.beans.BeansException", "org.springframework.context.ApplicationContext", "org.springframework.context.support.FileSystemXmlApplicationContext" ]
import java.io.File; import java.net.MalformedURLException; import java.util.Map; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.junits.logger.GridTestLog4jLogger; import org.apache.log4j.Appender; import org.apache.log4j.Logger; import org.apache.log4j.varia.NullAppender; import org.jetbrains.annotations.Nullable; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext;
import java.io.*; import java.net.*; import java.util.*; import org.apache.ignite.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.testframework.*; import org.apache.ignite.testframework.junits.logger.*; import org.apache.log4j.*; import org.apache.log4j.varia.*; import org.jetbrains.annotations.*; import org.springframework.beans.*; import org.springframework.context.*; import org.springframework.context.support.*;
[ "java.io", "java.net", "java.util", "org.apache.ignite", "org.apache.log4j", "org.jetbrains.annotations", "org.springframework.beans", "org.springframework.context" ]
java.io; java.net; java.util; org.apache.ignite; org.apache.log4j; org.jetbrains.annotations; org.springframework.beans; org.springframework.context;
1,492,021
// TODO(bazel-team): replace this method with assertThat(iterable).contains(target). // That doesn't work now because dynamic configurations aren't yet applied to top-level targets. // This means that getConfiguredTarget("//go:two") returns a different configuration than // requesting "//go:two" as a dependency. So the configured targets aren't considered "equal". // Once we apply dynamic configs to top-level targets this discrepancy will go away. protected void assertDirectPrerequisitesContain(ConfiguredTarget target, ConfiguredTarget dep) throws Exception { Iterable<ConfiguredTarget> prereqs = getDirectPrerequisites(target); BuildConfiguration depConfig = dep.getConfiguration(); for (ConfiguredTarget contained : prereqs) { if (contained.getLabel().equals(dep.getLabel())) { BuildConfiguration containedConfig = contained.getConfiguration(); if (containedConfig == null && depConfig == null) { return; } else if (containedConfig != null && depConfig != null && containedConfig.cloneOptions().equals(depConfig.cloneOptions())) { return; } } } fail("Cannot find " + target.toString() + " in " + prereqs.toString()); }
void function(ConfiguredTarget target, ConfiguredTarget dep) throws Exception { Iterable<ConfiguredTarget> prereqs = getDirectPrerequisites(target); BuildConfiguration depConfig = dep.getConfiguration(); for (ConfiguredTarget contained : prereqs) { if (contained.getLabel().equals(dep.getLabel())) { BuildConfiguration containedConfig = contained.getConfiguration(); if (containedConfig == null && depConfig == null) { return; } else if (containedConfig != null && depConfig != null && containedConfig.cloneOptions().equals(depConfig.cloneOptions())) { return; } } } fail(STR + target.toString() + STR + prereqs.toString()); }
/** * Asserts that a target's prerequisites contain the given dependency. */
Asserts that a target's prerequisites contain the given dependency
assertDirectPrerequisitesContain
{ "repo_name": "mrdomino/bazel", "path": "src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java", "license": "apache-2.0", "size": 77290 }
[ "com.google.devtools.build.lib.analysis.ConfiguredTarget", "com.google.devtools.build.lib.analysis.config.BuildConfiguration", "org.junit.Assert" ]
import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import org.junit.Assert;
import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.analysis.config.*; import org.junit.*;
[ "com.google.devtools", "org.junit" ]
com.google.devtools; org.junit;
2,373,935
public StepDataInterface getStepData() { return new MongoDBLookupData(); }
StepDataInterface function() { return new MongoDBLookupData(); }
/** * Get a new instance of the appropriate data class. This data class implements the * StepDataInterface. It basically contains the persisting data that needs to live on, even if a * worker thread is terminated. * * @return The appropriate StepDataInterface class. */
Get a new instance of the appropriate data class. This data class implements the StepDataInterface. It basically contains the persisting data that needs to live on, even if a worker thread is terminated
getStepData
{ "repo_name": "ivylabs/ivy-pdi-mongodb-steps", "path": "src/main/java/com/ivyis/di/trans/steps/mongodb/MongoDBLookupMeta.java", "license": "agpl-3.0", "size": 19620 }
[ "org.pentaho.di.trans.step.StepDataInterface" ]
import org.pentaho.di.trans.step.StepDataInterface;
import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,142,988
public static JMenu addAll(JMenu menu, Collection<Action> actions) { for (Action action : actions) { menu.add(menuComponentFactory.createActionComponent(action)); } return menu; }
static JMenu function(JMenu menu, Collection<Action> actions) { for (Action action : actions) { menu.add(menuComponentFactory.createActionComponent(action)); } return menu; }
/** * Adds all <code>Action</code> objects in the given <code>Collection</code> * to the given <code>JMenu</code> * * @param menu * the menu to add the actions to * @param actions * a <code>Collection</code> that may contain some * <code>Action</code>s. * @return the same menu */
Adds all <code>Action</code> objects in the given <code>Collection</code> to the given <code>JMenu</code>
addAll
{ "repo_name": "tilm4nn/swing-utils", "path": "src/de/tkuhn/swing/actions/ActionUtils.java", "license": "mit", "size": 5817 }
[ "java.util.Collection", "javax.swing.Action", "javax.swing.JMenu" ]
import java.util.Collection; import javax.swing.Action; import javax.swing.JMenu;
import java.util.*; import javax.swing.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
900,099
public void testDescendingKeySetDescendingIteratorOrder() { TreeMap map = map5(); NavigableSet s = map.descendingKeySet(); Iterator i = s.descendingIterator(); Integer last = (Integer)i.next(); assertEquals(last, one); int count = 1; while (i.hasNext()) { Integer k = (Integer)i.next(); assertTrue(last.compareTo(k) < 0); last = k; ++count; } assertEquals(5, count); }
void function() { TreeMap map = map5(); NavigableSet s = map.descendingKeySet(); Iterator i = s.descendingIterator(); Integer last = (Integer)i.next(); assertEquals(last, one); int count = 1; while (i.hasNext()) { Integer k = (Integer)i.next(); assertTrue(last.compareTo(k) < 0); last = k; ++count; } assertEquals(5, count); }
/** * descending iterator of descendingKeySet is ordered */
descending iterator of descendingKeySet is ordered
testDescendingKeySetDescendingIteratorOrder
{ "repo_name": "debian-pkg-android-tools/android-platform-libcore", "path": "jsr166-tests/src/test/java/jsr166/TreeMapTest.java", "license": "gpl-2.0", "size": 33145 }
[ "java.util.Iterator", "java.util.NavigableSet", "java.util.TreeMap" ]
import java.util.Iterator; import java.util.NavigableSet; import java.util.TreeMap;
import java.util.*;
[ "java.util" ]
java.util;
43,397
public static void main(String[] args) { // read the integers from a file In in = new In(args[0]); int[] whitelist = in.readAllInts(); // sort the array Arrays.sort(whitelist); // read integer key from standard input; print if not in whitelist while (!StdIn.isEmpty()) { int key = StdIn.readInt(); if (BinarySearch.indexOf(whitelist, key) == -1) StdOut.println(key); } } } /****************************************************************************** * Copyright 2002-2015, Robert Sedgewick and Kevin Wayne. * * This file is part of algs4.jar, which accompanies the textbook * * Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, * Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. * http://algs4.cs.princeton.edu * * * algs4.jar is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * algs4.jar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with algs4.jar. If not, see http://www.gnu.org/licenses.
static void function(String[] args) { In in = new In(args[0]); int[] whitelist = in.readAllInts(); Arrays.sort(whitelist); while (!StdIn.isEmpty()) { int key = StdIn.readInt(); if (BinarySearch.indexOf(whitelist, key) == -1) StdOut.println(key); } } } /****************************************************************************** * Copyright 2002-2015, Robert Sedgewick and Kevin Wayne. * * This file is part of algs4.jar, which accompanies the textbook * * Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, * Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. * http: * * * algs4.jar is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * algs4.jar is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with algs4.jar. If not, see http:
/** * Reads in a sequence of integers from the whitelist file, specified as * a command-line argument; reads in integers from standard input; * prints to standard output those integers that do <em>not</em> appear in the file. */
Reads in a sequence of integers from the whitelist file, specified as a command-line argument; reads in integers from standard input; prints to standard output those integers that do not appear in the file
main
{ "repo_name": "yu-yuxuan/algs4_exercise", "path": "src/main/java/edu/princeton/cs/algs4/BinarySearch.java", "license": "gpl-3.0", "size": 4557 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,167,728
public ImmuTable without(Position index) { throw new SubclassResponsibilityException(); }
ImmuTable function(Position index) { throw new SubclassResponsibilityException(); }
/** * Return a new table just like the current one except with the association whose * key is 'index'. */
Return a new table just like the current one except with the association whose key is 'index'
without
{ "repo_name": "jonesd/udanax-gold2java", "path": "abora-gold/src/generated-sources/translator/info/dgjones/abora/gold/collection/tables/ImmuTable.java", "license": "mit", "size": 12354 }
[ "info.dgjones.abora.gold.collection.tables.ImmuTable", "info.dgjones.abora.gold.java.exception.SubclassResponsibilityException", "info.dgjones.abora.gold.spaces.basic.Position" ]
import info.dgjones.abora.gold.collection.tables.ImmuTable; import info.dgjones.abora.gold.java.exception.SubclassResponsibilityException; import info.dgjones.abora.gold.spaces.basic.Position;
import info.dgjones.abora.gold.collection.tables.*; import info.dgjones.abora.gold.java.exception.*; import info.dgjones.abora.gold.spaces.basic.*;
[ "info.dgjones.abora" ]
info.dgjones.abora;
2,875,820
@Test public void testFindOperationsGeographic2Geographic() throws Exception { String source = "EPSG:4258"; String target = "EPSG:4326"; int min = 2; String expectedText = "AUTHORITY[\"EPSG\",\"1149\"]"; Set<CoordinateOperation> operations = findOperations(source, target); int size = operations.size(); Assert.assertTrue( size >= min); // at least min operations should be registered in the database for // this CRS pair assertOperationContained(operations, expectedText); }
void function() throws Exception { String source = STR; String target = STR; int min = 2; String expectedText = STREPSG\",\"1149\"]"; Set<CoordinateOperation> operations = findOperations(source, target); int size = operations.size(); Assert.assertTrue( size >= min); assertOperationContained(operations, expectedText); }
/** * Tests findOperations method for a pair of known CRSs. 4258 (Geographic2D) to 4326 * (Geographic2D), with different datum */
Tests findOperations method for a pair of known CRSs. 4258 (Geographic2D) to 4326 (Geographic2D), with different datum
testFindOperationsGeographic2Geographic
{ "repo_name": "geotools/geotools", "path": "modules/plugin/epsg-hsql/src/test/java/org/geotools/referencing/factory/epsg/hsql/OperationFactoryTest.java", "license": "lgpl-2.1", "size": 25650 }
[ "java.util.Set", "org.junit.Assert", "org.opengis.referencing.operation.CoordinateOperation" ]
import java.util.Set; import org.junit.Assert; import org.opengis.referencing.operation.CoordinateOperation;
import java.util.*; import org.junit.*; import org.opengis.referencing.operation.*;
[ "java.util", "org.junit", "org.opengis.referencing" ]
java.util; org.junit; org.opengis.referencing;
26,078
public String readLine() throws IOException { if (inStream == null) { return null; } int totalIn = 0; if (inflater != null) { totalIn = inflater.getTotalIn(); } StringBuffer lineBuffer = new StringBuffer(LINE_BUFFER_LENGTH); int c; int lengthRead = 0; while (true) { c = read(); lengthRead++; if (c < 0) {// stream ended... a valid line could not be read... return null if (lineBuffer.length() == 0) { return null; } else { break; } } else if (c == CR) {// skip \r and continue... we only care for \n continue; } else if (c == LF) {// found the end of the line... break here break; } else { // appending char is much faster then int! lineBuffer.append((char) c); } } // if ( bandwidthController != null ) // { // // adjust the read length to the compressed data read. // if ( inflater != null ) // { // lengthRead = inflater.getTotalIn() - totalIn; // } // bandwidthController.controlBandwidth( lengthRead ); // } return lineBuffer.toString(); }
String function() throws IOException { if (inStream == null) { return null; } int totalIn = 0; if (inflater != null) { totalIn = inflater.getTotalIn(); } StringBuffer lineBuffer = new StringBuffer(LINE_BUFFER_LENGTH); int c; int lengthRead = 0; while (true) { c = read(); lengthRead++; if (c < 0) { if (lineBuffer.length() == 0) { return null; } else { break; } } else if (c == CR) { continue; } else if (c == LF) { break; } else { lineBuffer.append((char) c); } } return lineBuffer.toString(); }
/** * Reads till the next \n. In the returned string \r and \n is not included. * If the stream ended null is returned. * Throttle is controlled when using this method. */
Reads till the next \n. In the returned string \r and \n is not included. If the stream ended null is returned. Throttle is controlled when using this method
readLine
{ "repo_name": "deepstupid/phex", "path": "src/main/java/phex/util/GnutellaInputStream.java", "license": "agpl-3.0", "size": 9123 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,688,350
public Map<String, List<Agent>> getRunningAgents() { return (runningAgents); }
Map<String, List<Agent>> function() { return (runningAgents); }
/** * Returns the current collection of running agents. * @return agents */
Returns the current collection of running agents
getRunningAgents
{ "repo_name": "structr/structr", "path": "structr-core/src/main/java/org/structr/agent/AgentService.java", "license": "gpl-3.0", "size": 7915 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,795,187
public ApiResponse numberOfResults() throws ClientApiException { Map<String, String> map = null; return api.callApi("ajaxSpider", "view", "numberOfResults", map); }
ApiResponse function() throws ClientApiException { Map<String, String> map = null; return api.callApi(STR, "view", STR, map); }
/** * This component is optional and therefore the API will only work if it is installed */
This component is optional and therefore the API will only work if it is installed
numberOfResults
{ "repo_name": "profjrr/zaproxy", "path": "src/org/zaproxy/clientapi/gen/AjaxSpider.java", "license": "apache-2.0", "size": 2824 }
[ "java.util.Map", "org.zaproxy.clientapi.core.ApiResponse", "org.zaproxy.clientapi.core.ClientApiException" ]
import java.util.Map; import org.zaproxy.clientapi.core.ApiResponse; import org.zaproxy.clientapi.core.ClientApiException;
import java.util.*; import org.zaproxy.clientapi.core.*;
[ "java.util", "org.zaproxy.clientapi" ]
java.util; org.zaproxy.clientapi;
1,533,378
public ArrayList<ICardHint> getHints(){ ArrayList<ICardHint> hints = this.cardHints; this.cardHints = null; return hints; }
ArrayList<ICardHint> function(){ ArrayList<ICardHint> hints = this.cardHints; this.cardHints = null; return hints; }
/** * Get hints for all cards. * @return list of hints. */
Get hints for all cards
getHints
{ "repo_name": "majklllll/ija_prj", "path": "src/model/BoardModel.java", "license": "mit", "size": 9417 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,810,248
public String[] getColumns(String propertyPath, Criteria criteria) throws HibernateException;
String[] function(String propertyPath, Criteria criteria) throws HibernateException;
/** * Get the names of the columns mapped by a property path, * ignoring projection aliases */
Get the names of the columns mapped by a property path, ignoring projection aliases
getColumns
{ "repo_name": "ControlSystemStudio/cs-studio", "path": "thirdparty/plugins/org.csstudio.platform.libs.hibernate/project/core/src/main/java/org/hibernate/criterion/CriteriaQuery.java", "license": "epl-1.0", "size": 3829 }
[ "org.hibernate.Criteria", "org.hibernate.HibernateException" ]
import org.hibernate.Criteria; import org.hibernate.HibernateException;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
183,555
public DocumentMutation merge(@NonNullable String path, @NonNullable Map<String, Object> map);
DocumentMutation function(@NonNullable String path, @NonNullable Map<String, Object> map);
/** * Merges the existing MAP at the given FieldPath with the specified Map. * <br/><br/> * @param path the FieldPath to apply this merge operation * @param map the Map to be merged * @return {@code this} for chained invocation */
Merges the existing MAP at the given FieldPath with the specified Map.
merge
{ "repo_name": "ojai/ojai", "path": "java/core/src/main/java/org/ojai/store/DocumentMutation.java", "license": "apache-2.0", "size": 47815 }
[ "java.util.Map", "org.ojai.annotation.API" ]
import java.util.Map; import org.ojai.annotation.API;
import java.util.*; import org.ojai.annotation.*;
[ "java.util", "org.ojai.annotation" ]
java.util; org.ojai.annotation;
2,771,538
public static <T> T eachLine(InputStream stream, @ClosureParams(value=FromString.class,options={"String","String,Integer"}) Closure<T> closure) throws IOException { return eachLine(stream, 1, closure); }
static <T> T function(InputStream stream, @ClosureParams(value=FromString.class,options={STR,STR}) Closure<T> closure) throws IOException { return eachLine(stream, 1, closure); }
/** * Iterates through this stream, passing each line to the given 1 or 2 arg closure. * The stream is closed before this method returns. * * @param stream a stream * @param closure a closure (arg 1 is line, optional arg 2 is line number starting at line 1) * @return the last value returned by the closure * @throws IOException if an IOException occurs. * @see #eachLine(java.io.InputStream, int, groovy.lang.Closure) * @since 1.5.6 */
Iterates through this stream, passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns
eachLine
{ "repo_name": "antoaravinth/incubator-groovy", "path": "src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java", "license": "apache-2.0", "size": 62643 }
[ "groovy.lang.Closure", "groovy.transform.stc.ClosureParams", "groovy.transform.stc.FromString", "java.io.IOException", "java.io.InputStream" ]
import groovy.lang.Closure; import groovy.transform.stc.ClosureParams; import groovy.transform.stc.FromString; import java.io.IOException; import java.io.InputStream;
import groovy.lang.*; import groovy.transform.stc.*; import java.io.*;
[ "groovy.lang", "groovy.transform.stc", "java.io" ]
groovy.lang; groovy.transform.stc; java.io;
1,204,173
public final void addToHintMap(final DecodeHintType hintType, final Object value) { this.readerHintMap.put(hintType, value); }
final void function(final DecodeHintType hintType, final Object value) { this.readerHintMap.put(hintType, value); }
/** * Adds a new hint value to reader (decode) hint map. */
Adds a new hint value to reader (decode) hint map
addToHintMap
{ "repo_name": "punkhorn/camel-upstream", "path": "components/camel-barcode/src/main/java/org/apache/camel/dataformat/barcode/BarcodeDataFormat.java", "license": "apache-2.0", "size": 10550 }
[ "com.google.zxing.DecodeHintType" ]
import com.google.zxing.DecodeHintType;
import com.google.zxing.*;
[ "com.google.zxing" ]
com.google.zxing;
1,417,752
public static MonitoringAgent createFromXml ( Element root ) throws MalformedXMLException { try { Element elId = root.getFirstChild(); long id = Long.parseLong( elId.getFirstChild().getText()); Element pubKey = root.getChild(1); if ( !pubKey.getName().equals( "publickey" )) throw new MalformedXMLException("public key expected" ); if ( ! pubKey.getAttribute("encoding").equals( "base64")) throw new MalformedXMLException("base64 encoding expected" ); PublicKey publicKey = (PublicKey) SerializeTools.deserializeBase64 ( pubKey.getFirstChild().getText()); Element privKey = root.getChild ( 2 ); if ( !privKey.getName().equals("privatekey")) throw new MalformedXMLException("private key expected"); if ( ! privKey.getAttribute("encrypted").equals( CryptoTools.getSymmetricAlgorithm() )) throw new MalformedXMLException(CryptoTools.getSymmetricAlgorithm() + " expected"); if ( ! privKey.getAttribute("keygen").equals( CryptoTools.getSymmetricKeygenMethod() )) throw new MalformedXMLException(CryptoTools.getSymmetricKeygenMethod() + " expected"); Element elSalt= privKey.getFirstChild(); if ( !elSalt.getName().equals("salt")) throw new MalformedXMLException("salt expected"); if ( ! elSalt.getAttribute("encoding").equals("base64")) throw new MalformedXMLException("base64 encoding expected"); byte[] salt = Base64.decodeBase64 (elSalt.getFirstChild().getText()); Element data = privKey.getChild(1); if ( !data.getName().equals( "data" )) throw new MalformedXMLException("data expected"); if ( ! data.getAttribute("encoding").equals("base64")) throw new MalformedXMLException("base64 encoding expected"); byte[] encPrivate = Base64.decodeBase64( data.getFirstChild().getText()); MonitoringAgent result = new MonitoringAgent ( id, publicKey, encPrivate, salt ); return result; } catch (XMLSyntaxException e) { throw new MalformedXMLException("Error parsing XML string", e); } catch (SerializationException e) { throw new MalformedXMLException("Deserialization problems", e ); } }
static MonitoringAgent function ( Element root ) throws MalformedXMLException { try { Element elId = root.getFirstChild(); long id = Long.parseLong( elId.getFirstChild().getText()); Element pubKey = root.getChild(1); if ( !pubKey.getName().equals( STR )) throw new MalformedXMLException(STR ); if ( ! pubKey.getAttribute(STR).equals( STR)) throw new MalformedXMLException(STR ); PublicKey publicKey = (PublicKey) SerializeTools.deserializeBase64 ( pubKey.getFirstChild().getText()); Element privKey = root.getChild ( 2 ); if ( !privKey.getName().equals(STR)) throw new MalformedXMLException(STR); if ( ! privKey.getAttribute(STR).equals( CryptoTools.getSymmetricAlgorithm() )) throw new MalformedXMLException(CryptoTools.getSymmetricAlgorithm() + STR); if ( ! privKey.getAttribute(STR).equals( CryptoTools.getSymmetricKeygenMethod() )) throw new MalformedXMLException(CryptoTools.getSymmetricKeygenMethod() + STR); Element elSalt= privKey.getFirstChild(); if ( !elSalt.getName().equals("salt")) throw new MalformedXMLException(STR); if ( ! elSalt.getAttribute(STR).equals(STR)) throw new MalformedXMLException(STR); byte[] salt = Base64.decodeBase64 (elSalt.getFirstChild().getText()); Element data = privKey.getChild(1); if ( !data.getName().equals( "data" )) throw new MalformedXMLException(STR); if ( ! data.getAttribute(STR).equals(STR)) throw new MalformedXMLException(STR); byte[] encPrivate = Base64.decodeBase64( data.getFirstChild().getText()); MonitoringAgent result = new MonitoringAgent ( id, publicKey, encPrivate, salt ); return result; } catch (XMLSyntaxException e) { throw new MalformedXMLException(STR, e); } catch (SerializationException e) { throw new MalformedXMLException(STR, e ); } }
/** * * Sets the state of the object from a string representation resulting from * a previous {@link #toXmlString} call. * * @param root parsed XML document * * @exception MalformedXMLException * */
Sets the state of the object from a string representation resulting from a previous <code>#toXmlString</code> call
createFromXml
{ "repo_name": "AlexRuppert/las2peer_project", "path": "java/i5/las2peer/security/MonitoringAgent.java", "license": "mit", "size": 8986 }
[ "java.security.PublicKey", "org.apache.commons.codec.binary.Base64" ]
import java.security.PublicKey; import org.apache.commons.codec.binary.Base64;
import java.security.*; import org.apache.commons.codec.binary.*;
[ "java.security", "org.apache.commons" ]
java.security; org.apache.commons;
628,296
protected void setUp() throws Exception { super.setUp(); oos = new ObjectOutputStream(bao = new ByteArrayOutputStream()); }
void function() throws Exception { super.setUp(); oos = new ObjectOutputStream(bao = new ByteArrayOutputStream()); }
/** * Sets up the fixture, for example, open a network connection. This method * is called before a test is executed. */
Sets up the fixture, for example, open a network connection. This method is called before a test is executed
setUp
{ "repo_name": "freeVM/freeVM", "path": "enhanced/java/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ObjectOutputStreamTest.java", "license": "apache-2.0", "size": 44867 }
[ "java.io.ByteArrayOutputStream", "java.io.ObjectOutputStream" ]
import java.io.ByteArrayOutputStream; import java.io.ObjectOutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,788,798
public PlotOrientation getOrientation();
PlotOrientation function();
/** * Gets the plot orientation (horizontal or vertical). */
Gets the plot orientation (horizontal or vertical)
getOrientation
{ "repo_name": "delafer/j7project", "path": "jasper352/csb-jasperreport-dep/src/net/sf/jasperreports/engine/JRChartPlot.java", "license": "gpl-2.0", "size": 6187 }
[ "org.jfree.chart.plot.PlotOrientation" ]
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.*;
[ "org.jfree.chart" ]
org.jfree.chart;
746,739
@Test public void testOutputCountAs() throws Exception { // Non-empty MovieSource movieSource = new MovieSource(); movieSource.insertMovie("1234", "Vertigo", "Mystery", "1950", 120, ImmutableList.of("Great!", "Awesome!"), true, (byte) 0x12, "Quentin Tarantino, Kate Winslet"); movieSource.insertMovie("5678", "Psycho", "Mystery", "1998", 120, ImmutableList.of("Great!", "Scary!"), true, (byte) 0x12, "Quentin Tarantino, Kate Winslet"); Injector injector = Guice.createInjector(new JavaTestModule(), new SourceBindingModule("source", movieSource)); YQLPlusCompiler compiler = injector.getInstance(YQLPlusCompiler.class); CompiledProgram program = compiler.compile("PROGRAM ();\n" + "DELETE FROM source OUTPUT COUNT AS numDeleted;"); ProgramResult myResult = program.run(null, true); Assert.assertEquals((int) myResult.getResult("numDeleted").get().getResult(), 2); // Empty movieSource = new MovieSource(); injector = Guice.createInjector(new JavaTestModule(), new SourceBindingModule("source", movieSource)); compiler = injector.getInstance(YQLPlusCompiler.class); program = compiler.compile("PROGRAM ();\n" + "DELETE FROM source OUTPUT COUNT AS numDeleted;"); myResult = program.run(null, true); Assert.assertEquals((int) myResult.getResult("numDeleted").get().getResult(), 0); }
void function() throws Exception { MovieSource movieSource = new MovieSource(); movieSource.insertMovie("1234", STR, STR, "1950", 120, ImmutableList.of(STR, STR), true, (byte) 0x12, STR); movieSource.insertMovie("5678", STR, STR, "1998", 120, ImmutableList.of(STR, STR), true, (byte) 0x12, STR); Injector injector = Guice.createInjector(new JavaTestModule(), new SourceBindingModule(STR, movieSource)); YQLPlusCompiler compiler = injector.getInstance(YQLPlusCompiler.class); CompiledProgram program = compiler.compile(STR + STR); ProgramResult myResult = program.run(null, true); Assert.assertEquals((int) myResult.getResult(STR).get().getResult(), 2); movieSource = new MovieSource(); injector = Guice.createInjector(new JavaTestModule(), new SourceBindingModule(STR, movieSource)); compiler = injector.getInstance(YQLPlusCompiler.class); program = compiler.compile(STR + STR); myResult = program.run(null, true); Assert.assertEquals((int) myResult.getResult(STR).get().getResult(), 0); }
/** * Test for OUTPUT COUNT AS directive. * * @throws Exception */
Test for OUTPUT COUNT AS directive
testOutputCountAs
{ "repo_name": "slolars/yql-plus", "path": "yqlplus_engine/src/test/java/com/yahoo/yqlplus/engine/java/JavaProgramCompilerTest.java", "license": "apache-2.0", "size": 234382 }
[ "com.google.common.collect.ImmutableList", "com.google.inject.Guice", "com.google.inject.Injector", "com.yahoo.yqlplus.engine.CompiledProgram", "com.yahoo.yqlplus.engine.ProgramResult", "com.yahoo.yqlplus.engine.YQLPlusCompiler", "com.yahoo.yqlplus.engine.sources.MovieSource", "org.testng.Assert", "org.testng.AssertJUnit" ]
import com.google.common.collect.ImmutableList; import com.google.inject.Guice; import com.google.inject.Injector; import com.yahoo.yqlplus.engine.CompiledProgram; import com.yahoo.yqlplus.engine.ProgramResult; import com.yahoo.yqlplus.engine.YQLPlusCompiler; import com.yahoo.yqlplus.engine.sources.MovieSource; import org.testng.Assert; import org.testng.AssertJUnit;
import com.google.common.collect.*; import com.google.inject.*; import com.yahoo.yqlplus.engine.*; import com.yahoo.yqlplus.engine.sources.*; import org.testng.*;
[ "com.google.common", "com.google.inject", "com.yahoo.yqlplus", "org.testng" ]
com.google.common; com.google.inject; com.yahoo.yqlplus; org.testng;
148,681
public static final Set getSaslServerMechanismNames() { return ServerFactory.getNames(); }
static final Set function() { return ServerFactory.getNames(); }
/** * Returns a {@link Set} of names of SASL Server mechanisms available from * this {@link Provider}. * * @return a {@link Set} of SASL Server mechanisms (Strings). */
Returns a <code>Set</code> of names of SASL Server mechanisms available from this <code>Provider</code>
getSaslServerMechanismNames
{ "repo_name": "shaotuanchen/sunflower_exp", "path": "tools/source/gcc-4.2.4/libjava/classpath/gnu/javax/crypto/jce/GnuSasl.java", "license": "bsd-3-clause", "size": 4847 }
[ "gnu.javax.crypto.sasl.ServerFactory", "java.util.Set" ]
import gnu.javax.crypto.sasl.ServerFactory; import java.util.Set;
import gnu.javax.crypto.sasl.*; import java.util.*;
[ "gnu.javax.crypto", "java.util" ]
gnu.javax.crypto; java.util;
2,712,181
private static void parseNameDB(File clientDB, TreeMap<Integer, String> nameMap) { try (BufferedReader in = new BufferedReader(new FileReader(clientDB))) { String line; while ((line = in.readLine()) != null) { if (line.isEmpty() || line.charAt(0) == '/') continue; String[] tokens = line.split("#"); try { nameMap.put(Integer.parseInt(tokens[0]), tokens[1].replace('_', ' ').trim()); } catch (Exception e) { continue; } } } catch (IOException e) { System.err.printf("Failed to read file '%s'.\n", clientDB.getName()); e.printStackTrace(System.err); } }
static void function(File clientDB, TreeMap<Integer, String> nameMap) { try (BufferedReader in = new BufferedReader(new FileReader(clientDB))) { String line; while ((line = in.readLine()) != null) { if (line.isEmpty() line.charAt(0) == '/') continue; String[] tokens = line.split("#"); try { nameMap.put(Integer.parseInt(tokens[0]), tokens[1].replace('_', ' ').trim()); } catch (Exception e) { continue; } } } catch (IOException e) { System.err.printf(STR, clientDB.getName()); e.printStackTrace(System.err); } }
/** * Parses client-side item name file. * @param clientDB the client-side item table file * @param nameMap the client-side ID/name map */
Parses client-side item name file
parseNameDB
{ "repo_name": "itdelatrisu/athena-item-name-checker", "path": "AthenaItemNameChecker.java", "license": "gpl-3.0", "size": 10339 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileReader", "java.io.IOException", "java.util.TreeMap" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.TreeMap;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,455,143
protected static Version normalizeIncompatibleImprovementsVersion(Version incompatibleImprovements) { _TemplateAPI.checkVersionNotNullAndSupported(incompatibleImprovements); if (incompatibleImprovements.intValue() < _TemplateAPI.VERSION_INT_2_3_0) { throw new IllegalArgumentException("Version must be at least 2.3.0."); } return is2324Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_24 : is2321Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_21 : Configuration.VERSION_2_3_0; } /** * Returns the default instance of the wrapper. This instance is used * when you construct various bean models without explicitly specifying * a wrapper. It is also returned by * {@link freemarker.template.ObjectWrapper#BEANS_WRAPPER}
static Version function(Version incompatibleImprovements) { _TemplateAPI.checkVersionNotNullAndSupported(incompatibleImprovements); if (incompatibleImprovements.intValue() < _TemplateAPI.VERSION_INT_2_3_0) { throw new IllegalArgumentException(STR); } return is2324Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_24 : is2321Bugfixed(incompatibleImprovements) ? Configuration.VERSION_2_3_21 : Configuration.VERSION_2_3_0; } /** * Returns the default instance of the wrapper. This instance is used * when you construct various bean models without explicitly specifying * a wrapper. It is also returned by * {@link freemarker.template.ObjectWrapper#BEANS_WRAPPER}
/** * Returns the lowest version number that is equivalent with the parameter version. * @since 2.3.21 */
Returns the lowest version number that is equivalent with the parameter version
normalizeIncompatibleImprovementsVersion
{ "repo_name": "woonsan/incubator-freemarker", "path": "src/main/java/freemarker/ext/beans/BeansWrapper.java", "license": "apache-2.0", "size": 83003 }
[ "freemarker.template.Configuration", "freemarker.template.ObjectWrapper", "freemarker.template.Version" ]
import freemarker.template.Configuration; import freemarker.template.ObjectWrapper; import freemarker.template.Version;
import freemarker.template.*;
[ "freemarker.template" ]
freemarker.template;
1,641,834
public List<T> getConfigInstances(); /** * Returns the {@link Manager}. * * @param enumConfig * the enum configuration class. * @return {@link Manager}
List<T> function(); /** * Returns the {@link Manager}. * * @param enumConfig * the enum configuration class. * @return {@link Manager}
/** * Returns the {@link List list} containing all config instance of current * {@link RepositoryServiceContext}. * * @return the config instances */
Returns the <code>List list</code> containing all config instance of current <code>RepositoryServiceContext</code>
getConfigInstances
{ "repo_name": "OldRepoPreservation/jgentle", "path": "src/org/jgentleframework/services/datalocator/context/RepositoryServiceContext.java", "license": "apache-2.0", "size": 1774 }
[ "java.util.List", "org.jgentleframework.services.datalocator.data.Manager" ]
import java.util.List; import org.jgentleframework.services.datalocator.data.Manager;
import java.util.*; import org.jgentleframework.services.datalocator.data.*;
[ "java.util", "org.jgentleframework.services" ]
java.util; org.jgentleframework.services;
1,805,056
@Override public boolean onTouchEvent(MotionEvent event) { // to move the button according to the finger coordinate mPosX = (int) event.getX(); mPosY = (int) event.getY(); if (event.getAction() == MotionEvent.ACTION_UP) { resetButtonPosition(); mThread.interrupt(); if (mCallback != null) mCallback.onMove(getAngle(), getStrength()); } if (event.getAction() == MotionEvent.ACTION_DOWN) { if (mThread != null && mThread.isAlive()) { mThread.interrupt(); } mThread = new Thread(this); mThread.start(); if (mCallback != null) mCallback.onMove(getAngle(), getStrength()); } // handle first touch and long press with multiple touch only switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: // when the first touch occurs we update the center (if set to auto-defined center) if (!mFixedCenter) { mCenterX = mPosX; mCenterY = mPosY; } break; case MotionEvent.ACTION_POINTER_DOWN: { // when the second finger touch if (event.getPointerCount() == 2) { mHandlerMultipleLongPress.postDelayed(mRunnableMultipleLongPress, ViewConfiguration.getLongPressTimeout()*2); mMoveTolerance = MOVE_TOLERANCE; } break; } case MotionEvent.ACTION_MOVE: mMoveTolerance--; if (mMoveTolerance == 0) { mHandlerMultipleLongPress.removeCallbacks(mRunnableMultipleLongPress); } break; case MotionEvent.ACTION_POINTER_UP: { // when the last multiple touch is released if (event.getPointerCount() == 2) { mHandlerMultipleLongPress.removeCallbacks(mRunnableMultipleLongPress); } break; } } double abs = Math.sqrt((mPosX - mCenterX) * (mPosX - mCenterX) + (mPosY - mCenterY) * (mPosY - mCenterY)); if (abs > mBorderRadius) { mPosX = (int) ((mPosX - mCenterX) * mBorderRadius / abs + mCenterX); mPosY = (int) ((mPosY - mCenterY) * mBorderRadius / abs + mCenterY); } // to force a new draw invalidate(); return true; }
boolean function(MotionEvent event) { mPosX = (int) event.getX(); mPosY = (int) event.getY(); if (event.getAction() == MotionEvent.ACTION_UP) { resetButtonPosition(); mThread.interrupt(); if (mCallback != null) mCallback.onMove(getAngle(), getStrength()); } if (event.getAction() == MotionEvent.ACTION_DOWN) { if (mThread != null && mThread.isAlive()) { mThread.interrupt(); } mThread = new Thread(this); mThread.start(); if (mCallback != null) mCallback.onMove(getAngle(), getStrength()); } switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: if (!mFixedCenter) { mCenterX = mPosX; mCenterY = mPosY; } break; case MotionEvent.ACTION_POINTER_DOWN: { if (event.getPointerCount() == 2) { mHandlerMultipleLongPress.postDelayed(mRunnableMultipleLongPress, ViewConfiguration.getLongPressTimeout()*2); mMoveTolerance = MOVE_TOLERANCE; } break; } case MotionEvent.ACTION_MOVE: mMoveTolerance--; if (mMoveTolerance == 0) { mHandlerMultipleLongPress.removeCallbacks(mRunnableMultipleLongPress); } break; case MotionEvent.ACTION_POINTER_UP: { if (event.getPointerCount() == 2) { mHandlerMultipleLongPress.removeCallbacks(mRunnableMultipleLongPress); } break; } } double abs = Math.sqrt((mPosX - mCenterX) * (mPosX - mCenterX) + (mPosY - mCenterY) * (mPosY - mCenterY)); if (abs > mBorderRadius) { mPosX = (int) ((mPosX - mCenterX) * mBorderRadius / abs + mCenterX); mPosY = (int) ((mPosY - mCenterY) * mBorderRadius / abs + mCenterY); } invalidate(); return true; }
/** * Handle touch screen motion event. Move the button according to the * finger coordinate and detect longPress by multiple pointers only. * * @param event The motion event. * @return True if the event was handled, false otherwise. */
Handle touch screen motion event. Move the button according to the finger coordinate and detect longPress by multiple pointers only
onTouchEvent
{ "repo_name": "PuzzleboxIO/jigsaw-android", "path": "jigsaw/src/main/java/io/puzzlebox/jigsaw/ui/JoystickView.java", "license": "agpl-3.0", "size": 13483 }
[ "android.view.MotionEvent", "android.view.ViewConfiguration" ]
import android.view.MotionEvent; import android.view.ViewConfiguration;
import android.view.*;
[ "android.view" ]
android.view;
1,803,061
@Override public java.util.Date getModifiedDate() { return _todo.getModifiedDate(); }
java.util.Date function() { return _todo.getModifiedDate(); }
/** * Returns the modified date of this todo. * * @return the modified date of this todo */
Returns the modified date of this todo
getModifiedDate
{ "repo_name": "gamerson/liferay-projects", "path": "todo/todo-portlet-service/src/main/java/com/liferay/ide/projects/todo/model/TodoWrapper.java", "license": "lgpl-2.1", "size": 12847 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
849,831
ProjectileMoveEvent createProjectileMoveEvent(int projectileId) { return EventTypesUtils.createProjectileMoveEvent(startTime, projectileId, x, y, speedX, speedY); } }
ProjectileMoveEvent createProjectileMoveEvent(int projectileId) { return EventTypesUtils.createProjectileMoveEvent(startTime, projectileId, x, y, speedX, speedY); } }
/** * Creates instance of {@link ProjectileMoveEvent} class using * data stored inside this {@link ProjectileMoveData} object. * * @param projectileId - identifier of projectile for which event * is created. * * @return Returns created instance of {@link ProjectileMoveEvent} class. */
Creates instance of <code>ProjectileMoveEvent</code> class using data stored inside this <code>ProjectileMoveData</code> object
createProjectileMoveEvent
{ "repo_name": "molszewski/dante", "path": "module/Simulation/src/net/java/dante/sim/event/EventsRepositoryBuilderImpl.java", "license": "lgpl-3.0", "size": 24177 }
[ "net.java.dante.sim.event.types.EventTypesUtils", "net.java.dante.sim.event.types.ProjectileMoveEvent" ]
import net.java.dante.sim.event.types.EventTypesUtils; import net.java.dante.sim.event.types.ProjectileMoveEvent;
import net.java.dante.sim.event.types.*;
[ "net.java.dante" ]
net.java.dante;
1,661,439
public List<DwcaResourceModel> filterResourcesWithoutRecords( List<DwcaResourceModel> resources);
List<DwcaResourceModel> function( List<DwcaResourceModel> resources);
/** * Return a subset with only resources that already have records * * @param resources * @return */
Return a subset with only resources that already have records
filterResourcesWithoutRecords
{ "repo_name": "sibbr/explorador", "path": "src/main/java/net/canadensys/dataportal/resource/service/ResourceService.java", "license": "mit", "size": 849 }
[ "java.util.List", "net.canadensys.dataportal.occurrence.model.DwcaResourceModel" ]
import java.util.List; import net.canadensys.dataportal.occurrence.model.DwcaResourceModel;
import java.util.*; import net.canadensys.dataportal.occurrence.model.*;
[ "java.util", "net.canadensys.dataportal" ]
java.util; net.canadensys.dataportal;
3,053
public String[] getTrimmedStrings(String name, String... defaultValue) { String valueString = get(name); if (null == valueString) { return defaultValue; } else { return StringUtils.getTrimmedStrings(valueString); } }
String[] function(String name, String... defaultValue) { String valueString = get(name); if (null == valueString) { return defaultValue; } else { return StringUtils.getTrimmedStrings(valueString); } }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then default value is returned. * * @param name property name. * @param defaultValue The default value * @return property value as an array of trimmed <code>String</code>s, * or default value. */
Get the comma delimited values of the <code>name</code> property as an array of <code>String</code>s, trimmed of the leading and trailing whitespace. If no such property is specified then default value is returned
getTrimmedStrings
{ "repo_name": "JoeChien23/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java", "license": "apache-2.0", "size": 100519 }
[ "org.apache.hadoop.util.StringUtils" ]
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,480,974
protected static String parseAs7BitData(byte[] data, String encoding) { // Handle any encoding aliases, where outlook describes it differently if ("ansi".equals(encoding)) { encoding = DEFAULT_ENCODING; } // Decode return new String(data, Charset.forName(encoding)); }
static String function(byte[] data, String encoding) { if ("ansi".equals(encoding)) { encoding = DEFAULT_ENCODING; } return new String(data, Charset.forName(encoding)); }
/** * Parses as non-unicode, supposedly 7 bit data and returns the string that * that yields. */
Parses as non-unicode, supposedly 7 bit data and returns the string that that yields
parseAs7BitData
{ "repo_name": "lvweiwolf/poi-3.16", "path": "src/scratchpad/src/org/apache/poi/hsmf/datatypes/StringChunk.java", "license": "apache-2.0", "size": 4707 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
1,957,099
private static int maxFinishIndexedBinarySearch( List<? extends TemporalProposition> list, long tstamp) { int low = 0; int high = list.size() - 1; while (low <= high) { int mid = (low + high) >>> 1; TemporalProposition midVal = list.get(mid); Long maxFinish = midVal.getInterval().getMaximumFinish(); int cmp = maxFinish != null ? maxFinish.compareTo(tstamp) : 1; if (cmp < 0) { low = mid + 1; } else if (cmp > 0) { high = mid - 1; } else { return mid + 1; } } return high + 1; }
static int function( List<? extends TemporalProposition> list, long tstamp) { int low = 0; int high = list.size() - 1; while (low <= high) { int mid = (low + high) >>> 1; TemporalProposition midVal = list.get(mid); Long maxFinish = midVal.getInterval().getMaximumFinish(); int cmp = maxFinish != null ? maxFinish.compareTo(tstamp) : 1; if (cmp < 0) { low = mid + 1; } else if (cmp > 0) { high = mid - 1; } else { return mid + 1; } } return high + 1; }
/** * Binary search for a primitive parameter by timestamp, optimized for when * the parameters are stored in a list that implements * <code>java.util.RandomAccess</code>. * * @param list * a <code>List</code> of <code>PrimitiveParameter</code> * objects all with the same paramId, cannot be <code>null</code>. * @param tstamp * the timestamp we're interested in finding. * @return a <code>PrimitiveParameter</code>, or <code>null</code> if * not found. */
Binary search for a primitive parameter by timestamp, optimized for when the parameters are stored in a list that implements <code>java.util.RandomAccess</code>
maxFinishIndexedBinarySearch
{ "repo_name": "eurekaclinical/protempa", "path": "protempa-framework/src/main/java/org/protempa/proposition/PropositionUtil.java", "license": "apache-2.0", "size": 19403 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,342,821
public static XLMultiReference of(final XLSheetId sheetId, final XLRange... ranges) { ArgumentChecker.notNull(sheetId, "sheetId"); ArgumentChecker.notNullOrEmpty(ranges, "ranges"); return new XLMultiReference(sheetId, Arrays.asList(ranges)); }
static XLMultiReference function(final XLSheetId sheetId, final XLRange... ranges) { ArgumentChecker.notNull(sheetId, STR); ArgumentChecker.notNullOrEmpty(ranges, STR); return new XLMultiReference(sheetId, Arrays.asList(ranges)); }
/** * Static factory method to create an instance of XLReference. * * @param sheetId * the worksheet ID * @param ranges * a vararg of contiguous 2D range of cells * @return an instance of XLReference */
Static factory method to create an instance of XLReference
of
{ "repo_name": "McLeodMoores/xl4j", "path": "xll-core/src/main/java/com/mcleodmoores/xl4j/v1/api/values/XLMultiReference.java", "license": "gpl-3.0", "size": 3948 }
[ "com.mcleodmoores.xl4j.v1.util.ArgumentChecker", "java.util.Arrays" ]
import com.mcleodmoores.xl4j.v1.util.ArgumentChecker; import java.util.Arrays;
import com.mcleodmoores.xl4j.v1.util.*; import java.util.*;
[ "com.mcleodmoores.xl4j", "java.util" ]
com.mcleodmoores.xl4j; java.util;
1,313,282
public Icon addEmptyIcon();
Icon function();
/** * Return an icon using the 1px image * @return an Icon * @see */
Return an icon using the 1px image
addEmptyIcon
{ "repo_name": "CecileBONIN/Silverpeas-Core", "path": "web-core/src/main/java/com/stratelia/webactiv/util/viewGenerator/html/iconPanes/IconPane.java", "license": "agpl-3.0", "size": 2261 }
[ "com.stratelia.webactiv.util.viewGenerator.html.icons.Icon" ]
import com.stratelia.webactiv.util.viewGenerator.html.icons.Icon;
import com.stratelia.webactiv.util.*;
[ "com.stratelia.webactiv" ]
com.stratelia.webactiv;
2,088,195
public OidcLoginRequestPostProcessor oidcUser(OidcUser oidcUser) { this.oidcUser = () -> oidcUser; return this; } /** * Use the provided {@link ClientRegistration} as the client to authorize. * * The supplied {@link ClientRegistration} will be registered into an * {@link HttpSessionOAuth2AuthorizedClientRepository}. Tests relying on * {@link org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient}
OidcLoginRequestPostProcessor function(OidcUser oidcUser) { this.oidcUser = () -> oidcUser; return this; } /** * Use the provided {@link ClientRegistration} as the client to authorize. * * The supplied {@link ClientRegistration} will be registered into an * {@link HttpSessionOAuth2AuthorizedClientRepository}. Tests relying on * {@link org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient}
/** * Use the provided {@link OidcUser} as the authenticated user. * @param oidcUser the {@link OidcUser} to use * @return the {@link OidcLoginRequestPostProcessor} for further configuration */
Use the provided <code>OidcUser</code> as the authenticated user
oidcUser
{ "repo_name": "fhanik/spring-security", "path": "test/src/main/java/org/springframework/security/test/web/servlet/request/SecurityMockMvcRequestPostProcessors.java", "license": "apache-2.0", "size": 66514 }
[ "org.springframework.security.oauth2.client.registration.ClientRegistration", "org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizedClientRepository", "org.springframework.security.oauth2.core.oidc.user.OidcUser" ]
import org.springframework.security.oauth2.client.registration.ClientRegistration; import org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizedClientRepository; import org.springframework.security.oauth2.core.oidc.user.OidcUser;
import org.springframework.security.oauth2.client.registration.*; import org.springframework.security.oauth2.client.web.*; import org.springframework.security.oauth2.core.oidc.user.*;
[ "org.springframework.security" ]
org.springframework.security;
2,883,614