method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public static EngineInfo getProcessEngineInfo(String processEngineName) {
return processEngineInfosByName.get(processEngineName);
} | static EngineInfo function(String processEngineName) { return processEngineInfosByName.get(processEngineName); } | /**
* Get initialization results. Only info will we available for process engines which were added in the {@link ProcessEngines#init()}. No {@link EngineInfo} is available for engines which were
* registered programmatically.
*/ | Get initialization results. Only info will we available for process engines which were added in the <code>ProcessEngines#init()</code>. No <code>EngineInfo</code> is available for engines which were registered programmatically | getProcessEngineInfo | {
"repo_name": "zwets/flowable-engine",
"path": "modules/flowable-engine/src/main/java/org/flowable/engine/ProcessEngines.java",
"license": "apache-2.0",
"size": 12269
} | [
"org.flowable.engine.common.EngineInfo"
] | import org.flowable.engine.common.EngineInfo; | import org.flowable.engine.common.*; | [
"org.flowable.engine"
] | org.flowable.engine; | 510,908 |
public void getData(JsonInputMeta in)
{
if (in.getFileName() !=null)
{
wFilenameList.removeAll();
for (int i=0;i<in.getFileName().length;i++)
{
wFilenameList.add(new String[] { in.getFileName()[i], in.getFileMask()[i] , in.getExludeFileMask()[i],
in.getRequiredFilesDesc(in.getFileRequir... | void function(JsonInputMeta in) { if (in.getFileName() !=null) { wFilenameList.removeAll(); for (int i=0;i<in.getFileName().length;i++) { wFilenameList.add(new String[] { in.getFileName()[i], in.getFileMask()[i] , in.getExludeFileMask()[i], in.getRequiredFilesDesc(in.getFileRequired()[i]), in.getRequiredFilesDesc(in.ge... | /**
* Read the data from the TextFileInputMeta object and show it in this dialog.
*
* @param in The TextFileInputMeta object to obtain the data from.
*/ | Read the data from the TextFileInputMeta object and show it in this dialog | getData | {
"repo_name": "yintaoxue/read-open-source-code",
"path": "kettle4.3/src/org/pentaho/di/ui/trans/steps/jsoninput/JsonInputDialog.java",
"license": "apache-2.0",
"size": 67491
} | [
"org.pentaho.di.trans.steps.jsoninput.JsonInputMeta"
] | import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; | import org.pentaho.di.trans.steps.jsoninput.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,757,948 |
public void setLogFile ( String filename) throws FileNotFoundException {
setLogStream ( new PrintStream ( new FileOutputStream ( filename, true )));
}
| void function ( String filename) throws FileNotFoundException { setLogStream ( new PrintStream ( new FileOutputStream ( filename, true ))); } | /**
* set the log file for this connector
*
* @param filename
* @throws FileNotFoundException
*/ | set the log file for this connector | setLogFile | {
"repo_name": "AlexRuppert/las2peer_project",
"path": "java/i5/las2peer/httpConnector/HttpConnector.java",
"license": "mit",
"size": 11913
} | [
"java.io.FileNotFoundException",
"java.io.FileOutputStream",
"java.io.PrintStream"
] | import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 499,989 |
public View getSecondaryMenu() {
return mViewBehind.getSecondaryContent();
} | View function() { return mViewBehind.getSecondaryContent(); } | /**
* Retrieves the current secondary menu (right).
* @return the current menu
*/ | Retrieves the current secondary menu (right) | getSecondaryMenu | {
"repo_name": "eduardoweiland/doode-android",
"path": "libs/SlidingMenu/src/com/slidingmenu/lib/SlidingMenu.java",
"license": "gpl-3.0",
"size": 25339
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,859,273 |
@Test
public void testOrphansNotPreferred() {
final ResourceId RESOURCE = ResourceId.from("resource");
final PartitionId[] PARTITIONS =
{
PartitionId.from("resource_0"), PartitionId.from("resource_1"),
PartitionId.from("resource_2")
};
final StateModelDefinition S... | void function() { final ResourceId RESOURCE = ResourceId.from(STR); final PartitionId[] PARTITIONS = { PartitionId.from(STR), PartitionId.from(STR), PartitionId.from(STR) }; final StateModelDefinition STATE_MODEL = new StateModelDefinition(StateModelConfigGenerator.generateConfigForMasterSlave()); final int REPLICA_COU... | /**
* Tests the following scenario: nodes come up one by one, then one node is taken down. Preference
* lists should prefer nodes in the current mapping at all times, but when all nodes are in the
* current mapping, then it should distribute states as evenly as possible.
*/ | Tests the following scenario: nodes come up one by one, then one node is taken down. Preference lists should prefer nodes in the current mapping at all times, but when all nodes are in the current mapping, then it should distribute states as evenly as possible | testOrphansNotPreferred | {
"repo_name": "Teino1978-Corp/Teino1978-Corp-helix",
"path": "helix-core/src/test/java/org/apache/helix/controller/strategy/TestAutoRebalanceStrategy.java",
"license": "apache-2.0",
"size": 37719
} | [
"com.google.common.collect.ImmutableList",
"com.google.common.collect.Lists",
"com.google.common.collect.Maps",
"com.google.common.collect.Sets",
"java.util.HashMap",
"java.util.LinkedHashMap",
"java.util.List",
"java.util.Map",
"java.util.Set",
"org.apache.helix.ZNRecord",
"org.apache.helix.api... | import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.helix.ZNRec... | import com.google.common.collect.*; import java.util.*; import org.apache.helix.*; import org.apache.helix.api.*; import org.apache.helix.api.id.*; import org.apache.helix.controller.rebalancer.util.*; import org.apache.helix.controller.strategy.*; import org.apache.helix.model.*; import org.apache.helix.tools.*; impor... | [
"com.google.common",
"java.util",
"org.apache.helix",
"org.testng"
] | com.google.common; java.util; org.apache.helix; org.testng; | 2,817,259 |
public void trace(Throwable throwable, String msg, Object[] argArray) {
logIfEnabled(Level.TRACE, throwable, msg, UNKNOWN_ARG, UNKNOWN_ARG, UNKNOWN_ARG, argArray);
} | void function(Throwable throwable, String msg, Object[] argArray) { logIfEnabled(Level.TRACE, throwable, msg, UNKNOWN_ARG, UNKNOWN_ARG, UNKNOWN_ARG, argArray); } | /**
* Log a trace message with a throwable.
*/ | Log a trace message with a throwable | trace | {
"repo_name": "dankito/ormlite-jpa-core",
"path": "src/main/java/com/j256/ormlite/logger/Logger.java",
"license": "isc",
"size": 17794
} | [
"com.j256.ormlite.logger.Log"
] | import com.j256.ormlite.logger.Log; | import com.j256.ormlite.logger.*; | [
"com.j256.ormlite"
] | com.j256.ormlite; | 1,024,503 |
List<Double> diapason(int start, int end, Function<Double, Double> func) {
List<Double> result = new ArrayList<>();
for (int index = start; index != end; index++) {
result.add(func.apply((double) index));
}
return result;
} | List<Double> diapason(int start, int end, Function<Double, Double> func) { List<Double> result = new ArrayList<>(); for (int index = start; index != end; index++) { result.add(func.apply((double) index)); } return result; } | /**
* Method for implementing a functions (linear, quadratic etc.)
* @param start - a start number
* @param end - an end number
* @param func - a function
* @return result - List<Double>
*/ | Method for implementing a functions (linear, quadratic etc.) | diapason | {
"repo_name": "DmitriiEskov/deskov",
"path": "chapter_004/src/main/java/lambda/FunctionMethod.java",
"license": "apache-2.0",
"size": 794
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.function.Function"
] | import java.util.ArrayList; import java.util.List; import java.util.function.Function; | import java.util.*; import java.util.function.*; | [
"java.util"
] | java.util; | 1,864,914 |
public int getStatusCode() throws IOException {
return this.statusCode;
} | int function() throws IOException { return this.statusCode; } | /**
* Returns the status code.
*
* @return The status code.
* @throws IOException
*/ | Returns the status code | getStatusCode | {
"repo_name": "zhangjunfang/eclipse-dir",
"path": "restlet/src/org/restlet/engine/adapter/Call.java",
"license": "bsd-2-clause",
"size": 13584
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 514,913 |
@Test
public void checkUpdates() {
// Create a controller
TestMesh mesh = new TestMesh(new ArrayList<IController>());
TestController object = new TestController(mesh, new TestView());
// Create a parent object to receive updates
TestMesh parentMesh = new TestMesh(new ArrayList<IController>());
... | void function() { TestMesh mesh = new TestMesh(new ArrayList<IController>()); TestController object = new TestController(mesh, new TestView()); TestMesh parentMesh = new TestMesh(new ArrayList<IController>()); TestController parent = new TestController(parentMesh, new TestView()); parent.addEntity(object); mesh.setProp... | /**
* Check that updates are handled correctly
*/ | Check that updates are handled correctly | checkUpdates | {
"repo_name": "eclipse/eavp",
"path": "org.eclipse.eavp.tests.viz.modeling/src/org/eclipse/eavp/tests/viz/modeling/BasicControllerTester.java",
"license": "epl-1.0",
"size": 14929
} | [
"java.util.ArrayList",
"org.eclipse.eavp.tests.viz.modeling.utils.TestController",
"org.eclipse.eavp.tests.viz.modeling.utils.TestMesh",
"org.eclipse.eavp.tests.viz.modeling.utils.TestView",
"org.eclipse.eavp.viz.modeling.base.IController",
"org.eclipse.eavp.viz.modeling.properties.MeshProperty",
"org.j... | import java.util.ArrayList; import org.eclipse.eavp.tests.viz.modeling.utils.TestController; import org.eclipse.eavp.tests.viz.modeling.utils.TestMesh; import org.eclipse.eavp.tests.viz.modeling.utils.TestView; import org.eclipse.eavp.viz.modeling.base.IController; import org.eclipse.eavp.viz.modeling.properties.MeshPr... | import java.util.*; import org.eclipse.eavp.tests.viz.modeling.utils.*; import org.eclipse.eavp.viz.modeling.base.*; import org.eclipse.eavp.viz.modeling.properties.*; import org.junit.*; | [
"java.util",
"org.eclipse.eavp",
"org.junit"
] | java.util; org.eclipse.eavp; org.junit; | 2,191,367 |
public NBTTagCompound getEntityData()
{
if (customEntityData == null)
{
customEntityData = new NBTTagCompound();
}
return customEntityData;
} | NBTTagCompound function() { if (customEntityData == null) { customEntityData = new NBTTagCompound(); } return customEntityData; } | /**
* Returns a NBTTagCompound that can be used to store custom data for this entity.
* It will be written, and read from disc, so it persists over world saves.
* @return A NBTTagCompound
*/ | Returns a NBTTagCompound that can be used to store custom data for this entity. It will be written, and read from disc, so it persists over world saves | getEntityData | {
"repo_name": "aebert1/BigTransport",
"path": "build/tmp/recompileMc/sources/net/minecraft/entity/Entity.java",
"license": "gpl-3.0",
"size": 111191
} | [
"net.minecraft.nbt.NBTTagCompound"
] | import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.nbt.*; | [
"net.minecraft.nbt"
] | net.minecraft.nbt; | 1,137,895 |
public void generateParameters(TableSet tableSet, PreparedStatement ps)
throws SQLException
{
List<DataGenerator> generators = tableSet.getDataGenerators();
int index = 1;
for (DataGenerator dg: generators)
{
ps.setObject(index++, dg.generate());
}
} | void function(TableSet tableSet, PreparedStatement ps) throws SQLException { List<DataGenerator> generators = tableSet.getDataGenerators(); int index = 1; for (DataGenerator dg: generators) { ps.setObject(index++, dg.generate()); } } | /**
* Generate parameters for a prepared statement from the associated
* table set.
*/ | Generate parameters for a prepared statement from the associated table set | generateParameters | {
"repo_name": "shutterstock/bristlecone",
"path": "src/com/continuent/bristlecone/benchmark/db/TableSetHelper.java",
"license": "gpl-2.0",
"size": 3930
} | [
"java.sql.PreparedStatement",
"java.sql.SQLException",
"java.util.List"
] | import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 2,609,767 |
public void ArmDown() {
System.out.println("Attempting to move arm down");
rArmSolenoid1.set(false);
rArmSolenoid2.set(true);
lArmSolenoid1.set(false);
lArmSolenoid2.set(true);
SmartDashboard.putBoolean("r arm solenoid1", rArmSolenoid1.get());
... | void function() { System.out.println(STR); rArmSolenoid1.set(false); rArmSolenoid2.set(true); lArmSolenoid1.set(false); lArmSolenoid2.set(true); SmartDashboard.putBoolean(STR, rArmSolenoid1.get()); SmartDashboard.putBoolean(STR, lArmSolenoid1.get()); } | /**
* Method that activates the arm solenoids so the arm moves down
*/ | Method that activates the arm solenoids so the arm moves down | ArmDown | {
"repo_name": "frc-88/2014-Robot",
"path": "src/edu/wpi/first/wpilibj/templates/subsystems/Arms.java",
"license": "bsd-3-clause",
"size": 1912
} | [
"edu.wpi.first.wpilibj.smartdashboard.SmartDashboard"
] | import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | import edu.wpi.first.wpilibj.smartdashboard.*; | [
"edu.wpi.first"
] | edu.wpi.first; | 2,786,403 |
@Override
protected void unsetTarget(EObject target)
{
if (isConnectedObject(target))
{
basicUnsetTarget(target);
if (target instanceof Resource)
{
InternalCDOView view = getCDOView(target);
if (view != null)
{
// Remove adapter from all adapted objects
... | void function(EObject target) { if (isConnectedObject(target)) { basicUnsetTarget(target); if (target instanceof Resource) { InternalCDOView view = getCDOView(target); if (view != null) { for (WeakReference<CDOObject> weakReference : adaptedObjects) { CDOObject object = weakReference.get(); if (object != null) { remove... | /**
* EContentAdapter removes adapter from all contained EObjects. In this case, we remove this adapter from all lazily
* loaded objects
*/ | EContentAdapter removes adapter from all contained EObjects. In this case, we remove this adapter from all lazily loaded objects | unsetTarget | {
"repo_name": "IHTSDO/snow-owl",
"path": "dependencies/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOLazyContentAdapter.java",
"license": "apache-2.0",
"size": 5693
} | [
"java.lang.ref.WeakReference",
"org.eclipse.emf.cdo.CDOObject",
"org.eclipse.emf.ecore.EObject",
"org.eclipse.emf.ecore.resource.Resource",
"org.eclipse.emf.spi.cdo.InternalCDOView"
] | import java.lang.ref.WeakReference; import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.spi.cdo.InternalCDOView; | import java.lang.ref.*; import org.eclipse.emf.cdo.*; import org.eclipse.emf.ecore.*; import org.eclipse.emf.ecore.resource.*; import org.eclipse.emf.spi.cdo.*; | [
"java.lang",
"org.eclipse.emf"
] | java.lang; org.eclipse.emf; | 444,169 |
protected void doProppatch(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {
if (!isAuthenticated(req, resp) || !isAuthorized(req, resp)) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
... | void function(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (!isAuthenticated(req, resp) !isAuthorized(req, resp)) { resp.sendError(WebdavStatus.SC_FORBIDDEN); return; } if (isLocked(req)) { resp.sendError(WebdavStatus.SC_LOCKED); return; } resp.sendError(HttpServletRespons... | /**
* PROPPATCH Method.
*/ | PROPPATCH Method | doProppatch | {
"repo_name": "headsupdev/agile",
"path": "agile-framework/src/main/java/org/apache/catalina/servlets/WebdavServlet.java",
"license": "agpl-3.0",
"size": 112157
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 1,862,355 |
public Object visitExpressionEvaluator(ExpressionEvaluator ex) throws VilException; | Object function(ExpressionEvaluator ex) throws VilException; | /**
* Visits an expression evaluator.
*
* @param ex the evaluator
* @return the result of visiting this expression (may be <b>null</b>)
* @throws VilException in case that visiting fails (e.g., execution)
*/ | Visits an expression evaluator | visitExpressionEvaluator | {
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/Instantiation/de.uni_hildesheim.sse.easy.instantiatorCore/src/net/ssehub/easy/instantiation/core/model/expressions/IExpressionVisitor.java",
"license": "apache-2.0",
"size": 5805
} | [
"net.ssehub.easy.instantiation.core.model.common.VilException"
] | import net.ssehub.easy.instantiation.core.model.common.VilException; | import net.ssehub.easy.instantiation.core.model.common.*; | [
"net.ssehub.easy"
] | net.ssehub.easy; | 295,803 |
public int read() throws IOException {
int b0 = fInputStream.read();
if (b0 > 0x80) {
throw new IOException(Localizer.getMessage("jsp.error.xml.invalidASCII",
Integer.toString(b0)));
}
return b0;
} // read():int | int function() throws IOException { int b0 = fInputStream.read(); if (b0 > 0x80) { throw new IOException(Localizer.getMessage(STR, Integer.toString(b0))); } return b0; } | /**
* Read a single character. This method will block until a character is
* available, an I/O error occurs, or the end of the stream is reached.
*
* <p> Subclasses that intend to support efficient single-character input
* should override this method.
*
* @return The character re... | Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached. Subclasses that intend to support efficient single-character input should override this method | read | {
"repo_name": "WillJiang/WillJiang",
"path": "src/plugins/embeddedjsp/src/main/java/org/apache/struts2/jasper/xmlparser/ASCIIReader.java",
"license": "apache-2.0",
"size": 7002
} | [
"java.io.IOException",
"org.apache.struts2.jasper.compiler.Localizer"
] | import java.io.IOException; import org.apache.struts2.jasper.compiler.Localizer; | import java.io.*; import org.apache.struts2.jasper.compiler.*; | [
"java.io",
"org.apache.struts2"
] | java.io; org.apache.struts2; | 560,843 |
boolean evaluate(ServiceEndpoint endpoint, MessageExchange exchange); | boolean evaluate(ServiceEndpoint endpoint, MessageExchange exchange); | /**
* Performs the filter on the endpoint returning true if the endpoint is suitable, based on some
* capabilities evaluation or false if the endpoint should be ignored.
*/ | Performs the filter on the endpoint returning true if the endpoint is suitable, based on some capabilities evaluation or false if the endpoint should be ignored | evaluate | {
"repo_name": "apache/servicemix-utils",
"path": "src/main/java/org/apache/servicemix/jbi/api/EndpointFilter.java",
"license": "apache-2.0",
"size": 1368
} | [
"javax.jbi.messaging.MessageExchange",
"javax.jbi.servicedesc.ServiceEndpoint"
] | import javax.jbi.messaging.MessageExchange; import javax.jbi.servicedesc.ServiceEndpoint; | import javax.jbi.messaging.*; import javax.jbi.servicedesc.*; | [
"javax.jbi"
] | javax.jbi; | 2,700,404 |
public void configureUsingCoalesceUnits(final CoalesceUnit... units) {
final List<InputColumn<?>> input = new ArrayList<>();
for (final CoalesceUnit coalesceUnit : units) {
final InputColumn<?>[] inputColumns = coalesceUnit.getInputColumns();
Collections.addAll(input, inputCo... | void function(final CoalesceUnit... units) { final List<InputColumn<?>> input = new ArrayList<>(); for (final CoalesceUnit coalesceUnit : units) { final InputColumn<?>[] inputColumns = coalesceUnit.getInputColumns(); Collections.addAll(input, inputColumns); } _inputs = input.toArray(new InputColumn[input.size()]); _uni... | /**
* Configures the transformer using the coalesce units provided
*
* @param units
*/ | Configures the transformer using the coalesce units provided | configureUsingCoalesceUnits | {
"repo_name": "datacleaner/DataCleaner",
"path": "components/fuse/src/main/java/org/datacleaner/components/fuse/FuseStreamsComponent.java",
"license": "lgpl-3.0",
"size": 6020
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"org.datacleaner.api.InputColumn"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.datacleaner.api.InputColumn; | import java.util.*; import org.datacleaner.api.*; | [
"java.util",
"org.datacleaner.api"
] | java.util; org.datacleaner.api; | 830,017 |
public void removeFrdParameterRule14List(List<FrdParameterRule14> frdParameterRule14List); | void function(List<FrdParameterRule14> frdParameterRule14List); | /**
* removeFrdParameterRule14List - removes a list of FrdParameterRule14
*
* @param frdParameterRule14List
*/ | removeFrdParameterRule14List - removes a list of FrdParameterRule14 | removeFrdParameterRule14List | {
"repo_name": "yauritux/venice-legacy",
"path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/FrdParameterRule14SessionEJBRemote.java",
"license": "apache-2.0",
"size": 2780
} | [
"com.gdn.venice.persistence.FrdParameterRule14",
"java.util.List"
] | import com.gdn.venice.persistence.FrdParameterRule14; import java.util.List; | import com.gdn.venice.persistence.*; import java.util.*; | [
"com.gdn.venice",
"java.util"
] | com.gdn.venice; java.util; | 2,309,009 |
protected static PreparedStatement getInstance(MySQLConnection conn,
String catalog) throws SQLException {
if (!Util.isJdbc4()) {
return new PreparedStatement(conn, catalog);
}
return (PreparedStatement) Util.handleNewInstance(
JDBC_4_PSTMT_2_ARG_CTOR, new Object[] { conn, catalog }, conn.getExcepti... | static PreparedStatement function(MySQLConnection conn, String catalog) throws SQLException { if (!Util.isJdbc4()) { return new PreparedStatement(conn, catalog); } return (PreparedStatement) Util.handleNewInstance( JDBC_4_PSTMT_2_ARG_CTOR, new Object[] { conn, catalog }, conn.getExceptionInterceptor()); } | /**
* Creates a prepared statement instance -- We need to provide factory-style
* methods so we can support both JDBC3 (and older) and JDBC4 runtimes,
* otherwise the class verifier complains when it tries to load JDBC4-only
* interface classes that are present in JDBC4 method signatures.
*/ | Creates a prepared statement instance -- We need to provide factory-style methods so we can support both JDBC3 (and older) and JDBC4 runtimes, otherwise the class verifier complains when it tries to load JDBC4-only interface classes that are present in JDBC4 method signatures | getInstance | {
"repo_name": "AbstractedSheep/Shuttle-Tracker",
"path": "server/java/mysql-connector-java-5.1.14/src/com/mysql/jdbc/PreparedStatement.java",
"license": "gpl-3.0",
"size": 163728
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,787,769 |
private void execute(Runnable volunteeringTask) throws InterruptedException {
// @todo: instead of having a semaphore and queue on RegionAdvisor
// we should have an executor which limits its max threads to
// VOLUNTEERING_THREAD_COUNT.
if (Thread.interrupted())
throw new Interrupted... | void function(Runnable volunteeringTask) throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); Queue volunteeringQueue = getVolunteeringQueue(); synchronized (volunteeringQueue) { volunteeringQueue.add(volunteeringTask); if (getVolunteeringSemaphore().tryAcquire()) { boolean handedOf... | /**
* Executes the primary volunteering task after queuing it in the
* {@link BucketAdvisor#getVolunteeringQueue()}. A number of threads equal to
* {@link RegionAdvisor#VOLUNTEERING_THREAD_COUNT} are permitted to consume from the queue by
* acquiring permits from {@link BucketAdvisor#getVolunteering... | Executes the primary volunteering task after queuing it in the <code>BucketAdvisor#getVolunteeringQueue()</code>. A number of threads equal to <code>RegionAdvisor#VOLUNTEERING_THREAD_COUNT</code> are permitted to consume from the queue by acquiring permits from <code>BucketAdvisor#getVolunteeringSemaphore()</code> | execute | {
"repo_name": "pdxrunner/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java",
"license": "apache-2.0",
"size": 99303
} | [
"java.util.Queue"
] | import java.util.Queue; | import java.util.*; | [
"java.util"
] | java.util; | 1,929,286 |
public void setTargetTlv(List<BgpValueType> targetTlv) {
this.targetTlv = targetTlv;
} | void function(List<BgpValueType> targetTlv) { this.targetTlv = targetTlv; } | /**
* Sets wide community target.
*
* @param targetTlv wide community targets to match
*/ | Sets wide community target | setTargetTlv | {
"repo_name": "sdnwiselab/onos",
"path": "protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/WideCommunityTarget.java",
"license": "apache-2.0",
"size": 3563
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 316,694 |
void closeUserRegions(final boolean abort) {
this.lock.writeLock().lock();
try {
for (Map.Entry<String, HRegion> e: this.onlineRegions.entrySet()) {
HRegion r = e.getValue();
if (!r.getRegionInfo().isMetaTable() && r.isAvailable()) {
// Don't update zk with this close transitio... | void closeUserRegions(final boolean abort) { this.lock.writeLock().lock(); try { for (Map.Entry<String, HRegion> e: this.onlineRegions.entrySet()) { HRegion r = e.getValue(); if (!r.getRegionInfo().isMetaTable() && r.isAvailable()) { closeRegionIgnoreErrors(r.getRegionInfo(), abort); } } } finally { this.lock.writeLock... | /**
* Schedule closes on all user regions.
* Should be safe calling multiple times because it wont' close regions
* that are already closed or that are closing.
* @param abort Whether we're running an abort.
*/ | Schedule closes on all user regions. Should be safe calling multiple times because it wont' close regions that are already closed or that are closing | closeUserRegions | {
"repo_name": "zshao/hbase-1.0.0-cdh5.4.1",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java",
"license": "apache-2.0",
"size": 119105
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 618,139 |
private static NamedContentValues findTypedData(ArrayList<NamedContentValues> list,
String contentItemType, int type, String stringType) {
NamedContentValues result = null;
if (contentItemType == null) {
return result;
}
// Loop th... | static NamedContentValues function(ArrayList<NamedContentValues> list, String contentItemType, int type, String stringType) { NamedContentValues result = null; if (contentItemType == null) { return result; } for (NamedContentValues namedContentValues: list) { final Uri uri = namedContentValues.uri; final ContentValues ... | /**
* Given the list of NamedContentValues for an entity, a mime type, and a subtype,
* tries to find a match, returning it
* @param list the list of NCV's from the contact entity
* @param contentItemType the mime type we're looking for
* @param type the subtype (e.g. HOME, ... | Given the list of NamedContentValues for an entity, a mime type, and a subtype, tries to find a match, returning it | findTypedData | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/Exchange/src/com/android/exchange/adapter/ContactsSyncParser.java",
"license": "gpl-3.0",
"size": 55969
} | [
"android.content.ContentValues",
"android.content.Entity",
"android.net.Uri",
"android.provider.ContactsContract",
"android.text.TextUtils",
"java.util.ArrayList"
] | import android.content.ContentValues; import android.content.Entity; import android.net.Uri; import android.provider.ContactsContract; import android.text.TextUtils; import java.util.ArrayList; | import android.content.*; import android.net.*; import android.provider.*; import android.text.*; import java.util.*; | [
"android.content",
"android.net",
"android.provider",
"android.text",
"java.util"
] | android.content; android.net; android.provider; android.text; java.util; | 652,850 |
public static SimpleString getDefaultManagementAddress() {
return DEFAULT_MANAGEMENT_ADDRESS;
} | static SimpleString function() { return DEFAULT_MANAGEMENT_ADDRESS; } | /**
* the name of the management address to send management messages to. It is prefixed with "jms.queue" so that JMS clients can send messages to it.
*/ | the name of the management address to send management messages to. It is prefixed with "jms.queue" so that JMS clients can send messages to it | getDefaultManagementAddress | {
"repo_name": "kjniemi/activemq-artemis",
"path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/config/ActiveMQDefaultConfiguration.java",
"license": "apache-2.0",
"size": 59954
} | [
"org.apache.activemq.artemis.api.core.SimpleString"
] | import org.apache.activemq.artemis.api.core.SimpleString; | import org.apache.activemq.artemis.api.core.*; | [
"org.apache.activemq"
] | org.apache.activemq; | 676,749 |
@SuppressWarnings("resource")
@Test(expected = NullPointerException.class)
public void testReaderConstructorWithNullReader() {
new CsvListReader((Reader) null, PREFS);
}
| @SuppressWarnings(STR) @Test(expected = NullPointerException.class) void function() { new CsvListReader((Reader) null, PREFS); } | /**
* Tests the Reader constructor with a null Reader.
*/ | Tests the Reader constructor with a null Reader | testReaderConstructorWithNullReader | {
"repo_name": "jrw2/super-csv",
"path": "super-csv/src/test/java/org/supercsv/io/CsvListReaderTest.java",
"license": "apache-2.0",
"size": 9486
} | [
"java.io.Reader",
"org.junit.Test"
] | import java.io.Reader; import org.junit.Test; | import java.io.*; import org.junit.*; | [
"java.io",
"org.junit"
] | java.io; org.junit; | 231,411 |
public static BufferedImage crop(final Image image, final int x, final int y, final int w, final int h) {
return ImageTools.toBufferedImage(image).getSubimage(x, y, w, h);
} | static BufferedImage function(final Image image, final int x, final int y, final int w, final int h) { return ImageTools.toBufferedImage(image).getSubimage(x, y, w, h); } | /**
* crop an image
*
* @param image : Image : source image
* @param x : int : x coordinate from upper left point
* @param y : int : y coordinate from upper left point
* @param w : int : width
* @param h : int : height
* @return : BufferedImage : cropped image
*/ | crop an image | crop | {
"repo_name": "jurgendl/jhaws",
"path": "jhaws/media/src/main/java/org/jhaws/common/io/media/images/ImageTools.java",
"license": "mit",
"size": 81625
} | [
"java.awt.Image",
"java.awt.image.BufferedImage"
] | import java.awt.Image; import java.awt.image.BufferedImage; | import java.awt.*; import java.awt.image.*; | [
"java.awt"
] | java.awt; | 470,791 |
public static SourcePartitionedScheduler simpleSourcePartitionedScheduler(
SqlStageExecution stage,
PlanNodeId partitionedNode,
SplitSource splitSource,
SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize)
{
SourcePartitionedScheduler... | static SourcePartitionedScheduler function( SqlStageExecution stage, PlanNodeId partitionedNode, SplitSource splitSource, SplitPlacementPolicy splitPlacementPolicy, int splitBatchSize) { SourcePartitionedScheduler result = new SourcePartitionedScheduler(stage, partitionedNode, splitSource, splitPlacementPolicy, splitBa... | /**
* Obtains an instance of {@code SourcePartitionedScheduler} suitable for use as a
* stage scheduler.
* <p>
* This returns an ungrouped {@code SourcePartitionedScheduler} that requires
* minimal management from the caller, which is ideal for use as a stage scheduler.
*/ | Obtains an instance of SourcePartitionedScheduler suitable for use as a stage scheduler. This returns an ungrouped SourcePartitionedScheduler that requires minimal management from the caller, which is ideal for use as a stage scheduler | simpleSourcePartitionedScheduler | {
"repo_name": "yuananf/presto",
"path": "presto-main/src/main/java/com/facebook/presto/execution/scheduler/SourcePartitionedScheduler.java",
"license": "apache-2.0",
"size": 21245
} | [
"com.facebook.presto.execution.Lifespan",
"com.facebook.presto.execution.SqlStageExecution",
"com.facebook.presto.split.SplitSource",
"com.facebook.presto.sql.planner.plan.PlanNodeId"
] | import com.facebook.presto.execution.Lifespan; import com.facebook.presto.execution.SqlStageExecution; import com.facebook.presto.split.SplitSource; import com.facebook.presto.sql.planner.plan.PlanNodeId; | import com.facebook.presto.execution.*; import com.facebook.presto.split.*; import com.facebook.presto.sql.planner.plan.*; | [
"com.facebook.presto"
] | com.facebook.presto; | 447,073 |
public int doWrite(ByteChunk chunk, Response res)
throws IOException {
// If non blocking (event) and there are leftover bytes,
// put all remaining bytes in the leftover buffer (they are
// part of the same write operation)
if (leftover.getLength()... | int function(ByteChunk chunk, Response res) throws IOException { if (leftover.getLength() > 0) { leftover.append(chunk); return chunk.getLength(); } int len = chunk.getLength(); int start = chunk.getStart(); byte[] b = chunk.getBuffer(); while (len > 0) { int thisTime = len; if (bbuf.position() == bbuf.capacity()) { fl... | /**
* Write chunk.
*/ | Write chunk | doWrite | {
"repo_name": "whitingjr/JbossWeb_7_2_0",
"path": "src/main/java/org/apache/coyote/http11/InternalAprOutputBuffer.java",
"license": "apache-2.0",
"size": 24347
} | [
"java.io.IOException",
"org.apache.coyote.Response",
"org.apache.tomcat.util.buf.ByteChunk"
] | import java.io.IOException; import org.apache.coyote.Response; import org.apache.tomcat.util.buf.ByteChunk; | import java.io.*; import org.apache.coyote.*; import org.apache.tomcat.util.buf.*; | [
"java.io",
"org.apache.coyote",
"org.apache.tomcat"
] | java.io; org.apache.coyote; org.apache.tomcat; | 756,540 |
public Set<ISharedObjectStatistics> getSharedObjects(String path); | Set<ISharedObjectStatistics> function(String path); | /**
* Return informations about shared objects for a given scope.
*
* @param path
* Path to scope to return shared object names for.
* @return list of informations about shared objects
*/ | Return informations about shared objects for a given scope | getSharedObjects | {
"repo_name": "maritelle/red5-server",
"path": "src/main/java/org/red5/server/api/statistics/IStatisticsService.java",
"license": "apache-2.0",
"size": 4185
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,222,565 |
public static List<InputStream> duplicateInputStream(@Nonnull InputStream stream, int numberDuplicates) throws IOException {
List<InputStream> result = new ArrayList<>();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[FileHelper.FILE_IO_BUFFER_SIZE];
... | static List<InputStream> function(@Nonnull InputStream stream, int numberDuplicates) throws IOException { List<InputStream> result = new ArrayList<>(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[FileHelper.FILE_IO_BUFFER_SIZE]; int len; while ((len = stream.read(buffer)) > -1) ba... | /**
* Duplicate the given InputStream as many times as given
*
* @param stream Initial InputStream to duplicate
* @param numberDuplicates Number of duplicates to create
* @return List containing the given number of duplicated InputStreams
* @throws IOException If anything goes wr... | Duplicate the given InputStream as many times as given | duplicateInputStream | {
"repo_name": "AVnetWS/Hentoid",
"path": "app/src/main/java/me/devsaki/hentoid/util/Helper.java",
"license": "apache-2.0",
"size": 13834
} | [
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.util.ArrayList",
"java.util.List",
"javax.annotation.Nonnull"
] | import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.annotation.Nonnull; | import java.io.*; import java.util.*; import javax.annotation.*; | [
"java.io",
"java.util",
"javax.annotation"
] | java.io; java.util; javax.annotation; | 1,182,166 |
try {
JavaClass cls = classContext.getJavaClass();
if (isSerializable(cls)) {
JavaClass superCls = cls.getSuperClass();
if (!isSerializable(superCls)) {
if (hasSerializableFields(superCls)) {
if (!hasSerializingMethods(c... | try { JavaClass cls = classContext.getJavaClass(); if (isSerializable(cls)) { JavaClass superCls = cls.getSuperClass(); if (!isSerializable(superCls)) { if (hasSerializableFields(superCls)) { if (!hasSerializingMethods(cls)) { bugReporter.reportBug(new BugInstance(this, BugType.PIS_POSSIBLE_INCOMPLETE_SERIALIZATION.nam... | /**
* implements the visitor to look for classes that are serializable, and are
* derived from non serializable classes and don't either implement methods
* in Externalizable or Serializable to save parent class fields.
*
* @param classContext
* the context object of the curren... | implements the visitor to look for classes that are serializable, and are derived from non serializable classes and don't either implement methods in Externalizable or Serializable to save parent class fields | visitClassContext | {
"repo_name": "crow-misia/fb-contrib",
"path": "src/com/mebigfatguy/fbcontrib/detect/PossibleIncompleteSerialization.java",
"license": "lgpl-2.1",
"size": 5106
} | [
"com.mebigfatguy.fbcontrib.utils.BugType",
"edu.umd.cs.findbugs.BugInstance",
"org.apache.bcel.classfile.JavaClass"
] | import com.mebigfatguy.fbcontrib.utils.BugType; import edu.umd.cs.findbugs.BugInstance; import org.apache.bcel.classfile.JavaClass; | import com.mebigfatguy.fbcontrib.utils.*; import edu.umd.cs.findbugs.*; import org.apache.bcel.classfile.*; | [
"com.mebigfatguy.fbcontrib",
"edu.umd.cs",
"org.apache.bcel"
] | com.mebigfatguy.fbcontrib; edu.umd.cs; org.apache.bcel; | 749,049 |
public Iterable<ObjectType> getAllImplementedInterfaces() {
// Store them in a linked hash set, so that the compile job is
// deterministic.
Set<ObjectType> interfaces = Sets.newLinkedHashSet();
for (ObjectType type : getImplementedInterfaces()) {
addRelatedInterfaces(type, interfaces);
}
... | Iterable<ObjectType> function() { Set<ObjectType> interfaces = Sets.newLinkedHashSet(); for (ObjectType type : getImplementedInterfaces()) { addRelatedInterfaces(type, interfaces); } return interfaces; } | /**
* Returns all interfaces implemented by a class or its superclass and any
* superclasses for any of those interfaces. If this is called before all
* types are resolved, it may return an incomplete set.
*/ | Returns all interfaces implemented by a class or its superclass and any superclasses for any of those interfaces. If this is called before all types are resolved, it may return an incomplete set | getAllImplementedInterfaces | {
"repo_name": "Dandandan/wikiprogramming",
"path": "jsrepl/tools/closure-compiler/trunk/src/com/google/javascript/rhino/jstype/FunctionType.java",
"license": "mit",
"size": 36092
} | [
"com.google.common.collect.Sets",
"java.util.Set"
] | import com.google.common.collect.Sets; import java.util.Set; | import com.google.common.collect.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 1,205,555 |
public static void notEmpty(final Collection<?> collection, final String collectionName) {
notNull(collection, collectionName);
if (collection.isEmpty()) {
throw new IllegalArgumentException("expecting " + maskNullArgument(collectionName) + " to contain 1 or more elements");
}
... | static void function(final Collection<?> collection, final String collectionName) { notNull(collection, collectionName); if (collection.isEmpty()) { throw new IllegalArgumentException(STR + maskNullArgument(collectionName) + STR); } } | /**
* Check that a collection is not empty
* @param collection the collection to check
* @param collectionName the name of the collection
* @throws IllegalArgumentException if collection is null or if the collection is empty
*/ | Check that a collection is not empty | notEmpty | {
"repo_name": "johncarl81/transfuse",
"path": "transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java",
"license": "apache-2.0",
"size": 9307
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,989,156 |
public boolean isVerifiedAppList() throws Exception {
ApplicationAdminClient applicationAdminClient = new ApplicationAdminClient(backendURL, sessionCookie);
String[] applicationList = applicationAdminClient.listAllApplications();
return Arrays.asList(applicationList).contains("WarCApp_1.0.0"... | boolean function() throws Exception { ApplicationAdminClient applicationAdminClient = new ApplicationAdminClient(backendURL, sessionCookie); String[] applicationList = applicationAdminClient.listAllApplications(); return Arrays.asList(applicationList).contains(STR); } | /**
* Verify the deployed services list
*
* @return boolean
* @throws Exception
*/ | Verify the deployed services list | isVerifiedAppList | {
"repo_name": "irham0019/product-as",
"path": "modules/integration/tests-integration/tests/src/test/java/org/wso2/appserver/integration/tests/carbonappservice/WSAS1798CAppWarUndeployTest.java",
"license": "apache-2.0",
"size": 4960
} | [
"java.util.Arrays",
"org.wso2.carbon.integration.common.admin.client.ApplicationAdminClient"
] | import java.util.Arrays; import org.wso2.carbon.integration.common.admin.client.ApplicationAdminClient; | import java.util.*; import org.wso2.carbon.integration.common.admin.client.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 413,420 |
protected void onEndBuilding() {
// signal that we've finished building.
if (runner!=null) {
// MavenBuilds may be created without their corresponding runners.
state = State.COMPLETED;
runner.checkpoints.allDone();
runner = null;
RunnerStac... | void function() { if (runner!=null) { state = State.COMPLETED; runner.checkpoints.allDone(); runner = null; RunnerStack.INSTANCE.pop(); } else { state = State.COMPLETED; } if (result == null) { result = Result.FAILURE; LOGGER.warning(toString() + STR); } RunListener.fireFinalized(this); } | /**
* Called when a job finished building normally or abnormally.
*/ | Called when a job finished building normally or abnormally | onEndBuilding | {
"repo_name": "IsCoolEntertainment/debpkg_jenkins",
"path": "core/src/main/java/hudson/model/Run.java",
"license": "mit",
"size": 68634
} | [
"hudson.model.listeners.RunListener"
] | import hudson.model.listeners.RunListener; | import hudson.model.listeners.*; | [
"hudson.model.listeners"
] | hudson.model.listeners; | 1,408,945 |
public static String toString(JSONObject jo) throws JSONException {
StringBuffer sb = new StringBuffer();
int i;
JSONArray ja;
String key;
Iterator<?> keys;
int length;
Object object;
String tagName;
String value;
// Emit <tagName
tagName = jo.optString("tagName");
if (tagName == null) {
... | static String function(JSONObject jo) throws JSONException { StringBuffer sb = new StringBuffer(); int i; JSONArray ja; String key; Iterator<?> keys; int length; Object object; String tagName; String value; tagName = jo.optString(STR); if (tagName == null) { return XML.escape(jo.toString()); } XML.noSpace(tagName); tag... | /**
* Reverse the JSONML transformation, making an XML text from a JSONObject.
* The JSONObject must contain a "tagName" property. If it has children,
* then it must have a "childNodes" property containing an array of objects.
* The other properties are attributes with string values.
*
* @param jo
* ... | Reverse the JSONML transformation, making an XML text from a JSONObject. The JSONObject must contain a "tagName" property. If it has children, then it must have a "childNodes" property containing an array of objects. The other properties are attributes with string values | toString | {
"repo_name": "GermanCoding/Nations",
"path": "Nations-1.8/src/org/json/JSONML.java",
"license": "gpl-2.0",
"size": 12859
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 74,045 |
@POST
@Path("upload-certificate")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
public CertificateRepresentation uploadJksCertificate(@Context final UriInfo uriInfo, MultipartFormDataInput input) throws IOException {
CertificateRepresentation info = getCertFr... | @Path(STR) @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) CertificateRepresentation function(@Context final UriInfo uriInfo, MultipartFormDataInput input) throws IOException { CertificateRepresentation info = getCertFromRequest(uriInfo, input); if (info.getCertificate() != null) { client... | /**
* Upload only certificate, not private key
*
* @param uriInfo
* @param input
* @return
* @throws IOException
*/ | Upload only certificate, not private key | uploadJksCertificate | {
"repo_name": "eugene-chow/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/ClientAttributeCertificateResource.java",
"license": "apache-2.0",
"size": 14248
} | [
"java.io.IOException",
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response",
"javax.ws.rs.core.UriInfo",
"org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput",
"org.keycloak.event... | import java.io.IOException; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInp... | import java.io.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.jboss.resteasy.plugins.providers.multipart.*; import org.keycloak.events.admin.*; import org.keycloak.representations.idm.*; import org.keycloak.services.*; | [
"java.io",
"javax.ws",
"org.jboss.resteasy",
"org.keycloak.events",
"org.keycloak.representations",
"org.keycloak.services"
] | java.io; javax.ws; org.jboss.resteasy; org.keycloak.events; org.keycloak.representations; org.keycloak.services; | 363,425 |
protected void onDisplayChange(ImageDisplay node)
{
if (node == null) {
setEnabled(false);
return;
}
Browser browser = model.getBrowser();
Collection l = browser.getSelectedDisplays();
if (l != null && l.size() == 1) {
Object object = node.getHierarchyOb... | void function(ImageDisplay node) { if (node == null) { setEnabled(false); return; } Browser browser = model.getBrowser(); Collection l = browser.getSelectedDisplays(); if (l != null && l.size() == 1) { Object object = node.getHierarchyObject(); if (object instanceof ImageData object instanceof DatasetData object instan... | /**
* Sets the action enabled depending on the currently selected display
* @see DataBrowserAction#onDisplayChange(ImageDisplay)
*/ | Sets the action enabled depending on the currently selected display | onDisplayChange | {
"repo_name": "joshmoore/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/actions/CreateExperimentAction.java",
"license": "gpl-2.0",
"size": 3823
} | [
"java.awt.event.ActionEvent",
"java.util.Collection",
"javax.swing.Action",
"org.openmicroscopy.shoola.agents.dataBrowser.IconManager",
"org.openmicroscopy.shoola.agents.dataBrowser.browser.Browser",
"org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay",
"org.openmicroscopy.shoola.agents.d... | import java.awt.event.ActionEvent; import java.util.Collection; import javax.swing.Action; import org.openmicroscopy.shoola.agents.dataBrowser.IconManager; import org.openmicroscopy.shoola.agents.dataBrowser.browser.Browser; import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay; import org.openmicros... | import java.awt.event.*; import java.util.*; import javax.swing.*; import org.openmicroscopy.shoola.agents.*; import org.openmicroscopy.shoola.util.ui.*; | [
"java.awt",
"java.util",
"javax.swing",
"org.openmicroscopy.shoola"
] | java.awt; java.util; javax.swing; org.openmicroscopy.shoola; | 2,221,067 |
public void createObject(MClass objectClass, String objectName) {
try {
MNewObjectStatement statement =
new MNewObjectStatement(objectClass, objectName);
USEWriter.getInstance().protocol(
"[GUI] " + statement.getShellCommand().substring(1));
... | void function(MClass objectClass, String objectName) { try { MNewObjectStatement statement = new MNewObjectStatement(objectClass, objectName); USEWriter.getInstance().protocol( STR + statement.getShellCommand().substring(1)); fSession.system().execute(statement); } catch (MSystemException e) { JOptionPane.showMessageDi... | /**
* Creates a new object. Keeps track of undo information and handles errors
* on the GUI level.
*/ | Creates a new object. Keeps track of undo information and handles errors on the GUI level | createObject | {
"repo_name": "anonymous100001/maxuse",
"path": "src/gui/org/tzi/use/gui/main/MainWindow.java",
"license": "gpl-2.0",
"size": 75637
} | [
"javax.swing.AbstractAction",
"javax.swing.Icon",
"javax.swing.JOptionPane",
"org.tzi.use.uml.mm.MClass",
"org.tzi.use.uml.sys.MSystemException",
"org.tzi.use.uml.sys.soil.MNewObjectStatement",
"org.tzi.use.util.USEWriter"
] | import javax.swing.AbstractAction; import javax.swing.Icon; import javax.swing.JOptionPane; import org.tzi.use.uml.mm.MClass; import org.tzi.use.uml.sys.MSystemException; import org.tzi.use.uml.sys.soil.MNewObjectStatement; import org.tzi.use.util.USEWriter; | import javax.swing.*; import org.tzi.use.uml.mm.*; import org.tzi.use.uml.sys.*; import org.tzi.use.uml.sys.soil.*; import org.tzi.use.util.*; | [
"javax.swing",
"org.tzi.use"
] | javax.swing; org.tzi.use; | 1,032,585 |
public static boolean changeReplicaLength(MiniDFSCluster cluster,
ExtendedBlock blk, int dnIndex, int lenDelta) throws IOException {
File blockFile = cluster.getBlockFile(dnIndex, blk);
if (blockFile != null && blockFile.exists()) {
RandomAccessFile raFile = new RandomAccessFile(blockFile, "rw");
... | static boolean function(MiniDFSCluster cluster, ExtendedBlock blk, int dnIndex, int lenDelta) throws IOException { File blockFile = cluster.getBlockFile(dnIndex, blk); if (blockFile != null && blockFile.exists()) { RandomAccessFile raFile = new RandomAccessFile(blockFile, "rw"); raFile.setLength(raFile.length()+lenDelt... | /**
* Change the length of a block at datanode dnIndex
*/ | Change the length of a block at datanode dnIndex | changeReplicaLength | {
"repo_name": "qqming113/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java",
"license": "apache-2.0",
"size": 66814
} | [
"java.io.File",
"java.io.IOException",
"java.io.RandomAccessFile",
"org.apache.hadoop.hdfs.protocol.ExtendedBlock"
] | import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import org.apache.hadoop.hdfs.protocol.ExtendedBlock; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,375,513 |
@Deprecated
protected Account getUnexpiredContinuationAccountOrNull(Account account) {
return accountService.getUnexpiredContinuationAccountOrNull(account);
} | Account function(Account account) { return accountService.getUnexpiredContinuationAccountOrNull(account); } | /**
* Method moved to AccountService, use method there instead. Same logic.
* @see org.kuali.kfs.coa.service.AccountService#getUnexpiredContinuationAccountOrNull(org.kuali.kfs.coa.businessobject.Account)
*/ | Method moved to AccountService, use method there instead. Same logic | getUnexpiredContinuationAccountOrNull | {
"repo_name": "ua-eas/kfs-devops-automation-fork",
"path": "kfs-core/src/main/java/org/kuali/kfs/sys/document/service/impl/AccountingLineRuleHelperServiceImpl.java",
"license": "agpl-3.0",
"size": 29425
} | [
"org.kuali.kfs.coa.businessobject.Account"
] | import org.kuali.kfs.coa.businessobject.Account; | import org.kuali.kfs.coa.businessobject.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,464,563 |
public final synchronized void setPositiveList(Collection positiveList)
{
if (posList.size() == 0)
posList.addAll(positiveList);
else {
posList = new HashSet(positiveList);
// remove old keys not in the new list anymore
for (final Iterator i = map.keySet().iterator(); i.hasNext(); )
if (... | final synchronized void function(Collection positiveList) { if (posList.size() == 0) posList.addAll(positiveList); else { posList = new HashSet(positiveList); for (final Iterator i = map.keySet().iterator(); i.hasNext(); ) if (!posList.contains(i.next())) i.remove(); } } | /**
* Sets a new positive list for this cache.
* <p>
* The old list is discarded. All cache objects will be updated immediately
* according to the new list.
*
* @param positiveList a Collection holding the allowed keys for this cache
*/ | Sets a new positive list for this cache. The old list is discarded. All cache objects will be updated immediately according to the new list | setPositiveList | {
"repo_name": "ow2-chameleon/fuchsia",
"path": "bases/knx/calimero/src/main/java/tuwien/auto/calimero/buffer/cache/PositiveListCache.java",
"license": "apache-2.0",
"size": 7484
} | [
"java.util.Collection",
"java.util.HashSet",
"java.util.Iterator"
] | import java.util.Collection; import java.util.HashSet; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 84,098 |
private MediaContainer serializeResource(String resourceURL)
throws MalformedURLException, IOException, Exception {
MediaContainer mediaContainer;
URL url = new URL(resourceURL);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
// We only want the updated data if something has changed.
co... | MediaContainer function(String resourceURL) throws MalformedURLException, IOException, Exception { MediaContainer mediaContainer; URL url = new URL(resourceURL); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.addRequestProperty(STR, STR); mediaContainer = serializer.read(MediaContainer.class, con... | /**
* Given a resource's URL, read and return the serialized MediaContainer
* @param resourceURL
* @return
* @throws MalformedURLException
* @throws IOException
* @throws Exception
*/ | Given a resource's URL, read and return the serialized MediaContainer | serializeResource | {
"repo_name": "0359xiaodong/serenity-android",
"path": "plexapp-rest-library/src/main/java/us/nineworlds/plex/rest/PlexappFactory.java",
"license": "mit",
"size": 9303
} | [
"java.io.IOException",
"java.net.HttpURLConnection",
"java.net.MalformedURLException",
"us.nineworlds.plex.rest.model.impl.MediaContainer"
] | import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import us.nineworlds.plex.rest.model.impl.MediaContainer; | import java.io.*; import java.net.*; import us.nineworlds.plex.rest.model.impl.*; | [
"java.io",
"java.net",
"us.nineworlds.plex"
] | java.io; java.net; us.nineworlds.plex; | 1,610,771 |
protected void resize(int d) {
this.d = d;
List<T>[] oldTable = t;
t = allocTable(1<<d);
for (int i = 0; i < oldTable.length; i++) {
for (T x : oldTable[i]) {
add(x);
}
}
}
| void function(int d) { this.d = d; List<T>[] oldTable = t; t = allocTable(1<<d); for (int i = 0; i < oldTable.length; i++) { for (T x : oldTable[i]) { add(x); } } } | /**
* Resize the table so that it has size 2^d
*/ | Resize the table so that it has size 2^d | resize | {
"repo_name": "UNIT-Research-Development/PlayGround",
"path": "AbstractDataTypes/src/ods/HashTable.java",
"license": "epl-1.0",
"size": 4303
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,890,285 |
public static Jode load(InputStream in, String rootNode) {
return load(in).single(rootNode);
} | static Jode function(InputStream in, String rootNode) { return load(in).single(rootNode); } | /**
* Creates a Jocument out of the given stream and makes the given node name the root of the Jocument
*
* @param in
* the XML file stream
* @return a Jocument represent the given xml file
*/ | Creates a Jocument out of the given stream and makes the given node name the root of the Jocument | load | {
"repo_name": "jjnguy/Jinq2XML",
"path": "src/main/java/com/jjnguy/xmlcomponents/Jocument.java",
"license": "mit",
"size": 3950
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,853,889 |
@Test
public void testFoldingStateDefaultValue() throws Exception {
AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE);
FoldingStateDescriptor<Integer, String> kvId =
new FoldingStateDescriptor<>("id", "Fold-Initial:", new AppendingFold(), String.class);
FoldingState... | void function() throws Exception { AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE); FoldingStateDescriptor<Integer, String> kvId = new FoldingStateDescriptor<>("id", STR, new AppendingFold(), String.class); FoldingState<Integer, String> state = backend.getPartitionedState( VoidNa... | /**
* Verify that an empty {@code FoldingState} yields {@code null}.
*/ | Verify that an empty FoldingState yields null | testFoldingStateDefaultValue | {
"repo_name": "DieBauer/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java",
"license": "apache-2.0",
"size": 91277
} | [
"org.apache.flink.api.common.state.FoldingState",
"org.apache.flink.api.common.state.FoldingStateDescriptor",
"org.apache.flink.api.common.typeutils.base.IntSerializer",
"org.junit.Assert"
] | import org.apache.flink.api.common.state.FoldingState; import org.apache.flink.api.common.state.FoldingStateDescriptor; import org.apache.flink.api.common.typeutils.base.IntSerializer; import org.junit.Assert; | import org.apache.flink.api.common.state.*; import org.apache.flink.api.common.typeutils.base.*; import org.junit.*; | [
"org.apache.flink",
"org.junit"
] | org.apache.flink; org.junit; | 2,644,749 |
void getCurrentUserRole(AsyncCallback<SessionManagementService.Result> callback);
| void getCurrentUserRole(AsyncCallback<SessionManagementService.Result> callback); | /**
* Gets the current user role.
*
* @param callback
* the callback
* @return the current user role
*/ | Gets the current user role | getCurrentUserRole | {
"repo_name": "MeasureAuthoringTool/MeasureAuthoringTool_Release",
"path": "mat/src/main/java/mat/client/login/service/SessionManagementServiceAsync.java",
"license": "cc0-1.0",
"size": 814
} | [
"com.google.gwt.user.client.rpc.AsyncCallback"
] | import com.google.gwt.user.client.rpc.AsyncCallback; | import com.google.gwt.user.client.rpc.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,094,685 |
public static boolean isVector(int[] shape) {
if (shape.length > 2 || shape.length < 1)
return false;
else {
long len = ArrayUtil.prodLong(shape);
return shape[0] == len || shape[1] == len;
}
} | static boolean function(int[] shape) { if (shape.length > 2 shape.length < 1) return false; else { long len = ArrayUtil.prodLong(shape); return shape[0] == len shape[1] == len; } } | /**
* Returns whether the given shape is a vector
*
* @param shape the shape to test
* @return whether the given shape is a vector
*/ | Returns whether the given shape is a vector | isVector | {
"repo_name": "huitseeker/nd4j",
"path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java",
"license": "apache-2.0",
"size": 76141
} | [
"org.nd4j.linalg.util.ArrayUtil"
] | import org.nd4j.linalg.util.ArrayUtil; | import org.nd4j.linalg.util.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 1,722,790 |
return Uri.fromFile(getOutputMediaFile());
} | return Uri.fromFile(getOutputMediaFile()); } | /**
* Create a file Uri for saving an image or video
*/ | Create a file Uri for saving an image or video | getOutputMediaFileUri | {
"repo_name": "FoodBook/android_app",
"path": "app/src/main/java/tk/lenkyun/foodbook/foodbook/Client/Helper/Interface/CameraHelper.java",
"license": "apache-2.0",
"size": 4558
} | [
"android.net.Uri"
] | import android.net.Uri; | import android.net.*; | [
"android.net"
] | android.net; | 1,712 |
CompilationUnit createCompilationUnit(File outputClassDirectory); | CompilationUnit createCompilationUnit(File outputClassDirectory); | /**
* Create a compilation unit for the supplied output class directory.
* @param outputClassDirectory output class directory
* @return compilation unit
*/ | Create a compilation unit for the supplied output class directory | createCompilationUnit | {
"repo_name": "zhenghx1105/compilation-toolbox",
"path": "src/main/java/org/abstractmeta/toolbox/compilation/compiler/JavaSourceCompiler.java",
"license": "apache-2.0",
"size": 5778
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 616,897 |
public Builder btnStackedGravity(@NonNull GravityEnum gravity) {
this.btnStackedGravity = gravity;
return this;
} | Builder function(@NonNull GravityEnum gravity) { this.btnStackedGravity = gravity; return this; } | /**
* Sets the gravity used for the text in stacked action buttons. By default, it's #{@link GravityEnum#END}.
*
* @param gravity The gravity to use.
* @return The Builder instance so calls can be chained.
*/ | Sets the gravity used for the text in stacked action buttons. By default, it's #<code>GravityEnum#END</code> | btnStackedGravity | {
"repo_name": "lcyluo/material-dialogs",
"path": "library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java",
"license": "mit",
"size": 67271
} | [
"android.support.annotation.NonNull"
] | import android.support.annotation.NonNull; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 2,355,170 |
public double getDx(double x)
{
if (len.length == 0 || len.length == 1)
{
return 0;
}
int index = Arrays.binarySearch(len, x);
if (index < 0)
{
index = - (index + 1) - 1;
}
return b[index]
+ 2 * c[index] * (x - len[index])
+ 3 * d[index] * Math.pow(x - len[index], 2);
} | double function(double x) { if (len.length == 0 len.length == 1) { return 0; } int index = Arrays.binarySearch(len, x); if (index < 0) { index = - (index + 1) - 1; } return b[index] + 2 * c[index] * (x - len[index]) + 3 * d[index] * Math.pow(x - len[index], 2); } | /**
* Returns the first derivation at x.
* @param x
* @return the first derivation at x
*/ | Returns the first derivation at x | getDx | {
"repo_name": "JanaWengenroth/GKA1",
"path": "libraries/jgraphx/src/com/mxgraph/util/mxSpline1D.java",
"license": "gpl-2.0",
"size": 5124
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 552,918 |
JagexConfiguration configuration = new JagexConfiguration();
try (BufferedReader reader = new BufferedReader(new InputStreamReader(configUrl.openStream()))) {
String line;
while ((line = reader.readLine()) != null) {
if (line.trim().length() < 1) continue;
String key = line.substring(0, line.indexOf(... | JagexConfiguration configuration = new JagexConfiguration(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(configUrl.openStream()))) { String line; while ((line = reader.readLine()) != null) { if (line.trim().length() < 1) continue; String key = line.substring(0, line.indexOf('=')); String value... | /**
* Parse the configuration file
* @return The parsed JagexConfiguration object
* @throws IOException If an IO error occurred, usually connection related
*/ | Parse the configuration file | parse | {
"repo_name": "nikkiii/rslite",
"path": "src/main/java/org/rslite/jagex/JagexConfigurationParser.java",
"license": "isc",
"size": 1296
} | [
"java.io.BufferedReader",
"java.io.InputStreamReader"
] | import java.io.BufferedReader; import java.io.InputStreamReader; | import java.io.*; | [
"java.io"
] | java.io; | 1,875,436 |
void addShape(long id, Coord3D coord, ROIShape shape)
throws ROICreationException, NoSuchROIException
{
roiComponent.addShape(id, coord, shape);
} | void addShape(long id, Coord3D coord, ROIShape shape) throws ROICreationException, NoSuchROIException { roiComponent.addShape(id, coord, shape); } | /**
* Adds a new shape to the ROI component.
*
* @param id
* @param coord
* @param shape
* @throws ROICreationException
* @throws NoSuchROIException
*/ | Adds a new shape to the ROI component | addShape | {
"repo_name": "bramalingam/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerModel.java",
"license": "gpl-2.0",
"size": 50321
} | [
"org.openmicroscopy.shoola.util.roi.exception.NoSuchROIException",
"org.openmicroscopy.shoola.util.roi.exception.ROICreationException",
"org.openmicroscopy.shoola.util.roi.model.ROIShape",
"org.openmicroscopy.shoola.util.roi.model.util.Coord3D"
] | import org.openmicroscopy.shoola.util.roi.exception.NoSuchROIException; import org.openmicroscopy.shoola.util.roi.exception.ROICreationException; import org.openmicroscopy.shoola.util.roi.model.ROIShape; import org.openmicroscopy.shoola.util.roi.model.util.Coord3D; | import org.openmicroscopy.shoola.util.roi.exception.*; import org.openmicroscopy.shoola.util.roi.model.*; import org.openmicroscopy.shoola.util.roi.model.util.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 1,753,880 |
public static InputStream getSystemResourceAsStream(String name) {
URL url = getSystemResource(name);
try {
return url != null ? url.openStream() : null;
} catch (IOException e) {
return null;
}
}
// -- Hierarchy -- | static InputStream function(String name) { URL url = getSystemResource(name); try { return url != null ? url.openStream() : null; } catch (IOException e) { return null; } } | /**
* Open for reading, a resource of the specified name from the search path
* used to load classes. This method locates the resource through the
* system class loader (see {@link #getSystemClassLoader()}). </p>
*
* @param name
* The resource name
*
* @return An inpu... | Open for reading, a resource of the specified name from the search path used to load classes. This method locates the resource through the system class loader (see <code>#getSystemClassLoader()</code>). | getSystemResourceAsStream | {
"repo_name": "ZhaoX/jdk-1.7-annotated",
"path": "src/java/lang/ClassLoader.java",
"license": "apache-2.0",
"size": 84190
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 645,176 |
private void fireEvent(final IDebugEvent event) {
if (Activator.getDefault().isDebugging())
System.out.println("Debugger : new " + event);
fDispatcher.addEvent(event);
}
| void function(final IDebugEvent event) { if (Activator.getDefault().isDebugging()) System.out.println(STR + event); fDispatcher.addEvent(event); } | /**
* Pass an event to the {@link EventDispatchJob} where it is handled asynchronously.
*
* @param event
* event to handle
*/ | Pass an event to the <code>EventDispatchJob</code> where it is handled asynchronously | fireEvent | {
"repo_name": "Pontesegger/codeandme",
"path": "debugger/12_memory/com.codeandme.debugger.textinterpreter.debugger/src/com/codeandme/debugger/textinterpreter/debugger/TextDebugger.java",
"license": "epl-1.0",
"size": 5440
} | [
"com.codeandme.debugger.textinterpreter.debugger.events.IDebugEvent"
] | import com.codeandme.debugger.textinterpreter.debugger.events.IDebugEvent; | import com.codeandme.debugger.textinterpreter.debugger.events.*; | [
"com.codeandme.debugger"
] | com.codeandme.debugger; | 1,199,840 |
private String validatePathForCreate(String path, long sessionId)
throws BadArgumentsException {
int lastSlash = path.lastIndexOf('/');
if (lastSlash == -1 || path.indexOf('\0') != -1 || failCreate) {
LOG.info("Invalid path " + path + " with session 0x" +
... | String function(String path, long sessionId) throws BadArgumentsException { int lastSlash = path.lastIndexOf('/'); if (lastSlash == -1 path.indexOf('\0') != -1 failCreate) { LOG.info(STR + path + STR + Long.toHexString(sessionId)); throw new KeeperException.BadArgumentsException(path); } return path.substring(0, lastSl... | /**
* Performs basic validation of a path for a create request.
* Throws if the path is not valid and returns the parent path.
* @throws BadArgumentsException
*/ | Performs basic validation of a path for a create request. Throws if the path is not valid and returns the parent path | validatePathForCreate | {
"repo_name": "project-zerus/zookeeper",
"path": "src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java",
"license": "apache-2.0",
"size": 45370
} | [
"org.apache.zookeeper.KeeperException"
] | import org.apache.zookeeper.KeeperException; | import org.apache.zookeeper.*; | [
"org.apache.zookeeper"
] | org.apache.zookeeper; | 1,054,548 |
void reportBadBlocks(LocatedBlock[] blocks) throws IOException {
checkOperation(OperationCategory.WRITE);
writeLock();
try {
checkOperation(OperationCategory.WRITE);
for (int i = 0; i < blocks.length; i++) {
ExtendedBlock blk = blocks[i].getBlock();
DatanodeInfo[] nodes = block... | void reportBadBlocks(LocatedBlock[] blocks) throws IOException { checkOperation(OperationCategory.WRITE); writeLock(); try { checkOperation(OperationCategory.WRITE); for (int i = 0; i < blocks.length; i++) { ExtendedBlock blk = blocks[i].getBlock(); DatanodeInfo[] nodes = blocks[i].getLocations(); String[] storageIDs =... | /**
* Client is reporting some bad block locations.
*/ | Client is reporting some bad block locations | reportBadBlocks | {
"repo_name": "jiayuhan-it/yarn-jyhtest",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 298813
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.DatanodeInfo",
"org.apache.hadoop.hdfs.protocol.ExtendedBlock",
"org.apache.hadoop.hdfs.protocol.LocatedBlock",
"org.apache.hadoop.hdfs.server.namenode.NameNode"
] | import java.io.IOException; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; import org.apache.hadoop.hdfs.protocol.ExtendedBlock; import org.apache.hadoop.hdfs.protocol.LocatedBlock; import org.apache.hadoop.hdfs.server.namenode.NameNode; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.namenode.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,455,215 |
public void testConvertToVector()
{
MutableDouble instance = new MutableDouble();
Vector1 result = instance.convertToVector();
assertEquals(0.0, result.getX(), 0.0);
double value = this.randomDouble();
instance.setValue(value);
assertEquals(0.0, result.getX(), 0.... | void function() { MutableDouble instance = new MutableDouble(); Vector1 result = instance.convertToVector(); assertEquals(0.0, result.getX(), 0.0); double value = this.randomDouble(); instance.setValue(value); assertEquals(0.0, result.getX(), 0.0); result = instance.convertToVector(); assertEquals(value, result.getX(),... | /**
* Test of convertToVector method, of class MutableDouble.
*/ | Test of convertToVector method, of class MutableDouble | testConvertToVector | {
"repo_name": "codeaudit/Foundry",
"path": "Components/CommonCore/Test/gov/sandia/cognition/math/MutableDoubleTest.java",
"license": "bsd-3-clause",
"size": 14237
} | [
"gov.sandia.cognition.math.matrix.mtj.Vector1"
] | import gov.sandia.cognition.math.matrix.mtj.Vector1; | import gov.sandia.cognition.math.matrix.mtj.*; | [
"gov.sandia.cognition"
] | gov.sandia.cognition; | 894,556 |
public void initGL(int viewWidth, int viewHeight, Vector4f color); | void function(int viewWidth, int viewHeight, Vector4f color); | /**
* This method initializes the base GL state
* @param viewWidth - view area width
* @param viewHeight - view area height
* @param color - color that will be used as a base background when the screen will be updated
*/ | This method initializes the base GL state | initGL | {
"repo_name": "jVirus/jToolkit",
"path": "src/main/Pipeline.java",
"license": "mit",
"size": 2348
} | [
"org.lwjgl.util.vector.Vector4f"
] | import org.lwjgl.util.vector.Vector4f; | import org.lwjgl.util.vector.*; | [
"org.lwjgl.util"
] | org.lwjgl.util; | 1,631,177 |
public void usage(@Nullable GlobalMetadata global, CommandGroupMetadata group)
{
StringBuilder stringBuilder = new StringBuilder();
usage(global, group, stringBuilder);
System.out.println(stringBuilder.toString());
} | void function(@Nullable GlobalMetadata global, CommandGroupMetadata group) { StringBuilder stringBuilder = new StringBuilder(); usage(global, group, stringBuilder); System.out.println(stringBuilder.toString()); } | /**
* Display the help on System.out.
*/ | Display the help on System.out | usage | {
"repo_name": "electrum/airline",
"path": "src/main/java/io/airlift/airline/CommandGroupUsage.java",
"license": "apache-2.0",
"size": 6720
} | [
"io.airlift.airline.model.CommandGroupMetadata",
"io.airlift.airline.model.GlobalMetadata",
"javax.annotation.Nullable"
] | import io.airlift.airline.model.CommandGroupMetadata; import io.airlift.airline.model.GlobalMetadata; import javax.annotation.Nullable; | import io.airlift.airline.model.*; import javax.annotation.*; | [
"io.airlift.airline",
"javax.annotation"
] | io.airlift.airline; javax.annotation; | 1,104,187 |
private static ObjectStreamField[] getDefaultSerialFields(Class<?> cl) {
Field[] clFields = cl.getDeclaredFields();
ArrayList<ObjectStreamField> list = new ArrayList<>();
int mask = Modifier.STATIC | Modifier.TRANSIENT;
for (int i = 0; i < clFields.length; i++) {
if ((cl... | static ObjectStreamField[] function(Class<?> cl) { Field[] clFields = cl.getDeclaredFields(); ArrayList<ObjectStreamField> list = new ArrayList<>(); int mask = Modifier.STATIC Modifier.TRANSIENT; for (int i = 0; i < clFields.length; i++) { if ((clFields[i].getModifiers() & mask) == 0) { list.add(new ObjectStreamField(c... | /**
* Returns array of ObjectStreamFields corresponding to all non-static
* non-transient fields declared by given class. Each ObjectStreamField
* contains a Field object for the field it represents. If no default
* serializable fields exist, NO_FIELDS is returned.
*/ | Returns array of ObjectStreamFields corresponding to all non-static non-transient fields declared by given class. Each ObjectStreamField contains a Field object for the field it represents. If no default serializable fields exist, NO_FIELDS is returned | getDefaultSerialFields | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/java/io/ObjectStreamClass.java",
"license": "apache-2.0",
"size": 86092
} | [
"java.lang.reflect.Field",
"java.lang.reflect.Modifier",
"java.util.ArrayList"
] | import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 2,650,956 |
public static void i(String tag, String s) {
if (LOG.INFO >= LOGLEVEL) Log.i(tag, s);
} | static void function(String tag, String s) { if (LOG.INFO >= LOGLEVEL) Log.i(tag, s); } | /**
* Info log message.
*
* @param tag
* @param s
*/ | Info log message | i | {
"repo_name": "wufan123/cordova-plugin-push",
"path": "src/android/LOG.java",
"license": "apache-2.0",
"size": 5891
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 181,892 |
public final class RtUsersTest {
@Test
public void iterateUsers() throws Exception {
final String identifier = "1";
final MkContainer container = new MkGrizzlyContainer().next(
new MkAnswer.Simple(
HttpURLConnection.HTTP_OK,
Json.createArrayBuilde... | final class RtUsersTest { public void function() throws Exception { final String identifier = "1"; final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createArrayBuilder() .add(RtUsersTest.json(STR, identifier)) .add(RtUsersTest.json("dummy", "2")) .build().... | /**
* RtUsers can iterate users.
* @throws Exception if there is any error
*/ | RtUsers can iterate users | iterateUsers | {
"repo_name": "cvrebert/typed-github",
"path": "src/test/java/com/jcabi/github/RtUsersTest.java",
"license": "bsd-3-clause",
"size": 4917
} | [
"com.jcabi.http.mock.MkAnswer",
"com.jcabi.http.mock.MkContainer",
"com.jcabi.http.mock.MkGrizzlyContainer",
"com.jcabi.http.request.ApacheRequest",
"java.net.HttpURLConnection",
"javax.json.Json",
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.mockito.Mockito"
] | import com.jcabi.http.mock.MkAnswer; import com.jcabi.http.mock.MkContainer; import com.jcabi.http.mock.MkGrizzlyContainer; import com.jcabi.http.request.ApacheRequest; import java.net.HttpURLConnection; import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.mockito.Mockito; | import com.jcabi.http.mock.*; import com.jcabi.http.request.*; import java.net.*; import javax.json.*; import org.hamcrest.*; import org.mockito.*; | [
"com.jcabi.http",
"java.net",
"javax.json",
"org.hamcrest",
"org.mockito"
] | com.jcabi.http; java.net; javax.json; org.hamcrest; org.mockito; | 342,373 |
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether this contact is being watched")
public Boolean getIsWatched() {
return isWatched;
} | @javax.annotation.Nullable @ApiModelProperty(value = STR) Boolean function() { return isWatched; } | /**
* Whether this contact is being watched
*
* @return isWatched
**/ | Whether this contact is being watched | getIsWatched | {
"repo_name": "burberius/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/CorporationContactsResponse.java",
"license": "apache-2.0",
"size": 8026
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 926,468 |
public void openDrawer(View drawerView) {
if (!isDrawerView(drawerView)) {
throw new IllegalArgumentException("View " + drawerView + " is not a sliding drawer");
}
if (mFirstLayout) {
final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
lp... | void function(View drawerView) { if (!isDrawerView(drawerView)) { throw new IllegalArgumentException(STR + drawerView + STR); } if (mFirstLayout) { final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams(); lp.onScreen = 1.f; lp.knownOpen = true; } else { if (checkDrawerViewAbsoluteGravity(drawerView, Gravity... | /**
* Open the specified drawer view by animating it into view.
*
* @param drawerView Drawer view to open
*/ | Open the specified drawer view by animating it into view | openDrawer | {
"repo_name": "mattlogan/ReverseDrawerLayout",
"path": "library/src/main/java/com/matthewlogan/reversedrawerlayout/library/ReverseDrawerLayout.java",
"license": "mit",
"size": 64597
} | [
"android.view.Gravity",
"android.view.View"
] | import android.view.Gravity; import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,246,902 |
public static void applyDefaultOrientation(Component comp) {
applyOrientation(comp, new Language(Locale.getDefault().getLanguage()).isLeftToRight());
}
| static void function(Component comp) { applyOrientation(comp, new Language(Locale.getDefault().getLanguage()).isLeftToRight()); } | /**
* Recursively apply default component orientation to the component and all
* it contains.
*
* @param comp
* the root of the tree to which orientation needs to be applied
*/ | Recursively apply default component orientation to the component and all it contains | applyDefaultOrientation | {
"repo_name": "truhanen/JSana",
"path": "JSana/src_others/org/crosswire/common/swing/GuiUtil.java",
"license": "gpl-2.0",
"size": 20415
} | [
"java.awt.Component",
"java.util.Locale",
"org.crosswire.common.util.Language"
] | import java.awt.Component; import java.util.Locale; import org.crosswire.common.util.Language; | import java.awt.*; import java.util.*; import org.crosswire.common.util.*; | [
"java.awt",
"java.util",
"org.crosswire.common"
] | java.awt; java.util; org.crosswire.common; | 2,131,798 |
boolean assignStationsAfter( DBlock blk0, List< DBlock > list )
{
Set<String> sts = mData.selectAllStationsBefore( blk0.mId, TDInstance.sid );
// TDLog.v("DATA " + "assign stations after " + blk0.Name() + " size " + list.size() + " stations " + sts.size() );
// if ( TDSetting.mSurveyStations < 0 ) ret... | boolean assignStationsAfter( DBlock blk0, List< DBlock > list ) { Set<String> sts = mData.selectAllStationsBefore( blk0.mId, TDInstance.sid ); StationName.clearCurrentStation(); if ( StationPolicy.doTopoRobot() ) { return new StationNameTRobot(this, mData, TDInstance.sid ).assignStationsAfter( blk0, list, sts ); } else... | /** called also by ShotWindow::updataBlockList
* this re-assign stations to shots with station(s) already set
* the list of stations is ordered by compare
*
* @param blk0 block after whcih to assign stations
* @param list list of shot to assign
* @return ???
*/ | called also by ShotWindow::updataBlockList this re-assign stations to shots with station(s) already set the list of stations is ordered by compare | assignStationsAfter | {
"repo_name": "marcocorvi/topodroid",
"path": "src/com/topodroid/DistoX/TopoDroidApp.java",
"license": "gpl-3.0",
"size": 106607
} | [
"java.util.List",
"java.util.Set"
] | import java.util.List; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,521,128 |
public void setTimestampedData(DSSDocument document) {
Objects.requireNonNull(document, "The document is null");
setDetachedContents(Arrays.asList(document));
} | void function(DSSDocument document) { Objects.requireNonNull(document, STR); setDetachedContents(Arrays.asList(document)); } | /**
* Sets the data that has been timestamped
*
* @param document {@link DSSDocument} timestamped data
*/ | Sets the data that has been timestamped | setTimestampedData | {
"repo_name": "esig/dss",
"path": "dss-document/src/main/java/eu/europa/esig/dss/validation/timestamp/DetachedTimestampValidator.java",
"license": "lgpl-2.1",
"size": 6158
} | [
"eu.europa.esig.dss.model.DSSDocument",
"java.util.Arrays",
"java.util.Objects"
] | import eu.europa.esig.dss.model.DSSDocument; import java.util.Arrays; import java.util.Objects; | import eu.europa.esig.dss.model.*; import java.util.*; | [
"eu.europa.esig",
"java.util"
] | eu.europa.esig; java.util; | 2,261,637 |
private static OMElement getRootElement(String filePath) throws XMLStreamException, IOException {
File claimConfigFile = new File(filePath);
InputStream inStream = new BufferedInputStream(new FileInputStream(claimConfigFile));
return new StAXOMBuilder(inStream).getDocumentElement();
} | static OMElement function(String filePath) throws XMLStreamException, IOException { File claimConfigFile = new File(filePath); InputStream inStream = new BufferedInputStream(new FileInputStream(claimConfigFile)); return new StAXOMBuilder(inStream).getDocumentElement(); } | /**
* Get elements from the claim config xml files to be read.
*
* @return elements from the config file
* @throws XMLStreamException XMLStreamException
* @throws IOException IOException
*/ | Get elements from the claim config xml files to be read | getRootElement | {
"repo_name": "milindaperera/product-is",
"path": "modules/migration/migration-service/src/main/java/org/wso2/carbon/is/migration/service/v540/util/FileBasedClaimBuilder.java",
"license": "apache-2.0",
"size": 8128
} | [
"java.io.BufferedInputStream",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream",
"javax.xml.stream.XMLStreamException",
"org.apache.axiom.om.OMElement",
"org.apache.axiom.om.impl.builder.StAXOMBuilder"
] | import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import javax.xml.stream.XMLStreamException; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.impl.builder.StAXOMBuilder; | import java.io.*; import javax.xml.stream.*; import org.apache.axiom.om.*; import org.apache.axiom.om.impl.builder.*; | [
"java.io",
"javax.xml",
"org.apache.axiom"
] | java.io; javax.xml; org.apache.axiom; | 1,354,480 |
Observable<ImageAnalysis> executeAsync();
}
}
interface ComputerVisionAnalyzeImageDefinition extends
ComputerVisionAnalyzeImageDefinitionStages.WithUrl,
ComputerVisionAnalyzeImageDefinitionStages.WithExecute {
} | Observable<ImageAnalysis> executeAsync(); } } interface ComputerVisionAnalyzeImageDefinition extends ComputerVisionAnalyzeImageDefinitionStages.WithUrl, ComputerVisionAnalyzeImageDefinitionStages.WithExecute { } | /**
* Execute the request asynchronously.
*
* @return the observable to the ImageAnalysis object
*/ | Execute the request asynchronously | executeAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/ComputerVision.java",
"license": "mit",
"size": 77568
} | [
"com.microsoft.azure.cognitiveservices.vision.computervision.models.ImageAnalysis"
] | import com.microsoft.azure.cognitiveservices.vision.computervision.models.ImageAnalysis; | import com.microsoft.azure.cognitiveservices.vision.computervision.models.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,396,345 |
private JSGLRI getParser(ILanguage lang, FileObject file, IStrategoTerm ast) throws IOException {
if(lang == null)
return null;
IStrategoTerm start = ESVReader.findTerm(ast, topsort_1.getName());
// start symbol creation is copied from the previous configure method
// TOD... | JSGLRI function(ILanguage lang, FileObject file, IStrategoTerm ast) throws IOException { if(lang == null) return null; IStrategoTerm start = ESVReader.findTerm(ast, topsort_1.getName()); String startSymbol = start == null ? null : asJavaString(start.getSubterm(0)); final ServiceRegistry services = ServiceRegistry.INSTA... | /**
* Creates a JSGLRI parser for the given language and file.
*
* @param lang
* the language which we should parse.
* @param file
* the file that this parser should parse.
* @param ast
* TODO I don't know what it should represent, but it is used... | Creates a JSGLRI parser for the given language and file | getParser | {
"repo_name": "MartijnDwars/spt",
"path": "org.strategoxt.imp.testing.cmd/editor/java/org/strategoxt/imp/testing/cmd/strategies/FragmentParser.java",
"license": "lgpl-2.1",
"size": 13750
} | [
"com.google.inject.TypeLiteral",
"java.io.IOException",
"org.apache.commons.vfs2.FileObject",
"org.metaborg.spoofax.core.language.ILanguage",
"org.metaborg.spoofax.core.syntax.ISyntaxService",
"org.metaborg.spoofax.core.syntax.jsglr.IParserConfig",
"org.metaborg.spoofax.core.syntax.jsglr.JSGLRParseServi... | import com.google.inject.TypeLiteral; import java.io.IOException; import org.apache.commons.vfs2.FileObject; import org.metaborg.spoofax.core.language.ILanguage; import org.metaborg.spoofax.core.syntax.ISyntaxService; import org.metaborg.spoofax.core.syntax.jsglr.IParserConfig; import org.metaborg.spoofax.core.syntax.j... | import com.google.inject.*; import java.io.*; import org.apache.commons.vfs2.*; import org.metaborg.spoofax.core.language.*; import org.metaborg.spoofax.core.syntax.*; import org.metaborg.spoofax.core.syntax.jsglr.*; import org.metaborg.spoofax.core.text.*; import org.metaborg.sunshine.environment.*; import org.metabor... | [
"com.google.inject",
"java.io",
"org.apache.commons",
"org.metaborg.spoofax",
"org.metaborg.sunshine",
"org.spoofax.interpreter"
] | com.google.inject; java.io; org.apache.commons; org.metaborg.spoofax; org.metaborg.sunshine; org.spoofax.interpreter; | 1,447,306 |
public Structure getStructureForDomain(ScopDomain domain, ScopDatabase scopDatabase, boolean strictLigandHandling)
throws IOException, StructureException {
String pdbId = domain.getPdbId();
Structure fullStructure = getStructure(pdbId);
// build the substructure
StringBuilder rangeString = new StringBui... | Structure function(ScopDomain domain, ScopDatabase scopDatabase, boolean strictLigandHandling) throws IOException, StructureException { String pdbId = domain.getPdbId(); Structure fullStructure = getStructure(pdbId); StringBuilder rangeString = new StringBuilder(); Iterator<String> iter = domain.getRanges().iterator();... | /**
* Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
*
* @param domain
* a SCOP domain
* @param scopDatabase
* A {@link ScopDatabase} to use
* @param strictLigandHandling
* If set to false, hetero-atoms are included if and only... | Returns the representation of a <code>ScopDomain</code> as a BioJava <code>Structure</code> object | getStructureForDomain | {
"repo_name": "kumar-physics/BioJava",
"path": "biojava3-structure/src/main/java/org/biojava/bio/structure/align/util/AtomCache.java",
"license": "lgpl-2.1",
"size": 34105
} | [
"java.io.IOException",
"java.util.Iterator",
"java.util.List",
"org.biojava.bio.structure.AtomPositionMap",
"org.biojava.bio.structure.Chain",
"org.biojava.bio.structure.Group",
"org.biojava.bio.structure.ResidueRange",
"org.biojava.bio.structure.Structure",
"org.biojava.bio.structure.StructureExcep... | import java.io.IOException; import java.util.Iterator; import java.util.List; import org.biojava.bio.structure.AtomPositionMap; import org.biojava.bio.structure.Chain; import org.biojava.bio.structure.Group; import org.biojava.bio.structure.ResidueRange; import org.biojava.bio.structure.Structure; import org.biojava.bi... | import java.io.*; import java.util.*; import org.biojava.bio.structure.*; import org.biojava.bio.structure.scop.*; | [
"java.io",
"java.util",
"org.biojava.bio"
] | java.io; java.util; org.biojava.bio; | 46,535 |
@Override
public FormStatus process(String actionName) {
// Local Declarations
FormStatus retStatus = FormStatus.Unacceptable;
// We need the project space for this, so check it
if (project != null) {
// Only process the request if the Item is enabled and the correct
// action was selected.... | FormStatus function(String actionName) { FormStatus retStatus = FormStatus.Unacceptable; if (project != null) { if (isEnabled() && actionName.equals(nekWriteActionString)) { writeREAFile(); retStatus = FormStatus.Processed; } else { retStatus = super.process(actionName); } } if (isEnabled()) { status = retStatus; retur... | /**
* This operation writes the Nek5000 file to disk.
*/ | This operation writes the Nek5000 file to disk | process | {
"repo_name": "eclipse/ice",
"path": "org.eclipse.ice.nek5000/src/org/eclipse/ice/nek5000/NekModel.java",
"license": "epl-1.0",
"size": 17587
} | [
"org.eclipse.ice.datastructures.form.FormStatus"
] | import org.eclipse.ice.datastructures.form.FormStatus; | import org.eclipse.ice.datastructures.form.*; | [
"org.eclipse.ice"
] | org.eclipse.ice; | 633,077 |
static boolean insert(DrillItem p_drill_item, Vector p_vector,
int p_max_recursion_depth, int p_max_via_recursion_depth, IntOctagon p_tidy_region,
RoutingBoard p_board)
{
if (p_drill_item.is_shove_fixed())
{
return false;
}
boolean attach_allo... | static boolean insert(DrillItem p_drill_item, Vector p_vector, int p_max_recursion_depth, int p_max_via_recursion_depth, IntOctagon p_tidy_region, RoutingBoard p_board) { if (p_drill_item.is_shove_fixed()) { return false; } boolean attach_allowed = false; if (p_drill_item instanceof Via) { attach_allowed = ((Via)p_dril... | /**
* Translates p_drill_item by p_vector by shoving obstacle
* traces and vias aside, so that no clearance violations occur.
* If p_tidy_region != null, it will be joined by the bounding octagons of the translated shapes.
*/ | Translates p_drill_item by p_vector by shoving obstacle traces and vias aside, so that no clearance violations occur. If p_tidy_region != null, it will be joined by the bounding octagons of the translated shapes | insert | {
"repo_name": "nick-less/freerouting",
"path": "src/main/java/board/MoveDrillItemAlgo.java",
"license": "gpl-3.0",
"size": 14381
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,583,067 |
public boolean checkin(Contentlet contentlet, Map<Relationship, List<Contentlet>> contentRelationships, List<Category> cats ,List<Permission> permissions, User user,boolean respectFrontendRoles);
| boolean function(Contentlet contentlet, Map<Relationship, List<Contentlet>> contentRelationships, List<Category> cats ,List<Permission> permissions, User user,boolean respectFrontendRoles); | /**
* Will check in a new version of you contentlet. The inode of your contentlet must be 0.
* @param contentlet - The inode of your contentlet must be 0.
* @param contentRelationships - throws IllegalArgumentException if null. Used to set relationships to new contentlet version
* @param cats - throws Illega... | Will check in a new version of you contentlet. The inode of your contentlet must be 0 | checkin | {
"repo_name": "jtesser/core-2.x",
"path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPIPreHook.java",
"license": "gpl-3.0",
"size": 46259
} | [
"com.dotmarketing.beans.Permission",
"com.dotmarketing.portlets.categories.model.Category",
"com.dotmarketing.portlets.contentlet.model.Contentlet",
"com.dotmarketing.portlets.structure.model.Relationship",
"com.liferay.portal.model.User",
"java.util.List",
"java.util.Map"
] | import com.dotmarketing.beans.Permission; import com.dotmarketing.portlets.categories.model.Category; import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.dotmarketing.portlets.structure.model.Relationship; import com.liferay.portal.model.User; import java.util.List; import java.util.Map; | import com.dotmarketing.beans.*; import com.dotmarketing.portlets.categories.model.*; import com.dotmarketing.portlets.contentlet.model.*; import com.dotmarketing.portlets.structure.model.*; import com.liferay.portal.model.*; import java.util.*; | [
"com.dotmarketing.beans",
"com.dotmarketing.portlets",
"com.liferay.portal",
"java.util"
] | com.dotmarketing.beans; com.dotmarketing.portlets; com.liferay.portal; java.util; | 2,427,059 |
private PrismObject<ShadowType> saveSyncMetadata(PrismObject<ShadowType> shadow,
SynchronizationSituation situation, ResourceObjectShadowChangeDescription change, ObjectSynchronizationType synchronizationPolicy,
OperationResult parentResult) {
if (shadow == null) {
return null;
}
ShadowType shadowT... | PrismObject<ShadowType> function(PrismObject<ShadowType> shadow, SynchronizationSituation situation, ResourceObjectShadowChangeDescription change, ObjectSynchronizationType synchronizationPolicy, OperationResult parentResult) { if (shadow == null) { return null; } ShadowType shadowType = shadow.asObjectable(); XMLGrego... | /**
* Saves situation, timestamps, kind and intent (if needed)
*/ | Saves situation, timestamps, kind and intent (if needed) | saveSyncMetadata | {
"repo_name": "sabriarabacioglu/engerek",
"path": "model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizationService.java",
"license": "apache-2.0",
"size": 41497
} | [
"com.evolveum.midpoint.prism.PrismObject",
"com.evolveum.midpoint.prism.delta.ItemDelta",
"com.evolveum.midpoint.prism.delta.PropertyDelta",
"com.evolveum.midpoint.prism.xml.XmlTypeConverter",
"com.evolveum.midpoint.provisioning.api.ResourceObjectShadowChangeDescription",
"com.evolveum.midpoint.schema.con... | import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.delta.PropertyDelta; import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.provisioning.api.ResourceObjectShadowChangeDescription; import com.evolveum.mi... | import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.delta.*; import com.evolveum.midpoint.prism.xml.*; import com.evolveum.midpoint.provisioning.api.*; import com.evolveum.midpoint.schema.constants.*; import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.schema.util.*; import c... | [
"com.evolveum.midpoint",
"java.util",
"javax.xml"
] | com.evolveum.midpoint; java.util; javax.xml; | 1,048,918 |
protected void encrypt() throws IOException {
inBuffer.flip();
outBuffer.clear();
try {
cipher.update(inBuffer, outBuffer);
} catch (ShortBufferException e) {
throw new IOException(e);
}
inBuffer.clear();
outBuffer.flip();
// write to output
output.write(outBuffer);... | void function() throws IOException { inBuffer.flip(); outBuffer.clear(); try { cipher.update(inBuffer, outBuffer); } catch (ShortBufferException e) { throw new IOException(e); } inBuffer.clear(); outBuffer.flip(); output.write(outBuffer); } | /**
* Does the encryption, input is {@link #inBuffer} and output is
* {@link #outBuffer}.
*
*@throws IOException if an I/O error occurs.
*/ | Does the encryption, input is <code>#inBuffer</code> and output is <code>#outBuffer</code> | encrypt | {
"repo_name": "intel-hadoop/chimera",
"path": "src/main/java/com/intel/chimera/stream/CryptoOutputStream.java",
"license": "apache-2.0",
"size": 11313
} | [
"java.io.IOException",
"javax.crypto.ShortBufferException"
] | import java.io.IOException; import javax.crypto.ShortBufferException; | import java.io.*; import javax.crypto.*; | [
"java.io",
"javax.crypto"
] | java.io; javax.crypto; | 2,243,421 |
@Override
public void write(final int c) throws IOException {
if (insideValue) {
if (c == '&') {
super.write("&", 0, 5);
return;
}
else if (c == '<') {
super.write("<", 0, 4);
return;
}
else if (c == '>') {
super.write(">", 0, 4);
return;
}
e... | void function(final int c) throws IOException { if (insideValue) { if (c == '&') { super.write("&", 0, 5); return; } else if (c == '<') { super.write("<", 0, 4); return; } else if (c == '>') { super.write(">", 0, 4); return; } else if (c == 'STR') { insideValue = true; } else if (c == '>') { insideTag = false... | /**
* Write a single char to the Writer.
*
* @param c
* Char to be written
*/ | Write a single char to the Writer | write | {
"repo_name": "fnatter/freeplane-debian-dev",
"path": "freeplane/src/main/java/org/freeplane/core/util/XHTMLWriter.java",
"license": "gpl-2.0",
"size": 9208
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 743,969 |
@Test(groups = "AlfrescoOne")
public void AONE_14143() throws Exception
{
String testName = getTestName();
String user1 = getUserNameFreeDomain(testName + "-1");
String user2 = getUserNameFreeDomain(testName + "-2");
String siteName = getSiteName(testName);
S... | @Test(groups = STR) void function() throws Exception { String testName = getTestName(); String user1 = getUserNameFreeDomain(testName + "-1"); String user2 = getUserNameFreeDomain(testName + "-2"); String siteName = getSiteName(testName); String folderName = getFolderName(testName) + System.currentTimeMillis(); String ... | /**
* Covers 10416
*/ | Covers 10416 | AONE_14143 | {
"repo_name": "Kast0rTr0y/community-edition",
"path": "projects/qa-share/src/test/java/org/alfresco/share/site/document/ManagePermissionTest.java",
"license": "lgpl-3.0",
"size": 137220
} | [
"java.io.File",
"org.alfresco.po.share.enums.UserRole",
"org.alfresco.po.share.site.document.DocumentLibraryPage",
"org.alfresco.share.util.ShareUser",
"org.alfresco.share.util.ShareUserMembers",
"org.alfresco.share.util.ShareUserSitePage",
"org.testng.Assert",
"org.testng.annotations.Test"
] | import java.io.File; import org.alfresco.po.share.enums.UserRole; import org.alfresco.po.share.site.document.DocumentLibraryPage; import org.alfresco.share.util.ShareUser; import org.alfresco.share.util.ShareUserMembers; import org.alfresco.share.util.ShareUserSitePage; import org.testng.Assert; import org.testng.annot... | import java.io.*; import org.alfresco.po.share.enums.*; import org.alfresco.po.share.site.document.*; import org.alfresco.share.util.*; import org.testng.*; import org.testng.annotations.*; | [
"java.io",
"org.alfresco.po",
"org.alfresco.share",
"org.testng",
"org.testng.annotations"
] | java.io; org.alfresco.po; org.alfresco.share; org.testng; org.testng.annotations; | 1,079,784 |
@Test
public void testProtectedConstructor() {
Assert.assertNotNull(new JpaClusterSpecs());
} | void function() { Assert.assertNotNull(new JpaClusterSpecs()); } | /**
* Here for completeness.
*/ | Here for completeness | testProtectedConstructor | {
"repo_name": "ajoymajumdar/genie",
"path": "genie-core/src/test/java/com/netflix/genie/core/jpa/specifications/JpaClusterSpecsUnitTests.java",
"license": "apache-2.0",
"size": 18710
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,228,725 |
public void removeAllAttributes() throws LDAPException {
this.removeAllAttributes(this.baseDN);
} | void function() throws LDAPException { this.removeAllAttributes(this.baseDN); } | /**
* Removes all attributes - except the Relativ Distinctive Name (RDN) - of
* the current entry.
*
* @throws LDAPException
*/ | Removes all attributes - except the Relativ Distinctive Name (RDN) - of the current entry | removeAllAttributes | {
"repo_name": "ebner/collaborilla",
"path": "src/se/kth/nada/kmr/collaborilla/ldap/LDAPObject.java",
"license": "lgpl-2.1",
"size": 26630
} | [
"com.novell.ldap.LDAPException"
] | import com.novell.ldap.LDAPException; | import com.novell.ldap.*; | [
"com.novell.ldap"
] | com.novell.ldap; | 2,210,199 |
public void removeHeader(String headerName) {
if (StringUtils.hasLength(headerName) && !isReadOnly(headerName)) {
setHeader(headerName, null);
}
} | void function(String headerName) { if (StringUtils.hasLength(headerName) && !isReadOnly(headerName)) { setHeader(headerName, null); } } | /**
* Remove the value for the given header name.
*/ | Remove the value for the given header name | removeHeader | {
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-messaging/src/main/java/org/springframework/messaging/support/MessageHeaderAccessor.java",
"license": "apache-2.0",
"size": 21465
} | [
"org.springframework.util.StringUtils"
] | import org.springframework.util.StringUtils; | import org.springframework.util.*; | [
"org.springframework.util"
] | org.springframework.util; | 122,242 |
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
if (isSelected) {
renderer.setForeground(table.getSelectionForeground());
renderer.setBackground(table.getSelectionBackground());
} else {
renderer.setForeground(ta... | Component function(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { renderer.setForeground(table.getSelectionForeground()); renderer.setBackground(table.getSelectionBackground()); } else { renderer.setForeground(table.getForeground()); renderer.setBackground(tab... | /**
* Overriden to format value.
*/ | Overriden to format value | getTableCellRendererComponent | {
"repo_name": "egonw/pathvisio",
"path": "modules/org.pathvisio.gui/src/org/pathvisio/gui/handler/BooleanHandler.java",
"license": "apache-2.0",
"size": 2404
} | [
"java.awt.Component",
"javax.swing.JTable"
] | import java.awt.Component; import javax.swing.JTable; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 858,192 |
public IdentityDescriptor readMember(
final String containerId,
final String memberId,
final QueryMembership queryMembership) {
final UUID locationId = UUID.fromString("8ba35978-138e-41f8-8963-7b1ea2c5f775"); //$NON-NLS-1$
final ApiResourceVersion apiVersion = new ApiReso... | IdentityDescriptor function( final String containerId, final String memberId, final QueryMembership queryMembership) { final UUID locationId = UUID.fromString(STR); final ApiResourceVersion apiVersion = new ApiResourceVersion(STR); final Map<String, Object> routeValues = new HashMap<String, Object>(); routeValues.put(S... | /**
* [Preview API 3.1-preview.1]
*
* @param containerId
*
* @param memberId
*
* @param queryMembership
*
* @return IdentityDescriptor
*/ | [Preview API 3.1-preview.1] | readMember | {
"repo_name": "Microsoft/vso-httpclient-java",
"path": "Rest/alm-vss-client/src/main/generated/com/microsoft/alm/visualstudio/services/identity/client/IdentityHttpClientBase.java",
"license": "mit",
"size": 37296
} | [
"com.microsoft.alm.client.HttpMethod",
"com.microsoft.alm.client.VssMediaTypes",
"com.microsoft.alm.client.VssRestRequest",
"com.microsoft.alm.client.model.NameValueCollection",
"com.microsoft.alm.visualstudio.services.identity.IdentityDescriptor",
"com.microsoft.alm.visualstudio.services.identity.QueryMe... | import com.microsoft.alm.client.HttpMethod; import com.microsoft.alm.client.VssMediaTypes; import com.microsoft.alm.client.VssRestRequest; import com.microsoft.alm.client.model.NameValueCollection; import com.microsoft.alm.visualstudio.services.identity.IdentityDescriptor; import com.microsoft.alm.visualstudio.services... | import com.microsoft.alm.client.*; import com.microsoft.alm.client.model.*; import com.microsoft.alm.visualstudio.services.identity.*; import com.microsoft.alm.visualstudio.services.webapi.*; import java.util.*; | [
"com.microsoft.alm",
"java.util"
] | com.microsoft.alm; java.util; | 2,694,176 |
protected void refreshTaskCountsAndWaitTime(TaskType type, long now) {
TaskInProgress[] allTips = getTasks(type);
int finishedTips = 0;
int runningTips = 0;
int runningTaskAttempts = 0;
long totalWaitTime = 0;
long jobStartTime = this.getStartTime();
for (TaskInProgress tip : allTips) {
... | void function(TaskType type, long now) { TaskInProgress[] allTips = getTasks(type); int finishedTips = 0; int runningTips = 0; int runningTaskAttempts = 0; long totalWaitTime = 0; long jobStartTime = this.getStartTime(); for (TaskInProgress tip : allTips) { if (tip.isComplete()) { finishedTips += 1; } else if(tip.isRun... | /**
* Refresh runningTasks, neededTasks and pendingTasks counters
* @param type TaskType to refresh
*/ | Refresh runningTasks, neededTasks and pendingTasks counters | refreshTaskCountsAndWaitTime | {
"repo_name": "rhli/hadoop-EAR",
"path": "src/mapred/org/apache/hadoop/mapred/JobInProgress.java",
"license": "apache-2.0",
"size": 140508
} | [
"org.apache.hadoop.mapreduce.TaskType"
] | import org.apache.hadoop.mapreduce.TaskType; | import org.apache.hadoop.mapreduce.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 305,172 |
boolean isDirectory(VirtualFile mountPoint, VirtualFile target); | boolean isDirectory(VirtualFile mountPoint, VirtualFile target); | /**
* Ascertain whether a virtual file within this filesystem is a directory.
*
* @param mountPoint the mount point of the filesystem instance (guaranteed to be a parent of {@code target})
* @param target the virtual file to act upon
* @return {@code true} if the file exists and is a direct... | Ascertain whether a virtual file within this filesystem is a directory | isDirectory | {
"repo_name": "jbossas/jboss-vfs",
"path": "src/main/java/org/jboss/vfs/spi/FileSystem.java",
"license": "apache-2.0",
"size": 7462
} | [
"org.jboss.vfs.VirtualFile"
] | import org.jboss.vfs.VirtualFile; | import org.jboss.vfs.*; | [
"org.jboss.vfs"
] | org.jboss.vfs; | 2,074,985 |
public static void copyStream(InputStream is, OutputStream os, int size)
throws IOException {
byte[] buffer = new byte[size];
for (int r = -1; (r = is.read(buffer, 0, size)) != -1;) {
os.write(buffer, 0, r);
}
} | static void function(InputStream is, OutputStream os, int size) throws IOException { byte[] buffer = new byte[size]; for (int r = -1; (r = is.read(buffer, 0, size)) != -1;) { os.write(buffer, 0, r); } } | /**
* Write all bytes from is to os. Does not close either stream.
* @param is to copy bytes from
* @param os to copy bytes to
* @param size number of bytes to buffer between read and write operations
* @throws IOException for usual reasons
*/ | Write all bytes from is to os. Does not close either stream | copyStream | {
"repo_name": "nlnwa/openwayback",
"path": "wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java",
"license": "apache-2.0",
"size": 4619
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 697,500 |
public Long countInterGroupContacts(String groupNameOne, String groupNameTwo) {
return atomContactRdd
.filter(t -> CanonNames.getCanonGroups(t).equals(CanonNames.getCanonGroups(
groupGroupContact(groupNameOne, groupNameTwo))))
.count();
} | Long function(String groupNameOne, String groupNameTwo) { return atomContactRdd .filter(t -> CanonNames.getCanonGroups(t).equals(CanonNames.getCanonGroups( groupGroupContact(groupNameOne, groupNameTwo)))) .count(); } | /**
* Get the number of inter-group contacts for a given pair of group names.
* @param groupNameOne the name of the first groups
* @param groupNameTwo the name of the second group
* @return the number of contacts between these two groups
*/ | Get the number of inter-group contacts for a given pair of group names | countInterGroupContacts | {
"repo_name": "abradle/biojava-spark",
"path": "src/main/java/org/biojava/spark/data/AtomContactRDD.java",
"license": "lgpl-2.1",
"size": 9180
} | [
"org.biojava.spark.utils.CanonNames"
] | import org.biojava.spark.utils.CanonNames; | import org.biojava.spark.utils.*; | [
"org.biojava.spark"
] | org.biojava.spark; | 613,279 |
private void pushAllOntoStack(Stack sSearchACStack, Stack vACSearchStack, Stack vSelRowsStack,
Stack vSearchIDStack, Stack vSearchNameStack, Stack vSearchUsedContextStack, Stack vResultStack,
Stack vCompAttrStack, Stack vAttributeListStack, String sSearchAC, Vector vAC, Vecto... | void function(Stack sSearchACStack, Stack vACSearchStack, Stack vSelRowsStack, Stack vSearchIDStack, Stack vSearchNameStack, Stack vSearchUsedContextStack, Stack vResultStack, Stack vCompAttrStack, Stack vAttributeListStack, String sSearchAC, Vector vAC, Vector vRSel, Vector vSearchID, Vector vSearchName, Vector vResul... | /**
* Adds the search component, result bean vector and result vector in a stack to use it later.
*
* @param sSearchACStack
* string of ACs searched
* @param vACSearchStack
* vector of ac beans searched
* @param vSelRowsStack
* vector of ac beans... | Adds the search component, result bean vector and result vector in a stack to use it later | pushAllOntoStack | {
"repo_name": "NCIP/cadsr-cdecurate",
"path": "src/gov/nih/nci/cadsr/cdecurate/tool/GetACSearch.java",
"license": "bsd-3-clause",
"size": 517161
} | [
"gov.nih.nci.cadsr.cdecurate.util.DataManager",
"java.util.Stack",
"java.util.Vector",
"javax.servlet.http.HttpSession"
] | import gov.nih.nci.cadsr.cdecurate.util.DataManager; import java.util.Stack; import java.util.Vector; import javax.servlet.http.HttpSession; | import gov.nih.nci.cadsr.cdecurate.util.*; import java.util.*; import javax.servlet.http.*; | [
"gov.nih.nci",
"java.util",
"javax.servlet"
] | gov.nih.nci; java.util; javax.servlet; | 1,007,937 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<ApplicationInner>> getWithResponseAsync(
String resourceGroupName, String accountName, String applicationName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<ApplicationInner>> function( String resourceGroupName, String accountName, String applicationName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono... | /**
* Gets information about the specified application.
*
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param applicationName The name of the application. This must be unique within the account.
... | Gets information about the specified application | getWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationsClientImpl.java",
"license": "mit",
"size": 56593
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.batch.fluent.models.ApplicationInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.batch.fluent.models.ApplicationInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.batch.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 653,769 |
private void fillToGalleryRightRtl() {
int itemSpacing = mSpacing;
int galleryRight = getRight() - getLeft() - mPaddingRight;
// Set state for initial iteration
View prevIterationView = getChildAt( 0 );
int curPosition;
int curLeftEdge;
if ( prevIterationView != null ) {
curPosition = mFirstPositi... | void function() { int itemSpacing = mSpacing; int galleryRight = getRight() - getLeft() - mPaddingRight; View prevIterationView = getChildAt( 0 ); int curPosition; int curLeftEdge; if ( prevIterationView != null ) { curPosition = mFirstPosition - 1; curLeftEdge = prevIterationView.getRight() + itemSpacing; } else { cur... | /**
* Fill to gallery right rtl.
*/ | Fill to gallery right rtl | fillToGalleryRightRtl | {
"repo_name": "photo/mobile-android",
"path": "submodules/Android-Feather/src/com/aviary/android/feather/widget/Gallery.java",
"license": "apache-2.0",
"size": 53395
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 2,548,886 |
public static String moveTopicToZone(String topic, String user, MqttAction action, ManagedZone topicZone) {
String tWithoutZoneAndUser = removeZoneAndUserIdentifier(topic);
final String publishTopicLevel = ManagedTopic.LEVEL_CHAR + MqttAction.PUBLISH.getValue();
final String subscribeTopicLevel = ManagedTopic... | static String function(String topic, String user, MqttAction action, ManagedZone topicZone) { String tWithoutZoneAndUser = removeZoneAndUserIdentifier(topic); final String publishTopicLevel = ManagedTopic.LEVEL_CHAR + MqttAction.PUBLISH.getValue(); final String subscribeTopicLevel = ManagedTopic.LEVEL_CHAR + MqttAction... | /**
* Moves a topic to a managed zone with user identifier and action.
*
* @param topic String
* @param user String
* @param action MqttAction
* @param topicZone ManagedZone
* @return String /%zone%/%topic%/%action%/%user%
*/ | Moves a topic to a managed zone with user identifier and action | moveTopicToZone | {
"repo_name": "lants1/moquette",
"path": "fce/src/main/java/io/moquette/fce/common/util/ManagedZoneUtil.java",
"license": "apache-2.0",
"size": 3897
} | [
"io.moquette.fce.model.common.ManagedTopic",
"io.moquette.fce.model.common.ManagedZone",
"io.moquette.plugin.MqttAction",
"org.apache.commons.lang3.StringUtils"
] | import io.moquette.fce.model.common.ManagedTopic; import io.moquette.fce.model.common.ManagedZone; import io.moquette.plugin.MqttAction; import org.apache.commons.lang3.StringUtils; | import io.moquette.fce.model.common.*; import io.moquette.plugin.*; import org.apache.commons.lang3.*; | [
"io.moquette.fce",
"io.moquette.plugin",
"org.apache.commons"
] | io.moquette.fce; io.moquette.plugin; org.apache.commons; | 2,127,684 |
@Override
public int getGroupCount(DeviceId deviceId) {
return (groupEntriesByKey.get(deviceId) != null) ?
groupEntriesByKey.get(deviceId).size() : 0;
} | int function(DeviceId deviceId) { return (groupEntriesByKey.get(deviceId) != null) ? groupEntriesByKey.get(deviceId).size() : 0; } | /**
* Returns the number of groups for the specified device in the store.
*
* @return number of groups for the specified device
*/ | Returns the number of groups for the specified device in the store | getGroupCount | {
"repo_name": "kuangrewawa/onos",
"path": "core/store/trivial/src/main/java/org/onosproject/store/trivial/impl/SimpleGroupStore.java",
"license": "apache-2.0",
"size": 21672
} | [
"org.onosproject.net.DeviceId"
] | import org.onosproject.net.DeviceId; | import org.onosproject.net.*; | [
"org.onosproject.net"
] | org.onosproject.net; | 1,109,280 |
public java.util.List<fr.lip6.move.pnml.pthlpng.terms.hlapi.VariableHLAPI> getSubterm_terms_VariableHLAPI() {
java.util.List<fr.lip6.move.pnml.pthlpng.terms.hlapi.VariableHLAPI> retour = new ArrayList<fr.lip6.move.pnml.pthlpng.terms.hlapi.VariableHLAPI>();
for (Term elemnt : getSubterm()) {
if (elemnt.getClas... | java.util.List<fr.lip6.move.pnml.pthlpng.terms.hlapi.VariableHLAPI> function() { java.util.List<fr.lip6.move.pnml.pthlpng.terms.hlapi.VariableHLAPI> retour = new ArrayList<fr.lip6.move.pnml.pthlpng.terms.hlapi.VariableHLAPI>(); for (Term elemnt : getSubterm()) { if (elemnt.getClass().equals(fr.lip6.move.pnml.pthlpng.te... | /**
* This accessor return a list of encapsulated subelement, only of VariableHLAPI
* kind. WARNING : this method can creates a lot of new object in memory.
*/ | This accessor return a list of encapsulated subelement, only of VariableHLAPI kind. WARNING : this method can creates a lot of new object in memory | getSubterm_terms_VariableHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-PT-HLPNG/src/fr/lip6/move/pnml/pthlpng/integers/hlapi/GreaterThanOrEqualHLAPI.java",
"license": "epl-1.0",
"size": 70100
} | [
"fr.lip6.move.pnml.pthlpng.terms.Term",
"java.util.ArrayList",
"java.util.List"
] | import fr.lip6.move.pnml.pthlpng.terms.Term; import java.util.ArrayList; import java.util.List; | import fr.lip6.move.pnml.pthlpng.terms.*; import java.util.*; | [
"fr.lip6.move",
"java.util"
] | fr.lip6.move; java.util; | 128,328 |
@Test
public void testProcessExecution() throws Exception {
cleanUpRunningProcessInstances();
ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
assertEquals(1, processEngine.getRuntimeService().createProcessInstanceQuery().processIns... | void function() throws Exception { cleanUpRunningProcessInstances(); ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY); assertEquals(1, processEngine.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstance.getId()).count()); ... | /**
* Tests that the process is executable and reaches its end.
*/ | Tests that the process is executable and reaches its end | testProcessExecution | {
"repo_name": "skjolber/camunda-bpm-examples",
"path": "bpmn-model-api/generate-jsf-form/src/test/java/org/camunda/bpm/ArquillianTest.java",
"license": "apache-2.0",
"size": 3264
} | [
"org.camunda.bpm.engine.runtime.ProcessInstance",
"org.junit.Assert"
] | import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Assert; | import org.camunda.bpm.engine.runtime.*; import org.junit.*; | [
"org.camunda.bpm",
"org.junit"
] | org.camunda.bpm; org.junit; | 2,822,893 |
private String readChecksum(File f) {
BufferedReader diskChecksumReader = null;
try {
diskChecksumReader = new BufferedReader(new FileReader(f));
Object[] result = format.parse(diskChecksumReader.readLine());
if (result == null || result.length == 0 || result[0] =... | String function(File f) { BufferedReader diskChecksumReader = null; try { diskChecksumReader = new BufferedReader(new FileReader(f)); Object[] result = format.parse(diskChecksumReader.readLine()); if (result == null result.length == 0 result[0] == null) { throw new BuildException(STR); } return (String) result[0]; } ca... | /**
* reads the checksum from a file using the specified format.
*
* @since 1.7
*/ | reads the checksum from a file using the specified format | readChecksum | {
"repo_name": "BIORIMP/biorimp",
"path": "BIO-RIMP/test_data/code/antapache/src/main/org/apache/tools/ant/taskdefs/Checksum.java",
"license": "gpl-2.0",
"size": 25912
} | [
"java.io.BufferedReader",
"java.io.File",
"java.io.FileReader",
"java.io.IOException",
"java.text.ParseException",
"org.apache.tools.ant.BuildException",
"org.apache.tools.ant.util.FileUtils"
] | import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.text.ParseException; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.util.FileUtils; | import java.io.*; import java.text.*; import org.apache.tools.ant.*; import org.apache.tools.ant.util.*; | [
"java.io",
"java.text",
"org.apache.tools"
] | java.io; java.text; org.apache.tools; | 2,189,429 |
@Nonnull Context sendError(@Nonnull Throwable cause, @Nonnull StatusCode statusCode); | @Nonnull Context sendError(@Nonnull Throwable cause, @Nonnull StatusCode statusCode); | /**
* Send an error response.
*
* @param cause Error. If this is a fatal error it is going to be rethrow it.
* @param statusCode Status code.
* @return This context.
*/ | Send an error response | sendError | {
"repo_name": "jooby-project/jooby",
"path": "jooby/src/main/java/io/jooby/Context.java",
"license": "apache-2.0",
"size": 41138
} | [
"javax.annotation.Nonnull"
] | import javax.annotation.Nonnull; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,850,316 |
public void fetchRunning(boolean f) {
if (f == model.isFetchRunningExecutions())
return;
model.fetchRunning(f);
if (f)
LogModel.getInstance().logMessage("Fetching running executions");
else
LogModel.getInstance().logMessage("Dot not fetch running... | void function(boolean f) { if (f == model.isFetchRunningExecutions()) return; model.fetchRunning(f); if (f) LogModel.getInstance().logMessage(STR); else LogModel.getInstance().logMessage(STR); this.fetchFirstPage(); } | /**
* Invalidates the current job list if toggling state,
* refetch immediately a new job list
*
* @param f true to fetch running jobs
*/ | Invalidates the current job list if toggling state, refetch immediately a new job list | fetchRunning | {
"repo_name": "lpellegr/scheduling-portal",
"path": "scheduler-portal/src/main/java/org/ow2/proactive_grid_cloud_portal/scheduler/client/controller/ExecutionsController.java",
"license": "agpl-3.0",
"size": 6863
} | [
"org.ow2.proactive_grid_cloud_portal.common.client.model.LogModel"
] | import org.ow2.proactive_grid_cloud_portal.common.client.model.LogModel; | import org.ow2.proactive_grid_cloud_portal.common.client.model.*; | [
"org.ow2.proactive_grid_cloud_portal"
] | org.ow2.proactive_grid_cloud_portal; | 1,665,700 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.