method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public void testMultipleMembersChange() throws Exception {
// start a couple of clients and three servers
startClientVMs(2, 0, null);
startServerVMs(3, 0, null);
sqlExecuteVerify(new int[] { 1, 2 }, new int[] { 1, 2, 3 },
"select KIND, HOSTDATA, ROLES, SERVERGROUPS, ISELDER from "
... | void function() throws Exception { startClientVMs(2, 0, null); startServerVMs(3, 0, null); sqlExecuteVerify(new int[] { 1, 2 }, new int[] { 1, 2, 3 }, STR + STR, TestUtil.getResourcesDir() + STR, STR, true, false); sqlExecuteVerify(new int[] { 1, 2 }, new int[] { 1, 2, 3 }, STR + STR, TestUtil.getResourcesDir() + STR, ... | /**
* Test for multiple members coming up and down in SYS.MEMBERS
* virtual table.
*/ | Test for multiple members coming up and down in SYS.MEMBERS virtual table | testMultipleMembersChange | {
"repo_name": "papicella/snappy-store",
"path": "gemfirexd/tools/src/dunit/java/com/pivotal/gemfirexd/diag/GfxdDiagsDUnit.java",
"license": "apache-2.0",
"size": 55619
} | [
"com.pivotal.gemfirexd.TestUtil"
] | import com.pivotal.gemfirexd.TestUtil; | import com.pivotal.gemfirexd.*; | [
"com.pivotal.gemfirexd"
] | com.pivotal.gemfirexd; | 714,011 |
@SuppressWarnings("unchecked")
public static <T> T deserializeFromByteArray(Configuration conf, Class<T> expectedClass,
String className, byte[] toDeserialize, T initialState) {
log.fine("Trying to deserialize: " + className);
SerializationFactory serializationFactory = new SerializationFactory(conf);... | @SuppressWarnings(STR) static <T> T function(Configuration conf, Class<T> expectedClass, String className, byte[] toDeserialize, T initialState) { log.fine(STR + className); SerializationFactory serializationFactory = new SerializationFactory(conf); try { Class<?> deserializationClass = conf.getClassByName(className); ... | /**
* Deserialize an object from a byte array. This uses {@code conf}'s
* serialization preferences to support arbitrary serialization mechanisms
* using {@link SerializationFactory}.
*
* @param conf the configuration to use for serialization preferences
* @param expectedClass a type token to set th... | Deserialize an object from a byte array. This uses conf's serialization preferences to support arbitrary serialization mechanisms using <code>SerializationFactory</code> | deserializeFromByteArray | {
"repo_name": "bradseefeld/AppEngine-MapReduce",
"path": "src/com/google/appengine/tools/mapreduce/SerializationUtil.java",
"license": "apache-2.0",
"size": 6451
} | [
"java.io.ByteArrayInputStream",
"java.io.IOException",
"java.io.UnsupportedEncodingException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.io.serializer.Deserializer",
"org.apache.hadoop.io.serializer.SerializationFactory"
] | import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.serializer.Deserializer; import org.apache.hadoop.io.serializer.SerializationFactory; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.io.serializer.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,921,123 |
@Deprecated
public static User createRandomUser(boolean isManager, boolean managerConfirmationRequired,
String externalSystemId) throws TestUtilsException {
UserRole[] roles = isManager
? new UserRole[] { UserRole.ROLE_KENMEI_USER, UserRole.ROLE_KENMEI_CLIENT_MANAGER }
... | static User function(boolean isManager, boolean managerConfirmationRequired, String externalSystemId) throws TestUtilsException { UserRole[] roles = isManager ? new UserRole[] { UserRole.ROLE_KENMEI_USER, UserRole.ROLE_KENMEI_CLIENT_MANAGER } : new UserRole[] { UserRole.ROLE_KENMEI_USER }; return createRandomUser(manag... | /**
* Creates a new random user.
*
* @param isManager
* True, if this user should be a manager.
* @param managerConfirmationRequired
* True, if the manager has to confirm the user creation.
* @param externalSystemId
* Id of the external sy... | Creates a new random user | createRandomUser | {
"repo_name": "Communote/communote-server",
"path": "communote/tests/all-versions/integration/src/main/java/com/communote/server/test/util/TestUtils.java",
"license": "apache-2.0",
"size": 37663
} | [
"com.communote.server.model.user.User",
"com.communote.server.model.user.UserRole"
] | import com.communote.server.model.user.User; import com.communote.server.model.user.UserRole; | import com.communote.server.model.user.*; | [
"com.communote.server"
] | com.communote.server; | 2,048,838 |
public static FormData buildXform(Form form, XformCustomizer customizer) throws Exception {
if (customizer == null) {
customizer = new XformCustomizer();
}
return new BuendiaXformBuilderEx(customizer).buildXformImpl(form);
}
private BuendiaXformBuilderEx(XformCustomizer ... | static FormData function(Form form, XformCustomizer customizer) throws Exception { if (customizer == null) { customizer = new XformCustomizer(); } return new BuendiaXformBuilderEx(customizer).buildXformImpl(form); } private BuendiaXformBuilderEx(XformCustomizer customizer) { useConceptIdAsHint = "true".equalsIgnoreCase... | /**
* Builds an xform for an given an openmrs form. This is the only
* public member in the class; it constructs an instance (to avoid
* nasty statics) and then invokes private methods appropriately.
*/ | Builds an xform for an given an openmrs form. This is the only public member in the class; it constructs an instance (to avoid nasty statics) and then invokes private methods appropriately | buildXform | {
"repo_name": "viniciusboson/buendia",
"path": "third_party/openmrs-module-xforms/api/src/main/java/org/openmrs/module/xforms/buendia/BuendiaXformBuilderEx.java",
"license": "apache-2.0",
"size": 30330
} | [
"org.openmrs.Form",
"org.openmrs.api.context.Context"
] | import org.openmrs.Form; import org.openmrs.api.context.Context; | import org.openmrs.*; import org.openmrs.api.context.*; | [
"org.openmrs",
"org.openmrs.api"
] | org.openmrs; org.openmrs.api; | 2,000,193 |
@FIXVersion(introduced="5.0SP2")
@TagNumRef(tagNum=TagNum.RefOrderID)
public void setRefOrderID(String refOrderID) {
this.refOrderID = refOrderID;
} | @FIXVersion(introduced=STR) @TagNumRef(tagNum=TagNum.RefOrderID) void function(String refOrderID) { this.refOrderID = refOrderID; } | /**
* Message field setter.
* @param refOrderID field value
*/ | Message field setter | setRefOrderID | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/comp/TradeReportOrderDetail.java",
"license": "gpl-3.0",
"size": 31528
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 2,893,392 |
public void setOrigin(ICell<StateType> origin) {
originCell = origin;
} | void function(ICell<StateType> origin) { originCell = origin; } | /**
* Change the origin of the space. <b>BE CAREFUL :</b> the complete space
* can be changed with this way, especially if you give a cell which is not
* accessible in the current space. All the space works on this origin.
*/ | Change the origin of the space. BE CAREFUL : the complete space can be changed with this way, especially if you give a cell which is not accessible in the current space. All the space works on this origin | setOrigin | {
"repo_name": "matthieu-vergne/Cellular-Automaton",
"path": "cellularautomaton-core/src/main/java/org/cellularautomaton/space/GenericSpace.java",
"license": "bsd-3-clause",
"size": 4274
} | [
"org.cellularautomaton.cell.ICell"
] | import org.cellularautomaton.cell.ICell; | import org.cellularautomaton.cell.*; | [
"org.cellularautomaton.cell"
] | org.cellularautomaton.cell; | 110,724 |
try{
TFramedTransport tf = new TFramedTransport(tr);
TProtocol proto = new TBinaryProtocol(tf);
Cassandra.Client client = new Cassandra.Client(proto);
tr.open();
client.set_keyspace(KEYSPACE);
return client;
}catch(Exception e) {
e.printStackTrace();
}
return null;
}
| try{ TFramedTransport tf = new TFramedTransport(tr); TProtocol proto = new TBinaryProtocol(tf); Cassandra.Client client = new Cassandra.Client(proto); tr.open(); client.set_keyspace(KEYSPACE); return client; }catch(Exception e) { e.printStackTrace(); } return null; } | /**
* Connect cassandra and open Transport variable(tr)
*/ | Connect cassandra and open Transport variable(tr) | connect | {
"repo_name": "YinYanfei/CadalWorkspace",
"path": "StormLogQue/src/cn/cadal/storm/analyze/cassandra/Util/Connector.java",
"license": "gpl-3.0",
"size": 1167
} | [
"org.apache.cassandra.thrift.Cassandra",
"org.apache.thrift.protocol.TBinaryProtocol",
"org.apache.thrift.protocol.TProtocol",
"org.apache.thrift.transport.TFramedTransport"
] | import org.apache.cassandra.thrift.Cassandra; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TFramedTransport; | import org.apache.cassandra.thrift.*; import org.apache.thrift.protocol.*; import org.apache.thrift.transport.*; | [
"org.apache.cassandra",
"org.apache.thrift"
] | org.apache.cassandra; org.apache.thrift; | 817,658 |
public Map<String, String> tags() {
return this.tags;
} | Map<String, String> function() { return this.tags; } | /**
* Get resource tags.
*
* @return the tags value
*/ | Get resource tags | tags | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/loganalytics/mgmt-v2020_08_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_08_01/implementation/DataSourceInner.java",
"license": "mit",
"size": 5653
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,076,737 |
@Path("client-session-stats")
@GET
@NoCache
@Produces(MediaType.APPLICATION_JSON)
public List<Map<String, String>> getClientSessionStats() {
auth.requireView();
List<Map<String, String>> data = new LinkedList<Map<String, String>>();
for (ClientModel client : realm.getClients(... | @Path(STR) @Produces(MediaType.APPLICATION_JSON) List<Map<String, String>> function() { auth.requireView(); List<Map<String, String>> data = new LinkedList<Map<String, String>>(); for (ClientModel client : realm.getClients()) { int size = session.sessions().getActiveUserSessions(client.getRealm(), client); if (size == ... | /**
* Get client session stats
*
* Returns a JSON map. The key is the client id, the value is the number of sessions that currently are active
* with that client. Only clients that actually have a session associated with them will be in this map.
*
* @return
*/ | Get client session stats Returns a JSON map. The key is the client id, the value is the number of sessions that currently are active with that client. Only clients that actually have a session associated with them will be in this map | getClientSessionStats | {
"repo_name": "gregjones60/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java",
"license": "apache-2.0",
"size": 24693
} | [
"java.util.HashMap",
"java.util.LinkedList",
"java.util.List",
"java.util.Map",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"org.keycloak.models.ClientModel"
] | import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.keycloak.models.ClientModel; | import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.keycloak.models.*; | [
"java.util",
"javax.ws",
"org.keycloak.models"
] | java.util; javax.ws; org.keycloak.models; | 725,236 |
public void onCreate(@Nullable Bundle savedInstanceState) {
showsBottomSheet = AccessFragmentInternals.getContainerId(fragment) == 0;
if (savedInstanceState != null) {
showsBottomSheet = savedInstanceState.getBoolean(SAVED_SHOWS_BOTTOM_SHEET, showsBottomSheet);
backStackId =... | void function(@Nullable Bundle savedInstanceState) { showsBottomSheet = AccessFragmentInternals.getContainerId(fragment) == 0; if (savedInstanceState != null) { showsBottomSheet = savedInstanceState.getBoolean(SAVED_SHOWS_BOTTOM_SHEET, showsBottomSheet); backStackId = savedInstanceState.getInt(SAVED_BACK_STACK_ID, -1);... | /**
* Corresponding onCreate() method
*
* @param savedInstanceState Instance state, can be null.
*/ | Corresponding onCreate() method | onCreate | {
"repo_name": "bernaferrari/bottomsheet",
"path": "bottomsheet-commons/src/main/java/com/flipboard/bottomsheet/commons/BottomSheetFragmentDelegate.java",
"license": "bsd-3-clause",
"size": 10774
} | [
"android.os.Bundle",
"android.support.annotation.Nullable",
"android.support.v4.app.AccessFragmentInternals",
"android.view.View"
] | import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.AccessFragmentInternals; import android.view.View; | import android.os.*; import android.support.annotation.*; import android.support.v4.app.*; import android.view.*; | [
"android.os",
"android.support",
"android.view"
] | android.os; android.support; android.view; | 4,939 |
public static java.util.List extractProtocolDiscriminatorList(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.ProtocolDiscriminatorForTriageVoCollection voCollection)
{
return extractProtocolDiscriminatorList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.ProtocolDiscriminatorForTriageVoCollection voCollection) { return extractProtocolDiscriminatorList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.emergency.configuration.domain.objects.ProtocolDiscriminator list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.emergency.configuration.domain.objects.ProtocolDiscriminator list from the value object collection | extractProtocolDiscriminatorList | {
"repo_name": "openhealthcare/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/ProtocolDiscriminatorForTriageVoAssembler.java",
"license": "agpl-3.0",
"size": 17999
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,222,252 |
public IPredefinedStyle getPredefinedStyle( String name )
{
if ( StringUtil.isBlank( name ) )
return null;
String key = name.toLowerCase( );
return predefinedStyles.get( key );
} | IPredefinedStyle function( String name ) { if ( StringUtil.isBlank( name ) ) return null; String key = name.toLowerCase( ); return predefinedStyles.get( key ); } | /**
* Finds a predefined style definition.
*
* @param name
* the internal name of the predefined style
* @return the predefined style, or null if the style is not defined
*/ | Finds a predefined style definition | getPredefinedStyle | {
"repo_name": "Charling-Huang/birt",
"path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/metadata/MetaDataDictionary.java",
"license": "epl-1.0",
"size": 35900
} | [
"org.eclipse.birt.report.model.api.metadata.IPredefinedStyle",
"org.eclipse.birt.report.model.api.util.StringUtil"
] | import org.eclipse.birt.report.model.api.metadata.IPredefinedStyle; import org.eclipse.birt.report.model.api.util.StringUtil; | import org.eclipse.birt.report.model.api.metadata.*; import org.eclipse.birt.report.model.api.util.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 394,746 |
@Benchmark
public void walk_filterCallerClass(Blackhole bh) {
final Blackhole localBH = bh;
final boolean[] done = {false}; | void function(Blackhole bh) { final Blackhole localBH = bh; final boolean[] done = {false}; | /**
* Use StackWalker.walk() to filter the StackFrames, looking for the
* TestMarker class, which will be (approximately) 'mark' calls back up the
* call stack.
*/ | Use StackWalker.walk() to filter the StackFrames, looking for the TestMarker class, which will be (approximately) 'mark' calls back up the call stack | walk_filterCallerClass | {
"repo_name": "md-5/jdk10",
"path": "test/micro/org/openjdk/bench/java/lang/StackWalkBench.java",
"license": "gpl-2.0",
"size": 11165
} | [
"org.openjdk.jmh.infra.Blackhole"
] | import org.openjdk.jmh.infra.Blackhole; | import org.openjdk.jmh.infra.*; | [
"org.openjdk.jmh"
] | org.openjdk.jmh; | 464,631 |
public PrePersist<T> removeDescription()
{
childNode.removeChildren("description");
return this;
}
// --------------------------------------------------------------------------------------------------------||
// ClassName: PrePersist ElementName: xsd:string ElementType : method-name
// ... | PrePersist<T> function() { childNode.removeChildren(STR); return this; } | /**
* Removes the <code>description</code> element
* @return the current instance of <code>PrePersist<T></code>
*/ | Removes the <code>description</code> element | removeDescription | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm21/PrePersistImpl.java",
"license": "epl-1.0",
"size": 3774
} | [
"org.jboss.shrinkwrap.descriptor.api.orm21.PrePersist"
] | import org.jboss.shrinkwrap.descriptor.api.orm21.PrePersist; | import org.jboss.shrinkwrap.descriptor.api.orm21.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 1,631,348 |
public void testGetFirstMillisecond() {
Locale saved = Locale.getDefault();
Locale.setDefault(Locale.UK);
TimeZone savedZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("Europe/London"));
Second s = new Second(15, 43, 15, 1, 4, 2006);
assertEqual... | void function() { Locale saved = Locale.getDefault(); Locale.setDefault(Locale.UK); TimeZone savedZone = TimeZone.getDefault(); TimeZone.setDefault(TimeZone.getTimeZone(STR)); Second s = new Second(15, 43, 15, 1, 4, 2006); assertEquals(1143902595000L, s.getFirstMillisecond()); Locale.setDefault(saved); TimeZone.setDefa... | /**
* Some checks for the getFirstMillisecond() method.
*/ | Some checks for the getFirstMillisecond() method | testGetFirstMillisecond | {
"repo_name": "integrated/jfreechart",
"path": "tests/org/jfree/data/time/junit/SecondTests.java",
"license": "lgpl-2.1",
"size": 11604
} | [
"java.util.Locale",
"java.util.TimeZone",
"org.jfree.data.time.Second"
] | import java.util.Locale; import java.util.TimeZone; import org.jfree.data.time.Second; | import java.util.*; import org.jfree.data.time.*; | [
"java.util",
"org.jfree.data"
] | java.util; org.jfree.data; | 466,919 |
public static long dirSize(Path path) throws IgniteCheckedException {
final AtomicLong s = new AtomicLong(0); | static long function(Path path) throws IgniteCheckedException { final AtomicLong s = new AtomicLong(0); | /**
* Will calculate the size of a directory.
*
* If there is concurrent activity in the directory, than returned value may be wrong.
*/ | Will calculate the size of a directory. If there is concurrent activity in the directory, than returned value may be wrong | dirSize | {
"repo_name": "WilliamDo/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 325083
} | [
"java.nio.file.Path",
"java.util.concurrent.atomic.AtomicLong",
"org.apache.ignite.IgniteCheckedException"
] | import java.nio.file.Path; import java.util.concurrent.atomic.AtomicLong; import org.apache.ignite.IgniteCheckedException; | import java.nio.file.*; import java.util.concurrent.atomic.*; import org.apache.ignite.*; | [
"java.nio",
"java.util",
"org.apache.ignite"
] | java.nio; java.util; org.apache.ignite; | 1,202,809 |
private void list_friend () throws NetworkException
{
SocialResponseList response = ccm.get_friend_list ( auth_token );
List <String> usernames = response.get_list ();
List <String> status = response.get_status ();
UserChoice r = gui.show_friend_list ( usernames, status );
if ( r.get_choice () == Choice.F... | void function () throws NetworkException { SocialResponseList response = ccm.get_friend_list ( auth_token ); List <String> usernames = response.get_list (); List <String> status = response.get_status (); UserChoice r = gui.show_friend_list ( usernames, status ); if ( r.get_choice () == Choice.FOLLOW ) { ccm.send_follow... | /**
*
* sends a request to the server to get the friend list, then ask the user if he wants to follow someone.
* If so, send the appropriate request to the server
*
* @throws NetworkException if there was a server or network error
*
* */ | sends a request to the server to get the friend list, then ask the user if he wants to follow someone. If so, send the appropriate request to the server | list_friend | {
"repo_name": "melfnt/SimpleSocial",
"path": "SocialClient/SocialClient.java",
"license": "gpl-3.0",
"size": 7634
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,108,564 |
void copy(ByteBase src, int dstOffset, int length) {
if (src.size != -1 && src.size < length) {
// awt.30=wrong number of elements to copy: {0}, size: {1}
throw new IndexOutOfBoundsException(Messages.getString("awt.30", length, src.size)); //$NON-NLS-1$
}
if (size != ... | void copy(ByteBase src, int dstOffset, int length) { if (src.size != -1 && src.size < length) { throw new IndexOutOfBoundsException(Messages.getString(STR, length, src.size)); } if (size != -1 && size - dstOffset < length) { throw new IndexOutOfBoundsException(Messages.getString(STR, length, src.size)); } byte[] tmp = ... | /**
* Copies <code>length</code> bytes from src byteBase to this byteBase.
* Offset in destination base is dstOffset. Starting offset in src base
* is always 0;
*
* @param src source byte base
* @param dstOffset destination
* @param length
*/ | Copies <code>length</code> bytes from src byteBase to this byteBase. Offset in destination base is dstOffset. Starting offset in src base is always 0 | copy | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/awt/src/main/java/common/org/apache/harmony/awt/nativebridge/ByteBase.java",
"license": "apache-2.0",
"size": 41389
} | [
"org.apache.harmony.awt.internal.nls.Messages"
] | import org.apache.harmony.awt.internal.nls.Messages; | import org.apache.harmony.awt.internal.nls.*; | [
"org.apache.harmony"
] | org.apache.harmony; | 88,898 |
private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
try {
return Utils.getUGI();
} catch (Exception e) {
throw new HiveSQLException("Unable to get current user", e);
}
} | UserGroupInformation function(HiveConf opConfig) throws HiveSQLException { try { return Utils.getUGI(); } catch (Exception e) { throw new HiveSQLException(STR, e); } } | /**
* Returns the current UGI on the stack
* @param opConfig
* @return UserGroupInformation
* @throws HiveSQLException
*/ | Returns the current UGI on the stack | getCurrentUGI | {
"repo_name": "cschenyuan/hive-hack",
"path": "service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java",
"license": "apache-2.0",
"size": 17227
} | [
"org.apache.hadoop.hive.conf.HiveConf",
"org.apache.hadoop.hive.shims.Utils",
"org.apache.hadoop.security.UserGroupInformation",
"org.apache.hive.service.cli.HiveSQLException"
] | import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.shims.Utils; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hive.service.cli.HiveSQLException; | import org.apache.hadoop.hive.conf.*; import org.apache.hadoop.hive.shims.*; import org.apache.hadoop.security.*; import org.apache.hive.service.cli.*; | [
"org.apache.hadoop",
"org.apache.hive"
] | org.apache.hadoop; org.apache.hive; | 1,653,500 |
public void addAsPreferenceGroup(PolicyType policy) {
Object pref = getPreferenceGroupPolicy(policy.getPolicyId());
if (pref != null) {
// the name is already used
this.deletePreferenceGroup(policy.getPolicyId());
}
this.persistObject(policy);
} | void function(PolicyType policy) { Object pref = getPreferenceGroupPolicy(policy.getPolicyId()); if (pref != null) { this.deletePreferenceGroup(policy.getPolicyId()); } this.persistObject(policy); } | /**
* Adds a preference group. If the id is already used, it deletes the old
* preference group first.
*
* @param policy
* - a detached policy
*/ | Adds a preference group. If the id is already used, it deletes the old preference group first | addAsPreferenceGroup | {
"repo_name": "fdicerbo/fiware-ppl",
"path": "ppl-engine-core/src/main/java/com/sap/research/primelife/dao/PolicyDao.java",
"license": "bsd-3-clause",
"size": 17136
} | [
"eu.primelife.ppl.policy.impl.PolicyType"
] | import eu.primelife.ppl.policy.impl.PolicyType; | import eu.primelife.ppl.policy.impl.*; | [
"eu.primelife.ppl"
] | eu.primelife.ppl; | 1,732,604 |
@NotNull
GitFetchResult fetch(@NotNull Collection<GitRepository> repositories); | GitFetchResult fetch(@NotNull Collection<GitRepository> repositories); | /**
* For each given repository, fetches the "default" remote.
* The latter is identified by {@link #getDefaultRemoteToFetch}.
*/ | For each given repository, fetches the "default" remote. The latter is identified by <code>#getDefaultRemoteToFetch</code> | fetch | {
"repo_name": "mdanielwork/intellij-community",
"path": "plugins/git4idea/src/git4idea/fetch/GitFetchSupport.java",
"license": "apache-2.0",
"size": 1985
} | [
"java.util.Collection",
"org.jetbrains.annotations.NotNull"
] | import java.util.Collection; import org.jetbrains.annotations.NotNull; | import java.util.*; import org.jetbrains.annotations.*; | [
"java.util",
"org.jetbrains.annotations"
] | java.util; org.jetbrains.annotations; | 776,529 |
private static IExpr continuedFractionReduce(IAST continuedFractionList, EvalEngine engine) {
try {
int size = continuedFractionList.argSize();
if (continuedFractionList.forAll(x -> x.isReal())) {
IExpr result = continuedFractionList.get(size--);
for (int i = size; i >= 1; ... | static IExpr function(IAST continuedFractionList, EvalEngine engine) { try { int size = continuedFractionList.argSize(); if (continuedFractionList.forAll(x -> x.isReal())) { IExpr result = continuedFractionList.get(size--); for (int i = size; i >= 1; i--) { result = continuedFractionList.get(i).plus(result.power(-1)); ... | /**
* Reduce a continued fraction to a rational or quadratic irrational.
*
* <p>
* Compute the rational or quadratic irrational number from its terminating or periodic
* continued fraction expansion.
*
* @param continuedFractionList the list of integers
* @param engine
* @re... | Reduce a continued fraction to a rational or quadratic irrational. Compute the rational or quadratic irrational number from its terminating or periodic continued fraction expansion | continuedFractionReduce | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/builtin/NumberTheory.java",
"license": "gpl-3.0",
"size": 156286
} | [
"org.matheclipse.core.eval.EvalEngine",
"org.matheclipse.core.eval.exception.ValidateException",
"org.matheclipse.core.expression.F",
"org.matheclipse.core.interfaces.IExpr"
] | import org.matheclipse.core.eval.EvalEngine; import org.matheclipse.core.eval.exception.ValidateException; import org.matheclipse.core.expression.F; import org.matheclipse.core.interfaces.IExpr; | import org.matheclipse.core.eval.*; import org.matheclipse.core.eval.exception.*; import org.matheclipse.core.expression.*; import org.matheclipse.core.interfaces.*; | [
"org.matheclipse.core"
] | org.matheclipse.core; | 804,623 |
public void setDateTimeCallbackPeriod(long period) throws TimeoutException, NotConnectedException {
byte options = 0;
boolean isResponseExpected = getResponseExpected(FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD);
if(isResponseExpected) {
options = 8;
}
ByteBuffer bb = ipcon.createRequestBuffer(uid, (byte)12,... | void function(long period) throws TimeoutException, NotConnectedException { byte options = 0; boolean isResponseExpected = getResponseExpected(FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD); if(isResponseExpected) { options = 8; } ByteBuffer bb = ipcon.createRequestBuffer(uid, (byte)12, FUNCTION_SET_DATE_TIME_CALLBACK_PERIOD,... | /**
* Sets the period in ms with which the {@link com.tinkerforge.BrickletGPS.DateTimeListener} listener is triggered
* periodically. A value of 0 turns the listener off.
*
* {@link com.tinkerforge.BrickletGPS.DateTimeListener} is only triggered if the date or time changed since the
* last triggering.
*
... | Sets the period in ms with which the <code>com.tinkerforge.BrickletGPS.DateTimeListener</code> listener is triggered periodically. A value of 0 turns the listener off. <code>com.tinkerforge.BrickletGPS.DateTimeListener</code> is only triggered if the date or time changed since the last triggering. The default value is ... | setDateTimeCallbackPeriod | {
"repo_name": "ezeeb/pipes-tinkerforge",
"path": "src/main/java/com/tinkerforge/BrickletGPS.java",
"license": "apache-2.0",
"size": 30755
} | [
"java.nio.ByteBuffer",
"java.nio.ByteOrder"
] | import java.nio.ByteBuffer; import java.nio.ByteOrder; | import java.nio.*; | [
"java.nio"
] | java.nio; | 176,066 |
public void setMonitoringService(com.google.container.v1.SetMonitoringServiceRequest request,
io.grpc.stub.StreamObserver<com.google.container.v1.Operation> responseObserver) {
asyncUnaryCall(
getChannel().newCall(getSetMonitoringServiceMethodHelper(), getCallOptions()), request, responseObs... | void function(com.google.container.v1.SetMonitoringServiceRequest request, io.grpc.stub.StreamObserver<com.google.container.v1.Operation> responseObserver) { asyncUnaryCall( getChannel().newCall(getSetMonitoringServiceMethodHelper(), getCallOptions()), request, responseObserver); } | /**
* <pre>
* Sets the monitoring service of a specific cluster.
* </pre>
*/ | <code> Sets the monitoring service of a specific cluster. </code> | setMonitoringService | {
"repo_name": "pongad/api-client-staging",
"path": "generated/java/grpc-google-cloud-container-v1/src/main/java/com/google/container/v1/ClusterManagerGrpc.java",
"license": "bsd-3-clause",
"size": 147597
} | [
"io.grpc.stub.ClientCalls",
"io.grpc.stub.ServerCalls"
] | import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 2,509,904 |
private void insertData() {
fatherEntity = factory.manufacturePojo(ClientEntity.class);
fatherEntity.setId(1L);
em.persist(fatherEntity);
for (int i = 0; i < 3; i++) {
PaymentEntity entity = factory.manufacturePojo(PaymentEntity.class);
entity.setClient(... | void function() { fatherEntity = factory.manufacturePojo(ClientEntity.class); fatherEntity.setId(1L); em.persist(fatherEntity); for (int i = 0; i < 3; i++) { PaymentEntity entity = factory.manufacturePojo(PaymentEntity.class); entity.setClient(fatherEntity); entity.setItems(itemData); em.persist(entity); data.add(entit... | /**
* Inserta los datos iniciales para el correcto funcionamiento de las pruebas.
*
* @generated
*/ | Inserta los datos iniciales para el correcto funcionamiento de las pruebas | insertData | {
"repo_name": "Uniandes-MISO4203/artwork-201620-1",
"path": "artwork-logic/src/test/java/co/edu/uniandes/csw/artwork/test/logic/PaymentLogicTest.java",
"license": "mit",
"size": 8572
} | [
"co.edu.uniandes.csw.artwork.entities.ClientEntity",
"co.edu.uniandes.csw.artwork.entities.PaymentEntity"
] | import co.edu.uniandes.csw.artwork.entities.ClientEntity; import co.edu.uniandes.csw.artwork.entities.PaymentEntity; | import co.edu.uniandes.csw.artwork.entities.*; | [
"co.edu.uniandes"
] | co.edu.uniandes; | 2,538,370 |
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
} | Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } | /**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/ | Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods | applyToAllUnaryMethods | {
"repo_name": "googleapis/java-gke-connect-gateway",
"path": "google-cloud-gke-connect-gateway/src/main/java/com/google/cloud/gkeconnect/gateway/v1beta1/GatewayServiceSettings.java",
"license": "apache-2.0",
"size": 8867
} | [
"com.google.api.core.ApiFunction",
"com.google.api.gax.rpc.UnaryCallSettings"
] | import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings; | import com.google.api.core.*; import com.google.api.gax.rpc.*; | [
"com.google.api"
] | com.google.api; | 2,790,933 |
public void testClose() {
// Set up.
SongDataSource songs = new SongDataSource(getContext());
songs.open();
// Test.
songs.close();
Assert.assertFalse(songs.isOpened());
// Tear down.
}
| void function() { SongDataSource songs = new SongDataSource(getContext()); songs.open(); songs.close(); Assert.assertFalse(songs.isOpened()); } | /**
* Tests if it's possible to close the database connection.
*/ | Tests if it's possible to close the database connection | testClose | {
"repo_name": "KVHC/adrumdrum",
"path": "test/ADrumDrumTest/src/kvhc/adrumdrum/test/SongDataSourceTest.java",
"license": "gpl-3.0",
"size": 5020
} | [
"junit.framework.Assert"
] | import junit.framework.Assert; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 2,743,670 |
if (null == toBeConvertedValue){
return null;
}
//---------------------------------------------------------------
//CharSequence
//since 1.14.0
if (ClassUtil.isInstance(toBeConvertedValue, CharSequence.class)){
return ((CharSequence) toBeConvertedValue).t... | if (null == toBeConvertedValue){ return null; } if (ClassUtil.isInstance(toBeConvertedValue, CharSequence.class)){ return ((CharSequence) toBeConvertedValue).toString(); } if (com.feilong.core.lang.ObjectUtil.isArray(toBeConvertedValue)){ return ConvertUtil.toString((Object[]) toBeConvertedValue, DEFAULT_CONNECTOR); } ... | /**
* To string value.
*
* @param toBeConvertedValue
* the value
* @return 如果 <code>toBeConvertedValue</code> 是null,返回 null<br>
* 如果 <code>toBeConvertedValue</code> 是 {@link CharSequence},直接 toString返回<br>
* 如果 <code>toBeConvertedValue</code> 是 数组,那么调用 {@lin... | To string value | toStringValue | {
"repo_name": "venusdrogon/feilong-core",
"path": "src/main/java/com/feilong/core/bean/ToStringHandler.java",
"license": "apache-2.0",
"size": 5149
} | [
"com.feilong.core.bean.ConvertUtil",
"com.feilong.core.lang.ClassUtil",
"java.math.BigDecimal",
"java.util.Calendar",
"java.util.Collection",
"java.util.Date"
] | import com.feilong.core.bean.ConvertUtil; import com.feilong.core.lang.ClassUtil; import java.math.BigDecimal; import java.util.Calendar; import java.util.Collection; import java.util.Date; | import com.feilong.core.bean.*; import com.feilong.core.lang.*; import java.math.*; import java.util.*; | [
"com.feilong.core",
"java.math",
"java.util"
] | com.feilong.core; java.math; java.util; | 1,762,947 |
public TemporalMatch getMatch() {
try {
return temporalMatchHistory.getFirst();
} catch (NoSuchElementException e) {
return null;
}
}
| TemporalMatch function() { try { return temporalMatchHistory.getFirst(); } catch (NoSuchElementException e) { return null; } } | /**
* Returns the last temporal match. Returns null if there isn't one.
* @return
*/ | Returns the last temporal match. Returns null if there isn't one | getMatch | {
"repo_name": "scrudden/core",
"path": "transitime/src/main/java/org/transitime/core/VehicleState.java",
"license": "gpl-3.0",
"size": 33254
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 1,082,908 |
void doImportCheckpoint() throws IOException {
FSNamesystem fsNamesys = getFSNamesystem();
FSImage ckptImage = new FSImage(fsNamesys);
// replace real image with the checkpoint image
FSImage realImage = fsNamesys.getFSImage();
assert realImage == this;
fsNamesys.dir.fsImage = ckptImage;
//... | void doImportCheckpoint() throws IOException { FSNamesystem fsNamesys = getFSNamesystem(); FSImage ckptImage = new FSImage(fsNamesys); FSImage realImage = fsNamesys.getFSImage(); assert realImage == this; fsNamesys.dir.fsImage = ckptImage; try { ckptImage.recoverTransitionRead(checkpointDirs, checkpointEditsDirs, Start... | /**
* Load image from a checkpoint directory and save it into the current one.
* @throws IOException
*/ | Load image from a checkpoint directory and save it into the current one | doImportCheckpoint | {
"repo_name": "toddlipcon/hadoop",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java",
"license": "apache-2.0",
"size": 67265
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.server.common.HdfsConstants"
] | import java.io.IOException; import org.apache.hadoop.hdfs.server.common.HdfsConstants; | import java.io.*; import org.apache.hadoop.hdfs.server.common.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 852,830 |
public static void doUpgrade(StorageDirectory sd, Storage storage)
throws IOException {
LOG.info("Performing upgrade of storage directory " + sd.getRoot());
try {
// Write the version file, since saveFsImage only makes the
// fsimage_<txid>, and the directory is otherwise empty.
storag... | static void function(StorageDirectory sd, Storage storage) throws IOException { LOG.info(STR + sd.getRoot()); try { storage.writeProperties(sd); File prevDir = sd.getPreviousDir(); File tmpDir = sd.getPreviousTmp(); Preconditions.checkState(!prevDir.exists(), STR); Preconditions.checkState(tmpDir.exists(), STR); NNStor... | /**
* Perform the upgrade of the storage dir to the given storage info. The new
* storage info is written into the current directory, and the previous.tmp
* directory is renamed to previous.
*
* @param sd the storage directory to upgrade
* @param storage info about the new upgraded versions.
* @th... | Perform the upgrade of the storage dir to the given storage info. The new storage info is written into the current directory, and the previous.tmp directory is renamed to previous | doUpgrade | {
"repo_name": "MeiSheng/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNUpgradeUtil.java",
"license": "apache-2.0",
"size": 8557
} | [
"com.google.common.base.Preconditions",
"java.io.File",
"java.io.IOException",
"org.apache.hadoop.hdfs.server.common.Storage"
] | import com.google.common.base.Preconditions; import java.io.File; import java.io.IOException; import org.apache.hadoop.hdfs.server.common.Storage; | import com.google.common.base.*; import java.io.*; import org.apache.hadoop.hdfs.server.common.*; | [
"com.google.common",
"java.io",
"org.apache.hadoop"
] | com.google.common; java.io; org.apache.hadoop; | 352,685 |
String result = null;
try {
AuthenticationSuccessResponse oidcResponse = (AuthenticationSuccessResponse) AuthenticationResponseParser
.parse(new URI(fullUrl));
AuthenticationResult authResult = getAccessToken(oidcResponse.getAuthorizationCode(), currentUri);
result = convertToJson(authResult);
} cat... | String result = null; try { AuthenticationSuccessResponse oidcResponse = (AuthenticationSuccessResponse) AuthenticationResponseParser .parse(new URI(fullUrl)); AuthenticationResult authResult = getAccessToken(oidcResponse.getAuthorizationCode(), currentUri); result = convertToJson(authResult); } catch (Exception ex) { ... | /**
* This method is called after the successful logon and redirect from WAAD
* this will return both an accessToken and a refreshToken as well as an
* expire time
*
* @param fullUrl
* @param currentUri
* @return
* @throws Throwable
*/ | This method is called after the successful logon and redirect from WAAD this will return both an accessToken and a refreshToken as well as an expire time | getAccessTokenFromURL | {
"repo_name": "tylerm007/waad-sso",
"path": "src/main/java/com/espressologic/waad/authentication/WaadAuthentication.java",
"license": "gpl-2.0",
"size": 12180
} | [
"com.microsoft.aad.adal4j.AuthenticationResult",
"com.nimbusds.openid.connect.sdk.AuthenticationResponseParser",
"com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse"
] | import com.microsoft.aad.adal4j.AuthenticationResult; import com.nimbusds.openid.connect.sdk.AuthenticationResponseParser; import com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse; | import com.microsoft.aad.adal4j.*; import com.nimbusds.openid.connect.sdk.*; | [
"com.microsoft.aad",
"com.nimbusds.openid"
] | com.microsoft.aad; com.nimbusds.openid; | 1,267,666 |
public static String getTagName(DetailNode javadocTagSection) {
String javadocTagName;
if (javadocTagSection.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG) {
javadocTagName = getNextSibling(
getFirstChild(javadocTagSection)).getText();
}
else {
... | static String function(DetailNode javadocTagSection) { String javadocTagName; if (javadocTagSection.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG) { javadocTagName = getNextSibling( getFirstChild(javadocTagSection)).getText(); } else { javadocTagName = getFirstChild(javadocTagSection).getText(); } return javadocTag... | /**
* Gets tag name from javadocTagSection.
*
* @param javadocTagSection to get tag name from.
* @return name, of the javadocTagSection's tag.
*/ | Gets tag name from javadocTagSection | getTagName | {
"repo_name": "gallandarakhneorg/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtils.java",
"license": "lgpl-2.1",
"size": 15258
} | [
"com.puppycrawl.tools.checkstyle.api.DetailNode",
"com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes"
] | import com.puppycrawl.tools.checkstyle.api.DetailNode; import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; | import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 2,395,557 |
public void jobStateUpdated(String owner, NotificationData<JobInfo> notification); | void function(String owner, NotificationData<JobInfo> notification); | /**
* Invoked each time the state of a job has changed.<br>
* In this case you can use the {@link org.ow2.proactive.scheduler.common.job.JobState#update(org.ow2.proactive.scheduler.common.job.JobInfo)} method to update the content of your job.
*
* @param owner the owner of this job
* @param not... | Invoked each time the state of a job has changed. In this case you can use the <code>org.ow2.proactive.scheduler.common.job.JobState#update(org.ow2.proactive.scheduler.common.job.JobInfo)</code> method to update the content of your job | jobStateUpdated | {
"repo_name": "acontes/scheduling",
"path": "src/scheduler/src/org/ow2/proactive/scheduler/core/SchedulerStateUpdate.java",
"license": "agpl-3.0",
"size": 3740
} | [
"org.ow2.proactive.scheduler.common.NotificationData",
"org.ow2.proactive.scheduler.common.job.JobInfo"
] | import org.ow2.proactive.scheduler.common.NotificationData; import org.ow2.proactive.scheduler.common.job.JobInfo; | import org.ow2.proactive.scheduler.common.*; import org.ow2.proactive.scheduler.common.job.*; | [
"org.ow2.proactive"
] | org.ow2.proactive; | 81,355 |
public ChartElement getChartElement(String key) {
return flowChartinstance.getFlowChartManager().getFlowChartSystem().getChartElement(key);
}
| ChartElement function(String key) { return flowChartinstance.getFlowChartManager().getFlowChartSystem().getChartElement(key); } | /**
* Returns the chart element in the flow chart system description
*
* @param key a chart element key
* @return the chart element in the flow chart system description
*/ | Returns the chart element in the flow chart system description | getChartElement | {
"repo_name": "VivianLuwenHuangfu/processors",
"path": "src/main/java/org/maltparserx/core/flow/item/ChartItem.java",
"license": "apache-2.0",
"size": 3737
} | [
"org.maltparserx.core.flow.system.elem.ChartElement"
] | import org.maltparserx.core.flow.system.elem.ChartElement; | import org.maltparserx.core.flow.system.elem.*; | [
"org.maltparserx.core"
] | org.maltparserx.core; | 1,517,724 |
@Test
public void deleteDir() throws Exception {
createFileWithSingleBlock(NESTED_FILE_URI);
// delete the dir
mFileSystemMaster.delete(NESTED_URI, DeleteOptions.defaults().setRecursive(true));
// verify the dir is deleted
assertEquals(-1, mFileSystemMaster.getFileId(NESTED_URI));
AlluxioU... | void function() throws Exception { createFileWithSingleBlock(NESTED_FILE_URI); mFileSystemMaster.delete(NESTED_URI, DeleteOptions.defaults().setRecursive(true)); assertEquals(-1, mFileSystemMaster.getFileId(NESTED_URI)); AlluxioURI ufsMount = new AlluxioURI(mTestFolder.newFolder().getAbsolutePath()); mFileSystemMaster.... | /**
* Tests the {@link FileSystemMaster#delete(AlluxioURI, DeleteOptions)} method for
* a directory.
*/ | Tests the <code>FileSystemMaster#delete(AlluxioURI, DeleteOptions)</code> method for a directory | deleteDir | {
"repo_name": "maboelhassan/alluxio",
"path": "core/server/master/src/test/java/alluxio/master/file/FileSystemMasterTest.java",
"license": "apache-2.0",
"size": 84885
} | [
"java.nio.file.Files",
"java.nio.file.Paths",
"org.junit.Assert"
] | import java.nio.file.Files; import java.nio.file.Paths; import org.junit.Assert; | import java.nio.file.*; import org.junit.*; | [
"java.nio",
"org.junit"
] | java.nio; org.junit; | 877,535 |
ServiceCall getNullAsync(final ServiceCallback<Basic> serviceCallback) throws IllegalArgumentException; | ServiceCall getNullAsync(final ServiceCallback<Basic> serviceCallback) throws IllegalArgumentException; | /**
* Get a basic complex type whose properties are null.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/ | Get a basic complex type whose properties are null | getNullAsync | {
"repo_name": "John-Hart/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodycomplex/Basics.java",
"license": "mit",
"size": 5783
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,821,978 |
private String determineReadCommunity(final Definition def) {
return (def.getReadCommunity() == null ? (m_config.getReadCommunity() == null ? SnmpAgentConfig.DEFAULT_READ_COMMUNITY :m_config.getReadCommunity()) : def.getReadCommunity());
} | String function(final Definition def) { return (def.getReadCommunity() == null ? (m_config.getReadCommunity() == null ? SnmpAgentConfig.DEFAULT_READ_COMMUNITY :m_config.getReadCommunity()) : def.getReadCommunity()); } | /**
* Helper method to search the snmp-config for the appropriate read
* community string.
* @param def
* @return
*/ | Helper method to search the snmp-config for the appropriate read community string | determineReadCommunity | {
"repo_name": "opennms-forge/poc-nms-core",
"path": "opennms-config/src/main/java/org/opennms/netmgt/config/SnmpPeerFactory.java",
"license": "gpl-2.0",
"size": 30384
} | [
"org.opennms.netmgt.config.snmp.Definition",
"org.opennms.netmgt.snmp.SnmpAgentConfig"
] | import org.opennms.netmgt.config.snmp.Definition; import org.opennms.netmgt.snmp.SnmpAgentConfig; | import org.opennms.netmgt.config.snmp.*; import org.opennms.netmgt.snmp.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 1,951,934 |
private void showError(int title) {
String showTitle;
String message;
switch (title) {
case R.string.internet_failure_title:
showTitle = getString(R.string.internet_failure_title);
message = getString(R.string.internet_failure);
br... | void function(int title) { String showTitle; String message; switch (title) { case R.string.internet_failure_title: showTitle = getString(R.string.internet_failure_title); message = getString(R.string.internet_failure); break; default: showTitle = getString(R.string.general_error_report); message = getString(R.string.g... | /**
* Presents an error to the user.
* @param title description
*/ | Presents an error to the user | showError | {
"repo_name": "segej87/ecomapper",
"path": "Android/AndroidDataCollection/app/src/main/java/com/kora/android/Notebook.java",
"license": "gpl-3.0",
"size": 25314
} | [
"android.support.v7.app.AlertDialog"
] | import android.support.v7.app.AlertDialog; | import android.support.v7.app.*; | [
"android.support"
] | android.support; | 1,923,046 |
public void configureChild(ProcessorDefinition<?> output) {
// noop
} | void function(ProcessorDefinition<?> output) { } | /**
* Strategy for children to do any custom configuration
*
* @param output the child to be added as output to this
*/ | Strategy for children to do any custom configuration | configureChild | {
"repo_name": "Fabryprog/camel",
"path": "core/camel-core/src/main/java/org/apache/camel/reifier/ProcessorReifier.java",
"license": "apache-2.0",
"size": 29950
} | [
"org.apache.camel.model.ProcessorDefinition"
] | import org.apache.camel.model.ProcessorDefinition; | import org.apache.camel.model.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,912,614 |
@Test
public void testParseEmtpyToken() throws InvalidFormatException {
String sentence = "the_DT _NNS";
POSSample sample = POSSample.parse(sentence);
assertEquals(sample.getSentence()[1], "");
} | void function() throws InvalidFormatException { String sentence = STR; POSSample sample = POSSample.parse(sentence); assertEquals(sample.getSentence()[1], ""); } | /**
* Tests if it can parse an empty token.
*
* @throws ParseException
*/ | Tests if it can parse an empty token | testParseEmtpyToken | {
"repo_name": "Groostav/CMPT880-term-project",
"path": "intruder/benchs/opennlp/opennlp-tools/src/test/java/opennlp/tools/postag/POSSampleTest.java",
"license": "apache-2.0",
"size": 3627
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 480,924 |
protected void assertTypeEquals(JSType expected, Node actual) {
assertTypeEquals(expected, new JSTypeExpression(actual, ""));
} | void function(JSType expected, Node actual) { assertTypeEquals(expected, new JSTypeExpression(actual, "")); } | /**
* Asserts that a Node representing a type expression resolves to the
* correct {@code JSType}.
*/ | Asserts that a Node representing a type expression resolves to the correct JSType | assertTypeEquals | {
"repo_name": "antz29/closure-compiler",
"path": "src/com/google/javascript/rhino/testing/BaseJSTypeTestCase.java",
"license": "apache-2.0",
"size": 24090
} | [
"com.google.javascript.rhino.JSTypeExpression",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.jstype.JSType"
] | import com.google.javascript.rhino.JSTypeExpression; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.JSType; | import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,173,623 |
public static StringBuilder encode(CharSequence src, boolean[] caseFlags) throws StringPrepParseException{
int n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, srcCPCount;
char c, c2;
int srcLength = src.length();
int[] cpBuffer = new int[srcLength];
StringBuilder ... | static StringBuilder function(CharSequence src, boolean[] caseFlags) throws StringPrepParseException{ int n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, srcCPCount; char c, c2; int srcLength = src.length(); int[] cpBuffer = new int[srcLength]; StringBuilder dest = new StringBuilder(srcLength); srcCPCount=0... | /**
* Converts Unicode to Punycode.
* The input string must not contain single, unpaired surrogates.
* The output will be represented as an array of ASCII code points.
*
* @param src The source of the String Buffer passed.
* @param caseFlags The boolean array of case flags.
* @return... | Converts Unicode to Punycode. The input string must not contain single, unpaired surrogates. The output will be represented as an array of ASCII code points | encode | {
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Punycode.java",
"license": "apache-2.0",
"size": 16551
} | [
"android.icu.lang.UCharacter",
"android.icu.text.StringPrepParseException"
] | import android.icu.lang.UCharacter; import android.icu.text.StringPrepParseException; | import android.icu.lang.*; import android.icu.text.*; | [
"android.icu"
] | android.icu; | 911,882 |
public Optional<BeanEventListener<T>> remove(String lineType){
return Optional.ofNullable(beanEventListeners.remove(lineType));
} | Optional<BeanEventListener<T>> function(String lineType){ return Optional.ofNullable(beanEventListeners.remove(lineType)); } | /**
* Removes line event listener for specified line type
* @param lineType The line type to remove listeners for.
* @return Optional with previously registered event listener for this line type. Optional.empty if no previous
* listener was registered for this line type.
*/ | Removes line event listener for specified line type | remove | {
"repo_name": "org-tigris-jsapar/jsapar",
"path": "src/main/java/org/jsapar/compose/bean/ByLineTypeBeanEventListener.java",
"license": "apache-2.0",
"size": 2914
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 2,894,188 |
@Test
public void testOffsetGreaterThanSize() {
Iterator<E> iter = new BoundedIterator<E>(testList.iterator(), 10, 4);
assertFalse(iter.hasNext());
try {
iter.next();
fail("Expected NoSuchElementException.");
} catch (NoSuchElementException nsee) {
... | void function() { Iterator<E> iter = new BoundedIterator<E>(testList.iterator(), 10, 4); assertFalse(iter.hasNext()); try { iter.next(); fail(STR); } catch (NoSuchElementException nsee) { } } | /**
* Test the case if the <code>offset</code> passed to the constructor is
* greater than the decorated iterator's size. The BoundedIterator should
* behave as if there are no more elements to return.
*/ | Test the case if the <code>offset</code> passed to the constructor is greater than the decorated iterator's size. The BoundedIterator should behave as if there are no more elements to return | testOffsetGreaterThanSize | {
"repo_name": "gonmarques/commons-collections",
"path": "src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java",
"license": "apache-2.0",
"size": 12144
} | [
"java.util.Iterator",
"java.util.NoSuchElementException"
] | import java.util.Iterator; import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 122,910 |
public List<Name<String>> pendingAttachmentNames(String attachmentId) {
List<Name<String>> result = new ArrayList<Name<String>>();
NameSource source = this.attachmentNameSources.get(attachmentId);
if(source!=null) {
result.addAll(source.pendingNames);
}
return result;
} | List<Name<String>> function(String attachmentId) { List<Name<String>> result = new ArrayList<Name<String>>(); NameSource source = this.attachmentNameSources.get(attachmentId); if(source!=null) { result.addAll(source.pendingNames); } return result; } | /**
* Return the pending names for the specified attachment.
*
* @param attachmentId
* the name of the attachment.
* @return the pending names for the specified attachment.
*/ | Return the pending names for the specified attachment | pendingAttachmentNames | {
"repo_name": "ldp4j/ldp4j",
"path": "framework/application/examples/src/main/java/org/ldp4j/example/NameProvider.java",
"license": "apache-2.0",
"size": 6392
} | [
"java.util.ArrayList",
"java.util.List",
"org.ldp4j.application.data.Name"
] | import java.util.ArrayList; import java.util.List; import org.ldp4j.application.data.Name; | import java.util.*; import org.ldp4j.application.data.*; | [
"java.util",
"org.ldp4j.application"
] | java.util; org.ldp4j.application; | 384,705 |
public Discussion setParentType(ParentType parentType) {
this.parentType = parentType;
return this;
}
public static class CreateDiscussionBuilder {
private String title;
private Comment comment; | Discussion function(ParentType parentType) { this.parentType = parentType; return this; } public static class CreateDiscussionBuilder { private String title; private Comment comment; | /**
* Sets the type to row or sheet
*
* @param parentType the new access level
*/ | Sets the type to row or sheet | setParentType | {
"repo_name": "smartsheet-platform/smartsheet-java-sdk",
"path": "src/main/java/com/smartsheet/api/models/Discussion.java",
"license": "apache-2.0",
"size": 9107
} | [
"com.smartsheet.api.models.enums.ParentType"
] | import com.smartsheet.api.models.enums.ParentType; | import com.smartsheet.api.models.enums.*; | [
"com.smartsheet.api"
] | com.smartsheet.api; | 2,400,642 |
public static SubmitPdu getSubmitPdu(String scAddress,
String destinationAddress, String message, boolean statusReportRequested) {
SubmitPduBase spb;
int activePhone = TelephonyManager.getDefault().getPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.andro... | static SubmitPdu function(String scAddress, String destinationAddress, String message, boolean statusReportRequested) { SubmitPduBase spb; int activePhone = TelephonyManager.getDefault().getPhoneType(); if (PHONE_TYPE_CDMA == activePhone) { spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress, de... | /**
* Get an SMS-SUBMIT PDU for a destination address and a message
*
* @param scAddress Service Centre address. Null means use default.
* @return a <code>SubmitPdu</code> containing the encoded SC
* address, if applicable, and the encoded message.
* Returns null on encode... | Get an SMS-SUBMIT PDU for a destination address and a message | getSubmitPdu | {
"repo_name": "mateor/PDroidHistory",
"path": "frameworks/base/telephony/java/android/telephony/SmsMessage.java",
"license": "gpl-3.0",
"size": 25802
} | [
"com.android.internal.telephony.SmsMessageBase"
] | import com.android.internal.telephony.SmsMessageBase; | import com.android.internal.telephony.*; | [
"com.android.internal"
] | com.android.internal; | 323,760 |
StatisticBuilder createStatisticBuilder();
/**
* Creates a new
* {@link StatisticBuilder.EntityStatisticBuilder} | StatisticBuilder createStatisticBuilder(); /** * Creates a new * {@link StatisticBuilder.EntityStatisticBuilder} | /**
* Creates a new {@link StatisticBuilder} which may be used to create custom
* {@link Statistic}s.
*
* @return The newly created simple statistic builder
*/ | Creates a new <code>StatisticBuilder</code> which may be used to create custom <code>Statistic</code>s | createStatisticBuilder | {
"repo_name": "Kiskae/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/GameRegistry.java",
"license": "mit",
"size": 20281
} | [
"org.spongepowered.api.statistic.StatisticBuilder"
] | import org.spongepowered.api.statistic.StatisticBuilder; | import org.spongepowered.api.statistic.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 346,180 |
public static Tracker parseTracker(JSONObject object) throws JSONException {
final int id = JsonInput.getInt(object, "id");
final String name = JsonInput.getStringNotNull(object, "name");
return TrackerFactory.create(id, name);
} | static Tracker function(JSONObject object) throws JSONException { final int id = JsonInput.getInt(object, "id"); final String name = JsonInput.getStringNotNull(object, "name"); return TrackerFactory.create(id, name); } | /**
* Parses a tracker.
*
* @param object
* object to parse.
* @return parsed tracker.
*/ | Parses a tracker | parseTracker | {
"repo_name": "andrea-rockt/mylyn-redmine-connector",
"path": "com.taskadapter.redmineapi/src/com/taskadapter/redmineapi/internal/RedmineJSONParser.java",
"license": "apache-2.0",
"size": 31728
} | [
"com.taskadapter.redmineapi.bean.Tracker",
"com.taskadapter.redmineapi.bean.TrackerFactory",
"com.taskadapter.redmineapi.internal.json.JsonInput",
"org.json.JSONException",
"org.json.JSONObject"
] | import com.taskadapter.redmineapi.bean.Tracker; import com.taskadapter.redmineapi.bean.TrackerFactory; import com.taskadapter.redmineapi.internal.json.JsonInput; import org.json.JSONException; import org.json.JSONObject; | import com.taskadapter.redmineapi.bean.*; import com.taskadapter.redmineapi.internal.json.*; import org.json.*; | [
"com.taskadapter.redmineapi",
"org.json"
] | com.taskadapter.redmineapi; org.json; | 2,024,276 |
protected final void importOrUpgradeData(String systemId, PortalDataKey portalDataKey, XMLEventReader xmlEventReader) {
//See if there is a registered importer for the data, if so import
final IDataImporter<Object> dataImporterExporter = this.portalDataImporters.get(portalDataKey);
if (dataI... | final void function(String systemId, PortalDataKey portalDataKey, XMLEventReader xmlEventReader) { final IDataImporter<Object> dataImporterExporter = this.portalDataImporters.get(portalDataKey); if (dataImporterExporter != null) { this.logger.debug(STR, getPartialSystemId(systemId)); final Object data = unmarshallData(... | /**
* Run the import/update process on the data
*/ | Run the import/update process on the data | importOrUpgradeData | {
"repo_name": "timlevett/uPortal",
"path": "uportal-war/src/main/java/org/jasig/portal/io/xml/JaxbPortalDataHandlerService.java",
"license": "apache-2.0",
"size": 54087
} | [
"javax.xml.stream.XMLEventReader",
"javax.xml.stream.XMLStreamException",
"javax.xml.transform.dom.DOMResult",
"javax.xml.transform.dom.DOMSource",
"org.jasig.portal.xml.XmlUtilitiesImpl",
"org.w3c.dom.Node"
] | import javax.xml.stream.XMLEventReader; import javax.xml.stream.XMLStreamException; import javax.xml.transform.dom.DOMResult; import javax.xml.transform.dom.DOMSource; import org.jasig.portal.xml.XmlUtilitiesImpl; import org.w3c.dom.Node; | import javax.xml.stream.*; import javax.xml.transform.dom.*; import org.jasig.portal.xml.*; import org.w3c.dom.*; | [
"javax.xml",
"org.jasig.portal",
"org.w3c.dom"
] | javax.xml; org.jasig.portal; org.w3c.dom; | 2,293,106 |
Collection<K> getKeys(); | Collection<K> getKeys(); | /**
* Get all the keys referencing cache entries
*
* @return collection of cached keys
*/ | Get all the keys referencing cache entries | getKeys | {
"repo_name": "afiantara/apache-wicket-1.5.7",
"path": "src/wicket-core/src/main/java/org/apache/wicket/markup/MarkupCache.java",
"license": "apache-2.0",
"size": 19488
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,988,446 |
public static Object getPhoneTypeFromStrings(Collection<String> types,
String number) {
if (number == null) {
number = "";
}
int type = -1;
String label = null;
boolean isFax = false;
boolean hasPref = false;
if (types != null) {
... | static Object function(Collection<String> types, String number) { if (number == null) { number = STRX-STR@"); if ((typeCandidate == Phone.TYPE_PAGER && 0 < indexOfAt && indexOfAt < number.length() - 1) type < 0 type == Phone.TYPE_CUSTOM type == Phone.TYPE_OTHER) { type = tmp; } } else if (type < 0) { type = Phone.TYPE_... | /**
* Returns Interger when the given types can be parsed as known type. Returns String object
* when not, which should be set to label.
*/ | Returns Interger when the given types can be parsed as known type. Returns String object when not, which should be set to label | getPhoneTypeFromStrings | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "frameworks/opt/vcard/java/com/android/vcard/VCardUtils.java",
"license": "gpl-2.0",
"size": 35006
} | [
"android.provider.ContactsContract",
"java.util.Collection"
] | import android.provider.ContactsContract; import java.util.Collection; | import android.provider.*; import java.util.*; | [
"android.provider",
"java.util"
] | android.provider; java.util; | 2,607,262 |
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if (server.worldServers != null)
{
notifyCommandListener(sender, this, "commands.stop.start", new Object[0]);
}
server.initiateShutdown();
} | void function(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (server.worldServers != null) { notifyCommandListener(sender, this, STR, new Object[0]); } server.initiateShutdown(); } | /**
* Callback for when the command is executed
*/ | Callback for when the command is executed | execute | {
"repo_name": "MartyParty21/AwakenDreamsClient",
"path": "mcp/src/minecraft/net/minecraft/command/server/CommandStop.java",
"license": "gpl-3.0",
"size": 932
} | [
"net.minecraft.command.CommandException",
"net.minecraft.command.ICommandSender",
"net.minecraft.server.MinecraftServer"
] | import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; | import net.minecraft.command.*; import net.minecraft.server.*; | [
"net.minecraft.command",
"net.minecraft.server"
] | net.minecraft.command; net.minecraft.server; | 2,467,335 |
@Test
public void applicationFilters() {
Assert.assertNotNull(new Expectations() {
{
context.findFilterDefs();
result = new FilterDef();
}
});
final Tomcat85ContainerAdapter adapter = new Tomcat85ContainerAdapter();
assertEquals(1, adapter.getApplicationFilters(context).... | void function() { Assert.assertNotNull(new Expectations() { { context.findFilterDefs(); result = new FilterDef(); } }); final Tomcat85ContainerAdapter adapter = new Tomcat85ContainerAdapter(); assertEquals(1, adapter.getApplicationFilters(context).size()); } | /**
* Application filters.
*/ | Application filters | applicationFilters | {
"repo_name": "dougwm/psi-probe",
"path": "tomcat85adapter/src/test/java/psiprobe/Tomcat85ContainerAdapterTest.java",
"license": "gpl-2.0",
"size": 6377
} | [
"org.apache.tomcat.util.descriptor.web.FilterDef",
"org.junit.Assert"
] | import org.apache.tomcat.util.descriptor.web.FilterDef; import org.junit.Assert; | import org.apache.tomcat.util.descriptor.web.*; import org.junit.*; | [
"org.apache.tomcat",
"org.junit"
] | org.apache.tomcat; org.junit; | 1,436,314 |
@SkylarkCallable(name = "executable", structField = true, doc = EXECUTABLE_DOC)
public SkylarkClassObject getExecutable() {
return attributesCollection.getExecutable();
} | @SkylarkCallable(name = STR, structField = true, doc = EXECUTABLE_DOC) SkylarkClassObject function() { return attributesCollection.getExecutable(); } | /**
* <p>See {@link RuleContext#getExecutablePrerequisite(String, Mode)}.
*/ | See <code>RuleContext#getExecutablePrerequisite(String, Mode)</code> | getExecutable | {
"repo_name": "iamthearm/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java",
"license": "apache-2.0",
"size": 31599
} | [
"com.google.devtools.build.lib.packages.SkylarkClassObject",
"com.google.devtools.build.lib.skylarkinterface.SkylarkCallable"
] | import com.google.devtools.build.lib.packages.SkylarkClassObject; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; | import com.google.devtools.build.lib.packages.*; import com.google.devtools.build.lib.skylarkinterface.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,272,116 |
if(!systemStatus){
status.setText("Waiting for user input...");
int i = JOptionPane.showConfirmDialog(null, "Are you sure to wish to quit?");
if(i == JOptionPane.YES_OPTION) {
status.setText(LauncherGUI.DEFAULT_STATUS_MESSAGE);
frame.setVisible(false);
... | if(!systemStatus){ status.setText(STR); int i = JOptionPane.showConfirmDialog(null, STR); if(i == JOptionPane.YES_OPTION) { status.setText(LauncherGUI.DEFAULT_STATUS_MESSAGE); frame.setVisible(false); frame.dispose(); System.exit(0); } status.setText(LauncherGUI.DEFAULT_STATUS_MESSAGE); } } | /**
* When the window closes, if the system is doing something, then ask the user
*/ | When the window closes, if the system is doing something, then ask the user | windowClosing | {
"repo_name": "peterrodgers/dover",
"path": "src/uk/ac/kent/dover/fastGraph/Gui/ClosingWindowListener.java",
"license": "apache-2.0",
"size": 2235
} | [
"javax.swing.JOptionPane"
] | import javax.swing.JOptionPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 938,735 |
public void removeTimeListener(VRMLTimeListener l) {
int index = findListener(l);
if(index == -1)
return;
if(index == (numTimeListeners - 1)) {
timeListeners[index] = null;
} else {
System.arraycopy(timeListeners,
ind... | void function(VRMLTimeListener l) { int index = findListener(l); if(index == -1) return; if(index == (numTimeListeners - 1)) { timeListeners[index] = null; } else { System.arraycopy(timeListeners, index + 1, timeListeners, index, numTimeListeners - index - 1); } numTimeListeners--; } | /**
* Remove a time listener to this clock. If the listener is not known to
* this implementation, it is silently ignored.
*
* @param l The listener instance to add
*/ | Remove a time listener to this clock. If the listener is not known to this implementation, it is silently ignored | removeTimeListener | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/web3d/vrml/renderer/j3d/input/TimeScheduler.java",
"license": "gpl-2.0",
"size": 10158
} | [
"org.web3d.vrml.nodes.VRMLTimeListener"
] | import org.web3d.vrml.nodes.VRMLTimeListener; | import org.web3d.vrml.nodes.*; | [
"org.web3d.vrml"
] | org.web3d.vrml; | 919,314 |
public Adapter createEObjectAdapter() {
return null;
}
| Adapter function() { return null; } | /**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/ | Creates a new adapter for the default case. This default implementation returns null. | createEObjectAdapter | {
"repo_name": "uppaal-emf/uppaal",
"path": "metamodel/org.muml.uppaal/src/org/muml/uppaal/templates/util/TemplatesAdapterFactory.java",
"license": "epl-1.0",
"size": 11665
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 541,607 |
public boolean savePlaylist(File filePath) {
return FileReadWriteModule.writeTextFile(filePath,
MusicVideoDataExportHandler.generateJsonContentPlaylist(this.playlistHandler.getPlaylistElements()));
} | boolean function(File filePath) { return FileReadWriteModule.writeTextFile(filePath, MusicVideoDataExportHandler.generateJsonContentPlaylist(this.playlistHandler.getPlaylistElements())); } | /**
* Save the current playlist in a JSON file
*
* @param filePath
* (File | Destination of the file)
*/ | Save the current playlist in a JSON file | savePlaylist | {
"repo_name": "AnonymerNiklasistanonym/KaraokeMusicVideoManager",
"path": "DesktopClient/src/main/java/anonymerniklasistanonym/karaokemusicvideomanager/desktopclient/handler/MusicVideoHandler.java",
"license": "mit",
"size": 65130
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 64,390 |
public ValidatedAndroidResources validate(
AndroidDataContext dataContext, AndroidAaptVersion aaptVersion) throws InterruptedException {
return ValidatedAndroidResources.validateFrom(dataContext, this, aaptVersion);
} | ValidatedAndroidResources function( AndroidDataContext dataContext, AndroidAaptVersion aaptVersion) throws InterruptedException { return ValidatedAndroidResources.validateFrom(dataContext, this, aaptVersion); } | /**
* Validates and packages this rule's resources.
*
* <p>See {@link ValidatedAndroidResources#validateFrom(AndroidDataContext,
* MergedAndroidResources, AndroidAaptVersion)}. This method is a convenience method for calling
* that one.
*/ | Validates and packages this rule's resources. See <code>ValidatedAndroidResources#validateFrom(AndroidDataContext, MergedAndroidResources, AndroidAaptVersion)</code>. This method is a convenience method for calling that one | validate | {
"repo_name": "dropbox/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/android/MergedAndroidResources.java",
"license": "apache-2.0",
"size": 6511
} | [
"com.google.devtools.build.lib.rules.android.AndroidConfiguration"
] | import com.google.devtools.build.lib.rules.android.AndroidConfiguration; | import com.google.devtools.build.lib.rules.android.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,680,092 |
Observable<ServiceResponse<List<Map<String, String>>>> getDictionaryItemNullAsync(); | Observable<ServiceResponse<List<Map<String, String>>>> getDictionaryItemNullAsync(); | /**
* Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}].
*
* @return the observable to the List<Map<String, String>> object
*/ | Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}] | getDictionaryItemNullAsync | {
"repo_name": "haocs/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodyarray/Arrays.java",
"license": "mit",
"size": 72234
} | [
"com.microsoft.rest.ServiceResponse",
"java.util.List",
"java.util.Map"
] | import com.microsoft.rest.ServiceResponse; import java.util.List; import java.util.Map; | import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.rest",
"java.util"
] | com.microsoft.rest; java.util; | 2,501,287 |
static Node getArgumentForCallOrNew(Node call, int index) {
checkState(isCallOrNew(call));
return getNthSibling(call.getSecondChild(), index);
} | static Node getArgumentForCallOrNew(Node call, int index) { checkState(isCallOrNew(call)); return getNthSibling(call.getSecondChild(), index); } | /**
* Given the new or call, this returns the nth
* argument of the call or null if no such argument exists.
*/ | Given the new or call, this returns the nth argument of the call or null if no such argument exists | getArgumentForCallOrNew | {
"repo_name": "Yannic/closure-compiler",
"path": "src/com/google/javascript/jscomp/NodeUtil.java",
"license": "apache-2.0",
"size": 170457
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node"
] | import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; | import com.google.common.base.*; import com.google.javascript.rhino.*; | [
"com.google.common",
"com.google.javascript"
] | com.google.common; com.google.javascript; | 2,364,117 |
public void printMessage(Declaration decl, Experimental exp)
{
String expStr = "EXPERIMENTAL code"
+ ( ( exp.value() != null && exp.value().length() > 0 ) ? ": " + exp.value() : "" )
+ ".";
Messager m = env.getMessager();
m.printWarning(
decl.getPosition(),
decl.getSimpleName() + ">> " + expStr
... | void function(Declaration decl, Experimental exp) { String expStr = STR + ( ( exp.value() != null && exp.value().length() > 0 ) ? STR + exp.value() : STR.STR>> " + expStr ); } | /**
* Prints Experimental annotation to the console.
* @param decl The declaration where the annotation has been found.
* @param exp The Experimental annotation.
*/ | Prints Experimental annotation to the console | printMessage | {
"repo_name": "sguazt/dcsj-commons",
"path": "src/java/it/unipmn/di/dcs/common/annotation/ExperimentalVisitor.java",
"license": "gpl-3.0",
"size": 2496
} | [
"com.sun.mirror.declaration.Declaration",
"it.unipmn.di.dcs.common.annotation.Experimental"
] | import com.sun.mirror.declaration.Declaration; import it.unipmn.di.dcs.common.annotation.Experimental; | import com.sun.mirror.declaration.*; import it.unipmn.di.dcs.common.annotation.*; | [
"com.sun.mirror",
"it.unipmn.di"
] | com.sun.mirror; it.unipmn.di; | 1,025,021 |
@Reference(
name = "registry.service",
service = org.wso2.carbon.registry.core.service.RegistryService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetRegistryService")
protected void setRe... | @Reference( name = STR, service = org.wso2.carbon.registry.core.service.RegistryService.class, cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.DYNAMIC, unbind = STR) void function(RegistryService registryService) { ServiceDataHolder.getInstance().setRegistryService(registryService); } | /**
* Method to set registry service.
*
* @param registryService service to get tenant data.
*/ | Method to set registry service | setRegistryService | {
"repo_name": "bhathiya/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.hybrid.gateway/org.wso2.carbon.apimgt.hybrid.gateway.api.synchronizer/src/main/java/org/wso2/carbon/apimgt/hybrid/gateway/api/synchronizer/internal/APISynchronizationServiceComponent.java",
"license": "apache-2.0",
"size"... | [
"org.osgi.service.component.annotations.Reference",
"org.osgi.service.component.annotations.ReferenceCardinality",
"org.osgi.service.component.annotations.ReferencePolicy",
"org.wso2.carbon.registry.core.service.RegistryService"
] | import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ReferenceCardinality; import org.osgi.service.component.annotations.ReferencePolicy; import org.wso2.carbon.registry.core.service.RegistryService; | import org.osgi.service.component.annotations.*; import org.wso2.carbon.registry.core.service.*; | [
"org.osgi.service",
"org.wso2.carbon"
] | org.osgi.service; org.wso2.carbon; | 980,310 |
public static void reset()
{
population.clear();
solutions.clear();
fitnessBuffer.clear();
similarityBuffer.clear();
mutationBuffer.clear();
duplicateBuffer.clear();
solutionGeneration.clear();
rotationMiss.clear();
reflectionMiss.clear();
... | static void function() { population.clear(); solutions.clear(); fitnessBuffer.clear(); similarityBuffer.clear(); mutationBuffer.clear(); duplicateBuffer.clear(); solutionGeneration.clear(); rotationMiss.clear(); reflectionMiss.clear(); duplicateStats.clear(); fitnessStats.clear(); similarityStats.clear(); mutationStats... | /**
* In the case of mult-run mode resets the current program state so that another
* fresh execution can be done.
*/ | In the case of mult-run mode resets the current program state so that another fresh execution can be done | reset | {
"repo_name": "gnu-user/genetic-algorithm-research",
"path": "NQueens/src/algorithm/NQueens.java",
"license": "gpl-3.0",
"size": 23818
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 438,219 |
@ApiModelProperty(value = "")
public Pagination getPagination() {
return pagination;
} | @ApiModelProperty(value = "") Pagination function() { return pagination; } | /**
* Get pagination
*
* @return pagination
*/ | Get pagination | getPagination | {
"repo_name": "SidneyAllen/Xero-Java",
"path": "src/main/java/com/xero/models/payrolluk/Deductions.java",
"license": "mit",
"size": 3375
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 603,201 |
CompositeData getAuthorization(String user) throws IOException;
/**
* Answer the credentials associated with a user.
*
* The returned Tabular Data is typed by
* {@link JmxConstants#PROPERTIES_TYPE}.
*
* @param username The user name
* @return the credentials associated with the user, see
* ... | CompositeData getAuthorization(String user) throws IOException; /** * Answer the credentials associated with a user. * * The returned Tabular Data is typed by * {@link JmxConstants#PROPERTIES_TYPE}. * * @param username The user name * @return the credentials associated with the user, see * {@link JmxConstants#PROPERTIE... | /**
* Answer the authorization for the user name.
*
* The Composite Data is typed by {@link #AUTORIZATION_TYPE}.
*
* @param user The user name
* @return the Authorization typed by {@link #AUTORIZATION_TYPE}.
* @throws IOException if the operation fails
* @throws IllegalArgumentException if the user na... | Answer the authorization for the user name. The Composite Data is typed by <code>#AUTORIZATION_TYPE</code> | getAuthorization | {
"repo_name": "eclipse/gemini.managment",
"path": "org.eclipse.gemini.management/src/main/java/org/osgi/jmx/service/useradmin/UserAdminMBean.java",
"license": "apache-2.0",
"size": 16643
} | [
"java.io.IOException",
"javax.management.openmbean.CompositeData",
"org.osgi.jmx.JmxConstants"
] | import java.io.IOException; import javax.management.openmbean.CompositeData; import org.osgi.jmx.JmxConstants; | import java.io.*; import javax.management.openmbean.*; import org.osgi.jmx.*; | [
"java.io",
"javax.management",
"org.osgi.jmx"
] | java.io; javax.management; org.osgi.jmx; | 2,728,495 |
@Override
public void stop(int svc) throws ChannelException {
this.internalStop(svc);
} | void function(int svc) throws ChannelException { this.internalStop(svc); } | /**
* Shuts down the channel. This can be called multiple times for individual services to shutdown
* The svc parameter can be the logical or value of any constants
* @param svc int value of <BR>
* DEFAULT - will shutdown all services <BR>
* MBR_RX_SEQ - stops the membership receiver <BR>
... | Shuts down the channel. This can be called multiple times for individual services to shutdown The svc parameter can be the logical or value of any constants | stop | {
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.22/ChannelCoordinator.java",
"license": "mit",
"size": 12979
} | [
"org.apache.catalina.tribes.ChannelException"
] | import org.apache.catalina.tribes.ChannelException; | import org.apache.catalina.tribes.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 2,644,943 |
private void populateTable(final Connection connection, TableName table, int value)
throws Exception {
// create HFiles for different column families
Path dir = buildBulkFiles(table, value);
BulkLoadHFiles.create(util.getConfiguration()).bulkLoad(table, dir);
} | void function(final Connection connection, TableName table, int value) throws Exception { Path dir = buildBulkFiles(table, value); BulkLoadHFiles.create(util.getConfiguration()).bulkLoad(table, dir); } | /**
* Populate table with known values.
*/ | Populate table with known values | populateTable | {
"repo_name": "ultratendency/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestBulkLoadHFilesSplitRecovery.java",
"license": "apache-2.0",
"size": 18670
} | [
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.TableName",
"org.apache.hadoop.hbase.client.Connection"
] | import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; | import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,651,330 |
public static Element firstChildElement(Element element, Set<String> childElementNames) {
if (element == null) return null;
// get the first element with the given name
Node node = element.getFirstChild();
if (node != null) {
do {
if (node.getNodeType() =... | static Element function(Element element, Set<String> childElementNames) { if (element == null) return null; Node node = element.getFirstChild(); if (node != null) { do { if (node.getNodeType() == Node.ELEMENT_NODE && childElementNames.contains(node.getNodeName())) { Element childElement = (Element) node; return childEl... | /** Return the first child Element
* returns the first element. */ | Return the first child Element | firstChildElement | {
"repo_name": "yuri0x7c1/ofbiz-explorer",
"path": "src/test/resources/apache-ofbiz-16.11.03/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java",
"license": "apache-2.0",
"size": 49763
} | [
"java.util.Set",
"org.w3c.dom.Element",
"org.w3c.dom.Node"
] | import java.util.Set; import org.w3c.dom.Element; import org.w3c.dom.Node; | import java.util.*; import org.w3c.dom.*; | [
"java.util",
"org.w3c.dom"
] | java.util; org.w3c.dom; | 1,648,665 |
private static byte[] decodeBase64(String base64Input) throws GeneralSecurityException
{
try
{
return Base64.getDecoder().decode(base64Input);
}
catch (IllegalArgumentException e)
{
throw new GeneralSecurityException("Failed to decode given base64 ... | static byte[] function(String base64Input) throws GeneralSecurityException { try { return Base64.getDecoder().decode(base64Input); } catch (IllegalArgumentException e) { throw new GeneralSecurityException(STR + e.getMessage(), e); } } | /**
* Decodes given input in Base64 format.
*
* @param base64Input input to be decoded
* @return byte[] containing decoded bytes
* @throws GeneralSecurityException in case it fails to decode the given base64 input
*/ | Decodes given input in Base64 format | decodeBase64 | {
"repo_name": "belliottsmith/cassandra",
"path": "src/java/org/apache/cassandra/security/PEMReader.java",
"license": "apache-2.0",
"size": 12937
} | [
"java.security.GeneralSecurityException",
"java.util.Base64"
] | import java.security.GeneralSecurityException; import java.util.Base64; | import java.security.*; import java.util.*; | [
"java.security",
"java.util"
] | java.security; java.util; | 865,543 |
public static void clearInconsistency(S3AFileSystem fs) throws Exception {
AmazonS3 s3 = fs.getAmazonS3ClientForTesting("s3guard");
InconsistentAmazonS3Client ic = InconsistentAmazonS3Client.castFrom(s3);
ic.clearInconsistency();
} | static void function(S3AFileSystem fs) throws Exception { AmazonS3 s3 = fs.getAmazonS3ClientForTesting(STR); InconsistentAmazonS3Client ic = InconsistentAmazonS3Client.castFrom(s3); ic.clearInconsistency(); } | /**
* Clear any accumulated inconsistency state. Used by tests to make paths
* visible again.
* @param fs S3AFileSystem under test
* @throws Exception on failure
*/ | Clear any accumulated inconsistency state. Used by tests to make paths visible again | clearInconsistency | {
"repo_name": "xiao-chen/hadoop",
"path": "hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/InconsistentAmazonS3Client.java",
"license": "apache-2.0",
"size": 23350
} | [
"com.amazonaws.services.s3.AmazonS3"
] | import com.amazonaws.services.s3.AmazonS3; | import com.amazonaws.services.s3.*; | [
"com.amazonaws.services"
] | com.amazonaws.services; | 1,171,570 |
public static boolean isFileExist(String path, String filename) {
String file_path = getFilePathAtExternalStorage(path, filename);
File file = new File(file_path.toString());
return file.exists();
}
| static boolean function(String path, String filename) { String file_path = getFilePathAtExternalStorage(path, filename); File file = new File(file_path.toString()); return file.exists(); } | /** Checks wheather exists the file at the location at SD card/path/filename.
* E.g. /mnt/sdcard/db.sqlite if dir="kiwidict" and filename="db.sqlite"
*/ | Checks wheather exists the file at the location at SD card/path/filename. E.g. /mnt/sdcard/db.sqlite if dir="kiwidict" and filename="db.sqlite" | isFileExist | {
"repo_name": "componavt/wikokit",
"path": "android/common_wiki_android/src/wikokit/base/wikt/db/FileUtil.java",
"license": "apache-2.0",
"size": 4705
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,091,440 |
public static MessageUnpacker newDefaultUnpacker(InputStream in)
{
return DEFAULT_UNPACKER_CONFIG.newUnpacker(in);
} | static MessageUnpacker function(InputStream in) { return DEFAULT_UNPACKER_CONFIG.newUnpacker(in); } | /**
* Creates an unpacker that deserializes objects from a specified input stream.
* <p>
* Note that you don't have to wrap InputStream in BufferedInputStream because MessageUnpacker has buffering
* internally.
* <p>
* This method is equivalent to <code>DEFAULT_UNPACKER_CONFIG.newDefaultUn... | Creates an unpacker that deserializes objects from a specified input stream. Note that you don't have to wrap InputStream in BufferedInputStream because MessageUnpacker has buffering internally. This method is equivalent to <code>DEFAULT_UNPACKER_CONFIG.newDefaultUnpacker(in)</code> | newDefaultUnpacker | {
"repo_name": "msgpack/msgpack-java",
"path": "msgpack-core/src/main/java/org/msgpack/core/MessagePack.java",
"license": "apache-2.0",
"size": 28880
} | [
"java.io.InputStream"
] | import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,059,285 |
@JsonIgnore
public UriTemplate getHrefAsTemplate() {
return UriTemplate.fromTemplate(href);
} | UriTemplate function() { return UriTemplate.fromTemplate(href); } | /**
* Returns the href of the link as a {@link UriTemplate} that can be expanded by providing the required template variables.
*
* @return uri template of the linked resource
*
* @see <a href="https://tools.ietf.org/html/draft-kelly-json-hal-08#section-5.1">draft-kelly-json-hal-08#section-5.1</... | Returns the href of the link as a <code>UriTemplate</code> that can be expanded by providing the required template variables | getHrefAsTemplate | {
"repo_name": "otto-de/edison-hal",
"path": "src/main/java/de/otto/edison/hal/Link.java",
"license": "apache-2.0",
"size": 21835
} | [
"com.damnhandy.uri.template.UriTemplate"
] | import com.damnhandy.uri.template.UriTemplate; | import com.damnhandy.uri.template.*; | [
"com.damnhandy.uri"
] | com.damnhandy.uri; | 1,146,214 |
public void sendMessage(Message message) {
try {
message.setTo(chat.getRoom());
message.setType(Message.Type.groupchat);
MessageEventManager.addNotificationsRequests(message, true, true,
true, true);
// Add packetID to list
addPacketID(message.getPacketID());
// Fire M... | void function(Message message) { try { message.setTo(chat.getRoom()); message.setType(Message.Type.groupchat); MessageEventManager.addNotificationsRequests(message, true, true, true, true); addPacketID(message.getPacketID()); SparkManager.getChatManager().filterOutgoingMessage(this, message); SparkManager.getChatManage... | /**
* Sends a message.
*
* @param message
* - the message to send.
*/ | Sends a message | sendMessage | {
"repo_name": "joshuairl/toothchat-client",
"path": "src/java/org/jivesoftware/spark/ui/rooms/GroupChatRoom.java",
"license": "apache-2.0",
"size": 42834
} | [
"org.jivesoftware.smack.XMPPException",
"org.jivesoftware.smack.packet.Message",
"org.jivesoftware.smackx.MessageEventManager",
"org.jivesoftware.spark.SparkManager",
"org.jivesoftware.spark.util.log.Log"
] | import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smackx.MessageEventManager; import org.jivesoftware.spark.SparkManager; import org.jivesoftware.spark.util.log.Log; | import org.jivesoftware.smack.*; import org.jivesoftware.smack.packet.*; import org.jivesoftware.smackx.*; import org.jivesoftware.spark.*; import org.jivesoftware.spark.util.log.*; | [
"org.jivesoftware.smack",
"org.jivesoftware.smackx",
"org.jivesoftware.spark"
] | org.jivesoftware.smack; org.jivesoftware.smackx; org.jivesoftware.spark; | 2,622,978 |
public SnarfHandler getReadHandler(int snarfID) {
if ( ! ((mySnarfInfo.getSpaceLeft(snarfID)) <= (myUrdiView.getDataSizeOfSnarf(snarfID)))) {
throw new AboraAssertionException("Handle must aready be initialized");
}
return SnarfHandler.make((myUrdiView.makeReadHandle(snarfID)));
} | SnarfHandler function(int snarfID) { if ( ! ((mySnarfInfo.getSpaceLeft(snarfID)) <= (myUrdiView.getDataSizeOfSnarf(snarfID)))) { throw new AboraAssertionException(STR); } return SnarfHandler.make((myUrdiView.makeReadHandle(snarfID))); } | /**
* Get the read handler on the snarf.
*/ | Get the read handler on the snarf | getReadHandler | {
"repo_name": "jonesd/udanax-gold2java",
"path": "abora-gold/src/generated-sources/translator/info/dgjones/abora/gold/snarf/SnarfPacker.java",
"license": "mit",
"size": 70169
} | [
"info.dgjones.abora.gold.java.exception.AboraAssertionException",
"info.dgjones.abora.gold.snarf.SnarfHandler"
] | import info.dgjones.abora.gold.java.exception.AboraAssertionException; import info.dgjones.abora.gold.snarf.SnarfHandler; | import info.dgjones.abora.gold.java.exception.*; import info.dgjones.abora.gold.snarf.*; | [
"info.dgjones.abora"
] | info.dgjones.abora; | 2,565,549 |
public Hashtable getEnvironment()
throws NamingException {
return env;
} | Hashtable function() throws NamingException { return env; } | /**
* Retrieves the environment in effect for this context. See class
* description for more details on environment properties.
* The caller should not make any changes to the object returned: their
* effect on the context is undefined. The environment of this context
* may be changed using... | Retrieves the environment in effect for this context. See class description for more details on environment properties. The caller should not make any changes to the object returned: their effect on the context is undefined. The environment of this context may be changed using addToEnvironment() and removeFromEnvironme... | getEnvironment | {
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-5.0.18-src/jakarta-tomcat-catalina/catalina/src/share/org/apache/naming/NamingContext.java",
"license": "apache-2.0",
"size": 35071
} | [
"java.util.Hashtable",
"javax.naming.NamingException"
] | import java.util.Hashtable; import javax.naming.NamingException; | import java.util.*; import javax.naming.*; | [
"java.util",
"javax.naming"
] | java.util; javax.naming; | 2,444,892 |
public void writeMethod(String method)
throws IOException
{
writeString(method);
}
| void function(String method) throws IOException { writeString(method); } | /**
* Writes the method tag.
*
* <code><pre>
* string
* </pre></code>
*
* @param method the method name to call.
*/ | Writes the method tag. <code><code> string </code></code> | writeMethod | {
"repo_name": "surlymo/dubbo",
"path": "hessian-lite/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Output.java",
"license": "apache-2.0",
"size": 36381
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,053,889 |
URL url = null;
// attempt to load from the context path
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl != null) {
url = cl.getResource(resourceName);
}
// attempt to load from system context path
if (url == null) {
url = C... | URL url = null; ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl != null) { url = cl.getResource(resourceName); } if (url == null) { url = ClassLoader.getSystemResource(resourceName); } if (url == null) { try { resourceName = URLDecoder.decode(resourceName, "UTF-8"); url = (new File(resourceName)... | /**
* Gets the resource url.
*
* @param resourceName the resource name.
* @return the resource url.
*/ | Gets the resource url | getResource | {
"repo_name": "cgfork/cgtools",
"path": "tools-common/src/main/java/org/cgfork/tools/common/util/ResourceUtil.java",
"license": "apache-2.0",
"size": 1737
} | [
"java.io.File",
"java.net.URLDecoder"
] | import java.io.File; import java.net.URLDecoder; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 1,718,270 |
public void testTimeout() throws Exception {
ProduceRequestResult request = new ProduceRequestResult(topicPartition);
FutureRecordMetadata future = new FutureRecordMetadata(request, relOffset,
RecordBatch.NO_TIMESTAMP, 0L, 0, 0);
assertFalse("Request is not completed", future.isD... | void function() throws Exception { ProduceRequestResult request = new ProduceRequestResult(topicPartition); FutureRecordMetadata future = new FutureRecordMetadata(request, relOffset, RecordBatch.NO_TIMESTAMP, 0L, 0, 0); assertFalse(STR, future.isDone()); try { future.get(5, TimeUnit.MILLISECONDS); fail(STR); } catch (T... | /**
* Test that waiting on a request that never completes times out
*/ | Test that waiting on a request that never completes times out | testTimeout | {
"repo_name": "wangcy6/storm_app",
"path": "frame/kafka-0.11.0/kafka-0.11.0.1-src/clients/src/test/java/org/apache/kafka/clients/producer/RecordSendTest.java",
"license": "apache-2.0",
"size": 3958
} | [
"java.util.concurrent.TimeUnit",
"java.util.concurrent.TimeoutException",
"org.apache.kafka.clients.producer.internals.FutureRecordMetadata",
"org.apache.kafka.clients.producer.internals.ProduceRequestResult",
"org.apache.kafka.common.record.RecordBatch",
"org.junit.Assert"
] | import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.kafka.clients.producer.internals.FutureRecordMetadata; import org.apache.kafka.clients.producer.internals.ProduceRequestResult; import org.apache.kafka.common.record.RecordBatch; import org.junit.Assert; | import java.util.concurrent.*; import org.apache.kafka.clients.producer.internals.*; import org.apache.kafka.common.record.*; import org.junit.*; | [
"java.util",
"org.apache.kafka",
"org.junit"
] | java.util; org.apache.kafka; org.junit; | 2,853,766 |
public LoggingEvent[] getAllEvents() {
return events.toArray(new LoggingEvent[]{});
} | LoggingEvent[] function() { return events.toArray(new LoggingEvent[]{}); } | /**
* Returns all saved events.
*
* @return all saved events.
*/ | Returns all saved events | getAllEvents | {
"repo_name": "jochenwierum/FitGoodies",
"path": "fitgoodies-logging-log4j/src/main/java/de/cologneintelligence/fitgoodies/log4j/CaptureAppender.java",
"license": "gpl-3.0",
"size": 3443
} | [
"org.apache.log4j.spi.LoggingEvent"
] | import org.apache.log4j.spi.LoggingEvent; | import org.apache.log4j.spi.*; | [
"org.apache.log4j"
] | org.apache.log4j; | 550,456 |
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawDefaultBackground();
GL11.glPushMatrix();
GL11.glScaled(7, 6, 5);
String var1 = "Cheata";
this.drawCenteredString(mc.fontRendererObj, var1, ((this.width / 7) / 2), ((this.height / 6) / 4) - 5, 0xffb825);
... | void function(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); GL11.glPushMatrix(); GL11.glScaled(7, 6, 5); String var1 = STR; this.drawCenteredString(mc.fontRendererObj, var1, ((this.width / 7) / 2), ((this.height / 6) / 4) - 5, 0xffb825); GL11.glPopMatrix(); if(needsUpdate){ this.drawRect(0... | /**
* Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
*/ | Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks | drawScreen | {
"repo_name": "CheataClient/CheataClientSrc",
"path": "com/lunix/cheata/gui/CheataMainMenu.java",
"license": "mpl-2.0",
"size": 25793
} | [
"com.lunix.cheata.Client"
] | import com.lunix.cheata.Client; | import com.lunix.cheata.*; | [
"com.lunix.cheata"
] | com.lunix.cheata; | 2,230,779 |
@Before
public void setUpTest() {
// Mock device service
expect(mockDeviceService.getDevice(deviceId1))
.andReturn(device1);
expect(mockDeviceService.getDevice(deviceId2))
.andReturn(device2);
expect(mockDeviceService.getDevice(deviceId4))
... | void function() { expect(mockDeviceService.getDevice(deviceId1)) .andReturn(device1); expect(mockDeviceService.getDevice(deviceId2)) .andReturn(device2); expect(mockDeviceService.getDevice(deviceId4)) .andReturn(device4); expect(mockDeviceService.getDevices()) .andReturn(ImmutableSet.of(device1, device2, device4)); exp... | /**
* Sets up the global values for all the tests.
*/ | Sets up the global values for all the tests | setUpTest | {
"repo_name": "LorenzReinhart/ONOSnew",
"path": "web/api/src/test/java/org/onosproject/rest/resources/MetersResourceTest.java",
"license": "apache-2.0",
"size": 18341
} | [
"com.google.common.collect.ImmutableSet",
"org.easymock.EasyMock",
"org.onlab.osgi.ServiceDirectory",
"org.onlab.osgi.TestServiceDirectory",
"org.onlab.rest.BaseResource",
"org.onosproject.codec.CodecService",
"org.onosproject.codec.impl.CodecManager",
"org.onosproject.codec.impl.MeterCodec",
"org.o... | import com.google.common.collect.ImmutableSet; import org.easymock.EasyMock; import org.onlab.osgi.ServiceDirectory; import org.onlab.osgi.TestServiceDirectory; import org.onlab.rest.BaseResource; import org.onosproject.codec.CodecService; import org.onosproject.codec.impl.CodecManager; import org.onosproject.codec.imp... | import com.google.common.collect.*; import org.easymock.*; import org.onlab.osgi.*; import org.onlab.rest.*; import org.onosproject.codec.*; import org.onosproject.codec.impl.*; import org.onosproject.core.*; import org.onosproject.net.*; import org.onosproject.net.device.*; import org.onosproject.net.meter.*; | [
"com.google.common",
"org.easymock",
"org.onlab.osgi",
"org.onlab.rest",
"org.onosproject.codec",
"org.onosproject.core",
"org.onosproject.net"
] | com.google.common; org.easymock; org.onlab.osgi; org.onlab.rest; org.onosproject.codec; org.onosproject.core; org.onosproject.net; | 2,340,731 |
public List getKeys() {
List result = Collections.EMPTY_LIST;
if (this.source != null) {
if (this.extract == TableOrder.BY_ROW) {
result = this.source.getColumnKeys();
}
else if (this.extract == TableOrder.BY_COLUMN) {
result... | List function() { List result = Collections.EMPTY_LIST; if (this.source != null) { if (this.extract == TableOrder.BY_ROW) { result = this.source.getColumnKeys(); } else if (this.extract == TableOrder.BY_COLUMN) { result = this.source.getRowKeys(); } } return result; } | /**
* Returns the keys for the dataset.
* <p>
* If the underlying dataset is <code>null</code>, this method returns an
* empty list.
*
* @return The keys.
*/ | Returns the keys for the dataset. If the underlying dataset is <code>null</code>, this method returns an empty list | getKeys | {
"repo_name": "fluidware/Eastwood-Charts",
"path": "source/org/jfree/data/category/CategoryToPieDataset.java",
"license": "lgpl-2.1",
"size": 10960
} | [
"java.util.Collections",
"java.util.List",
"org.jfree.util.TableOrder"
] | import java.util.Collections; import java.util.List; import org.jfree.util.TableOrder; | import java.util.*; import org.jfree.util.*; | [
"java.util",
"org.jfree.util"
] | java.util; org.jfree.util; | 2,155,753 |
public List<List<String>> matchingRecipeNames(String recipeName, boolean beLoose); | List<List<String>> function(String recipeName, boolean beLoose); | /**
* Returns a vector containing an entry for each craftable recipe
* whose name matches the given name. Each entry is also a vector.
* @param recipeName the name of the recipe to craft
* @param beLoose whether to be specific or "loose" with name matching
* @return a vector of vectors
*/ | Returns a vector containing an entry for each craftable recipe whose name matches the given name. Each entry is also a vector | matchingRecipeNames | {
"repo_name": "ConsecroMUD/ConsecroMUD",
"path": "com/suscipio_solutions/consecro_mud/Abilities/interfaces/ItemCraftor.java",
"license": "apache-2.0",
"size": 6383
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,561,893 |
@Nonnull
public ShiftCollectionRequest skipToken(@Nonnull final String skipToken) {
addSkipTokenOption(skipToken);
return this;
} | ShiftCollectionRequest function(@Nonnull final String skipToken) { addSkipTokenOption(skipToken); return this; } | /**
* Add Skip token for pagination
* @param skipToken - Token for pagination
* @return the updated request
*/ | Add Skip token for pagination | skipToken | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/ShiftCollectionRequest.java",
"license": "mit",
"size": 5477
} | [
"com.microsoft.graph.requests.ShiftCollectionRequest",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.requests.ShiftCollectionRequest; import javax.annotation.Nonnull; | import com.microsoft.graph.requests.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 1,919,260 |
private void commitRemainingBuffers()
{
// We synchronize on dirtyComponents here because that is what
// paintDirtyRegions also synchronizes on while painting.
synchronized (dirtyComponents)
{
Set entrySet = commitRequests.entrySet();
Iterator i = entrySet.iterator();
whil... | void function() { synchronized (dirtyComponents) { Set entrySet = commitRequests.entrySet(); Iterator i = entrySet.iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); Component root = (Component) entry.getKey(); Rectangle area = (Rectangle) entry.getValue(); blitBuffer(root, area); i.remove(); } }... | /**
* Commits the queued up back buffers to screen all at once.
*/ | Commits the queued up back buffers to screen all at once | commitRemainingBuffers | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/RepaintManager.java",
"license": "bsd-3-clause",
"size": 27650
} | [
"java.awt.Component",
"java.awt.Rectangle",
"java.util.Iterator",
"java.util.Map",
"java.util.Set"
] | import java.awt.Component; import java.awt.Rectangle; import java.util.Iterator; import java.util.Map; import java.util.Set; | import java.awt.*; import java.util.*; | [
"java.awt",
"java.util"
] | java.awt; java.util; | 1,215,470 |
static public RealScalarField loadScalarField(String path,
Topology topology, double ms) throws RuntimeException {
BufferedImage img = null;
try {
img = ImageIO.read(new File(IOConfig.getInstance().getPathFor(path)));
} catch (IOException e) {
// TODO print stack trace
}
int w = img.getWidth();
... | static RealScalarField function(String path, Topology topology, double ms) throws RuntimeException { BufferedImage img = null; try { img = ImageIO.read(new File(IOConfig.getInstance().getPathFor(path))); } catch (IOException e) { } int w = img.getWidth(); int h = img.getHeight(); if (topology.getCellCount(0) != w) thro... | /**
* Reads the red channel of an image and converts it to a
* <code>RealScalarField</code>, whereas a black pixel will result in 0 as a
* value and a white pixel in <code>ms</code>. The values in between are
* interpolated.
*
* @param path
* the path to the image
* @param topology
* ... | Reads the red channel of an image and converts it to a <code>RealScalarField</code>, whereas a black pixel will result in 0 as a value and a white pixel in <code>ms</code>. The values in between are interpolated | loadScalarField | {
"repo_name": "c-abird/yamms_core",
"path": "src/uni/hamburg/yamms/io/ImageService.java",
"license": "lgpl-3.0",
"size": 1762
} | [
"java.awt.Color",
"java.awt.image.BufferedImage",
"java.io.File",
"java.io.IOException",
"javax.imageio.ImageIO"
] | import java.awt.Color; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; | import java.awt.*; import java.awt.image.*; import java.io.*; import javax.imageio.*; | [
"java.awt",
"java.io",
"javax.imageio"
] | java.awt; java.io; javax.imageio; | 343,205 |
public List<Integer> markings() {
return this.innerProperties() == null ? null : this.innerProperties().markings();
} | List<Integer> function() { return this.innerProperties() == null ? null : this.innerProperties().markings(); } | /**
* Get the markings property: List of markings to be used in the configuration.
*
* @return the markings value.
*/ | Get the markings property: List of markings to be used in the configuration | markings | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/DscpConfigurationInner.java",
"license": "mit",
"size": 10048
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,131,444 |
@Test
public void testSetChokeLimit() throws InterruptedException,
TTransportException, IOException {
FlumeShell sh = new FlumeShell();
sh
.executeLine("connect localhost:"
+ FlumeConfiguration.DEFAULT_ADMIN_PORT);
sh.executeLine("exec setChokeLimit physNode choke 786");
... | void function() throws InterruptedException, TTransportException, IOException { FlumeShell sh = new FlumeShell(); sh .executeLine(STR + FlumeConfiguration.DEFAULT_ADMIN_PORT); sh.executeLine(STR); Clock.sleep(250); assertEquals(786, flumeMaster.getSpecMan().getChokeMap(STR).get( "choke").intValue()); } | /**
* Start a master, connect to it via the shell, and then issue a setChokeLimit
* and make sure the chokeMap at the master is updated.
*/ | Start a master, connect to it via the shell, and then issue a setChokeLimit and make sure the chokeMap at the master is updated | testSetChokeLimit | {
"repo_name": "fengzanfeng/flume-v2",
"path": "flume-core/test/java/com/cloudera/flume/shell/TestFlumeShell.java",
"license": "apache-2.0",
"size": 19783
} | [
"com.cloudera.flume.conf.FlumeConfiguration",
"com.cloudera.flume.util.FlumeShell",
"com.cloudera.util.Clock",
"java.io.IOException",
"org.apache.thrift.transport.TTransportException",
"org.junit.Assert"
] | import com.cloudera.flume.conf.FlumeConfiguration; import com.cloudera.flume.util.FlumeShell; import com.cloudera.util.Clock; import java.io.IOException; import org.apache.thrift.transport.TTransportException; import org.junit.Assert; | import com.cloudera.flume.conf.*; import com.cloudera.flume.util.*; import com.cloudera.util.*; import java.io.*; import org.apache.thrift.transport.*; import org.junit.*; | [
"com.cloudera.flume",
"com.cloudera.util",
"java.io",
"org.apache.thrift",
"org.junit"
] | com.cloudera.flume; com.cloudera.util; java.io; org.apache.thrift; org.junit; | 1,972,318 |
private String readString(ExtractorInput input, int byteLength)
throws IOException, InterruptedException {
if (byteLength == 0) {
return "";
}
byte[] stringBytes = new byte[byteLength];
input.readFully(stringBytes, 0, byteLength);
return new String(stringBytes);
}
private stati... | String function(ExtractorInput input, int byteLength) throws IOException, InterruptedException { if (byteLength == 0) { return ""; } byte[] stringBytes = new byte[byteLength]; input.readFully(stringBytes, 0, byteLength); return new String(stringBytes); } private static final class MasterElement { private final int elem... | /**
* Reads and returns a string of length {@code byteLength} from the {@link ExtractorInput}.
*
* @param input The {@link ExtractorInput} from which to read.
* @param byteLength The length of the float being read.
* @return The read string value.
* @throws IOException If an error occurs reading from ... | Reads and returns a string of length byteLength from the <code>ExtractorInput</code> | readString | {
"repo_name": "martinbonnin/ExoPlayer",
"path": "library/src/main/java/com/google/android/exoplayer/extractor/webm/DefaultEbmlReader.java",
"license": "apache-2.0",
"size": 9199
} | [
"com.google.android.exoplayer.extractor.ExtractorInput",
"java.io.IOException"
] | import com.google.android.exoplayer.extractor.ExtractorInput; import java.io.IOException; | import com.google.android.exoplayer.extractor.*; import java.io.*; | [
"com.google.android",
"java.io"
] | com.google.android; java.io; | 425,122 |
protected boolean[] runBasicTest(AttrTypes attrTypes, int numAtts,
int attrIndex, int classType, int classIndex, int missingLevel,
boolean attributeMissing, boolean classMissing, int numTrain, int numTest,
int numClasses, ArrayList<String> accepts) {
boolean[] result = new boolean[2];
Instances t... | boolean[] function(AttrTypes attrTypes, int numAtts, int attrIndex, int classType, int classIndex, int missingLevel, boolean attributeMissing, boolean classMissing, int numTrain, int numTest, int numClasses, ArrayList<String> accepts) { boolean[] result = new boolean[2]; Instances train = null; Vector<Double> test = nu... | /**
* Runs a text on the datasets with the given characteristics.
*
* @param attrTypes attribute types that can be estimated
* @param numAtts number of attributes
* @param classType the class type (NUMERIC, NOMINAL, etc.)
* @param classIndex the attribute index of the class
* @param missingLevel t... | Runs a text on the datasets with the given characteristics | runBasicTest | {
"repo_name": "mydzigear/weka.kmeanspp.silhouette_score",
"path": "src/weka/estimators/CheckEstimator.java",
"license": "gpl-3.0",
"size": 64211
} | [
"java.util.ArrayList",
"java.util.Vector"
] | import java.util.ArrayList; import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 2,000,486 |
private void encodeSidebarButton(FacesContext context, ResponseWriter out, String sideBarStyle,
String location, String labelId)
throws IOException
{
out.write("<div class=\"sidebarButton\" ");
out.write(sideBarStyle);
out.write("><a class='sidebarButtonLink' onclick=\"");
... | void function(FacesContext context, ResponseWriter out, String sideBarStyle, String location, String labelId) throws IOException { out.write(STRsidebarButton\" "); out.write(sideBarStyle); out.write(STRSTR\STR#\">"); out.write(Application.getMessage(context, labelId)); out.write(STR); } | /**
* Encode a Sidebar Button DIV with selectable button link
*
* @param context FacesContext
* @param out ResponseWriter
* @param sideBarStyle Inline CSS style to apply to the sidebar button
* @param location Toolbar location id
* @param labelId Label I1... | Encode a Sidebar Button DIV with selectable button link | encodeSidebarButton | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/web-client/source/java/org/alfresco/web/ui/repo/component/UINavigator.java",
"license": "lgpl-3.0",
"size": 16327
} | [
"java.io.IOException",
"javax.faces.context.FacesContext",
"javax.faces.context.ResponseWriter",
"org.alfresco.web.app.Application"
] | import java.io.IOException; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import org.alfresco.web.app.Application; | import java.io.*; import javax.faces.context.*; import org.alfresco.web.app.*; | [
"java.io",
"javax.faces",
"org.alfresco.web"
] | java.io; javax.faces; org.alfresco.web; | 2,291,102 |
@Override
public void addTag(Tag tag) {
setChanged();
tag.addTrace(getName());
//LOG.debug("calling observers");
notifyObservers(tag);
} | void function(Tag tag) { setChanged(); tag.addTrace(getName()); notifyObservers(tag); } | /**
* whenever a new Tag is read a notification is sent to the observers.
*
* @param tag a tag read on the reader
*/ | whenever a new Tag is read a notification is sent to the observers | addTag | {
"repo_name": "dreambt/FilteringAndCollectionServer",
"path": "fc-server/src/main/java/org/fosstrak/ale/server/readers/rp/RPAdaptor.java",
"license": "lgpl-2.1",
"size": 16228
} | [
"org.fosstrak.ale.server.Tag"
] | import org.fosstrak.ale.server.Tag; | import org.fosstrak.ale.server.*; | [
"org.fosstrak.ale"
] | org.fosstrak.ale; | 2,301,660 |
@Override
public void onConfirmClicked(@Nullable Contribution contribution, boolean copyWikicode) {
if (copyWikicode) {
String wikicode = contribution.getMedia().getWikiCode();
Utils.copy("wikicode", wikicode, getContext());
}
final String url =
languageWikipediaSite.mobileUrl() + "... | void function(@Nullable Contribution contribution, boolean copyWikicode) { if (copyWikicode) { String wikicode = contribution.getMedia().getWikiCode(); Utils.copy(STR, wikicode, getContext()); } final String url = languageWikipediaSite.mobileUrl() + STR + contribution.getWikidataPlace() .getWikipediaPageTitle(); Utils.... | /**
* Open the editor for the language Wikipedia
*
* @param contribution
*/ | Open the editor for the language Wikipedia | onConfirmClicked | {
"repo_name": "nicolas-raoul/apps-android-commons",
"path": "app/src/main/java/fr/free/nrw/commons/contributions/ContributionsListFragment.java",
"license": "apache-2.0",
"size": 14295
} | [
"android.net.Uri",
"androidx.annotation.Nullable",
"fr.free.nrw.commons.Utils"
] | import android.net.Uri; import androidx.annotation.Nullable; import fr.free.nrw.commons.Utils; | import android.net.*; import androidx.annotation.*; import fr.free.nrw.commons.*; | [
"android.net",
"androidx.annotation",
"fr.free.nrw"
] | android.net; androidx.annotation; fr.free.nrw; | 455,060 |
public void testListener() throws Exception
{
final FileObject baseFile = createScratchFolder();
FileObject child = baseFile.resolveFile("newfile.txt");
assertTrue(!child.exists());
FileSystem fs = baseFile.getFileSystem();
TestListener listener = new TestListener(child... | void function() throws Exception { final FileObject baseFile = createScratchFolder(); FileObject child = baseFile.resolveFile(STR); assertTrue(!child.exists()); FileSystem fs = baseFile.getFileSystem(); TestListener listener = new TestListener(child); fs.addListener(child, listener); listener.addCreateEvent(); child.cr... | /**
* Check listeners are notified of changes.
*/ | Check listeners are notified of changes | testListener | {
"repo_name": "EsupPortail/commons-vfs2-project-2.0",
"path": "core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteTests.java",
"license": "apache-2.0",
"size": 20403
} | [
"org.apache.commons.vfs2.FileObject",
"org.apache.commons.vfs2.FileSystem",
"org.apache.commons.vfs2.Selectors"
] | import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystem; import org.apache.commons.vfs2.Selectors; | import org.apache.commons.vfs2.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,970,113 |
public DistributionStatisticConfigFilter orAppliesTo(Predicate<Meter.Id> appliesTo) {
this.appliesTo = this.appliesTo.or(appliesTo);
return this;
} | DistributionStatisticConfigFilter function(Predicate<Meter.Id> appliesTo) { this.appliesTo = this.appliesTo.or(appliesTo); return this; } | /**
* Add a condition under which this config applies to a Camel meter
*
* @param appliesTo predicate that must return true so that this config applies
*/ | Add a condition under which this config applies to a Camel meter | orAppliesTo | {
"repo_name": "davidkarlsen/camel",
"path": "components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/DistributionStatisticConfigFilter.java",
"license": "apache-2.0",
"size": 7707
} | [
"io.micrometer.core.instrument.Meter",
"java.util.function.Predicate"
] | import io.micrometer.core.instrument.Meter; import java.util.function.Predicate; | import io.micrometer.core.instrument.*; import java.util.function.*; | [
"io.micrometer.core",
"java.util"
] | io.micrometer.core; java.util; | 2,331,102 |
public Stat exists(String path, Watcher watcher) throws KeeperException, InterruptedException {
try (TraceScope scope = TraceUtil.createTrace("RecoverableZookeeper.exists")) {
RetryCounter retryCounter = retryCounterFactory.create();
while (true) {
try {
long startTime = EnvironmentE... | Stat function(String path, Watcher watcher) throws KeeperException, InterruptedException { try (TraceScope scope = TraceUtil.createTrace(STR)) { RetryCounter retryCounter = retryCounterFactory.create(); while (true) { try { long startTime = EnvironmentEdgeManager.currentTime(); Stat nodeStat = checkZk().exists(path, wa... | /**
* exists is an idempotent operation. Retry before throwing exception
* @return A Stat instance
*/ | exists is an idempotent operation. Retry before throwing exception | exists | {
"repo_name": "Eshcar/hbase",
"path": "hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java",
"license": "apache-2.0",
"size": 26850
} | [
"org.apache.hadoop.hbase.trace.TraceUtil",
"org.apache.hadoop.hbase.util.EnvironmentEdgeManager",
"org.apache.hadoop.hbase.util.RetryCounter",
"org.apache.htrace.core.TraceScope",
"org.apache.zookeeper.KeeperException",
"org.apache.zookeeper.Watcher",
"org.apache.zookeeper.data.Stat"
] | import org.apache.hadoop.hbase.trace.TraceUtil; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.RetryCounter; import org.apache.htrace.core.TraceScope; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; | import org.apache.hadoop.hbase.trace.*; import org.apache.hadoop.hbase.util.*; import org.apache.htrace.core.*; import org.apache.zookeeper.*; import org.apache.zookeeper.data.*; | [
"org.apache.hadoop",
"org.apache.htrace",
"org.apache.zookeeper"
] | org.apache.hadoop; org.apache.htrace; org.apache.zookeeper; | 1,979,745 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.