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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static IOException createCompositeException( List<IOException> innerExceptions) { Preconditions.checkArgument(innerExceptions != null, "innerExceptions must not be null"); Preconditions.checkArgument(innerExceptions.size() > 0, "innerExceptions must contain at least one element"); if (innerExceptions.size() == 1) { return innerExceptions.get(0); } IOException combined = new IOException("Multiple IOExceptions."); for (IOException inner : innerExceptions) { combined.addSuppressed(inner); } return combined; }
static IOException function( List<IOException> innerExceptions) { Preconditions.checkArgument(innerExceptions != null, STR); Preconditions.checkArgument(innerExceptions.size() > 0, STR); if (innerExceptions.size() == 1) { return innerExceptions.get(0); } IOException combined = new IOException(STR); for (IOException inner : innerExceptions) { combined.addSuppressed(inner); } return combined; }
/** * Creates a composite IOException out of multiple IOExceptions. If there is only a single * {@code innerException}, it will be returned as-is without wrapping into an outer exception. * it. */
Creates a composite IOException out of multiple IOExceptions. If there is only a single innerException, it will be returned as-is without wrapping into an outer exception. it
createCompositeException
{ "repo_name": "peltekster/bigdata-interop-leanplum", "path": "gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageExceptions.java", "license": "apache-2.0", "size": 2959 }
[ "com.google.common.base.Preconditions", "java.io.IOException", "java.util.List" ]
import com.google.common.base.Preconditions; import java.io.IOException; import java.util.List;
import com.google.common.base.*; import java.io.*; import java.util.*;
[ "com.google.common", "java.io", "java.util" ]
com.google.common; java.io; java.util;
839,687
public final double computePrice() { Validate.notNull(_lognormalVol, "Black Volatility parameter, _vol, has not been set."); return BlackFormulaRepository.price(_forward, _strike, _expiry, _lognormalVol, _isCall); }
final double function() { Validate.notNull(_lognormalVol, STR); return BlackFormulaRepository.price(_forward, _strike, _expiry, _lognormalVol, _isCall); }
/** * Computes the forward price from forward, strike and variance. * This is NOT a getter of the data member, _fwdMtm. For that, use getFwdMtm(). * Nor does this set any data member. * @return Black formula price of the option */
Computes the forward price from forward, strike and variance. This is NOT a getter of the data member, _fwdMtm. For that, use getFwdMtm(). Nor does this set any data member
computePrice
{ "repo_name": "charles-cooper/idylfin", "path": "src/com/opengamma/analytics/financial/model/volatility/BlackFormula.java", "license": "apache-2.0", "size": 9743 }
[ "org.apache.commons.lang.Validate" ]
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
723,779
public SeleniumWMessageBoxWebElement getMessageBox(final int index) { List<SeleniumWMessageBoxWebElement> boxes = getMessageBoxes(); return boxes.get(index); }
SeleniumWMessageBoxWebElement function(final int index) { List<SeleniumWMessageBoxWebElement> boxes = getMessageBoxes(); return boxes.get(index); }
/** * Get the WMessageBox child at a given index. * * @param index the child index * @return a WebElement corresponding to the WMessageBox child. */
Get the WMessageBox child at a given index
getMessageBox
{ "repo_name": "marksreeves/wcomponents", "path": "wcomponents-test-lib/src/main/java/com/github/bordertech/wcomponents/test/selenium/element/SeleniumWMessagesWebElement.java", "license": "gpl-3.0", "size": 3400 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,759,037
public void setServiceProperties(Map serviceProperties) { this.serviceProperties = serviceProperties; }
void function(Map serviceProperties) { this.serviceProperties = serviceProperties; }
/** * Sets the properties used when exposing the target as an OSGi service. If the given argument implements ( * {@link ServicePropertiesChangeListener}), any updates to the properties will be reflected by the service * registration. * * @param serviceProperties properties used for exporting the target as an OSGi service */
Sets the properties used when exposing the target as an OSGi service. If the given argument implements ( <code>ServicePropertiesChangeListener</code>), any updates to the properties will be reflected by the service registration
setServiceProperties
{ "repo_name": "glyn/Gemini-Blueprint", "path": "core/src/main/java/org/eclipse/gemini/blueprint/compendium/internal/cm/ManagedServiceFactoryFactoryBean.java", "license": "apache-2.0", "size": 17612 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,471,774
public AcknowledgedResponse deleteAutoFollowPattern(DeleteAutoFollowPatternRequest request, RequestOptions options) throws IOException { return restHighLevelClient.performRequestAndParseEntity( request, CcrRequestConverters::deleteAutoFollowPattern, options, AcknowledgedResponse::fromXContent, Collections.emptySet() ); }
AcknowledgedResponse function(DeleteAutoFollowPatternRequest request, RequestOptions options) throws IOException { return restHighLevelClient.performRequestAndParseEntity( request, CcrRequestConverters::deleteAutoFollowPattern, options, AcknowledgedResponse::fromXContent, Collections.emptySet() ); }
/** * Deletes an auto follow pattern. * * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html"> * the docs</a> for more. * * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response * @throws IOException in case there is a problem sending the request or parsing back the response */
Deletes an auto follow pattern. See the docs for more
deleteAutoFollowPattern
{ "repo_name": "coding0011/elasticsearch", "path": "client/rest-high-level/src/main/java/org/elasticsearch/client/CcrClient.java", "license": "apache-2.0", "size": 24247 }
[ "java.io.IOException", "java.util.Collections", "org.elasticsearch.client.ccr.DeleteAutoFollowPatternRequest", "org.elasticsearch.client.core.AcknowledgedResponse" ]
import java.io.IOException; import java.util.Collections; import org.elasticsearch.client.ccr.DeleteAutoFollowPatternRequest; import org.elasticsearch.client.core.AcknowledgedResponse;
import java.io.*; import java.util.*; import org.elasticsearch.client.ccr.*; import org.elasticsearch.client.core.*;
[ "java.io", "java.util", "org.elasticsearch.client" ]
java.io; java.util; org.elasticsearch.client;
1,210,387
public synchronized void cleanUpTaskQueue(@Nonnull String taskType) { String helixJobQueueName = getHelixJobQueueName(taskType); LOGGER.info("Cleaning up task queue: {} for task type: {}", helixJobQueueName, taskType); _taskDriver.cleanupQueue(helixJobQueueName); }
synchronized void function(@Nonnull String taskType) { String helixJobQueueName = getHelixJobQueueName(taskType); LOGGER.info(STR, helixJobQueueName, taskType); _taskDriver.cleanupQueue(helixJobQueueName); }
/** * Clean up a task queue for the given task type. * * @param taskType Task type */
Clean up a task queue for the given task type
cleanUpTaskQueue
{ "repo_name": "apucher/pinot", "path": "pinot-controller/src/main/java/com/linkedin/pinot/controller/helix/core/minion/PinotHelixTaskResourceManager.java", "license": "apache-2.0", "size": 12686 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
702,923
private void setupGuideLayout() { bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetGuideTitle.setText(getGuideTitle()); bottomSheetText.setText(getGuideAbstract()); bottomSheetSchematic.setImageResource(getGuideSchematics()); bottomSheetDesc.setText(getGuideDescription()); // if sensor doesn't image in it's guide and hence returns 0 for getGuideSchematics(), hide the visibility of bottomSheetSchematic if (getGuideSchematics() != 0) { bottomSheetSchematic.setImageResource(getGuideSchematics()); } else { bottomSheetSchematic.setVisibility(View.GONE); } // If a sensor has extra content than provided in the standard layout, create a new layout // and attach the layout id with getGuideExtraContent() if (getGuideExtraContent() != 0) { LayoutInflater I = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE); assert I != null; View childLayout = I.inflate(getGuideExtraContent(), null); bottomSheetAdditionalContent.addView(childLayout); } }
void function() { bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetGuideTitle.setText(getGuideTitle()); bottomSheetText.setText(getGuideAbstract()); bottomSheetSchematic.setImageResource(getGuideSchematics()); bottomSheetDesc.setText(getGuideDescription()); if (getGuideSchematics() != 0) { bottomSheetSchematic.setImageResource(getGuideSchematics()); } else { bottomSheetSchematic.setVisibility(View.GONE); } if (getGuideExtraContent() != 0) { LayoutInflater I = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE); assert I != null; View childLayout = I.inflate(getGuideExtraContent(), null); bottomSheetAdditionalContent.addView(childLayout); } }
/** * Inflate each individual view with content to fill up the sensor guide */
Inflate each individual view with content to fill up the sensor guide
setupGuideLayout
{ "repo_name": "CloudyPadmal/pslab-android", "path": "app/src/main/java/io/pslab/models/PSLabSensor.java", "license": "apache-2.0", "size": 24931 }
[ "android.view.LayoutInflater", "android.view.View", "com.google.android.material.bottomsheet.BottomSheetBehavior" ]
import android.view.LayoutInflater; import android.view.View; import com.google.android.material.bottomsheet.BottomSheetBehavior;
import android.view.*; import com.google.android.material.bottomsheet.*;
[ "android.view", "com.google.android" ]
android.view; com.google.android;
2,701,941
public static void assertFileNotExists(String filename) { File file = new File(filename); assertFalse("File " + filename + " should not exist", file.exists()); }
static void function(String filename) { File file = new File(filename); assertFalse(STR + filename + STR, file.exists()); }
/** * To be used to check is a file is <b>not</b> found in the file system */
To be used to check is a file is not found in the file system
assertFileNotExists
{ "repo_name": "onders86/camel", "path": "camel-core/src/test/java/org/apache/camel/TestSupport.java", "license": "apache-2.0", "size": 20868 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,560,431
public int queryTotalDepartment() { Query query = this.getSession().createQuery("from DepartmentInfo di where di.departmentAvai=1 order by di.branchInfo.branchId"); List<DepartmentInfo> list = query.list(); return list.size(); }
int function() { Query query = this.getSession().createQuery(STR); List<DepartmentInfo> list = query.list(); return list.size(); }
/** * query Total Department num */
query Total Department num
queryTotalDepartment
{ "repo_name": "SCUSW/EAS", "path": "src/com/scusw/admin/dao/impl/DepartmentDaoImpl.java", "license": "gpl-2.0", "size": 4632 }
[ "com.scusw.model.DepartmentInfo", "java.util.List", "org.hibernate.Query" ]
import com.scusw.model.DepartmentInfo; import java.util.List; import org.hibernate.Query;
import com.scusw.model.*; import java.util.*; import org.hibernate.*;
[ "com.scusw.model", "java.util", "org.hibernate" ]
com.scusw.model; java.util; org.hibernate;
856,526
@Override public void fetch(Message[] messages, FetchProfile fp, MessageRetrievalListener listener) throws MessagingException { throw new UnsupportedOperationException( "Pop3Folder.fetch(Message[], FetchProfile, MessageRetrievalListener)"); }
void function(Message[] messages, FetchProfile fp, MessageRetrievalListener listener) throws MessagingException { throw new UnsupportedOperationException( STR); }
/** * Fetch the items contained in the FetchProfile into the given set of * Messages in as efficient a manner as possible. * @param messages * @param fp * @throws MessagingException */
Fetch the items contained in the FetchProfile into the given set of Messages in as efficient a manner as possible
fetch
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "packages/apps/Email/provider_src/com/android/email/mail/store/Pop3Store.java", "license": "gpl-3.0", "size": 31280 }
[ "com.android.emailcommon.mail.FetchProfile", "com.android.emailcommon.mail.Message", "com.android.emailcommon.mail.MessagingException" ]
import com.android.emailcommon.mail.FetchProfile; import com.android.emailcommon.mail.Message; import com.android.emailcommon.mail.MessagingException;
import com.android.emailcommon.mail.*;
[ "com.android.emailcommon" ]
com.android.emailcommon;
2,623,960
private BlobKey putBuffer(@Nullable JobID jobId, byte[] value, BlobKey.BlobType blobType) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Received PUT call for BLOB of job {}.", jobId); } File incomingFile = createTemporaryFilename(); MessageDigest md = BlobUtils.createMessageDigest(); BlobKey blobKey = null; try (FileOutputStream fos = new FileOutputStream(incomingFile)) { md.update(value); fos.write(value); // persist file blobKey = moveTempFileToStore(incomingFile, jobId, md.digest(), blobType); return blobKey; } finally { // delete incomingFile from a failed download if (!incomingFile.delete() && incomingFile.exists()) { LOG.warn("Could not delete the staging file {} for blob key {} and job {}.", incomingFile, blobKey, jobId); } } }
BlobKey function(@Nullable JobID jobId, byte[] value, BlobKey.BlobType blobType) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug(STR, jobId); } File incomingFile = createTemporaryFilename(); MessageDigest md = BlobUtils.createMessageDigest(); BlobKey blobKey = null; try (FileOutputStream fos = new FileOutputStream(incomingFile)) { md.update(value); fos.write(value); blobKey = moveTempFileToStore(incomingFile, jobId, md.digest(), blobType); return blobKey; } finally { if (!incomingFile.delete() && incomingFile.exists()) { LOG.warn(STR, incomingFile, blobKey, jobId); } } }
/** * Uploads the data of the given byte array for the given job to the BLOB server. * * @param jobId * the ID of the job the BLOB belongs to * @param value * the buffer to upload * @param blobType * whether to make the data permanent or transient * * @return the computed BLOB key identifying the BLOB on the server * * @throws IOException * thrown if an I/O error occurs while writing it to a local file, or uploading it to the HA * store */
Uploads the data of the given byte array for the given job to the BLOB server
putBuffer
{ "repo_name": "zimmermatt/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServer.java", "license": "apache-2.0", "size": 29394 }
[ "java.io.File", "java.io.FileOutputStream", "java.io.IOException", "java.security.MessageDigest", "javax.annotation.Nullable", "org.apache.flink.api.common.JobID" ]
import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.security.MessageDigest; import javax.annotation.Nullable; import org.apache.flink.api.common.JobID;
import java.io.*; import java.security.*; import javax.annotation.*; import org.apache.flink.api.common.*;
[ "java.io", "java.security", "javax.annotation", "org.apache.flink" ]
java.io; java.security; javax.annotation; org.apache.flink;
644,981
public static Coordinate adjustCoordinateToFitInRange( final CoordinateReferenceSystem crs, final Coordinate coord) { return new Coordinate( adjustCoordinateDimensionToRange(coord.getX(), crs, 0), clipRange(coord.getY(), crs, 1), clipRange(coord.getZ(), crs, 2)); }
static Coordinate function( final CoordinateReferenceSystem crs, final Coordinate coord) { return new Coordinate( adjustCoordinateDimensionToRange(coord.getX(), crs, 0), clipRange(coord.getY(), crs, 1), clipRange(coord.getZ(), crs, 2)); }
/** * Make sure the coordinate falls in the range of provided coordinate reference systems's * coordinate system. 'x' coordinate is wrapped around date line. 'y' and 'z' coordinate are * clipped. At some point, this function will be adjusted to project 'y' appropriately. * * @param crs * @param coord * @return */
Make sure the coordinate falls in the range of provided coordinate reference systems's coordinate system. 'x' coordinate is wrapped around date line. 'y' and 'z' coordinate are clipped. At some point, this function will be adjusted to project 'y' appropriately
adjustCoordinateToFitInRange
{ "repo_name": "spohnan/geowave", "path": "core/geotime/src/main/java/org/locationtech/geowave/core/geotime/util/GeometryUtils.java", "license": "apache-2.0", "size": 33870 }
[ "org.locationtech.jts.geom.Coordinate", "org.opengis.referencing.crs.CoordinateReferenceSystem" ]
import org.locationtech.jts.geom.Coordinate; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.locationtech.jts.geom.*; import org.opengis.referencing.crs.*;
[ "org.locationtech.jts", "org.opengis.referencing" ]
org.locationtech.jts; org.opengis.referencing;
1,804,133
@Override public void onListItemClick(ListView l, View v, int position, long id) { WifiP2pDevice device = (WifiP2pDevice) getListAdapter().getItem(position); ((DeviceActionListener) getActivity()).showDetails(device); } private class WiFiPeerListAdapter extends ArrayAdapter<WifiP2pDevice> { private List<WifiP2pDevice> items; public WiFiPeerListAdapter(Context context, int textViewResourceId, List<WifiP2pDevice> objects) { super(context, textViewResourceId, objects); items = objects; }
void function(ListView l, View v, int position, long id) { WifiP2pDevice device = (WifiP2pDevice) getListAdapter().getItem(position); ((DeviceActionListener) getActivity()).showDetails(device); } private class WiFiPeerListAdapter extends ArrayAdapter<WifiP2pDevice> { private List<WifiP2pDevice> items; public WiFiPeerListAdapter(Context context, int textViewResourceId, List<WifiP2pDevice> objects) { super(context, textViewResourceId, objects); items = objects; }
/** * Initiate a connection with the peer. */
Initiate a connection with the peer
onListItemClick
{ "repo_name": "itamaro/higgs-bot", "path": "Android/RoboDroid/src/com/higgsbot/wifidirect/DeviceListFragment.java", "license": "mit", "size": 5938 }
[ "android.content.Context", "android.net.wifi.p2p.WifiP2pDevice", "android.view.View", "android.widget.ArrayAdapter", "android.widget.ListView", "java.util.List" ]
import android.content.Context; import android.net.wifi.p2p.WifiP2pDevice; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; import java.util.List;
import android.content.*; import android.net.wifi.p2p.*; import android.view.*; import android.widget.*; import java.util.*;
[ "android.content", "android.net", "android.view", "android.widget", "java.util" ]
android.content; android.net; android.view; android.widget; java.util;
2,581,946
private Object runScript(final String commandsString, final Map<String, Object> headers) { LOG.debug("RunScript: {} ", commandsString); final HashMap<String, String> inputParamsMap = new HashMap<>(); inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SCRIPT, commandsString); headers.put(MBHeader.OPERATIONNAME_STRING.toString(), Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT); LOG.debug("Invoking ManagementBus for runScript with the following headers:"); for (final String key : headers.keySet()) { if (headers.get(key) != null && headers.get(key) instanceof String) { LOG.debug("Header: " + key + " Value: " + headers.get(key)); } } return invokeManagementBusEngine(inputParamsMap, headers); }
Object function(final String commandsString, final Map<String, Object> headers) { LOG.debug(STR, commandsString); final HashMap<String, String> inputParamsMap = new HashMap<>(); inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SCRIPT, commandsString); headers.put(MBHeader.OPERATIONNAME_STRING.toString(), Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT); LOG.debug(STR); for (final String key : headers.keySet()) { if (headers.get(key) != null && headers.get(key) instanceof String) { LOG.debug(STR + key + STR + headers.get(key)); } } return invokeManagementBusEngine(inputParamsMap, headers); }
/** * For running scripts on the target machine. Commands to be executed are defined in the corresponding *.xml file. */
For running scripts on the target machine. Commands to be executed are defined in the corresponding *.xml file
runScript
{ "repo_name": "OpenTOSCA/container", "path": "org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java", "license": "apache-2.0", "size": 30464 }
[ "java.util.HashMap", "java.util.Map", "org.opentosca.bus.management.header.MBHeader", "org.opentosca.container.core.convention.Interfaces" ]
import java.util.HashMap; import java.util.Map; import org.opentosca.bus.management.header.MBHeader; import org.opentosca.container.core.convention.Interfaces;
import java.util.*; import org.opentosca.bus.management.header.*; import org.opentosca.container.core.convention.*;
[ "java.util", "org.opentosca.bus", "org.opentosca.container" ]
java.util; org.opentosca.bus; org.opentosca.container;
2,247,850
@Override public String globalInfo() { return "Inserts the object passing through to the collection in storage at the specified position.\n" + "After inserting the object successfully, just forwards the object.\n" + "If the collection does not implement the " + Utils.classToString(List.class) + " " + "interface and the insertion is not at the end, the insertion will fail."; }
String function() { return STR + STR + STR + Utils.classToString(List.class) + " " + STR; }
/** * Returns a string describing the object. * * @return a description suitable for displaying in the gui */
Returns a string describing the object
globalInfo
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-core/src/main/java/adams/flow/transformer/StorageCollectionInsert.java", "license": "gpl-3.0", "size": 10376 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
791,603
void consumeOneResponse() throws SQLException { checkOpen(); while (!endOfResponse) { nextToken(); // If it's a response terminator, return if (currentToken.isEndToken() && (currentToken.status & DONE_END_OF_RESPONSE) != 0) { return; } } }
void consumeOneResponse() throws SQLException { checkOpen(); while (!endOfResponse) { nextToken(); if (currentToken.isEndToken() && (currentToken.status & DONE_END_OF_RESPONSE) != 0) { return; } } }
/** * Consume packets from the server response queue up to (and including) the * first response terminator. * * @throws SQLException if an I/O or protocol error occurs; server errors * are queued up and not thrown */
Consume packets from the server response queue up to (and including) the first response terminator
consumeOneResponse
{ "repo_name": "milesibastos/jTDS", "path": "src/main/net/sourceforge/jtds/jdbc/TdsCore.java", "license": "lgpl-2.1", "size": 168782 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,294,520
public void setDate(String parameterName, Date x, Calendar cal) throws SQLException { throw Util.notImplemented(); }
void function(String parameterName, Date x, Calendar cal) throws SQLException { throw Util.notImplemented(); }
/** * JDBC 3.0 * * Sets the designated parameter to the given java.sql.Date value, using the given * Calendar object. * * @param parameterName - the name of the parameter * @param x - the parameter value * @param cal - the Calendar object the driver will use to construct the date * @exception SQLException Feature not implemented for now. */
JDBC 3.0 Sets the designated parameter to the given java.sql.Date value, using the given Calendar object
setDate
{ "repo_name": "gemxd/gemfirexd-oss", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/jdbc/EmbedCallableStatement20.java", "license": "apache-2.0", "size": 40659 }
[ "com.pivotal.gemfirexd.internal.impl.jdbc.Util", "java.sql.Date", "java.sql.SQLException", "java.util.Calendar" ]
import com.pivotal.gemfirexd.internal.impl.jdbc.Util; import java.sql.Date; import java.sql.SQLException; import java.util.Calendar;
import com.pivotal.gemfirexd.internal.impl.jdbc.*; import java.sql.*; import java.util.*;
[ "com.pivotal.gemfirexd", "java.sql", "java.util" ]
com.pivotal.gemfirexd; java.sql; java.util;
685,442
private void cleanup(ConfigExtractor cfg) throws IOException { FileSystem fs = FileSystem.get(cfg.getConfig()); Path base = cfg.getBaseDirectory(); if (base != null) { LOG.info("Attempting to recursively delete " + base); fs.delete(base, true); } }
void function(ConfigExtractor cfg) throws IOException { FileSystem fs = FileSystem.get(cfg.getConfig()); Path base = cfg.getBaseDirectory(); if (base != null) { LOG.info(STR + base); fs.delete(base, true); } }
/** * Cleans up the base directory by removing it * * @param cfg * ConfigExtractor which has location of base directory * * @throws IOException */
Cleans up the base directory by removing it
cleanup
{ "repo_name": "ulmon/hadoop1.2.1", "path": "src/test/org/apache/hadoop/fs/slive/SliveTest.java", "license": "apache-2.0", "size": 10824 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; 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;
541,310
public ResearcherFile getById(Long id, boolean lock) { return hbCrudDAO.getById(id, lock); }
ResearcherFile function(Long id, boolean lock) { return hbCrudDAO.getById(id, lock); }
/** * Return ResearcherFile by id */
Return ResearcherFile by id
getById
{ "repo_name": "nate-rcl/irplus", "path": "ir_hibernate/src/edu/ur/hibernate/ir/researcher/db/HbResearcherFileDAO.java", "license": "apache-2.0", "size": 5956 }
[ "edu.ur.ir.researcher.ResearcherFile" ]
import edu.ur.ir.researcher.ResearcherFile;
import edu.ur.ir.researcher.*;
[ "edu.ur.ir" ]
edu.ur.ir;
48,915
public java.sql.ResultSet getSchemas() throws SQLException { Field[] fields = new Field[2]; fields[0] = new Field("", "TABLE_SCHEM", java.sql.Types.CHAR, 0); fields[1] = new Field("", "TABLE_CATALOG", java.sql.Types.CHAR, 0); ArrayList<ResultSetRow> tuples = new ArrayList<ResultSetRow>(); java.sql.ResultSet results = buildResultSet(fields, tuples); return results; }
java.sql.ResultSet function() throws SQLException { Field[] fields = new Field[2]; fields[0] = new Field(STRTABLE_SCHEM", java.sql.Types.CHAR, 0); fields[1] = new Field(STRTABLE_CATALOG", java.sql.Types.CHAR, 0); ArrayList<ResultSetRow> tuples = new ArrayList<ResultSetRow>(); java.sql.ResultSet results = buildResultSet(fields, tuples); return results; }
/** * Get the schema names available in this database. The results are ordered by schema name. * <P> * The schema column is: * <OL> * <li><B>TABLE_SCHEM</B> String => schema name</li> * </ol> * </p> * * @return ResultSet each row has a single String column that is a schema name * @throws SQLException DOCUMENT ME! */
Get the schema names available in this database. The results are ordered by schema name. The schema column is: TABLE_SCHEM String => schema name
getSchemas
{ "repo_name": "hongliangpan/manydesigns.cn", "path": "trunk/portofino-database/mysql.src/com/mysql/jdbc/DatabaseMetaData.java", "license": "lgpl-3.0", "size": 275823 }
[ "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Types", "java.util.ArrayList" ]
import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; import java.util.ArrayList;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
2,356,912
public PutIndexTemplateRequest settings(String source, XContentType xContentType) { this.settings = Settings.builder().loadFromSource(source, xContentType).build(); return this; }
PutIndexTemplateRequest function(String source, XContentType xContentType) { this.settings = Settings.builder().loadFromSource(source, xContentType).build(); return this; }
/** * The settings to create the index template with (either json/yaml format). */
The settings to create the index template with (either json/yaml format)
settings
{ "repo_name": "nknize/elasticsearch", "path": "server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java", "license": "apache-2.0", "size": 16748 }
[ "org.elasticsearch.common.settings.Settings", "org.elasticsearch.common.xcontent.XContentType" ]
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.settings.*; import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
1,845,839
Form form = new Form(entity); String targetName = form.getFirstValue("name"); TargetEntity targetEntity = new TargetEntity(); targetEntity.setName(targetName); dao.save(targetEntity); // TODO Return entity with completed fields return null; }
Form form = new Form(entity); String targetName = form.getFirstValue("name"); TargetEntity targetEntity = new TargetEntity(); targetEntity.setName(targetName); dao.save(targetEntity); return null; }
/** * Creates a new target based on the given representation. * * @param entity * The representation of the target that should be created * @return The completed representation of the created target */
Creates a new target based on the given representation
createTarget
{ "repo_name": "DEEDS-TUD/AUTOGRINDER", "path": "server/ext/rest/src/main/java/de/grinder/TargetsResource.java", "license": "agpl-3.0", "size": 1648 }
[ "de.grinder.database.TargetEntity", "org.restlet.data.Form" ]
import de.grinder.database.TargetEntity; import org.restlet.data.Form;
import de.grinder.database.*; import org.restlet.data.*;
[ "de.grinder.database", "org.restlet.data" ]
de.grinder.database; org.restlet.data;
944,606
public interface IOperatorDescriptor extends Serializable { public OperatorDescriptorId getOperatorId();
interface IOperatorDescriptor extends Serializable { public OperatorDescriptorId function();
/** * Returns the id of the operator. * * @return operator id */
Returns the id of the operator
getOperatorId
{ "repo_name": "tectronics/hyracks", "path": "hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/dataflow/IOperatorDescriptor.java", "license": "apache-2.0", "size": 2595 }
[ "java.io.Serializable" ]
import java.io.Serializable;
import java.io.*;
[ "java.io" ]
java.io;
711,881
private void recreateUserVmSeach(NetworkVO network) { if (network != null) { SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder(); nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ); nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL); List<String> networkServices = networkOfferingServiceMapDao.listServicesForNetworkOffering(network.getNetworkOfferingId()); if (!Network.GuestType.L2.equals(network.getGuestType()) && CollectionUtils.isNotEmpty(networkServices)) { nicSearch.and().op("ip4Address", nicSearch.entity().getIPv4Address(), SearchCriteria.Op.NNULL); nicSearch.or("ip6Address", nicSearch.entity().getIPv6Address(), SearchCriteria.Op.NNULL); nicSearch.cp(); } UserVmSearch = createSearchBuilder(); UserVmSearch.and("states", UserVmSearch.entity().getState(), SearchCriteria.Op.IN); UserVmSearch.join("nicSearch", nicSearch, UserVmSearch.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER); UserVmSearch.done(); } }
void function(NetworkVO network) { if (network != null) { SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder(); nicSearch.and(STR, nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ); nicSearch.and(STR, nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL); List<String> networkServices = networkOfferingServiceMapDao.listServicesForNetworkOffering(network.getNetworkOfferingId()); if (!Network.GuestType.L2.equals(network.getGuestType()) && CollectionUtils.isNotEmpty(networkServices)) { nicSearch.and().op(STR, nicSearch.entity().getIPv4Address(), SearchCriteria.Op.NNULL); nicSearch.or(STR, nicSearch.entity().getIPv6Address(), SearchCriteria.Op.NNULL); nicSearch.cp(); } UserVmSearch = createSearchBuilder(); UserVmSearch.and(STR, UserVmSearch.entity().getState(), SearchCriteria.Op.IN); UserVmSearch.join(STR, nicSearch, UserVmSearch.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER); UserVmSearch.done(); } }
/** * Recreates UserVmSearch depending on network type, as nics on L2 networks have no ip addresses * @param network network */
Recreates UserVmSearch depending on network type, as nics on L2 networks have no ip addresses
recreateUserVmSeach
{ "repo_name": "GabrielBrascher/cloudstack", "path": "engine/schema/src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java", "license": "apache-2.0", "size": 32300 }
[ "com.cloud.network.Network", "com.cloud.network.dao.NetworkVO", "com.cloud.utils.db.JoinBuilder", "com.cloud.utils.db.SearchBuilder", "com.cloud.utils.db.SearchCriteria", "com.cloud.vm.NicVO", "java.util.List", "org.apache.commons.collections.CollectionUtils" ]
import com.cloud.network.Network; import com.cloud.network.dao.NetworkVO; import com.cloud.utils.db.JoinBuilder; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; import com.cloud.vm.NicVO; import java.util.List; import org.apache.commons.collections.CollectionUtils;
import com.cloud.network.*; import com.cloud.network.dao.*; import com.cloud.utils.db.*; import com.cloud.vm.*; import java.util.*; import org.apache.commons.collections.*;
[ "com.cloud.network", "com.cloud.utils", "com.cloud.vm", "java.util", "org.apache.commons" ]
com.cloud.network; com.cloud.utils; com.cloud.vm; java.util; org.apache.commons;
1,689,628
public int getElementIndex(java.lang.String name, java.lang.Object element) { int i = Arrays.binarySearch(NATIVE_ELEMENTS, name); if (i < 0) { name = getSubstitute(name); i = Arrays.binarySearch(NATIVE_ELEMENTS, name); } switch (i) { case 0: return this.endBalance != null && this.endBalance.equals(element) ? 0 : -1; default: return super.getElementIndex(name, element); } }
int function(java.lang.String name, java.lang.Object element) { int i = Arrays.binarySearch(NATIVE_ELEMENTS, name); if (i < 0) { name = getSubstitute(name); i = Arrays.binarySearch(NATIVE_ELEMENTS, name); } switch (i) { case 0: return this.endBalance != null && this.endBalance.equals(element) ? 0 : -1; default: return super.getElementIndex(name, element); } }
/** * Returns the element called <code>name</code> at <code>index</code>.<p> * The legal value(s) for <code>name</code> are defined in {@link #getElement}. **/
Returns the element called <code>name</code> at <code>index</code>. The legal value(s) for <code>name</code> are defined in <code>#getElement</code>
getElementIndex
{ "repo_name": "jboss-fuse/camel-c24io", "path": "src/test/java/biz/c24/io/training/statements/Trailer.java", "license": "apache-2.0", "size": 8339 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,166,756
public Enumeration<String> getChildIds(String nodeId) throws PortalException;
Enumeration<String> function(String nodeId) throws PortalException;
/** * Returns a list of child node Ids for a given node. * * @param nodeId a <code>String</code> value * @return a <code>List</code> of <code>String</code> child node Ids. * @exception PortalException if an error occurs */
Returns a list of child node Ids for a given node
getChildIds
{ "repo_name": "jl1955/uPortal5", "path": "uPortal-core/src/main/java/org/apereo/portal/layout/IUserLayoutManager.java", "license": "apache-2.0", "size": 12317 }
[ "java.util.Enumeration", "org.apereo.portal.PortalException" ]
import java.util.Enumeration; import org.apereo.portal.PortalException;
import java.util.*; import org.apereo.portal.*;
[ "java.util", "org.apereo.portal" ]
java.util; org.apereo.portal;
1,011,957
@Test public void testSplitQueryFnWithoutNumSplits() throws Exception { // Force SplitQueryFn to compute the number of query splits int numSplits = 0; int expectedNumSplits = 20; long entityBytes = expectedNumSplits * DEFAULT_BUNDLE_SIZE_BYTES; // In seconds long timestamp = 1234L; RunQueryRequest latestTimestampRequest = makeRequest(makeLatestTimestampQuery(NAMESPACE), NAMESPACE); RunQueryResponse latestTimestampResponse = makeLatestTimestampResponse(timestamp); // Per Kind statistics request and response RunQueryRequest statRequest = makeRequest(makeStatKindQuery(NAMESPACE, timestamp), NAMESPACE); RunQueryResponse statResponse = makeStatKindResponse(entityBytes); when(mockDatastore.runQuery(latestTimestampRequest)) .thenReturn(latestTimestampResponse); when(mockDatastore.runQuery(statRequest)) .thenReturn(statResponse); when(mockQuerySplitter.getSplits( eq(QUERY), any(PartitionId.class), eq(expectedNumSplits), any(Datastore.class))) .thenReturn(splitQuery(QUERY, expectedNumSplits)); SplitQueryFn splitQueryFn = new SplitQueryFn(V_1_OPTIONS, numSplits, mockDatastoreFactory); DoFnTester<Query, KV<Integer, Query>> doFnTester = DoFnTester.of(splitQueryFn); doFnTester.setCloningBehavior(CloningBehavior.DO_NOT_CLONE); List<KV<Integer, Query>> queries = doFnTester.processBundle(QUERY); assertEquals(queries.size(), expectedNumSplits); verifyUniqueKeys(queries); verify(mockQuerySplitter, times(1)).getSplits( eq(QUERY), any(PartitionId.class), eq(expectedNumSplits), any(Datastore.class)); verify(mockDatastore, times(1)).runQuery(latestTimestampRequest); verify(mockDatastore, times(1)).runQuery(statRequest); }
void function() throws Exception { int numSplits = 0; int expectedNumSplits = 20; long entityBytes = expectedNumSplits * DEFAULT_BUNDLE_SIZE_BYTES; long timestamp = 1234L; RunQueryRequest latestTimestampRequest = makeRequest(makeLatestTimestampQuery(NAMESPACE), NAMESPACE); RunQueryResponse latestTimestampResponse = makeLatestTimestampResponse(timestamp); RunQueryRequest statRequest = makeRequest(makeStatKindQuery(NAMESPACE, timestamp), NAMESPACE); RunQueryResponse statResponse = makeStatKindResponse(entityBytes); when(mockDatastore.runQuery(latestTimestampRequest)) .thenReturn(latestTimestampResponse); when(mockDatastore.runQuery(statRequest)) .thenReturn(statResponse); when(mockQuerySplitter.getSplits( eq(QUERY), any(PartitionId.class), eq(expectedNumSplits), any(Datastore.class))) .thenReturn(splitQuery(QUERY, expectedNumSplits)); SplitQueryFn splitQueryFn = new SplitQueryFn(V_1_OPTIONS, numSplits, mockDatastoreFactory); DoFnTester<Query, KV<Integer, Query>> doFnTester = DoFnTester.of(splitQueryFn); doFnTester.setCloningBehavior(CloningBehavior.DO_NOT_CLONE); List<KV<Integer, Query>> queries = doFnTester.processBundle(QUERY); assertEquals(queries.size(), expectedNumSplits); verifyUniqueKeys(queries); verify(mockQuerySplitter, times(1)).getSplits( eq(QUERY), any(PartitionId.class), eq(expectedNumSplits), any(Datastore.class)); verify(mockDatastore, times(1)).runQuery(latestTimestampRequest); verify(mockDatastore, times(1)).runQuery(statRequest); }
/** * Tests {@link SplitQueryFn} when no query splits is specified. */
Tests <code>SplitQueryFn</code> when no query splits is specified
testSplitQueryFnWithoutNumSplits
{ "repo_name": "jasonkuster/beam", "path": "sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/datastore/DatastoreV1Test.java", "license": "apache-2.0", "size": 32717 }
[ "com.google.datastore.v1.PartitionId", "com.google.datastore.v1.Query", "com.google.datastore.v1.RunQueryRequest", "com.google.datastore.v1.RunQueryResponse", "com.google.datastore.v1.client.Datastore", "java.util.List", "org.apache.beam.sdk.io.gcp.datastore.DatastoreV1", "org.apache.beam.sdk.transforms.DoFnTester", "org.junit.Assert", "org.mockito.Matchers", "org.mockito.Mockito" ]
import com.google.datastore.v1.PartitionId; import com.google.datastore.v1.Query; import com.google.datastore.v1.RunQueryRequest; import com.google.datastore.v1.RunQueryResponse; import com.google.datastore.v1.client.Datastore; import java.util.List; import org.apache.beam.sdk.io.gcp.datastore.DatastoreV1; import org.apache.beam.sdk.transforms.DoFnTester; import org.junit.Assert; import org.mockito.Matchers; import org.mockito.Mockito;
import com.google.datastore.v1.*; import com.google.datastore.v1.client.*; import java.util.*; import org.apache.beam.sdk.io.gcp.datastore.*; import org.apache.beam.sdk.transforms.*; import org.junit.*; import org.mockito.*;
[ "com.google.datastore", "java.util", "org.apache.beam", "org.junit", "org.mockito" ]
com.google.datastore; java.util; org.apache.beam; org.junit; org.mockito;
1,123,146
void afterKrfCreated(); } private abstract static class AbstractDiskRegionInfo implements DiskRegionInfo { private DiskRegionView dr; private boolean unrecovered = false; public AbstractDiskRegionInfo(DiskRegionView dr) { this.dr = dr; }
void afterKrfCreated(); } private abstract static class AbstractDiskRegionInfo implements DiskRegionInfo { private DiskRegionView dr; private boolean unrecovered = false; public AbstractDiskRegionInfo(DiskRegionView dr) { this.dr = dr; }
/** * Callback to indicate that this oplog has created a krf. */
Callback to indicate that this oplog has created a krf
afterKrfCreated
{ "repo_name": "jdeppe-pivotal/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java", "license": "apache-2.0", "size": 272626 }
[ "org.apache.geode.internal.cache.persistence.DiskRegionView" ]
import org.apache.geode.internal.cache.persistence.DiskRegionView;
import org.apache.geode.internal.cache.persistence.*;
[ "org.apache.geode" ]
org.apache.geode;
2,486,257
private ActionForward confirmDeleteAttachment(ActionMapping mapping, ProtocolForm form, HttpServletRequest request, HttpServletResponse response, Class<? extends org.kuali.kra.protocol.noteattachment.ProtocolAttachmentBase> attachmentType) throws Exception { final int selection = this.getSelectedLine(request); final org.kuali.kra.protocol.noteattachment.ProtocolAttachmentBase attachment = form.getNotesAttachmentsHelper().retrieveExistingAttachmentByType(selection, attachmentType); if (attachment == null) { LOG.info(NOT_FOUND_SELECTION + selection); return mapping.findForward(Constants.MAPPING_BASIC); } final String confirmMethod = form.getNotesAttachmentsHelper().retrieveConfirmMethodByType(attachmentType); final StrutsConfirmation confirm = buildParameterizedConfirmationQuestion(mapping, form, request, response, confirmMethod, KeyConstants.QUESTION_DELETE_ATTACHMENT_CONFIRMATION, attachment.getAttachmentDescription(), attachment.getFile().getName()); return confirm(confirm, confirmMethod, CONFIRM_NO_DELETE); }
ActionForward function(ActionMapping mapping, ProtocolForm form, HttpServletRequest request, HttpServletResponse response, Class<? extends org.kuali.kra.protocol.noteattachment.ProtocolAttachmentBase> attachmentType) throws Exception { final int selection = this.getSelectedLine(request); final org.kuali.kra.protocol.noteattachment.ProtocolAttachmentBase attachment = form.getNotesAttachmentsHelper().retrieveExistingAttachmentByType(selection, attachmentType); if (attachment == null) { LOG.info(NOT_FOUND_SELECTION + selection); return mapping.findForward(Constants.MAPPING_BASIC); } final String confirmMethod = form.getNotesAttachmentsHelper().retrieveConfirmMethodByType(attachmentType); final StrutsConfirmation confirm = buildParameterizedConfirmationQuestion(mapping, form, request, response, confirmMethod, KeyConstants.QUESTION_DELETE_ATTACHMENT_CONFIRMATION, attachment.getAttachmentDescription(), attachment.getFile().getName()); return confirm(confirm, confirmMethod, CONFIRM_NO_DELETE); }
/** * Finds the attachment selected the by client which is really just an index. * Then deletes the selected attachment based on the passed-in attachmentType. * * @param mapping the action mapping * @param form the form. * @param request the request. * @param response the response. * @param attachmentType the attachment type. * @return an action forward. * @throws IllegalArgumentException if the attachmentType is not supported * @throws Exception if there is a problem executing the request. */
Finds the attachment selected the by client which is really just an index. Then deletes the selected attachment based on the passed-in attachmentType
confirmDeleteAttachment
{ "repo_name": "kuali/kc", "path": "coeus-impl/src/main/java/org/kuali/kra/irb/noteattachment/ProtocolNoteAndAttachmentAction.java", "license": "agpl-3.0", "size": 22345 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping", "org.kuali.coeus.sys.framework.controller.StrutsConfirmation", "org.kuali.kra.infrastructure.Constants", "org.kuali.kra.infrastructure.KeyConstants", "org.kuali.kra.irb.ProtocolForm" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.coeus.sys.framework.controller.StrutsConfirmation; import org.kuali.kra.infrastructure.Constants; import org.kuali.kra.infrastructure.KeyConstants; import org.kuali.kra.irb.ProtocolForm;
import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.coeus.sys.framework.controller.*; import org.kuali.kra.infrastructure.*; import org.kuali.kra.irb.*;
[ "javax.servlet", "org.apache.struts", "org.kuali.coeus", "org.kuali.kra" ]
javax.servlet; org.apache.struts; org.kuali.coeus; org.kuali.kra;
2,018,508
public List getListByAuthorityDomain(String authority, String domain) { try { TypeService service = new TypeService(); return service.getListByAuthorityDomain(authority, domain); } catch (Exception ex) { throw new CommonServiceException(ex); } }
List function(String authority, String domain) { try { TypeService service = new TypeService(); return service.getListByAuthorityDomain(authority, domain); } catch (Exception ex) { throw new CommonServiceException(ex); } }
/** * Get list of types for authority/domain. * @param authority the authority * @param domain the domain * @return list of TypeIfc */
Get list of types for authority/domain
getListByAuthorityDomain
{ "repo_name": "harfalm/Sakai-10.1", "path": "samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/shared/impl/common/TypeServiceImpl.java", "license": "apache-2.0", "size": 2950 }
[ "java.util.List", "org.sakaiproject.tool.assessment.services.CommonServiceException", "org.sakaiproject.tool.assessment.services.shared.TypeService" ]
import java.util.List; import org.sakaiproject.tool.assessment.services.CommonServiceException; import org.sakaiproject.tool.assessment.services.shared.TypeService;
import java.util.*; import org.sakaiproject.tool.assessment.services.*; import org.sakaiproject.tool.assessment.services.shared.*;
[ "java.util", "org.sakaiproject.tool" ]
java.util; org.sakaiproject.tool;
611,160
@Override protected EventReference getReplacement(EventReference old, String newName) { EventReference result; try { result = (EventReference) old.getClass().newInstance(); result.setValue(newName); } catch (Exception e) { getLogger().log(Level.SEVERE, "Failed to create instance of " + old.getClass().getName() + ":", e); result = null; } return result; }
EventReference function(EventReference old, String newName) { EventReference result; try { result = (EventReference) old.getClass().newInstance(); result.setValue(newName); } catch (Exception e) { getLogger().log(Level.SEVERE, STR + old.getClass().getName() + ":", e); result = null; } return result; }
/** * Returns the replacement object. * * @param old the old object * @param newName the new name to use * @return the replacement object, null in case of error */
Returns the replacement object
getReplacement
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-event/src/main/java/adams/flow/processor/UpdateEventName.java", "license": "gpl-3.0", "size": 4130 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
1,812,246
public String requestCard(byte[] messageRec) throws IOException { synchronized (out) { //try { out.write("T".getBytes()); out.flush(); // System.out.println("Card request sent"); // Thread that switches antennas waits until a card is requested // so that for each antenna switch at least one attempt to // read a card occurs. Avoiding starvation. cardRequestSent = true; // Blocking read // System.out.println("Waiting for card"); in.read(messageRec); // System.out.println("Got a card"); out.notify(); // } catch (SocketException e) { // // System.err.println("AntennaHandler.requestCard: Lost connection to server. Please press resume button to continue"); // e.printStackTrace(); // } } return new String(messageRec); }
String function(byte[] messageRec) throws IOException { synchronized (out) { out.write("T".getBytes()); out.flush(); cardRequestSent = true; in.read(messageRec); out.notify(); } return new String(messageRec); }
/** * Sends a command to the server requesting it to tell what card is on the * current antenna * * @param messageRec * the buffer to fill with the server response * @return the server response * @throws IOException * the connection failed */
Sends a command to the server requesting it to tell what card is on the current antenna
requestCard
{ "repo_name": "blernermhc/Bridge4Blind", "path": "src/controller/AntennaHandler.java", "license": "apache-2.0", "size": 12172 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,854,620
public PreparedStatement getStatement() { return statement; } /** * Executes the statement. * @return true if the first result is a {@link ResultSet}
PreparedStatement function() { return statement; } /** * Executes the statement. * @return true if the first result is a {@link ResultSet}
/** * Returns the underlying statement. * @return the statement */
Returns the underlying statement
getStatement
{ "repo_name": "AlexanderZf44/APermyakov", "path": "chapter_008/src/main/java/ru/apermyakov/TestTask/NamedParameterStatement.java", "license": "apache-2.0", "size": 10792 }
[ "java.sql.PreparedStatement", "java.sql.ResultSet" ]
import java.sql.PreparedStatement; import java.sql.ResultSet;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,914,718
public static boolean containsVote(long pk, long votePK) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().containsVote(pk, votePK); }
static boolean function(long pk, long votePK) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().containsVote(pk, votePK); }
/** * Returns <code>true</code> if the Vote is associated with the Answer. * * @param pk the primary key of the Answer * @param votePK the primary key of the Vote * @return <code>true</code> if the Vote is associated with the Answer; <code>false</code> otherwise * @throws SystemException if a system exception occurred */
Returns <code>true</code> if the Vote is associated with the Answer
containsVote
{ "repo_name": "p-gebhard/QuickAnswer", "path": "docroot/WEB-INF/service/it/gebhard/qa/service/persistence/AnswerUtil.java", "license": "gpl-3.0", "size": 33029 }
[ "com.liferay.portal.kernel.exception.SystemException" ]
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.exception.*;
[ "com.liferay.portal" ]
com.liferay.portal;
46,276
public ProcessorBinding getBinding(Profile profile) { return getTools().processorBindingForProcessor(this, profile); }
ProcessorBinding function(Profile profile) { return getTools().processorBindingForProcessor(this, profile); }
/** * Get the binding for this processor in the given profile. * * @param profile * The profile to search within. * @return The processor binding. * @throws IllegalStateException * If there are more than one binding for the processor. * @throws IndexOutOfBoundsException * If there aren't any bindings for the processor. * @see Scufl2Tools#processorBindingForProcessor(Processor,Profile) */
Get the binding for this processor in the given profile
getBinding
{ "repo_name": "binfalse/incubator-taverna-language", "path": "taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/core/Processor.java", "license": "apache-2.0", "size": 15517 }
[ "org.apache.taverna.scufl2.api.profiles.ProcessorBinding", "org.apache.taverna.scufl2.api.profiles.Profile" ]
import org.apache.taverna.scufl2.api.profiles.ProcessorBinding; import org.apache.taverna.scufl2.api.profiles.Profile;
import org.apache.taverna.scufl2.api.profiles.*;
[ "org.apache.taverna" ]
org.apache.taverna;
2,314,674
public static void checkElementTypes(Collection<?> c, Class<?> type) { for (Object elt : c) { if (!type.isInstance(elt)) { throw new ClassCastException( elt + " not assignable to " + type); } } }
static void function(Collection<?> c, Class<?> type) { for (Object elt : c) { if (!type.isInstance(elt)) { throw new ClassCastException( elt + STR + type); } } }
/** * Verifies that all non-<code>null</code> elements of the given * <code>Collection</code> are assignable to the specified type, * throwing a <code>ClassCastException</code> if any are not. */
Verifies that all non-<code>null</code> elements of the given <code>Collection</code> are assignable to the specified type, throwing a <code>ClassCastException</code> if any are not
checkElementTypes
{ "repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes", "path": "bigdata-jini/src/main/java/com/bigdata/util/Util.java", "license": "gpl-2.0", "size": 17063 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
787,676
public void handleInput(InputHandler input, float timestep) { for (SceneLayer<?> layer : layers) { layer.handleInput(input, timestep); } }
void function(InputHandler input, float timestep) { for (SceneLayer<?> layer : layers) { layer.handleInput(input, timestep); } }
/** * Handle the input for each element in the scene * @param input * @param timestep */
Handle the input for each element in the scene
handleInput
{ "repo_name": "bwyap/java-engine-lwjgl", "path": "src/com/bwyap/engine/render3d/Scene.java", "license": "mit", "size": 2119 }
[ "com.bwyap.engine.input.InputHandler" ]
import com.bwyap.engine.input.InputHandler;
import com.bwyap.engine.input.*;
[ "com.bwyap.engine" ]
com.bwyap.engine;
1,748,147
boolean assignStaticIP(MacAddress macAddress, IpAssignment ipAssignment);
boolean assignStaticIP(MacAddress macAddress, IpAssignment ipAssignment);
/** * Assigns the requested IP to the MAC ID (if available) for an indefinite period of time. * * @param macAddress mac address of the client * @param ipAssignment ip address and dhcp options requested for the client * @return true if the mapping was successfully registered, false otherwise */
Assigns the requested IP to the MAC ID (if available) for an indefinite period of time
assignStaticIP
{ "repo_name": "sdnwiselab/onos", "path": "apps/dhcp/api/src/main/java/org/onosproject/dhcp/DhcpStore.java", "license": "apache-2.0", "size": 3738 }
[ "org.onlab.packet.MacAddress" ]
import org.onlab.packet.MacAddress;
import org.onlab.packet.*;
[ "org.onlab.packet" ]
org.onlab.packet;
2,644,975
@Deprecated public PactDslJsonArray stringMatcher(String regex) { generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(1), new RandomStringGenerator(10)); stringMatcher(regex, new Generex(regex).random()); return this; }
PactDslJsonArray function(String regex) { generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(1), new RandomStringGenerator(10)); stringMatcher(regex, new Generex(regex).random()); return this; }
/** * Element that must match the regular expression * @param regex regular expression * @deprecated Use the version that takes an example value */
Element that must match the regular expression
stringMatcher
{ "repo_name": "algra/pact-jvm", "path": "pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java", "license": "apache-2.0", "size": 43161 }
[ "au.com.dius.pact.model.generators.Category", "au.com.dius.pact.model.generators.RandomStringGenerator", "com.mifmif.common.regex.Generex" ]
import au.com.dius.pact.model.generators.Category; import au.com.dius.pact.model.generators.RandomStringGenerator; import com.mifmif.common.regex.Generex;
import au.com.dius.pact.model.generators.*; import com.mifmif.common.regex.*;
[ "au.com.dius", "com.mifmif.common" ]
au.com.dius; com.mifmif.common;
2,125,881
public boolean supportsStoredProcedures() throws SQLException { return true; }
boolean function() throws SQLException { return true; }
/** * Retrieves whether this database supports stored procedure calls * that use the stored procedure escape syntax. <p> * * <!-- start release-specific documentation --> * <div class="ReleaseSpecificDocumentation"> * <h3>HSQLDB-Specific Information:</h3> <p> * * Up to and including 1.7.2, HSQLDB supports calling public static * Java methods in the context of SQL Stored Procedures; this method * always returns <code>true</code>. * </div> * <!-- end release-specific documentation --> * @return <code>true</code> if so; <code>false</code> otherwise * @exception SQLException if a database access error occurs * @see jdbcPreparedStatement * @see jdbcConnection#prepareCall */
Retrieves whether this database supports stored procedure calls that use the stored procedure escape syntax. HSQLDB-Specific Information: Up to and including 1.7.2, HSQLDB supports calling public static Java methods in the context of SQL Stored Procedures; this method always returns <code>true</code>.
supportsStoredProcedures
{ "repo_name": "minghao7896321/canyin", "path": "hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java", "license": "apache-2.0", "size": 237705 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,608,172
synchronized void removeStoredBlock(Block block, DatanodeDescriptor node) { NameNode.stateChangeLog.debug("BLOCK* NameSystem.removeStoredBlock: " +block + " from "+node.getName()); if (!blocksMap.removeNode(block, node)) { NameNode.stateChangeLog.debug("BLOCK* NameSystem.removeStoredBlock: " +block+" has already been removed from node "+node); return; } // // It's possible that the block was removed because of a datanode // failure. If the block is still valid, check if replication is // necessary. In that case, put block on a possibly-will- // be-replicated list. // INode fileINode = blocksMap.getINode(block); if (fileINode != null) { decrementSafeBlockCount(block); updateNeededReplications(block, -1, 0); } // // We've removed a block from a node, so it's definitely no longer // in "excess" there. // Collection<Block> excessBlocks = excessReplicateMap.get(node.getStorageID()); if (excessBlocks != null) { if (excessBlocks.remove(block)) { excessBlocksCount--; NameNode.stateChangeLog.debug("BLOCK* NameSystem.removeStoredBlock: " + block + " is removed from excessBlocks"); if (excessBlocks.size() == 0) { excessReplicateMap.remove(node.getStorageID()); } } } // Remove the replica from corruptReplicas corruptReplicas.removeFromCorruptReplicasMap(block, node); }
synchronized void removeStoredBlock(Block block, DatanodeDescriptor node) { NameNode.stateChangeLog.debug(STR +block + STR+node.getName()); if (!blocksMap.removeNode(block, node)) { NameNode.stateChangeLog.debug(STR +block+STR+node); return; } if (fileINode != null) { decrementSafeBlockCount(block); updateNeededReplications(block, -1, 0); } if (excessBlocks != null) { if (excessBlocks.remove(block)) { excessBlocksCount--; NameNode.stateChangeLog.debug(STR + block + STR); if (excessBlocks.size() == 0) { excessReplicateMap.remove(node.getStorageID()); } } } corruptReplicas.removeFromCorruptReplicasMap(block, node); }
/** * Modify (block-->datanode) map. Possibly generate * replication tasks, if the removed block is still valid. */
Modify (block-->datanode) map. Possibly generate replication tasks, if the removed block is still valid
removeStoredBlock
{ "repo_name": "davidl1/hortonworks-extension", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java", "license": "apache-2.0", "size": 218585 }
[ "org.apache.hadoop.hdfs.protocol.Block" ]
import org.apache.hadoop.hdfs.protocol.Block;
import org.apache.hadoop.hdfs.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,232,273
public void resetRing(List<TokenRange> servers) { this.servers = getAllServers(servers); }
void function(List<TokenRange> servers) { this.servers = getAllServers(servers); }
/** * Reset the servers in the ring. */
Reset the servers in the ring
resetRing
{ "repo_name": "dvasilen/Hive-Cassandra", "path": "src/main/java/org/apache/hadoop/hive/cassandra/CassandraProxyClient.java", "license": "apache-2.0", "size": 13667 }
[ "java.util.List", "org.apache.cassandra.thrift.TokenRange" ]
import java.util.List; import org.apache.cassandra.thrift.TokenRange;
import java.util.*; import org.apache.cassandra.thrift.*;
[ "java.util", "org.apache.cassandra" ]
java.util; org.apache.cassandra;
2,881,529
private synchronized Producer<EncodedImage> getBackgroundNetworkFetchToEncodedMemorySequence() { if (mBackgroundNetworkFetchToEncodedMemorySequence == null) { // Use hand-off producer to ensure that we don't do any unnecessary work on the UI thread. mBackgroundNetworkFetchToEncodedMemorySequence = mProducerFactory.newBackgroundThreadHandoffProducer( getCommonNetworkFetchToEncodedMemorySequence()); } return mBackgroundNetworkFetchToEncodedMemorySequence; }
synchronized Producer<EncodedImage> function() { if (mBackgroundNetworkFetchToEncodedMemorySequence == null) { mBackgroundNetworkFetchToEncodedMemorySequence = mProducerFactory.newBackgroundThreadHandoffProducer( getCommonNetworkFetchToEncodedMemorySequence()); } return mBackgroundNetworkFetchToEncodedMemorySequence; }
/** * background-thread hand-off -> multiplex -> encoded cache -> * disk cache -> (webp transcode) -> network fetch. */
background-thread hand-off -> multiplex -> encoded cache -> disk cache -> (webp transcode) -> network fetch
getBackgroundNetworkFetchToEncodedMemorySequence
{ "repo_name": "biezhihua/FrescoStudy", "path": "imagepipeline/src/main/java/com/facebook/imagepipeline/core/ProducerSequenceFactory.java", "license": "bsd-3-clause", "size": 23175 }
[ "com.facebook.imagepipeline.image.EncodedImage", "com.facebook.imagepipeline.producers.Producer" ]
import com.facebook.imagepipeline.image.EncodedImage; import com.facebook.imagepipeline.producers.Producer;
import com.facebook.imagepipeline.image.*; import com.facebook.imagepipeline.producers.*;
[ "com.facebook.imagepipeline" ]
com.facebook.imagepipeline;
49,608
private boolean CreateRemoteFolder(SFTPv3Client sftpClient, String foldername) { boolean retval=false; if(!sshDirectoryExists(sftpClient, foldername)) { try { sftpClient.mkdir(foldername, 0700); retval=true; }catch (Exception e) { logError(BaseMessages.getString(PKG, "JobSSH2PUT.Log.Error.CreatingRemoteFolder",foldername)); } } return retval; }
boolean function(SFTPv3Client sftpClient, String foldername) { boolean retval=false; if(!sshDirectoryExists(sftpClient, foldername)) { try { sftpClient.mkdir(foldername, 0700); retval=true; }catch (Exception e) { logError(BaseMessages.getString(PKG, STR,foldername)); } } return retval; }
/** * Create remote folder * * @param sftpClient * @param foldername * @return true, if foldername is created */
Create remote folder
CreateRemoteFolder
{ "repo_name": "dianhu/Kettle-Research", "path": "src/org/pentaho/di/job/entries/ssh2put/JobEntrySSH2PUT.java", "license": "lgpl-2.1", "size": 37686 }
[ "com.trilead.ssh2.SFTPv3Client", "org.pentaho.di.i18n.BaseMessages" ]
import com.trilead.ssh2.SFTPv3Client; import org.pentaho.di.i18n.BaseMessages;
import com.trilead.ssh2.*; import org.pentaho.di.i18n.*;
[ "com.trilead.ssh2", "org.pentaho.di" ]
com.trilead.ssh2; org.pentaho.di;
2,248,760
//---------------------------------------------------------------------- public ForumWatchDTO find(Long id) throws SQLException;
ForumWatchDTO function(Long id) throws SQLException;
/** * Finds a bean by its primary key * @param id * @return the bean found or null if not found */
Finds a bean by its primary key
find
{ "repo_name": "vasttrafik/wso2-community-api", "path": "java/src/main/java/org/vasttrafik/wso2/carbon/community/api/dao/ForumWatchDAO.java", "license": "mit", "size": 2724 }
[ "java.sql.SQLException", "org.vasttrafik.wso2.carbon.community.api.model.ForumWatchDTO" ]
import java.sql.SQLException; import org.vasttrafik.wso2.carbon.community.api.model.ForumWatchDTO;
import java.sql.*; import org.vasttrafik.wso2.carbon.community.api.model.*;
[ "java.sql", "org.vasttrafik.wso2" ]
java.sql; org.vasttrafik.wso2;
2,263,336
//!> String json1 = "{\"menu\": {"+ " \"id\": \"file\","+ "\"value\": \"Fileeeee\","+ "\"popup\": {"+ "\"menuitem\": ["+ "{\"value\": \"Neweee\", \"onclick\": \"CreateNewDoc()\"},"+ "{\"value\": \"Open\", \"onclick\": \"OpenDoc()\"},"+ "{\"value\": \"Close\", \"onclick\": \"CloseDoc()\"}"+ "]"+ "}"+ "}}"; String json2 = "{\"menu\": {"+ " \"id\": \"file\","+ "\"value\": \"File\","+ "\"popup\": {"+ "\"menuitem\": ["+ "{\"value\": \"New\", \"onclick\": \"CreateNewDoc()\"},"+ "{\"value\": \"Open\", \"onclick\": \"OpenDoc()\"},"+ "{\"value\": \"Close\", \"onclick\": \"CloseDoc()\"}"+ "]"+ "}"+ "}}"; //!< assertThat(json1, is(haveSameKeys(json2))); }
String json1 = "{\"menu\STR+ STRid\STRfile\","+ "\"value\STRFileeeee\","+ "\"popup\STR+ "\"menuitem\STR+ "{\"value\STRNeweee\STRonclick\STRCreateNewDoc()\"},"+ "{\"value\STROpen\STRonclick\STROpenDoc()\"},"+ "{\"value\STRClose\STRonclick\STRCloseDoc()\"}"+ "]"+ "}"+ "}}"; String json2 = "{\"menu\STR+ STRid\STRfile\","+ "\"value\STRFile\","+ "\"popup\STR+ "\"menuitem\STR+ "{\"value\STRNew\STRonclick\STRCreateNewDoc()\"},"+ "{\"value\STROpen\STRonclick\STROpenDoc()\"},"+ "{\"value\STRClose\STRonclick\STRCloseDoc()\"}"+ "]"+ "}"+ "}}"; assertThat(json1, is(haveSameKeys(json2))); }
/** * Same keys, different vals * * @throws Exception Exception */
Same keys, different vals
testHaveSameKeys_same
{ "repo_name": "baniuk/ImageJTestSuite", "path": "src/test/java/com/github/baniuk/ImageJTestSuite/matchers/json/JsonKeysMatcherTest.java", "license": "mit", "size": 4008 }
[ "org.hamcrest.CoreMatchers", "org.hamcrest.MatcherAssert" ]
import org.hamcrest.CoreMatchers; import org.hamcrest.MatcherAssert;
import org.hamcrest.*;
[ "org.hamcrest" ]
org.hamcrest;
1,620,093
public Currency getCurrency() { return _currency; }
Currency function() { return _currency; }
/** * Gets the index currency. * * @return The currency. */
Gets the index currency
getCurrency
{ "repo_name": "McLeodMoores/starling", "path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/instrument/index/GeneratorDepositONCounterpart.java", "license": "apache-2.0", "size": 6091 }
[ "com.opengamma.util.money.Currency" ]
import com.opengamma.util.money.Currency;
import com.opengamma.util.money.*;
[ "com.opengamma.util" ]
com.opengamma.util;
1,901,795
EAttribute getFossilSteamSupply_FuelDemandLimit();
EAttribute getFossilSteamSupply_FuelDemandLimit();
/** * Returns the meta object for the attribute '{@link CIM.IEC61970.Generation.GenerationDynamics.FossilSteamSupply#getFuelDemandLimit <em>Fuel Demand Limit</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Fuel Demand Limit</em>'. * @see CIM.IEC61970.Generation.GenerationDynamics.FossilSteamSupply#getFuelDemandLimit() * @see #getFossilSteamSupply() * @generated */
Returns the meta object for the attribute '<code>CIM.IEC61970.Generation.GenerationDynamics.FossilSteamSupply#getFuelDemandLimit Fuel Demand Limit</code>'.
getFossilSteamSupply_FuelDemandLimit
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Generation/GenerationDynamics/GenerationDynamicsPackage.java", "license": "mit", "size": 239957 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,751,969
public void reset(InetAddress remoteEP) { SystemKeyspace.updatePreferredIP(id, remoteEP); resetedEndpoint = remoteEP; for (OutboundTcpConnection conn : new OutboundTcpConnection[] { cmdCon, ackCon }) conn.softCloseSocket(); // release previous metrics and create new one with reset address metrics.release(); metrics = new ConnectionMetrics(resetedEndpoint, this); }
void function(InetAddress remoteEP) { SystemKeyspace.updatePreferredIP(id, remoteEP); resetedEndpoint = remoteEP; for (OutboundTcpConnection conn : new OutboundTcpConnection[] { cmdCon, ackCon }) conn.softCloseSocket(); metrics.release(); metrics = new ConnectionMetrics(resetedEndpoint, this); }
/** * reconnect to @param remoteEP (after the current message backlog is exhausted). * Used by Ec2MultiRegionSnitch to force nodes in the same region to communicate over their private IPs. * @param remoteEP */
reconnect to @param remoteEP (after the current message backlog is exhausted). Used by Ec2MultiRegionSnitch to force nodes in the same region to communicate over their private IPs
reset
{ "repo_name": "ibmsoe/cassandra", "path": "src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java", "license": "apache-2.0", "size": 7103 }
[ "java.net.InetAddress", "org.apache.cassandra.db.SystemKeyspace", "org.apache.cassandra.metrics.ConnectionMetrics" ]
import java.net.InetAddress; import org.apache.cassandra.db.SystemKeyspace; import org.apache.cassandra.metrics.ConnectionMetrics;
import java.net.*; import org.apache.cassandra.db.*; import org.apache.cassandra.metrics.*;
[ "java.net", "org.apache.cassandra" ]
java.net; org.apache.cassandra;
1,502,068
byte[] getPropertyValue(Property property) throws Exception, IllegalStateException;
byte[] getPropertyValue(Property property) throws Exception, IllegalStateException;
/** * Returns the property value as byte array. * * @param property the input property to get value from * @return the value as byte array * @throws Exception if there is any exception during this operation * @throws IllegalArgumentException if input param is null */
Returns the property value as byte array
getPropertyValue
{ "repo_name": "porcelli/OpenSpotLight", "path": "osl-persistence/osl-persistence-api/src/main/java/org/openspotlight/storage/engine/StorageEngineBind.java", "license": "lgpl-3.0", "size": 11719 }
[ "org.openspotlight.storage.domain.Property" ]
import org.openspotlight.storage.domain.Property;
import org.openspotlight.storage.domain.*;
[ "org.openspotlight.storage" ]
org.openspotlight.storage;
642,487
protected InputStream getWebPackStream(String name, String webDirURL) { InputStream result; // TODO: Look first in same directory as primary jar // This may include prompting for changing of media // TODO: download and cache them all before starting copy process // See compiler.Packager#getJarOutputStream for the counterpart InstallData installData = getInstallData(); String baseName = installData.getInfo().getInstallerBase(); String packURL = webDirURL + "/" + baseName + ".pack-" + name + ".jar"; String tempFolder = IoHelper.translatePath( installData.getInfo().getUninstallerPath() + GUIPackResources.tempSubPath, installData.getVariables()); String tempFile; try { tempFile = WebRepositoryAccessor.getCachedUrl(packURL, tempFolder); } catch (InterruptedIOException exception) { throw new ResourceInterruptedException("Retrieval of " + webDirURL + " interrupted", exception); } catch (IOException exception) { throw new ResourceException("Failed to read " + webDirURL, exception); } try { URL url = new URL("jar:" + tempFile + "!/packs/pack-" + name); result = url.openStream(); } catch (IOException exception) { throw new ResourceException("Failed to read pack", exception); } return result; }
InputStream function(String name, String webDirURL) { InputStream result; InstallData installData = getInstallData(); String baseName = installData.getInfo().getInstallerBase(); String packURL = webDirURL + "/" + baseName + STR + name + ".jar"; String tempFolder = IoHelper.translatePath( installData.getInfo().getUninstallerPath() + GUIPackResources.tempSubPath, installData.getVariables()); String tempFile; try { tempFile = WebRepositoryAccessor.getCachedUrl(packURL, tempFolder); } catch (InterruptedIOException exception) { throw new ResourceInterruptedException(STR + webDirURL + STR, exception); } catch (IOException exception) { throw new ResourceException(STR + webDirURL, exception); } try { URL url = new URL("jar:" + tempFile + STR + name); result = url.openStream(); } catch (IOException exception) { throw new ResourceException(STR, exception); } return result; }
/** * Returns the stream to a web-based pack resource. * * @param name the resource name * @param webDirURL the web URL to load the resource from * @return a stream to the resource * @throws ResourceNotFoundException if the resource cannot be found * @throws ResourceInterruptedException if resource retrieval is interrupted */
Returns the stream to a web-based pack resource
getWebPackStream
{ "repo_name": "mtjandra/izpack", "path": "izpack-installer/src/main/java/com/izforge/izpack/installer/unpacker/GUIPackResources.java", "license": "apache-2.0", "size": 3077 }
[ "com.izforge.izpack.api.data.InstallData", "com.izforge.izpack.api.exception.ResourceException", "com.izforge.izpack.api.exception.ResourceInterruptedException", "com.izforge.izpack.installer.web.WebRepositoryAccessor", "com.izforge.izpack.util.IoHelper", "java.io.IOException", "java.io.InputStream", "java.io.InterruptedIOException" ]
import com.izforge.izpack.api.data.InstallData; import com.izforge.izpack.api.exception.ResourceException; import com.izforge.izpack.api.exception.ResourceInterruptedException; import com.izforge.izpack.installer.web.WebRepositoryAccessor; import com.izforge.izpack.util.IoHelper; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException;
import com.izforge.izpack.api.data.*; import com.izforge.izpack.api.exception.*; import com.izforge.izpack.installer.web.*; import com.izforge.izpack.util.*; import java.io.*;
[ "com.izforge.izpack", "java.io" ]
com.izforge.izpack; java.io;
1,394,171
public static boolean isDlLiteObjectPropertyAxiom (OWLObjectPropertyAxiom ax){ boolean isDlLite = false; //SubObjectPropertyOf if ((ax instanceof OWLSubObjectPropertyOfAxiom) && isDlLiteSubObjectPropertyAxiom((OWLSubObjectPropertyOfAxiom)ax)){ isDlLite = true; } //EquivalentObjectProperties else if ((ax instanceof OWLEquivalentObjectPropertiesAxiom) && isDlLiteEquivalentObjectPropertiesAxiom ((OWLEquivalentObjectPropertiesAxiom)ax)) { isDlLite = true; } //DisjointObjectProperties else if ((ax instanceof OWLDisjointObjectPropertiesAxiom) && isDlLiteDisjointObjectPropertiesAxiom ((OWLDisjointObjectPropertiesAxiom)ax)) { isDlLite = true; } //InverseObjectProperties else if ((ax instanceof OWLInverseObjectPropertiesAxiom) && isDlLiteInverseObjectPropertiesAxiom ((OWLInverseObjectPropertiesAxiom)ax)){ isDlLite = true; } //ObjectPropertyDomain else if ((ax instanceof OWLObjectPropertyDomainAxiom)&& isDlLiteObjectPropertyDomainAxiom ((OWLObjectPropertyDomainAxiom)ax)) { isDlLite = true; } //ObjectPropertyRange else if ((ax instanceof OWLObjectPropertyRangeAxiom) && isDlLiteObjectPropertyRangeAxiom ((OWLObjectPropertyRangeAxiom)ax)){ isDlLite = true; } //SymmetricObjectProperty else if ((ax instanceof OWLSymmetricObjectPropertyAxiom)&& isDlLiteSymmetricObjectPropertyAxiom ((OWLSymmetricObjectPropertyAxiom)ax)){ isDlLite = true; } //Functional property axiom //not in DL-LiteR so we don't care // else if (ax instanceof OWLFunctionalObjectPropertyAxiom) { // try { // if(isDlLiteFunctionalObjectPropertyAxiom // ((OWLFunctionalObjectPropertyAxiom)ax, ont)){ // isDlLite = true; // } // } catch (FunctionalPropertySpecializedException e) { // // TODO Auto-generated catch block // //e.printStackTrace(); // //don't do anything, just to deal with the exception // } catch (FunctionalPropertyParticipatesInQualifiedExistentialException e2) { // // TODO Auto-generated catch block // //e2.printStackTrace(); // //don't do anything, just to deal with the exception // } // } return isDlLite; }
static boolean function (OWLObjectPropertyAxiom ax){ boolean isDlLite = false; if ((ax instanceof OWLSubObjectPropertyOfAxiom) && isDlLiteSubObjectPropertyAxiom((OWLSubObjectPropertyOfAxiom)ax)){ isDlLite = true; } else if ((ax instanceof OWLEquivalentObjectPropertiesAxiom) && isDlLiteEquivalentObjectPropertiesAxiom ((OWLEquivalentObjectPropertiesAxiom)ax)) { isDlLite = true; } else if ((ax instanceof OWLDisjointObjectPropertiesAxiom) && isDlLiteDisjointObjectPropertiesAxiom ((OWLDisjointObjectPropertiesAxiom)ax)) { isDlLite = true; } else if ((ax instanceof OWLInverseObjectPropertiesAxiom) && isDlLiteInverseObjectPropertiesAxiom ((OWLInverseObjectPropertiesAxiom)ax)){ isDlLite = true; } else if ((ax instanceof OWLObjectPropertyDomainAxiom)&& isDlLiteObjectPropertyDomainAxiom ((OWLObjectPropertyDomainAxiom)ax)) { isDlLite = true; } else if ((ax instanceof OWLObjectPropertyRangeAxiom) && isDlLiteObjectPropertyRangeAxiom ((OWLObjectPropertyRangeAxiom)ax)){ isDlLite = true; } else if ((ax instanceof OWLSymmetricObjectPropertyAxiom)&& isDlLiteSymmetricObjectPropertyAxiom ((OWLSymmetricObjectPropertyAxiom)ax)){ isDlLite = true; } return isDlLite; }
/************************************************************************** * This method accepts as input an OWLObjectPropertyAxiom and returns true * in case it is an Object Property Axiom valid in DL Lite * <p> * ObjectPropertyAxiom:= SubObjectPropertyOf | EquivalentObjectProperties | * DisjointObjectProperties |InverseObjectProperties * | ObjectPropertyDomain | ObjectPropertyRange | * SymmetricObjectProperty | * Functional property (DL-Lite, but not OWL-QL) * @param ax the input OWLObjectPropertyAxiom * @return True when the the input OWLObjectPropertyAxiom is * valid syntactically in Dl Lite, for the input Dl Lite ontology, * and False in the opposite case. *************************************************************************/
This method accepts as input an OWLObjectPropertyAxiom and returns true in case it is an Object Property Axiom valid in DL Lite ObjectPropertyAxiom:= SubObjectPropertyOf | EquivalentObjectProperties | DisjointObjectProperties |InverseObjectProperties | ObjectPropertyDomain | ObjectPropertyRange | SymmetricObjectProperty | Functional property (DL-Lite, but not OWL-QL)
isDlLiteObjectPropertyAxiom
{ "repo_name": "ontop/ontoprox", "path": "src/main/java/org/semanticweb/ontop/beyondql/approximation/DLLiteAGrammarChecker.java", "license": "apache-2.0", "size": 56444 }
[ "org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom", "org.semanticweb.owlapi.model.OWLEquivalentObjectPropertiesAxiom", "org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom", "org.semanticweb.owlapi.model.OWLObjectPropertyAxiom", "org.semanticweb.owlapi.model.OWLObjectPropertyDomainAxiom", "org.semanticweb.owlapi.model.OWLObjectPropertyRangeAxiom", "org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom", "org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom" ]
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; import org.semanticweb.owlapi.model.OWLEquivalentObjectPropertiesAxiom; import org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom; import org.semanticweb.owlapi.model.OWLObjectPropertyAxiom; import org.semanticweb.owlapi.model.OWLObjectPropertyDomainAxiom; import org.semanticweb.owlapi.model.OWLObjectPropertyRangeAxiom; import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom; import org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom;
import org.semanticweb.owlapi.model.*;
[ "org.semanticweb.owlapi" ]
org.semanticweb.owlapi;
406,398
public ElkDisjointObjectPropertiesAxiom getDisjointObjectPropertiesAxiom( List<? extends ElkObjectPropertyExpression> disjointObjectPropertyExpressions);
ElkDisjointObjectPropertiesAxiom function( List<? extends ElkObjectPropertyExpression> disjointObjectPropertyExpressions);
/** * Create an {@link ElkDisjointObjectPropertiesAxiom}. * * @param disjointObjectPropertyExpressions * the {@link ElkObjectPropertyExpression}s for which the axiom * should be created * @return an {@link ElkDisjointObjectPropertiesAxiom} corresponding to the * input */
Create an <code>ElkDisjointObjectPropertiesAxiom</code>
getDisjointObjectPropertiesAxiom
{ "repo_name": "sesuncedu/elk-reasoner", "path": "elk-owl-parent/elk-owl-model/src/main/java/org/semanticweb/elk/owl/interfaces/ElkObjectFactory.java", "license": "apache-2.0", "size": 52558 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,533,106
public void translateFilter(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); // Compile auxiliary class for filter compileFilter(classGen, methodGen); // Create new instance of filter il.append(new NEW(cpg.addClass(_className))); il.append(DUP); il.append(new INVOKESPECIAL(cpg.addMethodref(_className, "<init>", "()V"))); // Initialize closure variables final int length = (_closureVars == null) ? 0 : _closureVars.size(); for (int i = 0; i < length; i++) { VariableRefBase varRef = (VariableRefBase) _closureVars.get(i); VariableBase var = varRef.getVariable(); Type varType = var.getType(); il.append(DUP); // Find nearest closure implemented as an inner class Closure variableClosure = _parentClosure; while (variableClosure != null) { if (variableClosure.inInnerClass()) break; variableClosure = variableClosure.getParentClosure(); } // Use getfield if in an inner class if (variableClosure != null) { il.append(ALOAD_0); il.append(new GETFIELD( cpg.addFieldref(variableClosure.getInnerClassName(), var.getEscapedName(), varType.toSignature()))); } else { // Use a load of instruction if in translet class il.append(var.loadInstruction()); } // Store variable in new closure il.append(new PUTFIELD( cpg.addFieldref(_className, var.getEscapedName(), varType.toSignature()))); } }
void function(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); compileFilter(classGen, methodGen); il.append(new NEW(cpg.addClass(_className))); il.append(DUP); il.append(new INVOKESPECIAL(cpg.addMethodref(_className, STR, "()V"))); final int length = (_closureVars == null) ? 0 : _closureVars.size(); for (int i = 0; i < length; i++) { VariableRefBase varRef = (VariableRefBase) _closureVars.get(i); VariableBase var = varRef.getVariable(); Type varType = var.getType(); il.append(DUP); Closure variableClosure = _parentClosure; while (variableClosure != null) { if (variableClosure.inInnerClass()) break; variableClosure = variableClosure.getParentClosure(); } if (variableClosure != null) { il.append(ALOAD_0); il.append(new GETFIELD( cpg.addFieldref(variableClosure.getInnerClassName(), var.getEscapedName(), varType.toSignature()))); } else { il.append(var.loadInstruction()); } il.append(new PUTFIELD( cpg.addFieldref(_className, var.getEscapedName(), varType.toSignature()))); } }
/** * Translate a predicate expression. This translation pushes * two references on the stack: a reference to a newly created * filter object and a reference to the predicate's closure. */
Translate a predicate expression. This translation pushes two references on the stack: a reference to a newly created filter object and a reference to the predicate's closure
translateFilter
{ "repo_name": "haikuowuya/android_system_code", "path": "src/com/sun/org/apache/xalan/internal/xsltc/compiler/Predicate.java", "license": "apache-2.0", "size": 22154 }
[ "com.sun.org.apache.bcel.internal.generic.ConstantPoolGen", "com.sun.org.apache.bcel.internal.generic.InstructionList", "com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator", "com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator", "com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type" ]
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; import com.sun.org.apache.bcel.internal.generic.InstructionList; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.bcel.internal.generic.*; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.*;
[ "com.sun.org" ]
com.sun.org;
2,476,152
private static final Uri encodeFilename(List<Transform> transforms, Uri uri) { if (transforms.isEmpty()) { return uri; } List<String> segments = new ArrayList<String>(uri.getPathSegments()); // This Uri implementation's getPathSegments() ignores trailing "/". if (segments.isEmpty() || uri.getPath().endsWith("/")) { return uri; } String filename = segments.get(segments.size() - 1); // Reverse transforms, restoring their original order. (In all other places the reverse order // is more convenient.) for (ListIterator<Transform> iter = transforms.listIterator(transforms.size()); iter.hasPrevious(); ) { Transform transform = iter.previous(); filename = transform.encode(uri, filename); } segments.set(segments.size() - 1, filename); return uri.buildUpon().path(TextUtils.join("/", segments)).encodedFragment(null).build(); }
static final Uri function(List<Transform> transforms, Uri uri) { if (transforms.isEmpty()) { return uri; } List<String> segments = new ArrayList<String>(uri.getPathSegments()); if (segments.isEmpty() uri.getPath().endsWith("/")) { return uri; } String filename = segments.get(segments.size() - 1); for (ListIterator<Transform> iter = transforms.listIterator(transforms.size()); iter.hasPrevious(); ) { Transform transform = iter.previous(); filename = transform.encode(uri, filename); } segments.set(segments.size() - 1, filename); return uri.buildUpon().path(TextUtils.join("/", segments)).encodedFragment(null).build(); }
/** * Give transforms the opportunity to encode the file part (last segment for file operations) of * the uri. Also strips fragment. */
Give transforms the opportunity to encode the file part (last segment for file operations) of the uri. Also strips fragment
encodeFilename
{ "repo_name": "google/mobile-data-download", "path": "java/com/google/android/libraries/mobiledatadownload/file/SynchronousFileStorage.java", "license": "apache-2.0", "size": 15139 }
[ "android.net.Uri", "android.text.TextUtils", "com.google.android.libraries.mobiledatadownload.file.spi.Transform", "java.util.ArrayList", "java.util.List", "java.util.ListIterator" ]
import android.net.Uri; import android.text.TextUtils; import com.google.android.libraries.mobiledatadownload.file.spi.Transform; import java.util.ArrayList; import java.util.List; import java.util.ListIterator;
import android.net.*; import android.text.*; import com.google.android.libraries.mobiledatadownload.file.spi.*; import java.util.*;
[ "android.net", "android.text", "com.google.android", "java.util" ]
android.net; android.text; com.google.android; java.util;
1,375,202
private void waitForThread() { if ((this.thread != null) && this.thread.isAlive()) { try { this.thread.join(); } catch (final InterruptedException e) { this.plugin.getLogger().log(Level.SEVERE, null, e); } } }
void function() { if ((this.thread != null) && this.thread.isAlive()) { try { this.thread.join(); } catch (final InterruptedException e) { this.plugin.getLogger().log(Level.SEVERE, null, e); } } }
/** * As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish * before allowing anyone to check the result. */
As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish before allowing anyone to check the result
waitForThread
{ "repo_name": "bog500/CustomMarkers", "path": "CustomMarkers/src/mc/bog500/CustomMarkers/Updater.java", "license": "gpl-2.0", "size": 30617 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
923,584
@Override public void onClick() { Log.d("QS", "Tile tapped"); }
void function() { Log.d("QS", STR); }
/** * Called when the user taps the tile. */
Called when the user taps the tile
onClick
{ "repo_name": "googlecodelabs/android-n-quick-settings", "path": "app/src/start/java/com/google/android_quick_settings/QuickSettingsService.java", "license": "apache-2.0", "size": 1856 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,820,787
private static boolean sendTweet(final String tweetTxt, final File fileToAttach) { // abbreviate the Tweet to meet the 140 character limit ... String abbreviatedTweetTxt = StringUtils.abbreviate(tweetTxt, CHARACTER_LIMIT); try { // send the Tweet StatusUpdate status = new StatusUpdate(abbreviatedTweetTxt); if (fileToAttach != null && fileToAttach.isFile()) { status.setMedia(fileToAttach); } Status updatedStatus = client.updateStatus(status); logger.debug("Successfully sent Tweet '{}'", updatedStatus.getText()); return true; } catch (TwitterException e) { logger.warn("Failed to send Tweet '{}' because of : {}", abbreviatedTweetTxt, e.getLocalizedMessage()); return false; } }
static boolean function(final String tweetTxt, final File fileToAttach) { String abbreviatedTweetTxt = StringUtils.abbreviate(tweetTxt, CHARACTER_LIMIT); try { StatusUpdate status = new StatusUpdate(abbreviatedTweetTxt); if (fileToAttach != null && fileToAttach.isFile()) { status.setMedia(fileToAttach); } Status updatedStatus = client.updateStatus(status); logger.debug(STR, updatedStatus.getText()); return true; } catch (TwitterException e) { logger.warn(STR, abbreviatedTweetTxt, e.getLocalizedMessage()); return false; } }
/** * Internal method for sending a tweet, with or without image * * @param tweetTxt * text string to be sent as a Tweet * @param fileToAttach * the file to attach. May be null if no attached file. * * @return <code>true</code>, if sending the tweet has been successful and * <code>false</code> in all other cases. */
Internal method for sending a tweet, with or without image
sendTweet
{ "repo_name": "idserda/openhab", "path": "bundles/action/org.openhab.action.twitter/src/main/java/org/openhab/action/twitter/internal/Twitter.java", "license": "epl-1.0", "size": 8321 }
[ "java.io.File", "org.apache.commons.lang.StringUtils" ]
import java.io.File; import org.apache.commons.lang.StringUtils;
import java.io.*; import org.apache.commons.lang.*;
[ "java.io", "org.apache.commons" ]
java.io; org.apache.commons;
488,852
public void modifyColumn(final String tableName, HColumnDescriptor descriptor) throws IOException { modifyColumn(Bytes.toBytes(tableName), descriptor); }
void function(final String tableName, HColumnDescriptor descriptor) throws IOException { modifyColumn(Bytes.toBytes(tableName), descriptor); }
/** * Modify an existing column family on a table. * Asynchronous operation. * * @param tableName name of table * @param descriptor new column descriptor to use * @throws IOException if a remote or network exception occurs */
Modify an existing column family on a table. Asynchronous operation
modifyColumn
{ "repo_name": "zqxjjj/NobidaBase", "path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java", "license": "apache-2.0", "size": 89778 }
[ "java.io.IOException", "org.apache.hadoop.hbase.HColumnDescriptor", "org.apache.hadoop.hbase.util.Bytes" ]
import java.io.IOException; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.util.Bytes;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,007,213
@Override public CqQuery newCq(String queryString, CqAttributes cqAttributes, boolean isDurable) throws QueryInvalidException, CqException { ClientCQ cq = null; try { cq = (ClientCQ) getCqService().newCq(null, queryString, cqAttributes, this.pool, isDurable); } catch (CqExistsException cqe) { // Should not throw in here. if (logger.isDebugEnabled()) { logger.debug("Unable to createCq. Error :{}", cqe.getMessage(), cqe); } } return cq; }
CqQuery function(String queryString, CqAttributes cqAttributes, boolean isDurable) throws QueryInvalidException, CqException { ClientCQ cq = null; try { cq = (ClientCQ) getCqService().newCq(null, queryString, cqAttributes, this.pool, isDurable); } catch (CqExistsException cqe) { if (logger.isDebugEnabled()) { logger.debug(STR, cqe.getMessage(), cqe); } } return cq; }
/** * Constructs a new continuous query, represented by an instance of CqQuery. The CqQuery is not * executed until the execute method is invoked on the CqQuery. * * @param queryString the OQL query * @param cqAttributes the CqAttributes * @param isDurable true if the CQ is durable * @return the newly created CqQuery object * @throws IllegalArgumentException if queryString or cqAttr is null * @throws IllegalStateException if this method is called from a cache server * @throws QueryInvalidException if there is a syntax error in the query * @throws CqException if failed to create cq, failure during creating managing cq metadata info. * E.g.: Query string should refer only one region, join not supported. The query must be * a SELECT statement. DISTINCT queries are not supported. Projections are not supported. * Only one iterator in the FROM clause is supported, and it must be a region path. Bind * parameters in the query are not yet supported. */
Constructs a new continuous query, represented by an instance of CqQuery. The CqQuery is not executed until the execute method is invoked on the CqQuery
newCq
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/main/java/org/apache/geode/cache/query/internal/DefaultQueryService.java", "license": "apache-2.0", "size": 39507 }
[ "org.apache.geode.cache.query.CqAttributes", "org.apache.geode.cache.query.CqException", "org.apache.geode.cache.query.CqExistsException", "org.apache.geode.cache.query.CqQuery", "org.apache.geode.cache.query.QueryInvalidException", "org.apache.geode.cache.query.internal.cq.ClientCQ" ]
import org.apache.geode.cache.query.CqAttributes; import org.apache.geode.cache.query.CqException; import org.apache.geode.cache.query.CqExistsException; import org.apache.geode.cache.query.CqQuery; import org.apache.geode.cache.query.QueryInvalidException; import org.apache.geode.cache.query.internal.cq.ClientCQ;
import org.apache.geode.cache.query.*; import org.apache.geode.cache.query.internal.cq.*;
[ "org.apache.geode" ]
org.apache.geode;
988,344
@Test void testPutIntLe() throws CTFException { fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN); fixture.position(1); fixture.putInt(1); }
void testPutIntLe() throws CTFException { fixture.setByteOrder(ByteOrder.LITTLE_ENDIAN); fixture.position(1); fixture.putInt(1); }
/** * Test {@link BitBuffer#putInt(int)} Little endian * * @throws CTFException * Not expected */
Test <code>BitBuffer#putInt(int)</code> Little endian
testPutIntLe
{ "repo_name": "lttng/lttng-scope", "path": "ctfreader/src/test/java/org/eclipse/tracecompass/ctf/core/tests/io/BitBufferIntTest.java", "license": "epl-1.0", "size": 15329 }
[ "java.nio.ByteOrder", "org.eclipse.tracecompass.ctf.core.CTFException" ]
import java.nio.ByteOrder; import org.eclipse.tracecompass.ctf.core.CTFException;
import java.nio.*; import org.eclipse.tracecompass.ctf.core.*;
[ "java.nio", "org.eclipse.tracecompass" ]
java.nio; org.eclipse.tracecompass;
143,158
private static ColumnNameHelper columnNameHelper = new ColumnNameHelper( ); static ParameterMode newParameterMode( boolean isInput, boolean isOutput ) { int mode = ParameterMode.IN; if ( isOutput && isInput ) mode = ParameterMode.IN_OUT; else if ( isOutput ) mode = ParameterMode.OUT; else if ( isInput ) mode = ParameterMode.IN; return ParameterMode.get( mode ); }
static ColumnNameHelper columnNameHelper = new ColumnNameHelper( ); static ParameterMode function( boolean isInput, boolean isOutput ) { int mode = ParameterMode.IN; if ( isOutput && isInput ) mode = ParameterMode.IN_OUT; else if ( isOutput ) mode = ParameterMode.OUT; else if ( isInput ) mode = ParameterMode.IN; return ParameterMode.get( mode ); }
/** * Creates a ODA ParameterMode with the given parameter input/output flags. * * @param isInput * the parameter is inputable. * @param isOutput * the parameter is outputable * @return the created <code>ParameterMode</code>. */
Creates a ODA ParameterMode with the given parameter input/output flags
newParameterMode
{ "repo_name": "sguan-actuate/birt", "path": "model/org.eclipse.birt.report.model.adapter.oda/src/org/eclipse/birt/report/model/adapter/oda/impl/AdapterUtil.java", "license": "epl-1.0", "size": 15386 }
[ "org.eclipse.datatools.connectivity.oda.design.ParameterMode" ]
import org.eclipse.datatools.connectivity.oda.design.ParameterMode;
import org.eclipse.datatools.connectivity.oda.design.*;
[ "org.eclipse.datatools" ]
org.eclipse.datatools;
1,300,932
public static EntityDeleteOperation delete(String jobId) { return new DefaultDeleteOperation(ENTITY_SET, jobId); }
static EntityDeleteOperation function(String jobId) { return new DefaultDeleteOperation(ENTITY_SET, jobId); }
/** * Create an operation to delete the given job. * * @param jobId * id of job to delete * @return the delete operation */
Create an operation to delete the given job
delete
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "services/azure-media/src/main/java/com/microsoft/windowsazure/services/media/models/Job.java", "license": "apache-2.0", "size": 15671 }
[ "com.microsoft.windowsazure.services.media.entityoperations.DefaultDeleteOperation", "com.microsoft.windowsazure.services.media.entityoperations.EntityDeleteOperation" ]
import com.microsoft.windowsazure.services.media.entityoperations.DefaultDeleteOperation; import com.microsoft.windowsazure.services.media.entityoperations.EntityDeleteOperation;
import com.microsoft.windowsazure.services.media.entityoperations.*;
[ "com.microsoft.windowsazure" ]
com.microsoft.windowsazure;
735,149
public GraphicsConfiguration getDeviceConfiguration() { return surfaceData.getDeviceConfiguration(); }
GraphicsConfiguration function() { return surfaceData.getDeviceConfiguration(); }
/** * Return the device configuration associated with this Graphics2D. */
Return the device configuration associated with this Graphics2D
getDeviceConfiguration
{ "repo_name": "axDev-JDK/jdk", "path": "src/share/classes/sun/java2d/SunGraphics2D.java", "license": "gpl-2.0", "size": 129455 }
[ "java.awt.GraphicsConfiguration" ]
import java.awt.GraphicsConfiguration;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,300,951
public void setStatisticByDayPersistence( StatisticByDayPersistence statisticByDayPersistence) { this.statisticByDayPersistence = statisticByDayPersistence; }
void function( StatisticByDayPersistence statisticByDayPersistence) { this.statisticByDayPersistence = statisticByDayPersistence; }
/** * Sets the statistic by day persistence. * * @param statisticByDayPersistence the statistic by day persistence */
Sets the statistic by day persistence
setStatisticByDayPersistence
{ "repo_name": "openegovplatform/OEPv2", "path": "oep-dossier-portlet/docroot/WEB-INF/src/org/oep/dossiermgt/service/base/DossierProcBookmarkServiceBaseImpl.java", "license": "apache-2.0", "size": 49450 }
[ "org.oep.dossiermgt.service.persistence.StatisticByDayPersistence" ]
import org.oep.dossiermgt.service.persistence.StatisticByDayPersistence;
import org.oep.dossiermgt.service.persistence.*;
[ "org.oep.dossiermgt" ]
org.oep.dossiermgt;
2,400,455
private void startActivity(Intent intent, boolean proxy) { try { forcePdfViewerAsIntentHandlerIfNeeded(intent); if (proxy) { mDelegate.dispatchAuthenticatedIntent(intent); } else { // Start the activity via the current activity if possible, and otherwise as a new // task from the application context. Context context = ContextUtils.activityFromContext(mDelegate.getContext()); if (context == null) { context = ContextUtils.getApplicationContext(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } context.startActivity(intent); } recordExternalNavigationDispatched(intent); } catch (RuntimeException e) { Log.e(TAG, "Could not start Activity for intent " + intent.toString(), e); } mDelegate.didStartActivity(intent); }
void function(Intent intent, boolean proxy) { try { forcePdfViewerAsIntentHandlerIfNeeded(intent); if (proxy) { mDelegate.dispatchAuthenticatedIntent(intent); } else { Context context = ContextUtils.activityFromContext(mDelegate.getContext()); if (context == null) { context = ContextUtils.getApplicationContext(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); } context.startActivity(intent); } recordExternalNavigationDispatched(intent); } catch (RuntimeException e) { Log.e(TAG, STR + intent.toString(), e); } mDelegate.didStartActivity(intent); }
/** * Start an activity for the intent. Used for intents that must be handled externally. * @param intent The intent we want to send. * @param proxy Whether we need to proxy the intent through AuthenticatedProxyActivity (this is * used by Instant Apps intents). */
Start an activity for the intent. Used for intents that must be handled externally
startActivity
{ "repo_name": "nwjs/chromium.src", "path": "components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java", "license": "bsd-3-clause", "size": 96618 }
[ "android.content.Context", "android.content.Intent", "org.chromium.base.ContextUtils", "org.chromium.base.Log" ]
import android.content.Context; import android.content.Intent; import org.chromium.base.ContextUtils; import org.chromium.base.Log;
import android.content.*; import org.chromium.base.*;
[ "android.content", "org.chromium.base" ]
android.content; org.chromium.base;
472,104
public Event assertContainsEvent(EventKind kind, String expectedMessage) { return MoreAsserts.assertContainsEvent(eventCollector, expectedMessage, kind); }
Event function(EventKind kind, String expectedMessage) { return MoreAsserts.assertContainsEvent(eventCollector, expectedMessage, kind); }
/** * Utility method: Assert that the {@link #collector()} has received an event of the given type * and with the {@code expectedMessage}. */
Utility method: Assert that the <code>#collector()</code> has received an event of the given type and with the expectedMessage
assertContainsEvent
{ "repo_name": "twitter-forks/bazel", "path": "src/test/java/com/google/devtools/build/lib/events/util/EventCollectionApparatus.java", "license": "apache-2.0", "size": 7887 }
[ "com.google.devtools.build.lib.events.Event", "com.google.devtools.build.lib.events.EventKind", "com.google.devtools.build.lib.testutil.MoreAsserts" ]
import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventKind; import com.google.devtools.build.lib.testutil.MoreAsserts;
import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.testutil.*;
[ "com.google.devtools" ]
com.google.devtools;
2,155,899
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { getRecommendationAsJson(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { getRecommendationAsJson(request, response); }
/** * Process request from editor, provides recommendations */
Process request from editor, provides recommendations
doGet
{ "repo_name": "sindice/sparqled", "path": "sparqled/src/main/java/org/sindice/sparqled/assist/AssistedSparqlEditorServlet.java", "license": "agpl-3.0", "size": 6906 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
2,743,842
private BigInteger readBigInteger(DataInputStream dis) throws IOException { short i = dis.readShort(); if(i < 0) throw new IOException("Invalid BigInteger length: "+i); byte[] buf = new byte[i]; dis.readFully(buf); return new BigInteger(1,buf); }
BigInteger function(DataInputStream dis) throws IOException { short i = dis.readShort(); if(i < 0) throw new IOException(STR+i); byte[] buf = new byte[i]; dis.readFully(buf); return new BigInteger(1,buf); }
/** * Read a (reasonably short) BigInteger from a DataInputStream * @param dis the stream to read from * @return a BigInteger */
Read a (reasonably short) BigInteger from a DataInputStream
readBigInteger
{ "repo_name": "freenet/legacy", "path": "src/freenet/node/rt/SlidingBucketsKeyspaceEstimator.java", "license": "gpl-2.0", "size": 42425 }
[ "java.io.DataInputStream", "java.io.IOException", "java.math.BigInteger" ]
import java.io.DataInputStream; import java.io.IOException; import java.math.BigInteger;
import java.io.*; import java.math.*;
[ "java.io", "java.math" ]
java.io; java.math;
1,983,170
public synchronized void checkTGTAndReloginFromKeytab() throws IOException { //TODO: The method reloginFromKeytab should be refactored to use this // implementation. if (!isSecurityEnabled() || user.getAuthenticationMethod() != AuthenticationMethod.KERBEROS || !isKeytab) return; KerberosTicket tgt = getTGT(); if (tgt != null && System.currentTimeMillis() < getRefreshTime(tgt)) { return; } reloginFromKeytab(); }
synchronized void function() throws IOException { if (!isSecurityEnabled() user.getAuthenticationMethod() != AuthenticationMethod.KERBEROS !isKeytab) return; KerberosTicket tgt = getTGT(); if (tgt != null && System.currentTimeMillis() < getRefreshTime(tgt)) { return; } reloginFromKeytab(); }
/** * Re-login a user from keytab if TGT is expired or is close to expiry. * * @throws IOException */
Re-login a user from keytab if TGT is expired or is close to expiry
checkTGTAndReloginFromKeytab
{ "repo_name": "wzhuo918/release-1.1.2-MDP", "path": "src/core/org/apache/hadoop/security/UserGroupInformation.java", "license": "apache-2.0", "size": 42126 }
[ "java.io.IOException", "javax.security.auth.kerberos.KerberosTicket" ]
import java.io.IOException; import javax.security.auth.kerberos.KerberosTicket;
import java.io.*; import javax.security.auth.kerberos.*;
[ "java.io", "javax.security" ]
java.io; javax.security;
1,941,665
public Collection<URI> getNameDirs(int nnIndex) { return FSNamesystem.getNamespaceDirs(getNN(nnIndex).conf); }
Collection<URI> function(int nnIndex) { return FSNamesystem.getNamespaceDirs(getNN(nnIndex).conf); }
/** * Get the directories where the namenode stores its image. */
Get the directories where the namenode stores its image
getNameDirs
{ "repo_name": "anjuncc/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java", "license": "apache-2.0", "size": 106857 }
[ "java.util.Collection", "org.apache.hadoop.hdfs.server.namenode.FSNamesystem" ]
import java.util.Collection; import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
import java.util.*; import org.apache.hadoop.hdfs.server.namenode.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
818,093
public static List<VirtualMachineDescriptor> getVirtualMachineDescriptors() { List<VirtualMachineDescriptor> results = new ArrayList<VirtualMachineDescriptor>(); try { pushCl(); for(AttachProvider ap: AttachProvider.getAttachProviders()) { for(VirtualMachineDescriptor vmd: ap.listVirtualMachines()) { results.add(vmd); int key = System.identityHashCode(vmd.delegate); if(!vmdInstances.containsKey(key)) { synchronized(vmdInstances) { if(!vmdInstances.containsKey(key)) { VirtualMachineDescriptor virtualMachineDescriptor = new VirtualMachineDescriptor(vmd); vmdInstances.put(key, virtualMachineDescriptor); } } } } } return results; } catch (Exception e) { throw new RuntimeException("Failed to list all VirtualMachineDescriptors", e); } finally { popCl(); } }
static List<VirtualMachineDescriptor> function() { List<VirtualMachineDescriptor> results = new ArrayList<VirtualMachineDescriptor>(); try { pushCl(); for(AttachProvider ap: AttachProvider.getAttachProviders()) { for(VirtualMachineDescriptor vmd: ap.listVirtualMachines()) { results.add(vmd); int key = System.identityHashCode(vmd.delegate); if(!vmdInstances.containsKey(key)) { synchronized(vmdInstances) { if(!vmdInstances.containsKey(key)) { VirtualMachineDescriptor virtualMachineDescriptor = new VirtualMachineDescriptor(vmd); vmdInstances.put(key, virtualMachineDescriptor); } } } } } return results; } catch (Exception e) { throw new RuntimeException(STR, e); } finally { popCl(); } }
/** * Returns a list of all registered VirtualMachineDescriptors * @return a list of all registered VirtualMachineDescriptors */
Returns a list of all registered VirtualMachineDescriptors
getVirtualMachineDescriptors
{ "repo_name": "nickman/heliosutils", "path": "src/main/java/com/heliosapm/shorthand/attach/vm/VirtualMachineDescriptor.java", "license": "apache-2.0", "size": 5884 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
339,849
public static String getMethodDescriptor(final Method m) { Class<?>[] parameters = m.getParameterTypes(); StringBuffer buf = new StringBuffer(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); } buf.append(')'); getDescriptor(buf, m.getReturnType()); return buf.toString(); }
static String function(final Method m) { Class<?>[] parameters = m.getParameterTypes(); StringBuffer buf = new StringBuffer(); buf.append('('); for (int i = 0; i < parameters.length; ++i) { getDescriptor(buf, parameters[i]); } buf.append(')'); getDescriptor(buf, m.getReturnType()); return buf.toString(); }
/** * Returns the descriptor corresponding to the given method. * * @param m * a {@link Method Method} object. * @return the descriptor of the given method. */
Returns the descriptor corresponding to the given method
getMethodDescriptor
{ "repo_name": "imaman/asm", "path": "src/org/objectweb/asm/Type.java", "license": "bsd-3-clause", "size": 29356 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
82,202
private void typeUpdate(TypeDescription td, AddTypeDialog dialog) { td.setName(setValueChanged(dialog.typeName, td.getName())); td.setDescription(setValueChanged(multiLineFix(dialog.description), td.getDescription())); td.setSupertypeName(setValueChanged(dialog.supertypeName, td.getSupertypeName())); }
void function(TypeDescription td, AddTypeDialog dialog) { td.setName(setValueChanged(dialog.typeName, td.getName())); td.setDescription(setValueChanged(multiLineFix(dialog.description), td.getDescription())); td.setSupertypeName(setValueChanged(dialog.supertypeName, td.getSupertypeName())); }
/** * Type update. * * @param td * the td * @param dialog * the dialog */
Type update
typeUpdate
{ "repo_name": "apache/uima-uimaj", "path": "uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/TypeSection.java", "license": "apache-2.0", "size": 67505 }
[ "org.apache.uima.resource.metadata.TypeDescription", "org.apache.uima.taeconfigurator.editors.ui.dialogs.AddTypeDialog" ]
import org.apache.uima.resource.metadata.TypeDescription; import org.apache.uima.taeconfigurator.editors.ui.dialogs.AddTypeDialog;
import org.apache.uima.resource.metadata.*; import org.apache.uima.taeconfigurator.editors.ui.dialogs.*;
[ "org.apache.uima" ]
org.apache.uima;
1,936,450
public static TenantInfoBean getTenantInfoBeanfromTenant(int tenantId, Tenant tenant) { TenantInfoBean bean = new TenantInfoBean(); if (tenant != null) { bean.setTenantId(tenantId); bean.setTenantDomain(tenant.getDomain()); bean.setEmail(tenant.getEmail()); Calendar createdDate = Calendar.getInstance(); createdDate.setTimeInMillis(tenant.getCreatedDate().getTime()); bean.setCreatedDate(createdDate); bean.setActive(tenant.isActive()); if(log.isDebugEnabled()) { log.debug("The TenantInfoBean object has been created from the tenant."); } } else { if(log.isDebugEnabled()) { log.debug("The tenant is null."); } } return bean; }
static TenantInfoBean function(int tenantId, Tenant tenant) { TenantInfoBean bean = new TenantInfoBean(); if (tenant != null) { bean.setTenantId(tenantId); bean.setTenantDomain(tenant.getDomain()); bean.setEmail(tenant.getEmail()); Calendar createdDate = Calendar.getInstance(); createdDate.setTimeInMillis(tenant.getCreatedDate().getTime()); bean.setCreatedDate(createdDate); bean.setActive(tenant.isActive()); if(log.isDebugEnabled()) { log.debug(STR); } } else { if(log.isDebugEnabled()) { log.debug(STR); } } return bean; }
/** * initializes a TenantInfoBean object from the tenant * @param tenantId, tenant id * @param tenant, tenant * @return TenantInfoBean. */
initializes a TenantInfoBean object from the tenant
getTenantInfoBeanfromTenant
{ "repo_name": "GayanM/carbon-multitenancy", "path": "components/tenant-mgt/org.wso2.carbon.tenant.mgt/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantMgtUtil.java", "license": "apache-2.0", "size": 21423 }
[ "java.util.Calendar", "org.wso2.carbon.stratos.common.beans.TenantInfoBean", "org.wso2.carbon.user.core.tenant.Tenant" ]
import java.util.Calendar; import org.wso2.carbon.stratos.common.beans.TenantInfoBean; import org.wso2.carbon.user.core.tenant.Tenant;
import java.util.*; import org.wso2.carbon.stratos.common.beans.*; import org.wso2.carbon.user.core.tenant.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,716,672
public void setDFT(BigInteger defaultValue) { if (defaultValue == null) { throw new NullPointerException("defaultValue"); } defaultValue_ = defaultValue; isDFTNull_ = false; isDFTCurrent_ = false; DFTCurrentValue_ = null; }
void function(BigInteger defaultValue) { if (defaultValue == null) { throw new NullPointerException(STR); } defaultValue_ = defaultValue; isDFTNull_ = false; isDFTCurrent_ = false; DFTCurrentValue_ = null; }
/** *Sets the value for the DFT keyword for this field. Use this *version of setDFT() when an UnsignedAS400Bin8 object was used to *construct the object. *@param defaultValue The default value for this * field. The <i>defaultValue</i>cannot be null. *To set a default value of *NULL, use the setDFTNull() method. **/
Sets the value for the DFT keyword for this field. Use this version of setDFT() when an UnsignedAS400Bin8 object was used to construct the object
setDFT
{ "repo_name": "devjunix/libjt400-java", "path": "src/com/ibm/as400/access/BinaryFieldDescription.java", "license": "epl-1.0", "size": 30350 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
741,405
Context appContext();
Context appContext();
/** * Returns an App Context * * @return the Android Context */
Returns an App Context
appContext
{ "repo_name": "MHS-FIRSTrobotics/TeamClutch-FTC2016", "path": "FtcXtensible/src/main/java/org/ftccommunity/ftcxtensible/interfaces/AbstractRobotContext.java", "license": "mit", "size": 5983 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,559,099
public Connector createConnector(InetAddress address, int port, boolean secure) { return createConnector(address != null? address.toString() : null, port, secure); }
Connector function(InetAddress address, int port, boolean secure) { return createConnector(address != null? address.toString() : null, port, secure); }
/** * Create, configure, and return a new TCP/IP socket connector * based on the specified properties. * * @param address InetAddress to bind to, or <code>null</code> if the * connector is supposed to bind to all addresses on this server * @param port Port number to listen to * @param secure true if the generated connector is supposed to be * SSL-enabled, and false otherwise */
Create, configure, and return a new TCP/IP socket connector based on the specified properties
createConnector
{ "repo_name": "plumer/codana", "path": "tomcat_files/7.0.61/Embedded.java", "license": "mit", "size": 30387 }
[ "java.net.InetAddress", "org.apache.catalina.connector.Connector" ]
import java.net.InetAddress; import org.apache.catalina.connector.Connector;
import java.net.*; import org.apache.catalina.connector.*;
[ "java.net", "org.apache.catalina" ]
java.net; org.apache.catalina;
47,997
public int getFontStyle() { return Font.ITALIC; }
int function() { return Font.ITALIC; }
/** * Get the {@link Font#getStyle()) to use for drawing * the name of the road. * @return the style, e.g. Font.BOLD */
Get the {@link Font#getStyle()) to use for drawing the name of the road
getFontStyle
{ "repo_name": "xafero/travelingsales", "path": "osmnavigation/src/main/java/org/openstreetmap/travelingsalesman/painting/odr/ODR_WAY_TYPE.java", "license": "gpl-3.0", "size": 21979 }
[ "java.awt.Font" ]
import java.awt.Font;
import java.awt.*;
[ "java.awt" ]
java.awt;
535,111
@Override public Filter createFilter(FilterConfig filterConfig) { return new ChainedServletFilter(); }
Filter function(FilterConfig filterConfig) { return new ChainedServletFilter(); }
/** * We don't need any filter for this {@link SecurityRealm}. */
We don't need any filter for this <code>SecurityRealm</code>
createFilter
{ "repo_name": "oleg-nenashev/jenkins", "path": "core/src/main/java/hudson/security/SecurityRealm.java", "license": "mit", "size": 29079 }
[ "javax.servlet.Filter", "javax.servlet.FilterConfig" ]
import javax.servlet.Filter; import javax.servlet.FilterConfig;
import javax.servlet.*;
[ "javax.servlet" ]
javax.servlet;
2,474,391
public static void deactivateDartController() { FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(DART_CONTROLLER); }
static void function() { FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(DART_CONTROLLER); }
/** * Called at the end of <a:body> to turn of the AngularDart mode. */
Called at the end of to turn of the AngularDart mode
deactivateDartController
{ "repo_name": "stephanrauh/BackUp", "path": "AngularFaces/AngularFaces_1.0/AngularFaces-core/src/main/java/de/beyondjava/jsfComponents/core/SessionUtils.java", "license": "gpl-3.0", "size": 3125 }
[ "javax.faces.context.FacesContext" ]
import javax.faces.context.FacesContext;
import javax.faces.context.*;
[ "javax.faces" ]
javax.faces;
201,844
//------------------------- AUTOGENERATED START ------------------------- public static NormalSwaptionExpiryStrikeVolatilities.Meta meta() { return NormalSwaptionExpiryStrikeVolatilities.Meta.INSTANCE; } static { MetaBean.register(NormalSwaptionExpiryStrikeVolatilities.Meta.INSTANCE); } private static final long serialVersionUID = 1L;
static NormalSwaptionExpiryStrikeVolatilities.Meta function() { return NormalSwaptionExpiryStrikeVolatilities.Meta.INSTANCE; } static { MetaBean.register(NormalSwaptionExpiryStrikeVolatilities.Meta.INSTANCE); } private static final long serialVersionUID = 1L;
/** * The meta-bean for {@code NormalSwaptionExpiryStrikeVolatilities}. * @return the meta-bean, not null */
The meta-bean for NormalSwaptionExpiryStrikeVolatilities
meta
{ "repo_name": "OpenGamma/Strata", "path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/swaption/NormalSwaptionExpiryStrikeVolatilities.java", "license": "apache-2.0", "size": 19774 }
[ "org.joda.beans.MetaBean" ]
import org.joda.beans.MetaBean;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,286,906
public float cleanupProgress() throws IOException, InterruptedException { ensureState(JobState.RUNNING); ensureFreshStatus(); return status.getCleanupProgress(); }
float function() throws IOException, InterruptedException { ensureState(JobState.RUNNING); ensureFreshStatus(); return status.getCleanupProgress(); }
/** * Get the <i>progress</i> of the job's cleanup-tasks, as a float between 0.0 * and 1.0. When all cleanup tasks have completed, the function returns 1.0. * * @return the progress of the job's cleanup-tasks. * @throws IOException */
Get the progress of the job's cleanup-tasks, as a float between 0.0 and 1.0. When all cleanup tasks have completed, the function returns 1.0
cleanupProgress
{ "repo_name": "kristiantokarim/GIK-Hadoop", "path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Job.java", "license": "apache-2.0", "size": 48787 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,094,122
public void setTimeDuration(String name, long value, TimeUnit unit) { set(name, value + ParsedTimeDuration.unitFor(unit).suffix()); }
void function(String name, long value, TimeUnit unit) { set(name, value + ParsedTimeDuration.unitFor(unit).suffix()); }
/** * Set the value of <code>name</code> to the given time duration. This * is equivalent to <code>set(&lt;name&gt;, value + &lt;time suffix&gt;)</code>. * @param name Property name * @param value Time duration * @param unit Unit of time */
Set the value of <code>name</code> to the given time duration. This is equivalent to <code>set(&lt;name&gt;, value + &lt;time suffix&gt;)</code>
setTimeDuration
{ "repo_name": "jaypatil/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java", "license": "gpl-3.0", "size": 110363 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,043,204
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; }
AxisAlignedBB function(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; }
/** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */
Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been cleared to be reused)
getCollisionBoundingBoxFromPool
{ "repo_name": "npomroy/MineHr", "path": "src/main/java/com/kraz/minehr/blocks/BlockMHDrying.java", "license": "gpl-3.0", "size": 6912 }
[ "net.minecraft.util.AxisAlignedBB", "net.minecraft.world.World" ]
import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World;
import net.minecraft.util.*; import net.minecraft.world.*;
[ "net.minecraft.util", "net.minecraft.world" ]
net.minecraft.util; net.minecraft.world;
1,039,660
public boolean matchPrincipal(SlideToken token, SubjectNode checkSubject, SubjectNode matchSubject, int level) throws ServiceAccessException { if (matchSubject.equals(checkSubject)) { return true; } else { Uri groupUri = namespace.getUri(token, matchSubject.getUri()); try { NodeRevisionDescriptor nrd = groupUri.getStore().retrieveRevisionDescriptor(groupUri, new NodeRevisionNumber()); NodeProperty membersetProp = nrd.getProperty("group-member-set"); if (membersetProp != null && membersetProp.getValue() != null) { XMLValue xmlVal = new XMLValue((String)membersetProp.getValue()); List memberNodes = xmlVal.getHrefNodes(); if (memberNodes.contains(checkSubject)) { return true; } else if (level > 0) { int nextLevel = level - 1; boolean match = false; Iterator i = memberNodes.iterator(); while (!match && i.hasNext()) { SubjectNode nextMatchNode = (SubjectNode)i.next(); if (namespaceConfig.isRole(nextMatchNode.getUri()) || namespaceConfig.isGroup(nextMatchNode.getUri())) { match = matchPrincipal(token, checkSubject, nextMatchNode, nextLevel); } } return match; } else { return false; } } else { return false; } } catch (RevisionDescriptorNotFoundException e) { return false; } catch (ServiceAccessException e) { throw e; } catch (JDOMException e) { e.printStackTrace(); return false; } } }
boolean function(SlideToken token, SubjectNode checkSubject, SubjectNode matchSubject, int level) throws ServiceAccessException { if (matchSubject.equals(checkSubject)) { return true; } else { Uri groupUri = namespace.getUri(token, matchSubject.getUri()); try { NodeRevisionDescriptor nrd = groupUri.getStore().retrieveRevisionDescriptor(groupUri, new NodeRevisionNumber()); NodeProperty membersetProp = nrd.getProperty(STR); if (membersetProp != null && membersetProp.getValue() != null) { XMLValue xmlVal = new XMLValue((String)membersetProp.getValue()); List memberNodes = xmlVal.getHrefNodes(); if (memberNodes.contains(checkSubject)) { return true; } else if (level > 0) { int nextLevel = level - 1; boolean match = false; Iterator i = memberNodes.iterator(); while (!match && i.hasNext()) { SubjectNode nextMatchNode = (SubjectNode)i.next(); if (namespaceConfig.isRole(nextMatchNode.getUri()) namespaceConfig.isGroup(nextMatchNode.getUri())) { match = matchPrincipal(token, checkSubject, nextMatchNode, nextLevel); } } return match; } else { return false; } } else { return false; } } catch (RevisionDescriptorNotFoundException e) { return false; } catch (ServiceAccessException e) { throw e; } catch (JDOMException e) { e.printStackTrace(); return false; } } }
/** * Return true, if-and-only-if checkSubject matches permSubject. * * @param token a SlideToken * @param checkSubject the "current" principal * @param matchSubject the principal to check against (e.g. user * or group from NodePermission or NodeLock) * * @return a boolean * * @throws ServiceAccessException * */
Return true, if-and-only-if checkSubject matches permSubject
matchPrincipal
{ "repo_name": "integrated/jakarta-slide-server", "path": "src/share/org/apache/slide/security/SecurityImpl.java", "license": "apache-2.0", "size": 60874 }
[ "java.util.Iterator", "java.util.List", "org.apache.slide.common.ServiceAccessException", "org.apache.slide.common.SlideToken", "org.apache.slide.common.Uri", "org.apache.slide.content.NodeProperty", "org.apache.slide.content.NodeRevisionDescriptor", "org.apache.slide.content.NodeRevisionNumber", "org.apache.slide.content.RevisionDescriptorNotFoundException", "org.apache.slide.structure.SubjectNode", "org.apache.slide.util.XMLValue", "org.jdom.a.JDOMException" ]
import java.util.Iterator; import java.util.List; import org.apache.slide.common.ServiceAccessException; import org.apache.slide.common.SlideToken; import org.apache.slide.common.Uri; import org.apache.slide.content.NodeProperty; import org.apache.slide.content.NodeRevisionDescriptor; import org.apache.slide.content.NodeRevisionNumber; import org.apache.slide.content.RevisionDescriptorNotFoundException; import org.apache.slide.structure.SubjectNode; import org.apache.slide.util.XMLValue; import org.jdom.a.JDOMException;
import java.util.*; import org.apache.slide.common.*; import org.apache.slide.content.*; import org.apache.slide.structure.*; import org.apache.slide.util.*; import org.jdom.a.*;
[ "java.util", "org.apache.slide", "org.jdom.a" ]
java.util; org.apache.slide; org.jdom.a;
362,550
public static synchronized boolean isSELinuxEnforcing() { if (isSELinuxEnforcing == null) { Boolean enforcing = null; // First known firmware with SELinux built-in was a 4.2 (17) // leak if (android.os.Build.VERSION.SDK_INT >= 17) { // Detect enforcing through sysfs, not always present if (enforcing == null) { File f = new File("/sys/fs/selinux/enforce"); if (f.exists()) { try { InputStream is = new FileInputStream("/sys/fs/selinux/enforce"); try { enforcing = (is.read() == '1'); } finally { is.close(); } } catch (Exception e) { } } } // 4.4+ builds are enforcing by default, take the gamble if (enforcing == null) { enforcing = (android.os.Build.VERSION.SDK_INT >= 19); } } if (enforcing == null) { enforcing = false; } isSELinuxEnforcing = enforcing; } return isSELinuxEnforcing; }
static synchronized boolean function() { if (isSELinuxEnforcing == null) { Boolean enforcing = null; if (android.os.Build.VERSION.SDK_INT >= 17) { if (enforcing == null) { File f = new File(STR); if (f.exists()) { try { InputStream is = new FileInputStream(STR); try { enforcing = (is.read() == '1'); } finally { is.close(); } } catch (Exception e) { } } } if (enforcing == null) { enforcing = (android.os.Build.VERSION.SDK_INT >= 19); } } if (enforcing == null) { enforcing = false; } isSELinuxEnforcing = enforcing; } return isSELinuxEnforcing; }
/** * Detect if SELinux is set to enforcing, caches result * * @return true if SELinux set to enforcing, or false in the case of * permissive or not present */
Detect if SELinux is set to enforcing, caches result
isSELinuxEnforcing
{ "repo_name": "bejibx/libsuperuser", "path": "libsuperuser/src/main/java/eu/chainfire/libsuperuser/Shell.java", "license": "apache-2.0", "size": 66021 }
[ "java.io.File", "java.io.FileInputStream", "java.io.InputStream" ]
import java.io.File; import java.io.FileInputStream; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,234,183
public Font getFont() { return font; }
Font function() { return font; }
/** * Sets the font. * * @return */
Sets the font
getFont
{ "repo_name": "fstahnke/arx", "path": "src/gui/org/deidentifier/arx/gui/view/impl/common/datatable/DataTableContext.java", "license": "apache-2.0", "size": 5385 }
[ "org.eclipse.swt.graphics.Font" ]
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,615,054
public void broadcastMessage(String message) { this.lastActivity = System.currentTimeMillis(); // Support for colored messages message = ChatColor.translateAlternateColorCodes("&".toCharArray()[0], message); for (Iterator<ChannelSubscriber> iterator = this.subscribers.iterator(); iterator.hasNext();) { ChannelSubscriber p = iterator.next(); if (p.isOnline()) if (message.toLowerCase().contains(p.getName().toLowerCase()) && !message.startsWith(p.getName().toLowerCase())) { p.sendMessage(this.prefix + ChatColor.BLUE + message); if (p instanceof PlayerChannelSubscriber) if (Settings.CHAT_SOUNDS.hasEnabled(((PlayerChannelSubscriber) p).getPlayer())) ((PlayerChannelSubscriber) p).getPlayer().playSound( ((PlayerChannelSubscriber) p).getPlayer().getLocation(), Sound.NOTE_STICKS, 0.5F, 1); } else { p.sendMessage(this.prefix + message); } else iterator.remove(); } }
void function(String message) { this.lastActivity = System.currentTimeMillis(); message = ChatColor.translateAlternateColorCodes("&".toCharArray()[0], message); for (Iterator<ChannelSubscriber> iterator = this.subscribers.iterator(); iterator.hasNext();) { ChannelSubscriber p = iterator.next(); if (p.isOnline()) if (message.toLowerCase().contains(p.getName().toLowerCase()) && !message.startsWith(p.getName().toLowerCase())) { p.sendMessage(this.prefix + ChatColor.BLUE + message); if (p instanceof PlayerChannelSubscriber) if (Settings.CHAT_SOUNDS.hasEnabled(((PlayerChannelSubscriber) p).getPlayer())) ((PlayerChannelSubscriber) p).getPlayer().playSound( ((PlayerChannelSubscriber) p).getPlayer().getLocation(), Sound.NOTE_STICKS, 0.5F, 1); } else { p.sendMessage(this.prefix + message); } else iterator.remove(); } }
/** * Sends message to all subscribers. * * @param message * message to be send */
Sends message to all subscribers
broadcastMessage
{ "repo_name": "dobrakmato/PexelCore", "path": "src/eu/matejkormuth/pexel/PexelCore/chat/ChatChannel.java", "license": "gpl-3.0", "size": 9908 }
[ "eu.matejkormuth.pexel.PexelCore", "java.util.Iterator", "org.bukkit.ChatColor", "org.bukkit.Sound" ]
import eu.matejkormuth.pexel.PexelCore; import java.util.Iterator; import org.bukkit.ChatColor; import org.bukkit.Sound;
import eu.matejkormuth.pexel.*; import java.util.*; import org.bukkit.*;
[ "eu.matejkormuth.pexel", "java.util", "org.bukkit" ]
eu.matejkormuth.pexel; java.util; org.bukkit;
2,756,941
private void initializeCommands(CommandHandler commandHandler) { commandHandler.addHandler("exit", () -> new Object(), this::shutdown); commandHandler.addHandler("help", () -> new HelpParameters(), new HelpCommand(commandHandler)); commandHandler.addHandler("export", () -> new DataExportCommand.DataExportParameters(), new DataExportCommand()); commandHandler.addHandler("users", this::users); commandHandler.addHandler("say", this::say); commandHandler.addHandler("chat", this::chatInfo); commandHandler.addHandler("games", this::showGames); commandHandler.addHandler("invites", this::showInvites); commandHandler.addHandler("test", this::test); commandHandler.addHandler("ai", () -> new AICommandParameters(), new AICommand()); commandHandler.addHandler("ent", () -> new EntityInspectParameters(), new EntityCommand()); commandHandler.addHandler("threads", cmd -> showAllStackTraces(server, System.out::println)); commandHandler.addHandler("replay", () -> new ReplayParameters(), new ReplayCommand()); commandHandler.addHandler("allreplays", () -> new ReplayAllParameters(), new ReplayAllCommand()); }
void function(CommandHandler commandHandler) { commandHandler.addHandler("exit", () -> new Object(), this::shutdown); commandHandler.addHandler("help", () -> new HelpParameters(), new HelpCommand(commandHandler)); commandHandler.addHandler(STR, () -> new DataExportCommand.DataExportParameters(), new DataExportCommand()); commandHandler.addHandler("users", this::users); commandHandler.addHandler("say", this::say); commandHandler.addHandler("chat", this::chatInfo); commandHandler.addHandler("games", this::showGames); commandHandler.addHandler(STR, this::showInvites); commandHandler.addHandler("test", this::test); commandHandler.addHandler("ai", () -> new AICommandParameters(), new AICommand()); commandHandler.addHandler("ent", () -> new EntityInspectParameters(), new EntityCommand()); commandHandler.addHandler(STR, cmd -> showAllStackTraces(server, System.out::println)); commandHandler.addHandler(STR, () -> new ReplayParameters(), new ReplayCommand()); commandHandler.addHandler(STR, () -> new ReplayAllParameters(), new ReplayAllCommand()); }
/** * Adds specific commands to the CommandHandler such as "exit" and "chat" and attaches them to various methods * * @param commandHandler The command handler that commands will be added to */
Adds specific commands to the CommandHandler such as "exit" and "chat" and attaches them to various methods
initializeCommands
{ "repo_name": "June92/Cardshifter", "path": "cardshifter-server/src/main/java/com/cardshifter/server/model/MainServer.java", "license": "apache-2.0", "size": 8677 }
[ "com.cardshifter.server.commands.AICommand", "com.cardshifter.server.commands.EntityCommand", "com.cardshifter.server.commands.HelpCommand", "com.cardshifter.server.commands.ReplayAllCommand", "com.cardshifter.server.commands.ReplayCommand", "com.cardshifter.server.utils.export.DataExportCommand" ]
import com.cardshifter.server.commands.AICommand; import com.cardshifter.server.commands.EntityCommand; import com.cardshifter.server.commands.HelpCommand; import com.cardshifter.server.commands.ReplayAllCommand; import com.cardshifter.server.commands.ReplayCommand; import com.cardshifter.server.utils.export.DataExportCommand;
import com.cardshifter.server.commands.*; import com.cardshifter.server.utils.export.*;
[ "com.cardshifter.server" ]
com.cardshifter.server;
1,854,404
for(PropertyDescriptor prop:Introspector.getBeanInfo(obj.getClass(), Introspector.USE_ALL_BEANINFO).getPropertyDescriptors()){ Object value = prop.getReadMethod().invoke(obj, null); System.out.println("Property: "+prop.getName()+" \t\tValue: "+value); if(value.getClass().isArray()){ Class<?>componentClass=value.getClass().getComponentType(); if(ThirdPartyParseable.class.isAssignableFrom(value.getClass().getComponentType())){ for(ThirdPartyParseable elm:(ThirdPartyParseable [])value) {printBean(elm);} }//end if(componentIsThirdPartyParseable) }//end if(isArray) if(value instanceof ThirdPartyParseable) {printBean((ThirdPartyParseable)value);}//Recurse print }//end for(properties) }//end printBean(...)
for(PropertyDescriptor prop:Introspector.getBeanInfo(obj.getClass(), Introspector.USE_ALL_BEANINFO).getPropertyDescriptors()){ Object value = prop.getReadMethod().invoke(obj, null); System.out.println(STR+prop.getName()+STR+value); if(value.getClass().isArray()){ Class<?>componentClass=value.getClass().getComponentType(); if(ThirdPartyParseable.class.isAssignableFrom(value.getClass().getComponentType())){ for(ThirdPartyParseable elm:(ThirdPartyParseable [])value) {printBean(elm);} } } if(value instanceof ThirdPartyParseable) {printBean((ThirdPartyParseable)value);} } }
/** * Recursively prints a bean's properties, pending it is a ThirdPartyParseable. * @param obj * @throws Exception * @since Sep 17, 2012 */
Recursively prints a bean's properties, pending it is a ThirdPartyParseable
printBean
{ "repo_name": "jtrfp/jfdt", "path": "src/main/java/org/jtrfp/jfdt/TestParser.java", "license": "gpl-3.0", "size": 6190 }
[ "java.beans.Introspector", "java.beans.PropertyDescriptor" ]
import java.beans.Introspector; import java.beans.PropertyDescriptor;
import java.beans.*;
[ "java.beans" ]
java.beans;
157,145
AuthResult permissionGranted(OpType opType, User user, RegionCoprocessorEnvironment e, Map<byte [], ? extends Collection<?>> families, Action... actions) { AuthResult result = null; for (Action action: actions) { result = permissionGranted(opType.toString(), user, action, e, families); if (!result.isAllowed()) { return result; } } return result; }
AuthResult permissionGranted(OpType opType, User user, RegionCoprocessorEnvironment e, Map<byte [], ? extends Collection<?>> families, Action... actions) { AuthResult result = null; for (Action action: actions) { result = permissionGranted(opType.toString(), user, action, e, families); if (!result.isAllowed()) { return result; } } return result; }
/** * Check the current user for authorization to perform a specific action * against the given set of row data. * @param opType the operation type * @param user the user * @param e the coprocessor environment * @param families the map of column families to qualifiers present in * the request * @param actions the desired actions * @return an authorization result */
Check the current user for authorization to perform a specific action against the given set of row data
permissionGranted
{ "repo_name": "narendragoyal/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java", "license": "apache-2.0", "size": 106296 }
[ "java.util.Collection", "java.util.Map", "org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment", "org.apache.hadoop.hbase.security.User", "org.apache.hadoop.hbase.security.access.Permission" ]
import java.util.Collection; import java.util.Map; import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.security.access.Permission;
import java.util.*; import org.apache.hadoop.hbase.coprocessor.*; import org.apache.hadoop.hbase.security.*; import org.apache.hadoop.hbase.security.access.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
322,526
public Collection<T> getFilterTypes() { return (this.filterTypes != null) ? new ArrayList<T>(this.filterTypes) : null; }
Collection<T> function() { return (this.filterTypes != null) ? new ArrayList<T>(this.filterTypes) : null; }
/** * Gets the types to filter. * @return the types to filter */
Gets the types to filter
getFilterTypes
{ "repo_name": "vivantech/kc_fixes", "path": "src/main/java/org/kuali/kra/irb/noteattachment/ProtocolAttachmentTypeByGroupValuesFinder.java", "license": "apache-2.0", "size": 7013 }
[ "java.util.ArrayList", "java.util.Collection" ]
import java.util.ArrayList; import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,890,045
public static List<Attribute> getAttributes(final ServletContext servletContext, final HttpServletRequest request) { final LoginContext loginContext = getLoginContext(servletContext, request, true); @SuppressWarnings("unchecked") final List<Attribute> attributes = (List<Attribute>) loginContext.getProperty("uApprove.attributes"); return attributes; }
static List<Attribute> function(final ServletContext servletContext, final HttpServletRequest request) { final LoginContext loginContext = getLoginContext(servletContext, request, true); @SuppressWarnings(STR) final List<Attribute> attributes = (List<Attribute>) loginContext.getProperty(STR); return attributes; }
/** * Gets the attributes. * * @param servletContext The servlet context. * @param request The HTTP request. * @return Returns the attributes. */
Gets the attributes
getAttributes
{ "repo_name": "stroucki/uApprove", "path": "src/main/java/ch/SWITCH/aai/uApprove/IdPHelper.java", "license": "bsd-3-clause", "size": 16202 }
[ "edu.internet2.middleware.shibboleth.idp.authn.LoginContext", "java.util.List", "javax.servlet.ServletContext", "javax.servlet.http.HttpServletRequest" ]
import edu.internet2.middleware.shibboleth.idp.authn.LoginContext; import java.util.List; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest;
import edu.internet2.middleware.shibboleth.idp.authn.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*;
[ "edu.internet2.middleware", "java.util", "javax.servlet" ]
edu.internet2.middleware; java.util; javax.servlet;
1,774,989
protected int getExportSlotID( DesignElementHandle elementToExport ) { if ( elementToExport == null ) return DesignElement.NO_SLOT; int slotID = getTopContainerSlot( elementToExport.getElement( ) ); // The element in body slot should be added into components slot. if ( slotID == IReportDesignModel.BODY_SLOT ) slotID = IModuleModel.COMPONENT_SLOT; else if ( slotID == IModuleModel.PAGE_SLOT && elementToExport.getContainer( ) != elementToExport .getModuleHandle( ) ) slotID = IModuleModel.COMPONENT_SLOT; else if ( slotID == IReportDesignModel.CUBE_SLOT ) slotID = ILibraryModel.CUBE_SLOT; return slotID; }
int function( DesignElementHandle elementToExport ) { if ( elementToExport == null ) return DesignElement.NO_SLOT; int slotID = getTopContainerSlot( elementToExport.getElement( ) ); if ( slotID == IReportDesignModel.BODY_SLOT ) slotID = IModuleModel.COMPONENT_SLOT; else if ( slotID == IModuleModel.PAGE_SLOT && elementToExport.getContainer( ) != elementToExport .getModuleHandle( ) ) slotID = IModuleModel.COMPONENT_SLOT; else if ( slotID == IReportDesignModel.CUBE_SLOT ) slotID = ILibraryModel.CUBE_SLOT; return slotID; }
/** * Gets the slot id where the element resides in the target module. * * @param elementToExport * @return */
Gets the slot id where the element resides in the target module
getExportSlotID
{ "repo_name": "sguan-actuate/birt", "path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ElementExporterImpl.java", "license": "epl-1.0", "size": 31674 }
[ "org.eclipse.birt.report.model.api.DesignElementHandle", "org.eclipse.birt.report.model.api.core.IModuleModel", "org.eclipse.birt.report.model.core.DesignElement", "org.eclipse.birt.report.model.elements.interfaces.ILibraryModel", "org.eclipse.birt.report.model.elements.interfaces.IReportDesignModel" ]
import org.eclipse.birt.report.model.api.DesignElementHandle; import org.eclipse.birt.report.model.api.core.IModuleModel; import org.eclipse.birt.report.model.core.DesignElement; import org.eclipse.birt.report.model.elements.interfaces.ILibraryModel; import org.eclipse.birt.report.model.elements.interfaces.IReportDesignModel;
import org.eclipse.birt.report.model.api.*; import org.eclipse.birt.report.model.api.core.*; import org.eclipse.birt.report.model.core.*; import org.eclipse.birt.report.model.elements.interfaces.*;
[ "org.eclipse.birt" ]
org.eclipse.birt;
2,321,427
public Point getPosition() { return MouseInfo.getPointerInfo().getLocation(); }
Point function() { return MouseInfo.getPointerInfo().getLocation(); }
/** * Get current position of the mouse * @return Point2D representing the position of the mouse on the screen */
Get current position of the mouse
getPosition
{ "repo_name": "hptruong93/Repeat", "path": "src/core/controller/MouseCore.java", "license": "mit", "size": 7848 }
[ "java.awt.MouseInfo", "java.awt.Point" ]
import java.awt.MouseInfo; import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,743,648
public void addJointToBody(Joint joint) { if (joint == null) { throw new IllegalArgumentException("Joint cannot be null"); } final JointListElement jointListElement1 = new JointListElement(joint, joint.getFirstBody().getJointsList()); joint.getFirstBody().setJointsList(jointListElement1); final JointListElement jointListElement2 = new JointListElement(joint, joint.getSecondBody().getJointsList()); joint.getSecondBody().setJointsList(jointListElement2); }
void function(Joint joint) { if (joint == null) { throw new IllegalArgumentException(STR); } final JointListElement jointListElement1 = new JointListElement(joint, joint.getFirstBody().getJointsList()); joint.getFirstBody().setJointsList(jointListElement1); final JointListElement jointListElement2 = new JointListElement(joint, joint.getSecondBody().getJointsList()); joint.getSecondBody().setJointsList(jointListElement2); }
/** * Adds the joint to the list of joints of the two bodies involved in the joint. * * @param joint The joint to add */
Adds the joint to the list of joints of the two bodies involved in the joint
addJointToBody
{ "repo_name": "flow/react", "path": "src/main/java/com/flowpowered/react/engine/DynamicsWorld.java", "license": "mit", "size": 40934 }
[ "com.flowpowered.react.constraint.Joint" ]
import com.flowpowered.react.constraint.Joint;
import com.flowpowered.react.constraint.*;
[ "com.flowpowered.react" ]
com.flowpowered.react;
2,169,219
public Map<ModelDescription, XLinkConnectorView[]> getModelsToViews() { return modelViewMapping; }
Map<ModelDescription, XLinkConnectorView[]> function() { return modelViewMapping; }
/** * Model/View associations, provided by the client during registration */
Model/View associations, provided by the client during registration
getModelsToViews
{ "repo_name": "openengsb/openengsb", "path": "api/core/src/main/java/org/openengsb/core/api/xlink/model/XLinkConnectorRegistration.java", "license": "apache-2.0", "size": 3466 }
[ "java.util.Map", "org.openengsb.core.api.model.ModelDescription" ]
import java.util.Map; import org.openengsb.core.api.model.ModelDescription;
import java.util.*; import org.openengsb.core.api.model.*;
[ "java.util", "org.openengsb.core" ]
java.util; org.openengsb.core;
729,518
public void show(Date date) { if (date == null) { calendar.setTime(new Date()); } else { calendar.setTime(date); } updateText(); updatePicker(); }
void function(Date date) { if (date == null) { calendar.setTime(new Date()); } else { calendar.setTime(date); } updateText(); updatePicker(); }
/** * Shows the given date if it can be shown by the selector. In other words, * for graphical selectors such as a calendar, the visible range of time is * moved so that the given date is visible. * * @param date * the date to show */
Shows the given date if it can be shown by the selector. In other words, for graphical selectors such as a calendar, the visible range of time is moved so that the given date is visible
show
{ "repo_name": "debrief/debrief", "path": "org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/CDateTime.java", "license": "epl-1.0", "size": 61447 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,070,595
public int getNumClients() { if (mapOfServers.keySet().size() > 0) { Set<String> uniqueClientSet = new HashSet<>(); for (CacheServerMXBean cacheServerMXBean : mapOfServers.values()) { String[] clients; try { clients = cacheServerMXBean.getClientIds(); } catch (Exception e) { // Mostly due to condition where member is departed and proxy is still // with Manager. clients = null; } if (clients != null) { Collections.addAll(uniqueClientSet, clients); } } return uniqueClientSet.size(); } return 0; }
int function() { if (mapOfServers.keySet().size() > 0) { Set<String> uniqueClientSet = new HashSet<>(); for (CacheServerMXBean cacheServerMXBean : mapOfServers.values()) { String[] clients; try { clients = cacheServerMXBean.getClientIds(); } catch (Exception e) { clients = null; } if (clients != null) { Collections.addAll(uniqueClientSet, clients); } } return uniqueClientSet.size(); } return 0; }
/** * We have to iterate through the Cache servers to get Unique Client list across system. Stats * will give duplicate client numbers; * * @return total number of client vm connected to the system */
We have to iterate through the Cache servers to get Unique Client list across system. Stats will give duplicate client numbers
getNumClients
{ "repo_name": "smanvi-pivotal/geode", "path": "geode-core/src/main/java/org/apache/geode/management/internal/beans/DistributedSystemBridge.java", "license": "apache-2.0", "size": 55328 }
[ "java.util.Collections", "java.util.HashSet", "java.util.Set", "org.apache.geode.management.CacheServerMXBean" ]
import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.apache.geode.management.CacheServerMXBean;
import java.util.*; import org.apache.geode.management.*;
[ "java.util", "org.apache.geode" ]
java.util; org.apache.geode;
1,713,585