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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
default CompletableFuture<Void> unbanUser(long userId) {
return unbanUser(userId, null);
} | default CompletableFuture<Void> unbanUser(long userId) { return unbanUser(userId, null); } | /**
* Unbans the given user from the server.
*
* @param userId The id of the user to unban.
* @return A future to check if the unban was successful.
*/ | Unbans the given user from the server | unbanUser | {
"repo_name": "BtoBastian/Javacord",
"path": "javacord-api/src/main/java/org/javacord/api/entity/server/Server.java",
"license": "lgpl-3.0",
"size": 103692
} | [
"java.util.concurrent.CompletableFuture"
] | import java.util.concurrent.CompletableFuture; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,044,709 |
protected StructuredGraph parseProfiled(ResolvedJavaMethod m, AllowAssumptions allowAssumptions) {
return parse1(m, getDefaultGraphBuilderSuite(), allowAssumptions);
} | StructuredGraph function(ResolvedJavaMethod m, AllowAssumptions allowAssumptions) { return parse1(m, getDefaultGraphBuilderSuite(), allowAssumptions); } | /**
* Parses a Java method in {@linkplain GraphBuilderConfiguration#getDefault default} mode to
* produce a graph.
*/ | Parses a Java method in GraphBuilderConfiguration#getDefault default mode to produce a graph | parseProfiled | {
"repo_name": "davleopo/graal-core",
"path": "graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java",
"license": "gpl-2.0",
"size": 41197
} | [
"com.oracle.graal.nodes.StructuredGraph"
] | import com.oracle.graal.nodes.StructuredGraph; | import com.oracle.graal.nodes.*; | [
"com.oracle.graal"
] | com.oracle.graal; | 847,340 |
public void moveFromLocalFile(Path src, Path dst)
throws IOException {
copyFromLocalFile(true, src, dst);
} | void function(Path src, Path dst) throws IOException { copyFromLocalFile(true, src, dst); } | /**
* The src file is on the local disk. Add it to FS at
* the given dst name, removing the source afterwards.
* @param src path
* @param dst path
*/ | The src file is on the local disk. Add it to FS at the given dst name, removing the source afterwards | moveFromLocalFile | {
"repo_name": "fyqls/hadoop-2.4.0",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 102531
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 780,430 |
private List<Room> getRooms(int nPersons) {
List<Room> rooms = new ArrayList<>();
//Easy Variant
//Hard Variant
Collections.sort(tempRooms, Collections.reverseOrder());
int assignedCapacity = 0;
while (assignedCapacity < nPersons && !tempRooms.isEmpty()) {
... | List<Room> function(int nPersons) { List<Room> rooms = new ArrayList<>(); Collections.sort(tempRooms, Collections.reverseOrder()); int assignedCapacity = 0; while (assignedCapacity < nPersons && !tempRooms.isEmpty()) { Room temp = getBestFittingRoom(nPersons - assignedCapacity); rooms.add(temp); assignedCapacity += tem... | /**
* Function returning optimal number of rooms for nPersons
*
* @param nPersons
* @return
*/ | Function returning optimal number of rooms for nPersons | getRooms | {
"repo_name": "Team-Luna/PO-2014-Hotel",
"path": "PO-Hotel-2014/src/main/Hotel.java",
"license": "mit",
"size": 13719
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,674,939 |
String testFile = PathUtils.concatPath(mTestDirectory, "createEmpty");
int bytesRead;
OutputStream o = mUfs.create(testFile);
o.close();
byte[] buf = new byte[0];
bytesRead = mUfs.open(testFile).read(buf);
if (bytesRead != 0) {
throw new IOException("The written file should be empty but is... | String testFile = PathUtils.concatPath(mTestDirectory, STR); int bytesRead; OutputStream o = mUfs.create(testFile); o.close(); byte[] buf = new byte[0]; bytesRead = mUfs.open(testFile).read(buf); if (bytesRead != 0) { throw new IOException(STR); } } | /**
* Test for creating an empty file using streaming upload.
*/ | Test for creating an empty file using streaming upload | createEmptyFileTest | {
"repo_name": "EvilMcJerkface/alluxio",
"path": "integration/tools/validation/src/main/java/alluxio/cli/S3ASpecificOperations.java",
"license": "apache-2.0",
"size": 5959
} | [
"java.io.IOException",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,959,839 |
public List<CapitalAssetSystem> retrieveCapitalAssetSystemsForMultipleSystem(Integer poId); | List<CapitalAssetSystem> function(Integer poId); | /**
* Return a list of CapitalAssetSystems which provide the capital asset information such as asset numbers and asset type.
*
* @param poId Purchase Order ID used to retrieve the asset information for the current PO
* @return List of CapitalAssetSystems
*/ | Return a list of CapitalAssetSystems which provide the capital asset information such as asset numbers and asset type | retrieveCapitalAssetSystemsForMultipleSystem | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/document/service/PurchaseOrderService.java",
"license": "apache-2.0",
"size": 21955
} | [
"java.util.List",
"org.kuali.kfs.integration.purap.CapitalAssetSystem"
] | import java.util.List; import org.kuali.kfs.integration.purap.CapitalAssetSystem; | import java.util.*; import org.kuali.kfs.integration.purap.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 2,048,818 |
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager == null ? null : connectivityManager.getActiveNetworkInfo();
return networkInfo == null ? -1 : networkInfo.getType();
... | ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager == null ? null : connectivityManager.getActiveNetworkInfo(); return networkInfo == null ? -1 : networkInfo.getType(); } | /**
* Get network type
*
* @param context
* @return
*/ | Get network type | getNetworkType | {
"repo_name": "weiwenqiang/GitHub",
"path": "MVP/RxJava2ToMVP/login-master/app/src/main/java/com/chen/test/Utils/NetUtil.java",
"license": "apache-2.0",
"size": 5998
} | [
"android.content.Context",
"android.net.ConnectivityManager",
"android.net.NetworkInfo"
] | import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; | import android.content.*; import android.net.*; | [
"android.content",
"android.net"
] | android.content; android.net; | 2,460,376 |
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<List<MicrosoftGraphDirectoryObjectInner>>> getByIdsWithResponseAsync(
ApplicationsGetByIdsRequestBody body); | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<List<MicrosoftGraphDirectoryObjectInner>>> getByIdsWithResponseAsync( ApplicationsGetByIdsRequestBody body); | /**
* Invoke action getByIds.
*
* @param body Action parameters.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is
* rejected by server.
* @t... | Invoke action getByIds | getByIdsWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java",
"license": "mit",
"size": 113060
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.resourcemanager.authorization.fluent.models.ApplicationsGetByIdsRequestBody",
"com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphDirectoryObjectInner",
"java... | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.authorization.fluent.models.ApplicationsGetByIdsRequestBody; import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphDirectoryObjectI... | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.authorization.fluent.models.*; import java.util.*; | [
"com.azure.core",
"com.azure.resourcemanager",
"java.util"
] | com.azure.core; com.azure.resourcemanager; java.util; | 2,756,643 |
@SuppressWarnings("unchecked")
public static <E extends Comparable<? super E>> ImmutableSortedMultiset<E> of(
E e1, E e2, E e3, E e4, E e5) {
return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3, e4, e5));
} | @SuppressWarnings(STR) static <E extends Comparable<? super E>> ImmutableSortedMultiset<E> function( E e1, E e2, E e3, E e4, E e5) { return copyOf(Ordering.natural(), Arrays.asList(e1, e2, e3, e4, e5)); } | /**
* Returns an immutable sorted multiset containing the given elements sorted by their natural
* ordering.
*
* @throws NullPointerException if any element is null
*/ | Returns an immutable sorted multiset containing the given elements sorted by their natural ordering | of | {
"repo_name": "rgoldberg/guava",
"path": "guava/src/com/google/common/collect/ImmutableSortedMultiset.java",
"license": "apache-2.0",
"size": 22778
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 680,598 |
public static BloomFilter deserialize(OrcProto.Stream.Kind kind,
OrcFile.WriterVersion fileVersion,
TypeDescription.Category type,
OrcProto.BloomFilter bloomFilter) {
if (bloomFilter == null) {
... | static BloomFilter function(OrcProto.Stream.Kind kind, OrcFile.WriterVersion fileVersion, TypeDescription.Category type, OrcProto.BloomFilter bloomFilter) { if (bloomFilter == null) { return null; } int numFuncs = bloomFilter.getNumHashFunctions(); switch (kind) { case BLOOM_FILTER: { long values[] = new long[bloomFilt... | /**
* Deserialize a bloom filter from the ORC file.
*/ | Deserialize a bloom filter from the ORC file | deserialize | {
"repo_name": "chunyang-wen/orc",
"path": "java/core/src/java/org/apache/orc/util/BloomFilterIO.java",
"license": "apache-2.0",
"size": 3462
} | [
"com.google.protobuf.ByteString",
"java.nio.ByteOrder",
"org.apache.orc.OrcFile",
"org.apache.orc.OrcProto",
"org.apache.orc.TypeDescription"
] | import com.google.protobuf.ByteString; import java.nio.ByteOrder; import org.apache.orc.OrcFile; import org.apache.orc.OrcProto; import org.apache.orc.TypeDescription; | import com.google.protobuf.*; import java.nio.*; import org.apache.orc.*; | [
"com.google.protobuf",
"java.nio",
"org.apache.orc"
] | com.google.protobuf; java.nio; org.apache.orc; | 2,834,192 |
@Override
public boolean registerServer(final int type, final String name, final String ip) throws RemoteException {
if (LOG.isDebugEnabled()) {
LOG.debug("registerServer called :: type = " + type + " :: name = " + name + " :: ip = " + ip); // NOI18N
}
try {
if (... | boolean function(final int type, final String name, final String ip) throws RemoteException { if (LOG.isDebugEnabled()) { LOG.debug(STR + type + STR + name + STR + ip); } try { if (sm.registerServer(type, name, ip)) { obs.setChanged(); obs.notifyObservers(); status.addMessage( NbBundle.getMessage(Registry.class, STR) ,... | /**
* DOCUMENT ME!
*
* @param type DOCUMENT ME!
* @param name DOCUMENT ME!
* @param ip DOCUMENT ME!
*
* @return DOCUMENT ME!
*
* @throws RemoteException DOCUMENT ME!
*/ | DOCUMENT ME | registerServer | {
"repo_name": "cismet/cids-server",
"path": "src/main/java/Sirius/server/registry/Registry.java",
"license": "lgpl-3.0",
"size": 39621
} | [
"java.rmi.RemoteException",
"org.openide.util.NbBundle"
] | import java.rmi.RemoteException; import org.openide.util.NbBundle; | import java.rmi.*; import org.openide.util.*; | [
"java.rmi",
"org.openide.util"
] | java.rmi; org.openide.util; | 2,356,815 |
protected float getResourceAsValue(
Resource clusterResource, Resource resource, boolean dominant) {
// Just use 'dominant' resource
return (dominant) ?
Math.max(
(float)resource.getMemory() / clusterResource.getMemory(),
(float)resource.getVirtualCores() / clusterResour... | float function( Resource clusterResource, Resource resource, boolean dominant) { return (dominant) ? Math.max( (float)resource.getMemory() / clusterResource.getMemory(), (float)resource.getVirtualCores() / clusterResource.getVirtualCores() ) : Math.min( (float)resource.getMemory() / clusterResource.getMemory(), (float)... | /**
* Use 'dominant' for now since we only have 2 resources - gives us a slight
* performance boost.
*
* Once we add more resources, we'll need a more complicated (and slightly
* less performant algorithm).
*/ | Use 'dominant' for now since we only have 2 resources - gives us a slight performance boost. Once we add more resources, we'll need a more complicated (and slightly less performant algorithm) | getResourceAsValue | {
"repo_name": "yncxcw/PreemptYARN-2.7.1",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/resource/DominantResourceCalculator.java",
"license": "apache-2.0",
"size": 7342
} | [
"org.apache.hadoop.yarn.api.records.Resource"
] | import org.apache.hadoop.yarn.api.records.Resource; | import org.apache.hadoop.yarn.api.records.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,420,182 |
public void removeImage(int imageIndex) throws IOException {
unsupported();
}
// Empty images | void function(int imageIndex) throws IOException { unsupported(); } | /**
* Removes an image from the stream.
*
* <p>
* If <code>canRemoveImage(imageIndex)</code> returns false, an
* <code>UnsupportedOperationException</code>will be thrown.
*
* <p>
* The removal may or may not cause a reduction in the actual file size.
*
* <p>
* The default implementation throws an ... | Removes an image from the stream. If <code>canRemoveImage(imageIndex)</code> returns false, an <code>UnsupportedOperationException</code>will be thrown. The removal may or may not cause a reduction in the actual file size. The default implementation throws an <code>IllegalStateException</code> if the output is <code>nu... | removeImage | {
"repo_name": "javalovercn/j2se_for_android",
"path": "src/javax/imageio/ImageWriter.java",
"license": "gpl-2.0",
"size": 80999
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,342,274 |
private void initializeInterval(Date periodEndDate) {
Calendar tempCal = new GregorianCalendar();
tempCal.setTime(periodEndDate);
// This used to be the day prior to the report being run, which is confusing
// tempCal.add(Calendar.DAY_OF_MONTH, -1);
tempCal.set(Calendar... | void function(Date periodEndDate) { Calendar tempCal = new GregorianCalendar(); tempCal.setTime(periodEndDate); tempCal.set(Calendar.HOUR_OF_DAY, 23); tempCal.set(Calendar.MINUTE, 59); tempCal.set(Calendar.SECOND, 59); tempCal.set(Calendar.MILLISECOND, 999); m_endTime = tempCal.getTimeInMillis(); tempCal.add(Calendar.Y... | /**
* Initialize the endTime, start Time, last Months end time and number of days in the
* last month.
*/ | Initialize the endTime, start Time, last Months end time and number of days in the last month | initializeInterval | {
"repo_name": "tdefilip/opennms",
"path": "features/reporting/availability/src/main/java/org/opennms/reporting/availability/AvailabilityData.java",
"license": "agpl-3.0",
"size": 17835
} | [
"java.util.Calendar",
"java.util.Date",
"java.util.GregorianCalendar"
] | import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; | import java.util.*; | [
"java.util"
] | java.util; | 732,618 |
private void testNIST(CoveringArrayParameters parameters)
{
CoveringArrayPrinter printer;
printer = new CoveringArrayPrinter(CoveringArrayPrinter.FORMAT.NIST);
if(!printer.print(parameters, this.OUTPUT_SRC_PATH))
System.out.println("[WARNING] The covering array experien... | void function(CoveringArrayParameters parameters) { CoveringArrayPrinter printer; printer = new CoveringArrayPrinter(CoveringArrayPrinter.FORMAT.NIST); if(!printer.print(parameters, this.OUTPUT_SRC_PATH)) System.out.println(STR); } | /**
* Prints NIST arrays.
*/ | Prints NIST arrays | testNIST | {
"repo_name": "RushangKaria/JEssentials",
"path": "samples/coveringarray/printers/CoveringArrayPrinterDemo.java",
"license": "gpl-3.0",
"size": 3666
} | [
"com.coveringarray.CoveringArrayParameters",
"com.coveringarray.printers.CoveringArrayPrinter"
] | import com.coveringarray.CoveringArrayParameters; import com.coveringarray.printers.CoveringArrayPrinter; | import com.coveringarray.*; import com.coveringarray.printers.*; | [
"com.coveringarray",
"com.coveringarray.printers"
] | com.coveringarray; com.coveringarray.printers; | 1,566,917 |
@Override
public List<DelayedEntry> failureList() {
List failedDelayedEntries = new ArrayList<DelayedEntry>(1);
failedDelayedEntries.add(entry);
return failedDelayedEntries;
}
});
} | List<DelayedEntry> function() { List failedDelayedEntries = new ArrayList<DelayedEntry>(1); failedDelayedEntries.add(entry); return failedDelayedEntries; } }); } | /**
* Call when store failed.
*/ | Call when store failed | failureList | {
"repo_name": "tufangorel/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/map/impl/mapstore/writebehind/DefaultWriteBehindProcessor.java",
"license": "apache-2.0",
"size": 17093
} | [
"com.hazelcast.map.impl.mapstore.writebehind.entry.DelayedEntry",
"java.util.ArrayList",
"java.util.List"
] | import com.hazelcast.map.impl.mapstore.writebehind.entry.DelayedEntry; import java.util.ArrayList; import java.util.List; | import com.hazelcast.map.impl.mapstore.writebehind.entry.*; import java.util.*; | [
"com.hazelcast.map",
"java.util"
] | com.hazelcast.map; java.util; | 2,478,694 |
public PIPResponse getAttributes(PIPRequest pipRequest) throws PIPException; | PIPResponse function(PIPRequest pipRequest) throws PIPException; | /**
* Gets the {@link com.att.research.xacml.api.pip.PIPResponse} containing {@link com.att.research.xacml.api.Attribute}s that
* match the given {@link com.att.research.xacml.api.pip.PIPRequest} from this <code>EvaluationContext</code>.
*
* @param pipRequest the <code>PIPRequest</code> specifying which <code>... | Gets the <code>com.att.research.xacml.api.pip.PIPResponse</code> containing <code>com.att.research.xacml.api.Attribute</code>s that match the given <code>com.att.research.xacml.api.pip.PIPRequest</code> from this <code>EvaluationContext</code> | getAttributes | {
"repo_name": "att/XACML",
"path": "XACML-PDP/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContext.java",
"license": "mit",
"size": 3252
} | [
"com.att.research.xacml.api.pip.PIPException",
"com.att.research.xacml.api.pip.PIPRequest",
"com.att.research.xacml.api.pip.PIPResponse"
] | import com.att.research.xacml.api.pip.PIPException; import com.att.research.xacml.api.pip.PIPRequest; import com.att.research.xacml.api.pip.PIPResponse; | import com.att.research.xacml.api.pip.*; | [
"com.att.research"
] | com.att.research; | 1,235,620 |
public synchronized void addEventListener(PowerMaxEventListener listener) {
if (connector != null) {
connector.addEventListener(listener);
}
} | synchronized void function(PowerMaxEventListener listener) { if (connector != null) { connector.addEventListener(listener); } } | /**
* Add event listener
*
* @param listener
* the listener to be added
*/ | Add event listener | addEventListener | {
"repo_name": "computergeek1507/openhab",
"path": "bundles/binding/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowerMaxCommDriver.java",
"license": "epl-1.0",
"size": 22073
} | [
"org.openhab.binding.powermax.internal.connector.PowerMaxEventListener"
] | import org.openhab.binding.powermax.internal.connector.PowerMaxEventListener; | import org.openhab.binding.powermax.internal.connector.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 907,265 |
public RoutingAlgorithms setOVXBigSwitchRouting(final long dpid,
final String alg, final byte numBackups)
throws RoutingAlgorithmException {
RoutingAlgorithms algorithm = new RoutingAlgorithms(alg, numBackups);
((OVXBigSwitch) this.getSwitch(dpid)).setAlg(algorithm);
... | RoutingAlgorithms function(final long dpid, final String alg, final byte numBackups) throws RoutingAlgorithmException { RoutingAlgorithms algorithm = new RoutingAlgorithms(alg, numBackups); ((OVXBigSwitch) this.getSwitch(dpid)).setAlg(algorithm); return algorithm; } | /**
* Sets the algorithm and number of backups for the
* big switch routing.
*
* @param dpid the virtual dpid
* @param alg the algorithm
* @param numBackups the number of backups
* @return the routing algorithm instance
* @throws RoutingAlgorithmException
*/ | Sets the algorithm and number of backups for the big switch routing | setOVXBigSwitchRouting | {
"repo_name": "opennetworkinglab/OpenVirteX",
"path": "src/main/java/net/onrc/openvirtex/elements/network/OVXNetwork.java",
"license": "apache-2.0",
"size": 26987
} | [
"net.onrc.openvirtex.elements.datapath.OVXBigSwitch",
"net.onrc.openvirtex.exceptions.RoutingAlgorithmException",
"net.onrc.openvirtex.routing.RoutingAlgorithms"
] | import net.onrc.openvirtex.elements.datapath.OVXBigSwitch; import net.onrc.openvirtex.exceptions.RoutingAlgorithmException; import net.onrc.openvirtex.routing.RoutingAlgorithms; | import net.onrc.openvirtex.elements.datapath.*; import net.onrc.openvirtex.exceptions.*; import net.onrc.openvirtex.routing.*; | [
"net.onrc.openvirtex"
] | net.onrc.openvirtex; | 690,265 |
// JUnitDoclet begin method testcase.createInstance
Command cmd = new DeleteCommand("TestDelete", getDrawingEditor());
return new CommandCheckBoxMenuItem(cmd);
// JUnitDoclet end method testcase.createInstance
}
| Command cmd = new DeleteCommand(STR, getDrawingEditor()); return new CommandCheckBoxMenuItem(cmd); } | /**
* Factory method for instances of the class to be tested.
*/ | Factory method for instances of the class to be tested | createInstance | {
"repo_name": "samskivert/jhotdraw6",
"path": "src/test/java/org/jhotdraw/test/contrib/CommandCheckBoxMenuItemTest.java",
"license": "lgpl-2.1",
"size": 4268
} | [
"org.jhotdraw.contrib.CommandCheckBoxMenuItem",
"org.jhotdraw.standard.DeleteCommand",
"org.jhotdraw.util.Command"
] | import org.jhotdraw.contrib.CommandCheckBoxMenuItem; import org.jhotdraw.standard.DeleteCommand; import org.jhotdraw.util.Command; | import org.jhotdraw.contrib.*; import org.jhotdraw.standard.*; import org.jhotdraw.util.*; | [
"org.jhotdraw.contrib",
"org.jhotdraw.standard",
"org.jhotdraw.util"
] | org.jhotdraw.contrib; org.jhotdraw.standard; org.jhotdraw.util; | 561,769 |
@Override
public Date getFirstStart(int prevRawOffset, int prevDSTSavings) {
// No start time available
return null;
} | Date function(int prevRawOffset, int prevDSTSavings) { return null; } | /**
* {@inheritDoc}<br><br>
* Note: This method in <code>InitialTimeZoneRule</code> always returns null.
*
* @stable ICU 3.8
*/ | Note: This method in <code>InitialTimeZoneRule</code> always returns null | getFirstStart | {
"repo_name": "abhijitvalluri/fitnotifications",
"path": "icu4j/src/main/java/com/ibm/icu/util/InitialTimeZoneRule.java",
"license": "apache-2.0",
"size": 3299
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,093,872 |
public Set<SingleSignOnSessionKey> findSessions() {
return sessionKeys.keySet();
} | Set<SingleSignOnSessionKey> function() { return sessionKeys.keySet(); } | /**
* Returns the HTTP Session identifiers associated with this SSO.
*
* @return The identifiers for the HTTP sessions that are current associated
* with this SSo entry
*/ | Returns the HTTP Session identifiers associated with this SSO | findSessions | {
"repo_name": "apache/tomcat",
"path": "java/org/apache/catalina/authenticator/SingleSignOnEntry.java",
"license": "apache-2.0",
"size": 7640
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,662,151 |
void splitData(Node node, Node newNode, int offset) {
// notify ranges
if (ranges != null) {
int size = ranges.size();
for (int i = 0; i != size; i++) {
((RangeImpl)ranges.elementAt(i)).receiveSplitData(node,
... | void splitData(Node node, Node newNode, int offset) { if (ranges != null) { int size = ranges.size(); for (int i = 0; i != size; i++) { ((RangeImpl)ranges.elementAt(i)).receiveSplitData(node, newNode, offset); } } } // | /**
* A method to be called when a text node has been split,
* so that live objects can be notified.
*/ | A method to be called when a text node has been split, so that live objects can be notified | splitData | {
"repo_name": "lostdj/Jaklin-OpenJDK-JAXP",
"path": "src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java",
"license": "gpl-2.0",
"size": 50945
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,501,835 |
List<com.amazonaws.resources.ec2.Tag> createTags(List<Tag> tags); | List<com.amazonaws.resources.ec2.Tag> createTags(List<Tag> tags); | /**
* The convenient method form for the <code>CreateTags</code> action.
*
* @see #createTags(CreateTagsRequest)
*/ | The convenient method form for the <code>CreateTags</code> action | createTags | {
"repo_name": "smartpcr/aws-sdk-java-resources",
"path": "aws-resources-ec2/src/main/java/com/amazonaws/resources/ec2/Vpc.java",
"license": "apache-2.0",
"size": 28564
} | [
"com.amazonaws.services.ec2.model.Tag",
"java.util.List"
] | import com.amazonaws.services.ec2.model.Tag; import java.util.List; | import com.amazonaws.services.ec2.model.*; import java.util.*; | [
"com.amazonaws.services",
"java.util"
] | com.amazonaws.services; java.util; | 1,921,023 |
public static Object invokeMethodWithNoArgs(Object targetObject, Method method)
throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
// null argument array
final Object[] NO_ARGS = new Object[0];
// invoke method
return method.invoke(targetObject, NO_ARGS);
}
| static Object function(Object targetObject, Method method) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { final Object[] NO_ARGS = new Object[0]; return method.invoke(targetObject, NO_ARGS); } | /**
* Invoke method with no arguments.
*
* @param targetObject
* the object to invoke the method on.
* @param method
* the no-arg method to invoke.
*
* @return The result returned by the invoked method.
*
* @throws InvocationTargetException
* If meth... | Invoke method with no arguments | invokeMethodWithNoArgs | {
"repo_name": "athrane/pineapple",
"path": "modules/pineapple-api/src/main/java/com/alpha/javautils/reflection/MethodUtils.java",
"license": "gpl-3.0",
"size": 14770
} | [
"java.lang.reflect.InvocationTargetException",
"java.lang.reflect.Method"
] | import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 816,318 |
public void testSignificanceOnTextArrays() throws IOException {
TextFieldType textFieldType = new TextFieldType();
textFieldType.setName("text");
textFieldType.setIndexAnalyzer(new NamedAnalyzer("my_analyzer", AnalyzerScope.GLOBAL, new StandardAnalyzer()));
IndexWriterConfig indexWr... | void function() throws IOException { TextFieldType textFieldType = new TextFieldType(); textFieldType.setName("text"); textFieldType.setIndexAnalyzer(new NamedAnalyzer(STR, AnalyzerScope.GLOBAL, new StandardAnalyzer())); IndexWriterConfig indexWriterConfig = newIndexWriterConfig(); indexWriterConfig.setMaxBufferedDocs(... | /**
* Test documents with arrays of text
*/ | Test documents with arrays of text | testSignificanceOnTextArrays | {
"repo_name": "coding0011/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/search/aggregations/bucket/significant/SignificantTextAggregatorTests.java",
"license": "apache-2.0",
"size": 11002
} | [
"java.io.IOException",
"java.util.Arrays",
"org.apache.lucene.analysis.standard.StandardAnalyzer",
"org.apache.lucene.document.Document",
"org.apache.lucene.document.Field",
"org.apache.lucene.document.StoredField",
"org.apache.lucene.index.DirectoryReader",
"org.apache.lucene.index.IndexReader",
"o... | import java.io.IOException; import java.util.Arrays; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StoredField; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.i... | import java.io.*; import java.util.*; import org.apache.lucene.analysis.standard.*; import org.apache.lucene.document.*; import org.apache.lucene.index.*; import org.apache.lucene.search.*; import org.apache.lucene.store.*; import org.apache.lucene.util.*; import org.elasticsearch.index.analysis.*; import org.elasticse... | [
"java.io",
"java.util",
"org.apache.lucene",
"org.elasticsearch.index"
] | java.io; java.util; org.apache.lucene; org.elasticsearch.index; | 2,689,808 |
final DateTime now = UtcTime.now();
// with null launch time
Machine noLaunchTime = Machine.builder().id("i-1").machineState(MachineState.REQUESTED).cloudProvider("AWS-EC2")
.region("us-east-1").machineSize("m1.small").build();
Machine noLaunchTimeClone = Machine.builder().id("i-... | final DateTime now = UtcTime.now(); Machine noLaunchTime = Machine.builder().id("i-1").machineState(MachineState.REQUESTED).cloudProvider(STR) .region(STR).machineSize(STR).build(); Machine noLaunchTimeClone = Machine.builder().id("i-1").machineState(MachineState.REQUESTED) .cloudProvider(STR).region(STR).machineSize(S... | /**
* Verify behavior of equals comparisons.
*
* @throws IOException
*/ | Verify behavior of equals comparisons | testEquality | {
"repo_name": "elastisys/scale.cloudpool",
"path": "api/src/test/java/com/elastisys/scale/cloudpool/api/types/TestMachine.java",
"license": "apache-2.0",
"size": 15668
} | [
"com.elastisys.scale.commons.json.JsonUtils",
"com.elastisys.scale.commons.util.time.UtcTime",
"com.google.gson.JsonObject",
"org.joda.time.DateTime",
"org.junit.Assert"
] | import com.elastisys.scale.commons.json.JsonUtils; import com.elastisys.scale.commons.util.time.UtcTime; import com.google.gson.JsonObject; import org.joda.time.DateTime; import org.junit.Assert; | import com.elastisys.scale.commons.json.*; import com.elastisys.scale.commons.util.time.*; import com.google.gson.*; import org.joda.time.*; import org.junit.*; | [
"com.elastisys.scale",
"com.google.gson",
"org.joda.time",
"org.junit"
] | com.elastisys.scale; com.google.gson; org.joda.time; org.junit; | 1,094,872 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Void>> deleteWithResponseAsync(
String resourceGroupName, String accountName, String assetName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new Il... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Void>> function( String resourceGroupName, String accountName, String assetName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .er... | /**
* Deletes an Asset in the Media Services account.
*
* @param resourceGroupName The name of the resource group within the Azure subscription.
* @param accountName The Media Services account name.
* @param assetName The Asset name.
* @param context The context to associate with this oper... | Deletes an Asset in the Media Services account | deleteWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/mediaservices/azure-resourcemanager-mediaservices/src/main/java/com/azure/resourcemanager/mediaservices/implementation/AssetsClientImpl.java",
"license": "mit",
"size": 84704
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 423,160 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller<PollResult<String>, String> beginStopPacketCapture(
String resourceGroupName,
String gatewayName,
VpnGatewayPacketCaptureStopParameters parameters,
Context context) {
return beginStopPacketCaptu... | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<String>, String> function( String resourceGroupName, String gatewayName, VpnGatewayPacketCaptureStopParameters parameters, Context context) { return beginStopPacketCaptureAsync(resourceGroupName, gatewayName, parameters, context).getSyncP... | /**
* Stops packet capture on vpn gateway in the specified resource group.
*
* @param resourceGroupName The resource group name of the VpnGateway.
* @param gatewayName The name of the gateway.
* @param parameters Vpn gateway packet capture parameters supplied to stop packet capture on vpn gatew... | Stops packet capture on vpn gateway in the specified resource group | beginStopPacketCapture | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VpnGatewaysClientImpl.java",
"license": "mit",
"size": 124002
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.network.models.VpnGatewayPacketCaptureStopParameters"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.models.VpnGatewayPacketCaptureStopParameters; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 682,134 |
interface WithDuplicateDetectionHistoryTimeWindow {
Update withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow);
} | interface WithDuplicateDetectionHistoryTimeWindow { Update withDuplicateDetectionHistoryTimeWindow(Period duplicateDetectionHistoryTimeWindow); } | /**
* Specifies duplicateDetectionHistoryTimeWindow.
* @param duplicateDetectionHistoryTimeWindow ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes
* @return the next update stage
*/ | Specifies duplicateDetectionHistoryTimeWindow | withDuplicateDetectionHistoryTimeWindow | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/servicebus/mgmt-v2017_04_01/src/main/java/com/microsoft/azure/management/servicebus/v2017_04_01/SBSubscription.java",
"license": "mit",
"size": 18384
} | [
"org.joda.time.Period"
] | import org.joda.time.Period; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 2,029,329 |
private void addDuplicatedBlock(int fileRef, int blockCount) {
checkArgument(blockCount > 1, "BlockCount can not be less than 2");
TextBlock original = new TextBlock(1, 1);
TextBlock[] duplicates = new TextBlock[blockCount - 1];
for (int i = 2; i < blockCount + 1; i++) {
duplicates[i - 2] = new ... | void function(int fileRef, int blockCount) { checkArgument(blockCount > 1, STR); TextBlock original = new TextBlock(1, 1); TextBlock[] duplicates = new TextBlock[blockCount - 1]; for (int i = 2; i < blockCount + 1; i++) { duplicates[i - 2] = new TextBlock(i, i); } duplicationRepository.addDuplication(fileRef, original,... | /**
* Adds duplication blocks of a single line (each line is specific to its block).
*
* This is a very simple use case, convenient for unit tests but more realistic and complex use cases must be tested separately.
*/ | Adds duplication blocks of a single line (each line is specific to its block). This is a very simple use case, convenient for unit tests but more realistic and complex use cases must be tested separately | addDuplicatedBlock | {
"repo_name": "lbndev/sonarqube",
"path": "server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/NewSizeMeasuresStepTest.java",
"license": "lgpl-3.0",
"size": 18305
} | [
"com.google.common.base.Preconditions",
"org.sonar.server.computation.task.projectanalysis.duplication.TextBlock"
] | import com.google.common.base.Preconditions; import org.sonar.server.computation.task.projectanalysis.duplication.TextBlock; | import com.google.common.base.*; import org.sonar.server.computation.task.projectanalysis.duplication.*; | [
"com.google.common",
"org.sonar.server"
] | com.google.common; org.sonar.server; | 299,893 |
public List<String> listMyDBs(String owner, boolean restricted)
{
Connection conn = null;
try
{
conn = getConnection();
return listMyDBs(conn, owner, restricted);
}catch(Exception ex)
{
logger.log(Level.SEVERE,"Exception", ex);
}
finally
{
DBUtils.close(conn);
}
return null;... | List<String> function(String owner, boolean restricted) { Connection conn = null; try { conn = getConnection(); return listMyDBs(conn, owner, restricted); }catch(Exception ex) { logger.log(Level.SEVERE,STR, ex); } finally { DBUtils.close(conn); } return null; } | /**
* List database groups the specific user has provided passwords
* @param owner
* @return
*/ | List database groups the specific user has provided passwords | listMyDBs | {
"repo_name": "wgpshashank/mysql_perf_analyzer",
"path": "myperf/src/main/java/com/yahoo/dba/perf/myperf/meta/MetaDB.java",
"license": "apache-2.0",
"size": 34052
} | [
"com.yahoo.dba.perf.myperf.common.DBUtils",
"java.sql.Connection",
"java.util.List",
"java.util.logging.Level"
] | import com.yahoo.dba.perf.myperf.common.DBUtils; import java.sql.Connection; import java.util.List; import java.util.logging.Level; | import com.yahoo.dba.perf.myperf.common.*; import java.sql.*; import java.util.*; import java.util.logging.*; | [
"com.yahoo.dba",
"java.sql",
"java.util"
] | com.yahoo.dba; java.sql; java.util; | 506,042 |
public ContentType getRequestContentType(); | ContentType function(); | /**
* Returns the {@link ContentType} of the data that will be written to the
* service by this request or {@code null} if no data is written to the
* server by the request.
*/ | Returns the <code>ContentType</code> of the data that will be written to the service by this request or null if no data is written to the server by the request | getRequestContentType | {
"repo_name": "simonrrr/gdata-java-client",
"path": "java/src/com/google/gdata/client/Service.java",
"license": "apache-2.0",
"size": 83027
} | [
"com.google.gdata.util.ContentType"
] | import com.google.gdata.util.ContentType; | import com.google.gdata.util.*; | [
"com.google.gdata"
] | com.google.gdata; | 491,261 |
public void filterStateChanged(ChangeEvent e);
} // end of FilterChangeListener
private FiltersManager(FiltersDescription descr) {
comp = new FiltersComponent(descr);
}
private class FiltersComponent extends Box implements ActionListener {
private List<JTogg... | void function(ChangeEvent e); } private FiltersManager(FiltersDescription descr) { comp = new FiltersComponent(descr); } private class FiltersComponent extends Box implements ActionListener { private List<JToggleButton> toggles; private final FiltersDescription filtersDesc; private final Object L_LOCK = new Object(); p... | /** Called whenever some changes in state of filters contained in
* filters panel is triggered
* @param e
*/ | Called whenever some changes in state of filters contained in filters panel is triggered | filterStateChanged | {
"repo_name": "tunnelvisionlabs/antlrworks2",
"path": "org-antlr-netbeans/src/org/antlr/netbeans/editor/navigation/FiltersManager.java",
"license": "gpl-2.0",
"size": 11594
} | [
"java.awt.event.ActionListener",
"java.util.List",
"java.util.Map",
"javax.swing.Box",
"javax.swing.JToggleButton",
"javax.swing.JToolBar",
"javax.swing.event.ChangeEvent"
] | import java.awt.event.ActionListener; import java.util.List; import java.util.Map; import javax.swing.Box; import javax.swing.JToggleButton; import javax.swing.JToolBar; import javax.swing.event.ChangeEvent; | import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; | [
"java.awt",
"java.util",
"javax.swing"
] | java.awt; java.util; javax.swing; | 2,260,502 |
public boolean canHandleFile(File file)
throws IOException
{
if (isXMLFile(file))
return false;
//if it's not an XML file, give it a whirl, since this is the default handler
return true;
} | boolean function(File file) throws IOException { if (isXMLFile(file)) return false; return true; } | /**
* Can this type of file handler handle this specific file?
* Implementation is up to the handler, but this should be as low-cost as possible
* @param file
* @return
* @throws IOException
*/ | Can this type of file handler handle this specific file? Implementation is up to the handler, but this should be as low-cost as possible | canHandleFile | {
"repo_name": "dhmay/msInspect",
"path": "src/org/fhcrc/cpl/toolbox/proteomics/feature/filehandler/NativeTSVFeatureFileHandler.java",
"license": "apache-2.0",
"size": 8966
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,566,558 |
private void populateGenomicObjects(Map genomicIdentifierSetValues, String pathTraversed)
{
gene = null;
messengerRNA = null;
protein = null;
Long dataSourceId = null;
String[] dataSourceIdsInCurrentPath = pathTraversed.split(PATH_NODES_DELIMITER);
for (int i = 0; i < dataSourceIdsInCurrentPa... | void function(Map genomicIdentifierSetValues, String pathTraversed) { gene = null; messengerRNA = null; protein = null; Long dataSourceId = null; String[] dataSourceIdsInCurrentPath = pathTraversed.split(PATH_NODES_DELIMITER); for (int i = 0; i < dataSourceIdsInCurrentPath.length; i++) { dataSourceId = new Long(dataSou... | /**
* Populate Gene, mrna and protain objects using the values from the map.
* Only values for those data sources which are part of current path are populated.
*/ | Populate Gene, mrna and protain objects using the values from the map. Only values for those data sources which are part of current path are populated | populateGenomicObjects | {
"repo_name": "NCIP/geneconnect",
"path": "Coding and Testing/GeneConnect/src/edu/wustl/geneconnect/postwork/SummaryCalculator.java",
"license": "bsd-3-clause",
"size": 54569
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 276,356 |
List<Repository> repositories = buildService.getRepos();
HashMap<String, List<Repository>> map = new HashMap<String, List<Repository>>();
map.put("repositories", repositories);
String jsonRepos = new Gson().toJson(map);
return jsonRepos;
}
| List<Repository> repositories = buildService.getRepos(); HashMap<String, List<Repository>> map = new HashMap<String, List<Repository>>(); map.put(STR, repositories); String jsonRepos = new Gson().toJson(map); return jsonRepos; } | /**
* curl http://localhost:8080/ws/repository
* Sample Ouputs:
* {
* "repos":[
* {"id":1,"repoUrl":"git@git.flysnow.org:ci/helloworld.git"},
* {"id":2,"repoUrl":"git@git.flysnow.org:ci/releasemanager.git"}
* ]
* }
* @return
... | curl HREF Sample Ouputs: { "repos":[ {"id":1,"repoUrl":"git@git.flysnow.org:ci/helloworld.git"}, {"id":2,"repoUrl":"git@git.flysnow.org:ci/releasemanager.git"} ] } | getRepos | {
"repo_name": "shensiduanxing/devops-metadata-svc",
"path": "src/main/java/org/flysnow/cloud/buildmeta/ui/resteasy/RepositoryResource.java",
"license": "apache-2.0",
"size": 2997
} | [
"com.google.gson.Gson",
"java.util.HashMap",
"java.util.List",
"org.flysnow.cloud.buildmeta.domain.model.Repository"
] | import com.google.gson.Gson; import java.util.HashMap; import java.util.List; import org.flysnow.cloud.buildmeta.domain.model.Repository; | import com.google.gson.*; import java.util.*; import org.flysnow.cloud.buildmeta.domain.model.*; | [
"com.google.gson",
"java.util",
"org.flysnow.cloud"
] | com.google.gson; java.util; org.flysnow.cloud; | 2,194,220 |
public String getEncodingForIndex(int charsetIndex) throws SQLException {
String javaEncoding = null;
if (getUseOldUTF8Behavior()) {
return getEncoding();
}
if (charsetIndex != MysqlDefs.NO_CHARSET_INFO) {
try {
if (this.indexToMysqlCharset.s... | String function(int charsetIndex) throws SQLException { String javaEncoding = null; if (getUseOldUTF8Behavior()) { return getEncoding(); } if (charsetIndex != MysqlDefs.NO_CHARSET_INFO) { try { if (this.indexToMysqlCharset.size() > 0) { javaEncoding = CharsetMapping.getJavaEncodingForMysqlCharset(this.indexToMysqlChars... | /**
* Returns the Java character encoding name for the given MySQL server
* charset index
*
* @param charsetIndex
* @return the Java character encoding name for the given MySQL server
* charset index
* @throws SQLException
* if the character set index isn't k... | Returns the Java character encoding name for the given MySQL server charset index | getEncodingForIndex | {
"repo_name": "richardgutkowski/ansible-roles",
"path": "stash/files/mysql-connector-java-5.1.35/src/com/mysql/jdbc/ConnectionImpl.java",
"license": "mit",
"size": 215141
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 565,544 |
public DictionaryValidationService getDictionaryValidationService() {
return dictionaryValidationService;
} | DictionaryValidationService function() { return dictionaryValidationService; } | /**
* Gets the dictionaryValidationService attribute.
* @return Returns the dictionaryValidationService.
*/ | Gets the dictionaryValidationService attribute | getDictionaryValidationService | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-core/src/main/java/org/kuali/kfs/sys/document/validation/impl/BusinessObjectDataDictionaryValidation.java",
"license": "agpl-3.0",
"size": 6621
} | [
"org.kuali.rice.kns.service.DictionaryValidationService"
] | import org.kuali.rice.kns.service.DictionaryValidationService; | import org.kuali.rice.kns.service.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,645,032 |
public void reportInitialized( final ReportEvent event ) {
setCount( 0 );
} | void function( final ReportEvent event ) { setCount( 0 ); } | /**
* Receives notification that a new report is about to start. Resets the count.
*
* @param event
* the current report event received.
*/ | Receives notification that a new report is about to start. Resets the count | reportInitialized | {
"repo_name": "mbatchelor/pentaho-reporting",
"path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/function/GroupCountFunction.java",
"license": "lgpl-2.1",
"size": 4830
} | [
"org.pentaho.reporting.engine.classic.core.event.ReportEvent"
] | import org.pentaho.reporting.engine.classic.core.event.ReportEvent; | import org.pentaho.reporting.engine.classic.core.event.*; | [
"org.pentaho.reporting"
] | org.pentaho.reporting; | 51,403 |
public SettingsRecord getDefaultSettings() {
return configurationService.loadDefaultConfig();
} | SettingsRecord function() { return configurationService.loadDefaultConfig(); } | /**
* This function is only called when the default configuration is loaded
* and is no config in the database or external files
*/ | This function is only called when the default configuration is loaded and is no config in the database or external files | getDefaultSettings | {
"repo_name": "justin-hayes/motech",
"path": "platform/server-bundle/src/main/java/org/motechproject/server/startup/StartupManager.java",
"license": "bsd-3-clause",
"size": 6302
} | [
"org.motechproject.server.config.domain.SettingsRecord"
] | import org.motechproject.server.config.domain.SettingsRecord; | import org.motechproject.server.config.domain.*; | [
"org.motechproject.server"
] | org.motechproject.server; | 2,652,328 |
@Test(expected=MathIllegalArgumentException.class)
public void testFit02() {
GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer());
fitter.fit();
} | @Test(expected=MathIllegalArgumentException.class) void function() { GaussianFitter fitter = new GaussianFitter(new LevenbergMarquardtOptimizer()); fitter.fit(); } | /**
* Zero points is not enough observed points.
*/ | Zero points is not enough observed points | testFit02 | {
"repo_name": "venkateshamurthy/java-quantiles",
"path": "src/test/java/org/apache/commons/math3/optimization/fitting/GaussianFitterTest.java",
"license": "apache-2.0",
"size": 12347
} | [
"org.apache.commons.math3.exception.MathIllegalArgumentException",
"org.apache.commons.math3.optimization.general.LevenbergMarquardtOptimizer",
"org.junit.Test"
] | import org.apache.commons.math3.exception.MathIllegalArgumentException; import org.apache.commons.math3.optimization.general.LevenbergMarquardtOptimizer; import org.junit.Test; | import org.apache.commons.math3.exception.*; import org.apache.commons.math3.optimization.general.*; import org.junit.*; | [
"org.apache.commons",
"org.junit"
] | org.apache.commons; org.junit; | 315,001 |
boolean addImplementedInterface(JSTypeExpression interfaceName) {
lazyInitInfo();
if (info.implementedInterfaces == null) {
info.implementedInterfaces = Lists.newArrayListWithCapacity(2);
}
if (info.implementedInterfaces.contains(interfaceName)) {
return false;
}
info.implementedIn... | boolean addImplementedInterface(JSTypeExpression interfaceName) { lazyInitInfo(); if (info.implementedInterfaces == null) { info.implementedInterfaces = Lists.newArrayListWithCapacity(2); } if (info.implementedInterfaces.contains(interfaceName)) { return false; } info.implementedInterfaces.add(interfaceName); return tr... | /**
* Adds an implemented interface. Returns whether the interface was added. If
* the interface was already present in the list, it won't get added again.
*/ | Adds an implemented interface. Returns whether the interface was added. If the interface was already present in the list, it won't get added again | addImplementedInterface | {
"repo_name": "ehsan/js-symbolic-executor",
"path": "closure-compiler/src/com/google/javascript/rhino/JSDocInfo.java",
"license": "apache-2.0",
"size": 31979
} | [
"com.google.common.collect.Lists"
] | import com.google.common.collect.Lists; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,059,935 |
public void error(StringId msgID, Object param, Throwable ex) {
if (this.errorEnabled()) {
this.put(ERROR_LEVEL, msgID, new Object[] {param}, ex);
}
} | void function(StringId msgID, Object param, Throwable ex) { if (this.errorEnabled()) { this.put(ERROR_LEVEL, msgID, new Object[] {param}, ex); } } | /**
* Writes both a message and exception to this writer.
* The message level is "error".
* @since 6.0
*/ | Writes both a message and exception to this writer. The message level is "error" | error | {
"repo_name": "SnappyDataInc/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/LogWriterImpl.java",
"license": "apache-2.0",
"size": 43096
} | [
"com.gemstone.org.jgroups.util.StringId"
] | import com.gemstone.org.jgroups.util.StringId; | import com.gemstone.org.jgroups.util.*; | [
"com.gemstone.org"
] | com.gemstone.org; | 70,263 |
interface WithLinks {
Update withLinks(List<ExpressRouteLinkInner> links);
} | interface WithLinks { Update withLinks(List<ExpressRouteLinkInner> links); } | /**
* Specifies links.
* @param links The set of physical links of the ExpressRoutePort resource
* @return the next update stage
*/ | Specifies links | withLinks | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/ExpressRoutePort.java",
"license": "mit",
"size": 9693
} | [
"com.microsoft.azure.management.network.v2019_07_01.implementation.ExpressRouteLinkInner",
"java.util.List"
] | import com.microsoft.azure.management.network.v2019_07_01.implementation.ExpressRouteLinkInner; import java.util.List; | import com.microsoft.azure.management.network.v2019_07_01.implementation.*; import java.util.*; | [
"com.microsoft.azure",
"java.util"
] | com.microsoft.azure; java.util; | 1,359,305 |
private void attemptMergeColInfoRecords(int colInfoIx) {
int nRecords = records.size();
if (colInfoIx < 0 || colInfoIx >= nRecords) {
throw new IllegalArgumentException("colInfoIx " + colInfoIx
+ " is out of range (0.." + (nRecords-1) + ")");
}
ColumnInfoRecord currentCol = getColInfo(colInfoIx);
i... | void function(int colInfoIx) { int nRecords = records.size(); if (colInfoIx < 0 colInfoIx >= nRecords) { throw new IllegalArgumentException(STR + colInfoIx + STR + (nRecords-1) + ")"); } ColumnInfoRecord currentCol = getColInfo(colInfoIx); int nextIx = colInfoIx+1; if (nextIx < nRecords) { if (mergeColInfoRecords(curre... | /**
* Attempts to merge the col info record at the specified index
* with either or both of its neighbours
*/ | Attempts to merge the col info record at the specified index with either or both of its neighbours | attemptMergeColInfoRecords | {
"repo_name": "lvweiwolf/poi-3.16",
"path": "src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java",
"license": "apache-2.0",
"size": 16806
} | [
"org.apache.poi.hssf.record.ColumnInfoRecord"
] | import org.apache.poi.hssf.record.ColumnInfoRecord; | import org.apache.poi.hssf.record.*; | [
"org.apache.poi"
] | org.apache.poi; | 1,947,779 |
protected void addPatternPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Column_pattern_featur... | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), Query2tablePackage.Literals.COLUMN__PATTERN, true, false, false, ItemPropertyDescriptor.GENERIC_V... | /**
* This adds a property descriptor for the Pattern feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Pattern feature. | addPatternPropertyDescriptor | {
"repo_name": "TristanFAURE/query2Table",
"path": "plugins/org.topcased.model2doc.query2table.edit/src/org/topcased/model2doc/query2table/provider/ColumnItemProvider.java",
"license": "epl-1.0",
"size": 12137
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.topcased.model2doc.query2table.Query2tablePackage"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.topcased.model2doc.query2table.Query2tablePackage; | import org.eclipse.emf.edit.provider.*; import org.topcased.model2doc.query2table.*; | [
"org.eclipse.emf",
"org.topcased.model2doc"
] | org.eclipse.emf; org.topcased.model2doc; | 458,613 |
@Message(id = 40, value = "A component named '%s' is already defined in this module")
IllegalArgumentException componentAlreadyDefined(String name); | @Message(id = 40, value = STR) IllegalArgumentException componentAlreadyDefined(String name); | /**
* Creates an exception indicating a component, represented by the {@code name} parameter, is already defined in
* this module.
*
* @param name the name of the module.
*
* @return an {@link IllegalArgumentException} for the error.
*/ | Creates an exception indicating a component, represented by the name parameter, is already defined in this module | componentAlreadyDefined | {
"repo_name": "tomazzupan/wildfly",
"path": "ee/src/main/java/org/jboss/as/ee/logging/EeLogger.java",
"license": "lgpl-2.1",
"size": 48634
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 638,269 |
private IgfsFileInfo resolveFileInfo(IgfsPath path, IgfsMode mode) throws IgniteCheckedException {
assert path != null;
assert mode != null;
IgfsFileInfo info = null;
switch (mode) {
case PRIMARY:
info = meta.info(meta.fileId(path));
bre... | IgfsFileInfo function(IgfsPath path, IgfsMode mode) throws IgniteCheckedException { assert path != null; assert mode != null; IgfsFileInfo info = null; switch (mode) { case PRIMARY: info = meta.info(meta.fileId(path)); break; case DUAL_SYNC: case DUAL_ASYNC: info = meta.info(meta.fileId(path)); if (info == null) { Igfs... | /**
* Resolve file info for the given path and the given mode.
*
* @param path Path.
* @param mode Mode.
* @return File info or {@code null} in case file is not found.
* @throws IgniteCheckedException If failed.
*/ | Resolve file info for the given path and the given mode | resolveFileInfo | {
"repo_name": "agura/incubator-ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java",
"license": "apache-2.0",
"size": 71432
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.igfs.IgfsFile",
"org.apache.ignite.igfs.IgfsMode",
"org.apache.ignite.igfs.IgfsPath"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.igfs.IgfsFile; import org.apache.ignite.igfs.IgfsMode; import org.apache.ignite.igfs.IgfsPath; | import org.apache.ignite.*; import org.apache.ignite.igfs.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 945,742 |
public CcLibraryHelper addPrivateHeaders(Iterable<Artifact> privateHeaders) {
Iterables.addAll(this.privateHeaders, privateHeaders);
return this;
} | CcLibraryHelper function(Iterable<Artifact> privateHeaders) { Iterables.addAll(this.privateHeaders, privateHeaders); return this; } | /**
* Add the corresponding files as private header files, i.e., these files will not be compiled,
* but are not made visible as includes to dependent rules in module maps.
*/ | Add the corresponding files as private header files, i.e., these files will not be compiled, but are not made visible as includes to dependent rules in module maps | addPrivateHeaders | {
"repo_name": "kidaa/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java",
"license": "apache-2.0",
"size": 39258
} | [
"com.google.common.collect.Iterables",
"com.google.devtools.build.lib.actions.Artifact"
] | import com.google.common.collect.Iterables; import com.google.devtools.build.lib.actions.Artifact; | import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 1,283,846 |
public Map<Integer, SpacePoint> getInternalMap() {
return points;
}
| Map<Integer, SpacePoint> function() { return points; } | /**
* Attention: Do NOT store references to the internal map of points from outside
* the pile engine. Always only dynamically access it when needed.
* @return the internal pile engine used by this agent.
*/ | Attention: Do NOT store references to the internal map of points from outside the pile engine. Always only dynamically access it when needed | getInternalMap | {
"repo_name": "fabian-kostadinov/pile-system",
"path": "src/pile/engine/PileSpace.java",
"license": "gpl-2.0",
"size": 3678
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,478,005 |
public static InternationalString formatInternational(final short key, final Object... args) {
return new International(key, args);
} | static InternationalString function(final short key, final Object... args) { return new International(key, args); } | /**
* Gets an international string for the given key. This method does not check for the key
* validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
* when a {@link InternationalString#toString(Locale)} method is invoked.
*
* @param key The key for the desired... | Gets an international string for the given key. This method does not check for the key validity. If the key is invalid, then a <code>MissingResourceException</code> may be thrown when a <code>InternationalString#toString(Locale)</code> method is invoked | formatInternational | {
"repo_name": "desruisseaux/sis",
"path": "core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java",
"license": "apache-2.0",
"size": 45951
} | [
"org.opengis.util.InternationalString"
] | import org.opengis.util.InternationalString; | import org.opengis.util.*; | [
"org.opengis.util"
] | org.opengis.util; | 1,897,519 |
private String selectNewAssignment() {
for (Iterator<String> it = filesWithSignificantWork.iterator(); it.hasNext();) {
String fn = it.next();
if (!reservedFiles.contains(fn)) {
it.remove();
return fn;
}
}
for (Iterator<Stri... | String function() { for (Iterator<String> it = filesWithSignificantWork.iterator(); it.hasNext();) { String fn = it.next(); if (!reservedFiles.contains(fn)) { it.remove(); return fn; } } for (Iterator<String> it = filesWithInsignificantWork.iterator(); it.hasNext();) { String fn = it.next(); if (!reservedFiles.contains... | /**
* Return the name of the next file with available work
*/ | Return the name of the next file with available work | selectNewAssignment | {
"repo_name": "tdefilip/opennms",
"path": "opennms-rrd/opennms-rrd-api/src/main/java/org/opennms/netmgt/rrd/QueuingRrdStrategy.java",
"license": "agpl-3.0",
"size": 46906
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 990,509 |
String parseValue()
throws SQLException {
char c;
// skip over leading white space
while ((c = s.charAt(i)) == ' ') {
i++;
if (i >= n) {
return "";
}
}
if ((c == '"') || (c == '\'')) {
String value = parseQuoted(c);
// skip over trailing white space
... | String parseValue() throws SQLException { char c; while ((c = s.charAt(i)) == ' ') { i++; if (i >= n) { return STR') (c == '\'')) { String value = parseQuoted(c); while ((i < n) && ((c = s.charAt(i)) == ' ')) { i++; } if (i >= n) { return value; } else if (s.charAt(i) == ';') { i++; return value; } else { throw new SQL... | /**
* Reads "value;" or "value<EOF>"
*
* @throws SQLException if find an unterminated quoted value
*/ | Reads "value;" or "value" | parseValue | {
"repo_name": "glimpseio/incubator-calcite",
"path": "avatica/src/main/java/org/apache/calcite/avatica/ConnectStringParser.java",
"license": "apache-2.0",
"size": 10955
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,387,286 |
@Test
public void testStopMockObject() throws IOException {
RPC.stopProxy(MockitoUtil.mockProtocol(TestProtocol.class));
} | void function() throws IOException { RPC.stopProxy(MockitoUtil.mockProtocol(TestProtocol.class)); } | /**
* Test that the mockProtocol helper returns mock proxies that can
* be stopped without error.
*/ | Test that the mockProtocol helper returns mock proxies that can be stopped without error | testStopMockObject | {
"repo_name": "cnfire/hadoop",
"path": "hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestRPC.java",
"license": "apache-2.0",
"size": 38653
} | [
"java.io.IOException",
"org.apache.hadoop.test.MockitoUtil"
] | import java.io.IOException; import org.apache.hadoop.test.MockitoUtil; | import java.io.*; import org.apache.hadoop.test.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,619,863 |
private static void injectEntry( LdifEntry entry, DirectoryService service )
throws LdapException
{
if ( entry.isChangeAdd() || entry.isLdifContent() )
{
service.getAdminSession().add(
new DefaultEntry( service.getSchemaManager(), entry
.ge... | static void function( LdifEntry entry, DirectoryService service ) throws LdapException { if ( entry.isChangeAdd() entry.isLdifContent() ) { service.getAdminSession().add( new DefaultEntry( service.getSchemaManager(), entry .getEntry() ) ); } else if ( entry.isChangeModify() ) { service.getAdminSession().modify( entry.g... | /**
* injects an LDIF entry in the given DirectoryService
*
* @param entry
* the LdifEntry to be injected
* @param service
* the DirectoryService
* @throws Exception
*/ | injects an LDIF entry in the given DirectoryService | injectEntry | {
"repo_name": "lucastheisen/apache-directory-server",
"path": "core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java",
"license": "apache-2.0",
"size": 18046
} | [
"org.apache.directory.api.ldap.model.entry.DefaultEntry",
"org.apache.directory.api.ldap.model.exception.LdapException",
"org.apache.directory.api.ldap.model.ldif.LdifEntry",
"org.apache.directory.server.core.api.DirectoryService",
"org.apache.directory.server.i18n.I18n"
] | import org.apache.directory.api.ldap.model.entry.DefaultEntry; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.ldif.LdifEntry; import org.apache.directory.server.core.api.DirectoryService; import org.apache.directory.server.i18n.I18n; | import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.api.ldap.model.exception.*; import org.apache.directory.api.ldap.model.ldif.*; import org.apache.directory.server.core.api.*; import org.apache.directory.server.i18n.*; | [
"org.apache.directory"
] | org.apache.directory; | 1,689,525 |
protected void processNamedStoredFunctionQueries() {
// Process the XML named stored function queries first.
for (NamedStoredFunctionQueryMetadata namedStoredFunctionQuery : m_namedStoredFunctionQueries) {
getProject().addQuery(namedStoredFunctionQuery);
}
// Process the... | void function() { for (NamedStoredFunctionQueryMetadata namedStoredFunctionQuery : m_namedStoredFunctionQueries) { getProject().addQuery(namedStoredFunctionQuery); } MetadataAnnotation namedStoredFunctionQueries = getAnnotation(NamedStoredFunctionQueries.class); if (namedStoredFunctionQueries != null) { for (Object nam... | /**
* INTERNAL:
* Process/collect the named stored procedure queries on this accessor and
* add them to the project for later processing.
*/ | Process/collect the named stored procedure queries on this accessor and add them to the project for later processing | processNamedStoredFunctionQueries | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/MappedSuperclassAccessor.java",
"license": "epl-1.0",
"size": 77321
} | [
"org.eclipse.persistence.annotations.NamedStoredFunctionQueries",
"org.eclipse.persistence.annotations.NamedStoredFunctionQuery",
"org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation",
"org.eclipse.persistence.internal.jpa.metadata.queries.NamedStoredFunctionQueryMetadata"
] | import org.eclipse.persistence.annotations.NamedStoredFunctionQueries; import org.eclipse.persistence.annotations.NamedStoredFunctionQuery; import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotation; import org.eclipse.persistence.internal.jpa.metadata.queries.NamedStoredFunctionQueryMeta... | import org.eclipse.persistence.annotations.*; import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.*; import org.eclipse.persistence.internal.jpa.metadata.queries.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 2,207,487 |
@GET
@Path("/soap")
@ExamplePath("soap")
@Documentation(name = "SOAP Service list", description = "Return the list of all known"
+ " services' meta data objects.")
MetaData getAllSoapServiceMd() throws WsException; | @Path("/soap") @ExamplePath("soap") @Documentation(name = STR, description = STR + STR) MetaData getAllSoapServiceMd() throws WsException; | /**
* Return the list of all known RESTful services' meta data objects.
*
* @return a composite MD object containing a list of service meta data objects
*/ | Return the list of all known RESTful services' meta data objects | getAllSoapServiceMd | {
"repo_name": "openfurther/further-open-core",
"path": "core/core-metadata/src/main/java/edu/utah/further/core/metadata/service/UtilServiceRest.java",
"license": "apache-2.0",
"size": 3128
} | [
"edu.utah.further.core.api.exception.WsException",
"edu.utah.further.core.api.ws.Documentation",
"edu.utah.further.core.api.ws.ExamplePath",
"edu.utah.further.core.metadata.to.MetaData",
"javax.ws.rs.Path"
] | import edu.utah.further.core.api.exception.WsException; import edu.utah.further.core.api.ws.Documentation; import edu.utah.further.core.api.ws.ExamplePath; import edu.utah.further.core.metadata.to.MetaData; import javax.ws.rs.Path; | import edu.utah.further.core.api.exception.*; import edu.utah.further.core.api.ws.*; import edu.utah.further.core.metadata.to.*; import javax.ws.rs.*; | [
"edu.utah.further",
"javax.ws"
] | edu.utah.further; javax.ws; | 2,752,974 |
public static MGLCategory getDefaultSystem (Properties ctx)
{
MGLCategory retValue = getDefault(ctx, CATEGORYTYPE_SystemGenerated);
if (retValue == null
|| !retValue.getCategoryType().equals(CATEGORYTYPE_SystemGenerated))
{
retValue = new MGLCategory(ctx, 0, null);
retValue.setName("Default S... | static MGLCategory function (Properties ctx) { MGLCategory retValue = getDefault(ctx, CATEGORYTYPE_SystemGenerated); if (retValue == null !retValue.getCategoryType().equals(CATEGORYTYPE_SystemGenerated)) { retValue = new MGLCategory(ctx, 0, null); retValue.setName(STR); retValue.setCategoryType(CATEGORYTYPE_SystemGener... | /**
* Get Default System Category
* @param ctx context
* @return GL Category
*/ | Get Default System Category | getDefaultSystem | {
"repo_name": "pplatek/adempiere",
"path": "base/src/org/compiere/model/MGLCategory.java",
"license": "gpl-2.0",
"size": 5355
} | [
"java.sql.ResultSet",
"java.util.Properties",
"org.compiere.util.CCache",
"org.compiere.util.CLogger"
] | import java.sql.ResultSet; import java.util.Properties; import org.compiere.util.CCache; import org.compiere.util.CLogger; | import java.sql.*; import java.util.*; import org.compiere.util.*; | [
"java.sql",
"java.util",
"org.compiere.util"
] | java.sql; java.util; org.compiere.util; | 1,408,715 |
@Override
protected ObjectId _call() {
Preconditions.checkState(object != null, "Object has not been set.");
final Hasher hasher = ObjectId.HASH_FUNCTION.newHasher();
@SuppressWarnings("unchecked")
final Funnel<RevObject> funnel = (Funnel<RevObject>) FUNNELS[object.getType().val... | ObjectId function() { Preconditions.checkState(object != null, STR); final Hasher hasher = ObjectId.HASH_FUNCTION.newHasher(); @SuppressWarnings(STR) final Funnel<RevObject> funnel = (Funnel<RevObject>) FUNNELS[object.getType().value()]; funnel.funnel(object, hasher); final byte[] rawKey = hasher.hash().asBytes(); fina... | /**
* Hashes a RevObject using a SHA1 hasher.
*
* @return a new ObjectId created from the hash of the RevObject.
*/ | Hashes a RevObject using a SHA1 hasher | _call | {
"repo_name": "jdgarrett/geogig",
"path": "src/core/src/main/java/org/locationtech/geogig/plumbing/HashObject.java",
"license": "bsd-3-clause",
"size": 3962
} | [
"com.google.common.base.Preconditions",
"com.google.common.hash.Funnel",
"com.google.common.hash.Hasher",
"org.locationtech.geogig.model.ObjectId",
"org.locationtech.geogig.model.RevObject"
] | import com.google.common.base.Preconditions; import com.google.common.hash.Funnel; import com.google.common.hash.Hasher; import org.locationtech.geogig.model.ObjectId; import org.locationtech.geogig.model.RevObject; | import com.google.common.base.*; import com.google.common.hash.*; import org.locationtech.geogig.model.*; | [
"com.google.common",
"org.locationtech.geogig"
] | com.google.common; org.locationtech.geogig; | 2,396,765 |
public void merge(Set<String> jarFileNames, String destinationJarName)
throws GateException {
String sourceJarName = null;
JarOutputStream jarFileDestination = null;
JarFile jarFileSource = null;
try {
// create the output jar file
jar... | void function(Set<String> jarFileNames, String destinationJarName) throws GateException { String sourceJarName = null; JarOutputStream jarFileDestination = null; JarFile jarFileSource = null; try { jarFileDestination = new JarOutputStream(new FileOutputStream(destinationJarName)); dbgString.append(STR + destinationJarN... | /** This method takes the content of all jar/zip files from the set
* jarFileNames and put them in a file with the name outputFileName.
* If the jar entry is manifest then this information isn't added.
* @param jarFileNames is a set of names of files (jar/zip)
* @param destinationJarName is the name of ... | This method takes the content of all jar/zip files from the set jarFileNames and put them in a file with the name outputFileName. If the jar entry is manifest then this information isn't added | merge | {
"repo_name": "masterucm1617/botzzaroni",
"path": "BotzzaroniDev/GATE_Developer_8.4/src/main/gate/util/JarFiles.java",
"license": "gpl-3.0",
"size": 7495
} | [
"java.io.FileOutputStream",
"java.io.IOException",
"java.util.Iterator",
"java.util.Set",
"java.util.jar.JarFile",
"java.util.jar.JarOutputStream"
] | import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.Set; import java.util.jar.JarFile; import java.util.jar.JarOutputStream; | import java.io.*; import java.util.*; import java.util.jar.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 232,173 |
public void setConverter(Object propertyId,
Converter<String, ?> converter) {
if (!getContainerPropertyIds().contains(propertyId)) {
throw new IllegalArgumentException("PropertyId " + propertyId
+ " must be in the container");
}
if (!typeIsCompati... | void function(Object propertyId, Converter<String, ?> converter) { if (!getContainerPropertyIds().contains(propertyId)) { throw new IllegalArgumentException(STR + propertyId + STR); } if (!typeIsCompatible(converter.getModelType(), getType(propertyId))) { throw new IllegalArgumentException(STR + getType(propertyId) + S... | /**
* Sets a converter for a property id.
* <p>
* The converter is used to format the the data for the given property id
* before displaying it in the table.
* </p>
*
* @param propertyId
* The propertyId to format using the converter
* @param converter
* ... | Sets a converter for a property id. The converter is used to format the the data for the given property id before displaying it in the table. | setConverter | {
"repo_name": "jdahlstrom/vaadin.react",
"path": "server/src/main/java/com/vaadin/ui/Table.java",
"license": "apache-2.0",
"size": 223299
} | [
"com.vaadin.data.util.converter.Converter"
] | import com.vaadin.data.util.converter.Converter; | import com.vaadin.data.util.converter.*; | [
"com.vaadin.data"
] | com.vaadin.data; | 755,824 |
void setServerKeyStore(KeyStore serverKeyStore); | void setServerKeyStore(KeyStore serverKeyStore); | /**
* Sets the key stores used by the connection.
*
* @param serverKeyStore The keystore containing the server certificate.
*/ | Sets the key stores used by the connection | setServerKeyStore | {
"repo_name": "PDXostc/rvi_core_android",
"path": "src/main/java/org/genivi/rvi/RemoteConnectionInterface.java",
"license": "mpl-2.0",
"size": 4042
} | [
"java.security.KeyStore"
] | import java.security.KeyStore; | import java.security.*; | [
"java.security"
] | java.security; | 1,961,938 |
public static boolean isVisible(By by) {
WebElement element = null;
WebDriver driver = StepDefBase.getInstance().getWebDriver();
try {
element = driver.findElement(by);
} catch (NoSuchElementException e) {
logger.debug("ElementHelper.isVisible: " + e.getMessage());
return false;
}
return isVi... | static boolean function(By by) { WebElement element = null; WebDriver driver = StepDefBase.getInstance().getWebDriver(); try { element = driver.findElement(by); } catch (NoSuchElementException e) { logger.debug(STR + e.getMessage()); return false; } return isVisible(element); } | /**
* Determines if element is visible and also handles NoSuchElementException
* @param element
* @return boolean
*/ | Determines if element is visible and also handles NoSuchElementException | isVisible | {
"repo_name": "PazsitZ/PaCuSe",
"path": "src/main/java/hu/pazsitz/pacuse/tests/helpers/ElementHelper.java",
"license": "mit",
"size": 7073
} | [
"org.openqa.selenium.By",
"org.openqa.selenium.NoSuchElementException",
"org.openqa.selenium.WebDriver",
"org.openqa.selenium.WebElement"
] | import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; | import org.openqa.selenium.*; | [
"org.openqa.selenium"
] | org.openqa.selenium; | 1,371,583 |
private void checkTokenTime(Token token) {
if (token.getExpiresIn() == null || token.getGenerateTime() == null) {
throw new AuthFailedException("Token is illegal: expire or generate time not found.");
}
long curTime = System.currentTimeMillis();
if (token.getExpiresIn() + token.getGenerateTime()... | void function(Token token) { if (token.getExpiresIn() == null token.getGenerateTime() == null) { throw new AuthFailedException(STR); } long curTime = System.currentTimeMillis(); if (token.getExpiresIn() + token.getGenerateTime() < curTime) { throw new AuthFailedException(STR); } } | /**
* check if this token has expired.
*
* @param token
*/ | check if this token has expired | checkTokenTime | {
"repo_name": "reactivesw/customer_server",
"path": "src/main/java/io/reactivesw/common/auth/AuthFilter.java",
"license": "mit",
"size": 3824
} | [
"io.reactivesw.common.exception.AuthFailedException",
"io.reactivesw.common.model.Token"
] | import io.reactivesw.common.exception.AuthFailedException; import io.reactivesw.common.model.Token; | import io.reactivesw.common.exception.*; import io.reactivesw.common.model.*; | [
"io.reactivesw.common"
] | io.reactivesw.common; | 1,020,393 |
private String[] getTextAreaParams(HttpServletRequest request) {
// parse out the important strings from our methodToCall parameter
String fullParameter = (String) request.getAttribute(
KRADConstants.METHOD_TO_CALL_ATTRIBUTE);
// parse textfieldname:htmlformaction
... | String[] function(HttpServletRequest request) { String fullParameter = (String) request.getAttribute( KRADConstants.METHOD_TO_CALL_ATTRIBUTE); String parameterFields = StringUtils.substringBetween(fullParameter, KRADConstants.METHOD_TO_CALL_PARM2_LEFT_DEL, KRADConstants.METHOD_TO_CALL_PARM2_RIGHT_DEL); if ( LOG.isDebug... | /**
* This method takes the {@link org.kuali.rice.krad.util.KRADConstants.METHOD_TO_CALL_ATTRIBUTE} out of the request
* and parses it returning the required fields needed for a text area. The fields returned
* are the following in this order.
* <ol>
* <li>{@link #TEXT_AREA_FIELD_NAME}</li... | This method takes the <code>org.kuali.rice.krad.util.KRADConstants.METHOD_TO_CALL_ATTRIBUTE</code> out of the request and parses it returning the required fields needed for a text area. The fields returned are the following in this order. <code>#TEXT_AREA_FIELD_NAME</code> <code>#FORM_ACTION</code> <code>#TEXT_AREA_FIE... | getTextAreaParams | {
"repo_name": "sbower/kuali-rice-1",
"path": "kns/src/main/java/org/kuali/rice/kns/web/struts/action/KualiAction.java",
"license": "apache-2.0",
"size": 53121
} | [
"javax.servlet.http.HttpServletRequest",
"org.apache.commons.lang.StringUtils",
"org.kuali.rice.krad.util.KRADConstants"
] | import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import org.kuali.rice.krad.util.KRADConstants; | import javax.servlet.http.*; import org.apache.commons.lang.*; import org.kuali.rice.krad.util.*; | [
"javax.servlet",
"org.apache.commons",
"org.kuali.rice"
] | javax.servlet; org.apache.commons; org.kuali.rice; | 1,101,826 |
public List<Integer> getSpectrumIndicesByScanTimeRange(double low, double high) throws IllegalStateException {
if(this.spectrumOffsets.getScanTimesToOffsets() == null){
throw new IllegalStateException("No scan time index was set. Cannot random access by scan time range");
}
List<Integer> indices = new A... | List<Integer> function(double low, double high) throws IllegalStateException { if(this.spectrumOffsets.getScanTimesToOffsets() == null){ throw new IllegalStateException(STR); } List<Integer> indices = new ArrayList<Integer>(); for(Map.Entry<Double, Long> offset : this.spectrumOffsets.getScanTimesToOffsets().subMap(low,... | /**
* Gets a list of spectra within a scanTime range using random access.
* Assumes offsets are sorted
*
* @param low scan time inclusive
* @param high scan time inclusive
* @throws IllegalStateException if no scan time index was parsed by the constructor
* @return list of spectrum indices
*/ | Gets a list of spectra within a scanTime range using random access. Assumes offsets are sorted | getSpectrumIndicesByScanTimeRange | {
"repo_name": "digitalproteomics/dp-mzml",
"path": "src/main/java/com/digitalproteomics/oss/parsers/mzml/MzMLStAXParser.java",
"license": "apache-2.0",
"size": 17480
} | [
"com.digitalproteomics.oss.parsers.mzml.builders.ReferenceableParamGroup",
"com.digitalproteomics.oss.parsers.mzml.builders.SpectrumIndexer",
"java.nio.channels.SeekableByteChannel",
"java.nio.file.Path",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"java.util.Map",
"org.apache.... | import com.digitalproteomics.oss.parsers.mzml.builders.ReferenceableParamGroup; import com.digitalproteomics.oss.parsers.mzml.builders.SpectrumIndexer; import java.nio.channels.SeekableByteChannel; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.ut... | import com.digitalproteomics.oss.parsers.mzml.builders.*; import java.nio.channels.*; import java.nio.file.*; import java.util.*; import org.apache.logging.log4j.*; | [
"com.digitalproteomics.oss",
"java.nio",
"java.util",
"org.apache.logging"
] | com.digitalproteomics.oss; java.nio; java.util; org.apache.logging; | 1,591,009 |
public IBlockState withRotation(IBlockState state, Rotation rot)
{
return state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING)));
} | IBlockState function(IBlockState state, Rotation rot) { return state.withProperty(FACING, rot.rotate((EnumFacing)state.getValue(FACING))); } | /**
* Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed
* blockstate.
*/ | Returns the blockstate with the given rotation from the passed blockstate. If inapplicable, returns the passed blockstate | withRotation | {
"repo_name": "TheGreatAndPowerfulWeegee/wipunknown",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockTorch.java",
"license": "gpl-3.0",
"size": 11678
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.EnumFacing",
"net.minecraft.util.Rotation"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing; import net.minecraft.util.Rotation; | import net.minecraft.block.state.*; import net.minecraft.util.*; | [
"net.minecraft.block",
"net.minecraft.util"
] | net.minecraft.block; net.minecraft.util; | 1,999,994 |
public boolean getIsActive() {
if ( isActive == null ) {
isActive = (SFBool)getField( "isActive" );
}
return( isActive.getValue( ) );
} | boolean function() { if ( isActive == null ) { isActive = (SFBool)getField( STR ); } return( isActive.getValue( ) ); } | /** Return the isActive boolean value.
* @return The isActive boolean value. */ | Return the isActive boolean value | getIsActive | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/xj3d/sai/internal/node/pickingsensor/SAIPointPicker.java",
"license": "gpl-2.0",
"size": 7284
} | [
"org.web3d.x3d.sai.SFBool"
] | import org.web3d.x3d.sai.SFBool; | import org.web3d.x3d.sai.*; | [
"org.web3d.x3d"
] | org.web3d.x3d; | 2,591,499 |
Source needSource(String uri) throws FileNotFoundException; | Source needSource(String uri) throws FileNotFoundException; | /**
* Returns a Source object for a URI. This method is guaranteed to return a Source object. If
* the image cannot be found, a {@link FileNotFoundException} is thrown.
* @param uri the URI of the image
* @return the Source object to load the image from
* @throws FileNotFoundException if the im... | Returns a Source object for a URI. This method is guaranteed to return a Source object. If the image cannot be found, a <code>FileNotFoundException</code> is thrown | needSource | {
"repo_name": "apache/xml-graphics-commons",
"path": "src/main/java/org/apache/xmlgraphics/image/loader/ImageSessionContext.java",
"license": "apache-2.0",
"size": 3369
} | [
"java.io.FileNotFoundException",
"javax.xml.transform.Source"
] | import java.io.FileNotFoundException; import javax.xml.transform.Source; | import java.io.*; import javax.xml.transform.*; | [
"java.io",
"javax.xml"
] | java.io; javax.xml; | 2,333,044 |
public void moveToken(MovableToken t, Point p) {
Point loc = getCellLoc(p);
tokenPaintingManager.updateTokenLocation(t, loc.x, loc.y);
}
| void function(MovableToken t, Point p) { Point loc = getCellLoc(p); tokenPaintingManager.updateTokenLocation(t, loc.x, loc.y); } | /**
* Update the grid reference of a movable token
*
* @param token the movable token which is moving
* @param p the location it is moving to
*/ | Update the grid reference of a movable token | moveToken | {
"repo_name": "littlewoo/FireRescue",
"path": "src/ui/TokenGridPanel.java",
"license": "gpl-2.0",
"size": 4365
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,046,748 |
@Override
public Object getParent(Object object)
{
return ((EObject)object).eContainer();
} | Object function(Object object) { return ((EObject)object).eContainer(); } | /**
* This returns the parent of the TreeNode.
*/ | This returns the parent of the TreeNode | getParent | {
"repo_name": "Axellience/emfgwt",
"path": "emf-edit/src/main/java/org/eclipse/emf/edit/tree/provider/TreeNodeItemProvider.java",
"license": "epl-1.0",
"size": 5929
} | [
"org.eclipse.emf.ecore.EObject"
] | import org.eclipse.emf.ecore.EObject; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,315,486 |
public static String formatDate(Date d, String fmt) {
SimpleDateFormat format = new SimpleDateFormat(fmt);
return format.format(d);
} | static String function(Date d, String fmt) { SimpleDateFormat format = new SimpleDateFormat(fmt); return format.format(d); } | /**
* Format date using SimpleDateFormat format string.
*/ | Format date using SimpleDateFormat format string | formatDate | {
"repo_name": "paulnguyen/cmpe279",
"path": "eclipse/Roller/src/org/apache/roller/ui/rendering/velocity/deprecated/OldUtilities.java",
"license": "apache-2.0",
"size": 26301
} | [
"java.text.SimpleDateFormat",
"java.util.Date"
] | import java.text.SimpleDateFormat; import java.util.Date; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 2,394,722 |
ClusterConnection getClusterConnection();
/**
* Returns instance of {@link org.apache.hadoop.hbase.zookeeper.MetaTableLocator} | ClusterConnection getClusterConnection(); /** * Returns instance of {@link org.apache.hadoop.hbase.zookeeper.MetaTableLocator} | /**
* Returns a reference to the servers' cluster connection. Prefer {@link #getConnection()}.
*
* Important note: this method returns a reference to Connection which is managed
* by Server itself, so callers must NOT attempt to close connection obtained.
*/ | Returns a reference to the servers' cluster connection. Prefer <code>#getConnection()</code>. Important note: this method returns a reference to Connection which is managed by Server itself, so callers must NOT attempt to close connection obtained | getClusterConnection | {
"repo_name": "JingchengDu/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java",
"license": "apache-2.0",
"size": 2832
} | [
"org.apache.hadoop.hbase.client.ClusterConnection",
"org.apache.hadoop.hbase.zookeeper.MetaTableLocator"
] | import org.apache.hadoop.hbase.client.ClusterConnection; import org.apache.hadoop.hbase.zookeeper.MetaTableLocator; | import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.zookeeper.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,617,788 |
public OFStatistics newInstance(OFType t) {
if (t == OFType.STATS_REQUEST) {
return requestInstantiable.instantiate();
} else if (t == OFType.STATS_REPLY) {
return replyInstantiable.instantiate();
} else {
throw new RuntimeException(t.toString() + " is an ... | OFStatistics function(OFType t) { if (t == OFType.STATS_REQUEST) { return requestInstantiable.instantiate(); } else if (t == OFType.STATS_REPLY) { return replyInstantiable.instantiate(); } else { throw new RuntimeException(t.toString() + STR); } } | /**
* Returns a new instance of the implementation class for
* this OFStatisticsType, either request or reply based on the supplied
* OFType
*
* @param t
* @return
*/ | Returns a new instance of the implementation class for this OFStatisticsType, either request or reply based on the supplied OFType | newInstance | {
"repo_name": "rcchan/cs168-sdn-floodlight",
"path": "src/main/java/org/openflow/protocol/statistics/OFStatisticsType.java",
"license": "apache-2.0",
"size": 15076
} | [
"org.openflow.protocol.OFType"
] | import org.openflow.protocol.OFType; | import org.openflow.protocol.*; | [
"org.openflow.protocol"
] | org.openflow.protocol; | 1,591,043 |
protected static void cacheJars(final Job job, final DataBucketBean bucket, final IAnalyticsContext context) throws IllegalArgumentException, InterruptedException, ExecutionException, IOException {
final FileContext fc = context.getServiceContext().getStorageService().getUnderlyingPlatformDriver(FileContext.cla... | static void function(final Job job, final DataBucketBean bucket, final IAnalyticsContext context) throws IllegalArgumentException, InterruptedException, ExecutionException, IOException { final FileContext fc = context.getServiceContext().getStorageService().getUnderlyingPlatformDriver(FileContext.class, Optional.empty(... | /** Cache the system and user classpaths
* @param job
* @param context
* @throws IOException
* @throws ExecutionException
* @throws InterruptedException
* @throws IllegalArgumentException
*/ | Cache the system and user classpaths | cacheJars | {
"repo_name": "robgil/Aleph2-contrib",
"path": "aleph2_analytic_services_hadoop/src/main/java/com/ikanow/aleph2/analytics/hadoop/services/BeJobLauncher.java",
"license": "apache-2.0",
"size": 8904
} | [
"com.ikanow.aleph2.data_model.interfaces.data_analytics.IAnalyticsContext",
"com.ikanow.aleph2.data_model.objects.data_import.DataBucketBean",
"com.ikanow.aleph2.data_model.utils.Lambdas",
"com.ikanow.aleph2.data_model.utils.Tuples",
"java.io.File",
"java.io.IOException",
"java.util.Optional",
"java.u... | import com.ikanow.aleph2.data_model.interfaces.data_analytics.IAnalyticsContext; import com.ikanow.aleph2.data_model.objects.data_import.DataBucketBean; import com.ikanow.aleph2.data_model.utils.Lambdas; import com.ikanow.aleph2.data_model.utils.Tuples; import java.io.File; import java.io.IOException; import java.util.... | import com.ikanow.aleph2.data_model.interfaces.data_analytics.*; import com.ikanow.aleph2.data_model.objects.data_import.*; import com.ikanow.aleph2.data_model.utils.*; import java.io.*; import java.util.*; import java.util.concurrent.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.mapreduce.*; | [
"com.ikanow.aleph2",
"java.io",
"java.util",
"org.apache.hadoop"
] | com.ikanow.aleph2; java.io; java.util; org.apache.hadoop; | 759,556 |
public static XmlElement elementFor(String xml) throws XsylumException {
return new XmlElement(documentForInternal(
new InputSource(new StringReader(xml)).getByteStream()).getDocumentElement());
} | static XmlElement function(String xml) throws XsylumException { return new XmlElement(documentForInternal( new InputSource(new StringReader(xml)).getByteStream()).getDocumentElement()); } | /**
* Returns an XmlElement representing the document element for the {@code xml}.
*/ | Returns an XmlElement representing the document element for the xml | elementFor | {
"repo_name": "jhalterman/xsylum",
"path": "src/main/java/net/jodah/xsylum/Xsylum.java",
"license": "apache-2.0",
"size": 3353
} | [
"java.io.StringReader",
"org.xml.sax.InputSource"
] | import java.io.StringReader; import org.xml.sax.InputSource; | import java.io.*; import org.xml.sax.*; | [
"java.io",
"org.xml.sax"
] | java.io; org.xml.sax; | 1,397,851 |
@Deprecated
public String getUnitUrlByVideoById(String courseId, String videoId){
try{
VideoResponseModel vrm = getVideoById(courseId, videoId);
if(vrm!=null){
return vrm.getUnitUrl();
}
}catch(Exception e){
logger.error(e);
... | String function(String courseId, String videoId){ try{ VideoResponseModel vrm = getVideoById(courseId, videoId); if(vrm!=null){ return vrm.getUnitUrl(); } }catch(Exception e){ logger.error(e); } return null; } | /**
* Returns UnitUrl for given course id and video id.
* @param courseId
* @param videoId
* @return
* @throws Exception
*/ | Returns UnitUrl for given course id and video id | getUnitUrlByVideoById | {
"repo_name": "miptliot/edx-app-android",
"path": "VideoLocker/src/main/java/org/edx/mobile/http/Api.java",
"license": "apache-2.0",
"size": 44937
} | [
"org.edx.mobile.model.api.VideoResponseModel"
] | import org.edx.mobile.model.api.VideoResponseModel; | import org.edx.mobile.model.api.*; | [
"org.edx.mobile"
] | org.edx.mobile; | 235,737 |
void acceptWithEarlyMedia(Observer... observer) throws SignalException, MediaException; | void acceptWithEarlyMedia(Observer... observer) throws SignalException, MediaException; | /**
* accept this incoming call with early media (SIP 183)
*
* @throws SignalException
* when there is any signal error.
* @throws MediaException
* when there is any media server error.
*/ | accept this incoming call with early media (SIP 183) | acceptWithEarlyMedia | {
"repo_name": "voxeolabs/moho",
"path": "moho-api/src/main/java/com/voxeo/moho/IncomingCall.java",
"license": "apache-2.0",
"size": 3787
} | [
"com.voxeo.moho.event.Observer"
] | import com.voxeo.moho.event.Observer; | import com.voxeo.moho.event.*; | [
"com.voxeo.moho"
] | com.voxeo.moho; | 969,815 |
public void setTimeLastModified(Time lastmod); | void function(Time lastmod); | /**
* Set the time last modified.
*
* @param lastmod -
* The Time at which the Content was last modified.
*/ | Set the time last modified | setTimeLastModified | {
"repo_name": "harfalm/Sakai-10.1",
"path": "assignment/assignment-api/api/src/java/org/sakaiproject/assignment/api/AssignmentContentEdit.java",
"license": "apache-2.0",
"size": 4940
} | [
"org.sakaiproject.time.api.Time"
] | import org.sakaiproject.time.api.Time; | import org.sakaiproject.time.api.*; | [
"org.sakaiproject.time"
] | org.sakaiproject.time; | 1,437,105 |
@SuppressWarnings("unchecked")
public final <U extends Asset<T>> Optional<U> createInstance() {
Preconditions.checkState(!disposed);
return (Optional<U>) assetType.createInstance(this);
} | @SuppressWarnings(STR) final <U extends Asset<T>> Optional<U> function() { Preconditions.checkState(!disposed); return (Optional<U>) assetType.createInstance(this); } | /**
* Creates an instance of this asset. The instance will have the same urn as this asset, with the instance flag appended, and initially have the same data and settings.
* <p>
* Instance assets are reloaded back to the same value as their origin if their asset type is refreshed.
* </p>
*
... | Creates an instance of this asset. The instance will have the same urn as this asset, with the instance flag appended, and initially have the same data and settings. Instance assets are reloaded back to the same value as their origin if their asset type is refreshed. | createInstance | {
"repo_name": "MovingBlocks/gestalt",
"path": "gestalt-asset-core/src/main/java/org/terasology/gestalt/assets/Asset.java",
"license": "apache-2.0",
"size": 7133
} | [
"com.google.common.base.Preconditions",
"java.util.Optional"
] | import com.google.common.base.Preconditions; import java.util.Optional; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 496,986 |
public FriendsGetByPhonesQuery phones(List<String> value) {
return unsafeParam("phones", value);
} | FriendsGetByPhonesQuery function(List<String> value) { return unsafeParam(STR, value); } | /**
* List of phone numbers in MSISDN format (maximum 1000). Example: "+79219876543,+79111234567"
*
* @param value value of "phones" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/ | List of phone numbers in MSISDN format (maximum 1000). Example: "+79219876543,+79111234567" | phones | {
"repo_name": "VKCOM/vk-java-sdk",
"path": "sdk/src/main/java/com/vk/api/sdk/queries/friends/FriendsGetByPhonesQuery.java",
"license": "mit",
"size": 3141
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,142,531 |
Map<String, String> getDefaults() {
return this.defaults;
} | Map<String, String> getDefaults() { return this.defaults; } | /**
* Returns the defaults applicable to the service.
* @return the defaults of the service
*/ | Returns the defaults applicable to the service | getDefaults | {
"repo_name": "spring-projects/spring-boot",
"path": "spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java",
"license": "apache-2.0",
"size": 7541
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,633,096 |
public void printInstructionListing(ValueNode instruction) {
int indentation = out.indentationLevel();
out.fillTo(BCI.position + indentation, ' ').print(0).fillTo(USE.position + indentation, ' ').print("0").fillTo(VALUE.position + indentation, ' ').print(
ValueNodeUtil.valueS... | void function(ValueNode instruction) { int indentation = out.indentationLevel(); out.fillTo(BCI.position + indentation, ' ').print(0).fillTo(USE.position + indentation, ' ').print("0").fillTo(VALUE.position + indentation, ' ').print( ValueNodeUtil.valueString(instruction)).fillTo( INSTRUCTION.position + indentation, ' ... | /**
* Prints an instruction listing on one line. The instruction listing is composed of the columns
* specified by {@link InstructionLineColumn}.
*
* @param instruction the instruction to print
*/ | Prints an instruction listing on one line. The instruction listing is composed of the columns specified by <code>InstructionLineColumn</code> | printInstructionListing | {
"repo_name": "YouDiSN/OpenJDK-Research",
"path": "jdk9/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java",
"license": "gpl-2.0",
"size": 4981
} | [
"org.graalvm.compiler.nodes.StateSplit",
"org.graalvm.compiler.nodes.ValueNode",
"org.graalvm.compiler.nodes.ValueNodeUtil"
] | import org.graalvm.compiler.nodes.StateSplit; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.ValueNodeUtil; | import org.graalvm.compiler.nodes.*; | [
"org.graalvm.compiler"
] | org.graalvm.compiler; | 971,389 |
public boolean hasChanges(final ResourceResolverContext context) {
for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) {
if (p.hasChanges()) {
return true;
}
}
return false;
} | boolean function(final ResourceResolverContext context) { for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) { if (p.hasChanges()) { return true; } } return false; } | /**
* Check if any modifiable ResourceProvider has uncommited changes.
*/ | Check if any modifiable ResourceProvider has uncommited changes | hasChanges | {
"repo_name": "roele/sling",
"path": "bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java",
"license": "apache-2.0",
"size": 34619
} | [
"org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider"
] | import org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider; | import org.apache.sling.resourceresolver.impl.providers.stateful.*; | [
"org.apache.sling"
] | org.apache.sling; | 2,848,875 |
@Override
public void onResume()
{
super.onResume();
//Log.d("DEBUG", "onResume");
updateActionBar(this);
getFixHelper.onResume();
if (onResume_resetNoteIndex) {
notes.resetNoteIndex();
}
// restore open dialogs
updateDialogs(thi... | void function() { super.onResume(); updateActionBar(this); getFixHelper.onResume(); if (onResume_resetNoteIndex) { notes.resetNoteIndex(); } updateDialogs(this); FragmentManager fragments = getSupportFragmentManager(); TimeZoneDialog timezoneDialog = (TimeZoneDialog) fragments.findFragmentByTag(DIALOGTAG_TIMEZONE); if ... | /**
* OnResume: the user is now interacting w/ the Activity (running state)
*/ | OnResume: the user is now interacting w/ the Activity (running state) | onResume | {
"repo_name": "forrestguice/SuntimesWidget",
"path": "app/src/main/java/com/forrestguice/suntimeswidget/SuntimesActivity.java",
"license": "gpl-3.0",
"size": 93032
} | [
"android.support.v4.app.FragmentManager"
] | import android.support.v4.app.FragmentManager; | import android.support.v4.app.*; | [
"android.support"
] | android.support; | 802,777 |
@PatchMapping(value = ENABLE, consumes = APPLICATION_JSON_VALUE)
public ResponseBody enableUsers(@RequestBody EnableUsers enableUsers)
throws ServiceLayerException, UserNotFoundException, AuthenticationException {
ValidationUtils.validateEnableUsers(enableUsers);
List<User> users = ... | @PatchMapping(value = ENABLE, consumes = APPLICATION_JSON_VALUE) ResponseBody function(@RequestBody EnableUsers enableUsers) throws ServiceLayerException, UserNotFoundException, AuthenticationException { ValidationUtils.validateEnableUsers(enableUsers); List<User> users = userService.enableUsers(enableUsers.getIds(), e... | /**
* Enable users API
*
* @param enableUsers Enable users request body (json representation)
* @return Response object
*/ | Enable users API | enableUsers | {
"repo_name": "craftercms/studio2",
"path": "src/main/java/org/craftercms/studio/controller/rest/v2/UsersController.java",
"license": "gpl-3.0",
"size": 23931
} | [
"java.util.List",
"org.craftercms.studio.api.v1.exception.ServiceLayerException",
"org.craftercms.studio.api.v1.exception.security.AuthenticationException",
"org.craftercms.studio.api.v1.exception.security.UserNotFoundException",
"org.craftercms.studio.api.v2.dal.User",
"org.craftercms.studio.model.rest.E... | import java.util.List; import org.craftercms.studio.api.v1.exception.ServiceLayerException; import org.craftercms.studio.api.v1.exception.security.AuthenticationException; import org.craftercms.studio.api.v1.exception.security.UserNotFoundException; import org.craftercms.studio.api.v2.dal.User; import org.craftercms.st... | import java.util.*; import org.craftercms.studio.api.v1.exception.*; import org.craftercms.studio.api.v1.exception.security.*; import org.craftercms.studio.api.v2.dal.*; import org.craftercms.studio.model.rest.*; import org.springframework.web.bind.annotation.*; | [
"java.util",
"org.craftercms.studio",
"org.springframework.web"
] | java.util; org.craftercms.studio; org.springframework.web; | 1,414,228 |
private void validateNewAcl(Acl acl, Acl originalAcl) throws InvalidPrincipalException {
Set<Privilege> actions = acl.getActions();
for (Privilege action : actions) {
Set<Principal> principals = acl.getPrincipalSet(action);
for (Principal principal : principals) {
... | void function(Acl acl, Acl originalAcl) throws InvalidPrincipalException { Set<Privilege> actions = acl.getActions(); for (Privilege action : actions) { Set<Principal> principals = acl.getPrincipalSet(action); for (Principal principal : principals) { boolean valid = this.authorizationManager.isValidAclEntry(action, pri... | /**
* Validates all entries in an ACL, but keeps invalid entries if they
* are already present in the original Acl
*/ | Validates all entries in an ACL, but keeps invalid entries if they are already present in the original Acl | validateNewAcl | {
"repo_name": "vtkio/vtk",
"path": "src/main/java/vtk/repository/RepositoryImpl.java",
"license": "bsd-3-clause",
"size": 104337
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 643,080 |
@Override
public ArrayList<Column> getColumnsInHiveOrder() {
return getColumns();
} | ArrayList<Column> function() { return getColumns(); } | /**
* Hive returns the columns in order of their declaration for HBase tables.
*/ | Hive returns the columns in order of their declaration for HBase tables | getColumnsInHiveOrder | {
"repo_name": "michaelhkw/incubator-impala",
"path": "fe/src/main/java/org/apache/impala/catalog/HBaseTable.java",
"license": "apache-2.0",
"size": 34515
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 143,744 |
public Name getSuffix(int posn) {
try {
return new LdapName(null, rdns, posn, rdns.size());
} catch (IllegalArgumentException e) {
throw new IndexOutOfBoundsException(
"Posn: " + posn + ", Size: "+ rdns.size());
}
} | Name function(int posn) { try { return new LdapName(null, rdns, posn, rdns.size()); } catch (IllegalArgumentException e) { throw new IndexOutOfBoundsException( STR + posn + STR+ rdns.size()); } } | /**
* Creates a name whose components consist of a suffix of the
* components in this LDAP name.
* Subsequent changes to this name do not affect the name that is
* returned and vice versa.
*
* @param posn The 0-based index of the component at which to start.
* Mu... | Creates a name whose components consist of a suffix of the components in this LDAP name. Subsequent changes to this name do not affect the name that is returned and vice versa | getSuffix | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/javax/naming/ldap/LdapName.java",
"license": "apache-2.0",
"size": 29197
} | [
"javax.naming.Name"
] | import javax.naming.Name; | import javax.naming.*; | [
"javax.naming"
] | javax.naming; | 460,161 |
public final boolean add(ArraySet<T> source) {
final T[] sourceArraySet = source.getArray();
if (sourceArraySet == null) {
return false;
}
synchronized (sync) {
if (array == null) {
array = Arrays.copyOf(sourceArraySet, sourceArraySet.length)... | final boolean function(ArraySet<T> source) { final T[] sourceArraySet = source.getArray(); if (sourceArraySet == null) { return false; } synchronized (sync) { if (array == null) { array = Arrays.copyOf(sourceArraySet, sourceArraySet.length); return true; } boolean result = false; for (int i = 0; i < sourceArraySet.leng... | /**
* Add all the elements from the source <tt>ArraySet</tt>.
*
* @param source the elements to add.
* @return <tt>true</tt>, if at least one element was added to the set and,
* as result, the size of the set was increased, or <tt>false</tt>, all
* element(s) was/were present in the set an... | Add all the elements from the source ArraySet | add | {
"repo_name": "biw4ever/microweb",
"path": "src/main/java/com/yjz/microweb/util/ArraySet.java",
"license": "apache-2.0",
"size": 11708
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,127,550 |
protected VdcReturnValueBase createReturnValue() {
return new VdcReturnValueBase();
} | VdcReturnValueBase function() { return new VdcReturnValueBase(); } | /**
* Factory to determine the type of the ReturnValue field
*/ | Factory to determine the type of the ReturnValue field | createReturnValue | {
"repo_name": "jtux270/translate",
"path": "ovirt/3.6_source/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java",
"license": "gpl-3.0",
"size": 97139
} | [
"org.ovirt.engine.core.common.action.VdcReturnValueBase"
] | import org.ovirt.engine.core.common.action.VdcReturnValueBase; | import org.ovirt.engine.core.common.action.*; | [
"org.ovirt.engine"
] | org.ovirt.engine; | 1,277,750 |
private static String[] segment(String toSegment, int offset) {
int length = toSegment.length();
// Handle "/" and "" quickly.
if (length == offset) {
return new String[0];
}
// We make two passes through the array of characters: count & alloc,
// because simply using ArrayList was a b... | static String[] function(String toSegment, int offset) { int length = toSegment.length(); if (length == offset) { return new String[0]; } int seg = 0; int start = offset; for (int i = offset; i < length; i++) { if (isSeparator(toSegment.charAt(i))) { if (i > start) { seg++; } start = i + 1; } } if (start < length) { se... | /**
* Segments the string passed in as argument and returns an array of strings.
* The split is performed along occurrences of (sequences of) the slash
* character.
*
* @param toSegment the string to segment
* @param offset how many characters from the start of the string to ignore.
*/ | Segments the string passed in as argument and returns an array of strings. The split is performed along occurrences of (sequences of) the slash character | segment | {
"repo_name": "hhclam/bazel",
"path": "src/main/java/com/google/devtools/build/lib/vfs/PathFragment.java",
"license": "apache-2.0",
"size": 25026
} | [
"com.google.devtools.build.lib.util.StringCanonicalizer"
] | import com.google.devtools.build.lib.util.StringCanonicalizer; | import com.google.devtools.build.lib.util.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,526,857 |
void customize(JcloudsLocation location, ComputeService computeService, Template template); | void customize(JcloudsLocation location, ComputeService computeService, Template template); | /**
* Override to configure a subclass of this with the built template, or to configure the built
* template's {@link org.jclouds.compute.options.TemplateOptions}.
* <p/>
* This method will be called before {@link #customize(JcloudsLocation, ComputeService, TemplateOptions)}.
*/ | Override to configure a subclass of this with the built template, or to configure the built template's <code>org.jclouds.compute.options.TemplateOptions</code>. This method will be called before <code>#customize(JcloudsLocation, ComputeService, TemplateOptions)</code> | customize | {
"repo_name": "neykov/incubator-brooklyn",
"path": "locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocationCustomizer.java",
"license": "apache-2.0",
"size": 3014
} | [
"org.jclouds.compute.ComputeService",
"org.jclouds.compute.domain.Template"
] | import org.jclouds.compute.ComputeService; import org.jclouds.compute.domain.Template; | import org.jclouds.compute.*; import org.jclouds.compute.domain.*; | [
"org.jclouds.compute"
] | org.jclouds.compute; | 2,451,199 |
private byte[] getNonRootIndexedKey(ByteBuffer nonRootIndex, int i) {
int numEntries = nonRootIndex.getInt(0);
if (i < 0 || i >= numEntries) {
return null;
}
// Entries start after the number of entries and the secondary index.
// The secondary index takes numEntries + 1 ints.... | byte[] function(ByteBuffer nonRootIndex, int i) { int numEntries = nonRootIndex.getInt(0); if (i < 0 i >= numEntries) { return null; } int entriesOffset = Bytes.SIZEOF_INT * (numEntries + 2); int targetKeyRelOffset = nonRootIndex.getInt( Bytes.SIZEOF_INT * (i + 1)); int targetKeyOffset = entriesOffset + targetKeyRelOff... | /**
* The indexed key at the ith position in the nonRootIndex. The position starts at 0.
* @param nonRootIndex
* @param i the ith position
* @return The indexed key at the ith position in the nonRootIndex.
*/ | The indexed key at the ith position in the nonRootIndex. The position starts at 0 | getNonRootIndexedKey | {
"repo_name": "andrewmains12/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java",
"license": "apache-2.0",
"size": 55256
} | [
"java.nio.ByteBuffer",
"org.apache.hadoop.hbase.util.ByteBufferUtils",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.nio.ByteBuffer; import org.apache.hadoop.hbase.util.ByteBufferUtils; import org.apache.hadoop.hbase.util.Bytes; | import java.nio.*; import org.apache.hadoop.hbase.util.*; | [
"java.nio",
"org.apache.hadoop"
] | java.nio; org.apache.hadoop; | 1,291,733 |
@Deprecated
public static Locale getOfbizLocaleArgOrContext(List<?> args, int position, Environment env) throws TemplateModelException {
Locale locale = getOfbizLocaleArg(getModel(args, position));
return (locale != null) ? locale : ContextFtlUtil.getContextLocale(env);
} | static Locale function(List<?> args, int position, Environment env) throws TemplateModelException { Locale locale = getOfbizLocaleArg(getModel(args, position)); return (locale != null) ? locale : ContextFtlUtil.getContextLocale(env); } | /**
* Special handler that tries to read a locale arg and if not present gets it from context locale.
* NOTE: this does NOT check the request locale!
* @deprecated 2019-02-05: It's best not to use this; use the abstract {@link #getOfbizLocaleArgOrCurrent} instead.
*/ | Special handler that tries to read a locale arg and if not present gets it from context locale | getOfbizLocaleArgOrContext | {
"repo_name": "ilscipio/scipio-erp",
"path": "framework/webapp/src/com/ilscipio/scipio/ce/webapp/ftl/context/TransformUtil.java",
"license": "apache-2.0",
"size": 32646
} | [
"freemarker.core.Environment",
"freemarker.template.TemplateModelException",
"java.util.List",
"java.util.Locale"
] | import freemarker.core.Environment; import freemarker.template.TemplateModelException; import java.util.List; import java.util.Locale; | import freemarker.core.*; import freemarker.template.*; import java.util.*; | [
"freemarker.core",
"freemarker.template",
"java.util"
] | freemarker.core; freemarker.template; java.util; | 2,671,463 |
public void updateCharacterStream(int columnIndex, java.io.Reader x,
long length) throws SQLException {
checksBeforeUpdateCharacterStream(columnIndex);
updateCharacterStreamInternal(columnIndex, x, false, length,
"updateCharacterStream");
} | void function(int columnIndex, java.io.Reader x, long length) throws SQLException { checksBeforeUpdateCharacterStream(columnIndex); updateCharacterStreamInternal(columnIndex, x, false, length, STR); } | /**
* JDBC 4.0
*
* Update a column with a character stream value.
*
* The updateXXX() methods are used to update column values in the current
* row, or the insert row. The updateXXX() methods do not update the
* underlying database, instead the updateRow() or insertRow() methods are
* called to update... | JDBC 4.0 Update a column with a character stream value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database | updateCharacterStream | {
"repo_name": "viaper/DBPlus",
"path": "DerbyHodgepodge/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java",
"license": "apache-2.0",
"size": 178663
} | [
"java.io.Reader",
"java.sql.SQLException"
] | import java.io.Reader; import java.sql.SQLException; | import java.io.*; import java.sql.*; | [
"java.io",
"java.sql"
] | java.io; java.sql; | 348,542 |
private String processCommand(String command) {
if (sendCommand(command)) {
String[] result = readLines();
if (result != null && result.length > 0) {
Matcher m = RE_KO.matcher(result[result.length-1]);
if (m.matches()) {
return m.g... | String function(String command) { if (sendCommand(command)) { String[] result = readLines(); if (result != null && result.length > 0) { Matcher m = RE_KO.matcher(result[result.length-1]); if (m.matches()) { return m.group(1); } return RESULT_OK; } return STR; } return STR; } | /**
* Sends a command to the emulator and parses its answer.
* @param command the command to send.
* @return {@link #RESULT_OK} if success, an error message otherwise.
*/ | Sends a command to the emulator and parses its answer | processCommand | {
"repo_name": "lrscp/ControlAndroidDeviceFromPC",
"path": "src/com/android/ddmlib/EmulatorConsole.java",
"license": "apache-2.0",
"size": 25424
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,758,167 |
private boolean checkForRingerModeChange(int oldIndex, int direction, int step) {
boolean adjustVolumeIndex = true;
int ringerMode = getRingerMode();
switch (ringerMode) {
case RINGER_MODE_NORMAL:
if (direction == AudioManager.ADJUST_LOWER) {
if (mHasVib... | boolean function(int oldIndex, int direction, int step) { boolean adjustVolumeIndex = true; int ringerMode = getRingerMode(); switch (ringerMode) { case RINGER_MODE_NORMAL: if (direction == AudioManager.ADJUST_LOWER) { if (mHasVibrator) { if (step <= oldIndex && oldIndex < 2 * step) { ringerMode = RINGER_MODE_VIBRATE; ... | /**
* Checks if the adjustment should change ringer mode instead of just
* adjusting volume. If so, this will set the proper ringer mode and volume
* indices on the stream states.
*/ | Checks if the adjustment should change ringer mode instead of just adjusting volume. If so, this will set the proper ringer mode and volume indices on the stream states | checkForRingerModeChange | {
"repo_name": "JSDemos/android-sdk-20",
"path": "src/android/media/AudioService.java",
"license": "apache-2.0",
"size": 199905
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 911,874 |
@Override
public void releaseMemory(int toRelease) throws IOException {
checkArgument(toRelease > 0);
for (ResultSubpartition subpartition : subpartitions) {
toRelease -= subpartition.releaseMemory();
// Only release as much memory as needed
if (toRelease <= 0) {
break;
}
}
} | void function(int toRelease) throws IOException { checkArgument(toRelease > 0); for (ResultSubpartition subpartition : subpartitions) { toRelease -= subpartition.releaseMemory(); if (toRelease <= 0) { break; } } } | /**
* Releases buffers held by this result partition.
*
* <p> This is a callback from the buffer pool, which is registered for result partitions, which
* are back pressure-free.
*/ | Releases buffers held by this result partition. This is a callback from the buffer pool, which is registered for result partitions, which are back pressure-free | releaseMemory | {
"repo_name": "hongyuhong/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java",
"license": "apache-2.0",
"size": 14211
} | [
"java.io.IOException",
"org.apache.flink.util.Preconditions"
] | import java.io.IOException; import org.apache.flink.util.Preconditions; | import java.io.*; import org.apache.flink.util.*; | [
"java.io",
"org.apache.flink"
] | java.io; org.apache.flink; | 865,601 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.