method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public static Locale getOfbizLocaleArgOrCurrent(List<?> args, String key, int position, Environment env) throws TemplateModelException {
Locale locale = getOfbizLocaleArg(getModel(args, key, position));
return (locale != null) ? locale : ContextFtlUtil.getCurrentLocale(env);
} | static Locale function(List<?> args, String key, int position, Environment env) throws TemplateModelException { Locale locale = getOfbizLocaleArg(getModel(args, key, position)); return (locale != null) ? locale : ContextFtlUtil.getCurrentLocale(env); } | /**
* Special handler that tries to read a locale arg and if not present gets it from context locale,
* or falls back on request if present (abstracted method, behavior could change).
*/ | Special handler that tries to read a locale arg and if not present gets it from context locale, or falls back on request if present (abstracted method, behavior could change) | getOfbizLocaleArgOrCurrent | {
"repo_name": "ilscipio/scipio-erp",
"path": "framework/webapp/src/com/ilscipio/scipio/ce/webapp/ftl/context/TransformUtil.java",
"license": "apache-2.0",
"size": 32646
} | [
"freemarker.core.Environment",
"freemarker.template.TemplateModelException",
"java.util.List",
"java.util.Locale"
] | import freemarker.core.Environment; import freemarker.template.TemplateModelException; import java.util.List; import java.util.Locale; | import freemarker.core.*; import freemarker.template.*; import java.util.*; | [
"freemarker.core",
"freemarker.template",
"java.util"
] | freemarker.core; freemarker.template; java.util; | 2,671,465 |
public String[] getServlets() {
String[] result = null;
Container[] children = findChildren();
if (children != null) {
result = new String[children.length];
for( int i=0; i< children.length; i++ ) {
result[i] = children[i].getObjectName().toS... | String[] function() { String[] result = null; Container[] children = findChildren(); if (children != null) { result = new String[children.length]; for( int i=0; i< children.length; i++ ) { result[i] = children[i].getObjectName().toString(); } } return result; } | /**
* JSR77 servlets attribute
*
* @return list of all servlets ( we know about )
*/ | JSR77 servlets attribute | getServlets | {
"repo_name": "WhiteBearSolutions/WBSAirback",
"path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/org/apache/catalina/core/StandardContext.java",
"license": "apache-2.0",
"size": 198551
} | [
"org.apache.catalina.Container"
] | import org.apache.catalina.Container; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 1,555,225 |
Collection<ICab2bQuery> getUsersQueriesDetail(String serializedDCR) throws RemoteException;
| Collection<ICab2bQuery> getUsersQueriesDetail(String serializedDCR) throws RemoteException; | /**
* This method returns all the queries with only their name and description populated.
*
* @return list of IParameterizedQuery having only their name and description populated
* @throws RemoteException if retrieving fails
*/ | This method returns all the queries with only their name and description populated | getUsersQueriesDetail | {
"repo_name": "NCIP/cab2b",
"path": "software/cab2b/src/java/common/edu/wustl/cab2b/common/ejb/queryengine/QueryEngineBusinessInterface.java",
"license": "bsd-3-clause",
"size": 3953
} | [
"edu.wustl.cab2b.common.queryengine.ICab2bQuery",
"java.rmi.RemoteException",
"java.util.Collection"
] | import edu.wustl.cab2b.common.queryengine.ICab2bQuery; import java.rmi.RemoteException; import java.util.Collection; | import edu.wustl.cab2b.common.queryengine.*; import java.rmi.*; import java.util.*; | [
"edu.wustl.cab2b",
"java.rmi",
"java.util"
] | edu.wustl.cab2b; java.rmi; java.util; | 2,336,649 |
private static boolean cancelPotentialDownload(String url, ImageView imageView) {
BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
if (bitmapDownloaderTask != null) {
String bitmapUrl = bitmapDownloaderTask.url;
if ((bitmapUrl == null) || (!bit... | static boolean function(String url, ImageView imageView) { BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView); if (bitmapDownloaderTask != null) { String bitmapUrl = bitmapDownloaderTask.url; if ((bitmapUrl == null) (!bitmapUrl.equals(url))) { bitmapDownloaderTask.cancel(true); } else { retu... | /**
* Returns true if the current download has been canceled or if there was no download in
* progress on this image view.
* Returns false if the download in progress deals with the same url. The download is not
* stopped in that case.
*/ | Returns true if the current download has been canceled or if there was no download in progress on this image view. Returns false if the download in progress deals with the same url. The download is not stopped in that case | cancelPotentialDownload | {
"repo_name": "JasonBrannon/GoVRE",
"path": "Android/src/com/echo5bravo/govre/UTILS/ImageDownloader.java",
"license": "mit",
"size": 15159
} | [
"android.widget.ImageView"
] | import android.widget.ImageView; | import android.widget.*; | [
"android.widget"
] | android.widget; | 1,932,025 |
public List<ByteBuffer> getCommitted() {
return committed;
} | List<ByteBuffer> function() { return committed; } | /**
* Returns the committed buffers.
* @return the committed
*/ | Returns the committed buffers | getCommitted | {
"repo_name": "asakusafw/asakusafw-compiler",
"path": "vanilla/runtime/core/src/main/java/com/asakusafw/vanilla/core/mirror/MockDataChannel.java",
"license": "apache-2.0",
"size": 1751
} | [
"java.nio.ByteBuffer",
"java.util.List"
] | import java.nio.ByteBuffer; import java.util.List; | import java.nio.*; import java.util.*; | [
"java.nio",
"java.util"
] | java.nio; java.util; | 818,245 |
private JPanel getGrouperButtonPanel() {
if (grouperButtonPanel == null) {
GridBagConstraints gridBagConstraints20 = new GridBagConstraints();
gridBagConstraints20.gridx = 0;
gridBagConstraints20.insets = new Insets(2, 2, 2, 2);
gridBagConstraints20.gridy = 1;
GridBagConstraints gridBagConstraints19... | JPanel function() { if (grouperButtonPanel == null) { GridBagConstraints gridBagConstraints20 = new GridBagConstraints(); gridBagConstraints20.gridx = 0; gridBagConstraints20.insets = new Insets(2, 2, 2, 2); gridBagConstraints20.gridy = 1; GridBagConstraints gridBagConstraints19 = new GridBagConstraints(); gridBagConst... | /**
* This method initializes grouperButtonPanel
*
* @return javax.swing.JPanel
*/ | This method initializes grouperButtonPanel | getGrouperButtonPanel | {
"repo_name": "NCIP/cagrid",
"path": "cagrid/Software/core/caGrid/projects/gaards-ui/src/org/cagrid/gaards/ui/gridgrouper/expressioneditor/GridGrouperExpressionEditor.java",
"license": "bsd-3-clause",
"size": 27901
} | [
"java.awt.Color",
"java.awt.Font",
"java.awt.GridBagConstraints",
"java.awt.GridBagLayout",
"java.awt.Insets",
"javax.swing.BorderFactory",
"javax.swing.JPanel",
"javax.swing.border.TitledBorder"
] | import java.awt.Color; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.border.TitledBorder; | import java.awt.*; import javax.swing.*; import javax.swing.border.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 237,540 |
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction,
final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "UMAAL");
translateAll(environ... | void function(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "UMAAL"); translateAll(environment, instruction, "UMAAL", instruct... | /**
* UMAAL{<cond>} <RdLo>, <RdHi>, <Rm>, <Rs>
*
* Operation:
*
* if ConditionPassed(cond) then result = Rm * Rs + RdLo + RdHi // Unsigned multiplication and
* additions RdLo = result[31:0] RdHi = result[63:32]
*/ | UMAAL{} , , , Operation: if ConditionPassed(cond) then result = Rm * Rs + RdLo + RdHi // Unsigned multiplication and additions RdLo = result[31:0] RdHi = result[63:32] | translate | {
"repo_name": "guiquanz/binnavi",
"path": "src/main/java/com/google/security/zynamics/reil/translators/arm/ARMUmaalTranslator.java",
"license": "apache-2.0",
"size": 3830
} | [
"com.google.security.zynamics.reil.ReilInstruction",
"com.google.security.zynamics.reil.translators.ITranslationEnvironment",
"com.google.security.zynamics.reil.translators.InternalTranslationException",
"com.google.security.zynamics.reil.translators.TranslationHelpers",
"com.google.security.zynamics.zylib.... | import com.google.security.zynamics.reil.ReilInstruction; import com.google.security.zynamics.reil.translators.ITranslationEnvironment; import com.google.security.zynamics.reil.translators.InternalTranslationException; import com.google.security.zynamics.reil.translators.TranslationHelpers; import com.google.security.z... | import com.google.security.zynamics.reil.*; import com.google.security.zynamics.reil.translators.*; import com.google.security.zynamics.zylib.disassembly.*; import java.util.*; | [
"com.google.security",
"java.util"
] | com.google.security; java.util; | 66,428 |
public void doLocalUpdate()
{
if (this.targetLocation == null)
{
this.targetLocation = new Vec3d(this.dragon.worldObj.getTopSolidOrLiquidBlock(WorldGenEndPodium.END_PODIUM_LOCATION));
}
if (this.targetLocation.squareDistanceTo(this.dragon.posX, this.dragon.posY, this... | void function() { if (this.targetLocation == null) { this.targetLocation = new Vec3d(this.dragon.worldObj.getTopSolidOrLiquidBlock(WorldGenEndPodium.END_PODIUM_LOCATION)); } if (this.targetLocation.squareDistanceTo(this.dragon.posX, this.dragon.posY, this.dragon.posZ) < 1.0D) { ((PhaseSittingFlaming)this.dragon.getPhas... | /**
* Gives the phase a chance to update its status.
* Called by dragon's onLivingUpdate. Only used when !worldObj.isRemote.
*/ | Gives the phase a chance to update its status. Called by dragon's onLivingUpdate. Only used when !worldObj.isRemote | doLocalUpdate | {
"repo_name": "MartyParty21/AwakenDreamsClient",
"path": "mcp/src/minecraft/net/minecraft/entity/boss/dragon/phase/PhaseLanding.java",
"license": "gpl-3.0",
"size": 3172
} | [
"net.minecraft.util.math.Vec3d",
"net.minecraft.world.gen.feature.WorldGenEndPodium"
] | import net.minecraft.util.math.Vec3d; import net.minecraft.world.gen.feature.WorldGenEndPodium; | import net.minecraft.util.math.*; import net.minecraft.world.gen.feature.*; | [
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.util; net.minecraft.world; | 2,574,099 |
default byte[] getBytes(int columnIndex) {
// TODO check that "if the value is SQL NULL, the value returned is null" is correctly implemented
throw ExceptionFactory.createException(CJOperationNotSupportedException.class, Messages.getString("OperationNotSupportedException.0"));
} | default byte[] getBytes(int columnIndex) { throw ExceptionFactory.createException(CJOperationNotSupportedException.class, Messages.getString(STR)); } | /**
* Returns the value at the given column as a byte array.
* The bytes represent the raw values returned by the server.
*
* @param columnIndex
* index of column (starting at 0) to return from.
* @return the value for the given column; if the value is SQL <code>NULL</code>, th... | Returns the value at the given column as a byte array. The bytes represent the raw values returned by the server | getBytes | {
"repo_name": "ac2cz/FoxTelem",
"path": "lib/mysql-connector-java-8.0.13/src/main/core-api/java/com/mysql/cj/result/Row.java",
"license": "gpl-3.0",
"size": 4589
} | [
"com.mysql.cj.Messages",
"com.mysql.cj.exceptions.CJOperationNotSupportedException",
"com.mysql.cj.exceptions.ExceptionFactory"
] | import com.mysql.cj.Messages; import com.mysql.cj.exceptions.CJOperationNotSupportedException; import com.mysql.cj.exceptions.ExceptionFactory; | import com.mysql.cj.*; import com.mysql.cj.exceptions.*; | [
"com.mysql.cj"
] | com.mysql.cj; | 2,312,093 |
protected DTO findByCode(String code) throws InstanceNotFoundException {
return toDTO(getIntegrationEntityDAO().findByCode(code));
} | DTO function(String code) throws InstanceNotFoundException { return toDTO(getIntegrationEntityDAO().findByCode(code)); } | /**
* Returns a DTO searching by code. This will be useful for all REST
* services of IntegrationEntities
*
* @param code
* this is the code for the element which will be searched
* @return DTO which represents the IntegrationEntity with this code
* @throws InstanceNotFound... | Returns a DTO searching by code. This will be useful for all REST services of IntegrationEntities | findByCode | {
"repo_name": "bolobr/IEBT-Libreplan",
"path": "libreplan-webapp/src/main/java/org/libreplan/ws/common/impl/GenericRESTService.java",
"license": "agpl-3.0",
"size": 8401
} | [
"org.libreplan.business.common.exceptions.InstanceNotFoundException"
] | import org.libreplan.business.common.exceptions.InstanceNotFoundException; | import org.libreplan.business.common.exceptions.*; | [
"org.libreplan.business"
] | org.libreplan.business; | 1,180,515 |
public void createApp()
{
// Create and set up the window
m_appFrame = new JFrame("WordFinder");
m_appFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
m_appFrame.addComponentListener(this);
// Set the window size and center it
m_appFrame.setMinimumSize(new Dimension(300, 30... | void function() { m_appFrame = new JFrame(STR); m_appFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); m_appFrame.addComponentListener(this); m_appFrame.setMinimumSize(new Dimension(300, 300)); m_appFrame.setPreferredSize(new Dimension(800, 600)); m_appFrame.setSize(new Dimension(800, 600)); centerOnScreen(); build... | /**
* Create the application's GUI.
*/ | Create the application's GUI | createApp | {
"repo_name": "argonium/wordfinder",
"path": "src/io/miti/wordfinder/WordFinder.java",
"license": "mit",
"size": 35487
} | [
"java.awt.Dimension",
"javax.swing.JFrame"
] | import java.awt.Dimension; import javax.swing.JFrame; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,114,901 |
public void setIsotopePattern(final IsotopePattern pattern) {
isotopePattern = pattern;
} | void function(final IsotopePattern pattern) { isotopePattern = pattern; } | /**
* Sets the isotope pattern of this compound.
*
* @param pattern the isotope pattern.
*/ | Sets the isotope pattern of this compound | setIsotopePattern | {
"repo_name": "tomas-pluskal/mzmine3",
"path": "src/main/java/io/github/mzmine/modules/dataprocessing/id_onlinecompounddb/DBCompound.java",
"license": "gpl-2.0",
"size": 3519
} | [
"io.github.mzmine.datamodel.IsotopePattern"
] | import io.github.mzmine.datamodel.IsotopePattern; | import io.github.mzmine.datamodel.*; | [
"io.github.mzmine"
] | io.github.mzmine; | 2,822,179 |
public Node toNode(Document doc, Object o, short type) throws PageException; | Node function(Document doc, Object o, short type) throws PageException; | /**
* casts a value to a XML Object defined by type parameter
* @param doc XML Document
* @param o Object to cast
* @param type type to cast to
* @return XML Text Object
* @throws PageException
*/ | casts a value to a XML Object defined by type parameter | toNode | {
"repo_name": "lucee/unoffical-Lucee-no-jre",
"path": "source/java/loader/src/lucee/runtime/util/XMLUtil.java",
"license": "lgpl-2.1",
"size": 10306
} | [
"org.w3c.dom.Document",
"org.w3c.dom.Node"
] | import org.w3c.dom.Document; import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 405,574 |
private boolean checkRangeOfPercentage(CssKeyNode node, float percentage) {
// check whether the percentage is between 0% and 100%
if (percentage < 0 || percentage > 100) {
errorManager.report(new GssError(WRONG_KEY_VALUE_ERROR_MESSAGE,
node.getSourceCodeLocation()));
return false;
}... | boolean function(CssKeyNode node, float percentage) { if (percentage < 0 percentage > 100) { errorManager.report(new GssError(WRONG_KEY_VALUE_ERROR_MESSAGE, node.getSourceCodeLocation())); return false; } return true; } | /**
* Checks if the percentage is between 0% and 100% inclusive.
*
* @param node The {@link CssKeyNode} to get the location in case of an error
* @param percentage The value represented as a float
* @return Returns true if there is no error
*/ | Checks if the percentage is between 0% and 100% inclusive | checkRangeOfPercentage | {
"repo_name": "buntarb/closure-stylesheets",
"path": "src/com/google/common/css/compiler/passes/ProcessKeyframes.java",
"license": "apache-2.0",
"size": 5425
} | [
"com.google.common.css.compiler.ast.CssKeyNode",
"com.google.common.css.compiler.ast.GssError"
] | import com.google.common.css.compiler.ast.CssKeyNode; import com.google.common.css.compiler.ast.GssError; | import com.google.common.css.compiler.ast.*; | [
"com.google.common"
] | com.google.common; | 1,287,817 |
public void unlockTable(Connection con, String table) throws SQLException
{
} | void function(Connection con, String table) throws SQLException { } | /**
* Unlocks the specified table.
*
* @param con The JDBC connection to use.
* @param table The name of the table to unlock.
* @exception SQLException No Statement could be created or executed.
*/ | Unlocks the specified table | unlockTable | {
"repo_name": "besom/bbossgroups-mvn",
"path": "bboss_persistent/src/main/java/com/frameworkset/orm/adapter/DBPostgres.java",
"license": "apache-2.0",
"size": 5723
} | [
"java.sql.Connection",
"java.sql.SQLException"
] | import java.sql.Connection; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,637,648 |
private void initNotificationBuilder(Context context) {
// inti builder.
mNotificationBuilder = new NotificationCompat.Builder(context);
mNotificationView = new RemoteViews(context.getPackageName(),
R.layout.simple_sound_cloud_notification);
mNotificationExpandedView... | void function(Context context) { mNotificationBuilder = new NotificationCompat.Builder(context); mNotificationView = new RemoteViews(context.getPackageName(), R.layout.simple_sound_cloud_notification); mNotificationExpandedView = new RemoteViews(context.getPackageName(), R.layout.simple_sound_cloud_notification_expande... | /**
* Init all static components of the notification.
*
* @param context context used to instantiate the builder.
*/ | Init all static components of the notification | initNotificationBuilder | {
"repo_name": "duck-duck-go/Soundcloud-and-YouTube",
"path": "library/src/main/java/fr/tvbarthel/cheerleader/library/player/NotificationManager.java",
"license": "apache-2.0",
"size": 13988
} | [
"android.app.Notification",
"android.app.PendingIntent",
"android.content.Context",
"android.content.Intent",
"android.os.Build",
"android.support.v4.app.NotificationCompat",
"android.widget.RemoteViews"
] | import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Build; import android.support.v4.app.NotificationCompat; import android.widget.RemoteViews; | import android.app.*; import android.content.*; import android.os.*; import android.support.v4.app.*; import android.widget.*; | [
"android.app",
"android.content",
"android.os",
"android.support",
"android.widget"
] | android.app; android.content; android.os; android.support; android.widget; | 1,140,523 |
public State getStateAtVertex (int vertexIndex) {
State ret = null;
TIntList edgeList;
if (profileRequest.reverseSearch) {
edgeList = streetLayer.outgoingEdges.get(vertexIndex);
} else {
edgeList = streetLayer.incomingEdges.get(vertexIndex);
}
... | State function (int vertexIndex) { State ret = null; TIntList edgeList; if (profileRequest.reverseSearch) { edgeList = streetLayer.outgoingEdges.get(vertexIndex); } else { edgeList = streetLayer.incomingEdges.get(vertexIndex); } for (TIntIterator it = edgeList.iterator(); it.hasNext();) { int eidx = it.next(); State st... | /**
* Get a single best state at a vertex. NB this should not be used for propagating to samples, as you need to apply
* turn costs/restrictions during propagation.
*/ | Get a single best state at a vertex. NB this should not be used for propagating to samples, as you need to apply turn costs/restrictions during propagation | getStateAtVertex | {
"repo_name": "conveyal/r5",
"path": "src/main/java/com/conveyal/r5/streets/StreetRouter.java",
"license": "mit",
"size": 59065
} | [
"gnu.trove.iterator.TIntIterator",
"gnu.trove.list.TIntList"
] | import gnu.trove.iterator.TIntIterator; import gnu.trove.list.TIntList; | import gnu.trove.iterator.*; import gnu.trove.list.*; | [
"gnu.trove.iterator",
"gnu.trove.list"
] | gnu.trove.iterator; gnu.trove.list; | 1,544,613 |
@Test(timeout = 1000 * 60)
public void writeFileManyPackets() throws Exception {
Future<Long> checksumActual;
Future<Long> checksumExpected;
long length = PACKET_SIZE * 30000 + PACKET_SIZE / 3;
try (PacketWriter writer = create(Long.MAX_VALUE)) {
checksumExpected = writeFile(writer, length, 10... | @Test(timeout = 1000 * 60) void function() throws Exception { Future<Long> checksumActual; Future<Long> checksumExpected; long length = PACKET_SIZE * 30000 + PACKET_SIZE / 3; try (PacketWriter writer = create(Long.MAX_VALUE)) { checksumExpected = writeFile(writer, length, 10, length / 3); checksumExpected.get(); checks... | /**
* Writes lots of packets.
*/ | Writes lots of packets | writeFileManyPackets | {
"repo_name": "jswudi/alluxio",
"path": "core/client/fs/src/test/java/alluxio/client/block/stream/NettyPacketWriterTest.java",
"license": "apache-2.0",
"size": 10260
} | [
"java.util.concurrent.Future",
"org.junit.Assert",
"org.junit.Test"
] | import java.util.concurrent.Future; import org.junit.Assert; import org.junit.Test; | import java.util.concurrent.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 844,190 |
public void enterPattern_matcher(SQLParser.Pattern_matcherContext ctx) { } | public void enterPattern_matcher(SQLParser.Pattern_matcherContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | exitPattern_matching_predicate | {
"repo_name": "HEIG-GAPS/slasher",
"path": "slasher.corrector/src/main/java/ch/gaps/slasher/corrector/SQLParserBaseListener.java",
"license": "mit",
"size": 73849
} | [
"ch.gaps.slasher.corrector.SQLParser"
] | import ch.gaps.slasher.corrector.SQLParser; | import ch.gaps.slasher.corrector.*; | [
"ch.gaps.slasher"
] | ch.gaps.slasher; | 761,352 |
@Override
public void onConnected(Bundle bundle) {
Log.d(TAG, "onConnected: Connected to Google Play Services!");
} | void function(Bundle bundle) { Log.d(TAG, STR); } | /**
* GoogleApiClient.ConnectionCallbacks implementation
* This callback happens when we are connected to Google Play Services.
* @param bundle
*/ | GoogleApiClient.ConnectionCallbacks implementation This callback happens when we are connected to Google Play Services | onConnected | {
"repo_name": "yeelin/weatherberry",
"path": "app/src/main/java/com/example/yeelin/homework/weatherberry/fragment/BasePlayServicesFragment.java",
"license": "mit",
"size": 7024
} | [
"android.os.Bundle",
"android.util.Log"
] | import android.os.Bundle; import android.util.Log; | import android.os.*; import android.util.*; | [
"android.os",
"android.util"
] | android.os; android.util; | 1,601,488 |
SnappyUtil.validateBuffer(buffer, off, len);
if (needsInput()) {
// No buffered output bytes and no input to consume, need more input
return 0;
}
if (!outputBuffer.hasRemaining()) {
// There is uncompressed input, compress it now
int maxOutputSize = Snappy.maxCompressedLength(input... | SnappyUtil.validateBuffer(buffer, off, len); if (needsInput()) { return 0; } if (!outputBuffer.hasRemaining()) { int maxOutputSize = Snappy.maxCompressedLength(inputBuffer.position()); if (maxOutputSize > outputBuffer.capacity()) { ByteBuffer oldBuffer = outputBuffer; outputBuffer = ByteBuffer.allocateDirect(maxOutputS... | /**
* Fills specified buffer with compressed data. Returns actual number
* of bytes of compressed data. A return value of 0 indicates that
* needsInput() should be called in order to determine if more input
* data is required.
*
* @param buffer Buffer for the compressed data
* @param off Start of... | Fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput() should be called in order to determine if more input data is required | compress | {
"repo_name": "HyukjinKwon/parquet-mr",
"path": "parquet-hadoop/src/main/java/org/apache/parquet/hadoop/codec/SnappyCompressor.java",
"license": "apache-2.0",
"size": 5655
} | [
"java.nio.ByteBuffer",
"org.xerial.snappy.Snappy"
] | import java.nio.ByteBuffer; import org.xerial.snappy.Snappy; | import java.nio.*; import org.xerial.snappy.*; | [
"java.nio",
"org.xerial.snappy"
] | java.nio; org.xerial.snappy; | 2,335,323 |
List<ReportTable> getAllReportTables();
| List<ReportTable> getAllReportTables(); | /**
* Retrieves a Collection of all ReportTables.
*
* @return a Collection of ReportTables.
*/ | Retrieves a Collection of all ReportTables | getAllReportTables | {
"repo_name": "vietnguyen/dhis2-core",
"path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTableService.java",
"license": "bsd-3-clause",
"size": 4106
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,654,651 |
public State retrieve() {
State state = new State();
state.add_state("photoAt", 2);
for (int i = 0; i < size; i++) {
state.get_state("photoAt").add("" + i, IdMap.instance().obj2atom(photoAt[i]));
}
state.add_state("ownerName", 1).add(owner.getName());
state.add_state("ownerP... | State function() { State state = new State(); state.add_state(STR, 2); for (int i = 0; i < size; i++) { state.get_state(STR).add(STRownerNameSTRownerPasswordSTRloggedInSTRloggedIn").add(loggedUser.getName()); return state; } | /*** added by DBaseFineFit modified by DOwnerFineFit
*/ | added by DBaseFineFit modified by DOwnerFineFit | retrieve | {
"repo_name": "coderocket/finefit",
"path": "demos/deltafit/a_remove_owner_finefit/src/it/unito/Album/ArrayPhotoAlbum.java",
"license": "gpl-3.0",
"size": 3850
} | [
"com.finefit.sut.State"
] | import com.finefit.sut.State; | import com.finefit.sut.*; | [
"com.finefit.sut"
] | com.finefit.sut; | 940,308 |
public void loadScalingData(SampleModel sm) {
// Supposing integral transfer type
isTTypeIntegral = true;
nColorChannels = sm.getNumBands();
channelMinValues = new float[nColorChannels];
channelMulipliers = new float[nColorChannels];
invChannelMulipliers = new float... | void function(SampleModel sm) { isTTypeIntegral = true; nColorChannels = sm.getNumBands(); channelMinValues = new float[nColorChannels]; channelMulipliers = new float[nColorChannels]; invChannelMulipliers = new float[nColorChannels]; boolean isSignedShort = (sm.getTransferType() == DataBuffer.TYPE_SHORT); float maxVal;... | /**
* Use this method only for integral transfer types.
* Extracts min/max values from the sample model
* @param sm - sample model
*/ | Use this method only for integral transfer types. Extracts min/max values from the sample model | loadScalingData | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/color/ColorScaler.java",
"license": "apache-2.0",
"size": 12861
} | [
"java.awt.image.DataBuffer",
"java.awt.image.SampleModel"
] | import java.awt.image.DataBuffer; import java.awt.image.SampleModel; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 2,295,703 |
public List<Criteria> getOredCriteria() {
return oredCriteria;
} | List<Criteria> function() { return oredCriteria; } | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table m_prj_customize_view
*
* @mbggenerated Thu Jul 16 10:50:12 ICT 2015
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table m_prj_customize_view | getOredCriteria | {
"repo_name": "uniteddiversity/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/module/project/domain/ProjectCustomizeViewExample.java",
"license": "agpl-3.0",
"size": 35727
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,874,254 |
private final int getProximityPosition(XPathContext xctxt, int predPos,
boolean findLast)
{
int pos = 0;
int context = xctxt.getCurrentNode();
DTM dtm = xctxt.getDTM(context);
int parent = dtm.getParent(context);
try
{
DTMAxisTraverser traverser = dtm.getAxisTrave... | final int function(XPathContext xctxt, int predPos, boolean findLast) { int pos = 0; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int parent = dtm.getParent(context); try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.CHILD); for (int child = traverser.first(parent); DTM.NULL != chil... | /**
* Get the proximity position index of the current node based on this
* node test.
*
*
* @param xctxt XPath runtime context.
* @param predPos Which predicate we're evaluating of foo[1][2][3].
* @param findLast If true, don't terminate when the context node is found.
*
* @return the proximi... | Get the proximity position index of the current node based on this node test | getProximityPosition | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java",
"license": "apache-2.0",
"size": 27432
} | [
"com.sun.org.apache.xml.internal.dtm.Axis",
"com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser",
"com.sun.org.apache.xpath.internal.XPathContext",
"com.sun.org.apache.xpath.internal.objects.XObject"
] | import com.sun.org.apache.xml.internal.dtm.Axis; import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser; import com.sun.org.apache.xpath.internal.XPathContext; import com.sun.org.apache.xpath.internal.objects.XObject; | import com.sun.org.apache.xml.internal.dtm.*; import com.sun.org.apache.xpath.internal.*; import com.sun.org.apache.xpath.internal.objects.*; | [
"com.sun.org"
] | com.sun.org; | 2,798,420 |
@Test
public void testSSHWhenSplitRegionInProgress()
throws KeeperException, IOException, Exception {
// true indicates the region is split but still in RIT
testCaseWithSplitRegionPartial(true);
// false indicate the region is not split
testCaseWithSplitRegionPartial(false);
} | void function() throws KeeperException, IOException, Exception { testCaseWithSplitRegionPartial(true); testCaseWithSplitRegionPartial(false); } | /**
* To test if the split region is removed from RIT if the region was in SPLITTING state
* but the RS has actually completed the splitting in META but went down. See HBASE-6070
* and also HBASE-5806
* @throws KeeperException
* @throws IOException
*/ | To test if the split region is removed from RIT if the region was in SPLITTING state but the RS has actually completed the splitting in META but went down. See HBASE-6070 and also HBASE-5806 | testSSHWhenSplitRegionInProgress | {
"repo_name": "infospace/hbase",
"path": "src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java",
"license": "apache-2.0",
"size": 53132
} | [
"java.io.IOException",
"org.apache.zookeeper.KeeperException"
] | import java.io.IOException; import org.apache.zookeeper.KeeperException; | import java.io.*; import org.apache.zookeeper.*; | [
"java.io",
"org.apache.zookeeper"
] | java.io; org.apache.zookeeper; | 836,315 |
protected void handleAttributeDefinition(final String name, final String attribName, final String handlerClass)
throws ObjectDescriptionException {
final PropertyInfo propertyInfo = ModelBuilder.getInstance().createSimplePropertyInfo
(getPropertyDescriptor(name));
if (pro... | void function(final String name, final String attribName, final String handlerClass) throws ObjectDescriptionException { final PropertyInfo propertyInfo = ModelBuilder.getInstance().createSimplePropertyInfo (getPropertyDescriptor(name)); if (propertyInfo == null) { throw new ObjectDescriptionException(STR + name); } pr... | /**
* Handles the description of an attribute within an object definition.
*
* @param name the name.
* @param attribName the attribute name.
* @param handlerClass the fully qualified class name for the attribute handler.
*
* @throws ObjectDescriptionException if there is a ... | Handles the description of an attribute within an object definition | handleAttributeDefinition | {
"repo_name": "jfree/jcommon",
"path": "src/main/java/org/jfree/xml/generator/DefaultModelReader.java",
"license": "lgpl-2.1",
"size": 15628
} | [
"org.jfree.xml.generator.model.Comments",
"org.jfree.xml.generator.model.PropertyInfo",
"org.jfree.xml.generator.model.PropertyType",
"org.jfree.xml.util.ObjectDescriptionException"
] | import org.jfree.xml.generator.model.Comments; import org.jfree.xml.generator.model.PropertyInfo; import org.jfree.xml.generator.model.PropertyType; import org.jfree.xml.util.ObjectDescriptionException; | import org.jfree.xml.generator.model.*; import org.jfree.xml.util.*; | [
"org.jfree.xml"
] | org.jfree.xml; | 1,967,127 |
protected mxPoint getOriginForCell(Object cell)
{
mxPoint result = origins.get(cell);
if (result == null)
{
mxGraph graph = graphComponent.getGraph();
if (cell != null)
{
result = new mxPoint(getOriginForCell(graph.getModel()
.getParent(cell)));
mxGeometry geo = graph.getCellGeometry(... | mxPoint function(Object cell) { mxPoint result = origins.get(cell); if (result == null) { mxGraph graph = graphComponent.getGraph(); if (cell != null) { result = new mxPoint(getOriginForCell(graph.getModel() .getParent(cell))); mxGeometry geo = graph.getCellGeometry(cell); if (geo != null) { result.setX(result.getX() +... | /**
* Returns the top, left corner of the given cell.
*/ | Returns the top, left corner of the given cell | getOriginForCell | {
"repo_name": "jgraph/mxgraph",
"path": "java/src/com/mxgraph/swing/util/mxMorphing.java",
"license": "apache-2.0",
"size": 6948
} | [
"com.mxgraph.util.mxPoint"
] | import com.mxgraph.util.mxPoint; | import com.mxgraph.util.*; | [
"com.mxgraph.util"
] | com.mxgraph.util; | 1,781,917 |
public static boolean importRealm(KeycloakSession session, RealmRepresentation rep, Strategy strategy, boolean skipUserDependent) {
String realmName = rep.getRealm();
RealmProvider model = session.realms();
RealmModel realm = model.getRealmByName(realmName);
if (realm != null) {
... | static boolean function(KeycloakSession session, RealmRepresentation rep, Strategy strategy, boolean skipUserDependent) { String realmName = rep.getRealm(); RealmProvider model = session.realms(); RealmModel realm = model.getRealmByName(realmName); if (realm != null) { if (strategy == Strategy.IGNORE_EXISTING) { logger... | /**
* Fully import realm from representation, save it to model and return model of newly created realm
*
* @param session
* @param rep
* @param strategy specifies whether to overwrite or ignore existing realm or user entries
* @param skipUserDependent If true, then import of any models, wh... | Fully import realm from representation, save it to model and return model of newly created realm | importRealm | {
"repo_name": "almighty/keycloak",
"path": "services/src/main/java/org/keycloak/exportimport/util/ImportUtils.java",
"license": "apache-2.0",
"size": 11707
} | [
"org.keycloak.Config",
"org.keycloak.exportimport.ExportImportConfig",
"org.keycloak.exportimport.Strategy",
"org.keycloak.models.KeycloakSession",
"org.keycloak.models.RealmModel",
"org.keycloak.models.RealmProvider",
"org.keycloak.representations.idm.RealmRepresentation",
"org.keycloak.services.mana... | import org.keycloak.Config; import org.keycloak.exportimport.ExportImportConfig; import org.keycloak.exportimport.Strategy; import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.RealmProvider; import org.keycloak.representations.idm.RealmRepresentation; import org... | import org.keycloak.*; import org.keycloak.exportimport.*; import org.keycloak.models.*; import org.keycloak.representations.idm.*; import org.keycloak.services.managers.*; | [
"org.keycloak",
"org.keycloak.exportimport",
"org.keycloak.models",
"org.keycloak.representations",
"org.keycloak.services"
] | org.keycloak; org.keycloak.exportimport; org.keycloak.models; org.keycloak.representations; org.keycloak.services; | 2,915,932 |
public static Event error(@Nullable Location location, String message){
return new Event(EventKind.ERROR, location, message, null);
} | static Event function(@Nullable Location location, String message){ return new Event(EventKind.ERROR, location, message, null); } | /**
* Reports an error.
*/ | Reports an error | error | {
"repo_name": "spxtr/bazel",
"path": "src/main/java/com/google/devtools/build/lib/events/Event.java",
"license": "apache-2.0",
"size": 6634
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,103,898 |
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
return repair.getItem() == Item.getItemFromBlock(Blocks.PLANKS) ? true : super.getIsRepairable(toRepair, repair);
}
| boolean function(ItemStack toRepair, ItemStack repair) { return repair.getItem() == Item.getItemFromBlock(Blocks.PLANKS) ? true : super.getIsRepairable(toRepair, repair); } | /**
* Return whether this item is repairable in an anvil.
*/ | Return whether this item is repairable in an anvil | getIsRepairable | {
"repo_name": "lucemans/ShapeClient-SRC",
"path": "net/minecraft/item/ItemShield.java",
"license": "mpl-2.0",
"size": 3536
} | [
"net.minecraft.init.Blocks"
] | import net.minecraft.init.Blocks; | import net.minecraft.init.*; | [
"net.minecraft.init"
] | net.minecraft.init; | 2,304,057 |
@org.junit.Test
public void testUnderstanding() {
Bot bot = Bot.createInstance();
//bot.setDebugLevel(Level.FINER);
Language language = bot.mind().getThought(Language.class);
language.setLearningMode(LearningMode.Disabled);
TextEntry text = bot.awareness().getSense(TextEntry.class);
List<String> output ... | @org.junit.Test void function() { Bot bot = Bot.createInstance(); Language language = bot.mind().getThought(Language.class); language.setLearningMode(LearningMode.Disabled); TextEntry text = bot.awareness().getSense(TextEntry.class); List<String> output = registerForOutput(text); text.input(STR); String response = wait... | /**
* Test language understanding.
*/ | Test language understanding | testUnderstanding | {
"repo_name": "BOTlibre/BOTlibre",
"path": "ai-engine-test/source/org/botlibre/test/TestUnderstanding.java",
"license": "epl-1.0",
"size": 16992
} | [
"java.util.List",
"org.botlibre.Bot",
"org.botlibre.sense.text.TextEntry",
"org.botlibre.thought.language.Language"
] | import java.util.List; import org.botlibre.Bot; import org.botlibre.sense.text.TextEntry; import org.botlibre.thought.language.Language; | import java.util.*; import org.botlibre.*; import org.botlibre.sense.text.*; import org.botlibre.thought.language.*; | [
"java.util",
"org.botlibre",
"org.botlibre.sense",
"org.botlibre.thought"
] | java.util; org.botlibre; org.botlibre.sense; org.botlibre.thought; | 2,228,135 |
Message queryServers(Message request, String workZone,
Hashtable<Server, Object> visitedServers, boolean tcpOnly)
throws DomainProtocolException, SecurityException {
QuestionRecord qRecord;
SList slist = SList.getInstance();
Server curServer;
byte[] outBuf = ... | Message queryServers(Message request, String workZone, Hashtable<Server, Object> visitedServers, boolean tcpOnly) throws DomainProtocolException, SecurityException { QuestionRecord qRecord; SList slist = SList.getInstance(); Server curServer; byte[] outBuf = new byte[MSG_MAX_BYTES]; int outBufLen; byte[] inBuf = new by... | /**
* Query available DNS servers for desired information. This method doesn't
* look into the local cache. Drops all answers that contains "server fail"
* and "not implemented" answer codes and returns the first "good" answer.
*
* @param request
* a DNS message that contains t... | Query available DNS servers for desired information. This method doesn't look into the local cache. Drops all answers that contains "server fail" and "not implemented" answer codes and returns the first "good" answer | queryServers | {
"repo_name": "nextopio/nextop-client",
"path": "org.apache-jarjar/src/main/java/org/apache/harmony/jndi/provider/dns/Resolver.java",
"license": "apache-2.0",
"size": 67411
} | [
"java.net.SocketTimeoutException",
"java.util.HashSet",
"java.util.Hashtable",
"java.util.Set",
"org.apache.harmony.jndi.internal.nls.Messages",
"org.apache.harmony.jndi.provider.dns.SList"
] | import java.net.SocketTimeoutException; import java.util.HashSet; import java.util.Hashtable; import java.util.Set; import org.apache.harmony.jndi.internal.nls.Messages; import org.apache.harmony.jndi.provider.dns.SList; | import java.net.*; import java.util.*; import org.apache.harmony.jndi.internal.nls.*; import org.apache.harmony.jndi.provider.dns.*; | [
"java.net",
"java.util",
"org.apache.harmony"
] | java.net; java.util; org.apache.harmony; | 1,363,287 |
public void saveTask(TaskDefinition task) {
Context.getSchedulerService().saveTaskDefinition(task);
}
| void function(TaskDefinition task) { Context.getSchedulerService().saveTaskDefinition(task); } | /**
* Save a task in the database.
*
* @param task the <code>TaskDefinition</code> to save
* @deprecated use saveTaskDefinition which follows correct naming standard
*/ | Save a task in the database | saveTask | {
"repo_name": "Bhamni/openmrs-core",
"path": "api/src/main/java/org/openmrs/scheduler/timer/TimerSchedulerServiceImpl.java",
"license": "mpl-2.0",
"size": 17058
} | [
"org.openmrs.api.context.Context",
"org.openmrs.scheduler.TaskDefinition"
] | import org.openmrs.api.context.Context; import org.openmrs.scheduler.TaskDefinition; | import org.openmrs.api.context.*; import org.openmrs.scheduler.*; | [
"org.openmrs.api",
"org.openmrs.scheduler"
] | org.openmrs.api; org.openmrs.scheduler; | 1,492,974 |
public List<SystemOverview> listActiveSystems(User loggedInUser)
throws FaultException {
return SystemManager.systemListShortActive(loggedInUser, null);
} | List<SystemOverview> function(User loggedInUser) throws FaultException { return SystemManager.systemListShortActive(loggedInUser, null); } | /**
* Gets a list of all active systems visible to user
* @param loggedInUser The current user
* @return Returns an array of maps representing all active systems visible to user
*
* @throws FaultException A FaultException is thrown if a valid user can not be found
* from the passed in sess... | Gets a list of all active systems visible to user | listActiveSystems | {
"repo_name": "moio/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java",
"license": "gpl-2.0",
"size": 230187
} | [
"com.redhat.rhn.FaultException",
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.dto.SystemOverview",
"com.redhat.rhn.manager.system.SystemManager",
"java.util.List"
] | import com.redhat.rhn.FaultException; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.SystemOverview; import com.redhat.rhn.manager.system.SystemManager; import java.util.List; | import com.redhat.rhn.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.dto.*; import com.redhat.rhn.manager.system.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 227,594 |
public void dispositivoSeleccionado(View v) {
}
| void function(View v) { } | /**
* Dispositivo seleccionado.
*
* @param v
* the v
*/ | Dispositivo seleccionado | dispositivoSeleccionado | {
"repo_name": "sprayz/Phytris",
"path": "src/proyecto/blocktris/ActividadBluetooth.java",
"license": "gpl-3.0",
"size": 6232
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,504,819 |
public TextureComponent fetchTextureComponent(String filename)
throws IOException
{
TextureComponent ret_val = (TextureComponent)componentMap.get(filename);
if(ret_val == null)
{
ret_val = load2DImage(filename);
componentMap.put(filename, ret_val);
... | TextureComponent function(String filename) throws IOException { TextureComponent ret_val = (TextureComponent)componentMap.get(filename); if(ret_val == null) { ret_val = load2DImage(filename); componentMap.put(filename, ret_val); } return ret_val; } | /**
* Param fetch the imagecomponent named by the filename. The filename may
* be either absolute or relative to the classpath.
*
* @param filename The filename to fetch
* @return The TextureComponent instance for that filename
* @throws IOException An I/O error occurred during loading
... | Param fetch the imagecomponent named by the filename. The filename may be either absolute or relative to the classpath | fetchTextureComponent | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "aviatrix3d/src/java/org/j3d/renderer/aviatrix3d/texture/FixedTextureCache.java",
"license": "gpl-2.0",
"size": 8887
} | [
"java.io.IOException",
"org.j3d.aviatrix3d.TextureComponent"
] | import java.io.IOException; import org.j3d.aviatrix3d.TextureComponent; | import java.io.*; import org.j3d.aviatrix3d.*; | [
"java.io",
"org.j3d.aviatrix3d"
] | java.io; org.j3d.aviatrix3d; | 1,470,062 |
public static GANSSSignals fromPerAligned(byte[] encodedBytes) {
GANSSSignals result = new GANSSSignals();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
} | static GANSSSignals function(byte[] encodedBytes) { GANSSSignals result = new GANSSSignals(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; } | /**
* Creates a new GANSSSignals from encoded stream.
*/ | Creates a new GANSSSignals from encoded stream | fromPerAligned | {
"repo_name": "google/supl-client",
"path": "src/main/java/com/google/location/suplclient/asn1/supl2/rrlp_components/GANSSSignals.java",
"license": "apache-2.0",
"size": 2981
} | [
"com.google.location.suplclient.asn1.base.BitStreamReader"
] | import com.google.location.suplclient.asn1.base.BitStreamReader; | import com.google.location.suplclient.asn1.base.*; | [
"com.google.location"
] | com.google.location; | 994,318 |
@Override
public InputStream createInputStream() throws IOException {
if (this.file != null) {
return new FileInputStream(this.file);
} else {
return new ByteArrayInputStream(new byte[] {});
}
} | InputStream function() throws IOException { if (this.file != null) { return new FileInputStream(this.file); } else { return new ByteArrayInputStream(new byte[] {}); } } | /**
* Return a new {@link FileInputStream} for the current filename.
* @return the new input stream.
* @throws IOException If an IO problem occurs.
* @see PartSource#createInputStream()
*/ | Return a new <code>FileInputStream</code> for the current filename | createInputStream | {
"repo_name": "stanfy/enroscar",
"path": "net/src/main/java/com/stanfy/enroscar/rest/request/net/multipart/FilePartSource.java",
"license": "apache-2.0",
"size": 2592
} | [
"java.io.ByteArrayInputStream",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,181,113 |
@Override
public List findWithNamedQuery(String queryName, int resultLimit) {
try {
Query query = sessionFactory.openSession().getNamedQuery(queryName);
List qResult = query.list();
if (!qResult.isEmpty()) {
return qResult;
} else {
... | List function(String queryName, int resultLimit) { try { Query query = sessionFactory.openSession().getNamedQuery(queryName); List qResult = query.list(); if (!qResult.isEmpty()) { return qResult; } else { return null; } } catch (Exception ex) { ex.printStackTrace(); return null; } } | /**
* Named query with limited number of results
*
* @param queryName
* @param resultLimit
* @return
*/ | Named query with limited number of results | findWithNamedQuery | {
"repo_name": "bidurbs/yogaStudio",
"path": "poweryoga/src/main/java/com/saviour/poweryoga/crudfacade/CRUDFacadeImpl.java",
"license": "apache-2.0",
"size": 8819
} | [
"java.util.List",
"org.hibernate.Query"
] | import java.util.List; import org.hibernate.Query; | import java.util.*; import org.hibernate.*; | [
"java.util",
"org.hibernate"
] | java.util; org.hibernate; | 2,664,884 |
private static String getTypeName(int type)
{
Registry reg = DataBrowserAgent.getRegistry();
switch (type) {
case MOVIE: return "Movies";
case ORPHANED_IMAGES:
String v = (String) reg.lookup(LookupNames.ORPHANED_IMAGE_NAME);
if (CommonsLangUtils.isNotBlank(v)) {
return v;
... | static String function(int type) { Registry reg = DataBrowserAgent.getRegistry(); switch (type) { case MOVIE: return STR; case ORPHANED_IMAGES: String v = (String) reg.lookup(LookupNames.ORPHANED_IMAGE_NAME); if (CommonsLangUtils.isNotBlank(v)) { return v; } return STR; case TAG: return STR; case OTHER: default: return... | /**
* Returns the value corresponding to the passed index.
*
* @param type The type to handle;
* @return See above.
*/ | Returns the value corresponding to the passed index | getTypeName | {
"repo_name": "joansmith/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/browser/TreeFileSet.java",
"license": "gpl-2.0",
"size": 4182
} | [
"org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserAgent",
"org.openmicroscopy.shoola.env.LookupNames",
"org.openmicroscopy.shoola.env.config.Registry",
"org.openmicroscopy.shoola.util.CommonsLangUtils"
] | import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserAgent; import org.openmicroscopy.shoola.env.LookupNames; import org.openmicroscopy.shoola.env.config.Registry; import org.openmicroscopy.shoola.util.CommonsLangUtils; | import org.openmicroscopy.shoola.agents.*; import org.openmicroscopy.shoola.env.*; import org.openmicroscopy.shoola.env.config.*; import org.openmicroscopy.shoola.util.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 1,975,165 |
//-----------------------------------------------------------------------
public final MetaProperty<Set<ObjectId>> positionObjectIds() {
return _positionObjectIds;
} | final MetaProperty<Set<ObjectId>> function() { return _positionObjectIds; } | /**
* The meta-property for the {@code positionObjectIds} property.
* @return the meta-property, not null
*/ | The meta-property for the positionObjectIds property | positionObjectIds | {
"repo_name": "McLeodMoores/starling",
"path": "projects/master/src/main/java/com/opengamma/master/position/PositionSearchRequest.java",
"license": "apache-2.0",
"size": 29171
} | [
"com.opengamma.id.ObjectId",
"java.util.Set",
"org.joda.beans.MetaProperty"
] | import com.opengamma.id.ObjectId; import java.util.Set; import org.joda.beans.MetaProperty; | import com.opengamma.id.*; import java.util.*; import org.joda.beans.*; | [
"com.opengamma.id",
"java.util",
"org.joda.beans"
] | com.opengamma.id; java.util; org.joda.beans; | 176,026 |
default BiConsumer2E<T, U, E1, E2> andThen(final BiConsumer<? super T, ? super U> after) {
Objects.requireNonNull(after);
return (l, r) -> {
accept(l, r);
after.accept(l, r);
};
} | default BiConsumer2E<T, U, E1, E2> andThen(final BiConsumer<? super T, ? super U> after) { Objects.requireNonNull(after); return (l, r) -> { accept(l, r); after.accept(l, r); }; } | /**
* Returns a composed {@code BiConsumer2E} that performs, in sequence, this
* operation followed by the {@code after} operation. If performing either
* operation throws an exception, it is relayed to the caller of the
* composed operation. If performing this operation throws an exception,
*... | Returns a composed BiConsumer2E that performs, in sequence, this operation followed by the after operation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, the after operation will not be performed | andThen | {
"repo_name": "adamretter/j8fu",
"path": "src/main/java/com/evolvedbinary/j8fu/function/BiConsumer2E.java",
"license": "bsd-3-clause",
"size": 5198
} | [
"java.util.Objects",
"java.util.function.BiConsumer"
] | import java.util.Objects; import java.util.function.BiConsumer; | import java.util.*; import java.util.function.*; | [
"java.util"
] | java.util; | 2,022,446 |
public static MailboxListFragment newInstance(long accountId, long initialCurrentMailboxId,
boolean enableHighlight) {
final MailboxListFragment instance = new MailboxListFragment();
final Bundle args = new Bundle();
args.putLong(ARG_ACCOUNT_ID, accountId);
args.putLong(A... | static MailboxListFragment function(long accountId, long initialCurrentMailboxId, boolean enableHighlight) { final MailboxListFragment instance = new MailboxListFragment(); final Bundle args = new Bundle(); args.putLong(ARG_ACCOUNT_ID, accountId); args.putLong(ARG_INITIAL_CURRENT_MAILBOX_ID, initialCurrentMailboxId); a... | /**
* Create a new instance with initialization parameters.
*
* This fragment should be created only with this method. (Arguments should always be set.)
*
* @param accountId The ID of the account we want to view
* @param initialCurrentMailboxId ID of the mailbox of interest.
* ... | Create a new instance with initialization parameters. This fragment should be created only with this method. (Arguments should always be set.) | newInstance | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Email/src/com/android/email/activity/MailboxListFragment.java",
"license": "gpl-2.0",
"size": 50687
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 238,726 |
EReference getStateInternal__Comment_1(); | EReference getStateInternal__Comment_1(); | /**
* Returns the meta object for the containment reference list '{@link cruise.umple.umple.StateInternal_#getComment_1 <em>Comment 1</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Comment 1</em>'.
* @see cruise.umple.umple.Stat... | Returns the meta object for the containment reference list '<code>cruise.umple.umple.StateInternal_#getComment_1 Comment 1</code>'. | getStateInternal__Comment_1 | {
"repo_name": "ahmedvc/umple",
"path": "cruise.umple.xtext/src-gen/cruise/umple/umple/UmplePackage.java",
"license": "mit",
"size": 485842
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 392,275 |
public void testProperties2 ()
{
Attribute attribute;
Attribute space;
Vector attributes;
Tag tag;
String html;
attributes = new Vector ();
attribute = new PageAttribute ();
attribute.setName ("wombat");
assertTrue ("should be s... | void function () { Attribute attribute; Attribute space; Vector attributes; Tag tag; String html; attributes = new Vector (); attribute = new PageAttribute (); attribute.setName (STR); assertTrue (STR, attribute.isStandAlone ()); assertTrue (STR, !attribute.isWhitespace ()); assertTrue (STR, !attribute.isValued ()); as... | /**
* Test bean properties.
*/ | Test bean properties | testProperties2 | {
"repo_name": "socialwareinc/html-parser",
"path": "parser/src/test/java/org/htmlparser/tests/lexerTests/AttributeTests.java",
"license": "lgpl-3.0",
"size": 37178
} | [
"java.util.Vector",
"org.htmlparser.Attribute",
"org.htmlparser.Tag",
"org.htmlparser.lexer.PageAttribute",
"org.htmlparser.nodes.TagNode"
] | import java.util.Vector; import org.htmlparser.Attribute; import org.htmlparser.Tag; import org.htmlparser.lexer.PageAttribute; import org.htmlparser.nodes.TagNode; | import java.util.*; import org.htmlparser.*; import org.htmlparser.lexer.*; import org.htmlparser.nodes.*; | [
"java.util",
"org.htmlparser",
"org.htmlparser.lexer",
"org.htmlparser.nodes"
] | java.util; org.htmlparser; org.htmlparser.lexer; org.htmlparser.nodes; | 2,466,352 |
NUHttpGet httpGet = new NUHttpGet(url);
HttpResponse httpResponse = NUHttpClient.getHttpClient().execute(httpGet);
return EntityUtils.toString(httpResponse.getEntity());
} | NUHttpGet httpGet = new NUHttpGet(url); HttpResponse httpResponse = NUHttpClient.getHttpClient().execute(httpGet); return EntityUtils.toString(httpResponse.getEntity()); } | /**
* Get the content of a page.
* @param url url from which to read
* @return the String content of the page
* @throws Exception
*/ | Get the content of a page | getData | {
"repo_name": "Neembuu-Uploader/neembuu-uploader",
"path": "modules/neembuu-uploader-utils/src/neembuu/uploader/utils/NUHttpClientUtils.java",
"license": "gpl-3.0",
"size": 3371
} | [
"org.apache.http.HttpResponse",
"org.apache.http.util.EntityUtils"
] | import org.apache.http.HttpResponse; import org.apache.http.util.EntityUtils; | import org.apache.http.*; import org.apache.http.util.*; | [
"org.apache.http"
] | org.apache.http; | 1,746,456 |
public synchronized void setTabTitle(@NotNull String title, int tabIndex) {
// Throws exception if tabIndex is out of valid range
checkRange(tabIndex, 0, tabsData.size());
tabsData.get(tabIndex).tabTitle = title;
titleListeners.forEach(listener -> listener.changed(title, tabIndex));... | synchronized void function(@NotNull String title, int tabIndex) { checkRange(tabIndex, 0, tabsData.size()); tabsData.get(tabIndex).tabTitle = title; titleListeners.forEach(listener -> listener.changed(title, tabIndex)); } | /**
* Sets the tab title of the specified tab.
* <p>
* Notifies all {@link TabTitleChangeListener} listeners of the change.
*
* @param title title to set
* @param tabIndex the index of the tab with title to set
*
* @throws IndexOutOfBoundsException if the index is out of range
... | Sets the tab title of the specified tab. Notifies all <code>TabTitleChangeListener</code> listeners of the change | setTabTitle | {
"repo_name": "dmtolpeko/sqlines",
"path": "sqlines-studio-java/src/main/java/com/sqlines/studio/model/tabsdata/ObservableTabsData.java",
"license": "apache-2.0",
"size": 23316
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,434 |
List<ManagedPath> queryManagedPaths(String pathsPattern); | List<ManagedPath> queryManagedPaths(String pathsPattern); | /**
* Query managed server paths
* @param pathsPattern The path pattern to query for
* @return A list of managed server paths
*/ | Query managed server paths | queryManagedPaths | {
"repo_name": "ASzc/fuse-patch-jdk6",
"path": "core/src/main/java/org/wildfly/extras/patch/Server.java",
"license": "apache-2.0",
"size": 2375
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 962,826 |
public long getChannelPosition(Block b, BlockWriteStreams streams)
throws IOException {
FileOutputStream file = (FileOutputStream) streams.dataOut;
return file.getChannel().position();
} | long function(Block b, BlockWriteStreams streams) throws IOException { FileOutputStream file = (FileOutputStream) streams.dataOut; return file.getChannel().position(); } | /**
* Retrieves the offset in the block to which the
* the next write will write data to.
*/ | Retrieves the offset in the block to which the the next write will write data to | getChannelPosition | {
"repo_name": "ryanobjc/hadoop-cloudera",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java",
"license": "apache-2.0",
"size": 63084
} | [
"java.io.FileOutputStream",
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.Block"
] | import java.io.FileOutputStream; import java.io.IOException; import org.apache.hadoop.hdfs.protocol.Block; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 538,406 |
@NonNull
protected final PrintStream immutableGetPrintStream() {
return this.stream;
} | final PrintStream function() { return this.stream; } | /**
* Retrieves the {@link PrintStream}.
* @return such instance.
*/ | Retrieves the <code>PrintStream</code> | immutableGetPrintStream | {
"repo_name": "osoco/java-logging",
"path": "src/main/java/es/osoco/logging/adapter/printstream/PrintStreamLoggingConfiguration.java",
"license": "gpl-3.0",
"size": 2638
} | [
"java.io.PrintStream"
] | import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,172,103 |
protected synchronized void addProjectionListener(ProjectionListener l) {
projectionSupport.add(l);
} | synchronized void function(ProjectionListener l) { projectionSupport.add(l); } | /**
* Add a ProjectionListener to this menu and its components.
*/ | Add a ProjectionListener to this menu and its components | addProjectionListener | {
"repo_name": "d2fn/passage",
"path": "src/main/java/com/bbn/openmap/gui/menu/ProjectionMenu.java",
"license": "mit",
"size": 8119
} | [
"com.bbn.openmap.event.ProjectionListener"
] | import com.bbn.openmap.event.ProjectionListener; | import com.bbn.openmap.event.*; | [
"com.bbn.openmap"
] | com.bbn.openmap; | 1,348,404 |
@throws NullPointerException If {@code vertices} or any of its elements is {@code null}.
*/
public void set(final Vector<Point> vertices) {
if (vertices == null)
throw new NullPointerException("Vertices is null");
np = vertices.size();
final int minlen = np + 1;
if (minlen > p.length)
p = new Point... | @throws NullPointerException If {@code vertices} or any of its elements is {@code null}. */ void function(final Vector<Point> vertices) { if (vertices == null) throw new NullPointerException(STR); np = vertices.size(); final int minlen = np + 1; if (minlen > p.length) p = new Point[minlen+MINCAP]; for (int i=0; i<np; +... | /** Sets the vertices of the spline to the given vertices.
@param vertices The vertices to be copied. The handles of the {@code Point} objects are copied. Any subsequent modifications of the vertices become effective only after calling the {@link #update()} method.
@throws NullPointerException If {@code verti... | Sets the vertices of the spline to the given vertices | set | {
"repo_name": "yajunyang/BioImage",
"path": "lib/ImageScience-master/ImageScience-master/src/main/java/imagescience/shape/Spline.java",
"license": "bsd-2-clause",
"size": 17884
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 2,530,302 |
public boolean canDeleteIndexContents(Index index, IndexSettings indexSettings) {
// index contents can be deleted if its an already closed index (so all its resources have
// already been relinquished)
final IndexService indexService = indexService(index);
if (indexService == null &... | boolean function(Index index, IndexSettings indexSettings) { final IndexService indexService = indexService(index); if (indexService == null && nodeEnv.hasNodeFile()) { return true; } return false; } | /**
* This method returns true if the current node is allowed to delete the given index.
* This is the case if the index is deleted in the metadata or there is no allocation
* on the local node and the index isn't on a shared file system.
* @param index {@code Index} to check whether deletion is all... | This method returns true if the current node is allowed to delete the given index. This is the case if the index is deleted in the metadata or there is no allocation on the local node and the index isn't on a shared file system | canDeleteIndexContents | {
"repo_name": "jimczi/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/IndicesService.java",
"license": "apache-2.0",
"size": 62466
} | [
"org.elasticsearch.index.Index",
"org.elasticsearch.index.IndexService",
"org.elasticsearch.index.IndexSettings"
] | import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; | import org.elasticsearch.index.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 936,176 |
public static boolean isValidFileName (String name) {
try {
if (OsUtils.isWindows()) if (name.contains(">") || name.contains("<")) return false;
return new File(name).getCanonicalFile().getName().equals(name);
} catch (IOException e) {
return false;
}
} | static boolean function (String name) { try { if (OsUtils.isWindows()) if (name.contains(">") name.contains("<")) return false; return new File(name).getCanonicalFile().getName().equals(name); } catch (IOException e) { return false; } } | /**
* Checks whether given name is valid for current user OS.
* @param name that will be checked
* @return true if name is valid, false otherwise
*/ | Checks whether given name is valid for current user OS | isValidFileName | {
"repo_name": "StQuote/VisEditor",
"path": "UI/src/com/kotcrab/vis/ui/widget/file/FileUtils.java",
"license": "apache-2.0",
"size": 3181
} | [
"com.kotcrab.vis.ui.util.OsUtils",
"java.io.File",
"java.io.IOException"
] | import com.kotcrab.vis.ui.util.OsUtils; import java.io.File; import java.io.IOException; | import com.kotcrab.vis.ui.util.*; import java.io.*; | [
"com.kotcrab.vis",
"java.io"
] | com.kotcrab.vis; java.io; | 981,278 |
@OnError
public void onError (Session session, Throwable throwable, @PathParam("streamname") String streamName,
@PathParam("version") String version, @PathParam("tdomain") String tdomain) {
try {
PrivilegedCarbonContext.getThreadLocalCarbonContext().startTenantFlow();
... | void function (Session session, Throwable throwable, @PathParam(STR) String streamName, @PathParam(STR) String version, @PathParam(STR) String tdomain) { try { PrivilegedCarbonContext.getThreadLocalCarbonContext().startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tdomain, true); s... | /**
* Web socket onError - Remove the registered sessions
*
* @param session - Users registered session.
* @param throwable - Status code for web-socket close.
* @param streamName - StreamName extracted from the ws url.
* @param version - Version extracted from the ws url.
*/ | Web socket onError - Remove the registered sessions | onError | {
"repo_name": "keizer619/carbon-analytics-common",
"path": "components/event-publisher/event-output-adapters/org.wso2.carbon.event.output.adapter.ui/org.wso2.carbon.event.output.adapter.ui.endpoint/src/main/java/TenantSubscriptionEndpoint.java",
"license": "apache-2.0",
"size": 4932
} | [
"javax.websocket.Session",
"javax.websocket.server.PathParam",
"org.wso2.carbon.context.PrivilegedCarbonContext"
] | import javax.websocket.Session; import javax.websocket.server.PathParam; import org.wso2.carbon.context.PrivilegedCarbonContext; | import javax.websocket.*; import javax.websocket.server.*; import org.wso2.carbon.context.*; | [
"javax.websocket",
"org.wso2.carbon"
] | javax.websocket; org.wso2.carbon; | 1,248,679 |
@Test
public void testBuildForwardStringForActionListCommand() throws Exception {
Assert.assertEquals(
awardAction.buildForwardStringForActionListCommand(MOCK_FORWARD_STRING,
MOCK_DOC_ID_REQUEST_PARAMETER),MOCK_EXPECTED_RESULT_STRING);
} | void function() throws Exception { Assert.assertEquals( awardAction.buildForwardStringForActionListCommand(MOCK_FORWARD_STRING, MOCK_DOC_ID_REQUEST_PARAMETER),MOCK_EXPECTED_RESULT_STRING); } | /**
*
* This test tests the AwardAction.buildForwardStringForActionListCommand method.
* @throws Exception
*/ | This test tests the AwardAction.buildForwardStringForActionListCommand method | testBuildForwardStringForActionListCommand | {
"repo_name": "sanjupolus/kc-coeus-1508.3",
"path": "coeus-impl/src/test/java/org/kuali/kra/award/web/struts/action/AwardActionTest.java",
"license": "agpl-3.0",
"size": 2065
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,021,180 |
@Test
public void testGetPortPairGroupCount() {
testCreatePortPairGroup();
assertThat(portPairGroupMgr.getPortPairGroupCount(), is(1));
} | void function() { testCreatePortPairGroup(); assertThat(portPairGroupMgr.getPortPairGroupCount(), is(1)); } | /**
* Checks the operation of getPortPairGroupCount() method.
*/ | Checks the operation of getPortPairGroupCount() method | testGetPortPairGroupCount | {
"repo_name": "planoAccess/clonedONOS",
"path": "apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/portpairgroup/impl/PortPairGroupManagerTest.java",
"license": "apache-2.0",
"size": 5214
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; | import org.hamcrest.*; | [
"org.hamcrest"
] | org.hamcrest; | 1,353,392 |
public static boolean isDate(String date, String pattern) {
return DateValidator.getInstance().isValid(date, pattern);
} | static boolean function(String date, String pattern) { return DateValidator.getInstance().isValid(date, pattern); } | /**
* Validate using the specified <i>pattern</i>.
*
* @param date The value validation is being performed on.
* @param pattern The pattern used to validate the value against.
* @return <code>true</code> if the value is valid.
*/ | Validate using the specified pattern | isDate | {
"repo_name": "data-integrations/wrangler",
"path": "wrangler-core/src/main/java/io/cdap/functions/DataQuality.java",
"license": "apache-2.0",
"size": 9464
} | [
"org.apache.commons.validator.routines.DateValidator"
] | import org.apache.commons.validator.routines.DateValidator; | import org.apache.commons.validator.routines.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,956,552 |
@Select("SELECT id,gameId,name,data,stamp FROM saves WHERE gameId={saveGameId}")
public void selectList(String saveGameId,ListCallback<IPhoneSaveGameBean> callback) {} | @Select(STR) public void selectList(String saveGameId,ListCallback<IPhoneSaveGameBean> callback) {} | /**
* Records a Click value, and obtains the ID of the inserted record.
*/ | Records a Click value, and obtains the ID of the inserted record | insertSave | {
"repo_name": "Antokolos/iambookmaster",
"path": "src/com/iambookmaster/client/iphone/data/IPhoneDBDataService.java",
"license": "lgpl-3.0",
"size": 2689
} | [
"com.google.code.gwt.database.client.service.ListCallback",
"com.google.code.gwt.database.client.service.Select"
] | import com.google.code.gwt.database.client.service.ListCallback; import com.google.code.gwt.database.client.service.Select; | import com.google.code.gwt.database.client.service.*; | [
"com.google.code"
] | com.google.code; | 520,912 |
void setOkButton() {
if (this.okButton != null) {
this.okButton.setEnabled(!StringUtils.isBlank(ruleNameTextField.getText()) && atLeastOneConditionSet() && (shouldAlertCheckBox.isSelected() || shouldSaveCheckBox.isSelected()));
}
} | void setOkButton() { if (this.okButton != null) { this.okButton.setEnabled(!StringUtils.isBlank(ruleNameTextField.getText()) && atLeastOneConditionSet() && (shouldAlertCheckBox.isSelected() shouldSaveCheckBox.isSelected())); } } | /**
* Sets whether or not the OK button should be enabled based upon other UI
* elements
*/ | Sets whether or not the OK button should be enabled based upon other UI elements | setOkButton | {
"repo_name": "esaunders/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/logicalimager/configuration/EditNonFullPathsRulePanel.java",
"license": "apache-2.0",
"size": 50353
} | [
"org.apache.commons.lang.StringUtils"
] | import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,015,183 |
public String allowUserToConnect(SocketAddress p_148542_1_, GameProfile p_148542_2_)
{
return p_148542_2_.getName().equalsIgnoreCase(this.getServerInstance().getServerOwner()) && this.func_152612_a(p_148542_2_.getName()) != null ? "That name is already taken." : super.allowUserToConnect(p_148542_1_, p_1... | String function(SocketAddress p_148542_1_, GameProfile p_148542_2_) { return p_148542_2_.getName().equalsIgnoreCase(this.getServerInstance().getServerOwner()) && this.func_152612_a(p_148542_2_.getName()) != null ? STR : super.allowUserToConnect(p_148542_1_, p_148542_2_); } | /**
* checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message
*/ | checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message | allowUserToConnect | {
"repo_name": "CheeseL0ver/Ore-TTM",
"path": "build/tmp/recompSrc/net/minecraft/server/integrated/IntegratedPlayerList.java",
"license": "lgpl-2.1",
"size": 2044
} | [
"com.mojang.authlib.GameProfile",
"java.net.SocketAddress"
] | import com.mojang.authlib.GameProfile; import java.net.SocketAddress; | import com.mojang.authlib.*; import java.net.*; | [
"com.mojang.authlib",
"java.net"
] | com.mojang.authlib; java.net; | 506,844 |
public boolean handleWaterMovement()
{
return this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this);
} | boolean function() { return this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox(), Material.water, this); } | /**
* Returns if this entity is in water and will end up adding the waters velocity to the entity
*/ | Returns if this entity is in water and will end up adding the waters velocity to the entity | handleWaterMovement | {
"repo_name": "TorchPowered/CraftBloom",
"path": "src/net/minecraft/entity/item/EntityXPOrb.java",
"license": "mit",
"size": 7966
} | [
"net.minecraft.block.material.Material"
] | import net.minecraft.block.material.Material; | import net.minecraft.block.material.*; | [
"net.minecraft.block"
] | net.minecraft.block; | 2,889,071 |
public ServiceFuture<Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeering... | ServiceFuture<Void> function(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); } | /**
* Deletes the specified virtual network peering.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @param virtualNetworkPeeringName The name of the virtual network peering.
* @param serviceCallback the async Serv... | Deletes the specified virtual network peering | beginDeleteAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/network/v2019_09_01/implementation/VirtualNetworkPeeringsInner.java",
"license": "mit",
"size": 48368
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 764,761 |
public void printBitmap(String jobName, Bitmap bitmap) {
mImpl.printBitmap(jobName, bitmap, null);
} | void function(String jobName, Bitmap bitmap) { mImpl.printBitmap(jobName, bitmap, null); } | /**
* Prints a bitmap.
*
* @param jobName The print job name.
* @param bitmap The bitmap to print.
*/ | Prints a bitmap | printBitmap | {
"repo_name": "ycdev-aosp/sdk-support",
"path": "v4/src/java/android/support/v4/print/PrintHelper.java",
"license": "apache-2.0",
"size": 10877
} | [
"android.graphics.Bitmap"
] | import android.graphics.Bitmap; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,687,577 |
protected static synchronized void resetAllCounters() {
for (AtomicInteger counter : nodeCounters.values()) {
counter.set(0);
}
} | static synchronized void function() { for (AtomicInteger counter : nodeCounters.values()) { counter.set(0); } } | /**
* Helper method for test purposes that allows tests to start clean (made protected
* to ensure that it is not called accidentally)
*/ | Helper method for test purposes that allows tests to start clean (made protected to ensure that it is not called accidentally) | resetAllCounters | {
"repo_name": "jmandawg/camel",
"path": "camel-core/src/main/java/org/apache/camel/impl/DefaultNodeIdFactory.java",
"license": "apache-2.0",
"size": 2106
} | [
"java.util.concurrent.atomic.AtomicInteger"
] | import java.util.concurrent.atomic.AtomicInteger; | import java.util.concurrent.atomic.*; | [
"java.util"
] | java.util; | 1,817,031 |
return INSTANCE;
}
private static final ForexOptionVanillaBlackFlatMethod METHOD_FX_VAN = ForexOptionVanillaBlackFlatMethod.getInstance(); | return INSTANCE; } private static final ForexOptionVanillaBlackFlatMethod METHOD_FX_VAN = ForexOptionVanillaBlackFlatMethod.getInstance(); | /**
* Gets the calculator instance.
* @return The calculator.
*/ | Gets the calculator instance | getInstance | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/provider/calculator/blackforex/PresentValueForexBlackFlatCalculator.java",
"license": "apache-2.0",
"size": 2169
} | [
"com.opengamma.analytics.financial.forex.provider.ForexOptionVanillaBlackFlatMethod"
] | import com.opengamma.analytics.financial.forex.provider.ForexOptionVanillaBlackFlatMethod; | import com.opengamma.analytics.financial.forex.provider.*; | [
"com.opengamma.analytics"
] | com.opengamma.analytics; | 1,880,007 |
private Rectangle getConstraint( )
{
IFigure parent = ( (MasterPageEditPart) getParent( ) ).getFigure( );
Rectangle region = parent.getClientArea( );
Rectangle rect = new Rectangle( );
rect.height = -1;
rect.width = region.width;
// Define the default height value of header and footer
SimpleMasterP... | Rectangle function( ) { IFigure parent = ( (MasterPageEditPart) getParent( ) ).getFigure( ); Rectangle region = parent.getClientArea( ); Rectangle rect = new Rectangle( ); rect.height = -1; rect.width = region.width; SimpleMasterPageHandle mphandle = ( (SimpleMasterPageHandle) ( (MasterPageEditPart) getParent( ) ) .get... | /**
* Get the default constraint of area figure.
*
* @return
*/ | Get the default constraint of area figure | getConstraint | {
"repo_name": "sguan-actuate/birt",
"path": "UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/editparts/AreaEditPart.java",
"license": "epl-1.0",
"size": 4783
} | [
"org.eclipse.birt.report.designer.util.DEUtil",
"org.eclipse.birt.report.model.api.DimensionHandle",
"org.eclipse.birt.report.model.api.SimpleMasterPageHandle",
"org.eclipse.birt.report.model.api.SlotHandle",
"org.eclipse.draw2d.IFigure",
"org.eclipse.draw2d.geometry.Rectangle"
] | import org.eclipse.birt.report.designer.util.DEUtil; import org.eclipse.birt.report.model.api.DimensionHandle; import org.eclipse.birt.report.model.api.SimpleMasterPageHandle; import org.eclipse.birt.report.model.api.SlotHandle; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.geometry.Rectangle; | import org.eclipse.birt.report.designer.util.*; import org.eclipse.birt.report.model.api.*; import org.eclipse.draw2d.*; import org.eclipse.draw2d.geometry.*; | [
"org.eclipse.birt",
"org.eclipse.draw2d"
] | org.eclipse.birt; org.eclipse.draw2d; | 560,515 |
private void loadFileMetadataAndJournal(LockedInodePath inodePath,
MountTable.Resolution resolution, LoadMetadataOptions options, JournalContext journalContext)
throws BlockInfoException, FileDoesNotExistException, InvalidPathException,
AccessControlException, FileAlreadyCompletedException, InvalidF... | void function(LockedInodePath inodePath, MountTable.Resolution resolution, LoadMetadataOptions options, JournalContext journalContext) throws BlockInfoException, FileDoesNotExistException, InvalidPathException, AccessControlException, FileAlreadyCompletedException, InvalidFileSizeException, IOException { if (inodePath.... | /**
* Loads metadata for the file identified by the given path from UFS into Alluxio.
*
* @param inodePath the path for which metadata should be loaded
* @param resolution the UFS resolution of path
* @param options the load metadata options
* @param journalContext the journal context
* @throws Blo... | Loads metadata for the file identified by the given path from UFS into Alluxio | loadFileMetadataAndJournal | {
"repo_name": "Reidddddd/mo-alluxio",
"path": "core/server/master/src/main/java/alluxio/master/file/DefaultFileSystemMaster.java",
"license": "apache-2.0",
"size": 129113
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,538,879 |
@Override
public String getText(Object object) {
String label = ((TestCase)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_TestCase_type") :
getString("_UI_TestCase_type") + " " + label;
} | String function(Object object) { String label = ((TestCase)object).getName(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "ObeoNetwork/EAST-ADL-Designer",
"path": "plugins/org.obeonetwork.dsl.eastadl.edit/src/org/obeonetwork/dsl/east_adl/verification_validation/provider/TestCaseItemProvider.java",
"license": "epl-1.0",
"size": 6806
} | [
"org.obeonetwork.dsl.east_adl.verification_validation.TestCase"
] | import org.obeonetwork.dsl.east_adl.verification_validation.TestCase; | import org.obeonetwork.dsl.east_adl.verification_validation.*; | [
"org.obeonetwork.dsl"
] | org.obeonetwork.dsl; | 2,275,251 |
public static boolean isContributionMethod(@Nonnull Method method, boolean removeAbstractModifier) {
requireNonNull(method, ERROR_METHOD_NULL);
return isContributionMethod(MethodDescriptor.forMethod(method, removeAbstractModifier));
} | static boolean function(@Nonnull Method method, boolean removeAbstractModifier) { requireNonNull(method, ERROR_METHOD_NULL); return isContributionMethod(MethodDescriptor.forMethod(method, removeAbstractModifier)); } | /**
* Finds out if the given Method represents a contribution method
* by matching its name against the following pattern:
* "^with[A-Z][a-z0-9_]*[\w]*$"<p>
* <pre>
* // assuming getMethod() returns an appropriate Method reference
* isContributionMethod(getMethod("withRest")) = true
... | Finds out if the given Method represents a contribution method by matching its name against the following pattern: "^with[A-Z][a-z0-9_]*[\w]*$" <code> assuming getMethod() returns an appropriate Method reference isContributionMethod(getMethod("withRest")) = true isContributionMethod(getMethod("withMVCGroup")) = false i... | isContributionMethod | {
"repo_name": "levymoreira/griffon",
"path": "subprojects/griffon-core/src/main/java/griffon/util/GriffonClassUtils.java",
"license": "apache-2.0",
"size": 129659
} | [
"java.lang.reflect.Method",
"java.util.Objects",
"javax.annotation.Nonnull"
] | import java.lang.reflect.Method; import java.util.Objects; import javax.annotation.Nonnull; | import java.lang.reflect.*; import java.util.*; import javax.annotation.*; | [
"java.lang",
"java.util",
"javax.annotation"
] | java.lang; java.util; javax.annotation; | 235,132 |
@Test
public void testBranchCreatedNotifications() throws UnsupportedActionException, DataProviderException {
SaveRestoreService.getInstance().setSelectedDataProvider(dataProvider);
verify(dataProvider.getProvider(), times(1)).getBranches();
assertEquals("Default branch is selected", bra... | void function() throws UnsupportedActionException, DataProviderException { SaveRestoreService.getInstance().setSelectedDataProvider(dataProvider); verify(dataProvider.getProvider(), times(1)).getBranches(); assertEquals(STR, branch, selector.selectedBranchProperty().get()); dataProvider.getProvider().createNewBranch(br... | /**
* Test notifications when a new branch is created.
*
* @throws UnsupportedActionException
* @throws DataProviderException
*/ | Test notifications when a new branch is created | testBranchCreatedNotifications | {
"repo_name": "frib-high-level-controls/save-set-restore",
"path": "plugins/org.csstudio.saverestore.ui.test/src/org/csstudio/saverestore/ui/SelectorTest.java",
"license": "mit",
"size": 21215
} | [
"org.csstudio.saverestore.DataProviderException",
"org.csstudio.saverestore.SaveRestoreService",
"org.csstudio.saverestore.UnsupportedActionException",
"org.junit.Assert",
"org.mockito.Mockito"
] | import org.csstudio.saverestore.DataProviderException; import org.csstudio.saverestore.SaveRestoreService; import org.csstudio.saverestore.UnsupportedActionException; import org.junit.Assert; import org.mockito.Mockito; | import org.csstudio.saverestore.*; import org.junit.*; import org.mockito.*; | [
"org.csstudio.saverestore",
"org.junit",
"org.mockito"
] | org.csstudio.saverestore; org.junit; org.mockito; | 2,889,082 |
protected DisplayType getProposedType() {
DisplayType resultingType = m_configuredType;
if (resultingType.equals(DisplayType.none)) {
switch (m_rule) {
case rootLevel:
case labelLength:
resultingType ... | DisplayType function() { DisplayType resultingType = m_configuredType; if (resultingType.equals(DisplayType.none)) { switch (m_rule) { case rootLevel: case labelLength: resultingType = DisplayType.wide; break; case optional: resultingType = DisplayType.singleline; break; default: resultingType = m_default; } } return r... | /**
* Returns the proposed display type.<p>
*
* @return the proposed display type
*/ | Returns the proposed display type | getProposedType | {
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/ade/contenteditor/CmsContentTypeVisitor.java",
"license": "lgpl-2.1",
"size": 34156
} | [
"org.opencms.xml.content.I_CmsXmlContentHandler"
] | import org.opencms.xml.content.I_CmsXmlContentHandler; | import org.opencms.xml.content.*; | [
"org.opencms.xml"
] | org.opencms.xml; | 1,935,194 |
void forward(Ethernet eth, ConnectPoint inPort); | void forward(Ethernet eth, ConnectPoint inPort); | /**
* Forwards an ARP or neighbor solicitation request to its destination.
* Floods at the edg the request if the destination is not known.
*
* @param eth an ethernet frame containing an ARP or neighbor solicitation
* request.
* @param inPort the port the request was received on
*/ | Forwards an ARP or neighbor solicitation request to its destination. Floods at the edg the request if the destination is not known | forward | {
"repo_name": "sdnwiselab/onos",
"path": "core/api/src/main/java/org/onosproject/net/proxyarp/ProxyArpService.java",
"license": "apache-2.0",
"size": 2319
} | [
"org.onlab.packet.Ethernet",
"org.onosproject.net.ConnectPoint"
] | import org.onlab.packet.Ethernet; import org.onosproject.net.ConnectPoint; | import org.onlab.packet.*; import org.onosproject.net.*; | [
"org.onlab.packet",
"org.onosproject.net"
] | org.onlab.packet; org.onosproject.net; | 1,931,744 |
Observable<ServiceResponse<Boolean>> get200WithServiceResponseAsync(); | Observable<ServiceResponse<Boolean>> get200WithServiceResponseAsync(); | /**
* Get 200 success.
*
* @return the observable to the boolean object
*/ | Get 200 success | get200WithServiceResponseAsync | {
"repo_name": "yugangw-msft/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/HttpSuccess.java",
"license": "mit",
"size": 30999
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,624,102 |
public boolean isFlashOn() {
if (!useCamera) {
return false;
}
Camera.Parameters params = mCamera.getParameters();
return params.getFlashMode().equals(Parameters.FLASH_MODE_TORCH);
} | boolean function() { if (!useCamera) { return false; } Camera.Parameters params = mCamera.getParameters(); return params.getFlashMode().equals(Parameters.FLASH_MODE_TORCH); } | /**
* Check if the flash is on.
*
* @return state of the flash.
*/ | Check if the flash is on | isFlashOn | {
"repo_name": "alex-schwartzman/card.io-Android-source",
"path": "card.io/src/main/java/io/card/payment/CardScanner.java",
"license": "mit",
"size": 20908
} | [
"android.hardware.Camera"
] | import android.hardware.Camera; | import android.hardware.*; | [
"android.hardware"
] | android.hardware; | 616,861 |
public boolean excludeOnTaxonomyForProteinSequenceVersionIdSearchId(
Collection<Integer> excludeTaxonomy_Ids,
ProteinSequenceVersionObject proteinSequenceVersionObject,
int searchId ) throws Exception {
// Return true if all the taxonomy ids for the search id and protein sequence id are to be excluded... | boolean function( Collection<Integer> excludeTaxonomy_Ids, ProteinSequenceVersionObject proteinSequenceVersionObject, int searchId ) throws Exception { try { TaxonomyIdsForProtSeqIdSearchId_Request taxonomyIdsForProtSeqIdSearchId_Request = new TaxonomyIdsForProtSeqIdSearchId_Request(); taxonomyIdsForProtSeqIdSearchId_R... | /**
* The rules for if the passed in protein sequence version id and search id should be excluded
* for the passed in exclude taxonomy id Set.
*
* return true if should be excluded based on taxonomy id
*
* @param excludeTaxonomy_Ids
* @param proteinSequenceVersionObject
* @param searchId
* @return t... | The rules for if the passed in protein sequence version id and search id should be excluded for the passed in exclude taxonomy id Set. return true if should be excluded based on taxonomy id | excludeOnTaxonomyForProteinSequenceVersionIdSearchId | {
"repo_name": "yeastrc/proxl-web-app",
"path": "proxl_web_app/src/main/java/org/yeastrc/xlink/www/web_utils/ExcludeOnTaxonomyForProteinSequenceVersionIdSearchId.java",
"license": "apache-2.0",
"size": 3098
} | [
"java.util.Collection",
"java.util.Set",
"org.yeastrc.xlink.www.objects.ProteinSequenceVersionObject"
] | import java.util.Collection; import java.util.Set; import org.yeastrc.xlink.www.objects.ProteinSequenceVersionObject; | import java.util.*; import org.yeastrc.xlink.www.objects.*; | [
"java.util",
"org.yeastrc.xlink"
] | java.util; org.yeastrc.xlink; | 928,690 |
@Message(id = Message.NONE, value = "About to add user '%s' for realm '%s'")
String aboutToAddUser(String username, String realm); | @Message(id = Message.NONE, value = STR) String aboutToAddUser(String username, String realm); | /**
* Confirmation of the user being added.
*
* @param username - The new username.
* @param realm - The realm the user is being added for.
*
* @return a {@link String} for the message.
*/ | Confirmation of the user being added | aboutToAddUser | {
"repo_name": "luck3y/wildfly-core",
"path": "domain-management/src/main/java/org/jboss/as/domain/management/logging/DomainManagementLogger.java",
"license": "lgpl-2.1",
"size": 66410
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 707,518 |
public void setCardReverse(Image reverseImage) {
//cacheStore (backResourceName, reverseImage);
if (reverseImage == null) {
throw new IllegalArgumentException ("CardImages::setCardReverse() received null image.");
}
backImage = reverseImage;
}
| void function(Image reverseImage) { if (reverseImage == null) { throw new IllegalArgumentException (STR); } backImage = reverseImage; } | /**
* Set the reverse image for a card.
* <p>
* All calculations for card width, height, and offset are based on this card's dimensions.
* <p>
* @param reverseImage image for the reverse of a card.
*/ | Set the reverse image for a card. All calculations for card width, height, and offset are based on this card's dimensions. | setCardReverse | {
"repo_name": "heineman/algorithms-nutshell-2ed",
"path": "Blogs/src/algs/blog/graph/gui/view/CardImages.java",
"license": "mit",
"size": 5213
} | [
"java.awt.Image"
] | import java.awt.Image; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,465,920 |
public boolean isDebugEnabled() {
return isLoggable(Log.DEBUG);
}
| boolean function() { return isLoggable(Log.DEBUG); } | /**
* Is this logger instance enabled for the DEBUG level?
*
* @return True if this Logger is enabled for level DEBUG, false otherwise.
*/ | Is this logger instance enabled for the DEBUG level | isDebugEnabled | {
"repo_name": "tjth/bitcoinj-lotterycoin",
"path": "slf4j-1.7.16/slf4j-android/src/main/java/org/slf4j/impl/AndroidLoggerAdapter.java",
"license": "apache-2.0",
"size": 16947
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,343,044 |
protected final StreamManager getStreamManager(String streamName) {
return getStreamManager(Id.Namespace.DEFAULT, streamName);
} | final StreamManager function(String streamName) { return getStreamManager(Id.Namespace.DEFAULT, streamName); } | /**
* Returns a {@link StreamManager} for the specified stream in the default namespace
*
* @param streamName the specified stream
* @return {@link StreamManager} for the specified stream in the default namespace
*/ | Returns a <code>StreamManager</code> for the specified stream in the default namespace | getStreamManager | {
"repo_name": "anthcp/cdap",
"path": "cdap-unit-test/src/main/java/co/cask/cdap/test/ConfigurableTestBase.java",
"license": "apache-2.0",
"size": 33136
} | [
"co.cask.cdap.proto.Id"
] | import co.cask.cdap.proto.Id; | import co.cask.cdap.proto.*; | [
"co.cask.cdap"
] | co.cask.cdap; | 403,774 |
public void testRecoverExistingReplica() throws Exception {
final String indexName = "test-recover-existing-replica";
internalCluster().ensureAtLeastNumDataNodes(2);
List<String> dataNodes = randomSubsetOf(2, Sets.newHashSet(
clusterService().state().nodes().getDataNodes().values... | void function() throws Exception { final String indexName = STR; internalCluster().ensureAtLeastNumDataNodes(2); List<String> dataNodes = randomSubsetOf(2, Sets.newHashSet( clusterService().state().nodes().getDataNodes().valuesIt()).stream().map(DiscoveryNode::getName).collect(Collectors.toSet())); createIndex(indexNam... | /**
* Ensures that if a replica of a closed index does not have the same content as the primary, then a file-based recovery will occur.
*/ | Ensures that if a replica of a closed index does not have the same content as the primary, then a file-based recovery will occur | testRecoverExistingReplica | {
"repo_name": "gingerwizard/elasticsearch",
"path": "server/src/internalClusterTest/java/org/elasticsearch/indices/state/CloseIndexIT.java",
"license": "apache-2.0",
"size": 27655
} | [
"java.util.List",
"java.util.stream.Collectors",
"java.util.stream.IntStream",
"org.elasticsearch.cluster.metadata.IndexMetadata",
"org.elasticsearch.cluster.node.DiscoveryNode",
"org.elasticsearch.common.settings.Settings",
"org.elasticsearch.common.util.set.Sets"
] | import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.set.Sets; | import java.util.*; import java.util.stream.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.cluster.node.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.common.util.set.*; | [
"java.util",
"org.elasticsearch.cluster",
"org.elasticsearch.common"
] | java.util; org.elasticsearch.cluster; org.elasticsearch.common; | 495,163 |
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return blockForTexture.getIcon(side, textureMeta);
}
| @SideOnly(Side.CLIENT) IIcon function(int side, int meta) { return blockForTexture.getIcon(side, textureMeta); } | /**
* Gets the block's texture. Args: side, meta
*/ | Gets the block's texture. Args: side, meta | getIcon | {
"repo_name": "cbaakman/Tropicraft",
"path": "src/main/java/net/tropicraft/block/BlockTropicraftFenceGate.java",
"license": "mpl-2.0",
"size": 1674
} | [
"net.minecraft.util.IIcon"
] | import net.minecraft.util.IIcon; | import net.minecraft.util.*; | [
"net.minecraft.util"
] | net.minecraft.util; | 2,687,167 |
void mergePermissions(String uri, GraphPermissions permissions, Transaction transaction)
throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException; | void mergePermissions(String uri, GraphPermissions permissions, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException; | /** <p>Add to permissions on the graph.</p>
*
* @param uri the graph uri or {@link #DEFAULT_GRAPH} constant
* @param permissions the permissions to add to this graph
* @param transaction the open transaction to write in
*/ | Add to permissions on the graph | mergePermissions | {
"repo_name": "marklogic/java-client-api",
"path": "marklogic-client-api/src/main/java/com/marklogic/client/semantics/GraphManager.java",
"license": "apache-2.0",
"size": 32807
} | [
"com.marklogic.client.FailedRequestException",
"com.marklogic.client.ForbiddenUserException",
"com.marklogic.client.ResourceNotFoundException",
"com.marklogic.client.Transaction"
] | import com.marklogic.client.FailedRequestException; import com.marklogic.client.ForbiddenUserException; import com.marklogic.client.ResourceNotFoundException; import com.marklogic.client.Transaction; | import com.marklogic.client.*; | [
"com.marklogic.client"
] | com.marklogic.client; | 1,682,920 |
@Test
public void testNewInstance() {
Assert.assertEquals("W452", new Soundex().soundex("Williams"));
}
| void function() { Assert.assertEquals("W452", new Soundex().soundex(STR)); } | /**
* https://issues.apache.org/jira/browse/CODEC-54 https://issues.apache.org/jira/browse/CODEC-56
*/ | HREF HREF | testNewInstance | {
"repo_name": "886rs/commons-codec-1.10-src",
"path": "src/test/java/org/apache/commons/codec/language/SoundexTest.java",
"license": "apache-2.0",
"size": 15372
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 105,497 |
private void handleException(Throwable throwable) {
checkNotNull(throwable);
boolean completedWithFailure = false;
boolean firstTimeSeeingThisException = true;
if (allMustSucceed) {
// As soon as the first one fails, throw the exception up.
// The result of all other inputs i... | void function(Throwable throwable) { checkNotNull(throwable); boolean completedWithFailure = false; boolean firstTimeSeeingThisException = true; if (allMustSucceed) { completedWithFailure = setException(throwable); if (completedWithFailure) { releaseResourcesAfterFailure(); } else { firstTimeSeeingThisException = addCa... | /**
* Fails this future with the given Throwable if {@link #allMustSucceed} is true. Also, logs the
* throwable if it is an {@link Error} or if {@link #allMustSucceed} is {@code true}, the
* throwable did not cause this future to fail, and it is the first time we've seen that
* particular Throwable.... | Fails this future with the given Throwable if <code>#allMustSucceed</code> is true. Also, logs the throwable if it is an <code>Error</code> or if <code>#allMustSucceed</code> is true, the throwable did not cause this future to fail, and it is the first time we've seen that particular Throwable | handleException | {
"repo_name": "antlr/codebuff",
"path": "output/java_guava/1.4.18/AggregateFuture.java",
"license": "bsd-2-clause",
"size": 12055
} | [
"com.google.common.base.Preconditions",
"java.util.logging.Level"
] | import com.google.common.base.Preconditions; import java.util.logging.Level; | import com.google.common.base.*; import java.util.logging.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 980,105 |
public List<Capability> getCandidates(Requirement req)
{
List<Capability> candidates = m_candidateMap.get(req);
if (candidates != null)
{
return Collections.unmodifiableList(candidates);
}
return null;
} | List<Capability> function(Requirement req) { List<Capability> candidates = m_candidateMap.get(req); if (candidates != null) { return Collections.unmodifiableList(candidates); } return null; } | /**
* Gets the candidates associated with a given requirement.
*
* @param req the requirement whose candidates are desired.
* @return the matching candidates or null.
*/ | Gets the candidates associated with a given requirement | getCandidates | {
"repo_name": "aosgi/org.apache.felix.resolver",
"path": "src/main/java/org/apache/felix/resolver/Candidates.java",
"license": "apache-2.0",
"size": 58708
} | [
"java.util.Collections",
"java.util.List",
"org.osgi.resource.Capability",
"org.osgi.resource.Requirement"
] | import java.util.Collections; import java.util.List; import org.osgi.resource.Capability; import org.osgi.resource.Requirement; | import java.util.*; import org.osgi.resource.*; | [
"java.util",
"org.osgi.resource"
] | java.util; org.osgi.resource; | 1,842,754 |
public static Number div(Number left, Character right) {
return NumberNumberDiv.div(left, Integer.valueOf(right));
} | static Number function(Number left, Character right) { return NumberNumberDiv.div(left, Integer.valueOf(right)); } | /**
* Divide a Number by a Character. The ordinal value of the Character
* is used in the division (the ordinal value is the unicode
* value which for simple character sets is the ASCII value).
*
* @param left a Number
* @param right a Character
* @return the Number corresponding to ... | Divide a Number by a Character. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value) | div | {
"repo_name": "mv2a/yajsw",
"path": "src/groovy-patch/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 704164
} | [
"org.codehaus.groovy.runtime.dgmimpl.NumberNumberDiv"
] | import org.codehaus.groovy.runtime.dgmimpl.NumberNumberDiv; | import org.codehaus.groovy.runtime.dgmimpl.*; | [
"org.codehaus.groovy"
] | org.codehaus.groovy; | 1,565,712 |
@Deprecated
public List<Row> getWriteBuffer() {
return mutator == null ? null : mutator.getWriteBuffer();
}
/**
* Sets the number of rows that a scanner will fetch at once.
* <p>
* This will override the value specified by
* {@code hbase.client.scanner.caching}.
* Increasing this value will ... | List<Row> function() { return mutator == null ? null : mutator.getWriteBuffer(); } /** * Sets the number of rows that a scanner will fetch at once. * <p> * This will override the value specified by * {@code hbase.client.scanner.caching}. * Increasing this value will reduce the amount of work needed each time * {@code n... | /**
* Kept in 0.96 for backward compatibility
* @deprecated since 0.96. This is an internal buffer that should not be read nor write.
*/ | Kept in 0.96 for backward compatibility | getWriteBuffer | {
"repo_name": "zshao/hbase-1.0.0-cdh5.4.1",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java",
"license": "apache-2.0",
"size": 71077
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,126,371 |
public AppAnalysisReport analyze(App app)
throws Exception;
| AppAnalysisReport function(App app) throws Exception; | /**
* Analyze the given application.
*
* @param app the application under analysis
* @return the analysis report
* @throws Exception
*/ | Analyze the given application | analyze | {
"repo_name": "oprisnik/semdroid",
"path": "semdroid-core/src/main/java/com/oprisnik/semdroid/analysis/AppAnalysisPlugin.java",
"license": "apache-2.0",
"size": 1880
} | [
"com.oprisnik.semdroid.analysis.results.AppAnalysisReport",
"com.oprisnik.semdroid.app.App"
] | import com.oprisnik.semdroid.analysis.results.AppAnalysisReport; import com.oprisnik.semdroid.app.App; | import com.oprisnik.semdroid.analysis.results.*; import com.oprisnik.semdroid.app.*; | [
"com.oprisnik.semdroid"
] | com.oprisnik.semdroid; | 1,344,990 |
private void findViews() {
ibShopcartBack = (ImageButton) findViewById(R.id.ib_shopcart_back);
tvShopcartEdit = (TextView) findViewById(R.id.tv_shopcart_edit);
recyclerview = (RecyclerView) findViewById(R.id.recyclerview);
checkboxAll = (CheckBox) findViewById(R.id.checkbox_all);
... | void function() { ibShopcartBack = (ImageButton) findViewById(R.id.ib_shopcart_back); tvShopcartEdit = (TextView) findViewById(R.id.tv_shopcart_edit); recyclerview = (RecyclerView) findViewById(R.id.recyclerview); checkboxAll = (CheckBox) findViewById(R.id.checkbox_all); tvShopcartTotal = (TextView) findViewById(R.id.t... | /**
* Find the Views in the layout<br />
* <br />
* Auto-created on 2016-10-11 21:08:02 by Android Layout Finder
* (http://www.buzzingandroid.com/tools/android-layout-finder)
*/ | Find the Views in the layout Auto-created on 2016-10-11 21:08:02 by Android Layout Finder (HREF) | findViews | {
"repo_name": "weiwenqiang/GitHub",
"path": "ShoppingCart/Shopping-master/app/src/main/java/com/atguigu/shoppingmall/shoppingcart/activity/ShoppingCartActivity.java",
"license": "apache-2.0",
"size": 6481
} | [
"android.support.v7.widget.RecyclerView",
"android.widget.Button",
"android.widget.CheckBox",
"android.widget.ImageButton",
"android.widget.LinearLayout",
"android.widget.TextView"
] | import android.support.v7.widget.RecyclerView; import android.widget.Button; import android.widget.CheckBox; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; | import android.support.v7.widget.*; import android.widget.*; | [
"android.support",
"android.widget"
] | android.support; android.widget; | 1,699,726 |
public void onDrawStart(IMap map);
/**
* This method is called each time the feature is changed.
* @param map This parameter indicates the map the event occurred on.
* @param updateList This parameter contains a list of changes. see {@link IEditUpdateData} | void function(IMap map); /** * This method is called each time the feature is changed. * @param map This parameter indicates the map the event occurred on. * @param updateList This parameter contains a list of changes. see {@link IEditUpdateData} | /**
* This method is called when the draw session begins.
* @param map This parameter indicates the map the event occurred on.
*/ | This method is called when the draw session begins | onDrawStart | {
"repo_name": "missioncommand/emp3-android",
"path": "sdk/sdk-api/src/main/java/mil/emp3/api/listeners/IDrawEventListener.java",
"license": "apache-2.0",
"size": 1691
} | [
"mil.emp3.api.interfaces.IEditUpdateData",
"mil.emp3.api.interfaces.IMap"
] | import mil.emp3.api.interfaces.IEditUpdateData; import mil.emp3.api.interfaces.IMap; | import mil.emp3.api.interfaces.*; | [
"mil.emp3.api"
] | mil.emp3.api; | 1,384,267 |
public void addLinkToContentlet(Contentlet contentlet, String linkInode, String relationName, User user, boolean respectFrontendRoles)throws DotSecurityException, DotDataException;
| void function(Contentlet contentlet, String linkInode, String relationName, User user, boolean respectFrontendRoles)throws DotSecurityException, DotDataException; | /**
* Adds a relationship to a contentlet
* @param contentlet
* @param linkInode
* @param relationName
* @param user
* @param respectFrontendRoles
* @throws DotSecurityException
* @throws DotDataException
*/ | Adds a relationship to a contentlet | addLinkToContentlet | {
"repo_name": "guhb/core",
"path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPI.java",
"license": "gpl-3.0",
"size": 64730
} | [
"com.dotmarketing.exception.DotDataException",
"com.dotmarketing.exception.DotSecurityException",
"com.dotmarketing.portlets.contentlet.model.Contentlet",
"com.liferay.portal.model.User"
] | import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.liferay.portal.model.User; | import com.dotmarketing.exception.*; import com.dotmarketing.portlets.contentlet.model.*; import com.liferay.portal.model.*; | [
"com.dotmarketing.exception",
"com.dotmarketing.portlets",
"com.liferay.portal"
] | com.dotmarketing.exception; com.dotmarketing.portlets; com.liferay.portal; | 290,464 |
public void switchToExpenses() {
setCurrentMainCategory(Constants.EXPENSE_ID);
}
| void function() { setCurrentMainCategory(Constants.EXPENSE_ID); } | /**
* Sets the current main category to the expense category.
*/ | Sets the current main category to the expense category | switchToExpenses | {
"repo_name": "daubigne/Android-Budget-Project",
"path": "Android_Budget_App/src/it/chalmers/mufasa/android_budget_app/controller/TransactionController.java",
"license": "gpl-3.0",
"size": 2970
} | [
"it.chalmers.mufasa.android_budget_app.settings.Constants"
] | import it.chalmers.mufasa.android_budget_app.settings.Constants; | import it.chalmers.mufasa.android_budget_app.settings.*; | [
"it.chalmers.mufasa"
] | it.chalmers.mufasa; | 2,394,571 |
public static Map<String, Object> input(final String query) {
return input(query, null);
} | static Map<String, Object> function(final String query) { return input(query, null); } | /**
* Composes Web API input object from {@code query}.
*
* @param query
* @return
*/ | Composes Web API input object from query | input | {
"repo_name": "fieldenms/tg",
"path": "platform-pojo-bl/src/main/java/ua/com/fielden/platform/web_api/WebApiUtils.java",
"license": "mit",
"size": 4584
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,186,187 |
public static synchronized Properties loadEnvironment() {
if (env != null) return env;
// DGF lifted directly from Ant's Property task
env = new Properties();
Vector osEnv = Execute.getProcEnvironment();
for (Enumeration e = osEnv.elements(); e.hasMoreElements();) {
... | static synchronized Properties function() { if (env != null) return env; env = new Properties(); Vector osEnv = Execute.getProcEnvironment(); for (Enumeration e = osEnv.elements(); e.hasMoreElements();) { String entry = (String) e.nextElement(); int pos = entry.indexOf('='); if (pos == -1) { log.warn(STR + entry); } el... | /** Returns the current process environment variables
*
* @return the current process environment variables
*/ | Returns the current process environment variables | loadEnvironment | {
"repo_name": "mogotest/selenium",
"path": "remote/server/src/java/org/openqa/selenium/server/browserlaunchers/WindowsUtils.java",
"license": "apache-2.0",
"size": 27932
} | [
"java.util.Enumeration",
"java.util.Properties",
"java.util.Vector",
"org.apache.tools.ant.taskdefs.Execute"
] | import java.util.Enumeration; import java.util.Properties; import java.util.Vector; import org.apache.tools.ant.taskdefs.Execute; | import java.util.*; import org.apache.tools.ant.taskdefs.*; | [
"java.util",
"org.apache.tools"
] | java.util; org.apache.tools; | 2,031,915 |
protected void runSQL(String sql) throws SystemException {
try {
DataSource dataSource = appMessagePersistence.getDataSource();
SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
sql, new int[0]);
sqlUpdate.update();
}
catch (Exception e) {
throw new SystemException(e);
}
... | void function(String sql) throws SystemException { try { DataSource dataSource = appMessagePersistence.getDataSource(); SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql, new int[0]); sqlUpdate.update(); } catch (Exception e) { throw new SystemException(e); } } @BeanReference(type = org.oep.ssomgt... | /**
* Performs an SQL query.
*
* @param sql the sql query
*/ | Performs an SQL query | runSQL | {
"repo_name": "openegovplatform/OEPv2",
"path": "oep-ssomgt-portlet/docroot/WEB-INF/src/org/oep/ssomgt/service/base/AppMessageServiceBaseImpl.java",
"license": "apache-2.0",
"size": 21159
} | [
"com.liferay.portal.kernel.bean.BeanReference",
"com.liferay.portal.kernel.dao.jdbc.SqlUpdate",
"com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil",
"com.liferay.portal.kernel.exception.SystemException",
"com.liferay.portal.service.persistence.UserPersistence",
"javax.sql.DataSource",
"org.oep.sso... | import com.liferay.portal.kernel.bean.BeanReference; import com.liferay.portal.kernel.dao.jdbc.SqlUpdate; import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.service.persistence.UserPersistence; import javax.sql.DataSource... | import com.liferay.portal.kernel.bean.*; import com.liferay.portal.kernel.dao.jdbc.*; import com.liferay.portal.kernel.exception.*; import com.liferay.portal.service.persistence.*; import javax.sql.*; import org.oep.ssomgt.service.*; import org.oep.ssomgt.service.persistence.*; | [
"com.liferay.portal",
"javax.sql",
"org.oep.ssomgt"
] | com.liferay.portal; javax.sql; org.oep.ssomgt; | 1,445,457 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Void>> deleteWithResponseAsync(
String resourceGroupName, String accountName, String firewallRuleName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgum... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Void>> function( String resourceGroupName, String accountName, String firewallRuleName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new I... | /**
* Deletes the specified firewall rule from the specified Data Lake Store account.
*
* @param resourceGroupName The name of the Azure resource group.
* @param accountName The name of the Data Lake Store account.
* @param firewallRuleName The name of the firewall rule to delete.
* @throw... | Deletes the specified firewall rule from the specified Data Lake Store account | deleteWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/datalakestore/azure-resourcemanager-datalakestore/src/main/java/com/azure/resourcemanager/datalakestore/implementation/FirewallRulesClientImpl.java",
"license": "mit",
"size": 55791
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.FluxUtil"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,162,411 |
private void fillDetailFieldConfiguration(CmsListItem item, String detailId) {
StringBuffer html = new StringBuffer();
// search for the corresponding A_CmsSearchIndex:
String idxConfigName = (String)item.get(LIST_COLUMN_NAME);
I_CmsSearchFieldConfiguration idxFieldConfiguration = ... | void function(CmsListItem item, String detailId) { StringBuffer html = new StringBuffer(); String idxConfigName = (String)item.get(LIST_COLUMN_NAME); I_CmsSearchFieldConfiguration idxFieldConfiguration = OpenCms.getSearchManager().getFieldConfiguration( idxConfigName); List<CmsSearchField> fields = idxFieldConfiguratio... | /**
* Fills details of the field configuration into the given item. <p>
*
* @param item the list item to fill
* @param detailId the id for the detail to fill
*/ | Fills details of the field configuration into the given item. | fillDetailFieldConfiguration | {
"repo_name": "alkacon/opencms-core",
"path": "src-modules/org/opencms/workplace/tools/searchindex/CmsSearchFieldConfigurationList.java",
"license": "lgpl-2.1",
"size": 20945
} | [
"java.util.Iterator",
"java.util.List",
"org.opencms.main.OpenCms",
"org.opencms.search.fields.CmsLuceneField",
"org.opencms.search.fields.CmsSearchField",
"org.opencms.search.fields.CmsSearchFieldConfiguration",
"org.opencms.search.fields.CmsSearchFieldMapping",
"org.opencms.util.CmsStringUtil",
"o... | import java.util.Iterator; import java.util.List; import org.opencms.main.OpenCms; import org.opencms.search.fields.CmsLuceneField; import org.opencms.search.fields.CmsSearchField; import org.opencms.search.fields.CmsSearchFieldConfiguration; import org.opencms.search.fields.CmsSearchFieldMapping; import org.opencms.ut... | import java.util.*; import org.opencms.main.*; import org.opencms.search.fields.*; import org.opencms.util.*; import org.opencms.workplace.list.*; | [
"java.util",
"org.opencms.main",
"org.opencms.search",
"org.opencms.util",
"org.opencms.workplace"
] | java.util; org.opencms.main; org.opencms.search; org.opencms.util; org.opencms.workplace; | 496,455 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.