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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
Gson gson = new Gson();
ColumnChromatography columnChromatography = gson.fromJson(jsonString, ColumnChromatography.class);
return columnChromatography;
}
|
Gson gson = new Gson(); ColumnChromatography columnChromatography = gson.fromJson(jsonString, ColumnChromatography.class); return columnChromatography; }
|
/**
* This static function returns a new object using the data contained in the
* given JSON object (as String).
*
* @param jsonString the JSON object
* @return the new Object.
*/
|
This static function returns a new object using the data contained in the given JSON object (as String)
|
fromJSON
|
{
"repo_name": "fikipollo/stategraems",
"path": "src/java/classes/analysis/non_processed_data/raw_data/SeparationMethods/ColumnChromatography.java",
"license": "mit",
"size": 9824
}
|
[
"com.google.gson.Gson"
] |
import com.google.gson.Gson;
|
import com.google.gson.*;
|
[
"com.google.gson"
] |
com.google.gson;
| 582,663
|
public static <K, V> DefaultedMap<K, V> defaultedMap(final Map<K, V> map, final Factory<? extends V> factory) {
if (factory == null) {
throw new IllegalArgumentException("Factory must not be null");
}
return new DefaultedMap<K, V>(map, FactoryTransformer.factoryTransformer(factory));
}
|
static <K, V> DefaultedMap<K, V> function(final Map<K, V> map, final Factory<? extends V> factory) { if (factory == null) { throw new IllegalArgumentException(STR); } return new DefaultedMap<K, V>(map, FactoryTransformer.factoryTransformer(factory)); }
|
/**
* Factory method to create a defaulting map.
* <p>
* The factory specified is called when a missing key is found.
* The result will be returned as the result of the map get(key) method.
*
* @param <K> the key type
* @param <V> the value type
* @param map the map to decorate, must not be null
* @param factory the factory to use to create entries, must not be null
* @return a new defaulting map
* @throws IllegalArgumentException if map or factory is null
* @since 4.0
*/
|
Factory method to create a defaulting map. The factory specified is called when a missing key is found. The result will be returned as the result of the map get(key) method
|
defaultedMap
|
{
"repo_name": "krivachy/compgs03_mutation_testing",
"path": "src/main/java/org/apache/commons/collections4/map/DefaultedMap.java",
"license": "apache-2.0",
"size": 8267
}
|
[
"java.util.Map",
"org.apache.commons.collections4.Factory",
"org.apache.commons.collections4.functors.FactoryTransformer"
] |
import java.util.Map; import org.apache.commons.collections4.Factory; import org.apache.commons.collections4.functors.FactoryTransformer;
|
import java.util.*; import org.apache.commons.collections4.*; import org.apache.commons.collections4.functors.*;
|
[
"java.util",
"org.apache.commons"
] |
java.util; org.apache.commons;
| 1,337,640
|
public static String getTextFromInputLayout(TextInputLayout textInputLayout) {
if (textInputLayout != null && textInputLayout.getEditText() != null) {
return textInputLayout.getEditText().getText().toString();
} else {
return null;
}
}
|
static String function(TextInputLayout textInputLayout) { if (textInputLayout != null && textInputLayout.getEditText() != null) { return textInputLayout.getEditText().getText().toString(); } else { return null; } }
|
/**
* Check if textInputLayout contains editText view. If so, then return text value of the view.
*
* @param textInputLayout wrapper for the editText view.
* @return text value of the editText view.
*/
|
Check if textInputLayout contains editText view. If so, then return text value of the view
|
getTextFromInputLayout
|
{
"repo_name": "ngthtung2805/dalatlaptop",
"path": "app/src/main/java/com/tungnui/dalatlaptop/libraryhelper/Utils.java",
"license": "mit",
"size": 7003
}
|
[
"android.support.design.widget.TextInputLayout"
] |
import android.support.design.widget.TextInputLayout;
|
import android.support.design.widget.*;
|
[
"android.support"
] |
android.support;
| 1,223,032
|
public void testGetRAFOnDirectory() {
DataStore store = getStore();
VirtualFile vFile = new VirtualFile("mydir", store);
assertTrue(vFile.mkdir());
assertTrue(vFile.exists());
assertTrue(vFile.isDirectory());
// Try opening in read mode.
try {
vFile.getRandomAccessFile("r");
fail("Opening a RAF on a directory should have failed");
} catch (FileNotFoundException fnfe) {
// Expected.
}
// Try opening in write mode.
try {
vFile.getRandomAccessFile("r");
fail("Opening a RAF on a directory should have failed");
} catch (FileNotFoundException fnfe) {
// Expected.
}
// A few sanity checks.
assertTrue(vFile.exists());
assertTrue(vFile.isDirectory());
}
|
void function() { DataStore store = getStore(); VirtualFile vFile = new VirtualFile("mydir", store); assertTrue(vFile.mkdir()); assertTrue(vFile.exists()); assertTrue(vFile.isDirectory()); try { vFile.getRandomAccessFile("r"); fail(STR); } catch (FileNotFoundException fnfe) { } try { vFile.getRandomAccessFile("r"); fail(STR); } catch (FileNotFoundException fnfe) { } assertTrue(vFile.exists()); assertTrue(vFile.isDirectory()); }
|
/**
* Opening a random access file on a directory should fail.
*/
|
Opening a random access file on a directory should fail
|
testGetRAFOnDirectory
|
{
"repo_name": "trejkaz/derby",
"path": "java/testing/org/apache/derbyTesting/unitTests/junit/VirtualFileTest.java",
"license": "apache-2.0",
"size": 13562
}
|
[
"java.io.FileNotFoundException",
"org.apache.derby.impl.io.vfmem.DataStore",
"org.apache.derby.impl.io.vfmem.VirtualFile"
] |
import java.io.FileNotFoundException; import org.apache.derby.impl.io.vfmem.DataStore; import org.apache.derby.impl.io.vfmem.VirtualFile;
|
import java.io.*; import org.apache.derby.impl.io.vfmem.*;
|
[
"java.io",
"org.apache.derby"
] |
java.io; org.apache.derby;
| 2,806,821
|
@Override public T visitSelector(@NotNull GolangParser.SelectorContext ctx) { return visitChildren(ctx); }
|
@Override public T visitSelector(@NotNull GolangParser.SelectorContext ctx) { return visitChildren(ctx); }
|
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
|
The default implementation returns the result of calling <code>#visitChildren</code> on ctx
|
visitStatement
|
{
"repo_name": "IsThisThePayneResidence/intellidots",
"path": "src/main/java/ua/edu/hneu/ast/parsers/GolangBaseVisitor.java",
"license": "gpl-3.0",
"size": 26234
}
|
[
"org.antlr.v4.runtime.misc.NotNull"
] |
import org.antlr.v4.runtime.misc.NotNull;
|
import org.antlr.v4.runtime.misc.*;
|
[
"org.antlr.v4"
] |
org.antlr.v4;
| 1,174,366
|
public ServiceCall get200Model204NoModelDefaultError400ValidAsync(final ServiceCallback<A> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
|
ServiceCall function(final ServiceCallback<A> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException(STR); }
|
/**
* Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/
|
Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}
|
get200Model204NoModelDefaultError400ValidAsync
|
{
"repo_name": "John-Hart/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/implementation/MultipleResponsesImpl.java",
"license": "mit",
"size": 84047
}
|
[
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] |
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 120,825
|
private static void configurePageBlobDir(Configuration conf) {
if (conf.get(AzureNativeFileSystemStore.KEY_PAGE_BLOB_DIRECTORIES) == null) {
conf.set(AzureNativeFileSystemStore.KEY_PAGE_BLOB_DIRECTORIES,
"/" + DEFAULT_PAGE_BLOB_DIRECTORY);
}
}
|
static void function(Configuration conf) { if (conf.get(AzureNativeFileSystemStore.KEY_PAGE_BLOB_DIRECTORIES) == null) { conf.set(AzureNativeFileSystemStore.KEY_PAGE_BLOB_DIRECTORIES, "/" + DEFAULT_PAGE_BLOB_DIRECTORY); } }
|
/**
* Set the page blob directories configuration to the default if it is not
* already set. Some tests may set it differently (e.g. the page blob
* tests in TestNativeAzureFSPageBlobLive).
* @param conf The configuration to conditionally update.
*/
|
Set the page blob directories configuration to the default if it is not already set. Some tests may set it differently (e.g. the page blob tests in TestNativeAzureFSPageBlobLive)
|
configurePageBlobDir
|
{
"repo_name": "jaypatil/hadoop",
"path": "hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AzureBlobStorageTestAccount.java",
"license": "gpl-3.0",
"size": 30928
}
|
[
"org.apache.hadoop.conf.Configuration"
] |
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,671,771
|
public void setSeriesItemLabelPaint(int series, Paint paint,
boolean notify) {
this.itemLabelPaintList.setPaint(series, paint);
if (notify) {
fireChangeEvent();
}
}
|
void function(int series, Paint paint, boolean notify) { this.itemLabelPaintList.setPaint(series, paint); if (notify) { fireChangeEvent(); } }
|
/**
* Sets the item label paint for a series and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero based).
* @param paint the paint (<code>null</code> permitted).
* @param notify a flag that controls whether or not listeners are
* notified.
*
* @see #getSeriesItemLabelPaint(int)
*/
|
Sets the item label paint for a series and, if requested, sends a <code>RendererChangeEvent</code> to all registered listeners
|
setSeriesItemLabelPaint
|
{
"repo_name": "aaronc/jfreechart",
"path": "source/org/jfree/chart/renderer/AbstractRenderer.java",
"license": "lgpl-2.1",
"size": 143969
}
|
[
"java.awt.Paint"
] |
import java.awt.Paint;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 110,087
|
@Test
public void buildsEmptyLiteralBlockScalar() {
final Scalar scalar = new RtYamlScalarBuilder()
.buildLiteralBlockScalar();
MatcherAssert.assertThat(
scalar.value(),
Matchers.isEmptyString()
);
}
|
void function() { final Scalar scalar = new RtYamlScalarBuilder() .buildLiteralBlockScalar(); MatcherAssert.assertThat( scalar.value(), Matchers.isEmptyString() ); }
|
/**
* RtYamlScalarBuilder can build an empty literal block scalar.
*/
|
RtYamlScalarBuilder can build an empty literal block scalar
|
buildsEmptyLiteralBlockScalar
|
{
"repo_name": "decorators-squad/camel",
"path": "src/test/java/com/amihaiemil/eoyaml/RtYamlScalarBuilderTest.java",
"license": "bsd-3-clause",
"size": 7010
}
|
[
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers"
] |
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers;
|
import org.hamcrest.*;
|
[
"org.hamcrest"
] |
org.hamcrest;
| 1,870,035
|
public synchronized MapperService createIndexMapperService(IndexMetaData indexMetaData) throws IOException {
final IndexSettings idxSettings = new IndexSettings(indexMetaData, this.settings, indexScopeSetting);
final IndexModule indexModule = new IndexModule(idxSettings, analysisRegistry);
pluginsService.onIndexModule(indexModule);
return indexModule.newIndexMapperService(xContentRegistry, mapperRegistry);
}
|
synchronized MapperService function(IndexMetaData indexMetaData) throws IOException { final IndexSettings idxSettings = new IndexSettings(indexMetaData, this.settings, indexScopeSetting); final IndexModule indexModule = new IndexModule(idxSettings, analysisRegistry); pluginsService.onIndexModule(indexModule); return indexModule.newIndexMapperService(xContentRegistry, mapperRegistry); }
|
/**
* creates a new mapper service for the given index, in order to do administrative work like mapping updates.
* This *should not* be used for document parsing. Doing so will result in an exception.
*
* Note: the returned {@link MapperService} should be closed when unneeded.
*/
|
creates a new mapper service for the given index, in order to do administrative work like mapping updates. This *should not* be used for document parsing. Doing so will result in an exception. Note: the returned <code>MapperService</code> should be closed when unneeded
|
createIndexMapperService
|
{
"repo_name": "jimczi/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/IndicesService.java",
"license": "apache-2.0",
"size": 62466
}
|
[
"java.io.IOException",
"org.elasticsearch.cluster.metadata.IndexMetaData",
"org.elasticsearch.index.IndexModule",
"org.elasticsearch.index.IndexSettings",
"org.elasticsearch.index.mapper.MapperService"
] |
import java.io.IOException; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MapperService;
|
import java.io.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.index.*; import org.elasticsearch.index.mapper.*;
|
[
"java.io",
"org.elasticsearch.cluster",
"org.elasticsearch.index"
] |
java.io; org.elasticsearch.cluster; org.elasticsearch.index;
| 936,173
|
static ValidationException extractionError(String message, Object... args) {
return extractionError(null, message, args);
}
|
static ValidationException extractionError(String message, Object... args) { return extractionError(null, message, args); }
|
/**
* Helper method for creating consistent exceptions during extraction.
*/
|
Helper method for creating consistent exceptions during extraction
|
extractionError
|
{
"repo_name": "jinglining/flink",
"path": "flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/extraction/ExtractionUtils.java",
"license": "apache-2.0",
"size": 32145
}
|
[
"org.apache.flink.table.api.ValidationException"
] |
import org.apache.flink.table.api.ValidationException;
|
import org.apache.flink.table.api.*;
|
[
"org.apache.flink"
] |
org.apache.flink;
| 2,492,341
|
public void dispatchMessage(Deliverer from, JSONObject message)
throws MessageHandlerException
{
String targetRef = message.target();
if (targetRef != null) {
DispatchTarget target = get(targetRef);
if (target != null) {
myDispatcher.dispatchMessage(from, target, message);
} else {
throw new MessageHandlerException("target object '" +
targetRef + "' not found");
}
} else {
throw new MessageHandlerException("no target in message");
}
}
|
void function(Deliverer from, JSONObject message) throws MessageHandlerException { String targetRef = message.target(); if (targetRef != null) { DispatchTarget target = get(targetRef); if (target != null) { myDispatcher.dispatchMessage(from, target, message); } else { throw new MessageHandlerException(STR + targetRef + STR); } } else { throw new MessageHandlerException(STR); } }
|
/**
* Dispatch a JSON message to the appropriate method on the object that the
* message says it is addressed to.
*
* @param from Alleged sender of the message.
* @param message The message itself.
*
* @throws MessageHandlerException if there was some kind of problem
* handling the message.
*/
|
Dispatch a JSON message to the appropriate method on the object that the message says it is addressed to
|
dispatchMessage
|
{
"repo_name": "frandallfarmer/Elko",
"path": "ServerCore/java/org/elkoserver/foundation/actor/RefTable.java",
"license": "mit",
"size": 9605
}
|
[
"org.elkoserver.foundation.json.Deliverer",
"org.elkoserver.foundation.json.DispatchTarget",
"org.elkoserver.foundation.json.MessageHandlerException",
"org.elkoserver.json.JSONObject"
] |
import org.elkoserver.foundation.json.Deliverer; import org.elkoserver.foundation.json.DispatchTarget; import org.elkoserver.foundation.json.MessageHandlerException; import org.elkoserver.json.JSONObject;
|
import org.elkoserver.foundation.json.*; import org.elkoserver.json.*;
|
[
"org.elkoserver.foundation",
"org.elkoserver.json"
] |
org.elkoserver.foundation; org.elkoserver.json;
| 1,609,743
|
public ArchSource[] getLibraries () {
return ArrayUtils.clone (_libraries);
}
|
ArchSource[] function () { return ArrayUtils.clone (_libraries); }
|
/**
* Returns the libraries that can be used to consume the executable.
*
* @return sources of static or dynamic libraries
*/
|
Returns the libraries that can be used to consume the executable
|
getLibraries
|
{
"repo_name": "beerdragon/maven-native-packaging",
"path": "src/main/java/uk/co/beerdragon/mvn/natives/Executable.java",
"license": "gpl-3.0",
"size": 2555
}
|
[
"org.apache.commons.lang3.ArrayUtils"
] |
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 163,617
|
private static void statementTiming()
{
try
{
long startConnection = System.currentTimeMillis();
Connection conn = null;
if (s_cType == C_MULTIPLE)
conn = DriverManager.getConnection (CONNECTION, UID, PWD);
long startStatement = System.currentTimeMillis();
Statement stmt = conn.createStatement ();
// stmt.setFetchSize(s_fetchSize);
long startQuery = System.currentTimeMillis();
ResultSet rs = stmt.executeQuery (STATEMENT);
int i = 0;
long startRetrieve = System.currentTimeMillis();
while (rs.next())
{
rs.getString(1);
i++;
}
long endRetrieve = System.currentTimeMillis();
// System.out.println(i);
rs.close();
rs = null;
long endQuery = System.currentTimeMillis();
stmt.close();
stmt = null;
long endStatement = System.currentTimeMillis();
conn.close();
conn = null;
long endConnection = System.currentTimeMillis();
//
System.out.println(C_INFO[s_cType]
+ "Fetch=" + s_fetchSize
+ " \tConn=" + (startStatement - startConnection)
+ " \tStmt=" + (startQuery - startStatement)
+ " \tQuery=" + (startRetrieve - startQuery)
+ " \tRetrieve=" + (endRetrieve - startRetrieve)
+ " \tClRs=" + (endQuery - endRetrieve)
+ " \tClStmt=" + (endStatement - endQuery)
+ " \tClConn=" + (endConnection - endStatement)
+ " \t- Total=" + (endConnection - startConnection)
+ " \tStmt=" + (endStatement - startStatement)
+ " \tQuery=" + (endQuery - startQuery));
}
catch (SQLException e)
{
e.printStackTrace();
}
} // statementTiming
public JdbcTestPG (int id)
{
super();
m_myId = id;
}
private int m_myId = 0;
|
static void function() { try { long startConnection = System.currentTimeMillis(); Connection conn = null; if (s_cType == C_MULTIPLE) conn = DriverManager.getConnection (CONNECTION, UID, PWD); long startStatement = System.currentTimeMillis(); Statement stmt = conn.createStatement (); long startQuery = System.currentTimeMillis(); ResultSet rs = stmt.executeQuery (STATEMENT); int i = 0; long startRetrieve = System.currentTimeMillis(); while (rs.next()) { rs.getString(1); i++; } long endRetrieve = System.currentTimeMillis(); rs.close(); rs = null; long endQuery = System.currentTimeMillis(); stmt.close(); stmt = null; long endStatement = System.currentTimeMillis(); conn.close(); conn = null; long endConnection = System.currentTimeMillis(); + STR + s_fetchSize + STR + (startStatement - startConnection) + STR + (startQuery - startStatement) + STR + (startRetrieve - startQuery) + STR + (endRetrieve - startRetrieve) + STR + (endQuery - endRetrieve) + STR + (endStatement - endQuery) + STR + (endConnection - endStatement) + STR + (endConnection - startConnection) + STR + (endStatement - startStatement) + STR + (endQuery - startQuery)); } catch (SQLException e) { e.printStackTrace(); } } public JdbcTestPG (int id) { super(); m_myId = id; } private int m_myId = 0;
|
/**
* Statement Timing
*/
|
Statement Timing
|
statementTiming
|
{
"repo_name": "pplatek/adempiere",
"path": "base/src/org/compiere/dbPort/JdbcTestPG.java",
"license": "gpl-2.0",
"size": 9917
}
|
[
"java.sql.Connection",
"java.sql.DriverManager",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement"
] |
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,821,744
|
@Test
public void testGetSessionIndex() throws Exception {
HttpServletRequest request = mock(HttpServletRequest.class);
HttpServletResponse response = mock(HttpServletResponse.class);
String samlResponseEncoded = Util.getFileAsString("data/responses/response1.xml.base64");
when(request.getParameterMap()).thenReturn(singletonMap("SAMLResponse", new String[]{samlResponseEncoded}));
when(request.getRequestURL()).thenReturn(new StringBuffer("http://localhost:8080/java-saml-jspsample/acs.jsp"));
Saml2Settings settings = new SettingsBuilder().fromFile("config/config.my.properties").build();
Auth auth = new Auth(settings, request, response);
assertNull(auth.getSessionIndex());
auth.processResponse();
assertFalse(auth.isAuthenticated());
assertNull(auth.getSessionIndex());
samlResponseEncoded = Util.getFileAsString("data/responses/valid_response.xml.base64");
when(request.getParameterMap()).thenReturn(singletonMap("SAMLResponse", new String[]{samlResponseEncoded}));
Auth auth2 = new Auth(settings, request, response);
assertNull(auth2.getSessionIndex());
auth2.processResponse();
assertTrue(auth2.isAuthenticated());
assertEquals("_6273d77b8cde0c333ec79d22a9fa0003b9fe2d75cb", auth2.getSessionIndex());
}
|
void function() throws Exception { HttpServletRequest request = mock(HttpServletRequest.class); HttpServletResponse response = mock(HttpServletResponse.class); String samlResponseEncoded = Util.getFileAsString(STR); when(request.getParameterMap()).thenReturn(singletonMap(STR, new String[]{samlResponseEncoded})); when(request.getRequestURL()).thenReturn(new StringBuffer(STRconfig/config.my.propertiesSTRdata/responses/valid_response.xml.base64"); when(request.getParameterMap()).thenReturn(singletonMap(STR, new String[]{samlResponseEncoded})); Auth auth2 = new Auth(settings, request, response); assertNull(auth2.getSessionIndex()); auth2.processResponse(); assertTrue(auth2.isAuthenticated()); assertEquals("_6273d77b8cde0c333ec79d22a9fa0003b9fe2d75cb", auth2.getSessionIndex()); }
|
/**
* Tests the getSessionIndex method of Auth
*
* @throws Exception
*
* @see com.onelogin.saml2.Auth#getSessionIndex
*/
|
Tests the getSessionIndex method of Auth
|
testGetSessionIndex
|
{
"repo_name": "inflexiontecnologia/java-saml",
"path": "toolkit/src/test/java/com/onelogin/saml2/test/AuthTest.java",
"license": "mit",
"size": 78772
}
|
[
"com.onelogin.saml2.Auth",
"com.onelogin.saml2.util.Util",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.junit.Assert",
"org.mockito.Mockito"
] |
import com.onelogin.saml2.Auth; import com.onelogin.saml2.util.Util; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.junit.Assert; import org.mockito.Mockito;
|
import com.onelogin.saml2.*; import com.onelogin.saml2.util.*; import javax.servlet.http.*; import org.junit.*; import org.mockito.*;
|
[
"com.onelogin.saml2",
"javax.servlet",
"org.junit",
"org.mockito"
] |
com.onelogin.saml2; javax.servlet; org.junit; org.mockito;
| 1,658,615
|
public static WorkRecordModel getWorkRecordModel(
String id)
throws NotFoundException {
return readTaggedWorkRecord(id).getModel();
}
|
static WorkRecordModel function( String id) throws NotFoundException { return readTaggedWorkRecord(id).getModel(); }
|
/**
* Retrieve a WorkRecordModel by its ID.
* @param id the ID of the workrecord
* @return the workrecord found
* @throws NotFoundException if no workrecords with such an ID was found
*/
|
Retrieve a WorkRecordModel by its ID
|
getWorkRecordModel
|
{
"repo_name": "opentdc/workrecords-service-file",
"path": "src/java/org/opentdc/workrecords/file/FileServiceProvider.java",
"license": "mit",
"size": 20601
}
|
[
"org.opentdc.service.exception.NotFoundException",
"org.opentdc.workrecords.WorkRecordModel"
] |
import org.opentdc.service.exception.NotFoundException; import org.opentdc.workrecords.WorkRecordModel;
|
import org.opentdc.service.exception.*; import org.opentdc.workrecords.*;
|
[
"org.opentdc.service",
"org.opentdc.workrecords"
] |
org.opentdc.service; org.opentdc.workrecords;
| 2,014,222
|
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
|
void function(Date lastUpdated) { this.lastUpdated = lastUpdated; }
|
/**
* Sets the last updated.
*
* @param lastUpdated
* The last_updated
*/
|
Sets the last updated
|
setLastUpdated
|
{
"repo_name": "mikokitty/iMed",
"path": "java-wrapper-master/src/main/java/com/ibm/watson/developer_cloud/concept_insights/v2/model/CorpusProcessingState.java",
"license": "apache-2.0",
"size": 2469
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,660,513
|
public static long getFreeSpaceAvailable() {
File dataFolder = UserPreferences.getDataFolder(null);
if (dataFolder != null) {
return getFreeSpaceAvailable(dataFolder.getAbsolutePath());
} else {
return 0;
}
}
|
static long function() { File dataFolder = UserPreferences.getDataFolder(null); if (dataFolder != null) { return getFreeSpaceAvailable(dataFolder.getAbsolutePath()); } else { return 0; } }
|
/**
* Get the number of free bytes that are available on the external storage.
*/
|
Get the number of free bytes that are available on the external storage
|
getFreeSpaceAvailable
|
{
"repo_name": "ByteHamster/AntennaPod",
"path": "core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java",
"license": "gpl-3.0",
"size": 2430
}
|
[
"de.danoeh.antennapod.core.preferences.UserPreferences",
"java.io.File"
] |
import de.danoeh.antennapod.core.preferences.UserPreferences; import java.io.File;
|
import de.danoeh.antennapod.core.preferences.*; import java.io.*;
|
[
"de.danoeh.antennapod",
"java.io"
] |
de.danoeh.antennapod; java.io;
| 2,046,548
|
private void doProcess(String str, Element ref) {
try {
boolean sourceTitleProcessed = false;
if (!StringUtils.isEmpty(str) && str.length() > MIN_STRING_LENGTH) {
System.out.println(str);
if (reference.getAuthors().isEmpty()) {
reference.setAuthors(parseAuthorString(str));
}
if (StringUtils.isEmpty(reference.getYear())) {
reference.setYear(parseYearString(str));
}
if (StringUtils.isEmpty(reference.getSectionTitle())) {
if (parsePosition != -1
&& parsePosition < str.length() - MIN_STRING_LENGTH
+ 1) {
str = str.substring(parsePosition);
if (str.trim().startsWith(".")) {
str = str.substring(1);
}
String title = parseTitle(str.trim());
reference.setSectionTitleAndId(title.trim());
reference.setSourceTitleAndSourceId(title.trim());
}
}
if (reference.getSectionTitle() != null
&& reference.getEditors().isEmpty()) {
if (parsePosition != -1 && str.length() > MIN_STRING_LENGTH
&& parsePosition < str.length() - MIN_STRING_LENGTH) {
str = str.substring(parsePosition + 1);
reference.setEditors(parseEditorString(str));
}
}
if (!reference.getEditors().isEmpty() && !sourceTitleProcessed) {
str = getRestString(str);
String sourceTitle = parseSourceTitle(str, ref);
if (!sourceTitle.isEmpty()) {
reference.setSourceTitleAndSourceId(sourceTitle);
parsePosition = str.indexOf(sourceTitle)
+ sourceTitle.length();
str = getRestString(str);
} else {
if (sourceTitleProcessed) {
log.error(reference.getInternalReferenceId()
+ "No source title found!");
}
}
}
if (str.length() >= MIN_STRING_LENGTH) {
reference.setRest(str);
}
// TODO process source's page start and page end (see 671, r3)
// TODO process: reference.getPublisherName();
// TODO process: reference.getPublisherLocation()
// TODO process references of type external link
}
} catch (Exception e) {
log.error("TODO delete this catch block again. just for debugging\n. Ref: "
+ reference.getInternalReferenceId()
+ " ex: "
+ e.fillInStackTrace());
e.printStackTrace();
}
}
|
void function(String str, Element ref) { try { boolean sourceTitleProcessed = false; if (!StringUtils.isEmpty(str) && str.length() > MIN_STRING_LENGTH) { System.out.println(str); if (reference.getAuthors().isEmpty()) { reference.setAuthors(parseAuthorString(str)); } if (StringUtils.isEmpty(reference.getYear())) { reference.setYear(parseYearString(str)); } if (StringUtils.isEmpty(reference.getSectionTitle())) { if (parsePosition != -1 && parsePosition < str.length() - MIN_STRING_LENGTH + 1) { str = str.substring(parsePosition); if (str.trim().startsWith(".")) { str = str.substring(1); } String title = parseTitle(str.trim()); reference.setSectionTitleAndId(title.trim()); reference.setSourceTitleAndSourceId(title.trim()); } } if (reference.getSectionTitle() != null && reference.getEditors().isEmpty()) { if (parsePosition != -1 && str.length() > MIN_STRING_LENGTH && parsePosition < str.length() - MIN_STRING_LENGTH) { str = str.substring(parsePosition + 1); reference.setEditors(parseEditorString(str)); } } if (!reference.getEditors().isEmpty() && !sourceTitleProcessed) { str = getRestString(str); String sourceTitle = parseSourceTitle(str, ref); if (!sourceTitle.isEmpty()) { reference.setSourceTitleAndSourceId(sourceTitle); parsePosition = str.indexOf(sourceTitle) + sourceTitle.length(); str = getRestString(str); } else { if (sourceTitleProcessed) { log.error(reference.getInternalReferenceId() + STR); } } } if (str.length() >= MIN_STRING_LENGTH) { reference.setRest(str); } } } catch (Exception e) { log.error(STR + reference.getInternalReferenceId() + STR + e.fillInStackTrace()); e.printStackTrace(); } }
|
/**
* Coordinates the different extraction tasks: The references come in a
* predefined sequence (1st: author, 2nd: year, 3rd: title,...). The
* reference may contain all information in one string or in separate
* strings, this must be taken into account.
*
* @param str
* part of a reference.
*/
|
Coordinates the different extraction tasks: The references come in a predefined sequence (1st: author, 2nd: year, 3rd: title,...). The reference may contain all information in one string or in separate strings, this must be taken into account
|
doProcess
|
{
"repo_name": "isabelbarth/kobpsy",
"path": "se4ojs/sources/refStructuring/src/main/java/org/zpid/se4ojs/refStructuring/ReferenceStructurer.java",
"license": "apache-2.0",
"size": 14519
}
|
[
"org.apache.commons.lang3.StringUtils",
"org.w3c.dom.Element"
] |
import org.apache.commons.lang3.StringUtils; import org.w3c.dom.Element;
|
import org.apache.commons.lang3.*; import org.w3c.dom.*;
|
[
"org.apache.commons",
"org.w3c.dom"
] |
org.apache.commons; org.w3c.dom;
| 53,955
|
@Override
public String lookupPrefix(String namespaceURI) {
throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
"lookupPrefix(String namespaceURI) not implemented on class " + getClass().getName());
}
|
String function(String namespaceURI) { throw new DOMException(DOMException.NOT_SUPPORTED_ERR, STR + getClass().getName()); }
|
/** ? @see org.w3c.dom.Node#lookupPrefix(java.lang.String)
*/
|
? @see org.w3c.dom.Node#lookupPrefix(java.lang.String)
|
lookupPrefix
|
{
"repo_name": "shabanovd/exist",
"path": "src/org/exist/dom/ElementImpl.java",
"license": "lgpl-2.1",
"size": 78999
}
|
[
"org.w3c.dom.DOMException"
] |
import org.w3c.dom.DOMException;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 2,570,577
|
interface ConnectStrategy {
void connect(HttpURLConnection connection) throws IOException;
}
|
interface ConnectStrategy { void connect(HttpURLConnection connection) throws IOException; }
|
/**
* Causes the given {@code connection}, which was previously disconnected,
* to initiate the connection.
*/
|
Causes the given connection, which was previously disconnected, to initiate the connection
|
connect
|
{
"repo_name": "google/desugar_jdk_libs",
"path": "jdk11/src/libcore/luni/src/test/java/libcore/java/net/URLConnectionTest.java",
"license": "gpl-2.0",
"size": 173039
}
|
[
"java.io.IOException",
"java.net.HttpURLConnection"
] |
import java.io.IOException; import java.net.HttpURLConnection;
|
import java.io.*; import java.net.*;
|
[
"java.io",
"java.net"
] |
java.io; java.net;
| 600,167
|
private byte[] getHSSFWorkbookBytes(final HSSFWorkbook hssfwkbk)
throws IOException {
CodeListXLSGenerator clgen = new CodeListXLSGenerator();
return clgen.getHSSFWorkbookBytes(hssfwkbk);
}
|
byte[] function(final HSSFWorkbook hssfwkbk) throws IOException { CodeListXLSGenerator clgen = new CodeListXLSGenerator(); return clgen.getHSSFWorkbookBytes(hssfwkbk); }
|
/**
* Gets the hSSF workbook bytes.
*
* @param hssfwkbk
* - HSSFWorkbook.
* @return byte[].
* @throws IOException
* - IOException. *
*/
|
Gets the hSSF workbook bytes
|
getHSSFWorkbookBytes
|
{
"repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint",
"path": "mat/src/mat/server/service/impl/SimpleEMeasureServiceImpl.java",
"license": "apache-2.0",
"size": 28801
}
|
[
"java.io.IOException",
"org.apache.poi.hssf.usermodel.HSSFWorkbook"
] |
import java.io.IOException; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import java.io.*; import org.apache.poi.hssf.usermodel.*;
|
[
"java.io",
"org.apache.poi"
] |
java.io; org.apache.poi;
| 2,671,137
|
default void checkCanSetCatalogSessionProperty(Identity identity, String catalogName, String propertyName)
{
denySetCatalogSessionProperty(propertyName);
}
|
default void checkCanSetCatalogSessionProperty(Identity identity, String catalogName, String propertyName) { denySetCatalogSessionProperty(propertyName); }
|
/**
* Check if identity is allowed to set the specified property in a catalog.
*
* @throws com.facebook.presto.spi.security.AccessDeniedException if not allowed
*/
|
Check if identity is allowed to set the specified property in a catalog
|
checkCanSetCatalogSessionProperty
|
{
"repo_name": "RobinUS2/presto",
"path": "presto-spi/src/main/java/com/facebook/presto/spi/security/SystemAccessControl.java",
"license": "apache-2.0",
"size": 11691
}
|
[
"com.facebook.presto.spi.security.AccessDeniedException"
] |
import com.facebook.presto.spi.security.AccessDeniedException;
|
import com.facebook.presto.spi.security.*;
|
[
"com.facebook.presto"
] |
com.facebook.presto;
| 596,057
|
@Override
public SSLEngine createSSLEngine(String peerHost, int peerPort, Mode mode) {
SSLEngine sslEngine = sslContext.createSSLEngine(peerHost, peerPort);
if (cipherSuites != null) {
sslEngine.setEnabledCipherSuites(cipherSuites);
}
if (enabledProtocols != null) {
sslEngine.setEnabledProtocols(enabledProtocols);
}
if (mode == Mode.SERVER) {
sslEngine.setUseClientMode(false);
switch (clientAuth) {
case REQUIRED:
sslEngine.setNeedClientAuth(true);
break;
case REQUESTED:
sslEngine.setWantClientAuth(true);
break;
}
} else {
sslEngine.setUseClientMode(true);
SSLParameters sslParams = sslEngine.getSSLParameters();
sslParams.setEndpointIdentificationAlgorithm(endpointIdentification);
sslEngine.setSSLParameters(sslParams);
}
return sslEngine;
}
|
SSLEngine function(String peerHost, int peerPort, Mode mode) { SSLEngine sslEngine = sslContext.createSSLEngine(peerHost, peerPort); if (cipherSuites != null) { sslEngine.setEnabledCipherSuites(cipherSuites); } if (enabledProtocols != null) { sslEngine.setEnabledProtocols(enabledProtocols); } if (mode == Mode.SERVER) { sslEngine.setUseClientMode(false); switch (clientAuth) { case REQUIRED: sslEngine.setNeedClientAuth(true); break; case REQUESTED: sslEngine.setWantClientAuth(true); break; } } else { sslEngine.setUseClientMode(true); SSLParameters sslParams = sslEngine.getSSLParameters(); sslParams.setEndpointIdentificationAlgorithm(endpointIdentification); sslEngine.setSSLParameters(sslParams); } return sslEngine; }
|
/**
* Create {@link SSLEngine} for given host name and port number.
* This engine manages the handshake process and encryption/decryption with this remote host.
* @param peerHost The remote host name
* @param peerPort The remote port number
* @param mode The local SSL mode, Client or Server
* @return SSLEngine
*/
|
Create <code>SSLEngine</code> for given host name and port number. This engine manages the handshake process and encryption/decryption with this remote host
|
createSSLEngine
|
{
"repo_name": "vgkholla/ambry",
"path": "ambry-commons/src/main/java/com.github.ambry.commons/JdkSslFactory.java",
"license": "apache-2.0",
"size": 7116
}
|
[
"javax.net.ssl.SSLEngine",
"javax.net.ssl.SSLParameters"
] |
import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLParameters;
|
import javax.net.ssl.*;
|
[
"javax.net"
] |
javax.net;
| 1,070,513
|
private long sendData(OutputStream oStream) throws MeasurementError {
byte[] uplinkBuffer = new byte[config.getPktSizeUpBytes()];
this.genRandomByteArray(uplinkBuffer);
long pktSizeSent = 0;
try {
do {
sendMessageOnStream(uplinkBuffer, oStream);
pktSizeSent += config.getPktSizeUpBytes();
} while (pktSizeSent < config.getDataLimitMbUp() * MB_TO_B);
// send last message with special content
sendMessageOnStream(TCPUploadTask.UPLINK_FINISH_MSG.getBytes(), oStream);
} catch (IOException e) {
throw new MeasurementError(taskName, "Unable to upload data", e);
}
return pktSizeSent;
}
/**
* Write a message on the given {@link OutputStream}
|
long function(OutputStream oStream) throws MeasurementError { byte[] uplinkBuffer = new byte[config.getPktSizeUpBytes()]; this.genRandomByteArray(uplinkBuffer); long pktSizeSent = 0; try { do { sendMessageOnStream(uplinkBuffer, oStream); pktSizeSent += config.getPktSizeUpBytes(); } while (pktSizeSent < config.getDataLimitMbUp() * MB_TO_B); sendMessageOnStream(TCPUploadTask.UPLINK_FINISH_MSG.getBytes(), oStream); } catch (IOException e) { throw new MeasurementError(taskName, STR, e); } return pktSizeSent; } /** * Write a message on the given {@link OutputStream}
|
/**
* Send the required quantity of data on the given {@link Socket}.
*
* @param oStream The output stream to write onto.
* @return The quantity of sent bytes.
* @throws MeasurementError If the interaction with stream fails.
*/
|
Send the required quantity of data on the given <code>Socket</code>
|
sendData
|
{
"repo_name": "APISENSE/android-network-measures",
"path": "measures/src/main/java/io/apisense/network/tcp/TCPUploadTask.java",
"license": "apache-2.0",
"size": 4222
}
|
[
"io.apisense.network.MeasurementError",
"java.io.IOException",
"java.io.OutputStream"
] |
import io.apisense.network.MeasurementError; import java.io.IOException; import java.io.OutputStream;
|
import io.apisense.network.*; import java.io.*;
|
[
"io.apisense.network",
"java.io"
] |
io.apisense.network; java.io;
| 127,097
|
private void startTimer() {
stopTimer();
timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
|
void function() { stopTimer(); timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() {
|
/**
* We send periodically a command to keep connection alive and for avoiding
* stopping media session
*
* Fix for https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin/issues/5
*/
|
We send periodically a command to keep connection alive and for avoiding stopping media session Fix for HREF
|
startTimer
|
{
"repo_name": "moria/popcorn-android",
"path": "connectsdk/core/src/com/connectsdk/service/AirPlayService.java",
"license": "gpl-3.0",
"size": 32273
}
|
[
"java.util.Timer",
"java.util.TimerTask"
] |
import java.util.Timer; import java.util.TimerTask;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,380,177
|
public void testInsertRowOnQuotedCursor() throws SQLException {
ResultSet rs = null;
Statement stmt = createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);
stmt.setCursorName("my \"\"\"\"quoted\"\"\"\" cursor\"\"");
rs = stmt.executeQuery("select * from \"my table\"");
rs.next();
rs.moveToInsertRow();
rs.updateInt(1, 4);
rs.insertRow();
rs.moveToCurrentRow();
rs.close();
rs = stmt.executeQuery("select * from \"my table\" order by x");
for (int i=1; i<=4; i++) {
assertTrue("there is a row", rs.next());
assertEquals("row contains correct value", i, rs.getInt(1));
}
rs.close();
stmt.close();
}
|
void function() throws SQLException { ResultSet rs = null; Statement stmt = createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); stmt.setCursorName(STR\"\"\STR\"\"\STR\STRselect * from \STRSTRselect * from \STR order by xSTRthere is a rowSTRrow contains correct value", i, rs.getInt(1)); } rs.close(); stmt.close(); }
|
/**
* Tests insertRow with cursor name containing quotes
*/
|
Tests insertRow with cursor name containing quotes
|
testInsertRowOnQuotedCursor
|
{
"repo_name": "trejkaz/derby",
"path": "java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdatableResultSetTest.java",
"license": "apache-2.0",
"size": 24051
}
|
[
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement"
] |
import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,006,059
|
@Override
public final IExpr arg1() {
return arg1;
}
|
final IExpr function() { return arg1; }
|
/**
* Get the first argument (i.e. the second element of the underlying list structure) of the <code>
* AST</code> function (i.e. get(1) ). <br>
* <b>Example:</b> for the AST representing the expression <code>Sin(x)</code>, <code>arg1()
* </code> returns <code>x</code>.
*
* @return the first argument of the function represented by this <code>AST</code>.
* @see IExpr#head()
*/
|
Get the first argument (i.e. the second element of the underlying list structure) of the <code> AST</code> function (i.e. get(1) ). Example: for the AST representing the expression <code>Sin(x)</code>, <code>arg1() </code> returns <code>x</code>
|
arg1
|
{
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/expression/AST1.java",
"license": "gpl-3.0",
"size": 11799
}
|
[
"org.matheclipse.core.interfaces.IExpr"
] |
import org.matheclipse.core.interfaces.IExpr;
|
import org.matheclipse.core.interfaces.*;
|
[
"org.matheclipse.core"
] |
org.matheclipse.core;
| 364,271
|
boolean deleteTableColumnStatistics(String catName, String dbName, String tableName,
String colName, String engine)
throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException;
|
boolean deleteTableColumnStatistics(String catName, String dbName, String tableName, String colName, String engine) throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException;
|
/**
* Delete statistics for a single column or all columns in a table.
* @param catName catalog name
* @param dbName database name
* @param tableName table name
* @param colName column name. Null to delete stats for all columns in the table.
* @param engine engine for which we want to delete statistics
* @return true if the statistics were deleted.
* @throws NoSuchObjectException no such table or column.
* @throws MetaException error access the RDBMS.
* @throws InvalidObjectException error dropping the stats
* @throws InvalidInputException bad inputs, such as null table name.
*/
|
Delete statistics for a single column or all columns in a table
|
deleteTableColumnStatistics
|
{
"repo_name": "lirui-apache/hive",
"path": "standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java",
"license": "apache-2.0",
"size": 94780
}
|
[
"org.apache.hadoop.hive.metastore.api.InvalidInputException",
"org.apache.hadoop.hive.metastore.api.InvalidObjectException",
"org.apache.hadoop.hive.metastore.api.MetaException",
"org.apache.hadoop.hive.metastore.api.NoSuchObjectException"
] |
import org.apache.hadoop.hive.metastore.api.InvalidInputException; import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
|
import org.apache.hadoop.hive.metastore.api.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 2,483,113
|
m_dbcon = dbcon;
try {
DatabaseMetaData dmd = dbcon.getConnection().getMetaData();
if (dmd == null)
throw new RDFRDBException("Oracle database metadata not available.");
TABLE_NAME_LENGTH_MAX = dmd.getMaxTableNameLength();
setTableNames(TABLE_NAME_PREFIX); // need to recheck that table names are not too long
} catch ( SQLException e ) {
throw new RDFRDBException("Problem accessing Oracle database metadata.");
}
try {
m_sql = new SQLCache(SQL_FILE, null, dbcon, ID_SQL_TYPE);
} catch (Exception e) {
e.printStackTrace( System.err );
logger.error("Unable to set connection for Driver:", e);
}
}
|
m_dbcon = dbcon; try { DatabaseMetaData dmd = dbcon.getConnection().getMetaData(); if (dmd == null) throw new RDFRDBException(STR); TABLE_NAME_LENGTH_MAX = dmd.getMaxTableNameLength(); setTableNames(TABLE_NAME_PREFIX); } catch ( SQLException e ) { throw new RDFRDBException(STR); } try { m_sql = new SQLCache(SQL_FILE, null, dbcon, ID_SQL_TYPE); } catch (Exception e) { e.printStackTrace( System.err ); logger.error(STR, e); } }
|
/**
* Set the database connection
*/
|
Set the database connection
|
setConnection
|
{
"repo_name": "jacekkopecky/parkjam",
"path": "src/com/hp/hpl/jena/db/impl/Driver_Oracle.java",
"license": "apache-2.0",
"size": 11386
}
|
[
"com.hp.hpl.jena.db.RDFRDBException",
"java.sql.DatabaseMetaData",
"java.sql.SQLException"
] |
import com.hp.hpl.jena.db.RDFRDBException; import java.sql.DatabaseMetaData; import java.sql.SQLException;
|
import com.hp.hpl.jena.db.*; import java.sql.*;
|
[
"com.hp.hpl",
"java.sql"
] |
com.hp.hpl; java.sql;
| 2,174,425
|
public static String getPathFromUri(ContentResolver resolver, Uri contentUri) {
final String dataColumn = MediaStore.MediaColumns.DATA;
Cursor cursor = null;
try {
cursor = resolver.query(contentUri, new String[] { dataColumn }, null, null, null);
if (cursor == null || !cursor.moveToFirst())
return null;
final int index = cursor.getColumnIndex(dataColumn);
return cursor.getString(index);
} finally {
if (cursor != null)
cursor.close();
}
}
|
static String function(ContentResolver resolver, Uri contentUri) { final String dataColumn = MediaStore.MediaColumns.DATA; Cursor cursor = null; try { cursor = resolver.query(contentUri, new String[] { dataColumn }, null, null, null); if (cursor == null !cursor.moveToFirst()) return null; final int index = cursor.getColumnIndex(dataColumn); return cursor.getString(index); } finally { if (cursor != null) cursor.close(); } }
|
/**
* Retrieve real filename from Content Provider.
*
* @param contentUri Uri to be checked.
* @return Full path filename of the resource pointed by contentUri if look up successfully finished. null otherwise.
*/
|
Retrieve real filename from Content Provider
|
getPathFromUri
|
{
"repo_name": "mrmt/triaina",
"path": "android/Commons/src/jp/mixi/triaina/commons/utils/FileUtils.java",
"license": "bsd-3-clause",
"size": 3031
}
|
[
"android.content.ContentResolver",
"android.database.Cursor",
"android.net.Uri",
"android.provider.MediaStore"
] |
import android.content.ContentResolver; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore;
|
import android.content.*; import android.database.*; import android.net.*; import android.provider.*;
|
[
"android.content",
"android.database",
"android.net",
"android.provider"
] |
android.content; android.database; android.net; android.provider;
| 1,849,723
|
public WebServiceMessageSender getMessageSender() {
return replyToMessageSender;
}
|
WebServiceMessageSender function() { return replyToMessageSender; }
|
/** * @return Returns the replyToMessageSender for wsa:replyTo.
*/
|
@return Returns the replyToMessageSender for wsa:replyTo
|
getMessageSender
|
{
"repo_name": "ramonmaruko/camel",
"path": "components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/SpringWebserviceConfiguration.java",
"license": "apache-2.0",
"size": 9176
}
|
[
"org.springframework.ws.transport.WebServiceMessageSender"
] |
import org.springframework.ws.transport.WebServiceMessageSender;
|
import org.springframework.ws.transport.*;
|
[
"org.springframework.ws"
] |
org.springframework.ws;
| 1,959,672
|
EList<EObject> getWChar();
|
EList<EObject> getWChar();
|
/**
* Returns the value of the '<em><b>WChar</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.emf.ecore.EObject}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>WChar</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>WChar</em>' containment reference list.
* @see org.bbaw.bts.corpus.text.egy.egyDsl.EgyDslPackage#getExpanded_WChar()
* @model containment="true"
* @generated
*/
|
Returns the value of the 'WChar' containment reference list. The list contents are of type <code>org.eclipse.emf.ecore.EObject</code>. If the meaning of the 'WChar' containment reference list isn't clear, there really should be more of a description here...
|
getWChar
|
{
"repo_name": "JKatzwinkel/bts",
"path": "org.bbaw.bts.corpus.text.egy.egydsl/src-gen/org/bbaw/bts/corpus/text/egy/egyDsl/Expanded.java",
"license": "lgpl-3.0",
"size": 1422
}
|
[
"org.eclipse.emf.common.util.EList",
"org.eclipse.emf.ecore.EObject"
] |
import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject;
|
import org.eclipse.emf.common.util.*; import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,379,893
|
public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException;
|
KeyParameter function(CharSequence password) throws KeyCrypterException;
|
/**
* Create a KeyParameter (which typically contains an AES key)
* @param password
* @return KeyParameter The KeyParameter which typically contains the AES key to use for encrypting and decrypting
* @throws KeyCrypterException
*/
|
Create a KeyParameter (which typically contains an AES key)
|
deriveKey
|
{
"repo_name": "denwaotoko/devcoinj",
"path": "core/src/main/java/com/google/devcoin/crypto/KeyCrypter.java",
"license": "apache-2.0",
"size": 2913
}
|
[
"org.spongycastle.crypto.params.KeyParameter"
] |
import org.spongycastle.crypto.params.KeyParameter;
|
import org.spongycastle.crypto.params.*;
|
[
"org.spongycastle.crypto"
] |
org.spongycastle.crypto;
| 1,994,851
|
void postFlush(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store,
final StoreFile resultFile) throws IOException;
|
void postFlush(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final StoreFile resultFile) throws IOException;
|
/**
* Called after a Store's memstore is flushed to disk.
* @param c the environment provided by the region server
* @param store the store being flushed
* @param resultFile the new store file written out during compaction
* @throws IOException if an error occurred on the coprocessor
*/
|
Called after a Store's memstore is flushed to disk
|
postFlush
|
{
"repo_name": "zqxjjj/NobidaBase",
"path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java",
"license": "apache-2.0",
"size": 41666
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.regionserver.Store",
"org.apache.hadoop.hbase.regionserver.StoreFile"
] |
import java.io.IOException; import org.apache.hadoop.hbase.regionserver.Store; import org.apache.hadoop.hbase.regionserver.StoreFile;
|
import java.io.*; import org.apache.hadoop.hbase.regionserver.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 904,931
|
JavaType getDeclaringClass();
/**
* Gets a string for this field formatted according to a given format specification. A format
* specification is composed of characters that are to be copied verbatim to the result and
* specifiers that denote an attribute of this field that is to be copied to the result. A
* specifier is a single character preceded by a '%' character. The accepted specifiers and the
* field attributes they denote are described below:
*
* <pre>
* Specifier | Description | Example(s)
* ----------+------------------------------------------------------------------------------------------
* 'T' | Qualified type | "int" "java.lang.String"
* 't' | Unqualified type | "int" "String"
* 'H' | Qualified holder | "java.util.Map.Entry"
* 'h' | Unqualified holder | "Entry"
* 'n' | Field name | "age"
* 'f' | Indicator if field is unresolved, static or instance | "unresolved" "static" "instance"
* '%' | A '%' character | "%"
* </pre>
*
* @param format a format specification
* @return the result of formatting this field according to {@code format}
* @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
|
JavaType getDeclaringClass(); /** * Gets a string for this field formatted according to a given format specification. A format * specification is composed of characters that are to be copied verbatim to the result and * specifiers that denote an attribute of this field that is to be copied to the result. A * specifier is a single character preceded by a '%' character. The accepted specifiers and the * field attributes they denote are described below: * * <pre> * Specifier Description Example(s) * ----------+------------------------------------------------------------------------------------------ * 'T' Qualified type "int" STR * 't' Unqualified type "int" STR * 'H' Qualified holder STR * 'h' Unqualified holder "Entry" * 'n' Field name "age" * 'f' Indicator if field is unresolved, static or instance STR STR STR * '%' A '%' character "%" * </pre> * * @param format a format specification * @return the result of formatting this field according to {@code format} * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
|
/**
* Returns the {@link JavaType} object representing the class or interface that declares this
* field.
*/
|
Returns the <code>JavaType</code> object representing the class or interface that declares this field
|
getDeclaringClass
|
{
"repo_name": "FauxFaux/jdk9-hotspot",
"path": "src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java",
"license": "gpl-2.0",
"size": 5329
}
|
[
"java.util.IllegalFormatException"
] |
import java.util.IllegalFormatException;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,474,416
|
public static boolean onKeyDown(KeyEvent event, ChromeActivity activity,
boolean isCurrentTabVisible, boolean tabSwitchingEnabled) {
int keyCode = event.getKeyCode();
if (event.getRepeatCount() != 0 || KeyEvent.isModifierKey(keyCode)) return false;
if (KeyEvent.isGamepadButton(keyCode)) {
if (isGamepadAPIActive(activity)) return false;
} else if (!event.isCtrlPressed() && !event.isAltPressed()
&& keyCode != KeyEvent.KEYCODE_F3
&& keyCode != KeyEvent.KEYCODE_F5
&& keyCode != KeyEvent.KEYCODE_F10
&& keyCode != KeyEvent.KEYCODE_FORWARD) {
return false;
}
TabModel curModel = activity.getCurrentTabModel();
int count = curModel.getCount();
int metaState = getMetaState(event);
int keyCodeAndMeta = keyCode | metaState;
switch (keyCodeAndMeta) {
case CTRL | SHIFT | KeyEvent.KEYCODE_T:
activity.onMenuOrKeyboardAction(R.id.open_recently_closed_tab, false);
return true;
case CTRL | KeyEvent.KEYCODE_T:
activity.onMenuOrKeyboardAction(curModel.isIncognito()
? R.id.new_incognito_tab_menu_id
: R.id.new_tab_menu_id, false);
return true;
case CTRL | KeyEvent.KEYCODE_N:
activity.onMenuOrKeyboardAction(R.id.new_tab_menu_id, false);
return true;
case CTRL | SHIFT | KeyEvent.KEYCODE_N:
activity.onMenuOrKeyboardAction(R.id.new_incognito_tab_menu_id, false);
return true;
// Alt+E represents a special character ´ (latin code: ´) in Android.
// If an EditText or ContentView has focus, Alt+E will be swallowed by
// the default dispatchKeyEvent and cannot open the menu.
case ALT | KeyEvent.KEYCODE_E:
case ALT | KeyEvent.KEYCODE_F:
case KeyEvent.KEYCODE_F10:
case KeyEvent.KEYCODE_BUTTON_Y:
activity.onMenuOrKeyboardAction(R.id.show_menu, false);
return true;
}
if (isCurrentTabVisible) {
if (tabSwitchingEnabled && (metaState == CTRL || metaState == ALT)) {
int numCode = keyCode - KeyEvent.KEYCODE_0;
if (numCode > 0 && numCode <= Math.min(count, 8)) {
// Ctrl+1 to Ctrl+8: select tab by index
TabModelUtils.setIndex(curModel, numCode - 1);
return true;
} else if (numCode == 9 && count != 0) {
// Ctrl+9: select last tab
TabModelUtils.setIndex(curModel, count - 1);
return true;
}
}
switch (keyCodeAndMeta) {
case CTRL | KeyEvent.KEYCODE_TAB:
case CTRL | KeyEvent.KEYCODE_PAGE_DOWN:
case KeyEvent.KEYCODE_BUTTON_R1:
if (tabSwitchingEnabled && count > 1) {
TabModelUtils.setIndex(curModel, (curModel.index() + 1) % count);
}
return true;
case CTRL | SHIFT | KeyEvent.KEYCODE_TAB:
case CTRL | KeyEvent.KEYCODE_PAGE_UP:
case KeyEvent.KEYCODE_BUTTON_L1:
if (tabSwitchingEnabled && count > 1) {
TabModelUtils.setIndex(curModel, (curModel.index() + count - 1) % count);
}
return true;
case CTRL | KeyEvent.KEYCODE_W:
case CTRL | KeyEvent.KEYCODE_F4:
case KeyEvent.KEYCODE_BUTTON_B:
TabModelUtils.closeCurrentTab(curModel);
return true;
case CTRL | KeyEvent.KEYCODE_F:
case CTRL | KeyEvent.KEYCODE_G:
case CTRL | SHIFT | KeyEvent.KEYCODE_G:
case KeyEvent.KEYCODE_F3:
case SHIFT | KeyEvent.KEYCODE_F3:
activity.onMenuOrKeyboardAction(R.id.find_in_page_id, false);
return true;
case CTRL | KeyEvent.KEYCODE_L:
case ALT | KeyEvent.KEYCODE_D:
case KeyEvent.KEYCODE_BUTTON_X:
activity.onMenuOrKeyboardAction(R.id.focus_url_bar, false);
return true;
case CTRL | SHIFT | KeyEvent.KEYCODE_B:
activity.onMenuOrKeyboardAction(R.id.all_bookmarks_menu_id, false);
return true;
case KeyEvent.KEYCODE_BOOKMARK:
case CTRL | KeyEvent.KEYCODE_D:
activity.onMenuOrKeyboardAction(R.id.bookmark_this_page_id, false);
return true;
case CTRL | KeyEvent.KEYCODE_H:
activity.onMenuOrKeyboardAction(R.id.open_history_menu_id, false);
return true;
case CTRL | KeyEvent.KEYCODE_P:
activity.onMenuOrKeyboardAction(R.id.print_id, false);
return true;
case CTRL | KeyEvent.KEYCODE_PLUS:
case CTRL | KeyEvent.KEYCODE_EQUALS:
case CTRL | SHIFT | KeyEvent.KEYCODE_PLUS:
case CTRL | SHIFT | KeyEvent.KEYCODE_EQUALS:
case KeyEvent.KEYCODE_ZOOM_IN:
ContentViewCore cvc = activity.getCurrentContentViewCore();
if (cvc != null) cvc.zoomIn();
return true;
case CTRL | KeyEvent.KEYCODE_MINUS:
case KeyEvent.KEYCODE_ZOOM_OUT:
cvc = activity.getCurrentContentViewCore();
if (cvc != null) cvc.zoomOut();
return true;
case CTRL | KeyEvent.KEYCODE_0:
cvc = activity.getCurrentContentViewCore();
if (cvc != null) cvc.zoomReset();
return true;
case SHIFT | CTRL | KeyEvent.KEYCODE_R:
case CTRL | KeyEvent.KEYCODE_R:
case SHIFT | KeyEvent.KEYCODE_F5:
case KeyEvent.KEYCODE_F5:
Tab tab = activity.getActivityTab();
if (tab != null) {
if ((keyCodeAndMeta & SHIFT) == SHIFT) {
tab.reloadIgnoringCache();
} else {
tab.reload();
}
if (activity.getToolbarManager() != null
&& tab.getWebContents() != null
&& tab.getWebContents().focusLocationBarByDefault()) {
activity.getToolbarManager().revertLocationBarChanges();
} else {
tab.requestFocus();
}
}
return true;
case ALT | KeyEvent.KEYCODE_DPAD_LEFT:
tab = activity.getActivityTab();
if (tab != null && tab.canGoBack()) tab.goBack();
return true;
case ALT | KeyEvent.KEYCODE_DPAD_RIGHT:
case KeyEvent.KEYCODE_FORWARD:
case KeyEvent.KEYCODE_BUTTON_START:
tab = activity.getActivityTab();
if (tab != null && tab.canGoForward()) tab.goForward();
return true;
case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+?
activity.onMenuOrKeyboardAction(R.id.help_id, false);
return true;
}
}
return false;
}
|
static boolean function(KeyEvent event, ChromeActivity activity, boolean isCurrentTabVisible, boolean tabSwitchingEnabled) { int keyCode = event.getKeyCode(); if (event.getRepeatCount() != 0 KeyEvent.isModifierKey(keyCode)) return false; if (KeyEvent.isGamepadButton(keyCode)) { if (isGamepadAPIActive(activity)) return false; } else if (!event.isCtrlPressed() && !event.isAltPressed() && keyCode != KeyEvent.KEYCODE_F3 && keyCode != KeyEvent.KEYCODE_F5 && keyCode != KeyEvent.KEYCODE_F10 && keyCode != KeyEvent.KEYCODE_FORWARD) { return false; } TabModel curModel = activity.getCurrentTabModel(); int count = curModel.getCount(); int metaState = getMetaState(event); int keyCodeAndMeta = keyCode metaState; switch (keyCodeAndMeta) { case CTRL SHIFT KeyEvent.KEYCODE_T: activity.onMenuOrKeyboardAction(R.id.open_recently_closed_tab, false); return true; case CTRL KeyEvent.KEYCODE_T: activity.onMenuOrKeyboardAction(curModel.isIncognito() ? R.id.new_incognito_tab_menu_id : R.id.new_tab_menu_id, false); return true; case CTRL KeyEvent.KEYCODE_N: activity.onMenuOrKeyboardAction(R.id.new_tab_menu_id, false); return true; case CTRL SHIFT KeyEvent.KEYCODE_N: activity.onMenuOrKeyboardAction(R.id.new_incognito_tab_menu_id, false); return true; case ALT KeyEvent.KEYCODE_E: case ALT KeyEvent.KEYCODE_F: case KeyEvent.KEYCODE_F10: case KeyEvent.KEYCODE_BUTTON_Y: activity.onMenuOrKeyboardAction(R.id.show_menu, false); return true; } if (isCurrentTabVisible) { if (tabSwitchingEnabled && (metaState == CTRL metaState == ALT)) { int numCode = keyCode - KeyEvent.KEYCODE_0; if (numCode > 0 && numCode <= Math.min(count, 8)) { TabModelUtils.setIndex(curModel, numCode - 1); return true; } else if (numCode == 9 && count != 0) { TabModelUtils.setIndex(curModel, count - 1); return true; } } switch (keyCodeAndMeta) { case CTRL KeyEvent.KEYCODE_TAB: case CTRL KeyEvent.KEYCODE_PAGE_DOWN: case KeyEvent.KEYCODE_BUTTON_R1: if (tabSwitchingEnabled && count > 1) { TabModelUtils.setIndex(curModel, (curModel.index() + 1) % count); } return true; case CTRL SHIFT KeyEvent.KEYCODE_TAB: case CTRL KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_BUTTON_L1: if (tabSwitchingEnabled && count > 1) { TabModelUtils.setIndex(curModel, (curModel.index() + count - 1) % count); } return true; case CTRL KeyEvent.KEYCODE_W: case CTRL KeyEvent.KEYCODE_F4: case KeyEvent.KEYCODE_BUTTON_B: TabModelUtils.closeCurrentTab(curModel); return true; case CTRL KeyEvent.KEYCODE_F: case CTRL KeyEvent.KEYCODE_G: case CTRL SHIFT KeyEvent.KEYCODE_G: case KeyEvent.KEYCODE_F3: case SHIFT KeyEvent.KEYCODE_F3: activity.onMenuOrKeyboardAction(R.id.find_in_page_id, false); return true; case CTRL KeyEvent.KEYCODE_L: case ALT KeyEvent.KEYCODE_D: case KeyEvent.KEYCODE_BUTTON_X: activity.onMenuOrKeyboardAction(R.id.focus_url_bar, false); return true; case CTRL SHIFT KeyEvent.KEYCODE_B: activity.onMenuOrKeyboardAction(R.id.all_bookmarks_menu_id, false); return true; case KeyEvent.KEYCODE_BOOKMARK: case CTRL KeyEvent.KEYCODE_D: activity.onMenuOrKeyboardAction(R.id.bookmark_this_page_id, false); return true; case CTRL KeyEvent.KEYCODE_H: activity.onMenuOrKeyboardAction(R.id.open_history_menu_id, false); return true; case CTRL KeyEvent.KEYCODE_P: activity.onMenuOrKeyboardAction(R.id.print_id, false); return true; case CTRL KeyEvent.KEYCODE_PLUS: case CTRL KeyEvent.KEYCODE_EQUALS: case CTRL SHIFT KeyEvent.KEYCODE_PLUS: case CTRL SHIFT KeyEvent.KEYCODE_EQUALS: case KeyEvent.KEYCODE_ZOOM_IN: ContentViewCore cvc = activity.getCurrentContentViewCore(); if (cvc != null) cvc.zoomIn(); return true; case CTRL KeyEvent.KEYCODE_MINUS: case KeyEvent.KEYCODE_ZOOM_OUT: cvc = activity.getCurrentContentViewCore(); if (cvc != null) cvc.zoomOut(); return true; case CTRL KeyEvent.KEYCODE_0: cvc = activity.getCurrentContentViewCore(); if (cvc != null) cvc.zoomReset(); return true; case SHIFT CTRL KeyEvent.KEYCODE_R: case CTRL KeyEvent.KEYCODE_R: case SHIFT KeyEvent.KEYCODE_F5: case KeyEvent.KEYCODE_F5: Tab tab = activity.getActivityTab(); if (tab != null) { if ((keyCodeAndMeta & SHIFT) == SHIFT) { tab.reloadIgnoringCache(); } else { tab.reload(); } if (activity.getToolbarManager() != null && tab.getWebContents() != null && tab.getWebContents().focusLocationBarByDefault()) { activity.getToolbarManager().revertLocationBarChanges(); } else { tab.requestFocus(); } } return true; case ALT KeyEvent.KEYCODE_DPAD_LEFT: tab = activity.getActivityTab(); if (tab != null && tab.canGoBack()) tab.goBack(); return true; case ALT KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_FORWARD: case KeyEvent.KEYCODE_BUTTON_START: tab = activity.getActivityTab(); if (tab != null && tab.canGoForward()) tab.goForward(); return true; case CTRL SHIFT KeyEvent.KEYCODE_SLASH: activity.onMenuOrKeyboardAction(R.id.help_id, false); return true; } } return false; }
|
/**
* This should be called from the Activity's onKeyDown() to handle keyboard shortcuts.
*
* Note: onKeyDown() is called after the active view or web page has had a chance to handle
* the key event. So the keys handled here *can* be overridden by any view or web page.
*
* @param event The KeyEvent to handle.
* @param activity The ChromeActivity in which the key was pressed.
* @param isCurrentTabVisible Whether page-related actions are valid, e.g. reload, zoom in.
* This should be false when in the tab switcher.
* @param tabSwitchingEnabled Whether shortcuts that switch between tabs are enabled (e.g.
* Ctrl+Tab, Ctrl+3).
* @return Whether the key event was handled.
*/
|
This should be called from the Activity's onKeyDown() to handle keyboard shortcuts. Note: onKeyDown() is called after the active view or web page has had a chance to handle the key event. So the keys handled here *can* be overridden by any view or web page
|
onKeyDown
|
{
"repo_name": "danakj/chromium",
"path": "chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java",
"license": "bsd-3-clause",
"size": 12586
}
|
[
"android.view.KeyEvent",
"org.chromium.chrome.browser.tab.Tab",
"org.chromium.chrome.browser.tabmodel.TabModel",
"org.chromium.chrome.browser.tabmodel.TabModelUtils",
"org.chromium.content.browser.ContentViewCore"
] |
import android.view.KeyEvent; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.content.browser.ContentViewCore;
|
import android.view.*; import org.chromium.chrome.browser.tab.*; import org.chromium.chrome.browser.tabmodel.*; import org.chromium.content.browser.*;
|
[
"android.view",
"org.chromium.chrome",
"org.chromium.content"
] |
android.view; org.chromium.chrome; org.chromium.content;
| 977,447
|
public static JavaScriptReferenceHeaderItem forReference(ResourceReference reference,
String id)
{
return forReference(reference, null, id);
}
|
static JavaScriptReferenceHeaderItem function(ResourceReference reference, String id) { return forReference(reference, null, id); }
|
/**
* Creates a {@link JavaScriptReferenceHeaderItem} for the given reference.
*
* @param reference
* resource reference pointing to the JavaScript resource
* @param id
* id that will be used to filter duplicate reference (it's still filtered by URL
* too)
* @return A newly created {@link JavaScriptReferenceHeaderItem} for the given reference.
*/
|
Creates a <code>JavaScriptReferenceHeaderItem</code> for the given reference
|
forReference
|
{
"repo_name": "mosoft521/wicket",
"path": "wicket-core/src/main/java/org/apache/wicket/markup/head/JavaScriptHeaderItem.java",
"license": "apache-2.0",
"size": 5260
}
|
[
"org.apache.wicket.request.resource.ResourceReference"
] |
import org.apache.wicket.request.resource.ResourceReference;
|
import org.apache.wicket.request.resource.*;
|
[
"org.apache.wicket"
] |
org.apache.wicket;
| 2,873,325
|
public static native void freeBuffer(ByteBuffer buffer);
|
static native void function(ByteBuffer buffer);
|
/**
* This will call posix free to release the inner buffer allocated at {@link #newAlignedBuffer(int, int)}.
*/
|
This will call posix free to release the inner buffer allocated at <code>#newAlignedBuffer(int, int)</code>
|
freeBuffer
|
{
"repo_name": "clebertsuconic/netty",
"path": "transport-native-epoll/src/main/java/io/netty/jni/libaio/LibaioContext.java",
"license": "apache-2.0",
"size": 6517
}
|
[
"java.nio.ByteBuffer"
] |
import java.nio.ByteBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 1,902,244
|
public void testSetPowertypeToNull() throws Exception {
Model.getCoreHelper().setPowertype(elem, types[0]);
Model.getCoreHelper().setPowertype(elem, null);
ThreadHelper.synchronize();
// One can only do this by changing target,
// so let's simulate that:
model.targetSet(new TargetEvent(this,
TargetEvent.TARGET_SET,
new Object[0],
new Object[] {
elem,
}));
ThreadHelper.synchronize();
assertNull(model.getSelectedItem());
}
|
void function() throws Exception { Model.getCoreHelper().setPowertype(elem, types[0]); Model.getCoreHelper().setPowertype(elem, null); ThreadHelper.synchronize(); model.targetSet(new TargetEvent(this, TargetEvent.TARGET_SET, new Object[0], new Object[] { elem, })); ThreadHelper.synchronize(); assertNull(model.getSelectedItem()); }
|
/**
* Test setPowertype() with null argument.
*/
|
Test setPowertype() with null argument
|
testSetPowertypeToNull
|
{
"repo_name": "ckaestne/LEADT",
"path": "workspace/argouml_critics/argouml-app/tests/org/argouml/uml/ui/foundation/core/TestUMLGeneralizationPowertypeComboBoxModel.java",
"license": "gpl-3.0",
"size": 7244
}
|
[
"org.argouml.model.Model",
"org.argouml.ui.targetmanager.TargetEvent",
"org.argouml.util.ThreadHelper"
] |
import org.argouml.model.Model; import org.argouml.ui.targetmanager.TargetEvent; import org.argouml.util.ThreadHelper;
|
import org.argouml.model.*; import org.argouml.ui.targetmanager.*; import org.argouml.util.*;
|
[
"org.argouml.model",
"org.argouml.ui",
"org.argouml.util"
] |
org.argouml.model; org.argouml.ui; org.argouml.util;
| 1,903,675
|
private String parseSipUri(final SipURI uri) {
final StringBuilder sb = new StringBuilder("sip:");
sb.append(uri.getUser()).append("@").append(uri.getHost());
if (uri.getPort() != -1 && uri.getPort() != 5060) {
sb.append(":").append(uri.getPort());
}
return sb.toString();
}
|
String function(final SipURI uri) { final StringBuilder sb = new StringBuilder("sip:"); sb.append(uri.getUser()).append("@").append(uri.getHost()); if (uri.getPort() != -1 && uri.getPort() != 5060) { sb.append(":").append(uri.getPort()); } return sb.toString(); }
|
/**
* Helper to extract SIP URI without any parameters.
*
* @param uri SIP URI
* @return
*/
|
Helper to extract SIP URI without any parameters
|
parseSipUri
|
{
"repo_name": "jonbo372/sipstack",
"path": "sipstack-example/src/main/java/io/sipstack/example/trunking/TrunkingServiceApplicationInstance.java",
"license": "mit",
"size": 30955
}
|
[
"io.pkts.packet.sip.address.SipURI"
] |
import io.pkts.packet.sip.address.SipURI;
|
import io.pkts.packet.sip.address.*;
|
[
"io.pkts.packet"
] |
io.pkts.packet;
| 217,324
|
synchronized boolean createNonExistentDirs(FileContext localFs,
FsPermission perm) {
boolean failed = false;
for (final String dir : localDirs) {
try {
createDir(localFs, new Path(dir), perm);
} catch (IOException e) {
LOG.warn("Unable to create directory " + dir + " error " +
e.getMessage() + ", removing from the list of valid directories.");
localDirs.remove(dir);
errorDirs.add(dir);
numFailures++;
failed = true;
}
}
return !failed;
}
|
synchronized boolean createNonExistentDirs(FileContext localFs, FsPermission perm) { boolean failed = false; for (final String dir : localDirs) { try { createDir(localFs, new Path(dir), perm); } catch (IOException e) { LOG.warn(STR + dir + STR + e.getMessage() + STR); localDirs.remove(dir); errorDirs.add(dir); numFailures++; failed = true; } } return !failed; }
|
/**
* Create any non-existent directories and parent directories, updating the
* list of valid directories if necessary.
* @param localFs local file system to use
* @param perm absolute permissions to use for any directories created
* @return true if there were no errors, false if at least one error occurred
*/
|
Create any non-existent directories and parent directories, updating the list of valid directories if necessary
|
createNonExistentDirs
|
{
"repo_name": "cnfire/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DirectoryCollection.java",
"license": "apache-2.0",
"size": 14374
}
|
[
"java.io.IOException",
"org.apache.hadoop.fs.FileContext",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.fs.permission.FsPermission"
] |
import java.io.IOException; import org.apache.hadoop.fs.FileContext; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission;
|
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.permission.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,533,414
|
public PackageDescr parse(boolean isEditor,
final String source,
final Reader dsl) throws DroolsParserException {
DefaultExpanderResolver resolver = getDefaultResolver(dsl);
final Expander expander = resolver.get( "*", null );
final String expanded = expander.expand( source );
if ( expander.hasErrors() ) {
this.results.addAll( expander.getErrors() );
}
return this.parse(isEditor, expanded);
}
|
PackageDescr function(boolean isEditor, final String source, final Reader dsl) throws DroolsParserException { DefaultExpanderResolver resolver = getDefaultResolver(dsl); final Expander expander = resolver.get( "*", null ); final String expanded = expander.expand( source ); if ( expander.hasErrors() ) { this.results.addAll( expander.getErrors() ); } return this.parse(isEditor, expanded); }
|
/**
* Parse and build a rule package from a DRL source with a domain specific
* language.
*
* @param source
* As Text.
* @param dsl
* @return
* @throws DroolsParserException
*/
|
Parse and build a rule package from a DRL source with a domain specific language
|
parse
|
{
"repo_name": "Buble1981/MyDroolsFork",
"path": "drools-compiler/src/main/java/org/drools/compiler/compiler/DrlParser.java",
"license": "apache-2.0",
"size": 11493
}
|
[
"java.io.Reader",
"org.drools.compiler.lang.Expander",
"org.drools.compiler.lang.descr.PackageDescr",
"org.drools.compiler.lang.dsl.DefaultExpanderResolver"
] |
import java.io.Reader; import org.drools.compiler.lang.Expander; import org.drools.compiler.lang.descr.PackageDescr; import org.drools.compiler.lang.dsl.DefaultExpanderResolver;
|
import java.io.*; import org.drools.compiler.lang.*; import org.drools.compiler.lang.descr.*; import org.drools.compiler.lang.dsl.*;
|
[
"java.io",
"org.drools.compiler"
] |
java.io; org.drools.compiler;
| 119,573
|
public void doAction(Action action) throws AutomateException;
|
void function(Action action) throws AutomateException;
|
/**
* Do the action
*
* @param action
* the action object
* @throws AutomateException
* if there are error
*/
|
Do the action
|
doAction
|
{
"repo_name": "onlychoice/ganger",
"path": "src/main/java/com/netease/automate/master/entity/Entity.java",
"license": "mit",
"size": 482
}
|
[
"com.netease.automate.exception.AutomateException",
"com.netease.automate.master.action.Action"
] |
import com.netease.automate.exception.AutomateException; import com.netease.automate.master.action.Action;
|
import com.netease.automate.exception.*; import com.netease.automate.master.action.*;
|
[
"com.netease.automate"
] |
com.netease.automate;
| 1,522,513
|
private String getIntellijNameForRule(BuildRule rule) {
return Project.getIntellijNameForRule(rule, basePathToAliasMap);
}
/**
* @param rule whose corresponding IntelliJ module name will be returned
* @param basePathToAliasMap may be null if rule is a {@link PrebuiltJarRule}
|
String function(BuildRule rule) { return Project.getIntellijNameForRule(rule, basePathToAliasMap); } /** * @param rule whose corresponding IntelliJ module name will be returned * @param basePathToAliasMap may be null if rule is a {@link PrebuiltJarRule}
|
/**
* Maps a BuildRule to the name of the equivalent IntelliJ library or module.
*/
|
Maps a BuildRule to the name of the equivalent IntelliJ library or module
|
getIntellijNameForRule
|
{
"repo_name": "GerritCodeReview/buck",
"path": "src/com/facebook/buck/command/Project.java",
"license": "apache-2.0",
"size": 42194
}
|
[
"com.facebook.buck.java.PrebuiltJarRule",
"com.facebook.buck.rules.BuildRule"
] |
import com.facebook.buck.java.PrebuiltJarRule; import com.facebook.buck.rules.BuildRule;
|
import com.facebook.buck.java.*; import com.facebook.buck.rules.*;
|
[
"com.facebook.buck"
] |
com.facebook.buck;
| 2,725,835
|
public static TypeMapper getTypeMapper(Class cls) {
synchronized(libraries) {
Class interfaceClass = findEnclosingLibraryClass(cls);
if (interfaceClass != null)
loadLibraryInstance(interfaceClass);
else
interfaceClass = cls;
if (!typeMappers.containsKey(interfaceClass)) {
try {
Field field = interfaceClass.getField("TYPE_MAPPER");
field.setAccessible(true);
typeMappers.put(interfaceClass, field.get(null));
}
catch (NoSuchFieldException e) {
Map options = getLibraryOptions(cls);
if (options != null
&& options.containsKey(Library.OPTION_TYPE_MAPPER)) {
typeMappers.put(interfaceClass, options.get(Library.OPTION_TYPE_MAPPER));
}
}
catch (Exception e) {
throw new IllegalArgumentException("TYPE_MAPPER must be a public field of type "
+ TypeMapper.class.getName() + " ("
+ e + "): " + interfaceClass);
}
}
return (TypeMapper)typeMappers.get(interfaceClass);
}
}
|
static TypeMapper function(Class cls) { synchronized(libraries) { Class interfaceClass = findEnclosingLibraryClass(cls); if (interfaceClass != null) loadLibraryInstance(interfaceClass); else interfaceClass = cls; if (!typeMappers.containsKey(interfaceClass)) { try { Field field = interfaceClass.getField(STR); field.setAccessible(true); typeMappers.put(interfaceClass, field.get(null)); } catch (NoSuchFieldException e) { Map options = getLibraryOptions(cls); if (options != null && options.containsKey(Library.OPTION_TYPE_MAPPER)) { typeMappers.put(interfaceClass, options.get(Library.OPTION_TYPE_MAPPER)); } } catch (Exception e) { throw new IllegalArgumentException(STR + TypeMapper.class.getName() + STR + e + STR + interfaceClass); } } return (TypeMapper)typeMappers.get(interfaceClass); } }
|
/** Return the preferred {@link TypeMapper} for the given native interface.
* See {@link com.sun.jna.Library#OPTION_TYPE_MAPPER}.
*/
|
Return the preferred <code>TypeMapper</code> for the given native interface. See <code>com.sun.jna.Library#OPTION_TYPE_MAPPER</code>
|
getTypeMapper
|
{
"repo_name": "notnoop/jna",
"path": "jnalib/src/com/sun/jna/Native.java",
"license": "lgpl-2.1",
"size": 69605
}
|
[
"java.lang.reflect.Field",
"java.util.Map"
] |
import java.lang.reflect.Field; import java.util.Map;
|
import java.lang.reflect.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 2,201,137
|
//
//
//
private void deleteCollectionObject(CollectionObjectClient collectionObjectClient,
String resourceId) {
collectionObjectClient.delete(resourceId).close();
}
|
void function(CollectionObjectClient collectionObjectClient, String resourceId) { collectionObjectClient.delete(resourceId).close(); }
|
/**
* Delete collection object.
*
* @param collectionObjectClient the collection object client
* @param resourceId the resource id
*/
|
Delete collection object
|
deleteCollectionObject
|
{
"repo_name": "cherryhill/collectionspace-services",
"path": "services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java",
"license": "apache-2.0",
"size": 14507
}
|
[
"org.collectionspace.services.client.CollectionObjectClient"
] |
import org.collectionspace.services.client.CollectionObjectClient;
|
import org.collectionspace.services.client.*;
|
[
"org.collectionspace.services"
] |
org.collectionspace.services;
| 435,282
|
public Iterator<String> iterator () {
return new Iterator<String>() {
private Iterator<Path> iter = paths.iterator();
|
Iterator<String> function () { return new Iterator<String>() { private Iterator<Path> iter = paths.iterator();
|
/**
* Iterates over the absolute paths. The iterator supports the remove method.
*/
|
Iterates over the absolute paths. The iterator supports the remove method
|
iterator
|
{
"repo_name": "damonsmith/js-class-loader",
"path": "js-class-loader/src/main/java/com/esotericsoftware/wildcard/Paths.java",
"license": "apache-2.0",
"size": 14504
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,803,292
|
public synchronized CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> start() throws Exception {
if (serverStarted != null) {
// server already started - don't get it rolling again
return serverStarted;
}
serverStarted = new CompletableFuture<>();
final CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> serverReadyFuture = serverStarted;
try {
final ServerBootstrap b = new ServerBootstrap();
// when high value is reached then the channel becomes non-writable and stays like that until the
// low value is so that there is time to recover
b.childOption(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, settings.writeBufferLowWaterMark);
b.childOption(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, settings.writeBufferHighWaterMark);
b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
// fire off any lifecycle scripts that were provided by the user. hooks get initialized during
// ServerGremlinExecutor initialization
serverGremlinExecutor.getHooks().forEach(hook -> {
logger.info("Executing start up {}", LifeCycleHook.class.getSimpleName());
try {
hook.onStartUp(new LifeCycleHook.Context(logger));
} catch (UnsupportedOperationException uoe) {
// if the user doesn't implement onStartUp the scriptengine will throw
// this exception. it can safely be ignored.
}
});
final Channelizer channelizer = createChannelizer(settings);
channelizer.init(serverGremlinExecutor);
b.group(bossGroup, workerGroup)
.childHandler(channelizer);
if(isEpollEnabled){
b.channel(EpollServerSocketChannel.class);
} else{
b.channel(NioServerSocketChannel.class);
}
|
synchronized CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> function() throws Exception { if (serverStarted != null) { return serverStarted; } serverStarted = new CompletableFuture<>(); final CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> serverReadyFuture = serverStarted; try { final ServerBootstrap b = new ServerBootstrap(); b.childOption(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, settings.writeBufferLowWaterMark); b.childOption(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, settings.writeBufferHighWaterMark); b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); serverGremlinExecutor.getHooks().forEach(hook -> { logger.info(STR, LifeCycleHook.class.getSimpleName()); try { hook.onStartUp(new LifeCycleHook.Context(logger)); } catch (UnsupportedOperationException uoe) { } }); final Channelizer channelizer = createChannelizer(settings); channelizer.init(serverGremlinExecutor); b.group(bossGroup, workerGroup) .childHandler(channelizer); if(isEpollEnabled){ b.channel(EpollServerSocketChannel.class); } else{ b.channel(NioServerSocketChannel.class); }
|
/**
* Start Gremlin Server with {@link Settings} provided to the constructor.
*/
|
Start Gremlin Server with <code>Settings</code> provided to the constructor
|
start
|
{
"repo_name": "dalaro/incubator-tinkerpop",
"path": "gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java",
"license": "apache-2.0",
"size": 17345
}
|
[
"io.netty.bootstrap.ServerBootstrap",
"io.netty.buffer.PooledByteBufAllocator",
"io.netty.channel.ChannelOption",
"io.netty.channel.EventLoopGroup",
"io.netty.channel.epoll.EpollServerSocketChannel",
"io.netty.channel.socket.nio.NioServerSocketChannel",
"java.util.concurrent.CompletableFuture",
"org.apache.tinkerpop.gremlin.server.util.LifeCycleHook",
"org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor"
] |
import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.epoll.EpollServerSocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import java.util.concurrent.CompletableFuture; import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook; import org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor;
|
import io.netty.bootstrap.*; import io.netty.buffer.*; import io.netty.channel.*; import io.netty.channel.epoll.*; import io.netty.channel.socket.nio.*; import java.util.concurrent.*; import org.apache.tinkerpop.gremlin.server.util.*;
|
[
"io.netty.bootstrap",
"io.netty.buffer",
"io.netty.channel",
"java.util",
"org.apache.tinkerpop"
] |
io.netty.bootstrap; io.netty.buffer; io.netty.channel; java.util; org.apache.tinkerpop;
| 425,279
|
public Builder dayCount(DayCount dayCount) {
JodaBeanUtils.notNull(dayCount, "dayCount");
this.dayCount = dayCount;
return this;
}
|
Builder function(DayCount dayCount) { JodaBeanUtils.notNull(dayCount, STR); this.dayCount = dayCount; return this; }
|
/**
* Sets the {@code dayCount} property in the builder.
* @param dayCount the new value, not null
* @return this, for chaining, not null
*/
|
Sets the dayCount property in the builder
|
dayCount
|
{
"repo_name": "OpenGamma/OG-Commons",
"path": "modules/basics/src/main/java/com/opengamma/basics/index/ImmutableOvernightIndex.java",
"license": "apache-2.0",
"size": 24238
}
|
[
"com.opengamma.basics.date.DayCount",
"org.joda.beans.JodaBeanUtils"
] |
import com.opengamma.basics.date.DayCount; import org.joda.beans.JodaBeanUtils;
|
import com.opengamma.basics.date.*; import org.joda.beans.*;
|
[
"com.opengamma.basics",
"org.joda.beans"
] |
com.opengamma.basics; org.joda.beans;
| 193,278
|
public void restoreBinding(ContextModel contextModel) {
BindingElement element = (BindingElement) getSelectedElement();
if (element == null) {
return;
}
restoreBinding(element);
refresh(contextModel);
Object obj = element.getModelObject();
ParameterizedCommand cmd = null;
if (obj instanceof ParameterizedCommand) {
cmd = (ParameterizedCommand) obj;
} else if (obj instanceof KeyBinding) {
cmd = ((KeyBinding) obj).getParameterizedCommand();
}
boolean done = false;
Iterator i = bindingElements.iterator();
// Reselects the command
while (i.hasNext() && !done) {
BindingElement be = (BindingElement) i.next();
obj = be.getModelObject();
ParameterizedCommand pcmd = null;
if (obj instanceof ParameterizedCommand) {
pcmd = (ParameterizedCommand) obj;
} else if (obj instanceof KeyBinding) {
pcmd = ((KeyBinding) obj).getParameterizedCommand();
}
if (cmd.equals(pcmd)) {
done = true;
setSelectedElement(be);
}
}
}
|
void function(ContextModel contextModel) { BindingElement element = (BindingElement) getSelectedElement(); if (element == null) { return; } restoreBinding(element); refresh(contextModel); Object obj = element.getModelObject(); ParameterizedCommand cmd = null; if (obj instanceof ParameterizedCommand) { cmd = (ParameterizedCommand) obj; } else if (obj instanceof KeyBinding) { cmd = ((KeyBinding) obj).getParameterizedCommand(); } boolean done = false; Iterator i = bindingElements.iterator(); while (i.hasNext() && !done) { BindingElement be = (BindingElement) i.next(); obj = be.getModelObject(); ParameterizedCommand pcmd = null; if (obj instanceof ParameterizedCommand) { pcmd = (ParameterizedCommand) obj; } else if (obj instanceof KeyBinding) { pcmd = ((KeyBinding) obj).getParameterizedCommand(); } if (cmd.equals(pcmd)) { done = true; setSelectedElement(be); } } }
|
/**
* Restores the currently selected binding.
* @param contextModel
*/
|
Restores the currently selected binding
|
restoreBinding
|
{
"repo_name": "heartsome/tmxeditor8",
"path": "te/net.heartsome.cat.te.ui/src/net/heartsome/cat/te/ui/preferencepage/key/BindingModel2.java",
"license": "gpl-2.0",
"size": 14836
}
|
[
"java.util.Iterator",
"org.eclipse.core.commands.ParameterizedCommand",
"org.eclipse.jface.bindings.keys.KeyBinding",
"org.eclipse.ui.internal.keys.model.BindingElement",
"org.eclipse.ui.internal.keys.model.ContextModel"
] |
import java.util.Iterator; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.jface.bindings.keys.KeyBinding; import org.eclipse.ui.internal.keys.model.BindingElement; import org.eclipse.ui.internal.keys.model.ContextModel;
|
import java.util.*; import org.eclipse.core.commands.*; import org.eclipse.jface.bindings.keys.*; import org.eclipse.ui.internal.keys.model.*;
|
[
"java.util",
"org.eclipse.core",
"org.eclipse.jface",
"org.eclipse.ui"
] |
java.util; org.eclipse.core; org.eclipse.jface; org.eclipse.ui;
| 2,652,963
|
@Override
public POS getMostLikleyPOS(String word) {
WordnetStemmer stemmer = null;
synchronized(dictionary) {
stemmer = new WordnetStemmer(dictionary);
}
int maxCount = -1;
edu.mit.jwi.item.POS mostLikelyPOS = null;
for(edu.mit.jwi.item.POS pos : edu.mit.jwi.item.POS.values()) {
//From JavaDoc: The surface form may or may not contain whitespace or underscores, and may be in mixed case.
word = word.replaceAll("\\s", "").replaceAll("_", "");
List<String> stems = null;
synchronized(dictionary) {
stems = stemmer.findStems(word, pos);
}
for(String stem : stems) {
synchronized(dictionary) {
IIndexWord indexWord = dictionary.getIndexWord(stem, pos);
if(indexWord!=null) {
int count = 0;
for(IWordID wordId : indexWord.getWordIDs()) {
IWord aWord = dictionary.getWord(wordId);
//ISynset synset = aWord.getSynset();
//log(LogLevel.DEBUG, synset.getGloss());
ISenseEntry senseEntry = dictionary.getSenseEntry(aWord.getSenseKey());
//log(LogLevel.DEBUG, senseEntry.getSenseNumber());
count += senseEntry.getTagCount();
}
//int tagSenseCount = indexWord.getTagSenseCount();
//int wordIdCount = indexWord.getWordIDs().size();
if(count > maxCount) {
maxCount = count;
mostLikelyPOS = pos;
}
}
}
}
}
return translateWordNetPOSToPennPOS(mostLikelyPOS);
}
|
POS function(String word) { WordnetStemmer stemmer = null; synchronized(dictionary) { stemmer = new WordnetStemmer(dictionary); } int maxCount = -1; edu.mit.jwi.item.POS mostLikelyPOS = null; for(edu.mit.jwi.item.POS pos : edu.mit.jwi.item.POS.values()) { word = word.replaceAll("\\s", STR_STR"); List<String> stems = null; synchronized(dictionary) { stems = stemmer.findStems(word, pos); } for(String stem : stems) { synchronized(dictionary) { IIndexWord indexWord = dictionary.getIndexWord(stem, pos); if(indexWord!=null) { int count = 0; for(IWordID wordId : indexWord.getWordIDs()) { IWord aWord = dictionary.getWord(wordId); ISenseEntry senseEntry = dictionary.getSenseEntry(aWord.getSenseKey()); count += senseEntry.getTagCount(); } if(count > maxCount) { maxCount = count; mostLikelyPOS = pos; } } } } } return translateWordNetPOSToPennPOS(mostLikelyPOS); }
|
/**
* Needs to be synchronized, otherwise not thread safe. Underlying linkedHashMap throws ConcurrentModificationException
*/
|
Needs to be synchronized, otherwise not thread safe. Underlying linkedHashMap throws ConcurrentModificationException
|
getMostLikleyPOS
|
{
"repo_name": "dongyemeng/charaparser-unsupervised",
"path": "src/main/java/semanticMarkup/know/lib/WordNetPOSKnowledgeBase.java",
"license": "mit",
"size": 7159
}
|
[
"edu.mit.jwi.item.IIndexWord",
"edu.mit.jwi.item.ISenseEntry",
"edu.mit.jwi.item.IWord",
"edu.mit.jwi.item.IWordID",
"edu.mit.jwi.morph.WordnetStemmer",
"java.util.List"
] |
import edu.mit.jwi.item.IIndexWord; import edu.mit.jwi.item.ISenseEntry; import edu.mit.jwi.item.IWord; import edu.mit.jwi.item.IWordID; import edu.mit.jwi.morph.WordnetStemmer; import java.util.List;
|
import edu.mit.jwi.item.*; import edu.mit.jwi.morph.*; import java.util.*;
|
[
"edu.mit.jwi",
"java.util"
] |
edu.mit.jwi; java.util;
| 2,369,935
|
OpenCmsTestProperties.initialize(org.opencms.test.AllTests.TEST_PROPERTIES_PATH);
TestSuite suite = new TestSuite();
suite.setName(TestCmsSiteConfiguration.class.getName());
suite.addTest(new TestCmsSiteConfiguration("testSiteConfiguration"));
TestSetup wrapper = new TestSetup(suite) {
|
OpenCmsTestProperties.initialize(org.opencms.test.AllTests.TEST_PROPERTIES_PATH); TestSuite suite = new TestSuite(); suite.setName(TestCmsSiteConfiguration.class.getName()); suite.addTest(new TestCmsSiteConfiguration(STR)); TestSetup wrapper = new TestSetup(suite) {
|
/**
* Test suite for this test class.<p>
*
* @return the test suite
*/
|
Test suite for this test class
|
suite
|
{
"repo_name": "mediaworx/opencms-core",
"path": "test/org/opencms/site/TestCmsSiteConfiguration.java",
"license": "lgpl-2.1",
"size": 3809
}
|
[
"junit.extensions.TestSetup",
"junit.framework.TestSuite",
"org.opencms.test.OpenCmsTestProperties"
] |
import junit.extensions.TestSetup; import junit.framework.TestSuite; import org.opencms.test.OpenCmsTestProperties;
|
import junit.extensions.*; import junit.framework.*; import org.opencms.test.*;
|
[
"junit.extensions",
"junit.framework",
"org.opencms.test"
] |
junit.extensions; junit.framework; org.opencms.test;
| 565,399
|
private static String getResourcePath(String resourcePath) {
return Paths.get(".", resourcePath).toAbsolutePath().toString();
}
|
static String function(String resourcePath) { return Paths.get(".", resourcePath).toAbsolutePath().toString(); }
|
/**
* Returns full path to the required resource. Working directory will be used.
* @param resourcePath Relative resource path.
* @return Full path to the required resource.
*/
|
Returns full path to the required resource. Working directory will be used
|
getResourcePath
|
{
"repo_name": "expanset/expanset",
"path": "samples/samples-getting-started/src/main/java/com/expanset/samples/getstart/App.java",
"license": "apache-2.0",
"size": 3413
}
|
[
"java.nio.file.Paths"
] |
import java.nio.file.Paths;
|
import java.nio.file.*;
|
[
"java.nio"
] |
java.nio;
| 235,607
|
@Test
public void marker() {
InfoSerDe.checkRestore(
OperatorSpec.class,
MarkerOperatorSpec.get());
}
|
void function() { InfoSerDe.checkRestore( OperatorSpec.class, MarkerOperatorSpec.get()); }
|
/**
* marker operators.
*/
|
marker operators
|
marker
|
{
"repo_name": "akirakw/asakusafw",
"path": "info/model/src/test/java/com/asakusafw/info/operator/OperatorSpecTest.java",
"license": "apache-2.0",
"size": 4147
}
|
[
"com.asakusafw.info.InfoSerDe"
] |
import com.asakusafw.info.InfoSerDe;
|
import com.asakusafw.info.*;
|
[
"com.asakusafw.info"
] |
com.asakusafw.info;
| 2,859,816
|
public String getSignature(String verb, String url, RequestParams params, String body)
throws UnsupportedEncodingException, URISyntaxException, SignatureException {
// Add the params to the existing query string arguments, or add as new
String separator = url.contains("?") ? "&" : "?";
url += separator + params.toString();
return getSignature(verb, url, body.getBytes("UTF-8"));
}
|
String function(String verb, String url, RequestParams params, String body) throws UnsupportedEncodingException, URISyntaxException, SignatureException { String separator = url.contains("?") ? "&" : "?"; url += separator + params.toString(); return getSignature(verb, url, body.getBytes("UTF-8")); }
|
/**
* All api calls are required to be signed using HMAC based on the request
* string: {Http Verb}\n{host}\n{path}\n{k=v...}{body} where the query
* parameters are byte ordered
* <p>
* This assumes that the URL has been constructed with the access key and
* the timestamp already appended.
*/
|
All api calls are required to be signed using HMAC based on the request string: {Http Verb}\n{host}\n{path}\n{k=v...}{body} where the query parameters are byte ordered This assumes that the URL has been constructed with the access key and the timestamp already appended
|
getSignature
|
{
"repo_name": "maurizi/otm-android",
"path": "OpenTreeMap/src/main/java/org/azavea/otm/rest/RequestSignature.java",
"license": "agpl-3.0",
"size": 5081
}
|
[
"com.loopj.android.http.RequestParams",
"java.io.UnsupportedEncodingException",
"java.net.URISyntaxException",
"java.security.SignatureException"
] |
import com.loopj.android.http.RequestParams; import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.security.SignatureException;
|
import com.loopj.android.http.*; import java.io.*; import java.net.*; import java.security.*;
|
[
"com.loopj.android",
"java.io",
"java.net",
"java.security"
] |
com.loopj.android; java.io; java.net; java.security;
| 1,275,821
|
public void close() throws IOException {
if (!bEof) {
bEof = true;
if (in != null) {
in.close();
in = null;
}
if (out != null) {
out.close();
out = null;
}
if (reader != null) {
consumed = reader.pbin.getConsumed() - startOffset;
reader.consumed += consumed;
reader = null;
}
if (writer != null) {
writer = null;
}
}
}
|
void function() throws IOException { if (!bEof) { bEof = true; if (in != null) { in.close(); in = null; } if (out != null) { out.close(); out = null; } if (reader != null) { consumed = reader.pbin.getConsumed() - startOffset; reader.consumed += consumed; reader = null; } if (writer != null) { writer = null; } } }
|
/**
* Release resources associated with this record.
* @throws IOException if an i/o error occurs while closing entry
*/
|
Release resources associated with this record
|
close
|
{
"repo_name": "kris-sigur/jwat",
"path": "jwat-gzip/src/main/java/org/jwat/gzip/GzipEntry.java",
"license": "apache-2.0",
"size": 7996
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 691,926
|
private void requireScannerOwner(InternalScanner s) throws AccessDeniedException {
if (!RpcServer.isInRpcCallContext())
return;
String requestUName = RpcServer.getRequestUserName();
String owner = scannerOwners.get(s);
if (authorizationEnabled && owner != null && !owner.equals(requestUName)) {
throw new AccessDeniedException("User '" + requestUName + "' is not the scanner owner!");
}
}
|
void function(InternalScanner s) throws AccessDeniedException { if (!RpcServer.isInRpcCallContext()) return; String requestUName = RpcServer.getRequestUserName(); String owner = scannerOwners.get(s); if (authorizationEnabled && owner != null && !owner.equals(requestUName)) { throw new AccessDeniedException(STR + requestUName + STR); } }
|
/**
* Verify, when servicing an RPC, that the caller is the scanner owner. If so, we assume that
* access control is correctly enforced based on the checks performed in preScannerOpen()
*/
|
Verify, when servicing an RPC, that the caller is the scanner owner. If so, we assume that access control is correctly enforced based on the checks performed in preScannerOpen()
|
requireScannerOwner
|
{
"repo_name": "juwi/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java",
"license": "apache-2.0",
"size": 46912
}
|
[
"org.apache.hadoop.hbase.ipc.RpcServer",
"org.apache.hadoop.hbase.regionserver.InternalScanner",
"org.apache.hadoop.hbase.security.AccessDeniedException"
] |
import org.apache.hadoop.hbase.ipc.RpcServer; import org.apache.hadoop.hbase.regionserver.InternalScanner; import org.apache.hadoop.hbase.security.AccessDeniedException;
|
import org.apache.hadoop.hbase.ipc.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.security.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,997,702
|
private void setDefaultPrompt() {
this.defaultPrompt = format("[{0}/cash]$ ", env);
}
private static class Options {
private ConcourseClientPreferences prefs = null;
{
String file = System.getProperty("user.home") + File.separator
+ "concourse_client.prefs";
if(Files.exists(Paths.get(file))) { // check to make sure that the
// file exists first, so we
// don't create a blank one if
// it doesn't
prefs = ConcourseClientPreferences.load(file);
}
}
@Parameter(names = { "-e", "--environment" }, description = "The environment of the Concourse Server to use")
public String environment = prefs != null ? prefs.getEnvironment() : "";
@Parameter(names = "--help", help = true, hidden = true)
public boolean help;
@Parameter(names = { "-h", "--host" }, description = "The hostname where the Concourse Server is located")
public String host = prefs != null ? prefs.getHost() : "localhost";
@Parameter(names = "--password", description = "The password", password = false, hidden = true)
public String password = prefs != null ? new String(prefs.getPassword())
: null;
@Parameter(names = { "-p", "--port" }, description = "The port on which the Concourse Server is listening")
public int port = prefs != null ? prefs.getPort() : 1717;
@Parameter(names = { "-r", "--run" }, description = "The command to run non-interactively")
public String run = "";
@Parameter(names = { "-u", "--username" }, description = "The username with which to connect")
public String username = prefs != null ? prefs.getUsername() : "admin";
@Parameter(names = { "--run-commands", "--rc" }, description = "Path to a script that contains commands to run when the shell starts")
public String ext = FileOps.getUserHome() + "/.cashrc";
@Parameter(names = { "--no-run-commands", "--no-rc" }, description = "A flag to disable loading any run commands file")
public boolean ignoreRunCommands = false;
}
private enum Showable {
RECORDS;
|
void function() { this.defaultPrompt = format(STR, env); } private static class Options { private ConcourseClientPreferences prefs = null; { String file = System.getProperty(STR) + File.separator + STR; if(Files.exists(Paths.get(file))) { prefs = ConcourseClientPreferences.load(file); } } @Parameter(names = { "-e", STR }, description = STR) public String environment = prefs != null ? prefs.getEnvironment() : STR--helpSTR-hSTR--hostSTRThe hostname where the Concourse Server is locatedSTRlocalhostSTR--passwordSTRThe passwordSTR-pSTR--portSTRThe port on which the Concourse Server is listeningSTR-rSTR--runSTRThe command to run non-interactivelySTRSTR-uSTR--usernameSTRThe username with which to connectSTRadminSTR--run-commandsSTR--rcSTRPath to a script that contains commands to run when the shell startsSTR/.cashrcSTR--no-run-commandsSTR--no-rcSTRA flag to disable loading any run commands file") public boolean ignoreRunCommands = false; } private enum Showable { RECORDS;
|
/**
* Set the {@link #defaultPrompt} variable to account for the current
* {@link #env}.
*/
|
Set the <code>#defaultPrompt</code> variable to account for the current <code>#env</code>
|
setDefaultPrompt
|
{
"repo_name": "savanibharat/concourse",
"path": "concourse-shell/src/main/java/org/cinchapi/concourse/shell/ConcourseShell.java",
"license": "apache-2.0",
"size": 28488
}
|
[
"com.beust.jcommander.Parameter",
"java.io.File",
"java.nio.file.Files",
"java.nio.file.Paths",
"java.text.MessageFormat",
"org.cinchapi.concourse.Concourse",
"org.cinchapi.concourse.config.ConcourseClientPreferences"
] |
import com.beust.jcommander.Parameter; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; import java.text.MessageFormat; import org.cinchapi.concourse.Concourse; import org.cinchapi.concourse.config.ConcourseClientPreferences;
|
import com.beust.jcommander.*; import java.io.*; import java.nio.file.*; import java.text.*; import org.cinchapi.concourse.*; import org.cinchapi.concourse.config.*;
|
[
"com.beust.jcommander",
"java.io",
"java.nio",
"java.text",
"org.cinchapi.concourse"
] |
com.beust.jcommander; java.io; java.nio; java.text; org.cinchapi.concourse;
| 1,038,711
|
public void addUser(User user) {
try (PreparedStatement statement = this.connection.prepareStatement(this.props.getProperty("add_user"))) {
statement.setString(1, user.getName());
statement.setString(2, user.getLogin());
statement.setString(3, user.getEmail());
statement.setTimestamp(4, user.getCreateDate());
statement.setString(5, user.getPassword());
statement.setString(6, user.getRole().name());
statement.setString(7, user.getCity());
statement.setString(8, user.getCountry());
statement.executeUpdate();
LOGGER.info("User Added");
} catch (SQLException e) {
LOGGER.error("Cannot insert new user", e.fillInStackTrace());
}
}
|
void function(User user) { try (PreparedStatement statement = this.connection.prepareStatement(this.props.getProperty(STR))) { statement.setString(1, user.getName()); statement.setString(2, user.getLogin()); statement.setString(3, user.getEmail()); statement.setTimestamp(4, user.getCreateDate()); statement.setString(5, user.getPassword()); statement.setString(6, user.getRole().name()); statement.setString(7, user.getCity()); statement.setString(8, user.getCountry()); statement.executeUpdate(); LOGGER.info(STR); } catch (SQLException e) { LOGGER.error(STR, e.fillInStackTrace()); } }
|
/**
* Adding new user to db.
* @param user - user to add.
*/
|
Adding new user to db
|
addUser
|
{
"repo_name": "wamdue/agorbunov",
"path": "chapter_009/src/main/java/ru/job4j/crud/model/DBConnection.java",
"license": "apache-2.0",
"size": 11457
}
|
[
"java.sql.PreparedStatement",
"java.sql.SQLException"
] |
import java.sql.PreparedStatement; import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 512,273
|
@Nonnull
public static <T> Observable<T> replay(
@Nonnull final Observable<? extends T> source,
final long timeSpan,
@Nonnull final TimeUnit unit
) {
return replay(source, timeSpan, unit, scheduler());
}
|
@Nonnull static <T> Observable<T> function( @Nonnull final Observable<? extends T> source, final long timeSpan, @Nonnull final TimeUnit unit ) { return replay(source, timeSpan, unit, scheduler()); }
|
/**
* Creates an observable which shares the source observable and replays all source Ts
* to any of the registering observers. After the periodic timespan, the buffer is reset.
* @param <T> the source element type
* @param source the source of Ts
* @param timeSpan the window length
* @param unit the time unit
* @return the new observable
*/
|
Creates an observable which shares the source observable and replays all source Ts to any of the registering observers. After the periodic timespan, the buffer is reset
|
replay
|
{
"repo_name": "akarnokd/reactive4java",
"path": "src/main/java/hu/akarnokd/reactive4java/reactive/Reactive.java",
"license": "apache-2.0",
"size": 367224
}
|
[
"hu.akarnokd.reactive4java.base.Observable",
"java.util.concurrent.TimeUnit",
"javax.annotation.Nonnull"
] |
import hu.akarnokd.reactive4java.base.Observable; import java.util.concurrent.TimeUnit; import javax.annotation.Nonnull;
|
import hu.akarnokd.reactive4java.base.*; import java.util.concurrent.*; import javax.annotation.*;
|
[
"hu.akarnokd.reactive4java",
"java.util",
"javax.annotation"
] |
hu.akarnokd.reactive4java; java.util; javax.annotation;
| 1,803,463
|
@Test
public void testAcceptorSelectorConfigurability() throws Exception {
Configuration conf = new Configuration();
conf.setInt(HttpServer2.HTTP_MAX_THREADS_KEY, MAX_THREADS);
conf.setInt(HttpServer2.HTTP_ACCEPTOR_COUNT_KEY, MAX_THREADS - 2);
conf.setInt(HttpServer2.HTTP_SELECTOR_COUNT_KEY, MAX_THREADS - 2);
HttpServer2 badserver = createTestServer(conf);
try {
badserver.start();
// Should not succeed
fail();
} catch (IOException ioe) {
assertTrue(ioe.getCause() instanceof IllegalStateException);
}
}
|
void function() throws Exception { Configuration conf = new Configuration(); conf.setInt(HttpServer2.HTTP_MAX_THREADS_KEY, MAX_THREADS); conf.setInt(HttpServer2.HTTP_ACCEPTOR_COUNT_KEY, MAX_THREADS - 2); conf.setInt(HttpServer2.HTTP_SELECTOR_COUNT_KEY, MAX_THREADS - 2); HttpServer2 badserver = createTestServer(conf); try { badserver.start(); fail(); } catch (IOException ioe) { assertTrue(ioe.getCause() instanceof IllegalStateException); } }
|
/**
* Test that the number of acceptors and selectors can be configured by
* trying to configure more of them than would be allowed based on the
* maximum thread count.
*/
|
Test that the number of acceptors and selectors can be configured by trying to configure more of them than would be allowed based on the maximum thread count
|
testAcceptorSelectorConfigurability
|
{
"repo_name": "apurtell/hadoop",
"path": "hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java",
"license": "apache-2.0",
"size": 31707
}
|
[
"java.io.IOException",
"org.apache.hadoop.conf.Configuration"
] |
import java.io.IOException; import org.apache.hadoop.conf.Configuration;
|
import java.io.*; import org.apache.hadoop.conf.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,105,370
|
void processResult(JsonNode response);
|
void processResult(JsonNode response);
|
/**
* Processes result from ovsdb.
*
* @param response JsonNode response from ovsdb
*/
|
Processes result from ovsdb
|
processResult
|
{
"repo_name": "sonu283304/onos",
"path": "protocols/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/driver/OvsdbProviderService.java",
"license": "apache-2.0",
"size": 2107
}
|
[
"com.fasterxml.jackson.databind.JsonNode"
] |
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.*;
|
[
"com.fasterxml.jackson"
] |
com.fasterxml.jackson;
| 2,712,145
|
ClassResolver getClassResolver();
|
ClassResolver getClassResolver();
|
/**
* Returns the class resolver to be used for loading/lookup of classes.
*
* @return the resolver
*/
|
Returns the class resolver to be used for loading/lookup of classes
|
getClassResolver
|
{
"repo_name": "curso007/camel",
"path": "camel-core/src/main/java/org/apache/camel/CamelContext.java",
"license": "apache-2.0",
"size": 79052
}
|
[
"org.apache.camel.spi.ClassResolver"
] |
import org.apache.camel.spi.ClassResolver;
|
import org.apache.camel.spi.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 686,566
|
public EditType getEditType() {
return editType;
}
|
EditType function() { return editType; }
|
/**
* Get the editType
*
* @return the editType
*/
|
Get the editType
|
getEditType
|
{
"repo_name": "arkraft/jenkins-java",
"path": "src/main/java/de/arkraft/jenkins/entities/AffectedFile.java",
"license": "apache-2.0",
"size": 1537
}
|
[
"de.arkraft.jenkins.enums.EditType"
] |
import de.arkraft.jenkins.enums.EditType;
|
import de.arkraft.jenkins.enums.*;
|
[
"de.arkraft.jenkins"
] |
de.arkraft.jenkins;
| 1,320,862
|
private void scrollPathToVisibleVerticalOnly(TreePath treePath) {
if (treePath != null) {
makeVisible(treePath);
Rectangle pathBounds = getPathBounds(treePath);
if (pathBounds != null) {
pathBounds.x = 0;
scrollRectToVisible(pathBounds);
}
}
}
|
void function(TreePath treePath) { if (treePath != null) { makeVisible(treePath); Rectangle pathBounds = getPathBounds(treePath); if (pathBounds != null) { pathBounds.x = 0; scrollRectToVisible(pathBounds); } } }
|
/**
* This method will vertically scroll to the requested treePath, but without touching a horizontal scroll-bar
*
* @param treePath
* - TreePath to be vertically scrolled to
*/
|
This method will vertically scroll to the requested treePath, but without touching a horizontal scroll-bar
|
scrollPathToVisibleVerticalOnly
|
{
"repo_name": "bh4017/mobac",
"path": "src/main/java/mobac/gui/components/JMapSourceTree.java",
"license": "gpl-2.0",
"size": 20035
}
|
[
"java.awt.Rectangle",
"javax.swing.tree.TreePath"
] |
import java.awt.Rectangle; import javax.swing.tree.TreePath;
|
import java.awt.*; import javax.swing.tree.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 1,479,089
|
Page<Alarm> findAllDistinctByTimestampBetweenOrderByTimestampDesc(
LocalDateTime startTime, LocalDateTime endTime, Pageable pageable);
|
Page<Alarm> findAllDistinctByTimestampBetweenOrderByTimestampDesc( LocalDateTime startTime, LocalDateTime endTime, Pageable pageable);
|
/**
* Find all historical alarm records for the given time span in descending time order
* @param startTime start time to search for an alarm entry
* @param pageable The requested page
* @return The requested page
*/
|
Find all historical alarm records for the given time span in descending time order
|
findAllDistinctByTimestampBetweenOrderByTimestampDesc
|
{
"repo_name": "c2mon/c2mon-client-ext-history",
"path": "src/main/java/cern/c2mon/client/ext/history/alarm/AlarmHistoryService.java",
"license": "lgpl-3.0",
"size": 10797
}
|
[
"java.time.LocalDateTime",
"org.springframework.data.domain.Page",
"org.springframework.data.domain.Pageable"
] |
import java.time.LocalDateTime; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable;
|
import java.time.*; import org.springframework.data.domain.*;
|
[
"java.time",
"org.springframework.data"
] |
java.time; org.springframework.data;
| 1,992,478
|
public String updateSpaceInst(SpaceInst spaceInstNew) {
SilverTrace.info("admin", "AdminController.updateSpaceInst", "root.MSG_GEN_ENTER_METHOD");
try {
return getAdminService().updateSpaceInst(spaceInstNew);
} catch (Exception e) {
SilverTrace.error("admin", "AdminController.updateSpaceInst", "admin.MSG_ERR_UPDATE_SPACE", e);
return "";
}
}
|
String function(SpaceInst spaceInstNew) { SilverTrace.info("admin", STR, STR); try { return getAdminService().updateSpaceInst(spaceInstNew); } catch (Exception e) { SilverTrace.error("admin", STR, STR, e); return ""; } }
|
/**
* Update the space Instance corresponding to the given space name wuth the given SpaceInst
*/
|
Update the space Instance corresponding to the given space name wuth the given SpaceInst
|
updateSpaceInst
|
{
"repo_name": "stephaneperry/Silverpeas-Core",
"path": "lib-core/src/main/java/com/stratelia/webactiv/beans/admin/AdminController.java",
"license": "agpl-3.0",
"size": 59352
}
|
[
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"com.stratelia.webactiv.beans.admin.AdminReference"
] |
import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.beans.admin.AdminReference;
|
import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.beans.admin.*;
|
[
"com.stratelia.silverpeas",
"com.stratelia.webactiv"
] |
com.stratelia.silverpeas; com.stratelia.webactiv;
| 437,327
|
Page<Topic> searchByTitleAndContent(String searchText, JCommunePageRequest pageRequest);
|
Page<Topic> searchByTitleAndContent(String searchText, JCommunePageRequest pageRequest);
|
/**
* Performs the full-text search by the topic title and
* his content(the list of posts).
*
* @param searchText the search text
* @param pageRequest contains information for pagination: page number, page size
* @return object that contains search results for one page(note, that one page
* may contain all search results) and information for pagination
*/
|
Performs the full-text search by the topic title and his content(the list of posts)
|
searchByTitleAndContent
|
{
"repo_name": "offn/Myrelease",
"path": "jcommune-model/src/main/java/org/jtalks/jcommune/model/dao/search/TopicSearchDao.java",
"license": "lgpl-2.1",
"size": 2011
}
|
[
"org.jtalks.jcommune.model.dto.JCommunePageRequest",
"org.jtalks.jcommune.model.entity.Topic",
"org.springframework.data.domain.Page"
] |
import org.jtalks.jcommune.model.dto.JCommunePageRequest; import org.jtalks.jcommune.model.entity.Topic; import org.springframework.data.domain.Page;
|
import org.jtalks.jcommune.model.dto.*; import org.jtalks.jcommune.model.entity.*; import org.springframework.data.domain.*;
|
[
"org.jtalks.jcommune",
"org.springframework.data"
] |
org.jtalks.jcommune; org.springframework.data;
| 313,389
|
private boolean isSkippable(Exception e)
{
final String mName = "isSkippable";
String exClassName = e.getClass().getName();
boolean retVal = containsSkippable(_skipIncludeExceptions, e) && !containsSkippable(_skipExcludeExceptions, e);
if(logger.isLoggable(Level.FINE))
logger.logp(Level.FINE, className, mName, mName + ": " + retVal + ": " + exClassName);
return retVal;
}
|
boolean function(Exception e) { final String mName = STR; String exClassName = e.getClass().getName(); boolean retVal = containsSkippable(_skipIncludeExceptions, e) && !containsSkippable(_skipExcludeExceptions, e); if(logger.isLoggable(Level.FINE)) logger.logp(Level.FINE, className, mName, mName + STR + retVal + STR + exClassName); return retVal; }
|
/**
* Check the skipCount and skippable exception lists to determine whether
* the given Exception is skippable.
*/
|
Check the skipCount and skippable exception lists to determine whether the given Exception is skippable
|
isSkippable
|
{
"repo_name": "papegaaij/jsr-352",
"path": "JSR352.Runtime/src/com/ibm/jbatch/container/impl/SkipHandler.java",
"license": "apache-2.0",
"size": 11648
}
|
[
"java.util.logging.Level"
] |
import java.util.logging.Level;
|
import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 2,433,657
|
@Override
public void parse(InputStream stream){
this.fis = new BufferedInputStream(stream);
is = fis;
this.cnvBuffer = new byte[4000]; // OSM data should not contain string pairs with length > 512
this.ioBuf = new byte[8192];
this.ioPos = 0;
this.stringPair = new String[2];
this.lastRef = new long[3];
reset();
try {
int start = is.read();
++countBytes;
if (start != RESET_FLAG)
throw new IOException("wrong header byte " + start);
readFile();
} catch (IOException e) {
e.printStackTrace();
}
}
|
void function(InputStream stream){ this.fis = new BufferedInputStream(stream); is = fis; this.cnvBuffer = new byte[4000]; this.ioBuf = new byte[8192]; this.ioPos = 0; this.stringPair = new String[2]; this.lastRef = new long[3]; reset(); try { int start = is.read(); ++countBytes; if (start != RESET_FLAG) throw new IOException(STR + start); readFile(); } catch (IOException e) { e.printStackTrace(); } }
|
/**
* parse the input stream
*/
|
parse the input stream
|
parse
|
{
"repo_name": "openstreetmap/mkgmap",
"path": "src/uk/me/parabola/mkgmap/reader/osm/o5m/O5mBinHandler.java",
"license": "gpl-2.0",
"size": 16644
}
|
[
"java.io.BufferedInputStream",
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 785,888
|
EReference getUpdateValueAction_UpdateableValue();
|
EReference getUpdateValueAction_UpdateableValue();
|
/**
* Returns the meta object for the containment reference '{@link com.thalesgroup.trt.mde.vp.al.al.UpdateValueAction#getUpdateableValue <em>Updateable Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Updateable Value</em>'.
* @see com.thalesgroup.trt.mde.vp.al.al.UpdateValueAction#getUpdateableValue()
* @see #getUpdateValueAction()
* @generated
*/
|
Returns the meta object for the containment reference '<code>com.thalesgroup.trt.mde.vp.al.al.UpdateValueAction#getUpdateableValue Updateable Value</code>'.
|
getUpdateValueAction_UpdateableValue
|
{
"repo_name": "smadelenat/CapellaModeAutomata",
"path": "Language/ActionLanguage/com.thalesgroup.trt.mde.vp.al.model/src/com/thalesgroup/trt/mde/vp/al/al/AlPackage.java",
"license": "epl-1.0",
"size": 119399
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,554,207
|
IgniteCache<Long, Chromosome> cache = ignite.cache(GAGridConstants.POPULATION_CACHE);
StringBuffer sbSqlClause = new StringBuffer();
sbSqlClause.append("_key IN (");
sbSqlClause.append(key);
sbSqlClause.append(")");
Chromosome chromosome = null;
SqlQuery sql = new SqlQuery(Chromosome.class, sbSqlClause.toString());
try (QueryCursor<Entry<Long, Chromosome>> cursor = cache.query(sql)) {
for (Entry<Long, Chromosome> e : cursor)
chromosome = (e.getValue());
}
return chromosome;
}
|
IgniteCache<Long, Chromosome> cache = ignite.cache(GAGridConstants.POPULATION_CACHE); StringBuffer sbSqlClause = new StringBuffer(); sbSqlClause.append(STR); sbSqlClause.append(key); sbSqlClause.append(")"); Chromosome chromosome = null; SqlQuery sql = new SqlQuery(Chromosome.class, sbSqlClause.toString()); try (QueryCursor<Entry<Long, Chromosome>> cursor = cache.query(sql)) { for (Entry<Long, Chromosome> e : cursor) chromosome = (e.getValue()); } return chromosome; }
|
/**
* Retrieve a chromosome.
*
* @param key Primary key of chromosome.
* @return Chromosome.
*/
|
Retrieve a chromosome
|
getChromosome
|
{
"repo_name": "shroman/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java",
"license": "apache-2.0",
"size": 4963
}
|
[
"javax.cache.Cache",
"org.apache.ignite.IgniteCache",
"org.apache.ignite.cache.query.QueryCursor",
"org.apache.ignite.cache.query.SqlQuery",
"org.apache.ignite.ml.genetic.parameter.GAGridConstants"
] |
import javax.cache.Cache; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
|
import javax.cache.*; import org.apache.ignite.*; import org.apache.ignite.cache.query.*; import org.apache.ignite.ml.genetic.parameter.*;
|
[
"javax.cache",
"org.apache.ignite"
] |
javax.cache; org.apache.ignite;
| 1,231,997
|
String extendExpirationForSponsoredMember(PerunSession sess, Member sponsoredMember, User sponsorUser) throws InternalErrorException;
|
String extendExpirationForSponsoredMember(PerunSession sess, Member sponsoredMember, User sponsorUser) throws InternalErrorException;
|
/**
* Extends expiration date. Sponsored members cannot apply for membership extension, this method allows a sponsor to extend it.
*
* @param sess perun session
* @param sponsoredMember member which is sponsored
* @param sponsorUser sponsoring user or null for the caller
* @return new expiration date
* @throws InternalErrorException
*/
|
Extends expiration date. Sponsored members cannot apply for membership extension, this method allows a sponsor to extend it
|
extendExpirationForSponsoredMember
|
{
"repo_name": "stavamichal/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/MembersManagerBl.java",
"license": "bsd-2-clause",
"size": 66169
}
|
[
"cz.metacentrum.perun.core.api.Member",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.User",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException"
] |
import cz.metacentrum.perun.core.api.Member; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
|
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
|
[
"cz.metacentrum.perun"
] |
cz.metacentrum.perun;
| 1,842,890
|
public Instruction getInstruction(int num) {
return instList.get(num);
}
|
Instruction function(int num) { return instList.get(num); }
|
/**
* Gets an instruction by number.
*
* @param num the Instruction index
* @return the Instruction
*/
|
Gets an instruction by number
|
getInstruction
|
{
"repo_name": "pichenettes/ElmGen",
"path": "src/org/andrewkilpatrick/elmGen/ElmProgram.java",
"license": "gpl-3.0",
"size": 25234
}
|
[
"org.andrewkilpatrick.elmGen.instructions.Instruction"
] |
import org.andrewkilpatrick.elmGen.instructions.Instruction;
|
import org.andrewkilpatrick.*;
|
[
"org.andrewkilpatrick"
] |
org.andrewkilpatrick;
| 1,724,218
|
public void unlock(final IgfsFileInfo info, final long modificationTime) throws IgniteCheckedException {
assert validTxState(false);
assert info != null;
if (busyLock.enterBusy()) {
try {
final IgniteUuid lockId = info.lockId();
if (lockId == null)
return;
// Temporary clear interrupted state for unlocking.
final boolean interrupted = Thread.interrupted();
|
void function(final IgfsFileInfo info, final long modificationTime) throws IgniteCheckedException { assert validTxState(false); assert info != null; if (busyLock.enterBusy()) { try { final IgniteUuid lockId = info.lockId(); if (lockId == null) return; final boolean interrupted = Thread.interrupted();
|
/**
* Remove explicit lock on file held by the current thread.
*
* @param info File info to unlock.
* @param modificationTime Modification time to write to file info.
* @throws IgniteCheckedException If failed.
*/
|
Remove explicit lock on file held by the current thread
|
unlock
|
{
"repo_name": "agura/incubator-ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManager.java",
"license": "apache-2.0",
"size": 146888
}
|
[
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.lang.IgniteUuid"
] |
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.lang.IgniteUuid;
|
import org.apache.ignite.*; import org.apache.ignite.lang.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 198,847
|
private boolean commitBlock(final BlockInfo block,
final Block commitBlock) throws IOException {
if (block.getBlockUCState() == BlockUCState.COMMITTED)
return false;
assert block.getNumBytes() <= commitBlock.getNumBytes() :
"commitBlock length is less than the stored one "
+ commitBlock.getNumBytes() + " vs. " + block.getNumBytes();
if(block.getGenerationStamp() != commitBlock.getGenerationStamp()) {
throw new IOException("Commit block with mismatching GS. NN has " +
block + ", client submits " + commitBlock);
}
List<ReplicaUnderConstruction> staleReplicas =
block.commitBlock(commitBlock);
removeStaleReplicas(staleReplicas, block);
return true;
}
|
boolean function(final BlockInfo block, final Block commitBlock) throws IOException { if (block.getBlockUCState() == BlockUCState.COMMITTED) return false; assert block.getNumBytes() <= commitBlock.getNumBytes() : STR + commitBlock.getNumBytes() + STR + block.getNumBytes(); if(block.getGenerationStamp() != commitBlock.getGenerationStamp()) { throw new IOException(STR + block + STR + commitBlock); } List<ReplicaUnderConstruction> staleReplicas = block.commitBlock(commitBlock); removeStaleReplicas(staleReplicas, block); return true; }
|
/**
* Commit a block of a file
*
* @param block block to be committed
* @param commitBlock - contains client reported block length and generation
* @return true if the block is changed to committed state.
* @throws IOException if the block does not have at least a minimal number
* of replicas reported from data-nodes.
*/
|
Commit a block of a file
|
commitBlock
|
{
"repo_name": "huafengw/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java",
"license": "apache-2.0",
"size": 187287
}
|
[
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hdfs.protocol.Block",
"org.apache.hadoop.hdfs.server.common.HdfsServerConstants"
] |
import java.io.IOException; import java.util.List; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.common.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 1,328,376
|
void triggerCandidateChecked(boolean result) {
for (TransportResolverListener.Checker trl : getListenersList()) {
trl.candidateChecked(this, result);
}
}
|
void triggerCandidateChecked(boolean result) { for (TransportResolverListener.Checker trl : getListenersList()) { trl.candidateChecked(this, result); } }
|
/**
* Trigger a new candidate checked event.
*
* @param result The result.
*/
|
Trigger a new candidate checked event
|
triggerCandidateChecked
|
{
"repo_name": "opg7371/Smack",
"path": "smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportCandidate.java",
"license": "apache-2.0",
"size": 25276
}
|
[
"org.jivesoftware.smackx.jingleold.nat.TransportResolverListener"
] |
import org.jivesoftware.smackx.jingleold.nat.TransportResolverListener;
|
import org.jivesoftware.smackx.jingleold.nat.*;
|
[
"org.jivesoftware.smackx"
] |
org.jivesoftware.smackx;
| 1,434,766
|
public InvoiceDocumentType documentType() {
return this.documentType;
}
|
InvoiceDocumentType function() { return this.documentType; }
|
/**
* Get the documentType property: The type of the document.
*
* @return the documentType value.
*/
|
Get the documentType property: The type of the document
|
documentType
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/fluent/models/InvoiceProperties.java",
"license": "mit",
"size": 15301
}
|
[
"com.azure.resourcemanager.billing.models.InvoiceDocumentType"
] |
import com.azure.resourcemanager.billing.models.InvoiceDocumentType;
|
import com.azure.resourcemanager.billing.models.*;
|
[
"com.azure.resourcemanager"
] |
com.azure.resourcemanager;
| 880,547
|
public void onResult(UUID nodeId, Long cnt, boolean removeMapping, @Nullable Throwable err) {
NodeFuture nodeFut = mapFuture(nodeId);
if (nodeFut != null)
nodeFut.onResult(cnt, removeMapping, err);
}
|
void function(UUID nodeId, Long cnt, boolean removeMapping, @Nullable Throwable err) { NodeFuture nodeFut = mapFuture(nodeId); if (nodeFut != null) nodeFut.onResult(cnt, removeMapping, err); }
|
/**
* Process result of query execution on given
* @param nodeId Node id.
* @param cnt Total rows counter on given node.
* @param removeMapping Whether transaction mapping should be removed for node.
* @param err Error.
*/
|
Process result of query execution on given
|
onResult
|
{
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxSelectForUpdateFuture.java",
"license": "apache-2.0",
"size": 14181
}
|
[
"org.jetbrains.annotations.Nullable"
] |
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.*;
|
[
"org.jetbrains.annotations"
] |
org.jetbrains.annotations;
| 189,544
|
final CSVTokenizer tokenizer = new CSVTokenizer( name, false );
if ( tokenizer.hasMoreTokens() == false ) {
return null;
}
final String varName = tokenizer.nextToken();
final StringBuilder b = new StringBuilder( name.length() );
b.append( '{' );
b.append( String.valueOf( fields.size() ) );
while ( tokenizer.hasMoreTokens() ) {
b.append( ',' );
b.append( tokenizer.nextToken() );
}
b.append( '}' );
final String formatString = b.toString();
fields.add( varName );
return formatString;
}
|
final CSVTokenizer tokenizer = new CSVTokenizer( name, false ); if ( tokenizer.hasMoreTokens() == false ) { return null; } final String varName = tokenizer.nextToken(); final StringBuilder b = new StringBuilder( name.length() ); b.append( '{' ); b.append( String.valueOf( fields.size() ) ); while ( tokenizer.hasMoreTokens() ) { b.append( ',' ); b.append( tokenizer.nextToken() ); } b.append( '}' ); final String formatString = b.toString(); fields.add( varName ); return formatString; }
|
/**
* Looks up the property with the given name. This replaces the name with the current index position.
*
* @param name
* the name of the property to look up.
* @return the translated value.
*/
|
Looks up the property with the given name. This replaces the name with the current index position
|
lookupVariable
|
{
"repo_name": "EgorZhuk/pentaho-reporting",
"path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/filter/MessageFormatSupport.java",
"license": "lgpl-2.1",
"size": 10749
}
|
[
"org.pentaho.reporting.libraries.base.util.CSVTokenizer"
] |
import org.pentaho.reporting.libraries.base.util.CSVTokenizer;
|
import org.pentaho.reporting.libraries.base.util.*;
|
[
"org.pentaho.reporting"
] |
org.pentaho.reporting;
| 304,643
|
private void ackAsciiLogo() {
assert log != null;
if (System.getProperty(IGNITE_NO_ASCII) == null) {
String ver = "ver. " + ACK_VER_STR;
// Big thanks to: http://patorjk.com/software/taag
// Font name "Small Slant"
if (log.isInfoEnabled()) {
log.info(NL + NL +
">>> __________ ________________ " + NL +
">>> / _/ ___/ |/ / _/_ __/ __/ " + NL +
">>> _/ // (7 7 // / / / / _/ " + NL +
">>> /___/\\___/_/|_/___/ /_/ /___/ " + NL +
">>> " + NL +
">>> " + ver + NL +
">>> " + COPYRIGHT + NL +
">>> " + NL +
">>> Ignite documentation: " + "http://" + SITE + NL
);
}
if (log.isQuiet()) {
U.quiet(false,
" __________ ________________ ",
" / _/ ___/ |/ / _/_ __/ __/ ",
" _/ // (7 7 // / / / / _/ ",
"/___/\\___/_/|_/___/ /_/ /___/ ",
"",
ver,
COPYRIGHT,
"",
"Ignite documentation: " + "http://" + SITE,
"",
"Quiet mode.");
String fileName = log.fileName();
if (fileName != null)
U.quiet(false, " ^-- Logging to file '" + fileName + '\'');
U.quiet(false,
" ^-- To see **FULL** console log here add -DIGNITE_QUIET=false or \"-v\" to ignite.{sh|bat}",
"");
}
}
}
|
void function() { assert log != null; if (System.getProperty(IGNITE_NO_ASCII) == null) { String ver = STR + ACK_VER_STR; if (log.isInfoEnabled()) { log.info(NL + NL + STR + NL + STR + NL + STR>>> /___/\\___/_/ _/___/ /_/ /___/ STR>>> STR>>> STR>>> STR>>> STR>>> Ignite documentation: STRhttp: ); } if (log.isQuiet()) { U.quiet(false, STR, STR, STR/___/\\___/_/ _/___/ /_/ /___/ STRSTRSTRIgnite documentation: STRhttp: "STRQuiet mode.STR ^-- Logging to file 'STR ^-- To see **FULL** console log here add -DIGNITE_QUIET=false or \"-v\" to ignite.{sh bat}STR"); } } }
|
/**
* Acks ASCII-logo. Thanks to http://patorjk.com/software/taag
*/
|
Acks ASCII-logo. Thanks to HREF
|
ackAsciiLogo
|
{
"repo_name": "VladimirErshov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java",
"license": "apache-2.0",
"size": 111511
}
|
[
"org.apache.ignite.internal.util.typedef.internal.U"
] |
import org.apache.ignite.internal.util.typedef.internal.U;
|
import org.apache.ignite.internal.util.typedef.internal.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 155,513
|
boolean canDeleteComponent(Repository repository, ComponentXO componentXO);
|
boolean canDeleteComponent(Repository repository, ComponentXO componentXO);
|
/**
* Do we have enough permissions to delete this component?
*/
|
Do we have enough permissions to delete this component
|
canDeleteComponent
|
{
"repo_name": "sonatype/nexus-public",
"path": "plugins/nexus-coreui-plugin/src/main/java/org/sonatype/nexus/coreui/ComponentHelper.java",
"license": "epl-1.0",
"size": 2800
}
|
[
"org.sonatype.nexus.repository.Repository"
] |
import org.sonatype.nexus.repository.Repository;
|
import org.sonatype.nexus.repository.*;
|
[
"org.sonatype.nexus"
] |
org.sonatype.nexus;
| 1,746,155
|
public HttpMethod getHttpMethod() {
return httpMethod;
}
|
HttpMethod function() { return httpMethod; }
|
/**
* Get this route HttpMethod action.
*
* @return this route HttpMethod action.
*/
|
Get this route HttpMethod action
|
getHttpMethod
|
{
"repo_name": "torito/wisdom",
"path": "extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/model/ControllerRouteModel.java",
"license": "apache-2.0",
"size": 7642
}
|
[
"org.wisdom.api.http.HttpMethod"
] |
import org.wisdom.api.http.HttpMethod;
|
import org.wisdom.api.http.*;
|
[
"org.wisdom.api"
] |
org.wisdom.api;
| 914,308
|
final List<Rule> rules = new LinkedList<Rule>();
rules.add(new SampleRule(relationName, vocab));
return rules;
}
|
final List<Rule> rules = new LinkedList<Rule>(); rules.add(new SampleRule(relationName, vocab)); return rules; }
|
/**
* Called once by super class during construction of inference program.
*/
|
Called once by super class during construction of inference program
|
getCustomRules
|
{
"repo_name": "smalyshev/blazegraph",
"path": "bigdata-rdf/src/samples/com/bigdata/rdf/rules/SampleClosure.java",
"license": "gpl-2.0",
"size": 732
}
|
[
"com.bigdata.relation.rule.Rule",
"java.util.LinkedList",
"java.util.List"
] |
import com.bigdata.relation.rule.Rule; import java.util.LinkedList; import java.util.List;
|
import com.bigdata.relation.rule.*; import java.util.*;
|
[
"com.bigdata.relation",
"java.util"
] |
com.bigdata.relation; java.util;
| 1,149,173
|
public Short getShortOrNull(int columnIndex) throws SQLException;
|
Short function(int columnIndex) throws SQLException;
|
/**
* Returns <code>null</code> when null, not <code>0</code> as
* JDBC does by default!
*/
|
Returns <code>null</code> when null, not <code>0</code> as JDBC does by default
|
getShortOrNull
|
{
"repo_name": "spincast/spincast-framework",
"path": "spincast-plugins/spincast-plugins-jdbc-parent/spincast-plugins-jdbc/src/main/java/org/spincast/plugins/jdbc/SpincastResultSet.java",
"license": "apache-2.0",
"size": 7942
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,568,648
|
boolean onTouchEvent(MotionEvent event);
|
boolean onTouchEvent(MotionEvent event);
|
/**
* Handling the touch events.
*
* @param event The touch event to be handled.
* @return whether the event is consumed..
*/
|
Handling the touch events
|
onTouchEvent
|
{
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/android/java/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbar.java",
"license": "bsd-3-clause",
"size": 43435
}
|
[
"android.view.MotionEvent"
] |
import android.view.MotionEvent;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 1,581,630
|
@SuppressWarnings("unchecked")
private void proceedMapping0()
throws IgniteCheckedException {
GridNearLockMapping map;
synchronized (this) {
map = mappings.poll();
}
// If there are no more mappings to process, complete the future.
if (map == null)
return;
final GridNearLockRequest req = map.request();
final Collection<KeyCacheObject> mappedKeys = map.distributedKeys();
final ClusterNode node = map.node();
if (filter != null && filter.length != 0)
req.filter(filter, cctx);
if (node.isLocal()) {
req.miniId(-1);
if (log.isDebugEnabled())
log.debug("Before locally locking near request: " + req);
IgniteInternalFuture<GridNearLockResponse> fut = dht().lockAllAsync(cctx, cctx.localNode(), req, filter);
|
@SuppressWarnings(STR) void function() throws IgniteCheckedException { GridNearLockMapping map; synchronized (this) { map = mappings.poll(); } if (map == null) return; final GridNearLockRequest req = map.request(); final Collection<KeyCacheObject> mappedKeys = map.distributedKeys(); final ClusterNode node = map.node(); if (filter != null && filter.length != 0) req.filter(filter, cctx); if (node.isLocal()) { req.miniId(-1); if (log.isDebugEnabled()) log.debug(STR + req); IgniteInternalFuture<GridNearLockResponse> fut = dht().lockAllAsync(cctx, cctx.localNode(), req, filter);
|
/**
* Gets next near lock mapping and either acquires dht locks locally or sends near lock request to
* remote primary node.
*
* @throws IgniteCheckedException If mapping can not be completed.
*/
|
Gets next near lock mapping and either acquires dht locks locally or sends near lock request to remote primary node
|
proceedMapping0
|
{
"repo_name": "nivanov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java",
"license": "apache-2.0",
"size": 62790
}
|
[
"java.util.Collection",
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.IgniteInternalFuture",
"org.apache.ignite.internal.processors.cache.KeyCacheObject"
] |
import java.util.Collection; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.cache.KeyCacheObject;
|
import java.util.*; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.*;
|
[
"java.util",
"org.apache.ignite"
] |
java.util; org.apache.ignite;
| 2,060,080
|
public String getNamespacePrefix(final PrefixMapping mapping,
final String namespace, final boolean compact) {
final String nsURIPrefix = mapping.getNsURIPrefix(namespace);
if (nsURIPrefix == null) {
if (compact) {
final int hashIdx = namespace.lastIndexOf("#");
final int split;
if (hashIdx > 0) {
split = namespace.substring(0, hashIdx).lastIndexOf("/");
} else {
split = namespace.lastIndexOf("/");
}
if (split > 0) {
return "..." + namespace.substring(split);
} else {
return namespace;
}
} else {
return namespace;
}
} else {
return nsURIPrefix + ":";
}
}
|
String function(final PrefixMapping mapping, final String namespace, final boolean compact) { final String nsURIPrefix = mapping.getNsURIPrefix(namespace); if (nsURIPrefix == null) { if (compact) { final int hashIdx = namespace.lastIndexOf("#"); final int split; if (hashIdx > 0) { split = namespace.substring(0, hashIdx).lastIndexOf("/"); } else { split = namespace.lastIndexOf("/"); } if (split > 0) { return "..." + namespace.substring(split); } else { return namespace; } } else { return namespace; } } else { return nsURIPrefix + ":"; } }
|
/**
* Get the namespace prefix (or the namespace URI itself, if no prefix is
* available) from a prefix mapping
*
* @param mapping
* @param namespace
* @return
*/
|
Get the namespace prefix (or the namespace URI itself, if no prefix is available) from a prefix mapping
|
getNamespacePrefix
|
{
"repo_name": "barmintor/fcrepo4",
"path": "fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java",
"license": "apache-2.0",
"size": 9113
}
|
[
"com.hp.hpl.jena.shared.PrefixMapping"
] |
import com.hp.hpl.jena.shared.PrefixMapping;
|
import com.hp.hpl.jena.shared.*;
|
[
"com.hp.hpl"
] |
com.hp.hpl;
| 2,451,601
|
boolean match(T object) throws OrmException;
|
boolean match(T object) throws OrmException;
|
/**
* Does this predicate match this object?
*
* @throws OrmException
*/
|
Does this predicate match this object
|
match
|
{
"repo_name": "WANdisco/gerrit",
"path": "java/com/google/gerrit/index/query/Matchable.java",
"license": "apache-2.0",
"size": 964
}
|
[
"com.google.gwtorm.server.OrmException"
] |
import com.google.gwtorm.server.OrmException;
|
import com.google.gwtorm.server.*;
|
[
"com.google.gwtorm"
] |
com.google.gwtorm;
| 963,672
|
public void cancelResource(ContentResourceEdit edit);
|
void function(ContentResourceEdit edit);
|
/**
* Cancel a resource edit.
*/
|
Cancel a resource edit
|
cancelResource
|
{
"repo_name": "marktriggs/nyu-sakai-10.4",
"path": "kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java",
"license": "apache-2.0",
"size": 426240
}
|
[
"org.sakaiproject.content.api.ContentResourceEdit"
] |
import org.sakaiproject.content.api.ContentResourceEdit;
|
import org.sakaiproject.content.api.*;
|
[
"org.sakaiproject.content"
] |
org.sakaiproject.content;
| 2,109,359
|
public Product createNearProductCluster(ArrayList<Attribute> availableAttribute, int index) {
Product product = new Product(new HashMap<Attribute, Integer>());
int attrVal;
for (int i = 0; i < TotalAttributes.size(); i++) {
attrVal = chooseAttributeCluster(i, index, availableAttribute);
product.getAttributeValue().put(TotalAttributes.get(i), attrVal);
}
product.setPrice(inter.calculatePrice(product, getTotalAttributes(), getProducers()));
return product;
}
|
Product function(ArrayList<Attribute> availableAttribute, int index) { Product product = new Product(new HashMap<Attribute, Integer>()); int attrVal; for (int i = 0; i < TotalAttributes.size(); i++) { attrVal = chooseAttributeCluster(i, index, availableAttribute); product.getAttributeValue().put(TotalAttributes.get(i), attrVal); } product.setPrice(inter.calculatePrice(product, getTotalAttributes(), getProducers())); return product; }
|
/**
* Crea un producto cercano para cada perfil obtenido como centroide
*/
|
Crea un producto cercano para cada perfil obtenido como centroide
|
createNearProductCluster
|
{
"repo_name": "Stephania16/MarketingComputacional",
"path": "ProductDesign/src/Problem/Problem.java",
"license": "apache-2.0",
"size": 47580
}
|
[
"java.util.ArrayList",
"java.util.HashMap"
] |
import java.util.ArrayList; import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,799,331
|
@Test
public void connectionOptions ()
throws Exception
{
router = new Router (PORT);
SimpleClient client = new SimpleClient ("localhost", PORT);
HashMap<String, Object> options = new HashMap<String, Object> ();
options.put ("Packet.Max-Length", 1024);
options.put ("Subscription.Max-Count", 16);
options.put ("Subscription.Max-Length", 1024);
options.put ("Attribute.Opaque.Max-Length", 2048 * 1024);
options.put ("TCP.Send-Immediately", 1);
options.put ("Bogus", "not valid");
ConnRply connReply = client.connect (options);
// todo: when Attribute.Opaque.Max-Length supported, switch lines below
// assertEquals (2048 * 1024, reply.options.get ("Attribute.Opaque.Max-Length"));
assertEquals (Integer.MAX_VALUE, connReply.options.get ("Attribute.Opaque.Max-Length"));
assertEquals (1, connReply.options.get ("TCP.Send-Immediately"));
assertEquals (1024, connReply.options.get ("Packet.Max-Length"));
assertEquals (16, connReply.options.get ("Subscription.Max-Count"));
assertEquals (1024, connReply.options.get ("Subscription.Max-Length"));
assertNull (connReply.options.get ("Bogus"));
// try to send a frame bigger than 1K, check server rejects
SecRqst secRqst = new SecRqst ();
secRqst.addNtfnKeys = new Keys ();
secRqst.addNtfnKeys.add (SHA1_PRODUCER, new Key (new byte [1025]));
logTester.pause ();
client.send (secRqst);
Message reply = client.receive ();
assertTrue (reply instanceof Disconn);
// check the disconnect message advises looking at Packet.Max-Length
assertTrue (((Disconn)reply).args.contains ("Packet.Max-Length"));
client.closeImmediately ();
router.close ();
logTester.unpause ();
router = new Router (PORT);
// remove packet length restriction for following tests
options.remove ("Packet.Max-Length");
// test Subscription.Max-Count enforcement
client = new SimpleClient ("localhost", PORT);
client.connect (options);
for (int i = 0; i < 16; i++)
client.subscribe ("Count == " + i);
SubAddRqst subAddRqst = new SubAddRqst ("Invalid == 1");
client.send (subAddRqst);
Nack nack = (Nack)client.receive ();
assertEquals (subAddRqst.xid, nack.xid);
client.close ();
// test Subscription.Max-Length enforcement
client = new SimpleClient ("localhost", PORT);
client.connect (options);
subAddRqst = new SubAddRqst (dummySubscription (2048));
client.send (subAddRqst);
nack = (Nack)client.receive ();
assertEquals (subAddRqst.xid, nack.xid);
client.close ();
// test Subscription.Max-Keys and Connection.Max-Keys enforcement
int maxConnKeys = CONNECTION_OPTION_SET.getMaxValue ("Connection.Max-Keys");
int maxSubKeys = CONNECTION_OPTION_SET.getMaxValue ("Subscription.Max-Keys");
options = new HashMap<String, Object> ();
options.put ("Connection.Max-Keys", maxConnKeys);
options.put ("Subscription.Max-Keys", maxSubKeys);
client = new SimpleClient ("localhost", PORT);
client.connect (options);
Keys keys = new Keys ();
for (int i = 0; i < maxConnKeys + 1; i++)
keys.add (KeyScheme.SHA1_CONSUMER, new Key (randomBytes (128)));
secRqst = new SecRqst (keys, EMPTY_KEYS, EMPTY_KEYS, EMPTY_KEYS);
client.send (secRqst);
nack = (Nack)client.receive ();
assertEquals (secRqst.xid, nack.xid);
subAddRqst = new SubAddRqst ("n == 1");
subAddRqst.keys = keys;
client.send (subAddRqst);
nack = (Nack)client.receive ();
assertEquals (subAddRqst.xid, nack.xid);
client.close ();
router.close ();
}
|
void function () throws Exception { router = new Router (PORT); SimpleClient client = new SimpleClient (STR, PORT); HashMap<String, Object> options = new HashMap<String, Object> (); options.put (STR, 1024); options.put (STR, 16); options.put (STR, 1024); options.put (STR, 2048 * 1024); options.put (STR, 1); options.put ("Bogus", STR); ConnRply connReply = client.connect (options); assertEquals (Integer.MAX_VALUE, connReply.options.get (STR)); assertEquals (1, connReply.options.get (STR)); assertEquals (1024, connReply.options.get (STR)); assertEquals (16, connReply.options.get (STR)); assertEquals (1024, connReply.options.get (STR)); assertNull (connReply.options.get ("Bogus")); SecRqst secRqst = new SecRqst (); secRqst.addNtfnKeys = new Keys (); secRqst.addNtfnKeys.add (SHA1_PRODUCER, new Key (new byte [1025])); logTester.pause (); client.send (secRqst); Message reply = client.receive (); assertTrue (reply instanceof Disconn); assertTrue (((Disconn)reply).args.contains (STR)); client.closeImmediately (); router.close (); logTester.unpause (); router = new Router (PORT); options.remove (STR); client = new SimpleClient (STR, PORT); client.connect (options); for (int i = 0; i < 16; i++) client.subscribe (STR + i); SubAddRqst subAddRqst = new SubAddRqst (STR); client.send (subAddRqst); Nack nack = (Nack)client.receive (); assertEquals (subAddRqst.xid, nack.xid); client.close (); client = new SimpleClient (STR, PORT); client.connect (options); subAddRqst = new SubAddRqst (dummySubscription (2048)); client.send (subAddRqst); nack = (Nack)client.receive (); assertEquals (subAddRqst.xid, nack.xid); client.close (); int maxConnKeys = CONNECTION_OPTION_SET.getMaxValue (STR); int maxSubKeys = CONNECTION_OPTION_SET.getMaxValue (STR); options = new HashMap<String, Object> (); options.put (STR, maxConnKeys); options.put (STR, maxSubKeys); client = new SimpleClient (STR, PORT); client.connect (options); Keys keys = new Keys (); for (int i = 0; i < maxConnKeys + 1; i++) keys.add (KeyScheme.SHA1_CONSUMER, new Key (randomBytes (128))); secRqst = new SecRqst (keys, EMPTY_KEYS, EMPTY_KEYS, EMPTY_KEYS); client.send (secRqst); nack = (Nack)client.receive (); assertEquals (secRqst.xid, nack.xid); subAddRqst = new SubAddRqst (STR); subAddRqst.keys = keys; client.send (subAddRqst); nack = (Nack)client.receive (); assertEquals (subAddRqst.xid, nack.xid); client.close (); router.close (); }
|
/**
* Test connection options.
*
* @see JUTestClientConnectionOptions
*/
|
Test connection options
|
connectionOptions
|
{
"repo_name": "luv/avis_zmqprx",
"path": "server/src/test/org/avis/router/JUTestRouter.java",
"license": "gpl-3.0",
"size": 24633
}
|
[
"java.util.HashMap",
"org.avis.io.messages.ConnRply",
"org.avis.io.messages.Disconn",
"org.avis.io.messages.Message",
"org.avis.io.messages.Nack",
"org.avis.io.messages.SecRqst",
"org.avis.io.messages.SubAddRqst",
"org.avis.security.Key",
"org.avis.security.KeyScheme",
"org.avis.security.Keys"
] |
import java.util.HashMap; import org.avis.io.messages.ConnRply; import org.avis.io.messages.Disconn; import org.avis.io.messages.Message; import org.avis.io.messages.Nack; import org.avis.io.messages.SecRqst; import org.avis.io.messages.SubAddRqst; import org.avis.security.Key; import org.avis.security.KeyScheme; import org.avis.security.Keys;
|
import java.util.*; import org.avis.io.messages.*; import org.avis.security.*;
|
[
"java.util",
"org.avis.io",
"org.avis.security"
] |
java.util; org.avis.io; org.avis.security;
| 451,711
|
Map<String, Properties> findComponents() throws LoadPropertiesException, IOException;
|
Map<String, Properties> findComponents() throws LoadPropertiesException, IOException;
|
/**
* Find information about all the Camel components available in the classpath and {@link org.apache.camel.spi.Registry}.
*
* @return a map with the component name, and value with component details.
* @throws LoadPropertiesException is thrown if error during classpath discovery of the components
* @throws IOException is thrown if error during classpath discovery of the components
*/
|
Find information about all the Camel components available in the classpath and <code>org.apache.camel.spi.Registry</code>
|
findComponents
|
{
"repo_name": "borcsokj/camel",
"path": "camel-core/src/main/java/org/apache/camel/CamelContext.java",
"license": "apache-2.0",
"size": 68766
}
|
[
"java.io.IOException",
"java.util.Map",
"java.util.Properties",
"org.apache.camel.util.LoadPropertiesException"
] |
import java.io.IOException; import java.util.Map; import java.util.Properties; import org.apache.camel.util.LoadPropertiesException;
|
import java.io.*; import java.util.*; import org.apache.camel.util.*;
|
[
"java.io",
"java.util",
"org.apache.camel"
] |
java.io; java.util; org.apache.camel;
| 2,456,501
|
@JsonIgnore
public String getEncryptionCertificateDecoded() {
if (EncodingUtils.isBase64(encryptionCertificate)) {
val cert = SamlIdPMetadataGenerator.cleanCertificate(encryptionCertificate);
return EncodingUtils.decodeBase64ToString(cert);
}
return encryptionCertificate;
}
|
String function() { if (EncodingUtils.isBase64(encryptionCertificate)) { val cert = SamlIdPMetadataGenerator.cleanCertificate(encryptionCertificate); return EncodingUtils.decodeBase64ToString(cert); } return encryptionCertificate; }
|
/**
* Gets encryption certificate decoded.
*
* @return the encryption certificate decoded
*/
|
Gets encryption certificate decoded
|
getEncryptionCertificateDecoded
|
{
"repo_name": "philliprower/cas",
"path": "support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/SamlIdPMetadataDocument.java",
"license": "apache-2.0",
"size": 4191
}
|
[
"org.apereo.cas.support.saml.idp.metadata.generator.SamlIdPMetadataGenerator",
"org.apereo.cas.util.EncodingUtils"
] |
import org.apereo.cas.support.saml.idp.metadata.generator.SamlIdPMetadataGenerator; import org.apereo.cas.util.EncodingUtils;
|
import org.apereo.cas.support.saml.idp.metadata.generator.*; import org.apereo.cas.util.*;
|
[
"org.apereo.cas"
] |
org.apereo.cas;
| 1,597,710
|
ChannelFuture bindAddress(InetAddress localAddress);
/**
* Bind a address to the already bound channel to enable multi-homing.
* The Channel bust be bound and yet to be connected.
*
* Will notify the given {@link ChannelPromise} and return a {@link ChannelFuture}
|
ChannelFuture bindAddress(InetAddress localAddress); /** * Bind a address to the already bound channel to enable multi-homing. * The Channel bust be bound and yet to be connected. * * Will notify the given {@link ChannelPromise} and return a {@link ChannelFuture}
|
/**
* Bind a address to the already bound channel to enable multi-homing.
* The Channel bust be bound and yet to be connected.
*/
|
Bind a address to the already bound channel to enable multi-homing. The Channel bust be bound and yet to be connected
|
bindAddress
|
{
"repo_name": "NiteshKant/netty",
"path": "transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannel.java",
"license": "apache-2.0",
"size": 4148
}
|
[
"io.netty.channel.Channel",
"io.netty.channel.ChannelFuture",
"io.netty.channel.ChannelPromise",
"java.net.InetAddress"
] |
import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelPromise; import java.net.InetAddress;
|
import io.netty.channel.*; import java.net.*;
|
[
"io.netty.channel",
"java.net"
] |
io.netty.channel; java.net;
| 1,440,073
|
public List<AbstractGoods> getSortedPotential() {
return getSortedPotential(null, null);
}
|
List<AbstractGoods> function() { return getSortedPotential(null, null); }
|
/**
* Sorts GoodsTypes according to potential based on TileType,
* TileItemContainer if any.
*
* @return The sorted GoodsTypes.
*/
|
Sorts GoodsTypes according to potential based on TileType, TileItemContainer if any
|
getSortedPotential
|
{
"repo_name": "tectronics/reformationofeurope",
"path": "src/net/sf/freecol/common/model/Tile.java",
"license": "gpl-2.0",
"size": 60810
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 750,710
|
public void onSuccess(int statusCode, JSONObject response) {
onSuccess(response);
}
|
void function(int statusCode, JSONObject response) { onSuccess(response); }
|
/**
* Fired when a request returns successfully and contains a json object at the base of the
* response string. Override to handle in your own code.
*
* @param statusCode the status code of the response
* @param response the parsed json object found in the server response (if any)
*/
|
Fired when a request returns successfully and contains a json object at the base of the response string. Override to handle in your own code
|
onSuccess
|
{
"repo_name": "darklost/qingnianzhai",
"path": "src/com/loopj/android/http/JsonHttpResponseHandler.java",
"license": "apache-2.0",
"size": 9421
}
|
[
"org.json.JSONObject"
] |
import org.json.JSONObject;
|
import org.json.*;
|
[
"org.json"
] |
org.json;
| 689,658
|
public static Method getWriteMethod(PropertyDescriptor descriptor) {
return PropertyUtilsBean.getInstance().getWriteMethod(descriptor);
}
|
static Method function(PropertyDescriptor descriptor) { return PropertyUtilsBean.getInstance().getWriteMethod(descriptor); }
|
/**
* <p>Return an accessible property setter method for this property,
* if there is one; otherwise return <code>null</code>.</p>
*
* <p>For more details see <code>PropertyUtilsBean</code>.</p>
*
* @see PropertyUtilsBean#getWriteMethod
*/
|
Return an accessible property setter method for this property, if there is one; otherwise return <code>null</code>. For more details see <code>PropertyUtilsBean</code>
|
getWriteMethod
|
{
"repo_name": "ProfilingLabs/Usemon2",
"path": "usemon-agent-commons-java/src/main/java/com/usemon/lib/org/apache/commons/beanutils/PropertyUtils.java",
"license": "mpl-2.0",
"size": 18359
}
|
[
"java.beans.PropertyDescriptor",
"java.lang.reflect.Method"
] |
import java.beans.PropertyDescriptor; import java.lang.reflect.Method;
|
import java.beans.*; import java.lang.reflect.*;
|
[
"java.beans",
"java.lang"
] |
java.beans; java.lang;
| 1,397,557
|
public static <T extends IdentifiableObject> Map<String, T> getIdMap( List<T> objects, IdScheme idScheme )
{
Map<String, T> map = new HashMap<>();
for ( T object : objects )
{
String value = object.getPropertyValue( idScheme );
if ( value != null )
{
map.put( value, object );
}
}
return map;
}
|
static <T extends IdentifiableObject> Map<String, T> function( List<T> objects, IdScheme idScheme ) { Map<String, T> map = new HashMap<>(); for ( T object : objects ) { String value = object.getPropertyValue( idScheme ); if ( value != null ) { map.put( value, object ); } } return map; }
|
/**
* Returns a map of the identifiable property specified by the given id scheme
* and the corresponding object.
*
* @param objects the objects.
* @param idScheme the id scheme.
* @return a map.
*/
|
Returns a map of the identifiable property specified by the given id scheme and the corresponding object
|
getIdMap
|
{
"repo_name": "troyel/dhis2-core",
"path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectUtils.java",
"license": "bsd-3-clause",
"size": 14724
}
|
[
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] |
import java.util.HashMap; import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,078,785
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.