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
@Override public int read(byte buffer[]) throws IOException { return read(buffer, 0, buffer.length); }
int function(byte buffer[]) throws IOException { return read(buffer, 0, buffer.length); }
/*** * Reads the next number of bytes from the stream into an array and * returns the number of bytes read. Returns -1 if the end of the * stream has been reached. * <p> * @param buffer The byte array in which to store the data. * @return The number of bytes read. Returns -1 if the * end of the message has been reached. * @exception IOException If an error occurs in reading the underlying * stream. ***/
Reads the next number of bytes from the stream into an array and returns the number of bytes read. Returns -1 if the end of the stream has been reached.
read
{ "repo_name": "chenxiwen/CommonShellUtils", "path": "src/main/java/org/apache/commons/net/io/ToNetASCIIInputStream.java", "license": "apache-2.0", "size": 5253 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,797,000
public FileObject getFileAppenderFile() throws IOException { return fileAppender.getFile(); }
FileObject function() throws IOException { return fileAppender.getFile(); }
/** * This is not thread safe: please try to get the file appender yourself * using the static constructor and work from there */
This is not thread safe: please try to get the file appender yourself using the static constructor and work from there
getFileAppenderFile
{ "repo_name": "panbasten/imeta", "path": "imeta2.x/imeta-src/imeta-core/src/main/java/com/panet/imeta/core/logging/LogWriter.java", "license": "gpl-2.0", "size": 18890 }
[ "java.io.IOException", "org.apache.commons.vfs.FileObject" ]
import java.io.IOException; import org.apache.commons.vfs.FileObject;
import java.io.*; import org.apache.commons.vfs.*;
[ "java.io", "org.apache.commons" ]
java.io; org.apache.commons;
964,484
@Step MapArray<String, ICell> row(String value, Column column);
MapArray<String, ICell> row(String value, Column column);
/** * Get Row cells for Cell with searched value in Column by index(Int) or name(String) <br> * e.g. row("Roman", column("Name")) <br> * or row("Roman", column(3)) <br> * Each Row is map: columnName:cell */
Get Row cells for Cell with searched value in Column by index(Int) or name(String) e.g. row("Roman", column("Name")) or row("Roman", column(3)) Each Row is map: columnName:cell
row
{ "repo_name": "bes422/JDI", "path": "Java/JDI/jdi-uitest-core/src/main/java/com/epam/jdi/uitests/core/interfaces/complex/tables/ITable.java", "license": "gpl-3.0", "size": 10479 }
[ "com.epam.commons.map.MapArray" ]
import com.epam.commons.map.MapArray;
import com.epam.commons.map.*;
[ "com.epam.commons" ]
com.epam.commons;
2,836,130
public void setWorkDir(@CheckForNull Path workDir) { this.workDir = workDir; }
void function(@CheckForNull Path workDir) { this.workDir = workDir; }
/** * Specified a path to the work directory. * @param workDir Path to the working directory of the remoting instance. * {@code null} Disables the working directory. * @since TODO */
Specified a path to the work directory
setWorkDir
{ "repo_name": "oleg-nenashev/remoting", "path": "src/main/java/hudson/remoting/Engine.java", "license": "mit", "size": 34268 }
[ "java.nio.file.Path", "javax.annotation.CheckForNull" ]
import java.nio.file.Path; import javax.annotation.CheckForNull;
import java.nio.file.*; import javax.annotation.*;
[ "java.nio", "javax.annotation" ]
java.nio; javax.annotation;
1,926,685
@Override public void exitCatchType(@NotNull PJParser.CatchTypeContext ctx) { }
@Override public void exitCatchType(@NotNull PJParser.CatchTypeContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
enterCatchType
{ "repo_name": "Diolor/PJ", "path": "src/main/java/com/lorentzos/pj/PJBaseListener.java", "license": "mit", "size": 73292 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
782,497
public final DoveAsyncTask<Params, Progress, Result> executeParallel(Params... params) { return execute(AsyncTask.THREAD_POOL_EXECUTOR, false, params); }
final DoveAsyncTask<Params, Progress, Result> function(Params... params) { return execute(AsyncTask.THREAD_POOL_EXECUTOR, false, params); }
/** * Executes the task with the specified parameters in parallel order with * other tasks. The task returns itself (this) so that the caller can keep a * reference to it. * * <p/> * This method must be invoked on the UI thread. * * @param params The parameters of the task. * @return This instance of DoveAsyncTask. * @throws IllegalStateException If {@link #getStatus()} returns either * {@link android.os.AsyncTask.Status#RUNNING} or * {@link android.os.AsyncTask.Status#FINISHED}. * @see com.dove.common.content.DoveAsyncTask#executeSerial(Object...) * @see com.dove.common.content.DoveAsyncTask#cancelAndExecuteParallel(Object...) * @see com.dove.common.content.DoveAsyncTask#cancelAndExecuteSerial(Object...) * @see com.dove.common.content.DoveAsyncTask#executeParallel(Runnable) * @see com.dove.common.content.DoveAsyncTask#executeSerial(Runnable) * @see com.dove.common.content.DoveAsyncTask#executeParallel(Runnable, long) * @see com.dove.common.content.DoveAsyncTask#executeSerial(Runnable, long) */
Executes the task with the specified parameters in parallel order with other tasks. The task returns itself (this) so that the caller can keep a reference to it. This method must be invoked on the UI thread
executeParallel
{ "repo_name": "george-zhang-work/dove", "path": "Dove/common/src/main/java/com/dove/common/content/DoveAsyncTask.java", "license": "apache-2.0", "size": 14706 }
[ "android.os.AsyncTask" ]
import android.os.AsyncTask;
import android.os.*;
[ "android.os" ]
android.os;
711,574
public DateTime nextResetTime() { return this.nextResetTime; }
DateTime function() { return this.nextResetTime; }
/** * Get next reset time for the resource counter. * * @return the nextResetTime value */
Get next reset time for the resource counter
nextResetTime
{ "repo_name": "hovsepm/azure-sdk-for-java", "path": "appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/CsmUsageQuotaInner.java", "license": "mit", "size": 3479 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
1,046,565
public void startCall() throws IOException { flushIfFull(); _buffer[_offset++] = (byte) 'C'; }
void function() throws IOException { flushIfFull(); _buffer[_offset++] = (byte) 'C'; }
/** * Writes the call tag. This would be followed by the * method and the arguments * * <code><pre> * C * </pre></code> * * @param method the method name to call. */
Writes the call tag. This would be followed by the method and the arguments <code><code> C </code></code>
startCall
{ "repo_name": "zhushuchen/Ocean", "path": "项目源码/dubbo/hessian-lite/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Output.java", "license": "agpl-3.0", "size": 34700 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
695,519
public void render(Select select, HtmlStringBuffer buffer) { buffer.elementStart(getTag()); if (select.isMultiple()) { if (!select.getSelectedValues().isEmpty()) { // Search through selection list for matching value List values = select.getSelectedValues(); for (int i = 0, size = values.size(); i < size; i++) { String value = values.get(i).toString(); if (getValue().equals(value)) { buffer.appendAttribute("selected", "selected"); break; } } } } else { if (getValue().equals(select.getValue())) { buffer.appendAttribute("selected", "selected"); } } buffer.appendAttributeEscaped("value", getValue()); buffer.closeTag(); buffer.appendEscaped(getLabel()); buffer.elementEnd(getTag()); } /** * Return a HTML rendered Option string. * * @deprecated use {@link #render(org.apache.click.control.Select, org.apache.click.util.HtmlStringBuffer)}
void function(Select select, HtmlStringBuffer buffer) { buffer.elementStart(getTag()); if (select.isMultiple()) { if (!select.getSelectedValues().isEmpty()) { List values = select.getSelectedValues(); for (int i = 0, size = values.size(); i < size; i++) { String value = values.get(i).toString(); if (getValue().equals(value)) { buffer.appendAttribute(STR, STR); break; } } } } else { if (getValue().equals(select.getValue())) { buffer.appendAttribute(STR, STR); } } buffer.appendAttributeEscaped("value", getValue()); buffer.closeTag(); buffer.appendEscaped(getLabel()); buffer.elementEnd(getTag()); } /** * Return a HTML rendered Option string. * * @deprecated use {@link #render(org.apache.click.control.Select, org.apache.click.util.HtmlStringBuffer)}
/** * Return a HTML rendered Option string. * * @param select the parent Select * @param buffer the specified buffer to render to */
Return a HTML rendered Option string
render
{ "repo_name": "medgar/click", "path": "framework/src/org/apache/click/control/Option.java", "license": "apache-2.0", "size": 8281 }
[ "java.util.List", "org.apache.click.util.HtmlStringBuffer" ]
import java.util.List; import org.apache.click.util.HtmlStringBuffer;
import java.util.*; import org.apache.click.util.*;
[ "java.util", "org.apache.click" ]
java.util; org.apache.click;
624,394
public void setOffset(Vector vector) { if (vector == null) throw new IllegalArgumentException("Vector cannot be NULL."); setOffsetX((float) vector.getX()); setOffsetY((float) vector.getY()); setOffsetZ((float) vector.getZ()); }
void function(Vector vector) { if (vector == null) throw new IllegalArgumentException(STR); setOffsetX((float) vector.getX()); setOffsetY((float) vector.getY()); setOffsetZ((float) vector.getZ()); }
/** * Set the random offset (multiplied by a random gaussian) to be applied after the particles are created. * @param vector - the random vector offset. */
Set the random offset (multiplied by a random gaussian) to be applied after the particles are created
setOffset
{ "repo_name": "aadnk/PacketWrapper", "path": "PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerWorldParticles.java", "license": "lgpl-3.0", "size": 9555 }
[ "org.bukkit.util.Vector" ]
import org.bukkit.util.Vector;
import org.bukkit.util.*;
[ "org.bukkit.util" ]
org.bukkit.util;
1,264,629
public DBCompound getCompound(String ID, ParameterSet parameters) throws IOException;
DBCompound function(String ID, ParameterSet parameters) throws IOException;
/** * This method retrieves the details about a compound */
This method retrieves the details about a compound
getCompound
{ "repo_name": "berlinguyinca/mzmine-fork", "path": "src/main/java/net/sf/mzmine/modules/peaklistmethods/identification/dbsearch/DBGateway.java", "license": "gpl-2.0", "size": 1376 }
[ "java.io.IOException", "net.sf.mzmine.parameters.ParameterSet" ]
import java.io.IOException; import net.sf.mzmine.parameters.ParameterSet;
import java.io.*; import net.sf.mzmine.parameters.*;
[ "java.io", "net.sf.mzmine" ]
java.io; net.sf.mzmine;
2,454,845
public Entry getEntryForHighlight(Highlight highlight) { if (highlight.getDataSetIndex() >= mDataSets.size()) return null; else return mDataSets.get(highlight.getDataSetIndex()).getEntryForXIndex( highlight.getXIndex()); }
Entry function(Highlight highlight) { if (highlight.getDataSetIndex() >= mDataSets.size()) return null; else return mDataSets.get(highlight.getDataSetIndex()).getEntryForXIndex( highlight.getXIndex()); }
/** * Get the Entry for a corresponding highlight object * * @param highlight * @return the entry that is highlighted */
Get the Entry for a corresponding highlight object
getEntryForHighlight
{ "repo_name": "muyoumumumu/QuShuChe", "path": "MPChartLib/src/com/github/mikephil/charting/data/ChartData.java", "license": "apache-2.0", "size": 25281 }
[ "com.github.mikephil.charting.highlight.Highlight" ]
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.highlight.*;
[ "com.github.mikephil" ]
com.github.mikephil;
2,903,029
public RestoreSnapshotRequest source(String source) { if (hasLength(source)) { try { return source(XContentFactory.xContent(source).createParser(source).mapOrderedAndClose()); } catch (Exception e) { throw new ElasticsearchIllegalArgumentException("failed to parse repository source [" + source + "]", e); } } return this; }
RestoreSnapshotRequest function(String source) { if (hasLength(source)) { try { return source(XContentFactory.xContent(source).createParser(source).mapOrderedAndClose()); } catch (Exception e) { throw new ElasticsearchIllegalArgumentException(STR + source + "]", e); } } return this; }
/** * Parses restore definition * <p/> * JSON, YAML and properties formats are supported * * @param source restore definition * @return this request */
Parses restore definition JSON, YAML and properties formats are supported
source
{ "repo_name": "zuoyebushiwo/elasticsearch-1.5.0", "path": "src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java", "license": "apache-2.0", "size": 24393 }
[ "org.elasticsearch.ElasticsearchIllegalArgumentException", "org.elasticsearch.common.xcontent.XContentFactory" ]
import org.elasticsearch.ElasticsearchIllegalArgumentException; import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.*; import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch", "org.elasticsearch.common" ]
org.elasticsearch; org.elasticsearch.common;
775,007
@Test public void testProtectPropertiesByRestriction() throws Exception { // allow rep:write /testroot // deny jcr:modifyProperties /testroot/a hasProperty=protect-me addEntry(TEST_ROOT_PATH, true, "", PrivilegeConstants.JCR_READ, PrivilegeConstants.REP_WRITE); addEntry(TEST_A_PATH, false, PROP_NAME_PROTECT_ME, PrivilegeConstants.JCR_MODIFY_PROPERTIES); ContentSession testSession = createTestSession(); try { Root testRoot = testSession.getLatestRoot(); PermissionProvider pp = getPermissionProvider(testSession); assertIsGranted(pp, testRoot, true , TEST_A_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, true , TEST_B_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, false, TEST_C_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, true , TEST_D_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, true , TEST_E_PATH, Permissions.MODIFY_PROPERTY); } finally { testSession.close(); } }
void function() throws Exception { addEntry(TEST_ROOT_PATH, true, "", PrivilegeConstants.JCR_READ, PrivilegeConstants.REP_WRITE); addEntry(TEST_A_PATH, false, PROP_NAME_PROTECT_ME, PrivilegeConstants.JCR_MODIFY_PROPERTIES); ContentSession testSession = createTestSession(); try { Root testRoot = testSession.getLatestRoot(); PermissionProvider pp = getPermissionProvider(testSession); assertIsGranted(pp, testRoot, true , TEST_A_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, true , TEST_B_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, false, TEST_C_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, true , TEST_D_PATH, Permissions.MODIFY_PROPERTY); assertIsGranted(pp, testRoot, true , TEST_E_PATH, Permissions.MODIFY_PROPERTY); } finally { testSession.close(); } }
/** * Tests the custom restriction provider that checks on the existence of a property. * @throws Exception */
Tests the custom restriction provider that checks on the existence of a property
testProtectPropertiesByRestriction
{ "repo_name": "mduerig/jackrabbit-oak", "path": "oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/CustomRestrictionProviderTest.java", "license": "apache-2.0", "size": 14756 }
[ "org.apache.jackrabbit.oak.api.ContentSession", "org.apache.jackrabbit.oak.api.Root", "org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider", "org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions", "org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants" ]
import org.apache.jackrabbit.oak.api.ContentSession; import org.apache.jackrabbit.oak.api.Root; import org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider; import org.apache.jackrabbit.oak.spi.security.authorization.permission.Permissions; import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeConstants;
import org.apache.jackrabbit.oak.api.*; import org.apache.jackrabbit.oak.spi.security.authorization.permission.*; import org.apache.jackrabbit.oak.spi.security.privilege.*;
[ "org.apache.jackrabbit" ]
org.apache.jackrabbit;
1,076,574
protected Gfsh getGfsh() { return this.gfsh; }
Gfsh function() { return this.gfsh; }
/** * Returns the reference to the GemFire shell (Gfsh) instance using this HTTP-based * OperationInvoker to send commands to the GemFire Manager for remote execution and processing. * * @return a reference to the instance of the GemFire shell (Gfsh) using this HTTP-based * OperationInvoker to process commands. * @see org.apache.geode.management.internal.cli.shell.Gfsh */
Returns the reference to the GemFire shell (Gfsh) instance using this HTTP-based OperationInvoker to send commands to the GemFire Manager for remote execution and processing
getGfsh
{ "repo_name": "prasi-in/geode", "path": "geode-core/src/main/java/org/apache/geode/management/internal/web/shell/AbstractHttpOperationInvoker.java", "license": "apache-2.0", "size": 38481 }
[ "org.apache.geode.management.internal.cli.shell.Gfsh" ]
import org.apache.geode.management.internal.cli.shell.Gfsh;
import org.apache.geode.management.internal.cli.shell.*;
[ "org.apache.geode" ]
org.apache.geode;
680,477
private File getLimiterPath() { return mLimiter == null ? new File("/") : (File)mLimiter.data; }
File function() { return mLimiter == null ? new File("/") : (File)mLimiter.data; }
/** * Returns the unixpath represented by this limiter * * @return the file of this limiter represents */
Returns the unixpath represented by this limiter
getLimiterPath
{ "repo_name": "vanilla-music/vanilla", "path": "app/src/main/java/ch/blinkenlights/android/vanilla/FileSystemAdapter.java", "license": "gpl-3.0", "size": 12875 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,677,427
public Stream<IBaseAgent> agentstream() { return Stream.concat( m_voters.stream(), m_chairs.stream() ); }
Stream<IBaseAgent> function() { return Stream.concat( m_voters.stream(), m_chairs.stream() ); }
/** * return stream over agents * @return agent stream */
return stream over agents
agentstream
{ "repo_name": "sdennisen/LightVoting", "path": "src/main/java/org/lightvoting/simulation/agent/coordinated_iterative/CBrokerAgentCI.java", "license": "lgpl-3.0", "size": 32027 }
[ "java.util.stream.Stream", "org.lightjason.agentspeak.agent.IBaseAgent" ]
import java.util.stream.Stream; import org.lightjason.agentspeak.agent.IBaseAgent;
import java.util.stream.*; import org.lightjason.agentspeak.agent.*;
[ "java.util", "org.lightjason.agentspeak" ]
java.util; org.lightjason.agentspeak;
1,397,692
@Test public void testParallelPropagationSenderStartAfterStopOnAccessorNode() throws Exception { addIgnoredException("Broken pipe"); addIgnoredException("Connection reset"); addIgnoredException("Unexpected IOException"); Integer[] locatorPorts = createLNAndNYLocators(); Integer lnPort = locatorPorts[0]; Integer nyPort = locatorPorts[1]; createSendersReceiversAndPartitionedRegion(lnPort, nyPort, true, true); // make sure all the senders are not running on accessor nodes and running on non-accessor nodes waitForSendersRunning(); // FIRST RUN: now, the senders are started. So, do some of the puts vm4.invoke(() -> doPuts(getUniqueName() + "_PR", 200)); // now, stop all of the senders stopSenders(); // SECOND RUN: do some of the puts after the senders are stopped vm4.invoke(() -> doPuts(getUniqueName() + "_PR", 1000)); // Region size on remote site should remain same and below the number of puts done in the FIRST // RUN vm2.invoke(() -> validateRegionSizeRemainsSame(getUniqueName() + "_PR", 200)); // start the senders again startSenderInVMs("ln", vm4, vm5, vm6, vm7); // Region size on remote site should remain same and below the number of puts done in the FIRST // RUN vm2.invoke(() -> validateRegionSizeRemainsSame(getUniqueName() + "_PR", 200)); // SECOND RUN: do some more puts vm4.invoke(() -> doPuts(getUniqueName() + "_PR", 1000)); // verify all buckets drained only on non-accessor nodes. vm4.invoke(() -> validateParallelSenderQueueAllBucketsDrained("ln")); vm5.invoke(() -> validateParallelSenderQueueAllBucketsDrained("ln")); // verify the events propagate to remote site vm2.invoke(() -> validateRegionSize(getUniqueName() + "_PR", 1000)); }
void function() throws Exception { addIgnoredException(STR); addIgnoredException(STR); addIgnoredException(STR); Integer[] locatorPorts = createLNAndNYLocators(); Integer lnPort = locatorPorts[0]; Integer nyPort = locatorPorts[1]; createSendersReceiversAndPartitionedRegion(lnPort, nyPort, true, true); waitForSendersRunning(); vm4.invoke(() -> doPuts(getUniqueName() + "_PR", 200)); stopSenders(); vm4.invoke(() -> doPuts(getUniqueName() + "_PR", 1000)); vm2.invoke(() -> validateRegionSizeRemainsSame(getUniqueName() + "_PR", 200)); startSenderInVMs("ln", vm4, vm5, vm6, vm7); vm2.invoke(() -> validateRegionSizeRemainsSame(getUniqueName() + "_PR", 200)); vm4.invoke(() -> doPuts(getUniqueName() + "_PR", 1000)); vm4.invoke(() -> validateParallelSenderQueueAllBucketsDrained("ln")); vm5.invoke(() -> validateParallelSenderQueueAllBucketsDrained("ln")); vm2.invoke(() -> validateRegionSize(getUniqueName() + "_PR", 1000)); }
/** * Normal scenario in which a sender is stopped and then started again on accessor node. */
Normal scenario in which a sender is stopped and then started again on accessor node
testParallelPropagationSenderStartAfterStopOnAccessorNode
{ "repo_name": "jdeppe-pivotal/geode", "path": "geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderOperationsDUnitTest.java", "license": "apache-2.0", "size": 62442 }
[ "org.apache.geode.test.dunit.IgnoredException" ]
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.*;
[ "org.apache.geode" ]
org.apache.geode;
1,102,106
CompletableFuture<List<String>> getResourceGroupsAsync();
CompletableFuture<List<String>> getResourceGroupsAsync();
/** * Get the list of resourcegroups asynchronously. * <p/> * Get the list of all the resourcegrops. * <p/> * Response Example: * * <pre> * <code>["resourcegroup1", * "resourcegroup2", * "resourcegroup3"]</code> * </pre> */
Get the list of resourcegroups asynchronously. Get the list of all the resourcegrops. Response Example: <code> <code>["resourcegroup1", "resourcegroup2", "resourcegroup3"]</code> </code>
getResourceGroupsAsync
{ "repo_name": "massakam/pulsar", "path": "pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/ResourceGroups.java", "license": "apache-2.0", "size": 6734 }
[ "java.util.List", "java.util.concurrent.CompletableFuture" ]
import java.util.List; import java.util.concurrent.CompletableFuture;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,107,547
private PluginItem declarePlugin(Class<?> cl, String dir, PluginType pluginType) { String className = cl.getSimpleName(); String msg = className + " module loaded."; try { for (PluginItem plugin : plugins_) { if (plugin.getClassName().contentEquals(className)) { msg = className + " already loaded"; return new PluginItem(cl, "", pluginType, "", "", dir, msg); } } String menuItem = getNameForPluginClass(cl); String toolTipDescription = ""; try { // Get this static field from the class implementing MMBasePlugin. toolTipDescription = (String) cl.getDeclaredField("tooltipDescription").get(null); } catch (SecurityException e) { ReportingUtils.logError(e); toolTipDescription = "Description not available"; } catch (NoSuchFieldException e) { toolTipDescription = "Description not available"; ReportingUtils.logMessage(cl.getName() + " fails to implement static String tooltipDescription."); } catch (IllegalArgumentException e) { ReportingUtils.logError(e); } catch (IllegalAccessException e) { ReportingUtils.logError(e); } menuItem = menuItem.replace("_", " "); PluginItem pi = new PluginItem(cl, className, pluginType, menuItem, toolTipDescription, dir, msg); plugins_.add(pi); return pi; } catch (NoClassDefFoundError e) { msg = className + " class definition not found."; ReportingUtils.logError(e, msg); } // Give up on providing extra information; just return a "bare" // PluginItem. return new PluginItem(cl, "", pluginType, "", "", "", msg); }
PluginItem function(Class<?> cl, String dir, PluginType pluginType) { String className = cl.getSimpleName(); String msg = className + STR; try { for (PluginItem plugin : plugins_) { if (plugin.getClassName().contentEquals(className)) { msg = className + STR; return new PluginItem(cl, STRSTRSTRSTRtooltipDescriptionSTRDescription not availableSTRDescription not availableSTR fails to implement static String tooltipDescription.STR_STR STR class definition not found."; ReportingUtils.logError(e, msg); } return new PluginItem(cl, STRSTRSTR", msg); }
/** * Inspects the provided class and transforms it into a PluginItem instance * @param cl - Class that potentially is a plugin * @param dir - Relative directory (empty string if at root of plugin dir) * @param pluginType - Type of plugin (currently either MMPlugin or * MMProcessorPlugin). * @return - PluginItem constructed from provided data */
Inspects the provided class and transforms it into a PluginItem instance
declarePlugin
{ "repo_name": "kmdouglass/Micro-Manager", "path": "mmstudio/src/org/micromanager/pluginmanagement/PluginLoader.java", "license": "mit", "size": 11268 }
[ "org.micromanager.utils.ReportingUtils" ]
import org.micromanager.utils.ReportingUtils;
import org.micromanager.utils.*;
[ "org.micromanager.utils" ]
org.micromanager.utils;
2,858,206
private Set<String> processJavadoc(TextBlock cmt) { final Set<String> references = new HashSet<>(); // process all the @link type tags // INLINEs inside BLOCKs get hidden when using ALL for (final JavadocTag tag : getValidTags(cmt, JavadocUtils.JavadocTagType.INLINE)) { if (tag.canReferenceImports()) { references.addAll(processJavadocTag(tag)); } } // process all the @throws type tags for (final JavadocTag tag : getValidTags(cmt, JavadocUtils.JavadocTagType.BLOCK)) { if (tag.canReferenceImports()) { references.addAll( matchPattern(tag.getArg1(), FIRST_CLASS_NAME)); } } return references; } /** * Returns the list of valid tags found in a javadoc {@link TextBlock}
Set<String> function(TextBlock cmt) { final Set<String> references = new HashSet<>(); for (final JavadocTag tag : getValidTags(cmt, JavadocUtils.JavadocTagType.INLINE)) { if (tag.canReferenceImports()) { references.addAll(processJavadocTag(tag)); } } for (final JavadocTag tag : getValidTags(cmt, JavadocUtils.JavadocTagType.BLOCK)) { if (tag.canReferenceImports()) { references.addAll( matchPattern(tag.getArg1(), FIRST_CLASS_NAME)); } } return references; } /** * Returns the list of valid tags found in a javadoc {@link TextBlock}
/** * Process a javadoc {@link TextBlock} and return the set of classes * referenced within. * @param cmt The javadoc block to parse * @return a set of classes referenced in the javadoc block */
Process a javadoc <code>TextBlock</code> and return the set of classes referenced within
processJavadoc
{ "repo_name": "naver/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheck.java", "license": "lgpl-2.1", "size": 9914 }
[ "com.puppycrawl.tools.checkstyle.api.TextBlock", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTag", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocUtils", "java.util.HashSet", "java.util.Set" ]
import com.puppycrawl.tools.checkstyle.api.TextBlock; import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTag; import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocUtils; import java.util.HashSet; import java.util.Set;
import com.puppycrawl.tools.checkstyle.api.*; import com.puppycrawl.tools.checkstyle.checks.javadoc.*; import java.util.*;
[ "com.puppycrawl.tools", "java.util" ]
com.puppycrawl.tools; java.util;
335,200
protected void generateRandomInitialSolution(){ if(curSolution != null){ throw new SearchException( "Cannot set random initial solution in local search: current solution is already set." ); } updateCurrentAndBestSolution(getProblem().createRandomSolution(getRandom())); }
void function(){ if(curSolution != null){ throw new SearchException( STR ); } updateCurrentAndBestSolution(getProblem().createRandomSolution(getRandom())); }
/** * Generates a random initial solution. Called from {@link #searchStarted()}. * * @throws SearchException if a current solution is already set when calling this method */
Generates a random initial solution. Called from <code>#searchStarted()</code>
generateRandomInitialSolution
{ "repo_name": "hdbeukel/james-core", "path": "src/main/java/org/jamesframework/core/search/LocalSearch.java", "license": "apache-2.0", "size": 12887 }
[ "org.jamesframework.core.exceptions.SearchException" ]
import org.jamesframework.core.exceptions.SearchException;
import org.jamesframework.core.exceptions.*;
[ "org.jamesframework.core" ]
org.jamesframework.core;
593,027
@Test public void testClearSimulatedSyncToOSThreadContext() throws Exception { // Instead of testing the real SyncToOSThread context behavior, // the fake context provider defaults/propagates the thread name. ContextService contextSvc = InitialContext.doLookup("java:module/concurrent/zosWLMContext"); String originalName = Thread.currentThread().getName(); try { Thread.currentThread().setName("testClearSimulatedSyncToOSThreadContext"); Supplier<String> threadNameSupplier = contextSvc.contextualSupplier(() -> Thread.currentThread().getName()); assertEquals("Unnamed Thread", threadNameSupplier.get()); assertEquals("testClearSimulatedSyncToOSThreadContext", Thread.currentThread().getName()); } finally { Thread.currentThread().setName(originalName); } }
void function() throws Exception { ContextService contextSvc = InitialContext.doLookup(STR); String originalName = Thread.currentThread().getName(); try { Thread.currentThread().setName(STR); Supplier<String> threadNameSupplier = contextSvc.contextualSupplier(() -> Thread.currentThread().getName()); assertEquals(STR, threadNameSupplier.get()); assertEquals(STR, Thread.currentThread().getName()); } finally { Thread.currentThread().setName(originalName); } }
/** * Configure to clear SyncToOSThread context and verify that the fake * context type that we are using to simulate it is cleared from the thread. */
Configure to clear SyncToOSThread context and verify that the fake context type that we are using to simulate it is cleared from the thread
testClearSimulatedSyncToOSThreadContext
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.concurrent_fat_zcontext/test-applications/SimZOSContextWeb/src/test/concurrent/sim/zos/context/web/SimZOSContextTestServlet.java", "license": "epl-1.0", "size": 7921 }
[ "jakarta.enterprise.concurrent.ContextService", "java.util.function.Supplier", "javax.naming.InitialContext", "org.junit.Assert" ]
import jakarta.enterprise.concurrent.ContextService; import java.util.function.Supplier; import javax.naming.InitialContext; import org.junit.Assert;
import jakarta.enterprise.concurrent.*; import java.util.function.*; import javax.naming.*; import org.junit.*;
[ "jakarta.enterprise.concurrent", "java.util", "javax.naming", "org.junit" ]
jakarta.enterprise.concurrent; java.util; javax.naming; org.junit;
2,275,258
private void sendViaDelete(MessageContext msgContext, URL url, String soapActiionString) throws AxisFault { DeleteMethod deleteMethod = new DeleteMethod(); HttpClient httpClient = getHttpClient(msgContext); populateCommonProperties(msgContext, url, deleteMethod, httpClient, soapActiionString); try { executeMethod(httpClient, msgContext, url, deleteMethod); handleResponse(msgContext, deleteMethod); } catch (IOException e) { log.info("Unable to sendViaDelete to url[" + url + "]", e); throw AxisFault.makeFault(e); } finally { cleanup(msgContext, deleteMethod); } }
void function(MessageContext msgContext, URL url, String soapActiionString) throws AxisFault { DeleteMethod deleteMethod = new DeleteMethod(); HttpClient httpClient = getHttpClient(msgContext); populateCommonProperties(msgContext, url, deleteMethod, httpClient, soapActiionString); try { executeMethod(httpClient, msgContext, url, deleteMethod); handleResponse(msgContext, deleteMethod); } catch (IOException e) { log.info(STR + url + "]", e); throw AxisFault.makeFault(e); } finally { cleanup(msgContext, deleteMethod); } }
/** * Used to send a request via HTTP Delete Method * * @param msgContext - The MessageContext of the message * @param url - The target URL * @param soapActiionString - The soapAction string of the request * @throws AxisFault - Thrown in case an exception occurs */
Used to send a request via HTTP Delete Method
sendViaDelete
{ "repo_name": "Nipuni/wso2-axis2", "path": "modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java", "license": "apache-2.0", "size": 15271 }
[ "java.io.IOException", "org.apache.axis2.AxisFault", "org.apache.axis2.context.MessageContext", "org.apache.commons.httpclient.HttpClient", "org.apache.commons.httpclient.methods.DeleteMethod" ]
import java.io.IOException; import org.apache.axis2.AxisFault; import org.apache.axis2.context.MessageContext; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.DeleteMethod;
import java.io.*; import org.apache.axis2.*; import org.apache.axis2.context.*; import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*;
[ "java.io", "org.apache.axis2", "org.apache.commons" ]
java.io; org.apache.axis2; org.apache.commons;
2,911,352
public void onTeleported() { if (!isTeleporting()) { return; } spawnMe(getPosition().getX(), getPosition().getY(), getPosition().getZ()); setIsTeleporting(false); if (_isPendingRevive) { doRevive(); } // Modify the position of the pet if necessary if (getPet() != null) { getPet().setFollowStatus(false); getPet().teleToLocation(getPosition().getX() + Rnd.get(-100, 100), getPosition().getY() + Rnd.get(-100, 100), getPosition().getZ(), false); getPet().setFollowStatus(true); } }
void function() { if (!isTeleporting()) { return; } spawnMe(getPosition().getX(), getPosition().getY(), getPosition().getZ()); setIsTeleporting(false); if (_isPendingRevive) { doRevive(); } if (getPet() != null) { getPet().setFollowStatus(false); getPet().teleToLocation(getPosition().getX() + Rnd.get(-100, 100), getPosition().getY() + Rnd.get(-100, 100), getPosition().getZ(), false); getPet().setFollowStatus(true); } }
/** * On teleported. */
On teleported
onTeleported
{ "repo_name": "oonym/l2InterludeServer", "path": "L2J_Server/java/net/sf/l2j/gameserver/model/L2Character.java", "license": "gpl-2.0", "size": 231634 }
[ "net.sf.l2j.util.Rnd" ]
import net.sf.l2j.util.Rnd;
import net.sf.l2j.util.*;
[ "net.sf.l2j" ]
net.sf.l2j;
1,958,063
public static int getPlayerPlotCount(final String world, final PlotPlayer plr) { final UUID uuid = plr.getUUID(); int count = 0; for (final Plot plot : PS.get().getPlotsInWorld(world)) { if (plot.hasOwner() && plot.owner.equals(uuid) && (!Settings.DONE_COUNTS_TOWARDS_LIMIT || !plot.getSettings().flags.containsKey("done"))) { count++; } } return count; }
static int function(final String world, final PlotPlayer plr) { final UUID uuid = plr.getUUID(); int count = 0; for (final Plot plot : PS.get().getPlotsInWorld(world)) { if (plot.hasOwner() && plot.owner.equals(uuid) && (!Settings.DONE_COUNTS_TOWARDS_LIMIT !plot.getSettings().flags.containsKey("done"))) { count++; } } return count; }
/** * Get the number of plots for a player * * @param plr * * @return int plot count */
Get the number of plots for a player
getPlayerPlotCount
{ "repo_name": "confuser/PlotSquared", "path": "src/main/java/com/intellectualcrafters/plot/util/MainUtil.java", "license": "gpl-3.0", "size": 72323 }
[ "com.intellectualcrafters.plot.PS", "com.intellectualcrafters.plot.config.Settings", "com.intellectualcrafters.plot.object.Plot", "com.intellectualcrafters.plot.object.PlotPlayer" ]
import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.*; import com.intellectualcrafters.plot.config.*; import com.intellectualcrafters.plot.object.*;
[ "com.intellectualcrafters.plot" ]
com.intellectualcrafters.plot;
1,172,267
float[] calculateComponentScore(Data feature);
float[] calculateComponentScore(Data feature);
/** * Calculates the component scores for the mixture components in this senone based upon the given feature. * * @param feature the feature vector to score this senone against * @return the scores for this senone in LogMath log base */
Calculates the component scores for the mixture components in this senone based upon the given feature
calculateComponentScore
{ "repo_name": "deepstupid/sphinx5", "path": "sphinx4-core/src/main/java/edu/cmu/sphinx/linguist/acoustic/tiedstate/Senone.java", "license": "agpl-3.0", "size": 1731 }
[ "edu.cmu.sphinx.frontend.Data" ]
import edu.cmu.sphinx.frontend.Data;
import edu.cmu.sphinx.frontend.*;
[ "edu.cmu.sphinx" ]
edu.cmu.sphinx;
2,327,588
@Lazy @Bean public LocalContainerEntityManagerFactoryBean ticketEntityManagerFactory() { return Beans.newHibernateEntityManagerFactoryBean( new JpaConfigDataHolder( Beans.newHibernateJpaVendorAdapter(casProperties.getJdbc()), "jpaTicketRegistryContext", ticketPackagesToScan(), dataSourceTicket()), casProperties.getTicket().getRegistry().getJpa()); }
LocalContainerEntityManagerFactoryBean function() { return Beans.newHibernateEntityManagerFactoryBean( new JpaConfigDataHolder( Beans.newHibernateJpaVendorAdapter(casProperties.getJdbc()), STR, ticketPackagesToScan(), dataSourceTicket()), casProperties.getTicket().getRegistry().getJpa()); }
/** * Entity manager factory local container. * * @return the local container entity manager factory bean */
Entity manager factory local container
ticketEntityManagerFactory
{ "repo_name": "gabedwrds/cas", "path": "support/cas-server-support-jpa-ticket-registry/src/main/java/org/apereo/cas/config/JpaTicketRegistryConfiguration.java", "license": "apache-2.0", "size": 4456 }
[ "org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder", "org.apereo.cas.configuration.support.Beans", "org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" ]
import org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder; import org.apereo.cas.configuration.support.Beans; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.apereo.cas.configuration.model.support.jpa.*; import org.apereo.cas.configuration.support.*; import org.springframework.orm.jpa.*;
[ "org.apereo.cas", "org.springframework.orm" ]
org.apereo.cas; org.springframework.orm;
2,767,406
public KeyName itemKeyName(int i) throws XMLSecurityException { Element e = XMLUtils.selectDsNode( this.constructionElement.getFirstChild(), Constants._TAG_KEYNAME, i); if (e != null) { return new KeyName(e, this.baseURI); } return null; }
KeyName function(int i) throws XMLSecurityException { Element e = XMLUtils.selectDsNode( this.constructionElement.getFirstChild(), Constants._TAG_KEYNAME, i); if (e != null) { return new KeyName(e, this.baseURI); } return null; }
/** * Method itemKeyName * * @param i * @return the asked KeyName element, null if the index is too big * @throws XMLSecurityException */
Method itemKeyName
itemKeyName
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java", "license": "apache-2.0", "size": 40883 }
[ "com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException", "com.sun.org.apache.xml.internal.security.keys.content.KeyName", "com.sun.org.apache.xml.internal.security.utils.Constants", "com.sun.org.apache.xml.internal.security.utils.XMLUtils", "org.w3c.dom.Element" ]
import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.KeyName; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Element;
import com.sun.org.apache.xml.internal.security.exceptions.*; import com.sun.org.apache.xml.internal.security.keys.content.*; import com.sun.org.apache.xml.internal.security.utils.*; import org.w3c.dom.*;
[ "com.sun.org", "org.w3c.dom" ]
com.sun.org; org.w3c.dom;
187,578
public void setInlineProperties(final EntityProviderWriteProperties inlineProperties) { this.inlineProperties = inlineProperties; }
void function(final EntityProviderWriteProperties inlineProperties) { this.inlineProperties = inlineProperties; }
/** * Sets the inline properties for this entry * @param inlineProperties */
Sets the inline properties for this entry
setInlineProperties
{ "repo_name": "apache/olingo-odata2", "path": "odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/callback/WriteEntryCallbackResult.java", "license": "apache-2.0", "size": 2021 }
[ "org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties" ]
import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
import org.apache.olingo.odata2.api.ep.*;
[ "org.apache.olingo" ]
org.apache.olingo;
2,482,120
@Test public void detectFirstLeaderElectionFromLongTermLeaderWithSlowRequest() { executeCalls( ImmutableSingleCall.of(0L, 1L, LEADER_1), ImmutableSingleCall.of(3L, 6L, LEADER_1), ImmutableSingleCall.of(10L, 45L, LEADER_2), ImmutableSingleCall.of(15L, 21L, LEADER_3), ImmutableSingleCall.of(28L, 36L, LEADER_3)); assertExpectedDurationAndLeaders(Instant.ofEpochMilli(3L), Instant.ofEpochMilli(21L), LEADER_1, LEADER_3); }
void function() { executeCalls( ImmutableSingleCall.of(0L, 1L, LEADER_1), ImmutableSingleCall.of(3L, 6L, LEADER_1), ImmutableSingleCall.of(10L, 45L, LEADER_2), ImmutableSingleCall.of(15L, 21L, LEADER_3), ImmutableSingleCall.of(28L, 36L, LEADER_3)); assertExpectedDurationAndLeaders(Instant.ofEpochMilli(3L), Instant.ofEpochMilli(21L), LEADER_1, LEADER_3); }
/** * [ A ] * [ A ] * [ B ] * [ C ] * [ C ] * <============> */
[ A ] [ A ] [ B ] [ C ] [ C ]
detectFirstLeaderElectionFromLongTermLeaderWithSlowRequest
{ "repo_name": "palantir/atlasdb", "path": "lock-api/src/test/java/com/palantir/lock/client/LeaderElectionReportingTimelockServiceTest.java", "license": "apache-2.0", "size": 17465 }
[ "java.time.Instant" ]
import java.time.Instant;
import java.time.*;
[ "java.time" ]
java.time;
2,849,973
@Override public void setDifferenceAmt (java.math.BigDecimal DifferenceAmt) { set_ValueNoCheck (COLUMNNAME_DifferenceAmt, DifferenceAmt); }
void function (java.math.BigDecimal DifferenceAmt) { set_ValueNoCheck (COLUMNNAME_DifferenceAmt, DifferenceAmt); }
/** Set Differenz. @param DifferenceAmt Difference Amount */
Set Differenz
setDifferenceAmt
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_C_PaySelectionLine.java", "license": "gpl-2.0", "size": 12512 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,864,862
public BigDecimal getA_Split_Percent () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_A_Split_Percent); if (bd == null) return Env.ZERO; return bd; }
BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_A_Split_Percent); if (bd == null) return Env.ZERO; return bd; }
/** Get Split Percentage. @return Split Percentage */
Get Split Percentage
getA_Split_Percent
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/base/src/org/compiere/model/X_I_Asset.java", "license": "gpl-2.0", "size": 44316 }
[ "java.math.BigDecimal", "org.compiere.util.Env" ]
import java.math.BigDecimal; import org.compiere.util.Env;
import java.math.*; import org.compiere.util.*;
[ "java.math", "org.compiere.util" ]
java.math; org.compiere.util;
2,839,310
static <S, F> Function<Result<S, F>, Optional<F>> toOptionalFailure() { return r -> r.either(__ -> Optional.empty(), Optional::of); }
static <S, F> Function<Result<S, F>, Optional<F>> toOptionalFailure() { return r -> r.either(__ -> Optional.empty(), Optional::of); }
/** * Returns an Optional failure value, which is present if this result was a failure * and empty if it was a success. */
Returns an Optional failure value, which is present if this result was a failure and empty if it was a success
toOptionalFailure
{ "repo_name": "unruly/control", "path": "src/main/java/co/unruly/control/result/Resolvers.java", "license": "mit", "size": 4498 }
[ "java.util.Optional", "java.util.function.Function", "java.util.stream.Stream" ]
import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream;
import java.util.*; import java.util.function.*; import java.util.stream.*;
[ "java.util" ]
java.util;
463,296
public final String toString() { return name; } } protected boolean bigEndian; protected int channels; protected Encoding encoding; protected float frameRate; protected int frameSize; protected float sampleRate; protected int sampleSizeInBits; private Map<String, Object> properties; public AudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian) { this.encoding = encoding; this.sampleRate = sampleRate; this.sampleSizeInBits = sampleSizeInBits; this.channels = channels; this.frameSize = frameSize; this.frameRate = frameRate; this.bigEndian = bigEndian; this.properties = Collections.<String, Object> emptyMap(); } public AudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian, Map<String, Object> properties) { this.encoding = encoding; this.sampleRate = sampleRate; this.sampleSizeInBits = sampleSizeInBits; this.channels = channels; this.frameSize = frameSize; this.frameRate = frameRate; this.bigEndian = bigEndian; this.properties = Collections.unmodifiableMap(new HashMap<String, Object>(properties)); } public AudioFormat(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian) { this.encoding = signed ? Encoding.PCM_SIGNED : Encoding.PCM_UNSIGNED; this.sampleRate = sampleRate; this.sampleSizeInBits = sampleSizeInBits; this.channels = channels; // It isn't clear whether channels can be NOT_SPECIFIED. if (sampleSizeInBits == AudioSystem.NOT_SPECIFIED || channels == AudioSystem.NOT_SPECIFIED) this.frameSize = AudioSystem.NOT_SPECIFIED; else this.frameSize = (sampleSizeInBits + 7) / 8 * channels; this.frameRate = sampleRate; this.bigEndian = bigEndian; this.properties = Collections.<String, Object> emptyMap(); }
final String function() { return name; } } protected boolean bigEndian; protected int channels; protected Encoding encoding; protected float frameRate; protected int frameSize; protected float sampleRate; protected int sampleSizeInBits; private Map<String, Object> properties; public AudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian) { this.encoding = encoding; this.sampleRate = sampleRate; this.sampleSizeInBits = sampleSizeInBits; this.channels = channels; this.frameSize = frameSize; this.frameRate = frameRate; this.bigEndian = bigEndian; this.properties = Collections.<String, Object> emptyMap(); } public AudioFormat(Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian, Map<String, Object> properties) { this.encoding = encoding; this.sampleRate = sampleRate; this.sampleSizeInBits = sampleSizeInBits; this.channels = channels; this.frameSize = frameSize; this.frameRate = frameRate; this.bigEndian = bigEndian; this.properties = Collections.unmodifiableMap(new HashMap<String, Object>(properties)); } public AudioFormat(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian) { this.encoding = signed ? Encoding.PCM_SIGNED : Encoding.PCM_UNSIGNED; this.sampleRate = sampleRate; this.sampleSizeInBits = sampleSizeInBits; this.channels = channels; if (sampleSizeInBits == AudioSystem.NOT_SPECIFIED channels == AudioSystem.NOT_SPECIFIED) this.frameSize = AudioSystem.NOT_SPECIFIED; else this.frameSize = (sampleSizeInBits + 7) / 8 * channels; this.frameRate = sampleRate; this.bigEndian = bigEndian; this.properties = Collections.<String, Object> emptyMap(); }
/** * Return the name of this encoding. */
Return the name of this encoding
toString
{ "repo_name": "rhuitl/uClinux", "path": "lib/classpath/javax/sound/sampled/AudioFormat.java", "license": "gpl-2.0", "size": 10391 }
[ "java.util.Collections", "java.util.HashMap", "java.util.Map" ]
import java.util.Collections; import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,791,350
@Test public void shouldSuccessfullyConnectThroughLocalSocks5Proxy() throws Exception { // start a local SOCKS5 proxy Socks5Proxy.setLocalSocks5ProxyPort(proxyPort); Socks5Proxy socks5Proxy = Socks5Proxy.getSocks5Proxy(); socks5Proxy.start(); // test data final byte[] data = new byte[] { 1, 2, 3 }; // create digest final String digest = Socks5Utils.createDigest(sessionID, initiatorJID, targetJID); // allow connection of target with this digest socks5Proxy.addTransfer(digest); // build stream host information final StreamHost streamHost = new StreamHost(connection.getUser(), loopbackAddress, socks5Proxy.getPort()); // target connects to local SOCKS5 proxy Thread targetThread = new Thread() {
void function() throws Exception { Socks5Proxy.setLocalSocks5ProxyPort(proxyPort); Socks5Proxy socks5Proxy = Socks5Proxy.getSocks5Proxy(); socks5Proxy.start(); final byte[] data = new byte[] { 1, 2, 3 }; final String digest = Socks5Utils.createDigest(sessionID, initiatorJID, targetJID); socks5Proxy.addTransfer(digest); final StreamHost streamHost = new StreamHost(connection.getUser(), loopbackAddress, socks5Proxy.getPort()); Thread targetThread = new Thread() {
/** * Initiator and target should successfully connect to the local SOCKS5 proxy. * * @throws Exception should not happen */
Initiator and target should successfully connect to the local SOCKS5 proxy
shouldSuccessfullyConnectThroughLocalSocks5Proxy
{ "repo_name": "vanitasvitae/smack-omemo", "path": "smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java", "license": "apache-2.0", "size": 10585 }
[ "org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream" ]
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.bytestreams.socks5.packet.*;
[ "org.jivesoftware.smackx" ]
org.jivesoftware.smackx;
2,268,679
private File[] searchForFiles(final File[] searchPaths) { final List<File> fileList = new ArrayList<>(); for (File searchPath : searchPaths) { LOG.debug("Searching for tools on: {}", searchPath); final File[] list = searchPath.listFiles(); if (list != null) { for (File aList : list) { if (aList.isFile()) { final String fileName = aList.getPath(); if (fileName.endsWith(TOOL_EXT_JAR)) { LOG.debug("found tool: {}", aList); fileList.add(aList); } } } } } return (File[]) fileList.toArray(new File[fileList.size()]); }// searchForFiles() private ToolManager() { }// ToolManager()
File[] function(final File[] searchPaths) { final List<File> fileList = new ArrayList<>(); for (File searchPath : searchPaths) { LOG.debug(STR, searchPath); final File[] list = searchPath.listFiles(); if (list != null) { for (File aList : list) { if (aList.isFile()) { final String fileName = aList.getPath(); if (fileName.endsWith(TOOL_EXT_JAR)) { LOG.debug(STR, aList); fileList.add(aList); } } } } } return (File[]) fileList.toArray(new File[fileList.size()]); } private ToolManager() { }
/** * Searches the paths for plugins, and returns the URL to each. */
Searches the paths for plugins, and returns the URL to each
searchForFiles
{ "repo_name": "takaki/jdip", "path": "src/main/java/dip/tool/ToolManager.java", "license": "gpl-2.0", "size": 5899 }
[ "java.io.File", "java.util.ArrayList", "java.util.List" ]
import java.io.File; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,388,248
EReference getEndDeviceAsset_Customer();
EReference getEndDeviceAsset_Customer();
/** * Returns the meta object for the reference '{@link CIM.IEC61968.Metering.EndDeviceAsset#getCustomer <em>Customer</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Customer</em>'. * @see CIM.IEC61968.Metering.EndDeviceAsset#getCustomer() * @see #getEndDeviceAsset() * @generated */
Returns the meta object for the reference '<code>CIM.IEC61968.Metering.EndDeviceAsset#getCustomer Customer</code>'.
getEndDeviceAsset_Customer
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61968/Metering/MeteringPackage.java", "license": "mit", "size": 264485 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
660,840
private int getCurrentCategory() { if (AedictApp.getConfig().getNotepadCategories().size() > 0) { return getTabHost().getCurrentTab(); } return 0; } private final Map<Integer, ListView> tabContents = new HashMap<Integer, ListView>();
int function() { if (AedictApp.getConfig().getNotepadCategories().size() > 0) { return getTabHost().getCurrentTab(); } return 0; } private final Map<Integer, ListView> tabContents = new HashMap<Integer, ListView>();
/** * Returns currently selected category tab. * @return currently selected tab, 0 if no tabs are displayed. */
Returns currently selected category tab
getCurrentCategory
{ "repo_name": "dper/aedict", "path": "aedict-apk/src/main/java/sk/baka/aedict/NotepadActivity.java", "license": "gpl-3.0", "size": 20163 }
[ "android.widget.ListView", "java.util.HashMap", "java.util.Map" ]
import android.widget.ListView; import java.util.HashMap; import java.util.Map;
import android.widget.*; import java.util.*;
[ "android.widget", "java.util" ]
android.widget; java.util;
1,783,037
public final TypeToken<?> getComponentType() { Type componentType = Types.getComponentType(runtimeType); if (componentType == null) { return null; } return of(componentType); }
final TypeToken<?> function() { Type componentType = Types.getComponentType(runtimeType); if (componentType == null) { return null; } return of(componentType); }
/** * Returns the array component type if this type represents an array ({@code int[]}, {@code T[]}, * {@code <? extends Map<String, Integer>[]>} etc.), or else {@code null} is returned. */
Returns the array component type if this type represents an array (int[], T[], []> etc.), or else null is returned
getComponentType
{ "repo_name": "oneliang/third-party-lib", "path": "google/com/google/common/reflect/TypeToken.java", "license": "apache-2.0", "size": 44480 }
[ "java.lang.reflect.Type" ]
import java.lang.reflect.Type;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
162,231
protected ActionModePresenter getTextSelectPresenter() { return null; } /** * @param permissions * Array of JSON objects to represent site permissions. * Example: { type: "offline-app", setting: "Store Offline Data", value: "Allow" }
ActionModePresenter function() { return null; } /** * @param permissions * Array of JSON objects to represent site permissions. * Example: { type: STR, setting: STR, value: "Allow" }
/** * To get a presenter which will response for text-selection. In preMarshmallow Android we want * to provide different UI action when user select a text. Text-selection class will uses this * presenter to trigger UI updating. * * @return a presenter which handle showing/hiding of action mode UI. return *null* if this * activity doesn't handle any text-selection event. */
To get a presenter which will response for text-selection. In preMarshmallow Android we want to provide different UI action when user select a text. Text-selection class will uses this presenter to trigger UI updating
getTextSelectPresenter
{ "repo_name": "bill-mccloskey/searchfox", "path": "tests/tests/files/GeckoApp.java", "license": "mpl-2.0", "size": 104036 }
[ "org.mozilla.gecko.widget.ActionModePresenter" ]
import org.mozilla.gecko.widget.ActionModePresenter;
import org.mozilla.gecko.widget.*;
[ "org.mozilla.gecko" ]
org.mozilla.gecko;
1,772,683
public void write(int b) throws IOException { if (debug > 1) { System.out.println("write "+b+" in CompressionResponseStream "); } if (closed) throw new IOException("Cannot write to a closed output stream"); if (bufferCount >= buffer.length) { flushToGZip(); } buffer[bufferCount++] = (byte) b; }
void function(int b) throws IOException { if (debug > 1) { System.out.println(STR+b+STR); } if (closed) throw new IOException(STR); if (bufferCount >= buffer.length) { flushToGZip(); } buffer[bufferCount++] = (byte) b; }
/** * Write the specified byte to our output stream. * * @param b The byte to be written * * @exception IOException if an input/output error occurs */
Write the specified byte to our output stream
write
{ "repo_name": "Snifer/BurpSuite-Plugins", "path": "BurpJDSer/test/Server/src/compressionFilters/CompressionResponseStream.java", "license": "gpl-2.0", "size": 8504 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
979,781
public static final ParseTree getDumpFileParseTree(InputStream stream, Charset defaultCharset) throws IOException { // FileInputStream doesn't support mark for example, so we read the entire file in memory ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buffer = new byte[16384]; for (int len = stream.read(buffer); len != -1; len = stream.read(buffer)) { outStream.write(buffer, 0, len); } ByteArrayInputStream buffdInput = new ByteArrayInputStream(outStream.toByteArray()); // Trying to read codepage from DF footer LineProcessor<Charset> charsetReader = new DFCodePageProcessor(defaultCharset); com.google.common.io.CharStreams.readLines( new InputStreamReader(buffdInput, defaultCharset == null ? Charset.defaultCharset() : defaultCharset), charsetReader); buffdInput.reset(); return getDumpFileParseTree(new InputStreamReader(buffdInput, charsetReader.getResult())); }
static final ParseTree function(InputStream stream, Charset defaultCharset) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buffer = new byte[16384]; for (int len = stream.read(buffer); len != -1; len = stream.read(buffer)) { outStream.write(buffer, 0, len); } ByteArrayInputStream buffdInput = new ByteArrayInputStream(outStream.toByteArray()); LineProcessor<Charset> charsetReader = new DFCodePageProcessor(defaultCharset); com.google.common.io.CharStreams.readLines( new InputStreamReader(buffdInput, defaultCharset == null ? Charset.defaultCharset() : defaultCharset), charsetReader); buffdInput.reset(); return getDumpFileParseTree(new InputStreamReader(buffdInput, charsetReader.getResult())); }
/** * DF file encoding is stored at the end of the file. It's usually not expected that Sonar properties will hold the * right value. */
DF file encoding is stored at the end of the file. It's usually not expected that Sonar properties will hold the right value
getDumpFileParseTree
{ "repo_name": "Riverside-Software/sonar-openedge", "path": "database-parser/src/main/java/eu/rssw/antlr/database/DumpFileUtils.java", "license": "lgpl-3.0", "size": 5079 }
[ "com.google.common.io.LineProcessor", "java.io.ByteArrayInputStream", "java.io.ByteArrayOutputStream", "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader", "java.nio.charset.Charset", "org.antlr.v4.runtime.CharStreams", "org.antlr.v4.runtime.tree.ParseTree" ]
import com.google.common.io.LineProcessor; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.tree.ParseTree;
import com.google.common.io.*; import java.io.*; import java.nio.charset.*; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.tree.*;
[ "com.google.common", "java.io", "java.nio", "org.antlr.v4" ]
com.google.common; java.io; java.nio; org.antlr.v4;
33,375
@Size(max = 256) public String getUserName() { return (String) get(3); }
@Size(max = 256) String function() { return (String) get(3); }
/** * Getter for <code>isy.oauth_access_token.user_name</code>. */
Getter for <code>isy.oauth_access_token.user_name</code>
getUserName
{ "repo_name": "zbeboy/ISY", "path": "src/main/java/top/zbeboy/isy/domain/tables/records/OauthAccessTokenRecord.java", "license": "mit", "size": 9309 }
[ "javax.validation.constraints.Size" ]
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
[ "javax.validation" ]
javax.validation;
937,502
public static OrientationRequested[] getAssociatedAttributeArray(Set<Attribute> set) { OrientationRequested[] result = new OrientationRequested[set.size()]; int j = 0; for (Attribute tmp : set) { result[j] = ((OrientationRequestedSupported) tmp).getAssociatedAttribute(); j++; } return result; }
static OrientationRequested[] function(Set<Attribute> set) { OrientationRequested[] result = new OrientationRequested[set.size()]; int j = 0; for (Attribute tmp : set) { result[j] = ((OrientationRequestedSupported) tmp).getAssociatedAttribute(); j++; } return result; }
/** * Constructs an array from a set of -supported attributes. * @param set set to process * @return The constructed array. * * @see #getAssociatedAttribute() */
Constructs an array from a set of -supported attributes
getAssociatedAttributeArray
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java", "license": "gpl-2.0", "size": 5503 }
[ "java.util.Set", "javax.print.attribute.Attribute", "javax.print.attribute.standard.OrientationRequested" ]
import java.util.Set; import javax.print.attribute.Attribute; import javax.print.attribute.standard.OrientationRequested;
import java.util.*; import javax.print.attribute.*; import javax.print.attribute.standard.*;
[ "java.util", "javax.print" ]
java.util; javax.print;
2,714,722
private void resize(int newSize) { // copy all data to a temporary array Item[] tmp = (Item[]) new Object[newSize]; for (int i = 0; i <= this.current; i++) tmp[i] = this.data[i]; this.data = tmp; this.size = newSize; } private class StackIterator implements Iterator<Item> { int index; // index of the current iteration Item[] stackData; // all stack data public StackIterator(Item[] objects, int index) { this.index = index; this.stackData = objects; }
void function(int newSize) { Item[] tmp = (Item[]) new Object[newSize]; for (int i = 0; i <= this.current; i++) tmp[i] = this.data[i]; this.data = tmp; this.size = newSize; } private class StackIterator implements Iterator<Item> { int index; Item[] stackData; public StackIterator(Item[] objects, int index) { this.index = index; this.stackData = objects; }
/** * Resize the stack * @param newSize new size of the stack */
Resize the stack
resize
{ "repo_name": "panchr/data-structures", "path": "stack/Stack.java", "license": "gpl-2.0", "size": 2899 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,315,562
private static void saveAll(List<DynamicExtensionBaseDomainObjectInterface> objectList) throws IOException, DynamicExtensionsSystemException { logWriter.write("\n-Inside Save All method"); //DAOConfigFactory daocConfigFactory = DAOConfigFactory.getInstance(); //IDAOFactory daoFactory = daocConfigFactory.getDAOFactory("dynamicExtention"); HibernateDAO dao = null; try { dao = DynamicExtensionsUtility.getHibernateDAO(); dao.openSession(null); for (DynamicExtensionBaseDomainObjectInterface obj : objectList) { dao.update(obj); } //System.out.println("sava all finshes ------"); } catch (Exception e) { e.printStackTrace(); logWriter.write("\n-Error while saveall method"); throw new DynamicExtensionsSystemException(e.getMessage()); } finally { try { dao.commit(); dao.closeSession(); } catch (DAOException daoEx) { daoEx.printStackTrace(); logWriter.write("\n-Error while saveAll method "); throw new DynamicExtensionsSystemException(daoEx.getMessage()); } } System.out.println("--saveAll objects finishes."); }
static void function(List<DynamicExtensionBaseDomainObjectInterface> objectList) throws IOException, DynamicExtensionsSystemException { logWriter.write(STR); HibernateDAO dao = null; try { dao = DynamicExtensionsUtility.getHibernateDAO(); dao.openSession(null); for (DynamicExtensionBaseDomainObjectInterface obj : objectList) { dao.update(obj); } } catch (Exception e) { e.printStackTrace(); logWriter.write(STR); throw new DynamicExtensionsSystemException(e.getMessage()); } finally { try { dao.commit(); dao.closeSession(); } catch (DAOException daoEx) { daoEx.printStackTrace(); logWriter.write(STR); throw new DynamicExtensionsSystemException(daoEx.getMessage()); } } System.out.println(STR); }
/** * This method save database properties, constraint properties & table properties using Hibernate dao. * @param objectList * @throws IOException * @throws DynamicExtensionsSystemException */
This method save database properties, constraint properties & table properties using Hibernate dao
saveAll
{ "repo_name": "NCIP/catissue-tools", "path": "WEB-INF/src/edu/wustl/clinportal/uploadmetadata/AutomateDynamicMetadataUpload.java", "license": "bsd-3-clause", "size": 29758 }
[ "edu.common.dynamicextensions.domaininterface.DynamicExtensionBaseDomainObjectInterface", "edu.common.dynamicextensions.exception.DynamicExtensionsSystemException", "edu.common.dynamicextensions.util.DynamicExtensionsUtility", "edu.wustl.dao.HibernateDAO", "edu.wustl.dao.exception.DAOException", "java.io.IOException", "java.util.List" ]
import edu.common.dynamicextensions.domaininterface.DynamicExtensionBaseDomainObjectInterface; import edu.common.dynamicextensions.exception.DynamicExtensionsSystemException; import edu.common.dynamicextensions.util.DynamicExtensionsUtility; import edu.wustl.dao.HibernateDAO; import edu.wustl.dao.exception.DAOException; import java.io.IOException; import java.util.List;
import edu.common.dynamicextensions.domaininterface.*; import edu.common.dynamicextensions.exception.*; import edu.common.dynamicextensions.util.*; import edu.wustl.dao.*; import edu.wustl.dao.exception.*; import java.io.*; import java.util.*;
[ "edu.common.dynamicextensions", "edu.wustl.dao", "java.io", "java.util" ]
edu.common.dynamicextensions; edu.wustl.dao; java.io; java.util;
184,527
public static void disposeImages() { SWTResourceManager.disposeImages(); // dispose ImageDescriptor images { for (Iterator<Image> I = m_descriptorImageMap.values().iterator(); I.hasNext();) { I.next().dispose(); } m_descriptorImageMap.clear(); } // dispose decorated images for (int i = 0; i < m_decoratedImageMap.length; i++) { Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i]; if (cornerDecoratedImageMap != null) { for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) { for (Image image : decoratedMap.values()) { image.dispose(); } decoratedMap.clear(); } cornerDecoratedImageMap.clear(); } } // dispose plugin images { for (Iterator<Image> I = m_URLImageMap.values().iterator(); I.hasNext();) { I.next().dispose(); } m_URLImageMap.clear(); } }
static void function() { SWTResourceManager.disposeImages(); { for (Iterator<Image> I = m_descriptorImageMap.values().iterator(); I.hasNext();) { I.next().dispose(); } m_descriptorImageMap.clear(); } for (int i = 0; i < m_decoratedImageMap.length; i++) { Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i]; if (cornerDecoratedImageMap != null) { for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) { for (Image image : decoratedMap.values()) { image.dispose(); } decoratedMap.clear(); } cornerDecoratedImageMap.clear(); } } { for (Iterator<Image> I = m_URLImageMap.values().iterator(); I.hasNext();) { I.next().dispose(); } m_URLImageMap.clear(); } }
/** * Dispose all of the cached images. */
Dispose all of the cached images
disposeImages
{ "repo_name": "openrobots-dev/ChibiOS", "path": "tools/eclipse/debug_support/src/org/eclipse/wb/swt/ResourceManager.java", "license": "gpl-3.0", "size": 14336 }
[ "java.util.Iterator", "java.util.Map", "org.eclipse.swt.graphics.Image" ]
import java.util.Iterator; import java.util.Map; import org.eclipse.swt.graphics.Image;
import java.util.*; import org.eclipse.swt.graphics.*;
[ "java.util", "org.eclipse.swt" ]
java.util; org.eclipse.swt;
1,731,107
public void attachView(@NonNull View child) { attachView(child, -1); }
void function(@NonNull View child) { attachView(child, -1); }
/** * Reattach a previously {@link #detachView(android.view.View) detached} view. * This method should not be used to reattach views that were previously * {@link #detachAndScrapView(android.view.View, RecyclerView.Recycler)} scrapped}. * * @param child Child to reattach */
Reattach a previously <code>#detachView(android.view.View) detached</code> view. This method should not be used to reattach views that were previously <code>#detachAndScrapView(android.view.View, RecyclerView.Recycler)</code> scrapped}
attachView
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "v7/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java", "license": "apache-2.0", "size": 582575 }
[ "android.view.View", "androidx.annotation.NonNull" ]
import android.view.View; import androidx.annotation.NonNull;
import android.view.*; import androidx.annotation.*;
[ "android.view", "androidx.annotation" ]
android.view; androidx.annotation;
1,942,988
protected final void check(IgniteCache cache) throws Exception { long pagesActual = ((IgniteCacheProxy)cache).context().dataRegion().pageMemory().loadedPages(); if (loadedPages > 0) { delta += pagesActual - loadedPages; int allowedDelta = pagesDelta(); if (probeCnt++ > 12) { // We need some statistic first. Minimal statistic is taken for a minute. long actualDelta = delta / probeCnt; assertTrue( "Average growth pages in the number is more than expected [allowed=" + allowedDelta + ", actual=" + actualDelta + "]", actualDelta <= allowedDelta); } } long pagesAllowed = pagesMax(); assertTrue("Allocated pages count is more than expected [allowed=" + pagesAllowed + ", actual=" + pagesActual + "]", pagesActual < pagesAllowed); loadedPages = pagesActual; }
final void function(IgniteCache cache) throws Exception { long pagesActual = ((IgniteCacheProxy)cache).context().dataRegion().pageMemory().loadedPages(); if (loadedPages > 0) { delta += pagesActual - loadedPages; int allowedDelta = pagesDelta(); if (probeCnt++ > 12) { long actualDelta = delta / probeCnt; assertTrue( STR + allowedDelta + STR + actualDelta + "]", actualDelta <= allowedDelta); } } long pagesAllowed = pagesMax(); assertTrue(STR + pagesAllowed + STR + pagesActual + "]", pagesActual < pagesAllowed); loadedPages = pagesActual; }
/** * Callback to check the current state. * * @param cache Cache instance. * @throws Exception If failed. */
Callback to check the current state
check
{ "repo_name": "samaitra/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java", "license": "apache-2.0", "size": 7642 }
[ "org.apache.ignite.IgniteCache", "org.apache.ignite.internal.processors.cache.IgniteCacheProxy" ]
import org.apache.ignite.IgniteCache; import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,112,283
@Override public List<StmtSubqueryScan> getSubqueryScans() { List<StmtSubqueryScan> subqueries = new ArrayList<>(); if (m_subquery != null) { subqueries.add(m_subquery); } return subqueries; }
List<StmtSubqueryScan> function() { List<StmtSubqueryScan> subqueries = new ArrayList<>(); if (m_subquery != null) { subqueries.add(m_subquery); } return subqueries; }
/** * Return the subqueries for this statement. For INSERT statements, * there can be only one. */
Return the subqueries for this statement. For INSERT statements, there can be only one
getSubqueryScans
{ "repo_name": "wolffcm/voltdb", "path": "src/frontend/org/voltdb/planner/ParsedInsertStmt.java", "license": "agpl-3.0", "size": 7701 }
[ "java.util.ArrayList", "java.util.List", "org.voltdb.planner.parseinfo.StmtSubqueryScan" ]
import java.util.ArrayList; import java.util.List; import org.voltdb.planner.parseinfo.StmtSubqueryScan;
import java.util.*; import org.voltdb.planner.parseinfo.*;
[ "java.util", "org.voltdb.planner" ]
java.util; org.voltdb.planner;
277,712
public void testToQueryUnmappedWithTimezone() throws QueryShardException, IOException { RangeQueryBuilder query = new RangeQueryBuilder("bogus_field"); query.from(1).to(10).timeZone("UTC"); QueryShardException e = expectThrows(QueryShardException.class, () -> query.toQuery(createShardContext())); assertThat(e.getMessage(), containsString("[range] time_zone can not be applied")); }
void function() throws QueryShardException, IOException { RangeQueryBuilder query = new RangeQueryBuilder(STR); query.from(1).to(10).timeZone("UTC"); QueryShardException e = expectThrows(QueryShardException.class, () -> query.toQuery(createShardContext())); assertThat(e.getMessage(), containsString(STR)); }
/** * Specifying a timezone together with an unmapped field should throw an exception. */
Specifying a timezone together with an unmapped field should throw an exception
testToQueryUnmappedWithTimezone
{ "repo_name": "gmarz/elasticsearch", "path": "core/src/test/java/org/elasticsearch/index/query/RangeQueryBuilderTests.java", "license": "apache-2.0", "size": 25631 }
[ "java.io.IOException", "org.hamcrest.Matchers" ]
import java.io.IOException; import org.hamcrest.Matchers;
import java.io.*; import org.hamcrest.*;
[ "java.io", "org.hamcrest" ]
java.io; org.hamcrest;
931,362
public Reporter getReporter() { return reporter; }
Reporter function() { return reporter; }
/** * Returns the reporter for events. */
Returns the reporter for events
getReporter
{ "repo_name": "safarmer/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java", "license": "apache-2.0", "size": 29720 }
[ "com.google.devtools.build.lib.events.Reporter" ]
import com.google.devtools.build.lib.events.Reporter;
import com.google.devtools.build.lib.events.*;
[ "com.google.devtools" ]
com.google.devtools;
554,335
public RenderedImage getImage(int level) { if (level < 0) { return null; } while (currentLevel < level) { getDownImage(); } while (currentLevel > level) { getUpImage(); } return currentImage; }
RenderedImage function(int level) { if (level < 0) { return null; } while (currentLevel < level) { getDownImage(); } while (currentLevel > level) { getUpImage(); } return currentImage; }
/** * Returns the image at the specified resolution level. The * requested level must be greater than or equal to 0 or * <code>null</code> will be returned. The image is obtained * by either down sampling or up sampling the current image. * * @param level The specified resolution level. */
Returns the image at the specified resolution level. The requested level must be greater than or equal to 0 or <code>null</code> will be returned. The image is obtained by either down sampling or up sampling the current image
getImage
{ "repo_name": "RoProducts/rastertheque", "path": "JAILibrary/src/javax/media/jai/ImagePyramid.java", "license": "gpl-2.0", "size": 12053 }
[ "java.awt.image.RenderedImage" ]
import java.awt.image.RenderedImage;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
1,102,858
public static Aggregate<Map<VarName, Concept>, Number> sum(String name) { return Aggregates.sum(VarName.of(name)); }
static Aggregate<Map<VarName, Concept>, Number> function(String name) { return Aggregates.sum(VarName.of(name)); }
/** * Create an aggregate that will sum the values of a variable. */
Create an aggregate that will sum the values of a variable
sum
{ "repo_name": "sklarman/grakn", "path": "grakn-graql/src/main/java/ai/grakn/graql/Graql.java", "license": "gpl-3.0", "size": 14616 }
[ "ai.grakn.concept.Concept", "ai.grakn.graql.internal.query.aggregate.Aggregates", "java.util.Map" ]
import ai.grakn.concept.Concept; import ai.grakn.graql.internal.query.aggregate.Aggregates; import java.util.Map;
import ai.grakn.concept.*; import ai.grakn.graql.internal.query.aggregate.*; import java.util.*;
[ "ai.grakn.concept", "ai.grakn.graql", "java.util" ]
ai.grakn.concept; ai.grakn.graql; java.util;
135,573
@Override public boolean commit() throws LoginException { _logger.debug("Entering commit state {}", _state); if (_state == State.LOGIN_SUCCEEDED) { try { for (Principal principal : _principals) { _subject.getPrincipals().add(principal); } _logger.debug("Subject principals in commit: {}", _subject.getPrincipals()); } catch (Exception e) { _logger.error("Commit failed", e); throw new LoginException("Commit failed!"); } _state = State.COMMIT_SUCCEEDED; _logger.debug("Commit successful"); return true; } return false; }
boolean function() throws LoginException { _logger.debug(STR, _state); if (_state == State.LOGIN_SUCCEEDED) { try { for (Principal principal : _principals) { _subject.getPrincipals().add(principal); } _logger.debug(STR, _subject.getPrincipals()); } catch (Exception e) { _logger.error(STR, e); throw new LoginException(STR); } _state = State.COMMIT_SUCCEEDED; _logger.debug(STR); return true; } return false; }
/** * Commit changes as the overall authentication was successful. * <p> * * * @return true if login and commit succeeded, false otherwise.O * @throws LoginException * on errors. */
Commit changes as the overall authentication was successful.
commit
{ "repo_name": "erik-wramner/YubikeyAuth", "path": "yubi-jaas-jetty-example/src/main/java/com/codemint/example/yubi/jaas/YubiNonPortableLoginModule.java", "license": "apache-2.0", "size": 9852 }
[ "java.security.Principal", "javax.security.auth.login.LoginException" ]
import java.security.Principal; import javax.security.auth.login.LoginException;
import java.security.*; import javax.security.auth.login.*;
[ "java.security", "javax.security" ]
java.security; javax.security;
29,055
public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; }
Builder function(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; }
/** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.Klarna#extraParams} for the * field documentation. */
Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See <code>PaymentIntentConfirmParams.PaymentMethodData.Klarna#extraParams</code> for the field documentation
putExtraParam
{ "repo_name": "stripe/stripe-java", "path": "src/main/java/com/stripe/param/PaymentIntentConfirmParams.java", "license": "mit", "size": 315067 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,063,033
private void initDiscovery() { if (discoveryServiceClient == null) { LOG.info("No DiscoveryServiceClient provided. Skipping service discovery."); return; } endpointStrategy = new TimeLimitEndpointStrategy( new RandomEndpointStrategy( discoveryServiceClient.discover( configuration.get(TxConstants.Service.CFG_DATA_TX_DISCOVERY_SERVICE_NAME, TxConstants.Service.DEFAULT_DATA_TX_DISCOVERY_SERVICE_NAME))), 2, TimeUnit.SECONDS); }
void function() { if (discoveryServiceClient == null) { LOG.info(STR); return; } endpointStrategy = new TimeLimitEndpointStrategy( new RandomEndpointStrategy( discoveryServiceClient.discover( configuration.get(TxConstants.Service.CFG_DATA_TX_DISCOVERY_SERVICE_NAME, TxConstants.Service.DEFAULT_DATA_TX_DISCOVERY_SERVICE_NAME))), 2, TimeUnit.SECONDS); }
/** * Initialize the service discovery client, we will reuse that * every time we need to create a new client. */
Initialize the service discovery client, we will reuse that every time we need to create a new client
initDiscovery
{ "repo_name": "anwar6953/incubator-tephra", "path": "tephra-core/src/main/java/org/apache/tephra/distributed/AbstractClientProvider.java", "license": "apache-2.0", "size": 7731 }
[ "java.util.concurrent.TimeUnit", "org.apache.tephra.TxConstants" ]
import java.util.concurrent.TimeUnit; import org.apache.tephra.TxConstants;
import java.util.concurrent.*; import org.apache.tephra.*;
[ "java.util", "org.apache.tephra" ]
java.util; org.apache.tephra;
1,715,943
public T lookupReturningNullIfNotFound(String name, ParseFieldMatcher parseFieldMatcher) { Tuple<ParseField, T> parseFieldAndValue = registry.get(name); if (parseFieldAndValue == null) { return null; } ParseField parseField = parseFieldAndValue.v1(); T value = parseFieldAndValue.v2(); boolean match = parseFieldMatcher.match(name, parseField); //this is always expected to match, ParseField is useful for deprecation warnings etc. here assert match : "ParseField did not match registered name [" + name + "][" + registryName + "]"; return value; }
T function(String name, ParseFieldMatcher parseFieldMatcher) { Tuple<ParseField, T> parseFieldAndValue = registry.get(name); if (parseFieldAndValue == null) { return null; } ParseField parseField = parseFieldAndValue.v1(); T value = parseFieldAndValue.v2(); boolean match = parseFieldMatcher.match(name, parseField); assert match : STR + name + "][" + registryName + "]"; return value; }
/** * Lookup a value from the registry by name while checking that the name matches the ParseField. * * @param name The name of the thing to look up. * @param parseFieldMatcher The parseFieldMatcher. This is used to resolve the {@link ParseFieldMatcher} and to build nice * error messages. * @return The value being looked up or null if it wasn't found. * @throws ParsingException if the named thing isn't in the registry or the name was deprecated and deprecated names aren't supported. */
Lookup a value from the registry by name while checking that the name matches the ParseField
lookupReturningNullIfNotFound
{ "repo_name": "mmaracic/elasticsearch", "path": "core/src/main/java/org/elasticsearch/common/xcontent/ParseFieldRegistry.java", "license": "apache-2.0", "size": 4399 }
[ "org.elasticsearch.common.ParseField", "org.elasticsearch.common.ParseFieldMatcher", "org.elasticsearch.common.collect.Tuple" ]
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseFieldMatcher; import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.*; import org.elasticsearch.common.collect.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
889,490
public void testParallelPropagationWithLocalCacheClosedAndRebuilt() throws Exception { Integer lnPort = (Integer)vm0.invoke(WANTestBase.class, "createFirstLocatorWithDSId", new Object[] { 1 }); Integer nyPort = (Integer)vm1.invoke(WANTestBase.class, "createFirstRemoteLocator", new Object[] { 2, lnPort }); vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort }); vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort }); vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm6.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm7.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm4.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm5.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm6.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm7.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm2.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", null, 1, 100, isOffHeap() }); vm3.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", null, 1, 100, isOffHeap() }); //before doing any puts, let the senders be running in order to ensure that //not a single event will be lost vm4.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_PR", 1000 }); vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] { testName + "_PR", 1000 }); //-------------------Close and rebuild local site --------------------------------- vm4.invoke(WANTestBase.class, "killSender", new Object[] {}); vm5.invoke(WANTestBase.class, "killSender", new Object[] {}); vm6.invoke(WANTestBase.class, "killSender", new Object[] {}); vm7.invoke(WANTestBase.class, "killSender", new Object[] {}); Integer regionSize = (Integer) vm2.invoke(WANTestBase.class, "getRegionSize", new Object[] {testName + "_PR" }); getLogWriter().info("Region size on remote is: " + regionSize); vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm4.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm5.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm6.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm7.invoke(WANTestBase.class, "createSender", new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm4.invoke(WANTestBase.class, "setRemoveFromQueueOnException", new Object[] { "ln", true }); vm5.invoke(WANTestBase.class, "setRemoveFromQueueOnException", new Object[] { "ln", true }); vm6.invoke(WANTestBase.class, "setRemoveFromQueueOnException", new Object[] { "ln", true }); vm7.invoke(WANTestBase.class, "setRemoveFromQueueOnException", new Object[] { "ln", true }); vm4.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm5.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm6.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm7.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm4.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); //------------------------------------------------------------------------------------ addExpectedException(EntryExistsException.class.getName()); addExpectedException(BatchException70.class.getName()); addExpectedException(ServerOperationException.class.getName()); vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName + "_PR", 1000 }); //verify all buckets drained on all sender nodes. vm4.invoke(WANTestBase.class, "validateParallelSenderQueueAllBucketsDrained", new Object[] {"ln"}); vm5.invoke(WANTestBase.class, "validateParallelSenderQueueAllBucketsDrained", new Object[] {"ln"}); vm6.invoke(WANTestBase.class, "validateParallelSenderQueueAllBucketsDrained", new Object[] {"ln"}); vm7.invoke(WANTestBase.class, "validateParallelSenderQueueAllBucketsDrained", new Object[] {"ln"}); vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] { testName + "_PR", 1000 }); vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] { testName + "_PR", 1000 }); }
void function() throws Exception { Integer lnPort = (Integer)vm0.invoke(WANTestBase.class, STR, new Object[] { 1 }); Integer nyPort = (Integer)vm1.invoke(WANTestBase.class, STR, new Object[] { 2, lnPort }); vm2.invoke(WANTestBase.class, STR, new Object[] { nyPort }); vm3.invoke(WANTestBase.class, STR, new Object[] { nyPort }); vm4.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm5.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm6.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm7.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm4.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm5.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm6.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm7.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm2.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", null, 1, 100, isOffHeap() }); vm3.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", null, 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm4.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", 1000 }); vm2.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", 1000 }); vm4.invoke(WANTestBase.class, STR, new Object[] {}); vm5.invoke(WANTestBase.class, STR, new Object[] {}); vm6.invoke(WANTestBase.class, STR, new Object[] {}); vm7.invoke(WANTestBase.class, STR, new Object[] {}); Integer regionSize = (Integer) vm2.invoke(WANTestBase.class, STR, new Object[] {testName + "_PR" }); getLogWriter().info(STR + regionSize); vm4.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm5.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm6.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm7.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, false, null, true }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln", true }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln", true }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln", true }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln", true }); vm4.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm5.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm6.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm7.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", "ln", 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); addExpectedException(EntryExistsException.class.getName()); addExpectedException(BatchException70.class.getName()); addExpectedException(ServerOperationException.class.getName()); vm4.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", 1000 }); vm4.invoke(WANTestBase.class, STR, new Object[] {"ln"}); vm5.invoke(WANTestBase.class, STR, new Object[] {"ln"}); vm6.invoke(WANTestBase.class, STR, new Object[] {"ln"}); vm7.invoke(WANTestBase.class, STR, new Object[] {"ln"}); vm2.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", 1000 }); vm3.invoke(WANTestBase.class, STR, new Object[] { testName + "_PR", 1000 }); }
/** * Local and remote sites are up and running. * Local site cache is closed and the site is built again. * Puts are done to local site. * Expected: Remote site should receive all the events put after the local * site was built back. * * @throws Exception */
Local and remote sites are up and running. Local site cache is closed and the site is built again. Puts are done to local site. Expected: Remote site should receive all the events put after the local site was built back
testParallelPropagationWithLocalCacheClosedAndRebuilt
{ "repo_name": "papicella/snappy-store", "path": "tests/core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPropogationDUnitTest.java", "license": "apache-2.0", "size": 75407 }
[ "com.gemstone.gemfire.cache.EntryExistsException", "com.gemstone.gemfire.cache.client.ServerOperationException", "com.gemstone.gemfire.internal.cache.wan.BatchException70", "com.gemstone.gemfire.internal.cache.wan.WANTestBase" ]
import com.gemstone.gemfire.cache.EntryExistsException; import com.gemstone.gemfire.cache.client.ServerOperationException; import com.gemstone.gemfire.internal.cache.wan.BatchException70; import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.*; import com.gemstone.gemfire.internal.cache.wan.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
2,817,015
public void setCacheMetrics(UUID nodeId, Map<Integer, CacheMetrics> metrics) { assert nodeId != null; assert metrics != null; assert !this.cacheMetrics.containsKey(nodeId); if (!F.isEmpty(metrics)) this.cacheMetrics.put(nodeId, metrics); }
void function(UUID nodeId, Map<Integer, CacheMetrics> metrics) { assert nodeId != null; assert metrics != null; assert !this.cacheMetrics.containsKey(nodeId); if (!F.isEmpty(metrics)) this.cacheMetrics.put(nodeId, metrics); }
/** * Sets cache metrics for particular node. * * @param nodeId Node ID. * @param metrics Node cache metrics. */
Sets cache metrics for particular node
setCacheMetrics
{ "repo_name": "ilantukh/ignite", "path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryMetricsUpdateMessage.java", "license": "apache-2.0", "size": 9861 }
[ "java.util.Map", "org.apache.ignite.cache.CacheMetrics", "org.apache.ignite.internal.util.typedef.F" ]
import java.util.Map; import org.apache.ignite.cache.CacheMetrics; import org.apache.ignite.internal.util.typedef.F;
import java.util.*; import org.apache.ignite.cache.*; import org.apache.ignite.internal.util.typedef.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
1,676,445
private void wrapOutput() throws SSLException { while (true) { int pending = _underlyingOutput.pending(); if (pending < 0) { _head_closed = true; } ByteBuffer clearOutputBuffer = _underlyingOutput.head(); SSLEngineResult result = _sslEngine.wrap(clearOutputBuffer, _outputBuffer); logEngineClientModeAndResult(result, "output"); int written = result.bytesConsumed(); _underlyingOutput.pop(written); pending = _underlyingOutput.pending(); Status status = result.getStatus(); switch (status) { case CLOSED: _head_closed = true; break; case OK: break; case BUFFER_OVERFLOW: ByteBuffer old = _outputBuffer; _outputBuffer = newWriteableBuffer(_outputBuffer.capacity()*2); _head = _outputBuffer.asReadOnlyBuffer(); old.flip(); _outputBuffer.put(old); continue; case BUFFER_UNDERFLOW: throw new IllegalStateException("app buffer underflow"); } HandshakeStatus hstatus = result.getHandshakeStatus(); switch (hstatus) { case NEED_UNWRAP: // wait for input data if (_inputBuffer.position() == 0 && _tail_closed) { _head_closed = true; } break; case NEED_WRAP: // keep looping continue; case NEED_TASK: runDelegatedTasks(result); continue; case FINISHED: updateCipherAndProtocolName(result); // intentionally fall through case NOT_HANDSHAKING: if (pending > 0 && status == Status.OK) { continue; } else { break; } } break; } }
void function() throws SSLException { while (true) { int pending = _underlyingOutput.pending(); if (pending < 0) { _head_closed = true; } ByteBuffer clearOutputBuffer = _underlyingOutput.head(); SSLEngineResult result = _sslEngine.wrap(clearOutputBuffer, _outputBuffer); logEngineClientModeAndResult(result, STR); int written = result.bytesConsumed(); _underlyingOutput.pop(written); pending = _underlyingOutput.pending(); Status status = result.getStatus(); switch (status) { case CLOSED: _head_closed = true; break; case OK: break; case BUFFER_OVERFLOW: ByteBuffer old = _outputBuffer; _outputBuffer = newWriteableBuffer(_outputBuffer.capacity()*2); _head = _outputBuffer.asReadOnlyBuffer(); old.flip(); _outputBuffer.put(old); continue; case BUFFER_UNDERFLOW: throw new IllegalStateException(STR); } HandshakeStatus hstatus = result.getHandshakeStatus(); switch (hstatus) { case NEED_UNWRAP: if (_inputBuffer.position() == 0 && _tail_closed) { _head_closed = true; } break; case NEED_WRAP: continue; case NEED_TASK: runDelegatedTasks(result); continue; case FINISHED: updateCipherAndProtocolName(result); case NOT_HANDSHAKING: if (pending > 0 && status == Status.OK) { continue; } else { break; } } break; } }
/** * Wrap the underlying transport's output, passing it to the output buffer. * * {@link #_outputBuffer} is assumed to be writeable on entry and is guaranteed to * be still writeable on exit. */
Wrap the underlying transport's output, passing it to the output buffer. <code>#_outputBuffer</code> is assumed to be writeable on entry and is guaranteed to be still writeable on exit
wrapOutput
{ "repo_name": "astitcher/qpid-proton-old", "path": "proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java", "license": "apache-2.0", "size": 13958 }
[ "java.nio.ByteBuffer", "javax.net.ssl.SSLEngineResult", "javax.net.ssl.SSLException", "org.apache.qpid.proton.engine.impl.ByteBufferUtils" ]
import java.nio.ByteBuffer; import javax.net.ssl.SSLEngineResult; import javax.net.ssl.SSLException; import org.apache.qpid.proton.engine.impl.ByteBufferUtils;
import java.nio.*; import javax.net.ssl.*; import org.apache.qpid.proton.engine.impl.*;
[ "java.nio", "javax.net", "org.apache.qpid" ]
java.nio; javax.net; org.apache.qpid;
1,404,893
public boolean shouldRedeliver(Exchange exchange, int redeliveryCounter, Predicate retryWhile) { // predicate is always used if provided if (retryWhile != null) { return retryWhile.matches(exchange); } if (getMaximumRedeliveries() < 0) { // retry forever if negative value return true; } // redeliver until we hit the max return redeliveryCounter <= getMaximumRedeliveries(); }
boolean function(Exchange exchange, int redeliveryCounter, Predicate retryWhile) { if (retryWhile != null) { return retryWhile.matches(exchange); } if (getMaximumRedeliveries() < 0) { return true; } return redeliveryCounter <= getMaximumRedeliveries(); }
/** * Returns true if the policy decides that the message exchange should be * redelivered. * * @param exchange the current exchange * @param redeliveryCounter the current retry counter * @param retryWhile an optional predicate to determine if we should redeliver or not * @return true to redeliver, false to stop */
Returns true if the policy decides that the message exchange should be redelivered
shouldRedeliver
{ "repo_name": "shuliangtao/apache-camel-2.13.0-src", "path": "camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java", "license": "apache-2.0", "size": 23881 }
[ "org.apache.camel.Exchange", "org.apache.camel.Predicate" ]
import org.apache.camel.Exchange; import org.apache.camel.Predicate;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
543,033
public String getNsNetwork(String nsNetwork, String element) throws ServiceException { if (nsNetwork == null || nsNetwork.isEmpty()) { logger.error("getNsNetwork: null nsNetwork " + element); throw ExceptionCodes.buildProviderException(ExceptionCodes.MISSING_PARAMETER, element, "<null>"); } return nsNetwork; }
String function(String nsNetwork, String element) throws ServiceException { if (nsNetwork == null nsNetwork.isEmpty()) { logger.error(STR + element); throw ExceptionCodes.buildProviderException(ExceptionCodes.MISSING_PARAMETER, element, STR); } return nsNetwork; }
/** * Extracts the requesterNSA or providerNSA element. * * @param nsNetwork the NsNetwork field to extract. * @param element the name of the element field for exception generation. * @return nsNetwork * @throws ServiceException */
Extracts the requesterNSA or providerNSA element
getNsNetwork
{ "repo_name": "jmacauley/OpenDRAC", "path": "Nsi/NsiServer/src/main/java/org/opendrac/nsi/endpoints/ConnectionServiceProvider.java", "license": "gpl-3.0", "size": 29447 }
[ "org.ogf.schemas.nsi._2011._10.connection.provider.ServiceException", "org.opendrac.nsi.util.ExceptionCodes" ]
import org.ogf.schemas.nsi._2011._10.connection.provider.ServiceException; import org.opendrac.nsi.util.ExceptionCodes;
import org.ogf.schemas.nsi.*; import org.opendrac.nsi.util.*;
[ "org.ogf.schemas", "org.opendrac.nsi" ]
org.ogf.schemas; org.opendrac.nsi;
601,212
boolean isStale() { if (slot != null) { // Check staleness by looking at the shared memory area we use to // communicate with the DataNode. boolean stale = !slot.isValid(); LOG.trace("{}: checked shared memory segment. isStale={}", this, stale); return stale; } else { // Fall back to old, time-based staleness method. long deltaMs = Time.monotonicNow() - creationTimeMs; long staleThresholdMs = cache.getStaleThresholdMs(); if (deltaMs > staleThresholdMs) { LOG.trace("{} is stale because it's {} ms old and staleThreadholdMS={}", this, deltaMs, staleThresholdMs); return true; } else { LOG.trace("{} is not stale because it's only {} ms old " + "and staleThresholdMs={}", this, deltaMs, staleThresholdMs); return false; } } }
boolean isStale() { if (slot != null) { boolean stale = !slot.isValid(); LOG.trace(STR, this, stale); return stale; } else { long deltaMs = Time.monotonicNow() - creationTimeMs; long staleThresholdMs = cache.getStaleThresholdMs(); if (deltaMs > staleThresholdMs) { LOG.trace(STR, this, deltaMs, staleThresholdMs); return true; } else { LOG.trace(STR + STR, this, deltaMs, staleThresholdMs); return false; } } }
/** * Check if the replica is stale. * * Must be called with the cache lock held. */
Check if the replica is stale. Must be called with the cache lock held
isStale
{ "repo_name": "apurtell/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/shortcircuit/ShortCircuitReplica.java", "license": "apache-2.0", "size": 9671 }
[ "org.apache.hadoop.util.Time" ]
import org.apache.hadoop.util.Time;
import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,678,653
public PropertyName getSourceProperty() { return sourceProperty; }
PropertyName function() { return sourceProperty; }
/** * Returns the source property. * @return the source property */
Returns the source property
getSourceProperty
{ "repo_name": "asakusafw/asakusafw-compiler", "path": "compiler-project/analyzer/src/main/java/com/asakusafw/lang/compiler/analyzer/util/PropertyMapping.java", "license": "apache-2.0", "size": 2786 }
[ "com.asakusafw.lang.compiler.model.PropertyName" ]
import com.asakusafw.lang.compiler.model.PropertyName;
import com.asakusafw.lang.compiler.model.*;
[ "com.asakusafw.lang" ]
com.asakusafw.lang;
478,551
void injectDigest(ActionInput output, FileStatus statNoFollow, byte[] digest);
void injectDigest(ActionInput output, FileStatus statNoFollow, byte[] digest);
/** * Injects provided digest into the metadata handler, simultaneously caching lstat() data as well. */
Injects provided digest into the metadata handler, simultaneously caching lstat() data as well
injectDigest
{ "repo_name": "dslomov/bazel-windows", "path": "src/main/java/com/google/devtools/build/lib/actions/cache/MetadataInjector.java", "license": "apache-2.0", "size": 2601 }
[ "com.google.devtools.build.lib.actions.ActionInput", "com.google.devtools.build.lib.vfs.FileStatus" ]
import com.google.devtools.build.lib.actions.ActionInput; import com.google.devtools.build.lib.vfs.FileStatus;
import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.vfs.*;
[ "com.google.devtools" ]
com.google.devtools;
271,827
public final static <T> void resetDataModelFieldsValue(T pDataModel){ //Loop nos tributos do classe if (pDataModel != null){ for (Field xField:pDataModel.getClass().getDeclaredFields()){ xField.setAccessible(true); try { xField.set(pDataModel, null); } catch (SecurityException | IllegalAccessException e) { wLogger.error("resetDataModelFieldsValue",e); } } } } //######################################################################################################### //## Private Methods # //######################################################################################################### // // public static <T> int executeDataModelCommand(T pDataModel, T pDataModelValueOriginal, Connection pCn, COMMAND pDAOCommand) throws DBSIOException{ // //Procura pela anotação DataModel para posteriomente ler o nome da tabela // Annotation xAnnotationTmp = pDataModel.getClass().getAnnotation(DataModel.class); // if (xAnnotationTmp instanceof DataModel){ // DataModel xAnnotation = (DataModel) xAnnotationTmp; // //Se o nome da tabela foi informado // if (!DBSObject.isEmpty(xAnnotation.tablename())){ // return executeDataModelCommand(pDataModel, pDataModelValueOriginal, pCn, pDAOCommand, xAnnotation.tablename(), ""); // } // } // return -1; // }
final static <T> void function(T pDataModel){ if (pDataModel != null){ for (Field xField:pDataModel.getClass().getDeclaredFields()){ xField.setAccessible(true); try { xField.set(pDataModel, null); } catch (SecurityException IllegalAccessException e) { wLogger.error(STR,e); } } } }
/** * Reseta valores da datamodel * @param pDataModel */
Reseta valores da datamodel
resetDataModelFieldsValue
{ "repo_name": "dbsoftcombr/dbssdk", "path": "src/main/java/br/com/dbsoft/util/DBSIO.java", "license": "mit", "size": 128088 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,459,490
public List<SubResource> loadBalancerInboundNatPools() { return this.innerProperties() == null ? null : this.innerProperties().loadBalancerInboundNatPools(); }
List<SubResource> function() { return this.innerProperties() == null ? null : this.innerProperties().loadBalancerInboundNatPools(); }
/** * Get the loadBalancerInboundNatPools property: The load balancer inbound nat pools. * * @return the loadBalancerInboundNatPools value. */
Get the loadBalancerInboundNatPools property: The load balancer inbound nat pools
loadBalancerInboundNatPools
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetUpdateIpConfiguration.java", "license": "mit", "size": 10874 }
[ "com.azure.core.management.SubResource", "java.util.List" ]
import com.azure.core.management.SubResource; import java.util.List;
import com.azure.core.management.*; import java.util.*;
[ "com.azure.core", "java.util" ]
com.azure.core; java.util;
1,308,353
public void readConfig() { logger.log(LogLevel.DEBUG, "reading state mapping for: " + this.getClass().getSimpleName() + "_" + name); stateMap = new EnumMap<MachineState, ComponentState>(MachineState.class); if (name != null) { try { SimulationConfigReader scr = null; try { scr = getSimulationConfigReader(); } catch (Exception e) { e.printStackTrace(); } for (MachineState ms : MachineState.values()) stateMap.put(ms, scr.getComponentState(ms.name())); } catch (Exception e) { e.printStackTrace(); } } }
void function() { logger.log(LogLevel.DEBUG, STR + this.getClass().getSimpleName() + "_" + name); stateMap = new EnumMap<MachineState, ComponentState>(MachineState.class); if (name != null) { try { SimulationConfigReader scr = null; try { scr = getSimulationConfigReader(); } catch (Exception e) { e.printStackTrace(); } for (MachineState ms : MachineState.values()) stateMap.put(ms, scr.getComponentState(ms.name())); } catch (Exception e) { e.printStackTrace(); } } }
/** * reads the machine states and maps them to simulation states */
reads the machine states and maps them to simulation states
readConfig
{ "repo_name": "sizuest/EMod", "path": "ch.ethz.inspire.emod/src/ch/ethz/inspire/emod/simulation/ASimulationControl.java", "license": "gpl-3.0", "size": 4794 }
[ "ch.ethz.inspire.emod.LogLevel", "ch.ethz.inspire.emod.utils.SimulationConfigReader", "java.util.EnumMap" ]
import ch.ethz.inspire.emod.LogLevel; import ch.ethz.inspire.emod.utils.SimulationConfigReader; import java.util.EnumMap;
import ch.ethz.inspire.emod.*; import ch.ethz.inspire.emod.utils.*; import java.util.*;
[ "ch.ethz.inspire", "java.util" ]
ch.ethz.inspire; java.util;
1,143,373
private HttpGet createGetSubscriberDetailsRequest(String callingNumber, String operator, String circle, String callId) { StringBuilder sb = new StringBuilder(String.format( "http://localhost:%d/api/kilkari/user?", TestContext.getJettyPort())); String sep = ""; if (callingNumber != null) { sb.append(String.format("callingNumber=%s", callingNumber)); sep = "&"; } if (operator != null) { sb.append(String.format("%soperator=%s", sep, operator)); sep = "&"; } if (circle != null) { sb.append(String.format("%scircle=%s", sep, circle)); sep = "&"; } if (callId != null) { sb.append(String.format("%scallId=%s", sep, callId)); sep = "&"; } return new HttpGet(sb.toString()); }
HttpGet function(String callingNumber, String operator, String circle, String callId) { StringBuilder sb = new StringBuilder(String.format( STRSTRcallingNumber=%sSTR&STR%soperator=%sSTR&STR%scircle=%sSTR&STR%scallId=%sSTR&"; } return new HttpGet(sb.toString()); }
/** * This method is a utility method for running the test cases. */
This method is a utility method for running the test cases
createGetSubscriberDetailsRequest
{ "repo_name": "ngraczewski/mim", "path": "testing/src/test/java/org/motechproject/nms/testing/it/api/KilkariControllerBundleIT.java", "license": "bsd-3-clause", "size": 193191 }
[ "org.apache.http.client.methods.HttpGet" ]
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.*;
[ "org.apache.http" ]
org.apache.http;
2,469,265
public void init(IWorkbench workbench) { // BundleContext bundleContext = Platform.getBundle("org.bbaw.bts.ui.main").getBundleContext(); context = StaticAccessController.getContext(); projectController = context.get(BTSProjectController.class); prefs = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.app"); main_lemmaList = prefs.get(BTSPluginIDs.PREF_MAIN_LEMMALIST_KEY, prefs.get(BTSPluginIDs.PREF_MAIN_PROJECT_KEY, null)); active_lemmaLists = prefs.get(BTSPluginIDs.PREF_ACTIVE_LEMMALISTS, prefs.get(BTSPluginIDs.PREF_ACTIVE_PROJECTS, null)); logger = context.get(Logger.class); loadListInput(); }
void function(IWorkbench workbench) { context = StaticAccessController.getContext(); projectController = context.get(BTSProjectController.class); prefs = ConfigurationScope.INSTANCE.getNode(STR); main_lemmaList = prefs.get(BTSPluginIDs.PREF_MAIN_LEMMALIST_KEY, prefs.get(BTSPluginIDs.PREF_MAIN_PROJECT_KEY, null)); active_lemmaLists = prefs.get(BTSPluginIDs.PREF_ACTIVE_LEMMALISTS, prefs.get(BTSPluginIDs.PREF_ACTIVE_PROJECTS, null)); logger = context.get(Logger.class); loadListInput(); }
/** * Initialize the preference page. */
Initialize the preference page
init
{ "repo_name": "JKatzwinkel/bts", "path": "org.bbaw.bts.ui.corpus/src/org/bbaw/bts/ui/corpus/preferences/LemmaListSettingsPage.java", "license": "lgpl-3.0", "size": 8899 }
[ "org.bbaw.bts.commons.BTSPluginIDs", "org.bbaw.bts.core.commons.staticAccess.StaticAccessController", "org.bbaw.bts.core.controller.generalController.BTSProjectController", "org.eclipse.core.runtime.preferences.ConfigurationScope", "org.eclipse.e4.core.services.log.Logger", "org.eclipse.ui.IWorkbench" ]
import org.bbaw.bts.commons.BTSPluginIDs; import org.bbaw.bts.core.commons.staticAccess.StaticAccessController; import org.bbaw.bts.core.controller.generalController.BTSProjectController; import org.eclipse.core.runtime.preferences.ConfigurationScope; import org.eclipse.e4.core.services.log.Logger; import org.eclipse.ui.IWorkbench;
import org.bbaw.bts.commons.*; import org.bbaw.bts.core.commons.*; import org.bbaw.bts.core.controller.*; import org.eclipse.core.runtime.preferences.*; import org.eclipse.e4.core.services.log.*; import org.eclipse.ui.*;
[ "org.bbaw.bts", "org.eclipse.core", "org.eclipse.e4", "org.eclipse.ui" ]
org.bbaw.bts; org.eclipse.core; org.eclipse.e4; org.eclipse.ui;
1,291,643
public long reduceToLong(long parallelismThreshold, ToLongBiFunction<? super K, ? super V> transformer, long basis, LongBinaryOperator reducer) { if (transformer == null || reducer == null) throw new NullPointerException(); return new MapReduceMappingsToLongTask<K,V> (null, batchFor(parallelismThreshold), 0, 0, table, null, transformer, basis, reducer).invoke(); }
long function(long parallelismThreshold, ToLongBiFunction<? super K, ? super V> transformer, long basis, LongBinaryOperator reducer) { if (transformer == null reducer == null) throw new NullPointerException(); return new MapReduceMappingsToLongTask<K,V> (null, batchFor(parallelismThreshold), 0, 0, table, null, transformer, basis, reducer).invoke(); }
/** * Returns the result of accumulating the given transformation * of all (key, value) pairs using the given reducer to * combine values, and the given basis as an identity value. * * @param parallelismThreshold the (estimated) number of elements * needed for this operation to be executed in parallel * @param transformer a function returning the transformation * for an element * @param basis the identity (initial default value) for the reduction * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all (key, value) pairs * @since 1.8 */
Returns the result of accumulating the given transformation of all (key, value) pairs using the given reducer to combine values, and the given basis as an identity value
reduceToLong
{ "repo_name": "GaryWKeim/ehcache3", "path": "impl/src/unsafe/java/org/ehcache/impl/internal/concurrent/ConcurrentHashMap.java", "license": "apache-2.0", "size": 274219 }
[ "java.util.function.LongBinaryOperator", "java.util.function.ToLongBiFunction" ]
import java.util.function.LongBinaryOperator; import java.util.function.ToLongBiFunction;
import java.util.function.*;
[ "java.util" ]
java.util;
1,596,840
List<BannedIps> selectByExample(BannedIpsExample example);
List<BannedIps> selectByExample(BannedIpsExample example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table public.banned_ips * * @mbggenerated Sun Apr 10 19:05:37 CST 2016 */
This method was generated by MyBatis Generator. This method corresponds to the database table public.banned_ips
selectByExample
{ "repo_name": "zjlywjh001/PhrackCTF-Platform-Personal", "path": "src/main/java/top/phrack/ctf/models/dao/BannedIpsMapper.java", "license": "apache-2.0", "size": 3145 }
[ "java.util.List", "top.phrack.ctf.pojo.BannedIps", "top.phrack.ctf.pojo.BannedIpsExample" ]
import java.util.List; import top.phrack.ctf.pojo.BannedIps; import top.phrack.ctf.pojo.BannedIpsExample;
import java.util.*; import top.phrack.ctf.pojo.*;
[ "java.util", "top.phrack.ctf" ]
java.util; top.phrack.ctf;
1,963,797
public static void parse(Form form, String parametersString, CharacterSet characterSet, boolean decode, char separator) { if ((parametersString != null) && !parametersString.equals("")) { FormReader fr = null; if (decode) { fr = new FormReader(parametersString, characterSet, separator); } else { fr = new FormReader(parametersString, separator); } fr.addParameters(form); } } private FormUtils() { }
static void function(Form form, String parametersString, CharacterSet characterSet, boolean decode, char separator) { if ((parametersString != null) && !parametersString.equals("")) { FormReader fr = null; if (decode) { fr = new FormReader(parametersString, characterSet, separator); } else { fr = new FormReader(parametersString, separator); } fr.addParameters(form); } } private FormUtils() { }
/** * Parses a parameters string into a given form. * * @param form * The target form. * @param parametersString * The parameters string. * @param characterSet * The supported character encoding. * @param decode * Indicates if the query parameters should be decoded using the * given character set. * @param separator * The separator character to append between parameters. */
Parses a parameters string into a given form
parse
{ "repo_name": "theanuradha/debrief", "path": "org.mwc.asset.comms/docs/restlet_src/org.restlet/org/restlet/engine/util/FormUtils.java", "license": "epl-1.0", "size": 10893 }
[ "org.restlet.data.CharacterSet", "org.restlet.data.Form" ]
import org.restlet.data.CharacterSet; import org.restlet.data.Form;
import org.restlet.data.*;
[ "org.restlet.data" ]
org.restlet.data;
2,565,102
public String getPortletTitle(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response);
String function(IPortletWindowId portletWindowId, HttpServletRequest request, HttpServletResponse response);
/** * Gets the title for the specified portlet */
Gets the title for the specified portlet
getPortletTitle
{ "repo_name": "drewwills/uPortal", "path": "uportal-war/src/main/java/org/jasig/portal/portlet/rendering/IPortletExecutionManager.java", "license": "apache-2.0", "size": 6623 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.jasig.portal.portlet.om.IPortletWindowId" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jasig.portal.portlet.om.IPortletWindowId;
import javax.servlet.http.*; import org.jasig.portal.portlet.om.*;
[ "javax.servlet", "org.jasig.portal" ]
javax.servlet; org.jasig.portal;
1,988,882
public static void shutdownAll() { HazelcastInstanceFactory.shutdownAll(); }
static void function() { HazelcastInstanceFactory.shutdownAll(); }
/** * Shuts down all running Hazelcast Instances on this JVM. * It doesn't shutdown all members of the * cluster but just the ones running on this JVM. * * @see #newHazelcastInstance(Config) */
Shuts down all running Hazelcast Instances on this JVM. It doesn't shutdown all members of the cluster but just the ones running on this JVM
shutdownAll
{ "repo_name": "lmjacksoniii/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/core/Hazelcast.java", "license": "apache-2.0", "size": 5673 }
[ "com.hazelcast.instance.HazelcastInstanceFactory" ]
import com.hazelcast.instance.HazelcastInstanceFactory;
import com.hazelcast.instance.*;
[ "com.hazelcast.instance" ]
com.hazelcast.instance;
1,202,935
public File getStoragePath(String trackName) throws IOException { String timestamp = new SimpleDateFormat("yyyy-MM-dd_km").format(new Date()); String fileName = String.format("%s_%s.gpx", timestamp, track.getName()); File file; if(isExternalStorageWritable()) { // not working on KitKat and later versions file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), APP_DIR); Log.i(TAG, "Writing file to external public storage: " + file.getAbsolutePath()); } else { file = new File(context.getFilesDir(), APP_DIR); Log.i(TAG, "Writing file to internal storage: " + file.getAbsolutePath()); } file.mkdirs(); return new File(file, fileName); }
File function(String trackName) throws IOException { String timestamp = new SimpleDateFormat(STR).format(new Date()); String fileName = String.format(STR, timestamp, track.getName()); File file; if(isExternalStorageWritable()) { file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), APP_DIR); Log.i(TAG, STR + file.getAbsolutePath()); } else { file = new File(context.getFilesDir(), APP_DIR); Log.i(TAG, STR + file.getAbsolutePath()); } file.mkdirs(); return new File(file, fileName); }
/** * Gets a handle to a gpx file in the external/internal storage dir. * Creates path to file if not present. * * @param trackName the track name * @return the storage file */
Gets a handle to a gpx file in the external/internal storage dir. Creates path to file if not present
getStoragePath
{ "repo_name": "schocco/mds-droid", "path": "app/src/main/java/info/muni_scale/mdsdroid/gpx/GpxFileWriter.java", "license": "mit", "size": 7520 }
[ "android.os.Environment", "android.util.Log", "java.io.File", "java.io.IOException", "java.text.SimpleDateFormat", "java.util.Date" ]
import android.os.Environment; import android.util.Log; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date;
import android.os.*; import android.util.*; import java.io.*; import java.text.*; import java.util.*;
[ "android.os", "android.util", "java.io", "java.text", "java.util" ]
android.os; android.util; java.io; java.text; java.util;
2,452,705
private static String getClassFromDeclarationName(String specName) throws InvalidRequirementSpec { String tmp = removeTypeDecl(specName); String[] parts = tmp.split("\\.prototype\\."); Preconditions.checkState(parts.length == 1 || parts.length == 2); if (parts.length == 2) { return parts[0]; } return null; }
static String function(String specName) throws InvalidRequirementSpec { String tmp = removeTypeDecl(specName); String[] parts = tmp.split(STR); Preconditions.checkState(parts.length == 1 parts.length == 2); if (parts.length == 2) { return parts[0]; } return null; }
/** * From a provide name extract the class name. */
From a provide name extract the class name
getClassFromDeclarationName
{ "repo_name": "jimmytuc/closure-compiler", "path": "src/com/google/javascript/jscomp/ConformanceRules.java", "license": "apache-2.0", "size": 50823 }
[ "com.google.common.base.Preconditions", "com.google.javascript.jscomp.CheckConformance" ]
import com.google.common.base.Preconditions; import com.google.javascript.jscomp.CheckConformance;
import com.google.common.base.*; import com.google.javascript.jscomp.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
352,459
public BigDecimal getBigDecimal(int index) throws JSONException { Object object = this.get(index); try { return new BigDecimal(object.toString()); } catch (Exception e) { throw new JSONException("JSONArray[" + index + "] could not convert to BigDecimal."); } }
BigDecimal function(int index) throws JSONException { Object object = this.get(index); try { return new BigDecimal(object.toString()); } catch (Exception e) { throw new JSONException(STR + index + STR); } }
/** * Get the BigDecimal value associated with an index. * * @param index * The index must be between 0 and length() - 1. * @return The value. * @throws JSONException * If the key is not found or if the value cannot be converted * to a BigDecimal. */
Get the BigDecimal value associated with an index
getBigDecimal
{ "repo_name": "simplity/simplity", "path": "simplity/core/src/main/java/org/simplity/json/JSONArray.java", "license": "mit", "size": 35739 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
484,404
protected void doUnregister(ObjectName objectName) { try { // MBean might already have been unregistered by an external process. if (this.server.isRegistered(objectName)) { this.server.unregisterMBean(objectName); onUnregister(objectName); } else { if (logger.isWarnEnabled()) { logger.warn("Could not unregister MBean [" + objectName + "] as said MBean " + "is not registered (perhaps already unregistered by an external process)"); } } } catch (JMException ex) { if (logger.isErrorEnabled()) { logger.error("Could not unregister MBean [" + objectName + "]", ex); } } }
void function(ObjectName objectName) { try { if (this.server.isRegistered(objectName)) { this.server.unregisterMBean(objectName); onUnregister(objectName); } else { if (logger.isWarnEnabled()) { logger.warn(STR + objectName + STR + STR); } } } catch (JMException ex) { if (logger.isErrorEnabled()) { logger.error(STR + objectName + "]", ex); } } }
/** * Actually unregister the specified MBean from the server. * @param objectName the suggested ObjectName for the MBean */
Actually unregister the specified MBean from the server
doUnregister
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/jmx/support/MBeanRegistrationSupport.java", "license": "unlicense", "size": 10020 }
[ "javax.management.JMException", "javax.management.ObjectName" ]
import javax.management.JMException; import javax.management.ObjectName;
import javax.management.*;
[ "javax.management" ]
javax.management;
28,577
EAttribute getHasTurned_Angle();
EAttribute getHasTurned_Angle();
/** * Returns the meta object for the attribute '{@link robotG.robot.HasTurned#getAngle <em>Angle</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Angle</em>'. * @see robotG.robot.HasTurned#getAngle() * @see #getHasTurned() * @generated */
Returns the meta object for the attribute '<code>robotG.robot.HasTurned#getAngle Angle</code>'.
getHasTurned_Angle
{ "repo_name": "bseznec/TP4INFO", "path": "IDM/IDM/src/robotG/robot/RobotPackage.java", "license": "gpl-3.0", "size": 24851 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
71,101
public void drop(List<String> types, Map<String, String> data, String dropEffect);
void function(List<String> types, Map<String, String> data, String dropEffect);
/** * Called when drop event happens on client side. * * @param types * List of data types from {@code DataTransfer.types} object. * @param data * Map containing all types and corresponding data from the {@code * DataTransfer} object. * @param dropEffect * The desired drop effect. */
Called when drop event happens on client side
drop
{ "repo_name": "kironapublic/vaadin", "path": "shared/src/main/java/com/vaadin/shared/ui/dnd/DropTargetRpc.java", "license": "apache-2.0", "size": 1395 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,464,362
private Collection<CmsAccessControlEntry> getAces(CmsUUID principalId) throws CmsException { if (m_ace == null) { m_ace = ArrayListMultimap.create(); List<CmsAccessControlEntry> entries = m_cms.getAllAccessControlEntries(); for (CmsAccessControlEntry entry : entries) { m_ace.put(entry.getPrincipal(), entry); } } return m_ace.get(principalId); }
Collection<CmsAccessControlEntry> function(CmsUUID principalId) throws CmsException { if (m_ace == null) { m_ace = ArrayListMultimap.create(); List<CmsAccessControlEntry> entries = m_cms.getAllAccessControlEntries(); for (CmsAccessControlEntry entry : entries) { m_ace.put(entry.getPrincipal(), entry); } } return m_ace.get(principalId); }
/** * Gets the access control entries for a given principal id.<p> * * @param principalId the principal id * @return the access control entries for that principal id * * @throws CmsException if something goes wrong */
Gets the access control entries for a given principal id
getAces
{ "repo_name": "victos/opencms-core", "path": "src-modules/org/opencms/workplace/tools/accounts/CmsAllPrincipalDependenciesList.java", "license": "lgpl-2.1", "size": 17794 }
[ "com.google.common.collect.ArrayListMultimap", "java.util.Collection", "java.util.List", "org.opencms.main.CmsException", "org.opencms.security.CmsAccessControlEntry", "org.opencms.util.CmsUUID" ]
import com.google.common.collect.ArrayListMultimap; import java.util.Collection; import java.util.List; import org.opencms.main.CmsException; import org.opencms.security.CmsAccessControlEntry; import org.opencms.util.CmsUUID;
import com.google.common.collect.*; import java.util.*; import org.opencms.main.*; import org.opencms.security.*; import org.opencms.util.*;
[ "com.google.common", "java.util", "org.opencms.main", "org.opencms.security", "org.opencms.util" ]
com.google.common; java.util; org.opencms.main; org.opencms.security; org.opencms.util;
2,892,547
public DockerClientConfigBuilder withProperties(Properties p) { return withUri(p.getProperty(DOCKER_IO_URL_PROPERTY)) .withVersion(p.getProperty(DOCKER_IO_VERSION_PROPERTY)) .withUsername(p.getProperty(DOCKER_IO_USERNAME_PROPERTY)) .withPassword(p.getProperty(DOCKER_IO_PASSWORD_PROPERTY)) .withHttpUsername(p.getProperty(DOCKER_IO_HTTP_USERNAME_PROPERTY)) .withHttpPassword(p.getProperty(DOCKER_IO_HTTP_PASSWORD_PROPERTY)) .withEmail(p.getProperty(DOCKER_IO_EMAIL_PROPERTY)) .withServerAddress(p.getProperty(DOCKER_IO_SERVER_ADDRESS_PROPERTY)) .withReadTimeout(Integer.valueOf(p.getProperty(DOCKER_IO_READ_TIMEOUT_PROPERTY, "0"))) .withLoggingFilter(Boolean.valueOf(p.getProperty(DOCKER_IO_ENABLE_LOGGING_FILTER_PROPERTY, "true"))) .withDockerCertPath(p.getProperty(DOCKER_IO_DOCKER_CERT_PATH_PROPERTY)) .withDockerCfgPath(p.getProperty(DOCKER_IO_DOCKER_CFG_PATH_PROPERTY)) .withMaxPerRouteConnections(Integer.valueOf(p.getProperty(DOCKER_IO_MAX_PER_ROUTE_PROPERTY, "2"))) .withMaxTotalConnections(Integer.valueOf(p.getProperty(DOCKER_IO_MAX_TOTAL_PROPERTY, "20"))) ; }
DockerClientConfigBuilder function(Properties p) { return withUri(p.getProperty(DOCKER_IO_URL_PROPERTY)) .withVersion(p.getProperty(DOCKER_IO_VERSION_PROPERTY)) .withUsername(p.getProperty(DOCKER_IO_USERNAME_PROPERTY)) .withPassword(p.getProperty(DOCKER_IO_PASSWORD_PROPERTY)) .withHttpUsername(p.getProperty(DOCKER_IO_HTTP_USERNAME_PROPERTY)) .withHttpPassword(p.getProperty(DOCKER_IO_HTTP_PASSWORD_PROPERTY)) .withEmail(p.getProperty(DOCKER_IO_EMAIL_PROPERTY)) .withServerAddress(p.getProperty(DOCKER_IO_SERVER_ADDRESS_PROPERTY)) .withReadTimeout(Integer.valueOf(p.getProperty(DOCKER_IO_READ_TIMEOUT_PROPERTY, "0"))) .withLoggingFilter(Boolean.valueOf(p.getProperty(DOCKER_IO_ENABLE_LOGGING_FILTER_PROPERTY, "true"))) .withDockerCertPath(p.getProperty(DOCKER_IO_DOCKER_CERT_PATH_PROPERTY)) .withDockerCfgPath(p.getProperty(DOCKER_IO_DOCKER_CFG_PATH_PROPERTY)) .withMaxPerRouteConnections(Integer.valueOf(p.getProperty(DOCKER_IO_MAX_PER_ROUTE_PROPERTY, "2"))) .withMaxTotalConnections(Integer.valueOf(p.getProperty(DOCKER_IO_MAX_TOTAL_PROPERTY, "20"))) ; }
/** * This will set all fields in the builder to those contained in the Properties object. The Properties object * should contain the following docker.io.* keys: url, version, username, password, email, dockerCertPath, and * dockerCfgPath. If docker.io.readTimeout or docker.io.enableLoggingFilter are not contained, they will be set * to 1000 and true, respectively. */
This will set all fields in the builder to those contained in the Properties object. The Properties object should contain the following docker.io.* keys: url, version, username, password, email, dockerCertPath, and dockerCfgPath. If docker.io.readTimeout or docker.io.enableLoggingFilter are not contained, they will be set to 1000 and true, respectively
withProperties
{ "repo_name": "SpazioDati/docker-java", "path": "src/main/java/com/github/dockerjava/core/DockerClientConfig.java", "license": "apache-2.0", "size": 21022 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
742,847
@Test public void testGroupCount() { KeyToGroupMap m1 = new KeyToGroupMap("Default Group"); // a new map always has 1 group (the default group) assertEquals(1, m1.getGroupCount()); // if the default group is not mapped to, it should still count towards // the group count... m1.mapKeyToGroup("C1", "G1"); assertEquals(2, m1.getGroupCount()); // now when the default group is mapped to, it shouldn't increase the // group count... m1.mapKeyToGroup("C2", "Default Group"); assertEquals(2, m1.getGroupCount()); // complicate things a little... m1.mapKeyToGroup("C3", "Default Group"); m1.mapKeyToGroup("C4", "G2"); m1.mapKeyToGroup("C5", "G2"); m1.mapKeyToGroup("C6", "Default Group"); assertEquals(3, m1.getGroupCount()); // now overwrite group "G2"... m1.mapKeyToGroup("C4", "G1"); m1.mapKeyToGroup("C5", "G1"); assertEquals(2, m1.getGroupCount()); }
void function() { KeyToGroupMap m1 = new KeyToGroupMap(STR); assertEquals(1, m1.getGroupCount()); m1.mapKeyToGroup("C1", "G1"); assertEquals(2, m1.getGroupCount()); m1.mapKeyToGroup("C2", STR); assertEquals(2, m1.getGroupCount()); m1.mapKeyToGroup("C3", STR); m1.mapKeyToGroup("C4", "G2"); m1.mapKeyToGroup("C5", "G2"); m1.mapKeyToGroup("C6", STR); assertEquals(3, m1.getGroupCount()); m1.mapKeyToGroup("C4", "G1"); m1.mapKeyToGroup("C5", "G1"); assertEquals(2, m1.getGroupCount()); }
/** * Tests that the getGroupCount() method returns the correct values under * various circumstances. */
Tests that the getGroupCount() method returns the correct values under various circumstances
testGroupCount
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/test/java/org/jfree/data/KeyToGroupMapTest.java", "license": "lgpl-2.1", "size": 9077 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,913,743
boolean shouldLog(); } public static final LogAction DO_NOT_LOG = new NoLogAction(); private static final String DEFAULT_RECORDER_NAME = "__DEFAULT_RECORDER_NAME__"; private final long minLogPeriodMs; private String primaryRecorderName; private final Timer timer; private final Map<String, LoggingAction> currentLogs; private long lastLogTimestampMs = Long.MIN_VALUE; public LogThrottlingHelper(long minLogPeriodMs) { this(minLogPeriodMs, null); } public LogThrottlingHelper(long minLogPeriodMs, String primaryRecorderName) { this(minLogPeriodMs, primaryRecorderName, new Timer()); } @VisibleForTesting LogThrottlingHelper(long minLogPeriodMs, String primaryRecorderName, Timer timer) { this.minLogPeriodMs = minLogPeriodMs; this.primaryRecorderName = primaryRecorderName; this.timer = timer; this.currentLogs = new HashMap<>(); }
boolean shouldLog(); } public static final LogAction DO_NOT_LOG = new NoLogAction(); private static final String DEFAULT_RECORDER_NAME = STR; private final long minLogPeriodMs; private String primaryRecorderName; private final Timer timer; private final Map<String, LoggingAction> currentLogs; private long lastLogTimestampMs = Long.MIN_VALUE; public LogThrottlingHelper(long minLogPeriodMs) { this(minLogPeriodMs, null); } public LogThrottlingHelper(long minLogPeriodMs, String primaryRecorderName) { this(minLogPeriodMs, primaryRecorderName, new Timer()); } LogThrottlingHelper(long minLogPeriodMs, String primaryRecorderName, Timer timer) { this.minLogPeriodMs = minLogPeriodMs; this.primaryRecorderName = primaryRecorderName; this.timer = timer; this.currentLogs = new HashMap<>(); }
/** * If this is true, the caller should write to its log. Otherwise, the * caller should take no action, and it is an error to call other methods * on this object. */
If this is true, the caller should write to its log. Otherwise, the caller should take no action, and it is an error to call other methods on this object
shouldLog
{ "repo_name": "apurtell/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/log/LogThrottlingHelper.java", "license": "apache-2.0", "size": 14562 }
[ "java.util.HashMap", "java.util.Map", "org.apache.hadoop.util.Timer" ]
import java.util.HashMap; import java.util.Map; import org.apache.hadoop.util.Timer;
import java.util.*; import org.apache.hadoop.util.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
632,182
@Override public Adapter createMMESPDeployedDeviceAdapter() { if (mmespDeployedDeviceItemProvider == null) { mmespDeployedDeviceItemProvider = new MMESPDeployedDeviceItemProvider(this); } return mmespDeployedDeviceItemProvider; } protected MMESPDeploymentAlternativeItemProvider mmespDeploymentAlternativeItemProvider;
Adapter function() { if (mmespDeployedDeviceItemProvider == null) { mmespDeployedDeviceItemProvider = new MMESPDeployedDeviceItemProvider(this); } return mmespDeployedDeviceItemProvider; } protected MMESPDeploymentAlternativeItemProvider mmespDeploymentAlternativeItemProvider;
/** * This creates an adapter for a {@link es.uah.aut.srg.micobs.mesp.mespdep.MMESPDeployedDevice}. * @generated */
This creates an adapter for a <code>es.uah.aut.srg.micobs.mesp.mespdep.MMESPDeployedDevice</code>
createMMESPDeployedDeviceAdapter
{ "repo_name": "parraman/micobs", "path": "mesp/es.uah.aut.srg.micobs.mesp/src/es/uah/aut/srg/micobs/mesp/mespdep/provider/mespdepItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 10846 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,402,073
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeInt(size()); Iterator<?> it = new ArrayDequeIterator<E>(); while (it.hasNext()) { stream.writeObject(it.next()); } }
void function(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeInt(size()); Iterator<?> it = new ArrayDequeIterator<E>(); while (it.hasNext()) { stream.writeObject(it.next()); } }
/** * Serialization method. * * @param stream * the ObjectOutputStream * @serialData The current size of the deque, followed by all the elements * from head to tail. * @throws IOException * */
Serialization method
writeObject
{ "repo_name": "webos21/xi", "path": "java/jcl/src/java/java/util/ArrayDeque.java", "license": "apache-2.0", "size": 21515 }
[ "java.io.IOException", "java.io.ObjectOutputStream" ]
import java.io.IOException; import java.io.ObjectOutputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,682,087
public final HashMap<String, String> getMetadata() { return this.metadata; }
final HashMap<String, String> function() { return this.metadata; }
/** * Returns the metadata for the blob. * * @return A <code>java.util.HashMap</code> object that represents the metadata for the blob. */
Returns the metadata for the blob
getMetadata
{ "repo_name": "esummers-msft/azure-storage-java", "path": "microsoft-azure-storage/src/com/microsoft/azure/storage/blob/CloudBlob.java", "license": "apache-2.0", "size": 133882 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,260,200
private List<Realm> resolveRealms() { List<Realm> result = Lists.newArrayList(); RealmConfiguration model = getConfigurationInternal(); log.debug("Available realms: {}", availableRealms); for (String realmName : model.getRealmNames()) { Realm realm = availableRealms.get(realmName); // FIXME: Resolve what purpose this is for, looks like legacy? if (realm == null) { log.debug("Failed to look up realm '{}' as a component, trying reflection", realmName); // If that fails, will simply use reflection to load try { realm = (Realm) getClass().getClassLoader().loadClass(realmName).newInstance(); } catch (Exception e) { log.error("Unable to lookup security realms", e); } } if (realm != null) { result.add(realm); } } return result; } // // Helpers //
List<Realm> function() { List<Realm> result = Lists.newArrayList(); RealmConfiguration model = getConfigurationInternal(); log.debug(STR, availableRealms); for (String realmName : model.getRealmNames()) { Realm realm = availableRealms.get(realmName); if (realm == null) { log.debug(STR, realmName); try { realm = (Realm) getClass().getClassLoader().loadClass(realmName).newInstance(); } catch (Exception e) { log.error(STR, e); } } if (realm != null) { result.add(realm); } } return result; } //
/** * Resolve configured realm components. */
Resolve configured realm components
resolveRealms
{ "repo_name": "sonatype/nexus-public", "path": "components/nexus-security/src/main/java/org/sonatype/nexus/security/internal/RealmManagerImpl.java", "license": "epl-1.0", "size": 11870 }
[ "com.google.common.collect.Lists", "java.util.List", "org.apache.shiro.realm.Realm", "org.sonatype.nexus.security.realm.RealmConfiguration" ]
import com.google.common.collect.Lists; import java.util.List; import org.apache.shiro.realm.Realm; import org.sonatype.nexus.security.realm.RealmConfiguration;
import com.google.common.collect.*; import java.util.*; import org.apache.shiro.realm.*; import org.sonatype.nexus.security.realm.*;
[ "com.google.common", "java.util", "org.apache.shiro", "org.sonatype.nexus" ]
com.google.common; java.util; org.apache.shiro; org.sonatype.nexus;
1,573,722
@Override public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE); }
String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE); }
/** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
toString
{ "repo_name": "fpompermaier/onvif", "path": "onvif-ws-client/src/main/java/org/onvif/ver10/device/wsdl/GetNetworkProtocolsResponse.java", "license": "apache-2.0", "size": 2554 }
[ "org.apache.commons.lang3.builder.ToStringBuilder", "org.apache.cxf.xjc.runtime.JAXBToStringStyle" ]
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
import org.apache.commons.lang3.builder.*; import org.apache.cxf.xjc.runtime.*;
[ "org.apache.commons", "org.apache.cxf" ]
org.apache.commons; org.apache.cxf;
337,001
private static Class getAttributeClassWhenBOIsInterface(Class boClass, String attributeName){ if (boClass == null) { throw new IllegalArgumentException("invalid (null) boClass"); } if (StringUtils.isBlank(attributeName)) { throw new IllegalArgumentException("invalid (blank) attributeName"); } PropertyDescriptor propertyDescriptor = null; String[] intermediateProperties = attributeName.split("\\."); int lastLevel = intermediateProperties.length - 1; Class currentClass = boClass; for (int i = 0; i <= lastLevel; ++i) { String currentPropertyName = intermediateProperties[i]; propertyDescriptor = buildSimpleReadDescriptor(currentClass, currentPropertyName); if (propertyDescriptor != null) { Class propertyType = propertyDescriptor.getPropertyType(); if ( propertyType.equals( PersistableBusinessObjectExtension.class ) ) { propertyType = getPersistenceStructureService().getBusinessObjectAttributeClass( currentClass, currentPropertyName ); } if (Collection.class.isAssignableFrom(propertyType)) { // TODO: determine property type using generics type definition throw new AttributeValidationException("Can't determine the Class of Collection elements because when the business object is an (possibly ExternalizableBusinessObject) interface."); } else { currentClass = propertyType; } } else { throw new AttributeValidationException("Can't find getter method of " + boClass.getName() + " for property " + attributeName); } } return currentClass; }
static Class function(Class boClass, String attributeName){ if (boClass == null) { throw new IllegalArgumentException(STR); } if (StringUtils.isBlank(attributeName)) { throw new IllegalArgumentException(STR); } PropertyDescriptor propertyDescriptor = null; String[] intermediateProperties = attributeName.split("\\."); int lastLevel = intermediateProperties.length - 1; Class currentClass = boClass; for (int i = 0; i <= lastLevel; ++i) { String currentPropertyName = intermediateProperties[i]; propertyDescriptor = buildSimpleReadDescriptor(currentClass, currentPropertyName); if (propertyDescriptor != null) { Class propertyType = propertyDescriptor.getPropertyType(); if ( propertyType.equals( PersistableBusinessObjectExtension.class ) ) { propertyType = getPersistenceStructureService().getBusinessObjectAttributeClass( currentClass, currentPropertyName ); } if (Collection.class.isAssignableFrom(propertyType)) { throw new AttributeValidationException(STR); } else { currentClass = propertyType; } } else { throw new AttributeValidationException(STR + boClass.getName() + STR + attributeName); } } return currentClass; }
/** * * This method gets the property type of the given attributeName when the bo class is an interface * This method will also work if the bo class is not an interface, * but that case requires special handling, hence a separate method getAttributeClassWhenBOIsClass * * @param boClass * @param attributeName * @return */
This method gets the property type of the given attributeName when the bo class is an interface This method will also work if the bo class is not an interface, but that case requires special handling, hence a separate method getAttributeClassWhenBOIsClass
getAttributeClassWhenBOIsInterface
{ "repo_name": "ua-eas/ua-rice-2.1.9", "path": "krad/krad-web-framework/src/main/java/org/kuali/rice/krad/datadictionary/DataDictionary.java", "license": "apache-2.0", "size": 30189 }
[ "java.beans.PropertyDescriptor", "java.util.Collection", "org.apache.commons.lang.StringUtils", "org.kuali.rice.krad.bo.PersistableBusinessObjectExtension", "org.kuali.rice.krad.datadictionary.exception.AttributeValidationException" ]
import java.beans.PropertyDescriptor; import java.util.Collection; import org.apache.commons.lang.StringUtils; import org.kuali.rice.krad.bo.PersistableBusinessObjectExtension; import org.kuali.rice.krad.datadictionary.exception.AttributeValidationException;
import java.beans.*; import java.util.*; import org.apache.commons.lang.*; import org.kuali.rice.krad.bo.*; import org.kuali.rice.krad.datadictionary.exception.*;
[ "java.beans", "java.util", "org.apache.commons", "org.kuali.rice" ]
java.beans; java.util; org.apache.commons; org.kuali.rice;
322,551
protected boolean match(MailAdapter mail, String addressPart, String comparator, String matchType, String headerName, List<String> keys, SieveContext context) throws SieveException { // Iterate over the keys looking for a match boolean isMatched = false; for (final String key:keys) { isMatched = match(mail, addressPart, comparator, matchType, headerName, key, context); if (isMatched) { break; } } return isMatched; }
boolean function(MailAdapter mail, String addressPart, String comparator, String matchType, String headerName, List<String> keys, SieveContext context) throws SieveException { boolean isMatched = false; for (final String key:keys) { isMatched = match(mail, addressPart, comparator, matchType, headerName, key, context); if (isMatched) { break; } } return isMatched; }
/** * Method match. * * @param mail * @param addressPart * @param comparator * @param matchType * @param headerName * @param keys * @param context not null * @return boolean * @throws SieveMailException */
Method match
match
{ "repo_name": "aduprat/james-jsieve", "path": "core/src/main/java/org/apache/jsieve/tests/AbstractComparatorTest.java", "license": "apache-2.0", "size": 9173 }
[ "java.util.List", "org.apache.jsieve.SieveContext", "org.apache.jsieve.exception.SieveException", "org.apache.jsieve.mail.MailAdapter" ]
import java.util.List; import org.apache.jsieve.SieveContext; import org.apache.jsieve.exception.SieveException; import org.apache.jsieve.mail.MailAdapter;
import java.util.*; import org.apache.jsieve.*; import org.apache.jsieve.exception.*; import org.apache.jsieve.mail.*;
[ "java.util", "org.apache.jsieve" ]
java.util; org.apache.jsieve;
860,771
DateTimeFormatter toFormatter(ResolverStyle resolverStyle, Chronology chrono) { return toFormatter(Locale.getDefault(Locale.Category.FORMAT), resolverStyle, chrono); }
DateTimeFormatter toFormatter(ResolverStyle resolverStyle, Chronology chrono) { return toFormatter(Locale.getDefault(Locale.Category.FORMAT), resolverStyle, chrono); }
/** * Completes this builder by creating the formatter. * This uses the default locale. * * @param resolverStyle the resolver style to use, not null * @return the created formatter, not null */
Completes this builder by creating the formatter. This uses the default locale
toFormatter
{ "repo_name": "stain/jdk8u", "path": "src/share/classes/java/time/format/DateTimeFormatterBuilder.java", "license": "gpl-2.0", "size": 201531 }
[ "java.time.chrono.Chronology", "java.util.Locale" ]
import java.time.chrono.Chronology; import java.util.Locale;
import java.time.chrono.*; import java.util.*;
[ "java.time", "java.util" ]
java.time; java.util;
276,923
public List deleteTagInode(String tagName, String inode) throws Exception { StringTokenizer tagNameToken = new StringTokenizer(tagName, ","); if (tagNameToken.hasMoreTokens()) { for (; tagNameToken.hasMoreTokens();) { String tagTokenized = tagNameToken.nextToken().trim(); Tag tag = getTag(tagTokenized,"",""); TagInode tagInode = getTagInode(tag.getTagId(), inode); if (tagInode.getTagId() != null) { HibernateUtil.delete(tagInode); } } } return getTagInodeByInode(inode); }
List function(String tagName, String inode) throws Exception { StringTokenizer tagNameToken = new StringTokenizer(tagName, ","); if (tagNameToken.hasMoreTokens()) { for (; tagNameToken.hasMoreTokens();) { String tagTokenized = tagNameToken.nextToken().trim(); Tag tag = getTag(tagTokenized,"",""); TagInode tagInode = getTagInode(tag.getTagId(), inode); if (tagInode.getTagId() != null) { HibernateUtil.delete(tagInode); } } } return getTagInodeByInode(inode); }
/** * Deletes an object tag assignment(s) * @param tagName name(s) of the tag(s) * @param inode inode of the object tagged * @return a list of all tags assigned to an object */
Deletes an object tag assignment(s)
deleteTagInode
{ "repo_name": "ggonzales/ksl", "path": "src/com/dotmarketing/tag/business/TagAPIImpl.java", "license": "gpl-3.0", "size": 27961 }
[ "com.dotmarketing.db.HibernateUtil", "com.dotmarketing.tag.model.Tag", "com.dotmarketing.tag.model.TagInode", "java.util.List", "java.util.StringTokenizer" ]
import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.tag.model.Tag; import com.dotmarketing.tag.model.TagInode; import java.util.List; import java.util.StringTokenizer;
import com.dotmarketing.db.*; import com.dotmarketing.tag.model.*; import java.util.*;
[ "com.dotmarketing.db", "com.dotmarketing.tag", "java.util" ]
com.dotmarketing.db; com.dotmarketing.tag; java.util;
1,526,748
private JMenuItem getBeginCoherentItem() { if (beginCoherentItem == null) { beginCoherentItem = new JMenuItem(); beginCoherentItem.setText("Begin coherent changes"); beginCoherentItem.setActionCommand("begin_coherent_changes"); beginCoherentItem.setMnemonic(java.awt.event.KeyEvent.VK_B); beginCoherentItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.Event.CTRL_MASK, false)); beginCoherentItem.addActionListener(controller); } return beginCoherentItem; }
JMenuItem function() { if (beginCoherentItem == null) { beginCoherentItem = new JMenuItem(); beginCoherentItem.setText(STR); beginCoherentItem.setActionCommand(STR); beginCoherentItem.setMnemonic(java.awt.event.KeyEvent.VK_B); beginCoherentItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.Event.CTRL_MASK, false)); beginCoherentItem.addActionListener(controller); } return beginCoherentItem; }
/** * This method initializes beginCoherentItem * * @return javax.swing.JMenuItem */
This method initializes beginCoherentItem
getBeginCoherentItem
{ "repo_name": "PrismTech/opensplice", "path": "src/tools/cm/common/code/org/opensplice/common/view/CoherentPublishFrameCommon.java", "license": "gpl-3.0", "size": 15362 }
[ "java.awt.event.KeyEvent", "javax.swing.JMenuItem", "javax.swing.KeyStroke" ]
import java.awt.event.KeyEvent; import javax.swing.JMenuItem; import javax.swing.KeyStroke;
import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,641,948
Log.d(TAG, "In doInBackground"); TCPConnection connection = null; try { connection = new TCPConnection(tag, command); connection.run(); } catch (NullPointerException e) { Log.d(TAG, "Caught null pointer exception"); e.printStackTrace(); } return connection; }
Log.d(TAG, STR); TCPConnection connection = null; try { connection = new TCPConnection(tag, command); connection.run(); } catch (NullPointerException e) { Log.d(TAG, STR); e.printStackTrace(); } return connection; }
/** * create a tcp object and return it. * * @param params From MainActivity class empty string is passed. * @return TCPConnection object for closing it in onPostExecute method. */
create a tcp object and return it
doInBackground
{ "repo_name": "AriaPahlavan/EE360P_TeamProject", "path": "app/src/main/java/edu/utexas/ee360p_teamproject/ClientRequestHandler/ClientTask.java", "license": "mit", "size": 1876 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,905,705
public static void initialiseTableBookings() { try { File TableBooking = new File("TableBooking.txt"); if (!TableBooking.exists()) TableBooking.createNewFile(); else { FileReader fr = new FileReader(TableBooking); BufferedReader br = new BufferedReader(fr); String line; while ((line = br.readLine()) != null) { String[] tableBookingData = line.split(","); LocalDateTime tableLDT = LocalDateTime.parse(tableBookingData[0]); int tableNo = Integer.parseInt(tableBookingData[1]); TableHandler.initialiseTableHandler(tableLDT, tableNo); } br.close(); fr.close(); } } catch (IOException e) { e.printStackTrace(); } }
static void function() { try { File TableBooking = new File(STR); if (!TableBooking.exists()) TableBooking.createNewFile(); else { FileReader fr = new FileReader(TableBooking); BufferedReader br = new BufferedReader(fr); String line; while ((line = br.readLine()) != null) { String[] tableBookingData = line.split(","); LocalDateTime tableLDT = LocalDateTime.parse(tableBookingData[0]); int tableNo = Integer.parseInt(tableBookingData[1]); TableHandler.initialiseTableHandler(tableLDT, tableNo); } br.close(); fr.close(); } } catch (IOException e) { e.printStackTrace(); } }
/** * Reads from TableBooking.txt to initialise the * TableHandler object. Runs on startup * @see TableHandler */
Reads from TableBooking.txt to initialise the TableHandler object. Runs on startup
initialiseTableBookings
{ "repo_name": "jonathanliem94/NTU-CE2002-POS", "path": "2002Assign/src/ConsoleApplication.java", "license": "mit", "size": 38928 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileReader", "java.io.IOException", "java.time.LocalDateTime" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.time.LocalDateTime;
import java.io.*; import java.time.*;
[ "java.io", "java.time" ]
java.io; java.time;
1,590,157
public Timestamp getDateModified() { return (Timestamp) get(3); }
Timestamp function() { return (Timestamp) get(3); }
/** * Getter for <code>sugarcrm_4_12.accounts_cases.date_modified</code>. */
Getter for <code>sugarcrm_4_12.accounts_cases.date_modified</code>
getDateModified
{ "repo_name": "SmartMedicalServices/SpringJOOQ", "path": "src/main/java/com/sms/sis/db/tables/records/AccountsCasesRecord.java", "license": "gpl-3.0", "size": 6368 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,145,790