method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public Accessible getAccessibleChild(int i)
{
// Testing shows that the reference implementation returns instances
// of page here.
Accessible child = null;
if (i >= 0 && i < tabs.size())
child = (Page) tabs.get(i);
return child;
} | Accessible function(int i) { Accessible child = null; if (i >= 0 && i < tabs.size()) child = (Page) tabs.get(i); return child; } | /**
* Returns the accessible child component at the specified index.
*
* @param i the index of the child component to fetch
*
* @return the accessible child component at the specified index
*/ | Returns the accessible child component at the specified index | getAccessibleChild | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/JTabbedPane.java",
"license": "gpl-2.0",
"size": 47046
} | [
"javax.accessibility.Accessible"
] | import javax.accessibility.Accessible; | import javax.accessibility.*; | [
"javax.accessibility"
] | javax.accessibility; | 1,476,778 |
private void select() throws SQLException {
String sql = "SELECT * FROM Store WHERE id = ?";
DataTable dt = conn.executeQuery(sql, id);
if(dt.hasRows()) {
exists = true;
name = dt.getString("name");
address1 = dt.getString("address1");
address... | void function() throws SQLException { String sql = STR; DataTable dt = conn.executeQuery(sql, id); if(dt.hasRows()) { exists = true; name = dt.getString("name"); address1 = dt.getString(STR); address2 = dt.getString(STR); city = dt.getString("city"); state = dt.getString("state"); zip = dt.getString("zip"); phone = dt.... | /**
* Performs a SQL SELECT operation on this object.
*
* @throws SQLException if a database access error occurs
*/ | Performs a SQL SELECT operation on this object | select | {
"repo_name": "mordigaldj/SmartRegister",
"path": "src/main/java/com/djm/smartreg/data/DBStore.java",
"license": "mit",
"size": 9326
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,497,372 |
@Test
public void testGetInfo() {
Assertions.assertThat(this.authenticator.getInfo().length()).isGreaterThan(0);
Assert.assertTrue(this.authenticator.getAuth() instanceof WindowsAuthProviderImpl);
} | void function() { Assertions.assertThat(this.authenticator.getInfo().length()).isGreaterThan(0); Assert.assertTrue(this.authenticator.getAuth() instanceof WindowsAuthProviderImpl); } | /**
* Test get info.
*/ | Test get info | testGetInfo | {
"repo_name": "victorbriz/waffle",
"path": "Source/JNA/waffle-tomcat8/src/test/java/waffle/apache/NegotiateAuthenticatorTests.java",
"license": "epl-1.0",
"size": 14032
} | [
"org.assertj.core.api.Assertions",
"org.junit.Assert"
] | import org.assertj.core.api.Assertions; import org.junit.Assert; | import org.assertj.core.api.*; import org.junit.*; | [
"org.assertj.core",
"org.junit"
] | org.assertj.core; org.junit; | 488,253 |
List<SecurityGroupRulesVO> listSecurityGroupRules(); | List<SecurityGroupRulesVO> listSecurityGroupRules(); | /**
* List all security groups and associated ingress rules
* @return the list of security groups with associated ingress rules
*/ | List all security groups and associated ingress rules | listSecurityGroupRules | {
"repo_name": "GabrielBrascher/cloudstack",
"path": "engine/schema/src/main/java/com/cloud/network/security/dao/SecurityGroupRulesDao.java",
"license": "apache-2.0",
"size": 1959
} | [
"com.cloud.network.security.SecurityGroupRulesVO",
"java.util.List"
] | import com.cloud.network.security.SecurityGroupRulesVO; import java.util.List; | import com.cloud.network.security.*; import java.util.*; | [
"com.cloud.network",
"java.util"
] | com.cloud.network; java.util; | 1,451,036 |
public void testDML() throws SQLException {
final int phase = getPhase();
Statement s = createStatement();
switch (phase) {
case PH_CREATE:
s.executeUpdate("CREATE TABLE PHASE" +
"(id INT NOT NULL,... | void function() throws SQLException { final int phase = getPhase(); Statement s = createStatement(); switch (phase) { case PH_CREATE: s.executeUpdate(STR + STR); s.executeUpdate(STR + STR); break; case PH_SOFT_UPGRADE: break; case PH_POST_SOFT_UPGRADE: break; case PH_HARD_UPGRADE: break; } s.close(); PreparedStatement ... | /**
* Test general DML. Just execute some INSERT/UPDATE/DELETE
* statements in all phases to see that generally the database works.
* @throws SQLException
*/ | Test general DML. Just execute some INSERT/UPDATE/DELETE statements in all phases to see that generally the database works | testDML | {
"repo_name": "lpxz/grail-derby104",
"path": "java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java",
"license": "apache-2.0",
"size": 18145
} | [
"java.sql.PreparedStatement",
"java.sql.SQLException",
"java.sql.Statement"
] | import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,340,267 |
public long getFilePointer() throws IOException;
| long function() throws IOException; | /**
* Get the current position in the IRandomAccess.
*
* @since 1.0
*/ | Get the current position in the IRandomAccess | getFilePointer | {
"repo_name": "joval/jSAF",
"path": "src/jsaf/intf/io/IRandomAccess.java",
"license": "lgpl-2.1",
"size": 1636
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 21,545 |
@Override
void executeSqlBatch( String[] queryarr, JSONArray[] jsonparams,
String[] queryIDs, CallbackContext cbc) {
if (mydb == null) {
// not allowed - can only happen if someone has closed (and possibly deleted) a database and then re-used the database
... | void executeSqlBatch( String[] queryarr, JSONArray[] jsonparams, String[] queryIDs, CallbackContext cbc) { if (mydb == null) { cbc.error(STR); return; } int len = queryarr.length; JSONArray batchResults = new JSONArray(); for (int i = 0; i < len; i++) { int rowsAffectedCompat = 0; boolean needRowsAffectedCompat = false... | /**
* Executes a batch request and sends the results via cbc.
*
* @param dbname The name of the database.
* @param queryarr Array of query strings
* @param jsonparams Array of JSON query parameters
* @param queryIDs Array of query ids
* @param cbc Callback... | Executes a batch request and sends the results via cbc | executeSqlBatch | {
"repo_name": "prostudy/calculadatos",
"path": "plugins/cordova-sqlite-storage/src/android/io/liteglue/SQLitePlugin.java",
"license": "mit",
"size": 24415
} | [
"android.util.Log",
"org.apache.cordova.CallbackContext",
"org.json.JSONArray",
"org.json.JSONException",
"org.json.JSONObject"
] | import android.util.Log; import org.apache.cordova.CallbackContext; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; | import android.util.*; import org.apache.cordova.*; import org.json.*; | [
"android.util",
"org.apache.cordova",
"org.json"
] | android.util; org.apache.cordova; org.json; | 1,082,828 |
private void drawBgToWholePagePDFBox(Color bgColor) throws IOException
{
setNonStrokingColor(bgColor);
content.addRect(0, 0, pageFormat.getWidth(), pageFormat.getHeight());
content.fill();
} | void function(Color bgColor) throws IOException { setNonStrokingColor(bgColor); content.addRect(0, 0, pageFormat.getWidth(), pageFormat.getHeight()); content.fill(); } | /**
* Inserts background to whole recent PDF page using PDFBox
* @throws IOException
*/ | Inserts background to whole recent PDF page using PDFBox | drawBgToWholePagePDFBox | {
"repo_name": "radkovo/CSSBoxPdf",
"path": "src/main/java/org/fit/cssbox/pdf/PDFRenderer.java",
"license": "lgpl-3.0",
"size": 101523
} | [
"cz.vutbr.web.csskit.Color",
"java.io.IOException"
] | import cz.vutbr.web.csskit.Color; import java.io.IOException; | import cz.vutbr.web.csskit.*; import java.io.*; | [
"cz.vutbr.web",
"java.io"
] | cz.vutbr.web; java.io; | 1,514,103 |
public static String toString(Object o, String tagName)
throws JSONException {
StringBuffer b = new StringBuffer();
int i;
JSONArray ja;
JSONObject jo;
String k;
Iterator keys;
int len;
String s;
... | static String function(Object o, String tagName) throws JSONException { StringBuffer b = new StringBuffer(); int i; JSONArray ja; JSONObject jo; String k; Iterator keys; int len; String s; Object v; if (o instanceof JSONObject) { if (tagName != null) { b.append('<'); b.append(tagName); b.append('>'); } jo = (JSONObject... | /**
* Convert a JSONObject into a well-formed, element-normal XML string.
* @param o A JSONObject.
* @param tagName The optional name of the enclosing tag.
* @return A string.
* @throws JSONException
*/ | Convert a JSONObject into a well-formed, element-normal XML string | toString | {
"repo_name": "edvin/tornadofaces",
"path": "tornadofaces/src/main/java/io/tornadofaces/json/XML.java",
"license": "apache-2.0",
"size": 14141
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,917,979 |
private JMenuItem getJMenuItem4NetworkComponentProperties(NetworkComponent networkComponent) {
final NetworkComponent networkComponent2Edit = networkComponent;
| JMenuItem function(NetworkComponent networkComponent) { final NetworkComponent networkComponent2Edit = networkComponent; | /**
* Returns a JMenueItem for the properties of a NetworkComponent.
*
* @param networkComponent the NetworkComponent
* @return the JMenueItem for the specified NetworkComponent
*/ | Returns a JMenueItem for the properties of a NetworkComponent | getJMenuItem4NetworkComponentProperties | {
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/org.awb.env.networkModel/src/org/awb/env/networkModel/controller/ui/GraphEnvironmentPopupPlugin.java",
"license": "lgpl-2.1",
"size": 16808
} | [
"javax.swing.JMenuItem",
"org.awb.env.networkModel.NetworkComponent"
] | import javax.swing.JMenuItem; import org.awb.env.networkModel.NetworkComponent; | import javax.swing.*; import org.awb.env.*; | [
"javax.swing",
"org.awb.env"
] | javax.swing; org.awb.env; | 1,901,585 |
@Override
public void stateChanged(ChangeEvent e) {
if (e.getSource().equals(opacitySlider)) {
if (boardView != null) {
if (layerTable.getSelectedRow() > -1 && layerTable.getRowCount() > 0) {
boardView.getLayer((boardView.getBoard().getLayers().size() - la... | void function(ChangeEvent e) { if (e.getSource().equals(opacitySlider)) { if (boardView != null) { if (layerTable.getSelectedRow() > -1 && layerTable.getRowCount() > 0) { boardView.getLayer((boardView.getBoard().getLayers().size() - layerTable.getSelectedRow()) - 1) .setOpacity(opacitySlider.getValue() / 100.0f); } } }... | /**
* TODO: Possibly consider moving this to a dedicated listener class later. For now leave it here for simplicity.
*
* Used to keep track of changes on the opacity <code>JSlider</code>. If there is an open board and a layer is
* selected then the layers opacity will be updated.
*
* @para... | Used to keep track of changes on the opacity <code>JSlider</code>. If there is an open board and a layer is selected then the layers opacity will be updated | stateChanged | {
"repo_name": "swordmaster2k/rpgwizard",
"path": "editor/editor-ui/src/main/java/org/rpgwizard/editor/editors/board/panels/LayerPanel.java",
"license": "mpl-2.0",
"size": 11134
} | [
"javax.swing.event.ChangeEvent"
] | import javax.swing.event.ChangeEvent; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 2,480,434 |
// Encoding the compressed message
String encodedRequestMessage = Base64.encodeBytes(byteArrayOutputStream
.toByteArray(), Base64.DONT_BREAK_LINES);
return encodedRequestMessage.trim();
}*/
public static String decode(String encodedStr) throws Exception {
return new ... | String encodedRequestMessage = Base64.encodeBytes(byteArrayOutputStream .toByteArray(), Base64.DONT_BREAK_LINES); return encodedRequestMessage.trim(); }*/ static String function(String encodedStr) throws Exception { return new String(Base64.decode(encodedStr)); } /* static String function(String encodedStr) throws Exce... | /**
* Decoding and deflating the encoded AuthReq
*
* @param encodedStr encoded AuthReq
* @return decoded AuthReq
*/ | Decoding and deflating the encoded AuthReq | decode | {
"repo_name": "udarakr/jaggery-extensions",
"path": "sso/resources/org.jaggeryjs.modules.sso/src/main/java/org/jaggeryjs/modules/sso/common/util/Util.java",
"license": "apache-2.0",
"size": 31064
} | [
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"org.opensaml.xml.util.Base64"
] | import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import org.opensaml.xml.util.Base64; | import java.io.*; import org.opensaml.xml.util.*; | [
"java.io",
"org.opensaml.xml"
] | java.io; org.opensaml.xml; | 2,613,623 |
@Test
public void testList03() throws Exception {
// given
truncateTables("users");
createUser(getDefaultEmail(), getDefaultPass(), null, UserStatus.ACTIVE,
UserRole.ROLE_ADMIN);
final int userCount = 10;
String nexttoken = "MTA6MTA=";
String t... | void function() throws Exception { truncateTables("users"); createUser(getDefaultEmail(), getDefaultPass(), null, UserStatus.ACTIVE, UserRole.ROLE_ADMIN); final int userCount = 10; String nexttoken = STR; String token = login(); String url = getDefaultHostAndPort() + API_USER_LIST + STR + token; for (int i = 0; i < use... | /**
* testList03().
* test next token
* @throws Exception Exception
*/ | testList03(). test next token | testList03 | {
"repo_name": "formkiq/formkiq-server",
"path": "web/src/test/java/com/formkiq/web/UsersControllerIntegrationTest.java",
"license": "apache-2.0",
"size": 38086
} | [
"com.formkiq.core.domain.type.UserListDTO",
"com.formkiq.core.domain.type.UserRole",
"com.formkiq.core.domain.type.UserStatus",
"org.junit.Assert",
"org.springframework.http.HttpMethod",
"org.springframework.http.ResponseEntity"
] | import com.formkiq.core.domain.type.UserListDTO; import com.formkiq.core.domain.type.UserRole; import com.formkiq.core.domain.type.UserStatus; import org.junit.Assert; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; | import com.formkiq.core.domain.type.*; import org.junit.*; import org.springframework.http.*; | [
"com.formkiq.core",
"org.junit",
"org.springframework.http"
] | com.formkiq.core; org.junit; org.springframework.http; | 898,647 |
Observable<ServiceResponseWithHeaders<Boolean, JobScheduleExistsHeaders>> existsWithServiceResponseAsync(String jobScheduleId);
boolean exists(String jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions); | Observable<ServiceResponseWithHeaders<Boolean, JobScheduleExistsHeaders>> existsWithServiceResponseAsync(String jobScheduleId); boolean exists(String jobScheduleId, JobScheduleExistsOptions jobScheduleExistsOptions); | /**
* Checks the specified Job Schedule exists.
*
* @param jobScheduleId The ID of the Job Schedule which you want to check.
* @param jobScheduleExistsOptions Additional parameters for the operation
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws Batch... | Checks the specified Job Schedule exists | exists | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/batch/microsoft-azure-batch/src/main/java/com/microsoft/azure/batch/protocol/JobSchedules.java",
"license": "mit",
"size": 58025
} | [
"com.microsoft.azure.batch.protocol.models.JobScheduleExistsHeaders",
"com.microsoft.azure.batch.protocol.models.JobScheduleExistsOptions",
"com.microsoft.rest.ServiceResponseWithHeaders"
] | import com.microsoft.azure.batch.protocol.models.JobScheduleExistsHeaders; import com.microsoft.azure.batch.protocol.models.JobScheduleExistsOptions; import com.microsoft.rest.ServiceResponseWithHeaders; | import com.microsoft.azure.batch.protocol.models.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 526,469 |
public void loadDeviceNames(HmInterface hmInterface, Collection<HmDevice> devices) throws IOException {
RpcRequest<T> request = createRpcRequest("getDeviceInfo");
new HomegearLoadDeviceNamesParser(devices).parse(sendMessage(config.getRpcPort(hmInterface), request));
} | void function(HmInterface hmInterface, Collection<HmDevice> devices) throws IOException { RpcRequest<T> request = createRpcRequest(STR); new HomegearLoadDeviceNamesParser(devices).parse(sendMessage(config.getRpcPort(hmInterface), request)); } | /**
* Loads all device names from a Homegear gateway.
*/ | Loads all device names from a Homegear gateway | loadDeviceNames | {
"repo_name": "beowulfe/openhab2",
"path": "addons/binding/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/RpcClient.java",
"license": "epl-1.0",
"size": 14372
} | [
"java.io.IOException",
"java.util.Collection",
"org.openhab.binding.homematic.internal.communicator.message.RpcRequest",
"org.openhab.binding.homematic.internal.communicator.parser.HomegearLoadDeviceNamesParser",
"org.openhab.binding.homematic.internal.model.HmDevice",
"org.openhab.binding.homematic.inter... | import java.io.IOException; import java.util.Collection; import org.openhab.binding.homematic.internal.communicator.message.RpcRequest; import org.openhab.binding.homematic.internal.communicator.parser.HomegearLoadDeviceNamesParser; import org.openhab.binding.homematic.internal.model.HmDevice; import org.openhab.bindin... | import java.io.*; import java.util.*; import org.openhab.binding.homematic.internal.communicator.message.*; import org.openhab.binding.homematic.internal.communicator.parser.*; import org.openhab.binding.homematic.internal.model.*; | [
"java.io",
"java.util",
"org.openhab.binding"
] | java.io; java.util; org.openhab.binding; | 790,829 |
@JSFunction
public static String encrypt(String aString, Object key) throws Exception {
if (key == null || key instanceof Undefined) key = AFBase.K;
if (key instanceof String) key = ((String) key).getBytes();
if (((byte[]) key).length < 16) throw new Exception("Invalid key size. Key should be, at least, 1... | static String function(String aString, Object key) throws Exception { if (key == null key instanceof Undefined) key = AFBase.K; if (key instanceof String) key = ((String) key).getBytes(); if (((byte[]) key).length < 16) throw new Exception(STR); SecureRandom sc = new SecureRandom(); byte[] biv = sc.generateSeed(16); Iv... | /**
* <odoc>
* <key>af.encrypt(aString, aKey) : String</key>
* Encrypts the provided aString as password for most of the OpenAF password
* functionality. If aKey is provided it will encrypt using it.
* </odoc>
* @throws Exception
*/ | af.encrypt(aString, aKey) : String Encrypts the provided aString as password for most of the OpenAF password functionality. If aKey is provided it will encrypt using it. | encrypt | {
"repo_name": "OpenAF/openaf",
"path": "src/openaf/AFBase.java",
"license": "apache-2.0",
"size": 53748
} | [
"java.lang.String",
"java.security.SecureRandom",
"javax.crypto.Cipher",
"javax.crypto.spec.IvParameterSpec",
"javax.crypto.spec.SecretKeySpec",
"org.apache.commons.codec.binary.Hex",
"org.mozilla.javascript.Undefined"
] | import java.lang.String; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Hex; import org.mozilla.javascript.Undefined; | import java.lang.*; import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import org.apache.commons.codec.binary.*; import org.mozilla.javascript.*; | [
"java.lang",
"java.security",
"javax.crypto",
"org.apache.commons",
"org.mozilla.javascript"
] | java.lang; java.security; javax.crypto; org.apache.commons; org.mozilla.javascript; | 1,381,452 |
@Column(name = "state", nullable = false, length = 128)
@Override
public String getState() {
return (String) get(5);
} | @Column(name = "state", nullable = false, length = 128) String function() { return (String) get(5); } | /**
* Getter for <code>cattle.service_expose_map.state</code>.
*/ | Getter for <code>cattle.service_expose_map.state</code> | getState | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/tables/records/ServiceExposeMapRecord.java",
"license": "apache-2.0",
"size": 21690
} | [
"javax.persistence.Column"
] | import javax.persistence.Column; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 2,473,774 |
@RequestMapping("/downloadGMLAsZip.do")
public void downloadGMLAsZip(
@RequestParam("serviceUrls") final String[] serviceUrls,
HttpServletResponse response) throws Exception {
ExecutorService pool = Executors.newCachedThreadPool();
downloadGMLAsZip(serviceUrls,response,po... | @RequestMapping(STR) void function( @RequestParam(STR) final String[] serviceUrls, HttpServletResponse response) throws Exception { ExecutorService pool = Executors.newCachedThreadPool(); downloadGMLAsZip(serviceUrls,response,pool); } | /**
* Given a list of URls, this function will collate the responses
* into a zip file and send the response back to the browser.
*
* @param serviceUrls
* @param response
* @throws Exception
*/ | Given a list of URls, this function will collate the responses into a zip file and send the response back to the browser | downloadGMLAsZip | {
"repo_name": "AuScope/BOM-Portal",
"path": "src/main/java/org/auscope/portal/server/web/controllers/DownloadController.java",
"license": "gpl-3.0",
"size": 7368
} | [
"java.util.concurrent.ExecutorService",
"java.util.concurrent.Executors",
"javax.servlet.http.HttpServletResponse",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestParam"
] | import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.servlet.http.HttpServletResponse; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; | import java.util.concurrent.*; import javax.servlet.http.*; import org.springframework.web.bind.annotation.*; | [
"java.util",
"javax.servlet",
"org.springframework.web"
] | java.util; javax.servlet; org.springframework.web; | 1,520,682 |
public static ValidationException withErrors(List<String> errors) {
ValidationException e = new ValidationException();
for (String error : errors) {
e.addValidationError(error);
}
return e;
}
private final List<String> validationErrors = new ArrayList<>(); | static ValidationException function(List<String> errors) { ValidationException e = new ValidationException(); for (String error : errors) { e.addValidationError(error); } return e; } private final List<String> validationErrors = new ArrayList<>(); | /**
* Creates {@link ValidationException} instance initialized with given error messages.
* @param errors the list of errors to add
* @return {@link ValidationException} instance
*/ | Creates <code>ValidationException</code> instance initialized with given error messages | withErrors | {
"repo_name": "gingerwizard/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/ValidationException.java",
"license": "apache-2.0",
"size": 3103
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 145,265 |
if(soFar == null) {
soFar = new HashSet<FreenetURI>();
}
if(soFar.size() > maxArchiveLevels)
throw new ArchiveFailureException(ArchiveFailureException.TOO_MANY_LEVELS);
FreenetURI uri = key;
if(!soFar.add(uri)) {
throw new ArchiveFailureException(ArchiveFailureException.ARCHIVE_LOOP_DETECTED);
}
} | if(soFar == null) { soFar = new HashSet<FreenetURI>(); } if(soFar.size() > maxArchiveLevels) throw new ArchiveFailureException(ArchiveFailureException.TOO_MANY_LEVELS); FreenetURI uri = key; if(!soFar.add(uri)) { throw new ArchiveFailureException(ArchiveFailureException.ARCHIVE_LOOP_DETECTED); } } | /**
* Check for a loop.
*
* The URI provided is expected to be a reasonably unique identifier for the archive.
*/ | Check for a loop. The URI provided is expected to be a reasonably unique identifier for the archive | doLoopDetection | {
"repo_name": "Juiceman/fred",
"path": "src/freenet/client/ArchiveContext.java",
"license": "gpl-2.0",
"size": 1702
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 1,312,764 |
public static String returnUrl(HttpServletRequest req, String path)
{
StringBuilder url = new StringBuilder();
url.append(serverUrl(req));
url.append(req.getContextPath());
url.append(req.getServletPath());
if (path != null) url.append(path);
// TODO: params
return url.toString();
} | static String function(HttpServletRequest req, String path) { StringBuilder url = new StringBuilder(); url.append(serverUrl(req)); url.append(req.getContextPath()); url.append(req.getServletPath()); if (path != null) url.append(path); return url.toString(); } | /**
* Compute the URL that would return to this servlet based on the current request, with the optional path and parameters
*
* @param req
* The request.
* @return The URL back to this servlet based on the current request.
*/ | Compute the URL that would return to this servlet based on the current request, with the optional path and parameters | returnUrl | {
"repo_name": "OpenCollabZA/sakai",
"path": "kernel/kernel-util/src/main/java/org/sakaiproject/util/Web.java",
"license": "apache-2.0",
"size": 21784
} | [
"javax.servlet.http.HttpServletRequest"
] | import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 560,612 |
public long getTime(Date date) {
long result = date.getTime();
if (this.adjustForDaylightSaving) {
this.workingCalendar.setTime(date);
this.workingCalendarNoDST.set(
this.workingCalendar.get(Calendar.YEAR),
this.workingCalendar.get(Cale... | long function(Date date) { long result = date.getTime(); if (this.adjustForDaylightSaving) { this.workingCalendar.setTime(date); this.workingCalendarNoDST.set( this.workingCalendar.get(Calendar.YEAR), this.workingCalendar.get(Calendar.MONTH), this.workingCalendar.get(Calendar.DATE), this.workingCalendar.get(Calendar.HO... | /**
* Special method that handles conversion between the Default Time Zone and
* a UTC time zone with no DST. This is needed so all days have the same
* size. This method is the prefered way of converting a Data into
* milliseconds for usage in this class.
*
* @param date Date to convert t... | Special method that handles conversion between the Default Time Zone and a UTC time zone with no DST. This is needed so all days have the same size. This method is the prefered way of converting a Data into milliseconds for usage in this class | getTime | {
"repo_name": "Epsilon2/Memetic-Algorithm-for-TSP",
"path": "jfreechart-1.0.16/source/org/jfree/chart/axis/SegmentedTimeline.java",
"license": "mit",
"size": 64025
} | [
"java.util.Calendar",
"java.util.Date"
] | import java.util.Calendar; import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,034,561 |
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
validator = new GroupNameValidator();
validator.setTargetNode(this);
JSSTextPropertyDescriptor nameD = new JSSValidatedTextPropertyDescriptor(JRDesignGroup.PROPERTY_NAME, Messages.common_name, va... | void function(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { validator = new GroupNameValidator(); validator.setTargetNode(this); JSSTextPropertyDescriptor nameD = new JSSValidatedTextPropertyDescriptor(JRDesignGroup.PROPERTY_NAME, Messages.common_name, validator); nameD.setDescription(Messages.MGro... | /**
* Creates the property descriptors.
*
* @param desc
* the desc
*/ | Creates the property descriptors | createPropertyDescriptors | {
"repo_name": "OpenSoftwareSolutions/PDFReporter-Studio",
"path": "com.jaspersoft.studio/src/com/jaspersoft/studio/model/group/MGroup.java",
"license": "lgpl-3.0",
"size": 12140
} | [
"com.jaspersoft.studio.messages.Messages",
"com.jaspersoft.studio.property.descriptor.NullEnum",
"com.jaspersoft.studio.property.descriptor.checkbox.CheckBoxPropertyDescriptor",
"com.jaspersoft.studio.property.descriptor.expression.JRExpressionPropertyDescriptor",
"com.jaspersoft.studio.property.descriptors... | import com.jaspersoft.studio.messages.Messages; import com.jaspersoft.studio.property.descriptor.NullEnum; import com.jaspersoft.studio.property.descriptor.checkbox.CheckBoxPropertyDescriptor; import com.jaspersoft.studio.property.descriptor.expression.JRExpressionPropertyDescriptor; import com.jaspersoft.studio.proper... | import com.jaspersoft.studio.messages.*; import com.jaspersoft.studio.property.descriptor.*; import com.jaspersoft.studio.property.descriptor.checkbox.*; import com.jaspersoft.studio.property.descriptor.expression.*; import com.jaspersoft.studio.property.descriptors.*; import java.util.*; import net.sf.jasperreports.en... | [
"com.jaspersoft.studio",
"java.util",
"net.sf.jasperreports",
"org.eclipse.ui"
] | com.jaspersoft.studio; java.util; net.sf.jasperreports; org.eclipse.ui; | 2,895,891 |
@Override
public int getHoldability() throws SQLException {
try {
checkClosed();
return holdability;
} catch (Exception e) {
throw Logger.logAndConvert(log, e);
}
} | int function() throws SQLException { try { checkClosed(); return holdability; } catch (Exception e) { throw Logger.logAndConvert(log, e); } } | /**
* Returns the current result set holdability.
*
* @return the holdability
* @throws java.sql.SQLException
* if the connection is closed
*/ | Returns the current result set holdability | getHoldability | {
"repo_name": "fengshao0907/wasp",
"path": "src/main/java/com/alibaba/wasp/jdbc/JdbcConnection.java",
"license": "apache-2.0",
"size": 28314
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 648,294 |
private static String[] websocketEndpointConfig(API api, String urlType) throws JSONException {
org.json.JSONObject obj = new org.json.JSONObject(api.getEndpointConfig());
org.json.JSONObject endpointObj = null;
if (ENDPOINT_PRODUCTION.equalsIgnoreCase(urlType)) {
org.json.JSON... | static String[] function(API api, String urlType) throws JSONException { org.json.JSONObject obj = new org.json.JSONObject(api.getEndpointConfig()); org.json.JSONObject endpointObj = null; if (ENDPOINT_PRODUCTION.equalsIgnoreCase(urlType)) { org.json.JSONObject prodEP = obj.getJSONObject(APIConstants.API_DATA_PRODUCTIO... | /**
* Construct the timeout, suspendOnFailure, markForSuspension to add suspend.
* configuration to the websocket endpoint (Simply assign config values according to the endpoint-template)
*
* @param api
* @param urlType - Whether production or sandbox
* @return timeout, suspendOnFailure, m... | Construct the timeout, suspendOnFailure, markForSuspension to add suspend. configuration to the websocket endpoint (Simply assign config values according to the endpoint-template) | websocketEndpointConfig | {
"repo_name": "isharac/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/TemplateBuilderUtil.java",
"license": "apache-2.0",
"size": 79685
} | [
"org.json.JSONException",
"org.json.simple.JSONObject",
"org.wso2.carbon.apimgt.impl.APIConstants"
] | import org.json.JSONException; import org.json.simple.JSONObject; import org.wso2.carbon.apimgt.impl.APIConstants; | import org.json.*; import org.json.simple.*; import org.wso2.carbon.apimgt.impl.*; | [
"org.json",
"org.json.simple",
"org.wso2.carbon"
] | org.json; org.json.simple; org.wso2.carbon; | 367,621 |
public static ArrayList<ExprNodeDesc> genExprNodeDesc(Operator inputOp, int startPos, int endPos,
boolean addEmptyTabAlias, boolean setColToNonVirtual) {
ArrayList<ExprNodeDesc> exprColLst = new ArrayList<ExprNodeDesc>();
List<ColumnInfo> colInfoLst = inputOp.getSchema().getSignature();
String tabA... | static ArrayList<ExprNodeDesc> function(Operator inputOp, int startPos, int endPos, boolean addEmptyTabAlias, boolean setColToNonVirtual) { ArrayList<ExprNodeDesc> exprColLst = new ArrayList<ExprNodeDesc>(); List<ColumnInfo> colInfoLst = inputOp.getSchema().getSignature(); String tabAlias; boolean vc; ColumnInfo ci; fo... | /**
* Build ExprNodeColumnDesc for the projections in the input operator from
* sartpos to endpos(both included). Operator must have an associated
* colExprMap.
*
* @param inputOp
* Input Hive Operator
* @param startPos
* starting position in the input operator schema; must be ... | Build ExprNodeColumnDesc for the projections in the input operator from sartpos to endpos(both included). Operator must have an associated colExprMap | genExprNodeDesc | {
"repo_name": "nishantmonu51/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDescUtils.java",
"license": "apache-2.0",
"size": 39250
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hive.ql.exec.ColumnInfo",
"org.apache.hadoop.hive.ql.exec.Operator"
] | import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hive.ql.exec.ColumnInfo; import org.apache.hadoop.hive.ql.exec.Operator; | import java.util.*; import org.apache.hadoop.hive.ql.exec.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 776,837 |
private void initViewAllExtension(final View view, double progressFactor) {
if (!hasView()) {
return;
}
final double factorPerc = progressFactor / getExtensionCount();
for (int i = 0; i < getExtensionCount(); i++) {
final Extension extension = getExtension(i... | void function(final View view, double progressFactor) { if (!hasView()) { return; } final double factorPerc = progressFactor / getExtensionCount(); for (int i = 0; i < getExtensionCount(); i++) { final Extension extension = getExtension(i); try { EventQueue.invokeAndWait( new Runnable() { | /**
* Init all extensions with the same View
*
* @param view the View that need to be applied
*/ | Init all extensions with the same View | initViewAllExtension | {
"repo_name": "meitar/zaproxy",
"path": "zap/src/main/java/org/parosproxy/paros/extension/ExtensionLoader.java",
"license": "apache-2.0",
"size": 57249
} | [
"java.awt.EventQueue",
"org.parosproxy.paros.view.View"
] | import java.awt.EventQueue; import org.parosproxy.paros.view.View; | import java.awt.*; import org.parosproxy.paros.view.*; | [
"java.awt",
"org.parosproxy.paros"
] | java.awt; org.parosproxy.paros; | 2,343,709 |
private final ShortPoint2D setPositionsToMap(boolean[][] areaMap, List<ShortPoint2D> positions) {
if (positions.isEmpty()) {
return null;
}
ShortPoint2D upperLeft = positions.get(0);
for (ShortPoint2D curr : positions) {
areaMap[getMapX(curr)][getMapY(curr)] = true;
if (curr.y < upperLeft.y || cu... | final ShortPoint2D function(boolean[][] areaMap, List<ShortPoint2D> positions) { if (positions.isEmpty()) { return null; } ShortPoint2D upperLeft = positions.get(0); for (ShortPoint2D curr : positions) { areaMap[getMapX(curr)][getMapY(curr)] = true; if (curr.y < upperLeft.y curr.y == upperLeft.y && curr.x < upperLeft.x... | /**
* Sets the positions to the map and returns the upper left position
*
* @param areaMap
* @param positions
* @return
*/ | Sets the positions to the map and returns the upper left position | setPositionsToMap | {
"repo_name": "Peter-Maximilian/settlers-remake",
"path": "jsettlers.common/src/main/java/jsettlers/common/map/shapes/FreeMapArea.java",
"license": "mit",
"size": 6974
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 462,861 |
return (T) loader.load(new StringReader(yaml));
}
| return (T) loader.load(new StringReader(yaml)); } | /**
* Parse the first YAML document in a stream and produce the corresponding
* JavaBean.
*
* @param yaml
* YAML document
* @return parsed JavaBean
*/ | Parse the first YAML document in a stream and produce the corresponding JavaBean | load | {
"repo_name": "spariev/snakeyaml",
"path": "src/main/java/org/yaml/snakeyaml/JavaBeanLoader.java",
"license": "apache-2.0",
"size": 2810
} | [
"java.io.StringReader"
] | import java.io.StringReader; | import java.io.*; | [
"java.io"
] | java.io; | 2,381,275 |
private final Collection<PersistentTeamRule> getTeamRulesModifiable() {
return rules;
} | final Collection<PersistentTeamRule> function() { return rules; } | /**
* Returns the modifiable collection of the team type's team rules.
*
* @return the modifiable collection of the team type's team rules
*/ | Returns the modifiable collection of the team type's team rules | getTeamRulesModifiable | {
"repo_name": "Bernardo-MG/dreadball-model-persistence",
"path": "src/main/java/com/bernardomg/tabletop/dreadball/model/persistence/faction/PersistentTeamType.java",
"license": "apache-2.0",
"size": 6028
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,638,596 |
public Adapter createBoolConstantAdapter()
{
return null;
}
| Adapter function() { return null; } | /**
* Creates a new adapter for an object of class '{@link org.xtext.burst.burst.BoolConstant <em>Bool Constant</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway... | Creates a new adapter for an object of class '<code>org.xtext.burst.burst.BoolConstant Bool Constant</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. | createBoolConstantAdapter | {
"repo_name": "Parashift/Burst",
"path": "org.xtext.burst/src-gen/org/xtext/burst/burst/util/BurstAdapterFactory.java",
"license": "agpl-3.0",
"size": 25573
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 972,156 |
public void error(IValidationError error)
{
if (error == null)
{
throw new IllegalArgumentException("Argument [[error]] cannot be null");
}
MessageSource source = new MessageSource();
String message = error.getErrorMessage(source);
if (message == null)
{
StringBuffer buffer = new StringBuffer()... | void function(IValidationError error) { if (error == null) { throw new IllegalArgumentException(STR); } MessageSource source = new MessageSource(); String message = error.getErrorMessage(source); if (message == null) { StringBuffer buffer = new StringBuffer(); buffer.append(STR); buffer.append(Classes.simpleName(getCla... | /**
* Reports a validation error against this form component.
*
* The actual error is reported by creating a {@link ValidationErrorFeedback} object that holds
* both the validation error and the generated error message - so a custom feedback panel can
* have access to both.
*
* @param error
* ... | Reports a validation error against this form component. The actual error is reported by creating a <code>ValidationErrorFeedback</code> object that holds both the validation error and the generated error message - so a custom feedback panel can have access to both | error | {
"repo_name": "astubbs/wicket.get-portals2",
"path": "wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java",
"license": "apache-2.0",
"size": 41204
} | [
"java.util.Iterator",
"org.apache.wicket.util.lang.Classes",
"org.apache.wicket.validation.IValidationError"
] | import java.util.Iterator; import org.apache.wicket.util.lang.Classes; import org.apache.wicket.validation.IValidationError; | import java.util.*; import org.apache.wicket.util.lang.*; import org.apache.wicket.validation.*; | [
"java.util",
"org.apache.wicket"
] | java.util; org.apache.wicket; | 762,093 |
void login(final String serverName,
final String database,
final String user,
final String password,
final String domain,
final String charset,
final String appName,
final String progName,
String ... | void login(final String serverName, final String database, final String user, final String password, final String domain, final String charset, final String appName, final String progName, String wsid, final String language, final String macAddress, final int packetSize) throws SQLException { try { if (wsid.length() ==... | /**
* Login to the SQL Server.
*
* @param serverName server host name
* @param database required database
* @param user user name
* @param password user password
* @param domain Windows NT domain (or null)
* @param charset required server character set
* @pa... | Login to the SQL Server | login | {
"repo_name": "kassak/jtds",
"path": "src/main/net/sourceforge/jtds/jdbc/TdsCore.java",
"license": "lgpl-2.1",
"size": 169087
} | [
"java.io.IOException",
"java.sql.SQLException"
] | import java.io.IOException; import java.sql.SQLException; | import java.io.*; import java.sql.*; | [
"java.io",
"java.sql"
] | java.io; java.sql; | 191,350 |
public static Token<DelegationTokenIdentifier> createToken(
final int sequenceNumber,
final URI uri,
final Text owner,
final Text renewer) {
StubAbfsTokenIdentifier id
= new StubAbfsTokenIdentifier(uri, owner, renewer);
id.setSequenceNumber(sequenceNumber);
Token<Delegation... | static Token<DelegationTokenIdentifier> function( final int sequenceNumber, final URI uri, final Text owner, final Text renewer) { StubAbfsTokenIdentifier id = new StubAbfsTokenIdentifier(uri, owner, renewer); id.setSequenceNumber(sequenceNumber); Token<DelegationTokenIdentifier> token = new Token( id, new TokenSecretM... | /**
* Create a token.
*
* @param sequenceNumber sequence number.
* @param uri FS URI
* @param owner FS owner
* @param renewer renewer
* @return a token.
*/ | Create a token | createToken | {
"repo_name": "apurtell/hadoop",
"path": "hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/extensions/ClassicDelegationTokenManager.java",
"license": "apache-2.0",
"size": 7944
} | [
"org.apache.hadoop.io.Text",
"org.apache.hadoop.security.token.Token",
"org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier"
] | import org.apache.hadoop.io.Text; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier; | import org.apache.hadoop.io.*; import org.apache.hadoop.security.token.*; import org.apache.hadoop.security.token.delegation.web.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,589,284 |
Resources.INSTANCE.comanda_css().ensureInjected();
RootLayoutPanel.get().clear();
String loginToken = Cookies.getCookie("comanda_peter_login_token");
if(loginToken != null && loginToken.length() > 0){
GUIService.login(loginToken, new AsyncCallback<String>() { | Resources.INSTANCE.comanda_css().ensureInjected(); RootLayoutPanel.get().clear(); String loginToken = Cookies.getCookie(STR); if(loginToken != null && loginToken.length() > 0){ GUIService.login(loginToken, new AsyncCallback<String>() { | /**
* This is the entry point method.
*/ | This is the entry point method | onModuleLoad | {
"repo_name": "pgilmon/Comanda",
"path": "comanda-peter/src/com/company/comanda/peter/client/Comanda_peter.java",
"license": "gpl-3.0",
"size": 2744
} | [
"com.company.comanda.peter.client.resources.Resources",
"com.google.gwt.user.client.Cookies",
"com.google.gwt.user.client.rpc.AsyncCallback",
"com.google.gwt.user.client.ui.RootLayoutPanel"
] | import com.company.comanda.peter.client.resources.Resources; import com.google.gwt.user.client.Cookies; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.RootLayoutPanel; | import com.company.comanda.peter.client.resources.*; import com.google.gwt.user.client.*; import com.google.gwt.user.client.rpc.*; import com.google.gwt.user.client.ui.*; | [
"com.company.comanda",
"com.google.gwt"
] | com.company.comanda; com.google.gwt; | 2,218,741 |
public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_)
{
BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_);
return p_73155_1_ == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(p_73155_2_... | List function(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); return p_73155_1_ == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(p_73155_2_, p_73155_3_, p_73155_4_) ? this.scatteredF... | /**
* Returns a list of creatures of the specified type that can spawn at the given location.
*/ | Returns a list of creatures of the specified type that can spawn at the given location | getPossibleCreatures | {
"repo_name": "mviitanen/marsmod",
"path": "mcp/src/minecraft_server/net/minecraft/world/gen/ChunkProviderGenerate.java",
"license": "gpl-2.0",
"size": 20744
} | [
"java.util.List",
"net.minecraft.entity.EnumCreatureType",
"net.minecraft.world.biome.BiomeGenBase"
] | import java.util.List; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.biome.BiomeGenBase; | import java.util.*; import net.minecraft.entity.*; import net.minecraft.world.biome.*; | [
"java.util",
"net.minecraft.entity",
"net.minecraft.world"
] | java.util; net.minecraft.entity; net.minecraft.world; | 1,958,222 |
public Integer getAsInteger(String key) {
Object value = mValues.get(key);
try {
return value != null ? ((Number) value).intValue() : null;
} catch (ClassCastException e) {
if (value instanceof CharSequence) {
try {
return Integer.v... | Integer function(String key) { Object value = mValues.get(key); try { return value != null ? ((Number) value).intValue() : null; } catch (ClassCastException e) { if (value instanceof CharSequence) { try { return Integer.valueOf(value.toString()); } catch (NumberFormatException e2) { Log.e(TAG, STR, value, key); return ... | /**
* Gets a value and converts it to an Integer.
*
* @param key the value to get
* @return the Integer value, or null if the value is missing or cannot be converted
*/ | Gets a value and converts it to an Integer | getAsInteger | {
"repo_name": "netsense-sas/couchbase-lite-java-core",
"path": "src/main/java/com/couchbase/lite/storage/ContentValues.java",
"license": "apache-2.0",
"size": 13439
} | [
"com.couchbase.lite.util.Log"
] | import com.couchbase.lite.util.Log; | import com.couchbase.lite.util.*; | [
"com.couchbase.lite"
] | com.couchbase.lite; | 510,920 |
public static WebApplicationContext findWebApplicationContext(HttpServletRequest request) {
return findWebApplicationContext(request, request.getServletContext());
} | static WebApplicationContext function(HttpServletRequest request) { return findWebApplicationContext(request, request.getServletContext()); } | /**
* Look for the WebApplicationContext associated with the DispatcherServlet
* that has initiated request processing, and for the global context if none
* was found associated with the current request. The global context will
* be found via the ServletContext or via ContextLoader's current context.
* <p>NOT... | Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing, and for the global context if none was found associated with the current request. The global context will be found via the ServletContext or via ContextLoader's current context. for forward-looking custom use... | findWebApplicationContext | {
"repo_name": "boggad/jdk9-sample",
"path": "sample-catalog/spring-jdk9/src/spring.webmvc/org/springframework/web/servlet/support/RequestContextUtils.java",
"license": "mit",
"size": 10526
} | [
"javax.servlet.http.HttpServletRequest",
"org.springframework.web.context.WebApplicationContext"
] | import javax.servlet.http.HttpServletRequest; import org.springframework.web.context.WebApplicationContext; | import javax.servlet.http.*; import org.springframework.web.context.*; | [
"javax.servlet",
"org.springframework.web"
] | javax.servlet; org.springframework.web; | 2,886,938 |
val cxfBus = BusFactory.getDefaultBus();
val sts = new SecurityTokenServiceClient(cxfBus);
sts.setAddressingNamespace(StringUtils.defaultIfBlank(service.getAddressingNamespace(), WSFederationConstants.HTTP_WWW_W3_ORG_2005_08_ADDRESSING));
sts.setTokenType(StringUtils.defaultIfBlank(service.getTo... | val cxfBus = BusFactory.getDefaultBus(); val sts = new SecurityTokenServiceClient(cxfBus); sts.setAddressingNamespace(StringUtils.defaultIfBlank(service.getAddressingNamespace(), WSFederationConstants.HTTP_WWW_W3_ORG_2005_08_ADDRESSING)); sts.setTokenType(StringUtils.defaultIfBlank(service.getTokenType(), WSConstants.W... | /**
* Build client for security token requests.
*
* @param service the rp
* @return the security token service client
*/ | Build client for security token requests | buildClientForSecurityTokenRequests | {
"repo_name": "leleuj/cas",
"path": "support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/SecurityTokenServiceClientBuilder.java",
"license": "apache-2.0",
"size": 4205
} | [
"java.util.HashMap",
"javax.xml.namespace.QName",
"org.apache.commons.lang3.StringUtils",
"org.apache.cxf.BusFactory",
"org.apache.wss4j.dom.WSConstants",
"org.apereo.cas.ws.idp.WSFederationConstants"
] | import java.util.HashMap; import javax.xml.namespace.QName; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.BusFactory; import org.apache.wss4j.dom.WSConstants; import org.apereo.cas.ws.idp.WSFederationConstants; | import java.util.*; import javax.xml.namespace.*; import org.apache.commons.lang3.*; import org.apache.cxf.*; import org.apache.wss4j.dom.*; import org.apereo.cas.ws.idp.*; | [
"java.util",
"javax.xml",
"org.apache.commons",
"org.apache.cxf",
"org.apache.wss4j",
"org.apereo.cas"
] | java.util; javax.xml; org.apache.commons; org.apache.cxf; org.apache.wss4j; org.apereo.cas; | 313,603 |
public ServiceResponse<Colors> getReferenced() throws ErrorException, IOException {
Call<ResponseBody> call = service.getReferenced();
return getReferencedDelegate(call.execute());
} | ServiceResponse<Colors> function() throws ErrorException, IOException { Call<ResponseBody> call = service.getReferenced(); return getReferencedDelegate(call.execute()); } | /**
* Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Colors object wrapped in {@link ServiceResponse} if s... | Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color' | getReferenced | {
"repo_name": "yaqiyang/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java",
"license": "mit",
"size": 18760
} | [
"com.microsoft.rest.ServiceResponse",
"java.io.IOException"
] | import com.microsoft.rest.ServiceResponse; import java.io.IOException; | import com.microsoft.rest.*; import java.io.*; | [
"com.microsoft.rest",
"java.io"
] | com.microsoft.rest; java.io; | 1,158,489 |
void checkInheritability(final String proposedFingerprint) throws AuthorizationAccessException, UninheritableAuthorizationsException; | void checkInheritability(final String proposedFingerprint) throws AuthorizationAccessException, UninheritableAuthorizationsException; | /**
* When the fingerprints are not equal, this method will check if the proposed fingerprint is inheritable.
* If the fingerprint is an exact match, this method will not be invoked as there is nothing to inherit.
*
* @throws AuthorizationAccessException if there was an unexpected error performing t... | When the fingerprints are not equal, this method will check if the proposed fingerprint is inheritable. If the fingerprint is an exact match, this method will not be invoked as there is nothing to inherit | checkInheritability | {
"repo_name": "mcgilman/nifi",
"path": "nifi-framework-api/src/main/java/org/apache/nifi/authorization/ConfigurableUserGroupProvider.java",
"license": "apache-2.0",
"size": 7040
} | [
"org.apache.nifi.authorization.exception.AuthorizationAccessException",
"org.apache.nifi.authorization.exception.UninheritableAuthorizationsException"
] | import org.apache.nifi.authorization.exception.AuthorizationAccessException; import org.apache.nifi.authorization.exception.UninheritableAuthorizationsException; | import org.apache.nifi.authorization.exception.*; | [
"org.apache.nifi"
] | org.apache.nifi; | 2,344,500 |
public static FileStatus[] listChildren(FileSystem fileSystem,
Path path) throws IOException {
FileStatus[] entries = fileSystem.listStatus(path);
if (entries.length == 1 && path.equals(entries[0].getPath())) {
// this is the path: ignore
return new FileStatus[]{};
} else {
return ... | static FileStatus[] function(FileSystem fileSystem, Path path) throws IOException { FileStatus[] entries = fileSystem.listStatus(path); if (entries.length == 1 && path.equals(entries[0].getPath())) { return new FileStatus[]{}; } else { return entries; } } | /**
* List all children of a path, but not the path itself in the case
* that the path refers to a file or empty directory.
* @param fileSystem FS
* @param path path
* @return a list of children, and never the path itself.
* @throws IOException problem in the list process
*/ | List all children of a path, but not the path itself in the case that the path refers to a file or empty directory | listChildren | {
"repo_name": "jaypatil/hadoop",
"path": "hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/ContractTestUtils.java",
"license": "gpl-3.0",
"size": 49505
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,208,636 |
protected IBookingManager getBookingManager(LambdaLogger logger) throws Exception {
// Use a getter here so unit tests can substitute a mock manager
if (!bookingManager.isPresent()) {
bookingManager = Optional.of(new BookingManager());
bookingManager.get().initialise(logger);
}
return book... | IBookingManager function(LambdaLogger logger) throws Exception { if (!bookingManager.isPresent()) { bookingManager = Optional.of(new BookingManager()); bookingManager.get().initialise(logger); } return bookingManager.get(); } | /**
* Returns the {@link squash.booking.lambdas.core.IBookingManager}.
*/ | Returns the <code>squash.booking.lambdas.core.IBookingManager</code> | getBookingManager | {
"repo_name": "robinsteel/Sqawsh",
"path": "src/main/java/squash/booking/lambdas/PutDeleteBookingRuleOrExclusionLambda.java",
"license": "apache-2.0",
"size": 15920
} | [
"com.amazonaws.services.lambda.runtime.LambdaLogger",
"java.util.Optional"
] | import com.amazonaws.services.lambda.runtime.LambdaLogger; import java.util.Optional; | import com.amazonaws.services.lambda.runtime.*; import java.util.*; | [
"com.amazonaws.services",
"java.util"
] | com.amazonaws.services; java.util; | 1,061,746 |
protected ActionListener getPickerActionListener() {
if (pickerActionListener == null) {
pickerActionListener = createPickerActionListener();
}
return pickerActionListener;
} | ActionListener function() { if (pickerActionListener == null) { pickerActionListener = createPickerActionListener(); } return pickerActionListener; } | /**
* Returns the ActionListener to add to the datePicker.
*
* @return the action listener to listen for datePicker's
* action events.
*/ | Returns the ActionListener to add to the datePicker | getPickerActionListener | {
"repo_name": "syncer/swingx",
"path": "swingx-core/src/main/java/org/jdesktop/swingx/table/DatePickerCellEditor.java",
"license": "lgpl-2.1",
"size": 10364
} | [
"java.awt.event.ActionListener"
] | import java.awt.event.ActionListener; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,374,609 |
public void completeCacheFlush(final byte [] encodedRegionName,
final byte [] tableName, final long logSeqId, final boolean isMetaRegion)
throws IOException {
try {
synchronized (updateLock) {
if (this.closed) {
return;
}
long now = System.currentTimeMillis();
... | void function(final byte [] encodedRegionName, final byte [] tableName, final long logSeqId, final boolean isMetaRegion) throws IOException { try { synchronized (updateLock) { if (this.closed) { return; } long now = System.currentTimeMillis(); WALEdit edit = completeCacheFlushLogEdit(); HLogKey key = makeKey(encodedReg... | /**
* Complete the cache flush
*
* Protected by cacheFlushLock
*
* @param encodedRegionName
* @param tableName
* @param logSeqId
* @throws IOException
*/ | Complete the cache flush Protected by cacheFlushLock | completeCacheFlush | {
"repo_name": "lifeng5042/RStore",
"path": "src/org/apache/hadoop/hbase/regionserver/wal/HLog.java",
"license": "gpl-2.0",
"size": 58520
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.HConstants"
] | import java.io.IOException; import org.apache.hadoop.hbase.HConstants; | import java.io.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,936,162 |
@POST
@Consumes
@Path("/{hostId}/commands/enterMaintenanceMode")
public ApiCommand enterMaintenanceMode(@PathParam(HOST_ID) String hostId); | @Path(STR) ApiCommand function(@PathParam(HOST_ID) String hostId); | /**
* Put the host into maintenance mode. This is a synchronous command.
* The result is known immediately upon return.
*
* <p>Available since API v2.</p>
*
* @param hostId The ID of the host
* @return Synchronous command result.
*/ | Put the host into maintenance mode. This is a synchronous command. The result is known immediately upon return. Available since API v2 | enterMaintenanceMode | {
"repo_name": "kostin88/cm_api",
"path": "java/src/main/java/com/cloudera/api/v2/HostsResourceV2.java",
"license": "apache-2.0",
"size": 2100
} | [
"com.cloudera.api.model.ApiCommand",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam"
] | import com.cloudera.api.model.ApiCommand; import javax.ws.rs.Path; import javax.ws.rs.PathParam; | import com.cloudera.api.model.*; import javax.ws.rs.*; | [
"com.cloudera.api",
"javax.ws"
] | com.cloudera.api; javax.ws; | 1,424,155 |
public void loadMedia(MediaInfo media, boolean autoPlay, int position)
throws TransientNetworkDisconnectionException, NoConnectionException {
loadMedia(media, autoPlay, position, null);
} | void function(MediaInfo media, boolean autoPlay, int position) throws TransientNetworkDisconnectionException, NoConnectionException { loadMedia(media, autoPlay, position, null); } | /**
* Loads a media. For this to succeed, you need to have successfully launched the application.
*
* @param media The media to be loaded
* @param autoPlay If <code>true</code>, playback starts after load
* @param position Where to start the playback (only used if autoPlay is <code>true</code>.... | Loads a media. For this to succeed, you need to have successfully launched the application | loadMedia | {
"repo_name": "xiaoyanit/CastVideos-Android-Sample",
"path": "CastCompanionLibrary/src/com/google/android/libraries/cast/companionlibrary/cast/VideoCastManager.java",
"license": "apache-2.0",
"size": 128811
} | [
"com.google.android.gms.cast.MediaInfo",
"com.google.android.libraries.cast.companionlibrary.cast.exceptions.NoConnectionException",
"com.google.android.libraries.cast.companionlibrary.cast.exceptions.TransientNetworkDisconnectionException"
] | import com.google.android.gms.cast.MediaInfo; import com.google.android.libraries.cast.companionlibrary.cast.exceptions.NoConnectionException; import com.google.android.libraries.cast.companionlibrary.cast.exceptions.TransientNetworkDisconnectionException; | import com.google.android.gms.cast.*; import com.google.android.libraries.cast.companionlibrary.cast.exceptions.*; | [
"com.google.android"
] | com.google.android; | 1,606,868 |
@SuppressWarnings("unchecked")
public static<E> Object convertModelObjectListToJSON(List<? extends E> objList, ModelObjectSchema<E> schema) {
JSONArray result = new JSONArray();
for (E obj : objList) {
result.add(convertModelObjectToJSON(obj, schema));
}
return result;
}
/**
* Convert an {@li... | @SuppressWarnings(STR) static<E> Object function(List<? extends E> objList, ModelObjectSchema<E> schema) { JSONArray result = new JSONArray(); for (E obj : objList) { result.add(convertModelObjectToJSON(obj, schema)); } return result; } /** * Convert an {@link OperationResult} to a JSON object. * * @param operationResu... | /**
* Convert a list of model objects to a JSON array object.
*
* @param objList list of model objects
* @param schema the schema for the model objects
* @return a JSON array object
*/ | Convert a list of model objects to a JSON array object | convertModelObjectListToJSON | {
"repo_name": "cloudcoderdotorg/CloudCoder",
"path": "CloudCoderModelClassesJSON/src/org/cloudcoder/app/shared/model/json/JSONConversion.java",
"license": "agpl-3.0",
"size": 15631
} | [
"java.util.List",
"org.cloudcoder.app.shared.model.ModelObjectSchema",
"org.cloudcoder.app.shared.model.OperationResult",
"org.json.simple.JSONArray"
] | import java.util.List; import org.cloudcoder.app.shared.model.ModelObjectSchema; import org.cloudcoder.app.shared.model.OperationResult; import org.json.simple.JSONArray; | import java.util.*; import org.cloudcoder.app.shared.model.*; import org.json.simple.*; | [
"java.util",
"org.cloudcoder.app",
"org.json.simple"
] | java.util; org.cloudcoder.app; org.json.simple; | 885,029 |
return prepareService(AuthenticatedService.class, ManagementBean.class, objects);
} | return prepareService(AuthenticatedService.class, ManagementBean.class, objects); } | /**
* <p>Prepares a Authenticated Service instance. If the given Objects are
* present, then an internal Management Bean is set and so is the given
* resources. If no Objects are given, an empty service instance is
* returned without any bean or other settings set.</p>
*
* @param objects R... | Prepares a Authenticated Service instance. If the given Objects are present, then an internal Management Bean is set and so is the given resources. If no Objects are given, an empty service instance is returned without any bean or other settings set | prepareAuthenticatedService | {
"repo_name": "JavaDogs/cws",
"path": "cws-rest/src/test/java/net/haugr/cws/rest/BeanSetup.java",
"license": "apache-2.0",
"size": 9242
} | [
"net.haugr.cws.core.ManagementBean"
] | import net.haugr.cws.core.ManagementBean; | import net.haugr.cws.core.*; | [
"net.haugr.cws"
] | net.haugr.cws; | 2,245,473 |
EAttribute getResponsiblePartyType_IndividualName(); | EAttribute getResponsiblePartyType_IndividualName(); | /**
* Returns the meta object for the attribute '{@link net.opengis.ows11.ResponsiblePartyType#getIndividualName <em>Individual Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Individual Name</em>'.
* @see net.opengis.ows11.ResponsiblePart... | Returns the meta object for the attribute '<code>net.opengis.ows11.ResponsiblePartyType#getIndividualName Individual Name</code>'. | getResponsiblePartyType_IndividualName | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.ows/src/net/opengis/ows11/Ows11Package.java",
"license": "lgpl-2.1",
"size": 292282
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,256,975 |
@Override
public void onOutputAppend(String noteId, String paragraphId, int index, String output) {
Message msg = new Message(OP.PARAGRAPH_APPEND_OUTPUT)
.put("noteId", noteId)
.put("paragraphId", paragraphId)
.put("index", index)
.put("data", output);
broadcast(noteId, msg);... | void function(String noteId, String paragraphId, int index, String output) { Message msg = new Message(OP.PARAGRAPH_APPEND_OUTPUT) .put(STR, noteId) .put(STR, paragraphId) .put("index", index) .put("data", output); broadcast(noteId, msg); } | /**
* This callback is for the paragraph that runs on ZeppelinServer
* @param noteId
* @param paragraphId
* @param output output to append
*/ | This callback is for the paragraph that runs on ZeppelinServer | onOutputAppend | {
"repo_name": "Altiscale/incubator-zeppelin",
"path": "zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java",
"license": "apache-2.0",
"size": 74250
} | [
"org.apache.zeppelin.notebook.socket.Message"
] | import org.apache.zeppelin.notebook.socket.Message; | import org.apache.zeppelin.notebook.socket.*; | [
"org.apache.zeppelin"
] | org.apache.zeppelin; | 1,342,807 |
@Override
public void mouseClicked (MouseEvent e) {
JPanel parentPanel = (JPanel) e.getSource();
parentPanel.requestFocus();
int x = e.getX();
int y = e.getY();
int xTile = myTileManager.getHorizontalTileNum(x);
int yTile = myTileManager.getVerticalTile... | void function (MouseEvent e) { JPanel parentPanel = (JPanel) e.getSource(); parentPanel.requestFocus(); int x = e.getX(); int y = e.getY(); int xTile = myTileManager.getHorizontalTileNum(x); int yTile = myTileManager.getVerticalTileNum(y); if(SwingUtilities.isLeftMouseButton(e)) { System.out.println(Constants.MOUSE_CLI... | /**
* Handles a mouse click event, which can include a click on a JList
* item in the object panel on the right, or a click on the map, in
* which case the map will create/delete a tile.
*
*/ | Handles a mouse click event, which can include a click on a JList item in the object panel on the right, or a click on the map, in which case the map will create/delete a tile | mouseClicked | {
"repo_name": "michaeltmarion/OOGASalad",
"path": "src/author/listeners/MapCreationMouseListener.java",
"license": "mit",
"size": 3943
} | [
"java.awt.Graphics2D",
"java.awt.event.MouseEvent",
"javax.swing.JPanel",
"javax.swing.SwingUtilities"
] | import java.awt.Graphics2D; import java.awt.event.MouseEvent; import javax.swing.JPanel; import javax.swing.SwingUtilities; | import java.awt.*; import java.awt.event.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,049,537 |
private void setupStatTracking()
throws InvalidAttributeValueException, FatalConfigurationException {
MapType loggers = order.getLoggers();
final String cstName = "crawl-statistics";
if (loggers.isEmpty(null)) {
if (!isCheckpointRecover() && this.statistics == null) {
... | void function() throws InvalidAttributeValueException, FatalConfigurationException { MapType loggers = order.getLoggers(); final String cstName = STR; if (loggers.isEmpty(null)) { if (!isCheckpointRecover() && this.statistics == null) { this.statistics = new StatisticsTracker(cstName); } loggers.addElement(null, (Stati... | /**
* Setup the statistics tracker.
* The statistics object must be created before modules can use it.
* Do it here now so that when modules retrieve the object from the
* controller during initialization (which some do), its in place.
* @throws InvalidAttributeValueException
* @throws Fat... | Setup the statistics tracker. The statistics object must be created before modules can use it. Do it here now so that when modules retrieve the object from the controller during initialization (which some do), its in place | setupStatTracking | {
"repo_name": "chenyahui/Not-yet-named",
"path": "Not-yet-named/src/org/archive/crawler/framework/CrawlController.java",
"license": "lgpl-2.1",
"size": 76741
} | [
"java.util.Iterator",
"javax.management.InvalidAttributeValueException",
"org.archive.crawler.admin.StatisticsTracker",
"org.archive.crawler.framework.exceptions.FatalConfigurationException",
"org.archive.crawler.settings.MapType"
] | import java.util.Iterator; import javax.management.InvalidAttributeValueException; import org.archive.crawler.admin.StatisticsTracker; import org.archive.crawler.framework.exceptions.FatalConfigurationException; import org.archive.crawler.settings.MapType; | import java.util.*; import javax.management.*; import org.archive.crawler.admin.*; import org.archive.crawler.framework.exceptions.*; import org.archive.crawler.settings.*; | [
"java.util",
"javax.management",
"org.archive.crawler"
] | java.util; javax.management; org.archive.crawler; | 2,409,280 |
public Optional<Integer> declareManagedMemoryUseCaseAtOperatorScope(
ManagedMemoryUseCase managedMemoryUseCase, int weight) {
Preconditions.checkNotNull(managedMemoryUseCase);
Preconditions.checkArgument(
managedMemoryUseCase.scope == ManagedMemoryUseCase.Scope.OPERATOR,
... | Optional<Integer> function( ManagedMemoryUseCase managedMemoryUseCase, int weight) { Preconditions.checkNotNull(managedMemoryUseCase); Preconditions.checkArgument( managedMemoryUseCase.scope == ManagedMemoryUseCase.Scope.OPERATOR, STR); Preconditions.checkArgument( weight > 0, STR); return Optional.ofNullable( managedM... | /**
* Declares that this transformation contains certain operator scope managed memory use case.
*
* @param managedMemoryUseCase The use case that this transformation declares needing managed
* memory for.
* @param weight Use-case-specific weights for this transformation. Used for sharing m... | Declares that this transformation contains certain operator scope managed memory use case | declareManagedMemoryUseCaseAtOperatorScope | {
"repo_name": "apache/flink",
"path": "flink-core/src/main/java/org/apache/flink/api/dag/Transformation.java",
"license": "apache-2.0",
"size": 23957
} | [
"java.util.Optional",
"org.apache.flink.core.memory.ManagedMemoryUseCase",
"org.apache.flink.util.Preconditions"
] | import java.util.Optional; import org.apache.flink.core.memory.ManagedMemoryUseCase; import org.apache.flink.util.Preconditions; | import java.util.*; import org.apache.flink.core.memory.*; import org.apache.flink.util.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 684,367 |
public static MenuElement getFirstSelectableItem(final MenuElement[] children) {
if (isEmptyArray(children)) {
return null;
}
for (int i = 0; i < children.length; i++) {
Component component = children[i].getComponent();
if (component == null && children[i... | static MenuElement function(final MenuElement[] children) { if (isEmptyArray(children)) { return null; } for (int i = 0; i < children.length; i++) { Component component = children[i].getComponent(); if (component == null && children[i] instanceof Component) { component = (Component)children[i]; } if (component != null ... | /**
* Gets first visible and enabled item from the list of MenuElements.
*
* @param children the list of elements to select from
* @return visible and enabled element if any, null otherwise
*/ | Gets first visible and enabled item from the list of MenuElements | getFirstSelectableItem | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/archive/classlib/java6/modules/swing/src/main/java/common/org/apache/harmony/x/swing/Utilities.java",
"license": "apache-2.0",
"size": 42718
} | [
"java.awt.Component",
"javax.swing.MenuElement"
] | import java.awt.Component; import javax.swing.MenuElement; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,115,511 |
@JsonProperty("groupByColumns")
public void setGroupByColumns(List<String> groupByColumns) {
_groupByColumns = groupByColumns;
} | @JsonProperty(STR) void function(List<String> groupByColumns) { _groupByColumns = groupByColumns; } | /**
* Set groupByColumns for the aggregation function.
* @param groupByColumns
*/ | Set groupByColumns for the aggregation function | setGroupByColumns | {
"repo_name": "tkao1000/pinot",
"path": "pinot-common/src/main/java/com/linkedin/pinot/common/response/broker/AggregationResult.java",
"license": "apache-2.0",
"size": 3679
} | [
"java.util.List",
"org.codehaus.jackson.annotate.JsonProperty"
] | import java.util.List; import org.codehaus.jackson.annotate.JsonProperty; | import java.util.*; import org.codehaus.jackson.annotate.*; | [
"java.util",
"org.codehaus.jackson"
] | java.util; org.codehaus.jackson; | 921,841 |
public HTable createMultiRegionTable(TableName tableName, byte[][] families, int numVersions)
throws IOException {
return createTable(tableName, families, numVersions, KEYS_FOR_HBA_CREATE_TABLE);
}
/**
* Create a table.
* @param tableName
* @param families
* @param numVersions
* @param b... | HTable function(TableName tableName, byte[][] families, int numVersions) throws IOException { return createTable(tableName, families, numVersions, KEYS_FOR_HBA_CREATE_TABLE); } /** * Create a table. * @param tableName * @param families * @param numVersions * @param blockSize * @return An HTable instance for the created... | /**
* Create a table with multiple regions.
* @param tableName
* @param families
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
*/ | Create a table with multiple regions | createMultiRegionTable | {
"repo_name": "juwi/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 151512
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.HTable"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.HTable; | import java.io.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 95,121 |
static String getString(String key){
String value=instance.getProperty(key);
if(value==null) //delegate to default
return Parameters.getString(key);
return value;
}
| static String getString(String key){ String value=instance.getProperty(key); if(value==null) return Parameters.getString(key); return value; } | /**
* Returns a property by key as String
*/ | Returns a property by key as String | getString | {
"repo_name": "Anode1/aisgedcom",
"path": "src/org/is/ais/gedcom/gui/UserParameters.java",
"license": "gpl-2.0",
"size": 3114
} | [
"org.is.ais.gedcom.Parameters"
] | import org.is.ais.gedcom.Parameters; | import org.is.ais.gedcom.*; | [
"org.is.ais"
] | org.is.ais; | 1,159,677 |
JavaBeanTester.builder(StandardSeriesProvider.class).loadData().test();
} | JavaBeanTester.builder(StandardSeriesProvider.class).loadData().test(); } | /**
* Javabean tester.
*/ | Javabean tester | javabeanTester | {
"repo_name": "dougwm/psi-probe",
"path": "core/src/test/java/psiprobe/beans/stats/providers/StandardSeriesProviderTest.java",
"license": "gpl-2.0",
"size": 773
} | [
"com.codebox.bean.JavaBeanTester"
] | import com.codebox.bean.JavaBeanTester; | import com.codebox.bean.*; | [
"com.codebox.bean"
] | com.codebox.bean; | 675,472 |
@Override()
public java.lang.Class getJavaClass(
) {
return org.chocolate_milk.model.DefaultTaxableSalesTaxCodeRef.class;
} | @Override() java.lang.Class function( ) { return org.chocolate_milk.model.DefaultTaxableSalesTaxCodeRef.class; } | /**
* Method getJavaClass.
*
* @return the Java class represented by this descriptor.
*/ | Method getJavaClass | getJavaClass | {
"repo_name": "galleon1/chocolate-milk",
"path": "src/org/chocolate_milk/model/descriptors/DefaultTaxableSalesTaxCodeRefDescriptor.java",
"license": "lgpl-3.0",
"size": 5906
} | [
"org.chocolate_milk.model.DefaultTaxableSalesTaxCodeRef"
] | import org.chocolate_milk.model.DefaultTaxableSalesTaxCodeRef; | import org.chocolate_milk.model.*; | [
"org.chocolate_milk.model"
] | org.chocolate_milk.model; | 1,425,268 |
private void processLeftclick(MouseEvent e) {
//Leftclicks not processed so far
}
| void function(MouseEvent e) { } | /**
* Process a left click
*
* @param e The MouseEvent associated with the click
*/ | Process a left click | processLeftclick | {
"repo_name": "vitruv-tools/Vitruv",
"path": "bundles/extensions/changevisualization/tools.vitruv.extensions.changevisualization/src/tools/vitruv/extensions/changevisualization/tree/TreeMouseListener.java",
"license": "epl-1.0",
"size": 7137
} | [
"java.awt.event.MouseEvent"
] | import java.awt.event.MouseEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,672,423 |
protected void propertyChanged(ComplexProperty complexProperty) {
Iterator<Entry<PropertyDefinition, Object>> it = this.properties
.entrySet().iterator();
while (it.hasNext()) {
Entry<PropertyDefinition, Object> keyValuePair = it.next();
if (keyValuePair.getValue().equals(complexProperty)) {
if (!t... | void function(ComplexProperty complexProperty) { Iterator<Entry<PropertyDefinition, Object>> it = this.properties .entrySet().iterator(); while (it.hasNext()) { Entry<PropertyDefinition, Object> keyValuePair = it.next(); if (keyValuePair.getValue().equals(complexProperty)) { if (!this.deletedProperties.containsKey(keyV... | /**
* Handles a change event for the specified property.
*
* @param complexProperty
* The property that changes.
*/ | Handles a change event for the specified property | propertyChanged | {
"repo_name": "java-goodies/ews-java-api",
"path": "src/main/java/microsoft/exchange/webservices/data/PropertyBag.java",
"license": "mit",
"size": 28858
} | [
"java.util.Iterator",
"java.util.Map"
] | import java.util.Iterator; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,469,869 |
public String prunedLabel(Tree node) {
Map<String, Integer> counterMap = node.getSubtreeCounterMap();
int maximum = 0;
String label = "";
for (String entry : counterMap.keySet()) {
int number = counterMap.get(entry);
if (number > maximum) {
maximum = number;
label = entry;
}
}
return lab... | String function(Tree node) { Map<String, Integer> counterMap = node.getSubtreeCounterMap(); int maximum = 0; String label = ""; for (String entry : counterMap.keySet()) { int number = counterMap.get(entry); if (number > maximum) { maximum = number; label = entry; } } return label; } | /**
* Calculates the label a node would have if it became a leaf.
*
* @param node
* a node that is not a leaf
* @return the majority label
*/ | Calculates the label a node would have if it became a leaf | prunedLabel | {
"repo_name": "boob-sbcm/3838438",
"path": "src/main/java/com/rapidminer/operator/learner/tree/TreebasedPessimisticPruner.java",
"license": "agpl-3.0",
"size": 6410
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,434,839 |
public static Object invokeMethodFromClass(String className, String methodName, Object args, ClassLoader classLoader)
throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalArgumentException, SecurityException,
InstantiationException {
Class<?> c = cl... | static Object function(String className, String methodName, Object args, ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalArgumentException, SecurityException, InstantiationException { Class<?> c = classLoader.loadClass(className); return invokeMethodFromC... | /**
* Invoke static methodName from className with args arguments.
*/ | Invoke static methodName from className with args arguments | invokeMethodFromClass | {
"repo_name": "codelibs/n2dms",
"path": "src/main/java/com/openkm/util/cl/ClassLoaderUtils.java",
"license": "gpl-2.0",
"size": 6870
} | [
"java.lang.reflect.InvocationTargetException"
] | import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,833,751 |
public String getAnonymous()
{
return Validator.check(anonymous, "false");
} | String function() { return Validator.check(anonymous, "false"); } | /**
* Is this anonymous grading?
*
* @return anonymous grading? true or false
*/ | Is this anonymous grading | getAnonymous | {
"repo_name": "OpenCollabZA/sakai",
"path": "samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/TotalScoresBean.java",
"license": "apache-2.0",
"size": 35372
} | [
"org.sakaiproject.tool.assessment.ui.bean.util.Validator"
] | import org.sakaiproject.tool.assessment.ui.bean.util.Validator; | import org.sakaiproject.tool.assessment.ui.bean.util.*; | [
"org.sakaiproject.tool"
] | org.sakaiproject.tool; | 993,552 |
@SuppressWarnings("unchecked")
private void modifyReplace( String id, Entry entry, Attribute mods ) throws Exception
{
if ( entry instanceof ClonedServerEntry )
{
throw new Exception( I18n.err( I18n.ERR_215 ) );
}
String modsOid = schemaManager.getAttributeTypeRe... | @SuppressWarnings(STR) void function( String id, Entry entry, Attribute mods ) throws Exception { if ( entry instanceof ClonedServerEntry ) { throw new Exception( I18n.err( I18n.ERR_215 ) ); } String modsOid = schemaManager.getAttributeTypeRegistry().getOidByName( mods.getId() ); AttributeType attributeType = mods.getA... | /**
* Completely replaces the existing set of values for an attribute with the
* modified values supplied affecting the appropriate userIndices. The entry
* is not persisted: it is only changed in anticipation for a put into the
* master table.
*
* @param id the primary key of the entry
... | Completely replaces the existing set of values for an attribute with the modified values supplied affecting the appropriate userIndices. The entry is not persisted: it is only changed in anticipation for a put into the master table | modifyReplace | {
"repo_name": "darranl/directory-server",
"path": "xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java",
"license": "apache-2.0",
"size": 106249
} | [
"org.apache.directory.api.ldap.model.constants.SchemaConstants",
"org.apache.directory.api.ldap.model.entry.Attribute",
"org.apache.directory.api.ldap.model.entry.Entry",
"org.apache.directory.api.ldap.model.entry.Value",
"org.apache.directory.api.ldap.model.name.Dn",
"org.apache.directory.api.ldap.model.... | import org.apache.directory.api.ldap.model.constants.SchemaConstants; import org.apache.directory.api.ldap.model.entry.Attribute; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.entry.Value; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.director... | import org.apache.directory.api.ldap.model.constants.*; import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.api.ldap.model.name.*; import org.apache.directory.api.ldap.model.schema.*; import org.apache.directory.server.core.api.entry.*; import org.apache.directory.server.i18n.*; import org.a... | [
"org.apache.directory"
] | org.apache.directory; | 1,168,079 |
public byte[] getPasswordHash(String username, String password) {
try {
SecretKeyFactory f = SecretKeyFactory.getInstance(HASH_ALGORITHM);
KeySpec ks = new PBEKeySpec(password.toCharArray(), username.getBytes(CHARSET), HASH_ITERATION_COUNT, HASH_KEY_LENGTH);
SecretKey s =... | byte[] function(String username, String password) { try { SecretKeyFactory f = SecretKeyFactory.getInstance(HASH_ALGORITHM); KeySpec ks = new PBEKeySpec(password.toCharArray(), username.getBytes(CHARSET), HASH_ITERATION_COUNT, HASH_KEY_LENGTH); SecretKey s = f.generateSecret(ks); return s.getEncoded(); } catch (Unsuppo... | /**
* Calculates the password hash for the given username and password.
* @param username
* @param password
* @return
*/ | Calculates the password hash for the given username and password | getPasswordHash | {
"repo_name": "itlenergy/server-api",
"path": "itlenergy-ejb/src/main/java/com/itl_energy/repo/UserCollection.java",
"license": "mit",
"size": 3055
} | [
"java.io.UnsupportedEncodingException",
"java.security.NoSuchAlgorithmException",
"java.security.spec.InvalidKeySpecException",
"java.security.spec.KeySpec",
"javax.crypto.SecretKey",
"javax.crypto.SecretKeyFactory",
"javax.crypto.spec.PBEKeySpec"
] | import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.security.spec.KeySpec; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; | import java.io.*; import java.security.*; import java.security.spec.*; import javax.crypto.*; import javax.crypto.spec.*; | [
"java.io",
"java.security",
"javax.crypto"
] | java.io; java.security; javax.crypto; | 2,451,720 |
public ArrayList<Integer> getListInt(String key) {
String[] myList = TextUtils.split(preferences.getString(key, ""), "‚‗‚");
ArrayList<String> arrayToList = new ArrayList<String>(Arrays.asList(myList));
ArrayList<Integer> newList = new ArrayList<Integer>();
for (String item : arrayT... | ArrayList<Integer> function(String key) { String[] myList = TextUtils.split(preferences.getString(key, STR‚‗‚"); ArrayList<String> arrayToList = new ArrayList<String>(Arrays.asList(myList)); ArrayList<Integer> newList = new ArrayList<Integer>(); for (String item : arrayToList) newList.add(Integer.parseInt(item)); retur... | /**
* Get parsed ArrayList of Integers from SharedPreferences at 'key'
* @param key SharedPreferences key
* @return ArrayList of Integers
*/ | Get parsed ArrayList of Integers from SharedPreferences at 'key' | getListInt | {
"repo_name": "vector-solutions/MatzoMatch",
"path": "app/src/main/java/com/algorepublic/matzomatch/Utils/TinyDB.java",
"license": "apache-2.0",
"size": 16343
} | [
"android.text.TextUtils",
"java.util.ArrayList",
"java.util.Arrays"
] | import android.text.TextUtils; import java.util.ArrayList; import java.util.Arrays; | import android.text.*; import java.util.*; | [
"android.text",
"java.util"
] | android.text; java.util; | 2,134,214 |
public boolean setRequested(PEPeer peer, int blockNumber)
{
if (!downloaded[blockNumber])
{
requested[blockNumber] =peer.getIp();
return true;
}
return false;
}
| boolean function(PEPeer peer, int blockNumber) { if (!downloaded[blockNumber]) { requested[blockNumber] =peer.getIp(); return true; } return false; } | /**
* Assumption - single threaded with getAndMarkBlock
*/ | Assumption - single threaded with getAndMarkBlock | setRequested | {
"repo_name": "thangbn/Direct-File-Downloader",
"path": "src/src/org/gudy/azureus2/core3/peer/impl/PEPieceImpl.java",
"license": "gpl-2.0",
"size": 20136
} | [
"org.gudy.azureus2.core3.peer.PEPeer"
] | import org.gudy.azureus2.core3.peer.PEPeer; | import org.gudy.azureus2.core3.peer.*; | [
"org.gudy.azureus2"
] | org.gudy.azureus2; | 1,677,250 |
protected void loadEndOfCentralDirectory() throws IOException {
cdir = null;
long size = fileChannel.size();
verbose("Loading ZipIn: " + filename);
verbose("-- size: " + size);
int cap = (int) Math.min(size, MAX_EOCD_SIZE);
ByteBuffer buffer = ByteBuffer.allocate(cap).order(ByteOrder.LITTLE_EN... | void function() throws IOException { cdir = null; long size = fileChannel.size(); verbose(STR + filename); verbose(STR + size); int cap = (int) Math.min(size, MAX_EOCD_SIZE); ByteBuffer buffer = ByteBuffer.allocate(cap).order(ByteOrder.LITTLE_ENDIAN); long offset = size - cap; while (true) { fileChannel.position(offset... | /**
* Locates the "end of central directory" record, expected located at the end of the file, and
* reads it into a byte buffer. Called on the first invocation of
* {@link #endOfCentralDirectory() }.
*
* @throws IOException
*/ | Locates the "end of central directory" record, expected located at the end of the file, and reads it into a byte buffer. Called on the first invocation of <code>#endOfCentralDirectory() </code> | loadEndOfCentralDirectory | {
"repo_name": "hhclam/bazel",
"path": "src/tools/android/java/com/google/devtools/build/android/ziputils/ZipIn.java",
"license": "apache-2.0",
"size": 24358
} | [
"java.io.IOException",
"java.nio.ByteBuffer",
"java.nio.ByteOrder"
] | import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; | import java.io.*; import java.nio.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 506,325 |
public static Set<Pair<Text,Text>> getFetchedColumns(Class<?> implementingClass, Configuration conf) {
checkArgument(conf != null, "conf is null");
String confValue = conf.get(enumToConfKey(implementingClass, ScanOpts.COLUMNS));
List<String> serialized = new ArrayList<String>();
if (confValue != null)... | static Set<Pair<Text,Text>> function(Class<?> implementingClass, Configuration conf) { checkArgument(conf != null, STR); String confValue = conf.get(enumToConfKey(implementingClass, ScanOpts.COLUMNS)); List<String> serialized = new ArrayList<String>(); if (confValue != null) { for (String val : confValue.split(",", -1)... | /**
* Gets the columns to be mapped over from this job.
*
* @param implementingClass
* the class whose name will be used as a prefix for the property configuration key
* @param conf
* the Hadoop configuration object to configure
* @return a set of columns
* @since 1.6.0
* @... | Gets the columns to be mapped over from this job | getFetchedColumns | {
"repo_name": "joshelser/accumulo",
"path": "mapreduce/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java",
"license": "apache-2.0",
"size": 34615
} | [
"com.google.common.base.Preconditions",
"java.util.ArrayList",
"java.util.List",
"java.util.Set",
"org.apache.accumulo.core.util.Pair",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.io.Text"
] | import com.google.common.base.Preconditions; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.apache.accumulo.core.util.Pair; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; | import com.google.common.base.*; import java.util.*; import org.apache.accumulo.core.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.io.*; | [
"com.google.common",
"java.util",
"org.apache.accumulo",
"org.apache.hadoop"
] | com.google.common; java.util; org.apache.accumulo; org.apache.hadoop; | 1,837,674 |
public SyntaxTreeNode parse(InputSource input) {
try {
// Create a SAX parser and get the XMLReader object it uses
final SAXParserFactory factory = FactoryImpl.getSAXFactory(_useServicesMechanism);
if (_xsltc.isSecureProcessing()) {
try {
... | SyntaxTreeNode function(InputSource input) { try { final SAXParserFactory factory = FactoryImpl.getSAXFactory(_useServicesMechanism); if (_xsltc.isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } try { factory.setFeature(Constants.NAMESPACE_FEAT... | /**
* Parses a stylesheet and builds the internal abstract syntax tree
* @param input A SAX2 InputSource can be passed to a SAX reader
* @return The root of the abstract syntax tree
*/ | Parses a stylesheet and builds the internal abstract syntax tree | parse | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java",
"license": "apache-2.0",
"size": 56723
} | [
"com.sun.org.apache.xalan.internal.XalanConstants",
"com.sun.org.apache.xalan.internal.utils.FactoryImpl",
"com.sun.org.apache.xalan.internal.utils.XMLSecurityManager",
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg",
"javax.xml.XMLConstants",
"javax.xml.parsers.ParserConfigurationExcepti... | import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import javax.xml.XMLConstants; import javax.xml.parsers.ParserCon... | import com.sun.org.apache.xalan.internal.*; import com.sun.org.apache.xalan.internal.utils.*; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.*; import javax.xml.*; import javax.xml.parsers.*; import org.xml.sax.*; | [
"com.sun.org",
"javax.xml",
"org.xml.sax"
] | com.sun.org; javax.xml; org.xml.sax; | 265,596 |
public ImmutableSet<CppSource> getCompilationUnitSources() {
return ImmutableSet.copyOf(this.compilationUnitSources.values());
} | ImmutableSet<CppSource> function() { return ImmutableSet.copyOf(this.compilationUnitSources.values()); } | /**
* Returns the compilation unit sources. That includes all compiled source files as well as
* headers that will be parsed or preprocessed. Each source file contains the label it arises from
* in the build graph as well as {@code FeatureConfiguration} that should be used during its
* compilation.
*/ | Returns the compilation unit sources. That includes all compiled source files as well as headers that will be parsed or preprocessed. Each source file contains the label it arises from in the build graph as well as FeatureConfiguration that should be used during its compilation | getCompilationUnitSources | {
"repo_name": "werkt/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java",
"license": "apache-2.0",
"size": 88140
} | [
"com.google.common.collect.ImmutableSet"
] | import com.google.common.collect.ImmutableSet; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 2,412,378 |
private void addToken(final Token thisToken) {
this.tokenBuffer.add(thisToken);
} //addToken | void function(final Token thisToken) { this.tokenBuffer.add(thisToken); } | /**
* Adds a token to the vector of Tokens
* @param thisToken
*/ | Adds a token to the vector of Tokens | addToken | {
"repo_name": "eroslevi/titan.EclipsePlug-ins",
"path": "org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/parsers/RecordParser.java",
"license": "epl-1.0",
"size": 14738
} | [
"org.eclipse.titan.log.viewer.parsers.token.Token"
] | import org.eclipse.titan.log.viewer.parsers.token.Token; | import org.eclipse.titan.log.viewer.parsers.token.*; | [
"org.eclipse.titan"
] | org.eclipse.titan; | 717,493 |
public void putDouble(double d, Integer pos){
checkSize(Sizes.sizeof(double.class), pos);
if(pos == null){
data.putDouble(d);
} else {
data.putDouble(pos, d);
}
} | void function(double d, Integer pos){ checkSize(Sizes.sizeof(double.class), pos); if(pos == null){ data.putDouble(d); } else { data.putDouble(pos, d); } } | /**
* Writes a java double into the array.
* @param d The data to write.
* @param pos The position to start writing from, or null to use the current position.
*/ | Writes a java double into the array | putDouble | {
"repo_name": "Techcable/CommandHelper",
"path": "src/main/java/com/laytonsmith/core/constructs/CByteArray.java",
"license": "mit",
"size": 14017
} | [
"com.laytonsmith.PureUtilities"
] | import com.laytonsmith.PureUtilities; | import com.laytonsmith.*; | [
"com.laytonsmith"
] | com.laytonsmith; | 294,758 |
@OneToMany( fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "client" )
@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
@Basic( optional = false )
@Column( nullable = false )
public Set<Enrollment> getEnrollments() {
ret... | @OneToMany( fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = STR ) @org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE}) @Basic( optional = false ) @Column( nullable = false ) Set<Enrollment> function() { return this.enrollments; } | /**
* Return the value associated with the column: enrollment.
* @return A Set<Enrollment> object (this.enrollment)
*/ | Return the value associated with the column: enrollment | getEnrollments | {
"repo_name": "servinglynk/hmis-lynk-open-source",
"path": "hmis-model-v2015/src/main/java/com/servinglynk/hmis/warehouse/model/v2015/Client.java",
"license": "mpl-2.0",
"size": 23038
} | [
"java.util.Set",
"javax.persistence.Basic",
"javax.persistence.CascadeType",
"javax.persistence.Column",
"javax.persistence.FetchType",
"javax.persistence.OneToMany"
] | import java.util.Set; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.FetchType; import javax.persistence.OneToMany; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 1,844,492 |
public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, org.apache.thrift.TException; | boolean function(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, org.apache.thrift.TException; | /**
* Atomically checks if a row/family/qualifier value matches the expected
* value. If it does, it adds the TPut.
*
* @return true if the new put was executed, false otherwise
*
* @param table to check in and put to
*
* @param row row to check
*
* @param family co... | Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the TPut | checkAndPut | {
"repo_name": "daidong/DominoHBase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java",
"license": "apache-2.0",
"size": 480613
} | [
"java.nio.ByteBuffer",
"org.apache.thrift.TException"
] | import java.nio.ByteBuffer; import org.apache.thrift.TException; | import java.nio.*; import org.apache.thrift.*; | [
"java.nio",
"org.apache.thrift"
] | java.nio; org.apache.thrift; | 438,562 |
static boolean isLocale(String localeCandidate)
{
boolean isLocale = false;
Locale locale = parseLocale(localeCandidate);
if (locale != null)
{
for (final Locale l : Locale.getAvailableLocales())
{
if (l.equals(locale))
{
isLocale = true;
break;
}
}
}
return isLocale;
} | static boolean isLocale(String localeCandidate) { boolean isLocale = false; Locale locale = parseLocale(localeCandidate); if (locale != null) { for (final Locale l : Locale.getAvailableLocales()) { if (l.equals(locale)) { isLocale = true; break; } } } return isLocale; } | /**
* Checks whether the passed parameter can be parsed to an existing locale
*
* @param localeCandidate
* @return
*/ | Checks whether the passed parameter can be parsed to an existing locale | isLocale | {
"repo_name": "dashorst/wicket",
"path": "wicket-examples/src/main/java/org/apache/wicket/examples/requestmapper/LocaleHelper.java",
"license": "apache-2.0",
"size": 1991
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 1,003,881 |
public static List<CasoDeUso> getCasosDeUso() {
if (casosDeUso == null) {
CasoDeUsoLoader.inicializarClase();
}
return casosDeUso;
} | static List<CasoDeUso> function() { if (casosDeUso == null) { CasoDeUsoLoader.inicializarClase(); } return casosDeUso; } | /**
* Devuelve todos los Casos de Uso del Sistema cargados desde la BD.
* @return Lista con objetos CasoDeUso.
*/ | Devuelve todos los Casos de Uso del Sistema cargados desde la BD | getCasosDeUso | {
"repo_name": "marcelobusico/simbya-gecom",
"path": "GecomPojoLib/src/simbya/gecom/entidades/seguridad/CasoDeUso.java",
"license": "gpl-3.0",
"size": 9873
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,983,321 |
String inputFolder = "";
String outputFolder = "";
String workload = "random"; // Random workload
String vmAllocationPolicy = "lr"; // Local Regression (LR) VM allocation policy
String vmSelectionPolicy = "rs"; // Random Selection (RS) VM selection policy
double safetyParameter = 1.2;
new RandomRun... | String inputFolder = STRSTRrandomSTRlrSTRrs"; double safetyParameter = 1.2; new RandomRunner( true, false, inputFolder, outputFolder, workload, vmAllocationPolicy, vmSelectionPolicy, safetyParameter); } | /**
* The main method.
*
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/ | The main method | main | {
"repo_name": "RaysaOliveira/cloudsim-plus",
"path": "cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/power/random/LrRs.java",
"license": "gpl-3.0",
"size": 1664
} | [
"org.cloudbus.cloudsim.examples.power.util.RandomRunner"
] | import org.cloudbus.cloudsim.examples.power.util.RandomRunner; | import org.cloudbus.cloudsim.examples.power.util.*; | [
"org.cloudbus.cloudsim"
] | org.cloudbus.cloudsim; | 88,645 |
public void maybeUpdateGCGraceSeconds() {
logger.info("Checking tables in " + keyspace + " to see if gc_grace_seconds needs to be updated");
Stopwatch stopwatch = Stopwatch.createStarted();
Map<String, String> replication = session.getCluster().getMetadata().getKeyspace(keyspace).getReplicat... | void function() { logger.info(STR + keyspace + STR); Stopwatch stopwatch = Stopwatch.createStarted(); Map<String, String> replication = session.getCluster().getMetadata().getKeyspace(keyspace).getReplication(); String replicationFactor = replication.get(STR); Completable check; if (getClusterSize() == 1 replicationFact... | /**
* Asynchronously performs gc_grace_seconds updates if necessary. This method should <strong>not</strong> be called
* until schema updates have finished.
*/ | Asynchronously performs gc_grace_seconds updates if necessary. This method should not be called until schema updates have finished | maybeUpdateGCGraceSeconds | {
"repo_name": "tsegismont/hawkular-metrics",
"path": "core/metrics-core-service/src/main/java/org/hawkular/metrics/core/util/GCGraceSecondsManager.java",
"license": "apache-2.0",
"size": 9356
} | [
"com.google.common.base.Stopwatch",
"java.util.Map",
"java.util.concurrent.TimeUnit"
] | import com.google.common.base.Stopwatch; import java.util.Map; import java.util.concurrent.TimeUnit; | import com.google.common.base.*; import java.util.*; import java.util.concurrent.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 1,166,761 |
public GuacamoleTunnel connect(AuthenticatedUser user,
ModeledConnection connection, GuacamoleClientInformation info)
throws GuacamoleException {
// Connect only if READ permission is granted
if (hasObjectPermission(user, connection.getIdentifier(), ObjectPermission.Type.REA... | GuacamoleTunnel function(AuthenticatedUser user, ModeledConnection connection, GuacamoleClientInformation info) throws GuacamoleException { if (hasObjectPermission(user, connection.getIdentifier(), ObjectPermission.Type.READ)) return tunnelService.getGuacamoleTunnel(user, connection, info); throw new GuacamoleSecurityE... | /**
* Connects to the given connection as the given user, using the given
* client information. If the user does not have permission to read the
* connection, permission will be denied.
*
* @param user
* The user connecting to the connection.
*
* @param connection
* ... | Connects to the given connection as the given user, using the given client information. If the user does not have permission to read the connection, permission will be denied | connect | {
"repo_name": "Calvin-CS/Agora",
"path": "guacamole-client/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/connection/ConnectionService.java",
"license": "gpl-3.0",
"size": 18530
} | [
"org.glyptodon.guacamole.GuacamoleException",
"org.glyptodon.guacamole.GuacamoleSecurityException",
"org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser",
"org.glyptodon.guacamole.net.GuacamoleTunnel",
"org.glyptodon.guacamole.net.auth.permission.ObjectPermission",
"org.glyptodon.guacamole.protocol.G... | import org.glyptodon.guacamole.GuacamoleException; import org.glyptodon.guacamole.GuacamoleSecurityException; import org.glyptodon.guacamole.auth.jdbc.user.AuthenticatedUser; import org.glyptodon.guacamole.net.GuacamoleTunnel; import org.glyptodon.guacamole.net.auth.permission.ObjectPermission; import org.glyptodon.gua... | import org.glyptodon.guacamole.*; import org.glyptodon.guacamole.auth.jdbc.user.*; import org.glyptodon.guacamole.net.*; import org.glyptodon.guacamole.net.auth.permission.*; import org.glyptodon.guacamole.protocol.*; | [
"org.glyptodon.guacamole"
] | org.glyptodon.guacamole; | 2,581,100 |
Map<String, Map<String, Interest>> interestsByCategory(final PluginTask task, Schema schema) throws JsonProcessingException
{
if (!task.getGroupingColumns().isPresent() || task.getGroupingColumns().get().isEmpty()) {
return Collections.emptyMap();
}
try (MailChimpRetryable re... | Map<String, Map<String, Interest>> interestsByCategory(final PluginTask task, Schema schema) throws JsonProcessingException { if (!task.getGroupingColumns().isPresent() task.getGroupingColumns().get().isEmpty()) { return Collections.emptyMap(); } try (MailChimpRetryable retryable = new MailChimpRetryable(task)) { List<... | /**
* Extract interest categories by group names. Loop via categories and fetch category details
* Reference: https://developer.mailchimp.com/documentation/mailchimp/reference/lists/interest-categories/#read-get_lists_list_id_interest_categories
* https://developer.mailchimp.com/documentation/mailchimp/r... | Extract interest categories by group names. Loop via categories and fetch category details Reference: HREF HREF | interestsByCategory | {
"repo_name": "treasure-data/embulk-output-mailchimp",
"path": "src/main/java/org/embulk/output/mailchimp/MailChimpClient.java",
"license": "mit",
"size": 11631
} | [
"com.fasterxml.jackson.core.JsonProcessingException",
"java.util.Collections",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.embulk.output.mailchimp.MailChimpOutputPluginDelegate",
"org.embulk.output.mailchimp.helper.MailChimpRetryable",
"org.embulk.output.mailchimp.model.Category",
"... | import com.fasterxml.jackson.core.JsonProcessingException; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.embulk.output.mailchimp.MailChimpOutputPluginDelegate; import org.embulk.output.mailchimp.helper.MailChimpRetryable; import org.embulk.output.mailchi... | import com.fasterxml.jackson.core.*; import java.util.*; import org.embulk.output.mailchimp.*; import org.embulk.output.mailchimp.helper.*; import org.embulk.output.mailchimp.model.*; import org.embulk.spi.*; | [
"com.fasterxml.jackson",
"java.util",
"org.embulk.output",
"org.embulk.spi"
] | com.fasterxml.jackson; java.util; org.embulk.output; org.embulk.spi; | 1,613,321 |
@Test
public void testLoadSheddingWithAntiAffinityNamespace() throws Exception {
final String namespace = "my-tenant/use/my-ns";
final int totalNamespaces = 5;
final String namespaceAntiAffinityGroup = "my-antiaffinity";
final String bundle = "0x00000000_0xffffffff";
ad... | void function() throws Exception { final String namespace = STR; final int totalNamespaces = 5; final String namespaceAntiAffinityGroup = STR; final String bundle = STR; admin1.tenants().createTenant(STR, new TenantInfo(Sets.newHashSet(STR, STR), Sets.newHashSet("use"))); for (int i = 0; i < totalNamespaces; i++) { fin... | /**
* It verifies that load-manager::shouldAntiAffinityNamespaceUnload checks that unloading should only happen if all
* brokers have same number of anti-affinity namespaces
*
* @throws Exception
*/ | It verifies that load-manager::shouldAntiAffinityNamespaceUnload checks that unloading should only happen if all brokers have same number of anti-affinity namespaces | testLoadSheddingWithAntiAffinityNamespace | {
"repo_name": "merlimat/pulsar",
"path": "pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/AntiAffinityNamespaceGroupTest.java",
"license": "apache-2.0",
"size": 25338
} | [
"com.google.common.collect.Sets",
"org.apache.pulsar.client.api.Producer",
"org.apache.pulsar.client.api.PulsarClient",
"org.apache.pulsar.common.policies.data.TenantInfo"
] | import com.google.common.collect.Sets; import org.apache.pulsar.client.api.Producer; import org.apache.pulsar.client.api.PulsarClient; import org.apache.pulsar.common.policies.data.TenantInfo; | import com.google.common.collect.*; import org.apache.pulsar.client.api.*; import org.apache.pulsar.common.policies.data.*; | [
"com.google.common",
"org.apache.pulsar"
] | com.google.common; org.apache.pulsar; | 476,762 |
EList<MGridConfiguration> getConfigurations(); | EList<MGridConfiguration> getConfigurations(); | /**
* Returns the value of the '<em><b>Configurations</b></em>' containment reference list.
* The list contents are of type {@link at.bestsolution.framework.grid.model.grid.MGridConfiguration}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Configurations</em>' containment reference list isn't c... | Returns the value of the 'Configurations' containment reference list. The list contents are of type <code>at.bestsolution.framework.grid.model.grid.MGridConfiguration</code>. If the meaning of the 'Configurations' containment reference list isn't clear, there really should be more of a description here... | getConfigurations | {
"repo_name": "BestSolution-at/framework-grid",
"path": "bundles/at.bestsolution.framework.grid.model/src/at/bestsolution/framework/grid/model/grid/MGrid.java",
"license": "apache-2.0",
"size": 7763
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,995,317 |
public static String getHostAddress() {
NetworkInterface ni = getWifiInterface();
return getHostAddress(ni);
} | static String function() { NetworkInterface ni = getWifiInterface(); return getHostAddress(ni); } | /** get local IP address/domain name for use in URLs by other machines on network;
* most likely wireless
*
* @return IP address (as string)
*/ | get local IP address/domain name for use in URLs by other machines on network; most likely wireless | getHostAddress | {
"repo_name": "cgreenhalgh/opensharingtoolkit-kiosk",
"path": "commonlib/src/org/opensharingtoolkit/common/WifiUtils.java",
"license": "bsd-2-clause",
"size": 5279
} | [
"java.net.NetworkInterface"
] | import java.net.NetworkInterface; | import java.net.*; | [
"java.net"
] | java.net; | 2,741,683 |
//----------------------------------------------------------------------------
public static IDocument loadDocument(IServiceProvider serviceProvider, XFrame xFrame, String URL,
int searchFlags, PropertyValue[] properties) throws Exception, IOException {
if (xFrame != null) {
if (properties == n... | static IDocument function(IServiceProvider serviceProvider, XFrame xFrame, String URL, int searchFlags, PropertyValue[] properties) throws Exception, IOException { if (xFrame != null) { if (properties == null) { properties = new PropertyValue[0]; } XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.query... | /**
* Loads document from the submitted URL into the OpenOffice.org frame.
*
* @param serviceProvider the service provider to be used
* @param xFrame frame to used for document
* @param URL URL of the document
* @param searchFlags search flags for the target frame
* @param properties proper... | Loads document from the submitted URL into the OpenOffice.org frame | loadDocument | {
"repo_name": "LibreOffice/noa-libre",
"path": "src/ag/ion/bion/officelayer/internal/document/DocumentLoader.java",
"license": "lgpl-2.1",
"size": 14985
} | [
"ag.ion.bion.officelayer.document.IDocument",
"ag.ion.noa.service.IServiceProvider",
"com.sun.star.beans.PropertyValue",
"com.sun.star.frame.XComponentLoader",
"com.sun.star.frame.XFrame",
"com.sun.star.uno.UnoRuntime",
"java.io.IOException"
] | import ag.ion.bion.officelayer.document.IDocument; import ag.ion.noa.service.IServiceProvider; import com.sun.star.beans.PropertyValue; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XFrame; import com.sun.star.uno.UnoRuntime; import java.io.IOException; | import ag.ion.bion.officelayer.document.*; import ag.ion.noa.service.*; import com.sun.star.beans.*; import com.sun.star.frame.*; import com.sun.star.uno.*; import java.io.*; | [
"ag.ion.bion",
"ag.ion.noa",
"com.sun.star",
"java.io"
] | ag.ion.bion; ag.ion.noa; com.sun.star; java.io; | 1,806,261 |
EReference getLane_PartitionElementRef(); | EReference getLane_PartitionElementRef(); | /**
* Returns the meta object for the reference '{@link org.eclipse.bpmn2.Lane#getPartitionElementRef <em>Partition Element Ref</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Partition Element Ref</em>'.
* @see org.eclipse.bpmn2.Lane#getPartitionElem... | Returns the meta object for the reference '<code>org.eclipse.bpmn2.Lane#getPartitionElementRef Partition Element Ref</code>'. | getLane_PartitionElementRef | {
"repo_name": "Rikkola/kie-wb-common",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java",
"license": "apache-2.0",
"size": 929298
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,124,354 |
protected void addTypes(Set<ResolvedJavaType> newTypes) {
if (types.addAll(newTypes)) {
addToWorklist(this);
}
} | void function(Set<ResolvedJavaType> newTypes) { if (types.addAll(newTypes)) { addToWorklist(this); } } | /**
* Adds new types to this element. If that changes the state of this element, it is added to
* the {@link StaticAnalysis#addToWorklist worklist} in order to propagate the added types
* to all usages.
*/ | Adds new types to this element. If that changes the state of this element, it is added to the <code>StaticAnalysis#addToWorklist worklist</code> in order to propagate the added types to all usages | addTypes | {
"repo_name": "graalvm/graal-core",
"path": "graal/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java",
"license": "gpl-2.0",
"size": 26206
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,240,317 |
RestRequestMetrics getRestRequestMetrics(boolean sslUsed, boolean encrypted) {
RestRequestMetrics toReturn;
if (sslUsed && encrypted) {
toReturn = blobSslEncryptedMetrics;
} else if (sslUsed) {
toReturn = blobSslMetrics;
} else if (encrypted) {
toReturn = blobEncrypte... | RestRequestMetrics getRestRequestMetrics(boolean sslUsed, boolean encrypted) { RestRequestMetrics toReturn; if (sslUsed && encrypted) { toReturn = blobSslEncryptedMetrics; } else if (sslUsed) { toReturn = blobSslMetrics; } else if (encrypted) { toReturn = blobEncryptedMetrics; } else { toReturn = blobMetrics; } return ... | /**
* Fetches the appropriate {@link RestRequestMetrics} based on the params
* @param sslUsed {@code true} if the request is sent over ssl. {@code false} otherwise
* @param encrypted {@code true} if the blob is encrypted. {@code false} otherwise
* @return the appropriate {@link RestRequestMetrics} b... | Fetches the appropriate <code>RestRequestMetrics</code> based on the params | getRestRequestMetrics | {
"repo_name": "pnarayanan/ambry",
"path": "ambry-frontend/src/main/java/com.github.ambry.frontend/FrontendMetrics.java",
"license": "apache-2.0",
"size": 29525
} | [
"com.github.ambry.rest.RestRequestMetrics"
] | import com.github.ambry.rest.RestRequestMetrics; | import com.github.ambry.rest.*; | [
"com.github.ambry"
] | com.github.ambry; | 2,169,969 |
public void setNonStrokingColorSpace(PDColorSpace colorSpace)
{
nonStrokingColorSpace = colorSpace;
}
| void function(PDColorSpace colorSpace) { nonStrokingColorSpace = colorSpace; } | /**
* Sets the the non-stroking color space.
*
* @param colorSpace The new non-stroking color space.
*/ | Sets the the non-stroking color space | setNonStrokingColorSpace | {
"repo_name": "mdamt/PdfBox-Android",
"path": "library/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDGraphicsState.java",
"license": "apache-2.0",
"size": 14763
} | [
"org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace"
] | import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace; | import org.apache.pdfbox.pdmodel.graphics.color.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 1,426,180 |
public static boolean isBookmarkInMobileBookmarksBranch(Context context, long nodeId) {
Boolean result = chromeBrowserProviderCall(Boolean.class,
ChromeBrowserProvider.CLIENT_API_IS_BOOKMARK_IN_MOBILE_BOOKMARKS_BRANCH, context,
argsToBundle(nodeId));
return result != ... | static boolean function(Context context, long nodeId) { Boolean result = chromeBrowserProviderCall(Boolean.class, ChromeBrowserProvider.CLIENT_API_IS_BOOKMARK_IN_MOBILE_BOOKMARKS_BRANCH, context, argsToBundle(nodeId)); return result != null ? result.booleanValue() : false; } | /**
* Checks if a bookmark node is in the Mobile Bookmarks folder branch.
*
* @return True if the ID belongs to a node in the Mobile Bookmarks folder branch.
*/ | Checks if a bookmark node is in the Mobile Bookmarks folder branch | isBookmarkInMobileBookmarksBranch | {
"repo_name": "junmin-zhu/chromium-rivertrail",
"path": "chrome/android/java/src/org/chromium/chrome/browser/ChromeBrowserProviderClient.java",
"license": "bsd-3-clause",
"size": 7702
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,875,149 |
public static boolean isValid(final Reference ref) {
return isBranch(ref) || isTag(ref);
} | static boolean function(final Reference ref) { return isBranch(ref) isTag(ref); } | /**
* Should the given reference be included as valid?
* <p>
* This filters out pull request refs
*
* @param ref
* @return true if valid, false otherwise
*/ | Should the given reference be included as valid? This filters out pull request refs | isValid | {
"repo_name": "DeLaSalleUniversity-Manila/forkhub-BananaSpoon",
"path": "app/src/main/java/com/github/mobile/core/ref/RefUtils.java",
"license": "apache-2.0",
"size": 3980
} | [
"org.eclipse.egit.github.core.Reference"
] | import org.eclipse.egit.github.core.Reference; | import org.eclipse.egit.github.core.*; | [
"org.eclipse.egit"
] | org.eclipse.egit; | 1,674,401 |
private void countIncrementer() {
//Initializing Upcoming Time Variables
upcomingTime = Calendar.getInstance();
//Initializing Current Variables
currentTime = Calendar.getInstance();
if (Prefs.contains(Const.LIVE_IMAGES_UPCOMING_TIME)) {
//Get the upc... | void function() { upcomingTime = Calendar.getInstance(); currentTime = Calendar.getInstance(); if (Prefs.contains(Const.LIVE_IMAGES_UPCOMING_TIME)) { String upcoming = Prefs.getString(Const.LIVE_IMAGES_UPCOMING_TIME, ""); try { upcomingTime.setTime(sdf.parse(upcoming)); if (upcomingTime.getTimeInMillis() <= currentTime... | /**
* Determining if counter needs to be incremented or not
*/ | Determining if counter needs to be incremented or not | countIncrementer | {
"repo_name": "DawnImpulse/Wallup",
"path": "app/src/main/java/com/stonevire/wallup/singleton/WallpaperServiceSingleton.java",
"license": "apache-2.0",
"size": 32877
} | [
"com.pixplicity.easyprefs.library.Prefs",
"com.stonevire.wallup.utils.Const",
"java.text.ParseException",
"java.util.Calendar"
] | import com.pixplicity.easyprefs.library.Prefs; import com.stonevire.wallup.utils.Const; import java.text.ParseException; import java.util.Calendar; | import com.pixplicity.easyprefs.library.*; import com.stonevire.wallup.utils.*; import java.text.*; import java.util.*; | [
"com.pixplicity.easyprefs",
"com.stonevire.wallup",
"java.text",
"java.util"
] | com.pixplicity.easyprefs; com.stonevire.wallup; java.text; java.util; | 489,917 |
@JsonProperty(value = "min")
public void setMin(Object min) {
this.min = min;
} | @JsonProperty(value = "min") void function(Object min) { this.min = min; } | /**
* setter used during deserialization of the 'min' field of the metadata cache file.
*
* @param min
*/ | setter used during deserialization of the 'min' field of the metadata cache file | setMin | {
"repo_name": "KulykRoman/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java",
"license": "apache-2.0",
"size": 72268
} | [
"com.fasterxml.jackson.annotation.JsonProperty"
] | import com.fasterxml.jackson.annotation.JsonProperty; | import com.fasterxml.jackson.annotation.*; | [
"com.fasterxml.jackson"
] | com.fasterxml.jackson; | 216,138 |
public boolean supportsCoreSQLGrammar() throws SQLException {
if (JdbcDebugCfg.entryActive)
debug[methodId_supportsCoreSQLGrammar].methodEntry();
try {
return true;
} finally {
if (JdbcDebugCfg.entryActive)
debug[methodId_supportsCoreSQLGrammar].methodExit();
}
} | boolean function() throws SQLException { if (JdbcDebugCfg.entryActive) debug[methodId_supportsCoreSQLGrammar].methodEntry(); try { return true; } finally { if (JdbcDebugCfg.entryActive) debug[methodId_supportsCoreSQLGrammar].methodExit(); } } | /**
* Retrieves whether this database supports the ODBC Core SQL grammar.
*
* @return true
* @throws SQLException
* - if a database access error occurs
**/ | Retrieves whether this database supports the ODBC Core SQL grammar | supportsCoreSQLGrammar | {
"repo_name": "mashengchen/incubator-trafodion",
"path": "core/conn/jdbc_type2/src/main/java/org/apache/trafodion/jdbc/t2/SQLMXDatabaseMetaData.java",
"license": "apache-2.0",
"size": 191582
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,236,227 |
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
... | static PlaceholderFragment function(int sectionNumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } public PlaceholderFragment() { } | /**
* Returns a new instance of this fragment for the given section
* number.
*/ | Returns a new instance of this fragment for the given section number | newInstance | {
"repo_name": "Belobobr/Eventsource",
"path": "app/src/main/java/com/sednev/testgreeetings/app/MainActivity.java",
"license": "gpl-3.0",
"size": 5218
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 2,275,400 |
public static String formatWithStyle(Date date, DateTimeStyle style, Locale locale) {
if(date == null && debug) {
Log.e(LOG_TAG,"FormatWithPattern >> Supplied date is null");
}
return formatWithPattern(date,getPatternForStyle(style),locale);
} | static String function(Date date, DateTimeStyle style, Locale locale) { if(date == null && debug) { Log.e(LOG_TAG,STR); } return formatWithPattern(date,getPatternForStyle(style),locale); } | /**
* Get localized date string
*
* @param date Date string
* @return Formatted localized date string
*/ | Get localized date string | formatWithStyle | {
"repo_name": "thunder413/DateTimeUtils",
"path": "DateTimeUtils/src/main/java/com/github/thunder413/datetimeutils/DateTimeUtils.java",
"license": "mit",
"size": 22350
} | [
"android.util.Log",
"java.util.Date",
"java.util.Locale"
] | import android.util.Log; import java.util.Date; import java.util.Locale; | import android.util.*; import java.util.*; | [
"android.util",
"java.util"
] | android.util; java.util; | 1,195,239 |
public static void readFully(Reader input, char[] buffer) throws IOException {
readFully(input, buffer, 0, buffer.length);
} | static void function(Reader input, char[] buffer) throws IOException { readFully(input, buffer, 0, buffer.length); } | /**
* Read the requested number of characters or fail if there are not enough left.
* <p/>
* This allows for the possibility that {@link Reader#read(char[], int, int)} may
* not read as many characters as requested (most likely because of reaching EOF).
*
* @param input where to read inpu... | Read the requested number of characters or fail if there are not enough left. This allows for the possibility that <code>Reader#read(char[], int, int)</code> may not read as many characters as requested (most likely because of reaching EOF) | readFully | {
"repo_name": "solaris0403/SeleneDemo",
"path": "common_lib/src/main/java/com/tony/selene/common/trinea/android/common/io/IOUtil.java",
"license": "gpl-2.0",
"size": 95443
} | [
"java.io.IOException",
"java.io.Reader"
] | import java.io.IOException; import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 347,800 |
public boolean authenticate(HttpRequest request,
HttpResponse response,
LoginConfig config)
throws IOException {
// References to objects we will need later
HttpServletRequest hreq =
(HttpServletRequest) request.getRe... | boolean function(HttpRequest request, HttpResponse response, LoginConfig config) throws IOException { HttpServletRequest hreq = (HttpServletRequest) request.getRequest(); HttpServletResponse hres = (HttpServletResponse) response.getResponse(); Session session = null; Principal principal = hreq.getUserPrincipal(); if (p... | /**
* Authenticate the user making this request, based on the specified
* login configuration. Return <code>true</code> if any specified
* constraint has been satisfied, or <code>false</code> if we have
* created a response challenge already.
*
* @param request Request we are processing
... | Authenticate the user making this request, based on the specified login configuration. Return <code>true</code> if any specified constraint has been satisfied, or <code>false</code> if we have created a response challenge already | authenticate | {
"repo_name": "eclipsky/HowTomcatWorks",
"path": "src/org/apache/catalina/authenticator/FormAuthenticator.java",
"license": "apache-2.0",
"size": 17810
} | [
"java.io.IOException",
"java.security.Principal",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.catalina.HttpRequest",
"org.apache.catalina.HttpResponse",
"org.apache.catalina.Realm",
"org.apache.catalina.Session",
"org.apache.catalina.deploy.LoginCon... | import java.io.IOException; import java.security.Principal; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.catalina.HttpRequest; import org.apache.catalina.HttpResponse; import org.apache.catalina.Realm; import org.apache.catalina.Session; import org.apach... | import java.io.*; import java.security.*; import javax.servlet.http.*; import org.apache.catalina.*; import org.apache.catalina.deploy.*; | [
"java.io",
"java.security",
"javax.servlet",
"org.apache.catalina"
] | java.io; java.security; javax.servlet; org.apache.catalina; | 2,197,736 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.