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 Boolean hasPermission(String permissionMapKey, String identifier, IWApplicationContext iwac, String permissionKey,
List groups) throws SQLException {
if (identifier != null) {
PermissionMap permissionMap = (PermissionMap) iwac.getApplicationAttribute(
permissionMapKey);
if (permissionMap == null) {
updatePermissions(permissionMapKey, identifier, permissionKey, iwac);
permissionMap = (PermissionMap) iwac.getApplicationAttribute(permissionMapKey);
}
List permissions = permissionMap.get(identifier, permissionKey, groups);
if (permissions == null) {
updatePermissions(permissionMapKey, identifier, permissionKey, iwac);
permissions = permissionMap.get(identifier, permissionKey, groups);
}
if (permissions != null) {
if (permissions.contains(Boolean.TRUE)) {
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}
else {
return Boolean.FALSE;
}
} | Boolean function(String permissionMapKey, String identifier, IWApplicationContext iwac, String permissionKey, List groups) throws SQLException { if (identifier != null) { PermissionMap permissionMap = (PermissionMap) iwac.getApplicationAttribute( permissionMapKey); if (permissionMap == null) { updatePermissions(permissionMapKey, identifier, permissionKey, iwac); permissionMap = (PermissionMap) iwac.getApplicationAttribute(permissionMapKey); } List permissions = permissionMap.get(identifier, permissionKey, groups); if (permissions == null) { updatePermissions(permissionMapKey, identifier, permissionKey, iwac); permissions = permissionMap.get(identifier, permissionKey, groups); } if (permissions != null) { if (permissions.contains(Boolean.TRUE)) { return Boolean.TRUE; } } return Boolean.FALSE; } else { return Boolean.FALSE; } } | /**
* The permissionchecking ends in this method.
*
* @param permissionMapKey
* @param identifier
* @param iwac
* @param permissionKey
* @param groups
* @return Boolean
* @throws SQLException
*/ | The permissionchecking ends in this method | hasPermission | {
"repo_name": "idega/platform2",
"path": "src/com/idega/core/accesscontrol/business/PermissionCacher.java",
"license": "gpl-3.0",
"size": 24830
} | [
"com.idega.idegaweb.IWApplicationContext",
"java.sql.SQLException",
"java.util.List"
] | import com.idega.idegaweb.IWApplicationContext; import java.sql.SQLException; import java.util.List; | import com.idega.idegaweb.*; import java.sql.*; import java.util.*; | [
"com.idega.idegaweb",
"java.sql",
"java.util"
] | com.idega.idegaweb; java.sql; java.util; | 2,189,717 |
public void testDrainToNullN() {
final BlockingQueue q = emptyCollection();
try {
q.drainTo(null, 0);
shouldThrow();
} catch (NullPointerException success) {}
} | void function() { final BlockingQueue q = emptyCollection(); try { q.drainTo(null, 0); shouldThrow(); } catch (NullPointerException success) {} } | /**
* drainTo(null, n) throws NullPointerException
*/ | drainTo(null, n) throws NullPointerException | testDrainToNullN | {
"repo_name": "md-5/jdk10",
"path": "test/jdk/java/util/concurrent/tck/BlockingQueueTest.java",
"license": "gpl-2.0",
"size": 13661
} | [
"java.util.concurrent.BlockingQueue"
] | import java.util.concurrent.BlockingQueue; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,172,687 |
private static ILogger createLogger(final Class<?> clazz) {
return LoggerUtils.logger(clazz);
} | static ILogger function(final Class<?> clazz) { return LoggerUtils.logger(clazz); } | /**
* Creates the logger.
*
* @param clazz The class.
* @return The created logger instance.
*/ | Creates the logger | createLogger | {
"repo_name": "metaborg/spoofax-intellij",
"path": "spoofax-common/src/main/java/org/metaborg/intellij/logging/MetaborgLoggerMembersInjector.java",
"license": "apache-2.0",
"size": 2149
} | [
"org.metaborg.util.log.ILogger",
"org.metaborg.util.log.LoggerUtils"
] | import org.metaborg.util.log.ILogger; import org.metaborg.util.log.LoggerUtils; | import org.metaborg.util.log.*; | [
"org.metaborg.util"
] | org.metaborg.util; | 1,543,556 |
private JScrollPane getActiveAggList() {
if (ActiveAggList == null) {
ActiveAggList = new JScrollPane();
ActiveAggList.setViewportView(getActiveAggTable());
}
return ActiveAggList;
} | JScrollPane function() { if (ActiveAggList == null) { ActiveAggList = new JScrollPane(); ActiveAggList.setViewportView(getActiveAggTable()); } return ActiveAggList; } | /**
* This method initializes ActiveAggList
*
* @return javax.swing.JScrollPane
*/ | This method initializes ActiveAggList | getActiveAggList | {
"repo_name": "dmcennis/jMir",
"path": "jMIR_2_4_developer/jAudio/src/jAudioFeatureExtractor/AggregatorFrame.java",
"license": "gpl-2.0",
"size": 8953
} | [
"javax.swing.JScrollPane"
] | import javax.swing.JScrollPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,963,071 |
private void buildSparseInputStreams() throws IOException {
final List<InputStream> streams = new ArrayList<>();
final List<TarArchiveStructSparse> sparseHeaders = currEntry.getOrderedSparseHeaders();
// Stream doesn't need to be closed at all as it doesn't use any resources
final InputStream zeroInputStream = new TarArchiveSparseZeroInputStream(); //NOSONAR
// logical offset into the extracted entry
long offset = 0;
long numberOfZeroBytesInSparseEntry = 0;
for (TarArchiveStructSparse sparseHeader : sparseHeaders) {
final long zeroBlockSize = sparseHeader.getOffset() - offset;
if (zeroBlockSize < 0) {
// sparse header says to move backwards inside of the extracted entry
throw new IOException("Corrupted struct sparse detected");
}
// only store the zero block if it is not empty
if (zeroBlockSize > 0) {
streams.add(new BoundedInputStream(zeroInputStream, zeroBlockSize));
numberOfZeroBytesInSparseEntry += zeroBlockSize;
}
// only store the input streams with non-zero size
if (sparseHeader.getNumbytes() > 0) {
final long start =
currEntry.getDataOffset() + sparseHeader.getOffset() - numberOfZeroBytesInSparseEntry;
if (start + sparseHeader.getNumbytes() < start) {
// possible integer overflow
throw new IOException("Unreadable TAR archive, sparse block offset or length too big");
}
streams.add(new BoundedSeekableByteChannelInputStream(start, sparseHeader.getNumbytes(), archive));
}
offset = sparseHeader.getOffset() + sparseHeader.getNumbytes();
}
sparseInputStreams.put(currEntry.getName(), streams);
} | void function() throws IOException { final List<InputStream> streams = new ArrayList<>(); final List<TarArchiveStructSparse> sparseHeaders = currEntry.getOrderedSparseHeaders(); final InputStream zeroInputStream = new TarArchiveSparseZeroInputStream(); long offset = 0; long numberOfZeroBytesInSparseEntry = 0; for (TarArchiveStructSparse sparseHeader : sparseHeaders) { final long zeroBlockSize = sparseHeader.getOffset() - offset; if (zeroBlockSize < 0) { throw new IOException(STR); } if (zeroBlockSize > 0) { streams.add(new BoundedInputStream(zeroInputStream, zeroBlockSize)); numberOfZeroBytesInSparseEntry += zeroBlockSize; } if (sparseHeader.getNumbytes() > 0) { final long start = currEntry.getDataOffset() + sparseHeader.getOffset() - numberOfZeroBytesInSparseEntry; if (start + sparseHeader.getNumbytes() < start) { throw new IOException(STR); } streams.add(new BoundedSeekableByteChannelInputStream(start, sparseHeader.getNumbytes(), archive)); } offset = sparseHeader.getOffset() + sparseHeader.getNumbytes(); } sparseInputStreams.put(currEntry.getName(), streams); } | /**
* Build the input streams consisting of all-zero input streams and non-zero input streams.
* When reading from the non-zero input streams, the data is actually read from the original input stream.
* The size of each input stream is introduced by the sparse headers.
*
* @implNote Some all-zero input streams and non-zero input streams have the size of 0. We DO NOT store the
* 0 size input streams because they are meaningless.
*/ | Build the input streams consisting of all-zero input streams and non-zero input streams. When reading from the non-zero input streams, the data is actually read from the original input stream. The size of each input stream is introduced by the sparse headers | buildSparseInputStreams | {
"repo_name": "apache/commons-compress",
"path": "src/main/java/org/apache/commons/compress/archivers/tar/TarFile.java",
"license": "apache-2.0",
"size": 29365
} | [
"java.io.IOException",
"java.io.InputStream",
"java.util.ArrayList",
"java.util.List",
"org.apache.commons.compress.utils.BoundedInputStream",
"org.apache.commons.compress.utils.BoundedSeekableByteChannelInputStream"
] | import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.commons.compress.utils.BoundedInputStream; import org.apache.commons.compress.utils.BoundedSeekableByteChannelInputStream; | import java.io.*; import java.util.*; import org.apache.commons.compress.utils.*; | [
"java.io",
"java.util",
"org.apache.commons"
] | java.io; java.util; org.apache.commons; | 1,267,779 |
@ApiModelProperty(value = "A size of the output file.")
public Long getFileSize() {
return fileSize;
} | @ApiModelProperty(value = STR) Long function() { return fileSize; } | /**
* A size of the output file.
* @return fileSize
**/ | A size of the output file | getFileSize | {
"repo_name": "Telestream/telestream-cloud-java-sdk",
"path": "telestream-cloud-flip-sdk/src/main/java/net/telestream/cloud/flip/Encoding.java",
"license": "mit",
"size": 21436
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 987,358 |
@Subscribe
public void onGameAborted(final GameAbortedEvent gameAbortedEvent) {
this.websocketHandler.gameAborted(gameAbortedEvent.getQueue());
}
| void function(final GameAbortedEvent gameAbortedEvent) { this.websocketHandler.gameAborted(gameAbortedEvent.getQueue()); } | /**
* Listen to {@link GameAbortedEvent} and sent it through websocket.
*
* @param gameAbortedEvent the event
*/ | Listen to <code>GameAbortedEvent</code> and sent it through websocket | onGameAborted | {
"repo_name": "TeeFun/TeeFun",
"path": "src/main/java/com/teefun/bean/websocket/WebSocketEventTunneler.java",
"license": "gpl-2.0",
"size": 2508
} | [
"com.teefun.events.event.GameAbortedEvent"
] | import com.teefun.events.event.GameAbortedEvent; | import com.teefun.events.event.*; | [
"com.teefun.events"
] | com.teefun.events; | 1,684,090 |
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@EntityProperty
public void setState( State setter ) {
curState = setter;
}
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@EntityProperty
public State getState() { return curState; } | @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) void function( State setter ) { curState = setter; } @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) public State getState() { return curState; } | /**
* sets the state of the current job
* @param setter state of the job
*/ | sets the state of the current job | setState | {
"repo_name": "mdunker/usergrid",
"path": "stack/core/src/main/java/org/apache/usergrid/persistence/entities/Import.java",
"license": "apache-2.0",
"size": 3109
} | [
"org.codehaus.jackson.map.annotate.JsonSerialize"
] | import org.codehaus.jackson.map.annotate.JsonSerialize; | import org.codehaus.jackson.map.annotate.*; | [
"org.codehaus.jackson"
] | org.codehaus.jackson; | 1,927,929 |
@SuppressWarnings("unused")
private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
final java.lang.String attributeNamespace = qname.getNamespaceURI();
java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
if (attributePrefix == null) {
attributePrefix = this.registerPrefix(xmlWriter, attributeNamespace);
}
java.lang.String attributeValue;
if (attributePrefix.trim().length() > 0) {
attributeValue = attributePrefix + ":" + qname.getLocalPart();
} else {
attributeValue = qname.getLocalPart();
}
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName, attributeValue);
} else {
this.registerPrefix(xmlWriter, namespace);
xmlWriter.writeAttribute(namespace, attName, attributeValue);
}
} | @SuppressWarnings(STR) void function(final java.lang.String namespace, final java.lang.String attName, final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { final java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { attributePrefix = this.registerPrefix(xmlWriter, attributeNamespace); } java.lang.String attributeValue; if (attributePrefix.trim().length() > 0) { attributeValue = attributePrefix + ":" + qname.getLocalPart(); } else { attributeValue = qname.getLocalPart(); } if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { this.registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace, attName, attributeValue); } } | /**
* Util method to write an attribute without the ns prefix
*/ | Util method to write an attribute without the ns prefix | writeQNameAttribute | {
"repo_name": "fincatto/nfe",
"path": "src/main/java/com/fincatto/documentofiscal/mdfe3/webservices/statusservico/MDFeStatusServicoStub.java",
"license": "apache-2.0",
"size": 93683
} | [
"javax.xml.namespace.QName"
] | import javax.xml.namespace.QName; | import javax.xml.namespace.*; | [
"javax.xml"
] | javax.xml; | 1,292,074 |
@Override
protected void doGet( HttpServletRequest request, HttpServletResponse response ) throws IOException
{
response.setContentType( "text/plain" );
String word = getParameter( WORD_PARAMETER, request );
if (word != null) {
writeDefinition(word, response);
} else {
writeAllDictionaryEntries(response);
}
} | void function( HttpServletRequest request, HttpServletResponse response ) throws IOException { response.setContentType( STR ); String word = getParameter( WORD_PARAMETER, request ); if (word != null) { writeDefinition(word, response); } else { writeAllDictionaryEntries(response); } } | /**
* Handles an HTTP GET request from a client by writing the definition of the
* word specified in the "word" HTTP parameter to the HTTP response. If the
* "word" parameter is not specified, all of the entries in the dictionary
* are written to the HTTP response.
*/ | Handles an HTTP GET request from a client by writing the definition of the word specified in the "word" HTTP parameter to the HTTP response. If the "word" parameter is not specified, all of the entries in the dictionary are written to the HTTP response | doGet | {
"repo_name": "DavidWhitlock/PortlandStateJava",
"path": "projects-parent/originals-parent/phonebill-web/src/main/java/edu/pdx/cs410J/phonebillweb/PhoneBillServlet.java",
"license": "apache-2.0",
"size": 5405
} | [
"java.io.IOException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 734,352 |
public static Episode fromBundle(Bundle bundle) {
Builder builder = new Builder()
.title(bundle.getString(KEY_TITLE))
.number(bundle.getInt(KEY_NUMBER))
.numberAbsolute(bundle.getInt(KEY_NUMBER_ABSOLUTE))
.season(bundle.getInt(KEY_SEASON))
.tvdbId(bundle.getInt(KEY_TVDBID))
.imdbId(bundle.getString(KEY_IMDBID))
.showTitle(bundle.getString(KEY_SHOW_TITLE))
.showTvdbId(bundle.getInt(KEY_SHOW_TVDBID))
.showImdbId(bundle.getString(KEY_SHOW_IMDBID))
.showFirstReleaseDate(bundle.getString(KEY_SHOW_FIRST_RELEASE_DATE));
return builder.build();
} | static Episode function(Bundle bundle) { Builder builder = new Builder() .title(bundle.getString(KEY_TITLE)) .number(bundle.getInt(KEY_NUMBER)) .numberAbsolute(bundle.getInt(KEY_NUMBER_ABSOLUTE)) .season(bundle.getInt(KEY_SEASON)) .tvdbId(bundle.getInt(KEY_TVDBID)) .imdbId(bundle.getString(KEY_IMDBID)) .showTitle(bundle.getString(KEY_SHOW_TITLE)) .showTvdbId(bundle.getInt(KEY_SHOW_TVDBID)) .showImdbId(bundle.getString(KEY_SHOW_IMDBID)) .showFirstReleaseDate(bundle.getString(KEY_SHOW_FIRST_RELEASE_DATE)); return builder.build(); } | /**
* Deserializes an {@link Episode} into a {@link android.os.Bundle} object.
*/ | Deserializes an <code>Episode</code> into a <code>android.os.Bundle</code> object | fromBundle | {
"repo_name": "TreyWiranta/ASV",
"path": "api/src/main/java/com/battlelancer/seriesguide/api/Episode.java",
"license": "unlicense",
"size": 5129
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 725,552 |
PagedResult<T> search(MultiplePagedQuerySearch<T> searchRequest); | PagedResult<T> search(MultiplePagedQuerySearch<T> searchRequest); | /**
* Method to search with offset and limit.
* Method is used to handle pagination approach,
* when you need to retrieve results by "parts".
* @param searchRequest request.
* @return PagedResult with "part" result.
*/ | Method to search with offset and limit. Method is used to handle pagination approach, when you need to retrieve results by "parts" | search | {
"repo_name": "ifnul/ums-backend",
"path": "is-lnu-persistence/src/main/java/org/lnu/is/dao/persistence/PersistenceManager.java",
"license": "apache-2.0",
"size": 1788
} | [
"org.lnu.is.pagination.MultiplePagedQuerySearch",
"org.lnu.is.pagination.PagedResult"
] | import org.lnu.is.pagination.MultiplePagedQuerySearch; import org.lnu.is.pagination.PagedResult; | import org.lnu.is.pagination.*; | [
"org.lnu.is"
] | org.lnu.is; | 2,423,701 |
@Override
public void registerListener(TwilightListener listener, Handler handler) {
synchronized (mLock) {
mListeners.add(new TwilightListenerRecord(listener, handler));
if (mListeners.size() == 1) {
mLocationHandler.enableLocationUpdates();
}
}
} | void function(TwilightListener listener, Handler handler) { synchronized (mLock) { mListeners.add(new TwilightListenerRecord(listener, handler)); if (mListeners.size() == 1) { mLocationHandler.enableLocationUpdates(); } } } | /**
* Listens for twilight time.
*
* @param listener The listener.
*/ | Listens for twilight time | registerListener | {
"repo_name": "xorware/android_frameworks_base",
"path": "services/core/java/com/android/server/twilight/TwilightService.java",
"license": "apache-2.0",
"size": 25501
} | [
"android.os.Handler"
] | import android.os.Handler; | import android.os.*; | [
"android.os"
] | android.os; | 2,087,055 |
public float getTotalSizeIndexed() throws SQLException {
PreparedStatement st = con.prepareStatement("Select" +
" sum(size) from document");
ResultSet rs = st.executeQuery();
rs.next();
long aux = rs.getLong(1);
rs.close();
if (!st.isClosed()) {
try {
st.close();
} catch (Exception ex) {
//Nothing
}
}
return ((float) aux) / 1024f / 1024f;
} | float function() throws SQLException { PreparedStatement st = con.prepareStatement(STR + STR); ResultSet rs = st.executeQuery(); rs.next(); long aux = rs.getLong(1); rs.close(); if (!st.isClosed()) { try { st.close(); } catch (Exception ex) { } } return ((float) aux) / 1024f / 1024f; } | /**
* Get the total size of document indexed.
* @return Size in Megabytes.
*/ | Get the total size of document indexed | getTotalSizeIndexed | {
"repo_name": "marcelobusico/sabuesonix",
"path": "SabuesonixPojoLib/src/sabuesonix/entities/persistence/ManagementDB.java",
"license": "gpl-3.0",
"size": 6412
} | [
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException"
] | import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,552,344 |
public String getAuthenticationScheme() {
if (SecurityUtil.isSslClientCertAuth(this.request)) {
return SecurityContext.CLIENT_CERT_AUTH;
}
ChallengeResponse challengeResponse = request.getChallengeResponse();
if (challengeResponse == null) {
return null;
}
if (!request.getClientInfo().isAuthenticated()) {
return null;
}
final ChallengeScheme authScheme = challengeResponse.getScheme();
if (authScheme == null) {
return null;
}
if (authScheme.equals(ChallengeScheme.HTTP_BASIC)) {
return SecurityContext.BASIC_AUTH;
}
if (authScheme.equals(ChallengeScheme.HTTP_DIGEST)) {
return SecurityContext.DIGEST_AUTH;
}
// if (authScheme.equals(ChallengeScheme.HTTPS_CLIENT_CERT))
// return SecurityContext.CLIENT_CERT_AUTH;
// if (authScheme.equals(ChallengeScheme.HTTP_SERVLET_FORM))
// return SecurityContext.FORM_AUTH;
return authScheme.getName();
} | String function() { if (SecurityUtil.isSslClientCertAuth(this.request)) { return SecurityContext.CLIENT_CERT_AUTH; } ChallengeResponse challengeResponse = request.getChallengeResponse(); if (challengeResponse == null) { return null; } if (!request.getClientInfo().isAuthenticated()) { return null; } final ChallengeScheme authScheme = challengeResponse.getScheme(); if (authScheme == null) { return null; } if (authScheme.equals(ChallengeScheme.HTTP_BASIC)) { return SecurityContext.BASIC_AUTH; } if (authScheme.equals(ChallengeScheme.HTTP_DIGEST)) { return SecurityContext.DIGEST_AUTH; } return authScheme.getName(); } | /**
* Returns the string value of the authentication scheme used to protect the
* resource. If the resource is not authenticated, null is returned.
*
* Values are the same as the CGI variable AUTH_TYPE
*
* @return one of the static members BASIC_AUTH, FORM_AUTH,
* CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) or the
* container-specific string indicating the authentication scheme,
* or null if the request was not authenticated.
* @see SecurityContext#getAuthenticationScheme()
*/ | Returns the string value of the authentication scheme used to protect the resource. If the resource is not authenticated, null is returned. Values are the same as the CGI variable AUTH_TYPE | getAuthenticationScheme | {
"repo_name": "alastrina123/debrief",
"path": "org.mwc.asset.comms/docs/restlet_src/org.restlet.ext.jaxrs/org/restlet/ext/jaxrs/internal/core/CallContext.java",
"license": "epl-1.0",
"size": 46359
} | [
"javax.ws.rs.core.SecurityContext",
"org.restlet.data.ChallengeResponse",
"org.restlet.data.ChallengeScheme",
"org.restlet.ext.jaxrs.internal.util.SecurityUtil"
] | import javax.ws.rs.core.SecurityContext; import org.restlet.data.ChallengeResponse; import org.restlet.data.ChallengeScheme; import org.restlet.ext.jaxrs.internal.util.SecurityUtil; | import javax.ws.rs.core.*; import org.restlet.data.*; import org.restlet.ext.jaxrs.internal.util.*; | [
"javax.ws",
"org.restlet.data",
"org.restlet.ext"
] | javax.ws; org.restlet.data; org.restlet.ext; | 2,832,984 |
private static void sleepImpl(long millis, Closure closure) {
long start = System.currentTimeMillis();
long rest = millis;
long current;
boolean interrupted = false;
try {
while (rest > 0) {
try {
Thread.sleep(rest);
rest = 0;
} catch (InterruptedException e) {
interrupted = true;
if (closure != null) {
if (DefaultTypeTransformation.castToBoolean(closure.call(e))) {
return;
}
}
current = System.currentTimeMillis(); // compensate for closure's time
rest = millis + start - current;
}
}
} finally {
if (interrupted) Thread.currentThread().interrupt();
}
} | static void function(long millis, Closure closure) { long start = System.currentTimeMillis(); long rest = millis; long current; boolean interrupted = false; try { while (rest > 0) { try { Thread.sleep(rest); rest = 0; } catch (InterruptedException e) { interrupted = true; if (closure != null) { if (DefaultTypeTransformation.castToBoolean(closure.call(e))) { return; } } current = System.currentTimeMillis(); rest = millis + start - current; } } } finally { if (interrupted) Thread.currentThread().interrupt(); } } | /**
* This method is used by both sleep() methods to implement sleeping
* for the given time even if interrupted
*
* @param millis the number of milliseconds to sleep
* @param closure optional closure called when interrupted
* as long as the closure returns false the sleep continues
*/ | This method is used by both sleep() methods to implement sleeping for the given time even if interrupted | sleepImpl | {
"repo_name": "apache/incubator-groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyStaticMethods.java",
"license": "apache-2.0",
"size": 9741
} | [
"groovy.lang.Closure",
"org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation"
] | import groovy.lang.Closure; import org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation; | import groovy.lang.*; import org.codehaus.groovy.runtime.typehandling.*; | [
"groovy.lang",
"org.codehaus.groovy"
] | groovy.lang; org.codehaus.groovy; | 1,090,335 |
@Override
protected TableModel createTableModel() {
return new HashtableTableModel((Hashtable) m_Counts.clone(), new String[]{"Actor", "Timestamp"});
} | TableModel function() { return new HashtableTableModel((Hashtable) m_Counts.clone(), new String[]{"Actor", STR}); } | /**
* Creates a new table model with the current data.
*
* @return the model with the current data
*/ | Creates a new table model with the current data | createTableModel | {
"repo_name": "automenta/adams-core",
"path": "src/main/java/adams/flow/execution/CurrentlyExecuted.java",
"license": "gpl-3.0",
"size": 4677
} | [
"java.util.Hashtable",
"javax.swing.table.TableModel"
] | import java.util.Hashtable; import javax.swing.table.TableModel; | import java.util.*; import javax.swing.table.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 1,238,273 |
public final void drawImage(Image image, Point p) {
drawImage(image, p.x, p.y);
}
| final void function(Image image, Point p) { drawImage(image, p.x, p.y); } | /**
* Draws the given image at a point.
*
* @param image
* the image to draw
* @param p
* where to draw the image
* @see #drawImage(Image, int, int)
*/ | Draws the given image at a point | drawImage | {
"repo_name": "opensagres/xdocreport.eclipse",
"path": "rap/org.eclipse.draw2d/src/org/eclipse/draw2d/Graphics.java",
"license": "lgpl-2.1",
"size": 32691
} | [
"org.eclipse.draw2d.geometry.Point",
"org.eclipse.swt.graphics.Image"
] | import org.eclipse.draw2d.geometry.Point; import org.eclipse.swt.graphics.Image; | import org.eclipse.draw2d.geometry.*; import org.eclipse.swt.graphics.*; | [
"org.eclipse.draw2d",
"org.eclipse.swt"
] | org.eclipse.draw2d; org.eclipse.swt; | 1,404,686 |
public void contextDestroyed(ServletContextEvent event) {
// deregister database drivers
try {
for (Enumeration<Driver> e = DriverManager.getDrivers(); e
.hasMoreElements();) {
Driver driver = e.nextElement();
if (driver.getClass().getClassLoader() == getClass()
.getClassLoader()) {
DriverManager.deregisterDriver(driver);
}
}
} catch (Throwable e) {
// Any errors thrown in clearing the caches aren't significant to
// the normal execution of the application, so we ignore them
}
// Clean the axis method cache, see FCREPO-496
org.apache.axis.utils.cache.MethodCache.getInstance().clearCache();
} | void function(ServletContextEvent event) { try { for (Enumeration<Driver> e = DriverManager.getDrivers(); e .hasMoreElements();) { Driver driver = e.nextElement(); if (driver.getClass().getClassLoader() == getClass() .getClassLoader()) { DriverManager.deregisterDriver(driver); } } } catch (Throwable e) { } org.apache.axis.utils.cache.MethodCache.getInstance().clearCache(); } | /**
* Clean up resources used by the application when stopped
*
* @seejavax.servlet.ServletContextListener#contextDestroyed(javax.servlet
* .ServletContextEvent)
*/ | Clean up resources used by the application when stopped | contextDestroyed | {
"repo_name": "FLVC/fcrepo-src-3.4.2",
"path": "fcrepo-server/src/main/java/org/fcrepo/server/utilities/CleanupContextListener.java",
"license": "apache-2.0",
"size": 2643
} | [
"java.sql.Driver",
"java.sql.DriverManager",
"java.util.Enumeration",
"javax.servlet.ServletContextEvent"
] | import java.sql.Driver; import java.sql.DriverManager; import java.util.Enumeration; import javax.servlet.ServletContextEvent; | import java.sql.*; import java.util.*; import javax.servlet.*; | [
"java.sql",
"java.util",
"javax.servlet"
] | java.sql; java.util; javax.servlet; | 226,550 |
public String getAuthenticationKey(String login, String domainId)
throws AuthenticationException {
// Random key generation
long nStart = login.hashCode() * new Date().getTime() * (m_AutoInc++);
Random rand = new Random(nStart);
int key = rand.nextInt();
String sKey = String.valueOf(key);
storeAuthenticationKey(login, domainId, sKey);
return sKey;
} | String function(String login, String domainId) throws AuthenticationException { long nStart = login.hashCode() * new Date().getTime() * (m_AutoInc++); Random rand = new Random(nStart); int key = rand.nextInt(); String sKey = String.valueOf(key); storeAuthenticationKey(login, domainId, sKey); return sKey; } | /**
* Build a random authentication key, store it in Silverpeas database and return it.
* @param login user login
* @param domainId user domain id
* @return generated authentication key
*/ | Build a random authentication key, store it in Silverpeas database and return it | getAuthenticationKey | {
"repo_name": "stephaneperry/Silverpeas-Core",
"path": "lib-core/src/main/java/com/stratelia/silverpeas/authentication/LoginPasswordAuthentication.java",
"license": "agpl-3.0",
"size": 17948
} | [
"java.util.Date",
"java.util.Random"
] | import java.util.Date; import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 811,969 |
private List<String> getManualWordList(Locale locale, LinguisticServices linguServices) {
List<String> words = new ArrayList<>();
String shortLangCode = locale.Language;
String path;
for (int i = 0; i < 4; i++) {
if (i == 0) {
path = "/" + shortLangCode + "/spelling.txt";
} else if (i == 1) {
path = "/" + shortLangCode + "/hunspell/spelling.txt";
} else if (i == 2) {
path = "/" + shortLangCode + "/hunspell/spelling-" + shortLangCode + "-" + locale.Country + ".txt";
} else {
path = "/" + shortLangCode + "/hunspell/spelling-" + shortLangCode + "_" + locale.Country + ".txt";
}
if (JLanguageTool.getDataBroker().resourceExists(path)) {
List<String> lines = JLanguageTool.getDataBroker().getFromResourceDirAsLines(path);
if (lines != null) {
for (String line : lines) {
if (!line.isEmpty() && !line.startsWith("#")) {
String[] lineWords = line.trim().split("\\h");
lineWords = lineWords[0].trim().split("/");
lineWords[0] = lineWords[0].replaceAll("_","");
if (!lineWords[0].isEmpty() && !words.contains(lineWords[0]) && !linguServices.isCorrectSpell(lineWords[0], locale)) {
words.add(lineWords[0]);
}
}
}
}
}
}
return words;
} | List<String> function(Locale locale, LinguisticServices linguServices) { List<String> words = new ArrayList<>(); String shortLangCode = locale.Language; String path; for (int i = 0; i < 4; i++) { if (i == 0) { path = "/" + shortLangCode + STR; } else if (i == 1) { path = "/" + shortLangCode + STR; } else if (i == 2) { path = "/" + shortLangCode + STR + shortLangCode + "-" + locale.Country + ".txt"; } else { path = "/" + shortLangCode + STR + shortLangCode + "_" + locale.Country + ".txt"; } if (JLanguageTool.getDataBroker().resourceExists(path)) { List<String> lines = JLanguageTool.getDataBroker().getFromResourceDirAsLines(path); if (lines != null) { for (String line : lines) { if (!line.isEmpty() && !line.startsWith("#")) { String[] lineWords = line.trim().split("\\h"); lineWords = lineWords[0].trim().split("/"); lineWords[0] = lineWords[0].replaceAll("_",""); if (!lineWords[0].isEmpty() && !words.contains(lineWords[0]) && !linguServices.isCorrectSpell(lineWords[0], locale)) { words.add(lineWords[0]); } } } } } } return words; } | /**
* get the list of words out of spelling.txt files defined by LT
*/ | get the list of words out of spelling.txt files defined by LT | getManualWordList | {
"repo_name": "languagetool-org/languagetool",
"path": "languagetool-office-extension/src/main/java/org/languagetool/openoffice/LtDictionary.java",
"license": "lgpl-2.1",
"size": 8136
} | [
"com.sun.star.lang.Locale",
"java.util.ArrayList",
"java.util.List",
"org.languagetool.JLanguageTool"
] | import com.sun.star.lang.Locale; import java.util.ArrayList; import java.util.List; import org.languagetool.JLanguageTool; | import com.sun.star.lang.*; import java.util.*; import org.languagetool.*; | [
"com.sun.star",
"java.util",
"org.languagetool"
] | com.sun.star; java.util; org.languagetool; | 1,483,727 |
@AfterAll
static void afterAll()
{
Medias.setLoadFromJar(null);
Engine.terminate();
}
| static void afterAll() { Medias.setLoadFromJar(null); Engine.terminate(); } | /**
* Terminate engine.
*/ | Terminate engine | afterAll | {
"repo_name": "b3dgs/lionengine",
"path": "lionengine-core-awt/src/test/java/com/b3dgs/lionengine/awt/graphic/ToolsAwtTest.java",
"license": "gpl-3.0",
"size": 9171
} | [
"com.b3dgs.lionengine.Engine",
"com.b3dgs.lionengine.Medias"
] | import com.b3dgs.lionengine.Engine; import com.b3dgs.lionengine.Medias; | import com.b3dgs.lionengine.*; | [
"com.b3dgs.lionengine"
] | com.b3dgs.lionengine; | 1,502,517 |
Tag tagCreate(TagCreateParams params) throws GitException; | Tag tagCreate(TagCreateParams params) throws GitException; | /**
* Create new tag.
*
* @param params tag create params
* @throws GitException if any error occurs
* @see TagCreateParams
*/ | Create new tag | tagCreate | {
"repo_name": "sudaraka94/che",
"path": "wsagent/che-core-api-git/src/main/java/org/eclipse/che/api/git/GitConnection.java",
"license": "epl-1.0",
"size": 12601
} | [
"org.eclipse.che.api.git.exception.GitException",
"org.eclipse.che.api.git.params.TagCreateParams",
"org.eclipse.che.api.git.shared.Tag"
] | import org.eclipse.che.api.git.exception.GitException; import org.eclipse.che.api.git.params.TagCreateParams; import org.eclipse.che.api.git.shared.Tag; | import org.eclipse.che.api.git.exception.*; import org.eclipse.che.api.git.params.*; import org.eclipse.che.api.git.shared.*; | [
"org.eclipse.che"
] | org.eclipse.che; | 2,249,355 |
static final Map classAssertionStatus()
{
return new HashMap();
} | static final Map classAssertionStatus() { return new HashMap(); } | /**
* The system default for class assertion status. This is used for all
* ClassLoader's classAssertionStatus defaults. It must be a map of
* class names to Boolean.TRUE or Boolean.FALSE
*
* XXX - Not implemented yet; this requires native help.
*
* @return a (read-only) map for the default classAssertionStatus
*/ | The system default for class assertion status. This is used for all ClassLoader's classAssertionStatus defaults. It must be a map of class names to Boolean.TRUE or Boolean.FALSE XXX - Not implemented yet; this requires native help | classAssertionStatus | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/jamvm/jamvm-1.5.4/lib/java/lang/VMClassLoader.java",
"license": "gpl-2.0",
"size": 13181
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,387,381 |
UserTable resumeSimpleQuery(String appName, DbHandle dbHandleName, OrderedColumns columnDefns,
ResumableQuery query)
throws ServicesAvailabilityException; | UserTable resumeSimpleQuery(String appName, DbHandle dbHandleName, OrderedColumns columnDefns, ResumableQuery query) throws ServicesAvailabilityException; | /**
* Get a {@link UserTable} that holds the results from the continued query.
*
* @param appName
* @param dbHandleName
* @param columnDefns
* @param query The original query with the bounds adjusted
* @return
*/ | Get a <code>UserTable</code> that holds the results from the continued query | resumeSimpleQuery | {
"repo_name": "opendatakit/androidlibrary",
"path": "androidlibrary_lib/src/main/java/org/opendatakit/database/service/UserDbInterface.java",
"license": "apache-2.0",
"size": 50250
} | [
"org.opendatakit.database.data.OrderedColumns",
"org.opendatakit.database.data.UserTable",
"org.opendatakit.database.queries.ResumableQuery",
"org.opendatakit.exception.ServicesAvailabilityException"
] | import org.opendatakit.database.data.OrderedColumns; import org.opendatakit.database.data.UserTable; import org.opendatakit.database.queries.ResumableQuery; import org.opendatakit.exception.ServicesAvailabilityException; | import org.opendatakit.database.data.*; import org.opendatakit.database.queries.*; import org.opendatakit.exception.*; | [
"org.opendatakit.database",
"org.opendatakit.exception"
] | org.opendatakit.database; org.opendatakit.exception; | 2,673,346 |
public void realClose(boolean calledExplicitly) throws SQLException;
| void function(boolean calledExplicitly) throws SQLException; | /**
* Closes this ResultSet and releases resources.
*
* @param calledExplicitly was realClose called by the standard
* ResultSet.close() method, or was it closed internally by the driver?
*/ | Closes this ResultSet and releases resources | realClose | {
"repo_name": "suthat/signal",
"path": "vendor/mysql-connector-java-5.1.26/src/com/mysql/jdbc/ResultSetInternalMethods.java",
"license": "apache-2.0",
"size": 6310
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,752,038 |
Map<Address, List<Integer>> getMemberPartitionsMap(); | Map<Address, List<Integer>> getMemberPartitionsMap(); | /**
* Gets member partition IDs.
* <p>
* Blocks until partitions are assigned.
*
* @return map of member address to partition IDs
*/ | Gets member partition IDs. Blocks until partitions are assigned | getMemberPartitionsMap | {
"repo_name": "tufangorel/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/spi/partition/IPartitionService.java",
"license": "apache-2.0",
"size": 6186
} | [
"com.hazelcast.nio.Address",
"java.util.List",
"java.util.Map"
] | import com.hazelcast.nio.Address; import java.util.List; import java.util.Map; | import com.hazelcast.nio.*; import java.util.*; | [
"com.hazelcast.nio",
"java.util"
] | com.hazelcast.nio; java.util; | 207,869 |
@Deprecated
void moveResource(String resourcePath, String destinationPath, String newName) throws XMLDBException; | void moveResource(String resourcePath, String destinationPath, String newName) throws XMLDBException; | /**
* Move a Resource.
*
* @param resourcePath the source resource.
* @param destinationPath the destination collection.
* @param newName the new name in the destination collection.
*
* @deprecated Use XmldbURI version instead.
*
* @throws XMLDBException if an error occurs when moving the resource.
*/ | Move a Resource | moveResource | {
"repo_name": "windauer/exist",
"path": "exist-core/src/main/java/org/exist/xmldb/EXistCollectionManagementService.java",
"license": "lgpl-2.1",
"size": 7226
} | [
"org.xmldb.api.base.XMLDBException"
] | import org.xmldb.api.base.XMLDBException; | import org.xmldb.api.base.*; | [
"org.xmldb.api"
] | org.xmldb.api; | 2,178,113 |
public void testInvokeAny2() throws Throwable {
ExecutorService e = new ForkJoinPool(1);
PoolCleaner cleaner = null;
try {
cleaner = cleaner(e);
try {
e.invokeAny(new ArrayList<Callable<String>>());
shouldThrow();
} catch (IllegalArgumentException success) {}
} finally {
if (cleaner != null) {
cleaner.close();
}
}
} | void function() throws Throwable { ExecutorService e = new ForkJoinPool(1); PoolCleaner cleaner = null; try { cleaner = cleaner(e); try { e.invokeAny(new ArrayList<Callable<String>>()); shouldThrow(); } catch (IllegalArgumentException success) {} } finally { if (cleaner != null) { cleaner.close(); } } } | /**
* invokeAny(empty collection) throws IllegalArgumentException
*/ | invokeAny(empty collection) throws IllegalArgumentException | testInvokeAny2 | {
"repo_name": "streamsupport/streamsupport",
"path": "src/tests/java/org/openjdk/tests/tck/ForkJoinPoolTest.java",
"license": "gpl-2.0",
"size": 41090
} | [
"java.util.ArrayList",
"java.util.concurrent.Callable",
"java.util.concurrent.ExecutorService"
] | import java.util.ArrayList; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,055,673 |
@Test
public void justWorks() throws Exception {
Assume.assumeNotNull(AppITCase.HOME);
new JdkRequest(String.format("%s/f", AppITCase.HOME))
.through(VerboseWire.class)
.fetch()
.as(RestResponse.class)
.assertStatus(HttpURLConnection.HTTP_OK)
.as(XmlResponse.class)
.assertXPath("//xhtml:html");
} | void function() throws Exception { Assume.assumeNotNull(AppITCase.HOME); new JdkRequest(String.format("%s/f", AppITCase.HOME)) .through(VerboseWire.class) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .assertXPath(" } | /**
* App can work.
* @throws Exception If some problem inside
* @checkstyle NonStaticMethodCheck (2 lines)
*/ | App can work | justWorks | {
"repo_name": "simonjenga/takes",
"path": "src/it/file-manager/src/test/java/org/takes/it/fm/AppITCase.java",
"license": "mit",
"size": 2176
} | [
"com.jcabi.http.request.JdkRequest",
"com.jcabi.http.response.RestResponse",
"com.jcabi.http.response.XmlResponse",
"com.jcabi.http.wire.VerboseWire",
"java.net.HttpURLConnection",
"org.junit.Assume"
] | import com.jcabi.http.request.JdkRequest; import com.jcabi.http.response.RestResponse; import com.jcabi.http.response.XmlResponse; import com.jcabi.http.wire.VerboseWire; import java.net.HttpURLConnection; import org.junit.Assume; | import com.jcabi.http.request.*; import com.jcabi.http.response.*; import com.jcabi.http.wire.*; import java.net.*; import org.junit.*; | [
"com.jcabi.http",
"java.net",
"org.junit"
] | com.jcabi.http; java.net; org.junit; | 1,363,983 |
public static float diff(final float[][] x, final float[][] y) {
dimensionCheck(x, y);
final int n = x.length;
final int m = x[0].length;
float amax = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; amax = max(amax, abs(x[i][j] - y[i][j])), j++) ;
return amax;
} | static float function(final float[][] x, final float[][] y) { dimensionCheck(x, y); final int n = x.length; final int m = x[0].length; float amax = 0; for (int i = 0; i < n; i++) for (int j = 0; j < m; amax = max(amax, abs(x[i][j] - y[i][j])), j++) ; return amax; } | /**
* The maximum matrix norm of the difference of two matrixes x,y, e.g. the greatest difference
* |x_ij - y_ij|.
*
* @param x float[][] matrix one
* @param y float[][] matrix two
* @return float ||x-y||;
*/ | The maximum matrix norm of the difference of two matrixes x,y, e.g. the greatest difference |x_ij - y_ij| | diff | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-external/src/main/java/de/lab4inf/math/lapack/LinearAlgebra.java",
"license": "gpl-3.0",
"size": 103733
} | [
"java.lang.Math"
] | import java.lang.Math; | import java.lang.*; | [
"java.lang"
] | java.lang; | 23,503 |
public ViewFactoryContext getViewFactoryContext() {
return viewFactoryContext;
}
| ViewFactoryContext function() { return viewFactoryContext; } | /**
* Returns the engine services context.
* @return engine services context
*/ | Returns the engine services context | getViewFactoryContext | {
"repo_name": "intelie/esper",
"path": "esper/src/main/java/com/espertech/esper/client/hook/VirtualDataWindowContext.java",
"license": "gpl-2.0",
"size": 5692
} | [
"com.espertech.esper.view.ViewFactoryContext"
] | import com.espertech.esper.view.ViewFactoryContext; | import com.espertech.esper.view.*; | [
"com.espertech.esper"
] | com.espertech.esper; | 451,502 |
public List<Rc> getMostRecentChanges(int days, int rcLimit) throws Exception {
Date today = new Date();
Calendar cal = new GregorianCalendar();
cal.setTime(today);
cal.add(Calendar.DAY_OF_MONTH, -days);
Date date30daysbefore = cal.getTime();
String rcstart = dateToMWTimeStamp(today);
String rcend = dateToMWTimeStamp(date30daysbefore);
List<Rc> rcList = this.getRecentChanges(rcstart, rcend, rcLimit);
List<Rc> result = this.sortByTitleAndFilterDoubles(rcList);
return result;
} | List<Rc> function(int days, int rcLimit) throws Exception { Date today = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime(today); cal.add(Calendar.DAY_OF_MONTH, -days); Date date30daysbefore = cal.getTime(); String rcstart = dateToMWTimeStamp(today); String rcend = dateToMWTimeStamp(date30daysbefore); List<Rc> rcList = this.getRecentChanges(rcstart, rcend, rcLimit); List<Rc> result = this.sortByTitleAndFilterDoubles(rcList); return result; } | /**
* get the most recent changes
*
* @param days
* @param rcLimit
* @return
* @throws Exception
*/ | get the most recent changes | getMostRecentChanges | {
"repo_name": "WolfgangFahl/Mediawiki-Japi",
"path": "src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java",
"license": "apache-2.0",
"size": 47270
} | [
"com.bitplan.mediawiki.japi.api.Rc",
"java.util.Calendar",
"java.util.Date",
"java.util.GregorianCalendar",
"java.util.List"
] | import com.bitplan.mediawiki.japi.api.Rc; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; | import com.bitplan.mediawiki.japi.api.*; import java.util.*; | [
"com.bitplan.mediawiki",
"java.util"
] | com.bitplan.mediawiki; java.util; | 1,143,834 |
@POST( CONTROLLER + AES_CRYPTO_SERVICES_PATH )
Map<VersionedObjectKey, BlockCiphertext> getAesEncryptedCryptoServices( @Body VersionedObjectKeySet ids ); | @POST( CONTROLLER + AES_CRYPTO_SERVICES_PATH ) Map<VersionedObjectKey, BlockCiphertext> getAesEncryptedCryptoServices( @Body VersionedObjectKeySet ids ); | /**
* Returns AES encrypted crypto services.
*
* @param ids
* @return
*/ | Returns AES encrypted crypto services | getAesEncryptedCryptoServices | {
"repo_name": "kryptnostic/kodex",
"path": "src/main/java/com/kryptnostic/v2/storage/api/KeyStorageApi.java",
"license": "apache-2.0",
"size": 6385
} | [
"com.kryptnostic.kodex.v1.crypto.ciphers.BlockCiphertext",
"com.kryptnostic.v2.storage.models.VersionedObjectKey",
"com.kryptnostic.v2.storage.models.VersionedObjectKeySet",
"java.util.Map"
] | import com.kryptnostic.kodex.v1.crypto.ciphers.BlockCiphertext; import com.kryptnostic.v2.storage.models.VersionedObjectKey; import com.kryptnostic.v2.storage.models.VersionedObjectKeySet; import java.util.Map; | import com.kryptnostic.kodex.v1.crypto.ciphers.*; import com.kryptnostic.v2.storage.models.*; import java.util.*; | [
"com.kryptnostic.kodex",
"com.kryptnostic.v2",
"java.util"
] | com.kryptnostic.kodex; com.kryptnostic.v2; java.util; | 1,468,135 |
public String getCardName(Generator<Card> cards) {
Card selected = null;
try {
selected = GeneratorFunctions.selectRandom(cards);
}
catch (NoSuchElementException ignored) {
;
}
if (selected == null) {
// Previously, it was thought that this
// Only should happen if something is programmed wrong
// But empirical evidence contradicts this.
return null;
}
return selected.getName();
} | String function(Generator<Card> cards) { Card selected = null; try { selected = GeneratorFunctions.selectRandom(cards); } catch (NoSuchElementException ignored) { ; } if (selected == null) { return null; } return selected.getName(); } | /**
* Fetch a random card name from the given pool.
*
* This forces one evaluation of the cards Generator.
*
* @param cards the card pool from which to select
* @return a card name from cards
*/ | Fetch a random card name from the given pool. This forces one evaluation of the cards Generator | getCardName | {
"repo_name": "xitongzou/cardforge",
"path": "src/forge/quest/data/QuestBoosterPack.java",
"license": "gpl-3.0",
"size": 7076
} | [
"com.google.code.jyield.Generator",
"java.util.NoSuchElementException",
"net.slightlymagic.braids.util.generator.GeneratorFunctions"
] | import com.google.code.jyield.Generator; import java.util.NoSuchElementException; import net.slightlymagic.braids.util.generator.GeneratorFunctions; | import com.google.code.jyield.*; import java.util.*; import net.slightlymagic.braids.util.generator.*; | [
"com.google.code",
"java.util",
"net.slightlymagic.braids"
] | com.google.code; java.util; net.slightlymagic.braids; | 1,712,082 |
protected boolean fireEventWait(WebElement webElement, Eventable eventable) {
switch (eventable.getEventType()) {
case click:
try {
webElement.click();
} catch (ElementNotVisibleException e1) {
LOGGER.info("Element not visible, so cannot be clicked: "
+ webElement.getTagName().toUpperCase() + " " + webElement.getText());
return false;
} catch (WebDriverException e) {
throwIfConnectionException(e);
return false;
}
break;
case hover:
// todo
break;
default:
LOGGER.info("EventType " + eventable.getEventType()
+ " not supported in WebDriver.");
return false;
}
try {
Thread.sleep(this.crawlWaitEvent);
} catch (InterruptedException e) {
LOGGER.error("fireEventWait got interrupted during wait process", e);
return false;
}
return true;
}
| boolean function(WebElement webElement, Eventable eventable) { switch (eventable.getEventType()) { case click: try { webElement.click(); } catch (ElementNotVisibleException e1) { LOGGER.info(STR + webElement.getTagName().toUpperCase() + " " + webElement.getText()); return false; } catch (WebDriverException e) { throwIfConnectionException(e); return false; } break; case hover: break; default: LOGGER.info(STR + eventable.getEventType() + STR); return false; } try { Thread.sleep(this.crawlWaitEvent); } catch (InterruptedException e) { LOGGER.error(STR, e); return false; } return true; } | /**
* Fires the event and waits for a specified time.
*
* @param webElement
* the element to fire event on.
* @param eventable
* The HTML event type (onclick, onmouseover, ...).
* @return true if firing event is successful.
*/ | Fires the event and waits for a specified time | fireEventWait | {
"repo_name": "guifre/crawljax",
"path": "src/main/java/com/crawljax/browser/WebDriverBackedEmbeddedBrowser.java",
"license": "apache-2.0",
"size": 27178
} | [
"com.crawljax.core.state.Eventable",
"org.openqa.selenium.ElementNotVisibleException",
"org.openqa.selenium.WebDriverException",
"org.openqa.selenium.WebElement"
] | import com.crawljax.core.state.Eventable; import org.openqa.selenium.ElementNotVisibleException; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; | import com.crawljax.core.state.*; import org.openqa.selenium.*; | [
"com.crawljax.core",
"org.openqa.selenium"
] | com.crawljax.core; org.openqa.selenium; | 2,411,990 |
public Insets getBorderInsets() {
return computeInsets(new Insets(0,0,0,0));
} | Insets function() { return computeInsets(new Insets(0,0,0,0)); } | /**
* Returns the insets of the border.
* @since 1.3
*/ | Returns the insets of the border | getBorderInsets | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/javax/swing/border/MatteBorder.java",
"license": "apache-2.0",
"size": 9304
} | [
"java.awt.Insets"
] | import java.awt.Insets; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,710,214 |
public final AlertDialog initiateScan(
Collection<String> desiredBarcodeFormats) {
return initiateScan(desiredBarcodeFormats, -1);
} | final AlertDialog function( Collection<String> desiredBarcodeFormats) { return initiateScan(desiredBarcodeFormats, -1); } | /**
* Initiates a scan, using the default camera, only for a certain set of
* barcode types, given as strings corresponding to their names in ZXing's
* {@code BarcodeFormat} class like "UPC_A". You can supply constants like
* {@link #PRODUCT_CODE_TYPES} for example.
*
* @param desiredBarcodeFormats
* names of {@code BarcodeFormat}s to scan for
* @return the {@link AlertDialog} that was shown to the user prompting them
* to download the app if a prompt was needed, or null otherwise.
*/ | Initiates a scan, using the default camera, only for a certain set of barcode types, given as strings corresponding to their names in ZXing's BarcodeFormat class like "UPC_A". You can supply constants like <code>#PRODUCT_CODE_TYPES</code> for example | initiateScan | {
"repo_name": "Kharatsa/tracking-app",
"path": "SampleTracking/src/com/google/zxing/integration/android/IntentIntegrator.java",
"license": "apache-2.0",
"size": 15245
} | [
"android.app.AlertDialog",
"java.util.Collection"
] | import android.app.AlertDialog; import java.util.Collection; | import android.app.*; import java.util.*; | [
"android.app",
"java.util"
] | android.app; java.util; | 2,847,563 |
@Test
void createsRedirectResponseWithUrlAndStatus() throws Exception {
final String url = "/";
MatcherAssert.assertThat(
new RsPrint(
new TkRedirect(url, HttpURLConnection.HTTP_MOVED_TEMP).act(
new RqFake()
)
),
new TextIs(
new Joined(
TkRedirectTest.NEWLINE,
"HTTP/1.1 302 Found",
String.format(TkRedirectTest.LOCATION, url),
"",
""
)
)
);
} | void createsRedirectResponseWithUrlAndStatus() throws Exception { final String url = "/"; MatcherAssert.assertThat( new RsPrint( new TkRedirect(url, HttpURLConnection.HTTP_MOVED_TEMP).act( new RqFake() ) ), new TextIs( new Joined( TkRedirectTest.NEWLINE, STR, String.format(TkRedirectTest.LOCATION, url), STR" ) ) ); } | /**
* TkRedirect can create a response with HTTP status code and url string.
* @throws Exception If some problem inside
*/ | TkRedirect can create a response with HTTP status code and url string | createsRedirectResponseWithUrlAndStatus | {
"repo_name": "simonjenga/takes",
"path": "src/test/java/org/takes/tk/TkRedirectTest.java",
"license": "mit",
"size": 3736
} | [
"java.net.HttpURLConnection",
"org.cactoos.text.Joined",
"org.hamcrest.MatcherAssert",
"org.llorllale.cactoos.matchers.TextIs",
"org.takes.rq.RqFake",
"org.takes.rs.RsPrint"
] | import java.net.HttpURLConnection; import org.cactoos.text.Joined; import org.hamcrest.MatcherAssert; import org.llorllale.cactoos.matchers.TextIs; import org.takes.rq.RqFake; import org.takes.rs.RsPrint; | import java.net.*; import org.cactoos.text.*; import org.hamcrest.*; import org.llorllale.cactoos.matchers.*; import org.takes.rq.*; import org.takes.rs.*; | [
"java.net",
"org.cactoos.text",
"org.hamcrest",
"org.llorllale.cactoos",
"org.takes.rq",
"org.takes.rs"
] | java.net; org.cactoos.text; org.hamcrest; org.llorllale.cactoos; org.takes.rq; org.takes.rs; | 2,030,114 |
@Override
public DomainType decode(final BsonReader reader, final DecoderContext decoderContext) {
final DocumentDecoder decoder = new DocumentDecoder(this.targetClass, this.codecRegistry);
// code adapted from "org.bson.codecs.BsonDocumentCodec"
return decoder.decodeDocument(reader, decoderContext);
} | DomainType function(final BsonReader reader, final DecoderContext decoderContext) { final DocumentDecoder decoder = new DocumentDecoder(this.targetClass, this.codecRegistry); return decoder.decodeDocument(reader, decoderContext); } | /**
* Converts the BSON Documentation provided by the given {@link BsonReader} into an instance of
* user-domain class.
*/ | Converts the BSON Documentation provided by the given <code>BsonReader</code> into an instance of user-domain class | decode | {
"repo_name": "xcoulon/lambdamatic-project",
"path": "lambdamatic-mongodb/lambdamatic-mongodb-core/src/main/java/org/lambdamatic/mongodb/internal/codecs/DocumentCodec.java",
"license": "epl-1.0",
"size": 4311
} | [
"org.bson.BsonReader",
"org.bson.codecs.DecoderContext"
] | import org.bson.BsonReader; import org.bson.codecs.DecoderContext; | import org.bson.*; import org.bson.codecs.*; | [
"org.bson",
"org.bson.codecs"
] | org.bson; org.bson.codecs; | 510,231 |
public static FunctionMapper getFunctionMapper() {
return functionMapper;
}
protected static class Functions extends FunctionMapper {
protected final Map<String, Method> functionMap = new HashMap<String, Method>();
public Functions() {
try {
this.functionMap.put("date:second", UtilDateTime.class.getMethod("getSecond", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:minute", UtilDateTime.class.getMethod("getMinute", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:hour", UtilDateTime.class.getMethod("getHour", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:dayOfMonth", UtilDateTime.class.getMethod("getDayOfMonth", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:dayOfWeek", UtilDateTime.class.getMethod("getDayOfWeek", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:dayOfYear", UtilDateTime.class.getMethod("getDayOfYear", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:week", UtilDateTime.class.getMethod("getWeek", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:month", UtilDateTime.class.getMethod("getMonth", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:year", UtilDateTime.class.getMethod("getYear", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:dayStart", UtilDateTime.class.getMethod("getDayStart", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:dayEnd", UtilDateTime.class.getMethod("getDayEnd", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:weekStart", UtilDateTime.class.getMethod("getWeekStart", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:weekEnd", UtilDateTime.class.getMethod("getWeekEnd", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:monthStart", UtilDateTime.class.getMethod("getMonthStart", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:monthEnd", UtilDateTime.class.getMethod("getMonthEnd", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:yearStart", UtilDateTime.class.getMethod("getYearStart", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:yearEnd", UtilDateTime.class.getMethod("getYearEnd", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:dateStr", UelFunctions.class.getMethod("dateString", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:localizedDateStr", UelFunctions.class.getMethod("localizedDateString", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:localizedDateTimeStr", UelFunctions.class.getMethod("localizedDateTimeString", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:timeStr", UelFunctions.class.getMethod("timeString", Timestamp.class, TimeZone.class, Locale.class));
this.functionMap.put("date:nowTimestamp", UtilDateTime.class.getMethod("nowTimestamp"));
this.functionMap.put("math:absDouble", Math.class.getMethod("abs", double.class));
this.functionMap.put("math:absFloat", Math.class.getMethod("abs", float.class));
this.functionMap.put("math:absInt", Math.class.getMethod("abs", int.class));
this.functionMap.put("math:absLong", Math.class.getMethod("abs", long.class));
this.functionMap.put("math:acos", Math.class.getMethod("abs", double.class));
this.functionMap.put("math:asin", Math.class.getMethod("asin", double.class));
this.functionMap.put("math:atan", Math.class.getMethod("atan", double.class));
this.functionMap.put("math:atan2", Math.class.getMethod("max", double.class, double.class));
this.functionMap.put("math:cbrt", Math.class.getMethod("cbrt", double.class));
this.functionMap.put("math:ceil", Math.class.getMethod("ceil", double.class));
this.functionMap.put("math:cos", Math.class.getMethod("cos", double.class));
this.functionMap.put("math:cosh", Math.class.getMethod("cosh", double.class));
this.functionMap.put("math:exp", Math.class.getMethod("exp", double.class));
this.functionMap.put("math:expm1", Math.class.getMethod("expm1", double.class));
this.functionMap.put("math:floor", Math.class.getMethod("floor", double.class));
this.functionMap.put("math:hypot", Math.class.getMethod("hypot", double.class, double.class));
this.functionMap.put("math:IEEEremainder", Math.class.getMethod("IEEEremainder", double.class, double.class));
this.functionMap.put("math:log", Math.class.getMethod("log", double.class));
this.functionMap.put("math:log10", Math.class.getMethod("log10", double.class));
this.functionMap.put("math:log1p", Math.class.getMethod("log1p", double.class));
this.functionMap.put("math:maxDouble", Math.class.getMethod("max", double.class, double.class));
this.functionMap.put("math:maxFloat", Math.class.getMethod("max", float.class, float.class));
this.functionMap.put("math:maxInt", Math.class.getMethod("max", int.class, int.class));
this.functionMap.put("math:maxLong", Math.class.getMethod("max", long.class, long.class));
this.functionMap.put("math:minDouble", Math.class.getMethod("min", double.class, double.class));
this.functionMap.put("math:minFloat", Math.class.getMethod("min", float.class, float.class));
this.functionMap.put("math:minInt", Math.class.getMethod("min", int.class, int.class));
this.functionMap.put("math:minLong", Math.class.getMethod("min", long.class, long.class));
this.functionMap.put("math:pow", Math.class.getMethod("pow", double.class, double.class));
this.functionMap.put("math:random", Math.class.getMethod("random"));
this.functionMap.put("math:rint", Math.class.getMethod("rint", double.class));
this.functionMap.put("math:roundDouble", Math.class.getMethod("round", double.class));
this.functionMap.put("math:roundFloat", Math.class.getMethod("round", float.class));
this.functionMap.put("math:signumDouble", Math.class.getMethod("signum", double.class));
this.functionMap.put("math:signumFloat", Math.class.getMethod("signum", float.class));
this.functionMap.put("math:sin", Math.class.getMethod("sin", double.class));
this.functionMap.put("math:sinh", Math.class.getMethod("sinh", double.class));
this.functionMap.put("math:sqrt", Math.class.getMethod("sqrt", double.class));
this.functionMap.put("math:tan", Math.class.getMethod("tan", double.class));
this.functionMap.put("math:tanh", Math.class.getMethod("tanh", double.class));
this.functionMap.put("math:toDegrees", Math.class.getMethod("toDegrees", double.class));
this.functionMap.put("math:toRadians", Math.class.getMethod("toRadians", double.class));
this.functionMap.put("math:ulpDouble", Math.class.getMethod("ulp", double.class));
this.functionMap.put("math:ulpFloat", Math.class.getMethod("ulp", float.class));
this.functionMap.put("str:endsWith", UelFunctions.class.getMethod("endsWith", String.class, String.class));
this.functionMap.put("str:indexOf", UelFunctions.class.getMethod("indexOf", String.class, String.class));
this.functionMap.put("str:lastIndexOf", UelFunctions.class.getMethod("lastIndexOf", String.class, String.class));
this.functionMap.put("str:length", UelFunctions.class.getMethod("length", String.class));
this.functionMap.put("str:replace", UelFunctions.class.getMethod("replace", String.class, String.class, String.class));
this.functionMap.put("str:replaceAll", UelFunctions.class.getMethod("replaceAll", String.class, String.class, String.class));
this.functionMap.put("str:replaceFirst", UelFunctions.class.getMethod("replaceFirst", String.class, String.class, String.class));
this.functionMap.put("str:startsWith", UelFunctions.class.getMethod("startsWith", String.class, String.class));
this.functionMap.put("str:endstring", UelFunctions.class.getMethod("endString", String.class, int.class));
this.functionMap.put("str:substring", UelFunctions.class.getMethod("subString", String.class, int.class, int.class));
this.functionMap.put("str:toString", UelFunctions.class.getMethod("toString", Object.class));
this.functionMap.put("str:toLowerCase", UelFunctions.class.getMethod("toLowerCase", String.class));
this.functionMap.put("str:toUpperCase", UelFunctions.class.getMethod("toUpperCase", String.class));
this.functionMap.put("str:trim", UelFunctions.class.getMethod("trim", String.class));
this.functionMap.put("sys:getenv", UelFunctions.class.getMethod("sysGetEnv", String.class));
this.functionMap.put("sys:getProperty", UelFunctions.class.getMethod("sysGetProp", String.class));
this.functionMap.put("util:size", UelFunctions.class.getMethod("getSize", Object.class));
this.functionMap.put("util:defaultLocale", Locale.class.getMethod("getDefault"));
this.functionMap.put("util:defaultTimeZone", TimeZone.class.getMethod("getDefault"));
this.functionMap.put("util:urlExists", UelFunctions.class.getMethod("urlExists", String.class));
this.functionMap.put("dom:readHtmlDocument", UelFunctions.class.getMethod("readHtmlDocument", String.class));
this.functionMap.put("dom:readXmlDocument", UelFunctions.class.getMethod("readXmlDocument", String.class));
this.functionMap.put("dom:toHtmlString", UelFunctions.class.getMethod("toHtmlString", Node.class, String.class, boolean.class, int.class));
this.functionMap.put("dom:toXmlString", UelFunctions.class.getMethod("toXmlString", Node.class, String.class, boolean.class, boolean.class, int.class));
this.functionMap.put("dom:writeXmlDocument", UelFunctions.class.getMethod("writeXmlDocument", String.class, Node.class, String.class, boolean.class, boolean.class, int.class));
} catch (Exception e) {
Debug.logError(e, "Error while initializing UelFunctions.Functions instance", module);
}
Debug.logVerbose("UelFunctions.Functions loaded " + this.functionMap.size() + " functions", module);
} | static FunctionMapper function() { return functionMapper; } protected static class Functions extends FunctionMapper { protected final Map<String, Method> functionMap = new HashMap<String, Method>(); public Functions() { try { this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Timestamp.class, TimeZone.class, Locale.class)); this.functionMap.put(STR, UtilDateTime.class.getMethod(STR)); this.functionMap.put(STR, Math.class.getMethod("abs", double.class)); this.functionMap.put(STR, Math.class.getMethod("abs", float.class)); this.functionMap.put(STR, Math.class.getMethod("abs", int.class)); this.functionMap.put(STR, Math.class.getMethod("abs", long.class)); this.functionMap.put(STR, Math.class.getMethod("abs", double.class)); this.functionMap.put(STR, Math.class.getMethod("asin", double.class)); this.functionMap.put(STR, Math.class.getMethod("atan", double.class)); this.functionMap.put(STR, Math.class.getMethod("max", double.class, double.class)); this.functionMap.put(STR, Math.class.getMethod("cbrt", double.class)); this.functionMap.put(STR, Math.class.getMethod("ceil", double.class)); this.functionMap.put(STR, Math.class.getMethod("cos", double.class)); this.functionMap.put(STR, Math.class.getMethod("cosh", double.class)); this.functionMap.put(STR, Math.class.getMethod("exp", double.class)); this.functionMap.put(STR, Math.class.getMethod("expm1", double.class)); this.functionMap.put(STR, Math.class.getMethod("floor", double.class)); this.functionMap.put(STR, Math.class.getMethod("hypot", double.class, double.class)); this.functionMap.put(STR, Math.class.getMethod(STR, double.class, double.class)); this.functionMap.put(STR, Math.class.getMethod("log", double.class)); this.functionMap.put(STR, Math.class.getMethod("log10", double.class)); this.functionMap.put(STR, Math.class.getMethod("log1p", double.class)); this.functionMap.put(STR, Math.class.getMethod("max", double.class, double.class)); this.functionMap.put(STR, Math.class.getMethod("max", float.class, float.class)); this.functionMap.put(STR, Math.class.getMethod("max", int.class, int.class)); this.functionMap.put(STR, Math.class.getMethod("max", long.class, long.class)); this.functionMap.put(STR, Math.class.getMethod("min", double.class, double.class)); this.functionMap.put(STR, Math.class.getMethod("min", float.class, float.class)); this.functionMap.put(STR, Math.class.getMethod("min", int.class, int.class)); this.functionMap.put(STR, Math.class.getMethod("min", long.class, long.class)); this.functionMap.put(STR, Math.class.getMethod("pow", double.class, double.class)); this.functionMap.put(STR, Math.class.getMethod(STR)); this.functionMap.put(STR, Math.class.getMethod("rint", double.class)); this.functionMap.put(STR, Math.class.getMethod("round", double.class)); this.functionMap.put(STR, Math.class.getMethod("round", float.class)); this.functionMap.put(STR, Math.class.getMethod(STR, double.class)); this.functionMap.put(STR, Math.class.getMethod(STR, float.class)); this.functionMap.put(STR, Math.class.getMethod("sin", double.class)); this.functionMap.put(STR, Math.class.getMethod("sinh", double.class)); this.functionMap.put(STR, Math.class.getMethod("sqrt", double.class)); this.functionMap.put(STR, Math.class.getMethod("tan", double.class)); this.functionMap.put(STR, Math.class.getMethod("tanh", double.class)); this.functionMap.put(STR, Math.class.getMethod(STR, double.class)); this.functionMap.put(STR, Math.class.getMethod(STR, double.class)); this.functionMap.put(STR, Math.class.getMethod("ulp", double.class)); this.functionMap.put(STR, Math.class.getMethod("ulp", float.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, int.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, int.class, int.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Object.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod("trim", String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Object.class)); this.functionMap.put(STR, Locale.class.getMethod(STR)); this.functionMap.put(STR, TimeZone.class.getMethod(STR)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Node.class, String.class, boolean.class, int.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, Node.class, String.class, boolean.class, boolean.class, int.class)); this.functionMap.put(STR, UelFunctions.class.getMethod(STR, String.class, Node.class, String.class, boolean.class, boolean.class, int.class)); } catch (Exception e) { Debug.logError(e, STR, module); } Debug.logVerbose(STR + this.functionMap.size() + STR, module); } | /** Returns a <code>FunctionMapper</code> instance.
* @return <code>FunctionMapper</code> instance
*/ | Returns a <code>FunctionMapper</code> instance | getFunctionMapper | {
"repo_name": "yuri0x7c1/ofbiz-explorer",
"path": "src/test/resources/apache-ofbiz-16.11.03/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelFunctions.java",
"license": "apache-2.0",
"size": 37601
} | [
"java.lang.reflect.Method",
"java.sql.Timestamp",
"java.util.HashMap",
"java.util.Locale",
"java.util.Map",
"java.util.TimeZone",
"javax.el.FunctionMapper",
"org.apache.ofbiz.base.util.Debug",
"org.apache.ofbiz.base.util.UtilDateTime",
"org.w3c.dom.Node"
] | import java.lang.reflect.Method; import java.sql.Timestamp; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.TimeZone; import javax.el.FunctionMapper; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilDateTime; import org.w3c.dom.Node; | import java.lang.reflect.*; import java.sql.*; import java.util.*; import javax.el.*; import org.apache.ofbiz.base.util.*; import org.w3c.dom.*; | [
"java.lang",
"java.sql",
"java.util",
"javax.el",
"org.apache.ofbiz",
"org.w3c.dom"
] | java.lang; java.sql; java.util; javax.el; org.apache.ofbiz; org.w3c.dom; | 1,943,481 |
public Patterns parseXMLObject(XMLObject xo) throws XMLParseException {
PatternList patternList = (PatternList)xo.getChild(0);
Patterns patterns = new Patterns(patternList);
for (int i = 1; i < xo.getChildCount(); i++) {
patterns.addPatterns((PatternList)xo.getChild(i));
}
if (xo.hasAttribute(XMLParser.ID)) {
final Logger logger = Logger.getLogger("beast.evoxml");
logger.info("Site patterns '" + xo.getId() + "' created by merging " + xo.getChildCount() + " pattern lists");
logger.info(" pattern count = " + patterns.getPatternCount());
}
return patterns;
}
public XMLSyntaxRule[] getSyntaxRules() { return rules; } | Patterns function(XMLObject xo) throws XMLParseException { PatternList patternList = (PatternList)xo.getChild(0); Patterns patterns = new Patterns(patternList); for (int i = 1; i < xo.getChildCount(); i++) { patterns.addPatterns((PatternList)xo.getChild(i)); } if (xo.hasAttribute(XMLParser.ID)) { final Logger logger = Logger.getLogger(STR); logger.info(STR + xo.getId() + STR + xo.getChildCount() + STR); logger.info(STR + patterns.getPatternCount()); } return patterns; } public XMLSyntaxRule[] getSyntaxRules() { return rules; } | /**
* Parses a patterns element and returns a patterns object.
*/ | Parses a patterns element and returns a patterns object | parseXMLObject | {
"repo_name": "armanbilge/B3",
"path": "src/beast/evolution/alignment/Patterns.java",
"license": "gpl-3.0",
"size": 23094
} | [
"java.util.logging.Logger"
] | import java.util.logging.Logger; | import java.util.logging.*; | [
"java.util"
] | java.util; | 1,794,345 |
public Context read_Context()
{
throw new NO_IMPLEMENT();
} | Context function() { throw new NO_IMPLEMENT(); } | /**
* This should read the CORBA context, but following the 1.4 API
* specification, it must not be implemented.
*
* @throws NO_IMPLEMENT, always.
*/ | This should read the CORBA context, but following the 1.4 API specification, it must not be implemented | read_Context | {
"repo_name": "selmentdev/selment-toolchain",
"path": "source/gcc-latest/libjava/classpath/org/omg/CORBA/portable/InputStream.java",
"license": "gpl-3.0",
"size": 8354
} | [
"org.omg.CORBA"
] | import org.omg.CORBA; | import org.omg.*; | [
"org.omg"
] | org.omg; | 328,608 |
void setMediaSource(MediaSource mediaSource); | void setMediaSource(MediaSource mediaSource); | /**
* Clears the playlist, adds the specified {@link MediaSource} and resets the position to the
* default position.
*
* @param mediaSource The new {@link MediaSource}.
*/ | Clears the playlist, adds the specified <code>MediaSource</code> and resets the position to the default position | setMediaSource | {
"repo_name": "amzn/exoplayer-amazon-port",
"path": "library/core/src/main/java/com/google/android/exoplayer2/ExoPlayer.java",
"license": "apache-2.0",
"size": 30514
} | [
"com.google.android.exoplayer2.source.MediaSource"
] | import com.google.android.exoplayer2.source.MediaSource; | import com.google.android.exoplayer2.source.*; | [
"com.google.android"
] | com.google.android; | 1,996,945 |
private void updateAxes(IDataset output, IDataset original, List<AxesMetadata> ometadata, int rankDif, int[] datadims, int[] odatadim) {
if (ometadata != null && !ometadata.isEmpty() && ometadata.get(0) != null) {
List<AxesMetadata> metaout = null;
//update it all for new data;
try {
metaout = output.getMetadata(AxesMetadata.class);
} catch (Exception e) {
throw new OperationException(this, e);
}
AxesMetadata inMeta = ometadata.get(0);
AxesMetadata axOut = null;
if (metaout != null && !metaout.isEmpty()) axOut = metaout.get(0);
if (axOut == null) {
try {
axOut = MetadataFactory.createMetadata(AxesMetadata.class, original.getRank() - rankDif);
} catch (MetadataException e) {
throw new OperationException(this, e);
}
}
//Clone to get copies of lazy datasets
AxesMetadata cloneMeta = (AxesMetadata) inMeta.clone();
if (rankDif == 0) {
for (int i = 0; i< original.getRank(); i++) {
if (Arrays.binarySearch(datadims, i) < 0 && Arrays.binarySearch(odatadim, i)<0) {
ILazyDataset[] axis = cloneMeta.getAxis(i);
if (axis != null) axOut.setAxis(i, axis);
}
}
} else {
int j = 0;
int[] shape = new int[output.getRank()];
Arrays.fill(shape, 1);
for (int i = 0; i< original.getRank(); i++) {
if (Arrays.binarySearch(odatadim, i) < 0) {
if (Arrays.binarySearch(datadims, i) < 0) {
ILazyDataset[] axis = cloneMeta.getAxis(i);
if (axis != null) {
for (ILazyDataset ax : axis) if (ax != null) ax.setShape(shape);
axOut.setAxis(i+j, cloneMeta.getAxis(i));
}
}
} else {
j--;
}
}
}
output.setMetadata(axOut);
}
}
| void function(IDataset output, IDataset original, List<AxesMetadata> ometadata, int rankDif, int[] datadims, int[] odatadim) { if (ometadata != null && !ometadata.isEmpty() && ometadata.get(0) != null) { List<AxesMetadata> metaout = null; try { metaout = output.getMetadata(AxesMetadata.class); } catch (Exception e) { throw new OperationException(this, e); } AxesMetadata inMeta = ometadata.get(0); AxesMetadata axOut = null; if (metaout != null && !metaout.isEmpty()) axOut = metaout.get(0); if (axOut == null) { try { axOut = MetadataFactory.createMetadata(AxesMetadata.class, original.getRank() - rankDif); } catch (MetadataException e) { throw new OperationException(this, e); } } AxesMetadata cloneMeta = (AxesMetadata) inMeta.clone(); if (rankDif == 0) { for (int i = 0; i< original.getRank(); i++) { if (Arrays.binarySearch(datadims, i) < 0 && Arrays.binarySearch(odatadim, i)<0) { ILazyDataset[] axis = cloneMeta.getAxis(i); if (axis != null) axOut.setAxis(i, axis); } } } else { int j = 0; int[] shape = new int[output.getRank()]; Arrays.fill(shape, 1); for (int i = 0; i< original.getRank(); i++) { if (Arrays.binarySearch(odatadim, i) < 0) { if (Arrays.binarySearch(datadims, i) < 0) { ILazyDataset[] axis = cloneMeta.getAxis(i); if (axis != null) { for (ILazyDataset ax : axis) if (ax != null) ax.setShape(shape); axOut.setAxis(i+j, cloneMeta.getAxis(i)); } } } else { j--; } } } output.setMetadata(axOut); } } | /**
* Add missing axes to the updated rank axes metadata
*
* @param output
* @param original
* @param ometadata
* @param rankDif
* @param datadims
*/ | Add missing axes to the updated rank axes metadata | updateAxes | {
"repo_name": "belkassaby/dawnsci",
"path": "org.eclipse.dawnsci.analysis.dataset/src/org/eclipse/dawnsci/analysis/dataset/operations/AbstractOperation.java",
"license": "epl-1.0",
"size": 9182
} | [
"java.util.Arrays",
"java.util.List",
"org.eclipse.dawnsci.analysis.api.processing.OperationException",
"org.eclipse.january.MetadataException",
"org.eclipse.january.dataset.IDataset",
"org.eclipse.january.dataset.ILazyDataset",
"org.eclipse.january.metadata.AxesMetadata",
"org.eclipse.january.metadat... | import java.util.Arrays; import java.util.List; import org.eclipse.dawnsci.analysis.api.processing.OperationException; import org.eclipse.january.MetadataException; import org.eclipse.january.dataset.IDataset; import org.eclipse.january.dataset.ILazyDataset; import org.eclipse.january.metadata.AxesMetadata; import org.eclipse.january.metadata.MetadataFactory; | import java.util.*; import org.eclipse.dawnsci.analysis.api.processing.*; import org.eclipse.january.*; import org.eclipse.january.dataset.*; import org.eclipse.january.metadata.*; | [
"java.util",
"org.eclipse.dawnsci",
"org.eclipse.january"
] | java.util; org.eclipse.dawnsci; org.eclipse.january; | 1,840,811 |
public List<String> getChildList(CuratorFramework zk) {
try {
List<String> jobs = JobStateTracker.getTrackingJobs(appConf, zk);
Collections.sort(jobs);
return jobs;
} catch (IOException e) {
LOG.info("No jobs to check.");
}
return new ArrayList<String>();
} | List<String> function(CuratorFramework zk) { try { List<String> jobs = JobStateTracker.getTrackingJobs(appConf, zk); Collections.sort(jobs); return jobs; } catch (IOException e) { LOG.info(STR); } return new ArrayList<String>(); } | /**
* Get the list of jobs from JobState
*/ | Get the list of jobs from JobState | getChildList | {
"repo_name": "alanfgates/hive",
"path": "hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java",
"license": "apache-2.0",
"size": 5852
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"org.apache.curator.framework.CuratorFramework"
] | import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.curator.framework.CuratorFramework; | import java.io.*; import java.util.*; import org.apache.curator.framework.*; | [
"java.io",
"java.util",
"org.apache.curator"
] | java.io; java.util; org.apache.curator; | 685,992 |
public ByteBuffer serializeToBuffer(Object value, ByteBuffer buffer) throws IOException {
buffer = increaseBufferCapacityIfNeeded(buffer, EMPTY_HEADER.length);
buffer.put(EMPTY_HEADER);
buffer = appendRecursive(buffer, value, utf8Encoder);
int encodedLength = buffer.position() - EMPTY_HEADER.length;
// Overwrite the 32-bit length field at position 3 with the actual length of the object.
buffer.putInt(3, encodedLength);
return buffer;
} | ByteBuffer function(Object value, ByteBuffer buffer) throws IOException { buffer = increaseBufferCapacityIfNeeded(buffer, EMPTY_HEADER.length); buffer.put(EMPTY_HEADER); buffer = appendRecursive(buffer, value, utf8Encoder); int encodedLength = buffer.position() - EMPTY_HEADER.length; buffer.putInt(3, encodedLength); return buffer; } | /**
* Serializes an object using BSER encoding. If possible, writes the object to the provided byte
* buffer and returns it. If the buffer is not big enough to hold the object, returns a new
* buffer.
*
* <p>After returning, buffer.position() is advanced past the last encoded byte.
*/ | Serializes an object using BSER encoding. If possible, writes the object to the provided byte buffer and returns it. If the buffer is not big enough to hold the object, returns a new buffer. After returning, buffer.position() is advanced past the last encoded byte | serializeToBuffer | {
"repo_name": "ilya-klyuchnikov/buck",
"path": "src/com/facebook/buck/util/bser/BserSerializer.java",
"license": "apache-2.0",
"size": 9038
} | [
"java.io.IOException",
"java.nio.ByteBuffer"
] | import java.io.IOException; import java.nio.ByteBuffer; | import java.io.*; import java.nio.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 1,068,594 |
public void termNestIn(int nested, int nest) {
Set<Integer> res = _termNested.get(nested);
res = res == null ? new HashSet<Integer>() : res;
res.add(nest);
_termNested.put(nested, res);
} | void function(int nested, int nest) { Set<Integer> res = _termNested.get(nested); res = res == null ? new HashSet<Integer>() : res; res.add(nest); _termNested.put(nested, res); } | /**
* Index a term with id "nested" as nested in a term with id "nest"
*
* @param nested
* @param nest
*/ | Index a term with id "nested" as nested in a term with id "nest" | termNestIn | {
"repo_name": "scorpiovn/jate",
"path": "src/main/java/uk/ac/shef/dcs/jate/core/feature/FeatureTermNest.java",
"license": "lgpl-3.0",
"size": 2649
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,069,130 |
public long getSize() throws IOException {
if (physicalSize < 0L) {
physicalSize = file.length();
}
return physicalSize;
} | long function() throws IOException { if (physicalSize < 0L) { physicalSize = file.length(); } return physicalSize; } | /**
* Returns the file size in bytes.
* @return the file size
* @throws IOException if failed by I/O error
*/ | Returns the file size in bytes | getSize | {
"repo_name": "akirakw/asakusafw",
"path": "core-project/asakusa-runtime/src/main/java/com/asakusafw/runtime/io/util/BufferedFileInput.java",
"license": "apache-2.0",
"size": 6936
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,875,107 |
InputStream findConfiguration() throws IOException; | InputStream findConfiguration() throws IOException; | /**
* Find the configuration file.
*
* @return the configuration file input stream
*/ | Find the configuration file | findConfiguration | {
"repo_name": "olivergondza/jboss-logmanager",
"path": "src/main/java/org/jboss/logmanager/ConfigurationLocator.java",
"license": "apache-2.0",
"size": 1055
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,457,757 |
public void choseActiveControllerAddress() {
String zkAddress = conf.get(Constants.ZOOKEEPER_QUORUM) + ":" +
conf.getInt(Constants.ZOOKEPER_CLIENT_PORT,
Constants.DEFAULT_ZOOKEPER_CLIENT_PORT);
try {
this.bspzk = new BSPZookeeperImpl(zkAddress, Constants.SESSION_TIME_OUT,
this);
if (bspzk != null) {
if (bspzk.equaltoStat(Constants.BSPCONTROLLER_LEADER, true)) {
String controllerAddr = getData(Constants.BSPCONTROLLER_LEADER);
LOG.info("active controller Address is " + controllerAddr);
this.bspControllerAddr = NetUtils.createSocketAddr(controllerAddr);
} else {
LOG.error("could not get the active BspController's " +
"address,please restart the System");
}
// s = zk.exists(Constants.BSPCONTROLLER_STANDBY_LEADER, true);
if (bspzk.equaltoStat(Constants.BSPCONTROLLER_STANDBY_LEADER, true)) {
String standControllerAddr = getData(
Constants.BSPCONTROLLER_STANDBY_LEADER);
LOG.info("standby controller Address is " + standControllerAddr);
this.standbyControllerAddr = NetUtils
.createSocketAddr(standControllerAddr);
} else {
LOG.info("could not get the standby BspController's address," +
"please restart the standby System");
}
}
} catch (Exception e) {
LOG.error("could not get the active BspController's address," +
"please restart the System:" + e.getMessage());
}
}
| void function() { String zkAddress = conf.get(Constants.ZOOKEEPER_QUORUM) + ":" + conf.getInt(Constants.ZOOKEPER_CLIENT_PORT, Constants.DEFAULT_ZOOKEPER_CLIENT_PORT); try { this.bspzk = new BSPZookeeperImpl(zkAddress, Constants.SESSION_TIME_OUT, this); if (bspzk != null) { if (bspzk.equaltoStat(Constants.BSPCONTROLLER_LEADER, true)) { String controllerAddr = getData(Constants.BSPCONTROLLER_LEADER); LOG.info(STR + controllerAddr); this.bspControllerAddr = NetUtils.createSocketAddr(controllerAddr); } else { LOG.error(STR + STR); } if (bspzk.equaltoStat(Constants.BSPCONTROLLER_STANDBY_LEADER, true)) { String standControllerAddr = getData( Constants.BSPCONTROLLER_STANDBY_LEADER); LOG.info(STR + standControllerAddr); this.standbyControllerAddr = NetUtils .createSocketAddr(standControllerAddr); } else { LOG.info(STR + STR); } } } catch (Exception e) { LOG.error(STR + STR + e.getMessage()); } } | /**
* Get the address of BspController whose role is Active
*/ | Get the address of BspController whose role is Active | choseActiveControllerAddress | {
"repo_name": "LiuJianan/Graduate-Graph",
"path": "src/java/com/chinamobile/bcbsp/workermanager/WorkerManager.java",
"license": "apache-2.0",
"size": 72981
} | [
"com.chinamobile.bcbsp.Constants",
"com.chinamobile.bcbsp.thirdPartyInterface.Zookeeper",
"org.apache.hadoop.net.NetUtils"
] | import com.chinamobile.bcbsp.Constants; import com.chinamobile.bcbsp.thirdPartyInterface.Zookeeper; import org.apache.hadoop.net.NetUtils; | import com.chinamobile.bcbsp.*; import org.apache.hadoop.net.*; | [
"com.chinamobile.bcbsp",
"org.apache.hadoop"
] | com.chinamobile.bcbsp; org.apache.hadoop; | 1,787,953 |
public Map<String, Object> params() {
return params;
} | Map<String, Object> function() { return params; } | /**
* Get parameters that will be available in the {@code init},
* {@code map} and {@code combine} phases.
*/ | Get parameters that will be available in the init, map and combine phases | params | {
"repo_name": "uschindler/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java",
"license": "apache-2.0",
"size": 11423
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,612,738 |
@ExceptionHandler(BadRequestException.class)
public ResponseEntity<?> badRequest(Exception ex, WebRequest webRequest) {
return handleExceptionInternal(ex, ex.getLocalizedMessage(), new HttpHeaders(), HttpStatus.BAD_REQUEST,
webRequest);
} | @ExceptionHandler(BadRequestException.class) ResponseEntity<?> function(Exception ex, WebRequest webRequest) { return handleExceptionInternal(ex, ex.getLocalizedMessage(), new HttpHeaders(), HttpStatus.BAD_REQUEST, webRequest); } | /**
* 400 Bad Request.
*/ | 400 Bad Request | badRequest | {
"repo_name": "raulcsj/CPF",
"path": "plugin/src/main/java/core/plugin/spring/GlobalExceptionHandler.java",
"license": "apache-2.0",
"size": 9428
} | [
"org.springframework.http.HttpHeaders",
"org.springframework.http.HttpStatus",
"org.springframework.http.ResponseEntity",
"org.springframework.web.bind.annotation.ExceptionHandler",
"org.springframework.web.context.request.WebRequest"
] | import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; | import org.springframework.http.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.*; | [
"org.springframework.http",
"org.springframework.web"
] | org.springframework.http; org.springframework.web; | 1,654,590 |
@BeanProperty(description
= "Whether or not the root node from the TreeModel is visible.")
public void setRootVisible(boolean rootVisible) {
if(isRootVisible() != rootVisible && root != null) {
if(rootVisible) {
root.updatePreferredSize(0);
visibleNodes.insertElementAt(root, 0);
}
else if(visibleNodes.size() > 0) {
visibleNodes.removeElementAt(0);
if(treeSelectionModel != null)
treeSelectionModel.removeSelectionPath
(root.getTreePath());
}
if(treeSelectionModel != null)
treeSelectionModel.resetRowSelection();
if(getRowCount() > 0)
getNode(0).setYOrigin(0);
updateYLocationsFrom(0);
visibleNodesChanged();
}
super.setRootVisible(rootVisible);
} | @BeanProperty(description = STR) void function(boolean rootVisible) { if(isRootVisible() != rootVisible && root != null) { if(rootVisible) { root.updatePreferredSize(0); visibleNodes.insertElementAt(root, 0); } else if(visibleNodes.size() > 0) { visibleNodes.removeElementAt(0); if(treeSelectionModel != null) treeSelectionModel.removeSelectionPath (root.getTreePath()); } if(treeSelectionModel != null) treeSelectionModel.resetRowSelection(); if(getRowCount() > 0) getNode(0).setYOrigin(0); updateYLocationsFrom(0); visibleNodesChanged(); } super.setRootVisible(rootVisible); } | /**
* Determines whether or not the root node from
* the <code>TreeModel</code> is visible.
*
* @param rootVisible true if the root node of the tree is to be displayed
* @see #rootVisible
*/ | Determines whether or not the root node from the <code>TreeModel</code> is visible | setRootVisible | {
"repo_name": "mirkosertic/Bytecoder",
"path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/tree/VariableHeightLayoutCache.java",
"license": "apache-2.0",
"size": 61865
} | [
"java.beans.BeanProperty"
] | import java.beans.BeanProperty; | import java.beans.*; | [
"java.beans"
] | java.beans; | 1,991,356 |
private static void createContextFiles(Resource configDir, ServletConfig servletConfig, boolean doNew) throws IOException {
// NICE dies muss dynamisch erstellt werden, da hier der admin hinkommt
// und dieser sehr viele files haben wird
Resource contextDir = configDir.getRealResource("context");
if (!contextDir.exists())
contextDir.mkdirs();
// custom locale files
{
Resource dir = configDir.getRealResource("locales");
if (!dir.exists())
dir.mkdirs();
Resource file = dir.getRealResource("pt-PT-date.df");
if (!file.exists())
createFileFromResourceEL("/resource/locales/pt-PT-date.df", file);
}
// video
Resource videoDir = configDir.getRealResource("video");
if (!videoDir.exists())
videoDir.mkdirs();
Resource video = videoDir.getRealResource("video.xml");
if (!video.exists())
createFileFromResourceEL("/resource/video/video.xml", video);
// bin
Resource binDir = configDir.getRealResource("bin");
if (!binDir.exists())
binDir.mkdirs();
Resource ctDir = configDir.getRealResource("customtags");
if (!ctDir.exists())
ctDir.mkdirs();
// Jacob
if (SystemUtil.isWindows()) {
String name = (SystemUtil.getJREArch() == SystemUtil.ARCH_64) ? "jacob-x64.dll" : "jacob-i586.dll";
Resource jacob = binDir.getRealResource(name);
if (!jacob.exists()) {
createFileFromResourceEL("/resource/bin/windows" + ((SystemUtil.getJREArch() == SystemUtil.ARCH_64) ? "64" : "32") + "/" + name, jacob);
}
}
Resource storDir = configDir.getRealResource("storage");
if (!storDir.exists())
storDir.mkdirs();
Resource compDir = configDir.getRealResource("components");
if (!compDir.exists())
compDir.mkdirs();
// remove old cacerts files, they are now only in the server context
Resource secDir = configDir.getRealResource("security");
Resource f = null;
if (secDir.exists()) {
f = secDir.getRealResource("cacerts");
if (f.exists())
f.delete();
if (ResourceUtil.isEmpty(secDir))
secDir.delete();
}
// lucee-context
f = contextDir.getRealResource("lucee-context.lar");
if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-context.lar", f);
else createFileFromResourceCheckSizeDiffEL("/resource/context/lucee-context.lar", f);
// lucee-admin
f = contextDir.getRealResource("lucee-admin.lar");
if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-admin.lar", f);
else createFileFromResourceCheckSizeDiffEL("/resource/context/lucee-admin.lar", f);
// lucee-doc
f = contextDir.getRealResource("lucee-doc.lar");
if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-doc.lar", f);
else createFileFromResourceCheckSizeDiffEL("/resource/context/lucee-doc.lar", f);
f = contextDir.getRealResource("component-dump."+TEMPLATE_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/component-dump."+TEMPLATE_EXTENSION, f);
// Base Component
String badContent = "<cfcomponent displayname=\"Component\" hint=\"This is the Base Component\">\n</cfcomponent>";
String badVersion = "704b5bd8597be0743b0c99a644b65896";
f = contextDir.getRealResource("Component."+COMPONENT_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/Component."+COMPONENT_EXTENSION, f);
else if (doNew && badVersion.equals(ConfigWebUtil.createMD5FromResource(f))) {
createFileFromResourceEL("/resource/context/Component."+COMPONENT_EXTENSION, f);
}
else if (doNew && badContent.equals(createContentFromResource(f).trim())) {
createFileFromResourceEL("/resource/context/Component."+COMPONENT_EXTENSION, f);
}
// Component.lucee
f = contextDir.getRealResource("Component."+COMPONENT_EXTENSION_LUCEE);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/Component."+COMPONENT_EXTENSION_LUCEE, f);
f = contextDir.getRealResource(Constants.CFML_APPLICATION_EVENT_HANDLER);
if (!f.exists())
createFileFromResourceEL("/resource/context/Application."+COMPONENT_EXTENSION, f);
f = contextDir.getRealResource("form."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/form."+TEMPLATE_EXTENSION, f);
f = contextDir.getRealResource("graph."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/graph."+TEMPLATE_EXTENSION, f);
f = contextDir.getRealResource("wddx."+TEMPLATE_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/wddx."+TEMPLATE_EXTENSION, f);
f = contextDir.getRealResource("lucee-applet."+TEMPLATE_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/lucee-applet."+TEMPLATE_EXTENSION, f);
f = contextDir.getRealResource("lucee-applet.jar");
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/lucee-applet.jar", f);
// f=new BinaryFile(contextDir,"lucee_context.ra");
// if(!f.exists())createFileFromResource("/resource/context/lucee_context.ra",f);
f = contextDir.getRealResource("admin."+TEMPLATE_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/admin."+TEMPLATE_EXTENSION, f);
// Video
f = contextDir.getRealResource("swfobject.js");
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/video/swfobject.js", f);
f = contextDir.getRealResource("swfobject.js."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/video/swfobject.js."+TEMPLATE_EXTENSION, f);
f = contextDir.getRealResource("mediaplayer.swf");
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/video/mediaplayer.swf", f);
f = contextDir.getRealResource("mediaplayer.swf."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/video/mediaplayer.swf."+TEMPLATE_EXTENSION, f);
Resource adminDir = contextDir.getRealResource("admin");
if (!adminDir.exists())
adminDir.mkdirs();
// Plugin
Resource pluginDir = adminDir.getRealResource("plugin");
if (!pluginDir.exists())
pluginDir.mkdirs();
f = pluginDir.getRealResource("Plugin."+COMPONENT_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/admin/plugin/Plugin."+COMPONENT_EXTENSION, f);
// Plugin Note
Resource note = pluginDir.getRealResource("Note");
if (!note.exists())
note.mkdirs();
f = note.getRealResource("language.xml");
if (!f.exists())
createFileFromResourceEL("/resource/context/admin/plugin/Note/language.xml", f);
f = note.getRealResource("overview."+TEMPLATE_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/admin/plugin/Note/overview."+TEMPLATE_EXTENSION, f);
f = note.getRealResource("Action."+COMPONENT_EXTENSION);
if (!f.exists())
createFileFromResourceEL("/resource/context/admin/plugin/Note/Action."+COMPONENT_EXTENSION, f);
// gateway
Resource componentsDir = configDir.getRealResource("components");
if (!componentsDir.exists())
componentsDir.mkdirs();
Resource gwDir = componentsDir.getRealResource("lucee/extension/gateway/");
create("/resource/context/gateway/",new String[]{
"TaskGateway."+COMPONENT_EXTENSION
,"DummyGateway."+COMPONENT_EXTENSION
,"DirectoryWatcher."+COMPONENT_EXTENSION
,"DirectoryWatcherListener."+COMPONENT_EXTENSION
,"MailWatcher."+COMPONENT_EXTENSION
,"MailWatcherListener."+COMPONENT_EXTENSION
},gwDir,doNew);
// resources/language
Resource langDir = adminDir.getRealResource("resources/language");
create("/resource/context/admin/resources/language/",new String[]{
"en.xml","de.xml"
},langDir,doNew);
// delete Debug
Resource debug = adminDir.getRealResource("debug");
delete(debug,new String[]{
"Classic."+COMPONENT_EXTENSION
,"Modern."+COMPONENT_EXTENSION
,"Comment."+COMPONENT_EXTENSION
});
// add Debug
create("/resource/context/admin/debug/",new String[]{
"Debug."+COMPONENT_EXTENSION
,"Field."+COMPONENT_EXTENSION
,"Group."+COMPONENT_EXTENSION
},debug,doNew);
// delete Cache Driver
Resource cDir = adminDir.getRealResource("cdriver");
delete(cDir,new String[]{
"RamCache."+COMPONENT_EXTENSION
,"EHCacheLite."+COMPONENT_EXTENSION
,"EHCache."+COMPONENT_EXTENSION
});
// add Cache Drivers
create("/resource/context/admin/cdriver/",new String[]{
"Cache."+COMPONENT_EXTENSION
,"Field."+COMPONENT_EXTENSION
,"Group."+COMPONENT_EXTENSION}
,cDir,doNew);
// delete DB Drivers
Resource dbDir = adminDir.getRealResource("dbdriver");
delete(dbDir,new String[]{
"HSQLDB."+COMPONENT_EXTENSION
,"H2."+COMPONENT_EXTENSION
,"MSSQL."+COMPONENT_EXTENSION
,"MSSQL2."+COMPONENT_EXTENSION
,"DB2."+COMPONENT_EXTENSION
,"Oracle."+COMPONENT_EXTENSION
,"MySQL."+COMPONENT_EXTENSION
,"ODBC."+COMPONENT_EXTENSION
,"Sybase."+COMPONENT_EXTENSION
,"PostgreSql."+COMPONENT_EXTENSION
,"Other."+COMPONENT_EXTENSION
,"Firebird."+COMPONENT_EXTENSION
,"Driver."+COMPONENT_EXTENSION
});
// add DB Drivers types
Resource typesDir = dbDir.getRealResource("types");
create("/resource/context/admin/dbdriver/types/",new String[]{
"IDriver."+COMPONENT_EXTENSION
,"Driver."+COMPONENT_EXTENSION
,"IDatasource."+COMPONENT_EXTENSION
,"IDriverSelector."+COMPONENT_EXTENSION
,"Field."+COMPONENT_EXTENSION
},typesDir,doNew);
// delete Gateway Drivers
Resource gDir = adminDir.getRealResource("gdriver");
delete(gDir,new String[]{
"TaskGatewayDriver."+COMPONENT_EXTENSION
,"DirectoryWatcher."+COMPONENT_EXTENSION
,"MailWatcher."+COMPONENT_EXTENSION
});
// add Gateway Drivers
create("/resource/context/admin/gdriver/",new String[]{
"Gateway."+COMPONENT_EXTENSION
,"Field."+COMPONENT_EXTENSION
,"Group."+COMPONENT_EXTENSION}
,gDir,doNew);
// add Logging/appender
Resource app = adminDir.getRealResource("logging/appender");
create("/resource/context/admin/logging/appender/",new String[]{
"Appender."+COMPONENT_EXTENSION,"Field."+COMPONENT_EXTENSION,"Group."+COMPONENT_EXTENSION}
,app,doNew);
// Logging/layout
Resource lay = adminDir.getRealResource("logging/layout");
create("/resource/context/admin/logging/layout/",new String[]{
"Layout."+COMPONENT_EXTENSION,"Field."+COMPONENT_EXTENSION,"Group."+COMPONENT_EXTENSION}
,lay,doNew);
Resource templatesDir = contextDir.getRealResource("templates");
if (!templatesDir.exists())
templatesDir.mkdirs();
Resource errorDir = templatesDir.getRealResource("error");
if (!errorDir.exists())
errorDir.mkdirs();
f = errorDir.getRealResource("error."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/templates/error/error."+TEMPLATE_EXTENSION, f);
f = errorDir.getRealResource("error-neo."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/templates/error/error-neo."+TEMPLATE_EXTENSION, f);
f = errorDir.getRealResource("error-public."+TEMPLATE_EXTENSION);
if (!f.exists() || doNew)
createFileFromResourceEL("/resource/context/templates/error/error-public."+TEMPLATE_EXTENSION, f);
Resource displayDir = templatesDir.getRealResource("display");
if (!displayDir.exists())
displayDir.mkdirs();
} | static void function(Resource configDir, ServletConfig servletConfig, boolean doNew) throws IOException { Resource contextDir = configDir.getRealResource(STR); if (!contextDir.exists()) contextDir.mkdirs(); { Resource dir = configDir.getRealResource(STR); if (!dir.exists()) dir.mkdirs(); Resource file = dir.getRealResource(STR); if (!file.exists()) createFileFromResourceEL(STR, file); } Resource videoDir = configDir.getRealResource("video"); if (!videoDir.exists()) videoDir.mkdirs(); Resource video = videoDir.getRealResource(STR); if (!video.exists()) createFileFromResourceEL(STR, video); Resource binDir = configDir.getRealResource("bin"); if (!binDir.exists()) binDir.mkdirs(); Resource ctDir = configDir.getRealResource(STR); if (!ctDir.exists()) ctDir.mkdirs(); if (SystemUtil.isWindows()) { String name = (SystemUtil.getJREArch() == SystemUtil.ARCH_64) ? STR : STR; Resource jacob = binDir.getRealResource(name); if (!jacob.exists()) { createFileFromResourceEL(STR + ((SystemUtil.getJREArch() == SystemUtil.ARCH_64) ? "64" : "32") + "/" + name, jacob); } } Resource storDir = configDir.getRealResource(STR); if (!storDir.exists()) storDir.mkdirs(); Resource compDir = configDir.getRealResource(STR); if (!compDir.exists()) compDir.mkdirs(); Resource secDir = configDir.getRealResource(STR); Resource f = null; if (secDir.exists()) { f = secDir.getRealResource(STR); if (f.exists()) f.delete(); if (ResourceUtil.isEmpty(secDir)) secDir.delete(); } f = contextDir.getRealResource(STR); if (!f.exists() doNew) createFileFromResourceEL(STR, f); else createFileFromResourceCheckSizeDiffEL(STR, f); f = contextDir.getRealResource(STR); if (!f.exists() doNew) createFileFromResourceEL(STR, f); else createFileFromResourceCheckSizeDiffEL(STR, f); f = contextDir.getRealResource(STR); if (!f.exists() doNew) createFileFromResourceEL(STR, f); else createFileFromResourceCheckSizeDiffEL(STR, f); f = contextDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); String badContent = STRComponent\STRThis is the Base Component\STR; String badVersion = STR; f = contextDir.getRealResource(STR+COMPONENT_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+COMPONENT_EXTENSION, f); else if (doNew && badVersion.equals(ConfigWebUtil.createMD5FromResource(f))) { createFileFromResourceEL(STR+COMPONENT_EXTENSION, f); } else if (doNew && badContent.equals(createContentFromResource(f).trim())) { createFileFromResourceEL(STR+COMPONENT_EXTENSION, f); } f = contextDir.getRealResource(STR+COMPONENT_EXTENSION_LUCEE); if (!f.exists() doNew) createFileFromResourceEL(STR+COMPONENT_EXTENSION_LUCEE, f); f = contextDir.getRealResource(Constants.CFML_APPLICATION_EVENT_HANDLER); if (!f.exists()) createFileFromResourceEL(STR+COMPONENT_EXTENSION, f); f = contextDir.getRealResource("form."+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = contextDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = contextDir.getRealResource("wddx."+TEMPLATE_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = contextDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = contextDir.getRealResource(STR); if (!f.exists() doNew) createFileFromResourceEL(STR, f); f = contextDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = contextDir.getRealResource(STR); if (!f.exists() doNew) createFileFromResourceEL(STR, f); f = contextDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = contextDir.getRealResource(STR); if (!f.exists() doNew) createFileFromResourceEL(STR, f); f = contextDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); Resource adminDir = contextDir.getRealResource("admin"); if (!adminDir.exists()) adminDir.mkdirs(); Resource pluginDir = adminDir.getRealResource(STR); if (!pluginDir.exists()) pluginDir.mkdirs(); f = pluginDir.getRealResource(STR+COMPONENT_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+COMPONENT_EXTENSION, f); Resource note = pluginDir.getRealResource("Note"); if (!note.exists()) note.mkdirs(); f = note.getRealResource(STR); if (!f.exists()) createFileFromResourceEL(STR, f); f = note.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = note.getRealResource(STR+COMPONENT_EXTENSION); if (!f.exists()) createFileFromResourceEL(STR+COMPONENT_EXTENSION, f); Resource componentsDir = configDir.getRealResource(STR); if (!componentsDir.exists()) componentsDir.mkdirs(); Resource gwDir = componentsDir.getRealResource(STR); create(STR,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION },gwDir,doNew); Resource langDir = adminDir.getRealResource(STR); create(STR,new String[]{ STR,STR },langDir,doNew); Resource debug = adminDir.getRealResource("debug"); delete(debug,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION }); create(STR,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION },debug,doNew); Resource cDir = adminDir.getRealResource(STR); delete(cDir,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION }); create(STR,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION} ,cDir,doNew); Resource dbDir = adminDir.getRealResource(STR); delete(dbDir,new String[]{ STR+COMPONENT_EXTENSION ,"H2."+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,"DB2."+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,"ODBC."+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION }); Resource typesDir = dbDir.getRealResource("types"); create(STR,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION },typesDir,doNew); Resource gDir = adminDir.getRealResource(STR); delete(gDir,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION }); create(STR,new String[]{ STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION ,STR+COMPONENT_EXTENSION} ,gDir,doNew); Resource app = adminDir.getRealResource(STR); create(STR,new String[]{ STR+COMPONENT_EXTENSION,STR+COMPONENT_EXTENSION,STR+COMPONENT_EXTENSION} ,app,doNew); Resource lay = adminDir.getRealResource(STR); create(STR,new String[]{ STR+COMPONENT_EXTENSION,STR+COMPONENT_EXTENSION,STR+COMPONENT_EXTENSION} ,lay,doNew); Resource templatesDir = contextDir.getRealResource(STR); if (!templatesDir.exists()) templatesDir.mkdirs(); Resource errorDir = templatesDir.getRealResource("error"); if (!errorDir.exists()) errorDir.mkdirs(); f = errorDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = errorDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); f = errorDir.getRealResource(STR+TEMPLATE_EXTENSION); if (!f.exists() doNew) createFileFromResourceEL(STR+TEMPLATE_EXTENSION, f); Resource displayDir = templatesDir.getRealResource(STR); if (!displayDir.exists()) displayDir.mkdirs(); } | /**
* Creates all files for Lucee Context
*
* @param configDir
* @throws IOException
* @throws IOException
*/ | Creates all files for Lucee Context | createContextFiles | {
"repo_name": "lucee/unoffical-Lucee-no-jre",
"path": "source/java/core/src/lucee/runtime/config/XMLConfigWebFactory.java",
"license": "lgpl-2.1",
"size": 169381
} | [
"java.io.IOException",
"javax.servlet.ServletConfig"
] | import java.io.IOException; import javax.servlet.ServletConfig; | import java.io.*; import javax.servlet.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 107,832 |
public static PackagePartName createPartName(URI partName,
PackagePart relativePart) throws InvalidFormatException {
URI newPartNameURI = resolvePartUri(
relativePart.getPartName().getURI(), partName);
return createPartName(newPartNameURI);
} | static PackagePartName function(URI partName, PackagePart relativePart) throws InvalidFormatException { URI newPartNameURI = resolvePartUri( relativePart.getPartName().getURI(), partName); return createPartName(newPartNameURI); } | /**
* Create an OPC compliant part name by resolving it using a base part.
*
* @param partName
* The part name URI to validate.
* @param relativePart
* The relative base part.
* @return The correspondant part name if valid, else <code>null</code>.
* @throws InvalidFormatException
* Throws if the specified part name is not OPC compliant.
* @see #createPartName(URI)
*/ | Create an OPC compliant part name by resolving it using a base part | createPartName | {
"repo_name": "tobyclemson/msci-project",
"path": "vendor/poi-3.6/src/ooxml/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java",
"license": "mit",
"size": 19242
} | [
"org.apache.poi.openxml4j.exceptions.InvalidFormatException"
] | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; | import org.apache.poi.openxml4j.exceptions.*; | [
"org.apache.poi"
] | org.apache.poi; | 929,965 |
public byte[] toBytes(Action.ActionResult result) {
try {
return IOUtils.toByteArray(result.getResult().getRenderable().render(result.getContext(), result.getResult()));
} catch (Exception e) {
throw new IllegalArgumentException("Cannot retrieve the byte[] form of result `" + result + "`", e);
}
} | byte[] function(Action.ActionResult result) { try { return IOUtils.toByteArray(result.getResult().getRenderable().render(result.getContext(), result.getResult())); } catch (Exception e) { throw new IllegalArgumentException(STR + result + "`", e); } } | /**
* Helper method to get the content of the response as byte array.
*
* @param result the result object from which the content is extracted. Must not be {@literal null}.
* @return the String form of the result.
* @throws IllegalArgumentException if the byte array cannot be retrieved.
*/ | Helper method to get the content of the response as byte array | toBytes | {
"repo_name": "evrignaud/wisdom",
"path": "core/wisdom-test/src/main/java/org/wisdom/test/parents/WisdomUnitTest.java",
"license": "apache-2.0",
"size": 6082
} | [
"org.apache.commons.io.IOUtils"
] | import org.apache.commons.io.IOUtils; | import org.apache.commons.io.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,243,206 |
public String playAndGetDigits(int min, int max, int tries, int timeout,
String terminator, String file, String invalidFile, String regexp,
int digitTimeout) throws ExecuteException {
String id = UUID.randomUUID().toString();
CommandResponse resp = sendExeMesg("play_and_get_digits",
String.valueOf(min)
+ " " + max
+ " " + tries
+ " " + timeout
+ " " + terminator
+ " " + file
+ " " + invalidFile
+ " " + id
+ " " + regexp
+ " " + digitTimeout);
if (resp.isOk()) {
EslMessage eslMessage = api.sendApiCommand("uuid_getvar", _uuid
+ " " + id);
if (eslMessage.getBodyLines().size() > 0)
return eslMessage.getBodyLines().get(0);
} else {
throw new ExecuteException(resp.getReplyText());
}
return null;
} | String function(int min, int max, int tries, int timeout, String terminator, String file, String invalidFile, String regexp, int digitTimeout) throws ExecuteException { String id = UUID.randomUUID().toString(); CommandResponse resp = sendExeMesg(STR, String.valueOf(min) + " " + max + " " + tries + " " + timeout + " " + terminator + " " + file + " " + invalidFile + " " + id + " " + regexp + " " + digitTimeout); if (resp.isOk()) { EslMessage eslMessage = api.sendApiCommand(STR, _uuid + " " + id); if (eslMessage.getBodyLines().size() > 0) return eslMessage.getBodyLines().get(0); } else { throw new ExecuteException(resp.getReplyText()); } return null; } | /**
* Play a prompt and get digits.
*
* @return collected digits or null if none
*
* @see <a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits">
* http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits
* </a>
*/ | Play a prompt and get digits | playAndGetDigits | {
"repo_name": "mgodave/esl-client",
"path": "src/main/java/org/freeswitch/esl/client/dptools/Execute.java",
"license": "apache-2.0",
"size": 65062
} | [
"java.util.UUID",
"org.freeswitch.esl.client.transport.CommandResponse",
"org.freeswitch.esl.client.transport.message.EslMessage"
] | import java.util.UUID; import org.freeswitch.esl.client.transport.CommandResponse; import org.freeswitch.esl.client.transport.message.EslMessage; | import java.util.*; import org.freeswitch.esl.client.transport.*; import org.freeswitch.esl.client.transport.message.*; | [
"java.util",
"org.freeswitch.esl"
] | java.util; org.freeswitch.esl; | 772,402 |
@Test
public void testDeserializedFieldsMatchOriginalPacket() throws Exception {
T original = getInitialisedPacket();
setCommonFields(original);
T decodedPacket = getPacketType().newInstance();
ByteArrayOutputStream out = new ByteArrayOutputStream();
PacketEncoderImpl encoder = new PacketEncoderImpl(out);
original.writeTo(encoder);
PacketDecoderImpl decoder = new PacketDecoderImpl(out.toByteArray());
decodedPacket.readFrom(decoder);
assertEquals(decodedPacket, original);
} | void function() throws Exception { T original = getInitialisedPacket(); setCommonFields(original); T decodedPacket = getPacketType().newInstance(); ByteArrayOutputStream out = new ByteArrayOutputStream(); PacketEncoderImpl encoder = new PacketEncoderImpl(out); original.writeTo(encoder); PacketDecoderImpl decoder = new PacketDecoderImpl(out.toByteArray()); decodedPacket.readFrom(decoder); assertEquals(decodedPacket, original); } | /**
* Test that after serializing and deserializing a packet, the mandatory
* parameters all match.
* @throws Exception
*/ | Test that after serializing and deserializing a packet, the mandatory parameters all match | testDeserializedFieldsMatchOriginalPacket | {
"repo_name": "Mobicents/smpp",
"path": "src/test/java/org/mobicents/protocols/smpp/message/PacketTests.java",
"license": "lgpl-3.0",
"size": 6250
} | [
"java.io.ByteArrayOutputStream",
"org.mobicents.protocols.smpp.util.PacketDecoderImpl",
"org.mobicents.protocols.smpp.util.PacketEncoderImpl",
"org.testng.Assert"
] | import java.io.ByteArrayOutputStream; import org.mobicents.protocols.smpp.util.PacketDecoderImpl; import org.mobicents.protocols.smpp.util.PacketEncoderImpl; import org.testng.Assert; | import java.io.*; import org.mobicents.protocols.smpp.util.*; import org.testng.*; | [
"java.io",
"org.mobicents.protocols",
"org.testng"
] | java.io; org.mobicents.protocols; org.testng; | 2,152,802 |
public BukkitTask runTaskLater(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException;
/**
* @deprecated Use {@link BukkitRunnable#runTaskLater(Plugin, long)} | BukkitTask function(Plugin plugin, Runnable task, long delay) throws IllegalArgumentException; /** * @deprecated Use {@link BukkitRunnable#runTaskLater(Plugin, long)} | /**
* Returns a task that will run after the specified number of server
* ticks.
*
* @param plugin the reference to the plugin scheduling task
* @param task the task to be run
* @param delay the ticks to wait before running the task
* @return a BukkitTask that contains the id number
* @throws IllegalArgumentException if plugin is null
* @throws IllegalArgumentException if task is null
*/ | Returns a task that will run after the specified number of server ticks | runTaskLater | {
"repo_name": "Techcable/Bukkit",
"path": "src/main/java/org/bukkit/scheduler/BukkitScheduler.java",
"license": "gpl-3.0",
"size": 12155
} | [
"org.bukkit.plugin.Plugin"
] | import org.bukkit.plugin.Plugin; | import org.bukkit.plugin.*; | [
"org.bukkit.plugin"
] | org.bukkit.plugin; | 2,326,919 |
private void performTransitions(State msgProcessedState, Message msg) {
State orgState = mStateStack[mStateStackTopIndex].state;
boolean recordLogMsg = mSm.recordLogRec(mMsg) && (msg.obj != mSmHandlerObj);
if (mLogRecords.logOnlyTransitions()) {
if (mDestState != null) {
mLogRecords.add(mSm, mMsg, mSm.getLogRecString(mMsg), msgProcessedState,
orgState, mDestState);
}
} else if (recordLogMsg) {
mLogRecords.add(mSm, mMsg, mSm.getLogRecString(mMsg), msgProcessedState, orgState,
mDestState);
}
State destState = mDestState;
if (destState != null) {
while (true) {
if (mDbg) mSm.log("handleMessage: new destination call exit/enter");
StateInfo commonStateInfo = setupTempStateStackWithStatesToEnter(destState);
invokeExitMethods(commonStateInfo);
int stateStackEnteringIndex = moveTempStateStackToStateStack();
invokeEnterMethods(stateStackEnteringIndex);
moveDeferredMessageAtFrontOfQueue();
if (destState != mDestState) {
// A new mDestState so continue looping
destState = mDestState;
} else {
// No change in mDestState so we're done
break;
}
}
mDestState = null;
}
if (destState != null) {
if (destState == mQuittingState) {
mSm.onQuitting();
cleanupAfterQuitting();
} else if (destState == mHaltingState) {
mSm.onHalting();
}
}
} | void function(State msgProcessedState, Message msg) { State orgState = mStateStack[mStateStackTopIndex].state; boolean recordLogMsg = mSm.recordLogRec(mMsg) && (msg.obj != mSmHandlerObj); if (mLogRecords.logOnlyTransitions()) { if (mDestState != null) { mLogRecords.add(mSm, mMsg, mSm.getLogRecString(mMsg), msgProcessedState, orgState, mDestState); } } else if (recordLogMsg) { mLogRecords.add(mSm, mMsg, mSm.getLogRecString(mMsg), msgProcessedState, orgState, mDestState); } State destState = mDestState; if (destState != null) { while (true) { if (mDbg) mSm.log(STR); StateInfo commonStateInfo = setupTempStateStackWithStatesToEnter(destState); invokeExitMethods(commonStateInfo); int stateStackEnteringIndex = moveTempStateStackToStateStack(); invokeEnterMethods(stateStackEnteringIndex); moveDeferredMessageAtFrontOfQueue(); if (destState != mDestState) { destState = mDestState; } else { break; } } mDestState = null; } if (destState != null) { if (destState == mQuittingState) { mSm.onQuitting(); cleanupAfterQuitting(); } else if (destState == mHaltingState) { mSm.onHalting(); } } } | /**
* Do any transitions
* @param msgProcessedState is the state that processed the message
*/ | Do any transitions | performTransitions | {
"repo_name": "OmniEvo/android_frameworks_base",
"path": "core/java/com/android/internal/util/StateMachine.java",
"license": "gpl-3.0",
"size": 69732
} | [
"android.os.Message"
] | import android.os.Message; | import android.os.*; | [
"android.os"
] | android.os; | 370,050 |
@Test
public void testSaslDigestMd5Bind() throws Exception
{
Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
LdapNetworkConnection connection = new LdapNetworkConnection( InetAddress.getLocalHost().getHostName(), getLdapServer().getPort() );
SaslDigestMd5Request request = new SaslDigestMd5Request();
request.setUsername( userDn.getRdn().getValue().getString() );
request.setCredentials( "secret" );
request.setRealmName( ldapServer.getSaslRealms().get( 0 ) );
BindResponse resp = connection.bind( request );
assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );
Entry entry = connection.lookup( userDn );
assertEquals( "hnelson", entry.get( "uid" ).getString() );
connection.close();
} | void function() throws Exception { Dn userDn = new Dn( STR ); LdapNetworkConnection connection = new LdapNetworkConnection( InetAddress.getLocalHost().getHostName(), getLdapServer().getPort() ); SaslDigestMd5Request request = new SaslDigestMd5Request(); request.setUsername( userDn.getRdn().getValue().getString() ); request.setCredentials( STR ); request.setRealmName( ldapServer.getSaslRealms().get( 0 ) ); BindResponse resp = connection.bind( request ); assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() ); Entry entry = connection.lookup( userDn ); assertEquals( STR, entry.get( "uid" ).getString() ); connection.close(); } | /**
* Tests to make sure DIGEST-MD5 binds below the RootDSE work.
*/ | Tests to make sure DIGEST-MD5 binds below the RootDSE work | testSaslDigestMd5Bind | {
"repo_name": "drankye/directory-server",
"path": "server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java",
"license": "apache-2.0",
"size": 33230
} | [
"java.net.InetAddress",
"org.apache.directory.api.ldap.model.entry.Entry",
"org.apache.directory.api.ldap.model.message.BindResponse",
"org.apache.directory.api.ldap.model.message.ResultCodeEnum",
"org.apache.directory.api.ldap.model.name.Dn",
"org.apache.directory.ldap.client.api.LdapNetworkConnection",
... | import java.net.InetAddress; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.message.BindResponse; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.ldap.client.api.LdapNetworkConnection; import org.apache.directory.ldap.client.api.SaslDigestMd5Request; import org.junit.Assert; | import java.net.*; import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.api.ldap.model.message.*; import org.apache.directory.api.ldap.model.name.*; import org.apache.directory.ldap.client.api.*; import org.junit.*; | [
"java.net",
"org.apache.directory",
"org.junit"
] | java.net; org.apache.directory; org.junit; | 17,565 |
public void performRecoveryRestart() throws IOException {
synchronized (mutex) {
if (state != IndexShardState.RECOVERING) {
throw new IndexShardNotRecoveringException(shardId, state);
}
final Engine engine = this.currentEngineReference.getAndSet(null);
IOUtils.close(engine);
recoveryState().setStage(RecoveryState.Stage.INIT);
}
} | void function() throws IOException { synchronized (mutex) { if (state != IndexShardState.RECOVERING) { throw new IndexShardNotRecoveringException(shardId, state); } final Engine engine = this.currentEngineReference.getAndSet(null); IOUtils.close(engine); recoveryState().setStage(RecoveryState.Stage.INIT); } } | /**
* called if recovery has to be restarted after network error / delay **
*/ | called if recovery has to be restarted after network error / delay | performRecoveryRestart | {
"repo_name": "sneivandt/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/index/shard/IndexShard.java",
"license": "apache-2.0",
"size": 117724
} | [
"java.io.IOException",
"org.apache.lucene.util.IOUtils",
"org.elasticsearch.index.engine.Engine",
"org.elasticsearch.indices.recovery.RecoveryState"
] | import java.io.IOException; import org.apache.lucene.util.IOUtils; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.indices.recovery.RecoveryState; | import java.io.*; import org.apache.lucene.util.*; import org.elasticsearch.index.engine.*; import org.elasticsearch.indices.recovery.*; | [
"java.io",
"org.apache.lucene",
"org.elasticsearch.index",
"org.elasticsearch.indices"
] | java.io; org.apache.lucene; org.elasticsearch.index; org.elasticsearch.indices; | 1,936,353 |
public static void archiveFamily(FileSystem fs, Configuration conf,
HRegionInfo parent, Path tableDir, byte[] family) throws IOException {
Path familyDir = new Path(tableDir, new Path(parent.getEncodedName(), Bytes.toString(family)));
FileStatus[] storeFiles = FSUtils.listStatus(fs, familyDir);
if (storeFiles == null) {
LOG.debug("No store files to dispose for region=" + parent.getRegionNameAsString() +
", family=" + Bytes.toString(family));
return;
}
FileStatusConverter getAsFile = new FileStatusConverter(fs);
Collection<File> toArchive = Lists.transform(Arrays.asList(storeFiles), getAsFile);
Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, parent, tableDir, family);
// do the actual archive
if (!resolveAndArchive(fs, storeArchiveDir, toArchive)) {
throw new IOException("Failed to archive/delete all the files for region:"
+ Bytes.toString(parent.getRegionName()) + ", family:" + Bytes.toString(family)
+ " into " + storeArchiveDir + ". Something is probably awry on the filesystem.");
}
}
/**
* Remove the store files, either by archiving them or outright deletion
* @param conf {@link Configuration} to examine to determine the archive directory
* @param fs the filesystem where the store files live
* @param regionInfo {@link HRegionInfo} of the region hosting the store files
* @param family the family hosting the store files
* @param compactedFiles files to be disposed of. No further reading of these files should be
* attempted; otherwise likely to cause an {@link IOException} | static void function(FileSystem fs, Configuration conf, HRegionInfo parent, Path tableDir, byte[] family) throws IOException { Path familyDir = new Path(tableDir, new Path(parent.getEncodedName(), Bytes.toString(family))); FileStatus[] storeFiles = FSUtils.listStatus(fs, familyDir); if (storeFiles == null) { LOG.debug(STR + parent.getRegionNameAsString() + STR + Bytes.toString(family)); return; } FileStatusConverter getAsFile = new FileStatusConverter(fs); Collection<File> toArchive = Lists.transform(Arrays.asList(storeFiles), getAsFile); Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, parent, tableDir, family); if (!resolveAndArchive(fs, storeArchiveDir, toArchive)) { throw new IOException(STR + Bytes.toString(parent.getRegionName()) + STR + Bytes.toString(family) + STR + storeArchiveDir + STR); } } /** * Remove the store files, either by archiving them or outright deletion * @param conf {@link Configuration} to examine to determine the archive directory * @param fs the filesystem where the store files live * @param regionInfo {@link HRegionInfo} of the region hosting the store files * @param family the family hosting the store files * @param compactedFiles files to be disposed of. No further reading of these files should be * attempted; otherwise likely to cause an {@link IOException} | /**
* Remove from the specified region the store files of the specified column family,
* either by archiving them or outright deletion
* @param fs the filesystem where the store files live
* @param conf {@link Configuration} to examine to determine the archive directory
* @param parent Parent region hosting the store files
* @param tableDir {@link Path} to where the table is being stored (for building the archive path)
* @param family the family hosting the store files
* @throws IOException if the files could not be correctly disposed.
*/ | Remove from the specified region the store files of the specified column family, either by archiving them or outright deletion | archiveFamily | {
"repo_name": "toshimasa-nasu/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java",
"license": "apache-2.0",
"size": 26785
} | [
"com.google.common.collect.Lists",
"java.io.IOException",
"java.util.Arrays",
"java.util.Collection",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HRegionInfo",
"org.apache.hadoop... | import com.google.common.collect.Lists; import java.io.IOException; import java.util.Arrays; import java.util.Collection; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.FSUtils; import org.apache.hadoop.hbase.util.HFileArchiveUtil; | import com.google.common.collect.*; import java.io.*; import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*; | [
"com.google.common",
"java.io",
"java.util",
"org.apache.hadoop"
] | com.google.common; java.io; java.util; org.apache.hadoop; | 853,550 |
private static <T, A> T dispatchAny(Path.Any path, Visitor<T, A> visitor, A arg) {
switch (path.getPathCase()) {
case API:
return visitor.visit(path.getApi(), arg);
case ARRAY_INDEX:
return visitor.visit(path.getArrayIndex(), arg);
case AS:
return visitor.visit(path.getAs(), arg);
case BLOB:
return visitor.visit(path.getBlob(), arg);
case CAPTURE:
return visitor.visit(path.getCapture(), arg);
case CONSTANT_SET:
return visitor.visit(path.getConstantSet(), arg);
case COMMAND:
return visitor.visit(path.getCommand(), arg);
case COMMANDS:
return visitor.visit(path.getCommands(), arg);
case COMMAND_TREE:
return visitor.visit(path.getCommandTree(), arg);
case COMMAND_TREE_NODE:
return visitor.visit(path.getCommandTreeNode(), arg);
case COMMAND_TREE_NODE_FOR_COMMAND:
return visitor.visit(path.getCommandTreeNodeForCommand(), arg);
case CONTEXT:
return visitor.visit(path.getContext(), arg);
case CONTEXTS:
return visitor.visit(path.getContexts(), arg);
case DEVICE:
return visitor.visit(path.getDevice(), arg);
case EVENTS:
return visitor.visit(path.getEvents(), arg);
case FBO:
return visitor.visit(path.getFbo(), arg);
case FIELD:
return visitor.visit(path.getField(), arg);
case GLOBAL_STATE:
return visitor.visit(path.getGlobalState(), arg);
case IMAGE_INFO:
return visitor.visit(path.getImageInfo(), arg);
case MAP_INDEX:
return visitor.visit(path.getMapIndex(), arg);
case MEMORY:
return visitor.visit(path.getMemory(), arg);
case MESH:
return visitor.visit(path.getMesh(), arg);
case PARAMETER:
return visitor.visit(path.getParameter(), arg);
case REPORT:
return visitor.visit(path.getReport(), arg);
case RESOURCE_DATA:
return visitor.visit(path.getResourceData(), arg);
case RESOURCES:
return visitor.visit(path.getResources(), arg);
case RESULT:
return visitor.visit(path.getResult(), arg);
case SLICE:
return visitor.visit(path.getSlice(), arg);
case STATE:
return visitor.visit(path.getState(), arg);
case STATE_TREE:
return visitor.visit(path.getStateTree(), arg);
case STATE_TREE_NODE:
return visitor.visit(path.getStateTreeNode(), arg);
case STATE_TREE_NODE_FOR_PATH:
return visitor.visit(path.getStateTreeNodeForPath(), arg);
case THUMBNAIL:
return visitor.visit(path.getThumbnail(), arg);
default:
throw new RuntimeException("Unexpected path case: " + path.getPathCase());
}
} | static <T, A> T function(Path.Any path, Visitor<T, A> visitor, A arg) { switch (path.getPathCase()) { case API: return visitor.visit(path.getApi(), arg); case ARRAY_INDEX: return visitor.visit(path.getArrayIndex(), arg); case AS: return visitor.visit(path.getAs(), arg); case BLOB: return visitor.visit(path.getBlob(), arg); case CAPTURE: return visitor.visit(path.getCapture(), arg); case CONSTANT_SET: return visitor.visit(path.getConstantSet(), arg); case COMMAND: return visitor.visit(path.getCommand(), arg); case COMMANDS: return visitor.visit(path.getCommands(), arg); case COMMAND_TREE: return visitor.visit(path.getCommandTree(), arg); case COMMAND_TREE_NODE: return visitor.visit(path.getCommandTreeNode(), arg); case COMMAND_TREE_NODE_FOR_COMMAND: return visitor.visit(path.getCommandTreeNodeForCommand(), arg); case CONTEXT: return visitor.visit(path.getContext(), arg); case CONTEXTS: return visitor.visit(path.getContexts(), arg); case DEVICE: return visitor.visit(path.getDevice(), arg); case EVENTS: return visitor.visit(path.getEvents(), arg); case FBO: return visitor.visit(path.getFbo(), arg); case FIELD: return visitor.visit(path.getField(), arg); case GLOBAL_STATE: return visitor.visit(path.getGlobalState(), arg); case IMAGE_INFO: return visitor.visit(path.getImageInfo(), arg); case MAP_INDEX: return visitor.visit(path.getMapIndex(), arg); case MEMORY: return visitor.visit(path.getMemory(), arg); case MESH: return visitor.visit(path.getMesh(), arg); case PARAMETER: return visitor.visit(path.getParameter(), arg); case REPORT: return visitor.visit(path.getReport(), arg); case RESOURCE_DATA: return visitor.visit(path.getResourceData(), arg); case RESOURCES: return visitor.visit(path.getResources(), arg); case RESULT: return visitor.visit(path.getResult(), arg); case SLICE: return visitor.visit(path.getSlice(), arg); case STATE: return visitor.visit(path.getState(), arg); case STATE_TREE: return visitor.visit(path.getStateTree(), arg); case STATE_TREE_NODE: return visitor.visit(path.getStateTreeNode(), arg); case STATE_TREE_NODE_FOR_PATH: return visitor.visit(path.getStateTreeNodeForPath(), arg); case THUMBNAIL: return visitor.visit(path.getThumbnail(), arg); default: throw new RuntimeException(STR + path.getPathCase()); } } | /**
* Unboxes the path node from the {@link com.google.gapid.proto.service.path.Path.Any} and
* dispatches the node to the visitor. Throws an exception if the path is not an expected type.
*/ | Unboxes the path node from the <code>com.google.gapid.proto.service.path.Path.Any</code> and dispatches the node to the visitor. Throws an exception if the path is not an expected type | dispatchAny | {
"repo_name": "dsrbecky/gapid",
"path": "gapic/src/main/com/google/gapid/util/Paths.java",
"license": "apache-2.0",
"size": 57795
} | [
"com.google.gapid.proto.service.path.Path"
] | import com.google.gapid.proto.service.path.Path; | import com.google.gapid.proto.service.path.*; | [
"com.google.gapid"
] | com.google.gapid; | 1,847,104 |
@Override
protected void fillDeployedNames(Set<String> names)
{
updateIfModified();
for (String key : _deployedKeys) {
String name = keyToName(key);
if (name != null)
names.add(name);
}
} | void function(Set<String> names) { updateIfModified(); for (String key : _deployedKeys) { String name = keyToName(key); if (name != null) names.add(name); } } | /**
* Returns the deployed keys.
*/ | Returns the deployed keys | fillDeployedNames | {
"repo_name": "gruppo4/quercus-upstream",
"path": "modules/resin/src/com/caucho/env/deploy/ExpandDeployGenerator.java",
"license": "gpl-2.0",
"size": 22467
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,708,248 |
public static SumoCommand setColor(String polygonID, SumoColor color){
return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.TYPE_COLOR, polygonID, color);
} | static SumoCommand function(String polygonID, SumoColor color){ return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.TYPE_COLOR, polygonID, color); } | /**
* Set the color of this polygon.
*
* @param polygonID
* a string identifying the polygon
* @param color
* value (r,g,b,a) of color
*/ | Set the color of this polygon | setColor | {
"repo_name": "baumfalk/TraaS",
"path": "de/tudresden/sumo/cmd/Polygon.java",
"license": "gpl-3.0",
"size": 4966
} | [
"de.tudresden.sumo.config.Constants",
"de.tudresden.sumo.util.SumoCommand",
"de.tudresden.ws.container.SumoColor"
] | import de.tudresden.sumo.config.Constants; import de.tudresden.sumo.util.SumoCommand; import de.tudresden.ws.container.SumoColor; | import de.tudresden.sumo.config.*; import de.tudresden.sumo.util.*; import de.tudresden.ws.container.*; | [
"de.tudresden.sumo",
"de.tudresden.ws"
] | de.tudresden.sumo; de.tudresden.ws; | 577,251 |
public final void set(String name, Object value, DimensionValues dimensionValues, QueryProfileRegistry registry) {
set(new CompoundName(name), value, DimensionBinding.createFrom(getDimensions(), dimensionValues), registry);
}
// ----------------- Misc | final void function(String name, Object value, DimensionValues dimensionValues, QueryProfileRegistry registry) { set(new CompoundName(name), value, DimensionBinding.createFrom(getDimensions(), dimensionValues), registry); } | /**
* Sets a value in this or any nested profile. Any missing structure needed to set this will be created.
* If this value is already set, this will overwrite the previous value.
*
* @param name the name of the field, possibly a dotted name which will cause setting of a variable in a subprofile
* @param value the value to assign to the name, a primitive wrapper, string or a query profile
* @param dimensionValues the dimension values - will be matched by order to the dimensions set in this - if this is
* shorter or longer than the number of dimensions it will be adjusted as needed
* @param registry the registry used to resolve query profile references. If null is passed query profile references
* will cause an exception
* @throws IllegalArgumentException if the given name is illegal given the types of this or any nested query profile
* @throws IllegalStateException if this query profile is frozen
*/ | Sets a value in this or any nested profile. Any missing structure needed to set this will be created. If this value is already set, this will overwrite the previous value | set | {
"repo_name": "vespa-engine/vespa",
"path": "container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java",
"license": "apache-2.0",
"size": 39363
} | [
"com.yahoo.processing.request.CompoundName"
] | import com.yahoo.processing.request.CompoundName; | import com.yahoo.processing.request.*; | [
"com.yahoo.processing"
] | com.yahoo.processing; | 1,666,662 |
public void writeExternal_v10_2(ObjectOutput out)
throws IOException
{
super.writeExternal(out);
out.writeLong(baseConglomerateId);
out.writeInt(rowLocationColumn);
//write the columns ascend/descend information as bits
FormatableBitSet ascDescBits =
new FormatableBitSet(ascDescInfo.length);
for (int i = 0; i < ascDescInfo.length; i++)
{
if (ascDescInfo[i])
ascDescBits.set(i);
}
ascDescBits.writeExternal(out);
} | void function(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeLong(baseConglomerateId); out.writeInt(rowLocationColumn); FormatableBitSet ascDescBits = new FormatableBitSet(ascDescInfo.length); for (int i = 0; i < ascDescInfo.length; i++) { if (ascDescInfo[i]) ascDescBits.set(i); } ascDescBits.writeExternal(out); } | /**
* Store the stored representation of the column value in the
* stream.
* <p>
* For more detailed description of the ACCESS_B2I_V3_ID format see
* documentation at top of file.
*
* @see java.io.Externalizable#writeExternal
**/ | Store the stored representation of the column value in the stream. For more detailed description of the ACCESS_B2I_V3_ID format see documentation at top of file | writeExternal_v10_2 | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/impl/store/access/btree/index/B2I.java",
"license": "apache-2.0",
"size": 44193
} | [
"java.io.IOException",
"java.io.ObjectOutput",
"org.apache.derby.iapi.services.io.FormatableBitSet"
] | import java.io.IOException; import java.io.ObjectOutput; import org.apache.derby.iapi.services.io.FormatableBitSet; | import java.io.*; import org.apache.derby.iapi.services.io.*; | [
"java.io",
"org.apache.derby"
] | java.io; org.apache.derby; | 1,653,212 |
private boolean caseMapCheck(File f, String name) {
if (fileSystemIsCaseSensitive) return true;
// Note that getCanonicalPath() returns the case-sensitive
// spelled file name.
String path;
try {
path = f.getCanonicalPath();
} catch (IOException ex) {
return false;
}
char[] pcs = path.toCharArray();
char[] ncs = name.toCharArray();
int i = pcs.length - 1;
int j = ncs.length - 1;
while (i >= 0 && j >= 0) {
while (i >= 0 && pcs[i] == File.separatorChar) i--;
while (j >= 0 && ncs[j] == File.separatorChar) j--;
if (i >= 0 && j >= 0) {
if (pcs[i] != ncs[j]) return false;
i--;
j--;
}
}
return j < 0;
}
private final Set<JavaFileObject.Kind> sourceOrClass =
EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS);
private static class DelegateJavaFileObject extends BaseFileObject {
JavaFileObject delegate;
boolean isVisageSourceFile;
DelegateJavaFileObject(JavaFileObject jfo) {
delegate = jfo;
isVisageSourceFile = jfo.getName().endsWith(VISAGE_SOURCE_SUFFIX);
} | boolean function(File f, String name) { if (fileSystemIsCaseSensitive) return true; String path; try { path = f.getCanonicalPath(); } catch (IOException ex) { return false; } char[] pcs = path.toCharArray(); char[] ncs = name.toCharArray(); int i = pcs.length - 1; int j = ncs.length - 1; while (i >= 0 && j >= 0) { while (i >= 0 && pcs[i] == File.separatorChar) i--; while (j >= 0 && ncs[j] == File.separatorChar) j--; if (i >= 0 && j >= 0) { if (pcs[i] != ncs[j]) return false; i--; j--; } } return j < 0; } private final Set<JavaFileObject.Kind> sourceOrClass = EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS); private static class DelegateJavaFileObject extends BaseFileObject { JavaFileObject delegate; boolean isVisageSourceFile; DelegateJavaFileObject(JavaFileObject jfo) { delegate = jfo; isVisageSourceFile = jfo.getName().endsWith(VISAGE_SOURCE_SUFFIX); } | /** Hack to make Windows case sensitive. Test whether given path
* ends in a string of characters with the same case as given name.
* Ignore file separators in both path and name.
*/ | Hack to make Windows case sensitive. Test whether given path ends in a string of characters with the same case as given name. Ignore file separators in both path and name | caseMapCheck | {
"repo_name": "visage-lang/visage-compiler",
"path": "src/share/classes/org/visage/tools/util/VisageFileManager.java",
"license": "gpl-2.0",
"size": 16183
} | [
"com.sun.tools.mjavac.util.BaseFileObject",
"java.io.File",
"java.io.IOException",
"java.util.EnumSet",
"java.util.Set",
"javax.tools.JavaFileObject"
] | import com.sun.tools.mjavac.util.BaseFileObject; import java.io.File; import java.io.IOException; import java.util.EnumSet; import java.util.Set; import javax.tools.JavaFileObject; | import com.sun.tools.mjavac.util.*; import java.io.*; import java.util.*; import javax.tools.*; | [
"com.sun.tools",
"java.io",
"java.util",
"javax.tools"
] | com.sun.tools; java.io; java.util; javax.tools; | 2,407,695 |
private void dropColumnPermDescriptor(
TransactionController tc,
ExecIndexRow keyRow)
throws StandardException
{
ExecRow curRow;
PermissionsDescriptor perm;
TabInfoImpl ti = getNonCoreTI(SYSCOLPERMS_CATALOG_NUM);
SYSCOLPERMSRowFactory rf = (SYSCOLPERMSRowFactory) ti.getCatalogRowFactory();
while ((curRow=ti.getRow(tc, keyRow, rf.TABLEID_INDEX_NUM)) != null)
{
perm = (PermissionsDescriptor)rf.buildDescriptor(curRow, (TupleDescriptor) null, this);
removePermEntryInCache(perm);
// Build key on UUID and drop the entry as we want to drop only this row
ExecIndexRow uuidKey;
uuidKey = rf.buildIndexKeyRow(rf.COLPERMSID_INDEX_NUM, perm);
ti.deleteRow(tc, uuidKey, rf.COLPERMSID_INDEX_NUM);
}
} | void function( TransactionController tc, ExecIndexRow keyRow) throws StandardException { ExecRow curRow; PermissionsDescriptor perm; TabInfoImpl ti = getNonCoreTI(SYSCOLPERMS_CATALOG_NUM); SYSCOLPERMSRowFactory rf = (SYSCOLPERMSRowFactory) ti.getCatalogRowFactory(); while ((curRow=ti.getRow(tc, keyRow, rf.TABLEID_INDEX_NUM)) != null) { perm = (PermissionsDescriptor)rf.buildDescriptor(curRow, (TupleDescriptor) null, this); removePermEntryInCache(perm); ExecIndexRow uuidKey; uuidKey = rf.buildIndexKeyRow(rf.COLPERMSID_INDEX_NUM, perm); ti.deleteRow(tc, uuidKey, rf.COLPERMSID_INDEX_NUM); } } | /**
* Delete the appropriate rows from syscolperms when
* dropping a table
*
* @param tc The TransactionController
* @param keyRow Start/stop position.
*
* @exception StandardException Thrown on failure
*/ | Delete the appropriate rows from syscolperms when dropping a table | dropColumnPermDescriptor | {
"repo_name": "papicella/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/sql/catalog/DataDictionaryImpl.java",
"license": "apache-2.0",
"size": 403048
} | [
"com.pivotal.gemfirexd.internal.iapi.error.StandardException",
"com.pivotal.gemfirexd.internal.iapi.sql.dictionary.PermissionsDescriptor",
"com.pivotal.gemfirexd.internal.iapi.sql.dictionary.TupleDescriptor",
"com.pivotal.gemfirexd.internal.iapi.sql.execute.ExecIndexRow",
"com.pivotal.gemfirexd.internal.iap... | import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.sql.dictionary.PermissionsDescriptor; import com.pivotal.gemfirexd.internal.iapi.sql.dictionary.TupleDescriptor; import com.pivotal.gemfirexd.internal.iapi.sql.execute.ExecIndexRow; import com.pivotal.gemfirexd.internal.iapi.sql.execute.ExecRow; import com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController; | import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.sql.dictionary.*; import com.pivotal.gemfirexd.internal.iapi.sql.execute.*; import com.pivotal.gemfirexd.internal.iapi.store.access.*; | [
"com.pivotal.gemfirexd"
] | com.pivotal.gemfirexd; | 1,057,339 |
public static MessageResources getMessageResources(
ServletContext application, HttpServletRequest request, String bundle) {
if (bundle == null) {
bundle = Globals.MESSAGES_KEY;
}
MessageResources resources =
(MessageResources) request.getAttribute(bundle);
if (resources == null) {
ModuleConfig moduleConfig =
ModuleUtils.getInstance().getModuleConfig(request, application);
resources =
(MessageResources) application.getAttribute(bundle
+ moduleConfig.getPrefix());
}
if (resources == null) {
resources = (MessageResources) application.getAttribute(bundle);
}
if (resources == null) {
throw new NullPointerException(
"No message resources found for bundle: " + bundle);
}
return resources;
} | static MessageResources function( ServletContext application, HttpServletRequest request, String bundle) { if (bundle == null) { bundle = Globals.MESSAGES_KEY; } MessageResources resources = (MessageResources) request.getAttribute(bundle); if (resources == null) { ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, application); resources = (MessageResources) application.getAttribute(bundle + moduleConfig.getPrefix()); } if (resources == null) { resources = (MessageResources) application.getAttribute(bundle); } if (resources == null) { throw new NullPointerException( STR + bundle); } return resources; } | /**
* Retrieve <code>MessageResources</code> for the module and bundle.
*
* @param application the servlet context
* @param request the servlet request
* @param bundle the bundle key
*/ | Retrieve <code>MessageResources</code> for the module and bundle | getMessageResources | {
"repo_name": "Builders-SonarSource/sonarqube-bis",
"path": "tests/upgrade/projects/struts-1.3.9-diet/core/src/main/java/org/apache/struts/validator/Resources.java",
"license": "lgpl-3.0",
"size": 17977
} | [
"javax.servlet.ServletContext",
"javax.servlet.http.HttpServletRequest",
"org.apache.struts.Globals",
"org.apache.struts.config.ModuleConfig",
"org.apache.struts.util.MessageResources",
"org.apache.struts.util.ModuleUtils"
] | import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import org.apache.struts.Globals; import org.apache.struts.config.ModuleConfig; import org.apache.struts.util.MessageResources; import org.apache.struts.util.ModuleUtils; | import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.*; import org.apache.struts.config.*; import org.apache.struts.util.*; | [
"javax.servlet",
"org.apache.struts"
] | javax.servlet; org.apache.struts; | 1,444,502 |
public OptionsDialog getOptionsDialog() throws JAXBException, IOException, SAXException {
OptionsScriptProxy optionsScriptProxy = requestFactory.getOptionsScriptProxy();
final OptionsController optionsController = initOptionsController(optionsScriptProxy);
UndoManager undoManager = new UndoManager();
DirPath optionsPath = new DirPath(settingsProxy.getSettings().getPaths().getOptionsPath());
return getOptionsDialog("Options", requestFactory.getDiskDefaultOptions(), optionsController, undoManager, optionsPath);
//return getOptionsDialog(requestFactory.getDefaultOptionsFile());
}
| OptionsDialog function() throws JAXBException, IOException, SAXException { OptionsScriptProxy optionsScriptProxy = requestFactory.getOptionsScriptProxy(); final OptionsController optionsController = initOptionsController(optionsScriptProxy); UndoManager undoManager = new UndoManager(); DirPath optionsPath = new DirPath(settingsProxy.getSettings().getPaths().getOptionsPath()); return getOptionsDialog(STR, requestFactory.getDiskDefaultOptions(), optionsController, undoManager, optionsPath); } | /**
* This method returns an OptionsDialog for a new Options script.
* @return OptionsDialog
* @throws SAXException
* @throws IOException
* @throws JAXBException
*/ | This method returns an OptionsDialog for a new Options script | getOptionsDialog | {
"repo_name": "darmstrong1/filecopier",
"path": "filecopier-gui/src/main/java/net/sf/fc/gui/factory/MVCRequestFactory.java",
"license": "apache-2.0",
"size": 18015
} | [
"java.io.IOException",
"javax.swing.undo.UndoManager",
"javax.xml.bind.JAXBException",
"net.sf.fc.cfg.DirPath",
"net.sf.fc.gui.c.options.OptionsController",
"net.sf.fc.gui.v.options.OptionsDialog",
"net.sf.fc.script.OptionsScriptProxy",
"org.xml.sax.SAXException"
] | import java.io.IOException; import javax.swing.undo.UndoManager; import javax.xml.bind.JAXBException; import net.sf.fc.cfg.DirPath; import net.sf.fc.gui.c.options.OptionsController; import net.sf.fc.gui.v.options.OptionsDialog; import net.sf.fc.script.OptionsScriptProxy; import org.xml.sax.SAXException; | import java.io.*; import javax.swing.undo.*; import javax.xml.bind.*; import net.sf.fc.cfg.*; import net.sf.fc.gui.c.options.*; import net.sf.fc.gui.v.options.*; import net.sf.fc.script.*; import org.xml.sax.*; | [
"java.io",
"javax.swing",
"javax.xml",
"net.sf.fc",
"org.xml.sax"
] | java.io; javax.swing; javax.xml; net.sf.fc; org.xml.sax; | 2,212,919 |
@Override
public Path call() {
String textFile = null;
try {
textFile = new String(Files.readAllBytes(path));
} catch (IOException e) {
e.printStackTrace();
}
if (textFile != null && textFile.contains(text) && !fileIsFinding) {
fileIsFinding = true;
return path;
}
return null;
}
} | Path function() { String textFile = null; try { textFile = new String(Files.readAllBytes(path)); } catch (IOException e) { e.printStackTrace(); } if (textFile != null && textFile.contains(text) && !fileIsFinding) { fileIsFinding = true; return path; } return null; } } | /**
* Searching text in file.
*
* @return path of file if file contains text or null.
*/ | Searching text in file | call | {
"repo_name": "YuzyakAV/ayuzyak",
"path": "chapter_007_Multithreading/src/main/java/ru/job4j/monitore_synchronizy/TextSearch.java",
"license": "apache-2.0",
"size": 6405
} | [
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Path"
] | import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; | import java.io.*; import java.nio.file.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 1,276,294 |
public static Cursor getCursorForFormFile(File proposedPath, String[] projection) {
String[] selectionArgs = {
proposedPath.getAbsolutePath()
};
String selection = FormsProviderAPI.FormsColumns.FORM_FILE_PATH + "=?";
return Collect.getInstance()
.getApplication()
.getContentResolver()
.query(FormsProviderAPI.FormsColumns.CONTENT_URI, projection, selection,
selectionArgs, FormsProviderAPI.FormsColumns._ID + " DESC");
}
private static class FormToWrite {
public final String form;
public final File path;
private FormToWrite(String form, File path) {
this.form = Preconditions.checkNotNull(form);
this.path = Preconditions.checkNotNull(path);
}
}
private static class AddFormToDbAsyncTask extends AsyncTask<FormToWrite, Void, File> {
private final FormWrittenListener mFormWrittenListener;
private final String mUuid;
private AddFormToDbAsyncTask(
@Nullable FormWrittenListener formWrittenListener,
String uuid) {
mFormWrittenListener = formWrittenListener;
mUuid = uuid;
} | static Cursor function(File proposedPath, String[] projection) { String[] selectionArgs = { proposedPath.getAbsolutePath() }; String selection = FormsProviderAPI.FormsColumns.FORM_FILE_PATH + "=?"; return Collect.getInstance() .getApplication() .getContentResolver() .query(FormsProviderAPI.FormsColumns.CONTENT_URI, projection, selection, selectionArgs, FormsProviderAPI.FormsColumns._ID + STR); } private static class FormToWrite { public final String form; public final File path; private FormToWrite(String form, File path) { this.form = Preconditions.checkNotNull(form); this.path = Preconditions.checkNotNull(path); } } private static class AddFormToDbAsyncTask extends AsyncTask<FormToWrite, Void, File> { private final FormWrittenListener mFormWrittenListener; private final String mUuid; private AddFormToDbAsyncTask( @Nullable FormWrittenListener formWrittenListener, String uuid) { mFormWrittenListener = formWrittenListener; mUuid = uuid; } | /**
* Get a Cursor for the form from the filename. If there is more than one they are ordered
* descending by id, so most recent is first.
* @param proposedPath the path for the forms file
* @param projection a projection of fields to get
* @return the Cursor pointing to ideally one form.
*/ | Get a Cursor for the form from the filename. If there is more than one they are ordered descending by id, so most recent is first | getCursorForFormFile | {
"repo_name": "projectbuendia/client",
"path": "app/src/main/java/org/projectbuendia/client/net/OdkXformSyncTask.java",
"license": "apache-2.0",
"size": 10279
} | [
"android.database.Cursor",
"android.os.AsyncTask",
"android.support.annotation.Nullable",
"com.google.common.base.Preconditions",
"java.io.File",
"org.odk.collect.android.application.Collect",
"org.odk.collect.android.provider.FormsProviderAPI"
] | import android.database.Cursor; import android.os.AsyncTask; import android.support.annotation.Nullable; import com.google.common.base.Preconditions; import java.io.File; import org.odk.collect.android.application.Collect; import org.odk.collect.android.provider.FormsProviderAPI; | import android.database.*; import android.os.*; import android.support.annotation.*; import com.google.common.base.*; import java.io.*; import org.odk.collect.android.application.*; import org.odk.collect.android.provider.*; | [
"android.database",
"android.os",
"android.support",
"com.google.common",
"java.io",
"org.odk.collect"
] | android.database; android.os; android.support; com.google.common; java.io; org.odk.collect; | 891,579 |
@Test
public void createTest() {
User user = new User();
user.setUsername("admin");
user = repository.save(user);
User userResult = entityManager.find(User.class, user.getId());
assertThat(user, is(userResult));
} | void function() { User user = new User(); user.setUsername("admin"); user = repository.save(user); User userResult = entityManager.find(User.class, user.getId()); assertThat(user, is(userResult)); } | /**
* Create test.
*/ | Create test | createTest | {
"repo_name": "ephemeralin/java-training",
"path": "chapter_009_carplace_boot/src/test/java/com/ephemeralin/carplace/repository/UserRepositoryTest.java",
"license": "apache-2.0",
"size": 2786
} | [
"com.ephemeralin.carplace.model.User",
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import com.ephemeralin.carplace.model.User; import org.hamcrest.core.Is; import org.junit.Assert; | import com.ephemeralin.carplace.model.*; import org.hamcrest.core.*; import org.junit.*; | [
"com.ephemeralin.carplace",
"org.hamcrest.core",
"org.junit"
] | com.ephemeralin.carplace; org.hamcrest.core; org.junit; | 118,972 |
public Cancellable deleteCalendarAsync(DeleteCalendarRequest request, RequestOptions options,
ActionListener<AcknowledgedResponse> listener) {
return restHighLevelClient.performRequestAsyncAndParseEntity(request,
MLRequestConverters::deleteCalendar,
options,
AcknowledgedResponse::fromXContent,
listener,
Collections.emptySet());
} | Cancellable function(DeleteCalendarRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener) { return restHighLevelClient.performRequestAsyncAndParseEntity(request, MLRequestConverters::deleteCalendar, options, AcknowledgedResponse::fromXContent, listener, Collections.emptySet()); } | /**
* Deletes the given Machine Learning Job asynchronously and notifies the listener on completion
* <p>
* For additional info see
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html">
* ML Delete calendar documentation</a>
*
* @param request The request to delete the calendar
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener Listener to be notified upon request completion
* @return cancellable that may be used to cancel the request
*/ | Deletes the given Machine Learning Job asynchronously and notifies the listener on completion For additional info see ML Delete calendar documentation | deleteCalendarAsync | {
"repo_name": "nknize/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/MachineLearningClient.java",
"license": "apache-2.0",
"size": 133260
} | [
"java.util.Collections",
"org.elasticsearch.action.ActionListener",
"org.elasticsearch.action.support.master.AcknowledgedResponse",
"org.elasticsearch.client.ml.DeleteCalendarRequest"
] | import java.util.Collections; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.ml.DeleteCalendarRequest; | import java.util.*; import org.elasticsearch.action.*; import org.elasticsearch.action.support.master.*; import org.elasticsearch.client.ml.*; | [
"java.util",
"org.elasticsearch.action",
"org.elasticsearch.client"
] | java.util; org.elasticsearch.action; org.elasticsearch.client; | 1,179,321 |
@Test
public void testAfterUseCursor() throws Exception {
TJDBCInputProperties fixture = new TJDBCInputProperties("input");
fixture.init();
Form advanced = fixture.getForm(Form.ADVANCED);
fixture.useCursor.setValue(true);
fixture.afterUseCursor();
Assert.assertTrue(advanced.getWidget(fixture.cursor.getName()).isVisible());
fixture.useCursor.setValue(false);
fixture.afterUseCursor();
Assert.assertTrue(!advanced.getWidget(fixture.cursor.getName()).isVisible());
}
| void function() throws Exception { TJDBCInputProperties fixture = new TJDBCInputProperties("input"); fixture.init(); Form advanced = fixture.getForm(Form.ADVANCED); fixture.useCursor.setValue(true); fixture.afterUseCursor(); Assert.assertTrue(advanced.getWidget(fixture.cursor.getName()).isVisible()); fixture.useCursor.setValue(false); fixture.afterUseCursor(); Assert.assertTrue(!advanced.getWidget(fixture.cursor.getName()).isVisible()); } | /**
* Run the void afterUseCursor() method test.
*
* @throws Exception
*
* @generatedBy CodePro at 17-6-20 PM3:13
*/ | Run the void afterUseCursor() method test | testAfterUseCursor | {
"repo_name": "Talend/components",
"path": "components/components-jdbc/components-jdbc-definition/src/test/java/org/talend/components/jdbc/tjdbcinput/TJDBCInputPropertiesTest.java",
"license": "apache-2.0",
"size": 11537
} | [
"org.junit.Assert",
"org.talend.daikon.properties.presentation.Form"
] | import org.junit.Assert; import org.talend.daikon.properties.presentation.Form; | import org.junit.*; import org.talend.daikon.properties.presentation.*; | [
"org.junit",
"org.talend.daikon"
] | org.junit; org.talend.daikon; | 24,273 |
public DiscoveryNode connectToNodeLightAndHandshake(
final DiscoveryNode node,
final long handshakeTimeout) throws ConnectTransportException {
return connectToNodeLightAndHandshake(node, handshakeTimeout, true);
} | DiscoveryNode function( final DiscoveryNode node, final long handshakeTimeout) throws ConnectTransportException { return connectToNodeLightAndHandshake(node, handshakeTimeout, true); } | /**
* Lightly connect to the specified node, and handshake cluster
* name and version
*
* @param node the node to connect to
* @param handshakeTimeout handshake timeout
* @return the connected node with version set
* @throws ConnectTransportException if the connection or the
* handshake failed
*/ | Lightly connect to the specified node, and handshake cluster name and version | connectToNodeLightAndHandshake | {
"repo_name": "nomoa/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/transport/TransportService.java",
"license": "apache-2.0",
"size": 43521
} | [
"org.elasticsearch.cluster.node.DiscoveryNode"
] | import org.elasticsearch.cluster.node.DiscoveryNode; | import org.elasticsearch.cluster.node.*; | [
"org.elasticsearch.cluster"
] | org.elasticsearch.cluster; | 1,908,477 |
DatumResponse<Document> saveDocument(final Document document); | DatumResponse<Document> saveDocument(final Document document); | /**
* Saves the document. Requires ownership or WRITE over the associated
* entity.
*/ | Saves the document. Requires ownership or WRITE over the associated entity | saveDocument | {
"repo_name": "stori-es/stori_es",
"path": "dashboard/src/main/java/org/consumersunion/stories/common/client/service/RpcDocumentService.java",
"license": "apache-2.0",
"size": 2405
} | [
"org.consumersunion.stories.common.client.service.response.DatumResponse",
"org.consumersunion.stories.common.shared.model.document.Document"
] | import org.consumersunion.stories.common.client.service.response.DatumResponse; import org.consumersunion.stories.common.shared.model.document.Document; | import org.consumersunion.stories.common.client.service.response.*; import org.consumersunion.stories.common.shared.model.document.*; | [
"org.consumersunion.stories"
] | org.consumersunion.stories; | 727,283 |
public FlexibleOffsetAccountService getFlexibleOffsetAccountService() {
return flexibleOffsetAccountService;
} | FlexibleOffsetAccountService function() { return flexibleOffsetAccountService; } | /**
* Gets the flexibleOffsetAccountService attribute.
*
* @return Returns the flexibleOffsetAccountService.
*/ | Gets the flexibleOffsetAccountService attribute | getFlexibleOffsetAccountService | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-core/src/main/java/org/kuali/kfs/gl/batch/service/impl/EncumbranceClosingOriginEntryGenerationServiceImpl.java",
"license": "agpl-3.0",
"size": 35661
} | [
"org.kuali.kfs.sys.service.FlexibleOffsetAccountService"
] | import org.kuali.kfs.sys.service.FlexibleOffsetAccountService; | import org.kuali.kfs.sys.service.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,557,109 |
Observable<ServiceResponse<Void>> head204WithServiceResponseAsync(); | Observable<ServiceResponse<Void>> head204WithServiceResponseAsync(); | /**
* Return 204 status code if successful.
*
* @return the {@link ServiceResponse} object if successful.
*/ | Return 204 status code if successful | head204WithServiceResponseAsync | {
"repo_name": "yugangw-msft/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/HttpSuccess.java",
"license": "mit",
"size": 30999
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,624,144 |
public URI[] list(URI url) throws ProActiveException; | URI[] function(URI url) throws ProActiveException; | /**
* list all the remote objects register into a registry located at the url
*
* @param url
* the location of the registry
* @throws ProActiveException
*/ | list all the remote objects register into a registry located at the url | list | {
"repo_name": "acontes/programming",
"path": "src/Core/org/objectweb/proactive/core/remoteobject/RemoteObjectFactory.java",
"license": "agpl-3.0",
"size": 5308
} | [
"org.objectweb.proactive.core.ProActiveException"
] | import org.objectweb.proactive.core.ProActiveException; | import org.objectweb.proactive.core.*; | [
"org.objectweb.proactive"
] | org.objectweb.proactive; | 50,569 |
@Test
public void pcepUpdateMsgTest28() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80,
0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, //SRP object
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, //LSP object
0x00, 0x12, 0x00, 0x10, //StatefulIPv4LspIdentidiersTlv
(byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01,
(byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20,
0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, //SymbolicPathNameTlv
0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, //StatefulLspErrorCodeTlv
0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, //ERO object
0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01,
0x01, 0x01, 0x04, 0x00,
0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, //LSPA object
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00,
0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, //Bandwidth object
0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; //Metric object
byte[] testupdateMsg = {0};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(updateMsg);
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
message = reader.readFrom(buffer);
assertThat(message, instanceOf(PcepUpdateMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
testupdateMsg = buf.array();
int readLen = buf.writerIndex() - 0;
testupdateMsg = new byte[readLen];
buf.readBytes(testupdateMsg, 0, readLen);
assertThat(testupdateMsg, is(updateMsg));
} | void function() throws PcepParseException, PcepOutOfBoundMessageException { byte[] updateMsg = new byte[] {0x20, 0x0b, 0x00, (byte) 0x80, 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, 0x20, 0x10, 0x00, 0x2c, 0x00, 0x00, 0x10, 0x03, 0x00, 0x12, 0x00, 0x10, (byte) 0xb6, 0x02, 0x4e, 0x1f, 0x00, 0x01, (byte) 0x80, 0x01, (byte) 0xb6, 0x02, 0x4e, 0x1f, (byte) 0xb6, 0x02, 0x4e, 0x20, 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x07, 0x10, 0x00, 0x14, 0x01, 0x08, 0x11, 0x01, 0x01, 0x01, 0x04, 0x00, 0x01, 0x08, 0x11, 0x01, 0x01, 0x01, 0x04, 0x00, 0x09, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x05, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x20 }; byte[] testupdateMsg = {0}; ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); buffer.writeBytes(updateMsg); PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); PcepMessage message = null; message = reader.readFrom(buffer); assertThat(message, instanceOf(PcepUpdateMsg.class)); ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); message.writeTo(buf); testupdateMsg = buf.array(); int readLen = buf.writerIndex() - 0; testupdateMsg = new byte[readLen]; buf.readBytes(testupdateMsg, 0, readLen); assertThat(testupdateMsg, is(updateMsg)); } | /**
* This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv,
* SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject),
* LSPA, Bandwidth, Metric objects in PcUpd message.
*/ | This test case checks for SRP, LSP (SymbolicPathNameTlv, StatefulIPv4LspIdentidiersTlv, SymbolicPathNameTlv, StatefulLspErrorCodeTlv), ERO (IPv4SubObject, IPv4SubObject), LSPA, Bandwidth, Metric objects in PcUpd message | pcepUpdateMsgTest28 | {
"repo_name": "donNewtonAlpha/onos",
"path": "protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepUpdateMsgTest.java",
"license": "apache-2.0",
"size": 66899
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.hamcrest.core.Is",
"org.jboss.netty.buffer.ChannelBuffer",
"org.jboss.netty.buffer.ChannelBuffers",
"org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException",
"org.onosproject.pcepio.exceptions.PcepParseException"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.hamcrest.core.Is; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException; import org.onosproject.pcepio.exceptions.PcepParseException; | import org.hamcrest.*; import org.hamcrest.core.*; import org.jboss.netty.buffer.*; import org.onosproject.pcepio.exceptions.*; | [
"org.hamcrest",
"org.hamcrest.core",
"org.jboss.netty",
"org.onosproject.pcepio"
] | org.hamcrest; org.hamcrest.core; org.jboss.netty; org.onosproject.pcepio; | 2,576,841 |
public Map<String, Object> getUserData() {
return userData;
} | Map<String, Object> function() { return userData; } | /**
* Returns a Map, representing any other key-value pairs that were send
* to the RESTful Sender API.
*
* This map usually contains application specific payload, like:
* <pre>
* "sport-news-channel15" : "San Francisco 49er won last game"
* </pre>
*/ | Returns a Map, representing any other key-value pairs that were send to the RESTful Sender API. This map usually contains application specific payload, like: <code> "sport-news-channel15" : "San Francisco 49er won last game" </code> | getUserData | {
"repo_name": "C-B4/unifiedpush-server",
"path": "model/push/src/main/java/org/jboss/aerogear/unifiedpush/message/Message.java",
"license": "apache-2.0",
"size": 5604
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 31,500 |
List<Member> getCalculatedMembers(Level level); | List<Member> getCalculatedMembers(Level level); | /**
* Returns a list of calculated members in a given level.
*/ | Returns a list of calculated members in a given level | getCalculatedMembers | {
"repo_name": "citycloud-bigdata/mondrian",
"path": "src/main/mondrian/olap/SchemaReader.java",
"license": "epl-1.0",
"size": 16965
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,039,805 |
public EnrollDevicePage enrollNewDevice() throws IOException {
driver.findElement(By.xpath("iot.home.page.uuf-menu.xpath")).click();
driver.findElement(By.xpath("iot.home.page.uuf-menu.devicemgt.xpath")).click();
driver.findElement(By.xpath("iot.home.enrollDevice.xpath")).click();
return new EnrollDevicePage(driver);
} | EnrollDevicePage function() throws IOException { driver.findElement(By.xpath(STR)).click(); driver.findElement(By.xpath(STR)).click(); driver.findElement(By.xpath(STR)).click(); return new EnrollDevicePage(driver); } | /**
* Navigates to the New device enrollment page.
* @return : Enroll Device page.
*/ | Navigates to the New device enrollment page | enrollNewDevice | {
"repo_name": "madhawap/product-iots",
"path": "modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/home/IOTHomePage.java",
"license": "apache-2.0",
"size": 3713
} | [
"java.io.IOException",
"org.openqa.selenium.By",
"org.wso2.iot.integration.ui.pages.devices.EnrollDevicePage"
] | import java.io.IOException; import org.openqa.selenium.By; import org.wso2.iot.integration.ui.pages.devices.EnrollDevicePage; | import java.io.*; import org.openqa.selenium.*; import org.wso2.iot.integration.ui.pages.devices.*; | [
"java.io",
"org.openqa.selenium",
"org.wso2.iot"
] | java.io; org.openqa.selenium; org.wso2.iot; | 409,287 |
private boolean sortBasicBlock(int maxtime) {
boolean changed = false;
InstructionBucket[] pool = new InstructionBucket[maxtime + 1];
int num = bb.firstInstruction().scratch;
Instruction ins;
while ((ins = bb.firstRealInstruction()) != null) {
InstructionBucket.insert(pool, ins);
ins.remove();
}
for (int i = 0; i <= maxtime; i++) {
for (InstructionBucket t = pool[i]; t != null; t = t.next) {
bb.appendInstruction(t.instruction);
changed = changed || num > t.instruction.scratch;
num = t.instruction.scratch;
}
}
return changed;
} | boolean function(int maxtime) { boolean changed = false; InstructionBucket[] pool = new InstructionBucket[maxtime + 1]; int num = bb.firstInstruction().scratch; Instruction ins; while ((ins = bb.firstRealInstruction()) != null) { InstructionBucket.insert(pool, ins); ins.remove(); } for (int i = 0; i <= maxtime; i++) { for (InstructionBucket t = pool[i]; t != null; t = t.next) { bb.appendInstruction(t.instruction); changed = changed num > t.instruction.scratch; num = t.instruction.scratch; } } return changed; } | /**
* Sort basic block by Scheduled Time.
* Uses bucket sort on time, with equal times ordered by critical path.
* @param maxtime the maximum scheduled time
*/ | Sort basic block by Scheduled Time. Uses bucket sort on time, with equal times ordered by critical path | sortBasicBlock | {
"repo_name": "CodeOffloading/JikesRVM-CCO",
"path": "jikesrvm-3.1.3/rvm/src/org/jikesrvm/compilers/opt/instrsched/Scheduler.java",
"license": "epl-1.0",
"size": 13406
} | [
"org.jikesrvm.compilers.opt.ir.Instruction"
] | import org.jikesrvm.compilers.opt.ir.Instruction; | import org.jikesrvm.compilers.opt.ir.*; | [
"org.jikesrvm.compilers"
] | org.jikesrvm.compilers; | 2,380,550 |
@Schema(example = "Folder", description = "Return results that are file actions related to files or folders inside this folder path.")
public String getQueryFolder() {
return queryFolder;
} | @Schema(example = STR, description = STR) String function() { return queryFolder; } | /**
* Return results that are file actions related to files or folders inside this folder path.
* @return queryFolder
**/ | Return results that are file actions related to files or folders inside this folder path | getQueryFolder | {
"repo_name": "iterate-ch/cyberduck",
"path": "brick/src/main/java/ch/cyberduck/core/brick/io/swagger/client/model/HistoryExportsBody.java",
"license": "gpl-3.0",
"size": 21766
} | [
"io.swagger.v3.oas.annotations.media.Schema"
] | import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.*; | [
"io.swagger.v3"
] | io.swagger.v3; | 1,860,100 |
public static final Pattern getBasicPattern() {
return basic;
} | static final Pattern function() { return basic; } | /**
* Provides a pattern which can be used by an outside resource to determine if
* this class can provide credentials based on simple header information. It does
* not calculate any information regarding realms or challenges.
*
* @return Returns a Pattern which will match a Basic WWW-Authenticate header.
*/ | Provides a pattern which can be used by an outside resource to determine if this class can provide credentials based on simple header information. It does not calculate any information regarding realms or challenges | getBasicPattern | {
"repo_name": "kkllwww007/anthelion",
"path": "src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpBasicAuthentication.java",
"license": "apache-2.0",
"size": 6700
} | [
"java.util.regex.Pattern"
] | import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 58,998 |
public Game getGame() {
return game;
} | Game function() { return game; } | /**
* Return Game
*
* @return Game
*/ | Return Game | getGame | {
"repo_name": "JonathanxD/wReport",
"path": "src/main/java/io/github/jonathanxd/wreport/commands/wext/ArgumentSuggestionManager.java",
"license": "mit",
"size": 5706
} | [
"org.spongepowered.api.Game"
] | import org.spongepowered.api.Game; | import org.spongepowered.api.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 2,882,730 |
public Object execute(final Map<Object, Object> iArgs) {
final StringBuilder result = new StringBuilder();
if (optimizeEdges)
result.append(optimizeEdges());
return result.toString();
} | Object function(final Map<Object, Object> iArgs) { final StringBuilder result = new StringBuilder(); if (optimizeEdges) result.append(optimizeEdges()); return result.toString(); } | /**
* Execute the ALTER DATABASE.
*/ | Execute the ALTER DATABASE | execute | {
"repo_name": "alonsod86/orientdb",
"path": "core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLOptimizeDatabase.java",
"license": "apache-2.0",
"size": 5691
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 477,578 |
boolean addObjectPropertyRangeClass(String modelName, String propertyName,
String rangeClassName) throws SessionNotFoundException, InvalidNameException; | boolean addObjectPropertyRangeClass(String modelName, String propertyName, String rangeClassName) throws SessionNotFoundException, InvalidNameException; | /**
* Call this method to add a class to the range of an object property in the named model.
*
* @param modelName Model name
* @param propertyName Property name
* @param rangeClassName Range class name
* @return True if successful else false
* @throws com.ge.research.sadl.server.SessionNotFoundException
* @throws InvalidNameException
*/ | Call this method to add a class to the range of an object property in the named model | addObjectPropertyRangeClass | {
"repo_name": "crapo/sadlos2",
"path": "com.ge.research.sadl.server/com.ge.research.sadl.server.server-api/src/main/java/com/ge/research/sadl/server/ISadlServerPE.java",
"license": "epl-1.0",
"size": 23265
} | [
"com.ge.research.sadl.reasoner.InvalidNameException",
"com.ge.research.sadl.server.SessionNotFoundException"
] | import com.ge.research.sadl.reasoner.InvalidNameException; import com.ge.research.sadl.server.SessionNotFoundException; | import com.ge.research.sadl.reasoner.*; import com.ge.research.sadl.server.*; | [
"com.ge.research"
] | com.ge.research; | 162,547 |
@ApiModelProperty(
value =
"Sum of the amounts of all statement lines where both the reconciled flag is set to"
+ " TRUE, and the amount is positive.")
public Double getReconciledAmountPos() {
return reconciledAmountPos;
} | @ApiModelProperty( value = STR + STR) Double function() { return reconciledAmountPos; } | /**
* Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and
* the amount is positive.
*
* @return reconciledAmountPos
*/ | Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive | getReconciledAmountPos | {
"repo_name": "XeroAPI/Xero-Java",
"path": "src/main/java/com/xero/models/finance/StatementLinesResponse.java",
"license": "mit",
"size": 30674
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 123,263 |
public List<SubServer> getSubServers() {
return subServers;
} | List<SubServer> function() { return subServers; } | /**
* Returns a list of all available subservers of this style.
*
* @return All available subservers of this style.
*/ | Returns a list of all available subservers of this style | getSubServers | {
"repo_name": "johb/GAIA",
"path": "src/main/java/sep/gaia/resources/tiles2d/Style.java",
"license": "apache-2.0",
"size": 9162
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,454,529 |
List<ReproductionCustomNote> listAll(); | List<ReproductionCustomNote> listAll(); | /**
* List all ReproductionCustomNotes by material type.
*
* @return A list of ReproductionCustomNotes.
*/ | List all ReproductionCustomNotes by material type | listAll | {
"repo_name": "IISH/delivery",
"path": "src/main/java/org/socialhistoryservices/delivery/reproduction/dao/ReproductionCustomNoteDAO.java",
"license": "gpl-3.0",
"size": 2078
} | [
"java.util.List",
"org.socialhistoryservices.delivery.reproduction.entity.ReproductionCustomNote"
] | import java.util.List; import org.socialhistoryservices.delivery.reproduction.entity.ReproductionCustomNote; | import java.util.*; import org.socialhistoryservices.delivery.reproduction.entity.*; | [
"java.util",
"org.socialhistoryservices.delivery"
] | java.util; org.socialhistoryservices.delivery; | 197,410 |
public static Iterable<Object[]> createParameters() throws Exception {
return createParameters(ExecutableSection.XCONTENT_REGISTRY);
} | static Iterable<Object[]> function() throws Exception { return createParameters(ExecutableSection.XCONTENT_REGISTRY); } | /**
* Create parameters for this parameterized test. Uses the
* {@link ExecutableSection#XCONTENT_REGISTRY list} of executable sections
* defined in {@link ExecutableSection}.
*/ | Create parameters for this parameterized test. Uses the <code>ExecutableSection#XCONTENT_REGISTRY list</code> of executable sections defined in <code>ExecutableSection</code> | createParameters | {
"repo_name": "strapdata/elassandra",
"path": "test/framework/src/main/java/org/elasticsearch/test/rest/yaml/ESClientYamlSuiteTestCase.java",
"license": "apache-2.0",
"size": 20979
} | [
"org.elasticsearch.test.rest.yaml.section.ExecutableSection"
] | import org.elasticsearch.test.rest.yaml.section.ExecutableSection; | import org.elasticsearch.test.rest.yaml.section.*; | [
"org.elasticsearch.test"
] | org.elasticsearch.test; | 688,447 |
String strIOR = (String) environment.get(Context.PROVIDER_URL);
if (strIOR == null)
throw new NamingException("There is no " + Context.PROVIDER_URL + " property set!");
// try to get the server
// create and initialize the ORB
String[] argv = {};
ORB orb = ORB.init(argv, null);
DAL dal = DALHelper.narrow(orb.string_to_object(strIOR));
BrowserJNDIContext.setOrb(orb);
BrowserJNDIContext.setDal(dal);
String rootElements = dal.list_nodes("");
//Returns the first level of the CDBTree (possible: "alma MACI schema CVS")
try{
//remove 'CVS' and 'schema' from Root
rootElements = rootElements.replaceAll("CVS","");
rootElements = rootElements.replaceAll("schemas","");
}
catch(PatternSyntaxException e){}
catch(NullPointerException e){}
Logger logger = ClientLogManager.getAcsLogManager().getLoggerForApplication("cdbBrowser", false);
return new BrowserJNDIContext("", rootElements, logger); //JNDI_Context implements Context
} | String strIOR = (String) environment.get(Context.PROVIDER_URL); if (strIOR == null) throw new NamingException(STR + Context.PROVIDER_URL + STR); String[] argv = {}; ORB orb = ORB.init(argv, null); DAL dal = DALHelper.narrow(orb.string_to_object(strIOR)); BrowserJNDIContext.setOrb(orb); BrowserJNDIContext.setDal(dal); String rootElements = dal.list_nodes(STRCVS","STRschemas","STRcdbBrowserSTR", rootElements, logger); } | /**
* An initial context factory (JNDI_ContextFactory) must implement the InitialContextFactory interface, which
* provides a method for creating instances of initial context that implement the Context interface
*/ | An initial context factory (JNDI_ContextFactory) must implement the InitialContextFactory interface, which provides a method for creating instances of initial context that implement the Context interface | getInitialContext | {
"repo_name": "ACS-Community/ACS",
"path": "LGPL/CommonSoftware/acsGUIs/cdbBrowser/src/com/cosylab/cdb/browser/BrowserJNDIContextFactory.java",
"license": "lgpl-2.1",
"size": 2821
} | [
"com.cosylab.CDB",
"javax.naming.Context",
"javax.naming.NamingException",
"org.omg.CORBA"
] | import com.cosylab.CDB; import javax.naming.Context; import javax.naming.NamingException; import org.omg.CORBA; | import com.cosylab.*; import javax.naming.*; import org.omg.*; | [
"com.cosylab",
"javax.naming",
"org.omg"
] | com.cosylab; javax.naming; org.omg; | 207,838 |
private void skipATrack( RandomAccessFile dos) throws IOException{
if(VERBOSE) System.out.println("Skipping the tempo track . . .");
dos.readInt();
dos.skipBytes(dos.readInt());
}
| void function( RandomAccessFile dos) throws IOException{ if(VERBOSE) System.out.println(STR); dos.readInt(); dos.skipBytes(dos.readInt()); } | /**
* Reads a MIDI track without doing anything to the data
*/ | Reads a MIDI track without doing anything to the data | skipATrack | {
"repo_name": "Armaxis/jmg",
"path": "src/main/java/jm/midi/SMF.java",
"license": "gpl-2.0",
"size": 10866
} | [
"java.io.IOException",
"java.io.RandomAccessFile"
] | import java.io.IOException; import java.io.RandomAccessFile; | import java.io.*; | [
"java.io"
] | java.io; | 1,848,782 |
public SubResource probe() {
return this.probe;
} | SubResource function() { return this.probe; } | /**
* Get the reference of the load balancer probe used by the load balancing rule.
*
* @return the probe value
*/ | Get the reference of the load balancer probe used by the load balancing rule | probe | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancingRuleInner.java",
"license": "mit",
"size": 14287
} | [
"com.microsoft.azure.SubResource"
] | import com.microsoft.azure.SubResource; | import com.microsoft.azure.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,355,194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.