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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public Set<ThingTypeUID> getSupportedThingTypeUIDs(); | Set<ThingTypeUID> function(); | /**
* Defines the list of thing types that this participant can identify
*
* @return a set of thing type UIDs for which results can be created
*/ | Defines the list of thing types that this participant can identify | getSupportedThingTypeUIDs | {
"repo_name": "vilchev/eclipse-smarthome",
"path": "bundles/config/org.eclipse.smarthome.config.discovery/src/main/java/org/eclipse/smarthome/config/discovery/UpnpDiscoveryParticipant.java",
"license": "epl-1.0",
"size": 1912
} | [
"java.util.Set",
"org.eclipse.smarthome.core.thing.ThingTypeUID"
] | import java.util.Set; import org.eclipse.smarthome.core.thing.ThingTypeUID; | import java.util.*; import org.eclipse.smarthome.core.thing.*; | [
"java.util",
"org.eclipse.smarthome"
] | java.util; org.eclipse.smarthome; | 1,369,145 |
public static Type getType(final Method m) {
return getType(getMethodDescriptor(m));
} | static Type function(final Method m) { return getType(getMethodDescriptor(m)); } | /**
* Returns the Java method type corresponding to the given method.
*
* @param m
* a {@link Method Method} object.
* @return the Java method type corresponding to the given method.
*/ | Returns the Java method type corresponding to the given method | getType | {
"repo_name": "frohoff/jdk8u-jdk",
"path": "src/share/classes/jdk/internal/org/objectweb/asm/Type.java",
"license": "gpl-2.0",
"size": 30700
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,051,900 |
LL1Analyzer anal = new LL1Analyzer(this);
IntervalSet next = anal.LOOK(s, ctx);
return next;
} | LL1Analyzer anal = new LL1Analyzer(this); IntervalSet next = anal.LOOK(s, ctx); return next; } | /** Compute the set of valid tokens that can occur starting in state {@code s}.
* If {@code ctx} is null, the set of tokens will not include what can follow
* the rule surrounding {@code s}. In other words, the set will be
* restricted to tokens reachable staying within {@code s}'s rule.
*/ | Compute the set of valid tokens that can occur starting in state s. If ctx is null, the set of tokens will not include what can follow the rule surrounding s. In other words, the set will be restricted to tokens reachable staying within s's rule | nextTokens | {
"repo_name": "Pursuit92/antlr4",
"path": "runtime/Java/src/org/antlr/v4/runtime/atn/ATN.java",
"license": "bsd-3-clause",
"size": 6600
} | [
"org.antlr.v4.runtime.misc.IntervalSet"
] | import org.antlr.v4.runtime.misc.IntervalSet; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,261,035 |
public void bind(SocketAddress endpoint) throws IOException {
bind(endpoint, 50);
} | void function(SocketAddress endpoint) throws IOException { bind(endpoint, 50); } | /**
*
* Binds the {@code ServerSocket} to a specific address
* (IP address and port number).
* <p>
* If the address is {@code null}, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
*
* @param endpoint The IP address and port number to bind to.
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
* @throws SecurityException if a {@code SecurityManager} is present and
* its {@code checkListen} method doesn't allow the operation.
* @throws IllegalArgumentException if endpoint is a
* SocketAddress subclass not supported by this socket
* @since 1.4
*/ | Binds the ServerSocket to a specific address (IP address and port number). If the address is null, then the system will pick up an ephemeral port and a valid local address to bind the socket | bind | {
"repo_name": "google/desugar_jdk_libs",
"path": "jdk11/src/java.base/share/classes/java/net/ServerSocket.java",
"license": "gpl-2.0",
"size": 41520
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 777,845 |
CachePoolInfo getInfo(boolean fullInfo) {
CachePoolInfo info = new CachePoolInfo(poolName);
if (!fullInfo) {
return info;
}
return info.setOwnerName(ownerName).
setGroupName(groupName).
setMode(new FsPermission(mode)).
setLimit(limit).
setMaxRelativeExpiryMs(maxRelativeExpiryMs);
} | CachePoolInfo getInfo(boolean fullInfo) { CachePoolInfo info = new CachePoolInfo(poolName); if (!fullInfo) { return info; } return info.setOwnerName(ownerName). setGroupName(groupName). setMode(new FsPermission(mode)). setLimit(limit). setMaxRelativeExpiryMs(maxRelativeExpiryMs); } | /**
* Get either full or partial information about this CachePool.
*
* @param fullInfo
* If true, only the name will be returned (i.e., what you
* would get if you didn't have read permission for this pool.)
* @return
* Cache pool information.
*/ | Get either full or partial information about this CachePool | getInfo | {
"repo_name": "jsrudani/HadoopHDFSProject",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CachePool.java",
"license": "apache-2.0",
"size": 9298
} | [
"org.apache.hadoop.fs.permission.FsPermission",
"org.apache.hadoop.hdfs.protocol.CachePoolInfo"
] | import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.protocol.CachePoolInfo; | import org.apache.hadoop.fs.permission.*; import org.apache.hadoop.hdfs.protocol.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,012,603 |
private void dfsPruning(Prefix prefix, Bitmap prefixBitmap, List<Integer> sn, List<Integer> in, int hasToBeGreaterThanForIStep, int m, Integer lastAppendedItem) throws IOException {
// System.out.println(prefix.toString());
// ====== S-STEPS ======
// Temporary variables (as described in the paper)
List<Integer> sTemp = new ArrayList<Integer>();
List<Bitmap> sTempBitmaps = new ArrayList<Bitmap>();
// for CMAP pruning, we will only check against the last appended item
Map<Integer, Integer> mapSupportItemsAfter = coocMapAfter.get(lastAppendedItem);
// for each item in sn
loopi:
for (Integer i : sn) {
// LAST POSITION PRUNING
// CMAP PRUNING
// we only check with the last appended item
if (useCMAPPruning) {
if (mapSupportItemsAfter == null) {
continue loopi;
}
Integer support = mapSupportItemsAfter.get(i);
if (support == null || support < minsup) {
// System.out.println("PRUNE");
continue loopi;
}
}
// perform the S-STEP with that item to get a new bitmap
Bitmap.INTERSECTION_COUNT++;
// System.out.println(prefix + " bitmap : " + prefixBitmap.bitmap);
// if(prefix.size() == 1 && prefix.get(0).get(0) == 5) {
// System.out.println("TEST1" + prefixB);
// }
Bitmap newBitmap = prefixBitmap.createNewBitmapSStep(verticalDB.get(i), sequencesSize, lastBitIndex, maxGap);
// if the support is higher than minsup
if (newBitmap.getSupportWithoutGapTotal() >= minsup) {
// record that item and pattern in temporary variables
sTemp.add(i);
sTempBitmaps.add(newBitmap);
}
}
// for each pattern recorded for the s-step
for (int k = 0; k < sTemp.size(); k++) {
int item = sTemp.get(k);
// create the new prefix
Prefix prefixSStep = prefix.cloneSequence();
prefixSStep.addItemset(new Itemset(item));
// create the new bitmap
Bitmap newBitmap = sTempBitmaps.get(k);
// save the pattern to the file
if(newBitmap.getSupport() >= minsup) {
if(m >= minimumPatternLength) {
savePattern(prefixSStep, newBitmap);
}
// recursively try to extend that pattern
if (maximumPatternLength > m) {
dfsPruning(prefixSStep, newBitmap, sTemp, sTemp, item, m + 1, item);
}
}
}
Map<Integer, Integer> mapSupportItemsEquals = coocMapEquals.get(lastAppendedItem);
// ======== I STEPS =======
// Temporary variables
List<Integer> iTemp = new ArrayList<Integer>();
List<Bitmap> iTempBitmaps = new ArrayList<Bitmap>();
// for each item in in
loop2:
for (Integer i : in) {
// the item has to be greater than the largest item
// already in the last itemset of prefix.
if (i > hasToBeGreaterThanForIStep) {
// LAST POSITION PRUNING
// CMAP PRUNING
if (useCMAPPruning) {
if (mapSupportItemsEquals == null) {
continue loop2;
}
Integer support = mapSupportItemsEquals.get(i);
if (support == null || support < minsup) {
continue loop2;
}
}
// Perform an i-step with this item and the current prefix.
// This creates a new bitmap
Bitmap.INTERSECTION_COUNT++;
Bitmap newBitmap = prefixBitmap.createNewBitmapIStep(verticalDB.get(i), sequencesSize, lastBitIndex);
// If the support is no less than minsup
if (newBitmap.getSupport() >= minsup) {
// record that item and pattern in temporary variables
iTemp.add(i);
iTempBitmaps.add(newBitmap);
}
}
}
// for each pattern recorded for the i-step
for (int k = 0; k < iTemp.size(); k++) {
int item = iTemp.get(k);
// create the new prefix
Prefix prefixIStep = prefix.cloneSequence();
prefixIStep.getItemsets().get(prefixIStep.size() - 1).addItem(item);
// create the new bitmap
Bitmap newBitmap = iTempBitmaps.get(k);
// save the pattern
if(m >= minimumPatternLength) {
savePattern(prefixIStep, newBitmap);
}
// recursively try to extend that pattern
if (maximumPatternLength > m) {
dfsPruning(prefixIStep, newBitmap, sTemp, iTemp, item, m + 1, item);
}
}
// check the memory usage
MemoryLogger.getInstance().checkMemory();
}
| void function(Prefix prefix, Bitmap prefixBitmap, List<Integer> sn, List<Integer> in, int hasToBeGreaterThanForIStep, int m, Integer lastAppendedItem) throws IOException { List<Integer> sTemp = new ArrayList<Integer>(); List<Bitmap> sTempBitmaps = new ArrayList<Bitmap>(); Map<Integer, Integer> mapSupportItemsAfter = coocMapAfter.get(lastAppendedItem); loopi: for (Integer i : sn) { if (useCMAPPruning) { if (mapSupportItemsAfter == null) { continue loopi; } Integer support = mapSupportItemsAfter.get(i); if (support == null support < minsup) { continue loopi; } } Bitmap.INTERSECTION_COUNT++; Bitmap newBitmap = prefixBitmap.createNewBitmapSStep(verticalDB.get(i), sequencesSize, lastBitIndex, maxGap); if (newBitmap.getSupportWithoutGapTotal() >= minsup) { sTemp.add(i); sTempBitmaps.add(newBitmap); } } for (int k = 0; k < sTemp.size(); k++) { int item = sTemp.get(k); Prefix prefixSStep = prefix.cloneSequence(); prefixSStep.addItemset(new Itemset(item)); Bitmap newBitmap = sTempBitmaps.get(k); if(newBitmap.getSupport() >= minsup) { if(m >= minimumPatternLength) { savePattern(prefixSStep, newBitmap); } if (maximumPatternLength > m) { dfsPruning(prefixSStep, newBitmap, sTemp, sTemp, item, m + 1, item); } } } Map<Integer, Integer> mapSupportItemsEquals = coocMapEquals.get(lastAppendedItem); List<Integer> iTemp = new ArrayList<Integer>(); List<Bitmap> iTempBitmaps = new ArrayList<Bitmap>(); loop2: for (Integer i : in) { if (i > hasToBeGreaterThanForIStep) { if (useCMAPPruning) { if (mapSupportItemsEquals == null) { continue loop2; } Integer support = mapSupportItemsEquals.get(i); if (support == null support < minsup) { continue loop2; } } Bitmap.INTERSECTION_COUNT++; Bitmap newBitmap = prefixBitmap.createNewBitmapIStep(verticalDB.get(i), sequencesSize, lastBitIndex); if (newBitmap.getSupport() >= minsup) { iTemp.add(i); iTempBitmaps.add(newBitmap); } } } for (int k = 0; k < iTemp.size(); k++) { int item = iTemp.get(k); Prefix prefixIStep = prefix.cloneSequence(); prefixIStep.getItemsets().get(prefixIStep.size() - 1).addItem(item); Bitmap newBitmap = iTempBitmaps.get(k); if(m >= minimumPatternLength) { savePattern(prefixIStep, newBitmap); } if (maximumPatternLength > m) { dfsPruning(prefixIStep, newBitmap, sTemp, iTemp, item, m + 1, item); } } MemoryLogger.getInstance().checkMemory(); } | /**
* This is the dfsPruning method as described in the SPAM paper.
*
* @param prefix the current prefix
* @param prefixBitmap the bitmap corresponding to the current prefix
* @param sn a list of items to be considered for i-steps
* @param in a list of items to be considered for s-steps
* @param hasToBeGreaterThanForIStep
* @param m size of the current prefix in terms of items
* @param lastAppendedItem the last appended item to the prefix
* @throws IOException if there is an error writing a pattern to the output
* file
*/ | This is the dfsPruning method as described in the SPAM paper | dfsPruning | {
"repo_name": "aocalderon/PhD",
"path": "Y2Q2/Research/Code/SPMF/src/ca/pfv/spmf/algorithms/sequentialpatterns/spam/AlgoCMSPAM.java",
"license": "lgpl-3.0",
"size": 28580
} | [
"ca.pfv.spmf.patterns.itemset_list_integers_without_support.Itemset",
"ca.pfv.spmf.tools.MemoryLogger",
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map"
] | import ca.pfv.spmf.patterns.itemset_list_integers_without_support.Itemset; import ca.pfv.spmf.tools.MemoryLogger; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; | import ca.pfv.spmf.patterns.itemset_list_integers_without_support.*; import ca.pfv.spmf.tools.*; import java.io.*; import java.util.*; | [
"ca.pfv.spmf",
"java.io",
"java.util"
] | ca.pfv.spmf; java.io; java.util; | 1,269,408 |
EAttribute getOpenAttrs_AnyAttribute(); | EAttribute getOpenAttrs_AnyAttribute(); | /**
* Returns the meta object for the attribute list '{@link org.w3._2001.schema.OpenAttrs#getAnyAttribute <em>Any Attribute</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute list '<em>Any Attribute</em>'.
* @see org.w3._2001.schema.OpenAttrs#getAnyAttribute()
* @see #getOpenAttrs()
* @generated
*/ | Returns the meta object for the attribute list '<code>org.w3._2001.schema.OpenAttrs#getAnyAttribute Any Attribute</code>'. | getOpenAttrs_AnyAttribute | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wps/src/org/w3/_2001/schema/SchemaPackage.java",
"license": "lgpl-2.1",
"size": 433240
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,878,542 |
private void getLastChild() {
final NodeCursor cursor = getCursor();
// Nodekey of the root of the current subtree.
final long parent = cursor.getNodeKey();
if (cursor.hasFirstChild()) {
while (cursor.hasFirstChild()) {
mStack.push(cursor.getNodeKey());
cursor.moveToFirstChild();
}
while (cursor.hasRightSibling()) {
mStack.push(cursor.getNodeKey());
cursor.moveToRightSibling();
getLastChild();
}
if (cursor.hasParent() && (cursor.getParentKey() != parent)) {
mStack.push(cursor.getNodeKey());
while (cursor.hasParent() && (cursor.getParentKey() != parent)) {
cursor.moveToParent();
while (cursor.hasRightSibling()) {
cursor.moveToRightSibling();
getLastChild();
mStack.push(cursor.getNodeKey());
}
}
cursor.moveTo(mStack.pop());
}
}
} | void function() { final NodeCursor cursor = getCursor(); final long parent = cursor.getNodeKey(); if (cursor.hasFirstChild()) { while (cursor.hasFirstChild()) { mStack.push(cursor.getNodeKey()); cursor.moveToFirstChild(); } while (cursor.hasRightSibling()) { mStack.push(cursor.getNodeKey()); cursor.moveToRightSibling(); getLastChild(); } if (cursor.hasParent() && (cursor.getParentKey() != parent)) { mStack.push(cursor.getNodeKey()); while (cursor.hasParent() && (cursor.getParentKey() != parent)) { cursor.moveToParent(); while (cursor.hasRightSibling()) { cursor.moveToRightSibling(); getLastChild(); mStack.push(cursor.getNodeKey()); } } cursor.moveTo(mStack.pop()); } } } | /**
* Moves the transaction to the node in the current subtree, that is last in document order and
* pushes all other node key on a stack. At the end the stack contains all node keys except for
* the last one in reverse document order.
*/ | Moves the transaction to the node in the current subtree, that is last in document order and pushes all other node key on a stack. At the end the stack contains all node keys except for the last one in reverse document order | getLastChild | {
"repo_name": "sirixdb/sirix",
"path": "bundles/sirix-core/src/main/java/org/sirix/axis/PrecedingAxis.java",
"license": "bsd-3-clause",
"size": 5690
} | [
"org.sirix.api.NodeCursor"
] | import org.sirix.api.NodeCursor; | import org.sirix.api.*; | [
"org.sirix.api"
] | org.sirix.api; | 1,977,103 |
public void testSetBitPositiveOutside2() {
byte aBytes[] = {1, -128, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26};
int aSign = 1;
int number = 223;
byte rBytes[] = {
0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -128, 56, 100,
-2, -76, 89, 45, 91, 3, -15, 35, 26};
BigInteger aNumber = new BigInteger(aSign, aBytes);
BigInteger result = aNumber.setBit(number);
byte resBytes[] = new byte[rBytes.length];
resBytes = result.toByteArray();
for (int i = 0; i < resBytes.length; i++) {
assertTrue(resBytes[i] == rBytes[i]);
}
assertEquals("incorrect sign", 1, result.signum());
} | void function() { byte aBytes[] = {1, -128, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26}; int aSign = 1; int number = 223; byte rBytes[] = { 0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -128, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26}; BigInteger aNumber = new BigInteger(aSign, aBytes); BigInteger result = aNumber.setBit(number); byte resBytes[] = new byte[rBytes.length]; resBytes = result.toByteArray(); for (int i = 0; i < resBytes.length; i++) { assertTrue(resBytes[i] == rBytes[i]); } assertEquals(STR, 1, result.signum()); } | /**
* setBit(int n) outside a positive number.
*/ | setBit(int n) outside a positive number | testSetBitPositiveOutside2 | {
"repo_name": "google/j2cl",
"path": "jre/javatests/com/google/gwt/emultest/java/math/BigIntegerOperateBitsTest.java",
"license": "apache-2.0",
"size": 47597
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 936,681 |
public ITableRendererSource getColumnRendererSource()
{
return m_objColumnRendererSource;
} | ITableRendererSource function() { return m_objColumnRendererSource; } | /**
* Returns the columnRendererSource.
* @return ITableColumnRendererSource
*/ | Returns the columnRendererSource | getColumnRendererSource | {
"repo_name": "apache/tapestry4",
"path": "contrib/src/java/org/apache/tapestry/contrib/table/model/common/AbstractTableColumn.java",
"license": "apache-2.0",
"size": 7108
} | [
"org.apache.tapestry.contrib.table.model.ITableRendererSource"
] | import org.apache.tapestry.contrib.table.model.ITableRendererSource; | import org.apache.tapestry.contrib.table.model.*; | [
"org.apache.tapestry"
] | org.apache.tapestry; | 290,989 |
public EndpointFactory getEndpointFactory() {
return endpointFactory;
} | EndpointFactory function() { return endpointFactory; } | /**
* Obtains the endpointFactory.
* @return
*/ | Obtains the endpointFactory | getEndpointFactory | {
"repo_name": "christophd/citrus",
"path": "core/citrus-base/src/main/java/com/consol/citrus/CitrusContext.java",
"license": "apache-2.0",
"size": 16973
} | [
"com.consol.citrus.endpoint.EndpointFactory"
] | import com.consol.citrus.endpoint.EndpointFactory; | import com.consol.citrus.endpoint.*; | [
"com.consol.citrus"
] | com.consol.citrus; | 1,860,423 |
void remove(String id) throws NotFoundException, ServerException, ConflictException; | void remove(String id) throws NotFoundException, ServerException, ConflictException; | /**
* Removes account from persistent layer
*
* @param id
* account identifier
*/ | Removes account from persistent layer | remove | {
"repo_name": "dhuebner/che",
"path": "core/platform-api/che-core-api-account/src/main/java/org/eclipse/che/api/account/server/dao/AccountDao.java",
"license": "epl-1.0",
"size": 6721
} | [
"org.eclipse.che.api.core.ConflictException",
"org.eclipse.che.api.core.NotFoundException",
"org.eclipse.che.api.core.ServerException"
] | import org.eclipse.che.api.core.ConflictException; import org.eclipse.che.api.core.NotFoundException; import org.eclipse.che.api.core.ServerException; | import org.eclipse.che.api.core.*; | [
"org.eclipse.che"
] | org.eclipse.che; | 1,968,099 |
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "NP_OPTIONAL_RETURN_NULL", justification = "Intentional behavior")
public Optional<Entity> get(String entityTypeId, Object id, EntityType entityType)
{
CombinedEntityCache cache = caches.get();
if (cache == null)
{
return null;
}
Optional<Entity> result = cache.getIfPresent(entityType, id);
if (result != null)
{
LOG.debug("Retrieved entity [{}] from L1 cache that belongs to {}", id, entityTypeId);
}
else
{
LOG.trace("No entity with id [{}] present in L1 cache that belongs to {}", id, entityTypeId);
}
return result;
} | @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = STR, justification = STR) Optional<Entity> function(String entityTypeId, Object id, EntityType entityType) { CombinedEntityCache cache = caches.get(); if (cache == null) { return null; } Optional<Entity> result = cache.getIfPresent(entityType, id); if (result != null) { LOG.debug(STR, id, entityTypeId); } else { LOG.trace(STR, id, entityTypeId); } return result; } | /**
* Retrieves an entity from the L1 cache based on a combination of entity name and entity id.
*
* @param entityTypeId name of the entity to retrieve
* @param id id value of the entity to retrieve
* @return the retrieved {@link Entity} or Optional.empty() if deletion of this entity is stored in the cache or
* null if no information available about this entity in the cache
*/ | Retrieves an entity from the L1 cache based on a combination of entity name and entity id | get | {
"repo_name": "npklein/molgenis",
"path": "molgenis-data-cache/src/main/java/org/molgenis/data/cache/l1/L1Cache.java",
"license": "lgpl-3.0",
"size": 4552
} | [
"java.util.Optional",
"org.molgenis.data.Entity",
"org.molgenis.data.cache.utils.CombinedEntityCache",
"org.molgenis.data.meta.model.EntityType"
] | import java.util.Optional; import org.molgenis.data.Entity; import org.molgenis.data.cache.utils.CombinedEntityCache; import org.molgenis.data.meta.model.EntityType; | import java.util.*; import org.molgenis.data.*; import org.molgenis.data.cache.utils.*; import org.molgenis.data.meta.model.*; | [
"java.util",
"org.molgenis.data"
] | java.util; org.molgenis.data; | 2,863,029 |
private List<List<IMethodBinding>> groupOverrideEquivalentMethods(List<IMethodBinding> methods) {
List<List<IMethodBinding>> groups = Lists.newArrayList();
for (IMethodBinding method : methods) {
List<IMethodBinding> group = null;
for (List<IMethodBinding> candidate : groups) {
IMethodBinding first = candidate.get(0);
// Two methods are override-equivalent if either is a subsignature of the other.
// http://docs.oracle.com/javase/specs/jls/se5.0/html/classes.html#38649
if (isSubsignature(method, first) || isSubsignature(first, method)) {
group = candidate;
break;
}
}
if (group != null) {
group.add(method);
} else {
groups.add(Lists.newArrayList(method));
}
}
return groups;
} | List<List<IMethodBinding>> function(List<IMethodBinding> methods) { List<List<IMethodBinding>> groups = Lists.newArrayList(); for (IMethodBinding method : methods) { List<IMethodBinding> group = null; for (List<IMethodBinding> candidate : groups) { IMethodBinding first = candidate.get(0); if (isSubsignature(method, first) isSubsignature(first, method)) { group = candidate; break; } } if (group != null) { group.add(method); } else { groups.add(Lists.newArrayList(method)); } } return groups; } | /**
* Group a list of methods by override-equivalency, as defined by JLS3, section 8.4.2.
*/ | Group a list of methods by override-equivalency, as defined by JLS3, section 8.4.2 | groupOverrideEquivalentMethods | {
"repo_name": "rwl/j2objc",
"path": "src/main/java/com/google/devtools/j2objc/translate/DeadCodeEliminator.java",
"license": "apache-2.0",
"size": 34319
} | [
"com.google.common.collect.Lists",
"java.util.List",
"org.eclipse.jdt.core.dom.IMethodBinding"
] | import com.google.common.collect.Lists; import java.util.List; import org.eclipse.jdt.core.dom.IMethodBinding; | import com.google.common.collect.*; import java.util.*; import org.eclipse.jdt.core.dom.*; | [
"com.google.common",
"java.util",
"org.eclipse.jdt"
] | com.google.common; java.util; org.eclipse.jdt; | 280,800 |
@Test
public void testImmutability() {
assertThatClassIsImmutable(MplsPathIntent.class);
} | void function() { assertThatClassIsImmutable(MplsPathIntent.class); } | /**
* Checks that the MplsPathIntent class is immutable.
*/ | Checks that the MplsPathIntent class is immutable | testImmutability | {
"repo_name": "maxkondr/onos-porta",
"path": "core/api/src/test/java/org/onosproject/net/intent/MplsPathIntentTest.java",
"license": "apache-2.0",
"size": 3493
} | [
"org.onlab.junit.ImmutableClassChecker"
] | import org.onlab.junit.ImmutableClassChecker; | import org.onlab.junit.*; | [
"org.onlab.junit"
] | org.onlab.junit; | 316,784 |
private InputMethod getIMInstance(Iterator<InputMethodDescriptor> descriptors,
Locale locale) throws Exception {
while (descriptors.hasNext()) {
InputMethodDescriptor desc = descriptors.next();
Locale[] locs = desc.getAvailableLocales();
for (Locale element : locs) {
if (locale.equals(element)) {
return getIMInstance(desc);
}
}
}
return null;
} | InputMethod function(Iterator<InputMethodDescriptor> descriptors, Locale locale) throws Exception { while (descriptors.hasNext()) { InputMethodDescriptor desc = descriptors.next(); Locale[] locs = desc.getAvailableLocales(); for (Locale element : locs) { if (locale.equals(element)) { return getIMInstance(desc); } } } return null; } | /**
* Gets input method instance for the given
* locale from the given list of descriptors
* @param descriptors iterator of the list of IM descriptors
* @param locale the locale to be supported by the IM
* @return input method instance
* @throws Exception
*/ | Gets input method instance for the given locale from the given list of descriptors | getIMInstance | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/archive/classlib/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/im/InputMethodContext.java",
"license": "apache-2.0",
"size": 17520
} | [
"java.awt.im.spi.InputMethod",
"java.awt.im.spi.InputMethodDescriptor",
"java.util.Iterator",
"java.util.Locale"
] | import java.awt.im.spi.InputMethod; import java.awt.im.spi.InputMethodDescriptor; import java.util.Iterator; import java.util.Locale; | import java.awt.im.spi.*; import java.util.*; | [
"java.awt",
"java.util"
] | java.awt; java.util; | 2,238,846 |
@Override
public synchronized void afterLast() throws SQLException {
super.afterLast();
} | synchronized void function() throws SQLException { super.afterLast(); } | /**
* JDBC 2.0
*
* <p>
* Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows.
* </p>
*
* @exception SQLException
* if a database-access error occurs, or result set type is
* TYPE_FORWARD_ONLY.
*/ | JDBC 2.0 Moves to the end of the result set, just after the last row. Has no effect if the result set contains no rows. | afterLast | {
"repo_name": "slockhart/sql-app",
"path": "mysql-connector-java-5.1.34/src/com/mysql/jdbc/UpdatableResultSet.java",
"license": "gpl-2.0",
"size": 93047
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,284,214 |
void setPlane(int z, int t)
{
currentPlane = new Coord3D(z, t);
}
| void setPlane(int z, int t) { currentPlane = new Coord3D(z, t); } | /**
* Sets the selected z-section and timepoint.
*
* @param z The selected z-section.
* @param t The selected timepoint.
*/ | Sets the selected z-section and timepoint | setPlane | {
"repo_name": "chris-allan/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/measurement/view/MeasurementViewerModel.java",
"license": "gpl-2.0",
"size": 50154
} | [
"org.openmicroscopy.shoola.util.roi.model.util.Coord3D"
] | import org.openmicroscopy.shoola.util.roi.model.util.Coord3D; | import org.openmicroscopy.shoola.util.roi.model.util.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 2,202,898 |
// TODO(b/138456686): make detailedExitCode non-nullable
void handleError(
QueryExpression expression, String message, @Nullable DetailedExitCode detailedExitCode)
throws QueryException; | void handleError( QueryExpression expression, String message, @Nullable DetailedExitCode detailedExitCode) throws QueryException; | /**
* Handle an error during evaluation of {@code expression} by either throwing {@link
* QueryException} or emitting an event, depending on whether the evaluation is running in a "keep
* going" mode.
*/ | Handle an error during evaluation of expression by either throwing <code>QueryException</code> or emitting an event, depending on whether the evaluation is running in a "keep going" mode | handleError | {
"repo_name": "werkt/bazel",
"path": "src/main/java/com/google/devtools/build/lib/query2/engine/QueryEnvironment.java",
"license": "apache-2.0",
"size": 26694
} | [
"com.google.devtools.build.lib.util.DetailedExitCode",
"javax.annotation.Nullable"
] | import com.google.devtools.build.lib.util.DetailedExitCode; import javax.annotation.Nullable; | import com.google.devtools.build.lib.util.*; import javax.annotation.*; | [
"com.google.devtools",
"javax.annotation"
] | com.google.devtools; javax.annotation; | 933,780 |
public void remove() {
if (_expectedSize != _hash.size()) {
throw new ConcurrentModificationException();
}
// Disable auto compaction during the remove. This is a workaround for bug 1642768.
try {
_hash.tempDisableAutoCompaction();
_hash.removeAt(_index);
}
finally {
_hash.reenableAutoCompaction( false );
}
_expectedSize--;
} | void function() { if (_expectedSize != _hash.size()) { throw new ConcurrentModificationException(); } try { _hash.tempDisableAutoCompaction(); _hash.removeAt(_index); } finally { _hash.reenableAutoCompaction( false ); } _expectedSize--; } | /**
* Removes the last entry returned by the iterator.
* Invoking this method more than once for a single entry
* will leave the underlying data structure in a confused
* state.
*/ | Removes the last entry returned by the iterator. Invoking this method more than once for a single entry will leave the underlying data structure in a confused state | remove | {
"repo_name": "achraftriki/test2",
"path": "src/main/java/gnu/trove/impl/hash/THashPrimitiveIterator.java",
"license": "gpl-3.0",
"size": 4483
} | [
"java.util.ConcurrentModificationException"
] | import java.util.ConcurrentModificationException; | import java.util.*; | [
"java.util"
] | java.util; | 2,822,292 |
List<User> getAllowedUsers(PerunSession sess, Resource resource); | List<User> getAllowedUsers(PerunSession sess, Resource resource); | /**
* Returns all users who are allowed on the defined resource.
*
* @param sess
* @param resource
* @return list of users
* @throws InternalErrorException
*/ | Returns all users who are allowed on the defined resource | getAllowedUsers | {
"repo_name": "mvocu/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/ResourcesManagerImplApi.java",
"license": "bsd-2-clause",
"size": 29312
} | [
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.Resource",
"cz.metacentrum.perun.core.api.User",
"java.util.List"
] | import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.Resource; import cz.metacentrum.perun.core.api.User; import java.util.List; | import cz.metacentrum.perun.core.api.*; import java.util.*; | [
"cz.metacentrum.perun",
"java.util"
] | cz.metacentrum.perun; java.util; | 1,475,985 |
@Test
public void testMultipleStartSingleReplicator() {
Replicator mockReplicator = mock(Replicator.class);
EventBus mockEventBus = mock(EventBus.class);
when(mockReplicator.getEventBus()).thenReturn(mockEventBus);
TestPolicy replicationPolicy = new TestPolicy();
replicationPolicy.addReplicators(mockReplicator);
verify(mockReplicator, never()).start();
replicationPolicy.start();
replicationPolicy.start();
verify(mockReplicator, times(1)).start();
} | void function() { Replicator mockReplicator = mock(Replicator.class); EventBus mockEventBus = mock(EventBus.class); when(mockReplicator.getEventBus()).thenReturn(mockEventBus); TestPolicy replicationPolicy = new TestPolicy(); replicationPolicy.addReplicators(mockReplicator); verify(mockReplicator, never()).start(); replicationPolicy.start(); replicationPolicy.start(); verify(mockReplicator, times(1)).start(); } | /**
* Check that when the {@link ReplicationPolicyManager} is setup with a single
* {@link Replicator}, when the replication policy is started
* more than once before the {@link Replicator} has completed replication,
* the {@link Replicator#start()} method is called only once the {@link Replicator}.
*/ | Check that when the <code>ReplicationPolicyManager</code> is setup with a single <code>Replicator</code>, when the replication policy is started more than once before the <code>Replicator</code> has completed replication, the <code>Replicator#start()</code> method is called only once the <code>Replicator</code> | testMultipleStartSingleReplicator | {
"repo_name": "cloudant/sync-android",
"path": "cloudant-sync-datastore-core/src/test/java/com/cloudant/sync/internal/replication/ReplicationPolicyManagerTest.java",
"license": "apache-2.0",
"size": 19909
} | [
"com.cloudant.sync.event.EventBus",
"com.cloudant.sync.replication.Replicator",
"org.mockito.Mockito"
] | import com.cloudant.sync.event.EventBus; import com.cloudant.sync.replication.Replicator; import org.mockito.Mockito; | import com.cloudant.sync.event.*; import com.cloudant.sync.replication.*; import org.mockito.*; | [
"com.cloudant.sync",
"org.mockito"
] | com.cloudant.sync; org.mockito; | 2,690,746 |
public void setRestConfiguration(RestConfiguration restConfiguration)
{
this.restConfiguration = restConfiguration;
} | void function(RestConfiguration restConfiguration) { this.restConfiguration = restConfiguration; } | /**
* set REST configuration
* @param restConfiguration
*/ | set REST configuration | setRestConfiguration | {
"repo_name": "harfalm/Sakai-10.1",
"path": "help/help-component/src/java/org/sakaiproject/component/app/help/HelpManagerImpl.java",
"license": "apache-2.0",
"size": 39700
} | [
"org.sakaiproject.api.app.help.RestConfiguration"
] | import org.sakaiproject.api.app.help.RestConfiguration; | import org.sakaiproject.api.app.help.*; | [
"org.sakaiproject.api"
] | org.sakaiproject.api; | 836,424 |
public static long getFilesizeOnHDFS( Path path )
throws IOException
{
FileSystem fs = IOUtilFunctions.getFileSystem(path);
long ret = 0; //in bytes
if( fs.isDirectory(path) )
ret = fs.getContentSummary(path).getLength();
else
ret = fs.getFileStatus(path).getLen();
//note: filestatus would return 0 on directories
return ret;
}
| static long function( Path path ) throws IOException { FileSystem fs = IOUtilFunctions.getFileSystem(path); long ret = 0; if( fs.isDirectory(path) ) ret = fs.getContentSummary(path).getLength(); else ret = fs.getFileStatus(path).getLen(); return ret; } | /**
* Returns the size of a file or directory on hdfs in bytes.
*
* @param path file system path
* @return file size
* @throws IOException if IOException occurs
*/ | Returns the size of a file or directory on hdfs in bytes | getFilesizeOnHDFS | {
"repo_name": "deroneriksson/incubator-systemml",
"path": "src/main/java/org/apache/sysml/runtime/util/MapReduceTool.java",
"license": "apache-2.0",
"size": 23017
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.sysml.runtime.io.IOUtilFunctions"
] | import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.sysml.runtime.io.IOUtilFunctions; | import java.io.*; import org.apache.hadoop.fs.*; import org.apache.sysml.runtime.io.*; | [
"java.io",
"org.apache.hadoop",
"org.apache.sysml"
] | java.io; org.apache.hadoop; org.apache.sysml; | 154,302 |
public void addObject(Resource resource, Object entity)
throws RepositoryException {
if (entity instanceof RDFObjectBehaviour) {
RDFObjectBehaviour support = (RDFObjectBehaviour) entity;
Object delegate = support.getBehaviourDelegate();
if (delegate != entity) {
addObject(resource, delegate);
return;
}
}
synchronized (merged) {
merged.add(resource);
}
boolean autoCommit = isAutoCommit();
if (autoCommit) {
setAutoCommit(false);
}
try {
Class<?> proxy = entity.getClass();
Set<URI> list = getTypes(proxy, new HashSet<URI>(4));
for (URI type : list) {
types.addTypeStatement(resource, type);
}
Object result = of.createObject(resource, list);
if (result instanceof Mergeable) {
((Mergeable) result).merge(entity);
}
if (autoCommit) {
setAutoCommit(true);
}
} finally {
if (autoCommit && !isAutoCommit()) {
rollback();
setAutoCommit(true);
}
}
} | void function(Resource resource, Object entity) throws RepositoryException { if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { addObject(resource, delegate); return; } } synchronized (merged) { merged.add(resource); } boolean autoCommit = isAutoCommit(); if (autoCommit) { setAutoCommit(false); } try { Class<?> proxy = entity.getClass(); Set<URI> list = getTypes(proxy, new HashSet<URI>(4)); for (URI type : list) { types.addTypeStatement(resource, type); } Object result = of.createObject(resource, list); if (result instanceof Mergeable) { ((Mergeable) result).merge(entity); } if (autoCommit) { setAutoCommit(true); } } finally { if (autoCommit && !isAutoCommit()) { rollback(); setAutoCommit(true); } } } | /**
* Imports the entity into the RDF store using the given handle.
*/ | Imports the entity into the RDF store using the given handle | addObject | {
"repo_name": "stain/alibaba",
"path": "object-repository/src/main/java/org/openrdf/repository/object/ObjectConnection.java",
"license": "bsd-3-clause",
"size": 22203
} | [
"java.util.HashSet",
"java.util.Set",
"org.openrdf.model.Resource",
"org.openrdf.repository.RepositoryException",
"org.openrdf.repository.object.traits.Mergeable",
"org.openrdf.repository.object.traits.RDFObjectBehaviour"
] | import java.util.HashSet; import java.util.Set; import org.openrdf.model.Resource; import org.openrdf.repository.RepositoryException; import org.openrdf.repository.object.traits.Mergeable; import org.openrdf.repository.object.traits.RDFObjectBehaviour; | import java.util.*; import org.openrdf.model.*; import org.openrdf.repository.*; import org.openrdf.repository.object.traits.*; | [
"java.util",
"org.openrdf.model",
"org.openrdf.repository"
] | java.util; org.openrdf.model; org.openrdf.repository; | 1,984,280 |
Doc generateFilename(Element element); | Doc generateFilename(Element element); | /**
* Generates the result filename for the generated document
*/ | Generates the result filename for the generated document | generateFilename | {
"repo_name": "jmuk/toolkit",
"path": "src/main/java/com/google/api/codegen/go/GoSnippetSet.java",
"license": "apache-2.0",
"size": 1411
} | [
"com.google.api.tools.framework.snippet.Doc"
] | import com.google.api.tools.framework.snippet.Doc; | import com.google.api.tools.framework.snippet.*; | [
"com.google.api"
] | com.google.api; | 328,151 |
@RequestMapping(method = RequestMethod.POST, value = "/shareWithUsersViaEmail")
@Transactional
public ShareResponse shareWithUsersViaEmail(@RequestBody ShareRequest request) {
String resText = emailService.shareWithUsers(request.getSendTo(), constructUrl(request.getDocId()),
request.getSentFrom());
ShareResponse response = new ShareResponse();
response.setResponseText(resText);
if (!resText.isEmpty()) {
if (resText.contains("Success")||resText.contains("Email Queued"))
response.setResponseType("Success");
else if(resText.contains("Missing"))
response.setResponseType("Warning");
else
response.setResponseType("Failure");
}
return response;
} | @RequestMapping(method = RequestMethod.POST, value = STR) ShareResponse function(@RequestBody ShareRequest request) { String resText = emailService.shareWithUsers(request.getSendTo(), constructUrl(request.getDocId()), request.getSentFrom()); ShareResponse response = new ShareResponse(); response.setResponseText(resText); if (!resText.isEmpty()) { if (resText.contains(STR) resText.contains(STR)) response.setResponseType(STR); else if(resText.contains(STR)) response.setResponseType(STR); else response.setResponseType(STR); } return response; } | /**
* Responsible for sharing the document url with the given list of users through email
* @param request
* @return ShareResponse
*/ | Responsible for sharing the document url with the given list of users through email | shareWithUsersViaEmail | {
"repo_name": "aroychoudhury/innovista",
"path": "sharing-services/src/main/java/org/verizon/sharingservices/web/SharingServiceController.java",
"license": "mit",
"size": 6384
} | [
"org.springframework.web.bind.annotation.RequestBody",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.verizon.sharingservices.dataobject.ShareRequest",
"org.verizon.sharingservices.dataobject.ShareResponse"
] | import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.verizon.sharingservices.dataobject.ShareRequest; import org.verizon.sharingservices.dataobject.ShareResponse; | import org.springframework.web.bind.annotation.*; import org.verizon.sharingservices.dataobject.*; | [
"org.springframework.web",
"org.verizon.sharingservices"
] | org.springframework.web; org.verizon.sharingservices; | 651,246 |
private Product generateProduct(PTProductEntity productEntity)
throws RequiredFieldNotFoundException, InvalidProductTypeException {
this.context = "Product.";
Product product = new Product();
product.setProductType(this.validateString("ProductType", this.getProductType(productEntity.getType()),
this.MAX_LENGTH_1, true));
product.setProductCode(
this.validateString("ProductCode", productEntity.getID().toString(), this.MAX_LENGTH_30, true));
product.setProductGroup(
this.validateString("ProductGroup", productEntity.getProductGroup(), this.MAX_LENGTH_50, false));
product.setProductDescription(
this.validateString("ProductDescription", productEntity.getDescription(), this.MAX_LENGTH_200, true));
if (productEntity.getNumberCode() == null || productEntity.getNumberCode().length() == 0) {
product.setProductNumberCode(
this.validateString("ProductCode", productEntity.getID().toString(), this.MAX_LENGTH_50, true));
} else {
product.setProductNumberCode(
this.validateString("ProductCode", productEntity.getNumberCode(), this.MAX_LENGTH_50, true));
}
return product;
} | Product function(PTProductEntity productEntity) throws RequiredFieldNotFoundException, InvalidProductTypeException { this.context = STR; Product product = new Product(); product.setProductType(this.validateString(STR, this.getProductType(productEntity.getType()), this.MAX_LENGTH_1, true)); product.setProductCode( this.validateString(STR, productEntity.getID().toString(), this.MAX_LENGTH_30, true)); product.setProductGroup( this.validateString(STR, productEntity.getProductGroup(), this.MAX_LENGTH_50, false)); product.setProductDescription( this.validateString(STR, productEntity.getDescription(), this.MAX_LENGTH_200, true)); if (productEntity.getNumberCode() == null productEntity.getNumberCode().length() == 0) { product.setProductNumberCode( this.validateString(STR, productEntity.getID().toString(), this.MAX_LENGTH_50, true)); } else { product.setProductNumberCode( this.validateString(STR, productEntity.getNumberCode(), this.MAX_LENGTH_50, true)); } return product; } | /**
* Generates an instance of Product to be inserted in the table 2.4
* (Product)
*
* @param productEntity
* - the product/service
* @return an instance of Product
* @throws RequiredFieldNotFoundException
* @throws InvalidProductTypeException
*/ | Generates an instance of Product to be inserted in the table 2.4 (Product) | generateProduct | {
"repo_name": "premium-minds/billy",
"path": "billy-portugal/src/main/java/com/premiumminds/billy/portugal/services/export/saftpt/v1_02_01/PTSAFTFileGenerator.java",
"license": "lgpl-3.0",
"size": 69667
} | [
"com.premiumminds.billy.portugal.persistence.entities.PTProductEntity",
"com.premiumminds.billy.portugal.services.export.exceptions.InvalidProductTypeException",
"com.premiumminds.billy.portugal.services.export.exceptions.RequiredFieldNotFoundException",
"com.premiumminds.billy.portugal.services.export.saftpt.v1_02_01.schema.Product"
] | import com.premiumminds.billy.portugal.persistence.entities.PTProductEntity; import com.premiumminds.billy.portugal.services.export.exceptions.InvalidProductTypeException; import com.premiumminds.billy.portugal.services.export.exceptions.RequiredFieldNotFoundException; import com.premiumminds.billy.portugal.services.export.saftpt.v1_02_01.schema.Product; | import com.premiumminds.billy.portugal.persistence.entities.*; import com.premiumminds.billy.portugal.services.export.exceptions.*; import com.premiumminds.billy.portugal.services.export.saftpt.v1_02_01.schema.*; | [
"com.premiumminds.billy"
] | com.premiumminds.billy; | 2,653,263 |
public HighlightOptions addField(String... fieldnames) {
Assert.notNull(fieldnames);
for (String fieldname : fieldnames) {
addField(fieldname);
}
return this;
} | HighlightOptions function(String... fieldnames) { Assert.notNull(fieldnames); for (String fieldname : fieldnames) { addField(fieldname); } return this; } | /**
* Add names of fields to highlight on
*
* @param fieldnames
* @return
*/ | Add names of fields to highlight on | addField | {
"repo_name": "learningtcc/dubbox",
"path": "dubbo-solr/dubbo-solr-server/src/main/java/com/frank/search/solr/core/query/HighlightOptions.java",
"license": "apache-2.0",
"size": 9395
} | [
"org.springframework.util.Assert"
] | import org.springframework.util.Assert; | import org.springframework.util.*; | [
"org.springframework.util"
] | org.springframework.util; | 2,814,014 |
@Override
@Column(name = "ACTV_IND", nullable = false, length = 1)
public boolean isActive() {
return active;
}
| @Column(name = STR, nullable = false, length = 1) boolean function() { return active; } | /**
* Gets the active attribute.
*
* @return Returns the active.
*/ | Gets the active attribute | isActive | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/tem/businessobject/TemProfileAccount.java",
"license": "agpl-3.0",
"size": 7409
} | [
"javax.persistence.Column"
] | import javax.persistence.Column; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 1,868,768 |
void setBreakPoints(Set<BreakpointAddress> addresses, BreakpointType type) throws DebugExceptionWrapper; | void setBreakPoints(Set<BreakpointAddress> addresses, BreakpointType type) throws DebugExceptionWrapper; | /**
* Sets a list of breakpoints.
*
* @param addresses The addresses of the breakpoints.
* @param type The type of the breakpoints.
*
* @throws DebugExceptionWrapper Thrown if the message could not be sent to the debug client.
*/ | Sets a list of breakpoints | setBreakPoints | {
"repo_name": "guiquanz/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/debug/debugger/interfaces/IDebugger.java",
"license": "apache-2.0",
"size": 13711
} | [
"com.google.security.zynamics.binnavi.debug.debugger.DebugExceptionWrapper",
"com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress",
"com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointType",
"java.util.Set"
] | import com.google.security.zynamics.binnavi.debug.debugger.DebugExceptionWrapper; import com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress; import com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointType; import java.util.Set; | import com.google.security.zynamics.binnavi.debug.debugger.*; import com.google.security.zynamics.binnavi.debug.models.breakpoints.*; import com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.*; import java.util.*; | [
"com.google.security",
"java.util"
] | com.google.security; java.util; | 1,746,006 |
public IndexData getIndex(IndexType indexType, String[] definitions,
CompiledValue indexedExpression, ExecutionContext context)
throws AmbiguousNameException, TypeMismatchException, NameResolutionException {
IndexData indxData = null;
int qItrSize = definitions.length;
Iterator it = this.indexes.values().iterator();
StringBuilder sb = new StringBuilder();
indexedExpression.generateCanonicalizedExpression(sb, context);
String indexExprStr = sb.toString();
while (it.hasNext()) {
int mapping[] = new int[qItrSize];
Object ind = it.next();
// Check if the returned value is instance of Index (this means
// the index is not in create phase, its created successfully).
if (!(ind instanceof Index)) {
continue;
}
Index index = (Index) ind;
if (!((IndexProtocol) ind).isMatchingWithIndexExpression(indexedExpression, indexExprStr,
context) || index.getType() != indexType) {
continue;
}
int matchLevel = getMatchLevel(definitions,
((IndexProtocol) index).getCanonicalizedIteratorDefinitions(), mapping);
if (matchLevel == 0) {
indxData = new IndexData((IndexProtocol) index, 0, mapping);
break;
}
}
return indxData;
} | IndexData function(IndexType indexType, String[] definitions, CompiledValue indexedExpression, ExecutionContext context) throws AmbiguousNameException, TypeMismatchException, NameResolutionException { IndexData indxData = null; int qItrSize = definitions.length; Iterator it = this.indexes.values().iterator(); StringBuilder sb = new StringBuilder(); indexedExpression.generateCanonicalizedExpression(sb, context); String indexExprStr = sb.toString(); while (it.hasNext()) { int mapping[] = new int[qItrSize]; Object ind = it.next(); if (!(ind instanceof Index)) { continue; } Index index = (Index) ind; if (!((IndexProtocol) ind).isMatchingWithIndexExpression(indexedExpression, indexExprStr, context) index.getType() != indexType) { continue; } int matchLevel = getMatchLevel(definitions, ((IndexProtocol) index).getCanonicalizedIteratorDefinitions(), mapping); if (matchLevel == 0) { indxData = new IndexData((IndexProtocol) index, 0, mapping); break; } } return indxData; } | /**
* Get the Index with the specified indexType, fromClause, indexedExpression TODO: Asif :Check if
* synchronization is needed while obtaining Array of Indexes as similar to what we have used
* during index updates. This function will get the exact index , if available, else will return
* null
*
* @param indexType the type of index
* @param definitions the String array containing the required defintions of the fromClause of the
* index
* @param indexedExpression the indexedExpression for the index
* @param context ExecutionContext
* @return the sole index of the region with these parameters, or null if there isn't one
*/ | synchronization is needed while obtaining Array of Indexes as similar to what we have used during index updates. This function will get the exact index , if available, else will return null | getIndex | {
"repo_name": "davinash/geode",
"path": "geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java",
"license": "apache-2.0",
"size": 67140
} | [
"java.util.Iterator",
"org.apache.geode.cache.query.AmbiguousNameException",
"org.apache.geode.cache.query.Index",
"org.apache.geode.cache.query.IndexType",
"org.apache.geode.cache.query.NameResolutionException",
"org.apache.geode.cache.query.TypeMismatchException",
"org.apache.geode.cache.query.internal.CompiledValue",
"org.apache.geode.cache.query.internal.ExecutionContext"
] | import java.util.Iterator; import org.apache.geode.cache.query.AmbiguousNameException; import org.apache.geode.cache.query.Index; import org.apache.geode.cache.query.IndexType; import org.apache.geode.cache.query.NameResolutionException; import org.apache.geode.cache.query.TypeMismatchException; import org.apache.geode.cache.query.internal.CompiledValue; import org.apache.geode.cache.query.internal.ExecutionContext; | import java.util.*; import org.apache.geode.cache.query.*; import org.apache.geode.cache.query.internal.*; | [
"java.util",
"org.apache.geode"
] | java.util; org.apache.geode; | 255,993 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof CompositeTitle)) {
return false;
}
CompositeTitle that = (CompositeTitle) obj;
if (!this.container.equals(that.container)) {
return false;
}
if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {
return false;
}
return super.equals(obj);
} | boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CompositeTitle)) { return false; } CompositeTitle that = (CompositeTitle) obj; if (!this.container.equals(that.container)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } return super.equals(obj); } | /**
* Tests this title for equality with an arbitrary object.
*
* @param obj the object (<code>null</code> permitted).
*
* @return A boolean.
*/ | Tests this title for equality with an arbitrary object | equals | {
"repo_name": "JSansalone/JFreeChart",
"path": "source/org/jfree/chart/title/CompositeTitle.java",
"license": "lgpl-2.1",
"size": 7988
} | [
"org.jfree.util.PaintUtilities"
] | import org.jfree.util.PaintUtilities; | import org.jfree.util.*; | [
"org.jfree.util"
] | org.jfree.util; | 2,011,461 |
private static int avcLevelToMaxFrameSize(int avcLevel) {
switch (avcLevel) {
case CodecProfileLevel.AVCLevel1: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel1b: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel12: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel13: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel2: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel21: return 792 * 16 * 16;
case CodecProfileLevel.AVCLevel22: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel3: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel31: return 3600 * 16 * 16;
case CodecProfileLevel.AVCLevel32: return 5120 * 16 * 16;
case CodecProfileLevel.AVCLevel4: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel41: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel42: return 8704 * 16 * 16;
case CodecProfileLevel.AVCLevel5: return 22080 * 16 * 16;
case CodecProfileLevel.AVCLevel51: return 36864 * 16 * 16;
default: return -1;
}
}
private interface MediaCodecListCompat { | static int function(int avcLevel) { switch (avcLevel) { case CodecProfileLevel.AVCLevel1: return 99 * 16 * 16; case CodecProfileLevel.AVCLevel1b: return 99 * 16 * 16; case CodecProfileLevel.AVCLevel12: return 396 * 16 * 16; case CodecProfileLevel.AVCLevel13: return 396 * 16 * 16; case CodecProfileLevel.AVCLevel2: return 396 * 16 * 16; case CodecProfileLevel.AVCLevel21: return 792 * 16 * 16; case CodecProfileLevel.AVCLevel22: return 1620 * 16 * 16; case CodecProfileLevel.AVCLevel3: return 1620 * 16 * 16; case CodecProfileLevel.AVCLevel31: return 3600 * 16 * 16; case CodecProfileLevel.AVCLevel32: return 5120 * 16 * 16; case CodecProfileLevel.AVCLevel4: return 8192 * 16 * 16; case CodecProfileLevel.AVCLevel41: return 8192 * 16 * 16; case CodecProfileLevel.AVCLevel42: return 8704 * 16 * 16; case CodecProfileLevel.AVCLevel5: return 22080 * 16 * 16; case CodecProfileLevel.AVCLevel51: return 36864 * 16 * 16; default: return -1; } } private interface MediaCodecListCompat { | /**
* Conversion values taken from ISO 14496-10 Table A-1.
*
* @param avcLevel one of CodecProfileLevel.AVCLevel* constants.
* @return maximum frame size that can be decoded by a decoder with the specified avc level
* (or {@code -1} if the level is not recognized)
*/ | Conversion values taken from ISO 14496-10 Table A-1 | avcLevelToMaxFrameSize | {
"repo_name": "DigitalLabApp/Gramy",
"path": "Telegram-master/TMessagesProj/src/main/java/org/telegram/messenger/exoplayer/MediaCodecUtil.java",
"license": "gpl-2.0",
"size": 19636
} | [
"android.media.MediaCodecInfo"
] | import android.media.MediaCodecInfo; | import android.media.*; | [
"android.media"
] | android.media; | 2,109,149 |
public COSDictionary getDictionary() {
return dictionary;
} | COSDictionary function() { return dictionary; } | /**
* Convert this standard java object to a COS dictionary.
*
* @return The COS dictionary that matches this Java object.
*/ | Convert this standard java object to a COS dictionary | getDictionary | {
"repo_name": "sencko/NALB",
"path": "nalb2013/src/org/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature.java",
"license": "gpl-2.0",
"size": 10554
} | [
"org.apache.pdfbox.cos.COSDictionary"
] | import org.apache.pdfbox.cos.COSDictionary; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 48,555 |
public void addCppDirectory(@NotNull String path) {
File directory = myFileStructure.createProjectDir(path);
myCppDirectories.add(directory);
} | void function(@NotNull String path) { File directory = myFileStructure.createProjectDir(path); myCppDirectories.add(directory); } | /**
* Adds the given path to the list of 'Cpp' directories. It also creates the directory in the file system.
*
* @param path path of the 'Cpp' directory to add, relative to the root directory of the Android project.
*/ | Adds the given path to the list of 'Cpp' directories. It also creates the directory in the file system | addCppDirectory | {
"repo_name": "consulo/consulo-android",
"path": "android/android/testSrc/com/android/tools/idea/gradle/stubs/android/SourceProviderStub.java",
"license": "apache-2.0",
"size": 6597
} | [
"java.io.File",
"org.jetbrains.annotations.NotNull"
] | import java.io.File; import org.jetbrains.annotations.NotNull; | import java.io.*; import org.jetbrains.annotations.*; | [
"java.io",
"org.jetbrains.annotations"
] | java.io; org.jetbrains.annotations; | 2,808,464 |
public boolean add(@NonNull T listener, int index) {
final String METHOD_NAME = "add()";
if (listener == null) {
throw new IllegalArgumentException("can not specify null for the listener");
}
verifyIsNotReleased(METHOD_NAME);
verifyIsNotPerformingClearMethod(METHOD_NAME);
if (mListeners == null) {
mListeners = new ArrayList<>();
}
if (!mListeners.contains(listener)) {
if (index < 0) {
// append to the tail of the list
mListeners.add(listener);
} else {
// insert to the specified position
mListeners.add(index, listener);
}
// raise onAddedToEventDistributor() event
if (listener instanceof RecyclerViewEventDistributorListener) {
((RecyclerViewEventDistributorListener) listener).onAddedToEventDistributor(this);
}
}
return true;
} | boolean function(@NonNull T listener, int index) { final String METHOD_NAME = "add()"; if (listener == null) { throw new IllegalArgumentException(STR); } verifyIsNotReleased(METHOD_NAME); verifyIsNotPerformingClearMethod(METHOD_NAME); if (mListeners == null) { mListeners = new ArrayList<>(); } if (!mListeners.contains(listener)) { if (index < 0) { mListeners.add(listener); } else { mListeners.add(index, listener); } if (listener instanceof RecyclerViewEventDistributorListener) { ((RecyclerViewEventDistributorListener) listener).onAddedToEventDistributor(this); } } return true; } | /**
* Add a {@link T} listener to the chain at the specified position.
*
* @param listener The {@link T} instance
* @param index Position in the listener chain to insert this listener at. (< 0: tail of the chain)
*
* @return True if the listener object successfully added, otherwise false. Also returns true if have already been added.
*/ | Add a <code>T</code> listener to the chain at the specified position | add | {
"repo_name": "vinayak-garg/android-advancedrecyclerview",
"path": "library/src/main/java/com/h6ah4i/android/widget/advrecyclerview/event/BaseRecyclerViewEventDistributor.java",
"license": "apache-2.0",
"size": 7498
} | [
"android.support.annotation.NonNull",
"java.util.ArrayList"
] | import android.support.annotation.NonNull; import java.util.ArrayList; | import android.support.annotation.*; import java.util.*; | [
"android.support",
"java.util"
] | android.support; java.util; | 1,550,497 |
public static Date parseDate(String dateValue, Collection dateFormats)
throws DateParseException
{
return parseDate(dateValue, dateFormats, null);
} | static Date function(String dateValue, Collection dateFormats) throws DateParseException { return parseDate(dateValue, dateFormats, null); } | /**
* Parses the date value using the given date formats.
*
* @param dateValue the date value to parse
* @param dateFormats the date formats to use
* @return the parsed date
* @throws DateParseException if none of the dataFormats could parse the dateValue
*/ | Parses the date value using the given date formats | parseDate | {
"repo_name": "kabir/re-play",
"path": "resteasy-jaxrs/src/main/java/org/jboss/resteasy/util/DateUtil.java",
"license": "apache-2.0",
"size": 6423
} | [
"java.util.Collection",
"java.util.Date"
] | import java.util.Collection; import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,505,887 |
public void setComponentJS (String componentJS) throws JSONException {
log.info("setCompomentJS \"#0\"", componentJS);
if (componentJS.startsWith("\"")) {
// hack to fix the doubly-jsoned string
componentJS = (new JSONArray("[" + componentJS + "]")).getString(0);
}
JSONArray array = new JSONArray(componentJS);
if (array.length() != 6) {
log.info("setLinksJS wrong format: #0", componentJS);
return;
}
String contextId = array.getString(0);
String contextTypes = array.getString(1);
String fragmentId = array.getString(2);
String componentId = array.getString(3);
String componentRel = array.getString(4);
String componentTypes = array.getString(5);
if (contextId == null || "".equals(contextId)) {
currentContextLabel = currentContentItem.getTitle();
currentContextTypes = new ArrayList<KiWiResource>(
currentContentItem.getTypes());
} else {
if (contextId.startsWith("bnode::")
|| contextId.startsWith("uri::")) {
ContentItem ci = contentItemService
.getContentItemByKiwiId(contextId);
if (ci != null) {
currentContextLabel = ci.getTitle();
} else {
currentContextLabel = contextId;
}
} else {
currentContextLabel = contextId;
}
if (contextTypes == null) {
currentContextTypes = Collections.emptyList();
} else {
currentContextTypes = new LinkedList<KiWiResource>();
String[] types = contextTypes.split(" ");
for (String type : types) {
ContentItem ci_type = contentItemService
.getContentItemByKiwiId(type);
if (ci_type != null) {
currentContextTypes.add(ci_type.getResource());
}
}
}
}
// setCurrentContextKiwiId(contextId);
if (contextId == null || "".equals(contextId)) {
currentContextLabel = currentContentItem.getTitle();
currentContextTypes = new ArrayList<KiWiResource>(
currentContentItem.getTypes());
} else {
if (contextId.startsWith("bnode::")
|| contextId.startsWith("uri::")) {
ContentItem ci = contentItemService
.getContentItemByKiwiId(contextId);
if (ci != null) {
currentContextLabel = ci.getTitle();
} else {
currentContextLabel = contextId;
}
} else {
currentContextLabel = contextId;
}
if (contextTypes == null) {
currentContextTypes = Collections.emptyList();
} else {
currentContextTypes = new LinkedList<KiWiResource>();
String[] types = contextTypes.split(" ");
for (String type : types) {
ContentItem ci_type = contentItemService
.getContentItemByKiwiId(type);
if (ci_type != null) {
currentContextTypes.add(ci_type.getResource());
}
}
}
}
if (componentId == null) {
componentResource = null;
componentTitle = "";
}
else {
if (componentId.startsWith("bnode::") || componentId.startsWith("uri::")) {
componentResource = state.getResourceByNestedId(componentId);
componentTitle = state.getTitle(componentResource);
if (componentTitle == null && componentResource.getId() != null) {
componentTitle = componentResource.getContentItem().getTitle();
}
}
else {
componentResource = null;
componentTitle = componentId;
}
}
if (componentRel == null || "".equals(componentRel)) {
componentRelation = null;
}
else {
ContentItem ci = contentItemService.getContentItemByKiwiId(componentRel);
if (ci != null) {
componentRelation = kiwiEntityManager.createFacade(ci, KiWiProperty.class);
}
else {
componentRelation = null;
}
}
selectedComponentRelation = componentRelation;
oldComponentResource = componentResource;
if (componentTypes == null) {
this.componentTypes = Collections.emptyList();
} else {
this.componentTypes = new LinkedList<KiWiResource>();
String[] types = contextTypes.split(" ");
for (String type : types) {
ContentItem ci_type = contentItemService
.getContentItemByKiwiId(type);
if (ci_type != null) {
this.componentTypes.add(ci_type.getResource());
}
}
}
if (!"".equals(fragmentId) && "".equals(componentTitle)) {
// set the component title to the suggestion label.
Suggestion suggestion = state.getSuggestion(fragmentId);
if (suggestion != null) {
componentTitle = suggestion.getLabel();
// add the suggestion types
for (KiWiResource type : suggestion.getTypes()) {
if (!this.componentTypes.contains(type)) {
this.componentTypes.add(type);
}
}
}
}
// selectedComponentType = componentType;
}
| void function (String componentJS) throws JSONException { log.info(STR#0\STR\STR[STR]STRsetLinksJS wrong format: #0STRSTRbnode::STRuri::STR STRSTRbnode::STRuri::STR STRSTRbnode::STRuri::STRSTR STRSTR".equals(componentTitle)) { Suggestion suggestion = state.getSuggestion(fragmentId); if (suggestion != null) { componentTitle = suggestion.getLabel(); for (KiWiResource type : suggestion.getTypes()) { if (!this.componentTypes.contains(type)) { this.componentTypes.add(type); } } } } } | /**
* Sets the currently edited component values. Updates the selected values to those new component values.
* @param componentJS "contextKiwiId componentKiwiId relationKiwiId classKiwiId"
* @throws JSONException
*/ | Sets the currently edited component values. Updates the selected values to those new component values | setComponentJS | {
"repo_name": "fregaham/KiWi",
"path": "extensions/wiki/src/kiwi/wiki/action/KiwirdfaAction.java",
"license": "bsd-3-clause",
"size": 43502
} | [
"kiwi.model.informationextraction.Suggestion",
"kiwi.model.kbase.KiWiResource",
"org.json.JSONException"
] | import kiwi.model.informationextraction.Suggestion; import kiwi.model.kbase.KiWiResource; import org.json.JSONException; | import kiwi.model.informationextraction.*; import kiwi.model.kbase.*; import org.json.*; | [
"kiwi.model.informationextraction",
"kiwi.model.kbase",
"org.json"
] | kiwi.model.informationextraction; kiwi.model.kbase; org.json; | 1,541,334 |
public static final SourceModel.Expr CaseDataCons(SourceModel.Expr value) {
return
SourceModel.Expr.Application.make(
new SourceModel.Expr[] {SourceModel.Expr.DataCons.make(DataConstructors.CaseDataCons), value});
}
public static final QualifiedName CaseDataCons =
QualifiedName.make(
CAL_Optimizer_Expression_internal.MODULE_NAME,
"CaseDataCons");
public static final int CaseDataCons_ordinal = 1;
| static final SourceModel.Expr function(SourceModel.Expr value) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.DataCons.make(DataConstructors.CaseDataCons), value}); } static final QualifiedName function = QualifiedName.make( CAL_Optimizer_Expression_internal.MODULE_NAME, STR); static final int function_ordinal = 1; | /**
* Binding for DataConstructor: Cal.Internal.Optimizer_Expression.CaseDataCons.
* @param value
* @return the SourceModule.Expr representing an application of Cal.Internal.Optimizer_Expression.CaseDataCons
*/ | Binding for DataConstructor: Cal.Internal.Optimizer_Expression.CaseDataCons | CaseDataCons | {
"repo_name": "levans/Open-Quark",
"path": "src/CAL_Platform/src/org/openquark/cal/internal/module/Cal/Internal/CAL_Optimizer_Expression_internal.java",
"license": "bsd-3-clause",
"size": 265925
} | [
"org.openquark.cal.compiler.QualifiedName",
"org.openquark.cal.compiler.SourceModel"
] | import org.openquark.cal.compiler.QualifiedName; import org.openquark.cal.compiler.SourceModel; | import org.openquark.cal.compiler.*; | [
"org.openquark.cal"
] | org.openquark.cal; | 1,092,189 |
public List<IPConfigurationProfile> ipConfigurationProfiles() {
return this.ipConfigurationProfiles;
} | List<IPConfigurationProfile> function() { return this.ipConfigurationProfiles; } | /**
* Get array of IP configuration profiles which reference this subnet.
*
* @return the ipConfigurationProfiles value
*/ | Get array of IP configuration profiles which reference this subnet | ipConfigurationProfiles | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/network/v2019_09_01/implementation/SubnetInner.java",
"license": "mit",
"size": 13592
} | [
"com.microsoft.azure.management.network.v2019_09_01.IPConfigurationProfile",
"java.util.List"
] | import com.microsoft.azure.management.network.v2019_09_01.IPConfigurationProfile; import java.util.List; | import com.microsoft.azure.management.network.v2019_09_01.*; import java.util.*; | [
"com.microsoft.azure",
"java.util"
] | com.microsoft.azure; java.util; | 1,718,485 |
private void TypeDefsAnalyzeOk(String... typeDefs) {
for (String typeDefStr: typeDefs) {
ParseNode stmt = AnalyzesOk(String.format("CREATE TABLE t (i %s)", typeDefStr));
AnalyzesOk(String.format("CREATE TABLE t (i ARRAY<%s>)", typeDefStr));
AnalyzesOk(String.format("CREATE TABLE t (i STRUCT<f:%s>)", typeDefStr));
Preconditions.checkState(stmt instanceof CreateTableStmt);
CreateTableStmt createTableStmt = (CreateTableStmt) stmt;
Type t = createTableStmt.getColumnDefs().get(0).getType();
// If the given type is complex, don't use it as a map key.
if (t.isComplexType()) {
AnalyzesOk(String.format(
"CREATE TABLE t (i MAP<int, %s>)", typeDefStr, typeDefStr));
} else {
AnalyzesOk(String.format(
"CREATE TABLE t (i MAP<%s, %s>)", typeDefStr, typeDefStr));
}
}
} | void function(String... typeDefs) { for (String typeDefStr: typeDefs) { ParseNode stmt = AnalyzesOk(String.format(STR, typeDefStr)); AnalyzesOk(String.format(STR, typeDefStr)); AnalyzesOk(String.format(STR, typeDefStr)); Preconditions.checkState(stmt instanceof CreateTableStmt); CreateTableStmt createTableStmt = (CreateTableStmt) stmt; Type t = createTableStmt.getColumnDefs().get(0).getType(); if (t.isComplexType()) { AnalyzesOk(String.format( STR, typeDefStr, typeDefStr)); } else { AnalyzesOk(String.format( STR, typeDefStr, typeDefStr)); } } } | /**
* Wraps the given typeDefs in a CREATE TABLE stmt and runs AnalyzesOk().
* Also tests that the type is analyzes correctly in ARRAY, MAP, and STRUCT types.
*/ | Wraps the given typeDefs in a CREATE TABLE stmt and runs AnalyzesOk(). Also tests that the type is analyzes correctly in ARRAY, MAP, and STRUCT types | TypeDefsAnalyzeOk | {
"repo_name": "scalingdata/Impala",
"path": "fe/src/test/java/com/cloudera/impala/analysis/AnalyzeDDLTest.java",
"license": "apache-2.0",
"size": 112770
} | [
"com.cloudera.impala.catalog.Type",
"com.google.common.base.Preconditions"
] | import com.cloudera.impala.catalog.Type; import com.google.common.base.Preconditions; | import com.cloudera.impala.catalog.*; import com.google.common.base.*; | [
"com.cloudera.impala",
"com.google.common"
] | com.cloudera.impala; com.google.common; | 2,573,426 |
private void installApplication(JSONObject data, org.wso2.emm.agent.beans.Operation operation) throws AndroidAgentException {
String appUrl;
String type;
String name;
String operationType;
try {
if (!data.isNull(resources.getString(R.string.app_type))) {
type = data.getString(resources.getString(R.string.app_type));
if (type.equalsIgnoreCase(resources.getString(R.string.intent_extra_enterprise))) {
appUrl = data.getString(resources.getString(R.string.app_url));
operation.setStatus(resources.getString(R.string.operation_value_completed));
resultBuilder.build(operation);
appList.installApp(appUrl);
} else if (type.equalsIgnoreCase(resources.getString(R.string.intent_extra_public))) {
appUrl = data.getString(resources.getString(R.string.app_identifier));
operation.setStatus(resources.getString(R.string.operation_value_completed));
resultBuilder.build(operation);
triggerGooglePlayApp(appUrl);
} else if (type.equalsIgnoreCase(resources.getString(R.string.intent_extra_web))) {
name = data.getString(resources.getString(R.string.intent_extra_name));
appUrl = data.getString(resources.getString(R.string.app_url));
operationType = resources.getString(R.string.operation_install);
JSONObject payload = new JSONObject();
payload.put(resources.getString(R.string.intent_extra_identity), appUrl);
payload.put(resources.getString(R.string.intent_extra_title), name);
payload.put(resources.getString(R.string.operation_type), operationType);
operation.setPayLoad(payload.toString());
manageWebClip(operation);
} else {
operation.setStatus(resources.getString(R.string.operation_value_error));
resultBuilder.build(operation);
throw new AndroidAgentException("Invalid application details");
}
if (Constants.DEBUG_MODE_ENABLED) {
Log.d(TAG, "Application installation started");
}
}
} catch (JSONException e) {
operation.setStatus(resources.getString(R.string.operation_value_error));
resultBuilder.build(operation);
throw new AndroidAgentException("Invalid JSON format.", e);
}
} | void function(JSONObject data, org.wso2.emm.agent.beans.Operation operation) throws AndroidAgentException { String appUrl; String type; String name; String operationType; try { if (!data.isNull(resources.getString(R.string.app_type))) { type = data.getString(resources.getString(R.string.app_type)); if (type.equalsIgnoreCase(resources.getString(R.string.intent_extra_enterprise))) { appUrl = data.getString(resources.getString(R.string.app_url)); operation.setStatus(resources.getString(R.string.operation_value_completed)); resultBuilder.build(operation); appList.installApp(appUrl); } else if (type.equalsIgnoreCase(resources.getString(R.string.intent_extra_public))) { appUrl = data.getString(resources.getString(R.string.app_identifier)); operation.setStatus(resources.getString(R.string.operation_value_completed)); resultBuilder.build(operation); triggerGooglePlayApp(appUrl); } else if (type.equalsIgnoreCase(resources.getString(R.string.intent_extra_web))) { name = data.getString(resources.getString(R.string.intent_extra_name)); appUrl = data.getString(resources.getString(R.string.app_url)); operationType = resources.getString(R.string.operation_install); JSONObject payload = new JSONObject(); payload.put(resources.getString(R.string.intent_extra_identity), appUrl); payload.put(resources.getString(R.string.intent_extra_title), name); payload.put(resources.getString(R.string.operation_type), operationType); operation.setPayLoad(payload.toString()); manageWebClip(operation); } else { operation.setStatus(resources.getString(R.string.operation_value_error)); resultBuilder.build(operation); throw new AndroidAgentException(STR); } if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG, STR); } } } catch (JSONException e) { operation.setStatus(resources.getString(R.string.operation_value_error)); resultBuilder.build(operation); throw new AndroidAgentException(STR, e); } } | /**
* Install an Application.
*
* @param operation - Operation object.
*/ | Install an Application | installApplication | {
"repo_name": "jeradrutnam/product-mdm",
"path": "modules/mobile-agents/android/client/client/src/main/java/org/wso2/emm/agent/services/Operation.java",
"license": "apache-2.0",
"size": 45337
} | [
"android.util.Log",
"org.json.JSONException",
"org.json.JSONObject",
"org.wso2.emm.agent.AndroidAgentException",
"org.wso2.emm.agent.utils.Constants"
] | import android.util.Log; import org.json.JSONException; import org.json.JSONObject; import org.wso2.emm.agent.AndroidAgentException; import org.wso2.emm.agent.utils.Constants; | import android.util.*; import org.json.*; import org.wso2.emm.agent.*; import org.wso2.emm.agent.utils.*; | [
"android.util",
"org.json",
"org.wso2.emm"
] | android.util; org.json; org.wso2.emm; | 2,143,457 |
public void test_createSocket_wrapping() throws Exception {
try {
Socket underlying = new Socket(TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT);
mFactory.createSocket(
underlying, TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT, true);
fail();
} catch (SSLPeerUnverifiedException expected) {
// expected
}
} | void function() throws Exception { try { Socket underlying = new Socket(TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT); mFactory.createSocket( underlying, TEST_CREATE_SOCKET_HOST, TEST_CREATE_SOCKET_PORT, true); fail(); } catch (SSLPeerUnverifiedException expected) { } } | /**
* b/2807618 Make sure that hostname verifcation in cases were it
* is documented to be included by various
* SSLCertificateSocketFactory.createSocket messages.
*
* NOTE: Test will fail if external server is not available.
*/ | b/2807618 Make sure that hostname verifcation in cases were it is documented to be included by various SSLCertificateSocketFactory.createSocket messages | test_createSocket_wrapping | {
"repo_name": "wiki2014/Learning-Summary",
"path": "alps/cts/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java",
"license": "gpl-3.0",
"size": 5098
} | [
"java.net.Socket",
"javax.net.ssl.SSLPeerUnverifiedException"
] | import java.net.Socket; import javax.net.ssl.SSLPeerUnverifiedException; | import java.net.*; import javax.net.ssl.*; | [
"java.net",
"javax.net"
] | java.net; javax.net; | 635,750 |
public void checkName(String name) {
OpenCms.getValidationHandler().checkGroupName(name);
}
| void function(String name) { OpenCms.getValidationHandler().checkGroupName(name); } | /**
* Checks if the provided group name is valid and can be used as an argument value
* for {@link #setName(String)}.<p>
*
* A group name must not be empty or whitespace only.<p>
*
* @param name the group name to check
*
* @see org.opencms.security.I_CmsValidationHandler#checkGroupName(String)
*/ | Checks if the provided group name is valid and can be used as an argument value for <code>#setName(String)</code>. A group name must not be empty or whitespace only | checkName | {
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/file/CmsGroup.java",
"license": "lgpl-2.1",
"size": 7590
} | [
"org.opencms.main.OpenCms"
] | import org.opencms.main.OpenCms; | import org.opencms.main.*; | [
"org.opencms.main"
] | org.opencms.main; | 2,434,879 |
@Test(expectedExceptions = { LDAPException.class })
public void testConstructor3ValueSequenceInvalidElementCount()
throws Exception
{
new PostReadResponseControl("1.3.6.1.1.13.2", false,
new ASN1OctetString(new ASN1Sequence().encode()));
} | @Test(expectedExceptions = { LDAPException.class }) void function() throws Exception { new PostReadResponseControl(STR, false, new ASN1OctetString(new ASN1Sequence().encode())); } | /**
* Tests the third constructor with a value sequence with an invalid number of
* elements.
*
* @throws Exception If an unexpected problem occurs.
*/ | Tests the third constructor with a value sequence with an invalid number of elements | testConstructor3ValueSequenceInvalidElementCount | {
"repo_name": "UnboundID/ldapsdk",
"path": "tests/unit/src/com/unboundid/ldap/sdk/controls/PostReadResponseControlTestCase.java",
"license": "gpl-2.0",
"size": 9867
} | [
"com.unboundid.asn1.ASN1OctetString",
"com.unboundid.asn1.ASN1Sequence",
"com.unboundid.ldap.sdk.LDAPException",
"org.testng.annotations.Test"
] | import com.unboundid.asn1.ASN1OctetString; import com.unboundid.asn1.ASN1Sequence; import com.unboundid.ldap.sdk.LDAPException; import org.testng.annotations.Test; | import com.unboundid.asn1.*; import com.unboundid.ldap.sdk.*; import org.testng.annotations.*; | [
"com.unboundid.asn1",
"com.unboundid.ldap",
"org.testng.annotations"
] | com.unboundid.asn1; com.unboundid.ldap; org.testng.annotations; | 628,589 |
public Boolean getUpDownAvailable() {
return (Boolean) store.get( Names.upDownAvailable);
}
| Boolean function() { return (Boolean) store.get( Names.upDownAvailable); } | /**
* get the button supports "button down" and "button up".
* @return the button supports "button down" and "button up".
*/ | get the button supports "button down" and "button up" | getUpDownAvailable | {
"repo_name": "Luxoft/SDLP2",
"path": "SDL_Android/SmartDeviceLinkProxyAndroid/src/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java",
"license": "lgpl-2.1",
"size": 4730
} | [
"com.smartdevicelink.proxy.constants.Names"
] | import com.smartdevicelink.proxy.constants.Names; | import com.smartdevicelink.proxy.constants.*; | [
"com.smartdevicelink.proxy"
] | com.smartdevicelink.proxy; | 1,942,299 |
@Override public void enterFunType(@NotNull ErlangParser.FunTypeContext ctx) { } | @Override public void enterFunType(@NotNull ErlangParser.FunTypeContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | exitTypeSpec | {
"repo_name": "lyskouski/erlang-netbeans",
"path": "src/by/creativity/erlang/lexer/ErlangBaseListener.java",
"license": "gpl-2.0",
"size": 35296
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,291,944 |
public IPackageDescriptor getPackageDescriptor(); | IPackageDescriptor function(); | /**
* Return package descriptor related to this
* plugin
* @return
*/ | Return package descriptor related to this plugin | getPackageDescriptor | {
"repo_name": "nikelin/Redshape-AS",
"path": "plugins/src/main/java/com/redshape/plugins/meta/IPluginInfo.java",
"license": "apache-2.0",
"size": 2207
} | [
"com.redshape.plugins.packagers.IPackageDescriptor"
] | import com.redshape.plugins.packagers.IPackageDescriptor; | import com.redshape.plugins.packagers.*; | [
"com.redshape.plugins"
] | com.redshape.plugins; | 613,843 |
public RelNode createNewProject(RelNode projChild, int[] adjustments) {
final List<Pair<RexNode, String>> projects = new ArrayList<>();
if (origProj != null) {
for (Pair<RexNode, String> p : origProj.getNamedProjects()) {
projects.add(
Pair.of(
convertRefsAndExprs(
p.left,
projChild.getRowType().getFieldList(),
adjustments),
p.right));
}
} else {
for (Ord<RelDataTypeField> field : Ord.zip(childFields)) {
projects.add(
Pair.of(
rexBuilder.makeInputRef(
field.e.getType(), field.i), field.e.getName()));
}
}
return relBuilder.push(projChild)
.project(Pair.left(projects), Pair.right(projects))
.build();
}
//~ Inner Classes ----------------------------------------------------------
private static class InputSpecialOpFinder extends RexVisitorImpl<Void> {
private final BitSet rexRefs;
private final ImmutableBitSet leftFields;
private final @Nullable ImmutableBitSet rightFields;
private final ImmutableBitSet strongFields;
private final ExprCondition preserveExprCondition;
private final List<RexNode> preserveLeft;
private final List<RexNode> preserveRight;
private final Strong strong;
InputSpecialOpFinder(
BitSet rexRefs,
ImmutableBitSet leftFields,
@Nullable ImmutableBitSet rightFields,
final ImmutableBitSet strongFields,
ExprCondition preserveExprCondition,
List<RexNode> preserveLeft,
List<RexNode> preserveRight) {
super(true);
this.rexRefs = rexRefs;
this.leftFields = leftFields;
this.rightFields = rightFields;
this.preserveExprCondition = preserveExprCondition;
this.preserveLeft = preserveLeft;
this.preserveRight = preserveRight;
this.strongFields = strongFields;
this.strong = Strong.of(strongFields);
} | RelNode function(RelNode projChild, int[] adjustments) { final List<Pair<RexNode, String>> projects = new ArrayList<>(); if (origProj != null) { for (Pair<RexNode, String> p : origProj.getNamedProjects()) { projects.add( Pair.of( convertRefsAndExprs( p.left, projChild.getRowType().getFieldList(), adjustments), p.right)); } } else { for (Ord<RelDataTypeField> field : Ord.zip(childFields)) { projects.add( Pair.of( rexBuilder.makeInputRef( field.e.getType(), field.i), field.e.getName())); } } return relBuilder.push(projChild) .project(Pair.left(projects), Pair.right(projects)) .build(); } private static class InputSpecialOpFinder extends RexVisitorImpl<Void> { private final BitSet rexRefs; private final ImmutableBitSet leftFields; private final @Nullable ImmutableBitSet rightFields; private final ImmutableBitSet strongFields; private final ExprCondition preserveExprCondition; private final List<RexNode> preserveLeft; private final List<RexNode> preserveRight; private final Strong strong; InputSpecialOpFinder( BitSet rexRefs, ImmutableBitSet leftFields, @Nullable ImmutableBitSet rightFields, final ImmutableBitSet strongFields, ExprCondition preserveExprCondition, List<RexNode> preserveLeft, List<RexNode> preserveRight) { super(true); this.rexRefs = rexRefs; this.leftFields = leftFields; this.rightFields = rightFields; this.preserveExprCondition = preserveExprCondition; this.preserveLeft = preserveLeft; this.preserveRight = preserveRight; this.strongFields = strongFields; this.strong = Strong.of(strongFields); } | /**
* Creates a new projection based on the original projection, adjusting all
* input refs using an adjustment array passed in. If there was no original
* projection, create a new one that selects every field from the underlying
* rel.
*
* <p>If the resulting projection would be trivial, return the child.
*
* @param projChild child of the new project
* @param adjustments array indicating how much each input reference should
* be adjusted by
* @return the created projection
*/ | Creates a new projection based on the original projection, adjusting all input refs using an adjustment array passed in. If there was no original projection, create a new one that selects every field from the underlying rel. If the resulting projection would be trivial, return the child | createNewProject | {
"repo_name": "datametica/calcite",
"path": "core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java",
"license": "apache-2.0",
"size": 30457
} | [
"java.util.ArrayList",
"java.util.BitSet",
"java.util.List",
"org.apache.calcite.linq4j.Ord",
"org.apache.calcite.plan.Strong",
"org.apache.calcite.rel.RelNode",
"org.apache.calcite.rel.type.RelDataTypeField",
"org.apache.calcite.rex.RexNode",
"org.apache.calcite.rex.RexVisitorImpl",
"org.apache.calcite.util.ImmutableBitSet",
"org.apache.calcite.util.Pair",
"org.checkerframework.checker.nullness.qual.Nullable"
] | import java.util.ArrayList; import java.util.BitSet; import java.util.List; import org.apache.calcite.linq4j.Ord; import org.apache.calcite.plan.Strong; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexVisitorImpl; import org.apache.calcite.util.ImmutableBitSet; import org.apache.calcite.util.Pair; import org.checkerframework.checker.nullness.qual.Nullable; | import java.util.*; import org.apache.calcite.linq4j.*; import org.apache.calcite.plan.*; import org.apache.calcite.rel.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.rex.*; import org.apache.calcite.util.*; import org.checkerframework.checker.nullness.qual.*; | [
"java.util",
"org.apache.calcite",
"org.checkerframework.checker"
] | java.util; org.apache.calcite; org.checkerframework.checker; | 1,746,720 |
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static boolean relaunchTask(boolean incognito, String url) {
if (TextUtils.isEmpty(url)) return false;
Context context = ApplicationStatus.getApplicationContext();
ActivityManager manager =
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (AppTask task : manager.getAppTasks()) {
RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task);
if (info == null) continue;
String initialUrl = ActivityDelegate.getInitialUrlForDocument(info.baseIntent);
if (TextUtils.isEmpty(initialUrl) || !TextUtils.equals(initialUrl, url)) continue;
int id = ActivityDelegate.getTabIdFromIntent(info.baseIntent);
DocumentTabModelSelector.setPrioritizedTabId(id);
if (!ChromeApplication.getDocumentTabModelSelector().getModel(incognito)
.isRetargetable(id)) {
continue;
}
if (!moveToFront(task)) continue;
return true;
}
return false;
} | @TargetApi(Build.VERSION_CODES.LOLLIPOP) static boolean function(boolean incognito, String url) { if (TextUtils.isEmpty(url)) return false; Context context = ApplicationStatus.getApplicationContext(); ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (AppTask task : manager.getAppTasks()) { RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); if (info == null) continue; String initialUrl = ActivityDelegate.getInitialUrlForDocument(info.baseIntent); if (TextUtils.isEmpty(initialUrl) !TextUtils.equals(initialUrl, url)) continue; int id = ActivityDelegate.getTabIdFromIntent(info.baseIntent); DocumentTabModelSelector.setPrioritizedTabId(id); if (!ChromeApplication.getDocumentTabModelSelector().getModel(incognito) .isRetargetable(id)) { continue; } if (!moveToFront(task)) continue; return true; } return false; } | /**
* Bring the task matching the given URL to the front if the task is retargetable.
* @param incognito Whether or not the tab is incognito.
* @param url URL that the tab would have been created for. If null, this param is ignored.
* @return Whether the task was successfully brought back.
*/ | Bring the task matching the given URL to the front if the task is retargetable | relaunchTask | {
"repo_name": "TheTypoMaster/chromium-crosswalk",
"path": "chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java",
"license": "bsd-3-clause",
"size": 35055
} | [
"android.annotation.TargetApi",
"android.app.ActivityManager",
"android.content.Context",
"android.os.Build",
"android.text.TextUtils",
"org.chromium.base.ApplicationStatus",
"org.chromium.chrome.browser.ChromeApplication",
"org.chromium.chrome.browser.tabmodel.document.ActivityDelegate",
"org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector"
] | import android.annotation.TargetApi; import android.app.ActivityManager; import android.content.Context; import android.os.Build; import android.text.TextUtils; import org.chromium.base.ApplicationStatus; import org.chromium.chrome.browser.ChromeApplication; import org.chromium.chrome.browser.tabmodel.document.ActivityDelegate; import org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector; | import android.annotation.*; import android.app.*; import android.content.*; import android.os.*; import android.text.*; import org.chromium.base.*; import org.chromium.chrome.browser.*; import org.chromium.chrome.browser.tabmodel.document.*; | [
"android.annotation",
"android.app",
"android.content",
"android.os",
"android.text",
"org.chromium.base",
"org.chromium.chrome"
] | android.annotation; android.app; android.content; android.os; android.text; org.chromium.base; org.chromium.chrome; | 632,569 |
public List<VideoEditInfo> queryCutList(Channel channel, Date recStartTs) throws IOException; | List<VideoEditInfo> function(Channel channel, Date recStartTs) throws IOException; | /**
* Retrieve the list of cut list marks found for the the recording at the
* given channel and start time.
*
* @param channel
* the channel on which the program aired
* @param recStartTs
* the actual (not scheduled) start time of the program
* @return the list of cut marks
* @throws IOException
* if there is a communication or protocol error
*
* @since 63
*/ | Retrieve the list of cut list marks found for the the recording at the given channel and start time | queryCutList | {
"repo_name": "syphr42/libmythtv-java",
"path": "protocol/src/main/java/org/syphr/mythtv/protocol/Protocol.java",
"license": "apache-2.0",
"size": 50355
} | [
"java.io.IOException",
"java.util.Date",
"java.util.List",
"org.syphr.mythtv.data.Channel",
"org.syphr.mythtv.data.VideoEditInfo"
] | import java.io.IOException; import java.util.Date; import java.util.List; import org.syphr.mythtv.data.Channel; import org.syphr.mythtv.data.VideoEditInfo; | import java.io.*; import java.util.*; import org.syphr.mythtv.data.*; | [
"java.io",
"java.util",
"org.syphr.mythtv"
] | java.io; java.util; org.syphr.mythtv; | 112,683 |
protected final Property parseVendorExtensionContent( String vendorExtension ) {
Matcher matcher = VENDOR_PATTERN.matcher(vendorExtension);
if (!matcher.find()) return null;
String vendorName = removeQuotes(matcher.group(1));
String vendorValue = removeQuotes(matcher.group(3));
assert vendorName != null;
assert vendorValue != null;
assert vendorName.length() != 0;
assert vendorValue.length() != 0;
return context.getPropertyFactory().create(nameFactory.create(vendorName), vendorValue);
} | final Property function( String vendorExtension ) { Matcher matcher = VENDOR_PATTERN.matcher(vendorExtension); if (!matcher.find()) return null; String vendorName = removeQuotes(matcher.group(1)); String vendorValue = removeQuotes(matcher.group(3)); assert vendorName != null; assert vendorValue != null; assert vendorName.length() != 0; assert vendorValue.length() != 0; return context.getPropertyFactory().create(nameFactory.create(vendorName), vendorValue); } | /**
* Parse the content of the vendor extension excluding the curly braces in the CND content.
*
* @param vendorExtension the vendor extension string; never null
* @return the property representing the vendor extension, or null if the vendor extension is incomplete
*/ | Parse the content of the vendor extension excluding the curly braces in the CND content | parseVendorExtensionContent | {
"repo_name": "phantomjinx/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/CndImporter.java",
"license": "apache-2.0",
"size": 38876
} | [
"java.util.regex.Matcher",
"org.modeshape.jcr.value.Property"
] | import java.util.regex.Matcher; import org.modeshape.jcr.value.Property; | import java.util.regex.*; import org.modeshape.jcr.value.*; | [
"java.util",
"org.modeshape.jcr"
] | java.util; org.modeshape.jcr; | 1,294,186 |
public ActionForward unselectall(Map paramsIn) {
User user = requestContext.getCurrentUser();
this.setDecl.clear(user);
paramsIn.put("setupdated", "true");
return strutsDelegate.forwardParams(mapping.findForward(forward), paramsIn);
} | ActionForward function(Map paramsIn) { User user = requestContext.getCurrentUser(); this.setDecl.clear(user); paramsIn.put(STR, "true"); return strutsDelegate.forwardParams(mapping.findForward(forward), paramsIn); } | /**
* Clears set for the user.
* @param paramsIn Map of request parameters you want to forward
* along with the ActionForward
* @return The ActionForward to go to next.
*/ | Clears set for the user | unselectall | {
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/struts/RhnSetHelper.java",
"license": "gpl-2.0",
"size": 6630
} | [
"com.redhat.rhn.domain.user.User",
"java.util.Map",
"org.apache.struts.action.ActionForward"
] | import com.redhat.rhn.domain.user.User; import java.util.Map; import org.apache.struts.action.ActionForward; | import com.redhat.rhn.domain.user.*; import java.util.*; import org.apache.struts.action.*; | [
"com.redhat.rhn",
"java.util",
"org.apache.struts"
] | com.redhat.rhn; java.util; org.apache.struts; | 1,838,102 |
public List<WebElement> getRows() {
return rowList;
}
/**
* Grabs the specified column inside a specified row.
*
* @param rowNo The row number.
* @param colNo The column number.
* @return a {@link WebElement} | List<WebElement> function() { return rowList; } /** * Grabs the specified column inside a specified row. * * @param rowNo The row number. * @param colNo The column number. * @return a {@link WebElement} | /**
* Returns the row list.
*
* @return a {@List} of {@link WebElement]
*/ | Returns the row list | getRows | {
"repo_name": "tolis-e/continuous-integration-of-mobile-web-applications-on-android",
"path": "src/test/java/org/jboss/as/quickstarts/kitchensink/html5/mobile/demo/pages/MembersPage.java",
"license": "apache-2.0",
"size": 5696
} | [
"java.util.List",
"org.openqa.selenium.WebElement"
] | import java.util.List; import org.openqa.selenium.WebElement; | import java.util.*; import org.openqa.selenium.*; | [
"java.util",
"org.openqa.selenium"
] | java.util; org.openqa.selenium; | 133,581 |
private static int modeToMode(String mode) {
int modeBits;
if ("r".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_ONLY;
} else if ("w".equals(mode) || "wt".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_TRUNCATE;
} else if ("wa".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_APPEND;
} else if ("rw".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_WRITE
| ParcelFileDescriptor.MODE_CREATE;
} else if ("rwt".equals(mode)) {
modeBits = ParcelFileDescriptor.MODE_READ_WRITE
| ParcelFileDescriptor.MODE_CREATE
| ParcelFileDescriptor.MODE_TRUNCATE;
} else {
throw new IllegalArgumentException("Invalid mode: " + mode);
}
return modeBits;
} | static int function(String mode) { int modeBits; if ("r".equals(mode)) { modeBits = ParcelFileDescriptor.MODE_READ_ONLY; } else if ("w".equals(mode) "wt".equals(mode)) { modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY ParcelFileDescriptor.MODE_CREATE ParcelFileDescriptor.MODE_TRUNCATE; } else if ("wa".equals(mode)) { modeBits = ParcelFileDescriptor.MODE_WRITE_ONLY ParcelFileDescriptor.MODE_CREATE ParcelFileDescriptor.MODE_APPEND; } else if ("rw".equals(mode)) { modeBits = ParcelFileDescriptor.MODE_READ_WRITE ParcelFileDescriptor.MODE_CREATE; } else if ("rwt".equals(mode)) { modeBits = ParcelFileDescriptor.MODE_READ_WRITE ParcelFileDescriptor.MODE_CREATE ParcelFileDescriptor.MODE_TRUNCATE; } else { throw new IllegalArgumentException(STR + mode); } return modeBits; } | /**
* Copied from ContentResolver.java
*/ | Copied from ContentResolver.java | modeToMode | {
"repo_name": "Jaden-J/androidbible",
"path": "Alkitab/src/main/java/yuku/alkitab/base/cp/FileProvider.java",
"license": "apache-2.0",
"size": 5026
} | [
"android.os.ParcelFileDescriptor"
] | import android.os.ParcelFileDescriptor; | import android.os.*; | [
"android.os"
] | android.os; | 111,064 |
synchronized void notifyModelReplacement(M oldModel, M newModel) {
List<IModelListener<M>> oldListeners = modelListeners.get(oldModel);
if (null != oldListeners) {
// are listeners registered (if not, do nothing)
// inform listeners
for (int l = 0; l < oldListeners.size(); l++) {
oldListeners.get(l).notifyReplaced(oldModel, newModel);
}
// change listeners of both types
if (oldModel != newModel) {
updateListeners(modelListeners.get(oldModel), modelListeners, oldModel, newModel);
updateListeners(modelReloadListeners.get(oldModel), modelReloadListeners, oldModel, newModel);
}
}
} | synchronized void notifyModelReplacement(M oldModel, M newModel) { List<IModelListener<M>> oldListeners = modelListeners.get(oldModel); if (null != oldListeners) { for (int l = 0; l < oldListeners.size(); l++) { oldListeners.get(l).notifyReplaced(oldModel, newModel); } if (oldModel != newModel) { updateListeners(modelListeners.get(oldModel), modelListeners, oldModel, newModel); updateListeners(modelReloadListeners.get(oldModel), modelReloadListeners, oldModel, newModel); } } } | /**
* Notifies registered listeners about replacing a model instance. Changes
* the listener registrations accordingly.
*
* @param oldModel the old model being replaced
* @param newModel the new model replacing <code>oldModel</code>
*/ | Notifies registered listeners about replacing a model instance. Changes the listener registrations accordingly | notifyModelReplacement | {
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/VarModel/Utils/src/net/ssehub/easy/basics/modelManagement/ModelEvents.java",
"license": "apache-2.0",
"size": 9949
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,686,541 |
@Override
public void onDragFloatView(View floatView, Point position, Point touch) {
if (mRemoveEnabled && mIsRemoving) {
mPositionX = position.x;
}
} | void function(View floatView, Point position, Point touch) { if (mRemoveEnabled && mIsRemoving) { mPositionX = position.x; } } | /**
* Overrides to provide fading when slide removal is enabled.
*/ | Overrides to provide fading when slide removal is enabled | onDragFloatView | {
"repo_name": "vanilla-music/vanilla",
"path": "app/src/main/java/com/mobeta/android/dslv/DragSortController.java",
"license": "gpl-3.0",
"size": 15740
} | [
"android.graphics.Point",
"android.view.View"
] | import android.graphics.Point; import android.view.View; | import android.graphics.*; import android.view.*; | [
"android.graphics",
"android.view"
] | android.graphics; android.view; | 748,813 |
public static void requestExchangeForwardCancellation(Channel channel, String exchangeName,
Collection<String> bindings) {
try {
sendCommandMessage(channel,exchangeName,Command.UNPUBLISH,EndpointType.FANOUT, bindings, true);
} catch (IOException e) {
System.err.println("Error while requesting exchange forward for exchange '" + exchangeName +"':");
e.printStackTrace();
}
}
| static void function(Channel channel, String exchangeName, Collection<String> bindings) { try { sendCommandMessage(channel,exchangeName,Command.UNPUBLISH,EndpointType.FANOUT, bindings, true); } catch (IOException e) { System.err.println(STR + exchangeName +"':"); e.printStackTrace(); } } | /**
* Cancel forwarding of a local exchange to the remote AMQP instance
* @param channel A channel used to submit the cancellation request.
* @param queueName The name of the exchange which should no longer be forwarded.
*/ | Cancel forwarding of a local exchange to the remote AMQP instance | requestExchangeForwardCancellation | {
"repo_name": "rapid7/harp",
"path": "harp-amqp-relay-lib/src/main/java/com/rapid7/component/messaging/relay/amqp/MessageRelayControl.java",
"license": "bsd-3-clause",
"size": 7366
} | [
"com.rabbitmq.client.Channel",
"com.rapid7.component.messaging.relay.encoding.MessageRelayEncoding",
"java.io.IOException",
"java.util.Collection"
] | import com.rabbitmq.client.Channel; import com.rapid7.component.messaging.relay.encoding.MessageRelayEncoding; import java.io.IOException; import java.util.Collection; | import com.rabbitmq.client.*; import com.rapid7.component.messaging.relay.encoding.*; import java.io.*; import java.util.*; | [
"com.rabbitmq.client",
"com.rapid7.component",
"java.io",
"java.util"
] | com.rabbitmq.client; com.rapid7.component; java.io; java.util; | 1,534,796 |
PagedIterable<PrivateDnsRecordSet> listRecordSets(int pageSize); | PagedIterable<PrivateDnsRecordSet> listRecordSets(int pageSize); | /**
* Lists all the record sets in this zone with each entries in each page limited to the given size.
*
* @param pageSize the maximum number of record sets in a page
* @return the record sets
*/ | Lists all the record sets in this zone with each entries in each page limited to the given size | listRecordSets | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/models/PrivateDnsZone.java",
"license": "mit",
"size": 24638
} | [
"com.azure.core.http.rest.PagedIterable"
] | import com.azure.core.http.rest.PagedIterable; | import com.azure.core.http.rest.*; | [
"com.azure.core"
] | com.azure.core; | 341,633 |
public SocketChannel getSocketChannelByPlayer(NetPlayerInfo pInfo) {
synchronized(channelList) {
for(SocketChannel ch: channelList) {
NetPlayerInfo p = playerInfoMap.get(ch);
if((p != null) && (p.uid == pInfo.uid)) {
return ch;
}
}
}
return null;
}
| SocketChannel function(NetPlayerInfo pInfo) { synchronized(channelList) { for(SocketChannel ch: channelList) { NetPlayerInfo p = playerInfoMap.get(ch); if((p != null) && (p.uid == pInfo.uid)) { return ch; } } } return null; } | /**
* Get SocketChannel from NetPlayerInfo
* @param pInfo Player
* @return SocketChannel (null if not found)
*/ | Get SocketChannel from NetPlayerInfo | getSocketChannelByPlayer | {
"repo_name": "sammymax/nullpomino",
"path": "src/mu/nu/nullpo/game/net/NetServer.java",
"license": "bsd-3-clause",
"size": 118621
} | [
"java.nio.channels.SocketChannel"
] | import java.nio.channels.SocketChannel; | import java.nio.channels.*; | [
"java.nio"
] | java.nio; | 20,410 |
public DistinctOperator<T> distinct(int... fields) {
return new DistinctOperator<>(
this, new Keys.ExpressionKeys<>(fields, getType()), Utils.getCallLocationName());
} | DistinctOperator<T> function(int... fields) { return new DistinctOperator<>( this, new Keys.ExpressionKeys<>(fields, getType()), Utils.getCallLocationName()); } | /**
* Returns a distinct set of a {@link Tuple} {@link DataSet} using field position keys.
*
* <p>The field position keys specify the fields of Tuples on which the decision is made if two
* Tuples are distinct or not.
*
* <p>Note: Field position keys can only be specified for Tuple DataSets.
*
* @param fields One or more field positions on which the distinction of the DataSet is decided.
* @return A DistinctOperator that represents the distinct DataSet.
*/ | Returns a distinct set of a <code>Tuple</code> <code>DataSet</code> using field position keys. The field position keys specify the fields of Tuples on which the decision is made if two Tuples are distinct or not. Note: Field position keys can only be specified for Tuple DataSets | distinct | {
"repo_name": "apache/flink",
"path": "flink-java/src/main/java/org/apache/flink/api/java/DataSet.java",
"license": "apache-2.0",
"size": 87622
} | [
"org.apache.flink.api.common.operators.Keys",
"org.apache.flink.api.java.operators.DistinctOperator"
] | import org.apache.flink.api.common.operators.Keys; import org.apache.flink.api.java.operators.DistinctOperator; | import org.apache.flink.api.common.operators.*; import org.apache.flink.api.java.operators.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,007,418 |
public List<UserIdentityProvider> getUserIdProviders(int userId) throws RMapAuthException; | List<UserIdentityProvider> function(int userId) throws RMapAuthException; | /**
* Get a list of ID provider details associated with a User Id.
*
* @param userId the user id
* @return the user's id providers
* @throws RMapAuthException the RMap Auth exception
*/ | Get a list of ID provider details associated with a User Id | getUserIdProviders | {
"repo_name": "rmap-project/rmap",
"path": "auth/src/main/java/info/rmapproject/auth/dao/UserIdProviderDao.java",
"license": "apache-2.0",
"size": 2577
} | [
"info.rmapproject.auth.exception.RMapAuthException",
"info.rmapproject.auth.model.UserIdentityProvider",
"java.util.List"
] | import info.rmapproject.auth.exception.RMapAuthException; import info.rmapproject.auth.model.UserIdentityProvider; import java.util.List; | import info.rmapproject.auth.exception.*; import info.rmapproject.auth.model.*; import java.util.*; | [
"info.rmapproject.auth",
"java.util"
] | info.rmapproject.auth; java.util; | 1,744,678 |
@Test
public void testCreateErrorResponseIntObject() throws Exception {
Response result = Whitebox.invokeMethod(target, "createErrorResponse",
Response.INTERNAL_SERVER_ERROR, "Body");
assertThat(result.statusCode, is(Response.INTERNAL_SERVER_ERROR));
assertThat(result.getBody(String.class), is("Body"));
} | void function() throws Exception { Response result = Whitebox.invokeMethod(target, STR, Response.INTERNAL_SERVER_ERROR, "Body"); assertThat(result.statusCode, is(Response.INTERNAL_SERVER_ERROR)); assertThat(result.getBody(String.class), is("Body")); } | /**
* Test method for {@link org.o3project.odenos.core.component.network.Network#createErrorResponse(int, Object)}.
*
* @throws Exception throws Exception in targets
*/ | Test method for <code>org.o3project.odenos.core.component.network.Network#createErrorResponse(int, Object)</code> | testCreateErrorResponseIntObject | {
"repo_name": "haizawa/odenos",
"path": "src/test/java/org/o3project/odenos/core/component/network/NetworkTest.java",
"license": "apache-2.0",
"size": 112118
} | [
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.o3project.odenos.remoteobject.message.Response",
"org.powermock.reflect.Whitebox"
] | import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.o3project.odenos.remoteobject.message.Response; import org.powermock.reflect.Whitebox; | import org.hamcrest.*; import org.junit.*; import org.o3project.odenos.remoteobject.message.*; import org.powermock.reflect.*; | [
"org.hamcrest",
"org.junit",
"org.o3project.odenos",
"org.powermock.reflect"
] | org.hamcrest; org.junit; org.o3project.odenos; org.powermock.reflect; | 990,850 |
@WebMethod
@WebResult(name = "registerPassengerResponse", targetNamespace = "http://pad.polito.it/FDS", partName = "parameters")
@Action(input = "http://pad.polito.it/FDSControl/Control/registerPassengerRequest", output = "http://pad.polito.it/FDSControl/Control/registerPassengerResponse", fault = {
@FaultAction(className = UnknownFlightInstance_Exception.class, value = "http://pad.polito.it/FDSControl/Control/registerPassenger/Fault/UnknownFlightInstance"),
@FaultAction(className = NotBoarding_Exception.class, value = "http://pad.polito.it/FDSControl/Control/registerPassenger/Fault/NotBoarding"),
@FaultAction(className = InvalidArgument_Exception.class, value = "http://pad.polito.it/FDSControl/Control/registerPassenger/Fault/InvalidArgument"),
@FaultAction(className = PassengerAlreadyRegistered_Exception.class, value = "http://pad.polito.it/FDSControl/Control/registerPassenger/Fault/PassengerAlreadyRegistered"),
@FaultAction(className = Monitor_Exception.class, value = "http://pad.polito.it/FDSControl/Control/registerPassenger/Fault/Monitor")
})
public RegisterPassengerResponse registerPassenger(
@WebParam(name = "registerPassenger", targetNamespace = "http://pad.polito.it/FDS", partName = "parameters")
RegisterPassenger parameters)
throws InvalidArgument_Exception, Monitor_Exception, NotBoarding_Exception, PassengerAlreadyRegistered_Exception, UnknownFlightInstance_Exception
; | @WebResult(name = STR, targetNamespace = STRhttp: @FaultAction(className = UnknownFlightInstance_Exception.class, value = STRhttp: @FaultAction(className = InvalidArgument_Exception.class, value = STRhttp: @FaultAction(className = Monitor_Exception.class, value = STRregisterPassengerSTRhttp: RegisterPassenger parameters) throws InvalidArgument_Exception, Monitor_Exception, NotBoarding_Exception, PassengerAlreadyRegistered_Exception, UnknownFlightInstance_Exception ; | /**
*
* This operation lets the user to register a checked-in
* passenger on a
* boarding flight instance.
*
*
* @param parameters
* @return
* returns it.polito.dp2.FDS.sol4.server.jaxws.RegisterPassengerResponse
* @throws NotBoarding_Exception
* @throws InvalidArgument_Exception
* @throws Monitor_Exception
* @throws PassengerAlreadyRegistered_Exception
* @throws UnknownFlightInstance_Exception
*/ | This operation lets the user to register a checked-in passenger on a boarding flight instance | registerPassenger | {
"repo_name": "emdotzed/FinalTestSample",
"path": "src/it/polito/dp2/FDS/sol4/server/jaxws/Control.java",
"license": "mit",
"size": 12420
} | [
"javax.jws.WebResult",
"javax.xml.ws.FaultAction"
] | import javax.jws.WebResult; import javax.xml.ws.FaultAction; | import javax.jws.*; import javax.xml.ws.*; | [
"javax.jws",
"javax.xml"
] | javax.jws; javax.xml; | 59,442 |
private void verifyMetadata() {
verifyNotNull(metadata.getName(), "Cluster name must be specified");
verifyNotNull(metadata.getNodes(), "Cluster nodes must be specified");
verifyNotNull(metadata.getPartitions(), "Cluster partitions must be specified");
verify(!metadata.getNodes().isEmpty(), "Cluster nodes must not be empty");
verify(!metadata.getPartitions().isEmpty(), "Cluster nodes must not be empty");
// verify that partitions are constituted from valid cluster nodes.
boolean validPartitions = Collections2.transform(metadata.getNodes(), ControllerNode::id)
.containsAll(metadata.getPartitions()
.stream()
.flatMap(r -> r.getMembers().stream())
.collect(Collectors.toSet()));
verify(validPartitions, "Partition locations must be valid cluster nodes");
}
} | void function() { verifyNotNull(metadata.getName(), STR); verifyNotNull(metadata.getNodes(), STR); verifyNotNull(metadata.getPartitions(), STR); verify(!metadata.getNodes().isEmpty(), STR); verify(!metadata.getPartitions().isEmpty(), STR); boolean validPartitions = Collections2.transform(metadata.getNodes(), ControllerNode::id) .containsAll(metadata.getPartitions() .stream() .flatMap(r -> r.getMembers().stream()) .collect(Collectors.toSet())); verify(validPartitions, STR); } } | /**
* Validates the constructed metadata for semantic correctness.
* @throws VerifyException if the metadata is misconfigured.
*/ | Validates the constructed metadata for semantic correctness | verifyMetadata | {
"repo_name": "planoAccess/clonedONOS",
"path": "core/api/src/main/java/org/onosproject/cluster/ClusterMetadata.java",
"license": "apache-2.0",
"size": 6393
} | [
"com.google.common.base.Verify",
"com.google.common.collect.Collections2",
"java.util.stream.Collectors"
] | import com.google.common.base.Verify; import com.google.common.collect.Collections2; import java.util.stream.Collectors; | import com.google.common.base.*; import com.google.common.collect.*; import java.util.stream.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 166,656 |
public boolean anyRecoverable(ECBlockGroup blockGroup) {
int erasedCount = blockGroup.getErasedCount();
return erasedCount > 0 && erasedCount <= getRequiredNumParityBlocks();
} | boolean function(ECBlockGroup blockGroup) { int erasedCount = blockGroup.getErasedCount(); return erasedCount > 0 && erasedCount <= getRequiredNumParityBlocks(); } | /**
* Given a BlockGroup, tell if any of the missing blocks can be recovered,
* to be called by ECManager
* @param blockGroup a blockGroup that may contain erased blocks but not sure
* recoverable or not
* @return true if any erased block recoverable, false otherwise
*/ | Given a BlockGroup, tell if any of the missing blocks can be recovered, to be called by ECManager | anyRecoverable | {
"repo_name": "PHILO-HE/SSM",
"path": "smart-hadoop-support/smart-erasurecodec/src/main/java/org/smartdata/erasurecode/grouper/BlockGrouper.java",
"license": "apache-2.0",
"size": 2851
} | [
"org.smartdata.erasurecode.ECBlockGroup"
] | import org.smartdata.erasurecode.ECBlockGroup; | import org.smartdata.erasurecode.*; | [
"org.smartdata.erasurecode"
] | org.smartdata.erasurecode; | 2,217,048 |
public void testCombiningScheduling3() throws Exception {
FreeStyleProject fs = createFreeStyleProject("freestyle");
// scheduleBuild2 returns null if request is combined into an existing item. (no new item added to queue)
Future b1 = fs.scheduleBuild2(3);
Future b2 = fs.scheduleBuild2(3, null, Collections.singletonList(new RevisionParameterAction("DEADBEEF")));
// Check that we have the correct futures.
assertNotNull(b1);
assertNotNull(b2);
// Check that two builds occurred
waitUntilNoActivity();
assertEquals(fs.getBuilds().size(),2);
} | void function() throws Exception { FreeStyleProject fs = createFreeStyleProject(STR); Future b1 = fs.scheduleBuild2(3); Future b2 = fs.scheduleBuild2(3, null, Collections.singletonList(new RevisionParameterAction(STR))); assertNotNull(b1); assertNotNull(b2); waitUntilNoActivity(); assertEquals(fs.getBuilds().size(),2); } | /** test when there is no revision on the item in the queue
*/ | test when there is no revision on the item in the queue | testCombiningScheduling3 | {
"repo_name": "ialbors/git-plugin",
"path": "src/test/java/hudson/plugins/git/RevisionParameterActionTest.java",
"license": "mit",
"size": 8660
} | [
"hudson.model.FreeStyleProject",
"java.util.Collections",
"java.util.concurrent.Future"
] | import hudson.model.FreeStyleProject; import java.util.Collections; import java.util.concurrent.Future; | import hudson.model.*; import java.util.*; import java.util.concurrent.*; | [
"hudson.model",
"java.util"
] | hudson.model; java.util; | 2,039,253 |
public Map<String, TaskDef> getTaskDefs();
| Map<String, TaskDef> function(); | /**
* Get a copy of all {@code TaskDef}s of this Job.
* @return a map of TaskDef.
*/ | Get a copy of all TaskDefs of this Job | getTaskDefs | {
"repo_name": "nugraviton/chao-open",
"path": "chao-core/src/main/java/com/nugraviton/chao/job/JobContainer.java",
"license": "apache-2.0",
"size": 1235
} | [
"com.nugraviton.chao.job.rmi.TaskDef",
"java.util.Map"
] | import com.nugraviton.chao.job.rmi.TaskDef; import java.util.Map; | import com.nugraviton.chao.job.rmi.*; import java.util.*; | [
"com.nugraviton.chao",
"java.util"
] | com.nugraviton.chao; java.util; | 206,877 |
void addViewToHistory(ModelAndView view, boolean updatePreviousView, HttpSession session);
| void addViewToHistory(ModelAndView view, boolean updatePreviousView, HttpSession session); | /**
* Add view to history.
*
* @param view
* View to add.
* @param updatePreviousView
* Update previous view flag.
* @param session
* HTTP session.
*/ | Add view to history | addViewToHistory | {
"repo_name": "oswa/bianccoAdmin",
"path": "BianccoAdministrator/src/main/java/com/biancco/admin/service/CommonService.java",
"license": "apache-2.0",
"size": 2095
} | [
"javax.servlet.http.HttpSession",
"org.springframework.web.servlet.ModelAndView"
] | import javax.servlet.http.HttpSession; import org.springframework.web.servlet.ModelAndView; | import javax.servlet.http.*; import org.springframework.web.servlet.*; | [
"javax.servlet",
"org.springframework.web"
] | javax.servlet; org.springframework.web; | 1,760,321 |
public List<String> getSupportedSceneModes() {
String str = get(KEY_SCENE_MODE + SUPPORTED_VALUES_SUFFIX);
return split(str);
} | List<String> function() { String str = get(KEY_SCENE_MODE + SUPPORTED_VALUES_SUFFIX); return split(str); } | /**
* Gets the supported scene modes.
*
* @return a list of supported scene modes. null if scene mode setting
* is not supported.
* @see #getSceneMode()
*/ | Gets the supported scene modes | getSupportedSceneModes | {
"repo_name": "OmniEvo/android_frameworks_base",
"path": "core/java/android/hardware/Camera.java",
"license": "gpl-3.0",
"size": 224245
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,223,255 |
private DatanodeID pickSrcDatanode(LocatedBlocks blks, HdfsFileStatus i)
throws IOException {
if (i.getLen() == 0 || blks.getLocatedBlocks().size() <= 0) {
// pick a random datanode
NameNode nn = (NameNode)getServletContext().getAttribute("name.node");
return nn.getNamesystem().getRandomDatanode();
}
return JspHelper.bestNode(blks);
}
/**
* Service a GET request as described below.
* Request:
* {@code
* GET http://<nn>:<port>/data[/<path>] HTTP/1.1
* } | DatanodeID function(LocatedBlocks blks, HdfsFileStatus i) throws IOException { if (i.getLen() == 0 blks.getLocatedBlocks().size() <= 0) { NameNode nn = (NameNode)getServletContext().getAttribute(STR); return nn.getNamesystem().getRandomDatanode(); } return JspHelper.bestNode(blks); } /** * Service a GET request as described below. * Request: * { * GET http: * } | /** Select a datanode to service this request.
* Currently, this looks at no more than the first five blocks of a file,
* selecting a datanode randomly from the most represented.
*/ | Select a datanode to service this request. Currently, this looks at no more than the first five blocks of a file, selecting a datanode randomly from the most represented | pickSrcDatanode | {
"repo_name": "steveloughran/hadoop-hdfs",
"path": "src/java/org/apache/hadoop/hdfs/server/namenode/FileDataServlet.java",
"license": "apache-2.0",
"size": 5420
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.DatanodeID",
"org.apache.hadoop.hdfs.protocol.HdfsFileStatus",
"org.apache.hadoop.hdfs.protocol.LocatedBlocks",
"org.apache.hadoop.hdfs.server.common.JspHelper"
] | import java.io.IOException; import org.apache.hadoop.hdfs.protocol.DatanodeID; import org.apache.hadoop.hdfs.protocol.HdfsFileStatus; import org.apache.hadoop.hdfs.protocol.LocatedBlocks; import org.apache.hadoop.hdfs.server.common.JspHelper; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.common.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,071,260 |
public void write(CWExporter ex) throws IOException {
OutputCapsule oc = (OutputCapsule) ex.getCapsule(this);
oc.write(name, "name", "");
oc.write(type, "type", "");
oc.write(nameSpace, "nameSpace", "");
oc.write(condition, "condition", null);
oc.write(shaderOutput, "shaderOutput", false);
oc.write(multiplicity, "multiplicity", null);
} | void function(CWExporter ex) throws IOException { OutputCapsule oc = (OutputCapsule) ex.getCapsule(this); oc.write(name, "name", STRtypeSTRSTRnameSpaceSTRSTRconditionSTRshaderOutputSTRmultiplicity", null); } | /**
* CW seralization (not used)
*
* @param ex the exporter
* @throws IOException
*/ | CW seralization (not used) | write | {
"repo_name": "PlanetWaves/clockworkengine",
"path": "branches/3.0/engine/src/core/com/clockwork/shader/ShaderNodeVariable.java",
"license": "apache-2.0",
"size": 6183
} | [
"com.clockwork.export.CWExporter",
"com.clockwork.export.OutputCapsule",
"java.io.IOException"
] | import com.clockwork.export.CWExporter; import com.clockwork.export.OutputCapsule; import java.io.IOException; | import com.clockwork.export.*; import java.io.*; | [
"com.clockwork.export",
"java.io"
] | com.clockwork.export; java.io; | 685,328 |
public void output(XMLStreamWriter writer) throws XMLStreamException {
output(writer,null);
}
| void function(XMLStreamWriter writer) throws XMLStreamException { output(writer,null); } | /**
* outputs all files in the filesec
* @param writer
* @throws XMLStreamException
*/ | outputs all files in the filesec | output | {
"repo_name": "opf-labs/ots-schema",
"path": "src/edu/harvard/hul/ois/ots/schemas/METS/StructMap.java",
"license": "gpl-3.0",
"size": 4352
} | [
"javax.xml.stream.XMLStreamException",
"javax.xml.stream.XMLStreamWriter"
] | import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; | import javax.xml.stream.*; | [
"javax.xml"
] | javax.xml; | 185,941 |
protected static boolean parsePartHeaders(ByteArrayInputStream pduDataStream,
PduPart part, int length) {
assert(null != pduDataStream);
assert(null != part);
assert(length > 0);
int startPos = pduDataStream.available();
int tempPos = 0;
int lastLen = length;
while(0 < lastLen) {
int header = pduDataStream.read();
assert(-1 != header);
lastLen--;
if (header > TEXT_MAX) {
// Number assigned headers.
switch (header) {
case PduPart.P_CONTENT_LOCATION:
byte[] contentLocation = parseWapString(pduDataStream, TYPE_TEXT_STRING);
if (null != contentLocation) {
part.setContentLocation(contentLocation);
}
tempPos = pduDataStream.available();
lastLen = length - (startPos - tempPos);
break;
case PduPart.P_CONTENT_ID:
byte[] contentId = parseWapString(pduDataStream, TYPE_QUOTED_STRING);
if (null != contentId) {
part.setContentId(contentId);
}
tempPos = pduDataStream.available();
lastLen = length - (startPos - tempPos);
break;
case PduPart.P_DEP_CONTENT_DISPOSITION:
case PduPart.P_CONTENT_DISPOSITION:
boolean contentDisposition = Resources.getSystem().getBoolean(com
.android.internal.R.bool.config_mms_content_disposition_support);
if (contentDisposition) {
int len = parseValueLength(pduDataStream);
pduDataStream.mark(1);
int thisStartPos = pduDataStream.available();
int thisEndPos = 0;
int value = pduDataStream.read();
if (value == PduPart.P_DISPOSITION_FROM_DATA ) {
part.setContentDisposition(PduPart.DISPOSITION_FROM_DATA);
} else if (value == PduPart.P_DISPOSITION_ATTACHMENT) {
part.setContentDisposition(PduPart.DISPOSITION_ATTACHMENT);
} else if (value == PduPart.P_DISPOSITION_INLINE) {
part.setContentDisposition(PduPart.DISPOSITION_INLINE);
} else {
pduDataStream.reset();
part.setContentDisposition(parseWapString(pduDataStream
, TYPE_TEXT_STRING));
}
thisEndPos = pduDataStream.available();
if (thisStartPos - thisEndPos < len) {
value = pduDataStream.read();
if (value == PduPart.P_FILENAME) { //filename is text-string
part.setFilename(parseWapString(pduDataStream
, TYPE_TEXT_STRING));
}
thisEndPos = pduDataStream.available();
if (thisStartPos - thisEndPos < len) {
int last = len - (thisStartPos - thisEndPos);
byte[] temp = new byte[last];
pduDataStream.read(temp, 0, last);
}
}
tempPos = pduDataStream.available();
lastLen = length - (startPos - tempPos);
}
break;
default:
if (LOCAL_LOGV) {
Log.v(LOG_TAG, "Not supported Part headers: " + header);
}
if (-1 == skipWapValue(pduDataStream, lastLen)) {
Log.e(LOG_TAG, "Corrupt Part headers");
return false;
}
lastLen = 0;
break;
}
} else if ((header >= TEXT_MIN) && (header <= TEXT_MAX)) {
// Not assigned header.
byte[] tempHeader = parseWapString(pduDataStream, TYPE_TEXT_STRING);
byte[] tempValue = parseWapString(pduDataStream, TYPE_TEXT_STRING);
// Check the header whether it is "Content-Transfer-Encoding".
if (true ==
PduPart.CONTENT_TRANSFER_ENCODING.equalsIgnoreCase(new String(tempHeader))) {
part.setContentTransferEncoding(tempValue);
}
tempPos = pduDataStream.available();
lastLen = length - (startPos - tempPos);
} else {
if (LOCAL_LOGV) {
Log.v(LOG_TAG, "Not supported Part headers: " + header);
}
// Skip all headers of this part.
if (-1 == skipWapValue(pduDataStream, lastLen)) {
Log.e(LOG_TAG, "Corrupt Part headers");
return false;
}
lastLen = 0;
}
}
if (0 != lastLen) {
Log.e(LOG_TAG, "Corrupt Part headers");
return false;
}
return true;
} | static boolean function(ByteArrayInputStream pduDataStream, PduPart part, int length) { assert(null != pduDataStream); assert(null != part); assert(length > 0); int startPos = pduDataStream.available(); int tempPos = 0; int lastLen = length; while(0 < lastLen) { int header = pduDataStream.read(); assert(-1 != header); lastLen--; if (header > TEXT_MAX) { switch (header) { case PduPart.P_CONTENT_LOCATION: byte[] contentLocation = parseWapString(pduDataStream, TYPE_TEXT_STRING); if (null != contentLocation) { part.setContentLocation(contentLocation); } tempPos = pduDataStream.available(); lastLen = length - (startPos - tempPos); break; case PduPart.P_CONTENT_ID: byte[] contentId = parseWapString(pduDataStream, TYPE_QUOTED_STRING); if (null != contentId) { part.setContentId(contentId); } tempPos = pduDataStream.available(); lastLen = length - (startPos - tempPos); break; case PduPart.P_DEP_CONTENT_DISPOSITION: case PduPart.P_CONTENT_DISPOSITION: boolean contentDisposition = Resources.getSystem().getBoolean(com .android.internal.R.bool.config_mms_content_disposition_support); if (contentDisposition) { int len = parseValueLength(pduDataStream); pduDataStream.mark(1); int thisStartPos = pduDataStream.available(); int thisEndPos = 0; int value = pduDataStream.read(); if (value == PduPart.P_DISPOSITION_FROM_DATA ) { part.setContentDisposition(PduPart.DISPOSITION_FROM_DATA); } else if (value == PduPart.P_DISPOSITION_ATTACHMENT) { part.setContentDisposition(PduPart.DISPOSITION_ATTACHMENT); } else if (value == PduPart.P_DISPOSITION_INLINE) { part.setContentDisposition(PduPart.DISPOSITION_INLINE); } else { pduDataStream.reset(); part.setContentDisposition(parseWapString(pduDataStream , TYPE_TEXT_STRING)); } thisEndPos = pduDataStream.available(); if (thisStartPos - thisEndPos < len) { value = pduDataStream.read(); if (value == PduPart.P_FILENAME) { part.setFilename(parseWapString(pduDataStream , TYPE_TEXT_STRING)); } thisEndPos = pduDataStream.available(); if (thisStartPos - thisEndPos < len) { int last = len - (thisStartPos - thisEndPos); byte[] temp = new byte[last]; pduDataStream.read(temp, 0, last); } } tempPos = pduDataStream.available(); lastLen = length - (startPos - tempPos); } break; default: if (LOCAL_LOGV) { Log.v(LOG_TAG, STR + header); } if (-1 == skipWapValue(pduDataStream, lastLen)) { Log.e(LOG_TAG, STR); return false; } lastLen = 0; break; } } else if ((header >= TEXT_MIN) && (header <= TEXT_MAX)) { byte[] tempHeader = parseWapString(pduDataStream, TYPE_TEXT_STRING); byte[] tempValue = parseWapString(pduDataStream, TYPE_TEXT_STRING); if (true == PduPart.CONTENT_TRANSFER_ENCODING.equalsIgnoreCase(new String(tempHeader))) { part.setContentTransferEncoding(tempValue); } tempPos = pduDataStream.available(); lastLen = length - (startPos - tempPos); } else { if (LOCAL_LOGV) { Log.v(LOG_TAG, STR + header); } if (-1 == skipWapValue(pduDataStream, lastLen)) { Log.e(LOG_TAG, STR); return false; } lastLen = 0; } } if (0 != lastLen) { Log.e(LOG_TAG, STR); return false; } return true; } | /**
* Parse part's headers.
*
* @param pduDataStream pdu data input stream
* @param part to store the header informations of the part
* @param length length of the headers
* @return true if parse successfully, false otherwise
*/ | Parse part's headers | parsePartHeaders | {
"repo_name": "mateor/pdroid",
"path": "android-4.0.3_r1/trunk/frameworks/base/core/java/com/google/android/mms/pdu/PduParser.java",
"license": "gpl-3.0",
"size": 75489
} | [
"android.content.res.Resources",
"android.util.Log",
"java.io.ByteArrayInputStream"
] | import android.content.res.Resources; import android.util.Log; import java.io.ByteArrayInputStream; | import android.content.res.*; import android.util.*; import java.io.*; | [
"android.content",
"android.util",
"java.io"
] | android.content; android.util; java.io; | 1,554,385 |
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start(SurfaceHolder surfaceHolder) throws IOException {
synchronized (mCameraLock) {
if (mCamera != null) {
return this;
}
mCamera = createCamera();
mCamera.setPreviewDisplay(surfaceHolder);
mCamera.startPreview();
mProcessingThread = new Thread(mFrameProcessor);
mFrameProcessor.setActive(true);
mProcessingThread.start();
}
return this;
} | @RequiresPermission(Manifest.permission.CAMERA) CameraSource function(SurfaceHolder surfaceHolder) throws IOException { synchronized (mCameraLock) { if (mCamera != null) { return this; } mCamera = createCamera(); mCamera.setPreviewDisplay(surfaceHolder); mCamera.startPreview(); mProcessingThread = new Thread(mFrameProcessor); mFrameProcessor.setActive(true); mProcessingThread.start(); } return this; } | /**
* Opens the camera and starts sending preview frames to the underlying detector. The supplied
* surface holder is used for the preview so frames can be displayed to the user.
*
* @param surfaceHolder the surface holder to use for the preview frames
* @throws IOException if the supplied surface holder could not be used as the preview display
*/ | Opens the camera and starts sending preview frames to the underlying detector. The supplied surface holder is used for the preview so frames can be displayed to the user | start | {
"repo_name": "emoncms/AndroidApp",
"path": "app/src/main/java/org/emoncms/myapps/barcodescanner/camera/CameraSource.java",
"license": "agpl-3.0",
"size": 48638
} | [
"android.support.annotation.RequiresPermission",
"android.view.SurfaceHolder",
"java.io.IOException"
] | import android.support.annotation.RequiresPermission; import android.view.SurfaceHolder; import java.io.IOException; | import android.support.annotation.*; import android.view.*; import java.io.*; | [
"android.support",
"android.view",
"java.io"
] | android.support; android.view; java.io; | 502,714 |
protected File root = null;
protected FileFilter filter = new DummyFilter();
protected boolean done = false;
protected int maxCount = 2000;
public int getMaxCount() {
return maxCount;
}
| File root = null; protected FileFilter filter = new DummyFilter(); protected boolean done = false; protected int maxCount = 2000; public int function() { return maxCount; } | /**
* Getter for {@link #maxCount} property.
* @return value of property
*/ | Getter for <code>#maxCount</code> property | getMaxCount | {
"repo_name": "BradleyRoss/bradleyross-examples",
"path": "src/bradleyross/library/helpers/DirWalker.java",
"license": "lgpl-3.0",
"size": 14229
} | [
"java.io.File",
"java.io.FileFilter"
] | import java.io.File; import java.io.FileFilter; | import java.io.*; | [
"java.io"
] | java.io; | 2,191,805 |
public static String oneAuthorPlusIni(String authorField) {
String fixedAuthorField = AuthorList.fixAuthorForAlphabetization(authorField);
String[] tokens = fixedAuthorField.split("\\s+\\band\\b\\s+");
if (tokens.length == 0) {
return "";
}
String firstAuthor = tokens[0].split(",")[0];
StringBuilder authorSB = new StringBuilder();
authorSB.append(firstAuthor.substring(0, Math.min(CHARS_OF_FIRST, firstAuthor.length())));
int i = 1;
while (tokens.length > i) {
// convert lastname, firstname to firstname lastname
authorSB.append(tokens[i].charAt(0));
i++;
}
return authorSB.toString();
} | static String function(String authorField) { String fixedAuthorField = AuthorList.fixAuthorForAlphabetization(authorField); String[] tokens = fixedAuthorField.split(STR); if (tokens.length == 0) { return STR,")[0]; StringBuilder authorSB = new StringBuilder(); authorSB.append(firstAuthor.substring(0, Math.min(CHARS_OF_FIRST, firstAuthor.length()))); int i = 1; while (tokens.length > i) { authorSB.append(tokens[i].charAt(0)); i++; } return authorSB.toString(); } | /**
* Gets the first part of the last name of the first
* author/editor, and appends the last name initial of the
* remaining authors/editors.
* Maximum 5 characters
* @param authorField a <code>String</code>
* @return the surname of all authors/editors
*/ | Gets the first part of the last name of the first author/editor, and appends the last name initial of the remaining authors/editors. Maximum 5 characters | oneAuthorPlusIni | {
"repo_name": "mairdl/jabref",
"path": "src/main/java/net/sf/jabref/logic/bibtexkeypattern/BibtexKeyPatternUtil.java",
"license": "mit",
"size": 51274
} | [
"net.sf.jabref.model.entry.AuthorList"
] | import net.sf.jabref.model.entry.AuthorList; | import net.sf.jabref.model.entry.*; | [
"net.sf.jabref"
] | net.sf.jabref; | 2,759,376 |
public static boolean getFastPreviewEnabled() {
if ( mEnableFastPreview == null ) {
boolean value = false;
if ( containsValue( EXTRA_EFFECTS_ENABLE_FAST_PREVIEW ) ) {
value = getValueFromIntent( EXTRA_EFFECTS_ENABLE_FAST_PREVIEW, false );
} else {
int mhz = SystemUtils.getCpuMhz();
if ( mhz > 0 ) {
value = mhz >= MHZ_CPU_FAST;
} else {
float speed = SystemUtils.getCpuSpeed();
value = speed >= BOGO_CPU_FAST;
}
}
mEnableFastPreview = value;
}
return mEnableFastPreview.booleanValue();
} | static boolean function() { if ( mEnableFastPreview == null ) { boolean value = false; if ( containsValue( EXTRA_EFFECTS_ENABLE_FAST_PREVIEW ) ) { value = getValueFromIntent( EXTRA_EFFECTS_ENABLE_FAST_PREVIEW, false ); } else { int mhz = SystemUtils.getCpuMhz(); if ( mhz > 0 ) { value = mhz >= MHZ_CPU_FAST; } else { float speed = SystemUtils.getCpuSpeed(); value = speed >= BOGO_CPU_FAST; } } mEnableFastPreview = value; } return mEnableFastPreview.booleanValue(); } | /**
* Get if the fast preview mode is enabled. If the 'effect-enable-fast-preview' intent-extra has been passed within the original
* intent the intent value will be used, otherwise the device cpu speed will be used to determine the return value
*
* @return
*/ | Get if the fast preview mode is enabled. If the 'effect-enable-fast-preview' intent-extra has been passed within the original intent the intent value will be used, otherwise the device cpu speed will be used to determine the return value | getFastPreviewEnabled | {
"repo_name": "photo/mobile-android",
"path": "submodules/Android-Feather/src/com/aviary/android/feather/Constants.java",
"license": "apache-2.0",
"size": 10987
} | [
"com.aviary.android.feather.library.utils.SystemUtils"
] | import com.aviary.android.feather.library.utils.SystemUtils; | import com.aviary.android.feather.library.utils.*; | [
"com.aviary.android"
] | com.aviary.android; | 245,937 |
private void writePoint(MixedEndianDataOutputStream mos, GeoPoint geoPoint)
throws IOException {
this.writeRecordHeader(mos, 20);
final double x = geoPoint.getX();
final double y = geoPoint.getY();
mos.writeLittleEndianInt(POINT_SHAPE_TYPE); // shape type
mos.writeLittleEndianDouble(x); // x coordinate
mos.writeLittleEndianDouble(y); // y coordinate
} | void function(MixedEndianDataOutputStream mos, GeoPoint geoPoint) throws IOException { this.writeRecordHeader(mos, 20); final double x = geoPoint.getX(); final double y = geoPoint.getY(); mos.writeLittleEndianInt(POINT_SHAPE_TYPE); mos.writeLittleEndianDouble(x); mos.writeLittleEndianDouble(y); } | /**
* Writes a point to a stream.
*/ | Writes a point to a stream | writePoint | {
"repo_name": "berniejenny/MapAnalyst",
"path": "src/ika/geoexport/ShapeGeometryExporter.java",
"license": "gpl-2.0",
"size": 15105
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,313,277 |
public String getCommand() {
StringBuilder sb = new StringBuilder();
for (String i : command) {
// redirect stderr to stdout
sb.append(i);
sb.append(" 2>&1");
sb.append('\n');
}
Log.d(RootCommands.TAG, "Sending command(s): " + sb.toString());
return sb.toString();
} | String function() { StringBuilder sb = new StringBuilder(); for (String i : command) { sb.append(i); sb.append(STR); sb.append('\n'); } Log.d(RootCommands.TAG, STR + sb.toString()); return sb.toString(); } | /**
* Gets command string executed on the shell
*
* @return
*/ | Gets command string executed on the shell | getCommand | {
"repo_name": "WtfJoke/Rashr",
"path": "root-commands/src/main/java/org/sufficientlysecure/rootcommands/command/Command.java",
"license": "gpl-3.0",
"size": 5322
} | [
"org.sufficientlysecure.rootcommands.RootCommands",
"org.sufficientlysecure.rootcommands.util.Log"
] | import org.sufficientlysecure.rootcommands.RootCommands; import org.sufficientlysecure.rootcommands.util.Log; | import org.sufficientlysecure.rootcommands.*; import org.sufficientlysecure.rootcommands.util.*; | [
"org.sufficientlysecure.rootcommands"
] | org.sufficientlysecure.rootcommands; | 2,687,510 |
public Object getCompactionMetric(String metricName)
{
try
{
switch(metricName)
{
case "BytesCompacted":
return JMX.newMBeanProxy(mbeanServerConn,
new ObjectName("org.apache.cassandra.metrics:type=Compaction,name=" + metricName),
JmxReporter.CounterMBean.class);
case "CompletedTasks":
case "PendingTasks":
return JMX.newMBeanProxy(mbeanServerConn,
new ObjectName("org.apache.cassandra.metrics:type=Compaction,name=" + metricName),
JmxReporter.GaugeMBean.class).getValue();
case "TotalCompactionsCompleted":
return JMX.newMBeanProxy(mbeanServerConn,
new ObjectName("org.apache.cassandra.metrics:type=Compaction,name=" + metricName),
JmxReporter.MeterMBean.class);
default:
throw new RuntimeException("Unknown compaction metric.");
}
}
catch (MalformedObjectNameException e)
{
throw new RuntimeException(e);
}
} | Object function(String metricName) { try { switch(metricName) { case STR: return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(STR + metricName), JmxReporter.CounterMBean.class); case STR: case STR: return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(STR + metricName), JmxReporter.GaugeMBean.class).getValue(); case STR: return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(STR + metricName), JmxReporter.MeterMBean.class); default: throw new RuntimeException(STR); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } } | /**
* Retrieve Proxy metrics
* @param metricName CompletedTasks, PendingTasks, BytesCompacted or TotalCompactionsCompleted.
*/ | Retrieve Proxy metrics | getCompactionMetric | {
"repo_name": "iburmistrov/Cassandra",
"path": "src/java/org/apache/cassandra/tools/NodeProbe.java",
"license": "apache-2.0",
"size": 50637
} | [
"com.yammer.metrics.reporting.JmxReporter",
"javax.management.JMX",
"javax.management.MalformedObjectNameException",
"javax.management.ObjectName"
] | import com.yammer.metrics.reporting.JmxReporter; import javax.management.JMX; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; | import com.yammer.metrics.reporting.*; import javax.management.*; | [
"com.yammer.metrics",
"javax.management"
] | com.yammer.metrics; javax.management; | 1,148,997 |
private void replaceThemeAttribute(String attributeName, String oldPrefix,
String newPrefix) {
// Find all "attributeName=" which start with "oldPrefix" using e.g.
// [^src='http://oldpath']
NodeList<Element> elements = querySelectorAll("[" + attributeName
+ "^='" + oldPrefix + "']");
for (int i = 0; i < elements.getLength(); i++) {
Element element = elements.getItem(i);
element.setAttribute(
attributeName,
element.getAttribute(attributeName).replace(oldPrefix,
newPrefix));
}
} | void function(String attributeName, String oldPrefix, String newPrefix) { NodeList<Element> elements = querySelectorAll("[" + attributeName + "^='" + oldPrefix + "']"); for (int i = 0; i < elements.getLength(); i++) { Element element = elements.getItem(i); element.setAttribute( attributeName, element.getAttribute(attributeName).replace(oldPrefix, newPrefix)); } } | /**
* Finds any attribute of the given type where theme:// urls have possibly
* been used and replaces any old theme url with a new one
*
* @param attributeName
* The name of the attribute, e.g. "src"
* @param oldPrefix
* The start of the old theme URL
* @param newPrefix
* The start of the new theme URL
*/ | Finds any attribute of the given type where theme:// urls have possibly been used and replaces any old theme url with a new one | replaceThemeAttribute | {
"repo_name": "udayinfy/vaadin",
"path": "client/src/com/vaadin/client/ui/ui/UIConnector.java",
"license": "apache-2.0",
"size": 43468
} | [
"com.google.gwt.dom.client.Element",
"com.google.gwt.dom.client.NodeList"
] | import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NodeList; | import com.google.gwt.dom.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,386,928 |
void send(JmsOutboundMessageDispatch envelope, AsyncResult request) throws IOException, JMSException; | void send(JmsOutboundMessageDispatch envelope, AsyncResult request) throws IOException, JMSException; | /**
* Sends the JmsMessage contained in the outbound dispatch envelope.
*
* @param envelope
* the message envelope containing the JmsMessage to send.
* @param request
* The request object that should be signaled when this operation completes.
*
* @throws IOException if an error occurs or the Provider is already closed.
* @throws JMSException if an error that maps to JMS occurs such as not authorized.
*/ | Sends the JmsMessage contained in the outbound dispatch envelope | send | {
"repo_name": "avranju/qpid-jms",
"path": "qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/Provider.java",
"license": "apache-2.0",
"size": 14970
} | [
"java.io.IOException",
"javax.jms.JMSException",
"org.apache.qpid.jms.message.JmsOutboundMessageDispatch"
] | import java.io.IOException; import javax.jms.JMSException; import org.apache.qpid.jms.message.JmsOutboundMessageDispatch; | import java.io.*; import javax.jms.*; import org.apache.qpid.jms.message.*; | [
"java.io",
"javax.jms",
"org.apache.qpid"
] | java.io; javax.jms; org.apache.qpid; | 738,604 |
public TreeMap getGroupsForSite(){
String siteId = ToolManager.getCurrentPlacement().getContext();
return getGroupsForSite(siteId);
}
| TreeMap function(){ String siteId = ToolManager.getCurrentPlacement().getContext(); return getGroupsForSite(siteId); } | /**
* Returns all groups for site
* @return
*/ | Returns all groups for site | getGroupsForSite | {
"repo_name": "puramshetty/sakai",
"path": "samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/PublishedAssessmentFacadeQueries.java",
"license": "apache-2.0",
"size": 137829
} | [
"java.util.TreeMap",
"org.sakaiproject.tool.cover.ToolManager"
] | import java.util.TreeMap; import org.sakaiproject.tool.cover.ToolManager; | import java.util.*; import org.sakaiproject.tool.cover.*; | [
"java.util",
"org.sakaiproject.tool"
] | java.util; org.sakaiproject.tool; | 1,591,840 |
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return Item.getItemFromBlock(this);
} | Item function(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(this); } | /**
* Get the Item that this Block should drop when harvested.
*/ | Get the Item that this Block should drop when harvested | getItemDropped | {
"repo_name": "aebert1/BigTransport",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/Block.java",
"license": "gpl-3.0",
"size": 115325
} | [
"java.util.Random",
"net.minecraft.block.state.IBlockState",
"net.minecraft.item.Item"
] | import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; | import java.util.*; import net.minecraft.block.state.*; import net.minecraft.item.*; | [
"java.util",
"net.minecraft.block",
"net.minecraft.item"
] | java.util; net.minecraft.block; net.minecraft.item; | 1,530,811 |
ExternalRepositorySyncRevisionService getExternalRepositorySyncRevisionService() throws RepositoryException; | ExternalRepositorySyncRevisionService getExternalRepositorySyncRevisionService() throws RepositoryException; | /**
* Provides access to the ExternalRepositorySyncRevisionService for this repository.
* @return the ExternalRepositorySyncRevisionService for this repository
* @throws RepositoryException
*/ | Provides access to the ExternalRepositorySyncRevisionService for this repository | getExternalRepositorySyncRevisionService | {
"repo_name": "canhnt/hippo-repo-xacml",
"path": "hippo-repository-3.1.x-xacml/engine/src/main/java/org/onehippo/repository/InternalHippoRepository.java",
"license": "apache-2.0",
"size": 1261
} | [
"javax.jcr.RepositoryException",
"org.onehippo.repository.journal.ExternalRepositorySyncRevisionService"
] | import javax.jcr.RepositoryException; import org.onehippo.repository.journal.ExternalRepositorySyncRevisionService; | import javax.jcr.*; import org.onehippo.repository.journal.*; | [
"javax.jcr",
"org.onehippo.repository"
] | javax.jcr; org.onehippo.repository; | 1,257,274 |
public void mouseReleased(MouseEvent e)
{
if (e.getClickCount() == 2) {
if (selectedItemsListbox.isFocusOwner())
removeItem();
}
}
});
IconManager icons = IconManager.getInstance();
addButton = new JButton(icons.getIcon(IconManager.RIGHT_ARROW));
removeButton = new JButton(icons.getIcon(IconManager.LEFT_ARROW));
addAllButton = new JButton(
icons.getIcon(IconManager.DOUBLE_RIGHT_ARROW));
removeAllButton = new JButton(
icons.getIcon(IconManager.DOUBLE_LEFT_ARROW));
addButton.setActionCommand(""+ADD);
addButton.addActionListener(this);
addAllButton.setActionCommand(""+ADD_ALL);
addAllButton.addActionListener(this);
removeButton.setActionCommand(""+REMOVE);
removeButton.addActionListener(this);
removeAllButton.setActionCommand(""+REMOVE_ALL);
removeAllButton.addActionListener(this);
setImmutableElements(null);
} | void function(MouseEvent e) { if (e.getClickCount() == 2) { if (selectedItemsListbox.isFocusOwner()) removeItem(); } } }); IconManager icons = IconManager.getInstance(); addButton = new JButton(icons.getIcon(IconManager.RIGHT_ARROW)); removeButton = new JButton(icons.getIcon(IconManager.LEFT_ARROW)); addAllButton = new JButton( icons.getIcon(IconManager.DOUBLE_RIGHT_ARROW)); removeAllButton = new JButton( icons.getIcon(IconManager.DOUBLE_LEFT_ARROW)); addButton.setActionCommand(STRSTRSTR"+REMOVE_ALL); removeAllButton.addActionListener(this); setImmutableElements(null); } | /**
* Removes the selected elements from the selected list.
* @see MouseListener#mouseReleased(MouseEvent)
*/ | Removes the selected elements from the selected list | mouseReleased | {
"repo_name": "stelfrich/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/SelectionWizardUI.java",
"license": "gpl-2.0",
"size": 52439
} | [
"java.awt.event.MouseEvent",
"javax.swing.JButton",
"org.openmicroscopy.shoola.util.ui.IconManager"
] | import java.awt.event.MouseEvent; import javax.swing.JButton; import org.openmicroscopy.shoola.util.ui.IconManager; | import java.awt.event.*; import javax.swing.*; import org.openmicroscopy.shoola.util.ui.*; | [
"java.awt",
"javax.swing",
"org.openmicroscopy.shoola"
] | java.awt; javax.swing; org.openmicroscopy.shoola; | 1,424,896 |
public ForwardCursor<PK> keys(Transaction txn, CursorConfig config)
throws DatabaseException {
return new JoinForwardCursor<PK>(txn, config, true);
}
private static class Condition {
private Database db;
private DatabaseEntry key;
Condition(Database db, DatabaseEntry key) {
this.db = db;
this.key = key;
} | ForwardCursor<PK> function(Transaction txn, CursorConfig config) throws DatabaseException { return new JoinForwardCursor<PK>(txn, config, true); } private static class Condition { private Database db; private DatabaseEntry key; Condition(Database db, DatabaseEntry key) { this.db = db; this.key = key; } | /**
* Opens a cursor that returns the primary keys of entities qualifying for
* the join. The join operation is performed as the returned cursor is
* accessed.
*
* @param txn the transaction used to protect all operations performed with
* the cursor, or null if the operations should not be transaction
* protected.
*
* @param config the cursor configuration that determines the default lock
* mode used for all cursor operations, or null to implicitly use {@link
* CursorConfig#DEFAULT}.
*
* @return the cursor.
*
* @throws IllegalStateException if less than two conditions were added.
*/ | Opens a cursor that returns the primary keys of entities qualifying for the join. The join operation is performed as the returned cursor is accessed | keys | {
"repo_name": "plast-lab/DelphJ",
"path": "examples/berkeleydb/com/sleepycat/persist/EntityJoin.java",
"license": "mit",
"size": 10830
} | [
"com.sleepycat.je.CursorConfig",
"com.sleepycat.je.Database",
"com.sleepycat.je.DatabaseEntry",
"com.sleepycat.je.DatabaseException",
"com.sleepycat.je.Transaction"
] | import com.sleepycat.je.CursorConfig; import com.sleepycat.je.Database; import com.sleepycat.je.DatabaseEntry; import com.sleepycat.je.DatabaseException; import com.sleepycat.je.Transaction; | import com.sleepycat.je.*; | [
"com.sleepycat.je"
] | com.sleepycat.je; | 1,392,297 |
boolean mayBrowsePortlet(IAuthorizationPrincipal principal, IPortletDefinition portletDefinition); | boolean mayBrowsePortlet(IAuthorizationPrincipal principal, IPortletDefinition portletDefinition); | /**
* Answers whether the given user may browse the portlet marketplace entry for the given portlet definition.
*
* @param principal A non-null IPerson who might be permitted to browse the entry
* @param portletDefinition A non-null portlet definition the Marketplace entry of which the user might browse
* @return true if permitted, false otherwise
* @throws IllegalArgumentException If user is null
* @throws IllegalArgumentException If portletDefinition is null
* @since uPortal 4.1
*/ | Answers whether the given user may browse the portlet marketplace entry for the given portlet definition | mayBrowsePortlet | {
"repo_name": "kole9273/uPortal",
"path": "uportal-war/src/main/java/org/jasig/portal/portlet/marketplace/IMarketplaceService.java",
"license": "apache-2.0",
"size": 4545
} | [
"org.jasig.portal.portlet.om.IPortletDefinition",
"org.jasig.portal.security.IAuthorizationPrincipal"
] | import org.jasig.portal.portlet.om.IPortletDefinition; import org.jasig.portal.security.IAuthorizationPrincipal; | import org.jasig.portal.portlet.om.*; import org.jasig.portal.security.*; | [
"org.jasig.portal"
] | org.jasig.portal; | 721,531 |
private String extractDoc(JsonNode node) {
if (node != null) {
if (node.has(DOC)) {
return node.get(DOC).asText();
} else if (node.has(DESCRIPTION)) {
// This is to support older standards of cwl which use description instead of doc
return node.get(DESCRIPTION).asText();
}
}
return null;
} | String function(JsonNode node) { if (node != null) { if (node.has(DOC)) { return node.get(DOC).asText(); } else if (node.has(DESCRIPTION)) { return node.get(DESCRIPTION).asText(); } } return null; } | /**
* Extract the doc or description from a node
* @param node The node to have the doc/description extracted from
* @return The string for the doc/description of the node
*/ | Extract the doc or description from a node | extractDoc | {
"repo_name": "common-workflow-language/cwlviewer",
"path": "src/main/java/org/commonwl/view/cwl/CWLService.java",
"license": "apache-2.0",
"size": 40945
} | [
"com.fasterxml.jackson.databind.JsonNode"
] | import com.fasterxml.jackson.databind.JsonNode; | import com.fasterxml.jackson.databind.*; | [
"com.fasterxml.jackson"
] | com.fasterxml.jackson; | 2,426,262 |
public void shutdown() {
// -------------------- BEGIN CRITICAL SECTION -------------------
synchronized (lock) {
if (!isShutDown) {
// mark as shutdown and release memory
isShutDown = true;
numNonAllocatedPages = 0;
// go over all allocated segments and release them
for (Set<MemorySegment> segments : allocatedSegments.values()) {
for (MemorySegment seg : segments) {
seg.free();
}
}
memoryPool.clear();
}
}
// -------------------- END CRITICAL SECTION -------------------
} | void function() { synchronized (lock) { if (!isShutDown) { isShutDown = true; numNonAllocatedPages = 0; for (Set<MemorySegment> segments : allocatedSegments.values()) { for (MemorySegment seg : segments) { seg.free(); } } memoryPool.clear(); } } } | /**
* Shuts the memory manager down, trying to release all the memory it managed. Depending
* on implementation details, the memory does not necessarily become reclaimable by the
* garbage collector, because there might still be references to allocated segments in the
* code that allocated them from the memory manager.
*/ | Shuts the memory manager down, trying to release all the memory it managed. Depending on implementation details, the memory does not necessarily become reclaimable by the garbage collector, because there might still be references to allocated segments in the code that allocated them from the memory manager | shutdown | {
"repo_name": "zimmermatt/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/memory/MemoryManager.java",
"license": "apache-2.0",
"size": 23339
} | [
"java.util.Set",
"org.apache.flink.core.memory.MemorySegment"
] | import java.util.Set; import org.apache.flink.core.memory.MemorySegment; | import java.util.*; import org.apache.flink.core.memory.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 2,463,015 |
@Override
protected void process(ClusterDistributionManager dm) {
SearchLoadAndWriteProcessor processor = null;
processor = (SearchLoadAndWriteProcessor) getProcessorKeeper().retrieve(processorId);
if (processor == null) {
if (logger.isDebugEnabled()) {
logger.debug("NetLoadReplyMessage() SearchLoadAndWriteProcessor no longer exists");
}
return;
}
processor.incomingNetLoadReply(this.result, 0, this.aCallbackArgument, this.e,
this.isSerialized, this.requestorTimedOut);
} | void function(ClusterDistributionManager dm) { SearchLoadAndWriteProcessor processor = null; processor = (SearchLoadAndWriteProcessor) getProcessorKeeper().retrieve(processorId); if (processor == null) { if (logger.isDebugEnabled()) { logger.debug(STR); } return; } processor.incomingNetLoadReply(this.result, 0, this.aCallbackArgument, this.e, this.isSerialized, this.requestorTimedOut); } | /**
* Invoked on the receiver - which, in this case, was the initiator of the
* NetLoadRequestMessage. This concludes the net request, by communicating an object value.
*/ | Invoked on the receiver - which, in this case, was the initiator of the NetLoadRequestMessage. This concludes the net request, by communicating an object value | process | {
"repo_name": "davinash/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/SearchLoadAndWriteProcessor.java",
"license": "apache-2.0",
"size": 97036
} | [
"org.apache.geode.distributed.internal.ClusterDistributionManager"
] | import org.apache.geode.distributed.internal.ClusterDistributionManager; | import org.apache.geode.distributed.internal.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,746,780 |
public ISphinxClient getDelegate() {
if (delegate == null) throw new IllegalStateException("The underlying sphinx client has been closed.");
return delegate;
} | ISphinxClient function() { if (delegate == null) throw new IllegalStateException(STR); return delegate; } | /**
* Returns the underlying sphinx client instance wrapped by this proxy instance. This method will
* throw an exception if the client has been closed and returned to the pool.
*
* @return wrapped client instance
* @throws IllegalStateException if client is closed
*/ | Returns the underlying sphinx client instance wrapped by this proxy instance. This method will throw an exception if the client has been closed and returned to the pool | getDelegate | {
"repo_name": "bcowdery/sphinx-api-pool",
"path": "src/main/java/org/sphinx/pool/SphinxClientProxy.java",
"license": "mit",
"size": 8885
} | [
"org.sphinx.api.ISphinxClient"
] | import org.sphinx.api.ISphinxClient; | import org.sphinx.api.*; | [
"org.sphinx.api"
] | org.sphinx.api; | 2,105,631 |
private Map<String, BigdataURIImpl> getXSDMap() {
final Map<String, BigdataURIImpl> map = new LinkedHashMap<String, BigdataURIImpl>();
final BigdataURIImpl[] a = new BigdataURIImpl[] { xsd_string,
xsd_dateTime, xsd_date, xsd_long, xsd_int, xsd_byte, xsd_short,
xsd_double, xsd_float, xsd_boolean };
for (BigdataURIImpl x : a) {
// stringValue of URI => URI
map.put(x.stringValue(), x);
}
return map;
}
/**
* {@inheritDoc} | Map<String, BigdataURIImpl> function() { final Map<String, BigdataURIImpl> map = new LinkedHashMap<String, BigdataURIImpl>(); final BigdataURIImpl[] a = new BigdataURIImpl[] { xsd_string, xsd_dateTime, xsd_date, xsd_long, xsd_int, xsd_byte, xsd_short, xsd_double, xsd_float, xsd_boolean }; for (BigdataURIImpl x : a) { map.put(x.stringValue(), x); } return map; } /** * {@inheritDoc} | /**
* Populate and return a map for fast resolution of XSD URIs.
*/ | Populate and return a map for fast resolution of XSD URIs | getXSDMap | {
"repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes",
"path": "bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java",
"license": "gpl-2.0",
"size": 20758
} | [
"java.util.LinkedHashMap",
"java.util.Map"
] | import java.util.LinkedHashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,252,130 |
public E sample(Random rand) {
double total = totalCount();
if (total <= 0.0) {
throw new RuntimeException(String.format(
"Attempting to sample() with totalCount() %.3f\n", total));
}
double sum = 0.0;
double r = rand.nextDouble();
for (Map.Entry<E, Double> entry : entries.entrySet()) {
double count = entry.getValue();
double frac = count / total;
sum += frac;
if (r < sum) {
return entry.getKey();
}
}
throw new IllegalStateException("Shoudl've have returned a sample by now....");
} | E function(Random rand) { double total = totalCount(); if (total <= 0.0) { throw new RuntimeException(String.format( STR, total)); } double sum = 0.0; double r = rand.nextDouble(); for (Map.Entry<E, Double> entry : entries.entrySet()) { double count = entry.getValue(); double frac = count / total; sum += frac; if (r < sum) { return entry.getKey(); } } throw new IllegalStateException(STR); } | /**
* Will return a sample from the counter, will throw exception if any of the
* counts are < 0.0 or if the totalCount() <= 0.0
*
* @return
*
* @author aria42
*/ | Will return a sample from the counter, will throw exception if any of the counts are < 0.0 or if the totalCount() <= 0.0 | sample | {
"repo_name": "jpatanooga/Metronome",
"path": "src/main/java/tv/floe/metronome/berkley/Counter.java",
"license": "apache-2.0",
"size": 14013
} | [
"java.util.Map",
"java.util.Random"
] | import java.util.Map; import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 424,905 |
public Dimension getPreferredSize()
{
return new Dimension(350,400);
} | Dimension function() { return new Dimension(350,400); } | /**
* Returns the desired size of the display, for use by layout manager.
* @return preferred size
*/ | Returns the desired size of the display, for use by layout manager | getPreferredSize | {
"repo_name": "fazerlicourice7/botWorld",
"path": "RatBots16_0/src/gui/RatBotsScoreBoard.java",
"license": "gpl-3.0",
"size": 8644
} | [
"java.awt.Dimension"
] | import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,792,047 |
@Override
@SafeVarargs
public final PCollectionContentsAssert<T> containsInAnyOrder(T... expectedElements) {
return containsInAnyOrder(Arrays.asList(expectedElements));
} | final PCollectionContentsAssert<T> function(T... expectedElements) { return containsInAnyOrder(Arrays.asList(expectedElements)); } | /**
* Checks that the {@code Iterable} contains the expected elements, in any order.
*
* <p>Returns this {@code IterableAssert}.
*/ | Checks that the Iterable contains the expected elements, in any order. Returns this IterableAssert | containsInAnyOrder | {
"repo_name": "eljefe6a/incubator-beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/testing/PAssert.java",
"license": "apache-2.0",
"size": 58752
} | [
"java.util.Arrays",
"org.hamcrest.Matchers"
] | import java.util.Arrays; import org.hamcrest.Matchers; | import java.util.*; import org.hamcrest.*; | [
"java.util",
"org.hamcrest"
] | java.util; org.hamcrest; | 2,396,167 |
public StorageAccountUpdateParameters withSku(SkuInner sku) {
this.sku = sku;
return this;
} | StorageAccountUpdateParameters function(SkuInner sku) { this.sku = sku; return this; } | /**
* Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value.
*
* @param sku the sku value to set
* @return the StorageAccountUpdateParameters object itself.
*/ | Set gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value | withSku | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java",
"license": "mit",
"size": 14066
} | [
"com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner"
] | import com.microsoft.azure.management.storage.v2019_04_01.implementation.SkuInner; | import com.microsoft.azure.management.storage.v2019_04_01.implementation.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,286,021 |
public static Element toXML(Document doc, AbstractConfigurator<? extends Configurable> configurator,
Configurable configurable) {
Element element = doc.createElement(configurator.getTypeId());
element.setAttribute("name", configurable.getName());
if (configurable.getId() != -1) {
element.setAttribute("id", String.valueOf(configurable.getId()));
}
String source = getSourceNameForConfigurable(configurable);
if (permittedGroups != null && permittedGroups.get(configurable.getTypeId()) != null && permittedGroups
.get(configurable.getTypeId()).get(new ComparablePair<>(configurable.getName(), source)) != null) {
Element permittedGroupsElement = doc.createElement("permittedGroups");
Set<String> configPermittedGroups = permittedGroups.get(configurable.getTypeId())
.get(new ComparablePair<>(configurable.getName(), source));
for (String group : configPermittedGroups) {
Element valueElement = doc.createElement("value");
valueElement.appendChild(doc.createTextNode(group));
permittedGroupsElement.appendChild(valueElement);
}
element.appendChild(permittedGroupsElement);
}
for (Entry<String, String> param : configurable.getParameters().entrySet()) {
String key = param.getKey();
String value = null;
// if we use AbstractConfigurables, do not use the method which converts parameters to
// non-xml form here, otherwise passwords would be saved in plaintext
if (configurable instanceof AbstractConfigurable) {
value = ((AbstractConfigurable) configurable).getParameterAsXMLString(key);
} else {
value = configurable.getParameter(key);
}
// skip null values on save
if (value == null) {
continue;
}
Element paramElement = doc.createElement(key);
paramElement.appendChild(doc.createTextNode(value)); // This escapes the value
element.appendChild(paramElement);
}
return element;
}
/**
* Returns the xml representation of the registered configurables by using the given old key to
* decrypt the information and the specified new key to encrypt the information.
*
* @param configurator
* @param onlyLocal
* @param decryptKey
* {@link Key} used to decrypt the configurable values
* @param encryptKey
* {@link Key} which should be used to encrypt them in the returned xml
* @deprecated Use
* {@link #getConfigurablesAsXMLAndChangeEncryption(AbstractConfigurator, boolean, Key, Key)} | static Element function(Document doc, AbstractConfigurator<? extends Configurable> configurator, Configurable configurable) { Element element = doc.createElement(configurator.getTypeId()); element.setAttribute("name", configurable.getName()); if (configurable.getId() != -1) { element.setAttribute("id", String.valueOf(configurable.getId())); } String source = getSourceNameForConfigurable(configurable); if (permittedGroups != null && permittedGroups.get(configurable.getTypeId()) != null && permittedGroups .get(configurable.getTypeId()).get(new ComparablePair<>(configurable.getName(), source)) != null) { Element permittedGroupsElement = doc.createElement(STR); Set<String> configPermittedGroups = permittedGroups.get(configurable.getTypeId()) .get(new ComparablePair<>(configurable.getName(), source)); for (String group : configPermittedGroups) { Element valueElement = doc.createElement("value"); valueElement.appendChild(doc.createTextNode(group)); permittedGroupsElement.appendChild(valueElement); } element.appendChild(permittedGroupsElement); } for (Entry<String, String> param : configurable.getParameters().entrySet()) { String key = param.getKey(); String value = null; if (configurable instanceof AbstractConfigurable) { value = ((AbstractConfigurable) configurable).getParameterAsXMLString(key); } else { value = configurable.getParameter(key); } if (value == null) { continue; } Element paramElement = doc.createElement(key); paramElement.appendChild(doc.createTextNode(value)); element.appendChild(paramElement); } return element; } /** * Returns the xml representation of the registered configurables by using the given old key to * decrypt the information and the specified new key to encrypt the information. * * @param configurator * @param onlyLocal * @param decryptKey * {@link Key} used to decrypt the configurable values * @param encryptKey * {@link Key} which should be used to encrypt them in the returned xml * @deprecated Use * {@link #getConfigurablesAsXMLAndChangeEncryption(AbstractConfigurator, boolean, Key, Key)} | /**
* Creates an XML-element where the tag name equals {@link Configurator#getTypeId()}. This tag
* has name and id attributes corresponding to {@link Configurable#getName()} and
* {@link Configurable#getId()}. The parameters are encoded as tags whose name matches
* {@link ParameterType#getKey()} and the text-contents of these tags matches the parameter
* value.
*
* @since 6.2.0
*/ | Creates an XML-element where the tag name equals <code>Configurator#getTypeId()</code>. This tag has name and id attributes corresponding to <code>Configurable#getName()</code> and <code>Configurable#getId()</code>. The parameters are encoded as tags whose name matches <code>ParameterType#getKey()</code> and the text-contents of these tags matches the parameter value | toXML | {
"repo_name": "boob-sbcm/3838438",
"path": "src/main/java/com/rapidminer/tools/config/ConfigurationManager.java",
"license": "agpl-3.0",
"size": 46118
} | [
"com.rapidminer.tools.container.ComparablePair",
"java.security.Key",
"java.util.Map",
"java.util.Set",
"org.w3c.dom.Document",
"org.w3c.dom.Element"
] | import com.rapidminer.tools.container.ComparablePair; import java.security.Key; import java.util.Map; import java.util.Set; import org.w3c.dom.Document; import org.w3c.dom.Element; | import com.rapidminer.tools.container.*; import java.security.*; import java.util.*; import org.w3c.dom.*; | [
"com.rapidminer.tools",
"java.security",
"java.util",
"org.w3c.dom"
] | com.rapidminer.tools; java.security; java.util; org.w3c.dom; | 1,511,659 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.