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
@ApiModelProperty(value = "") public Integer getNumber() { return number; }
@ApiModelProperty(value = "") Integer function() { return number; }
/** * Get number * @return number **/
Get number
getNumber
{ "repo_name": "knetikmedia/knetikcloud-java-client", "path": "src/main/java/com/knetikcloud/model/PageResourceBareChallengeActivityResource.java", "license": "apache-2.0", "size": 7974 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,847,633
public ims.therapies.vo.GaitVo getGait(ims.core.vo.ClinicalContactShortVo voClinicalContact) { if (voClinicalContact == null) throw new RuntimeException("Cannot get GaitVo for null ClinicalContactShortVo"); StringBuffer hql = new StringBuffer("from Gait as g1_1 where g1_1.clinicalContact.id = :CCID and g1_1.isRIE is null"); List list = getDomainFactory().find(hql.toString(), "CCID", voClinicalContact.getID_ClinicalContact()); if (list == null || list.size() == 0) return null; else if (list.size() > 1) throw new RuntimeException("More than one Gait Treatment found for the current Clinical Contact"); GaitVoCollection voColl = GaitVoAssembler.createGaitVoCollectionFromGait(list); if (voColl.size() > 0) return voColl.get(0); return null; }
ims.therapies.vo.GaitVo function(ims.core.vo.ClinicalContactShortVo voClinicalContact) { if (voClinicalContact == null) throw new RuntimeException(STR); StringBuffer hql = new StringBuffer(STR); List list = getDomainFactory().find(hql.toString(), "CCID", voClinicalContact.getID_ClinicalContact()); if (list == null list.size() == 0) return null; else if (list.size() > 1) throw new RuntimeException(STR); GaitVoCollection voColl = GaitVoAssembler.createGaitVoCollectionFromGait(list); if (voColl.size() > 0) return voColl.get(0); return null; }
/** * get gait */
get gait
getGait
{ "repo_name": "open-health-hub/openmaxims-linux", "path": "openmaxims_workspace/Therapies/src/ims/therapies/domain/impl/GaitImpl.java", "license": "agpl-3.0", "size": 4827 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
609,511
protected StaticTypeCheckingVisitor newVisitor(SourceUnit unit, ClassNode node) { return new StaticTypeCheckingVisitor(unit, node); }
StaticTypeCheckingVisitor function(SourceUnit unit, ClassNode node) { return new StaticTypeCheckingVisitor(unit, node); }
/** * Allows subclasses to provide their own visitor. This is useful for example for transformations relying * on the static type checker. * * * @param unit the source unit * @param node the current classnode * @return a static type checking visitor */
Allows subclasses to provide their own visitor. This is useful for example for transformations relying on the static type checker
newVisitor
{ "repo_name": "paulk-asert/groovy", "path": "src/main/java/org/codehaus/groovy/transform/StaticTypesTransformation.java", "license": "apache-2.0", "size": 4788 }
[ "org.codehaus.groovy.ast.ClassNode", "org.codehaus.groovy.control.SourceUnit", "org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor" ]
import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor;
import org.codehaus.groovy.ast.*; import org.codehaus.groovy.control.*; import org.codehaus.groovy.transform.stc.*;
[ "org.codehaus.groovy" ]
org.codehaus.groovy;
2,545,021
if (BROKER.isStarted()) { LOGGER.info("Broker already running : " + BROKER); return; } // Set up the BROKER, i.e. the jms server BROKER.setUseJmx(true); BROKER.setBrokerName("fred"); BROKER.setUseShutdownHook(false); TransportConnector connector = new TransportConnector(); try { connector.setUri(new URI("tcp://localhost:61616")); BROKER.addConnector(connector); BROKER.start(); } catch (final Exception e) { LOGGER.error("Exception starting the JMS server programmatically : ", e); } }
if (BROKER.isStarted()) { LOGGER.info(STR + BROKER); return; } BROKER.setUseJmx(true); BROKER.setBrokerName("fred"); BROKER.setUseShutdownHook(false); TransportConnector connector = new TransportConnector(); try { connector.setUri(new URI(STRException starting the JMS server programmatically : ", e); } }
/** * This starts a JMS server, using the default(ActiveMQ) JMS provider, * so that we can test the JMS functionality in a dynamic way in integration * tests. */
This starts a JMS server, using the default(ActiveMQ) JMS provider, so that we can test the JMS functionality in a dynamic way in integration tests
startServer
{ "repo_name": "michaelcouck/ikube", "path": "code/tool/src/test/java/ikube/jms/JmsUtilities.java", "license": "apache-2.0", "size": 1682 }
[ "org.apache.activemq.broker.TransportConnector" ]
import org.apache.activemq.broker.TransportConnector;
import org.apache.activemq.broker.*;
[ "org.apache.activemq" ]
org.apache.activemq;
124,899
Bundle deleteBundle(Bundle bundle); // ----- Extension Bundle Versions -----
Bundle deleteBundle(Bundle bundle);
/** * Deletes the given extension bundle and all it's versions. * * @param bundle the extension bundle to delete * @return the deleted bundle */
Deletes the given extension bundle and all it's versions
deleteBundle
{ "repo_name": "bbende/nifi-registry", "path": "nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/service/extension/ExtensionService.java", "license": "apache-2.0", "size": 10237 }
[ "org.apache.nifi.registry.extension.bundle.Bundle" ]
import org.apache.nifi.registry.extension.bundle.Bundle;
import org.apache.nifi.registry.extension.bundle.*;
[ "org.apache.nifi" ]
org.apache.nifi;
2,309,968
@ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable<ProductContractInner> listByService(String resourceGroupName, String serviceName) { final String filter = null; final Integer top = null; final Integer skip = null; final Boolean expandGroups = null; final String tags = null; return new PagedIterable<>( listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags)); }
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<ProductContractInner> function(String resourceGroupName, String serviceName) { final String filter = null; final Integer top = null; final Integer skip = null; final Boolean expandGroups = null; final String tags = null; return new PagedIterable<>( listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, expandGroups, tags)); }
/** * Lists a collection of products in the specified service instance. * * @param resourceGroupName The name of the resource group. * @param serviceName The name of the API Management service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged Products list representation. */
Lists a collection of products in the specified service instance
listByService
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/ProductsClientImpl.java", "license": "mit", "size": 97306 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedIterable", "com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.apimanagement.fluent.models.ProductContractInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.apimanagement.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,319,740
public static UnixTerminal createUnixTerminal( InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset) { return new UnixTerminal(terminalInput, terminalOutput, terminalCharset); }
static UnixTerminal function( InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset) { return new UnixTerminal(terminalInput, terminalOutput, terminalCharset); }
/** * Creates a {@code UnixTerminal} object that is using supplied input and * output streams for standard out and standard in, as well as a character * set to be used when converting characters to bytes. */
Creates a UnixTerminal object that is using supplied input and output streams for standard out and standard in, as well as a character set to be used when converting characters to bytes
createUnixTerminal
{ "repo_name": "Tusamarco/stresstool", "path": "src/com/googlecode/lanterna/TerminalFacade.java", "license": "gpl-2.0", "size": 10429 }
[ "com.googlecode.lanterna.terminal.text.UnixTerminal", "java.io.InputStream", "java.io.OutputStream", "java.nio.charset.Charset" ]
import com.googlecode.lanterna.terminal.text.UnixTerminal; import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.Charset;
import com.googlecode.lanterna.terminal.text.*; import java.io.*; import java.nio.charset.*;
[ "com.googlecode.lanterna", "java.io", "java.nio" ]
com.googlecode.lanterna; java.io; java.nio;
479,188
public MainResponse info(Header... headers) throws IOException { return performRequestAndParseEntity(new MainRequest(), (request) -> Request.info(), MainResponse::fromXContent, emptySet(), headers); }
MainResponse function(Header... headers) throws IOException { return performRequestAndParseEntity(new MainRequest(), (request) -> Request.info(), MainResponse::fromXContent, emptySet(), headers); }
/** * Get the cluster info otherwise provided when sending an HTTP request to port 9200 */
Get the cluster info otherwise provided when sending an HTTP request to port 9200
info
{ "repo_name": "fuchao01/elasticsearch", "path": "client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java", "license": "apache-2.0", "size": 36095 }
[ "java.io.IOException", "java.util.Collections", "org.elasticsearch.action.main.MainRequest", "org.elasticsearch.action.main.MainResponse", "org.elasticsearch.client.http.Header" ]
import java.io.IOException; import java.util.Collections; import org.elasticsearch.action.main.MainRequest; import org.elasticsearch.action.main.MainResponse; import org.elasticsearch.client.http.Header;
import java.io.*; import java.util.*; import org.elasticsearch.action.main.*; import org.elasticsearch.client.http.*;
[ "java.io", "java.util", "org.elasticsearch.action", "org.elasticsearch.client" ]
java.io; java.util; org.elasticsearch.action; org.elasticsearch.client;
1,376,053
public void removePointerDraggedListener(ActionListener l) { if (pointerDraggedListeners != null) { pointerDraggedListeners.removeListener(l); } }
void function(ActionListener l) { if (pointerDraggedListeners != null) { pointerDraggedListeners.removeListener(l); } }
/** * Removes the listener from the pointer event * * @param l callback to remove */
Removes the listener from the pointer event
removePointerDraggedListener
{ "repo_name": "skyHALud/codenameone", "path": "CodenameOne/src/com/codename1/ui/Form.java", "license": "gpl-2.0", "size": 99398 }
[ "com.codename1.ui.events.ActionListener" ]
import com.codename1.ui.events.ActionListener;
import com.codename1.ui.events.*;
[ "com.codename1.ui" ]
com.codename1.ui;
651,514
int arraySize = 1000000; int maxInteger = 1000000; int fixedValue = 1000000; int calLimit = 10000000; try { if (args.length == 2) { arraySize = Integer.parseInt(args[0]); maxInteger = Integer.parseInt(args[1]); } else if (args.length == 4) { arraySize = Integer.parseInt(args[0]); maxInteger = Integer.parseInt(args[1]); fixedValue = Integer.parseInt(args[2]); calLimit = Integer.parseInt(args[3]); } } catch (NumberFormatException e) { System.err.println(e); } NumberGenerator builder = new NumberGenerator(arraySize, maxInteger, fixedValue, calLimit); long normalAppRunTime = 60000; builder.run(normalAppRunTime); } } class NumberGenerator { final static Logger logger = Logger.getLogger(String.valueOf(NumberGenerator.class)); Random randomGenerator = new Random(); private int arraySize; private int maxInteger; private int calLimit; private int fixedValue; public NumberGenerator(int arraySize, int maxInteger, int fixedValue, int calLimit) { this.arraySize = arraySize; this.maxInteger = maxInteger; this.fixedValue = fixedValue; this.calLimit = calLimit; }
int arraySize = 1000000; int maxInteger = 1000000; int fixedValue = 1000000; int calLimit = 10000000; try { if (args.length == 2) { arraySize = Integer.parseInt(args[0]); maxInteger = Integer.parseInt(args[1]); } else if (args.length == 4) { arraySize = Integer.parseInt(args[0]); maxInteger = Integer.parseInt(args[1]); fixedValue = Integer.parseInt(args[2]); calLimit = Integer.parseInt(args[3]); } } catch (NumberFormatException e) { System.err.println(e); } NumberGenerator builder = new NumberGenerator(arraySize, maxInteger, fixedValue, calLimit); long normalAppRunTime = 60000; builder.run(normalAppRunTime); } } class NumberGenerator { final static Logger logger = Logger.getLogger(String.valueOf(NumberGenerator.class)); Random randomGenerator = new Random(); private int arraySize; private int maxInteger; private int calLimit; private int fixedValue; public NumberGenerator(int arraySize, int maxInteger, int fixedValue, int calLimit) { this.arraySize = arraySize; this.maxInteger = maxInteger; this.fixedValue = fixedValue; this.calLimit = calLimit; }
/** * This app generates 4 random size arrays with random values. * Parameters:- * <p> * Array Size * Max Integer * Fixed Value * Calculation Limit * <p> * Eg:- (1000000 1000000) or (1000000 1000000 1000000 10000000) * * @param args */
This app generates 4 random size arrays with random values. Parameters:- Array Size Max Integer Fixed Value Calculation Limit Eg:- (1000000 1000000) or (1000000 1000000 1000000 10000000)
main
{ "repo_name": "wso2-incubator/automatic-anomaly-detection", "path": "jvm-monitor-agent/src/samples/applications/NormalAppToOOM/NormalAppToOOM.java", "license": "apache-2.0", "size": 5668 }
[ "java.util.Random", "java.util.logging.Logger" ]
import java.util.Random; import java.util.logging.Logger;
import java.util.*; import java.util.logging.*;
[ "java.util" ]
java.util;
1,746,793
public void recoverMessagesOfChannel(UUID channelID, DisruptorEventCallback recoverOKCallback) throws AndesException { InboundMessageRecoveryEvent recoveryEvent = new InboundMessageRecoveryEvent(channelID, recoverOKCallback); inboundEventManager.publishMessageRecoveryEvent(recoveryEvent); }
void function(UUID channelID, DisruptorEventCallback recoverOKCallback) throws AndesException { InboundMessageRecoveryEvent recoveryEvent = new InboundMessageRecoveryEvent(channelID, recoverOKCallback); inboundEventManager.publishMessageRecoveryEvent(recoveryEvent); }
/** * Recover messages for the subscriber. Re-schedule sent but un-ackenowledged * messages back * * @param channelID ID of the channel recover request is received * @param recoverOKCallback Callback to send recover-ok * @throws AndesException in case of publishing event to the disruptor. */
Recover messages for the subscriber. Re-schedule sent but un-ackenowledged messages back
recoverMessagesOfChannel
{ "repo_name": "ramith/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/Andes.java", "license": "apache-2.0", "size": 35104 }
[ "org.wso2.andes.kernel.disruptor.DisruptorEventCallback", "org.wso2.andes.kernel.disruptor.inbound.InboundMessageRecoveryEvent" ]
import org.wso2.andes.kernel.disruptor.DisruptorEventCallback; import org.wso2.andes.kernel.disruptor.inbound.InboundMessageRecoveryEvent;
import org.wso2.andes.kernel.disruptor.*; import org.wso2.andes.kernel.disruptor.inbound.*;
[ "org.wso2.andes" ]
org.wso2.andes;
2,776,892
public static Instances read_data(String path) throws IOException { System.out.println("Opening file: " + path); BufferedReader reader = new BufferedReader(new FileReader(path)); //create a weka data Instance Instances data = new Instances(reader); reader.close(); return (data); }
static Instances function(String path) throws IOException { System.out.println(STR + path); BufferedReader reader = new BufferedReader(new FileReader(path)); Instances data = new Instances(reader); reader.close(); return (data); }
/** * Returns a Weka Instance of the data for testing. * This will not be used in the finished product, but may be adapted to that end. * * @param path the local path to the data file (at this time, only .arff is supported) * @return data a Weka Instance of the data */
Returns a Weka Instance of the data for testing. This will not be used in the finished product, but may be adapted to that end
read_data
{ "repo_name": "optimusmoose/miniML", "path": "src/test/java/backend/backendTest.java", "license": "gpl-3.0", "size": 2897 }
[ "java.io.BufferedReader", "java.io.FileReader", "java.io.IOException" ]
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,944,595
private void writeTagPayload(Tag tag) throws IOException { int type = NBTUtils.getTypeCode(tag.getClass()); switch(type) { case NBTConstants.TYPE_END: writeEndTagPayload((EndTag) tag); break; case NBTConstants.TYPE_BYTE: writeByteTagPayload((ByteTag) tag); break; case NBTConstants.TYPE_SHORT: writeShortTagPayload((ShortTag) tag); break; case NBTConstants.TYPE_INT: writeIntTagPayload((IntTag) tag); break; case NBTConstants.TYPE_LONG: writeLongTagPayload((LongTag) tag); break; case NBTConstants.TYPE_FLOAT: writeFloatTagPayload((FloatTag) tag); break; case NBTConstants.TYPE_DOUBLE: writeDoubleTagPayload((DoubleTag) tag); break; case NBTConstants.TYPE_BYTE_ARRAY: writeByteArrayTagPayload((ByteArrayTag) tag); break; case NBTConstants.TYPE_STRING: writeStringTagPayload((StringTag) tag); break; case NBTConstants.TYPE_LIST: writeListTagPayload((ListTag) tag); break; case NBTConstants.TYPE_COMPOUND: writeCompoundTagPayload((CompoundTag) tag); break; case NBTConstants.TYPE_INT_ARRAY: writeIntArrayTagPayload((IntArrayTag) tag); break; default: throw new IOException("Invalid tag type: " + type + "."); } }
void function(Tag tag) throws IOException { int type = NBTUtils.getTypeCode(tag.getClass()); switch(type) { case NBTConstants.TYPE_END: writeEndTagPayload((EndTag) tag); break; case NBTConstants.TYPE_BYTE: writeByteTagPayload((ByteTag) tag); break; case NBTConstants.TYPE_SHORT: writeShortTagPayload((ShortTag) tag); break; case NBTConstants.TYPE_INT: writeIntTagPayload((IntTag) tag); break; case NBTConstants.TYPE_LONG: writeLongTagPayload((LongTag) tag); break; case NBTConstants.TYPE_FLOAT: writeFloatTagPayload((FloatTag) tag); break; case NBTConstants.TYPE_DOUBLE: writeDoubleTagPayload((DoubleTag) tag); break; case NBTConstants.TYPE_BYTE_ARRAY: writeByteArrayTagPayload((ByteArrayTag) tag); break; case NBTConstants.TYPE_STRING: writeStringTagPayload((StringTag) tag); break; case NBTConstants.TYPE_LIST: writeListTagPayload((ListTag) tag); break; case NBTConstants.TYPE_COMPOUND: writeCompoundTagPayload((CompoundTag) tag); break; case NBTConstants.TYPE_INT_ARRAY: writeIntArrayTagPayload((IntArrayTag) tag); break; default: throw new IOException(STR + type + "."); } }
/** * Writes tag payload. * @param tag The tag. * @throws IOException if an I/O error occurs. */
Writes tag payload
writeTagPayload
{ "repo_name": "Cubeville/HawkEye-Redux", "path": "api/src/main/java/org/cubeville/lib/jnbt/NBTOutputStream.java", "license": "gpl-3.0", "size": 7766 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,203,021
public String getContentLength(String url) { String contentLength = null; try { String requestURL = url; // Replaces all spaces. requestURL = requestURL.replaceAll(" ", "%20"); TapjoyLog.i(TAPJOY_URL_CONNECTION, "requestURL: " + requestURL); URL httpURL = new URL(requestURL); HttpURLConnection connection = (HttpURLConnection) httpURL.openConnection(); connection.setConnectTimeout(15000); connection.setReadTimeout(30000); contentLength = connection.getHeaderField("content-length"); } catch (Exception e) { TapjoyLog.e(TAPJOY_URL_CONNECTION, "Exception: " + e.toString()); } TapjoyLog.i(TAPJOY_URL_CONNECTION, "content-length: " + contentLength); return contentLength; }
String function(String url) { String contentLength = null; try { String requestURL = url; requestURL = requestURL.replaceAll(" ", "%20"); TapjoyLog.i(TAPJOY_URL_CONNECTION, STR + requestURL); URL httpURL = new URL(requestURL); HttpURLConnection connection = (HttpURLConnection) httpURL.openConnection(); connection.setConnectTimeout(15000); connection.setReadTimeout(30000); contentLength = connection.getHeaderField(STR); } catch (Exception e) { TapjoyLog.e(TAPJOY_URL_CONNECTION, STR + e.toString()); } TapjoyLog.i(TAPJOY_URL_CONNECTION, STR + contentLength); return contentLength; }
/** * Gets the file size of the specified resource from the HTTP header field "content-length" * @param url URL of the specified resource. * @return content-length, null otherwise. */
Gets the file size of the specified resource from the HTTP header field "content-length"
getContentLength
{ "repo_name": "bullno1/MoaiNao", "path": "project/tapjoy/src/com/tapjoy/TapjoyURLConnection.java", "license": "mit", "size": 7873 }
[ "java.net.HttpURLConnection" ]
import java.net.HttpURLConnection;
import java.net.*;
[ "java.net" ]
java.net;
1,199,802
public List<IViolation> getByAgreement(String contractUuid, String termName);
List<IViolation> function(String contractUuid, String termName);
/** * Returns the Violations from the database by its contractUuid. * The violations are sorted descendent by datetime. * * @param contractUuid * of the Violation * @param termName * of the Violation * @return the corresponding Violation from the database */
Returns the Violations from the database by its contractUuid. The violations are sorted descendent by datetime
getByAgreement
{ "repo_name": "modaclouds/modaclouds-sla-core", "path": "sla-repository/src/main/java/eu/atos/sla/dao/IViolationDAO.java", "license": "apache-2.0", "size": 4733 }
[ "eu.atos.sla.datamodel.IViolation", "java.util.List" ]
import eu.atos.sla.datamodel.IViolation; import java.util.List;
import eu.atos.sla.datamodel.*; import java.util.*;
[ "eu.atos.sla", "java.util" ]
eu.atos.sla; java.util;
2,627,986
@SuppressWarnings("deprecation") public void stop() { final ReentrantLock mainLock = this.mainLock; mainLock.lock(); try { try { if (worker.isAlive()) { worker.stop(); } } finally { worker = null; } } finally { mainLock.unlock(); } }
@SuppressWarnings(STR) void function() { final ReentrantLock mainLock = this.mainLock; mainLock.lock(); try { try { if (worker.isAlive()) { worker.stop(); } } finally { worker = null; } } finally { mainLock.unlock(); } }
/** * Force the underlying thread to stop. */
Force the underlying thread to stop
stop
{ "repo_name": "jbenech/gnikrap", "path": "gnikrap-core/src/main/java/org/gnikrap/utils/StopableExecutor.java", "license": "gpl-3.0", "size": 2441 }
[ "java.util.concurrent.locks.ReentrantLock" ]
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.*;
[ "java.util" ]
java.util;
511,773
@Test public void testDestoryRegistry() { URL newRegistryUrl = registryUrl.addParameter(EXPORT_KEY, serviceUrl); Invoker<RegistryProtocolTest> invoker = new MockInvoker<RegistryProtocolTest>(RegistryProtocolTest.class, newRegistryUrl); Exporter<?> exporter = protocol.export(invoker); destroyRegistryProtocol(); try { Thread.sleep(ConfigurationUtils.getServerShutdownTimeout() + 100); } catch (InterruptedException e) { e.printStackTrace(); } assertFalse(exporter.getInvoker().isAvailable()); }
void function() { URL newRegistryUrl = registryUrl.addParameter(EXPORT_KEY, serviceUrl); Invoker<RegistryProtocolTest> invoker = new MockInvoker<RegistryProtocolTest>(RegistryProtocolTest.class, newRegistryUrl); Exporter<?> exporter = protocol.export(invoker); destroyRegistryProtocol(); try { Thread.sleep(ConfigurationUtils.getServerShutdownTimeout() + 100); } catch (InterruptedException e) { e.printStackTrace(); } assertFalse(exporter.getInvoker().isAvailable()); }
/** * Test destory registry, exporter can be normal by destroyed */
Test destory registry, exporter can be normal by destroyed
testDestoryRegistry
{ "repo_name": "qtvbwfn/dubbo", "path": "dubbo-registry/dubbo-registry-default/src/test/java/org/apache/dubbo/registry/dubbo/RegistryProtocolTest.java", "license": "apache-2.0", "size": 10033 }
[ "org.apache.dubbo.common.config.ConfigurationUtils", "org.apache.dubbo.rpc.Exporter", "org.apache.dubbo.rpc.Invoker", "org.junit.jupiter.api.Assertions" ]
import org.apache.dubbo.common.config.ConfigurationUtils; import org.apache.dubbo.rpc.Exporter; import org.apache.dubbo.rpc.Invoker; import org.junit.jupiter.api.Assertions;
import org.apache.dubbo.common.config.*; import org.apache.dubbo.rpc.*; import org.junit.jupiter.api.*;
[ "org.apache.dubbo", "org.junit.jupiter" ]
org.apache.dubbo; org.junit.jupiter;
2,708,778
public SortedSet headSet(Object toMapEntry) { return subSet(null, false, toMapEntry, false); }
SortedSet function(Object toMapEntry) { return subSet(null, false, toMapEntry, false); }
/** * Returns a view of the portion of this sorted set whose elements are * strictly less than toMapEntry. * This method conforms to the {@link SortedSet#headSet} interface. * * <p>Note that the return value is a StoredCollection and must be treated * as such; for example, its iterators must be explicitly closed.</p> * * @param toMapEntry the upper bound. * * @return the subset. * * @throws RuntimeExceptionWrapper if a {@link * com.sleepycat.db.DatabaseException} is thrown. */
Returns a view of the portion of this sorted set whose elements are strictly less than toMapEntry. This method conforms to the <code>SortedSet#headSet</code> interface. Note that the return value is a StoredCollection and must be treated as such; for example, its iterators must be explicitly closed
headSet
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/db/db-4.6.21/java/src/com/sleepycat/collections/StoredSortedEntrySet.java", "license": "gpl-2.0", "size": 7725 }
[ "java.util.SortedSet" ]
import java.util.SortedSet;
import java.util.*;
[ "java.util" ]
java.util;
978,622
public native final JsArray<LayerInfo> getLayerInfos() ;
native final JsArray<LayerInfo> function() ;
/** * Returns the available layers in service and their default visibility. * * @return JsArray<LayerInfo> */
Returns the available layers in service and their default visibility
getLayerInfos
{ "repo_name": "CSTARS/gwt-esri", "path": "src/main/java/edu/ucdavis/cstars/client/layers/ArcGISDynamicMapServiceLayer.java", "license": "lgpl-3.0", "size": 25196 }
[ "com.google.gwt.core.client.JsArray" ]
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.*;
[ "com.google.gwt" ]
com.google.gwt;
713,437
public void compile(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor) throws BuildException { BuildException exc = null; // // determine length of executable name and args // String command = getCommandWithPath(config); int baseLength = command.length() + args.length + endArgs.length; if (libtool) { baseLength += 8; } for (int i = 0; i < args.length; i++) { baseLength += args[i].length(); } for (int i = 0; i < endArgs.length; i++) { baseLength += endArgs[i].length(); } if (baseLength > getMaximumCommandLength()) { throw new BuildException( "Command line is over maximum length without specifying source file"); } // // typically either 1 or Integer.MAX_VALUE // int maxInputFilesPerCommand = getMaximumInputFilesPerCommand(); int argumentCountPerInputFile = getArgumentCountPerInputFile(); for (int sourceIndex = 0; sourceIndex < sourceFiles.length;) { int cmdLength = baseLength; int firstFileNextExec; for (firstFileNextExec = sourceIndex; firstFileNextExec < sourceFiles.length && (firstFileNextExec - sourceIndex) < maxInputFilesPerCommand; firstFileNextExec++) { cmdLength += getTotalArgumentLengthForInputFile(outputDir, sourceFiles[firstFileNextExec]); if (cmdLength >= getMaximumCommandLength()) break; } if (firstFileNextExec == sourceIndex) { throw new BuildException( "Extremely long file name, can't fit on command line"); } int argCount = args.length + 1 + endArgs.length + (firstFileNextExec - sourceIndex) * argumentCountPerInputFile; if (libtool) { argCount++; } String[] commandline = new String[argCount]; int index = 0; if (libtool) { commandline[index++] = "libtool"; } commandline[index++] = command; for (int j = 0; j < args.length; j++) { commandline[index++] = args[j]; } for (int j = sourceIndex; j < firstFileNextExec; j++) { for (int k = 0; k < argumentCountPerInputFile; k++) { commandline[index++] = getInputFileArgument(outputDir, sourceFiles[j], k); } } for (int j = 0; j < endArgs.length; j++) { commandline[index++] = endArgs[j]; } int retval = runCommand(task, outputDir, commandline); if (monitor != null) { String[] fileNames = new String[firstFileNextExec - sourceIndex]; for (int j = 0; j < fileNames.length; j++) { fileNames[j] = sourceFiles[sourceIndex + j]; } monitor.progress(fileNames); } // // if the process returned a failure code and // we aren't holding an exception from an earlier // interation if (retval != 0 && exc == null) { // // construct the exception // exc = new BuildException(getCommandWithPath(config) + " failed with return code " + retval, task .getLocation()); // // and throw it now unless we are relentless // if (!relentless) { throw exc; } } sourceIndex = firstFileNextExec; } // // if the compiler returned a failure value earlier // then throw an exception if (exc != null) { throw exc; } }
void function(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor) throws BuildException { BuildException exc = null; int baseLength = command.length() + args.length + endArgs.length; if (libtool) { baseLength += 8; } for (int i = 0; i < args.length; i++) { baseLength += args[i].length(); } for (int i = 0; i < endArgs.length; i++) { baseLength += endArgs[i].length(); } if (baseLength > getMaximumCommandLength()) { throw new BuildException( STR); } int argumentCountPerInputFile = getArgumentCountPerInputFile(); for (int sourceIndex = 0; sourceIndex < sourceFiles.length;) { int cmdLength = baseLength; int firstFileNextExec; for (firstFileNextExec = sourceIndex; firstFileNextExec < sourceFiles.length && (firstFileNextExec - sourceIndex) < maxInputFilesPerCommand; firstFileNextExec++) { cmdLength += getTotalArgumentLengthForInputFile(outputDir, sourceFiles[firstFileNextExec]); if (cmdLength >= getMaximumCommandLength()) break; } if (firstFileNextExec == sourceIndex) { throw new BuildException( STR); } int argCount = args.length + 1 + endArgs.length + (firstFileNextExec - sourceIndex) * argumentCountPerInputFile; if (libtool) { argCount++; } String[] commandline = new String[argCount]; int index = 0; if (libtool) { commandline[index++] = STR; } commandline[index++] = command; for (int j = 0; j < args.length; j++) { commandline[index++] = args[j]; } for (int j = sourceIndex; j < firstFileNextExec; j++) { for (int k = 0; k < argumentCountPerInputFile; k++) { commandline[index++] = getInputFileArgument(outputDir, sourceFiles[j], k); } } for (int j = 0; j < endArgs.length; j++) { commandline[index++] = endArgs[j]; } int retval = runCommand(task, outputDir, commandline); if (monitor != null) { String[] fileNames = new String[firstFileNextExec - sourceIndex]; for (int j = 0; j < fileNames.length; j++) { fileNames[j] = sourceFiles[sourceIndex + j]; } monitor.progress(fileNames); } if (retval != 0 && exc == null) { + STR + retval, task .getLocation()); throw exc; } } sourceIndex = firstFileNextExec; } if (exc != null) { throw exc; } }
/** * Compiles a source file. * */
Compiles a source file
compile
{ "repo_name": "muzare/nar-maven-plugin", "path": "src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java", "license": "apache-2.0", "size": 19578 }
[ "com.github.maven_nar.cpptasks.CCTask", "java.io.File", "org.apache.tools.ant.BuildException" ]
import com.github.maven_nar.cpptasks.CCTask; import java.io.File; import org.apache.tools.ant.BuildException;
import com.github.maven_nar.cpptasks.*; import java.io.*; import org.apache.tools.ant.*;
[ "com.github.maven_nar", "java.io", "org.apache.tools" ]
com.github.maven_nar; java.io; org.apache.tools;
2,437,111
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<KustoPoolInner> createOrUpdateAsync( String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters, String ifMatch, String ifNoneMatch, Context context) { return beginCreateOrUpdateAsync( workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) .last() .flatMap(this.client::getLroFinalResultOrError); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<KustoPoolInner> function( String workspaceName, String resourceGroupName, String kustoPoolName, KustoPoolInner parameters, String ifMatch, String ifNoneMatch, Context context) { return beginCreateOrUpdateAsync( workspaceName, resourceGroupName, kustoPoolName, parameters, ifMatch, ifNoneMatch, context) .last() .flatMap(this.client::getLroFinalResultOrError); }
/** * Create or update a Kusto pool. * * @param workspaceName The name of the workspace. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param kustoPoolName The name of the Kusto pool. * @param parameters The Kusto pool parameters supplied to the CreateOrUpdate operation. * @param ifMatch The ETag of the Kusto Pool. Omit this value to always overwrite the current Kusto Pool. Specify * the last-seen ETag value to prevent accidentally overwriting concurrent changes. * @param ifNoneMatch Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto * Pool. Other values will result in a 412 Pre-condition Failed response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return class representing a Kusto kusto pool on successful completion of {@link Mono}. */
Create or update a Kusto pool
createOrUpdateAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KustoPoolsClientImpl.java", "license": "mit", "size": 205878 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.Context", "com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.KustoPoolInner;
import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.synapse.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,472,254
private Cursor getContactByAddress(final String address) { final Uri uri = Uri.withAppendedPath(Email.CONTENT_LOOKUP_URI, Uri.encode(address)); final Cursor c = mContentResolver.query( uri, PROJECTION, null, null, SORT_ORDER); return c; }
Cursor function(final String address) { final Uri uri = Uri.withAppendedPath(Email.CONTENT_LOOKUP_URI, Uri.encode(address)); final Cursor c = mContentResolver.query( uri, PROJECTION, null, null, SORT_ORDER); return c; }
/** * Return a {@link Cursor} instance that can be used to fetch information * about the contact with the given email address. * * @param address The email address to search for. * @return A {@link Cursor} instance that can be used to fetch information * about the contact with the given email address */
Return a <code>Cursor</code> instance that can be used to fetch information about the contact with the given email address
getContactByAddress
{ "repo_name": "1037704496/ZywxEmail", "path": "src/com/fsck/zywxMailk9/helper/ContactsSdk5.java", "license": "bsd-3-clause", "size": 8321 }
[ "android.database.Cursor", "android.net.Uri", "android.provider.ContactsContract" ]
import android.database.Cursor; import android.net.Uri; import android.provider.ContactsContract;
import android.database.*; import android.net.*; import android.provider.*;
[ "android.database", "android.net", "android.provider" ]
android.database; android.net; android.provider;
1,940,941
public void addFormulaList(final String element, final String keyword, final String attributeName) { final List<String[]> elements = new ArrayList<>(1); elements.add(new String[] {element, TLAConstants.EMPTY_STRING}); addFormulaList(elements, keyword, attributeName); }
void function(final String element, final String keyword, final String attributeName) { final List<String[]> elements = new ArrayList<>(1); elements.add(new String[] {element, TLAConstants.EMPTY_STRING}); addFormulaList(elements, keyword, attributeName); }
/** * Convenience method to call {@link #addFormulaList(List, String, String)} wrapping the {@code element} parameter. * * @param element * @param keyword * @param attributeName */
Convenience method to call <code>#addFormulaList(List, String, String)</code> wrapping the element parameter
addFormulaList
{ "repo_name": "lemmy/tlaplus", "path": "tlatools/org.lamport.tlatools/src/tlc2/output/AbstractSpecWriter.java", "license": "mit", "size": 24224 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,775,068
private void assertGlobMatches( List<String> result, List<String> includes, List<String> excludes, boolean excludeDirs) throws Exception { Pair<Package, GlobCache> evaluated = evaluateGlob( includes, excludes, excludeDirs, Starlark.format("(result == sorted(%r)) or fail('incorrect glob result')", result)); Package pkg = evaluated.first; GlobCache globCache = evaluated.second; // Ensure all of the patterns are recorded against this package: assertThat(globCache.getKeySet().containsAll(createGlobCacheKeys(includes, excludeDirs))) .isTrue(); assertThat(pkg.containsErrors()).isFalse(); }
void function( List<String> result, List<String> includes, List<String> excludes, boolean excludeDirs) throws Exception { Pair<Package, GlobCache> evaluated = evaluateGlob( includes, excludes, excludeDirs, Starlark.format(STR, result)); Package pkg = evaluated.first; GlobCache globCache = evaluated.second; assertThat(globCache.getKeySet().containsAll(createGlobCacheKeys(includes, excludeDirs))) .isTrue(); assertThat(pkg.containsErrors()).isFalse(); }
/** * Test globbing in the context of a package, using the build language. We use the specially setup * "globs" test package and the files beneath it. * * @param result the expected list of filenames that match the glob * @param includes an include pattern for the glob * @param excludes an exclude pattern for the glob * @param excludeDirs an exclude_directories flag for the glob * @throws Exception if the glob doesn't match the expected result. */
Test globbing in the context of a package, using the build language. We use the specially setup "globs" test package and the files beneath it
assertGlobMatches
{ "repo_name": "davidzchen/bazel", "path": "src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java", "license": "apache-2.0", "size": 55544 }
[ "com.google.common.truth.Truth", "com.google.devtools.build.lib.util.Pair", "java.util.List", "net.starlark.java.eval.Starlark" ]
import com.google.common.truth.Truth; import com.google.devtools.build.lib.util.Pair; import java.util.List; import net.starlark.java.eval.Starlark;
import com.google.common.truth.*; import com.google.devtools.build.lib.util.*; import java.util.*; import net.starlark.java.eval.*;
[ "com.google.common", "com.google.devtools", "java.util", "net.starlark.java" ]
com.google.common; com.google.devtools; java.util; net.starlark.java;
1,447,882
private void initializeItem(String itemName) { for (OnkyoBindingProvider provider : providers) { String initCmd = provider.getItemInitCommand(itemName); if (initCmd != null) { logger.debug("Initialize item {}", itemName); String[] commandParts = initCmd.split(":"); String deviceId = commandParts[0]; String deviceCmd = commandParts[1]; DeviceConfig device = deviceConfigCache.get(deviceId); OnkyoConnection remoteController = device.getConnection(); if (device != null && remoteController != null) { if (deviceCmd.startsWith(ADVANCED_COMMAND_KEY)) { deviceCmd = deviceCmd.replace(ADVANCED_COMMAND_KEY, ""); } else { EiscpCommand cmd = EiscpCommand.valueOf(deviceCmd); deviceCmd = cmd.getCommand(); } remoteController.send(deviceCmd); } else { logger.warn("Cannot find connection details for device id '{}'", deviceId); } } } } static class DeviceConfig { String host; String serialPortName; int port = DEFAULT_PORT; OnkyoConnection connection = null; String deviceId; public DeviceConfig(String deviceId) { this.deviceId = deviceId; }
void function(String itemName) { for (OnkyoBindingProvider provider : providers) { String initCmd = provider.getItemInitCommand(itemName); if (initCmd != null) { logger.debug(STR, itemName); String[] commandParts = initCmd.split(":"); String deviceId = commandParts[0]; String deviceCmd = commandParts[1]; DeviceConfig device = deviceConfigCache.get(deviceId); OnkyoConnection remoteController = device.getConnection(); if (device != null && remoteController != null) { if (deviceCmd.startsWith(ADVANCED_COMMAND_KEY)) { deviceCmd = deviceCmd.replace(ADVANCED_COMMAND_KEY, STRCannot find connection details for device id '{}'", deviceId); } } } } static class DeviceConfig { String host; String serialPortName; int port = DEFAULT_PORT; OnkyoConnection connection = null; String deviceId; public DeviceConfig(String deviceId) { this.deviceId = deviceId; }
/** * Initialize item value. Method send query to receiver if init query is * configured to binding item configuration * * @param itemType * */
Initialize item value. Method send query to receiver if init query is configured to binding item configuration
initializeItem
{ "repo_name": "computergeek1507/openhab", "path": "bundles/binding/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoBinding.java", "license": "epl-1.0", "size": 18319 }
[ "org.openhab.binding.onkyo.OnkyoBindingProvider" ]
import org.openhab.binding.onkyo.OnkyoBindingProvider;
import org.openhab.binding.onkyo.*;
[ "org.openhab.binding" ]
org.openhab.binding;
2,756,090
public VariableReference getLeftOperand() { return leftOperand; } /** * <p> * Getter for the field <code>operator</code>. * </p> * * @return a {@link org.evosuite.testcase.statements.PrimitiveExpression.Operator}
VariableReference function() { return leftOperand; } /** * <p> * Getter for the field <code>operator</code>. * </p> * * @return a {@link org.evosuite.testcase.statements.PrimitiveExpression.Operator}
/** * <p> * Getter for the field <code>leftOperand</code>. * </p> * * @return a {@link org.evosuite.testcase.variable.VariableReference} object. */
Getter for the field <code>leftOperand</code>.
getLeftOperand
{ "repo_name": "SoftwareEngineeringToolDemos/FSE-2011-EvoSuite", "path": "client/src/main/java/org/evosuite/testcase/statements/PrimitiveExpression.java", "license": "lgpl-3.0", "size": 7485 }
[ "org.evosuite.testcase.variable.VariableReference" ]
import org.evosuite.testcase.variable.VariableReference;
import org.evosuite.testcase.variable.*;
[ "org.evosuite.testcase" ]
org.evosuite.testcase;
296,149
@Override public void doSaveAs() { SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); saveAsDialog.open(); IPath path = saveAsDialog.getResult(); if (path != null) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); if (file != null) { doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); } } }
void function() { SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); saveAsDialog.open(); IPath path = saveAsDialog.getResult(); if (path != null) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); if (file != null) { doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); } } }
/** * This also changes the editor's input. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This also changes the editor's input.
doSaveAs
{ "repo_name": "aciancone/klapersuite", "path": "klapersuite.metamodel.klaper.editor/src/klaper/probability/presentation/ProbabilityEditor.java", "license": "epl-1.0", "size": 54031 }
[ "org.eclipse.core.resources.IFile", "org.eclipse.core.resources.ResourcesPlugin", "org.eclipse.core.runtime.IPath", "org.eclipse.emf.common.util.URI", "org.eclipse.ui.dialogs.SaveAsDialog", "org.eclipse.ui.part.FileEditorInput" ]
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.emf.common.util.URI; import org.eclipse.ui.dialogs.SaveAsDialog; import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.emf.common.util.*; import org.eclipse.ui.dialogs.*; import org.eclipse.ui.part.*;
[ "org.eclipse.core", "org.eclipse.emf", "org.eclipse.ui" ]
org.eclipse.core; org.eclipse.emf; org.eclipse.ui;
742,196
@Test public void test() throws Exception { DocumentationTool tool = ToolProvider.getSystemDocumentationTool(); check(tool, "-sourcepath", 1); check(tool, "-verbose", 0); check(tool, "-ZZZ", -1); try { check(tool, null, -1); error("null was accepted without exception"); } catch (NullPointerException e) { } }
void function() throws Exception { DocumentationTool tool = ToolProvider.getSystemDocumentationTool(); check(tool, STR, 1); check(tool, STR, 0); check(tool, "-ZZZ", -1); try { check(tool, null, -1); error(STR); } catch (NullPointerException e) { } }
/** * Verify that isSupportedOption method can be invoked. */
Verify that isSupportedOption method can be invoked
test
{ "repo_name": "google/error-prone-javac", "path": "test/tools/javadoc/api/basic/IsSupportedOptionTest.java", "license": "gpl-2.0", "size": 2326 }
[ "javax.tools.DocumentationTool", "javax.tools.ToolProvider" ]
import javax.tools.DocumentationTool; import javax.tools.ToolProvider;
import javax.tools.*;
[ "javax.tools" ]
javax.tools;
2,344,520
public void setTransLogTable( TransLogTable transLogTable ) { this.transLogTable = transLogTable; }
void function( TransLogTable transLogTable ) { this.transLogTable = transLogTable; }
/** * Sets the log table for the transformation. * * @param transLogTable the log table to set */
Sets the log table for the transformation
setTransLogTable
{ "repo_name": "dkincade/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/trans/TransMeta.java", "license": "apache-2.0", "size": 227503 }
[ "org.pentaho.di.core.logging.TransLogTable" ]
import org.pentaho.di.core.logging.TransLogTable;
import org.pentaho.di.core.logging.*;
[ "org.pentaho.di" ]
org.pentaho.di;
635,029
private static MatrixBlock computeMatrixInverse(Array2DRowRealMatrix in) throws DMLRuntimeException { if ( !in.isSquare() ) throw new DMLRuntimeException("Input to inv() must be square matrix -- given: a " + in.getRowDimension() + "x" + in.getColumnDimension() + " matrix."); QRDecomposition qrdecompose = new QRDecomposition(in); DecompositionSolver solver = qrdecompose.getSolver(); RealMatrix inverseMatrix = solver.getInverse(); return DataConverter.convertToMatrixBlock(inverseMatrix.getData()); }
static MatrixBlock function(Array2DRowRealMatrix in) throws DMLRuntimeException { if ( !in.isSquare() ) throw new DMLRuntimeException(STR + in.getRowDimension() + "x" + in.getColumnDimension() + STR); QRDecomposition qrdecompose = new QRDecomposition(in); DecompositionSolver solver = qrdecompose.getSolver(); RealMatrix inverseMatrix = solver.getInverse(); return DataConverter.convertToMatrixBlock(inverseMatrix.getData()); }
/** * Function to compute matrix inverse via matrix decomposition. * * @param in commons-math3 Array2DRowRealMatrix * @return matrix block * @throws DMLRuntimeException if DMLRuntimeException occurs */
Function to compute matrix inverse via matrix decomposition
computeMatrixInverse
{ "repo_name": "asurve/arvind-sysml", "path": "src/main/java/org/apache/sysml/runtime/matrix/data/LibCommonsMath.java", "license": "apache-2.0", "size": 9237 }
[ "org.apache.commons.math3.linear.Array2DRowRealMatrix", "org.apache.commons.math3.linear.DecompositionSolver", "org.apache.commons.math3.linear.QRDecomposition", "org.apache.commons.math3.linear.RealMatrix", "org.apache.sysml.runtime.DMLRuntimeException", "org.apache.sysml.runtime.util.DataConverter" ]
import org.apache.commons.math3.linear.Array2DRowRealMatrix; import org.apache.commons.math3.linear.DecompositionSolver; import org.apache.commons.math3.linear.QRDecomposition; import org.apache.commons.math3.linear.RealMatrix; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.util.DataConverter;
import org.apache.commons.math3.linear.*; import org.apache.sysml.runtime.*; import org.apache.sysml.runtime.util.*;
[ "org.apache.commons", "org.apache.sysml" ]
org.apache.commons; org.apache.sysml;
2,058,723
public static Test suite() { log.fine("Creating a TestSuite for GrahamScan"); return new TestSuite(GrahamScanTest.class); }
static Test function() { log.fine(STR); return new TestSuite(GrahamScanTest.class); }
/** * Test suite * * @return static Test */
Test suite
suite
{ "repo_name": "tectronics/two-point-correlation", "path": "src/test/java/algorithms/compGeometry/convexHull/GrahamScanTest.java", "license": "mit", "size": 12372 }
[ "junit.framework.Test", "junit.framework.TestSuite" ]
import junit.framework.Test; import junit.framework.TestSuite;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
1,975,591
public static void fetchImage(final Context context, final String url, final OnFetchCompleteListener callback) { fetchImage(context, url, null, null, callback); }
static void function(final Context context, final String url, final OnFetchCompleteListener callback) { fetchImage(context, url, null, null, callback); }
/** * Only call this method from the main (UI) thread. The {@link OnFetchCompleteListener} callback * be invoked on the UI thread, but image fetching will be done in an {@link AsyncTask}. */
Only call this method from the main (UI) thread. The <code>OnFetchCompleteListener</code> callback be invoked on the UI thread, but image fetching will be done in an <code>AsyncTask</code>
fetchImage
{ "repo_name": "sanyaade-iot/freedomotic-android-client", "path": "src/es/gpulido/freedomotic/util/BitmapUtils.java", "license": "gpl-2.0", "size": 13313 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,401,903
int updateByPrimaryKey(Item record);
int updateByPrimaryKey(Item record);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table item * * @mbggenerated Sun Aug 20 16:27:11 CST 2017 */
This method was generated by MyBatis Generator. This method corresponds to the database table item
updateByPrimaryKey
{ "repo_name": "guhanjie/wine", "path": "src/main/java/top/guhanjie/wine/mapper/ItemMapper.java", "license": "apache-2.0", "size": 1947 }
[ "top.guhanjie.wine.model.Item" ]
import top.guhanjie.wine.model.Item;
import top.guhanjie.wine.model.*;
[ "top.guhanjie.wine" ]
top.guhanjie.wine;
1,949,968
private void determineSyntaxAndEncoding(String absFileName, JarFile jarFile, String jspConfigPageEnc) throws JasperException, IOException { isXml = false; boolean isExternal = false; boolean revert = false; JspConfig jspConfig = ctxt.getOptions().getJspConfig(); JspProperty jspProperty = jspConfig.findJspProperty(absFileName); if (jspProperty.isXml() != null) { // If <is-xml> is specified in a <jsp-property-group>, it is used. isXml = JspUtil.booleanValue(jspProperty.isXml()); isExternal = true; } else if (absFileName.endsWith(".jspx") || absFileName.endsWith(".tagx")) { isXml = true; isExternal = true; } if (isExternal && !isXml) { // JSP (standard) syntax. Use encoding specified in jsp-config // if provided. sourceEnc = jspConfigPageEnc; if (sourceEnc != null) { return; } // We don't know the encoding sourceEnc = "ISO-8859-1"; } else { // XML syntax or unknown, (auto)detect encoding ... Object[] ret = XMLEncodingDetector.getEncoding(absFileName, jarFile, ctxt, err); sourceEnc = (String) ret[0]; if (((Boolean) ret[1]).booleanValue()) { isEncodingSpecifiedInProlog = true; } if (ret[2] != null && ((Boolean) ret[2]).booleanValue()) { hasBom = true; } if (!isXml && sourceEnc.equalsIgnoreCase("utf-8") && !hasBom) { sourceEnc = "ISO-8859-1"; revert = true; } } if (isXml) { // (This implies 'isExternal' is TRUE.) // We know we're dealing with a JSP document (via JSP config or // ".jspx" suffix), so we're done. return; } JspReader jspReader = null; try { jspReader = new JspReader(ctxt, absFileName, sourceEnc, jarFile, err); } catch (FileNotFoundException ex) { throw new JasperException(ex); } jspReader.setSingleFile(true); Mark startMark = jspReader.mark(); if (!isExternal) { jspReader.reset(startMark); if (hasJspRoot(jspReader)) { isXml = true; if (revert) sourceEnc = "UTF-8"; return; } else { isXml = false; } } if (!hasBom) { sourceEnc = jspConfigPageEnc; } if (sourceEnc == null) { sourceEnc = getPageEncodingForJspSyntax(jspReader, startMark); if (sourceEnc == null) { // Default to "ISO-8859-1" per JSP spec sourceEnc = "ISO-8859-1"; isDefaultPageEncoding = true; } } }
void function(String absFileName, JarFile jarFile, String jspConfigPageEnc) throws JasperException, IOException { isXml = false; boolean isExternal = false; boolean revert = false; JspConfig jspConfig = ctxt.getOptions().getJspConfig(); JspProperty jspProperty = jspConfig.findJspProperty(absFileName); if (jspProperty.isXml() != null) { isXml = JspUtil.booleanValue(jspProperty.isXml()); isExternal = true; } else if (absFileName.endsWith(".jspx") absFileName.endsWith(".tagx")) { isXml = true; isExternal = true; } if (isExternal && !isXml) { sourceEnc = jspConfigPageEnc; if (sourceEnc != null) { return; } sourceEnc = STR; } else { Object[] ret = XMLEncodingDetector.getEncoding(absFileName, jarFile, ctxt, err); sourceEnc = (String) ret[0]; if (((Boolean) ret[1]).booleanValue()) { isEncodingSpecifiedInProlog = true; } if (ret[2] != null && ((Boolean) ret[2]).booleanValue()) { hasBom = true; } if (!isXml && sourceEnc.equalsIgnoreCase("utf-8") && !hasBom) { sourceEnc = STR; revert = true; } } if (isXml) { return; } JspReader jspReader = null; try { jspReader = new JspReader(ctxt, absFileName, sourceEnc, jarFile, err); } catch (FileNotFoundException ex) { throw new JasperException(ex); } jspReader.setSingleFile(true); Mark startMark = jspReader.mark(); if (!isExternal) { jspReader.reset(startMark); if (hasJspRoot(jspReader)) { isXml = true; if (revert) sourceEnc = "UTF-8"; return; } else { isXml = false; } } if (!hasBom) { sourceEnc = jspConfigPageEnc; } if (sourceEnc == null) { sourceEnc = getPageEncodingForJspSyntax(jspReader, startMark); if (sourceEnc == null) { sourceEnc = STR; isDefaultPageEncoding = true; } } }
/** * Determines the syntax (standard or XML) and page encoding properties * for the given file, and stores them in the 'isXml' and 'sourceEnc' * instance variables, respectively. */
Determines the syntax (standard or XML) and page encoding properties for the given file, and stores them in the 'isXml' and 'sourceEnc' instance variables, respectively
determineSyntaxAndEncoding
{ "repo_name": "TinyGroup/tiny", "path": "web/org.tinygroup.jspengine/src/main/java/org/tinygroup/jspengine/compiler/ParserController.java", "license": "gpl-3.0", "size": 20618 }
[ "java.io.FileNotFoundException", "java.io.IOException", "java.util.jar.JarFile", "org.tinygroup.jspengine.JasperException", "org.tinygroup.jspengine.xmlparser.XMLEncodingDetector" ]
import java.io.FileNotFoundException; import java.io.IOException; import java.util.jar.JarFile; import org.tinygroup.jspengine.JasperException; import org.tinygroup.jspengine.xmlparser.XMLEncodingDetector;
import java.io.*; import java.util.jar.*; import org.tinygroup.jspengine.*; import org.tinygroup.jspengine.xmlparser.*;
[ "java.io", "java.util", "org.tinygroup.jspengine" ]
java.io; java.util; org.tinygroup.jspengine;
2,690,324
public MessageHolder getDelegatedCustomMessageViewHolder(int dataTypeHash, OnDelegateViewHolder<MessageHolder> callback, MessagesAdapter messagesAdapter, ViewGroup viewGroup) { MessageHolder delegated = delegate.getCustomMessageViewHolder(dataTypeHash, messagesAdapter, viewGroup); if (delegated != null) { return delegated; } else { return callback.onNotDelegated(); } }
MessageHolder function(int dataTypeHash, OnDelegateViewHolder<MessageHolder> callback, MessagesAdapter messagesAdapter, ViewGroup viewGroup) { MessageHolder delegated = delegate.getCustomMessageViewHolder(dataTypeHash, messagesAdapter, viewGroup); if (delegated != null) { return delegated; } else { return callback.onNotDelegated(); } }
/** * Method is used internally for getting delegated list ViewHolder for custom messages types */
Method is used internally for getting delegated list ViewHolder for custom messages types
getDelegatedCustomMessageViewHolder
{ "repo_name": "y0ke/actor-platform", "path": "actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/ActorSDK.java", "license": "agpl-3.0", "size": 27580 }
[ "android.view.ViewGroup", "im.actor.sdk.controllers.conversation.MessagesAdapter", "im.actor.sdk.controllers.conversation.messages.MessageHolder" ]
import android.view.ViewGroup; import im.actor.sdk.controllers.conversation.MessagesAdapter; import im.actor.sdk.controllers.conversation.messages.MessageHolder;
import android.view.*; import im.actor.sdk.controllers.conversation.*; import im.actor.sdk.controllers.conversation.messages.*;
[ "android.view", "im.actor.sdk" ]
android.view; im.actor.sdk;
1,724,387
List<AnswerHeader> getPrintAnswerHeadersForProtocol(ModuleQuestionnaireBean moduleQuestionnaireBean, String protocolNumber, QuestionnaireHelperBase questionnaireHelper);
List<AnswerHeader> getPrintAnswerHeadersForProtocol(ModuleQuestionnaireBean moduleQuestionnaireBean, String protocolNumber, QuestionnaireHelperBase questionnaireHelper);
/** * * This method is to get all the questionnaire answers to print for the protocol. * This method is intended to obtain the data that will ultimately be used by the protocol actions, print, questionnaire sub-tab. * * @param moduleQuestionnaireBean * @param protocolNumber * @param questionnaireHelper * @return */
This method is to get all the questionnaire answers to print for the protocol. This method is intended to obtain the data that will ultimately be used by the protocol actions, print, questionnaire sub-tab
getPrintAnswerHeadersForProtocol
{ "repo_name": "jwillia/kc-old1", "path": "coeus-impl/src/main/java/org/kuali/coeus/common/questionnaire/framework/answer/QuestionnaireAnswerService.java", "license": "agpl-3.0", "size": 6791 }
[ "java.util.List", "org.kuali.kra.protocol.questionnaire.QuestionnaireHelperBase" ]
import java.util.List; import org.kuali.kra.protocol.questionnaire.QuestionnaireHelperBase;
import java.util.*; import org.kuali.kra.protocol.questionnaire.*;
[ "java.util", "org.kuali.kra" ]
java.util; org.kuali.kra;
2,757,134
public void putDocuments(List<StudentAttributes> students) { studentsDb.putDocuments(students); }
void function(List<StudentAttributes> students) { studentsDb.putDocuments(students); }
/** * Batch creates or updates documents for the given students. */
Batch creates or updates documents for the given students
putDocuments
{ "repo_name": "guzman890/EpisMates", "path": "src/main/java/teammates/logic/core/StudentsLogic.java", "license": "gpl-2.0", "size": 29572 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
675,403
void enterInterfaceMemberDeclaration(@NotNull Java8Parser.InterfaceMemberDeclarationContext ctx); void exitInterfaceMemberDeclaration(@NotNull Java8Parser.InterfaceMemberDeclarationContext ctx);
void enterInterfaceMemberDeclaration(@NotNull Java8Parser.InterfaceMemberDeclarationContext ctx); void exitInterfaceMemberDeclaration(@NotNull Java8Parser.InterfaceMemberDeclarationContext ctx);
/** * Exit a parse tree produced by {@link Java8Parser#interfaceMemberDeclaration}. * @param ctx the parse tree */
Exit a parse tree produced by <code>Java8Parser#interfaceMemberDeclaration</code>
exitInterfaceMemberDeclaration
{ "repo_name": "IsThisThePayneResidence/intellidots", "path": "src/main/java/ua/edu/hneu/ast/parsers/Java8Listener.java", "license": "gpl-3.0", "size": 95845 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
608,436
private static final ScheduledThreadPoolExecutor scheduled = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("AnimaClient-heartbeat", true)); // 心跳定时器 private ScheduledFuture<?> heatbeatTimer; // 心跳超时,毫秒。缺省0,不会执行心跳 private int heartbeat; private int heartbeatTimeout; public static HpgscClient build(String identify,String remoteIp,int remotePort,int connectTimeout) { HpgscClientConf conf = new HpgscClientConf(); conf.setRemoteHost(remoteIp); conf.setIdentify(identify); conf.setRemotePort(remotePort); conf.setConnectTimeout(connectTimeout); HpgscClient client = new HpgscClient(conf); return client; } public HpgscClient(HpgscClientConf conf) { Preconditions.checkArgument(conf != null, "conf can not be null!"); this.conf = conf; this.index = INDEX_GEN.incrementAndGet(); }
static final ScheduledThreadPoolExecutor scheduled = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory(STR, true)); private ScheduledFuture<?> heatbeatTimer; private int heartbeat; private int heartbeatTimeout; public static HpgscClient function(String identify,String remoteIp,int remotePort,int connectTimeout) { HpgscClientConf conf = new HpgscClientConf(); conf.setRemoteHost(remoteIp); conf.setIdentify(identify); conf.setRemotePort(remotePort); conf.setConnectTimeout(connectTimeout); HpgscClient client = new HpgscClient(conf); return client; } public HpgscClient(HpgscClientConf conf) { Preconditions.checkArgument(conf != null, STR); this.conf = conf; this.index = INDEX_GEN.incrementAndGet(); }
/** * build hpgsc client * @param identify * @param remoteIp * @param remotePort * @param connectTimeout * @return */
build hpgsc client
build
{ "repo_name": "qiuhd2015/Hpgsc-RPC", "path": "hpgsc-rpc/src/main/java/org/hdl/hggsc/rpc/client/HpgscClient.java", "license": "mit", "size": 11793 }
[ "java.util.concurrent.ScheduledFuture", "java.util.concurrent.ScheduledThreadPoolExecutor", "org.hdl.hpgsc.common.NamedThreadFactory", "org.hdl.hpgsc.common.utils.Preconditions" ]
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; import org.hdl.hpgsc.common.NamedThreadFactory; import org.hdl.hpgsc.common.utils.Preconditions;
import java.util.concurrent.*; import org.hdl.hpgsc.common.*; import org.hdl.hpgsc.common.utils.*;
[ "java.util", "org.hdl.hpgsc" ]
java.util; org.hdl.hpgsc;
224,974
try { return (PacketArmorstand) ReflectionUtils .invokeConstructor(ReflectionUtils.invokeClass("com.github.shynixn.astraledit.bukkit.logic.business.nms.VERSION.DisplayArmorstand" .replace("VERSION", VersionSupport.getServerVersion().getVersionText())) , new Class[]{Player.class, Location.class, int.class, byte.class, Set.class} , new Object[]{player, location, id, data, watchers}); } catch (IllegalAccessException | InvocationTargetException | InstantiationException | NoSuchMethodException | ClassNotFoundException e) { AstralEditPlugin.logger().log(Level.WARNING, "Failed to create packetArmorstand.", e); throw new RuntimeException("Failed to create packetArmorstand."); } }
try { return (PacketArmorstand) ReflectionUtils .invokeConstructor(ReflectionUtils.invokeClass(STR .replace(STR, VersionSupport.getServerVersion().getVersionText())) , new Class[]{Player.class, Location.class, int.class, byte.class, Set.class} , new Object[]{player, location, id, data, watchers}); } catch (IllegalAccessException InvocationTargetException InstantiationException NoSuchMethodException ClassNotFoundException e) { AstralEditPlugin.logger().log(Level.WARNING, STR, e); throw new RuntimeException(STR); } }
/** * Creates a new packetArmorstand * * @param player player * @param location location * @param id id * @param data data * @param watchers watchers * @return packetArmorstand */
Creates a new packetArmorstand
createPacketArmorstand
{ "repo_name": "Shynixn/AstralEdit", "path": "astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/nms/NMSRegistry.java", "license": "apache-2.0", "size": 3111 }
[ "com.github.shynixn.astraledit.api.bukkit.business.entity.PacketArmorstand", "com.github.shynixn.astraledit.bukkit.AstralEditPlugin", "com.github.shynixn.astraledit.bukkit.logic.lib.ReflectionUtils", "java.lang.reflect.InvocationTargetException", "java.util.Set", "java.util.logging.Level", "org.bukkit.Location", "org.bukkit.entity.Player" ]
import com.github.shynixn.astraledit.api.bukkit.business.entity.PacketArmorstand; import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; import com.github.shynixn.astraledit.bukkit.logic.lib.ReflectionUtils; import java.lang.reflect.InvocationTargetException; import java.util.Set; import java.util.logging.Level; import org.bukkit.Location; import org.bukkit.entity.Player;
import com.github.shynixn.astraledit.api.bukkit.business.entity.*; import com.github.shynixn.astraledit.bukkit.*; import com.github.shynixn.astraledit.bukkit.logic.lib.*; import java.lang.reflect.*; import java.util.*; import java.util.logging.*; import org.bukkit.*; import org.bukkit.entity.*;
[ "com.github.shynixn", "java.lang", "java.util", "org.bukkit", "org.bukkit.entity" ]
com.github.shynixn; java.lang; java.util; org.bukkit; org.bukkit.entity;
1,890,681
@Override public void close() { final List<Throwable> suppressed = new ArrayList<>(); if (closed) { return; } boolean wasInTransaction = false; if (forceEndTransactions && localConfig.get().get(Handles.class).isForceEndTransactions()) { try { wasInTransaction = isInTransaction(); } catch (Exception e) { suppressed.add(e); } } localExtensionMethod.remove(); localConfig.remove(); if (wasInTransaction) { try { rollback(); } catch (Exception e) { suppressed.add(e); } } try { statementBuilder.close(getConnection()); } catch (Exception e) { suppressed.add(e); } try { closer.close(connection); if (!suppressed.isEmpty()) { final Throwable original = suppressed.remove(0); suppressed.forEach(original::addSuppressed); throw new CloseException("Failed to clear transaction status on close", original); } if (wasInTransaction) { throw new TransactionException("Improper transaction handling detected: A Handle with an open " + "transaction was closed. Transactions must be explicitly committed or rolled back " + "before closing the Handle. " + "Jdbi has rolled back this transaction automatically. " + "This check may be disabled by calling getConfig(Handles.class).setForceEndTransactions(false)."); } } catch (SQLException e) { CloseException ce = new CloseException("Unable to close Connection", e); suppressed.forEach(ce::addSuppressed); throw ce; } finally { LOG.trace("Handle [{}] released", this); closed = true; } }
void function() { final List<Throwable> suppressed = new ArrayList<>(); if (closed) { return; } boolean wasInTransaction = false; if (forceEndTransactions && localConfig.get().get(Handles.class).isForceEndTransactions()) { try { wasInTransaction = isInTransaction(); } catch (Exception e) { suppressed.add(e); } } localExtensionMethod.remove(); localConfig.remove(); if (wasInTransaction) { try { rollback(); } catch (Exception e) { suppressed.add(e); } } try { statementBuilder.close(getConnection()); } catch (Exception e) { suppressed.add(e); } try { closer.close(connection); if (!suppressed.isEmpty()) { final Throwable original = suppressed.remove(0); suppressed.forEach(original::addSuppressed); throw new CloseException(STR, original); } if (wasInTransaction) { throw new TransactionException(STR + STR + STR + STR + STR); } } catch (SQLException e) { CloseException ce = new CloseException(STR, e); suppressed.forEach(ce::addSuppressed); throw ce; } finally { LOG.trace(STR, this); closed = true; } }
/** * Closes the handle, its connection, and any other database resources it is holding. * * @throws CloseException if any resources throw exception while closing * @throws TransactionException if called while the handle has a transaction open. The open transaction will be * rolled back. */
Closes the handle, its connection, and any other database resources it is holding
close
{ "repo_name": "john9x/jdbi", "path": "core/src/main/java/org/jdbi/v3/core/Handle.java", "license": "apache-2.0", "size": 21227 }
[ "java.sql.SQLException", "java.util.ArrayList", "java.util.List", "org.jdbi.v3.core.transaction.TransactionException" ]
import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.jdbi.v3.core.transaction.TransactionException;
import java.sql.*; import java.util.*; import org.jdbi.v3.core.transaction.*;
[ "java.sql", "java.util", "org.jdbi.v3" ]
java.sql; java.util; org.jdbi.v3;
686,003
WorkflowProcessInstanceDto get(String processInstanceId, boolean checkRight);
WorkflowProcessInstanceDto get(String processInstanceId, boolean checkRight);
/** * Search process instance by ID process instance and check permission * * @param processInstanceId * @param checkRight * @return */
Search process instance by ID process instance and check permission
get
{ "repo_name": "bcvsolutions/CzechIdMng", "path": "Realization/backend/core/core-impl/src/main/java/eu/bcvsolutions/idm/core/workflow/service/WorkflowProcessInstanceService.java", "license": "mit", "size": 3833 }
[ "eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowProcessInstanceDto" ]
import eu.bcvsolutions.idm.core.workflow.model.dto.WorkflowProcessInstanceDto;
import eu.bcvsolutions.idm.core.workflow.model.dto.*;
[ "eu.bcvsolutions.idm" ]
eu.bcvsolutions.idm;
1,599,151
@Test public void getApplicationID() throws IOException, SQLException { try(final Connection connection = TestUtility.getConnection(TestUtility.getRandomFile())) { assertEquals("DatabaseUtility did not return the expected application Id.", 0, DatabaseUtility.getApplicationId(connection)); } }
void function() throws IOException, SQLException { try(final Connection connection = TestUtility.getConnection(TestUtility.getRandomFile())) { assertEquals(STR, 0, DatabaseUtility.getApplicationId(connection)); } }
/** * Tests if the DatabaseUtility will return the expected application Id. */
Tests if the DatabaseUtility will return the expected application Id
getApplicationID
{ "repo_name": "GitHubRGI/swagd", "path": "GeoPackage/src/test/java/com/rgi/geopackage/DatabaseUtilityTest.java", "license": "mit", "size": 13853 }
[ "com.rgi.geopackage.utility.DatabaseUtility", "java.io.IOException", "java.sql.Connection", "java.sql.SQLException", "org.junit.Assert" ]
import com.rgi.geopackage.utility.DatabaseUtility; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import org.junit.Assert;
import com.rgi.geopackage.utility.*; import java.io.*; import java.sql.*; import org.junit.*;
[ "com.rgi.geopackage", "java.io", "java.sql", "org.junit" ]
com.rgi.geopackage; java.io; java.sql; org.junit;
2,787,299
boolean handleBurnInputGesture(DisplayedGem.DisplayedPart dPartToBurn){ // check if burnable: // must be an unconnected input that isn't on a collector gem. // also must not be defined by anything broken. Gem gem = dPartToBurn.getDisplayedGem().getGem(); if (!(dPartToBurn instanceof DisplayedGem.DisplayedPartInput) || ((DisplayedGem.DisplayedPartInput)dPartToBurn).isConnected() || (dPartToBurn.getGem() instanceof CollectorGem) || (GemGraph.isAncestorOfBrokenGemForest(gem.getRootGem()))) { return false; } Gem.PartInput inputToBurn = ((DisplayedGem.DisplayedPartInput)dPartToBurn).getPartInput(); // see if toggling the input burn state invalidates the tree boolean burnOk = !(inputToBurn.burnBreaksGem(tableTop.getTypeCheckInfo())); // if the (un)burn ok, toggle burnt state, else warn and display a dialog re: what to do if (burnOk) { doSetInputBurnStatusUserAction(inputToBurn, inputToBurn.isBurnt() ? AutoburnLogic.BurnStatus.NOT_BURNT : AutoburnLogic.BurnStatus.MANUALLY_BURNT); updateForBurn(); return true; } else { // burning breaks the gem tree. Highlight the output connection as potentially disconnecting. DisplayedConnection dConn = dPartToBurn.getDisplayedGem().getDisplayedOutputPart().getDisplayedConnection(); // should always be connected tableTop.setBadDisplayedConnection(dConn, true); tableTop.getTableTopPanel().repaint(dConn.getBounds()); // Formulate the warning. String titleString = GemCutter.getResourceString("WarningDialogTitle"); String message; if (inputToBurn.isBurnt()){ message = GemCutter.getResourceString("UnburnWarning"); } else { message = GemCutter.getResourceString("BurnWarning"); } ExtendedUndoableEditSupport undoableEditSupport = tableTop.getUndoableEditSupport(); // Show the warning. Ask what to do.. int option = JOptionPane.showConfirmDialog(tableTop.getTableTopPanel(), message, titleString, JOptionPane.YES_NO_OPTION, javax.swing.JOptionPane.WARNING_MESSAGE); // only do anything if the user answered yes. if (option == JOptionPane.YES_OPTION) { // Increment the update level to aggregate the edits. undoableEditSupport.beginUpdate(); // disconnect the output and change the burnt state. Connection conn = dConn.getConnection(); tableTop.doDisconnectUserAction(conn); doSetInputBurnStatusUserAction(inputToBurn, inputToBurn.isBurnt() ? AutoburnLogic.BurnStatus.NOT_BURNT : AutoburnLogic.BurnStatus.MANUALLY_BURNT); updateForBurn(); // Decrement the update level. This will post the edit if the level is zero. undoableEditSupport.endUpdate(); return true; } else { // un-highlight the output connection tableTop.setBadDisplayedConnection(dConn, false); return false; } } }
boolean handleBurnInputGesture(DisplayedGem.DisplayedPart dPartToBurn){ Gem gem = dPartToBurn.getDisplayedGem().getGem(); if (!(dPartToBurn instanceof DisplayedGem.DisplayedPartInput) ((DisplayedGem.DisplayedPartInput)dPartToBurn).isConnected() (dPartToBurn.getGem() instanceof CollectorGem) (GemGraph.isAncestorOfBrokenGemForest(gem.getRootGem()))) { return false; } Gem.PartInput inputToBurn = ((DisplayedGem.DisplayedPartInput)dPartToBurn).getPartInput(); boolean burnOk = !(inputToBurn.burnBreaksGem(tableTop.getTypeCheckInfo())); if (burnOk) { doSetInputBurnStatusUserAction(inputToBurn, inputToBurn.isBurnt() ? AutoburnLogic.BurnStatus.NOT_BURNT : AutoburnLogic.BurnStatus.MANUALLY_BURNT); updateForBurn(); return true; } else { DisplayedConnection dConn = dPartToBurn.getDisplayedGem().getDisplayedOutputPart().getDisplayedConnection(); tableTop.setBadDisplayedConnection(dConn, true); tableTop.getTableTopPanel().repaint(dConn.getBounds()); String titleString = GemCutter.getResourceString(STR); String message; if (inputToBurn.isBurnt()){ message = GemCutter.getResourceString(STR); } else { message = GemCutter.getResourceString(STR); } ExtendedUndoableEditSupport undoableEditSupport = tableTop.getUndoableEditSupport(); int option = JOptionPane.showConfirmDialog(tableTop.getTableTopPanel(), message, titleString, JOptionPane.YES_NO_OPTION, javax.swing.JOptionPane.WARNING_MESSAGE); if (option == JOptionPane.YES_OPTION) { undoableEditSupport.beginUpdate(); Connection conn = dConn.getConnection(); tableTop.doDisconnectUserAction(conn); doSetInputBurnStatusUserAction(inputToBurn, inputToBurn.isBurnt() ? AutoburnLogic.BurnStatus.NOT_BURNT : AutoburnLogic.BurnStatus.MANUALLY_BURNT); updateForBurn(); undoableEditSupport.endUpdate(); return true; } else { tableTop.setBadDisplayedConnection(dConn, false); return false; } } }
/** * Handle the gesture where the user (un)burns a displayed input. * A dialog may pop up asking for input, if the burning breaks a gem tree. * * @param dPartToBurn the Displayed part in question * @return boolean whether the displayed input was burnt */
Handle the gesture where the user (un)burns a displayed input. A dialog may pop up asking for input, if the burning breaks a gem tree
handleBurnInputGesture
{ "repo_name": "levans/Open-Quark", "path": "src/Quark_Gems/src/org/openquark/gems/client/TableTopBurnManager.java", "license": "bsd-3-clause", "size": 21461 }
[ "javax.swing.JOptionPane", "org.openquark.gems.client.Gem", "org.openquark.gems.client.utilities.ExtendedUndoableEditSupport" ]
import javax.swing.JOptionPane; import org.openquark.gems.client.Gem; import org.openquark.gems.client.utilities.ExtendedUndoableEditSupport;
import javax.swing.*; import org.openquark.gems.client.*; import org.openquark.gems.client.utilities.*;
[ "javax.swing", "org.openquark.gems" ]
javax.swing; org.openquark.gems;
1,872,546
public List<MicrosoftGraphAssignedLicense> assignedLicenses() { return this.assignedLicenses; }
List<MicrosoftGraphAssignedLicense> function() { return this.assignedLicenses; }
/** * Get the assignedLicenses property: The licenses that are assigned to the user. Not nullable. * * @return the assignedLicenses value. */
Get the assignedLicenses property: The licenses that are assigned to the user. Not nullable
assignedLicenses
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphUserInner.java", "license": "mit", "size": 120247 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
546,663
private void createAdapters() { int listItemId = R.layout.tweetlist_item; if (mSP.getBoolean("appearance_use_avatars", false)) { listItemId = R.layout.tweetlist_item_avatar; } PagedCursorAdapter tweetsAdapter = new PagedCursorAdapter( TweetListActivity.this, listItemId, mCursor, new String[] { Tweets.AUTHOR_ID, Tweets.MESSAGE, Tweets.SENT_DATE, Tweets.FAVORITED }, new int[] { R.id.tweet_screen_name, R.id.tweet_message, R.id.tweet_sent, R.id.tweet_favorite }, getIntent().getData(), PROJECTION, Tweets.DEFAULT_SORT_ORDER ); tweetsAdapter.setViewBinder(new TweetBinder()); setListAdapter(tweetsAdapter); SearchableCursorAdapter friendsAdapter = new SearchableCursorAdapter( this, android.R.layout.simple_dropdown_item_1line, mFriendsCursor, new String[] { Users.AUTHOR_ID }, new int[] { android.R.id.text1 }, Users.CONTENT_URI, FRIENDS_PROJECTION, Users.DEFAULT_SORT_ORDER ); try { friendsAdapter.setStringConversionColumn(mFriendsCursor.getColumnIndexOrThrow(Users.AUTHOR_ID)); } catch (IllegalArgumentException e) { Log.e(TAG, "Could not set string conversion column on mFriendsCursor", e); } //mEditText.setAdapter(friendsAdapter); //mEditText.setTokenizer(new AtTokenizer()); }
void function() { int listItemId = R.layout.tweetlist_item; if (mSP.getBoolean(STR, false)) { listItemId = R.layout.tweetlist_item_avatar; } PagedCursorAdapter tweetsAdapter = new PagedCursorAdapter( TweetListActivity.this, listItemId, mCursor, new String[] { Tweets.AUTHOR_ID, Tweets.MESSAGE, Tweets.SENT_DATE, Tweets.FAVORITED }, new int[] { R.id.tweet_screen_name, R.id.tweet_message, R.id.tweet_sent, R.id.tweet_favorite }, getIntent().getData(), PROJECTION, Tweets.DEFAULT_SORT_ORDER ); tweetsAdapter.setViewBinder(new TweetBinder()); setListAdapter(tweetsAdapter); SearchableCursorAdapter friendsAdapter = new SearchableCursorAdapter( this, android.R.layout.simple_dropdown_item_1line, mFriendsCursor, new String[] { Users.AUTHOR_ID }, new int[] { android.R.id.text1 }, Users.CONTENT_URI, FRIENDS_PROJECTION, Users.DEFAULT_SORT_ORDER ); try { friendsAdapter.setStringConversionColumn(mFriendsCursor.getColumnIndexOrThrow(Users.AUTHOR_ID)); } catch (IllegalArgumentException e) { Log.e(TAG, STR, e); } }
/** * Create adapters */
Create adapters
createAdapters
{ "repo_name": "google-code/andtweet", "path": "src/com/xorcode/andtweet/TweetListActivity.java", "license": "apache-2.0", "size": 40485 }
[ "android.util.Log", "com.xorcode.andtweet.data.AndTweetDatabase", "com.xorcode.andtweet.data.PagedCursorAdapter", "com.xorcode.andtweet.data.SearchableCursorAdapter", "com.xorcode.andtweet.data.TweetBinder" ]
import android.util.Log; import com.xorcode.andtweet.data.AndTweetDatabase; import com.xorcode.andtweet.data.PagedCursorAdapter; import com.xorcode.andtweet.data.SearchableCursorAdapter; import com.xorcode.andtweet.data.TweetBinder;
import android.util.*; import com.xorcode.andtweet.data.*;
[ "android.util", "com.xorcode.andtweet" ]
android.util; com.xorcode.andtweet;
1,115,610
if(language == null){ return EN.getInstance(); } try{ switch(Idioms.valueOf(language)){ case es: return ES.getInstance(); case en: return EN.getInstance(); } }catch(IllegalArgumentException e1){ throw new LangException(I18n.get("LanguageException")); } return null; }
if(language == null){ return EN.getInstance(); } try{ switch(Idioms.valueOf(language)){ case es: return ES.getInstance(); case en: return EN.getInstance(); } }catch(IllegalArgumentException e1){ throw new LangException(I18n.get(STR)); } return null; }
/** * Chose an idiom supported by app. * @param language Value for language. * @return Idiom Instance of language of app. * @throws LangException Idiom is not supported by app. */
Chose an idiom supported by app
checkIdiom
{ "repo_name": "ifcunharro/amchartsJava-core", "path": "src/main/java/es/uvigo/esei/amchartsJava/core/validators/IdiomValidator.java", "license": "gpl-3.0", "size": 1226 }
[ "es.uvigo.esei.amchartsJava.core.constants.lang.EN", "es.uvigo.esei.amchartsJava.core.constants.lang.ES", "es.uvigo.esei.amchartsJava.core.constants.lang.I18n", "es.uvigo.esei.amchartsJava.core.constants.lang.Idioms", "es.uvigo.esei.amchartsJava.core.exceptions.LangException" ]
import es.uvigo.esei.amchartsJava.core.constants.lang.EN; import es.uvigo.esei.amchartsJava.core.constants.lang.ES; import es.uvigo.esei.amchartsJava.core.constants.lang.I18n; import es.uvigo.esei.amchartsJava.core.constants.lang.Idioms; import es.uvigo.esei.amchartsJava.core.exceptions.LangException;
import es.uvigo.esei.*;
[ "es.uvigo.esei" ]
es.uvigo.esei;
2,346,238
public static void verify(final ClassReader cr, final ClassLoader loader, final boolean dump, final PrintWriter pw) { ClassNode cn = new ClassNode(); cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG); Type syperType = cn.superName == null ? null : Type .getObjectType(cn.superName); List<MethodNode> methods = cn.methods; List<Type> interfaces = new ArrayList<Type>(); for (Iterator<String> i = cn.interfaces.iterator(); i.hasNext();) { interfaces.add(Type.getObjectType(i.next())); } for (int i = 0; i < methods.size(); ++i) { MethodNode method = methods.get(i); SimpleVerifier verifier = new SimpleVerifier( Type.getObjectType(cn.name), syperType, interfaces, (cn.access & Opcodes.ACC_INTERFACE) != 0); Analyzer<BasicValue> a = new Analyzer<BasicValue>(verifier); if (loader != null) { verifier.setClassLoader(loader); } try { a.analyze(cn.name, method); if (!dump) { continue; } } catch (Exception e) { e.printStackTrace(pw); } printAnalyzerResult(method, a, pw); } pw.flush(); }
static void function(final ClassReader cr, final ClassLoader loader, final boolean dump, final PrintWriter pw) { ClassNode cn = new ClassNode(); cr.accept(new CheckClassAdapter(cn, false), ClassReader.SKIP_DEBUG); Type syperType = cn.superName == null ? null : Type .getObjectType(cn.superName); List<MethodNode> methods = cn.methods; List<Type> interfaces = new ArrayList<Type>(); for (Iterator<String> i = cn.interfaces.iterator(); i.hasNext();) { interfaces.add(Type.getObjectType(i.next())); } for (int i = 0; i < methods.size(); ++i) { MethodNode method = methods.get(i); SimpleVerifier verifier = new SimpleVerifier( Type.getObjectType(cn.name), syperType, interfaces, (cn.access & Opcodes.ACC_INTERFACE) != 0); Analyzer<BasicValue> a = new Analyzer<BasicValue>(verifier); if (loader != null) { verifier.setClassLoader(loader); } try { a.analyze(cn.name, method); if (!dump) { continue; } } catch (Exception e) { e.printStackTrace(pw); } printAnalyzerResult(method, a, pw); } pw.flush(); }
/** * Checks a given class. * * @param cr * a <code>ClassReader</code> that contains bytecode for the * analysis. * @param loader * a <code>ClassLoader</code> which will be used to load * referenced classes. This is useful if you are verifiying * multiple interdependent classes. * @param dump * true if bytecode should be printed out not only when errors * are found. * @param pw * write where results going to be printed */
Checks a given class
verify
{ "repo_name": "FFY00/deobfuscator", "path": "src/main/java/com/javadeobfuscator/deobfuscator/org/objectweb/asm/util/CheckClassAdapter.java", "license": "apache-2.0", "size": 39148 }
[ "com.javadeobfuscator.deobfuscator.org.objectweb.asm.ClassReader", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.Opcodes", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.Type", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.ClassNode", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.MethodNode", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.Analyzer", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.BasicValue", "com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.SimpleVerifier", "java.io.PrintWriter", "java.util.ArrayList", "java.util.Iterator", "java.util.List" ]
import com.javadeobfuscator.deobfuscator.org.objectweb.asm.ClassReader; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.Opcodes; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.Type; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.ClassNode; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.MethodNode; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.Analyzer; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.BasicValue; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.SimpleVerifier; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Iterator; import java.util.List;
import com.javadeobfuscator.deobfuscator.org.objectweb.asm.*; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.*; import com.javadeobfuscator.deobfuscator.org.objectweb.asm.tree.analysis.*; import java.io.*; import java.util.*;
[ "com.javadeobfuscator.deobfuscator", "java.io", "java.util" ]
com.javadeobfuscator.deobfuscator; java.io; java.util;
938,751
public CreditCardMerchant getCreditCardMerchant();
CreditCardMerchant function();
/** * This method returns the CreditCardMerchant used by this client. * The Merchant contains the data that the clients uses to connect with. * @return CreditCardMerchant */
This method returns the CreditCardMerchant used by this client. The Merchant contains the data that the clients uses to connect with
getCreditCardMerchant
{ "repo_name": "idega/platform2", "path": "src/com/idega/block/creditcard/business/CreditCardClient.java", "license": "gpl-3.0", "size": 3506 }
[ "com.idega.block.creditcard.data.CreditCardMerchant" ]
import com.idega.block.creditcard.data.CreditCardMerchant;
import com.idega.block.creditcard.data.*;
[ "com.idega.block" ]
com.idega.block;
1,492,706
public static String toString( @NonNull String type, long id, @NonNull String subtype, long subId) { if (type.indexOf(DELIMETER) != -1) { throw new IllegalArgumentException("Invalid type " + type + ". Delimeter is " + DELIMETER); } else if (subtype.indexOf(DELIMETER) != -1) { throw new IllegalArgumentException( "Invalid subtype " + subtype + ". Delimeter is " + DELIMETER); } return type + DELIMETER + id + DELIMETER + subtype + DELIMETER + subId; }
static String function( @NonNull String type, long id, @NonNull String subtype, long subId) { if (type.indexOf(DELIMETER) != -1) { throw new IllegalArgumentException(STR + type + STR + DELIMETER); } else if (subtype.indexOf(DELIMETER) != -1) { throw new IllegalArgumentException( STR + subtype + STR + DELIMETER); } return type + DELIMETER + id + DELIMETER + subtype + DELIMETER + subId; }
/** * Use empty string instead of null of subtype is not applicabale. */
Use empty string instead of null of subtype is not applicabale
toString
{ "repo_name": "travelbird/react-native-navigation", "path": "lib/android/src/main/java/com/airbnb/android/react/navigation/TransitionName.java", "license": "mit", "size": 4074 }
[ "android.support.annotation.NonNull" ]
import android.support.annotation.NonNull;
import android.support.annotation.*;
[ "android.support" ]
android.support;
1,609,764
public void create(String path) { // On creation the actualItem is tmpFolder and must create from the // parent of tmpFolder ( the real actualItem ) folderService.create(path, ((GWTFolder) actualItem.getParentItem().getUserObject()).getPath(), callbackCreate); Main.get().mainPanel.desktop.navigator.status.setFlagCreate(); hideMenuPopup(); }
void function(String path) { folderService.create(path, ((GWTFolder) actualItem.getParentItem().getUserObject()).getPath(), callbackCreate); Main.get().mainPanel.desktop.navigator.status.setFlagCreate(); hideMenuPopup(); }
/** * Creates a new folder on actual item * * @param path * The folder subpath selected by user = name */
Creates a new folder on actual item
create
{ "repo_name": "papamas/DMS-KANGREG-XI-MANADO", "path": "src/main/java/com/openkm/frontend/client/widget/foldertree/FolderTree.java", "license": "gpl-3.0", "size": 48471 }
[ "com.openkm.frontend.client.Main", "com.openkm.frontend.client.bean.GWTFolder" ]
import com.openkm.frontend.client.Main; import com.openkm.frontend.client.bean.GWTFolder;
import com.openkm.frontend.client.*; import com.openkm.frontend.client.bean.*;
[ "com.openkm.frontend" ]
com.openkm.frontend;
165,765
@Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); form.setText("Android Manifest Instrumentation"); form.setImage(AdtPlugin.getAndroidLogo()); UiElementNode manifest = mEditor.getUiRootNode(); AndroidManifestDescriptors manifestDescriptor = mEditor.getManifestDescriptors(); ElementDescriptor[] descriptorFilters = null; if (manifestDescriptor != null) { descriptorFilters = new ElementDescriptor[] { manifestDescriptor.getInstrumentationElement(), }; } mTreeBlock = new UiTreeBlock(mEditor, manifest, true , descriptorFilters, "Instrumentation", "List of instrumentations defined in the manifest"); mTreeBlock.createContent(managedForm); }
void function(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); form.setText(STR); form.setImage(AdtPlugin.getAndroidLogo()); UiElementNode manifest = mEditor.getUiRootNode(); AndroidManifestDescriptors manifestDescriptor = mEditor.getManifestDescriptors(); ElementDescriptor[] descriptorFilters = null; if (manifestDescriptor != null) { descriptorFilters = new ElementDescriptor[] { manifestDescriptor.getInstrumentationElement(), }; } mTreeBlock = new UiTreeBlock(mEditor, manifest, true , descriptorFilters, STR, STR); mTreeBlock.createContent(managedForm); }
/** * Creates the content in the form hosted in this page. * * @param managedForm the form hosted in this page. */
Creates the content in the form hosted in this page
createFormContent
{ "repo_name": "rex-xxx/mt6572_x201", "path": "sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/InstrumentationPage.java", "license": "gpl-2.0", "size": 4010 }
[ "com.android.ide.eclipse.adt.AdtPlugin", "com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor", "com.android.ide.eclipse.adt.internal.editors.manifest.descriptors.AndroidManifestDescriptors", "com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock", "com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode", "org.eclipse.ui.forms.IManagedForm", "org.eclipse.ui.forms.widgets.ScrolledForm" ]
import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor; import com.android.ide.eclipse.adt.internal.editors.manifest.descriptors.AndroidManifestDescriptors; import com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock; import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; import org.eclipse.ui.forms.IManagedForm; import org.eclipse.ui.forms.widgets.ScrolledForm;
import com.android.ide.eclipse.adt.*; import com.android.ide.eclipse.adt.internal.editors.descriptors.*; import com.android.ide.eclipse.adt.internal.editors.manifest.descriptors.*; import com.android.ide.eclipse.adt.internal.editors.ui.tree.*; import com.android.ide.eclipse.adt.internal.editors.uimodel.*; import org.eclipse.ui.forms.*; import org.eclipse.ui.forms.widgets.*;
[ "com.android.ide", "org.eclipse.ui" ]
com.android.ide; org.eclipse.ui;
161,495
private boolean waitForCache() { InternalCache cache; long tilt = System.currentTimeMillis() + MAX_CACHE_WAIT * 1000; for (;;) { if (quitting()) { logger.warn("{}: abandoned wait due to cancellation.", this); return false; } if (!this.connected) { logger.warn("{}: abandoned wait because it is no longer connected", this); return false; } if (System.currentTimeMillis() > tilt) { logger.warn("{}: wait timed out (more than {} seconds)", new Object[] {this, MAX_CACHE_WAIT}); return false; } cache = GemFireCacheImpl.getInstance(); if (cache != null && !cache.isClosed()) { break; } boolean interrupted = Thread.interrupted(); try { Thread.sleep(1000); } catch (InterruptedException ignore) { interrupted = true; } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } // for this.cache = cache; this.cacheHelper = new CachedRegionHelper(cache); return true; } public CacheClientUpdater(String name, ServerLocation location, boolean primary, DistributedSystem ids, ClientSideHandshake handshake, QueueManager qManager, EndpointManager eManager, Endpoint endpoint, int handshakeTimeout, SocketCreator socketCreator) throws AuthenticationRequiredException, AuthenticationFailedException, ServerRefusedConnectionException { this(name, location, primary, ids, handshake, qManager, eManager, endpoint, handshakeTimeout, socketCreator, new StatisticsProvider()); } public CacheClientUpdater(String name, ServerLocation location, boolean primary, DistributedSystem distributedSystem, ClientSideHandshake handshake, QueueManager qManager, EndpointManager eManager, Endpoint endpoint, int handshakeTimeout, SocketCreator socketCreator, StatisticsProvider statisticsProvider) throws AuthenticationRequiredException, AuthenticationFailedException, ServerRefusedConnectionException { super(name); this.system = distributedSystem; this.isDurableClient = handshake.isDurable(); this.isPrimary = primary; this.location = location; this.qManager = qManager; // this holds the connection which this threads reads this.eManager = eManager; this.endpoint = endpoint; this.stats = statisticsProvider.createStatistics(distributedSystem, location); // Create the connection... final boolean isDebugEnabled = logger.isDebugEnabled(); if (isDebugEnabled) { logger.debug("Creating asynchronous update connection"); } boolean success = false; Socket mySock = null; InternalDistributedMember sid = null; ByteBuffer cb = null; OutputStream tmpOut = null; InputStream tmpIn = null; try { // Size of the server-to-client communication socket buffers int socketBufferSize = Integer.getInteger("BridgeServer.SOCKET_BUFFER_SIZE", DEFAULT_SOCKET_BUFFER_SIZE); mySock = socketCreator.connectForClient(location.getHostName(), location.getPort(), handshakeTimeout, socketBufferSize); mySock.setTcpNoDelay(true); mySock.setSendBufferSize(socketBufferSize); // Verify buffer sizes verifySocketBufferSize(socketBufferSize, mySock.getReceiveBufferSize(), "receive"); verifySocketBufferSize(socketBufferSize, mySock.getSendBufferSize(), "send"); // set the timeout for the handshake mySock.setSoTimeout(handshakeTimeout); tmpOut = mySock.getOutputStream(); tmpIn = mySock.getInputStream(); if (isDebugEnabled) { logger.debug( "Initialized server-to-client socket with send buffer size: {} bytes and receive buffer size: {} bytes", mySock.getSendBufferSize(), mySock.getReceiveBufferSize()); } if (isDebugEnabled) { logger.debug( "Created connection from {}:{} to CacheClientNotifier on port {} for server-to-client communication", mySock.getInetAddress().getHostAddress(), mySock.getLocalPort(), mySock.getPort()); } this.serverQueueStatus = handshake.handshakeWithSubscriptionFeed(mySock, this.isPrimary); if (serverQueueStatus.isPrimary() || serverQueueStatus.isNonRedundant()) { PoolImpl pool = (PoolImpl) this.qManager.getPool(); if (!pool.getReadyForEventsCalled()) { pool.setPendingEventCount(serverQueueStatus.getServerQueueSize()); } } int bufSize = 1024; try { bufSize = mySock.getSendBufferSize(); if (bufSize < 1024) { bufSize = 1024; } } catch (SocketException ignore) { } cb = ServerConnection.allocateCommBuffer(bufSize, mySock); // create a "server" memberId we currently don't know much about the server. // Would be nice for it to send us its member id // TODO: change the serverId to use the endpoint's getMemberId() which returns a // DistributedMember (once gfecq branch is merged to trunk). MemberAttributes ma = new MemberAttributes(0, -1, ClusterDistributionManager.NORMAL_DM_TYPE, -1, null, null, null); sid = new InternalDistributedMember(mySock.getInetAddress(), mySock.getPort(), false, true, ma); success = true; } catch (ConnectException ignore) { if (!quitting()) { logger.warn("{} connection was refused", this); } } catch (SSLException ex) { if (!quitting()) { getSecurityLogger().warning(String.format("%s SSL negotiation failed. %s", new Object[] {this, ex})); throw new AuthenticationFailedException( String.format("SSL negotiation failed with endpoint: %s", location), ex); } } catch (GemFireSecurityException ex) { if (!quitting()) { getSecurityLogger().warning( String.format( "%s: Security exception when creating server-to-client communication socket. %s", new Object[] {this, ex})); throw ex; } } catch (IOException e) { if (!quitting()) { logger.warn(String.format( "%s: Caught following exception while attempting to create a server-to-client communication socket and will exit: %s", new Object[] {this, e}), logger.isDebugEnabled() ? e : null); } eManager.serverCrashed(this.endpoint); } catch (ClassNotFoundException e) { if (!quitting()) { logger.warn("Unable to load the class: {}", e.getMessage()); } } catch (ServerRefusedConnectionException e) { if (!quitting()) { logger.warn(String.format( "%s: Caught following exception while attempting to create a server-to-client communication socket and will exit: %s", new Object[] {this, e}), logger.isDebugEnabled() ? e : null); } throw e; } finally { this.connected = success; this.socket = mySock; this.commBuffer = cb; this.out = tmpOut; this.in = tmpIn; this.serverId = sid; if (this.connected) { if (mySock != null) { try { mySock.setSoTimeout(0); } catch (SocketException ignore) { // ignore: nothing we can do about this } } } else { close(); } } }
boolean function() { InternalCache cache; long tilt = System.currentTimeMillis() + MAX_CACHE_WAIT * 1000; for (;;) { if (quitting()) { logger.warn(STR, this); return false; } if (!this.connected) { logger.warn(STR, this); return false; } if (System.currentTimeMillis() > tilt) { logger.warn(STR, new Object[] {this, MAX_CACHE_WAIT}); return false; } cache = GemFireCacheImpl.getInstance(); if (cache != null && !cache.isClosed()) { break; } boolean interrupted = Thread.interrupted(); try { Thread.sleep(1000); } catch (InterruptedException ignore) { interrupted = true; } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } this.cache = cache; this.cacheHelper = new CachedRegionHelper(cache); return true; } public CacheClientUpdater(String name, ServerLocation location, boolean primary, DistributedSystem ids, ClientSideHandshake handshake, QueueManager qManager, EndpointManager eManager, Endpoint endpoint, int handshakeTimeout, SocketCreator socketCreator) throws AuthenticationRequiredException, AuthenticationFailedException, ServerRefusedConnectionException { this(name, location, primary, ids, handshake, qManager, eManager, endpoint, handshakeTimeout, socketCreator, new StatisticsProvider()); } public CacheClientUpdater(String name, ServerLocation location, boolean primary, DistributedSystem distributedSystem, ClientSideHandshake handshake, QueueManager qManager, EndpointManager eManager, Endpoint endpoint, int handshakeTimeout, SocketCreator socketCreator, StatisticsProvider statisticsProvider) throws AuthenticationRequiredException, AuthenticationFailedException, ServerRefusedConnectionException { super(name); this.system = distributedSystem; this.isDurableClient = handshake.isDurable(); this.isPrimary = primary; this.location = location; this.qManager = qManager; this.eManager = eManager; this.endpoint = endpoint; this.stats = statisticsProvider.createStatistics(distributedSystem, location); final boolean isDebugEnabled = logger.isDebugEnabled(); if (isDebugEnabled) { logger.debug(STR); } boolean success = false; Socket mySock = null; InternalDistributedMember sid = null; ByteBuffer cb = null; OutputStream tmpOut = null; InputStream tmpIn = null; try { int socketBufferSize = Integer.getInteger(STR, DEFAULT_SOCKET_BUFFER_SIZE); mySock = socketCreator.connectForClient(location.getHostName(), location.getPort(), handshakeTimeout, socketBufferSize); mySock.setTcpNoDelay(true); mySock.setSendBufferSize(socketBufferSize); verifySocketBufferSize(socketBufferSize, mySock.getReceiveBufferSize(), STR); verifySocketBufferSize(socketBufferSize, mySock.getSendBufferSize(), "send"); mySock.setSoTimeout(handshakeTimeout); tmpOut = mySock.getOutputStream(); tmpIn = mySock.getInputStream(); if (isDebugEnabled) { logger.debug( STR, mySock.getSendBufferSize(), mySock.getReceiveBufferSize()); } if (isDebugEnabled) { logger.debug( STR, mySock.getInetAddress().getHostAddress(), mySock.getLocalPort(), mySock.getPort()); } this.serverQueueStatus = handshake.handshakeWithSubscriptionFeed(mySock, this.isPrimary); if (serverQueueStatus.isPrimary() serverQueueStatus.isNonRedundant()) { PoolImpl pool = (PoolImpl) this.qManager.getPool(); if (!pool.getReadyForEventsCalled()) { pool.setPendingEventCount(serverQueueStatus.getServerQueueSize()); } } int bufSize = 1024; try { bufSize = mySock.getSendBufferSize(); if (bufSize < 1024) { bufSize = 1024; } } catch (SocketException ignore) { } cb = ServerConnection.allocateCommBuffer(bufSize, mySock); MemberAttributes ma = new MemberAttributes(0, -1, ClusterDistributionManager.NORMAL_DM_TYPE, -1, null, null, null); sid = new InternalDistributedMember(mySock.getInetAddress(), mySock.getPort(), false, true, ma); success = true; } catch (ConnectException ignore) { if (!quitting()) { logger.warn(STR, this); } } catch (SSLException ex) { if (!quitting()) { getSecurityLogger().warning(String.format(STR, new Object[] {this, ex})); throw new AuthenticationFailedException( String.format(STR, location), ex); } } catch (GemFireSecurityException ex) { if (!quitting()) { getSecurityLogger().warning( String.format( STR, new Object[] {this, ex})); throw ex; } } catch (IOException e) { if (!quitting()) { logger.warn(String.format( STR, new Object[] {this, e}), logger.isDebugEnabled() ? e : null); } eManager.serverCrashed(this.endpoint); } catch (ClassNotFoundException e) { if (!quitting()) { logger.warn(STR, e.getMessage()); } } catch (ServerRefusedConnectionException e) { if (!quitting()) { logger.warn(String.format( STR, new Object[] {this, e}), logger.isDebugEnabled() ? e : null); } throw e; } finally { this.connected = success; this.socket = mySock; this.commBuffer = cb; this.out = tmpOut; this.in = tmpIn; this.serverId = sid; if (this.connected) { if (mySock != null) { try { mySock.setSoTimeout(0); } catch (SocketException ignore) { } } } else { close(); } } }
/** * Return true if cache appears * * @return true if cache appears */
Return true if cache appears
waitForCache
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java", "license": "apache-2.0", "size": 69714 }
[ "java.io.IOException", "java.io.InputStream", "java.io.OutputStream", "java.net.ConnectException", "java.net.Socket", "java.net.SocketException", "java.nio.ByteBuffer", "javax.net.ssl.SSLException", "org.apache.geode.cache.client.ServerRefusedConnectionException", "org.apache.geode.cache.client.internal.Endpoint", "org.apache.geode.cache.client.internal.EndpointManager", "org.apache.geode.cache.client.internal.PoolImpl", "org.apache.geode.cache.client.internal.QueueManager", "org.apache.geode.distributed.DistributedSystem", "org.apache.geode.distributed.internal.ClusterDistributionManager", "org.apache.geode.distributed.internal.ServerLocation", "org.apache.geode.distributed.internal.membership.InternalDistributedMember", "org.apache.geode.distributed.internal.membership.MemberAttributes", "org.apache.geode.internal.cache.GemFireCacheImpl", "org.apache.geode.internal.cache.InternalCache", "org.apache.geode.internal.cache.tier.CachedRegionHelper", "org.apache.geode.internal.cache.tier.ClientSideHandshake", "org.apache.geode.internal.net.SocketCreator", "org.apache.geode.security.AuthenticationFailedException", "org.apache.geode.security.AuthenticationRequiredException", "org.apache.geode.security.GemFireSecurityException" ]
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ConnectException; import java.net.Socket; import java.net.SocketException; import java.nio.ByteBuffer; import javax.net.ssl.SSLException; import org.apache.geode.cache.client.ServerRefusedConnectionException; import org.apache.geode.cache.client.internal.Endpoint; import org.apache.geode.cache.client.internal.EndpointManager; import org.apache.geode.cache.client.internal.PoolImpl; import org.apache.geode.cache.client.internal.QueueManager; import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.distributed.internal.ClusterDistributionManager; import org.apache.geode.distributed.internal.ServerLocation; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.MemberAttributes; import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.tier.CachedRegionHelper; import org.apache.geode.internal.cache.tier.ClientSideHandshake; import org.apache.geode.internal.net.SocketCreator; import org.apache.geode.security.AuthenticationFailedException; import org.apache.geode.security.AuthenticationRequiredException; import org.apache.geode.security.GemFireSecurityException;
import java.io.*; import java.net.*; import java.nio.*; import javax.net.ssl.*; import org.apache.geode.cache.client.*; import org.apache.geode.cache.client.internal.*; import org.apache.geode.distributed.*; import org.apache.geode.distributed.internal.*; import org.apache.geode.distributed.internal.membership.*; import org.apache.geode.internal.cache.*; import org.apache.geode.internal.cache.tier.*; import org.apache.geode.internal.net.*; import org.apache.geode.security.*;
[ "java.io", "java.net", "java.nio", "javax.net", "org.apache.geode" ]
java.io; java.net; java.nio; javax.net; org.apache.geode;
2,757,777
protected void setGeneratorContext(SVGGeneratorContext generatorCtx) { this.generatorCtx = generatorCtx; this.gc = new GraphicContext(new AffineTransform()); SVGGeneratorContext.GraphicContextDefaults gcDefaults = generatorCtx.getGraphicContextDefaults(); if(gcDefaults != null){ if(gcDefaults.getPaint() != null){ gc.setPaint(gcDefaults.getPaint()); } if(gcDefaults.getStroke() != null){ gc.setStroke(gcDefaults.getStroke()); } if(gcDefaults.getComposite() != null){ gc.setComposite(gcDefaults.getComposite()); } if(gcDefaults.getClip() != null){ gc.setClip(gcDefaults.getClip()); } if(gcDefaults.getRenderingHints() != null){ gc.setRenderingHints(gcDefaults.getRenderingHints()); } if(gcDefaults.getFont() != null){ gc.setFont(gcDefaults.getFont()); } if(gcDefaults.getBackground() != null){ gc.setBackground(gcDefaults.getBackground()); } } this.shapeConverter = new SVGShape(generatorCtx); this.domTreeManager = new DOMTreeManager(gc, generatorCtx, DEFAULT_MAX_GC_OVERRIDES); this.domGroupManager = new DOMGroupManager(gc, domTreeManager); this.domTreeManager.addGroupManager(domGroupManager); generatorCtx.genericImageHandler.setDOMTreeManager(domTreeManager); } public SVGGraphics2D(SVGGraphics2D g) { super(g); this.generatorCtx = g.generatorCtx; this.gc.validateTransformStack(); this.shapeConverter = g.shapeConverter; this.domTreeManager = g.domTreeManager; this.domGroupManager = new DOMGroupManager(this.gc, this.domTreeManager); this.domTreeManager.addGroupManager(this.domGroupManager); }
void function(SVGGeneratorContext generatorCtx) { this.generatorCtx = generatorCtx; this.gc = new GraphicContext(new AffineTransform()); SVGGeneratorContext.GraphicContextDefaults gcDefaults = generatorCtx.getGraphicContextDefaults(); if(gcDefaults != null){ if(gcDefaults.getPaint() != null){ gc.setPaint(gcDefaults.getPaint()); } if(gcDefaults.getStroke() != null){ gc.setStroke(gcDefaults.getStroke()); } if(gcDefaults.getComposite() != null){ gc.setComposite(gcDefaults.getComposite()); } if(gcDefaults.getClip() != null){ gc.setClip(gcDefaults.getClip()); } if(gcDefaults.getRenderingHints() != null){ gc.setRenderingHints(gcDefaults.getRenderingHints()); } if(gcDefaults.getFont() != null){ gc.setFont(gcDefaults.getFont()); } if(gcDefaults.getBackground() != null){ gc.setBackground(gcDefaults.getBackground()); } } this.shapeConverter = new SVGShape(generatorCtx); this.domTreeManager = new DOMTreeManager(gc, generatorCtx, DEFAULT_MAX_GC_OVERRIDES); this.domGroupManager = new DOMGroupManager(gc, domTreeManager); this.domTreeManager.addGroupManager(domGroupManager); generatorCtx.genericImageHandler.setDOMTreeManager(domTreeManager); } public SVGGraphics2D(SVGGraphics2D g) { super(g); this.generatorCtx = g.generatorCtx; this.gc.validateTransformStack(); this.shapeConverter = g.shapeConverter; this.domTreeManager = g.domTreeManager; this.domGroupManager = new DOMGroupManager(this.gc, this.domTreeManager); this.domTreeManager.addGroupManager(this.domGroupManager); }
/** * Sets an non null <code>SVGGeneratorContext</code>. */
Sets an non null <code>SVGGeneratorContext</code>
setGeneratorContext
{ "repo_name": "git-moss/Push2Display", "path": "lib/batik-1.8/sources/org/apache/batik/svggen/SVGGraphics2D.java", "license": "lgpl-3.0", "size": 60716 }
[ "java.awt.geom.AffineTransform", "org.apache.batik.ext.awt.g2d.GraphicContext" ]
import java.awt.geom.AffineTransform; import org.apache.batik.ext.awt.g2d.GraphicContext;
import java.awt.geom.*; import org.apache.batik.ext.awt.g2d.*;
[ "java.awt", "org.apache.batik" ]
java.awt; org.apache.batik;
2,163,825
public List<String> getOutLines() { return out; }
List<String> function() { return out; }
/** * Return the STD OUT lines. */
Return the STD OUT lines
getOutLines
{ "repo_name": "avaje/docker-commands", "path": "src/main/java/io/ebean/docker/commands/process/ProcessResult.java", "license": "apache-2.0", "size": 1130 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,564,414
public static int getGreen(int color) { return Color.green(color); }
static int function(int color) { return Color.green(color); }
/** * Finds the green factor of a color. * @param color The color to evaluate. * @return A uint from 0 to 255. */
Finds the green factor of a color
getGreen
{ "repo_name": "gamblore/AndroidPunk", "path": "src/net/androidpunk/FP.java", "license": "mit", "size": 33659 }
[ "android.graphics.Color" ]
import android.graphics.Color;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,817,096
public Builder addApmDataEntry(String key, String value) { if (apmData == null) { apmData = new HashMap<>(); } apmData.put(key, value); return this; }
Builder function(String key, String value) { if (apmData == null) { apmData = new HashMap<>(); } apmData.put(key, value); return this; }
/** * Adds one key-value pair of APM specific data to the request. * * @param key {@link String} key. E.g. "username" * @param value {@link String} value to assign to the {@code key}. E.g. "user1111" * @return this object */
Adds one key-value pair of APM specific data to the request
addApmDataEntry
{ "repo_name": "SafechargeBulgaria/safecharge-retail-java", "path": "src/main/java/com/safecharge/request/AddUPOAPMRequest.java", "license": "mit", "size": 8230 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
260,533
public Enumeration<URL> findResources(final String name) throws IOException { final Enumeration<URL> e = ucp.findResources(name, true); return new Enumeration<>() { private URL url = null;
Enumeration<URL> function(final String name) throws IOException { final Enumeration<URL> e = ucp.findResources(name, true); return new Enumeration<>() { private URL url = null;
/** * Returns an Enumeration of URLs representing all of the resources * on the URL search path having the specified name. * * @param name the resource name * @exception IOException if an I/O exception occurs * @return an {@code Enumeration} of {@code URL}s * If the loader is closed, the Enumeration will be empty. */
Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name
findResources
{ "repo_name": "universsky/openjdk", "path": "jdk/src/java.base/share/classes/java/net/URLClassLoader.java", "license": "gpl-2.0", "size": 32011 }
[ "java.io.IOException", "java.util.Enumeration" ]
import java.io.IOException; import java.util.Enumeration;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
192,606
public void setMobileDataEnabled(boolean enabled) { try { mService.setMobileDataEnabled(enabled); } catch (RemoteException e) { } } public ConnectivityManager(IConnectivityManager service) { mService = checkNotNull(service, "missing IConnectivityManager"); } /** * {@hide}
void function(boolean enabled) { try { mService.setMobileDataEnabled(enabled); } catch (RemoteException e) { } } public ConnectivityManager(IConnectivityManager service) { mService = checkNotNull(service, STR); } /** * {@hide}
/** * Sets the persisted value for enabling/disabling Mobile data. * * @param enabled Whether the mobile data connection should be * used or not. * @hide */
Sets the persisted value for enabling/disabling Mobile data
setMobileDataEnabled
{ "repo_name": "AdeebNqo/Thula", "path": "Thula/src/main/java/android/net/ConnectivityManager.java", "license": "gpl-3.0", "size": 32273 }
[ "android.os.RemoteException", "com.android.internal.util.Preconditions" ]
import android.os.RemoteException; import com.android.internal.util.Preconditions;
import android.os.*; import com.android.internal.util.*;
[ "android.os", "com.android.internal" ]
android.os; com.android.internal;
165,336
@Override public List<Bookmark> getAllBookmarksForUser(String externalId) { return bookmarkDataService.findBookmarksForUser(externalId); }
List<Bookmark> function(String externalId) { return bookmarkDataService.findBookmarksForUser(externalId); }
/** * Get all the bookmarks for a user * @param externalId external tracking id for the user * @return list of bookmarks for user */
Get all the bookmarks for a user
getAllBookmarksForUser
{ "repo_name": "smalecki/modules", "path": "mtraining/src/main/java/org/motechproject/mtraining/service/impl/BookmarkServiceImpl.java", "license": "bsd-3-clause", "size": 3164 }
[ "java.util.List", "org.motechproject.mtraining.domain.Bookmark" ]
import java.util.List; import org.motechproject.mtraining.domain.Bookmark;
import java.util.*; import org.motechproject.mtraining.domain.*;
[ "java.util", "org.motechproject.mtraining" ]
java.util; org.motechproject.mtraining;
2,484,069
public static void replace(@NonNull final FragmentManager fm, @NonNull final Fragment fragment, @IdRes final int containerId, final boolean isAddStack) { replace(fm, fragment, containerId, null, isAddStack); }
static void function(@NonNull final FragmentManager fm, @NonNull final Fragment fragment, @IdRes final int containerId, final boolean isAddStack) { replace(fm, fragment, containerId, null, isAddStack); }
/** * Replace fragment. * * @param fm The manager of fragment. * @param containerId The id of container. * @param fragment The new fragment to place in the container. * @param isAddStack True to add fragment in stack, false otherwise. */
Replace fragment
replace
{ "repo_name": "Blankj/AndroidUtilCode", "path": "lib/utilcode/src/main/java/com/blankj/utilcode/util/FragmentUtils.java", "license": "apache-2.0", "size": 82362 }
[ "androidx.annotation.IdRes", "androidx.annotation.NonNull", "androidx.fragment.app.Fragment", "androidx.fragment.app.FragmentManager" ]
import androidx.annotation.IdRes; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager;
import androidx.annotation.*; import androidx.fragment.app.*;
[ "androidx.annotation", "androidx.fragment" ]
androidx.annotation; androidx.fragment;
2,038,084
public void paste(Context c, File copyTo){ // Quick check just to make sure. Normally this should never be the case as the path we get is not user-generated. if(!copyTo.isDirectory()) return; switch (mOperation) { case COPY: CopyService.copyTo(c, mClipboard, copyTo); mClipboard.clear(); break; case CUT: CopyService.moveTo(c, mClipboard, copyTo); mClipboard.clear(); break; default: break; } }
void function(Context c, File copyTo){ if(!copyTo.isDirectory()) return; switch (mOperation) { case COPY: CopyService.copyTo(c, mClipboard, copyTo); mClipboard.clear(); break; case CUT: CopyService.moveTo(c, mClipboard, copyTo); mClipboard.clear(); break; default: break; } }
/** * Paste the copied/cut items. * @param copyTo Path to paste to. */
Paste the copied/cut items
paste
{ "repo_name": "veniosg/Dir", "path": "app/src/main/java/com/veniosg/dir/android/util/CopyHelper.java", "license": "apache-2.0", "size": 2948 }
[ "android.content.Context", "com.veniosg.dir.android.service.CopyService", "java.io.File" ]
import android.content.Context; import com.veniosg.dir.android.service.CopyService; import java.io.File;
import android.content.*; import com.veniosg.dir.android.service.*; import java.io.*;
[ "android.content", "com.veniosg.dir", "java.io" ]
android.content; com.veniosg.dir; java.io;
2,199,578
public void backPropagate(Node<GameState> c, double heuristicScore){ c.setTotal(c.getTotal()+1); c.setHeuristicScore(c.getHeuristicScore() + heuristicScore); c.setWin(1); // if(heuristicScore>0.5){ // //TODO PSS: how to determine win? // c.setWin(c.getWin()+1); // } Node<GameState> parent = c.getParent(); if(parent!=null){ backPropagate(parent, heuristicScore); } }
void function(Node<GameState> c, double heuristicScore){ c.setTotal(c.getTotal()+1); c.setHeuristicScore(c.getHeuristicScore() + heuristicScore); c.setWin(1); Node<GameState> parent = c.getParent(); if(parent!=null){ backPropagate(parent, heuristicScore); } }
/** * Back-propagation: using the result of the play-out, update information in * the nodes on the path from C to Root. * */
Back-propagation: using the result of the play-out, update information in the nodes on the path from C to Root
backPropagate
{ "repo_name": "pr80ik/mcts-core", "path": "src/main/java/name/pratik/tree/mct/MCT.java", "license": "mit", "size": 6653 }
[ "name.pratik.game.core.GameState", "name.pratik.tree.Node" ]
import name.pratik.game.core.GameState; import name.pratik.tree.Node;
import name.pratik.game.core.*; import name.pratik.tree.*;
[ "name.pratik.game", "name.pratik.tree" ]
name.pratik.game; name.pratik.tree;
925,424
public List<SearchSuggestion> searchSuggestions(String query, int maxResult);
List<SearchSuggestion> function(String query, int maxResult);
/** * This will try to find suggestions based on the query and then * weight the results. * * @param query * @param maxResult * @return */
This will try to find suggestions based on the query and then weight the results
searchSuggestions
{ "repo_name": "jbottel/openstorefront", "path": "server/openstorefront/openstorefront-core/model/src/main/java/edu/usu/sdl/openstorefront/core/api/SearchService.java", "license": "apache-2.0", "size": 3652 }
[ "edu.usu.sdl.openstorefront.core.model.search.SearchSuggestion", "java.util.List" ]
import edu.usu.sdl.openstorefront.core.model.search.SearchSuggestion; import java.util.List;
import edu.usu.sdl.openstorefront.core.model.search.*; import java.util.*;
[ "edu.usu.sdl", "java.util" ]
edu.usu.sdl; java.util;
384,774
@TargetApi(23) private void initLocationService(Context context) { if ( Build.VERSION.SDK_INT >= 23 && this.checkSelfPermission( android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED && this.checkSelfPermission( android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); } try { this.locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); // Get GPS and network status this.isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); this.isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); if (forceNetwork) isGPSEnabled = false; if (!isNetworkEnabled && !isGPSEnabled) { // cannot get location this.locationServiceAvailable = false; } //else { this.locationServiceAvailable = true; if (isNetworkEnabled) { locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); if (locationManager != null) { this.location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); } }//end if if (isGPSEnabled) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); if (locationManager != null) { this.location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); } } } } catch (Exception ex) { android.util.Log.d( "WSO App Analytics", "Error creating location service: " + ex.getMessage() ); } }
@TargetApi(23) void function(Context context) { if ( Build.VERSION.SDK_INT >= 23 && this.checkSelfPermission( android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED && this.checkSelfPermission( android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { this.requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); } try { this.locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); this.isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); this.isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); if (forceNetwork) isGPSEnabled = false; if (!isNetworkEnabled && !isGPSEnabled) { this.locationServiceAvailable = false; } { this.locationServiceAvailable = true; if (isNetworkEnabled) { locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); if (locationManager != null) { this.location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); } } if (isGPSEnabled) { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this); if (locationManager != null) { this.location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); } } } } catch (Exception ex) { android.util.Log.d( STR, STR + ex.getMessage() ); } }
/** * Sets up location service after permissions is granted */
Sets up location service after permissions is granted
initLocationService
{ "repo_name": "vmwaresamples/AirWatch-samples", "path": "Intelligence-Samples/IntelligenceSDK/AppAnalytics-Sample-App/Android/app/src/main/java/com/example/android/wsoappanalytics/MainActivity.java", "license": "bsd-3-clause", "size": 10126 }
[ "android.annotation.TargetApi", "android.content.Context", "android.content.pm.PackageManager", "android.location.LocationManager", "android.os.Build" ]
import android.annotation.TargetApi; import android.content.Context; import android.content.pm.PackageManager; import android.location.LocationManager; import android.os.Build;
import android.annotation.*; import android.content.*; import android.content.pm.*; import android.location.*; import android.os.*;
[ "android.annotation", "android.content", "android.location", "android.os" ]
android.annotation; android.content; android.location; android.os;
2,629,940
protected String getTmpDirName(PathFragment execPath) { String basename = execPath.getBaseName(); synchronized (tmpIndex) { int index = tmpIndex.containsKey(basename) ? tmpIndex.get(basename) : 1; tmpIndex.put(basename, index + 1); return basename + "_" + index; } }
String function(PathFragment execPath) { String basename = execPath.getBaseName(); synchronized (tmpIndex) { int index = tmpIndex.containsKey(basename) ? tmpIndex.get(basename) : 1; tmpIndex.put(basename, index + 1); return basename + "_" + index; } }
/** * Returns a unique name for a temporary directory a test could use. * * <p>Since each test within single Blaze run must have a unique TEST_TMPDIR, we will use rule * name and a unique (within single Blaze request) number to generate directory name. * * <p>This does not create the directory. */
Returns a unique name for a temporary directory a test could use. Since each test within single Blaze run must have a unique TEST_TMPDIR, we will use rule name and a unique (within single Blaze request) number to generate directory name. This does not create the directory
getTmpDirName
{ "repo_name": "hermione521/bazel", "path": "src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java", "license": "apache-2.0", "size": 18691 }
[ "com.google.devtools.build.lib.vfs.PathFragment" ]
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.vfs.*;
[ "com.google.devtools" ]
com.google.devtools;
1,897,919
public String sprintf() { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb=new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); if (c=='\0') sb.append(cs.getLiteral()); else if (c=='%') sb.append("%"); } return sb.toString(); }
String function() { Enumeration e = vFmt.elements(); ConversionSpecification cs = null; char c = 0; StringBuffer sb=new StringBuffer(); while (e.hasMoreElements()) { cs = (ConversionSpecification) e.nextElement(); c = cs.getConversionCharacter(); if (c=='\0') sb.append(cs.getLiteral()); else if (c=='%') sb.append("%"); } return sb.toString(); }
/** * Format nothing. Just use the control string. * @return the formatted String. */
Format nothing. Just use the control string
sprintf
{ "repo_name": "cc14514/hq6", "path": "hq-util/src/main/java/org/hyperic/util/PrintfFormat.java", "license": "unlicense", "size": 98200 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,238,456
public void generateParametersFile(final String baseDataUrl, final StackId sourceStack, final Double firstZ, final Double lastZ, final String matchOwner, final String matchCollection, final Integer zNeighborDistance, final StackId targetStack, final File parametersFile) throws IOException { LOG.info("generateParametersFile: entry"); // Parameter file format is: // // { // "first_section": 1, // "last_section": 3, // "solver_options": { // ... // "nbrs": 1 // ... // "dir_scratch": "/scratch/trautmane", // ... // }, // "source_collection": { // "owner": "flyTEM", // "project": "test_tier_1", // "stack": "0003x0003_000001", // "baseURL": "http://renderer-dev:8080/render-ws/v1" // }, // "target_collection": { // "owner": "flyTEM", // "project": "test_tier_1", // "stack": "0003x0003_000001_fine", // "baseURL": "http://renderer-dev:8080/render-ws/v1" // }, // "source_point_match_collection": { // "server": "http://renderer-dev:8080/render-ws/v1", // "owner": "flyTEM", // "match_collection": "test_tier_1_0003x0003_000001" // }, // "verbose": 1 // } // NOTE: assumes redundant "service_host" attributes are not needed final Map<String, Object> parameters = JsonUtils.MAPPER.readValue(scriptParametersTemplateFile, new TypeReference<Map<String, Object>>(){}); final Map<String, Object> solverOptions = getNestedMap(parameters, "solver_options"); final Map<String, Object> sourceCollection = getNestedMap(parameters, "source_collection"); final Map<String, Object> targetCollection = getNestedMap(parameters, "target_collection"); final Map<String, Object> sourceMatchCollection = getNestedMap(parameters, "source_point_match_collection"); setParameter(solverOptions, "nbrs", zNeighborDistance); final File scratchDirectory = new File(parametersFile.getParent(), "solver_scratch_" + targetStack.getStack()); setParameter(solverOptions, "dir_scratch", scratchDirectory.getAbsolutePath()); setParameter(parameters, "first_section", firstZ); setParameter(parameters, "last_section", lastZ); setStackValues(sourceCollection, sourceStack, baseDataUrl); setStackValues(targetCollection, targetStack, baseDataUrl); setParameter(sourceMatchCollection, "server", baseDataUrl); setParameter(sourceMatchCollection, "owner", matchOwner); setParameter(sourceMatchCollection, "match_collection", matchCollection); JsonUtils.MAPPER.writeValue(parametersFile, parameters); LOG.info("generateParametersFile: exit, saved {}", parametersFile.getAbsolutePath()); }
void function(final String baseDataUrl, final StackId sourceStack, final Double firstZ, final Double lastZ, final String matchOwner, final String matchCollection, final Integer zNeighborDistance, final StackId targetStack, final File parametersFile) throws IOException { LOG.info(STR); final Map<String, Object> parameters = JsonUtils.MAPPER.readValue(scriptParametersTemplateFile, new TypeReference<Map<String, Object>>(){}); final Map<String, Object> solverOptions = getNestedMap(parameters, STR); final Map<String, Object> sourceCollection = getNestedMap(parameters, STR); final Map<String, Object> targetCollection = getNestedMap(parameters, STR); final Map<String, Object> sourceMatchCollection = getNestedMap(parameters, STR); setParameter(solverOptions, "nbrs", zNeighborDistance); final File scratchDirectory = new File(parametersFile.getParent(), STR + targetStack.getStack()); setParameter(solverOptions, STR, scratchDirectory.getAbsolutePath()); setParameter(parameters, STR, firstZ); setParameter(parameters, STR, lastZ); setStackValues(sourceCollection, sourceStack, baseDataUrl); setStackValues(targetCollection, targetStack, baseDataUrl); setParameter(sourceMatchCollection, STR, baseDataUrl); setParameter(sourceMatchCollection, "owner", matchOwner); setParameter(sourceMatchCollection, STR, matchCollection); JsonUtils.MAPPER.writeValue(parametersFile, parameters); LOG.info(STR, parametersFile.getAbsolutePath()); }
/** * Applies the specified parameters to this tool's template to create a run specific parameters file. * * @param baseDataUrl base web service URL for data (e.g. http://host[:port]/render-ws/v1) * @param sourceStack identifies the source render stack. * @param firstZ first layer to solve. * @param lastZ last layer to solve. * @param matchOwner owner of the point match collection. * @param matchCollection name of the point match collection. * @param targetStack identifies target render stack where solution transforms are to be stored. * @param parametersFile (writeable) file that will contain solver parameters after applying * parameters specified here to the parameters template file. * * @throws IOException * if the parameters file cannot be produced. */
Applies the specified parameters to this tool's template to create a run specific parameters file
generateParametersFile
{ "repo_name": "saalfeldlab/render", "path": "render-ws-spark-client/src/main/java/org/janelia/render/client/spark/EMAlignerTool.java", "license": "gpl-2.0", "size": 9892 }
[ "com.fasterxml.jackson.core.type.TypeReference", "java.io.File", "java.io.IOException", "java.util.Map", "org.janelia.alignment.json.JsonUtils", "org.janelia.alignment.spec.stack.StackId" ]
import com.fasterxml.jackson.core.type.TypeReference; import java.io.File; import java.io.IOException; import java.util.Map; import org.janelia.alignment.json.JsonUtils; import org.janelia.alignment.spec.stack.StackId;
import com.fasterxml.jackson.core.type.*; import java.io.*; import java.util.*; import org.janelia.alignment.json.*; import org.janelia.alignment.spec.stack.*;
[ "com.fasterxml.jackson", "java.io", "java.util", "org.janelia.alignment" ]
com.fasterxml.jackson; java.io; java.util; org.janelia.alignment;
2,855,275
private JSONObject buildParam() { JSONObject object = new JSONObject(); try { object.put("params", params); object.put("jsonrpc", "2.0"); object.put("method", mMethod); if (id != -1) { object.put("id", id); } } catch (Exception e) { Log.e(TAG, "Error building JSON object string", e); object = null; } return object; }
JSONObject function() { JSONObject object = new JSONObject(); try { object.put(STR, params); object.put(STR, "2.0"); object.put(STR, mMethod); if (id != -1) { object.put("id", id); } } catch (Exception e) { Log.e(TAG, STR, e); object = null; } return object; }
/** * Method to build the JSONObject; Throw exception if JSONObject cannot be build. * @return Build JSONObject or null on exception error. */
Method to build the JSONObject; Throw exception if JSONObject cannot be build
buildParam
{ "repo_name": "snappy46/GuitarixDroid", "path": "app/src/main/java/com/marcel/guitarixdroid/util/SocketClient.java", "license": "gpl-3.0", "size": 5529 }
[ "android.util.Log", "org.json.JSONObject" ]
import android.util.Log; import org.json.JSONObject;
import android.util.*; import org.json.*;
[ "android.util", "org.json" ]
android.util; org.json;
561,669
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { setBinaryStream(parameterIndex,x,(long)length); }
void function(int parameterIndex, java.io.InputStream x, int length) throws SQLException { setBinaryStream(parameterIndex,x,(long)length); }
/** * sets the parameter to the Binary Stream object * * @param parameterIndex the first parameter is 1, the second is 2, ... * @param x the java input stream which contains the binary parameter value * @param length the number of bytes in the stream * @exception SQLException thrown on failure. */
sets the parameter to the Binary Stream object
setBinaryStream
{ "repo_name": "viaper/DBPlus", "path": "DerbyHodgepodge/java/client/org/apache/derby/client/am/PreparedStatement.java", "license": "apache-2.0", "size": 126488 }
[ "java.io.InputStream", "java.sql.SQLException" ]
import java.io.InputStream; import java.sql.SQLException;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
2,727,162
public void createMaps() throws IOException { final Image map = loadImage(); // ask user to input image location if (map == null) { System.out.println("You need to select a map image for this to work"); System.out.println("Shutting down"); System.exit(0); } m_seaZoneOnly = doSeaZone(); // ask user wether it is sea zone only or // not final String mapDir = getMapDirectory(); // ask user where the map is if (mapDir == null || mapDir.equals("")) { System.out.println("You need to specify a map name for this to work"); System.out.println("Shutting down"); System.exit(0); } try { m_mapData = new MapData(mapDir); // files for the map. } catch (final NullPointerException npe) { System.out.println("Bad data given or missing text files, shutting down"); System.exit(0); } for (final String territoryName : m_mapData.getTerritories()) { final boolean seaZone = territoryName.endsWith("Sea Zone") || territoryName.startsWith("Sea Zone"); if (!seaZone && m_seaZoneOnly) { continue; } if (seaZone && !m_seaZoneOnly) { continue; } processImage(territoryName, map); } System.out.println("All Finished!"); System.exit(0); }
void function() throws IOException { final Image map = loadImage(); if (map == null) { System.out.println(STR); System.out.println(STR); System.exit(0); } m_seaZoneOnly = doSeaZone(); final String mapDir = getMapDirectory(); if (mapDir == null mapDir.equals(STRYou need to specify a map name for this to work"); System.out.println(STR); System.exit(0); } try { m_mapData = new MapData(mapDir); } catch (final NullPointerException npe) { System.out.println("Bad data given or missing text files, shutting downSTRSea ZoneSTRSea ZoneSTRAll Finished!"); System.exit(0); }
/** * createMaps() * * One of the main methods that is used to create the actual maps. Calls on * various methods to get user input and create the maps. * * @exception java.io.IOException * throws * */
createMaps() One of the main methods that is used to create the actual maps. Calls on various methods to get user input and create the maps
createMaps
{ "repo_name": "tea-dragon/triplea", "path": "src/main/java/util/image/ReliefImageBreaker.java", "license": "gpl-2.0", "size": 11013 }
[ "games.strategy.triplea.ui.MapData", "java.awt.Image", "java.io.IOException" ]
import games.strategy.triplea.ui.MapData; import java.awt.Image; import java.io.IOException;
import games.strategy.triplea.ui.*; import java.awt.*; import java.io.*;
[ "games.strategy.triplea", "java.awt", "java.io" ]
games.strategy.triplea; java.awt; java.io;
1,951,819
public ServiceFuture<CertificatePolicy> updateCertificatePolicyAsync(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, final ServiceCallback<CertificatePolicy> serviceCallback) { return ServiceFuture.fromResponse(updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy), serviceCallback); }
ServiceFuture<CertificatePolicy> function(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, final ServiceCallback<CertificatePolicy> serviceCallback) { return ServiceFuture.fromResponse(updateCertificatePolicyWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy), serviceCallback); }
/** * Updates the policy for a certificate. Set specified members in the certificate policy. Leave others as null. * * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param certificateName The name of the certificate in the given vault. * @param certificatePolicy The policy for the certificate. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceFuture} object */
Updates the policy for a certificate. Set specified members in the certificate policy. Leave others as null
updateCertificatePolicyAsync
{ "repo_name": "anudeepsharma/azure-sdk-for-java", "path": "azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java", "license": "mit", "size": 399443 }
[ "com.microsoft.azure.keyvault.models.CertificatePolicy", "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.azure.keyvault.models.CertificatePolicy; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.azure.keyvault.models.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
2,698,859
private static void loadFontMapping() { boolean addedMapping = true; // There could be some recursive mappings in the fontmapping, so that we have to // read the list until no more additional mapping is added to it while (addedMapping) { int counter = 0; Enumeration<Object> keys = fontMapping.keys(); while (keys.hasMoreElements()) { String key = (String)keys.nextElement(); if (addFontMapping(key,(String)fontMapping.get(key))) { counter++; } } if (counter == 0) { addedMapping = false; } } }
static void function() { boolean addedMapping = true; while (addedMapping) { int counter = 0; Enumeration<Object> keys = fontMapping.keys(); while (keys.hasMoreElements()) { String key = (String)keys.nextElement(); if (addFontMapping(key,(String)fontMapping.get(key))) { counter++; } } if (counter == 0) { addedMapping = false; } } }
/** * Load the mapping for the well knwon font-substitutions. * */
Load the mapping for the well knwon font-substitutions
loadFontMapping
{ "repo_name": "myrridin/qz-print", "path": "pdfbox_1.8.4_qz/src/org/apache/pdfbox/pdmodel/font/FontManager.java", "license": "lgpl-2.1", "size": 10589 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
492,025
public void setUserDirIsRoot(FileSystemOptions opts, boolean userDirIsRoot) { setParam(opts, USER_DIR_IS_ROOT, userDirIsRoot ? Boolean.TRUE : Boolean.FALSE); }
void function(FileSystemOptions opts, boolean userDirIsRoot) { setParam(opts, USER_DIR_IS_ROOT, userDirIsRoot ? Boolean.TRUE : Boolean.FALSE); }
/** * use user directory as root (do not change to fs root). * * @param opts The FileSystemOptions. * @param userDirIsRoot true if the user directory should be the root. */
use user directory as root (do not change to fs root)
setUserDirIsRoot
{ "repo_name": "virajsenevirathne/wso2-commons-vfs", "path": "core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsFileSystemConfigBuilder.java", "license": "apache-2.0", "size": 15470 }
[ "org.apache.commons.vfs2.FileSystemOptions" ]
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.*;
[ "org.apache.commons" ]
org.apache.commons;
2,348,144
public static Snapshot create( @Nullable Long count, @Nullable Double sum, List<ValueAtPercentile> valueAtPercentiles) { checkCountAndSum(count, sum); Utils.checkListElementNotNull( Utils.checkNotNull(valueAtPercentiles, "valueAtPercentiles"), "valueAtPercentile"); return new AutoValue_Summary_Snapshot( count, sum, Collections.unmodifiableList(new ArrayList<ValueAtPercentile>(valueAtPercentiles))); }
static Snapshot function( @Nullable Long count, @Nullable Double sum, List<ValueAtPercentile> valueAtPercentiles) { checkCountAndSum(count, sum); Utils.checkListElementNotNull( Utils.checkNotNull(valueAtPercentiles, STR), STR); return new AutoValue_Summary_Snapshot( count, sum, Collections.unmodifiableList(new ArrayList<ValueAtPercentile>(valueAtPercentiles))); }
/** * Creates a {@link Snapshot}. * * @param count the number of values in this {@code Snapshot}. * @param sum the number of values in this {@code Snapshot}. * @param valueAtPercentiles the list of {@code ValueAtPercentile}. * @return a {@code Snapshot} with the given values. * @since 0.17 */
Creates a <code>Snapshot</code>
create
{ "repo_name": "sebright/opencensus-java", "path": "api/src/main/java/io/opencensus/metrics/export/Summary.java", "license": "apache-2.0", "size": 5802 }
[ "com.google.auto.value.AutoValue", "io.opencensus.internal.Utils", "java.util.ArrayList", "java.util.Collections", "java.util.List", "javax.annotation.Nullable" ]
import com.google.auto.value.AutoValue; import io.opencensus.internal.Utils; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.annotation.Nullable;
import com.google.auto.value.*; import io.opencensus.internal.*; import java.util.*; import javax.annotation.*;
[ "com.google.auto", "io.opencensus.internal", "java.util", "javax.annotation" ]
com.google.auto; io.opencensus.internal; java.util; javax.annotation;
541,112
public Set<String> getSet() { return getSet(null); }
Set<String> function() { return getSet(null); }
/** * Gets the set of root level settings that have been set * @return A set of root level settings */
Gets the set of root level settings that have been set
getSet
{ "repo_name": "danielmoney/GeLL", "path": "src/Utils/SetSettings.java", "license": "gpl-3.0", "size": 8107 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,885,378
@Nullable public static TriggerKey scheduleMe (final long nDisposalMinutes) { TriggerKey aTriggerKey = null; if (nDisposalMinutes > 0) { if (!s_aScheduled.getAndSet (true)) { final JobDataMap aJobDataMap = new JobDataMap (); aJobDataMap.putIn (KEY_MINUTES, nDisposalMinutes); aTriggerKey = GlobalQuartzScheduler.getInstance () .scheduleJob (ClassHelper.getClassLocalName (AS4DuplicateCleanupJob.class) + "-" + nDisposalMinutes, JDK8TriggerBuilder.newTrigger () .startNow () .withSchedule (SimpleScheduleBuilder.repeatMinutelyForever ()), AS4DuplicateCleanupJob.class, aJobDataMap); } else { LOGGER.warn ("AS4DuplicateCleanupJob is already scheduled"); } } else { LOGGER.warn ("Incoming duplicate message cleaning is disabled!"); } return aTriggerKey; }
static TriggerKey function (final long nDisposalMinutes) { TriggerKey aTriggerKey = null; if (nDisposalMinutes > 0) { if (!s_aScheduled.getAndSet (true)) { final JobDataMap aJobDataMap = new JobDataMap (); aJobDataMap.putIn (KEY_MINUTES, nDisposalMinutes); aTriggerKey = GlobalQuartzScheduler.getInstance () .scheduleJob (ClassHelper.getClassLocalName (AS4DuplicateCleanupJob.class) + "-" + nDisposalMinutes, JDK8TriggerBuilder.newTrigger () .startNow () .withSchedule (SimpleScheduleBuilder.repeatMinutelyForever ()), AS4DuplicateCleanupJob.class, aJobDataMap); } else { LOGGER.warn (STR); } } else { LOGGER.warn (STR); } return aTriggerKey; }
/** * Start a job that runs every minute, that removes all messages older than a * certain time from duplication check. If the job is already scheduled, it * cannot be scheduled again. * * @param nDisposalMinutes * Messages older than this number of minutes will not be checked for * duplicates. Must be &gt; 0. * @return <code>null</code> if no job was scheduled, the trigger key of the * respective job otherwise. */
Start a job that runs every minute, that removes all messages older than a certain time from duplication check. If the job is already scheduled, it cannot be scheduled again
scheduleMe
{ "repo_name": "phax/ph-as4", "path": "ph-as4-servlet/src/main/java/com/helger/as4/servlet/mgr/AS4DuplicateCleanupJob.java", "license": "apache-2.0", "size": 4377 }
[ "com.helger.commons.lang.ClassHelper", "com.helger.quartz.JobDataMap", "com.helger.quartz.SimpleScheduleBuilder", "com.helger.quartz.TriggerKey", "com.helger.schedule.quartz.GlobalQuartzScheduler", "com.helger.schedule.quartz.trigger.JDK8TriggerBuilder" ]
import com.helger.commons.lang.ClassHelper; import com.helger.quartz.JobDataMap; import com.helger.quartz.SimpleScheduleBuilder; import com.helger.quartz.TriggerKey; import com.helger.schedule.quartz.GlobalQuartzScheduler; import com.helger.schedule.quartz.trigger.JDK8TriggerBuilder;
import com.helger.commons.lang.*; import com.helger.quartz.*; import com.helger.schedule.quartz.*; import com.helger.schedule.quartz.trigger.*;
[ "com.helger.commons", "com.helger.quartz", "com.helger.schedule" ]
com.helger.commons; com.helger.quartz; com.helger.schedule;
2,435,091
@Test public void testGetRegionsInRange() throws Exception { // Test Initialization. byte [] startKey = Bytes.toBytes("ddc"); byte [] endKey = Bytes.toBytes("mmm"); TableName tableName = name.getTableName(); TEST_UTIL.createMultiRegionTable(tableName, new byte[][] { FAMILY }, 10); int numOfRegions; try (RegionLocator r = TEST_UTIL.getConnection().getRegionLocator(tableName)) { numOfRegions = r.getStartKeys().length; } assertEquals(26, numOfRegions); // Get the regions in this range List<HRegionLocation> regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(10, regionsList.size()); // Change the start key startKey = Bytes.toBytes("fff"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(7, regionsList.size()); // Change the end key endKey = Bytes.toBytes("nnn"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(8, regionsList.size()); // Empty start key regionsList = getRegionsInRange(tableName, HConstants.EMPTY_START_ROW, endKey); assertEquals(13, regionsList.size()); // Empty end key regionsList = getRegionsInRange(tableName, startKey, HConstants.EMPTY_END_ROW); assertEquals(21, regionsList.size()); // Both start and end keys empty regionsList = getRegionsInRange(tableName, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW); assertEquals(26, regionsList.size()); // Change the end key to somewhere in the last block endKey = Bytes.toBytes("zzz1"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(21, regionsList.size()); // Change the start key to somewhere in the first block startKey = Bytes.toBytes("aac"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(26, regionsList.size()); // Make start and end key the same startKey = Bytes.toBytes("ccc"); endKey = Bytes.toBytes("ccc"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(1, regionsList.size()); }
void function() throws Exception { byte [] startKey = Bytes.toBytes("ddc"); byte [] endKey = Bytes.toBytes("mmm"); TableName tableName = name.getTableName(); TEST_UTIL.createMultiRegionTable(tableName, new byte[][] { FAMILY }, 10); int numOfRegions; try (RegionLocator r = TEST_UTIL.getConnection().getRegionLocator(tableName)) { numOfRegions = r.getStartKeys().length; } assertEquals(26, numOfRegions); List<HRegionLocation> regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(10, regionsList.size()); startKey = Bytes.toBytes("fff"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(7, regionsList.size()); endKey = Bytes.toBytes("nnn"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(8, regionsList.size()); regionsList = getRegionsInRange(tableName, HConstants.EMPTY_START_ROW, endKey); assertEquals(13, regionsList.size()); regionsList = getRegionsInRange(tableName, startKey, HConstants.EMPTY_END_ROW); assertEquals(21, regionsList.size()); regionsList = getRegionsInRange(tableName, HConstants.EMPTY_START_ROW, HConstants.EMPTY_END_ROW); assertEquals(26, regionsList.size()); endKey = Bytes.toBytes("zzz1"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(21, regionsList.size()); startKey = Bytes.toBytes("aac"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(26, regionsList.size()); startKey = Bytes.toBytes("ccc"); endKey = Bytes.toBytes("ccc"); regionsList = getRegionsInRange(tableName, startKey, endKey); assertEquals(1, regionsList.size()); }
/** * Tests getRegionsInRange by creating some regions over which a range of * keys spans; then changing the key range. */
Tests getRegionsInRange by creating some regions over which a range of keys spans; then changing the key range
testGetRegionsInRange
{ "repo_name": "francisliu/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide5.java", "license": "apache-2.0", "size": 101931 }
[ "java.util.List", "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.HRegionLocation", "org.apache.hadoop.hbase.TableName", "org.apache.hadoop.hbase.util.Bytes", "org.junit.Assert" ]
import java.util.List; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Assert;
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*; import org.junit.*;
[ "java.util", "org.apache.hadoop", "org.junit" ]
java.util; org.apache.hadoop; org.junit;
868,930
public static Vector parseListFrom(InputStream in, Schema schema) throws IOException { final Vector list = new Vector(); byte[] buf = null; int biggestLen = 0; LimitedInputStream lin = null; for (int size = in.read(); size != -1; size = in.read()) { final Object message = schema.newMessage(); list.addElement(message); final int len = size < 0x80 ? size : CodedInput.readRawVarint32(in, size); if (len != 0) { // not an empty message if (len > CodedInput.DEFAULT_BUFFER_SIZE) { // message too big if (lin == null) lin = new LimitedInputStream(in); final CodedInput input = new CodedInput(lin.limit(len), false); schema.mergeFrom(input, message); input.checkLastTagWas(0); continue; } if (biggestLen < len) { // cannot reuse buffer, allocate a bigger buffer // discard the last one for gc buf = new byte[len]; biggestLen = len; } IOUtil.fillBufferFrom(in, buf, 0, len); final ByteArrayInput input = new ByteArrayInput(buf, 0, len, false); try { schema.mergeFrom(input, message); } catch (ArrayIndexOutOfBoundsException e) { throw ProtobufException.truncatedMessage(e); } input.checkLastTagWas(0); } } return list; }
static Vector function(InputStream in, Schema schema) throws IOException { final Vector list = new Vector(); byte[] buf = null; int biggestLen = 0; LimitedInputStream lin = null; for (int size = in.read(); size != -1; size = in.read()) { final Object message = schema.newMessage(); list.addElement(message); final int len = size < 0x80 ? size : CodedInput.readRawVarint32(in, size); if (len != 0) { if (len > CodedInput.DEFAULT_BUFFER_SIZE) { if (lin == null) lin = new LimitedInputStream(in); final CodedInput input = new CodedInput(lin.limit(len), false); schema.mergeFrom(input, message); input.checkLastTagWas(0); continue; } if (biggestLen < len) { buf = new byte[len]; biggestLen = len; } IOUtil.fillBufferFrom(in, buf, 0, len); final ByteArrayInput input = new ByteArrayInput(buf, 0, len, false); try { schema.mergeFrom(input, message); } catch (ArrayIndexOutOfBoundsException e) { throw ProtobufException.truncatedMessage(e); } input.checkLastTagWas(0); } } return list; }
/** * Parses the {@code messages} (delimited) from the {@link InputStream} using the given {@code schema}. * * @return the list containing the messages. */
Parses the messages (delimited) from the <code>InputStream</code> using the given schema
parseListFrom
{ "repo_name": "protostuff/protostuff-me", "path": "src/main/java/io/protostuff/me/ProtobufIOUtil.java", "license": "apache-2.0", "size": 15575 }
[ "java.io.IOException", "java.io.InputStream", "java.util.Vector" ]
import java.io.IOException; import java.io.InputStream; import java.util.Vector;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
295,439
default O removeInnerType(HxType type) { Objects.requireNonNull(type, "Given type is null."); for(Iterator<HxType> iterator = getInnerTypes().iterator(); iterator.hasNext(); ){ if (iterator.next().equals(type)) { iterator.remove(); break; } } return (O) this; }
default O removeInnerType(HxType type) { Objects.requireNonNull(type, STR); for(Iterator<HxType> iterator = getInnerTypes().iterator(); iterator.hasNext(); ){ if (iterator.next().equals(type)) { iterator.remove(); break; } } return (O) this; }
/** * Removes given type from list of inner types * @param type to remove * @return */
Removes given type from list of inner types
removeInnerType
{ "repo_name": "andreho/haxxor", "path": "src/main/java/net/andreho/haxxor/api/HxInnerTypeManager.java", "license": "apache-2.0", "size": 2929 }
[ "java.util.Iterator", "java.util.Objects" ]
import java.util.Iterator; import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
226,219
@SuppressWarnings (value = "unchecked") private Map<String, Object> getMetaDataMap(Notification notification, String key) { return ((Map<String, Object>) notification.getEvents().get(0).getMetaData().get(key)); }
@SuppressWarnings (value = STR) Map<String, Object> function(Notification notification, String key) { return ((Map<String, Object>) notification.getEvents().get(0).getMetaData().get(key)); }
/** * Gets a hashmap key from the meta data in a notification * * @param notification The notification * @param key The key to get * @return The hash map */
Gets a hashmap key from the meta data in a notification
getMetaDataMap
{ "repo_name": "bugsnag/bugsnag-java", "path": "bugsnag/src/test/java/com/bugsnag/AppenderTest.java", "license": "mit", "size": 15134 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,453,883
protected void create(Set<ConfigObject> changeIndexObjects) throws DBCreateException { if (isLoggingEnabled()) { getLog().setCreateIndexesException(DBCreateLog.STARTED); } actionMessage("Creating indexes"); for (ConfigObject configObject : changeIndexObjects) { if (!configObject.isTable() || configObject.isSystem()) { continue; // пропускаем нетаблицы } String tableName = configObject.getName(); List<Index> configIndexes = Collections.unmodifiableList(getConfigIndexes(configObject)); dropAllUnknown(tableName, configIndexes, getExistingIndexes(tableName)); createAllNew(tableName, configIndexes, getExistingIndexes(tableName)); if (configObject.isTree()) { try { tableName = configObject.getExtendedTreeTableName(); configIndexes = getExtendedTreeIndexes(configObject); } catch (DBConfigException e) { throw newIndexException(DBCreateException.DBC_CANT_CREATE_INDEX, e, tableName, null); } dropAllUnknown(tableName, configIndexes, getExistingIndexes(tableName)); createAllNew(tableName, configIndexes, getExistingIndexes(tableName)); } } if (isLoggingEnabled()) { getLog().setCreateIndexesException(DBCreateLog.OK); } ok(); }
void function(Set<ConfigObject> changeIndexObjects) throws DBCreateException { if (isLoggingEnabled()) { getLog().setCreateIndexesException(DBCreateLog.STARTED); } actionMessage(STR); for (ConfigObject configObject : changeIndexObjects) { if (!configObject.isTable() configObject.isSystem()) { continue; } String tableName = configObject.getName(); List<Index> configIndexes = Collections.unmodifiableList(getConfigIndexes(configObject)); dropAllUnknown(tableName, configIndexes, getExistingIndexes(tableName)); createAllNew(tableName, configIndexes, getExistingIndexes(tableName)); if (configObject.isTree()) { try { tableName = configObject.getExtendedTreeTableName(); configIndexes = getExtendedTreeIndexes(configObject); } catch (DBConfigException e) { throw newIndexException(DBCreateException.DBC_CANT_CREATE_INDEX, e, tableName, null); } dropAllUnknown(tableName, configIndexes, getExistingIndexes(tableName)); createAllNew(tableName, configIndexes, getExistingIndexes(tableName)); } } if (isLoggingEnabled()) { getLog().setCreateIndexesException(DBCreateLog.OK); } ok(); }
/** * Create all indexes, and register they in DB.SYS_TBL_INDX_NAME * * @param changeIndexObjects * набор имен объектов, для которых надо пересоздать индексы */
Create all indexes, and register they in DB.SYS_TBL_INDX_NAME
create
{ "repo_name": "mozartframework/cms", "path": "src/com/mozartframework/db/create/Indexes.java", "license": "gpl-3.0", "size": 12130 }
[ "com.mozartframework.db.config.ConfigObject", "com.mozartframework.db.config.DBConfigException", "java.util.Collections", "java.util.List", "java.util.Set" ]
import com.mozartframework.db.config.ConfigObject; import com.mozartframework.db.config.DBConfigException; import java.util.Collections; import java.util.List; import java.util.Set;
import com.mozartframework.db.config.*; import java.util.*;
[ "com.mozartframework.db", "java.util" ]
com.mozartframework.db; java.util;
623,956
public InputStream wrap(InputStream is) { Objects.requireNonNull(is); return new DecInputStream(is, isURL ? fromBase64URL : fromBase64, isMIME); }
InputStream function(InputStream is) { Objects.requireNonNull(is); return new DecInputStream(is, isURL ? fromBase64URL : fromBase64, isMIME); }
/** * Returns an input stream for decoding {@link Base64} encoded byte stream. * * <p> The {@code read} methods of the returned {@code InputStream} will * throw {@code IOException} when reading bytes that cannot be decoded. * * <p> Closing the returned input stream will close the underlying * input stream. * * @param is * the input stream * * @return the input stream for decoding the specified Base64 encoded * byte stream */
Returns an input stream for decoding <code>Base64</code> encoded byte stream. The read methods of the returned InputStream will throw IOException when reading bytes that cannot be decoded. Closing the returned input stream will close the underlying input stream
wrap
{ "repo_name": "xkommando/Gplume", "path": "gplume/src/main/java/com/caibowen/gplume/common/Base64.java", "license": "apache-2.0", "size": 38581 }
[ "java.io.InputStream", "java.util.Objects" ]
import java.io.InputStream; import java.util.Objects;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,221,901
protected void processActionTaken(ActionTakenValue actionTaken) { // no default impl }
void function(ActionTakenValue actionTaken) { }
/** * Allows subclasses to perform any post-processing after the action has been taken */
Allows subclasses to perform any post-processing after the action has been taken
processActionTaken
{ "repo_name": "ewestfal/rice-svn2git-test", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/actions/SuperUserActionTakenEvent.java", "license": "apache-2.0", "size": 7381 }
[ "org.kuali.rice.kew.actiontaken.ActionTakenValue" ]
import org.kuali.rice.kew.actiontaken.ActionTakenValue;
import org.kuali.rice.kew.actiontaken.*;
[ "org.kuali.rice" ]
org.kuali.rice;
1,336,081
public File getKerberosServiceKeytab();
File function();
/** * The File instance for the Kerberos service keytab. The service principal * and service keytab will be used to communicate with the KDC to obtain * tickets on behalf of Logisland. * * @return the File instance of the service keytab, or null if this Logisland * instance is not configured with a Logisland Kerberos service keytab */
The File instance for the Kerberos service keytab. The service principal and service keytab will be used to communicate with the KDC to obtain tickets on behalf of Logisland
getKerberosServiceKeytab
{ "repo_name": "Hurence/log-island", "path": "logisland-core/logisland-api/src/main/java/com/hurence/logisland/kerberos/KerberosContext.java", "license": "apache-2.0", "size": 1916 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,711,493
private boolean maybeSeekForCues(PositionHolder seekPosition, long currentPosition) { if (seekForCues) { seekPositionAfterBuildingCues = currentPosition; seekPosition.position = cuesContentPosition; seekForCues = false; return true; } // After parsing Cues, seek back to original position if available. We will not do this unless // we seeked to get to the Cues in the first place. if (sentSeekMap && seekPositionAfterBuildingCues != C.POSITION_UNSET) { seekPosition.position = seekPositionAfterBuildingCues; seekPositionAfterBuildingCues = C.POSITION_UNSET; return true; } return false; }
boolean function(PositionHolder seekPosition, long currentPosition) { if (seekForCues) { seekPositionAfterBuildingCues = currentPosition; seekPosition.position = cuesContentPosition; seekForCues = false; return true; } if (sentSeekMap && seekPositionAfterBuildingCues != C.POSITION_UNSET) { seekPosition.position = seekPositionAfterBuildingCues; seekPositionAfterBuildingCues = C.POSITION_UNSET; return true; } return false; }
/** * Updates the position of the holder to Cues element's position if the extractor configuration * permits use of master seek entry. After building Cues sets the holder's position back to where * it was before. * * @param seekPosition The holder whose position will be updated. * @param currentPosition Current position of the input. * @return Whether the seek position was updated. */
Updates the position of the holder to Cues element's position if the extractor configuration permits use of master seek entry. After building Cues sets the holder's position back to where it was before
maybeSeekForCues
{ "repo_name": "jeoliva/ExoPlayer", "path": "library/core/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java", "license": "apache-2.0", "size": 75927 }
[ "com.google.android.exoplayer2.extractor.PositionHolder" ]
import com.google.android.exoplayer2.extractor.PositionHolder;
import com.google.android.exoplayer2.extractor.*;
[ "com.google.android" ]
com.google.android;
548,302
@Override public ConstantAction makeConstantAction() throws StandardException { if (targetTableDescriptor != null) { // Base table int lckMode = resultSet.updateTargetLockMode(); long heapConglomId = targetTableDescriptor.getHeapConglomerateId(); TransactionController tc = getLanguageConnectionContext().getTransactionCompile(); StaticCompiledOpenConglomInfo[] indexSCOCIs = new StaticCompiledOpenConglomInfo[indexConglomerateNumbers.length]; for (int index = 0; index < indexSCOCIs.length; index++) { indexSCOCIs[index] = tc.getStaticCompiledConglomInfo(indexConglomerateNumbers[index]); } if (targetTableDescriptor.getLockGranularity() == TableDescriptor.TABLE_LOCK_GRANULARITY) { lckMode = TransactionController.MODE_TABLE; } ResultDescription resultDescription = null; if(isDependentTable) { //triggers need the result description , //dependent tables don't have a source from generation time //to get the result description resultDescription = makeResultDescription(); } return getGenericConstantActionFactory().getDeleteConstantAction ( heapConglomId, targetTableDescriptor.getTableType(), tc.getStaticCompiledConglomInfo(heapConglomId), indicesToMaintain, indexConglomerateNumbers, indexSCOCIs, deferred, false, targetTableDescriptor.getUUID(), lckMode, null, null, null, 0, null, null, resultDescription, getFKInfo(), getTriggerInfo(), (readColsBitSet == null) ? (FormatableBitSet)null : new FormatableBitSet(readColsBitSet), getReadColMap(targetTableDescriptor.getNumberOfColumns(),readColsBitSet), resultColumnList.getStreamStorableColIds(targetTableDescriptor.getNumberOfColumns()), (readColsBitSet == null) ? targetTableDescriptor.getNumberOfColumns() : readColsBitSet.getNumBitsSet(), (UUID) null, resultSet.isOneRowResultSet(), dependentConstantActions, inMatchingClause()); } else { return getGenericConstantActionFactory().getUpdatableVTIConstantAction( DeferModification.DELETE_STATEMENT, deferred); } }
ConstantAction function() throws StandardException { if (targetTableDescriptor != null) { int lckMode = resultSet.updateTargetLockMode(); long heapConglomId = targetTableDescriptor.getHeapConglomerateId(); TransactionController tc = getLanguageConnectionContext().getTransactionCompile(); StaticCompiledOpenConglomInfo[] indexSCOCIs = new StaticCompiledOpenConglomInfo[indexConglomerateNumbers.length]; for (int index = 0; index < indexSCOCIs.length; index++) { indexSCOCIs[index] = tc.getStaticCompiledConglomInfo(indexConglomerateNumbers[index]); } if (targetTableDescriptor.getLockGranularity() == TableDescriptor.TABLE_LOCK_GRANULARITY) { lckMode = TransactionController.MODE_TABLE; } ResultDescription resultDescription = null; if(isDependentTable) { resultDescription = makeResultDescription(); } return getGenericConstantActionFactory().getDeleteConstantAction ( heapConglomId, targetTableDescriptor.getTableType(), tc.getStaticCompiledConglomInfo(heapConglomId), indicesToMaintain, indexConglomerateNumbers, indexSCOCIs, deferred, false, targetTableDescriptor.getUUID(), lckMode, null, null, null, 0, null, null, resultDescription, getFKInfo(), getTriggerInfo(), (readColsBitSet == null) ? (FormatableBitSet)null : new FormatableBitSet(readColsBitSet), getReadColMap(targetTableDescriptor.getNumberOfColumns(),readColsBitSet), resultColumnList.getStreamStorableColIds(targetTableDescriptor.getNumberOfColumns()), (readColsBitSet == null) ? targetTableDescriptor.getNumberOfColumns() : readColsBitSet.getNumBitsSet(), (UUID) null, resultSet.isOneRowResultSet(), dependentConstantActions, inMatchingClause()); } else { return getGenericConstantActionFactory().getUpdatableVTIConstantAction( DeferModification.DELETE_STATEMENT, deferred); } }
/** * Compile constants that Execution will use * * @exception StandardException Thrown on failure */
Compile constants that Execution will use
makeConstantAction
{ "repo_name": "trejkaz/derby", "path": "java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java", "license": "apache-2.0", "size": 34876 }
[ "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.services.io.FormatableBitSet", "org.apache.derby.iapi.sql.ResultDescription", "org.apache.derby.iapi.sql.dictionary.TableDescriptor", "org.apache.derby.iapi.sql.execute.ConstantAction", "org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo", "org.apache.derby.iapi.store.access.TransactionController", "org.apache.derby.vti.DeferModification" ]
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.services.io.FormatableBitSet; import org.apache.derby.iapi.sql.ResultDescription; import org.apache.derby.iapi.sql.dictionary.TableDescriptor; import org.apache.derby.iapi.sql.execute.ConstantAction; import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo; import org.apache.derby.iapi.store.access.TransactionController; import org.apache.derby.vti.DeferModification;
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.services.io.*; import org.apache.derby.iapi.sql.*; import org.apache.derby.iapi.sql.dictionary.*; import org.apache.derby.iapi.sql.execute.*; import org.apache.derby.iapi.store.access.*; import org.apache.derby.vti.*;
[ "org.apache.derby" ]
org.apache.derby;
1,799,913
public CategoryURLGenerator getURLGenerator() { return this.urlGenerator; }
CategoryURLGenerator function() { return this.urlGenerator; }
/** * Returns the URL generator for the plot. * * @return The URL generator (possibly <code>null</code>). * * @see #setURLGenerator(CategoryURLGenerator) * * @since 1.0.2 */
Returns the URL generator for the plot
getURLGenerator
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/plot/SpiderWebPlot.java", "license": "lgpl-2.1", "size": 56201 }
[ "org.jfree.chart.urls.CategoryURLGenerator" ]
import org.jfree.chart.urls.CategoryURLGenerator;
import org.jfree.chart.urls.*;
[ "org.jfree.chart" ]
org.jfree.chart;
2,224,859
public void removePropertyChangeListener(String propertyName, PropertyChangeListener pcl) { getPropertyChangeSupport().removePropertyChangeListener(propertyName, pcl); }
void function(String propertyName, PropertyChangeListener pcl) { getPropertyChangeSupport().removePropertyChangeListener(propertyName, pcl); }
/** * Remove a property change listener for a specific property. */
Remove a property change listener for a specific property
removePropertyChangeListener
{ "repo_name": "spakzad/ocs", "path": "bundle/edu.gemini.pot/src/main/java/edu/gemini/spModel/data/AbstractDataObject.java", "license": "bsd-3-clause", "size": 11313 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
770,178
public void finishUrlFocusChange(boolean hasFocus) { final WindowDelegate windowDelegate = getWindowDelegate(); if (!hasFocus) { // Remove the selection from the url text. The ending selection position // will determine the scroll position when the url field is restored. If // we do not clear this, it will scroll to the end of the text when you // enter/exit the tab stack. // We set the selection to 0 instead of removing the selection to avoid a crash that // happens if you clear the selection instead. // // Triggering the bug happens by: // 1.) Selecting some portion of the URL (where the two selection handles // appear) // 2.) Trigger a text change in the URL bar (i.e. by triggering a new URL load // by a command line intent) // 3.) Simultaneously moving one of the selection handles left and right. This will // occasionally throw an AssertionError on the bounds of the selection. Selection.setSelection(mUrlBar.getText(), 0);
void function(boolean hasFocus) { final WindowDelegate windowDelegate = getWindowDelegate(); if (!hasFocus) { Selection.setSelection(mUrlBar.getText(), 0);
/** * Handles any actions to be performed after all other actions triggered by the URL focus * change. This will be called after any animations are performed to transition from one * focus state to the other. * @param hasFocus Whether the URL field has gained focus. */
Handles any actions to be performed after all other actions triggered by the URL focus change. This will be called after any animations are performed to transition from one focus state to the other
finishUrlFocusChange
{ "repo_name": "axinging/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java", "license": "bsd-3-clause", "size": 18106 }
[ "android.text.Selection", "org.chromium.chrome.browser.WindowDelegate" ]
import android.text.Selection; import org.chromium.chrome.browser.WindowDelegate;
import android.text.*; import org.chromium.chrome.browser.*;
[ "android.text", "org.chromium.chrome" ]
android.text; org.chromium.chrome;
701,166
StreamableResource withContentType(ContentType newContentType);
StreamableResource withContentType(ContentType newContentType);
/** * Returns a new StreamableResource instance with the new content type. * * @param newContentType * @since 5.4 */
Returns a new StreamableResource instance with the new content type
withContentType
{ "repo_name": "apache/tapestry-5", "path": "tapestry-core/src/main/java/org/apache/tapestry5/services/assets/StreamableResource.java", "license": "apache-2.0", "size": 3595 }
[ "org.apache.tapestry5.http.ContentType" ]
import org.apache.tapestry5.http.ContentType;
import org.apache.tapestry5.http.*;
[ "org.apache.tapestry5" ]
org.apache.tapestry5;
947,843
public static void setFunction(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Role value) { Base.set(model, instanceResource, FUNCTION, value); }
static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Role value) { Base.set(model, instanceResource, FUNCTION, value); }
/** * Sets a value of property Function from an instance of Role First, all * existing values are removed, then this value is added. Cardinality * constraints are not checked, but this method exists only for properties * with no minCardinality or minCardinality == 1. * * @param model * an RDF2Go model * @param resource * an RDF2Go resource * @param value * the value to be added * * [Generated from RDFReactor template rule #set3static] */
Sets a value of property Function from an instance of Role First, all existing values are removed, then this value is added. Cardinality constraints are not checked, but this method exists only for properties with no minCardinality or minCardinality == 1
setFunction
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-sioc/src/main/java/org/rdfs/sioc/Thing.java", "license": "mit", "size": 317844 }
[ "org.ontoware.rdf2go.model.Model", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdf2go", "org.ontoware.rdfreactor" ]
org.ontoware.rdf2go; org.ontoware.rdfreactor;
1,083,705
private I_CmsStringModel getStringModel(CmsPathValue pathValue) { String path = pathValue.getPath(); I_CmsStringModel model = m_models.get(path); if (model == null) { String[] tokens = path.split("/"); String id = tokens[0]; String propName = tokens[1]; boolean isStructure = tokens[2].equals("S"); model = createStringModel(new CmsUUID(id), propName, isStructure); m_models.put(path, model); } return model; }
I_CmsStringModel function(CmsPathValue pathValue) { String path = pathValue.getPath(); I_CmsStringModel model = m_models.get(path); if (model == null) { String[] tokens = path.split("/"); String id = tokens[0]; String propName = tokens[1]; boolean isStructure = tokens[2].equals("S"); model = createStringModel(new CmsUUID(id), propName, isStructure); m_models.put(path, model); } return model; }
/** * Creates a string model for a given property path value, and returns the same model if the same path value is passed in.<p> * * @param pathValue the path value * * @return the model for that path value */
Creates a string model for a given property path value, and returns the same model if the same path value is passed in
getStringModel
{ "repo_name": "mediaworx/opencms-core", "path": "src-gwt/org/opencms/gwt/client/property/CmsVfsModePropertyEditor.java", "license": "lgpl-2.1", "size": 19202 }
[ "org.opencms.gwt.shared.property.CmsPathValue", "org.opencms.util.CmsUUID" ]
import org.opencms.gwt.shared.property.CmsPathValue; import org.opencms.util.CmsUUID;
import org.opencms.gwt.shared.property.*; import org.opencms.util.*;
[ "org.opencms.gwt", "org.opencms.util" ]
org.opencms.gwt; org.opencms.util;
2,522,531
public Box parseBox(DataSource byteChannel, Container parent) throws IOException { header.get().rewind().limit(8); int bytesRead = 0; while ((bytesRead += byteChannel.read(header.get())) != 8) { if (bytesRead < 0) { throw new EOFException(); } } header.get().rewind(); long size = IsoTypeReader.readUInt32(header.get()); // do plausibility check if (size < 8 && size > 1) { LOG.severe("Plausibility check failed: size < 8 (size = " + size + "). Stop parsing!"); return null; } String type = IsoTypeReader.read4cc(header.get()); //System.err.println(type); byte[] usertype = null; long contentSize; if (size == 1) { header.get().limit(16); byteChannel.read(header.get()); header.get().position(8); size = IsoTypeReader.readUInt64(header.get()); contentSize = size - 16; } else if (size == 0) { contentSize = byteChannel.size() - byteChannel.position(); size = contentSize + 8; } else { contentSize = size - 8; } if (UserBox.TYPE.equals(type)) { header.get().limit(header.get().limit() + 16); byteChannel.read(header.get()); usertype = new byte[16]; for (int i = header.get().position() - 16; i < header.get().position(); i++) { usertype[i - (header.get().position() - 16)] = header.get().get(i); } contentSize -= 16; } Box box = createBox(type, usertype, (parent instanceof Box) ? ((Box) parent).getType() : ""); box.setParent(parent); //LOG.finest("Parsing " + box.getType()); // System.out.println("parsing " + Arrays.toString(box.getType()) + " " + box.getClass().getName() + " size=" + size); header.get().rewind(); box.parse(byteChannel, header.get(), contentSize, this); return box; }
Box function(DataSource byteChannel, Container parent) throws IOException { header.get().rewind().limit(8); int bytesRead = 0; while ((bytesRead += byteChannel.read(header.get())) != 8) { if (bytesRead < 0) { throw new EOFException(); } } header.get().rewind(); long size = IsoTypeReader.readUInt32(header.get()); if (size < 8 && size > 1) { LOG.severe(STR + size + STR); return null; } String type = IsoTypeReader.read4cc(header.get()); byte[] usertype = null; long contentSize; if (size == 1) { header.get().limit(16); byteChannel.read(header.get()); header.get().position(8); size = IsoTypeReader.readUInt64(header.get()); contentSize = size - 16; } else if (size == 0) { contentSize = byteChannel.size() - byteChannel.position(); size = contentSize + 8; } else { contentSize = size - 8; } if (UserBox.TYPE.equals(type)) { header.get().limit(header.get().limit() + 16); byteChannel.read(header.get()); usertype = new byte[16]; for (int i = header.get().position() - 16; i < header.get().position(); i++) { usertype[i - (header.get().position() - 16)] = header.get().get(i); } contentSize -= 16; } Box box = createBox(type, usertype, (parent instanceof Box) ? ((Box) parent).getType() : ""); box.setParent(parent); header.get().rewind(); box.parse(byteChannel, header.get(), contentSize, this); return box; }
/** * Parses the next size and type, creates a box instance and parses the box's content. * * @param byteChannel the DataSource pointing to the ISO file * @param parent the current box's parent (null if no parent) * @return the box just parsed * @throws java.io.IOException if reading from <code>in</code> fails */
Parses the next size and type, creates a box instance and parses the box's content
parseBox
{ "repo_name": "tonyley/PlanA", "path": "AA/libs/mp4parse/src/com/coremedia/iso/AbstractBoxParser.java", "license": "apache-2.0", "size": 3861 }
[ "com.coremedia.iso.boxes.Box", "com.coremedia.iso.boxes.Container", "com.coremedia.iso.boxes.UserBox", "com.googlecode.mp4parser.DataSource", "java.io.EOFException", "java.io.IOException" ]
import com.coremedia.iso.boxes.Box; import com.coremedia.iso.boxes.Container; import com.coremedia.iso.boxes.UserBox; import com.googlecode.mp4parser.DataSource; import java.io.EOFException; import java.io.IOException;
import com.coremedia.iso.boxes.*; import com.googlecode.mp4parser.*; import java.io.*;
[ "com.coremedia.iso", "com.googlecode.mp4parser", "java.io" ]
com.coremedia.iso; com.googlecode.mp4parser; java.io;
2,697,226
public List<SpaceRow> getDirectSubSpaces(int superSpaceId) throws AdminPersistenceException { return getRows(SELECT_SUBSPACES, superSpaceId); } static final private String SELECT_SUBSPACES = "select " + SPACE_COLUMNS + " from ST_Space where domainFatherId = ? " + "and spaceStatus is null order by orderNum";
List<SpaceRow> function(int superSpaceId) throws AdminPersistenceException { return getRows(SELECT_SUBSPACES, superSpaceId); } static final private String SELECT_SUBSPACES = STR + SPACE_COLUMNS + STR + STR;
/** * Returns direct sub spaces of given space. * @param superSpaceId * @return all direct sub spaces of given space. * @throws AdminPersistenceException */
Returns direct sub spaces of given space
getDirectSubSpaces
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-library/src/main/java/org/silverpeas/core/admin/persistence/SpaceTable.java", "license": "agpl-3.0", "size": 17819 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,557,331
public final BranchGroup getBranchGroup() { return branchgrp; }
final BranchGroup function() { return branchgrp; }
/** * Liefert die BranchGroup * * @return BG */
Liefert die BranchGroup
getBranchGroup
{ "repo_name": "tsandmann/ct-sim", "path": "ctSim/model/ThreeDBot.java", "license": "gpl-2.0", "size": 28421 }
[ "javax.media.j3d.BranchGroup" ]
import javax.media.j3d.BranchGroup;
import javax.media.j3d.*;
[ "javax.media" ]
javax.media;
2,559,243
public static Iterator<String> getJoinedRooms(Connection connection, String user) { try { ArrayList<String> answer = new ArrayList<String>(); // Send the disco packet to the user DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection).discoverItems(user, discoNode); // Collect the entityID for each returned item for (Iterator<DiscoverItems.Item> items=result.getItems(); items.hasNext();) { answer.add(items.next().getEntityID()); } return answer.iterator(); } catch (XMPPException e) { e.printStackTrace(); // Return an iterator on an empty collection return new ArrayList<String>().iterator(); } }
static Iterator<String> function(Connection connection, String user) { try { ArrayList<String> answer = new ArrayList<String>(); DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection).discoverItems(user, discoNode); for (Iterator<DiscoverItems.Item> items=result.getItems(); items.hasNext();) { answer.add(items.next().getEntityID()); } return answer.iterator(); } catch (XMPPException e) { e.printStackTrace(); return new ArrayList<String>().iterator(); } }
/** * Returns an Iterator on the rooms where the requested user has joined. The Iterator will * contain Strings where each String represents a room (e.g. room@muc.jabber.org). * * @param connection the connection to use to perform the service discovery. * @param user the user to check. A fully qualified xmpp ID, e.g. jdoe@example.com. * @return an Iterator on the rooms where the requested user has joined. */
Returns an Iterator on the rooms where the requested user has joined. The Iterator will contain Strings where each String represents a room (e.g. room@muc.jabber.org)
getJoinedRooms
{ "repo_name": "luchuangbin/test1", "path": "src/org/jivesoftware/smackx/muc/MultiUserChat.java", "license": "apache-2.0", "size": 122001 }
[ "java.util.ArrayList", "java.util.Iterator", "org.jivesoftware.smack.Connection", "org.jivesoftware.smack.XMPPException", "org.jivesoftware.smackx.ServiceDiscoveryManager", "org.jivesoftware.smackx.packet.DiscoverItems" ]
import java.util.ArrayList; import java.util.Iterator; import org.jivesoftware.smack.Connection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smackx.ServiceDiscoveryManager; import org.jivesoftware.smackx.packet.DiscoverItems;
import java.util.*; import org.jivesoftware.smack.*; import org.jivesoftware.smackx.*; import org.jivesoftware.smackx.packet.*;
[ "java.util", "org.jivesoftware.smack", "org.jivesoftware.smackx" ]
java.util; org.jivesoftware.smack; org.jivesoftware.smackx;
1,366,590
private static String createFile() { final File file = new File(UtilIO.obtainTemporaryDirectory(), UtilText.concatenate("EmptyClassLoader", File.separator, "file", EmptyClassLoader.tempFileIndex++)); UtilIO.createFile(file); return UtilText.concatenate('"', file.getAbsolutePath().replace("\\", "\\\\"), '"'); } private final WeakHashMap<String, SoftReference<Class<?>>> classes; private File directory; private final JHelpJarClassLoader jarClassLoader; private final HashSet<String> onCreation; public EmptyClassLoader(final JarFile... jarsToMock) { this.jarClassLoader = new JHelpJarClassLoader(); for(final JarFile jarFile : jarsToMock) { this.jarClassLoader.add(jarFile); } this.onCreation = new HashSet<String>(); this.directory = null; this.classes = new WeakHashMap<String, SoftReference<Class<?>>>(); }
static String function() { final File file = new File(UtilIO.obtainTemporaryDirectory(), UtilText.concatenate(STR, File.separator, "file", EmptyClassLoader.tempFileIndex++)); UtilIO.createFile(file); return UtilText.concatenate('STR\\STR\\\\STR'); } private final WeakHashMap<String, SoftReference<Class<?>>> classes; private File directory; private final JHelpJarClassLoader jarClassLoader; private final HashSet<String> onCreation; public EmptyClassLoader(final JarFile... jarsToMock) { this.jarClassLoader = new JHelpJarClassLoader(); for(final JarFile jarFile : jarsToMock) { this.jarClassLoader.add(jarFile); } this.onCreation = new HashSet<String>(); this.directory = null; this.classes = new WeakHashMap<String, SoftReference<Class<?>>>(); }
/** * Create temporary file. Use for simulate reference to a valid file * * @return XML value of file name */
Create temporary file. Use for simulate reference to a valid file
createFile
{ "repo_name": "printedheart/opennars", "path": "nars_lab/src/main/java/jhelp/util/classLoader/EmptyClassLoader.java", "license": "agpl-3.0", "size": 34849 }
[ "java.io.File", "java.lang.ref.SoftReference", "java.util.HashSet", "java.util.WeakHashMap", "java.util.jar.JarFile" ]
import java.io.File; import java.lang.ref.SoftReference; import java.util.HashSet; import java.util.WeakHashMap; import java.util.jar.JarFile;
import java.io.*; import java.lang.ref.*; import java.util.*; import java.util.jar.*;
[ "java.io", "java.lang", "java.util" ]
java.io; java.lang; java.util;
2,005,916
CmsSitemapCategoryData getCategoryData(String entryPoint) throws CmsRpcException;
CmsSitemapCategoryData getCategoryData(String entryPoint) throws CmsRpcException;
/** * Gets the category data for the given entry point.<p> * * @param entryPoint the entry point * @return the category data * * @throws CmsRpcException if something goes wrong **/
Gets the category data for the given entry point
getCategoryData
{ "repo_name": "alkacon/opencms-core", "path": "src/org/opencms/ade/sitemap/shared/rpc/I_CmsSitemapService.java", "license": "lgpl-2.1", "size": 14007 }
[ "org.opencms.ade.sitemap.shared.CmsSitemapCategoryData", "org.opencms.gwt.CmsRpcException" ]
import org.opencms.ade.sitemap.shared.CmsSitemapCategoryData; import org.opencms.gwt.CmsRpcException;
import org.opencms.ade.sitemap.shared.*; import org.opencms.gwt.*;
[ "org.opencms.ade", "org.opencms.gwt" ]
org.opencms.ade; org.opencms.gwt;
1,032,852
public static void handleInternalServerError(String msg, String code, Log log, Throwable throwable) throws InternalServerErrorException { InternalServerErrorException internalServerErrorException = buildInternalServerErrorException(code); if (throwable == null) { log.error(msg); } else { log.error(msg, throwable); } throw internalServerErrorException; }
static void function(String msg, String code, Log log, Throwable throwable) throws InternalServerErrorException { InternalServerErrorException internalServerErrorException = buildInternalServerErrorException(code); if (throwable == null) { log.error(msg); } else { log.error(msg, throwable); } throw internalServerErrorException; }
/** * Logs the error, builds a internalServerErrorException with specified details and throws it * * @param msg error message * @param log Log instance * @throws InternalServerErrorException */
Logs the error, builds a internalServerErrorException with specified details and throws it
handleInternalServerError
{ "repo_name": "IsuraD/identity-governance", "path": "components/org.wso2.carbon.identity.recovery.endpoint/src/main/java/org/wso2/carbon/identity/recovery/endpoint/Utils/RecoveryUtil.java", "license": "apache-2.0", "size": 20818 }
[ "org.apache.commons.logging.Log", "org.wso2.carbon.identity.recovery.endpoint.Exceptions" ]
import org.apache.commons.logging.Log; import org.wso2.carbon.identity.recovery.endpoint.Exceptions;
import org.apache.commons.logging.*; import org.wso2.carbon.identity.recovery.endpoint.*;
[ "org.apache.commons", "org.wso2.carbon" ]
org.apache.commons; org.wso2.carbon;
2,666,685