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
|
---|---|---|---|---|---|---|---|---|---|---|---|
protected synchronized void removeShapeGeometryChangeListener(ShapeGeometryChangeListener listener) {
assert listener != null : AssertMessages.notNullParameter();
if (this.geometryListeners != null) {
this.geometryListeners.remove(listener);
if (this.geometryListeners.isEmpty()) {
this.geometryListeners = null;
}
}
} | synchronized void function(ShapeGeometryChangeListener listener) { assert listener != null : AssertMessages.notNullParameter(); if (this.geometryListeners != null) { this.geometryListeners.remove(listener); if (this.geometryListeners.isEmpty()) { this.geometryListeners = null; } } } | /** Remove listener on geometry changes.
*
* @param listener the listener.
*/ | Remove listener on geometry changes | removeShapeGeometryChangeListener | {
"repo_name": "gallandarakhneorg/afc",
"path": "core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/i/AbstractShape2i.java",
"license": "apache-2.0",
"size": 3637
} | [
"org.arakhne.afc.vmutil.asserts.AssertMessages"
]
| import org.arakhne.afc.vmutil.asserts.AssertMessages; | import org.arakhne.afc.vmutil.asserts.*; | [
"org.arakhne.afc"
]
| org.arakhne.afc; | 2,081,592 |
public static String getAnnotationFieldName(java.util.List<AnnotationFieldName> parts) {
StringBuilder sb = new StringBuilder();
for (AnnotationFieldName part : parts) {
sb.append(part.getFieldNamePrefix()).append(part.getFieldName()).append("$");
}
return sb.substring(0, sb.length()-1);
} | static String function(java.util.List<AnnotationFieldName> parts) { StringBuilder sb = new StringBuilder(); for (AnnotationFieldName part : parts) { sb.append(part.getFieldNamePrefix()).append(part.getFieldName()).append("$"); } return sb.substring(0, sb.length()-1); } | /**
* Computes the name of the constant field on the class for an
* annotation constructor. The name comprises a number of parts because
* defaulted parameters and literal arguments both require constant fields
* and because of nested invocations we need to generate a unique name
*/ | Computes the name of the constant field on the class for an annotation constructor. The name comprises a number of parts because defaulted parameters and literal arguments both require constant fields and because of nested invocations we need to generate a unique name | getAnnotationFieldName | {
"repo_name": "lucaswerkmeister/ceylon-compiler",
"path": "src/com/redhat/ceylon/compiler/java/codegen/Naming.java",
"license": "gpl-2.0",
"size": 76714
} | [
"java.util.List"
]
| import java.util.List; | import java.util.*; | [
"java.util"
]
| java.util; | 2,629,037 |
public static DateTime toDateAdvanced(Object o, TimeZone timezone) throws PageException {
if (o instanceof Date) {
if (o instanceof DateTime) return (DateTime) o;
return new DateTimeImpl((Date) o);
}
else if (o instanceof Castable) return ((Castable) o).castToDateTime();
else if (o instanceof String) {
DateTime dt = toDateAdvanced((String) o, timezone, null);
if (dt == null) throw new ExpressionException("can't cast [" + o + "] to date value");
return dt;
}
else if (o instanceof Number) return util.toDateTime(((Number) o).doubleValue());
else if (o instanceof ObjectWrap) return toDateAdvanced(((ObjectWrap) o).getEmbededObject(), timezone);
else if (o instanceof Calendar) {
return new DateTimeImpl((Calendar) o);
}
throw new ExpressionException("can't cast [" + Caster.toClassName(o) + "] to date value");
} | static DateTime function(Object o, TimeZone timezone) throws PageException { if (o instanceof Date) { if (o instanceof DateTime) return (DateTime) o; return new DateTimeImpl((Date) o); } else if (o instanceof Castable) return ((Castable) o).castToDateTime(); else if (o instanceof String) { DateTime dt = toDateAdvanced((String) o, timezone, null); if (dt == null) throw new ExpressionException(STR + o + STR); return dt; } else if (o instanceof Number) return util.toDateTime(((Number) o).doubleValue()); else if (o instanceof ObjectWrap) return toDateAdvanced(((ObjectWrap) o).getEmbededObject(), timezone); else if (o instanceof Calendar) { return new DateTimeImpl((Calendar) o); } throw new ExpressionException(STR + Caster.toClassName(o) + STR); } | /**
* converts a Object to a DateTime Object (Advanced but slower)
*
* @param o Object to Convert
* @param timezone
* @return Date Time Object
* @throws PageException
*/ | converts a Object to a DateTime Object (Advanced but slower) | toDateAdvanced | {
"repo_name": "jzuijlek/Lucee",
"path": "core/src/main/java/lucee/runtime/op/date/DateCaster.java",
"license": "lgpl-2.1",
"size": 39390
} | [
"java.util.Calendar",
"java.util.Date",
"java.util.TimeZone"
]
| import java.util.Calendar; import java.util.Date; import java.util.TimeZone; | import java.util.*; | [
"java.util"
]
| java.util; | 1,832,113 |
public RMapDiSCO readDiSCO(URI discoUri);
| RMapDiSCO function(URI discoUri); | /**
* Retrieve DiSCO
* @return matching disco
*/ | Retrieve DiSCO | readDiSCO | {
"repo_name": "rmap-project/rmap",
"path": "webapp/src/main/java/info/rmapproject/webapp/service/RMapUpdateService.java",
"license": "apache-2.0",
"size": 1745
} | [
"info.rmapproject.core.model.disco.RMapDiSCO"
]
| import info.rmapproject.core.model.disco.RMapDiSCO; | import info.rmapproject.core.model.disco.*; | [
"info.rmapproject.core"
]
| info.rmapproject.core; | 2,466,799 |
private Collection<String> processCompositeAggBucketKeys(Map<String, Object> bucketKeys) {
List<String> addedFieldValues = new ArrayList<>();
for (Map.Entry<String, Object> bucketKey : bucketKeys.entrySet()) {
if (bucketKey.getKey().equals(compositeAggDateValueSourceName) == false && fields.contains(bucketKey.getKey())) {
// TODO any validations or processing???
keyValuePairs.put(bucketKey.getKey(), bucketKey.getValue());
addedFieldValues.add(bucketKey.getKey());
}
}
return addedFieldValues;
} | Collection<String> function(Map<String, Object> bucketKeys) { List<String> addedFieldValues = new ArrayList<>(); for (Map.Entry<String, Object> bucketKey : bucketKeys.entrySet()) { if (bucketKey.getKey().equals(compositeAggDateValueSourceName) == false && fields.contains(bucketKey.getKey())) { keyValuePairs.put(bucketKey.getKey(), bucketKey.getValue()); addedFieldValues.add(bucketKey.getKey()); } } return addedFieldValues; } | /**
* It is possible that the key values in composite agg bucket contain field values we care about
* Make sure if they do, they get processed
* @param bucketKeys the composite agg bucket keys
* @return The field names we added to the key value pairs
*/ | It is possible that the key values in composite agg bucket contain field values we care about Make sure if they do, they get processed | processCompositeAggBucketKeys | {
"repo_name": "ern/elasticsearch",
"path": "x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/extractor/aggregation/AggregationToJsonProcessor.java",
"license": "apache-2.0",
"size": 21605
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"java.util.Map"
]
| import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
]
| java.util; | 1,798,043 |
public boolean deleteSingleImageFromRMS(String storeName, String imageName) throws PersistenceMechanismException, ImageNotFoundException, NullAlbumDataReference {
System.out.println("ImageAccessor.deleteSingleImageFromRMS()");
boolean success = false;
// Open the record stores containing the byte data and the meta data
// (info)
try {
// Verify storeName is name without pre-fix
imageRS = RecordStore
.openRecordStore(ALBUM_LABEL + storeName, true);
imageInfoRS = RecordStore.openRecordStore(INFO_LABEL + storeName,
true);
ImageData imageData = getImageInfo(imageName);
int rid = imageData.getForeignRecordId();
imageRS.deleteRecord(rid);
imageInfoRS.deleteRecord(rid);
imageRS.closeRecordStore();
imageInfoRS.closeRecordStore();
} catch (RecordStoreException rse) {
throw new PersistenceMechanismException("The mobile database can not delete this photo");
}
// TODO: It's not clear from the API whether the record store needs to
// be closed or not...
return success;
} | boolean function(String storeName, String imageName) throws PersistenceMechanismException, ImageNotFoundException, NullAlbumDataReference { System.out.println(STR); boolean success = false; try { imageRS = RecordStore .openRecordStore(ALBUM_LABEL + storeName, true); imageInfoRS = RecordStore.openRecordStore(INFO_LABEL + storeName, true); ImageData imageData = getImageInfo(imageName); int rid = imageData.getForeignRecordId(); imageRS.deleteRecord(rid); imageInfoRS.deleteRecord(rid); imageRS.closeRecordStore(); imageInfoRS.closeRecordStore(); } catch (RecordStoreException rse) { throw new PersistenceMechanismException(STR); } return success; } | /**
* Delete a single (specified) image from the (specified) record store. This
* will permanently delete the image data and metadata from the device.
* @throws PersistenceMechanismException
* @throws NullAlbumDataReference
* @throws ImageNotFoundException
*/ | Delete a single (specified) image from the (specified) record store. This will permanently delete the image data and metadata from the device | deleteSingleImageFromRMS | {
"repo_name": "leotizzei/MobileMedia-Cosmos-v1",
"path": "src/br/unicamp/ic/sed/mobilemedia/filesystemmgr/impl/ImageAccessor.java",
"license": "mit",
"size": 16161
} | [
"br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.ImageNotFoundException",
"br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.NullAlbumDataReference",
"br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.PersistenceMechanismException",
"javax.microedition.rms.RecordStore",
"javax.microedition.rms.RecordStoreException"
]
| import br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.ImageNotFoundException; import br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.NullAlbumDataReference; import br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.PersistenceMechanismException; import javax.microedition.rms.RecordStore; import javax.microedition.rms.RecordStoreException; | import br.unicamp.ic.sed.mobilemedia.filesystemmgr.spec.excep.*; import javax.microedition.rms.*; | [
"br.unicamp.ic",
"javax.microedition"
]
| br.unicamp.ic; javax.microedition; | 2,895,306 |
private void ensureOpen() throws IOException {
if (readers == null)
throw new IOException("Stream closed");
} | void function() throws IOException { if (readers == null) throw new IOException(STR); } | /**
* Check to make sure that the stream has not been closed
*/ | Check to make sure that the stream has not been closed | ensureOpen | {
"repo_name": "vthriller/opensymphony-compass-backup",
"path": "src/main/src/org/compass/core/util/reader/MultiIOReader.java",
"license": "apache-2.0",
"size": 3752
} | [
"java.io.IOException"
]
| import java.io.IOException; | import java.io.*; | [
"java.io"
]
| java.io; | 2,502,171 |
public static ArrayList<String> getUserSVGFiles() {
ArrayList<String> filenames = new ArrayList<String>();
String dir = getImagesDirectory();
File file = new File(dir);
for (File f : file.listFiles()) {
if (!f.isDirectory() && f.getName().endsWith(".svg")) {
filenames.add(f.getPath());
}
}
return filenames;
} | static ArrayList<String> function() { ArrayList<String> filenames = new ArrayList<String>(); String dir = getImagesDirectory(); File file = new File(dir); for (File f : file.listFiles()) { if (!f.isDirectory() && f.getName().endsWith(".svg")) { filenames.add(f.getPath()); } } return filenames; } | /**
* Gets the user's saved SVG files, form the <i>images</i> directory.
*
* @return List of filenames.
*/ | Gets the user's saved SVG files, form the images directory | getUserSVGFiles | {
"repo_name": "jonghough/ArtisteX",
"path": "app/src/main/java/jgh/artistex/engine/utils/FileUtils.java",
"license": "bsd-3-clause",
"size": 11059
} | [
"java.io.File",
"java.util.ArrayList"
]
| import java.io.File; import java.util.ArrayList; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
]
| java.io; java.util; | 1,457,378 |
public SimpleFeatureFigure[] getFeatureFigures(boolean selectedOnly) {
ArrayList<SimpleFeatureFigure> selectedFigures = new ArrayList<>();
collectFeatureFigures(figureEditor.getFigureSelection(), selectedFigures);
if (selectedFigures.isEmpty()
&& !selectedOnly
&& getSelectedLayer() instanceof VectorDataLayer) {
VectorDataLayer vectorDataLayer = (VectorDataLayer) getSelectedLayer();
collectFeatureFigures(vectorDataLayer.getFigureCollection(), selectedFigures);
}
return selectedFigures.toArray(new SimpleFeatureFigure[selectedFigures.size()]);
} | SimpleFeatureFigure[] function(boolean selectedOnly) { ArrayList<SimpleFeatureFigure> selectedFigures = new ArrayList<>(); collectFeatureFigures(figureEditor.getFigureSelection(), selectedFigures); if (selectedFigures.isEmpty() && !selectedOnly && getSelectedLayer() instanceof VectorDataLayer) { VectorDataLayer vectorDataLayer = (VectorDataLayer) getSelectedLayer(); collectFeatureFigures(vectorDataLayer.getFigureCollection(), selectedFigures); } return selectedFigures.toArray(new SimpleFeatureFigure[selectedFigures.size()]); } | /**
* Gets either the selected figures, or all the figures of the currently selected layer.
*
* @param selectedOnly If {@code true}, only selected figures are returned.
* @return The feature figures or an empty array.
* @since BEAM 4.10
*/ | Gets either the selected figures, or all the figures of the currently selected layer | getFeatureFigures | {
"repo_name": "senbox-org/snap-desktop",
"path": "snap-ui/src/main/java/org/esa/snap/ui/product/ProductSceneView.java",
"license": "gpl-3.0",
"size": 61604
} | [
"java.util.ArrayList"
]
| import java.util.ArrayList; | import java.util.*; | [
"java.util"
]
| java.util; | 2,200,844 |
default AdvancedHdfsEndpointConsumerBuilder pollStrategy(
PollingConsumerPollStrategy pollStrategy) {
setProperty("pollStrategy", pollStrategy);
return this;
} | default AdvancedHdfsEndpointConsumerBuilder pollStrategy( PollingConsumerPollStrategy pollStrategy) { setProperty(STR, pollStrategy); return this; } | /**
* A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing
* you to provide your custom implementation to control error handling
* usually occurred during the poll operation before an Exchange have
* been created and being routed in Camel.
*
* The option is a:
* <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type.
*
* Group: consumer (advanced)
*/ | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. The option is a: <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. Group: consumer (advanced) | pollStrategy | {
"repo_name": "Fabryprog/camel",
"path": "core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/HdfsEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 74974
} | [
"org.apache.camel.spi.PollingConsumerPollStrategy"
]
| import org.apache.camel.spi.PollingConsumerPollStrategy; | import org.apache.camel.spi.*; | [
"org.apache.camel"
]
| org.apache.camel; | 1,142,258 |
static private byte[] toBytes(
Vector octs)
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
for (int i = 0; i != octs.size(); i++)
{
try
{
DEROctetString o = (DEROctetString)octs.elementAt(i);
bOut.write(o.getOctets());
}
catch (ClassCastException e)
{
throw new IllegalArgumentException(octs.elementAt(i).getClass().getName() + " found in input should only contain DEROctetString");
}
catch (IOException e)
{
throw new IllegalArgumentException("exception converting octets " + e.toString());
}
}
return bOut.toByteArray();
}
private Vector octs;
public BERConstructedOctetString(
byte[] string)
{
super(string);
}
public BERConstructedOctetString(
Vector octs)
{
super(toBytes(octs));
this.octs = octs;
}
public BERConstructedOctetString(
DERObject obj)
{
super(obj);
}
public BERConstructedOctetString(
DEREncodable obj)
{
super(obj.getDERObject());
} | static byte[] function( Vector octs) { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); for (int i = 0; i != octs.size(); i++) { try { DEROctetString o = (DEROctetString)octs.elementAt(i); bOut.write(o.getOctets()); } catch (ClassCastException e) { throw new IllegalArgumentException(octs.elementAt(i).getClass().getName() + STR); } catch (IOException e) { throw new IllegalArgumentException(STR + e.toString()); } } return bOut.toByteArray(); } private Vector octs; public BERConstructedOctetString( byte[] string) { super(string); } public BERConstructedOctetString( Vector octs) { super(toBytes(octs)); this.octs = octs; } public BERConstructedOctetString( DERObject obj) { super(obj); } public BERConstructedOctetString( DEREncodable obj) { super(obj.getDERObject()); } | /**
* convert a vector of octet strings into a single byte string
*/ | convert a vector of octet strings into a single byte string | toBytes | {
"repo_name": "braintree/braintree_android_encryption",
"path": "BraintreeAndroidEncryption/src/main/java/com/braintree/org/bouncycastle/asn1/BERConstructedOctetString.java",
"license": "mit",
"size": 3538
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.util.Vector"
]
| import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Vector; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
]
| java.io; java.util; | 887,546 |
public void remove(UnitPropagationListener upl) {
for (int i = 0; i < Math.min(this.degree + 1, this.lits.length); i++) {
this.voc.watches(this.lits[i] ^ 1).remove(this);
}
} | void function(UnitPropagationListener upl) { for (int i = 0; i < Math.min(this.degree + 1, this.lits.length); i++) { this.voc.watches(this.lits[i] ^ 1).remove(this); } } | /**
* Removes a constraint from the solver
*
* @since 2.1
*/ | Removes a constraint from the solver | remove | {
"repo_name": "SCPTeam/Safe-Component-Provider",
"path": "Sat4jCore/src/org/sat4j/minisat/constraints/card/MinWatchCard.java",
"license": "mit",
"size": 19355
} | [
"org.sat4j.specs.UnitPropagationListener"
]
| import org.sat4j.specs.UnitPropagationListener; | import org.sat4j.specs.*; | [
"org.sat4j.specs"
]
| org.sat4j.specs; | 1,982,852 |
public List<ImageDescription> describeImagesByOwner(List<String> owners) throws EC2Exception {
Map<String, String> params = new HashMap<String, String>();
for (int i=0 ; i<owners.size(); i++) {
params.put("Owner."+(i+1), owners.get(i));
}
return describeImages(params);
} | List<ImageDescription> function(List<String> owners) throws EC2Exception { Map<String, String> params = new HashMap<String, String>(); for (int i=0 ; i<owners.size(); i++) { params.put(STR+(i+1), owners.get(i)); } return describeImages(params); } | /**
* Describe the AMIs belonging to the supplied owners.
*
* @param owners A list of owners.
* @return A list of {@link ImageDescription} instances describing each AMI ID.
* @throws EC2Exception wraps checked exceptions
*/ | Describe the AMIs belonging to the supplied owners | describeImagesByOwner | {
"repo_name": "jonnyzzz/maragogype",
"path": "tags/v1.6/java/com/xerox/amazonws/ec2/Jec2.java",
"license": "apache-2.0",
"size": 81043
} | [
"java.util.HashMap",
"java.util.List",
"java.util.Map"
]
| import java.util.HashMap; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
]
| java.util; | 494,515 |
public DefaultCalcIntermResult<BigDecimal> compute( DefaultCalcIntermResult<BigDecimal> intermResult,
Object newValue) {
return new DefaultCalcIntermResult<BigDecimal>(
intermResult.getResult().add(new BigDecimal(newValue.toString())));
}
| DefaultCalcIntermResult<BigDecimal> function( DefaultCalcIntermResult<BigDecimal> intermResult, Object newValue) { return new DefaultCalcIntermResult<BigDecimal>( intermResult.getResult().add(new BigDecimal(newValue.toString()))); } | /**
* adds the new value to the previous intermediate result by converting it to BigDecimal.
*/ | adds the new value to the previous intermediate result by converting it to BigDecimal | compute | {
"repo_name": "humbletrader/katechaki",
"path": "src/main/java/net/sf/reportengine/core/calc/SumGroupCalculator.java",
"license": "apache-2.0",
"size": 2187
} | [
"java.math.BigDecimal"
]
| import java.math.BigDecimal; | import java.math.*; | [
"java.math"
]
| java.math; | 412,483 |
public byte[] createDescriptor(StereoMolecule mol) {
mol.ensureHelperArrays(Molecule.cHelperRings);
StereoMolecule fragment = new StereoMolecule(mol.getAtoms(), mol.getBonds());
byte[] descriptor = new byte[DESCRIPTOR_SIZE];
//System.out.println("descriptor skeleton spheres:");
int[] atomList = new int[mol.getAtoms()];
boolean[] atomMask = new boolean[mol.getAtoms()];
for (int rootAtom=0; rootAtom<mol.getAtoms(); rootAtom++) {
if (rootAtom != 0)
Arrays.fill(atomMask, false);
int min = 0;
int max = 0;
for (int sphere=0; sphere<MAX_SPHERE_COUNT && max<mol.getAtoms(); sphere++) {
if (max == 0) {
atomList[0] = rootAtom;
atomMask[rootAtom] = true;
max = 1;
}
else {
int newMax = max;
for (int i=min; i<max; i++) {
int atom = atomList[i];
for (int j=0; j<mol.getConnAtoms(atom); j++) {
int connAtom = mol.getConnAtom(atom, j);
if (!atomMask[connAtom]) {
atomMask[connAtom] = true;
atomList[newMax++] = connAtom;
}
}
}
min = max;
max = newMax;
}
mol.copyMoleculeByAtoms(fragment, atomMask, true, null);
// take fragment as it is
if (sphere < EXACT_SPHERE_COUNT) {
String idcode = new Canonizer(fragment).getIDCode();
int h = BurtleHasher.hashlittle(idcode, HASH_INIT);
h = (h & BurtleHasher.hashmask(HASH_BITS));
if (descriptor[h] < DescriptorEncoder.MAX_COUNT_VALUE)
descriptor[h]++;
//System.out.println("atom:"+rootAtom+"\tfragment\tradius:"+sphere+"\thash:"+h+"\t"+idcode);
}
// take atomic no reduced fragment skeleton also
if (sphere < SKELETON_SPHERE_COUNT) {
for (int atom=0; atom<fragment.getAllAtoms(); atom++)
fragment.setAtomicNo(atom, 6);
String idcode = new Canonizer(fragment).getIDCode();
int h = BurtleHasher.hashlittle(idcode, HASH_INIT);
h = (h & BurtleHasher.hashmask(HASH_BITS));
if (descriptor[h] < DescriptorEncoder.MAX_COUNT_VALUE)
descriptor[h]++;
//System.out.println("atom:"+rootAtom+"\tskeleton\tradius:"+sphere+"\thash:"+h+"\t"+idcode);
}
}
}
return descriptor;
} | byte[] function(StereoMolecule mol) { mol.ensureHelperArrays(Molecule.cHelperRings); StereoMolecule fragment = new StereoMolecule(mol.getAtoms(), mol.getBonds()); byte[] descriptor = new byte[DESCRIPTOR_SIZE]; int[] atomList = new int[mol.getAtoms()]; boolean[] atomMask = new boolean[mol.getAtoms()]; for (int rootAtom=0; rootAtom<mol.getAtoms(); rootAtom++) { if (rootAtom != 0) Arrays.fill(atomMask, false); int min = 0; int max = 0; for (int sphere=0; sphere<MAX_SPHERE_COUNT && max<mol.getAtoms(); sphere++) { if (max == 0) { atomList[0] = rootAtom; atomMask[rootAtom] = true; max = 1; } else { int newMax = max; for (int i=min; i<max; i++) { int atom = atomList[i]; for (int j=0; j<mol.getConnAtoms(atom); j++) { int connAtom = mol.getConnAtom(atom, j); if (!atomMask[connAtom]) { atomMask[connAtom] = true; atomList[newMax++] = connAtom; } } } min = max; max = newMax; } mol.copyMoleculeByAtoms(fragment, atomMask, true, null); if (sphere < EXACT_SPHERE_COUNT) { String idcode = new Canonizer(fragment).getIDCode(); int h = BurtleHasher.hashlittle(idcode, HASH_INIT); h = (h & BurtleHasher.hashmask(HASH_BITS)); if (descriptor[h] < DescriptorEncoder.MAX_COUNT_VALUE) descriptor[h]++; } if (sphere < SKELETON_SPHERE_COUNT) { for (int atom=0; atom<fragment.getAllAtoms(); atom++) fragment.setAtomicNo(atom, 6); String idcode = new Canonizer(fragment).getIDCode(); int h = BurtleHasher.hashlittle(idcode, HASH_INIT); h = (h & BurtleHasher.hashmask(HASH_BITS)); if (descriptor[h] < DescriptorEncoder.MAX_COUNT_VALUE) descriptor[h]++; } } } return descriptor; } | /**
* This descriptor requires proper up/down bonds, because it encodes stereo parities.
* If a passed molecule is generated from idcode parsing, make sure that coordinates
* and up/down/bonds are available, i.e. that the IDCodeParser was instantiated with
* the respective option.
*/ | This descriptor requires proper up/down bonds, because it encodes stereo parities. If a passed molecule is generated from idcode parsing, make sure that coordinates and up/down/bonds are available, i.e. that the IDCodeParser was instantiated with the respective option | createDescriptor | {
"repo_name": "egonw/openchemlib",
"path": "src/com/actelion/research/chem/DescriptorHandlerSkeletonSpheres.java",
"license": "bsd-3-clause",
"size": 8153
} | [
"com.actelion.research.chem.Canonizer",
"com.actelion.research.chem.Molecule",
"com.actelion.research.chem.StereoMolecule",
"com.actelion.research.util.BurtleHasher",
"java.util.Arrays"
]
| import com.actelion.research.chem.Canonizer; import com.actelion.research.chem.Molecule; import com.actelion.research.chem.StereoMolecule; import com.actelion.research.util.BurtleHasher; import java.util.Arrays; | import com.actelion.research.chem.*; import com.actelion.research.util.*; import java.util.*; | [
"com.actelion.research",
"java.util"
]
| com.actelion.research; java.util; | 1,170,685 |
@Override
public void loadDataFromDB() throws InitializationException
{
Object tmpKeyIndexObj;
String[] ObjectKeyFields;
Integer tmpKeyIndex;
int Index;
String[] ObjectSplitFields;
int ObjectLinesLoaded = 0;
// Find the location of the zone configuration file
OpenRate.getOpenRateFrameworkLog().info("Starting Indexed Lookup Cache Loading from DB");
// Try to open the DS
JDBCcon = DBUtil.getConnection(cacheDataSourceName);
// Now prepare the statements
prepareStatements();
// Execute the query
try
{
mrs = StmtCacheDataSelectQuery.executeQuery();
}
catch (SQLException ex)
{
message = "Error performing SQL for retieving Indexed Match data in module <" +
getSymbolicName() + ">";
throw new InitializationException(message,ex,getSymbolicName());
}
// loop through the results for the customer login cache
try
{
mrs.beforeFirst();
while (mrs.next())
{
ObjectLinesLoaded++;
ObjectSplitFields = new String[ObjectFields];
for (Index = 0; Index < ObjectFields; Index++)
{
ObjectSplitFields[Index] = mrs.getString(Index + 1);
}
// Create the Index List
ObjectKeyFields = new String[KeyFormFactor];
for (Index = 0; Index < KeyFormFactor; Index++)
{
tmpKeyIndexObj = KeyFieldList.get(Index);
tmpKeyIndex = (Integer)tmpKeyIndexObj;
ObjectKeyFields[Index] = ObjectSplitFields[tmpKeyIndex];
}
// Add the map
addEntry(ObjectKeyFields, ObjectSplitFields);
}
}
catch (SQLException ex)
{
message = "Error opening Search Map Data for <" +
cacheDataSourceName + "> in module <" + getSymbolicName() + ">";
throw new InitializationException(message,ex,getSymbolicName());
}
// Close down stuff
try
{
mrs.close();
StmtCacheDataSelectQuery.close();
JDBCcon.close();
}
catch (SQLException ex)
{
message = "Error closing Search Map Data connection for <" +
cacheDataSourceName + "> in module <" +
getSymbolicName() + ">";
throw new InitializationException(message,ex,getSymbolicName());
}
OpenRate.getOpenRateFrameworkLog().info(
"Indexed Match Data Loading completed. <" + ObjectLinesLoaded +
"> configuration lines loaded from <" +
cacheDataSourceName + ">");
} | void function() throws InitializationException { Object tmpKeyIndexObj; String[] ObjectKeyFields; Integer tmpKeyIndex; int Index; String[] ObjectSplitFields; int ObjectLinesLoaded = 0; OpenRate.getOpenRateFrameworkLog().info(STR); JDBCcon = DBUtil.getConnection(cacheDataSourceName); prepareStatements(); try { mrs = StmtCacheDataSelectQuery.executeQuery(); } catch (SQLException ex) { message = STR + getSymbolicName() + ">"; throw new InitializationException(message,ex,getSymbolicName()); } try { mrs.beforeFirst(); while (mrs.next()) { ObjectLinesLoaded++; ObjectSplitFields = new String[ObjectFields]; for (Index = 0; Index < ObjectFields; Index++) { ObjectSplitFields[Index] = mrs.getString(Index + 1); } ObjectKeyFields = new String[KeyFormFactor]; for (Index = 0; Index < KeyFormFactor; Index++) { tmpKeyIndexObj = KeyFieldList.get(Index); tmpKeyIndex = (Integer)tmpKeyIndexObj; ObjectKeyFields[Index] = ObjectSplitFields[tmpKeyIndex]; } addEntry(ObjectKeyFields, ObjectSplitFields); } } catch (SQLException ex) { message = STR + cacheDataSourceName + STR + getSymbolicName() + ">"; throw new InitializationException(message,ex,getSymbolicName()); } try { mrs.close(); StmtCacheDataSelectQuery.close(); JDBCcon.close(); } catch (SQLException ex) { message = STR + cacheDataSourceName + STR + getSymbolicName() + ">"; throw new InitializationException(message,ex,getSymbolicName()); } OpenRate.getOpenRateFrameworkLog().info( STR + ObjectLinesLoaded + STR + cacheDataSourceName + ">"); } | /**
* Load the data from the defined Data Source
*
* @throws InitializationException
*/ | Load the data from the defined Data Source | loadDataFromDB | {
"repo_name": "jmuthu/OpenRate",
"path": "src/main/java/OpenRate/cache/IndexedLookupCache.java",
"license": "gpl-2.0",
"size": 24231
} | [
"java.sql.SQLException"
]
| import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
]
| java.sql; | 279,415 |
List<Field> fields();
/**
* Returns a list containing each unhidden and unambiguous {@link Field} | List<Field> fields(); /** * Returns a list containing each unhidden and unambiguous {@link Field} | /**
* Returns a list containing each {@link Field} declared in this type.
* Inherited fields are not included. Any synthetic fields created
* by the compiler are included in the list.
* <p>
* For arrays ({@link ArrayType}) and primitive classes, the returned
* list is always empty.
*
* @return a list {@link Field} objects; the list has length 0
* if no fields exist.
* @throws ClassNotPreparedException if this class not yet been
* prepared.
*/ | Returns a list containing each <code>Field</code> declared in this type. Inherited fields are not included. Any synthetic fields created by the compiler are included in the list. For arrays (<code>ArrayType</code>) and primitive classes, the returned list is always empty | fields | {
"repo_name": "FauxFaux/jdk9-jdk",
"path": "src/jdk.jdi/share/classes/com/sun/jdi/ReferenceType.java",
"license": "gpl-2.0",
"size": 32766
} | [
"java.util.List"
]
| import java.util.List; | import java.util.*; | [
"java.util"
]
| java.util; | 2,452,320 |
public Collection<Object> values()
{
return hintMap.values();
} | Collection<Object> function() { return hintMap.values(); } | /**
* Returns a collection of the values from this hint collection. The
* collection is backed by the <code>RenderingHints</code> instance,
* so updates to one will affect the other.
*
* @return A collection of values.
*/ | Returns a collection of the values from this hint collection. The collection is backed by the <code>RenderingHints</code> instance, so updates to one will affect the other | values | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/java/awt/RenderingHints.java",
"license": "gpl-2.0",
"size": 22572
} | [
"java.util.Collection"
]
| import java.util.Collection; | import java.util.*; | [
"java.util"
]
| java.util; | 2,739,887 |
protected Class<?> defineClass(String name, sun.misc.Resource res) throws IOException {
final int i = name.lastIndexOf('.');
final URL url = res.getCodeSourceURL();
if (i != -1) {
final String pkgname = name.substring(0, i);
// Check if package already loaded.
final Package pkg = getPackage(pkgname);
final Manifest man = res.getManifest();
if (pkg != null) {
// Package found, so check package sealing.
if (pkg.isSealed()) {
// Verify that code source URL is the same.
if (!pkg.isSealed(url)) {
throw new SecurityException(Locale.getString("E1", pkgname)); //$NON-NLS-1$
}
} else {
// Make sure we are not attempting to seal the package
// at this code source URL.
if ((man != null) && isSealed(pkgname, man)) {
throw new SecurityException(Locale.getString("E2", pkgname)); //$NON-NLS-1$
}
}
} else {
if (man != null) {
definePackage(pkgname, man, url);
} else {
definePackage(pkgname, null, null, null, null, null, null, null);
}
}
}
// Now read the class bytes and define the class
final java.nio.ByteBuffer bb = res.getByteBuffer();
if (bb != null) {
// Use (direct) ByteBuffer:
final CodeSigner[] signers = res.getCodeSigners();
final CodeSource cs = new CodeSource(url, signers);
return defineClass(name, bb, cs);
}
final byte[] b = res.getBytes();
// must read certificates AFTER reading bytes.
final CodeSigner[] signers = res.getCodeSigners();
final CodeSource cs = new CodeSource(url, signers);
return defineClass(name, b, 0, b.length, cs);
} | Class<?> function(String name, sun.misc.Resource res) throws IOException { final int i = name.lastIndexOf('.'); final URL url = res.getCodeSourceURL(); if (i != -1) { final String pkgname = name.substring(0, i); final Package pkg = getPackage(pkgname); final Manifest man = res.getManifest(); if (pkg != null) { if (pkg.isSealed()) { if (!pkg.isSealed(url)) { throw new SecurityException(Locale.getString("E1", pkgname)); } } else { if ((man != null) && isSealed(pkgname, man)) { throw new SecurityException(Locale.getString("E2", pkgname)); } } } else { if (man != null) { definePackage(pkgname, man, url); } else { definePackage(pkgname, null, null, null, null, null, null, null); } } } final java.nio.ByteBuffer bb = res.getByteBuffer(); if (bb != null) { final CodeSigner[] signers = res.getCodeSigners(); final CodeSource cs = new CodeSource(url, signers); return defineClass(name, bb, cs); } final byte[] b = res.getBytes(); final CodeSigner[] signers = res.getCodeSigners(); final CodeSource cs = new CodeSource(url, signers); return defineClass(name, b, 0, b.length, cs); } | /**
* Defines a Class using the class bytes obtained from the specified
* Resource. The resulting Class must be resolved before it can be
* used.
*
* @param name is the name of the class to define
* @param res is the resource from which the class byte-code could be obtained
* @return the loaded class.
* @throws IOException in case the byte-code was unavailable.
*/ | Defines a Class using the class bytes obtained from the specified Resource. The resulting Class must be resolved before it can be used | defineClass | {
"repo_name": "tpiotrow/afc",
"path": "core/vmutils/src/main/java/org/arakhne/afc/vmutil/DynamicURLClassLoader.java",
"license": "apache-2.0",
"size": 19412
} | [
"java.io.IOException",
"java.security.CodeSigner",
"java.security.CodeSource",
"java.util.jar.Manifest",
"org.arakhne.afc.vmutil.locale.Locale"
]
| import java.io.IOException; import java.security.CodeSigner; import java.security.CodeSource; import java.util.jar.Manifest; import org.arakhne.afc.vmutil.locale.Locale; | import java.io.*; import java.security.*; import java.util.jar.*; import org.arakhne.afc.vmutil.locale.*; | [
"java.io",
"java.security",
"java.util",
"org.arakhne.afc"
]
| java.io; java.security; java.util; org.arakhne.afc; | 1,918,506 |
@Test(groups = "ticket:2963")
public void testDeleteImageViewedByOtherRenderingSettingsOnlyRWRW()
throws Exception {
EventContext ownerCtx = newUserAndGroup("rwrw--");
// owner creates the image
Image image = (Image) iUpdate.saveAndReturnObject(mmFactory
.createImage());
// create rendering settings for that user.
Pixels pixels = image.getPrimaryPixels();
long id = pixels.getId().getValue();
long imageID = image.getId().getValue();
// Image
// method already tested
IRenderingSettingsPrx prx = factory.getRenderingSettingsService();
prx.setOriginalSettingsInSet(Image.class.getName(),
Arrays.asList(imageID));
RenderingDef ownerDef = factory.getPixelsService().retrieveRndSettings(
id);
newUserInGroup(ownerCtx);
prx = factory.getRenderingSettingsService();
prx.setOriginalSettingsInSet(Image.class.getName(),
Arrays.asList(imageID));
RenderingDef otherDef = factory.getPixelsService().retrieveRndSettings(
id);
assertAllExist(ownerDef, otherDef);
disconnect();
// Delete the image.
loginUser(ownerCtx);
delete(client, new Delete(DeleteServiceTest.REF_IMAGE, imageID, null));
assertNoneExist(image, ownerDef, otherDef);
} | @Test(groups = STR) void function() throws Exception { EventContext ownerCtx = newUserAndGroup(STR); Image image = (Image) iUpdate.saveAndReturnObject(mmFactory .createImage()); Pixels pixels = image.getPrimaryPixels(); long id = pixels.getId().getValue(); long imageID = image.getId().getValue(); IRenderingSettingsPrx prx = factory.getRenderingSettingsService(); prx.setOriginalSettingsInSet(Image.class.getName(), Arrays.asList(imageID)); RenderingDef ownerDef = factory.getPixelsService().retrieveRndSettings( id); newUserInGroup(ownerCtx); prx = factory.getRenderingSettingsService(); prx.setOriginalSettingsInSet(Image.class.getName(), Arrays.asList(imageID)); RenderingDef otherDef = factory.getPixelsService().retrieveRndSettings( id); assertAllExist(ownerDef, otherDef); disconnect(); loginUser(ownerCtx); delete(client, new Delete(DeleteServiceTest.REF_IMAGE, imageID, null)); assertNoneExist(image, ownerDef, otherDef); } | /**
* Test to delete an image viewed by another user in a RWRW-- group.
*
* @throws Exception
* Thrown if an error occurred.
*/ | Test to delete an image viewed by another user in a RWRW-- group | testDeleteImageViewedByOtherRenderingSettingsOnlyRWRW | {
"repo_name": "bramalingam/openmicroscopy",
"path": "components/tools/OmeroJava/test/integration/DeleteServicePermissionsTest.java",
"license": "gpl-2.0",
"size": 34904
} | [
"java.util.Arrays",
"org.testng.annotations.Test"
]
| import java.util.Arrays; import org.testng.annotations.Test; | import java.util.*; import org.testng.annotations.*; | [
"java.util",
"org.testng.annotations"
]
| java.util; org.testng.annotations; | 1,669,884 |
void unregisterModel(Model model) throws ModelInUsingException; | void unregisterModel(Model model) throws ModelInUsingException; | /**
* Un-Register a model from the context. Only un-using model can be un-register.
*
* @param model model
*
* @throws ModelInUsingException
*/ | Un-Register a model from the context. Only un-using model can be un-register | unregisterModel | {
"repo_name": "igitras-cg/core",
"path": "src/main/java/com/igitras/cg/core/context/ModelContext.java",
"license": "unlicense",
"size": 2370
} | [
"com.igitras.cg.core.exception.ModelInUsingException",
"com.igitras.cg.core.model.Model"
]
| import com.igitras.cg.core.exception.ModelInUsingException; import com.igitras.cg.core.model.Model; | import com.igitras.cg.core.exception.*; import com.igitras.cg.core.model.*; | [
"com.igitras.cg"
]
| com.igitras.cg; | 2,369,092 |
protected boolean isOptionDisabled() throws JspException {
return false;
} | boolean function() throws JspException { return false; } | /**
* Determine whether the option fields should be disabled.
*/ | Determine whether the option fields should be disabled | isOptionDisabled | {
"repo_name": "SunriseCoder/sunny-tracker",
"path": "src/main/java/org/springframework/web/servlet/tags/form/RecursiveOptionWriter.java",
"license": "gpl-3.0",
"size": 3893
} | [
"javax.servlet.jsp.JspException"
]
| import javax.servlet.jsp.JspException; | import javax.servlet.jsp.*; | [
"javax.servlet"
]
| javax.servlet; | 2,459,783 |
AclBuilder revoke(); | AclBuilder revoke(); | /**
* Create new builder for revoking acl permissions
* @return AclBuilder
*/ | Create new builder for revoking acl permissions | revoke | {
"repo_name": "jtalks-org/jtalks-common",
"path": "jtalks-common-service/src/main/java/org/jtalks/common/service/SecurityService.java",
"license": "lgpl-2.1",
"size": 3112
} | [
"org.jtalks.common.service.security.AclBuilder"
]
| import org.jtalks.common.service.security.AclBuilder; | import org.jtalks.common.service.security.*; | [
"org.jtalks.common"
]
| org.jtalks.common; | 479,294 |
public ServiceFuture<ConnectionSharedKeyInner> setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback<ConnectionSharedKeyInner> serviceCallback) {
return ServiceFuture.fromResponse(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback);
} | ServiceFuture<ConnectionSharedKeyInner> function(String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, final ServiceCallback<ConnectionSharedKeyInner> serviceCallback) { return ServiceFuture.fromResponse(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); } | /**
* The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayConnectionName The virtual network gateway connection name.
* @param parameters Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork resource provider.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/ | The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider | setSharedKeyAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/implementation/VirtualNetworkGatewayConnectionsInner.java",
"license": "mit",
"size": 103823
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
]
| import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
]
| com.microsoft.rest; | 1,945,700 |
public String getJobTrackerLogFilePattern() throws IOException {
return getProxy().getFilePattern();
} | String function() throws IOException { return getProxy().getFilePattern(); } | /**
* Get the jobtracker log files as pattern.
* @return String - Jobtracker log file pattern.
* @throws IOException - if I/O error occurs.
*/ | Get the jobtracker log files as pattern | getJobTrackerLogFilePattern | {
"repo_name": "vierja/hadoop-per-mare",
"path": "src/test/system/java/org/apache/hadoop/mapreduce/test/system/JTClient.java",
"license": "apache-2.0",
"size": 13461
} | [
"java.io.IOException"
]
| import java.io.IOException; | import java.io.*; | [
"java.io"
]
| java.io; | 1,123,371 |
@Test
public void testNotEquals() {
Assert.assertFalse("Invalid value.", Expressions.accept(Locale.ENGLISH, "TABLE", "table", true,
Constants.ESCAPE_CHAR));
} | void function() { Assert.assertFalse(STR, Expressions.accept(Locale.ENGLISH, "TABLE", "table", true, Constants.ESCAPE_CHAR)); } | /**
* Test for not equals.
*/ | Test for not equals | testNotEquals | {
"repo_name": "leonhad/paradoxdriver",
"path": "src/test/java/com/googlecode/paradox/utils/ExpressionsTest.java",
"license": "lgpl-3.0",
"size": 3023
} | [
"java.util.Locale",
"org.junit.Assert"
]
| import java.util.Locale; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
]
| java.util; org.junit; | 539,671 |
private Context prologue() throws SQLException, IOException
{
MessageContext mc = MessageContext.getCurrentContext();
String username = null, password = null;
if (mc.getUsername() != null)
{
username = DAVServlet.decodeFromURL(mc.getUsername());
}
if (mc.getPassword() != null)
{
password = DAVServlet.decodeFromURL(mc.getPassword());
}
this.request = (HttpServletRequest) mc
.getProperty("transport.http.servletRequest");
this.response = (HttpServletResponse) mc
.getProperty("transport.http.servletResponse");
Context context = new Context();
// try cookie shortcut
if (DAVServlet.getAuthFromCookie(context, this.request))
{
DAVServlet.putAuthCookie(context, this.request, this.response, false);
log.debug("SOAP service " + this.getClass().getName()
+ " authenticated with cookie.");
return context;
}
int status = AuthenticationManager.authenticate(context, username,
password, null, this.request);
if (status == AuthenticationMethod.SUCCESS)
{
EPerson cu = context.getCurrentUser();
log.debug("SOAP service " + this.getClass().getName()
+ " authenticated as " + cu.getEmail() + " ("
+ cu.getFirstName() + " " + cu.getLastName() + ")");
DAVServlet.putAuthCookie(context, this.request, this.response, true);
return context;
}
else if (status == AuthenticationMethod.BAD_CREDENTIALS)
{
context.abort();
throw new LNIRemoteException(
"Authentication failed: Bad Credentials.");
}
else if (status == AuthenticationMethod.CERT_REQUIRED)
{
context.abort();
throw new LNIRemoteException(
"Authentication failed: This user may only login with X.509 certificate.");
}
else if (status == AuthenticationMethod.NO_SUCH_USER)
{
context.abort();
throw new LNIRemoteException("Authentication failed: No such user.");
}
else
{
context.abort();
throw new LNIRemoteException(
"Authentication failed: Cannot authenticate.");
}
} | Context function() throws SQLException, IOException { MessageContext mc = MessageContext.getCurrentContext(); String username = null, password = null; if (mc.getUsername() != null) { username = DAVServlet.decodeFromURL(mc.getUsername()); } if (mc.getPassword() != null) { password = DAVServlet.decodeFromURL(mc.getPassword()); } this.request = (HttpServletRequest) mc .getProperty(STR); this.response = (HttpServletResponse) mc .getProperty(STR); Context context = new Context(); if (DAVServlet.getAuthFromCookie(context, this.request)) { DAVServlet.putAuthCookie(context, this.request, this.response, false); log.debug(STR + this.getClass().getName() + STR); return context; } int status = AuthenticationManager.authenticate(context, username, password, null, this.request); if (status == AuthenticationMethod.SUCCESS) { EPerson cu = context.getCurrentUser(); log.debug(STR + this.getClass().getName() + STR + cu.getEmail() + STR + cu.getFirstName() + " " + cu.getLastName() + ")"); DAVServlet.putAuthCookie(context, this.request, this.response, true); return context; } else if (status == AuthenticationMethod.BAD_CREDENTIALS) { context.abort(); throw new LNIRemoteException( STR); } else if (status == AuthenticationMethod.CERT_REQUIRED) { context.abort(); throw new LNIRemoteException( STR); } else if (status == AuthenticationMethod.NO_SUCH_USER) { context.abort(); throw new LNIRemoteException(STR); } else { context.abort(); throw new LNIRemoteException( STR); } } | /**
* Authenticate and return the filled-in DSpace context This is the prologue
* to all calls.
*
* @return the context
*
* @throws SQLException the SQL exception
* @throws IOException Signals that an I/O exception has occurred.
*/ | Authenticate and return the filled-in DSpace context This is the prologue to all calls | prologue | {
"repo_name": "jamie-dryad/dryad-repo",
"path": "dspace-lni/dspace-lni-core/src/main/java/org/dspace/app/dav/LNISoapServlet.java",
"license": "bsd-3-clause",
"size": 15319
} | [
"java.io.IOException",
"java.sql.SQLException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.axis.MessageContext",
"org.dspace.authenticate.AuthenticationManager",
"org.dspace.authenticate.AuthenticationMethod",
"org.dspace.core.Context",
"org.dspace.eperson.EPerson"
]
| import java.io.IOException; import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.axis.MessageContext; import org.dspace.authenticate.AuthenticationManager; import org.dspace.authenticate.AuthenticationMethod; import org.dspace.core.Context; import org.dspace.eperson.EPerson; | import java.io.*; import java.sql.*; import javax.servlet.http.*; import org.apache.axis.*; import org.dspace.authenticate.*; import org.dspace.core.*; import org.dspace.eperson.*; | [
"java.io",
"java.sql",
"javax.servlet",
"org.apache.axis",
"org.dspace.authenticate",
"org.dspace.core",
"org.dspace.eperson"
]
| java.io; java.sql; javax.servlet; org.apache.axis; org.dspace.authenticate; org.dspace.core; org.dspace.eperson; | 1,819,601 |
public void setSpecimenList(List<List<NameValueBean>> specimenListParam)
{
this.specimenList = specimenListParam;
}
| void function(List<List<NameValueBean>> specimenListParam) { this.specimenList = specimenListParam; } | /**
* Sets the specimenList.
* @param specimenListParam List containing the list of specimens
*/ | Sets the specimenList | setSpecimenList | {
"repo_name": "NCIP/catissue-core",
"path": "software/caTissue/modules/core/src/main/java/edu/wustl/catissuecore/bean/DefinedArrayDetailsBean.java",
"license": "bsd-3-clause",
"size": 9702
} | [
"edu.wustl.common.beans.NameValueBean",
"java.util.List"
]
| import edu.wustl.common.beans.NameValueBean; import java.util.List; | import edu.wustl.common.beans.*; import java.util.*; | [
"edu.wustl.common",
"java.util"
]
| edu.wustl.common; java.util; | 882,169 |
public static boolean isEmpty( final Collection<?> collection )
{
return collection == null || collection.isEmpty();
}
| static boolean function( final Collection<?> collection ) { return collection == null collection.isEmpty(); } | /**
* Convenience method to determine that a collection is empty or null.
*/ | Convenience method to determine that a collection is empty or null | isEmpty | {
"repo_name": "mcculls/maven-plugins",
"path": "maven-javadoc-plugin/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java",
"license": "apache-2.0",
"size": 65609
} | [
"java.util.Collection"
]
| import java.util.Collection; | import java.util.*; | [
"java.util"
]
| java.util; | 1,655,768 |
public void fireEvent(String typeName, Transaction transaction, FeatureEvent event) {
if (event.getType() == FeatureEvent.Type.COMMIT
|| event.getType() == FeatureEvent.Type.ROLLBACK) {
// This is a commit event; it needs to go out to everyone
// Listeners on the Transaction need to be told about any feature ids that were changed
// Listeners on AUTO_COMMIT need to be told that something happened
Map<SimpleFeatureSource, FeatureListener[]> map =
getListeners(typeName, Transaction.AUTO_COMMIT);
for (Map.Entry entry : map.entrySet()) {
FeatureSource featureSource = (FeatureSource) entry.getKey();
FeatureListener[] listeners = (FeatureListener[]) entry.getValue();
event.setFeatureSource(featureSource);
for (FeatureListener listener : listeners) {
try {
listener.changed(event);
} catch (Throwable t) {
LOGGER.log(
Level.FINE,
"Could not deliver "
+ event
+ " to "
+ listener
+ ":"
+ t.getMessage(),
t);
}
}
}
} else {
// This is a commit event; it needs to go out to everyone
// Listeners on the Transaction need to be told about any feature ids that were changed
// Listeners on AUTO_COMMIT need to be told that something happened
Map<SimpleFeatureSource, FeatureListener[]> map = getListeners(typeName, transaction);
for (Map.Entry entry : map.entrySet()) {
FeatureSource featureSource = (FeatureSource) entry.getKey();
FeatureListener[] listeners = (FeatureListener[]) entry.getValue();
event.setFeatureSource(featureSource);
for (FeatureListener listener : listeners) {
try {
listener.changed(event);
} catch (Throwable t) {
LOGGER.log(
Level.FINE,
"Could not deliver "
+ event
+ " to "
+ listener
+ ":"
+ t.getMessage(),
t);
}
}
}
}
} | void function(String typeName, Transaction transaction, FeatureEvent event) { if (event.getType() == FeatureEvent.Type.COMMIT event.getType() == FeatureEvent.Type.ROLLBACK) { Map<SimpleFeatureSource, FeatureListener[]> map = getListeners(typeName, Transaction.AUTO_COMMIT); for (Map.Entry entry : map.entrySet()) { FeatureSource featureSource = (FeatureSource) entry.getKey(); FeatureListener[] listeners = (FeatureListener[]) entry.getValue(); event.setFeatureSource(featureSource); for (FeatureListener listener : listeners) { try { listener.changed(event); } catch (Throwable t) { LOGGER.log( Level.FINE, STR + event + STR + listener + ":" + t.getMessage(), t); } } } } else { Map<SimpleFeatureSource, FeatureListener[]> map = getListeners(typeName, transaction); for (Map.Entry entry : map.entrySet()) { FeatureSource featureSource = (FeatureSource) entry.getKey(); FeatureListener[] listeners = (FeatureListener[]) entry.getValue(); event.setFeatureSource(featureSource); for (FeatureListener listener : listeners) { try { listener.changed(event); } catch (Throwable t) { LOGGER.log( Level.FINE, STR + event + STR + listener + ":" + t.getMessage(), t); } } } } } | /**
* Provided event will be used as a template for notifying all FeatureSources for the provided
* typeName.
*/ | Provided event will be used as a template for notifying all FeatureSources for the provided typeName | fireEvent | {
"repo_name": "geotools/geotools",
"path": "modules/library/main/src/main/java/org/geotools/data/FeatureListenerManager.java",
"license": "lgpl-2.1",
"size": 17874
} | [
"java.util.Map",
"java.util.logging.Level",
"org.geotools.data.simple.SimpleFeatureSource"
]
| import java.util.Map; import java.util.logging.Level; import org.geotools.data.simple.SimpleFeatureSource; | import java.util.*; import java.util.logging.*; import org.geotools.data.simple.*; | [
"java.util",
"org.geotools.data"
]
| java.util; org.geotools.data; | 1,420,056 |
@GET
@Path("jobs/{jobid}/tasks/tag/{tasktag}")
@Produces(MediaType.APPLICATION_JSON)
RestPage<String> getJobTasksIdsByTag(@HeaderParam("sessionid") String sessionId, @PathParam("jobid") String jobId,
@PathParam("tasktag") String taskTag) throws RestException; | @Path(STR) @Produces(MediaType.APPLICATION_JSON) RestPage<String> getJobTasksIdsByTag(@HeaderParam(STR) String sessionId, @PathParam("jobid") String jobId, @PathParam(STR) String taskTag) throws RestException; | /**
* Returns a list of the name of the tasks belonging to job
* <code>jobId</code>
*
* @param sessionId
* a valid session id
* @param jobId
* jobid one wants to list the tasks' name
* @param taskTag
* the tag used to filter the tasks.
* @return a list of task ids filtered by the tag and with the total number
* of tasks ids
*/ | Returns a list of the name of the tasks belonging to job <code>jobId</code> | getJobTasksIdsByTag | {
"repo_name": "mbenguig/scheduling",
"path": "rest/rest-api/src/main/java/org/ow2/proactive_grid_cloud_portal/common/SchedulerRestInterface.java",
"license": "agpl-3.0",
"size": 98025
} | [
"javax.ws.rs.HeaderParam",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"org.ow2.proactive_grid_cloud_portal.scheduler.dto.RestPage",
"org.ow2.proactive_grid_cloud_portal.scheduler.exception.RestException"
]
| import javax.ws.rs.HeaderParam; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.ow2.proactive_grid_cloud_portal.scheduler.dto.RestPage; import org.ow2.proactive_grid_cloud_portal.scheduler.exception.RestException; | import javax.ws.rs.*; import javax.ws.rs.core.*; import org.ow2.proactive_grid_cloud_portal.scheduler.dto.*; import org.ow2.proactive_grid_cloud_portal.scheduler.exception.*; | [
"javax.ws",
"org.ow2.proactive_grid_cloud_portal"
]
| javax.ws; org.ow2.proactive_grid_cloud_portal; | 1,636,087 |
private void acceptSolutions() {
final ICloseableIterator<IBindingSet[]> src;
if (sourceIsPipeline) {
src = context.getSource();
} else if (op.getProperty(Annotations.NAMED_SET_SOURCE_REF) != null) {
final INamedSolutionSetRef namedSetSourceRef = (INamedSolutionSetRef) op
.getRequiredProperty(Annotations.NAMED_SET_SOURCE_REF);
src = context.getAlternateSource(namedSetSourceRef);
} else if (op.getProperty(Annotations.BINDING_SETS_SOURCE) != null) {
final IBindingSet[] bindingSets = (IBindingSet[]) op
.getProperty(Annotations.BINDING_SETS_SOURCE);
src = new SingleValueIterator<IBindingSet[]>(bindingSets);
} else {
throw new UnsupportedOperationException(
"Source was not specified");
}
try {
state.acceptSolutions(src, stats);
} finally {
src.close();
}
}
| void function() { final ICloseableIterator<IBindingSet[]> src; if (sourceIsPipeline) { src = context.getSource(); } else if (op.getProperty(Annotations.NAMED_SET_SOURCE_REF) != null) { final INamedSolutionSetRef namedSetSourceRef = (INamedSolutionSetRef) op .getRequiredProperty(Annotations.NAMED_SET_SOURCE_REF); src = context.getAlternateSource(namedSetSourceRef); } else if (op.getProperty(Annotations.BINDING_SETS_SOURCE) != null) { final IBindingSet[] bindingSets = (IBindingSet[]) op .getProperty(Annotations.BINDING_SETS_SOURCE); src = new SingleValueIterator<IBindingSet[]>(bindingSets); } else { throw new UnsupportedOperationException( STR); } try { state.acceptSolutions(src, stats); } finally { src.close(); } } | /**
* Add solutions to the hash index. The solutions to be indexed will be
* read either from the pipeline or from an "alternate" source
* identified by an annotation.
*
* @see HashIndexOp.Annotations#NAMED_SET_SOURCE_REF
*/ | Add solutions to the hash index. The solutions to be indexed will be read either from the pipeline or from an "alternate" source identified by an annotation | acceptSolutions | {
"repo_name": "smalyshev/blazegraph",
"path": "bigdata/src/java/com/bigdata/bop/join/HashIndexOp.java",
"license": "gpl-2.0",
"size": 18193
} | [
"com.bigdata.bop.IBindingSet",
"com.bigdata.bop.controller.INamedSolutionSetRef"
]
| import com.bigdata.bop.IBindingSet; import com.bigdata.bop.controller.INamedSolutionSetRef; | import com.bigdata.bop.*; import com.bigdata.bop.controller.*; | [
"com.bigdata.bop"
]
| com.bigdata.bop; | 1,599,606 |
@Override public void exitCompDimAggrFunction(@NotNull QueryGrammarParser.CompDimAggrFunctionContext ctx) { } | @Override public void exitCompDimAggrFunction(@NotNull QueryGrammarParser.CompDimAggrFunctionContext ctx) { } | /**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/ | The default implementation does nothing | enterCompDimAggrFunction | {
"repo_name": "pmeisen/dis-timeintervaldataanalyzer",
"path": "src/net/meisen/dissertation/impl/parser/query/generated/QueryGrammarBaseListener.java",
"license": "bsd-3-clause",
"size": 33327
} | [
"org.antlr.v4.runtime.misc.NotNull"
]
| import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
]
| org.antlr.v4; | 1,760,860 |
@Override
public void sleep(long duration, TimeUnit unit) throws InterruptedException {
plus(duration, unit);
} | void function(long duration, TimeUnit unit) throws InterruptedException { plus(duration, unit); } | /**
* Advances the clock by the given duration and immediately returns after that.
*
* @param duration duration value
* @param unit duration unit
* @throws InterruptedException
*/ | Advances the clock by the given duration and immediately returns after that | sleep | {
"repo_name": "Graylog2/graylog2-server",
"path": "graylog2-server/src/test/java/org/graylog/events/JobSchedulerTestClock.java",
"license": "gpl-3.0",
"size": 2416
} | [
"java.util.concurrent.TimeUnit"
]
| import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
]
| java.util; | 1,812,343 |
public static long getCurrentVersion(Directory directory) throws IOException {
// synchronized (directory) // our fix:directory their fix: FSDirectory.class FSDirectory.class
{
return SegmentInfos.readCurrentVersion(directory);
}
} | static long function(Directory directory) throws IOException { { return SegmentInfos.readCurrentVersion(directory); } } | /**
* Reads version number from segments files. The version number is
* initialized with a timestamp and then increased by one for each change of
* the index.
*
* @param directory where the index resides.
* @return version number.
* @throws IOException if segments file cannot be read.
*/ | Reads version number from segments files. The version number is initialized with a timestamp and then increased by one for each change of the index | getCurrentVersion | {
"repo_name": "lpxz/grail-lucene358684",
"path": "src/java/org/apache/lucene/index/IndexReader.java",
"license": "apache-2.0",
"size": 30781
} | [
"java.io.IOException",
"org.apache.lucene.store.Directory"
]
| import java.io.IOException; import org.apache.lucene.store.Directory; | import java.io.*; import org.apache.lucene.store.*; | [
"java.io",
"org.apache.lucene"
]
| java.io; org.apache.lucene; | 2,468,698 |
public void setAuthStepResult(AuthStepResult authStepResult) {
this.authStepResult = authStepResult;
} | void function(AuthStepResult authStepResult) { this.authStepResult = authStepResult; } | /**
* Set authentication step result.
* @param authStepResult Authentication step result.
*/ | Set authentication step result | setAuthStepResult | {
"repo_name": "lime-company/powerauth-webflow",
"path": "powerauth-data-adapter-model/src/main/java/io/getlime/security/powerauth/lib/dataadapter/model/request/AfsRequestParameters.java",
"license": "apache-2.0",
"size": 6709
} | [
"io.getlime.security.powerauth.lib.nextstep.model.enumeration.AuthStepResult"
]
| import io.getlime.security.powerauth.lib.nextstep.model.enumeration.AuthStepResult; | import io.getlime.security.powerauth.lib.nextstep.model.enumeration.*; | [
"io.getlime.security"
]
| io.getlime.security; | 1,671,225 |
@Test(groups = "embedded")
public void validateInvalidClusterOnServer() throws Exception {
ClusterMerlin clusterObj = new ClusterMerlin(bundles[0].getClusters().get(0));
clusterObj.setColo(null);
ServiceResponse response = cluster.getClusterHelper().validateEntity(clusterObj.toString());
AssertUtil.assertFailed(response);
} | @Test(groups = STR) void function() throws Exception { ClusterMerlin clusterObj = new ClusterMerlin(bundles[0].getClusters().get(0)); clusterObj.setColo(null); ServiceResponse response = cluster.getClusterHelper().validateEntity(clusterObj.toString()); AssertUtil.assertFailed(response); } | /**
*Validate an invalid cluster via server.
* Should fail.
*
* @throws Exception
*/ | Validate an invalid cluster via server. Should fail | validateInvalidClusterOnServer | {
"repo_name": "pisaychuk/apache-falcon",
"path": "falcon-regression/merlin/src/test/java/org/apache/falcon/regression/ValidateAPIPrismAndServerTest.java",
"license": "apache-2.0",
"size": 10431
} | [
"org.apache.falcon.regression.Entities",
"org.apache.falcon.regression.core.response.ServiceResponse",
"org.apache.falcon.regression.core.util.AssertUtil",
"org.testng.annotations.Test"
]
| import org.apache.falcon.regression.Entities; import org.apache.falcon.regression.core.response.ServiceResponse; import org.apache.falcon.regression.core.util.AssertUtil; import org.testng.annotations.Test; | import org.apache.falcon.regression.*; import org.apache.falcon.regression.core.response.*; import org.apache.falcon.regression.core.util.*; import org.testng.annotations.*; | [
"org.apache.falcon",
"org.testng.annotations"
]
| org.apache.falcon; org.testng.annotations; | 25,259 |
public void contextAdded(Context context);
| void function(Context context); | /**
* Called whenever a new context is created and added.
*/ | Called whenever a new context is created and added | contextAdded | {
"repo_name": "Harinus/zaproxy",
"path": "src/org/parosproxy/paros/model/Session.java",
"license": "apache-2.0",
"size": 56588
} | [
"org.zaproxy.zap.model.Context"
]
| import org.zaproxy.zap.model.Context; | import org.zaproxy.zap.model.*; | [
"org.zaproxy.zap"
]
| org.zaproxy.zap; | 922,070 |
final ScheduledExecutorService service = EasyMock
.createMock(ScheduledExecutorService.class);
EasyMock.replay(service);
final TimedSemaphore semaphore = new TimedSemaphore(service, PERIOD, UNIT,
LIMIT);
EasyMock.verify(service);
assertEquals("Wrong service", service, semaphore.getExecutorService());
assertEquals("Wrong period", PERIOD, semaphore.getPeriod());
assertEquals("Wrong unit", UNIT, semaphore.getUnit());
assertEquals("Statistic available", 0, semaphore
.getLastAcquiresPerPeriod());
assertEquals("Average available", 0.0, semaphore
.getAverageCallsPerPeriod(), .05);
assertFalse("Already shutdown", semaphore.isShutdown());
assertEquals("Wrong limit", LIMIT, semaphore.getLimit());
} | final ScheduledExecutorService service = EasyMock .createMock(ScheduledExecutorService.class); EasyMock.replay(service); final TimedSemaphore semaphore = new TimedSemaphore(service, PERIOD, UNIT, LIMIT); EasyMock.verify(service); assertEquals(STR, service, semaphore.getExecutorService()); assertEquals(STR, PERIOD, semaphore.getPeriod()); assertEquals(STR, UNIT, semaphore.getUnit()); assertEquals(STR, 0, semaphore .getLastAcquiresPerPeriod()); assertEquals(STR, 0.0, semaphore .getAverageCallsPerPeriod(), .05); assertFalse(STR, semaphore.isShutdown()); assertEquals(STR, LIMIT, semaphore.getLimit()); } | /**
* Tests creating a new instance.
*/ | Tests creating a new instance | testInit | {
"repo_name": "xiwc/commons-lang",
"path": "src/test/java/org/apache/commons/lang3/concurrent/TimedSemaphoreTest.java",
"license": "apache-2.0",
"size": 19163
} | [
"java.util.concurrent.ScheduledExecutorService",
"org.easymock.EasyMock",
"org.junit.Assert"
]
| import java.util.concurrent.ScheduledExecutorService; import org.easymock.EasyMock; import org.junit.Assert; | import java.util.concurrent.*; import org.easymock.*; import org.junit.*; | [
"java.util",
"org.easymock",
"org.junit"
]
| java.util; org.easymock; org.junit; | 1,737,896 |
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
} | Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } | /**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/ | Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods | applyToAllUnaryMethods | {
"repo_name": "googleapis/java-compute",
"path": "google-cloud-compute/src/main/java/com/google/cloud/compute/v1/stub/InstanceTemplatesStubSettings.java",
"license": "apache-2.0",
"size": 27021
} | [
"com.google.api.core.ApiFunction",
"com.google.api.gax.rpc.UnaryCallSettings"
]
| import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings; | import com.google.api.core.*; import com.google.api.gax.rpc.*; | [
"com.google.api"
]
| com.google.api; | 1,214,503 |
public void onCompletion(MediaPlayer player) {
Log.d(LOG_TAG, "on completion is calling stopped");
this.setState(STATE.MEDIA_STOPPED);
} | void function(MediaPlayer player) { Log.d(LOG_TAG, STR); this.setState(STATE.MEDIA_STOPPED); } | /**
* Callback to be invoked when playback of a media source has completed.
*
* @param player The MediaPlayer that reached the end of the file
*/ | Callback to be invoked when playback of a media source has completed | onCompletion | {
"repo_name": "cljack-public/phonegap",
"path": "framework/src/org/apache/cordova/AudioPlayer.java",
"license": "apache-2.0",
"size": 20898
} | [
"android.media.MediaPlayer",
"android.util.Log"
]
| import android.media.MediaPlayer; import android.util.Log; | import android.media.*; import android.util.*; | [
"android.media",
"android.util"
]
| android.media; android.util; | 1,555,997 |
protected void writeAttributeString(String localName, String stringValue)
throws ServiceXmlSerializationException {
try {
this.xmlWriter.writeAttribute(localName, stringValue);
} catch (XMLStreamException e) {
// Bug E14:65046: XmlTextWriter will throw ArgumentException
//if string includes invalid characters.
throw new ServiceXmlSerializationException(String.format(
"The invalid value '%s' was specified for the '%s' attribute.", stringValue, localName), e);
}
} | void function(String localName, String stringValue) throws ServiceXmlSerializationException { try { this.xmlWriter.writeAttribute(localName, stringValue); } catch (XMLStreamException e) { throw new ServiceXmlSerializationException(String.format( STR, stringValue, localName), e); } } | /**
* Writes the attribute value.
*
* @param localName The local name of the attribute.
* @param stringValue The string value.
* @throws ServiceXmlSerializationException Thrown if string value isn't valid for XML
*/ | Writes the attribute value | writeAttributeString | {
"repo_name": "sanjay444/ews-java-api",
"path": "src/main/java/microsoft/exchange/webservices/data/core/EwsServiceXmlWriter.java",
"license": "mit",
"size": 19643
} | [
"javax.xml.stream.XMLStreamException"
]
| import javax.xml.stream.XMLStreamException; | import javax.xml.stream.*; | [
"javax.xml"
]
| javax.xml; | 2,281,926 |
public void chatWaiting(OmegleSession session); | void function(OmegleSession session); | /**
* Called when a chat is sent the 'waiting' event
*
* @param session
* The session which was changed to 'waiting'
*/ | Called when a chat is sent the 'waiting' event | chatWaiting | {
"repo_name": "nikkiii/omegle-api-java",
"path": "src/org/nikki/omegle/event/OmegleEventListener.java",
"license": "gpl-3.0",
"size": 6109
} | [
"org.nikki.omegle.core.OmegleSession"
]
| import org.nikki.omegle.core.OmegleSession; | import org.nikki.omegle.core.*; | [
"org.nikki.omegle"
]
| org.nikki.omegle; | 1,908,188 |
@Override
public String getNamespaceUri() {
return AbstractITunesObject.URI;
} | String function() { return AbstractITunesObject.URI; } | /**
* Returns the namespace URI this module handles.
*
* @return Returns the namespace URI this module handles.
*/ | Returns the namespace URI this module handles | getNamespaceUri | {
"repo_name": "IgnacioDomingo/rome-modules",
"path": "src/main/java/com/rometools/modules/itunes/io/ITunesGenerator.java",
"license": "apache-2.0",
"size": 6951
} | [
"com.rometools.modules.itunes.AbstractITunesObject"
]
| import com.rometools.modules.itunes.AbstractITunesObject; | import com.rometools.modules.itunes.*; | [
"com.rometools.modules"
]
| com.rometools.modules; | 981,902 |
public BlockingQueue<TesterRegistration> registrations() {
return registrations;
} | BlockingQueue<TesterRegistration> function() { return registrations; } | /**
* Pending registrations.
*
* @return
*/ | Pending registrations | registrations | {
"repo_name": "sunye/Macaw",
"path": "horda-coordinator/src/main/java/org/atlanmod/horda/coordinator/coordinator/RemoteCoordinatorImpl.java",
"license": "gpl-3.0",
"size": 4625
} | [
"java.util.concurrent.BlockingQueue",
"org.atlanmod.commons.coordinator.TesterRegistration"
]
| import java.util.concurrent.BlockingQueue; import org.atlanmod.commons.coordinator.TesterRegistration; | import java.util.concurrent.*; import org.atlanmod.commons.coordinator.*; | [
"java.util",
"org.atlanmod.commons"
]
| java.util; org.atlanmod.commons; | 1,013,687 |
@ServiceMethod(returns = ReturnType.SINGLE)
public BlobRestoreStatusInner restoreBlobRanges(
String resourceGroupName,
String accountName,
OffsetDateTime timeToRestore,
List<BlobRestoreRange> blobRanges,
Context context) {
return restoreBlobRangesAsync(resourceGroupName, accountName, timeToRestore, blobRanges, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) BlobRestoreStatusInner function( String resourceGroupName, String accountName, OffsetDateTime timeToRestore, List<BlobRestoreRange> blobRanges, Context context) { return restoreBlobRangesAsync(resourceGroupName, accountName, timeToRestore, blobRanges, context).block(); } | /**
* Restore blobs in the specified blob ranges.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case
* insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names
* must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param timeToRestore Restore blob to the specified time.
* @param blobRanges Blob ranges to restore.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return blob restore status.
*/ | Restore blobs in the specified blob ranges | restoreBlobRanges | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java",
"license": "mit",
"size": 168198
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.storage.fluent.models.BlobRestoreStatusInner",
"com.azure.resourcemanager.storage.models.BlobRestoreRange",
"java.time.OffsetDateTime",
"java.util.List"
]
| import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.storage.fluent.models.BlobRestoreStatusInner; import com.azure.resourcemanager.storage.models.BlobRestoreRange; import java.time.OffsetDateTime; import java.util.List; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.storage.fluent.models.*; import com.azure.resourcemanager.storage.models.*; import java.time.*; import java.util.*; | [
"com.azure.core",
"com.azure.resourcemanager",
"java.time",
"java.util"
]
| com.azure.core; com.azure.resourcemanager; java.time; java.util; | 1,805,464 |
public void updateOccurrenceAnnotations(ITextSelection selection, CFDocument antModel) {
if (fOccurrencesFinderJob != null)
fOccurrencesFinderJob.cancel();
if (!fMarkOccurrenceAnnotations) {
return;
}
if (selection == null || antModel == null) {
return;
}
IDocument document= fViewer.getDocument();
if (document == null) {
return;
}
List positions= null;
OccurrencesFinder finder= new OccurrencesFinder(editor, antModel, document, selection.getOffset());
positions= finder.perform();
if (positions == null || positions.size() == 0) {
if (!fStickyOccurrenceAnnotations) {
removeOccurrenceAnnotations();
}
return;
}
fOccurrencesFinderJob= new OccurrencesFinderJob(document, positions, selection);
fOccurrencesFinderJob.run(new NullProgressMonitor());
}
| void function(ITextSelection selection, CFDocument antModel) { if (fOccurrencesFinderJob != null) fOccurrencesFinderJob.cancel(); if (!fMarkOccurrenceAnnotations) { return; } if (selection == null antModel == null) { return; } IDocument document= fViewer.getDocument(); if (document == null) { return; } List positions= null; OccurrencesFinder finder= new OccurrencesFinder(editor, antModel, document, selection.getOffset()); positions= finder.perform(); if (positions == null positions.size() == 0) { if (!fStickyOccurrenceAnnotations) { removeOccurrenceAnnotations(); } return; } fOccurrencesFinderJob= new OccurrencesFinderJob(document, positions, selection); fOccurrencesFinderJob.run(new NullProgressMonitor()); } | /**
* Updates the occurrences annotations based
* on the current selection.
*
* @param selection the text selection
* @param antModel the model for the buildfile
* @since 3.1
*/ | Updates the occurrences annotations based on the current selection | updateOccurrenceAnnotations | {
"repo_name": "cybersonic/org.cfeclipse.cfml",
"path": "src/org/cfeclipse/cfml/editors/dnd/SelectionCursorListener.java",
"license": "mit",
"size": 32618
} | [
"java.util.List",
"org.cfeclipse.cfml.editors.OccurrencesFinder",
"org.cfeclipse.cfml.parser.CFDocument",
"org.eclipse.core.runtime.NullProgressMonitor",
"org.eclipse.jface.text.IDocument",
"org.eclipse.jface.text.ITextSelection"
]
| import java.util.List; import org.cfeclipse.cfml.editors.OccurrencesFinder; import org.cfeclipse.cfml.parser.CFDocument; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextSelection; | import java.util.*; import org.cfeclipse.cfml.editors.*; import org.cfeclipse.cfml.parser.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.text.*; | [
"java.util",
"org.cfeclipse.cfml",
"org.eclipse.core",
"org.eclipse.jface"
]
| java.util; org.cfeclipse.cfml; org.eclipse.core; org.eclipse.jface; | 1,776,001 |
public static Map<String, Collection<String>> transformPrincipalAttributesListIntoMap(final List<String> list) {
final Multimap<String, String> map = transformPrincipalAttributesListIntoMultiMap(list);
return CollectionUtils.wrap(map);
} | static Map<String, Collection<String>> function(final List<String> list) { final Multimap<String, String> map = transformPrincipalAttributesListIntoMultiMap(list); return CollectionUtils.wrap(map); } | /**
* Transform principal attributes list into map map.
*
* @param list the list
* @return the map
*/ | Transform principal attributes list into map map | transformPrincipalAttributesListIntoMap | {
"repo_name": "Unicon/cas",
"path": "core/cas-server-core-authentication/src/main/java/org/apereo/cas/authentication/CoreAuthenticationUtils.java",
"license": "apache-2.0",
"size": 5634
} | [
"com.google.common.collect.Multimap",
"java.util.Collection",
"java.util.List",
"java.util.Map",
"org.apereo.cas.util.CollectionUtils"
]
| import com.google.common.collect.Multimap; import java.util.Collection; import java.util.List; import java.util.Map; import org.apereo.cas.util.CollectionUtils; | import com.google.common.collect.*; import java.util.*; import org.apereo.cas.util.*; | [
"com.google.common",
"java.util",
"org.apereo.cas"
]
| com.google.common; java.util; org.apereo.cas; | 469,641 |
@Test
public void testGetFirstPulseLevel() {
assertThat(instance.getFirstPulseLevel(), is(1));
instance = new PulseList(pulses, 0, 1);
assertThat(instance.getFirstPulseLevel(), is(0));
} | void function() { assertThat(instance.getFirstPulseLevel(), is(1)); instance = new PulseList(pulses, 0, 1); assertThat(instance.getFirstPulseLevel(), is(0)); } | /**
* Test of getFirstPulseLevel method, of class PulseList.
*/ | Test of getFirstPulseLevel method, of class PulseList | testGetFirstPulseLevel | {
"repo_name": "fmeunier/wav2pzx",
"path": "src/test/java/xyz/meunier/wav2pzx/pulselist/PulseListTest.java",
"license": "bsd-2-clause",
"size": 3126
} | [
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
]
| import org.hamcrest.CoreMatchers; import org.junit.Assert; | import org.hamcrest.*; import org.junit.*; | [
"org.hamcrest",
"org.junit"
]
| org.hamcrest; org.junit; | 777,127 |
private static void removeModelEntity(Ignite ignite, UUID mdlId) {
ModelStorage storage = new ModelStorageFactory().getModelStorage(ignite);
storage.remove(IGNITE_MDL_FOLDER + "/" + mdlId);
} | static void function(Ignite ignite, UUID mdlId) { ModelStorage storage = new ModelStorageFactory().getModelStorage(ignite); storage.remove(IGNITE_MDL_FOLDER + "/" + mdlId); } | /**
* Removes model with specified identifier from model storage.
*
* @param ignite Ignite instance.
* @param mdlId Model identifier.
*/ | Removes model with specified identifier from model storage | removeModelEntity | {
"repo_name": "daradurvs/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/inference/IgniteModelStorageUtil.java",
"license": "apache-2.0",
"size": 12501
} | [
"org.apache.ignite.Ignite",
"org.apache.ignite.ml.inference.storage.model.ModelStorage",
"org.apache.ignite.ml.inference.storage.model.ModelStorageFactory"
]
| import org.apache.ignite.Ignite; import org.apache.ignite.ml.inference.storage.model.ModelStorage; import org.apache.ignite.ml.inference.storage.model.ModelStorageFactory; | import org.apache.ignite.*; import org.apache.ignite.ml.inference.storage.model.*; | [
"org.apache.ignite"
]
| org.apache.ignite; | 1,655,661 |
public static void setAppleCrosstoolTransitionConfiguration(BuildOptions from,
BuildOptions to, String cpu) {
to.get(BuildConfiguration.Options.class).cpu = cpu;
to.get(CppOptions.class).crosstoolTop =
from.get(AppleCommandLineOptions.class).appleCrosstoolTop;
// --compiler = "compiler" for all OSX toolchains. We do not support asan/tsan, cfi, etc. on
// darwin.
to.get(CppOptions.class).cppCompiler = "compiler";
// OSX toolchains always use the runtime of the platform they are targeting (i.e. we do not
// support custom production environments).
to.get(CppOptions.class).libcTop = null;
to.get(CppOptions.class).glibc = null;
// OSX toolchains do not support fission.
to.get(CppOptions.class).fissionModes = ImmutableList.of();
} | static void function(BuildOptions from, BuildOptions to, String cpu) { to.get(BuildConfiguration.Options.class).cpu = cpu; to.get(CppOptions.class).crosstoolTop = from.get(AppleCommandLineOptions.class).appleCrosstoolTop; to.get(CppOptions.class).cppCompiler = STR; to.get(CppOptions.class).libcTop = null; to.get(CppOptions.class).glibc = null; to.get(CppOptions.class).fissionModes = ImmutableList.of(); } | /**
* Sets configuration fields required for a transition that uses apple_crosstool_top in place of
* the default CROSSTOOL.
*
* @param from options from the originating configuration
* @param to options for the destination configuration. This instance will be modified
* to so the destination configuration uses the apple crosstool
* @param cpu {@code --cpu} value for toolchain selection in the destination configuration
*/ | Sets configuration fields required for a transition that uses apple_crosstool_top in place of the default CROSSTOOL | setAppleCrosstoolTransitionConfiguration | {
"repo_name": "kchodorow/bazel-1",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java",
"license": "apache-2.0",
"size": 4224
} | [
"com.google.common.collect.ImmutableList",
"com.google.devtools.build.lib.analysis.config.BuildConfiguration",
"com.google.devtools.build.lib.analysis.config.BuildOptions",
"com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions",
"com.google.devtools.build.lib.rules.cpp.CppOptions"
]
| import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.analysis.config.BuildOptions; import com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions; import com.google.devtools.build.lib.rules.cpp.CppOptions; | import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.config.*; import com.google.devtools.build.lib.rules.apple.*; import com.google.devtools.build.lib.rules.cpp.*; | [
"com.google.common",
"com.google.devtools"
]
| com.google.common; com.google.devtools; | 2,038,841 |
return irAclDAO.getAcl(getObjectId(domainInstance),
CgLibHelper.cleanClassName(domainInstance.getClass().getName()), sid);
}
| return irAclDAO.getAcl(getObjectId(domainInstance), CgLibHelper.cleanClassName(domainInstance.getClass().getName()), sid); } | /**
* Get the ACL for specified domain instance and Principal
*
* @param domainInstance object that has to be secured
* @param sid Id for user
*/ | Get the ACL for specified domain instance and Principal | getAcl | {
"repo_name": "nate-rcl/irplus",
"path": "ir_service/src/edu/ur/ir/security/service/DefaultSecurityService.java",
"license": "apache-2.0",
"size": 16840
} | [
"edu.ur.cgLib.CgLibHelper"
]
| import edu.ur.cgLib.CgLibHelper; | import edu.ur.*; | [
"edu.ur"
]
| edu.ur; | 112,796 |
public OperationStatus deletePatterns(UUID appId, String versionId, List<UUID> patternIds) {
return deletePatternsWithServiceResponseAsync(appId, versionId, patternIds).toBlocking().single().body();
} | OperationStatus function(UUID appId, String versionId, List<UUID> patternIds) { return deletePatternsWithServiceResponseAsync(appId, versionId, patternIds).toBlocking().single().body(); } | /**
* Deletes a list of patterns in a version of the application.
*
* @param appId The application ID.
* @param versionId The version ID.
* @param patternIds The patterns IDs.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the OperationStatus object if successful.
*/ | Deletes a list of patterns in a version of the application | deletePatterns | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java",
"license": "mit",
"size": 55384
} | [
"com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus",
"java.util.List"
]
| import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; import java.util.List; | import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.*; import java.util.*; | [
"com.microsoft.azure",
"java.util"
]
| com.microsoft.azure; java.util; | 535,880 |
@Override
public Set<Integer> get(Set<Integer> element){
return get(element, 0D);
}
| Set<Integer> function(Set<Integer> element){ return get(element, 0D); } | /**
* Gets the finalElement to element if exists, else null
*/ | Gets the finalElement to element if exists, else null | get | {
"repo_name": "renespeck/Cugar",
"path": "src/de/uni_leipzig/cc/coyotecache/CoyoteCache.java",
"license": "gpl-2.0",
"size": 6913
} | [
"java.util.Set"
]
| import java.util.Set; | import java.util.*; | [
"java.util"
]
| java.util; | 150,206 |
void setThreshold(BigDecimal value); | void setThreshold(BigDecimal value); | /**
* Sets the value of the '{@link org.openhab.binding.tinkerforge.internal.model.PTCResistance#getThreshold
* <em>Threshold</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @param value the new value of the '<em>Threshold</em>' attribute.
* @see #getThreshold()
* @generated
*/ | Sets the value of the '<code>org.openhab.binding.tinkerforge.internal.model.PTCResistance#getThreshold Threshold</code>' attribute. | setThreshold | {
"repo_name": "mvolaart/openhab",
"path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/PTCResistance.java",
"license": "epl-1.0",
"size": 3292
} | [
"java.math.BigDecimal"
]
| import java.math.BigDecimal; | import java.math.*; | [
"java.math"
]
| java.math; | 2,595,566 |
public boolean isPrimary() {
return spaceMode == SpaceMode.PRIMARY;
} | boolean function() { return spaceMode == SpaceMode.PRIMARY; } | /**
* The space mode is <code>PRIMARY</code>.
*/ | The space mode is <code>PRIMARY</code> | isPrimary | {
"repo_name": "Gigaspaces/xap-openspaces",
"path": "src/main/java/org/openspaces/core/space/mode/AbstractSpaceModeChangeEvent.java",
"license": "apache-2.0",
"size": 2101
} | [
"com.gigaspaces.cluster.activeelection.SpaceMode"
]
| import com.gigaspaces.cluster.activeelection.SpaceMode; | import com.gigaspaces.cluster.activeelection.*; | [
"com.gigaspaces.cluster"
]
| com.gigaspaces.cluster; | 23,888 |
public void close() throws IOException {
pool.close();
}
private static class KryoPool {
Queue<KryoHolder> pool = new ConcurrentLinkedQueue<KryoHolder>(); | void function() throws IOException { pool.close(); } private static class KryoPool { Queue<KryoHolder> pool = new ConcurrentLinkedQueue<KryoHolder>(); | /**
* clear cached Kryo
*
* @throws java.io.IOException
*/ | clear cached Kryo | close | {
"repo_name": "lichengwu/iMemory",
"path": "iMemory-serializer/src/main/java/cn/lichengwu/imemory/serializer/KryoSerializer.java",
"license": "gpl-3.0",
"size": 3286
} | [
"java.io.IOException",
"java.util.Queue",
"java.util.concurrent.ConcurrentLinkedQueue"
]
| import java.io.IOException; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; | import java.io.*; import java.util.*; import java.util.concurrent.*; | [
"java.io",
"java.util"
]
| java.io; java.util; | 2,860,615 |
private void dumpCarParkDataResults(final List<CarParkData> list)
{
for (CarParkData data : list)
{
System.out.println(data.toString());
}
}
| void function(final List<CarParkData> list) { for (CarParkData data : list) { System.out.println(data.toString()); } } | /**
* Dump out results so we can take a look at them.
*
* @param list
*/ | Dump out results so we can take a look at them | dumpCarParkDataResults | {
"repo_name": "alistairrutherford/transportation-json-glasgow",
"path": "src/test/java/com/netthreads/transportation/test/TestParser.java",
"license": "apache-2.0",
"size": 3541
} | [
"com.netthreads.transportation.data.CarParkData",
"java.util.List"
]
| import com.netthreads.transportation.data.CarParkData; import java.util.List; | import com.netthreads.transportation.data.*; import java.util.*; | [
"com.netthreads.transportation",
"java.util"
]
| com.netthreads.transportation; java.util; | 988,837 |
public void onMotionEvent(MotionEvent e) {
int eventAction = e.getActionMasked();
if (eventAction == MotionEvent.ACTION_DOWN
|| eventAction == MotionEvent.ACTION_POINTER_DOWN) {
mInGesture = true;
getHtmlApiHandler().hideNotificationBubble();
} else if (eventAction == MotionEvent.ACTION_CANCEL
|| eventAction == MotionEvent.ACTION_UP) {
mInGesture = false;
updateVisuals();
}
} | void function(MotionEvent e) { int eventAction = e.getActionMasked(); if (eventAction == MotionEvent.ACTION_DOWN eventAction == MotionEvent.ACTION_POINTER_DOWN) { mInGesture = true; getHtmlApiHandler().hideNotificationBubble(); } else if (eventAction == MotionEvent.ACTION_CANCEL eventAction == MotionEvent.ACTION_UP) { mInGesture = false; updateVisuals(); } } | /**
* Notifies the fullscreen manager that a motion event has occurred.
* @param e The dispatched motion event.
*/ | Notifies the fullscreen manager that a motion event has occurred | onMotionEvent | {
"repo_name": "Pluto-tv/chromium-crosswalk",
"path": "chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java",
"license": "bsd-3-clause",
"size": 29319
} | [
"android.view.MotionEvent"
]
| import android.view.MotionEvent; | import android.view.*; | [
"android.view"
]
| android.view; | 588,682 |
public void testSanity() throws Exception{
HBaseAdmin admin =
new HBaseAdmin(new Configuration(TEST_UTIL.getConfiguration()));
String tableName = "test"+System.currentTimeMillis();
HTableDescriptor desc = new HTableDescriptor(tableName);
HColumnDescriptor family = new HColumnDescriptor("fam");
desc.addFamily(family);
LOG.info("Creating table " + tableName);
admin.createTable(desc);
HTable table =
new HTable(new Configuration(TEST_UTIL.getConfiguration()), tableName);
Put put = new Put(Bytes.toBytes("testrow"));
put.add(Bytes.toBytes("fam"),
Bytes.toBytes("col"), Bytes.toBytes("testdata"));
LOG.info("Putting table " + tableName);
table.put(put);
} | void function() throws Exception{ HBaseAdmin admin = new HBaseAdmin(new Configuration(TEST_UTIL.getConfiguration())); String tableName = "test"+System.currentTimeMillis(); HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor family = new HColumnDescriptor("fam"); desc.addFamily(family); LOG.info(STR + tableName); admin.createTable(desc); HTable table = new HTable(new Configuration(TEST_UTIL.getConfiguration()), tableName); Put put = new Put(Bytes.toBytes(STR)); put.add(Bytes.toBytes("fam"), Bytes.toBytes("col"), Bytes.toBytes(STR)); LOG.info(STR + tableName); table.put(put); } | /**
* Make sure we can use the cluster
* @throws Exception
*/ | Make sure we can use the cluster | testSanity | {
"repo_name": "bcopeland/hbase-thrift",
"path": "src/test/java/org/apache/hadoop/hbase/TestZooKeeper.java",
"license": "apache-2.0",
"size": 10314
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.client.HBaseAdmin",
"org.apache.hadoop.hbase.client.HTable",
"org.apache.hadoop.hbase.client.Put",
"org.apache.hadoop.hbase.util.Bytes"
]
| import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes; | import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
]
| org.apache.hadoop; | 1,935,536 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> deletePortMirroringWithResponseAsync(
String resourceGroupName, String portMirroringId, String privateCloudName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (portMirroringId == null) {
return Mono
.error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
}
if (privateCloudName == null) {
return Mono
.error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.deletePortMirroring(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
this.client.getApiVersion(),
portMirroringId,
privateCloudName,
accept,
context);
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> function( String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (portMirroringId == null) { return Mono .error(new IllegalArgumentException(STR)); } if (privateCloudName == null) { return Mono .error(new IllegalArgumentException(STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .deletePortMirroring( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), portMirroringId, privateCloudName, accept, context); } | /**
* Delete a port mirroring profile by id in a private cloud workload network.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name.
* @param privateCloudName Name of the private cloud.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/ | Delete a port mirroring profile by id in a private cloud workload network | deletePortMirroringWithResponseAsync | {
"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.Response",
"com.azure.core.util.Context",
"java.nio.ByteBuffer"
]
| import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import java.nio.*; | [
"com.azure.core",
"java.nio"
]
| com.azure.core; java.nio; | 1,416,441 |
@Endpoint(
describeByClass = true
)
public static <U extends TNumber> Irfft3d<U> create(Scope scope, Operand<? extends TType> input,
Operand<TInt32> fftLength, Class<U> Treal) {
OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "Irfft3d");
opBuilder.addInput(input.asOutput());
opBuilder.addInput(fftLength.asOutput());
opBuilder.setAttr("Treal", Operands.toDataType(Treal));
return new Irfft3d<>(opBuilder.build());
} | @Endpoint( describeByClass = true ) static <U extends TNumber> Irfft3d<U> function(Scope scope, Operand<? extends TType> input, Operand<TInt32> fftLength, Class<U> Treal) { OperationBuilder opBuilder = scope.opBuilder(OP_NAME, STR); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); return new Irfft3d<>(opBuilder.build()); } | /**
* Factory method to create a class wrapping a new IRFFT3D operation.
*
* @param scope current scope
* @param input A complex tensor.
* @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension.
* @param Treal The value of the Treal attribute
* @param <U> data type for {@code IRFFT3D} output and operands
* @return a new instance of Irfft3d
*/ | Factory method to create a class wrapping a new IRFFT3D operation | create | {
"repo_name": "tensorflow/java",
"path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java",
"license": "apache-2.0",
"size": 5833
} | [
"org.tensorflow.Operand",
"org.tensorflow.OperationBuilder",
"org.tensorflow.op.Operands",
"org.tensorflow.op.Scope",
"org.tensorflow.op.annotation.Endpoint",
"org.tensorflow.types.TInt32",
"org.tensorflow.types.family.TNumber",
"org.tensorflow.types.family.TType"
]
| import org.tensorflow.Operand; import org.tensorflow.OperationBuilder; import org.tensorflow.op.Operands; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; | import org.tensorflow.*; import org.tensorflow.op.*; import org.tensorflow.op.annotation.*; import org.tensorflow.types.*; import org.tensorflow.types.family.*; | [
"org.tensorflow",
"org.tensorflow.op",
"org.tensorflow.types"
]
| org.tensorflow; org.tensorflow.op; org.tensorflow.types; | 1,386,263 |
@Nullable private Collection<Method> methodsFromCache(Class<?> cls, Class<? extends Annotation> annCls) {
assert cls != null;
assert annCls != null;
Map<Class<? extends Annotation>, Collection<Method>> annCache = mtdCache.get(cls);
return annCache != null ? annCache.get(annCls) : null;
} | @Nullable Collection<Method> function(Class<?> cls, Class<? extends Annotation> annCls) { assert cls != null; assert annCls != null; Map<Class<? extends Annotation>, Collection<Method>> annCache = mtdCache.get(cls); return annCache != null ? annCache.get(annCls) : null; } | /**
* Gets all methods for a given class with given annotation from cache.
*
* @param cls Class to get methods from.
* @param annCls Annotation class for fields.
* @return List of methods with given annotation, possibly {@code null}.
*/ | Gets all methods for a given class with given annotation from cache | methodsFromCache | {
"repo_name": "andrey-kuznetsov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeployment.java",
"license": "apache-2.0",
"size": 24572
} | [
"java.lang.annotation.Annotation",
"java.lang.reflect.Method",
"java.util.Collection",
"java.util.Map",
"org.jetbrains.annotations.Nullable"
]
| import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.Collection; import java.util.Map; import org.jetbrains.annotations.Nullable; | import java.lang.annotation.*; import java.lang.reflect.*; import java.util.*; import org.jetbrains.annotations.*; | [
"java.lang",
"java.util",
"org.jetbrains.annotations"
]
| java.lang; java.util; org.jetbrains.annotations; | 1,732,313 |
public ECFieldElement pow(BigInteger k) {
ECFieldElement u = this;
for (int i = k.bitLength() - 2; i >= 0; i--) {
u = u.square();
if (k.testBit(i)) {
u = u.multiply(this);
}
}
return u;
} | ECFieldElement function(BigInteger k) { ECFieldElement u = this; for (int i = k.bitLength() - 2; i >= 0; i--) { u = u.square(); if (k.testBit(i)) { u = u.multiply(this); } } return u; } | /**
* Raises the current field element to the power k, given as argument
*
* @return the power this^k
*/ | Raises the current field element to the power k, given as argument | pow | {
"repo_name": "credentials/bouncycastle-ext",
"path": "src/org/bouncycastle/math/ec/ECFieldElementFp2.java",
"license": "gpl-3.0",
"size": 15795
} | [
"java.math.BigInteger"
]
| import java.math.BigInteger; | import java.math.*; | [
"java.math"
]
| java.math; | 807,379 |
protected void deliverToOnRedeliveryProcessor(final Exchange exchange, final RedeliveryData data) {
if (data.onRedeliveryProcessor == null) {
return;
}
if (log.isTraceEnabled()) {
log.trace("Redelivery processor {} is processing Exchange: {} before its redelivered",
data.onRedeliveryProcessor, exchange);
}
// run this synchronously as its just a Processor
try {
data.onRedeliveryProcessor.process(exchange);
} catch (Throwable e) {
exchange.setException(e);
}
log.trace("Redelivery processor done");
} | void function(final Exchange exchange, final RedeliveryData data) { if (data.onRedeliveryProcessor == null) { return; } if (log.isTraceEnabled()) { log.trace(STR, data.onRedeliveryProcessor, exchange); } try { data.onRedeliveryProcessor.process(exchange); } catch (Throwable e) { exchange.setException(e); } log.trace(STR); } | /**
* Gives an optional configure redelivery processor a chance to process before the Exchange
* will be redelivered. This can be used to alter the Exchange.
*/ | Gives an optional configure redelivery processor a chance to process before the Exchange will be redelivered. This can be used to alter the Exchange | deliverToOnRedeliveryProcessor | {
"repo_name": "engagepoint/camel",
"path": "camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java",
"license": "apache-2.0",
"size": 49739
} | [
"org.apache.camel.Exchange"
]
| import org.apache.camel.Exchange; | import org.apache.camel.*; | [
"org.apache.camel"
]
| org.apache.camel; | 1,557,423 |
public void sortOtherSiteRelations(CmsObject cms, CmsResourceStatusBean resStatus) {
final List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(
cms,
false,
false,
cms.getRequestContext().getOuFqn());
Collections.sort(resStatus.getOtherSiteRelationSources(), new Comparator<CmsResourceStatusRelationBean>() {
private Map<String, Integer> m_rankCache = Maps.newHashMap();
| void function(CmsObject cms, CmsResourceStatusBean resStatus) { final List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites( cms, false, false, cms.getRequestContext().getOuFqn()); Collections.sort(resStatus.getOtherSiteRelationSources(), new Comparator<CmsResourceStatusRelationBean>() { private Map<String, Integer> m_rankCache = Maps.newHashMap(); | /**
* Sorts relation beans from other sites by site order.<p>
*
* @param cms the current CMS context
* @param resStatus the bean in which to sort the relation beans
*/ | Sorts relation beans from other sites by site order | sortOtherSiteRelations | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/gwt/CmsDefaultResourceStatusProvider.java",
"license": "lgpl-2.1",
"size": 25318
} | [
"com.google.common.collect.Maps",
"java.util.Collections",
"java.util.Comparator",
"java.util.List",
"java.util.Map",
"org.opencms.file.CmsObject",
"org.opencms.gwt.shared.CmsResourceStatusBean",
"org.opencms.gwt.shared.CmsResourceStatusRelationBean",
"org.opencms.main.OpenCms",
"org.opencms.site.CmsSite"
]
| import com.google.common.collect.Maps; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import org.opencms.file.CmsObject; import org.opencms.gwt.shared.CmsResourceStatusBean; import org.opencms.gwt.shared.CmsResourceStatusRelationBean; import org.opencms.main.OpenCms; import org.opencms.site.CmsSite; | import com.google.common.collect.*; import java.util.*; import org.opencms.file.*; import org.opencms.gwt.shared.*; import org.opencms.main.*; import org.opencms.site.*; | [
"com.google.common",
"java.util",
"org.opencms.file",
"org.opencms.gwt",
"org.opencms.main",
"org.opencms.site"
]
| com.google.common; java.util; org.opencms.file; org.opencms.gwt; org.opencms.main; org.opencms.site; | 754,283 |
public static java.util.List extractEmergencyAttendanceList(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EmergencyAttendanceForEDDischargeVoCollection voCollection)
{
return extractEmergencyAttendanceList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EmergencyAttendanceForEDDischargeVoCollection voCollection) { return extractEmergencyAttendanceList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.core.admin.domain.objects.EmergencyAttendance list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.core.admin.domain.objects.EmergencyAttendance list from the value object collection | extractEmergencyAttendanceList | {
"repo_name": "IMS-MAXIMS/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/EmergencyAttendanceForEDDischargeVoAssembler.java",
"license": "agpl-3.0",
"size": 19870
} | [
"java.util.HashMap"
]
| import java.util.HashMap; | import java.util.*; | [
"java.util"
]
| java.util; | 457,534 |
public static String join(final Iterator<?> iterator, final String separator) {
// handle null, zero and one elements before building a buffer
if (iterator == null) {
return null;
}
if (!iterator.hasNext()) {
return EMPTY;
}
final Object first = iterator.next();
if (!iterator.hasNext()) {
@SuppressWarnings( "deprecation" ) // ObjectUtils.toString(Object) has been deprecated in 3.2
final String result = ObjectUtils.toString(first);
return result;
}
// two or more elements
final StringBuilder buf = new StringBuilder(256); // Java default is 16, probably too small
if (first != null) {
buf.append(first);
}
while (iterator.hasNext()) {
if (separator != null) {
buf.append(separator);
}
final Object obj = iterator.next();
if (obj != null) {
buf.append(obj);
}
}
return buf.toString();
} | static String function(final Iterator<?> iterator, final String separator) { if (iterator == null) { return null; } if (!iterator.hasNext()) { return EMPTY; } final Object first = iterator.next(); if (!iterator.hasNext()) { @SuppressWarnings( STR ) final String result = ObjectUtils.toString(first); return result; } final StringBuilder buf = new StringBuilder(256); if (first != null) { buf.append(first); } while (iterator.hasNext()) { if (separator != null) { buf.append(separator); } final Object obj = iterator.next(); if (obj != null) { buf.append(obj); } } return buf.toString(); } | /**
* <p>Joins the elements of the provided {@code Iterator} into
* a single String containing the provided elements.</p>
*
* <p>No delimiter is added before or after the list.
* A {@code null} separator is the same as an empty String ("").</p>
*
* <p>See the examples here: {@link #join(Object[],String)}. </p>
*
* @param iterator the {@code Iterator} of values to join together, may be null
* @param separator the separator character to use, null treated as ""
* @return the joined String, {@code null} if null iterator input
*/ | Joins the elements of the provided Iterator into a single String containing the provided elements. No delimiter is added before or after the list. A null separator is the same as an empty String (""). See the examples here: <code>#join(Object[],String)</code>. | join | {
"repo_name": "PascalSchumacher/commons-lang",
"path": "src/main/java/org/apache/commons/lang3/StringUtils.java",
"license": "apache-2.0",
"size": 321191
} | [
"java.util.Iterator"
]
| import java.util.Iterator; | import java.util.*; | [
"java.util"
]
| java.util; | 1,121,731 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<ExpressRouteCircuitStatsInner> getStatsWithResponse(
String resourceGroupName, String circuitName, Context context) {
return getStatsWithResponseAsync(resourceGroupName, circuitName, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) Response<ExpressRouteCircuitStatsInner> function( String resourceGroupName, String circuitName, Context context) { return getStatsWithResponseAsync(resourceGroupName, circuitName, context).block(); } | /**
* Gets all the stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return all the stats from an express route circuit in a resource group along with {@link Response}.
*/ | Gets all the stats from an express route circuit in a resource group | getStatsWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCircuitsClientImpl.java",
"license": "mit",
"size": 143721
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitStatsInner"
]
| import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitStatsInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
]
| com.azure.core; com.azure.resourcemanager; | 2,427,436 |
public ApplicationGatewayPathRule withBackendAddressPool(SubResource backendAddressPool) {
this.backendAddressPool = backendAddressPool;
return this;
} | ApplicationGatewayPathRule function(SubResource backendAddressPool) { this.backendAddressPool = backendAddressPool; return this; } | /**
* Set backend address pool resource of URL path map path rule.
*
* @param backendAddressPool the backendAddressPool value to set
* @return the ApplicationGatewayPathRule object itself.
*/ | Set backend address pool resource of URL path map path rule | withBackendAddressPool | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/ApplicationGatewayPathRule.java",
"license": "mit",
"size": 7193
} | [
"com.microsoft.azure.SubResource"
]
| import com.microsoft.azure.SubResource; | import com.microsoft.azure.*; | [
"com.microsoft.azure"
]
| com.microsoft.azure; | 2,022,636 |
public static ch46Type fromPerUnaligned(byte[] encodedBytes) {
ch46Type result = new ch46Type();
result.decodePerUnaligned(new BitStreamReader(encodedBytes));
return result;
} | static ch46Type function(byte[] encodedBytes) { ch46Type result = new ch46Type(); result.decodePerUnaligned(new BitStreamReader(encodedBytes)); return result; } | /**
* Creates a new ch46Type from encoded stream.
*/ | Creates a new ch46Type from encoded stream | fromPerUnaligned | {
"repo_name": "google/supl-client",
"path": "src/main/java/com/google/location/suplclient/asn1/supl2/ver2_ulp_components/SupportedWLANApsChannel11a.java",
"license": "apache-2.0",
"size": 60534
} | [
"com.google.location.suplclient.asn1.base.BitStreamReader"
]
| import com.google.location.suplclient.asn1.base.BitStreamReader; | import com.google.location.suplclient.asn1.base.*; | [
"com.google.location"
]
| com.google.location; | 1,495,980 |
private void setCidsBeanListener(final PropertyChangeListener cidsBeanListener) {
this.cidsBeanListener = cidsBeanListener;
} | void function(final PropertyChangeListener cidsBeanListener) { this.cidsBeanListener = cidsBeanListener; } | /**
* DOCUMENT ME!
*
* @param cidsBeanListener DOCUMENT ME!
*/ | DOCUMENT ME | setCidsBeanListener | {
"repo_name": "cismet/cismap-plugin",
"path": "src/main/java/de/cismet/cismap/linearreferencing/TableStationEditor.java",
"license": "lgpl-3.0",
"size": 38035
} | [
"java.beans.PropertyChangeListener"
]
| import java.beans.PropertyChangeListener; | import java.beans.*; | [
"java.beans"
]
| java.beans; | 384,105 |
private void setupContent() {
final int gridWidth = getResources().getInteger(R.integer.media_grid_width);
boolean lightVersion = getResources().getBoolean(R.bool.syncedFolder_light);
adapter = new SyncedFolderAdapter(this, clock, gridWidth, this, lightVersion);
syncedFolderProvider = new SyncedFolderProvider(getContentResolver(), preferences, clock);
emptyContentIcon.setImageResource(R.drawable.nav_synced_folders);
emptyContentActionButton.setBackgroundColor(ThemeUtils.primaryColor(this));
emptyContentActionButton.setTextColor(ThemeUtils.fontColor(this));
final GridLayoutManager lm = new GridLayoutManager(this, gridWidth);
adapter.setLayoutManager(lm);
int spacing = getResources().getDimensionPixelSize(R.dimen.media_grid_spacing);
mRecyclerView.addItemDecoration(new MediaGridItemDecoration(spacing));
mRecyclerView.setLayoutManager(lm);
mRecyclerView.setAdapter(adapter);
load(gridWidth * 2, false);
} | void function() { final int gridWidth = getResources().getInteger(R.integer.media_grid_width); boolean lightVersion = getResources().getBoolean(R.bool.syncedFolder_light); adapter = new SyncedFolderAdapter(this, clock, gridWidth, this, lightVersion); syncedFolderProvider = new SyncedFolderProvider(getContentResolver(), preferences, clock); emptyContentIcon.setImageResource(R.drawable.nav_synced_folders); emptyContentActionButton.setBackgroundColor(ThemeUtils.primaryColor(this)); emptyContentActionButton.setTextColor(ThemeUtils.fontColor(this)); final GridLayoutManager lm = new GridLayoutManager(this, gridWidth); adapter.setLayoutManager(lm); int spacing = getResources().getDimensionPixelSize(R.dimen.media_grid_spacing); mRecyclerView.addItemDecoration(new MediaGridItemDecoration(spacing)); mRecyclerView.setLayoutManager(lm); mRecyclerView.setAdapter(adapter); load(gridWidth * 2, false); } | /**
* sets up the UI elements and loads all media/synced folders.
*/ | sets up the UI elements and loads all media/synced folders | setupContent | {
"repo_name": "jsargent7089/android",
"path": "src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.java",
"license": "gpl-2.0",
"size": 38791
} | [
"androidx.recyclerview.widget.GridLayoutManager",
"com.owncloud.android.datamodel.SyncedFolderProvider",
"com.owncloud.android.ui.adapter.SyncedFolderAdapter",
"com.owncloud.android.ui.decoration.MediaGridItemDecoration",
"com.owncloud.android.utils.ThemeUtils"
]
| import androidx.recyclerview.widget.GridLayoutManager; import com.owncloud.android.datamodel.SyncedFolderProvider; import com.owncloud.android.ui.adapter.SyncedFolderAdapter; import com.owncloud.android.ui.decoration.MediaGridItemDecoration; import com.owncloud.android.utils.ThemeUtils; | import androidx.recyclerview.widget.*; import com.owncloud.android.datamodel.*; import com.owncloud.android.ui.adapter.*; import com.owncloud.android.ui.decoration.*; import com.owncloud.android.utils.*; | [
"androidx.recyclerview",
"com.owncloud.android"
]
| androidx.recyclerview; com.owncloud.android; | 454,057 |
public List<String> containers() {
return this.containers;
} | List<String> function() { return this.containers; } | /**
* Get the names of the blob containers that the workspace should read.
*
* @return the containers value
*/ | Get the names of the blob containers that the workspace should read | containers | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightInner.java",
"license": "mit",
"size": 4410
} | [
"java.util.List"
]
| import java.util.List; | import java.util.*; | [
"java.util"
]
| java.util; | 1,780,404 |
public void addSeries(String legend, IFloatSource plottableObject,
Enum<?> variableID) {
sources.add(new FSource(legend, plottableObject, variableID));
//plot.addLegend(sources.size() - 1, legend);
XYSeries series = new XYSeries(legend);
dataset.addSeries(series);
} | void function(String legend, IFloatSource plottableObject, Enum<?> variableID) { sources.add(new FSource(legend, plottableObject, variableID)); XYSeries series = new XYSeries(legend); dataset.addSeries(series); } | /**
* Build a series from a IFloatSource object.
*
* @param legend
* The legend name of the series.
* @param plottableObject
* The data source object implementing the IFloatSource
* interface.
* @param variableID
* The variable id of the source object.
*/ | Build a series from a IFloatSource object | addSeries | {
"repo_name": "Circular-Money/Agent-Based-Model",
"path": "src/main/java/org/circularmoney/gui/ScatterSeriesSimulationPlotter.java",
"license": "gpl-3.0",
"size": 12869
} | [
"org.jfree.data.xy.XYSeries"
]
| import org.jfree.data.xy.XYSeries; | import org.jfree.data.xy.*; | [
"org.jfree.data"
]
| org.jfree.data; | 613,131 |
public boolean isGetAsParentSupported(Class clazz, String accessorAttribute)
{
return ClassMappingDescriptor.getInstance(clazz).isGetAsParentSupported(accessorAttribute);
} | boolean function(Class clazz, String accessorAttribute) { return ClassMappingDescriptor.getInstance(clazz).isGetAsParentSupported(accessorAttribute); } | /**
* This method returns true when the get-as-parent-method is specified in the corresponding
* ClassMappingDescriptor in the persistenceMapping.xml file
*/ | This method returns true when the get-as-parent-method is specified in the corresponding ClassMappingDescriptor in the persistenceMapping.xml file | isGetAsParentSupported | {
"repo_name": "oracle/mobile-persistence",
"path": "Projects/Framework/Runtime/src/oracle/ateam/sample/mobile/persistence/manager/AbstractRemotePersistenceManager.java",
"license": "mit",
"size": 15894
} | [
"oracle.ateam.sample.mobile.persistence.metadata.ClassMappingDescriptor"
]
| import oracle.ateam.sample.mobile.persistence.metadata.ClassMappingDescriptor; | import oracle.ateam.sample.mobile.persistence.metadata.*; | [
"oracle.ateam.sample"
]
| oracle.ateam.sample; | 1,108,122 |
private void closeCurrentPartFile() throws Exception {
if (isWriterOpen) {
writer.close();
isWriterOpen = false;
}
if (currentPartPath != null) {
Path inProgressPath = getInProgressPathFor(currentPartPath);
Path pendingPath = getPendingPathFor(currentPartPath);
fs.rename(inProgressPath, pendingPath);
LOG.debug("Moving in-progress bucket {} to pending file {}", inProgressPath, pendingPath);
this.bucketState.pendingFiles.add(currentPartPath.toString());
}
} | void function() throws Exception { if (isWriterOpen) { writer.close(); isWriterOpen = false; } if (currentPartPath != null) { Path inProgressPath = getInProgressPathFor(currentPartPath); Path pendingPath = getPendingPathFor(currentPartPath); fs.rename(inProgressPath, pendingPath); LOG.debug(STR, inProgressPath, pendingPath); this.bucketState.pendingFiles.add(currentPartPath.toString()); } } | /**
* Closes the current part file.
*
*
* <p>This moves the current in-progress part file to a pending file and adds it to the list
* of pending files in our bucket state.
*/ | Closes the current part file. This moves the current in-progress part file to a pending file and adds it to the list of pending files in our bucket state | closeCurrentPartFile | {
"repo_name": "zimmermatt/flink",
"path": "flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java",
"license": "apache-2.0",
"size": 32577
} | [
"org.apache.hadoop.fs.Path"
]
| import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
]
| org.apache.hadoop; | 377,484 |
@Override
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
return 32;
}
| int function(ItemStack par1ItemStack) { return 32; } | /**
* How long it takes to use or consume an item
*/ | How long it takes to use or consume an item | getMaxItemUseDuration | {
"repo_name": "bsun0000/TerraFirmaCraft",
"path": "src/Common/com/bioxx/tfc/Food/ItemMeal.java",
"license": "gpl-3.0",
"size": 10492
} | [
"net.minecraft.item.ItemStack"
]
| import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
]
| net.minecraft.item; | 213,410 |
public Parameter getParam(String parameter) {
if (!hasParams()) {
return null;
}
return getParams().get(parameter);
}
/**
* Gets a ParamChatSection value for the parameter with the given name, if
* there is a Params object available for these Arguments and said Params
* object contains a value for the given parameter. If either of these
* conditions are not true, null is returned. This method is a redirect to
* {@link #getParam(String)} | Parameter function(String parameter) { if (!hasParams()) { return null; } return getParams().get(parameter); } /** * Gets a ParamChatSection value for the parameter with the given name, if * there is a Params object available for these Arguments and said Params * object contains a value for the given parameter. If either of these * conditions are not true, null is returned. This method is a redirect to * {@link #getParam(String)} | /**
* Gets a ParamChatSection value for the parameter with the given name, if
* there is a Params object available for these Arguments and said Params
* object contains a value for the given parameter. If either of these
* conditions are not true, null is returned
*
* @param parameter The parameter to get the ParamChatSection value for
* @return A ParamChatSection for the given parameter, or null if there isn't
* one
*/ | Gets a ParamChatSection value for the parameter with the given name, if there is a Params object available for these Arguments and said Params object contains a value for the given parameter. If either of these conditions are not true, null is returned | getParam | {
"repo_name": "simplyianm/albkit",
"path": "src/main/java/pw/ian/albkit/command/parser/Arguments.java",
"license": "mit",
"size": 10094
} | [
"pw.ian.albkit.command.parser.parameter.Parameter",
"pw.ian.albkit.command.parser.parameter.Params"
]
| import pw.ian.albkit.command.parser.parameter.Parameter; import pw.ian.albkit.command.parser.parameter.Params; | import pw.ian.albkit.command.parser.parameter.*; | [
"pw.ian.albkit"
]
| pw.ian.albkit; | 45,921 |
public static junit.framework.Test suite() {
return new JUnit4TestAdapter(DeductionValidationTest.class);
} | static junit.framework.Test function() { return new JUnit4TestAdapter(DeductionValidationTest.class); } | /**
* <p>
* Creates a test suite for the tests in this test case.
* </p>
*
* @return a Test suite for this test case.
*/ | Creates a test suite for the tests in this test case. | suite | {
"repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application",
"path": "Code/SCRD_BRE/src/java/tests/gov/opm/scrd/DeductionValidationTest.java",
"license": "apache-2.0",
"size": 13937
} | [
"junit.framework.JUnit4TestAdapter",
"org.junit.Test"
]
| import junit.framework.JUnit4TestAdapter; import org.junit.Test; | import junit.framework.*; import org.junit.*; | [
"junit.framework",
"org.junit"
]
| junit.framework; org.junit; | 2,753,143 |
Collection<DatabaseSetup> annotations = getAnnotations(testContext, DatabaseSetup.class);
setupOrTeardown(testContext, true, AnnotationAttributes.get(annotations));
} | Collection<DatabaseSetup> annotations = getAnnotations(testContext, DatabaseSetup.class); setupOrTeardown(testContext, true, AnnotationAttributes.get(annotations)); } | /**
* Called before a test method is executed to perform any database setup.
* @param testContext The test context
* @throws Exception
*/ | Called before a test method is executed to perform any database setup | beforeTestMethod | {
"repo_name": "simonpatrick/stepbystep-java",
"path": "basicjava/src/main/java/com/hedwig/stepbystep/javatutorial/dbtest/DbUnitRunner.java",
"license": "gpl-3.0",
"size": 8774
} | [
"com.hedwig.stepbystep.javatutorial.dbtest.annotation.DatabaseSetup",
"java.util.Collection"
]
| import com.hedwig.stepbystep.javatutorial.dbtest.annotation.DatabaseSetup; import java.util.Collection; | import com.hedwig.stepbystep.javatutorial.dbtest.annotation.*; import java.util.*; | [
"com.hedwig.stepbystep",
"java.util"
]
| com.hedwig.stepbystep; java.util; | 1,126,145 |
public static double dateToJulianDate(Calendar calendar) {
return calendar.getTimeInMillis() / MILLISECONDS_PER_DAY - 0.5 + J1970;
} | static double function(Calendar calendar) { return calendar.getTimeInMillis() / MILLISECONDS_PER_DAY - 0.5 + J1970; } | /**
* Returns the julian date from the calendar object.
*/ | Returns the julian date from the calendar object | dateToJulianDate | {
"repo_name": "peuter/openhab2-addons",
"path": "addons/binding/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/DateTimeUtils.java",
"license": "epl-1.0",
"size": 7764
} | [
"java.util.Calendar"
]
| import java.util.Calendar; | import java.util.*; | [
"java.util"
]
| java.util; | 2,309,623 |
protected List<ASTEntry> getOccurrencesWithScopeAnalyzer(RefactoringRequest request) {
List<ASTEntry> entryOccurrences = new ArrayList<ASTEntry>();
IModule module = request.getModule();
try {
ScopeAnalyzerVisitor visitor = new ScopeAnalyzerVisitor(request.nature, request.moduleName, module,
new NullProgressMonitor(), request.ps);
request.getAST().accept(visitor);
entryOccurrences = visitor.getEntryOccurrences();
} catch (BadLocationException e) {
//don't log
} catch (Exception e) {
Log.log(e);
}
return entryOccurrences;
} | List<ASTEntry> function(RefactoringRequest request) { List<ASTEntry> entryOccurrences = new ArrayList<ASTEntry>(); IModule module = request.getModule(); try { ScopeAnalyzerVisitor visitor = new ScopeAnalyzerVisitor(request.nature, request.moduleName, module, new NullProgressMonitor(), request.ps); request.getAST().accept(visitor); entryOccurrences = visitor.getEntryOccurrences(); } catch (BadLocationException e) { } catch (Exception e) { Log.log(e); } return entryOccurrences; } | /**
* Searches for a list of entries that are found within a scope.
*
* It is always based on a single scope and bases itself on a refactoring request.
*/ | Searches for a list of entries that are found within a scope. It is always based on a single scope and bases itself on a refactoring request | getOccurrencesWithScopeAnalyzer | {
"repo_name": "smkr/pyclipse",
"path": "plugins/com.python.pydev.refactoring/src/com/python/pydev/refactoring/wizards/rename/AbstractRenameRefactorProcess.java",
"license": "epl-1.0",
"size": 10189
} | [
"com.python.pydev.analysis.scopeanalysis.ScopeAnalyzerVisitor",
"java.util.ArrayList",
"java.util.List",
"org.eclipse.core.runtime.NullProgressMonitor",
"org.eclipse.jface.text.BadLocationException",
"org.python.pydev.core.IModule",
"org.python.pydev.core.log.Log",
"org.python.pydev.editor.refactoring.RefactoringRequest",
"org.python.pydev.parser.visitors.scope.ASTEntry"
]
| import com.python.pydev.analysis.scopeanalysis.ScopeAnalyzerVisitor; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.text.BadLocationException; import org.python.pydev.core.IModule; import org.python.pydev.core.log.Log; import org.python.pydev.editor.refactoring.RefactoringRequest; import org.python.pydev.parser.visitors.scope.ASTEntry; | import com.python.pydev.analysis.scopeanalysis.*; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.text.*; import org.python.pydev.core.*; import org.python.pydev.core.log.*; import org.python.pydev.editor.refactoring.*; import org.python.pydev.parser.visitors.scope.*; | [
"com.python.pydev",
"java.util",
"org.eclipse.core",
"org.eclipse.jface",
"org.python.pydev"
]
| com.python.pydev; java.util; org.eclipse.core; org.eclipse.jface; org.python.pydev; | 946,497 |
@Override
public void close() {
for (Iterator<JobLogFileHandler> iter = jobLogFileHandlers.iterator(); iter.hasNext();) {
//iter.next().close();
// This will publish the final job log if required and then close the stream.
iter.next().handleFinalJobLogPart();
iter.remove();
}
} | void function() { for (Iterator<JobLogFileHandler> iter = jobLogFileHandlers.iterator(); iter.hasNext();) { iter.next().handleFinalJobLogPart(); iter.remove(); } } | /**
* Close ALL handlers for all threads.
*
* This method is called when JobLogManagerImpl is deactivating, which means this
* instance of JobLogHandler will soon be dead (it's a member of JobLogManagerImpl,
* which is going away).
*
*
*/ | Close ALL handlers for all threads. This method is called when JobLogManagerImpl is deactivating, which means this instance of JobLogHandler will soon be dead (it's a member of JobLogManagerImpl, which is going away) | close | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.jbatch.joblog/src/com/ibm/ws/jbatch/joblog/internal/impl/JobLogHandler.java",
"license": "epl-1.0",
"size": 11076
} | [
"java.util.Iterator"
]
| import java.util.Iterator; | import java.util.*; | [
"java.util"
]
| java.util; | 1,707,242 |
@JsonProperty("documents")
public void setDocuments(Set<Document> documents) {
this.documents = documents;
} | @JsonProperty(STR) void function(Set<Document> documents) { this.documents = documents; } | /**
* Documents
* <p>
* All documents and attachments related to the bid and its evaluation.
*/ | Documents All documents and attachments related to the bid and its evaluation | setDocuments | {
"repo_name": "devgateway/ocua",
"path": "persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Detail.java",
"license": "mit",
"size": 6047
} | [
"com.fasterxml.jackson.annotation.JsonProperty",
"java.util.Set"
]
| import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Set; | import com.fasterxml.jackson.annotation.*; import java.util.*; | [
"com.fasterxml.jackson",
"java.util"
]
| com.fasterxml.jackson; java.util; | 2,271,709 |
public ResteasyClientBuilder establishConnectionTimeout(long timeout, TimeUnit unit)
{
this.establishConnectionTimeout = timeout;
this.establishConnectionTimeoutUnits = unit;
return this;
} | ResteasyClientBuilder function(long timeout, TimeUnit unit) { this.establishConnectionTimeout = timeout; this.establishConnectionTimeoutUnits = unit; return this; } | /**
* When trying to make an initial socket connection, what is the timeout?
*
* @param timeout
* @param unit
* @return
*/ | When trying to make an initial socket connection, what is the timeout | establishConnectionTimeout | {
"repo_name": "raphaelning/resteasy-client-android",
"path": "jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/ResteasyClientBuilder.java",
"license": "apache-2.0",
"size": 16185
} | [
"java.util.concurrent.TimeUnit"
]
| import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
]
| java.util; | 2,313,841 |
public void deleteFavouriteMovies(TheMovieDBObject theMovieDBObject){
if(favouriteMoviesSavedData.size() == 1){
favouriteMoviesSavedData = null;
} else {
for(int i = 0; i < favouriteMoviesSavedData.size(); i++){
if(favouriteMoviesSavedData.get(i).equals(theMovieDBObject)){
favouriteMoviesSavedData.remove(i);
return;
}
}
}
} | void function(TheMovieDBObject theMovieDBObject){ if(favouriteMoviesSavedData.size() == 1){ favouriteMoviesSavedData = null; } else { for(int i = 0; i < favouriteMoviesSavedData.size(); i++){ if(favouriteMoviesSavedData.get(i).equals(theMovieDBObject)){ favouriteMoviesSavedData.remove(i); return; } } } } | /**
* Deletes data saved in favourite movies arraylist.
*
* It does not delete data on android device.
*
* @param theMovieDBObject
*/ | Deletes data saved in favourite movies arraylist. It does not delete data on android device | deleteFavouriteMovies | {
"repo_name": "abhinavp13/TitanFilms",
"path": "app/src/main/java/com/nanodegree/abhinav/titanfilms/application/ApplicationSavedData.java",
"license": "apache-2.0",
"size": 7331
} | [
"com.nanodegree.abhinav.titanfilms.dao.TheMovieDBObject"
]
| import com.nanodegree.abhinav.titanfilms.dao.TheMovieDBObject; | import com.nanodegree.abhinav.titanfilms.dao.*; | [
"com.nanodegree.abhinav"
]
| com.nanodegree.abhinav; | 2,026,695 |
return Optional.ofNullable(context.get());
} | return Optional.ofNullable(context.get()); } | /**
* Returns the context of the invocation that is being handled in the current thread.
*/ | Returns the context of the invocation that is being handled in the current thread | current | {
"repo_name": "brant-hwang/armeria",
"path": "src/main/java/com/linecorp/armeria/common/ServiceInvocationContext.java",
"license": "apache-2.0",
"size": 8020
} | [
"java.util.Optional"
]
| import java.util.Optional; | import java.util.*; | [
"java.util"
]
| java.util; | 239,327 |
public ExecutorService getAffinityExecutorService(); | ExecutorService function(); | /**
* Get affinity executor service.
*
* @return Affinity executor service.
*/ | Get affinity executor service | getAffinityExecutorService | {
"repo_name": "SomeFire/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java",
"license": "apache-2.0",
"size": 22514
} | [
"java.util.concurrent.ExecutorService"
]
| import java.util.concurrent.ExecutorService; | import java.util.concurrent.*; | [
"java.util"
]
| java.util; | 2,213,071 |
private TimeZone tzCalcul(pointIGC p1) {
IConverter iconv = Converter.getInstance(TimeZoneListStore.class);
TimeZone tzCalc = iconv.getTimeZone(p1.Latitude,p1.Longitude);
return tzCalc;
} | TimeZone function(pointIGC p1) { IConverter iconv = Converter.getInstance(TimeZoneListStore.class); TimeZone tzCalc = iconv.getTimeZone(p1.Latitude,p1.Longitude); return tzCalc; } | /**
* For TimeZone computing, llttz of Artem Gapchenko (https://github.com/agap/llttz) is called
* @param p1
* @return
*/ | For TimeZone computing, llttz of Artem Gapchenko (HREF) is called | tzCalcul | {
"repo_name": "giloutho/Logfly",
"path": "src/main/java/trackgps/traceGPS.java",
"license": "gpl-3.0",
"size": 90136
} | [
"java.util.TimeZone"
]
| import java.util.TimeZone; | import java.util.*; | [
"java.util"
]
| java.util; | 1,848,956 |
private Resource getResource(HttpServletRequest request, HttpServletResponse response) throws ServletException {
try {
Realm realm = map.getRealm(request.getServletPath());
String path = map.getPath(realm, request.getServletPath());
HttpRequest httpRequest = (HttpRequest)request;
HttpResponse httpResponse = new HttpResponse(response);
Resource res = yanelInstance.getResourceManager().getResource(getEnvironment(httpRequest, httpResponse), realm, path);
return res;
} catch (Exception e) {
log.error(e, e);
throw new ServletException("Could not get resource for request <" + request.getServletPath() + ">: " + e.getMessage(), e);
}
} | Resource function(HttpServletRequest request, HttpServletResponse response) throws ServletException { try { Realm realm = map.getRealm(request.getServletPath()); String path = map.getPath(realm, request.getServletPath()); HttpRequest httpRequest = (HttpRequest)request; HttpResponse httpResponse = new HttpResponse(response); Resource res = yanelInstance.getResourceManager().getResource(getEnvironment(httpRequest, httpResponse), realm, path); return res; } catch (Exception e) { log.error(e, e); throw new ServletException(STR + request.getServletPath() + STR + e.getMessage(), e); } } | /**
* Resolve resource for a specific request
*/ | Resolve resource for a specific request | getResource | {
"repo_name": "baszero/yanel",
"path": "src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java",
"license": "apache-2.0",
"size": 179722
} | [
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.wyona.yanel.core.Resource",
"org.wyona.yanel.core.map.Realm",
"org.wyona.yanel.servlet.communication.HttpRequest",
"org.wyona.yanel.servlet.communication.HttpResponse"
]
| import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.wyona.yanel.core.Resource; import org.wyona.yanel.core.map.Realm; import org.wyona.yanel.servlet.communication.HttpRequest; import org.wyona.yanel.servlet.communication.HttpResponse; | import javax.servlet.*; import javax.servlet.http.*; import org.wyona.yanel.core.*; import org.wyona.yanel.core.map.*; import org.wyona.yanel.servlet.communication.*; | [
"javax.servlet",
"org.wyona.yanel"
]
| javax.servlet; org.wyona.yanel; | 449,630 |
public void setHitRadius(RadiusCallback<DatasetContext> hitRadiusCallback) {
// sets the callback
this.hitRadiusCallback = hitRadiusCallback;
// stores and manages callback
getChart().getOptions().setCallback(getElement(), Property.HIT_RADIUS, hitRadiusCallback, hitRadiusCallbackProxy);
} | void function(RadiusCallback<DatasetContext> hitRadiusCallback) { this.hitRadiusCallback = hitRadiusCallback; getChart().getOptions().setCallback(getElement(), Property.HIT_RADIUS, hitRadiusCallback, hitRadiusCallbackProxy); } | /**
* Sets the hit radius callback.
*
* @param hitRadiusCallback the hit radius callback.
*/ | Sets the hit radius callback | setHitRadius | {
"repo_name": "pepstock-org/Charba",
"path": "src/org/pepstock/charba/client/configuration/Point.java",
"license": "apache-2.0",
"size": 15183
} | [
"org.pepstock.charba.client.callbacks.DatasetContext",
"org.pepstock.charba.client.callbacks.RadiusCallback"
]
| import org.pepstock.charba.client.callbacks.DatasetContext; import org.pepstock.charba.client.callbacks.RadiusCallback; | import org.pepstock.charba.client.callbacks.*; | [
"org.pepstock.charba"
]
| org.pepstock.charba; | 1,089,382 |
Dimension getPreferredSize();
| Dimension getPreferredSize(); | /**
* Returns the preferred size for this IFigure. The returned value must not
* be modified by the caller. If the figure has no preference, it returns
* its current size. The same as calling {@link #getPreferredSize(int, int)
* getPreferredSize(-1, -1)}.
*
* @return The preferred size
*/ | Returns the preferred size for this IFigure. The returned value must not be modified by the caller. If the figure has no preference, it returns its current size. The same as calling <code>#getPreferredSize(int, int) getPreferredSize(-1, -1)</code> | getPreferredSize | {
"repo_name": "opensagres/xdocreport.eclipse",
"path": "rap/org.eclipse.draw2d/src/org/eclipse/draw2d/IFigure.java",
"license": "lgpl-2.1",
"size": 31295
} | [
"org.eclipse.draw2d.geometry.Dimension"
]
| import org.eclipse.draw2d.geometry.Dimension; | import org.eclipse.draw2d.geometry.*; | [
"org.eclipse.draw2d"
]
| org.eclipse.draw2d; | 1,273,747 |
public void setParameterFromObject(final Object o) throws ObjectFactoryException {
if (!(o instanceof Color)) {
throw new ObjectFactoryException("Is no instance of java.awt.Color");
}
final Color c = (Color) o;
setParameter("value", PaintUtilities.colorToString(c));
}
| void function(final Object o) throws ObjectFactoryException { if (!(o instanceof Color)) { throw new ObjectFactoryException(STR); } final Color c = (Color) o; setParameter("value", PaintUtilities.colorToString(c)); } | /**
* Sets the parameters of this description object to match the supplied object.
*
* @param o the object (should be an instance of <code>Color</code>).
*
* @throws ObjectFactoryException if there is a problem while reading the
* properties of the given object.
*/ | Sets the parameters of this description object to match the supplied object | setParameterFromObject | {
"repo_name": "jfree/jcommon",
"path": "src/main/java/org/jfree/xml/factory/objects/ColorObjectDescription.java",
"license": "lgpl-2.1",
"size": 3226
} | [
"java.awt.Color",
"org.jfree.util.PaintUtilities"
]
| import java.awt.Color; import org.jfree.util.PaintUtilities; | import java.awt.*; import org.jfree.util.*; | [
"java.awt",
"org.jfree.util"
]
| java.awt; org.jfree.util; | 665,329 |
@Kroll.method
public void insertAt(Object params)
{
if (!(params instanceof HashMap)) {
Log.e(TAG, "Argument for insertAt must be a dictionary");
return;
}
@SuppressWarnings("rawtypes")
HashMap options = (HashMap) params;
if (children == null) {
children = new ArrayList<TiViewProxy>();
}
if (view != null) {
if (TiApplication.isUIThread()) {
handleInsertAt(options);
return;
}
getMainHandler().obtainMessage(MSG_INSERT_VIEW_AT, options).sendToTarget();
} else {
handleInsertAt(options);
}
} | @Kroll.method void function(Object params) { if (!(params instanceof HashMap)) { Log.e(TAG, STR); return; } @SuppressWarnings(STR) HashMap options = (HashMap) params; if (children == null) { children = new ArrayList<TiViewProxy>(); } if (view != null) { if (TiApplication.isUIThread()) { handleInsertAt(options); return; } getMainHandler().obtainMessage(MSG_INSERT_VIEW_AT, options).sendToTarget(); } else { handleInsertAt(options); } } | /**
* Adds a child to this view proxy in the specified position. This is useful for "vertical" and
* "horizontal" layouts.
* @param params A Dictionary containing a TiViewProxy for the view and an int for the position
* @module.api
*/ | Adds a child to this view proxy in the specified position. This is useful for "vertical" and "horizontal" layouts | insertAt | {
"repo_name": "pinnamur/titanium_mobile",
"path": "android/titanium/src/java/org/appcelerator/titanium/proxy/TiViewProxy.java",
"license": "apache-2.0",
"size": 33398
} | [
"java.util.ArrayList",
"java.util.HashMap",
"org.appcelerator.kroll.annotations.Kroll",
"org.appcelerator.kroll.common.Log",
"org.appcelerator.titanium.TiApplication"
]
| import java.util.ArrayList; import java.util.HashMap; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.kroll.common.Log; import org.appcelerator.titanium.TiApplication; | import java.util.*; import org.appcelerator.kroll.annotations.*; import org.appcelerator.kroll.common.*; import org.appcelerator.titanium.*; | [
"java.util",
"org.appcelerator.kroll",
"org.appcelerator.titanium"
]
| java.util; org.appcelerator.kroll; org.appcelerator.titanium; | 4,677 |
default int getParaPos(XWPFParagraph paragraph) {
List<XWPFParagraph> paragraphs = getTarget().getParagraphs();
for (int i = 0; i < paragraphs.size(); i++) {
if (paragraphs.get(i) == paragraph) {
return i;
}
}
return -1;
} | default int getParaPos(XWPFParagraph paragraph) { List<XWPFParagraph> paragraphs = getTarget().getParagraphs(); for (int i = 0; i < paragraphs.size(); i++) { if (paragraphs.get(i) == paragraph) { return i; } } return -1; } | /**
* get the position of paragraph in paragraphs
*
* @param paragraph
* @return the position of paragraph
*/ | get the position of paragraph in paragraphs | getParaPos | {
"repo_name": "Sayi/poi-tl",
"path": "poi-tl/src/main/java/com/deepoove/poi/xwpf/BodyContainer.java",
"license": "apache-2.0",
"size": 6497
} | [
"java.util.List",
"org.apache.poi.xwpf.usermodel.XWPFParagraph"
]
| import java.util.List; import org.apache.poi.xwpf.usermodel.XWPFParagraph; | import java.util.*; import org.apache.poi.xwpf.usermodel.*; | [
"java.util",
"org.apache.poi"
]
| java.util; org.apache.poi; | 745,238 |
@SuppressWarnings("unchecked")
protected String addPostRunDependent(Appliable<? extends Indexable> appliable) {
TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable;
return this.addPostRunDependent(dependency);
} | @SuppressWarnings(STR) String function(Appliable<? extends Indexable> appliable) { TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) appliable; return this.addPostRunDependent(dependency); } | /**
* Add an appliable "post-run" dependent for this task item.
*
* @param appliable the appliable "post-run" dependent.
* @return the key to be used as parameter to taskResult(string) method to retrieve updated "post-run" dependent
*/ | Add an appliable "post-run" dependent for this task item | addPostRunDependent | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluentcore/dag/IndexableTaskItem.java",
"license": "mit",
"size": 10694
} | [
"com.azure.resourcemanager.resources.fluentcore.model.Appliable",
"com.azure.resourcemanager.resources.fluentcore.model.Indexable"
]
| import com.azure.resourcemanager.resources.fluentcore.model.Appliable; import com.azure.resourcemanager.resources.fluentcore.model.Indexable; | import com.azure.resourcemanager.resources.fluentcore.model.*; | [
"com.azure.resourcemanager"
]
| com.azure.resourcemanager; | 113,086 |
@Override
protected void runTest() throws Throwable {
String databaseType = DatabaseHelper.getDatabaseType(processEngineConfiguration);
if("h2".equals(databaseType)) {
// skip test method - if database is H2
} else {
// invoke the test method
super.runTest();
}
} | void function() throws Throwable { String databaseType = DatabaseHelper.getDatabaseType(processEngineConfiguration); if("h2".equals(databaseType)) { } else { super.runTest(); } } | /**
* hook into test method invocation - after the process engine is initialized
*/ | hook into test method invocation - after the process engine is initialized | runTest | {
"repo_name": "falko/camunda-bpm-platform",
"path": "engine/src/test/java/org/camunda/bpm/engine/test/concurrency/ConcurrentDeploymentTest.java",
"license": "apache-2.0",
"size": 6232
} | [
"org.camunda.bpm.engine.test.util.DatabaseHelper"
]
| import org.camunda.bpm.engine.test.util.DatabaseHelper; | import org.camunda.bpm.engine.test.util.*; | [
"org.camunda.bpm"
]
| org.camunda.bpm; | 1,696,790 |
public static void ApplyAnimation(View view, String animation) {
// TODO(user): These string constants need to be extracted and defined somewhere else!
// TODO(user): Also, the endless else-if is inefficient
if (animation.equals("ScrollRightSlow")) {
ApplyHorizontalScrollAnimation(view, false, 8000);
} else if (animation.equals("ScrollRight")) {
ApplyHorizontalScrollAnimation(view, false, 4000);
} else if (animation.equals("ScrollRightFast")) {
ApplyHorizontalScrollAnimation(view, false, 1000);
} else if (animation.equals("ScrollLeftSlow")) {
ApplyHorizontalScrollAnimation(view, true, 8000);
} else if (animation.equals("ScrollLeft")) {
ApplyHorizontalScrollAnimation(view, true, 4000);
} else if (animation.equals("ScrollLeftFast")) {
ApplyHorizontalScrollAnimation(view, true, 1000);
}
}
| static void function(View view, String animation) { if (animation.equals(STR)) { ApplyHorizontalScrollAnimation(view, false, 8000); } else if (animation.equals(STR)) { ApplyHorizontalScrollAnimation(view, false, 4000); } else if (animation.equals(STR)) { ApplyHorizontalScrollAnimation(view, false, 1000); } else if (animation.equals(STR)) { ApplyHorizontalScrollAnimation(view, true, 8000); } else if (animation.equals(STR)) { ApplyHorizontalScrollAnimation(view, true, 4000); } else if (animation.equals(STR)) { ApplyHorizontalScrollAnimation(view, true, 1000); } } | /**
* Animates a component (using pre-defined animation kinds).
*
* @param view component to animate
* @param animation animation kind
*/ | Animates a component (using pre-defined animation kinds) | ApplyAnimation | {
"repo_name": "roadlabs/alternate-java-bridge-library",
"path": "src/com/xiledsystems/AlternateJavaBridgelib/components/altbridge/util/AnimationUtil.java",
"license": "apache-2.0",
"size": 2654
} | [
"android.view.View"
]
| import android.view.View; | import android.view.*; | [
"android.view"
]
| android.view; | 957,015 |
@Nullable
VirtualFile getModuleOutputDirectoryForTests(Module module); | VirtualFile getModuleOutputDirectoryForTests(Module module); | /**
* Returns the test output directory for the specified module.
*
* @param module the module to check.
* @return the tests output directory the module specified, null if corresponding VirtualFile is not valid. If in Paths settings
* output directory for tests is not configured explicitly, but the output path is present, the output path will be returned.
*/ | Returns the test output directory for the specified module | getModuleOutputDirectoryForTests | {
"repo_name": "hurricup/intellij-community",
"path": "java/compiler/openapi/src/com/intellij/openapi/compiler/CompileContext.java",
"license": "apache-2.0",
"size": 5472
} | [
"com.intellij.openapi.module.Module",
"com.intellij.openapi.vfs.VirtualFile"
]
| import com.intellij.openapi.module.Module; import com.intellij.openapi.vfs.VirtualFile; | import com.intellij.openapi.module.*; import com.intellij.openapi.vfs.*; | [
"com.intellij.openapi"
]
| com.intellij.openapi; | 2,394,042 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.