method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public void testMapOfMapSerialization() {
Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>>();
Map<String, String> nestedMap = new HashMap<String, String>();
nestedMap.put("1", "1");
nestedMap.put("2", "2");
map.put("nestedMap", nestedMap);
String json = gson.toJson(map);
assertTrue(json.contains("nestedMap"));
assertTrue(json.contains("\"1\":\"1\""));
assertTrue(json.contains("\"2\":\"2\""));
}
|
void function() { Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>>(); Map<String, String> nestedMap = new HashMap<String, String>(); nestedMap.put("1", "1"); nestedMap.put("2", "2"); map.put(STR, nestedMap); String json = gson.toJson(map); assertTrue(json.contains(STR)); assertTrue(json.contains("\"1\":\"1\STR\"2\":\"2\"")); }
|
/**
* From bug report http://code.google.com/p/google-gson/issues/detail?id=95
*/
|
From bug report HREF
|
testMapOfMapSerialization
|
{
"repo_name": "jjrobinson/Reddit-DailyProgrammer",
"path": "lib/GSON/gson/src/gson/src/test/java/com/google/gson/functional/MapTest.java",
"license": "apache-2.0",
"size": 22450
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 595,643
|
void removeStorageDir(File dir) {
Iterator<StorageDirectory> it = dirIterator();
while (it.hasNext()) {
StorageDirectory sd = it.next();
if (sd.getRoot().getPath().equals(dir.getPath())) {
try {
sd.unlock(); // Try to unlock before removing (in case it is restored)
} catch (Exception e) {
// Ignore
}
updateRemovedDirs(sd, null);
it.remove();
}
}
}
|
void removeStorageDir(File dir) { Iterator<StorageDirectory> it = dirIterator(); while (it.hasNext()) { StorageDirectory sd = it.next(); if (sd.getRoot().getPath().equals(dir.getPath())) { try { sd.unlock(); } catch (Exception e) { } updateRemovedDirs(sd, null); it.remove(); } } }
|
/**
* Remove the given storage directory.
*/
|
Remove the given storage directory
|
removeStorageDir
|
{
"repo_name": "koven2049/hdfs-cloudera-cdh3u3-production",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImage.java",
"license": "apache-2.0",
"size": 64491
}
|
[
"java.io.File",
"java.util.Iterator"
] |
import java.io.File; import java.util.Iterator;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,176,864
|
public StringBuilderWrapper andSome(Collection<?> collection) {
Null.check(collection).ifAny("Collection cannot be null");
collection.forEach(builder::append);
return this;
}
|
StringBuilderWrapper function(Collection<?> collection) { Null.check(collection).ifAny(STR); collection.forEach(builder::append); return this; }
|
/**
* Appends all the objects in the collection, one after another, to the wrapped StringBuilder
* @throws NullPointerException if collection is null (NOT if it contains null, that is allowed)
*/
|
Appends all the objects in the collection, one after another, to the wrapped StringBuilder
|
andSome
|
{
"repo_name": "TheGoodlike13/goodlike-utils",
"path": "src/main/java/eu/goodlike/str/impl/str/StringBuilderWrapper.java",
"license": "unlicense",
"size": 7908
}
|
[
"eu.goodlike.neat.Null",
"java.util.Collection"
] |
import eu.goodlike.neat.Null; import java.util.Collection;
|
import eu.goodlike.neat.*; import java.util.*;
|
[
"eu.goodlike.neat",
"java.util"
] |
eu.goodlike.neat; java.util;
| 1,764,813
|
public boolean isMixin( Name nodeTypeName ) {
return unmodifiableMixinTypeNames.contains(nodeTypeName);
}
|
boolean function( Name nodeTypeName ) { return unmodifiableMixinTypeNames.contains(nodeTypeName); }
|
/**
* Determine whether the node type given by the supplied name is a mixin node type.
*
* @param nodeTypeName the name of the node type
* @return true if there is an existing mixin node type with the supplied name, or false otherwise
*/
|
Determine whether the node type given by the supplied name is a mixin node type
|
isMixin
|
{
"repo_name": "flownclouds/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java",
"license": "apache-2.0",
"size": 162947
}
|
[
"org.modeshape.jcr.value.Name"
] |
import org.modeshape.jcr.value.Name;
|
import org.modeshape.jcr.value.*;
|
[
"org.modeshape.jcr"
] |
org.modeshape.jcr;
| 1,044,939
|
public static JPanel createDemoPanel() {
JFreeChart chart = createChart(createDataset());
ChartPanel panel = new ChartPanel(chart);
panel.setMouseWheelEnabled(true);
return panel;
}
|
static JPanel function() { JFreeChart chart = createChart(createDataset()); ChartPanel panel = new ChartPanel(chart); panel.setMouseWheelEnabled(true); return panel; }
|
/**
* Creates a panel for the demo (used by SuperDemo.java).
*
* @return A panel.
*/
|
Creates a panel for the demo (used by SuperDemo.java)
|
createDemoPanel
|
{
"repo_name": "greearb/jfreechart-fse-ct",
"path": "src/main/java/org/jfree/chart/demo/PieChartDemo1.java",
"license": "lgpl-2.1",
"size": 4797
}
|
[
"javax.swing.JPanel",
"org.jfree.chart.ChartPanel",
"org.jfree.chart.JFreeChart"
] |
import javax.swing.JPanel; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart;
|
import javax.swing.*; import org.jfree.chart.*;
|
[
"javax.swing",
"org.jfree.chart"
] |
javax.swing; org.jfree.chart;
| 373,584
|
@Override
public HyperlinkType getTypeEnum() {
return _type;
}
|
HyperlinkType function() { return _type; }
|
/**
* Return the type of this hyperlink
*
* @return the type of this hyperlink
*/
|
Return the type of this hyperlink
|
getTypeEnum
|
{
"repo_name": "lvweiwolf/poi-3.16",
"path": "src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFHyperlink.java",
"license": "apache-2.0",
"size": 12950
}
|
[
"org.apache.poi.common.usermodel.HyperlinkType"
] |
import org.apache.poi.common.usermodel.HyperlinkType;
|
import org.apache.poi.common.usermodel.*;
|
[
"org.apache.poi"
] |
org.apache.poi;
| 406,074
|
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
XAnnotationsPackage theXAnnotationsPackage = (XAnnotationsPackage)EPackage.Registry.INSTANCE.getEPackage(XAnnotationsPackage.eNS_URI);
TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI);
XbasePackage theXbasePackage = (XbasePackage)EPackage.Registry.INSTANCE.getEPackage(XbasePackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
lCommonModelEClass.getESuperTypes().add(this.getLLazyResolver());
lPackageEClass.getESuperTypes().add(this.getLLazyResolver());
lTypedPackageEClass.getESuperTypes().add(this.getLPackage());
lTypeEClass.getESuperTypes().add(this.getLAnnotationTarget());
lAnnotationDefEClass.getESuperTypes().add(this.getLLazyResolver());
lAnnotationTargetEClass.getESuperTypes().add(this.getLLazyResolver());
lScalarTypeEClass.getESuperTypes().add(this.getLType());
lDataTypeEClass.getESuperTypes().add(this.getLScalarType());
lEnumEClass.getESuperTypes().add(this.getLScalarType());
lEnumLiteralEClass.getESuperTypes().add(this.getLLazyResolver());
lClassEClass.getESuperTypes().add(this.getLType());
lFeatureEClass.getESuperTypes().add(this.getLAnnotationTarget());
lReferenceEClass.getESuperTypes().add(this.getLFeature());
lAttributeEClass.getESuperTypes().add(this.getLFeature());
lOperationEClass.getESuperTypes().add(this.getLAnnotationTarget());
lModifierEClass.getESuperTypes().add(this.getLLazyResolver());
// Initialize classes, features, and operations; add parameters
initEClass(lCommonModelEClass, LCommonModel.class, "LCommonModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLCommonModel_Packages(), this.getLTypedPackage(), null, "packages", null, 0, -1, LCommonModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lLazyResolverEClass, LLazyResolver.class, "LLazyResolver", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
EOperation op = initEOperation(getLLazyResolver__EResolveProxy__InternalEObject(), theEcorePackage.getEObject(), "eResolveProxy", 0, 1, !IS_UNIQUE, IS_ORDERED);
addEParameter(op, this.getInternalEObject(), "proxy", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEClass(lPackageEClass, LPackage.class, "LPackage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLPackage_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLPackage_Imports(), this.getLImport(), null, "imports", null, 0, -1, LPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lTypedPackageEClass, LTypedPackage.class, "LTypedPackage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLTypedPackage_Types(), this.getLType(), null, "types", null, 0, -1, LTypedPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lImportEClass, LImport.class, "LImport", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLImport_ImportedNamespace(), theEcorePackage.getEString(), "importedNamespace", null, 0, 1, LImport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lTypeEClass, LType.class, "LType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLType_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLType_AnnotationInfo(), this.getLAnnotationTarget(), null, "annotationInfo", null, 0, 1, LType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEOperation(getLType__GetResolvedAnnotations(), this.getAnnotationList(), "getResolvedAnnotations", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEClass(lAnnotationDefEClass, LAnnotationDef.class, "LAnnotationDef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLAnnotationDef_Exclude(), theEcorePackage.getEBoolean(), "exclude", null, 0, 1, LAnnotationDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLAnnotationDef_Annotation(), theXAnnotationsPackage.getXAnnotation(), null, "annotation", null, 0, 1, LAnnotationDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lAnnotationTargetEClass, LAnnotationTarget.class, "LAnnotationTarget", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLAnnotationTarget_Annotations(), this.getLAnnotationDef(), null, "annotations", null, 0, -1, LAnnotationTarget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lScalarTypeEClass, LScalarType.class, "LScalarType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(lDataTypeEClass, LDataType.class, "LDataType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLDataType_JvmTypeReference(), theTypesPackage.getJvmTypeReference(), null, "jvmTypeReference", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_AsPrimitive(), theEcorePackage.getEBoolean(), "asPrimitive", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_Date(), theEcorePackage.getEBoolean(), "date", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_AsBlob(), theEcorePackage.getEBoolean(), "asBlob", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_Length(), theEcorePackage.getEInt(), "length", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_DateType(), this.getLDateType(), "dateType", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_SyntheticFlag(), theEcorePackage.getEBoolean(), "syntheticFlag", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLDataType_SyntheticSelector(), theEcorePackage.getEString(), "syntheticSelector", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLDataType_SyntheticTypeReference(), this.getLFeature(), null, "syntheticTypeReference", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLDataType_SyntheticType(), this.getLType(), null, "syntheticType", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lEnumEClass, LEnum.class, "LEnum", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLEnum_Literals(), this.getLEnumLiteral(), null, "literals", null, 0, -1, LEnum.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lEnumLiteralEClass, LEnumLiteral.class, "LEnumLiteral", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLEnumLiteral_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LEnumLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lClassEClass, LClass.class, "LClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLClass_Abstract(), theEcorePackage.getEBoolean(), "abstract", null, 0, 1, LClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLClass_Serializable(), theEcorePackage.getEBoolean(), "serializable", null, 0, 1, LClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLClass_ShortName(), theEcorePackage.getEString(), "shortName", null, 0, 1, LClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lFeaturesHolderEClass, LFeaturesHolder.class, "LFeaturesHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEOperation(getLFeaturesHolder__GetFeatures(), this.getFeaturesList(), "getFeatures", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEOperation(getLFeaturesHolder__GetAllFeatures(), this.getFeaturesList(), "getAllFeatures", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEClass(lFeatureEClass, LFeature.class, "LFeature", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLFeature_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLFeature_Multiplicity(), this.getLMultiplicity(), null, "multiplicity", null, 0, 1, LFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLFeature_AnnotationInfo(), this.getLAnnotationTarget(), null, "annotationInfo", null, 0, 1, LFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEOperation(getLFeature__GetResolvedAnnotations(), this.getAnnotationList(), "getResolvedAnnotations", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEClass(lReferenceEClass, LReference.class, "LReference", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLReference_Lazy(), theEcorePackage.getEBoolean(), "lazy", null, 0, 1, LReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLReference_Cascading(), theEcorePackage.getEBoolean(), "cascading", null, 0, 1, LReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lAttributeEClass, LAttribute.class, "LAttribute", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLAttribute_Id(), theEcorePackage.getEBoolean(), "id", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_Uuid(), theEcorePackage.getEBoolean(), "uuid", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_Version(), theEcorePackage.getEBoolean(), "version", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_Lazy(), theEcorePackage.getEBoolean(), "lazy", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_Cascading(), theEcorePackage.getEBoolean(), "cascading", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_Transient(), theEcorePackage.getEBoolean(), "transient", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_Derived(), theEcorePackage.getEBoolean(), "derived", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_DomainKey(), theEcorePackage.getEBoolean(), "domainKey", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLAttribute_DomainDescription(), theEcorePackage.getEBoolean(), "domainDescription", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLAttribute_DerivedGetterExpression(), theXbasePackage.getXExpression(), null, "derivedGetterExpression", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLAttribute_Type(), this.getLScalarType(), null, "type", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lOperationEClass, LOperation.class, "LOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLOperation_Modifier(), this.getLModifier(), null, "modifier", null, 0, 1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLOperation_Type(), theTypesPackage.getJvmTypeReference(), null, "type", null, 0, 1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLOperation_Params(), theTypesPackage.getJvmFormalParameter(), null, "params", null, 0, -1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLOperation_Body(), theXbasePackage.getXExpression(), null, "body", null, 0, 1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEOperation(getLOperation__GetResolvedAnnotations(), this.getAnnotationList(), "getResolvedAnnotations", 0, 1, !IS_UNIQUE, IS_ORDERED);
initEClass(lModifierEClass, LModifier.class, "LModifier", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLModifier_Final(), theEcorePackage.getEBoolean(), "final", null, 0, 1, LModifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLModifier_Static(), theEcorePackage.getEBoolean(), "static", null, 0, 1, LModifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLModifier_Visibility(), this.getLVisibility(), "visibility", null, 0, 1, LModifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(lMultiplicityEClass, LMultiplicity.class, "LMultiplicity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLMultiplicity_Lower(), this.getLLowerBound(), "lower", null, 0, 1, LMultiplicity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLMultiplicity_Upper(), this.getLUpperBound(), "upper", null, 0, 1, LMultiplicity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLMultiplicity_ToMultiplicityString(), theEcorePackage.getEString(), "toMultiplicityString", null, 0, 1, LMultiplicity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED);
// Initialize enums and add enum literals
initEEnum(lDateTypeEEnum, LDateType.class, "LDateType");
addEEnumLiteral(lDateTypeEEnum, LDateType.DATE);
addEEnumLiteral(lDateTypeEEnum, LDateType.TIME);
addEEnumLiteral(lDateTypeEEnum, LDateType.TIMESTAMP);
initEEnum(lVisibilityEEnum, LVisibility.class, "LVisibility");
addEEnumLiteral(lVisibilityEEnum, LVisibility.PACKAGE);
addEEnumLiteral(lVisibilityEEnum, LVisibility.PRIVATE);
addEEnumLiteral(lVisibilityEEnum, LVisibility.PROTECTED);
addEEnumLiteral(lVisibilityEEnum, LVisibility.PUBLIC);
initEEnum(lLowerBoundEEnum, LLowerBound.class, "LLowerBound");
addEEnumLiteral(lLowerBoundEEnum, LLowerBound.NULL);
addEEnumLiteral(lLowerBoundEEnum, LLowerBound.MANY);
addEEnumLiteral(lLowerBoundEEnum, LLowerBound.OPTIONAL);
addEEnumLiteral(lLowerBoundEEnum, LLowerBound.ATLEASTONE);
addEEnumLiteral(lLowerBoundEEnum, LLowerBound.ZERO);
addEEnumLiteral(lLowerBoundEEnum, LLowerBound.ONE);
initEEnum(lUpperBoundEEnum, LUpperBound.class, "LUpperBound");
addEEnumLiteral(lUpperBoundEEnum, LUpperBound.NULL);
addEEnumLiteral(lUpperBoundEEnum, LUpperBound.MANY);
addEEnumLiteral(lUpperBoundEEnum, LUpperBound.ONE);
// Initialize data types
initEDataType(operationsListEDataType, List.class, "OperationsList", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, "java.util.List<org.lunifera.dsl.semantic.common.types.LOperation>");
initEDataType(featuresListEDataType, List.class, "FeaturesList", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, "java.util.List<? extends org.lunifera.dsl.semantic.common.types.LFeature>");
initEDataType(annotationListEDataType, EList.class, "AnnotationList", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, "org.eclipse.emf.common.util.EList<org.lunifera.dsl.semantic.common.types.LAnnotationDef>");
initEDataType(internalEObjectEDataType, InternalEObject.class, "InternalEObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
// Create annotations
// http://www.eclipse.org/emf/2002/Ecore
createEcoreAnnotations();
}
|
void function() { if (isInitialized) return; isInitialized = true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); XAnnotationsPackage theXAnnotationsPackage = (XAnnotationsPackage)EPackage.Registry.INSTANCE.getEPackage(XAnnotationsPackage.eNS_URI); TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); XbasePackage theXbasePackage = (XbasePackage)EPackage.Registry.INSTANCE.getEPackage(XbasePackage.eNS_URI); lCommonModelEClass.getESuperTypes().add(this.getLLazyResolver()); lPackageEClass.getESuperTypes().add(this.getLLazyResolver()); lTypedPackageEClass.getESuperTypes().add(this.getLPackage()); lTypeEClass.getESuperTypes().add(this.getLAnnotationTarget()); lAnnotationDefEClass.getESuperTypes().add(this.getLLazyResolver()); lAnnotationTargetEClass.getESuperTypes().add(this.getLLazyResolver()); lScalarTypeEClass.getESuperTypes().add(this.getLType()); lDataTypeEClass.getESuperTypes().add(this.getLScalarType()); lEnumEClass.getESuperTypes().add(this.getLScalarType()); lEnumLiteralEClass.getESuperTypes().add(this.getLLazyResolver()); lClassEClass.getESuperTypes().add(this.getLType()); lFeatureEClass.getESuperTypes().add(this.getLAnnotationTarget()); lReferenceEClass.getESuperTypes().add(this.getLFeature()); lAttributeEClass.getESuperTypes().add(this.getLFeature()); lOperationEClass.getESuperTypes().add(this.getLAnnotationTarget()); lModifierEClass.getESuperTypes().add(this.getLLazyResolver()); initEClass(lCommonModelEClass, LCommonModel.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLCommonModel_Packages(), this.getLTypedPackage(), null, STR, null, 0, -1, LCommonModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lLazyResolverEClass, LLazyResolver.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); EOperation op = initEOperation(getLLazyResolver__EResolveProxy__InternalEObject(), theEcorePackage.getEObject(), STR, 0, 1, !IS_UNIQUE, IS_ORDERED); addEParameter(op, this.getInternalEObject(), "proxy", 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(lPackageEClass, LPackage.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLPackage_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLPackage_Imports(), this.getLImport(), null, STR, null, 0, -1, LPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lTypedPackageEClass, LTypedPackage.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLTypedPackage_Types(), this.getLType(), null, "types", null, 0, -1, LTypedPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lImportEClass, LImport.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLImport_ImportedNamespace(), theEcorePackage.getEString(), STR, null, 0, 1, LImport.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lTypeEClass, LType.class, "LType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLType_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLType_AnnotationInfo(), this.getLAnnotationTarget(), null, STR, null, 0, 1, LType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation(getLType__GetResolvedAnnotations(), this.getAnnotationList(), STR, 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(lAnnotationDefEClass, LAnnotationDef.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLAnnotationDef_Exclude(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAnnotationDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLAnnotationDef_Annotation(), theXAnnotationsPackage.getXAnnotation(), null, STR, null, 0, 1, LAnnotationDef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lAnnotationTargetEClass, LAnnotationTarget.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLAnnotationTarget_Annotations(), this.getLAnnotationDef(), null, STR, null, 0, -1, LAnnotationTarget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lScalarTypeEClass, LScalarType.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(lDataTypeEClass, LDataType.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLDataType_JvmTypeReference(), theTypesPackage.getJvmTypeReference(), null, STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_AsPrimitive(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_Date(), theEcorePackage.getEBoolean(), "date", null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_AsBlob(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_Length(), theEcorePackage.getEInt(), STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_DateType(), this.getLDateType(), STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_SyntheticFlag(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLDataType_SyntheticSelector(), theEcorePackage.getEString(), STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLDataType_SyntheticTypeReference(), this.getLFeature(), null, STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLDataType_SyntheticType(), this.getLType(), null, STR, null, 0, 1, LDataType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lEnumEClass, LEnum.class, "LEnum", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLEnum_Literals(), this.getLEnumLiteral(), null, STR, null, 0, -1, LEnum.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lEnumLiteralEClass, LEnumLiteral.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLEnumLiteral_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LEnumLiteral.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lClassEClass, LClass.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLClass_Abstract(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLClass_Serializable(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLClass_ShortName(), theEcorePackage.getEString(), STR, null, 0, 1, LClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lFeaturesHolderEClass, LFeaturesHolder.class, STR, IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEOperation(getLFeaturesHolder__GetFeatures(), this.getFeaturesList(), STR, 0, 1, !IS_UNIQUE, IS_ORDERED); initEOperation(getLFeaturesHolder__GetAllFeatures(), this.getFeaturesList(), STR, 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(lFeatureEClass, LFeature.class, STR, IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLFeature_Name(), theEcorePackage.getEString(), "name", null, 0, 1, LFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLFeature_Multiplicity(), this.getLMultiplicity(), null, STR, null, 0, 1, LFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLFeature_AnnotationInfo(), this.getLAnnotationTarget(), null, STR, null, 0, 1, LFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation(getLFeature__GetResolvedAnnotations(), this.getAnnotationList(), STR, 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(lReferenceEClass, LReference.class, STR, IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLReference_Lazy(), theEcorePackage.getEBoolean(), "lazy", null, 0, 1, LReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLReference_Cascading(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lAttributeEClass, LAttribute.class, STR, IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLAttribute_Id(), theEcorePackage.getEBoolean(), "id", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_Uuid(), theEcorePackage.getEBoolean(), "uuid", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_Version(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_Lazy(), theEcorePackage.getEBoolean(), "lazy", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_Cascading(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_Transient(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_Derived(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_DomainKey(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLAttribute_DomainDescription(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLAttribute_DerivedGetterExpression(), theXbasePackage.getXExpression(), null, STR, null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLAttribute_Type(), this.getLScalarType(), null, "type", null, 0, 1, LAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lOperationEClass, LOperation.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getLOperation_Modifier(), this.getLModifier(), null, STR, null, 0, 1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLOperation_Type(), theTypesPackage.getJvmTypeReference(), null, "type", null, 0, 1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLOperation_Params(), theTypesPackage.getJvmFormalParameter(), null, STR, null, 0, -1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLOperation_Body(), theXbasePackage.getXExpression(), null, "body", null, 0, 1, LOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEOperation(getLOperation__GetResolvedAnnotations(), this.getAnnotationList(), STR, 0, 1, !IS_UNIQUE, IS_ORDERED); initEClass(lModifierEClass, LModifier.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLModifier_Final(), theEcorePackage.getEBoolean(), "final", null, 0, 1, LModifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLModifier_Static(), theEcorePackage.getEBoolean(), STR, null, 0, 1, LModifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLModifier_Visibility(), this.getLVisibility(), STR, null, 0, 1, LModifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(lMultiplicityEClass, LMultiplicity.class, STR, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getLMultiplicity_Lower(), this.getLLowerBound(), "lower", null, 0, 1, LMultiplicity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLMultiplicity_Upper(), this.getLUpperBound(), "upper", null, 0, 1, LMultiplicity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLMultiplicity_ToMultiplicityString(), theEcorePackage.getEString(), STR, null, 0, 1, LMultiplicity.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEEnum(lDateTypeEEnum, LDateType.class, STR); addEEnumLiteral(lDateTypeEEnum, LDateType.DATE); addEEnumLiteral(lDateTypeEEnum, LDateType.TIME); addEEnumLiteral(lDateTypeEEnum, LDateType.TIMESTAMP); initEEnum(lVisibilityEEnum, LVisibility.class, STR); addEEnumLiteral(lVisibilityEEnum, LVisibility.PACKAGE); addEEnumLiteral(lVisibilityEEnum, LVisibility.PRIVATE); addEEnumLiteral(lVisibilityEEnum, LVisibility.PROTECTED); addEEnumLiteral(lVisibilityEEnum, LVisibility.PUBLIC); initEEnum(lLowerBoundEEnum, LLowerBound.class, STR); addEEnumLiteral(lLowerBoundEEnum, LLowerBound.NULL); addEEnumLiteral(lLowerBoundEEnum, LLowerBound.MANY); addEEnumLiteral(lLowerBoundEEnum, LLowerBound.OPTIONAL); addEEnumLiteral(lLowerBoundEEnum, LLowerBound.ATLEASTONE); addEEnumLiteral(lLowerBoundEEnum, LLowerBound.ZERO); addEEnumLiteral(lLowerBoundEEnum, LLowerBound.ONE); initEEnum(lUpperBoundEEnum, LUpperBound.class, STR); addEEnumLiteral(lUpperBoundEEnum, LUpperBound.NULL); addEEnumLiteral(lUpperBoundEEnum, LUpperBound.MANY); addEEnumLiteral(lUpperBoundEEnum, LUpperBound.ONE); initEDataType(operationsListEDataType, List.class, STR, IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, STR); initEDataType(featuresListEDataType, List.class, STR, IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, STR); initEDataType(annotationListEDataType, EList.class, STR, IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, STR); initEDataType(internalEObjectEDataType, InternalEObject.class, STR, IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); createResource(eNS_URI); createEcoreAnnotations(); }
|
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first.
|
initializePackageContents
|
{
"repo_name": "lunifera/lunifera-dsl",
"path": "org.lunifera.dsl.semantic.common/src-gen/org/lunifera/dsl/semantic/common/types/impl/LunTypesPackageImpl.java",
"license": "epl-1.0",
"size": 49727
}
|
[
"java.util.List",
"org.eclipse.emf.common.util.EList",
"org.eclipse.emf.ecore.EOperation",
"org.eclipse.emf.ecore.EPackage",
"org.eclipse.emf.ecore.EcorePackage",
"org.eclipse.emf.ecore.InternalEObject",
"org.eclipse.xtext.common.types.TypesPackage",
"org.eclipse.xtext.xbase.XbasePackage",
"org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationsPackage",
"org.lunifera.dsl.semantic.common.types.LAnnotationDef",
"org.lunifera.dsl.semantic.common.types.LAnnotationTarget",
"org.lunifera.dsl.semantic.common.types.LAttribute",
"org.lunifera.dsl.semantic.common.types.LClass",
"org.lunifera.dsl.semantic.common.types.LCommonModel",
"org.lunifera.dsl.semantic.common.types.LDataType",
"org.lunifera.dsl.semantic.common.types.LDateType",
"org.lunifera.dsl.semantic.common.types.LEnum",
"org.lunifera.dsl.semantic.common.types.LEnumLiteral",
"org.lunifera.dsl.semantic.common.types.LFeature",
"org.lunifera.dsl.semantic.common.types.LFeaturesHolder",
"org.lunifera.dsl.semantic.common.types.LImport",
"org.lunifera.dsl.semantic.common.types.LLazyResolver",
"org.lunifera.dsl.semantic.common.types.LLowerBound",
"org.lunifera.dsl.semantic.common.types.LModifier",
"org.lunifera.dsl.semantic.common.types.LMultiplicity",
"org.lunifera.dsl.semantic.common.types.LOperation",
"org.lunifera.dsl.semantic.common.types.LPackage",
"org.lunifera.dsl.semantic.common.types.LReference",
"org.lunifera.dsl.semantic.common.types.LScalarType",
"org.lunifera.dsl.semantic.common.types.LType",
"org.lunifera.dsl.semantic.common.types.LTypedPackage",
"org.lunifera.dsl.semantic.common.types.LUpperBound",
"org.lunifera.dsl.semantic.common.types.LVisibility"
] |
import java.util.List; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EcorePackage; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.xtext.common.types.TypesPackage; import org.eclipse.xtext.xbase.XbasePackage; import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationsPackage; import org.lunifera.dsl.semantic.common.types.LAnnotationDef; import org.lunifera.dsl.semantic.common.types.LAnnotationTarget; import org.lunifera.dsl.semantic.common.types.LAttribute; import org.lunifera.dsl.semantic.common.types.LClass; import org.lunifera.dsl.semantic.common.types.LCommonModel; import org.lunifera.dsl.semantic.common.types.LDataType; import org.lunifera.dsl.semantic.common.types.LDateType; import org.lunifera.dsl.semantic.common.types.LEnum; import org.lunifera.dsl.semantic.common.types.LEnumLiteral; import org.lunifera.dsl.semantic.common.types.LFeature; import org.lunifera.dsl.semantic.common.types.LFeaturesHolder; import org.lunifera.dsl.semantic.common.types.LImport; import org.lunifera.dsl.semantic.common.types.LLazyResolver; import org.lunifera.dsl.semantic.common.types.LLowerBound; import org.lunifera.dsl.semantic.common.types.LModifier; import org.lunifera.dsl.semantic.common.types.LMultiplicity; import org.lunifera.dsl.semantic.common.types.LOperation; import org.lunifera.dsl.semantic.common.types.LPackage; import org.lunifera.dsl.semantic.common.types.LReference; import org.lunifera.dsl.semantic.common.types.LScalarType; import org.lunifera.dsl.semantic.common.types.LType; import org.lunifera.dsl.semantic.common.types.LTypedPackage; import org.lunifera.dsl.semantic.common.types.LUpperBound; import org.lunifera.dsl.semantic.common.types.LVisibility;
|
import java.util.*; import org.eclipse.emf.common.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.common.types.*; import org.eclipse.xtext.xbase.*; import org.eclipse.xtext.xbase.annotations.*; import org.lunifera.dsl.semantic.common.types.*;
|
[
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext",
"org.lunifera.dsl"
] |
java.util; org.eclipse.emf; org.eclipse.xtext; org.lunifera.dsl;
| 1,928,753
|
public HashMap<String, String> getControllerSettings(String controllerId,
PasswordAuthentication authentication)
throws AuthenticationException, ConfigurationException,
APPlatformException;
|
HashMap<String, String> function(String controllerId, PasswordAuthentication authentication) throws AuthenticationException, ConfigurationException, APPlatformException;
|
/**
* Returns the configuration settings for the given service controller.
* <p>
* In order to execute this method, you must specify the credentials of a
* technology manager registered in the organization which is responsible
* for the controller.
*
* @param controllerId
* the ID of the service controller
* @param authentication
* a <code>PasswordAuthentication</code> object identifying a
* technology manager registered in the organization which is
* responsible for the controller
* @return the configuration settings, consisting of a key and a value each
* @throws AuthenticationException
* if the authentication of the user fails
* @throws ConfigurationException
* if the configuration settings cannot be loaded
* @throws APPlatformException
* if a general problem occurs in accessing APP
*/
|
Returns the configuration settings for the given service controller. In order to execute this method, you must specify the credentials of a technology manager registered in the organization which is responsible for the controller
|
getControllerSettings
|
{
"repo_name": "opetrovski/development",
"path": "oscm-app-extsvc/javasrc/org/oscm/app/intf/APPlatformService.java",
"license": "apache-2.0",
"size": 12409
}
|
[
"java.util.HashMap",
"org.oscm.app.data.PasswordAuthentication",
"org.oscm.app.exceptions.APPlatformException",
"org.oscm.app.exceptions.AuthenticationException",
"org.oscm.app.exceptions.ConfigurationException"
] |
import java.util.HashMap; import org.oscm.app.data.PasswordAuthentication; import org.oscm.app.exceptions.APPlatformException; import org.oscm.app.exceptions.AuthenticationException; import org.oscm.app.exceptions.ConfigurationException;
|
import java.util.*; import org.oscm.app.data.*; import org.oscm.app.exceptions.*;
|
[
"java.util",
"org.oscm.app"
] |
java.util; org.oscm.app;
| 516,624
|
@SuppressWarnings("unchecked")
public static <T> Iterator<T> concat(Iterator<? extends T> a,
Iterator<? extends T> b, Iterator<? extends T> c) {
checkNotNull(a);
checkNotNull(b);
checkNotNull(c);
return concat(Arrays.asList(a, b, c).iterator());
}
|
@SuppressWarnings(STR) static <T> Iterator<T> function(Iterator<? extends T> a, Iterator<? extends T> b, Iterator<? extends T> c) { checkNotNull(a); checkNotNull(b); checkNotNull(c); return concat(Arrays.asList(a, b, c).iterator()); }
|
/**
* Combines three iterators into a single iterator. The returned iterator
* iterates across the elements in {@code a}, followed by the elements in
* {@code b}, followed by the elements in {@code c}. The source iterators
* are not polled until necessary.
*
* <p>The returned iterator supports {@code remove()} when the corresponding
* input iterator supports it.
*/
|
Combines three iterators into a single iterator. The returned iterator iterates across the elements in a, followed by the elements in b, followed by the elements in c. The source iterators are not polled until necessary. The returned iterator supports remove() when the corresponding input iterator supports it
|
concat
|
{
"repo_name": "lshain-android-source/external-guava",
"path": "guava/src/com/google/common/collect/Iterators.java",
"license": "apache-2.0",
"size": 44646
}
|
[
"com.google.common.base.Preconditions",
"java.util.Arrays",
"java.util.Iterator"
] |
import com.google.common.base.Preconditions; import java.util.Arrays; import java.util.Iterator;
|
import com.google.common.base.*; import java.util.*;
|
[
"com.google.common",
"java.util"
] |
com.google.common; java.util;
| 1,426,899
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
assertNotNull(processInstance);
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(task);
// Check create event
assertEquals(3, listener.getEventsReceived().size());
FlowableEngineEntityEvent event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0);
assertEquals(FlowableEngineEventType.ENTITY_CREATED, event.getType());
assertTrue(event.getEntity() instanceof org.activiti.engine.task.Task);
org.activiti.engine.task.Task taskFromEvent = (org.activiti.engine.task.Task) event.getEntity();
assertEquals(task.getId(), taskFromEvent.getId());
assertExecutionDetails(event, processInstance);
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(1);
assertEquals(FlowableEngineEventType.ENTITY_INITIALIZED, event.getType());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(2);
assertEquals(FlowableEngineEventType.TASK_CREATED, event.getType());
assertTrue(event.getEntity() instanceof org.activiti.engine.task.Task);
taskFromEvent = (org.activiti.engine.task.Task) event.getEntity();
assertEquals(task.getId(), taskFromEvent.getId());
assertExecutionDetails(event, processInstance);
listener.clearEventsReceived();
// Update duedate, owner and priority should trigger update-event
taskService.setDueDate(task.getId(), new Date());
assertEquals(1, listener.getEventsReceived().size());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0);
assertExecutionDetails(event, processInstance);
assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType());
listener.clearEventsReceived();
taskService.setPriority(task.getId(), 12);
assertEquals(1, listener.getEventsReceived().size());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0);
assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType());
assertExecutionDetails(event, processInstance);
listener.clearEventsReceived();
taskService.setOwner(task.getId(), "kermit");
assertEquals(1, listener.getEventsReceived().size());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0);
assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType());
assertExecutionDetails(event, processInstance);
listener.clearEventsReceived();
// Updating detached task and calling saveTask should trigger a single update-event
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
task.setDueDate(new Date());
task.setOwner("john");
taskService.saveTask(task);
assertEquals(1, listener.getEventsReceived().size());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0);
assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType());
assertExecutionDetails(event, processInstance);
listener.clearEventsReceived();
// Check delete-event on complete
taskService.complete(task.getId());
assertEquals(2, listener.getEventsReceived().size());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0);
assertEquals(FlowableEngineEventType.TASK_COMPLETED, event.getType());
assertExecutionDetails(event, processInstance);
org.activiti.engine.impl.persistence.entity.TaskEntity taskEntity = (org.activiti.engine.impl.persistence.entity.TaskEntity) event.getEntity();
assertNotNull(taskEntity.getDueDate());
event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(1);
assertEquals(FlowableEngineEventType.ENTITY_DELETED, event.getType());
assertExecutionDetails(event, processInstance);
}
|
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(STR); assertNotNull(processInstance); Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); assertNotNull(task); assertEquals(3, listener.getEventsReceived().size()); FlowableEngineEntityEvent event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0); assertEquals(FlowableEngineEventType.ENTITY_CREATED, event.getType()); assertTrue(event.getEntity() instanceof org.activiti.engine.task.Task); org.activiti.engine.task.Task taskFromEvent = (org.activiti.engine.task.Task) event.getEntity(); assertEquals(task.getId(), taskFromEvent.getId()); assertExecutionDetails(event, processInstance); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(1); assertEquals(FlowableEngineEventType.ENTITY_INITIALIZED, event.getType()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(2); assertEquals(FlowableEngineEventType.TASK_CREATED, event.getType()); assertTrue(event.getEntity() instanceof org.activiti.engine.task.Task); taskFromEvent = (org.activiti.engine.task.Task) event.getEntity(); assertEquals(task.getId(), taskFromEvent.getId()); assertExecutionDetails(event, processInstance); listener.clearEventsReceived(); taskService.setDueDate(task.getId(), new Date()); assertEquals(1, listener.getEventsReceived().size()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0); assertExecutionDetails(event, processInstance); assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType()); listener.clearEventsReceived(); taskService.setPriority(task.getId(), 12); assertEquals(1, listener.getEventsReceived().size()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0); assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType()); assertExecutionDetails(event, processInstance); listener.clearEventsReceived(); taskService.setOwner(task.getId(), STR); assertEquals(1, listener.getEventsReceived().size()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0); assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType()); assertExecutionDetails(event, processInstance); listener.clearEventsReceived(); task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); task.setDueDate(new Date()); task.setOwner("john"); taskService.saveTask(task); assertEquals(1, listener.getEventsReceived().size()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0); assertEquals(FlowableEngineEventType.ENTITY_UPDATED, event.getType()); assertExecutionDetails(event, processInstance); listener.clearEventsReceived(); taskService.complete(task.getId()); assertEquals(2, listener.getEventsReceived().size()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(0); assertEquals(FlowableEngineEventType.TASK_COMPLETED, event.getType()); assertExecutionDetails(event, processInstance); org.activiti.engine.impl.persistence.entity.TaskEntity taskEntity = (org.activiti.engine.impl.persistence.entity.TaskEntity) event.getEntity(); assertNotNull(taskEntity.getDueDate()); event = (FlowableEngineEntityEvent) listener.getEventsReceived().get(1); assertEquals(FlowableEngineEventType.ENTITY_DELETED, event.getType()); assertExecutionDetails(event, processInstance); }
|
/**
* Check create, update and delete events for a task.
*/
|
Check create, update and delete events for a task
|
testTaskEventsInProcess
|
{
"repo_name": "robsoncardosoti/flowable-engine",
"path": "modules/flowable5-test/src/test/java/org/activiti/engine/test/api/event/TaskEventsTest.java",
"license": "apache-2.0",
"size": 14217
}
|
[
"java.util.Date",
"org.flowable.engine.delegate.event.FlowableEngineEventType",
"org.flowable.engine.impl.delegate.event.FlowableEngineEntityEvent",
"org.flowable.engine.runtime.ProcessInstance",
"org.flowable.engine.task.Task"
] |
import java.util.Date; import org.flowable.engine.delegate.event.FlowableEngineEventType; import org.flowable.engine.impl.delegate.event.FlowableEngineEntityEvent; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.engine.task.Task;
|
import java.util.*; import org.flowable.engine.delegate.event.*; import org.flowable.engine.impl.delegate.event.*; import org.flowable.engine.runtime.*; import org.flowable.engine.task.*;
|
[
"java.util",
"org.flowable.engine"
] |
java.util; org.flowable.engine;
| 191,617
|
private static boolean hideKeyboard(View view) {
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
return imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
|
static boolean function(View view) { InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); return imm.hideSoftInputFromWindow(view.getWindowToken(), 0); }
|
/**
* Hides the keyboard.
* @param view The {@link View} that is currently accepting input.
* @return Whether the keyboard was visible before.
*/
|
Hides the keyboard
|
hideKeyboard
|
{
"repo_name": "Pluto-tv/chromium-crosswalk",
"path": "android_webview/tools/WebViewShell/src/org/chromium/webview_shell/WebViewBrowserActivity.java",
"license": "bsd-3-clause",
"size": 8369
}
|
[
"android.content.Context",
"android.view.View",
"android.view.inputmethod.InputMethodManager"
] |
import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager;
|
import android.content.*; import android.view.*; import android.view.inputmethod.*;
|
[
"android.content",
"android.view"
] |
android.content; android.view;
| 989,710
|
public ArrayList<Player> getActivePlayers() {
return activePlayers;
}
|
ArrayList<Player> function() { return activePlayers; }
|
/** Gets the list of players participating in minigames.
*
* @return list of active (participating) players */
|
Gets the list of players participating in minigames
|
getActivePlayers
|
{
"repo_name": "TheBrianiac/OtisArena",
"path": "src/main/java/me/otisdiver/otisarena/game/Game.java",
"license": "mit",
"size": 8874
}
|
[
"java.util.ArrayList",
"org.bukkit.entity.Player"
] |
import java.util.ArrayList; import org.bukkit.entity.Player;
|
import java.util.*; import org.bukkit.entity.*;
|
[
"java.util",
"org.bukkit.entity"
] |
java.util; org.bukkit.entity;
| 1,188,608
|
public void copyMessageToExceptionDestination(LocalTransaction tran)
throws SINotPossibleInCurrentConfigurationException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "copyMessageToExceptionDestination", tran);
SIMPMessage msg = getSIMPMessage();
ExceptionDestinationHandlerImpl edh = null;
if (_destinationHandler.isLink())
edh = new ExceptionDestinationHandlerImpl(_destinationHandler);
else {
edh = new ExceptionDestinationHandlerImpl(null, _messageProcessor);
edh.setDestination(_destinationHandler);
}
edh.sendToExceptionDestination(
msg.getMessage(),
null,
tran,
SIRCConstants.SIRC0036_MESSAGE_ADMINISTRATIVELY_REROUTED_TO_EXCEPTION_DESTINATION,
null,
new String[]{""+_messageID,
_destinationHandler.getName(),
_messageProcessor.getMessagingEngineName()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "copyMessageToExceptionDestination");
}
|
void function(LocalTransaction tran) throws SINotPossibleInCurrentConfigurationException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, STR, tran); SIMPMessage msg = getSIMPMessage(); ExceptionDestinationHandlerImpl edh = null; if (_destinationHandler.isLink()) edh = new ExceptionDestinationHandlerImpl(_destinationHandler); else { edh = new ExceptionDestinationHandlerImpl(null, _messageProcessor); edh.setDestination(_destinationHandler); } edh.sendToExceptionDestination( msg.getMessage(), null, tran, SIRCConstants.SIRC0036_MESSAGE_ADMINISTRATIVELY_REROUTED_TO_EXCEPTION_DESTINATION, null, new String[]{""+_messageID, _destinationHandler.getName(), _messageProcessor.getMessagingEngineName()}); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR); }
|
/**
* Copy the message to the exception destination
* @param tran can be null
* @throws SIResourceException
* @throws SINotPossibleInCurrentConfigurationException
*/
|
Copy the message to the exception destination
|
copyMessageToExceptionDestination
|
{
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/QueuedMessage.java",
"license": "epl-1.0",
"size": 25397
}
|
[
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.websphere.sib.SIRCConstants",
"com.ibm.websphere.sib.exception.SINotPossibleInCurrentConfigurationException",
"com.ibm.websphere.sib.exception.SIResourceException",
"com.ibm.ws.sib.processor.impl.ExceptionDestinationHandlerImpl",
"com.ibm.ws.sib.processor.impl.interfaces.SIMPMessage",
"com.ibm.ws.sib.transactions.LocalTransaction",
"com.ibm.ws.sib.utils.ras.SibTr"
] |
import com.ibm.websphere.ras.TraceComponent; import com.ibm.websphere.sib.SIRCConstants; import com.ibm.websphere.sib.exception.SINotPossibleInCurrentConfigurationException; import com.ibm.websphere.sib.exception.SIResourceException; import com.ibm.ws.sib.processor.impl.ExceptionDestinationHandlerImpl; import com.ibm.ws.sib.processor.impl.interfaces.SIMPMessage; import com.ibm.ws.sib.transactions.LocalTransaction; import com.ibm.ws.sib.utils.ras.SibTr;
|
import com.ibm.websphere.ras.*; import com.ibm.websphere.sib.*; import com.ibm.websphere.sib.exception.*; import com.ibm.ws.sib.processor.impl.*; import com.ibm.ws.sib.processor.impl.interfaces.*; import com.ibm.ws.sib.transactions.*; import com.ibm.ws.sib.utils.ras.*;
|
[
"com.ibm.websphere",
"com.ibm.ws"
] |
com.ibm.websphere; com.ibm.ws;
| 344,036
|
public void windowClosing(WindowEvent e)
{
if (m_dialog.getContentPane().getComponentCount() > 0)
if (m_dialog.getContentPane().getComponent(0) instanceof BaseApplet)
((BaseApplet)m_dialog.getContentPane().getComponent(0)).free();
m_dialog.dispose(); // Remove dialog.
}
|
void function(WindowEvent e) { if (m_dialog.getContentPane().getComponentCount() > 0) if (m_dialog.getContentPane().getComponent(0) instanceof BaseApplet) ((BaseApplet)m_dialog.getContentPane().getComponent(0)).free(); m_dialog.dispose(); }
|
/**
* The window is closing, free the sub-BaseApplet.
* @param e The window event.
*/
|
The window is closing, free the sub-BaseApplet
|
windowClosing
|
{
"repo_name": "jbundle/jbundle",
"path": "thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBaseFrameAdapter.java",
"license": "gpl-3.0",
"size": 1090
}
|
[
"java.awt.event.WindowEvent"
] |
import java.awt.event.WindowEvent;
|
import java.awt.event.*;
|
[
"java.awt"
] |
java.awt;
| 2,582,428
|
@ApiModelProperty(example = "null", value = "Internal server error message")
public String getError() {
return error;
}
|
@ApiModelProperty(example = "null", value = STR) String function() { return error; }
|
/**
* Internal server error message
* @return error
**/
|
Internal server error message
|
getError
|
{
"repo_name": "Tmin10/EVE-Security-Service",
"path": "server-api/src/main/java/ru/tmin10/EVESecurityService/serverApi/model/GetUniverseRacesInternalServerError.java",
"license": "gpl-3.0",
"size": 2218
}
|
[
"io.swagger.annotations.ApiModelProperty"
] |
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.*;
|
[
"io.swagger.annotations"
] |
io.swagger.annotations;
| 1,247,104
|
public static Bundle makeCMessageBundle(byte[] packet, long refid) {
Bundle b = new Bundle();
injectCMessageIntoBundle(b, packet, refid );
return b;
}
|
static Bundle function(byte[] packet, long refid) { Bundle b = new Bundle(); injectCMessageIntoBundle(b, packet, refid ); return b; }
|
/**
* Creates a Bundle containing the passed message packet.
*
* @param packet
* @return
*/
|
Creates a Bundle containing the passed message packet
|
makeCMessageBundle
|
{
"repo_name": "yangjun2/android",
"path": "sfsp_application/src/com/airbiquity/android/choreofleetmessaging/CMessage.java",
"license": "unlicense",
"size": 40737
}
|
[
"android.os.Bundle"
] |
import android.os.Bundle;
|
import android.os.*;
|
[
"android.os"
] |
android.os;
| 2,521,401
|
@Test
@Graph( nodes = {@NODE( name = "I" ), @NODE( name = "you" )}, relationships = {@REL( start = "I", end = "you",
type = "know", properties = {@PROP( key = "since", value = "today" )} )}, autoIndexRelationships = true )
public void Find_relationship_by_exact_match_from_an_automatic_index()
{
data.get();
assertSize( 1, gen.get()
.noGraph()
.expectedStatus( 200 )
.get( relationshipAutoIndexUri() + "since/today/" )
.entity() );
}
|
@Graph( nodes = {@NODE( name = "I" ), @NODE( name = "you" )}, relationships = {@REL( start = "I", end = "you", type = "know", properties = {@PROP( key = "since", value = "today" )} )}, autoIndexRelationships = true ) void function() { data.get(); assertSize( 1, gen.get() .noGraph() .expectedStatus( 200 ) .get( relationshipAutoIndexUri() + STR ) .entity() ); }
|
/**
* See the example request.
*/
|
See the example request
|
Find_relationship_by_exact_match_from_an_automatic_index
|
{
"repo_name": "HuangLS/neo4j",
"path": "community/server/src/test/java/org/neo4j/server/rest/AutoIndexDocIT.java",
"license": "apache-2.0",
"size": 15226
}
|
[
"org.neo4j.test.GraphDescription"
] |
import org.neo4j.test.GraphDescription;
|
import org.neo4j.test.*;
|
[
"org.neo4j.test"
] |
org.neo4j.test;
| 1,853,704
|
@Override
public ThrowableProxy getThrownProxy() {
return event.getThrownProxy();
}
|
ThrowableProxy function() { return event.getThrownProxy(); }
|
/**
* Returns the Throwable associated with the event, if any.
* @return the Throwable.
*/
|
Returns the Throwable associated with the event, if any
|
getThrownProxy
|
{
"repo_name": "lburgazzoli/logging-log4j2",
"path": "log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java",
"license": "apache-2.0",
"size": 11248
}
|
[
"org.apache.logging.log4j.core.impl.ThrowableProxy"
] |
import org.apache.logging.log4j.core.impl.ThrowableProxy;
|
import org.apache.logging.log4j.core.impl.*;
|
[
"org.apache.logging"
] |
org.apache.logging;
| 1,201,252
|
protected TextView textView(final int childViewIndex) {
return updater.textView(childViewIndex);
}
|
TextView function(final int childViewIndex) { return updater.textView(childViewIndex); }
|
/**
* Get text view at given index
*
* @param childViewIndex
* @return text view
*/
|
Get text view at given index
|
textView
|
{
"repo_name": "hackugyo/wishlist_hackugyo",
"path": "src/main/java/com/github/kevinsawicki/wishlist/TypeAdapter.java",
"license": "mit",
"size": 8469
}
|
[
"android.widget.TextView"
] |
import android.widget.TextView;
|
import android.widget.*;
|
[
"android.widget"
] |
android.widget;
| 714,550
|
private Cursor getWord(Uri uri) {
String id = uri.getLastPathSegment();
String[] projection = new String[] {
LexiconContract._ID,
LexiconContract.COLUMN_ENTRY,
LexiconContract.COLUMN_GREEK_NO_SYMBOLS
};
String selection = "_id = ?";
String[] selectionArgs = new String[] {id};
SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();
queryBuilder.setTables(LexiconContract.TABLE_NAME);
return queryBuilder.query(mDatabase, projection, selection, selectionArgs, null,
null, null);
}
|
Cursor function(Uri uri) { String id = uri.getLastPathSegment(); String[] projection = new String[] { LexiconContract._ID, LexiconContract.COLUMN_ENTRY, LexiconContract.COLUMN_GREEK_NO_SYMBOLS }; String selection = STR; String[] selectionArgs = new String[] {id}; SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder(); queryBuilder.setTables(LexiconContract.TABLE_NAME); return queryBuilder.query(mDatabase, projection, selection, selectionArgs, null, null, null); }
|
/**
* Queries the database for the word specified by the given URI.
* @param uri a {@code Uri} specifying the word for which to search
* @return a {@code Cursor} containing the results of the query
*/
|
Queries the database for the word specified by the given URI
|
getWord
|
{
"repo_name": "blinskey/greek-reference",
"path": "GreekReference/src/main/java/com/benlinskey/greekreference/data/lexicon/LexiconProvider.java",
"license": "apache-2.0",
"size": 8196
}
|
[
"android.database.Cursor",
"android.database.sqlite.SQLiteQueryBuilder",
"android.net.Uri"
] |
import android.database.Cursor; import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri;
|
import android.database.*; import android.database.sqlite.*; import android.net.*;
|
[
"android.database",
"android.net"
] |
android.database; android.net;
| 4,094
|
public Dimension getMinimumSize() {
return dMinimum;
}
|
Dimension function() { return dMinimum; }
|
/**
* Method declaration
*/
|
Method declaration
|
getMinimumSize
|
{
"repo_name": "ThangBK2009/android-source-browsing.platform--external--hsqldb",
"path": "src/org/hsqldb/util/Grid.java",
"license": "bsd-3-clause",
"size": 14907
}
|
[
"java.awt.Dimension"
] |
import java.awt.Dimension;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,360,696
|
void storeEvent(SaveRelatedData evt)
{
if (events == null) events = new HashMap<String, SaveRelatedData>();
events.put(evt.toString(), evt);
}
|
void storeEvent(SaveRelatedData evt) { if (events == null) events = new HashMap<String, SaveRelatedData>(); events.put(evt.toString(), evt); }
|
/**
* Stored the event to display.
*
* @param evt The event to store.
*/
|
Stored the event to display
|
storeEvent
|
{
"repo_name": "chris-allan/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java",
"license": "gpl-2.0",
"size": 95777
}
|
[
"java.util.HashMap",
"org.openmicroscopy.shoola.agents.events.iviewer.SaveRelatedData"
] |
import java.util.HashMap; import org.openmicroscopy.shoola.agents.events.iviewer.SaveRelatedData;
|
import java.util.*; import org.openmicroscopy.shoola.agents.events.iviewer.*;
|
[
"java.util",
"org.openmicroscopy.shoola"
] |
java.util; org.openmicroscopy.shoola;
| 2,259,119
|
private void refreshLayout()
{
DateFormat labelDateFormat = getLabelDateFormat();
String formattedDate = labelDateFormat.format(DATE);
getChildren().clear();
StackPane lStackPane = new StackPane();
VBox lVBox = new VBox(0);
lVBox.alignmentProperty().set(Pos.CENTER);
if ( formattedDate.contains("2") ) {
if (getShowTickLabels() == ShowTickLabels.YES) {
lVBox.getChildren().add(hourLabelsPane);
}
lVBox.getChildren().add(hourScrollSlider);
}
if ( formattedDate.contains("3") ) {
lVBox.getChildren().add(minuteScrollSlider);
if (getShowTickLabels() == ShowTickLabels.YES) {
lVBox.getChildren().add(minuteLabelsPane);
}
}
if ( formattedDate.contains("4") ) {
lVBox.getChildren().add(secondScrollSlider);
}
lStackPane.getChildren().add(lVBox);
lStackPane.getChildren().add(timeText);
StackPane.setAlignment(timeText, getShowTickLabels() == ShowTickLabels.YES ? Pos.CENTER : Pos.TOP_CENTER);
getChildren().add(lStackPane);
}
final static Date DATE = new Date(9999-1900, 0, 1, 2, 3, 4);
|
void function() { DateFormat labelDateFormat = getLabelDateFormat(); String formattedDate = labelDateFormat.format(DATE); getChildren().clear(); StackPane lStackPane = new StackPane(); VBox lVBox = new VBox(0); lVBox.alignmentProperty().set(Pos.CENTER); if ( formattedDate.contains("2") ) { if (getShowTickLabels() == ShowTickLabels.YES) { lVBox.getChildren().add(hourLabelsPane); } lVBox.getChildren().add(hourScrollSlider); } if ( formattedDate.contains("3") ) { lVBox.getChildren().add(minuteScrollSlider); if (getShowTickLabels() == ShowTickLabels.YES) { lVBox.getChildren().add(minuteLabelsPane); } } if ( formattedDate.contains("4") ) { lVBox.getChildren().add(secondScrollSlider); } lStackPane.getChildren().add(lVBox); lStackPane.getChildren().add(timeText); StackPane.setAlignment(timeText, getShowTickLabels() == ShowTickLabels.YES ? Pos.CENTER : Pos.TOP_CENTER); getChildren().add(lStackPane); } final static Date DATE = new Date(9999-1900, 0, 1, 2, 3, 4);
|
/**
* hide or show nodes (VBox reserves room for not visible nodes)
*/
|
hide or show nodes (VBox reserves room for not visible nodes)
|
refreshLayout
|
{
"repo_name": "palawchust/jfxtras",
"path": "jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarTimePickerSkin.java",
"license": "bsd-3-clause",
"size": 22570
}
|
[
"java.text.DateFormat",
"java.util.Date"
] |
import java.text.DateFormat; import java.util.Date;
|
import java.text.*; import java.util.*;
|
[
"java.text",
"java.util"
] |
java.text; java.util;
| 721,482
|
public void setOVXPort(final OVXPort ovxPort) {
if (this.ovxPortMap.get(ovxPort.getTenantId()) != null) {
if (ovxPort.getLink() != null) {
this.ovxPortMap.get(ovxPort.getTenantId()).put(
ovxPort.getLink().getInLink().getLinkId(), ovxPort);
} else {
this.ovxPortMap.get(ovxPort.getTenantId()).put(0, ovxPort);
}
} else {
final HashMap<Integer, OVXPort> portMap = new HashMap<Integer, OVXPort>();
if (ovxPort.getLink() != null) {
portMap.put(ovxPort.getLink().getOutLink().getLinkId(), ovxPort);
} else {
portMap.put(0, ovxPort);
}
this.ovxPortMap.put(ovxPort.getTenantId(), portMap);
}
}
|
void function(final OVXPort ovxPort) { if (this.ovxPortMap.get(ovxPort.getTenantId()) != null) { if (ovxPort.getLink() != null) { this.ovxPortMap.get(ovxPort.getTenantId()).put( ovxPort.getLink().getInLink().getLinkId(), ovxPort); } else { this.ovxPortMap.get(ovxPort.getTenantId()).put(0, ovxPort); } } else { final HashMap<Integer, OVXPort> portMap = new HashMap<Integer, OVXPort>(); if (ovxPort.getLink() != null) { portMap.put(ovxPort.getLink().getOutLink().getLinkId(), ovxPort); } else { portMap.put(0, ovxPort); } this.ovxPortMap.put(ovxPort.getTenantId(), portMap); } }
|
/**
* Maps the given virtual port to this physical port.
*
* @param ovxPort
* the virtual port
*/
|
Maps the given virtual port to this physical port
|
setOVXPort
|
{
"repo_name": "Gyeong-Sik/vsdn_monitoring",
"path": "src/main/java/net/onrc/openvirtex/elements/port/PhysicalPort.java",
"license": "apache-2.0",
"size": 8431
}
|
[
"java.util.HashMap"
] |
import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 225,969
|
public Class<?> loadClass(String className) throws ClassNotFoundException {
final Bundle bundle = getCurrentBundle();
if (bundle != null) {
final Class cls = bundle.loadClass(className);
LOG.debug(String.format("Located class [%s] in bundle [%s]", className, bundle.getSymbolicName()));
return cls;
}
throw new ClassNotFoundException("Unable to find class " + className);
}
|
Class<?> function(String className) throws ClassNotFoundException { final Bundle bundle = getCurrentBundle(); if (bundle != null) { final Class cls = bundle.loadClass(className); LOG.debug(String.format(STR, className, bundle.getSymbolicName())); return cls; } throw new ClassNotFoundException(STR + className); }
|
/**
* load a class from the current bundle.
*
* @param className class to load
* @return the loaded class
* @throws ClassNotFoundException if cannot resolve the class in the bundle
*/
|
load a class from the current bundle
|
loadClass
|
{
"repo_name": "NCIP/caarray",
"path": "software/caarray.war/src/main/java/gov/nih/nci/caarray/web/plugins/DefaultBundleAccessor.java",
"license": "bsd-3-clause",
"size": 7582
}
|
[
"org.osgi.framework.Bundle"
] |
import org.osgi.framework.Bundle;
|
import org.osgi.framework.*;
|
[
"org.osgi.framework"
] |
org.osgi.framework;
| 1,753,307
|
public void setShader(Shader shader);
|
void function(Shader shader);
|
/**
* Sets the shader to use for rendering.
* If the shader has not been uploaded yet, it is compiled
* and linked. If it has been uploaded, then the
* uniform data is updated and the shader is set.
*
* @param shader The shader to use for rendering.
*/
|
Sets the shader to use for rendering. If the shader has not been uploaded yet, it is compiled and linked. If it has been uploaded, then the uniform data is updated and the shader is set
|
setShader
|
{
"repo_name": "zzuegg/jmonkeyengine",
"path": "jme3-core/src/main/java/com/jme3/renderer/Renderer.java",
"license": "bsd-3-clause",
"size": 16827
}
|
[
"com.jme3.shader.Shader"
] |
import com.jme3.shader.Shader;
|
import com.jme3.shader.*;
|
[
"com.jme3.shader"
] |
com.jme3.shader;
| 455,119
|
public SimpleObjectProperty<Color> getVUColorProperty ()
{
return this.vuColorProperty;
}
|
SimpleObjectProperty<Color> function () { return this.vuColorProperty; }
|
/**
* Get the VU color property.
*
* @return The property
*/
|
Get the VU color property
|
getVUColorProperty
|
{
"repo_name": "git-moss/Push2Display",
"path": "src/push22bitwig/LayoutSettings.java",
"license": "lgpl-3.0",
"size": 8208
}
|
[
"java.awt.Color"
] |
import java.awt.Color;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,501,906
|
public void setBatchClassInfoFromSession(String batchClassInfo, AsyncCallback<Void> callback);
|
void function(String batchClassInfo, AsyncCallback<Void> callback);
|
/**
* API to set the selected batch class info into session.
*
* @param batchClassInfo
* @param callback
*/
|
API to set the selected batch class info into session
|
setBatchClassInfoFromSession
|
{
"repo_name": "ungerik/ephesoft",
"path": "Ephesoft_Community_Release_4.0.2.0/source/dcma-gwt/dcma-gwt-core/src/main/java/com/ephesoft/dcma/gwt/core/client/DCMARemoteServiceAsync.java",
"license": "agpl-3.0",
"size": 10548
}
|
[
"com.google.gwt.user.client.rpc.AsyncCallback"
] |
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.*;
|
[
"com.google.gwt"
] |
com.google.gwt;
| 1,561,684
|
@RequestMapping( value = "/{namespace}/{key}", method = RequestMethod.POST, produces = "application/json", consumes = "application/json" )
public void addKeyJsonValue(
@PathVariable String namespace, @PathVariable String key, @RequestBody String body,
@RequestParam( defaultValue = "false" ) boolean encrypt, HttpServletResponse response )
throws IOException, WebMessageException
{
if ( !hasAccess( namespace ) )
{
throw new WebMessageException( WebMessageUtils.forbidden( "The namespace '" + namespace +
"' is protected, and you don't have the right authority to access it." ) );
}
if ( keyJsonValueService.getKeyJsonValue( namespace, key ) != null )
{
throw new WebMessageException( WebMessageUtils
.conflict( "The key '" + key + "' already exists on the namespace '" + namespace + "'." ) );
}
if ( !renderService.isValidJson( body ) )
{
throw new WebMessageException( WebMessageUtils.badRequest( "The data is not valid JSON." ) );
}
KeyJsonValue keyJsonValue = new KeyJsonValue();
keyJsonValue.setKey( key );
keyJsonValue.setNamespace( namespace );
keyJsonValue.setValue( body );
keyJsonValue.setEncrypted( encrypt );
keyJsonValueService.addKeyJsonValue( keyJsonValue );
response.setStatus( HttpServletResponse.SC_CREATED );
messageService.sendJson( WebMessageUtils.created( "Key '" + key + "' created." ), response );
}
|
@RequestMapping( value = STR, method = RequestMethod.POST, produces = STR, consumes = STR ) void function( @PathVariable String namespace, @PathVariable String key, @RequestBody String body, @RequestParam( defaultValue = "false" ) boolean encrypt, HttpServletResponse response ) throws IOException, WebMessageException { if ( !hasAccess( namespace ) ) { throw new WebMessageException( WebMessageUtils.forbidden( STR + namespace + STR ) ); } if ( keyJsonValueService.getKeyJsonValue( namespace, key ) != null ) { throw new WebMessageException( WebMessageUtils .conflict( STR + key + STR + namespace + "'." ) ); } if ( !renderService.isValidJson( body ) ) { throw new WebMessageException( WebMessageUtils.badRequest( STR ) ); } KeyJsonValue keyJsonValue = new KeyJsonValue(); keyJsonValue.setKey( key ); keyJsonValue.setNamespace( namespace ); keyJsonValue.setValue( body ); keyJsonValue.setEncrypted( encrypt ); keyJsonValueService.addKeyJsonValue( keyJsonValue ); response.setStatus( HttpServletResponse.SC_CREATED ); messageService.sendJson( WebMessageUtils.created( STR + key + STR ), response ); }
|
/**
* Creates a new KeyJsonValue Object on the given namespace with the key and value supplied.
*/
|
Creates a new KeyJsonValue Object on the given namespace with the key and value supplied
|
addKeyJsonValue
|
{
"repo_name": "troyel/dhis2-core",
"path": "dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/KeyJsonValueController.java",
"license": "bsd-3-clause",
"size": 12322
}
|
[
"java.io.IOException",
"javax.servlet.http.HttpServletResponse",
"org.hisp.dhis.dxf2.webmessage.WebMessageException",
"org.hisp.dhis.dxf2.webmessage.WebMessageUtils",
"org.hisp.dhis.keyjsonvalue.KeyJsonValue",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestBody",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.springframework.web.bind.annotation.RequestParam"
] |
import java.io.IOException; import javax.servlet.http.HttpServletResponse; import org.hisp.dhis.dxf2.webmessage.WebMessageException; import org.hisp.dhis.dxf2.webmessage.WebMessageUtils; import org.hisp.dhis.keyjsonvalue.KeyJsonValue; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam;
|
import java.io.*; import javax.servlet.http.*; import org.hisp.dhis.dxf2.webmessage.*; import org.hisp.dhis.keyjsonvalue.*; import org.springframework.web.bind.annotation.*;
|
[
"java.io",
"javax.servlet",
"org.hisp.dhis",
"org.springframework.web"
] |
java.io; javax.servlet; org.hisp.dhis; org.springframework.web;
| 840,022
|
private void serializeMethodCallAttributes(MethodCall methodCall, XmlSerializer serializer, String apiUri) throws IOException, SerializeException {
//Id (optional)
if (methodCall.getId() != null){
serializer.startTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_ID_ATTR);
serializer.text(methodCall.getId());
serializer.endTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_ID_ATTR);
}
//Version (mandatory)
if (methodCall.getVersion() == null)
throw new SerializeException("Version attribute cannot be null");
serializer.startTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_VERSION_ATTR);
serializer.text(methodCall.getVersion());
serializer.endTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_VERSION_ATTR);
//Method (mandatory)
Log.d(TAG, "getting Method:" + methodCall.getMethod());
if (methodCall.getMethod() == null)
throw new SerializeException("Method attribute cannot be null");
serializer.startTag(apiUri, XmlConstants.XSD_RPC_METHOD_ATTR);
serializer.text(methodCall.getMethod());
serializer.endTag(apiUri, XmlConstants.XSD_RPC_METHOD_ATTR);
}
|
void function(MethodCall methodCall, XmlSerializer serializer, String apiUri) throws IOException, SerializeException { if (methodCall.getId() != null){ serializer.startTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_ID_ATTR); serializer.text(methodCall.getId()); serializer.endTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_ID_ATTR); } if (methodCall.getVersion() == null) throw new SerializeException(STR); serializer.startTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_VERSION_ATTR); serializer.text(methodCall.getVersion()); serializer.endTag(XmlConstants.NS_RPC_DEFINITION_URI, XmlConstants.XSD_RPC_VERSION_ATTR); Log.d(TAG, STR + methodCall.getMethod()); if (methodCall.getMethod() == null) throw new SerializeException(STR); serializer.startTag(apiUri, XmlConstants.XSD_RPC_METHOD_ATTR); serializer.text(methodCall.getMethod()); serializer.endTag(apiUri, XmlConstants.XSD_RPC_METHOD_ATTR); }
|
/**
* Serializes the common attributes of the MethodCall
*
* @param methodCall the MethodCall entity
* @param serializer the serializer
* @throws IOException
* @throws SerializeException
*/
|
Serializes the common attributes of the MethodCall
|
serializeMethodCallAttributes
|
{
"repo_name": "BlueVia/Official-Library-Android",
"path": "library/src/com/bluevia/android/commons/parser/xmlrpc/XmlMethodCallSerializer.java",
"license": "lgpl-3.0",
"size": 4477
}
|
[
"android.util.Log",
"com.bluevia.android.commons.data.xmlrpc.MethodCall",
"com.bluevia.android.commons.parser.SerializeException",
"com.bluevia.android.commons.parser.xml.XmlConstants",
"java.io.IOException",
"org.xmlpull.v1.XmlSerializer"
] |
import android.util.Log; import com.bluevia.android.commons.data.xmlrpc.MethodCall; import com.bluevia.android.commons.parser.SerializeException; import com.bluevia.android.commons.parser.xml.XmlConstants; import java.io.IOException; import org.xmlpull.v1.XmlSerializer;
|
import android.util.*; import com.bluevia.android.commons.data.xmlrpc.*; import com.bluevia.android.commons.parser.*; import com.bluevia.android.commons.parser.xml.*; import java.io.*; import org.xmlpull.v1.*;
|
[
"android.util",
"com.bluevia.android",
"java.io",
"org.xmlpull.v1"
] |
android.util; com.bluevia.android; java.io; org.xmlpull.v1;
| 715,971
|
public String getName() {
synchronized(state){
if(state.isNotReleased())
return name;
else
throw new StateException("This control has been released and must not be used");
}
}
/**
* This method retrieves the increment to be used when setting a new value
* for this control. New values must be equal to <code>getMin() + K*getStep()</code>
* where K is an integer, and the result is less or equal to {@link #getMaxValue()}.
* For string control, this method returns the step size of the string.
* @return the increment
* @throws StateException if this control has been released and must not be used anymore.
* @throws UnsupportedMethod if this control is of type {@link V4L4JConstants#CTRL_TYPE_LONG}
|
String function() { synchronized(state){ if(state.isNotReleased()) return name; else throw new StateException(STR); } } /** * This method retrieves the increment to be used when setting a new value * for this control. New values must be equal to <code>getMin() + K*getStep()</code> * where K is an integer, and the result is less or equal to {@link #getMaxValue()}. * For string control, this method returns the step size of the string. * @return the increment * @throws StateException if this control has been released and must not be used anymore. * @throws UnsupportedMethod if this control is of type {@link V4L4JConstants#CTRL_TYPE_LONG}
|
/**
* This method retrieves the name of this control.
* @return the name of this control
* @throws StateException if this control has been released and must not be used anymore.
*/
|
This method retrieves the name of this control
|
getName
|
{
"repo_name": "sarxos/v4l4j",
"path": "src/main/java/au/edu/jcu/v4l4j/Control.java",
"license": "gpl-3.0",
"size": 27578
}
|
[
"au.edu.jcu.v4l4j.exceptions.StateException",
"au.edu.jcu.v4l4j.exceptions.UnsupportedMethod"
] |
import au.edu.jcu.v4l4j.exceptions.StateException; import au.edu.jcu.v4l4j.exceptions.UnsupportedMethod;
|
import au.edu.jcu.v4l4j.exceptions.*;
|
[
"au.edu.jcu"
] |
au.edu.jcu;
| 776,339
|
private void addFilesInDirectory(File directory) {
File[] files = directory.listFiles();
if (files == null) {
throw new DockerClientException("Failed to read build context directory: " + baseDirectory.getAbsolutePath());
}
if (files.length != 0) {
for (File f : files) {
if (effectiveMatchingIgnorePattern(f) == null) {
if (f.isDirectory()) {
addFilesInDirectory(f);
} else {
filesToAdd.add(f);
}
}
}
// base directory should at least contains Dockerfile, but better check
} else if (!isBaseDirectory(directory)) {
// add empty directory
filesToAdd.add(directory);
}
}
|
void function(File directory) { File[] files = directory.listFiles(); if (files == null) { throw new DockerClientException(STR + baseDirectory.getAbsolutePath()); } if (files.length != 0) { for (File f : files) { if (effectiveMatchingIgnorePattern(f) == null) { if (f.isDirectory()) { addFilesInDirectory(f); } else { filesToAdd.add(f); } } } } else if (!isBaseDirectory(directory)) { filesToAdd.add(directory); } }
|
/**
* Adds all files found in <code>directory</code> and subdirectories to
* <code>filesToAdd</code> collection. It also adds any empty directories
* if found.
*
* @param directory directory
* @throws DockerClientException when IO error occurs
*/
|
Adds all files found in <code>directory</code> and subdirectories to <code>filesToAdd</code> collection. It also adds any empty directories if found
|
addFilesInDirectory
|
{
"repo_name": "gesellix/docker-java",
"path": "src/main/java/com/github/dockerjava/core/dockerfile/Dockerfile.java",
"license": "apache-2.0",
"size": 9605
}
|
[
"com.github.dockerjava.api.exception.DockerClientException",
"java.io.File"
] |
import com.github.dockerjava.api.exception.DockerClientException; import java.io.File;
|
import com.github.dockerjava.api.exception.*; import java.io.*;
|
[
"com.github.dockerjava",
"java.io"
] |
com.github.dockerjava; java.io;
| 525,456
|
public void setField (GridField mField)
{
m_mField = mField;
} // setField
|
void function (GridField mField) { m_mField = mField; }
|
/**
* Set Field/WindowNo for ValuePreference
* @param mField field
*/
|
Set Field/WindowNo for ValuePreference
|
setField
|
{
"repo_name": "pplatek/adempiere",
"path": "client/src/org/compiere/grid/ed/VPassword.java",
"license": "gpl-2.0",
"size": 6225
}
|
[
"org.compiere.model.GridField"
] |
import org.compiere.model.GridField;
|
import org.compiere.model.*;
|
[
"org.compiere.model"
] |
org.compiere.model;
| 326,010
|
public void setIcon(Icon icon) {
operationIcon.setIcon(icon);
}
|
void function(Icon icon) { operationIcon.setIcon(icon); }
|
/**
* Sets operation icon
*
* @param icon operation icon
*/
|
Sets operation icon
|
setIcon
|
{
"repo_name": "kiminoboku/emorg-lab",
"path": "java/netbeans/remote-control/src/main/java/pl/kiminoboku/netbeans/components/operation/OperationRowJPanel.java",
"license": "gpl-3.0",
"size": 10942
}
|
[
"javax.swing.Icon"
] |
import javax.swing.Icon;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 951,059
|
org.omg.CORBA.Object Resolve(NameComponent n,BindingTypeHolder bth)
throws org.omg.CORBA.SystemException;
|
org.omg.CORBA.Object Resolve(NameComponent n,BindingTypeHolder bth) throws org.omg.CORBA.SystemException;
|
/**
* Method which implements resolving the specified name,
* returning the type of the binding and the bound object reference.
* If the id and kind of the NameComponent are both empty, the initial
* naming context (i.e., the local root) must be returned.
* @param n a NameComponent which is the name to be resolved.
* @param bth the BindingType as an out parameter.
* @return the object reference bound under the supplied name.
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
*/
|
Method which implements resolving the specified name, returning the type of the binding and the bound object reference. If the id and kind of the NameComponent are both empty, the initial naming context (i.e., the local root) must be returned
|
Resolve
|
{
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/corba/src/share/classes/com/sun/corba/se/impl/naming/cosnaming/NamingContextDataStore.java",
"license": "gpl-2.0",
"size": 4869
}
|
[
"org.omg.CORBA",
"org.omg.CosNaming"
] |
import org.omg.CORBA; import org.omg.CosNaming;
|
import org.omg.*;
|
[
"org.omg"
] |
org.omg;
| 553,738
|
public static List<Pipe> removePreviousPipes(final Pipeline pipeline, final String namedStep) {
final List<Pipe> previousPipes = new ArrayList<Pipe>();
for (int i = pipeline.size() - 1; i >= 0; i--) {
final Pipe pipe = pipeline.get(i);
if (pipe instanceof AsPipe && ((AsPipe) pipe).getName().equals(namedStep)) {
break;
} else {
previousPipes.add(0, pipe);
}
}
for (int i = 0; i < previousPipes.size(); i++) {
pipeline.remove(pipeline.size() - 1);
}
if (pipeline.size() == 1)
pipeline.setStarts(pipeline.getStarts());
return previousPipes;
}
|
static List<Pipe> function(final Pipeline pipeline, final String namedStep) { final List<Pipe> previousPipes = new ArrayList<Pipe>(); for (int i = pipeline.size() - 1; i >= 0; i--) { final Pipe pipe = pipeline.get(i); if (pipe instanceof AsPipe && ((AsPipe) pipe).getName().equals(namedStep)) { break; } else { previousPipes.add(0, pipe); } } for (int i = 0; i < previousPipes.size(); i++) { pipeline.remove(pipeline.size() - 1); } if (pipeline.size() == 1) pipeline.setStarts(pipeline.getStarts()); return previousPipes; }
|
/**
* A utility method to remove all the pipes back some partition step and return them as a list.
*
* @param namedStep the name of the step previous to remove from the pipeline
* @return the removed pipes
*/
|
A utility method to remove all the pipes back some partition step and return them as a list
|
removePreviousPipes
|
{
"repo_name": "whshev/pipes",
"path": "src/main/java/com/tinkerpop/pipes/util/FluentUtility.java",
"license": "bsd-3-clause",
"size": 4787
}
|
[
"com.tinkerpop.pipes.Pipe",
"java.util.ArrayList",
"java.util.List"
] |
import com.tinkerpop.pipes.Pipe; import java.util.ArrayList; import java.util.List;
|
import com.tinkerpop.pipes.*; import java.util.*;
|
[
"com.tinkerpop.pipes",
"java.util"
] |
com.tinkerpop.pipes; java.util;
| 2,458,888
|
@Test
public void testInvoke() throws SecurityException,
IllegalArgumentException, JMeterException {
Dummy dummy = new Dummy();
ClassTools.invoke(dummy, "callMe");
assertTrue(dummy.wasCalled());
}
public static class Dummy {
private boolean called = false;
|
void function() throws SecurityException, IllegalArgumentException, JMeterException { Dummy dummy = new Dummy(); ClassTools.invoke(dummy, STR); assertTrue(dummy.wasCalled()); } public static class Dummy { private boolean called = false;
|
/**
* Test that a simple method can be invoked on an object
*
* @throws SecurityException
* when the method can not be used because of security concerns
* @throws IllegalArgumentException
* when the method parameters does not match the given ones
* @throws JMeterException
* when something fails while invoking the method
*/
|
Test that a simple method can be invoked on an object
|
testInvoke
|
{
"repo_name": "yuyupapa/OpenSource",
"path": "apache-jmeter-3.0/test/src/org/apache/jorphan/reflect/TestClassTools.java",
"license": "apache-2.0",
"size": 3804
}
|
[
"org.apache.jorphan.util.JMeterException",
"org.junit.Assert"
] |
import org.apache.jorphan.util.JMeterException; import org.junit.Assert;
|
import org.apache.jorphan.util.*; import org.junit.*;
|
[
"org.apache.jorphan",
"org.junit"
] |
org.apache.jorphan; org.junit;
| 1,465,525
|
private CellServerState fetchCellServerState() {
// Fetch the setup object from the Cell object. We send a message on
// the cell channel, so we must fetch that first.
ResponseMessage response = selectedCell.sendCellMessageAndWait(
new CellServerStateRequestMessage(selectedCell.getCellID()));
if (response == null) {
return null;
}
// We need to remove the position component first as a special case
// since we do not want to update it after the cell is created.
CellServerStateResponseMessage cssrm = (CellServerStateResponseMessage) response;
CellServerState state = cssrm.getCellServerState();
if (state != null) {
state.removeComponentServerState(PositionComponentServerState.class);
}
return state;
}
|
CellServerState function() { ResponseMessage response = selectedCell.sendCellMessageAndWait( new CellServerStateRequestMessage(selectedCell.getCellID())); if (response == null) { return null; } CellServerStateResponseMessage cssrm = (CellServerStateResponseMessage) response; CellServerState state = cssrm.getCellServerState(); if (state != null) { state.removeComponentServerState(PositionComponentServerState.class); } return state; }
|
/**
* Asks the server for the server state of the cell; returns null upon
* error
*/
|
Asks the server for the server state of the cell; returns null upon error
|
fetchCellServerState
|
{
"repo_name": "AsherBond/MondocosmOS",
"path": "wonderland/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/CellPropertiesJFrame.java",
"license": "agpl-3.0",
"size": 63911
}
|
[
"org.jdesktop.wonderland.common.cell.messages.CellServerStateRequestMessage",
"org.jdesktop.wonderland.common.cell.messages.CellServerStateResponseMessage",
"org.jdesktop.wonderland.common.cell.state.CellServerState",
"org.jdesktop.wonderland.common.cell.state.PositionComponentServerState",
"org.jdesktop.wonderland.common.messages.ResponseMessage"
] |
import org.jdesktop.wonderland.common.cell.messages.CellServerStateRequestMessage; import org.jdesktop.wonderland.common.cell.messages.CellServerStateResponseMessage; import org.jdesktop.wonderland.common.cell.state.CellServerState; import org.jdesktop.wonderland.common.cell.state.PositionComponentServerState; import org.jdesktop.wonderland.common.messages.ResponseMessage;
|
import org.jdesktop.wonderland.common.cell.messages.*; import org.jdesktop.wonderland.common.cell.state.*; import org.jdesktop.wonderland.common.messages.*;
|
[
"org.jdesktop.wonderland"
] |
org.jdesktop.wonderland;
| 2,079,537
|
public static Database getCurrentDatabase() {
try {
lotus.domino.Database db = (lotus.domino.Database) resolveVariable("database");
if (db instanceof org.openntf.domino.Database) {
return (org.openntf.domino.Database) db;
} else {
WrapperFactory wf = Factory.getWrapperFactory();
Session session = wf.fromLotus(db.getParent(), Session.SCHEMA, wf);
return wf.fromLotus(db, Database.SCHEMA, session);
}
} catch (Exception ne) {
DominoUtils.handleException(ne);
return null;
}
}
|
static Database function() { try { lotus.domino.Database db = (lotus.domino.Database) resolveVariable(STR); if (db instanceof org.openntf.domino.Database) { return (org.openntf.domino.Database) db; } else { WrapperFactory wf = Factory.getWrapperFactory(); Session session = wf.fromLotus(db.getParent(), Session.SCHEMA, wf); return wf.fromLotus(db, Database.SCHEMA, session); } } catch (Exception ne) { DominoUtils.handleException(ne); return null; } }
|
/**
* Gets the current database.
*
* @return the current database
*/
|
Gets the current database
|
getCurrentDatabase
|
{
"repo_name": "rPraml/org.openntf.domino",
"path": "domino/deprecated/src/main/java/org/openntf/domino/utils/XSPUtil.java",
"license": "apache-2.0",
"size": 5203
}
|
[
"org.openntf.domino.Database",
"org.openntf.domino.Session",
"org.openntf.domino.WrapperFactory"
] |
import org.openntf.domino.Database; import org.openntf.domino.Session; import org.openntf.domino.WrapperFactory;
|
import org.openntf.domino.*;
|
[
"org.openntf.domino"
] |
org.openntf.domino;
| 895,933
|
@ApiMethod(name="deleteSessionInWishlist",
path="session/{websafeSessionKey}/wishlist",
httpMethod = HttpMethod.DELETE)
public WrappedBoolean deleteSessionInWishlist(final User user,
@Named("websafeSessionKey") final String websafeSessionKey)
throws UnauthorizedException, NotFoundException,
ForbiddenException, ConflictException {
if (user == null) {
throw new UnauthorizedException("Authorization required.");
}
|
@ApiMethod(name=STR, path=STR, httpMethod = HttpMethod.DELETE) WrappedBoolean function(final User user, @Named(STR) final String websafeSessionKey) throws UnauthorizedException, NotFoundException, ForbiddenException, ConflictException { if (user == null) { throw new UnauthorizedException(STR); }
|
/**
* Delete a session from user's wishlist.
* @param user The user who invokes this method. Null when not signed in.
* @param websafeSessionKey String representation of Session key.
*
* @return WrappedBoolean true if deleted successfully, false otherwise.
*
* @throws UnauthorizedException When user is not signed in.
* @throws NotFoundException When there is no session with this key.
* @throws ForbiddenException
* @throws ConflictException When user has no session with this key in their wish list.
*/
|
Delete a session from user's wishlist
|
deleteSessionInWishlist
|
{
"repo_name": "snknikolov/conference-central",
"path": "src/main/java/com/google/devrel/training/conference/spi/ConferenceApi.java",
"license": "apache-2.0",
"size": 30923
}
|
[
"com.google.api.server.spi.config.ApiMethod",
"com.google.api.server.spi.response.ConflictException",
"com.google.api.server.spi.response.ForbiddenException",
"com.google.api.server.spi.response.NotFoundException",
"com.google.api.server.spi.response.UnauthorizedException",
"com.google.appengine.api.users.User",
"javax.inject.Named"
] |
import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.response.ConflictException; import com.google.api.server.spi.response.ForbiddenException; import com.google.api.server.spi.response.NotFoundException; import com.google.api.server.spi.response.UnauthorizedException; import com.google.appengine.api.users.User; import javax.inject.Named;
|
import com.google.api.server.spi.config.*; import com.google.api.server.spi.response.*; import com.google.appengine.api.users.*; import javax.inject.*;
|
[
"com.google.api",
"com.google.appengine",
"javax.inject"
] |
com.google.api; com.google.appengine; javax.inject;
| 581,414
|
private Map<NodeKey, Integer> computeReferrersCountDelta( List<NodeKey> addedReferrers,
List<NodeKey> removedReferrers ) {
Map<NodeKey, Integer> referrersCountDelta = new HashMap<NodeKey, Integer>(0);
Set<NodeKey> addedReferrersUnique = new HashSet<NodeKey>(addedReferrers);
for (NodeKey addedReferrer : addedReferrersUnique) {
int referrersCount = Collections.frequency(addedReferrers, addedReferrer)
- Collections.frequency(removedReferrers, addedReferrer);
referrersCountDelta.put(addedReferrer, referrersCount);
}
Set<NodeKey> removedReferrersUnique = new HashSet<NodeKey>(removedReferrers);
for (NodeKey removedReferrer : removedReferrersUnique) {
// process what's left in the removed list, only if not found in the added
if (!referrersCountDelta.containsKey(removedReferrer)) {
referrersCountDelta.put(removedReferrer, -1 * Collections.frequency(removedReferrers, removedReferrer));
}
}
return referrersCountDelta;
}
|
Map<NodeKey, Integer> function( List<NodeKey> addedReferrers, List<NodeKey> removedReferrers ) { Map<NodeKey, Integer> referrersCountDelta = new HashMap<NodeKey, Integer>(0); Set<NodeKey> addedReferrersUnique = new HashSet<NodeKey>(addedReferrers); for (NodeKey addedReferrer : addedReferrersUnique) { int referrersCount = Collections.frequency(addedReferrers, addedReferrer) - Collections.frequency(removedReferrers, addedReferrer); referrersCountDelta.put(addedReferrer, referrersCount); } Set<NodeKey> removedReferrersUnique = new HashSet<NodeKey>(removedReferrers); for (NodeKey removedReferrer : removedReferrersUnique) { if (!referrersCountDelta.containsKey(removedReferrer)) { referrersCountDelta.put(removedReferrer, -1 * Collections.frequency(removedReferrers, removedReferrer)); } } return referrersCountDelta; }
|
/**
* Given the lists of added & removed referrers (which may contain duplicates), compute the delta with which the count has to
* be updated in the document
*
* @param addedReferrers the list of referrers that was added
* @param removedReferrers the list of referrers that was removed
* @return a map(nodekey, delta) pairs
*/
|
Given the lists of added & removed referrers (which may contain duplicates), compute the delta with which the count has to be updated in the document
|
computeReferrersCountDelta
|
{
"repo_name": "vhalbert/modeshape",
"path": "modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/DocumentTranslator.java",
"license": "apache-2.0",
"size": 73980
}
|
[
"java.util.Collections",
"java.util.HashMap",
"java.util.HashSet",
"java.util.List",
"java.util.Map",
"java.util.Set",
"org.modeshape.jcr.cache.NodeKey"
] |
import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.modeshape.jcr.cache.NodeKey;
|
import java.util.*; import org.modeshape.jcr.cache.*;
|
[
"java.util",
"org.modeshape.jcr"
] |
java.util; org.modeshape.jcr;
| 1,662,426
|
@ApiModelProperty(example = "null", required = true, value = "main unique identificator")
public String getCode() {
return code;
}
|
@ApiModelProperty(example = "null", required = true, value = STR) String function() { return code; }
|
/**
* main unique identificator
* @return code
**/
|
main unique identificator
|
getCode
|
{
"repo_name": "Avalara/avataxbr-clients",
"path": "java-client/src/main/java/io/swagger/client/model/CfopConf.java",
"license": "gpl-3.0",
"size": 29385
}
|
[
"io.swagger.annotations.ApiModelProperty"
] |
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.*;
|
[
"io.swagger.annotations"
] |
io.swagger.annotations;
| 856,674
|
@Test
public void testGetVerticalValue() {
BorderSpacing borderSpacing = new BorderSpacing();
borderSpacing.setValue(25, CssLengthUnit.PX, 50, CssLengthUnit.CM);
assertEquals("25.0px 50.0cm", borderSpacing.getCssValue());
assertTrue(borderSpacing.getVerticalValue() == 50);
assertEquals(CssLengthUnit.CM, borderSpacing.getVerticalUnit());
borderSpacing.setAsInherit();
assertNull(borderSpacing.getVerticalValue());
borderSpacing.setValue(30, CssLengthUnit.PX, 30, CssLengthUnit.PX);
assertEquals("30.0px", borderSpacing.getCssValue());
assertTrue(borderSpacing.getVerticalValue() == 30);
assertEquals(CssLengthUnit.PX, borderSpacing.getVerticalUnit());
borderSpacing.setAsInherit();
assertNull(borderSpacing.getVerticalValue());
}
|
void function() { BorderSpacing borderSpacing = new BorderSpacing(); borderSpacing.setValue(25, CssLengthUnit.PX, 50, CssLengthUnit.CM); assertEquals(STR, borderSpacing.getCssValue()); assertTrue(borderSpacing.getVerticalValue() == 50); assertEquals(CssLengthUnit.CM, borderSpacing.getVerticalUnit()); borderSpacing.setAsInherit(); assertNull(borderSpacing.getVerticalValue()); borderSpacing.setValue(30, CssLengthUnit.PX, 30, CssLengthUnit.PX); assertEquals(STR, borderSpacing.getCssValue()); assertTrue(borderSpacing.getVerticalValue() == 30); assertEquals(CssLengthUnit.PX, borderSpacing.getVerticalUnit()); borderSpacing.setAsInherit(); assertNull(borderSpacing.getVerticalValue()); }
|
/**
* Test method for
* {@link com.webfirmframework.wffweb.css.BorderSpacing#getVerticalValue()}.
*/
|
Test method for <code>com.webfirmframework.wffweb.css.BorderSpacing#getVerticalValue()</code>
|
testGetVerticalValue
|
{
"repo_name": "webfirmframework/wff",
"path": "wffweb/src/test/java/com/webfirmframework/wffweb/css/BorderSpacingTest.java",
"license": "apache-2.0",
"size": 15460
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 343,481
|
public void setInitialState(final SpacecraftState initialState,
final boolean isOsculating)
throws PropagationException {
mapper.setInitialIsOsculating(isOsculating);
resetInitialState(initialState);
}
|
void function(final SpacecraftState initialState, final boolean isOsculating) throws PropagationException { mapper.setInitialIsOsculating(isOsculating); resetInitialState(initialState); }
|
/** Set the initial state.
* @param initialState initial state
* @param isOsculating true if the orbital state is defined with osculating elements
* @throws PropagationException if the initial state cannot be set
*/
|
Set the initial state
|
setInitialState
|
{
"repo_name": "Yakushima/Orekit",
"path": "src/main/java/org/orekit/propagation/semianalytical/dsst/DSSTPropagator.java",
"license": "apache-2.0",
"size": 40449
}
|
[
"org.orekit.errors.PropagationException",
"org.orekit.propagation.SpacecraftState"
] |
import org.orekit.errors.PropagationException; import org.orekit.propagation.SpacecraftState;
|
import org.orekit.errors.*; import org.orekit.propagation.*;
|
[
"org.orekit.errors",
"org.orekit.propagation"
] |
org.orekit.errors; org.orekit.propagation;
| 1,129,166
|
public void waitTillPresent(long time, TimeUnit unit) {
wd().wait(getSelector(), time, unit);
}
|
void function(long time, TimeUnit unit) { wd().wait(getSelector(), time, unit); }
|
/**
* Waits until the component is present with a timeout.
*/
|
Waits until the component is present with a timeout
|
waitTillPresent
|
{
"repo_name": "fjalvingh/domui",
"path": "integrations/to.etc.domui.selenium/src/main/java/to/etc/domui/webdriver/poproxies/AbstractCpComponent.java",
"license": "lgpl-2.1",
"size": 2898
}
|
[
"java.util.concurrent.TimeUnit"
] |
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 1,652,151
|
public void setRotation(RotationInfo rotation) {
this.rotation = rotation;
}
public static class ChoiceInfo implements Serializable {
private static final long serialVersionUID = 100;
private int choiceListSelect = -1;
private static final int EXTERNAL_GRAPHIC_CHOICE = 0;
private static final int MARK_CHOICE = 1;
private ExternalGraphicInfo externalGraphic;
private MarkInfo mark;
|
void function(RotationInfo rotation) { this.rotation = rotation; } public static class ChoiceInfo implements Serializable { private static final long serialVersionUID = 100; private int choiceListSelect = -1; private static final int EXTERNAL_GRAPHIC_CHOICE = 0; private static final int MARK_CHOICE = 1; private ExternalGraphicInfo externalGraphic; private MarkInfo mark;
|
/**
* Set the 'Rotation' element value.
*
* @param rotation
*/
|
Set the 'Rotation' element value
|
setRotation
|
{
"repo_name": "oliverm-be/geomajas",
"path": "project/geomajas-project-sld/api/src/main/java/org/geomajas/sld/GraphicInfo.java",
"license": "agpl-3.0",
"size": 8805
}
|
[
"java.io.Serializable"
] |
import java.io.Serializable;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,190,393
|
private void linkAllBlocks(File fromDir, File fromBbwDir, File toDir)
throws IOException {
HardLink hardLink = new HardLink();
// do the link
int diskLayoutVersion = this.getLayoutVersion();
if (LayoutVersion.supports(Feature.APPEND_RBW_DIR, diskLayoutVersion)) {
// hardlink finalized blocks in tmpDir/finalized
linkBlocks(new File(fromDir, STORAGE_DIR_FINALIZED),
new File(toDir, STORAGE_DIR_FINALIZED), diskLayoutVersion, hardLink);
// hardlink rbw blocks in tmpDir/rbw
linkBlocks(new File(fromDir, STORAGE_DIR_RBW),
new File(toDir, STORAGE_DIR_RBW), diskLayoutVersion, hardLink);
} else { // pre-RBW version
// hardlink finalized blocks in tmpDir
linkBlocks(fromDir, new File(toDir, STORAGE_DIR_FINALIZED),
diskLayoutVersion, hardLink);
if (fromBbwDir.exists()) {
linkBlocks(fromBbwDir,
new File(toDir, STORAGE_DIR_RBW), diskLayoutVersion, hardLink);
}
}
LOG.info( hardLink.linkStats.report() );
}
|
void function(File fromDir, File fromBbwDir, File toDir) throws IOException { HardLink hardLink = new HardLink(); int diskLayoutVersion = this.getLayoutVersion(); if (LayoutVersion.supports(Feature.APPEND_RBW_DIR, diskLayoutVersion)) { linkBlocks(new File(fromDir, STORAGE_DIR_FINALIZED), new File(toDir, STORAGE_DIR_FINALIZED), diskLayoutVersion, hardLink); linkBlocks(new File(fromDir, STORAGE_DIR_RBW), new File(toDir, STORAGE_DIR_RBW), diskLayoutVersion, hardLink); } else { linkBlocks(fromDir, new File(toDir, STORAGE_DIR_FINALIZED), diskLayoutVersion, hardLink); if (fromBbwDir.exists()) { linkBlocks(fromBbwDir, new File(toDir, STORAGE_DIR_RBW), diskLayoutVersion, hardLink); } } LOG.info( hardLink.linkStats.report() ); }
|
/**
* Hardlink all finalized and RBW blocks in fromDir to toDir
*
* @param fromDir The directory where the 'from' snapshot is stored
* @param fromBbwDir In HDFS 1.x, the directory where blocks
* that are under construction are stored.
* @param toDir The current data directory
*
* @throws IOException If error occurs during hardlink
*/
|
Hardlink all finalized and RBW blocks in fromDir to toDir
|
linkAllBlocks
|
{
"repo_name": "ict-carch/hadoop-plus",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java",
"license": "apache-2.0",
"size": 27571
}
|
[
"java.io.File",
"java.io.IOException",
"org.apache.hadoop.fs.HardLink",
"org.apache.hadoop.hdfs.protocol.LayoutVersion"
] |
import java.io.File; import java.io.IOException; import org.apache.hadoop.fs.HardLink; import org.apache.hadoop.hdfs.protocol.LayoutVersion;
|
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.protocol.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,177,282
|
public synchronized List<V> getCheckedItems() {
List<V> result = new ArrayList<>();
for(int i = 0; i < itemStatus.size(); i++) {
if(itemStatus.get(i)) {
result.add(getItemAt(i));
}
}
return result;
}
/**
* Adds a new listener to the {@code CheckBoxList} that will be called on certain user actions
* @param listener Listener to attach to this {@code CheckBoxList}
|
synchronized List<V> function() { List<V> result = new ArrayList<>(); for(int i = 0; i < itemStatus.size(); i++) { if(itemStatus.get(i)) { result.add(getItemAt(i)); } } return result; } /** * Adds a new listener to the {@code CheckBoxList} that will be called on certain user actions * @param listener Listener to attach to this {@code CheckBoxList}
|
/**
* Returns all the items in the list box that have checked state, as a list
* @return List of all items in the list box that has checked state on
*/
|
Returns all the items in the list box that have checked state, as a list
|
getCheckedItems
|
{
"repo_name": "mabe02/lanterna",
"path": "src/main/java/com/googlecode/lanterna/gui2/CheckBoxList.java",
"license": "lgpl-3.0",
"size": 12616
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 21,600
|
@Override
protected boolean prepare(Context2D context, Attributes attr, double alpha)
{
Point2DArray list = getPolygon(); // is null for invalid arrow definition
if ((null != list) && (list.size() > 2))
{
Point2D point = list.get(0);
context.beginPath();
context.moveTo(point.getX(), point.getY());
final int leng = list.size();
for (int i = 1; i < leng; i++)
{
point = list.get(i);
context.lineTo(point.getX(), point.getY());
}
context.closePath();
return true;
}
return false;
}
|
boolean function(Context2D context, Attributes attr, double alpha) { Point2DArray list = getPolygon(); if ((null != list) && (list.size() > 2)) { Point2D point = list.get(0); context.beginPath(); context.moveTo(point.getX(), point.getY()); final int leng = list.size(); for (int i = 1; i < leng; i++) { point = list.get(i); context.lineTo(point.getX(), point.getY()); } context.closePath(); return true; } return false; }
|
/**
* Draws this arrow.
*
* @param context the {@link Context2D} used to draw this arrow.
*/
|
Draws this arrow
|
prepare
|
{
"repo_name": "psiroky/dashbuilder",
"path": "dashbuilder-client/dashbuilder-lienzo/dashbuilder-lienzo-core/src/main/java/com/ait/lienzo/client/core/shape/Arrow.java",
"license": "apache-2.0",
"size": 15193
}
|
[
"com.ait.lienzo.client.core.Context2D",
"com.ait.lienzo.client.core.types.Point2D",
"com.ait.lienzo.client.core.types.Point2DArray"
] |
import com.ait.lienzo.client.core.Context2D; import com.ait.lienzo.client.core.types.Point2D; import com.ait.lienzo.client.core.types.Point2DArray;
|
import com.ait.lienzo.client.core.*; import com.ait.lienzo.client.core.types.*;
|
[
"com.ait.lienzo"
] |
com.ait.lienzo;
| 1,353,761
|
public Map<String, Object> getAttributes();
|
Map<String, Object> function();
|
/**
* Adapter attributes. Adapter must at least support the keys listed in this
* interface, but may support their own special keys.
*
* @return The attributes
*/
|
Adapter attributes. Adapter must at least support the keys listed in this interface, but may support their own special keys
|
getAttributes
|
{
"repo_name": "tliron/scripturian",
"path": "components/scripturian/source/com/threecrickets/scripturian/LanguageAdapter.java",
"license": "lgpl-3.0",
"size": 6825
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,369,077
|
private ImmutableMap<String, PackageArgument<?>> createPackageArguments() {
ImmutableList.Builder<PackageArgument<?>> arguments =
ImmutableList.<PackageArgument<?>>builder()
.add(new DefaultDeprecation())
.add(new DefaultDistribs())
.add(new DefaultLicenses())
.add(new DefaultTestOnly())
.add(new DefaultVisibility())
.add(new Features())
.add(new DefaultCompatibleWith())
.add(new DefaultRestrictedTo());
for (EnvironmentExtension extension : environmentExtensions) {
arguments.addAll(extension.getPackageArguments());
}
ImmutableMap.Builder<String, PackageArgument<?>> packageArguments = ImmutableMap.builder();
for (PackageArgument<?> argument : arguments.build()) {
packageArguments.put(argument.getName(), argument);
}
return packageArguments.build();
}
|
ImmutableMap<String, PackageArgument<?>> function() { ImmutableList.Builder<PackageArgument<?>> arguments = ImmutableList.<PackageArgument<?>>builder() .add(new DefaultDeprecation()) .add(new DefaultDistribs()) .add(new DefaultLicenses()) .add(new DefaultTestOnly()) .add(new DefaultVisibility()) .add(new Features()) .add(new DefaultCompatibleWith()) .add(new DefaultRestrictedTo()); for (EnvironmentExtension extension : environmentExtensions) { arguments.addAll(extension.getPackageArguments()); } ImmutableMap.Builder<String, PackageArgument<?>> packageArguments = ImmutableMap.builder(); for (PackageArgument<?> argument : arguments.build()) { packageArguments.put(argument.getName(), argument); } return packageArguments.build(); }
|
/**
* Creates the list of arguments for the 'package' function.
*/
|
Creates the list of arguments for the 'package' function
|
createPackageArguments
|
{
"repo_name": "dinowernli/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java",
"license": "apache-2.0",
"size": 60356
}
|
[
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableMap"
] |
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.*;
|
[
"com.google.common"
] |
com.google.common;
| 406,130
|
public void setNamespaceContextBuilder(NamespaceContextBuilder namespaceContextBuilder) {
this.namespaceContextBuilder = namespaceContextBuilder;
}
|
void function(NamespaceContextBuilder namespaceContextBuilder) { this.namespaceContextBuilder = namespaceContextBuilder; }
|
/**
* Sets the namespace context builder.
* @param namespaceContextBuilder
*/
|
Sets the namespace context builder
|
setNamespaceContextBuilder
|
{
"repo_name": "christophd/citrus",
"path": "validation/citrus-validation-xml/src/main/java/com/consol/citrus/validation/xml/XpathMessageValidator.java",
"license": "apache-2.0",
"size": 6773
}
|
[
"com.consol.citrus.xml.namespace.NamespaceContextBuilder"
] |
import com.consol.citrus.xml.namespace.NamespaceContextBuilder;
|
import com.consol.citrus.xml.namespace.*;
|
[
"com.consol.citrus"
] |
com.consol.citrus;
| 2,529,728
|
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.sendError(418, "I am a teapot");
}
|
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendError(418, STR); }
|
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
|
Handles the HTTP <code>GET</code> method
|
doGet
|
{
"repo_name": "ITG-Code/Dan-MediaDistributor",
"path": "src/java/se/definewild/mediadist/servlet/AddSubscription.java",
"license": "mit",
"size": 4866
}
|
[
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] |
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
|
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
|
[
"java.io",
"javax.servlet"
] |
java.io; javax.servlet;
| 374,397
|
@SuppressWarnings("rawtypes")
public AvroCollector getCollector(String namedOutput,String multiName, Reporter reporter)
throws IOException{
return getCollector(namedOutput,multiName,reporter,namedOutput,null);
}
|
@SuppressWarnings(STR) AvroCollector function(String namedOutput,String multiName, Reporter reporter) throws IOException{ return getCollector(namedOutput,multiName,reporter,namedOutput,null); }
|
/**
* Gets the output collector for a named output.
* <p/>
*
* @param namedOutput the named output name
* @param reporter the reporter
* @param multiName the multiname
* @return the output collector for the given named output
* @throws IOException thrown if output collector could not be created
*/
|
Gets the output collector for a named output.
|
getCollector
|
{
"repo_name": "RallySoftware/avro",
"path": "lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroMultipleOutputs.java",
"license": "apache-2.0",
"size": 22156
}
|
[
"java.io.IOException",
"org.apache.hadoop.mapred.Reporter"
] |
import java.io.IOException; import org.apache.hadoop.mapred.Reporter;
|
import java.io.*; import org.apache.hadoop.mapred.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,816,771
|
public BaseViewHolder setOnCheckedChangeListener(int viewId, CompoundButton.OnCheckedChangeListener listener) {
CompoundButton view = getView(viewId);
view.setOnCheckedChangeListener(listener);
return this;
}
|
BaseViewHolder function(int viewId, CompoundButton.OnCheckedChangeListener listener) { CompoundButton view = getView(viewId); view.setOnCheckedChangeListener(listener); return this; }
|
/**
* Sets the on checked change listener of the view.
*
* @param viewId The view id.
* @param listener The checked change listener of compound button.
* @return The BaseViewHolder for chaining.
*/
|
Sets the on checked change listener of the view
|
setOnCheckedChangeListener
|
{
"repo_name": "mcshengInworking/MFrame",
"path": "library/src/main/java/com/mcs/mframe/ui/recyclerview/BaseViewHolder.java",
"license": "apache-2.0",
"size": 15077
}
|
[
"android.widget.CompoundButton"
] |
import android.widget.CompoundButton;
|
import android.widget.*;
|
[
"android.widget"
] |
android.widget;
| 2,446,795
|
public static <E extends Enum<E>> EnumMultiset<E> create(Iterable<E> elements) {
Iterator<E> iterator = elements.iterator();
checkArgument(iterator.hasNext(), "EnumMultiset constructor passed empty Iterable");
EnumMultiset<E> multiset = new EnumMultiset<>(iterator.next().getDeclaringClass());
Iterables.addAll(multiset, elements);
return multiset;
}
|
static <E extends Enum<E>> EnumMultiset<E> function(Iterable<E> elements) { Iterator<E> iterator = elements.iterator(); checkArgument(iterator.hasNext(), STR); EnumMultiset<E> multiset = new EnumMultiset<>(iterator.next().getDeclaringClass()); Iterables.addAll(multiset, elements); return multiset; }
|
/**
* Creates a new {@code EnumMultiset} containing the specified elements.
*
* <p>This implementation is highly efficient when {@code elements} is itself a {@link Multiset}.
*
* @param elements the elements that the multiset should contain
* @throws IllegalArgumentException if {@code elements} is empty
*/
|
Creates a new EnumMultiset containing the specified elements. This implementation is highly efficient when elements is itself a <code>Multiset</code>
|
create
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/guava25/collect/EnumMultiset.java",
"license": "mit",
"size": 8943
}
|
[
"com.azure.cosmos.implementation.guava25.base.Preconditions",
"java.util.Iterator"
] |
import com.azure.cosmos.implementation.guava25.base.Preconditions; import java.util.Iterator;
|
import com.azure.cosmos.implementation.guava25.base.*; import java.util.*;
|
[
"com.azure.cosmos",
"java.util"
] |
com.azure.cosmos; java.util;
| 2,157,561
|
@Test
public void testNoCloseEvent() {
try {
PooledConnection pc = getPooledConnection();
CountClose cc = new CountClose();
pc.addConnectionEventListener(cc);
con = pc.getConnection();
assertTrue(cc.getCount() == 0);
assertTrue(cc.getErrorCount() == 0);
con.close();
assertTrue(cc.getCount() == 1);
assertTrue(cc.getErrorCount() == 0);
pc.removeConnectionEventListener(cc);
con = pc.getConnection();
assertTrue(cc.getCount() == 1);
assertTrue(cc.getErrorCount() == 0);
con.close();
assertTrue(cc.getCount() == 1);
assertTrue(cc.getErrorCount() == 0);
} catch (SQLException e) {
fail(e.getMessage());
}
}
|
void function() { try { PooledConnection pc = getPooledConnection(); CountClose cc = new CountClose(); pc.addConnectionEventListener(cc); con = pc.getConnection(); assertTrue(cc.getCount() == 0); assertTrue(cc.getErrorCount() == 0); con.close(); assertTrue(cc.getCount() == 1); assertTrue(cc.getErrorCount() == 0); pc.removeConnectionEventListener(cc); con = pc.getConnection(); assertTrue(cc.getCount() == 1); assertTrue(cc.getErrorCount() == 0); con.close(); assertTrue(cc.getCount() == 1); assertTrue(cc.getErrorCount() == 0); } catch (SQLException e) { fail(e.getMessage()); } }
|
/**
* Makes sure that close events are not fired after a listener has been removed.
*/
|
Makes sure that close events are not fired after a listener has been removed
|
testNoCloseEvent
|
{
"repo_name": "panchenko/pgjdbc",
"path": "pgjdbc/src/test/java/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java",
"license": "bsd-2-clause",
"size": 16936
}
|
[
"java.sql.SQLException",
"javax.sql.PooledConnection",
"org.junit.Assert"
] |
import java.sql.SQLException; import javax.sql.PooledConnection; import org.junit.Assert;
|
import java.sql.*; import javax.sql.*; import org.junit.*;
|
[
"java.sql",
"javax.sql",
"org.junit"
] |
java.sql; javax.sql; org.junit;
| 987,137
|
public boolean val() throws VariableNotFoundException {
Number aValue = retrieveValue(this.a.val());
Number bValue = retrieveValue(this.b.val());
return aValue.floatValue() == bValue.floatValue();
}
|
boolean function() throws VariableNotFoundException { Number aValue = retrieveValue(this.a.val()); Number bValue = retrieveValue(this.b.val()); return aValue.floatValue() == bValue.floatValue(); }
|
/**
* Valuta l'espressione
*
* @throws VariableNotFoundException
* Variabile non trovata
* @return true se ha trovato la variabile
*/
|
Valuta l'espressione
|
val
|
{
"repo_name": "marcosperanza/logo",
"path": "src/main/java/org/logo/viewer/exp/bool/Eq.java",
"license": "apache-2.0",
"size": 1582
}
|
[
"org.logo.viewer.logo.exception.VariableNotFoundException"
] |
import org.logo.viewer.logo.exception.VariableNotFoundException;
|
import org.logo.viewer.logo.exception.*;
|
[
"org.logo.viewer"
] |
org.logo.viewer;
| 599,866
|
T setSupertype(Type type);
|
T setSupertype(Type type);
|
/**
* Sets the super type of this model.
*
* @param type the super type
* @return a reference to this
*/
|
Sets the super type of this model
|
setSupertype
|
{
"repo_name": "Pyknic/CodeGen",
"path": "src/main/java/com/speedment/common/codegen/model/trait/HasSupertype.java",
"license": "apache-2.0",
"size": 1290
}
|
[
"java.lang.reflect.Type"
] |
import java.lang.reflect.Type;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 1,101,514
|
static String getRequestResponseText(JsonRequest<?> request, JSONObject response)
{
StringBuilder msg = new StringBuilder();
msg.append( methodToString( request.getMethod() ) ).append(" request successful ").append("\n");
msg.append("URL: ").append(request.getUrl()).append("\n");
msg.append("Response: ").append(response.toString()).append("\n");
return msg.toString();
}
|
static String getRequestResponseText(JsonRequest<?> request, JSONObject response) { StringBuilder msg = new StringBuilder(); msg.append( methodToString( request.getMethod() ) ).append(STR).append("\n"); msg.append(STR).append(request.getUrl()).append("\n"); msg.append(STR).append(response.toString()).append("\n"); return msg.toString(); }
|
/**
* Gets Request response information.
*
* @param request
* Request instance to retrieve information for logging
*
* @param response
* Response instance to retrieve information for logging
*
* @return Message describing response, including Method type, URL and JSON response
* */
|
Gets Request response information
|
getRequestResponseText
|
{
"repo_name": "SpartanJ/restafari",
"path": "restafari/src/main/java/com/ensoft/restafari/network/rest/request/RequestLoggingHelper.java",
"license": "mit",
"size": 5236
}
|
[
"com.android.volley.toolbox.JsonRequest",
"org.json.JSONObject"
] |
import com.android.volley.toolbox.JsonRequest; import org.json.JSONObject;
|
import com.android.volley.toolbox.*; import org.json.*;
|
[
"com.android.volley",
"org.json"
] |
com.android.volley; org.json;
| 1,728,903
|
public ListResponse list(String categoryId) throws IOException {
return list(categoryId, null, null, null);
}
|
ListResponse function(String categoryId) throws IOException { return list(categoryId, null, null, null); }
|
/**
* Equivalent of <code>list(categoryId, null, null, null)</code>. It fetches
* sub-categories of given category!
*/
|
Equivalent of <code>list(categoryId, null, null, null)</code>. It fetches sub-categories of given category
|
list
|
{
"repo_name": "Akdeniz/google-play-crawler",
"path": "src/main/java/com/akdeniz/googleplaycrawler/GooglePlayAPI.java",
"license": "bsd-2-clause",
"size": 24147
}
|
[
"com.akdeniz.googleplaycrawler.GooglePlay",
"java.io.IOException"
] |
import com.akdeniz.googleplaycrawler.GooglePlay; import java.io.IOException;
|
import com.akdeniz.googleplaycrawler.*; import java.io.*;
|
[
"com.akdeniz.googleplaycrawler",
"java.io"
] |
com.akdeniz.googleplaycrawler; java.io;
| 844,530
|
@Override
protected Map<String, SAML2Requestor> readRequestors(IConfigurationManager
oConfigManager, Element elConfig) throws OAException {
Map<String, SAML2Requestor> resultMap = new HashMap<>();
// local requestors from LDAP
if (_mapRequestors != null)
for (String key : _mapRequestors.keySet()) {
resultMap.put(key, _mapRequestors.get(key));
}
// parent requestors from XML
Map<String, SAML2Requestor> mapRequestors = super.readRequestors(oConfigManager, elConfig);
if (mapRequestors != null)
for (String key : mapRequestors.keySet()) {
resultMap.put(key, mapRequestors.get(key));
}
return mapRequestors;
}
|
Map<String, SAML2Requestor> function(IConfigurationManager oConfigManager, Element elConfig) throws OAException { Map<String, SAML2Requestor> resultMap = new HashMap<>(); if (_mapRequestors != null) for (String key : _mapRequestors.keySet()) { resultMap.put(key, _mapRequestors.get(key)); } Map<String, SAML2Requestor> mapRequestors = super.readRequestors(oConfigManager, elConfig); if (mapRequestors != null) for (String key : mapRequestors.keySet()) { resultMap.put(key, mapRequestors.get(key)); } return mapRequestors; }
|
/**
* Read the <requestor> elements from the configuration, instantiate SAML2Requestor-instances
* and put them in a map with [requestor.id] -> [SAML2Requestor-instance]
*
* @param oConfigManager ConfigManager for processing configuration
* @param elConfig requestors-configuration containing <requestor$gt; elements
* @return Map of instantiated ISAML2Requestors
* @throws OAException
*/
|
Read the <requestor> elements from the configuration, instantiate SAML2Requestor-instances and put them in a map with [requestor.id] -> [SAML2Requestor-instance]
|
readRequestors
|
{
"repo_name": "GluuFederation/gluu-Asimba",
"path": "asimba-saml2-utility/src/main/java/com/alfaariss/oa/util/saml2/SAML2RequestorsLDAP.java",
"license": "agpl-3.0",
"size": 6422
}
|
[
"com.alfaariss.oa.OAException",
"com.alfaariss.oa.api.configuration.IConfigurationManager",
"java.util.HashMap",
"java.util.Map",
"org.w3c.dom.Element"
] |
import com.alfaariss.oa.OAException; import com.alfaariss.oa.api.configuration.IConfigurationManager; import java.util.HashMap; import java.util.Map; import org.w3c.dom.Element;
|
import com.alfaariss.oa.*; import com.alfaariss.oa.api.configuration.*; import java.util.*; import org.w3c.dom.*;
|
[
"com.alfaariss.oa",
"java.util",
"org.w3c.dom"
] |
com.alfaariss.oa; java.util; org.w3c.dom;
| 1,716,147
|
private void opcionesLineaSeleccionada() {
List<CharSequence> itemsL = new ArrayList<>();
itemsL.add(getString(R.string.menu_alarma));
itemsL.add(getString(R.string.menu_share));
itemsL.add(getString(R.string.menu_ver_en_mapa));
itemsL.add(getString(R.string.menu_leer));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
itemsL.add(getString(R.string.menu_widget));
}
final CharSequence[] items = itemsL.toArray(new CharSequence[itemsL.size()]);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.menu_contextual);
|
void function() { List<CharSequence> itemsL = new ArrayList<>(); itemsL.add(getString(R.string.menu_alarma)); itemsL.add(getString(R.string.menu_share)); itemsL.add(getString(R.string.menu_ver_en_mapa)); itemsL.add(getString(R.string.menu_leer)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { itemsL.add(getString(R.string.menu_widget)); } final CharSequence[] items = itemsL.toArray(new CharSequence[itemsL.size()]); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.menu_contextual);
|
/**
* Menu de seleccion de linea
*/
|
Menu de seleccion de linea
|
opcionesLineaSeleccionada
|
{
"repo_name": "alberapps/tiempobus",
"path": "TiempoBus/src/alberapps/android/tiempobus/MainActivity.java",
"license": "gpl-3.0",
"size": 82009
}
|
[
"android.os.Build",
"androidx.appcompat.app.AlertDialog",
"java.util.ArrayList",
"java.util.List"
] |
import android.os.Build; import androidx.appcompat.app.AlertDialog; import java.util.ArrayList; import java.util.List;
|
import android.os.*; import androidx.appcompat.app.*; import java.util.*;
|
[
"android.os",
"androidx.appcompat",
"java.util"
] |
android.os; androidx.appcompat; java.util;
| 1,686,574
|
private void initDataGroups(List<FeatureTerm> orderedTerms, FTKBase dm) throws FeatureTermException {
Graph g = new Graph(true);
g.addColumn("id", Integer.class);
g.addColumn("name", String.class);
// Create nodes:
for (FeatureTerm t : orderedTerms) {
g.addNode();
}
// Create links:
// Compute the properties tree:
int l = orderedTerms.size();
boolean[] subsumtionMatrix = new boolean[l * l];
for (int i = 0; i < l * l; i++)
subsumtionMatrix[i] = false;
for (int i = 0; i < l; i++) {
for (int j = 0; j < l; j++) {
if (i != j) {
if (orderedTerms.get(i).subsumes(orderedTerms.get(j))) {
subsumtionMatrix[i * l + j] = true;
System.out.print("1 ");
} else {
System.out.print("0 ");
}
}
}
System.out.println("");
}
// Preprocess the matrix:
{
for (int i = 0; i < l; i++) {
for (int j = 0; j < l; j++) {
if (subsumtionMatrix[i * l + j]) {
for (int k = 0; k < l; k++) {
if (k != j && subsumtionMatrix[k * l + j]) {
if (subsumtionMatrix[i * l + k]) {
subsumtionMatrix[i * l + j] = false;
}
}
}
}
}
}
}
// Create the actual links:
for (int i = 0; i < l; i++) {
for (int j = 0; j < l; j++) {
if (i != j) {
if (subsumtionMatrix[i * l + j]) {
Node n1 = g.getNode(i);
Node n2 = g.getNode(j);
Edge e = g.addEdge(n1, n2);
System.out.print("1 ");
} else {
System.out.print("0 ");
}
}
}
System.out.println("");
}
VisualGraph vg = m_vis.addGraph(GRAPH, g);
// Set labels:
Iterator i = vg.nodes();
for (FeatureTerm t : orderedTerms) {
VisualItem vi = (VisualItem) i.next();
vi.set("id", new Integer(orderedTerms.indexOf(t)));
vi.set("name", "P" + (orderedTerms.indexOf(t)));
vi.setStrokeColor(ColorLib.rgb(128, 128, 128));
vi.set(VisualItem.TEXTCOLOR, ColorLib.gray(0));
}
// Set colors:
i = vg.edges();
while (i.hasNext()) {
VisualItem vi = (VisualItem) i.next();
vi.setFillColor(ColorLib.gray(0));
vi.setTextColor(ColorLib.rgb(0, 128, 0));
}
}
}
class PropertiesSelectControl extends ControlAdapter {
public VisualItem menuItem = null;
public List<FeatureTerm> terms = null;
public FTKBase dm = null;
protected VisualItem activeItem;
protected Point2D down = new Point2D.Double();
protected Point2D temp = new Point2D.Double();
protected boolean dragged;
final JPopupMenu menu = new JPopupMenu();
public PropertiesSelectControl(List<FeatureTerm> t, FTKBase a_dm) {
terms = t;
dm = a_dm;
}
|
void function(List<FeatureTerm> orderedTerms, FTKBase dm) throws FeatureTermException { Graph g = new Graph(true); g.addColumn("id", Integer.class); g.addColumn("name", String.class); for (FeatureTerm t : orderedTerms) { g.addNode(); } int l = orderedTerms.size(); boolean[] subsumtionMatrix = new boolean[l * l]; for (int i = 0; i < l * l; i++) subsumtionMatrix[i] = false; for (int i = 0; i < l; i++) { for (int j = 0; j < l; j++) { if (i != j) { if (orderedTerms.get(i).subsumes(orderedTerms.get(j))) { subsumtionMatrix[i * l + j] = true; System.out.print(STR); } else { System.out.print(STR); } } } System.out.println(""); } { for (int i = 0; i < l; i++) { for (int j = 0; j < l; j++) { if (subsumtionMatrix[i * l + j]) { for (int k = 0; k < l; k++) { if (k != j && subsumtionMatrix[k * l + j]) { if (subsumtionMatrix[i * l + k]) { subsumtionMatrix[i * l + j] = false; } } } } } } } for (int i = 0; i < l; i++) { for (int j = 0; j < l; j++) { if (i != j) { if (subsumtionMatrix[i * l + j]) { Node n1 = g.getNode(i); Node n2 = g.getNode(j); Edge e = g.addEdge(n1, n2); System.out.print(STR); } else { System.out.print(STR); } } } System.out.println("STRidSTRnameSTRP" + (orderedTerms.indexOf(t))); vi.setStrokeColor(ColorLib.rgb(128, 128, 128)); vi.set(VisualItem.TEXTCOLOR, ColorLib.gray(0)); } i = vg.edges(); while (i.hasNext()) { VisualItem vi = (VisualItem) i.next(); vi.setFillColor(ColorLib.gray(0)); vi.setTextColor(ColorLib.rgb(0, 128, 0)); } } } class PropertiesSelectControl extends ControlAdapter { public VisualItem menuItem = null; public List<FeatureTerm> terms = null; public FTKBase dm = null; protected VisualItem activeItem; protected Point2D down = new Point2D.Double(); protected Point2D temp = new Point2D.Double(); protected boolean dragged; final JPopupMenu menu = new JPopupMenu(); public PropertiesSelectControl(List<FeatureTerm> t, FTKBase a_dm) { terms = t; dm = a_dm; }
|
/**
* Inits the data groups.
*
* @param orderedTerms
* the ordered terms
* @param dm
* the dm
* @throws FeatureTermException
* the feature term exception
*/
|
Inits the data groups
|
initDataGroups
|
{
"repo_name": "santiontanon/fterm",
"path": "src/ftl/base/visualization/PropertiesVisualizer.java",
"license": "bsd-3-clause",
"size": 12092
}
|
[
"java.awt.geom.Point2D",
"java.util.List",
"javax.swing.JPopupMenu"
] |
import java.awt.geom.Point2D; import java.util.List; import javax.swing.JPopupMenu;
|
import java.awt.geom.*; import java.util.*; import javax.swing.*;
|
[
"java.awt",
"java.util",
"javax.swing"
] |
java.awt; java.util; javax.swing;
| 146,876
|
// -----------------------------------------------
private boolean search_blank_image( String s_tile_id ) throws IOException {
boolean b_unique = true;
if (i_type_tiles != 1) { // there will be no 'images' table, return
return b_unique;
}
String s_sql_query = "SELECT count(tile_id) AS count_tile_id FROM images WHERE (tile_id = '" + s_tile_id + "')";
// mj10777: A good wms-server to test 'blank-images' (i.e. all pixels of image have the
// same RGB) is:
// http://fbinter.stadt-berlin.de/fb/wms/senstadt/ortsteil?LAYERS=0&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=visual&SRS=EPSG:4326&BBOX=XXX,YYY,XXX,YYY&WIDTH=256&HEIGHT=256
// SELECT count(tile_id) FROM images where tile_id like '%.rgb' : 8
// SELECT count(tile_id) FROM map where tile_id like '%.rgb' : 177
db_lock.readLock().lock();
try {
final Cursor c = db_mbtiles.rawQuery(s_sql_query, null);
if (c != null) {
if (c.moveToFirst()) {
int i_count_tile_id = c.getInt(c.getColumnIndex("count_tile_id"));
if (i_count_tile_id > 0) { // We have this image, do not add again
b_unique = false;
}
}
c.close();
}
} catch (Exception e) {
String s_message = e.getMessage();
int index_of_text = s_message.indexOf("closed");
if (index_of_text != -1) {
// attempt to re-open an already-closed [sometimes: 'already closed']
return false;
} else {
throw new IOException("MBTilesDroidSpitter:search_blank_image query[" + s_sql_query + "] error["
+ e.getLocalizedMessage() + "] ");
}
} finally {
db_lock.readLock().unlock();
}
return b_unique;
}
|
boolean function( String s_tile_id ) throws IOException { boolean b_unique = true; if (i_type_tiles != 1) { return b_unique; } String s_sql_query = STR + s_tile_id + "')"; db_lock.readLock().lock(); try { final Cursor c = db_mbtiles.rawQuery(s_sql_query, null); if (c != null) { if (c.moveToFirst()) { int i_count_tile_id = c.getInt(c.getColumnIndex(STR)); if (i_count_tile_id > 0) { b_unique = false; } } c.close(); } } catch (Exception e) { String s_message = e.getMessage(); int index_of_text = s_message.indexOf(STR); if (index_of_text != -1) { return false; } else { throw new IOException(STR + s_sql_query + STR + e.getLocalizedMessage() + STR); } } finally { db_lock.readLock().unlock(); } return b_unique; }
|
/**
* Function to check if image is blank
* - avoids duplicate images
* @param s_tile_id the image tile_id
* @return true if unique or false if tile_id was found
*/
|
Function to check if image is blank - avoids duplicate images
|
search_blank_image
|
{
"repo_name": "gabrielmancilla/mtisig",
"path": "geopaparazzispatialitelibrary/src/eu/geopaparazzi/spatialite/database/spatial/core/mbtiles/MBTilesDroidSpitter.java",
"license": "gpl-3.0",
"size": 100537
}
|
[
"android.database.Cursor",
"java.io.IOException"
] |
import android.database.Cursor; import java.io.IOException;
|
import android.database.*; import java.io.*;
|
[
"android.database",
"java.io"
] |
android.database; java.io;
| 475,092
|
protected MessageConsumer createConsumer(Session session, Destination destination) throws JMSException {
return session.createConsumer(destination);
}
|
MessageConsumer function(Session session, Destination destination) throws JMSException { return session.createConsumer(destination); }
|
/**
* Create a JMS MessageConsumer for the given Session and Destination.
* <p>This implementation uses JMS 1.1 API.
* @param session the JMS Session to create a MessageConsumer for
* @param destination the JMS Destination to create a MessageConsumer for
* @return the new JMS MessageConsumer
* @throws JMSException if thrown by JMS API methods
*/
|
Create a JMS MessageConsumer for the given Session and Destination. This implementation uses JMS 1.1 API
|
createConsumer
|
{
"repo_name": "dachengxi/spring1.1.1_source",
"path": "src/org/springframework/jms/core/JmsTemplate.java",
"license": "mit",
"size": 26282
}
|
[
"javax.jms.Destination",
"javax.jms.JMSException",
"javax.jms.MessageConsumer",
"javax.jms.Session"
] |
import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.MessageConsumer; import javax.jms.Session;
|
import javax.jms.*;
|
[
"javax.jms"
] |
javax.jms;
| 513,798
|
public void markPageAccessed(BookmarkId bookmarkId) {
assert mIsNativeOfflinePageModelLoaded;
nativeMarkPageAccessed(mNativeOfflinePageBridge, bookmarkId.getId());
}
|
void function(BookmarkId bookmarkId) { assert mIsNativeOfflinePageModelLoaded; nativeMarkPageAccessed(mNativeOfflinePageBridge, bookmarkId.getId()); }
|
/**
* Marks that an offline page related to a specified bookmark has been accessed.
*
* @param bookmarkId Bookmark ID for which the offline copy will be deleted.
*/
|
Marks that an offline page related to a specified bookmark has been accessed
|
markPageAccessed
|
{
"repo_name": "Workday/OpenFrame",
"path": "chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java",
"license": "bsd-3-clause",
"size": 16483
}
|
[
"org.chromium.components.bookmarks.BookmarkId"
] |
import org.chromium.components.bookmarks.BookmarkId;
|
import org.chromium.components.bookmarks.*;
|
[
"org.chromium.components"
] |
org.chromium.components;
| 373,371
|
protected synchronized double getAverageLoad() {
int numServers = 0, totalLoad = 0;
for (Map.Entry<ServerName, Set<HRegionInfo>> e: serverHoldings.entrySet()) {
Set<HRegionInfo> regions = e.getValue();
ServerName serverName = e.getKey();
int regionCount = regions.size();
if (regionCount > 0 || serverManager.isServerOnline(serverName)) {
totalLoad += regionCount;
numServers++;
}
}
if (numServers > 1) {
// The master region server holds only a couple regions.
// Don't consider this server in calculating the average load
// if there are other region servers to avoid possible confusion.
Set<HRegionInfo> hris = serverHoldings.get(server.getServerName());
if (hris != null) {
totalLoad -= hris.size();
numServers--;
}
}
return numServers == 0 ? 0.0 :
(double)totalLoad / (double)numServers;
}
|
synchronized double function() { int numServers = 0, totalLoad = 0; for (Map.Entry<ServerName, Set<HRegionInfo>> e: serverHoldings.entrySet()) { Set<HRegionInfo> regions = e.getValue(); ServerName serverName = e.getKey(); int regionCount = regions.size(); if (regionCount > 0 serverManager.isServerOnline(serverName)) { totalLoad += regionCount; numServers++; } } if (numServers > 1) { Set<HRegionInfo> hris = serverHoldings.get(server.getServerName()); if (hris != null) { totalLoad -= hris.size(); numServers--; } } return numServers == 0 ? 0.0 : (double)totalLoad / (double)numServers; }
|
/**
* Compute the average load across all region servers.
* Currently, this uses a very naive computation - just uses the number of
* regions being served, ignoring stats about number of requests.
* @return the average load
*/
|
Compute the average load across all region servers. Currently, this uses a very naive computation - just uses the number of regions being served, ignoring stats about number of requests
|
getAverageLoad
|
{
"repo_name": "intel-hadoop/hbase-rhino",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java",
"license": "apache-2.0",
"size": 32625
}
|
[
"java.util.Map",
"java.util.Set",
"org.apache.hadoop.hbase.HRegionInfo",
"org.apache.hadoop.hbase.ServerName"
] |
import java.util.Map; import java.util.Set; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName;
|
import java.util.*; import org.apache.hadoop.hbase.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 975,223
|
public GridDiscoveryManager discovery();
|
GridDiscoveryManager function();
|
/**
* Gets discovery manager.
*
* @return Discovery manager.
*/
|
Gets discovery manager
|
discovery
|
{
"repo_name": "vadopolski/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java",
"license": "apache-2.0",
"size": 18159
}
|
[
"org.apache.ignite.internal.managers.discovery.GridDiscoveryManager"
] |
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
|
import org.apache.ignite.internal.managers.discovery.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 408,054
|
FindInfo findDeletedEntriesSince(FindToken token, long maxTotalSizeOfEntries, long endTimeSeconds)
throws StoreException {
StoreFindToken storeToken = (StoreFindToken) token;
StoreFindToken newToken;
List<MessageInfo> messageEntries = new ArrayList<MessageInfo>();
if (storeToken.getType().equals(StoreFindToken.Type.IndexBased)) {
// Case 1: index based
// Find the index segment corresponding to the token indexStartOffset.
// Get entries starting from the token Key in this index.
newToken = findEntriesFromSegmentStartOffset(storeToken.getOffset(), storeToken.getStoreKey(), messageEntries,
new FindEntriesCondition(maxTotalSizeOfEntries, endTimeSeconds), validIndexSegments);
if (newToken.getType().equals(StoreFindToken.Type.Uninitialized)) {
newToken = storeToken;
}
} else {
// journal based or empty
Offset offsetToStart = storeToken.getOffset();
boolean inclusive = false;
if (storeToken.getType().equals(StoreFindToken.Type.Uninitialized)) {
offsetToStart = getStartOffset();
inclusive = true;
}
List<JournalEntry> entries = journal.getEntriesSince(offsetToStart, inclusive);
// we deliberately obtain a snapshot of the index segments AFTER fetching from the journal. This ensures that
// any and all entries returned from the journal are guaranteed to be in the obtained snapshot of indexSegments.
ConcurrentSkipListMap<Offset, IndexSegment> indexSegments = validIndexSegments;
Offset offsetEnd = offsetToStart;
if (entries != null) {
// Case 2: offset based, and offset still in journal
IndexSegment currentSegment = indexSegments.floorEntry(offsetToStart).getValue();
long currentTotalSizeOfEntries = 0;
for (JournalEntry entry : entries) {
if (entry.getOffset().compareTo(currentSegment.getEndOffset()) > 0) {
Offset nextSegmentStartOffset = indexSegments.higherKey(currentSegment.getStartOffset());
currentSegment = indexSegments.get(nextSegmentStartOffset);
}
if (endTimeSeconds < currentSegment.getLastModifiedTimeSecs()) {
break;
}
IndexValue value =
findKey(entry.getKey(), new FileSpan(entry.getOffset(), getCurrentEndOffset(indexSegments)),
EnumSet.allOf(IndexEntryType.class), indexSegments);
if (value.isFlagSet(IndexValue.Flags.Delete_Index)) {
messageEntries.add(new MessageInfo(entry.getKey(), value.getSize(), true,
value.isFlagSet(IndexValue.Flags.Ttl_Update_Index), value.getExpiresAtMs(), value.getAccountId(),
value.getContainerId(), value.getOperationTimeInMs()));
}
offsetEnd = entry.getOffset();
currentTotalSizeOfEntries += value.getSize();
if (currentTotalSizeOfEntries >= maxTotalSizeOfEntries) {
break;
}
}
newToken = new StoreFindToken(offsetEnd, sessionId, incarnationId, false);
} else {
// Case 3: offset based, but offset out of journal
Map.Entry<Offset, IndexSegment> entry = indexSegments.floorEntry(offsetToStart);
if (entry != null && entry.getKey() != indexSegments.lastKey()) {
newToken = findEntriesFromSegmentStartOffset(entry.getKey(), null, messageEntries,
new FindEntriesCondition(maxTotalSizeOfEntries, endTimeSeconds), indexSegments);
if (newToken.getType().equals(StoreFindToken.Type.Uninitialized)) {
newToken = storeToken;
}
} else {
newToken = storeToken; //use the same offset as before.
}
}
}
filterDeleteEntries(messageEntries);
eliminateDuplicates(messageEntries);
return new FindInfo(messageEntries, newToken);
}
|
FindInfo findDeletedEntriesSince(FindToken token, long maxTotalSizeOfEntries, long endTimeSeconds) throws StoreException { StoreFindToken storeToken = (StoreFindToken) token; StoreFindToken newToken; List<MessageInfo> messageEntries = new ArrayList<MessageInfo>(); if (storeToken.getType().equals(StoreFindToken.Type.IndexBased)) { newToken = findEntriesFromSegmentStartOffset(storeToken.getOffset(), storeToken.getStoreKey(), messageEntries, new FindEntriesCondition(maxTotalSizeOfEntries, endTimeSeconds), validIndexSegments); if (newToken.getType().equals(StoreFindToken.Type.Uninitialized)) { newToken = storeToken; } } else { Offset offsetToStart = storeToken.getOffset(); boolean inclusive = false; if (storeToken.getType().equals(StoreFindToken.Type.Uninitialized)) { offsetToStart = getStartOffset(); inclusive = true; } List<JournalEntry> entries = journal.getEntriesSince(offsetToStart, inclusive); ConcurrentSkipListMap<Offset, IndexSegment> indexSegments = validIndexSegments; Offset offsetEnd = offsetToStart; if (entries != null) { IndexSegment currentSegment = indexSegments.floorEntry(offsetToStart).getValue(); long currentTotalSizeOfEntries = 0; for (JournalEntry entry : entries) { if (entry.getOffset().compareTo(currentSegment.getEndOffset()) > 0) { Offset nextSegmentStartOffset = indexSegments.higherKey(currentSegment.getStartOffset()); currentSegment = indexSegments.get(nextSegmentStartOffset); } if (endTimeSeconds < currentSegment.getLastModifiedTimeSecs()) { break; } IndexValue value = findKey(entry.getKey(), new FileSpan(entry.getOffset(), getCurrentEndOffset(indexSegments)), EnumSet.allOf(IndexEntryType.class), indexSegments); if (value.isFlagSet(IndexValue.Flags.Delete_Index)) { messageEntries.add(new MessageInfo(entry.getKey(), value.getSize(), true, value.isFlagSet(IndexValue.Flags.Ttl_Update_Index), value.getExpiresAtMs(), value.getAccountId(), value.getContainerId(), value.getOperationTimeInMs())); } offsetEnd = entry.getOffset(); currentTotalSizeOfEntries += value.getSize(); if (currentTotalSizeOfEntries >= maxTotalSizeOfEntries) { break; } } newToken = new StoreFindToken(offsetEnd, sessionId, incarnationId, false); } else { Map.Entry<Offset, IndexSegment> entry = indexSegments.floorEntry(offsetToStart); if (entry != null && entry.getKey() != indexSegments.lastKey()) { newToken = findEntriesFromSegmentStartOffset(entry.getKey(), null, messageEntries, new FindEntriesCondition(maxTotalSizeOfEntries, endTimeSeconds), indexSegments); if (newToken.getType().equals(StoreFindToken.Type.Uninitialized)) { newToken = storeToken; } } else { newToken = storeToken; } } } filterDeleteEntries(messageEntries); eliminateDuplicates(messageEntries); return new FindInfo(messageEntries, newToken); }
|
/**
* Finds all the deleted entries from the given start token. The token defines the start position in the index from
* where entries needs to be fetched
* @param token The token that signifies the start position in the index from where deleted entries need to be
* retrieved
* @param maxTotalSizeOfEntries The maximum total size of entries that need to be returned. The api will try to
* return a list of entries whose total size is close to this value.
* @param endTimeSeconds The (approximate) time of the latest entry to be fetched. This is used at segment granularity.
* @return The FindInfo state that contains both the list of entries and the new findtoken to start the next iteration
*/
|
Finds all the deleted entries from the given start token. The token defines the start position in the index from where entries needs to be fetched
|
findDeletedEntriesSince
|
{
"repo_name": "pnarayanan/ambry",
"path": "ambry-store/src/main/java/com.github.ambry.store/PersistentIndex.java",
"license": "apache-2.0",
"size": 86790
}
|
[
"java.util.ArrayList",
"java.util.EnumSet",
"java.util.List",
"java.util.Map",
"java.util.concurrent.ConcurrentSkipListMap"
] |
import java.util.ArrayList; import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentSkipListMap;
|
import java.util.*; import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 1,689,762
|
private static <K1, V1, K2, V2> boolean compareSortedMap(SortedMap<K1, V1> map1, SortedMap<K2, V2> map2,
List<String> path, Deque<DualKey> toCompare,
Set<DualKey> visited) {
if (map1.size() != map2.size()) {
return false;
}
Iterator<Map.Entry<K2, V2>> i2 = map2.entrySet().iterator();
for (Map.Entry<K1, V1> entry1 : map1.entrySet()) {
Map.Entry<K2, V2> entry2 = i2.next();
// Must split the Key and Value so that Map.Entry's equals() method is not used.
DualKey dk = new DualKey(path, entry1.getKey(), entry2.getKey());
if (!visited.contains(dk)) {
toCompare.addFirst(dk);
}
dk = new DualKey(path, entry1.getValue(), entry2.getValue());
if (!visited.contains(dk)) {
toCompare.addFirst(dk);
}
}
return true;
}
|
static <K1, V1, K2, V2> boolean function(SortedMap<K1, V1> map1, SortedMap<K2, V2> map2, List<String> path, Deque<DualKey> toCompare, Set<DualKey> visited) { if (map1.size() != map2.size()) { return false; } Iterator<Map.Entry<K2, V2>> i2 = map2.entrySet().iterator(); for (Map.Entry<K1, V1> entry1 : map1.entrySet()) { Map.Entry<K2, V2> entry2 = i2.next(); DualKey dk = new DualKey(path, entry1.getKey(), entry2.getKey()); if (!visited.contains(dk)) { toCompare.addFirst(dk); } dk = new DualKey(path, entry1.getValue(), entry2.getValue()); if (!visited.contains(dk)) { toCompare.addFirst(dk); } } return true; }
|
/**
* Deeply compare two SortedMap instances. This method walks the Maps in
* order, taking advantage of the fact that the Maps are SortedMaps.
*
* @param <K1> the first key type
* @param <V1> the first value type
* @param <K2> the second key type
* @param <V2> the second value type
* @param map1 SortedMap one
* @param map2 SortedMap two
* @param path the path to the maps to compare
* @param toCompare add items to compare to the Stack (Stack versus recursion)
* @param visited Set containing items that have already been compared, to
* prevent cycles.
* @return false if the Maps are for certain not equals. 'true' indicates
* that 'on the surface' the maps are equal, however, it will place
* the contents of the Maps on the stack for further comparisons.
*/
|
Deeply compare two SortedMap instances. This method walks the Maps in order, taking advantage of the fact that the Maps are SortedMaps
|
compareSortedMap
|
{
"repo_name": "xasx/assertj-core",
"path": "src/main/java/org/assertj/core/internal/DeepDifference.java",
"license": "apache-2.0",
"size": 28959
}
|
[
"java.util.Deque",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"java.util.Set",
"java.util.SortedMap"
] |
import java.util.Deque; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,568,102
|
void onExpired(RewardedAd ad);
|
void onExpired(RewardedAd ad);
|
/**
* Called when a rewarded ad is no longer available to show.
*
* @param ad the rewarded ad
*/
|
Called when a rewarded ad is no longer available to show
|
onExpired
|
{
"repo_name": "deltaDNA/android-smartads-sdk",
"path": "library/src/main/java/com/deltadna/android/sdk/ads/listeners/RewardedAdsListener.java",
"license": "apache-2.0",
"size": 1825
}
|
[
"com.deltadna.android.sdk.ads.RewardedAd"
] |
import com.deltadna.android.sdk.ads.RewardedAd;
|
import com.deltadna.android.sdk.ads.*;
|
[
"com.deltadna.android"
] |
com.deltadna.android;
| 2,806,077
|
protected void StringExpr() throws javax.xml.transform.TransformerException
{
int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH);
appendOp(2, OpCodes.OP_STRING);
Expr();
m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH,
m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos);
}
|
void function() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_STRING); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
|
/**
*
* StringExpr ::= Expr
*
*
* @throws javax.xml.transform.TransformerException
*/
|
StringExpr ::= Expr
|
StringExpr
|
{
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jaxp/src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java",
"license": "mit",
"size": 63899
}
|
[
"javax.xml.transform.TransformerException"
] |
import javax.xml.transform.TransformerException;
|
import javax.xml.transform.*;
|
[
"javax.xml"
] |
javax.xml;
| 1,544,351
|
public void nodeDisconnected(GraphLink link);
}
protected ContentSystem contentSystem;
protected GraphManager graphManager;
protected ArrayList<GraphLink> incomingLinks = new ArrayList<GraphLink>();
protected boolean isLinkable = true;
protected OrthoContentItem linkPoint, closePoint;
protected transient ArrayList<ConceptMapListener> listeners = new ArrayList<ConceptMapListener>();
protected OrthoContentItem nodeItem;
protected ArrayList<GraphLink> outgoingLinks = new ArrayList<GraphLink>();
public GraphNode(GraphManager graphManager, OrthoContentItem nodeItem) {
this.nodeItem = nodeItem;
this.graphManager = graphManager;
if (graphManager != null) {
graphManager.addGraphNode(this);
nodeItem.addOrthoControlPointRotateTranslateScaleListener(new OrthoControlPointRotateTranslateScaleListener() {
|
void function(GraphLink link); } protected ContentSystem contentSystem; protected GraphManager graphManager; protected ArrayList<GraphLink> incomingLinks = new ArrayList<GraphLink>(); protected boolean isLinkable = true; protected OrthoContentItem linkPoint, closePoint; protected transient ArrayList<ConceptMapListener> listeners = new ArrayList<ConceptMapListener>(); protected OrthoContentItem nodeItem; protected ArrayList<GraphLink> outgoingLinks = new ArrayList<GraphLink>(); public GraphNode(GraphManager graphManager, OrthoContentItem nodeItem) { this.nodeItem = nodeItem; this.graphManager = graphManager; if (graphManager != null) { graphManager.addGraphNode(this); nodeItem.addOrthoControlPointRotateTranslateScaleListener(new OrthoControlPointRotateTranslateScaleListener() {
|
/**
* Node disconnected.
*
* @param link
* the link
*/
|
Node disconnected
|
nodeDisconnected
|
{
"repo_name": "synergynet/synergynet2.5",
"path": "synergynet2.5/src/main/java/apps/mathpadapp/conceptmapping/GraphNode.java",
"license": "bsd-3-clause",
"size": 9836
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 725,291
|
public void post() throws SQLException {
super.insert();
}
|
void function() throws SQLException { super.insert(); }
|
/**
* See the DBCouponPriceLimit class for more details.
*
* @see com.djm.smartreg.data.DBCouponPriceLimit#insert()
*/
|
See the DBCouponPriceLimit class for more details
|
post
|
{
"repo_name": "mordigaldj/SmartRegister",
"path": "src/main/java/com/djm/smartreg/business/CouponPriceLimit.java",
"license": "mit",
"size": 3289
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,660,921
|
public RSItem getItemAt(final int index) {
final RSComponent comp = getInterface().getComponent(index);
return 0 <= index && index < 28 && comp != null ? new RSItem(methods, comp) : null;
}
|
RSItem function(final int index) { final RSComponent comp = getInterface().getComponent(index); return 0 <= index && index < 28 && comp != null ? new RSItem(methods, comp) : null; }
|
/**
* Gets inventory item at specified index.
*
* @param index The index of inventory item.
* @return The item, or <tt>null</tt> if not found.
*/
|
Gets inventory item at specified index
|
getItemAt
|
{
"repo_name": "Latency/UtopianBot",
"path": "src/org/rsbot/script/methods/Inventory.java",
"license": "lgpl-3.0",
"size": 20483
}
|
[
"org.rsbot.script.wrappers.RSComponent",
"org.rsbot.script.wrappers.RSItem"
] |
import org.rsbot.script.wrappers.RSComponent; import org.rsbot.script.wrappers.RSItem;
|
import org.rsbot.script.wrappers.*;
|
[
"org.rsbot.script"
] |
org.rsbot.script;
| 67,113
|
public static void createResizedImage(final File sourceFile,
final File destFile, final int width, final int height,
final float quality) throws IOException {
BufferedImage image = ImageIO.read(sourceFile);
Dimension dimension = new Dimension(width, height);
if (image.getHeight() == dimension.height
&& image.getWidth() == dimension.width) {
writeUntouchedImage(sourceFile, destFile);
} else {
resizeImage(image, dimension.width, dimension.height, quality,
destFile);
}
}
|
static void function(final File sourceFile, final File destFile, final int width, final int height, final float quality) throws IOException { BufferedImage image = ImageIO.read(sourceFile); Dimension dimension = new Dimension(width, height); if (image.getHeight() == dimension.height && image.getWidth() == dimension.width) { writeUntouchedImage(sourceFile, destFile); } else { resizeImage(image, dimension.width, dimension.height, quality, destFile); } }
|
/**
* Creates image file with fixed width and height.
*
* @param sourceFile input file
* @param destFile file to save
* @param width image width
* @param height image height
* @param quality image quality
* @throws IOException when error occurs.
*/
|
Creates image file with fixed width and height
|
createResizedImage
|
{
"repo_name": "ahwxl/deep",
"path": "src/main/java/com/ckfinder/connector/utils/ImageUtils.java",
"license": "apache-2.0",
"size": 9136
}
|
[
"java.awt.Dimension",
"java.awt.image.BufferedImage",
"java.io.File",
"java.io.IOException",
"javax.imageio.ImageIO"
] |
import java.awt.Dimension; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;
|
import java.awt.*; import java.awt.image.*; import java.io.*; import javax.imageio.*;
|
[
"java.awt",
"java.io",
"javax.imageio"
] |
java.awt; java.io; javax.imageio;
| 2,774,048
|
@Override
public String getFileType() {
return LastUsedFile.FILE_TYPE_TRANSFORMATION;
}
|
String function() { return LastUsedFile.FILE_TYPE_TRANSFORMATION; }
|
/**
* Gets the file type. For TransMeta, this returns a value corresponding to Transformation
*
* @return the file type
* @see org.pentaho.di.core.EngineMetaInterface#getFileType()
*/
|
Gets the file type. For TransMeta, this returns a value corresponding to Transformation
|
getFileType
|
{
"repo_name": "alina-ipatina/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 221917
}
|
[
"org.pentaho.di.core.LastUsedFile"
] |
import org.pentaho.di.core.LastUsedFile;
|
import org.pentaho.di.core.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 124,673
|
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
|
void function(Date auditTime) { this.auditTime = auditTime; }
|
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column release_form.audit_time
*
* @param auditTime the value for release_form.audit_time
*
* @mbggenerated
*/
|
This method was generated by MyBatis Generator. This method sets the value of the database column release_form.audit_time
|
setAuditTime
|
{
"repo_name": "zouzhirong/configx",
"path": "configx-web/src/main/java/com/configx/web/model/ReleaseForm.java",
"license": "apache-2.0",
"size": 13603
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,471,031
|
public void generateOneParameter(ExpressionClassBuilder acb,
MethodBuilder mb,
int parameterNumber )
throws StandardException
{
methodParms[parameterNumber].generateExpression(acb, mb);
}
|
void function(ExpressionClassBuilder acb, MethodBuilder mb, int parameterNumber ) throws StandardException { methodParms[parameterNumber].generateExpression(acb, mb); }
|
/**
* Generate one parameter to the given method call. This method is overriden by
* RepStaticMethodCallNode.
*
* @param acb The ExpressionClassBuilder for the class we're generating
* @param mb the method the expression will go into
* @param parameterNumber Identifies which parameter to generate. 0 based.
*
* @exception StandardException Thrown on error
*/
|
Generate one parameter to the given method call. This method is overriden by RepStaticMethodCallNode
|
generateOneParameter
|
{
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java",
"license": "apache-2.0",
"size": 38211
}
|
[
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.services.compiler.MethodBuilder",
"org.apache.derby.impl.sql.compile.ExpressionClassBuilder"
] |
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.services.compiler.MethodBuilder; import org.apache.derby.impl.sql.compile.ExpressionClassBuilder;
|
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.services.compiler.*; import org.apache.derby.impl.sql.compile.*;
|
[
"org.apache.derby"
] |
org.apache.derby;
| 1,031,520
|
private void testLocalStorage(IRunnable test, Function<String, Number> parser) throws Exception {
manager = new SimpleSerialThreadManager(test);
manager.execute(1);
for (int i = 0; i < 9; i++) {
assertEquals(parser.apply("-1"), field(test, "value" + i));
}
manager.execute(1);
for (int i = 0; i < 9; i++) {
assertEquals(parser.apply("" + i), field(test, "value" + i));
}
}
|
void function(IRunnable test, Function<String, Number> parser) throws Exception { manager = new SimpleSerialThreadManager(test); manager.execute(1); for (int i = 0; i < 9; i++) { assertEquals(parser.apply("-1"), field(test, "value" + i)); } manager.execute(1); for (int i = 0; i < 9; i++) { assertEquals(parser.apply(STRvalue" + i)); } }
|
/**
* Test that locals are stored and restored correctly.
*
* @param test Test object.
* @param parser Parser for the primitive type which is tested.
*/
|
Test that locals are stored and restored correctly
|
testLocalStorage
|
{
"repo_name": "markusheiden/serialthreads",
"path": "src/test/java/org/serialthreads/transformer/strategies/TransformerIntegration_AbstractTest.java",
"license": "gpl-3.0",
"size": 4611
}
|
[
"java.util.function.Function",
"org.junit.jupiter.api.Assertions",
"org.serialthreads.context.IRunnable",
"org.serialthreads.context.SimpleSerialThreadManager"
] |
import java.util.function.Function; import org.junit.jupiter.api.Assertions; import org.serialthreads.context.IRunnable; import org.serialthreads.context.SimpleSerialThreadManager;
|
import java.util.function.*; import org.junit.jupiter.api.*; import org.serialthreads.context.*;
|
[
"java.util",
"org.junit.jupiter",
"org.serialthreads.context"
] |
java.util; org.junit.jupiter; org.serialthreads.context;
| 589,830
|
@JsonProperty( "scanner_boottime" )
public void setScannerBootTime( int scannerBootTime ) {
this.scannerBootTime = scannerBootTime;
}
|
@JsonProperty( STR ) void function( int scannerBootTime ) { this.scannerBootTime = scannerBootTime; }
|
/**
* Sets scanner boot time.
*
* @param scannerBootTime the scanner boot time
*/
|
Sets scanner boot time
|
setScannerBootTime
|
{
"repo_name": "tenable/Tenable.io-SDK-for-Java",
"path": "src/main/java/com/tenable/io/api/server/models/ServerProperties.java",
"license": "mit",
"size": 9546
}
|
[
"com.fasterxml.jackson.annotation.JsonProperty"
] |
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.*;
|
[
"com.fasterxml.jackson"
] |
com.fasterxml.jackson;
| 1,409,002
|
@Nonnull
public ReportRootGetTeamsUserActivityUserCountsRequest buildRequest(@Nullable final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}
|
ReportRootGetTeamsUserActivityUserCountsRequest function(@Nullable final com.microsoft.graph.options.Option... requestOptions) { return buildRequest(getOptions(requestOptions)); }
|
/**
* Creates the ReportRootGetTeamsUserActivityUserCountsRequest
*
* @param requestOptions the options for the request
* @return the ReportRootGetTeamsUserActivityUserCountsRequest instance
*/
|
Creates the ReportRootGetTeamsUserActivityUserCountsRequest
|
buildRequest
|
{
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/ReportRootGetTeamsUserActivityUserCountsRequestBuilder.java",
"license": "mit",
"size": 3786
}
|
[
"com.microsoft.graph.requests.ReportRootGetTeamsUserActivityUserCountsRequest",
"javax.annotation.Nullable"
] |
import com.microsoft.graph.requests.ReportRootGetTeamsUserActivityUserCountsRequest; import javax.annotation.Nullable;
|
import com.microsoft.graph.requests.*; import javax.annotation.*;
|
[
"com.microsoft.graph",
"javax.annotation"
] |
com.microsoft.graph; javax.annotation;
| 1,540,043
|
private boolean switchesHaveAnotherMaster() {
IOFSwitchService switchService = controller.getSwitchService();
for(Entry<DatapathId, IOFSwitch> switchMap : switchService.getAllSwitchMap().entrySet()){
IOFSwitchBackend sw = (IOFSwitchBackend) switchMap.getValue();
if(sw.hasAnotherMaster()){
return true;
}
}
return false;
}
|
boolean function() { IOFSwitchService switchService = controller.getSwitchService(); for(Entry<DatapathId, IOFSwitch> switchMap : switchService.getAllSwitchMap().entrySet()){ IOFSwitchBackend sw = (IOFSwitchBackend) switchMap.getValue(); if(sw.hasAnotherMaster()){ return true; } } return false; }
|
/**
* Iterates over all the switches and checks to see if they have controller
* connections that points towards another master controller.
* @return
*/
|
Iterates over all the switches and checks to see if they have controller connections that points towards another master controller
|
switchesHaveAnotherMaster
|
{
"repo_name": "chinhnc/floodlight",
"path": "src/main/java/net/floodlightcontroller/core/internal/RoleManager.java",
"license": "apache-2.0",
"size": 9703
}
|
[
"java.util.Map",
"net.floodlightcontroller.core.IOFSwitch",
"net.floodlightcontroller.core.IOFSwitchBackend",
"org.projectfloodlight.openflow.types.DatapathId"
] |
import java.util.Map; import net.floodlightcontroller.core.IOFSwitch; import net.floodlightcontroller.core.IOFSwitchBackend; import org.projectfloodlight.openflow.types.DatapathId;
|
import java.util.*; import net.floodlightcontroller.core.*; import org.projectfloodlight.openflow.types.*;
|
[
"java.util",
"net.floodlightcontroller.core",
"org.projectfloodlight.openflow"
] |
java.util; net.floodlightcontroller.core; org.projectfloodlight.openflow;
| 2,098,404
|
public static boolean isAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.getContext();
Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities();
if (authorities != null) {
for (GrantedAuthority authority : authorities) {
if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) {
return false;
}
}
}
return true;
}
|
static boolean function() { SecurityContext securityContext = SecurityContextHolder.getContext(); Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); if (authorities != null) { for (GrantedAuthority authority : authorities) { if (authority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)) { return false; } } } return true; }
|
/**
* Check if a user is authenticated.
*
* @return true if the user is authenticated, false otherwise
*/
|
Check if a user is authenticated
|
isAuthenticated
|
{
"repo_name": "JulianMaurin/noodle",
"path": "src/main/java/com/cesi/noodle/security/SecurityUtils.java",
"license": "mit",
"size": 2947
}
|
[
"java.util.Collection",
"org.springframework.security.core.GrantedAuthority",
"org.springframework.security.core.context.SecurityContext",
"org.springframework.security.core.context.SecurityContextHolder"
] |
import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder;
|
import java.util.*; import org.springframework.security.core.*; import org.springframework.security.core.context.*;
|
[
"java.util",
"org.springframework.security"
] |
java.util; org.springframework.security;
| 1,625,761
|
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<WorkloadNetworkDnsZoneInner> listDnsZonesAsync(
String resourceGroupName, String privateCloudName) {
return new PagedFlux<>(
() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName),
nextLink -> listDnsZonesNextSinglePageAsync(nextLink));
}
|
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<WorkloadNetworkDnsZoneInner> function( String resourceGroupName, String privateCloudName) { return new PagedFlux<>( () -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName), nextLink -> listDnsZonesNextSinglePageAsync(nextLink)); }
|
/**
* List of DNS zones in a private cloud workload network.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of NSX DNS Zones.
*/
|
List of DNS zones in a private cloud workload network
|
listDnsZonesAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java",
"license": "mit",
"size": 538828
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.avs.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,416,545
|
private void createExtensionDirectory(String coordinate, File atLocation)
{
if (atLocation.isDirectory()) {
log.info("Directory [%s] already exists, skipping creating a directory", atLocation.getAbsolutePath());
return;
}
if (!atLocation.mkdir()) {
throw new ISE(
"Unable to create directory at [%s] for coordinate [%s]",
atLocation.getAbsolutePath(),
coordinate
);
}
}
|
void function(String coordinate, File atLocation) { if (atLocation.isDirectory()) { log.info(STR, atLocation.getAbsolutePath()); return; } if (!atLocation.mkdir()) { throw new ISE( STR, atLocation.getAbsolutePath(), coordinate ); } }
|
/**
* Create the extension directory for a specific maven coordinate.
* The name of this directory should be the artifactId in the coordinate
*/
|
Create the extension directory for a specific maven coordinate. The name of this directory should be the artifactId in the coordinate
|
createExtensionDirectory
|
{
"repo_name": "liquidm/druid",
"path": "services/src/main/java/org/apache/druid/cli/PullDependencies.java",
"license": "apache-2.0",
"size": 20725
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,980,968
|
@ApiModelProperty(value = "Integer value of the resource.")
@JsonProperty("value")
public Long getValue() {
return value;
}
|
@ApiModelProperty(value = STR) @JsonProperty("value") Long function() { return value; }
|
/**
* Integer value of the resource.
*
* @return value
**/
|
Integer value of the resource
|
getValue
|
{
"repo_name": "plusplusjiajia/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/ResourceInformation.java",
"license": "apache-2.0",
"size": 4322
}
|
[
"com.fasterxml.jackson.annotation.JsonProperty",
"io.swagger.annotations.ApiModelProperty"
] |
import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty;
|
import com.fasterxml.jackson.annotation.*; import io.swagger.annotations.*;
|
[
"com.fasterxml.jackson",
"io.swagger.annotations"
] |
com.fasterxml.jackson; io.swagger.annotations;
| 867,407
|
public Link setPattern(Pattern pattern) {
this.pattern = pattern;
this.text = null;
return this;
}
|
Link function(Pattern pattern) { this.pattern = pattern; this.text = null; return this; }
|
/**
* Specify the pattern you want to match.
*
* @param pattern
* to match.
* @return the current link object.
*/
|
Specify the pattern you want to match
|
setPattern
|
{
"repo_name": "feishuai/PersonLife",
"path": "src/com/klinker/android/link_builder/Link.java",
"license": "apache-2.0",
"size": 5485
}
|
[
"java.util.regex.Pattern"
] |
import java.util.regex.Pattern;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 2,617,557
|
public static void setDIODir(byte port, boolean val) {
dioDirections[port] = (byte) (val ? 1 : 0);
if (SimulationGUI.INSTANCE != null)
SimulationGUI.INSTANCE.dioSpinners[port].setEditable(val);
}
public static int[] glitchFilters = new int[10];
public static int[] filterDurations = new int[20];
public static double[] pwmValues = new double[10];
public static PWMConfigDataResult[] pwmConfigs = new PWMConfigDataResult[10];
public static boolean[] pwmEliminateDeadband = new boolean[10];
|
static void function(byte port, boolean val) { dioDirections[port] = (byte) (val ? 1 : 0); if (SimulationGUI.INSTANCE != null) SimulationGUI.INSTANCE.dioSpinners[port].setEditable(val); } public static int[] glitchFilters = new int[10]; public static int[] filterDurations = new int[20]; public static double[] pwmValues = new double[10]; public static PWMConfigDataResult[] pwmConfigs = new PWMConfigDataResult[10]; public static boolean[] pwmEliminateDeadband = new boolean[10];
|
/**
* Set the digital IO direction on the given port, as Input or Output
*/
|
Set the digital IO direction on the given port, as Input or Output
|
setDIODir
|
{
"repo_name": "Open-RIO/ToastAPI",
"path": "src/main/java/jaci/openrio/toast/core/loader/simulation/SimulationData.java",
"license": "mit",
"size": 7378
}
|
[
"edu.wpi.first.wpilibj.PWMConfigDataResult"
] |
import edu.wpi.first.wpilibj.PWMConfigDataResult;
|
import edu.wpi.first.wpilibj.*;
|
[
"edu.wpi.first"
] |
edu.wpi.first;
| 580,255
|
@Test(timeout = 20000)
public void testSendMessageWithGroupRelatedPropertiesSet() throws Exception {
try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
Connection connection = testFixture.establishConnecton(testPeer);
testPeer.expectBegin();
testPeer.expectSenderAttach();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
String queueName = "myQueue";
Queue queue = session.createQueue(queueName);
MessageProducer producer = session.createProducer(queue);
MessageHeaderSectionMatcher headersMatcher = new MessageHeaderSectionMatcher(true).withDurable(equalTo(true));
MessageAnnotationsSectionMatcher msgAnnotationsMatcher = new MessageAnnotationsSectionMatcher(true);
String expectedGroupId = "myGroupId123";
int expectedGroupSeq = 1;
String expectedReplyToGroupId = "myReplyToGroupId456";
MessagePropertiesSectionMatcher propsMatcher = new MessagePropertiesSectionMatcher(true);
propsMatcher.withGroupId(equalTo(expectedGroupId));
propsMatcher.withReplyToGroupId(equalTo(expectedReplyToGroupId));
propsMatcher.withGroupSequence(equalTo(UnsignedInteger.valueOf(expectedGroupSeq)));
TransferPayloadCompositeMatcher messageMatcher = new TransferPayloadCompositeMatcher();
messageMatcher.setHeadersMatcher(headersMatcher);
messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
messageMatcher.setPropertiesMatcher(propsMatcher);
messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null));
testPeer.expectTransfer(messageMatcher);
Message message = session.createTextMessage();
message.setStringProperty(JmsClientProperties.JMSXGROUPID, expectedGroupId);
message.setIntProperty(JmsClientProperties.JMSXGROUPSEQ, expectedGroupSeq);
message.setStringProperty(AmqpMessageSupport.JMS_AMQP_REPLY_TO_GROUP_ID, expectedReplyToGroupId);
producer.send(message);
testPeer.waitForAllHandlersToComplete(1000);
}
}
|
@Test(timeout = 20000) void function() throws Exception { try (TestAmqpPeer testPeer = new TestAmqpPeer();) { Connection connection = testFixture.establishConnecton(testPeer); testPeer.expectBegin(); testPeer.expectSenderAttach(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); String queueName = STR; Queue queue = session.createQueue(queueName); MessageProducer producer = session.createProducer(queue); MessageHeaderSectionMatcher headersMatcher = new MessageHeaderSectionMatcher(true).withDurable(equalTo(true)); MessageAnnotationsSectionMatcher msgAnnotationsMatcher = new MessageAnnotationsSectionMatcher(true); String expectedGroupId = STR; int expectedGroupSeq = 1; String expectedReplyToGroupId = STR; MessagePropertiesSectionMatcher propsMatcher = new MessagePropertiesSectionMatcher(true); propsMatcher.withGroupId(equalTo(expectedGroupId)); propsMatcher.withReplyToGroupId(equalTo(expectedReplyToGroupId)); propsMatcher.withGroupSequence(equalTo(UnsignedInteger.valueOf(expectedGroupSeq))); TransferPayloadCompositeMatcher messageMatcher = new TransferPayloadCompositeMatcher(); messageMatcher.setHeadersMatcher(headersMatcher); messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher); messageMatcher.setPropertiesMatcher(propsMatcher); messageMatcher.setMessageContentMatcher(new EncodedAmqpValueMatcher(null)); testPeer.expectTransfer(messageMatcher); Message message = session.createTextMessage(); message.setStringProperty(JmsClientProperties.JMSXGROUPID, expectedGroupId); message.setIntProperty(JmsClientProperties.JMSXGROUPSEQ, expectedGroupSeq); message.setStringProperty(AmqpMessageSupport.JMS_AMQP_REPLY_TO_GROUP_ID, expectedReplyToGroupId); producer.send(message); testPeer.waitForAllHandlersToComplete(1000); } }
|
/**
* Tests that when sending a message with the JMSXGroupID, JMSXGroupSeq, and JMS_AMQP_REPLY_TO_GROUP_ID
* properties of the JMS message set, that the expected values are included in the fields of
* the AMQP message emitted.
*/
|
Tests that when sending a message with the JMSXGroupID, JMSXGroupSeq, and JMS_AMQP_REPLY_TO_GROUP_ID properties of the JMS message set, that the expected values are included in the fields of the AMQP message emitted
|
testSendMessageWithGroupRelatedPropertiesSet
|
{
"repo_name": "avranju/qpid-jms",
"path": "qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java",
"license": "apache-2.0",
"size": 92138
}
|
[
"javax.jms.Connection",
"javax.jms.Message",
"javax.jms.MessageProducer",
"javax.jms.Queue",
"javax.jms.Session",
"org.apache.qpid.jms.JmsClientProperties",
"org.apache.qpid.jms.provider.amqp.message.AmqpMessageSupport",
"org.apache.qpid.jms.test.testpeer.TestAmqpPeer",
"org.apache.qpid.jms.test.testpeer.matchers.sections.MessageAnnotationsSectionMatcher",
"org.apache.qpid.jms.test.testpeer.matchers.sections.MessageHeaderSectionMatcher",
"org.apache.qpid.jms.test.testpeer.matchers.sections.MessagePropertiesSectionMatcher",
"org.apache.qpid.jms.test.testpeer.matchers.sections.TransferPayloadCompositeMatcher",
"org.apache.qpid.jms.test.testpeer.matchers.types.EncodedAmqpValueMatcher",
"org.apache.qpid.proton.amqp.UnsignedInteger",
"org.junit.Test"
] |
import javax.jms.Connection; import javax.jms.Message; import javax.jms.MessageProducer; import javax.jms.Queue; import javax.jms.Session; import org.apache.qpid.jms.JmsClientProperties; import org.apache.qpid.jms.provider.amqp.message.AmqpMessageSupport; import org.apache.qpid.jms.test.testpeer.TestAmqpPeer; import org.apache.qpid.jms.test.testpeer.matchers.sections.MessageAnnotationsSectionMatcher; import org.apache.qpid.jms.test.testpeer.matchers.sections.MessageHeaderSectionMatcher; import org.apache.qpid.jms.test.testpeer.matchers.sections.MessagePropertiesSectionMatcher; import org.apache.qpid.jms.test.testpeer.matchers.sections.TransferPayloadCompositeMatcher; import org.apache.qpid.jms.test.testpeer.matchers.types.EncodedAmqpValueMatcher; import org.apache.qpid.proton.amqp.UnsignedInteger; import org.junit.Test;
|
import javax.jms.*; import org.apache.qpid.jms.*; import org.apache.qpid.jms.provider.amqp.message.*; import org.apache.qpid.jms.test.testpeer.*; import org.apache.qpid.jms.test.testpeer.matchers.sections.*; import org.apache.qpid.jms.test.testpeer.matchers.types.*; import org.apache.qpid.proton.amqp.*; import org.junit.*;
|
[
"javax.jms",
"org.apache.qpid",
"org.junit"
] |
javax.jms; org.apache.qpid; org.junit;
| 782,031
|
public int[] createColumnTypes(List<String> columns) {
int[] types = new int[columns.size()];
List<TableParameterMetaData> parameters = this.metaDataProvider.getTableParameterMetaData();
Map<String, TableParameterMetaData> parameterMap = new HashMap<String, TableParameterMetaData>(
parameters.size());
for (TableParameterMetaData tpmd : parameters) {
parameterMap.put(tpmd.getParameterName().toUpperCase(), tpmd);
}
int typeIndx = 0;
for (String column : columns) {
if (column == null) {
types[typeIndx] = SqlTypeValue.TYPE_UNKNOWN;
} else {
TableParameterMetaData tpmd = parameterMap.get(column.toUpperCase());
if (tpmd != null) {
types[typeIndx] = tpmd.getSqlType();
} else {
types[typeIndx] = SqlTypeValue.TYPE_UNKNOWN;
}
}
typeIndx++;
}
return types;
}
|
int[] function(List<String> columns) { int[] types = new int[columns.size()]; List<TableParameterMetaData> parameters = this.metaDataProvider.getTableParameterMetaData(); Map<String, TableParameterMetaData> parameterMap = new HashMap<String, TableParameterMetaData>( parameters.size()); for (TableParameterMetaData tpmd : parameters) { parameterMap.put(tpmd.getParameterName().toUpperCase(), tpmd); } int typeIndx = 0; for (String column : columns) { if (column == null) { types[typeIndx] = SqlTypeValue.TYPE_UNKNOWN; } else { TableParameterMetaData tpmd = parameterMap.get(column.toUpperCase()); if (tpmd != null) { types[typeIndx] = tpmd.getSqlType(); } else { types[typeIndx] = SqlTypeValue.TYPE_UNKNOWN; } } typeIndx++; } return types; }
|
/**
* Build the array of {@link java.sql.Types} based on configuration and metadata
* information
*
* @return the array of types to be used
*/
|
Build the array of <code>java.sql.Types</code> based on configuration and metadata information
|
createColumnTypes
|
{
"repo_name": "skarpushin/summerb",
"path": "summerb-easycrud/src/main/java/org/summerb/easycrud/impl/SimpleJdbcUpdate/TableMetaDataContext.java",
"license": "apache-2.0",
"size": 10466
}
|
[
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.springframework.jdbc.core.SqlTypeValue",
"org.springframework.jdbc.core.metadata.TableParameterMetaData"
] |
import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.jdbc.core.SqlTypeValue; import org.springframework.jdbc.core.metadata.TableParameterMetaData;
|
import java.util.*; import org.springframework.jdbc.core.*; import org.springframework.jdbc.core.metadata.*;
|
[
"java.util",
"org.springframework.jdbc"
] |
java.util; org.springframework.jdbc;
| 1,999,773
|
boolean isHasChildren(DtsData parent);
|
boolean isHasChildren(DtsData parent);
|
/**
* Does this concept have children or not.
*
* @param parent
* parent DTS object
* @return <code>true</code> if and only if the concept has children
* @throws ApplicationException
*/
|
Does this concept have children or not
|
isHasChildren
|
{
"repo_name": "openfurther/further-open-core",
"path": "dts/dts-api/src/main/java/edu/utah/further/dts/api/service/DtsOperationService.java",
"license": "apache-2.0",
"size": 18676
}
|
[
"edu.utah.further.dts.api.domain.namespace.DtsData"
] |
import edu.utah.further.dts.api.domain.namespace.DtsData;
|
import edu.utah.further.dts.api.domain.namespace.*;
|
[
"edu.utah.further"
] |
edu.utah.further;
| 2,715,794
|
public static CompletableFuture<Void> zkAsyncCreateFullPathOptimistic(
final ZooKeeperClient zkc,
final String pathToCreate,
final Optional<String> parentPathShouldNotCreate,
final byte[] data,
final List<ACL> acl,
final CreateMode createMode) {
final CompletableFuture<Void> result = new CompletableFuture<Void>();
|
static CompletableFuture<Void> function( final ZooKeeperClient zkc, final String pathToCreate, final Optional<String> parentPathShouldNotCreate, final byte[] data, final List<ACL> acl, final CreateMode createMode) { final CompletableFuture<Void> result = new CompletableFuture<Void>();
|
/**
* Asynchronously create zookeeper path recursively and optimistically.
*
* @param zkc Zookeeper client
* @param pathToCreate Zookeeper full path
* @param parentPathShouldNotCreate zookeeper parent path should not be created
* @param data Zookeeper data
* @param acl Acl of the zk path
* @param createMode Create mode of zk path
*/
|
Asynchronously create zookeeper path recursively and optimistically
|
zkAsyncCreateFullPathOptimistic
|
{
"repo_name": "sijie/bookkeeper",
"path": "stream/distributedlog/core/src/main/java/org/apache/distributedlog/util/Utils.java",
"license": "apache-2.0",
"size": 30421
}
|
[
"com.google.common.base.Optional",
"java.util.List",
"java.util.concurrent.CompletableFuture",
"org.apache.distributedlog.ZooKeeperClient",
"org.apache.zookeeper.CreateMode"
] |
import com.google.common.base.Optional; import java.util.List; import java.util.concurrent.CompletableFuture; import org.apache.distributedlog.ZooKeeperClient; import org.apache.zookeeper.CreateMode;
|
import com.google.common.base.*; import java.util.*; import java.util.concurrent.*; import org.apache.distributedlog.*; import org.apache.zookeeper.*;
|
[
"com.google.common",
"java.util",
"org.apache.distributedlog",
"org.apache.zookeeper"
] |
com.google.common; java.util; org.apache.distributedlog; org.apache.zookeeper;
| 2,018,263
|
protected IFigure setupContentPane(IFigure nodeShape) {
return nodeShape; // use nodeShape itself as contentPane
}
|
IFigure function(IFigure nodeShape) { return nodeShape; }
|
/**
* Default implementation treats passed figure as content pane. Respects
* layout one may have set for generated figure.
*
* @param nodeShape
* instance of generated figure class
* @generated
*/
|
Default implementation treats passed figure as content pane. Respects layout one may have set for generated figure
|
setupContentPane
|
{
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.visualdatamapper.diagram/src/org/wso2/developerstudio/datamapper/diagram/edit/parts/InNode2EditPart.java",
"license": "apache-2.0",
"size": 11062
}
|
[
"org.eclipse.draw2d.IFigure"
] |
import org.eclipse.draw2d.IFigure;
|
import org.eclipse.draw2d.*;
|
[
"org.eclipse.draw2d"
] |
org.eclipse.draw2d;
| 1,598,484
|
List<User> search(String userName, String firstName, String lastName);
|
List<User> search(String userName, String firstName, String lastName);
|
/**
* Search User Data
*
*/
|
Search User Data
|
search
|
{
"repo_name": "nasebanal/nb-finance",
"path": "src/main/java/com/nasebanal/finance/repository/UserRepository.java",
"license": "apache-2.0",
"size": 597
}
|
[
"com.nasebanal.finance.entity.User",
"java.util.List"
] |
import com.nasebanal.finance.entity.User; import java.util.List;
|
import com.nasebanal.finance.entity.*; import java.util.*;
|
[
"com.nasebanal.finance",
"java.util"
] |
com.nasebanal.finance; java.util;
| 1,832,634
|
public Iterator<Map.Entry<A, B>> reverseIterator() {
return FastListIterator.reverseIterator(this);
}
private static class Tuple<A, B> implements Map.Entry<A, B> {
private A key;
private B value;
private Tuple(A key, B value) {
this.key = key;
this.value = value;
}
|
Iterator<Map.Entry<A, B>> function() { return FastListIterator.reverseIterator(this); } private static class Tuple<A, B> implements Map.Entry<A, B> { private A key; private B value; private Tuple(A key, B value) { this.key = key; this.value = value; }
|
/**
* Return an entry iterator that traverses in the reverse direction.
*
* @return an entry iterator
*/
|
Return an entry iterator that traverses in the reverse direction
|
reverseIterator
|
{
"repo_name": "CameronRedmore/TF-WorldEdit",
"path": "worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/TupleArrayList.java",
"license": "gpl-3.0",
"size": 2618
}
|
[
"java.util.Iterator",
"java.util.Map"
] |
import java.util.Iterator; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,805,158
|
public static Uri getEndPointUri() {
Uri uri = Uri.parse(API_BASE_URL);
return uri.buildUpon().appendEncodedPath("account/endpoint").build();
}
|
static Uri function() { Uri uri = Uri.parse(API_BASE_URL); return uri.buildUpon().appendEncodedPath(STR).build(); }
|
/**
* Get current user end point url
*
* @return Uri
*/
|
Get current user end point url
|
getEndPointUri
|
{
"repo_name": "he5ed/cloudprovider",
"path": "cloudprovider/src/main/java/com/he5ed/lib/cloudprovider/apis/CloudDriveApi.java",
"license": "apache-2.0",
"size": 50250
}
|
[
"android.net.Uri"
] |
import android.net.Uri;
|
import android.net.*;
|
[
"android.net"
] |
android.net;
| 1,216,772
|
public void initiate() throws IOException
{
logger.debug("[Stream #{}] Sending stream init for incoming stream", session.planId());
Socket incomingSocket = connect(session.peer);
incoming.start(incomingSocket, StreamMessage.CURRENT_VERSION);
incoming.sendInitMessage(incomingSocket, true);
logger.debug("[Stream #{}] Sending stream init for outgoing stream", session.planId());
Socket outgoingSocket = connect(session.peer);
outgoing.start(outgoingSocket, StreamMessage.CURRENT_VERSION);
outgoing.sendInitMessage(outgoingSocket, false);
}
|
void function() throws IOException { logger.debug(STR, session.planId()); Socket incomingSocket = connect(session.peer); incoming.start(incomingSocket, StreamMessage.CURRENT_VERSION); incoming.sendInitMessage(incomingSocket, true); logger.debug(STR, session.planId()); Socket outgoingSocket = connect(session.peer); outgoing.start(outgoingSocket, StreamMessage.CURRENT_VERSION); outgoing.sendInitMessage(outgoingSocket, false); }
|
/**
* Set up incoming message handler and initiate streaming.
*
* This method is called once on initiator.
*
* @throws IOException
*/
|
Set up incoming message handler and initiate streaming. This method is called once on initiator
|
initiate
|
{
"repo_name": "YosubShin/morphous-cassandra",
"path": "src/java/org/apache/cassandra/streaming/ConnectionHandler.java",
"license": "apache-2.0",
"size": 13014
}
|
[
"java.io.IOException",
"java.net.Socket",
"org.apache.cassandra.streaming.messages.StreamMessage"
] |
import java.io.IOException; import java.net.Socket; import org.apache.cassandra.streaming.messages.StreamMessage;
|
import java.io.*; import java.net.*; import org.apache.cassandra.streaming.messages.*;
|
[
"java.io",
"java.net",
"org.apache.cassandra"
] |
java.io; java.net; org.apache.cassandra;
| 2,345,653
|
public TextEdit replace(ISelection selection, String replacement) throws BadLocationException {
return getImplementation(selection).replace(selection, replacement);
}
|
TextEdit function(ISelection selection, String replacement) throws BadLocationException { return getImplementation(selection).replace(selection, replacement); }
|
/**
* Returns a text edit describing the text modification that would be executed if the given
* selection was replaced by <code>replacement</code>.
*
* @param selection the selection to replace
* @param replacement the replacement text
* @return a text edit describing the operation needed to replace <code>selection</code>
* @throws BadLocationException if computing the edit failed
*/
|
Returns a text edit describing the text modification that would be executed if the given selection was replaced by <code>replacement</code>
|
replace
|
{
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jface.text_3.8.1.v20120828-155502/src/org/eclipse/jface/internal/text/SelectionProcessor.java",
"license": "mit",
"size": 27101
}
|
[
"org.eclipse.jface.text.BadLocationException",
"org.eclipse.jface.viewers.ISelection",
"org.eclipse.text.edits.TextEdit"
] |
import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.viewers.ISelection; import org.eclipse.text.edits.TextEdit;
|
import org.eclipse.jface.text.*; import org.eclipse.jface.viewers.*; import org.eclipse.text.edits.*;
|
[
"org.eclipse.jface",
"org.eclipse.text"
] |
org.eclipse.jface; org.eclipse.text;
| 109,023
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.