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 Collection<FlowRule> processSpecific(ForwardingObjective fwd) {
log.trace("Processing specific fwd objective:{} in dev:{} with next:{}",
fwd.id(), deviceId, fwd.nextId());
boolean isEthTypeObj = isSupportedEthTypeObjective(fwd);
boolean isEthDstObj = isSupportedEt... | Collection<FlowRule> function(ForwardingObjective fwd) { log.trace(STR, fwd.id(), deviceId, fwd.nextId()); boolean isEthTypeObj = isSupportedEthTypeObjective(fwd); boolean isEthDstObj = isSupportedEthDstObjective(fwd); if (isEthTypeObj) { return processEthTypeSpecific(fwd); } else if (isEthDstObj) { return processEthDs... | /**
* In the OF-DPA 2.0 pipeline, specific forwarding refers to the IP table
* (unicast or multicast) or the L2 table (mac + vlan) or the MPLS table.
*
* @param fwd the forwarding objective of type 'specific'
* @return a collection of flow rules. Typically there will be only one
* ... | In the OF-DPA 2.0 pipeline, specific forwarding refers to the IP table (unicast or multicast) or the L2 table (mac + vlan) or the MPLS table | processSpecific | {
"repo_name": "sonu283304/onos",
"path": "drivers/default/src/main/java/org/onosproject/driver/pipeline/OFDPA2Pipeline.java",
"license": "apache-2.0",
"size": 46893
} | [
"java.util.Collection",
"java.util.Collections",
"org.onosproject.net.flow.FlowRule",
"org.onosproject.net.flowobjective.ForwardingObjective",
"org.onosproject.net.flowobjective.ObjectiveError"
] | import java.util.Collection; import java.util.Collections; import org.onosproject.net.flow.FlowRule; import org.onosproject.net.flowobjective.ForwardingObjective; import org.onosproject.net.flowobjective.ObjectiveError; | import java.util.*; import org.onosproject.net.flow.*; import org.onosproject.net.flowobjective.*; | [
"java.util",
"org.onosproject.net"
] | java.util; org.onosproject.net; | 2,205,813 |
public OCSPReq build() throws OCSPException, IOException, CertificateEncodingException {
SecureRandom generator = requireNonNull(this.generator, "generator");
DigestCalculator calculator = requireNonNull(this.calculator, "calculator");
X509Certificate certificate = requireNonNull(this.certif... | OCSPReq function() throws OCSPException, IOException, CertificateEncodingException { SecureRandom generator = requireNonNull(this.generator, STR); DigestCalculator calculator = requireNonNull(this.calculator, STR); X509Certificate certificate = requireNonNull(this.certificate, STR); X509Certificate issuer = requireNonN... | /**
* ATTENTION: The returned {@link OCSPReq} is not re-usable/cacheable! It contains a one-time nonce
* and CA's will (should) reject subsequent requests that have the same nonce value.
*/ | and CA's will (should) reject subsequent requests that have the same nonce value | build | {
"repo_name": "gerdriesselmann/netty",
"path": "example/src/main/java/io/netty/example/ocsp/OcspRequestBuilder.java",
"license": "apache-2.0",
"size": 3598
} | [
"java.io.IOException",
"java.math.BigInteger",
"java.security.SecureRandom",
"java.security.cert.CertificateEncodingException",
"java.security.cert.X509Certificate",
"java.util.Objects",
"org.bouncycastle.asn1.DEROctetString",
"org.bouncycastle.asn1.ocsp.OCSPObjectIdentifiers",
"org.bouncycastle.asn... | import java.io.IOException; import java.math.BigInteger; import java.security.SecureRandom; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; import java.util.Objects; import org.bouncycastle.asn1.DEROctetString; import org.bouncycastle.asn1.ocsp.OCSPObjectIdentifiers; i... | import java.io.*; import java.math.*; import java.security.*; import java.security.cert.*; import java.util.*; import org.bouncycastle.asn1.*; import org.bouncycastle.asn1.ocsp.*; import org.bouncycastle.asn1.x509.*; import org.bouncycastle.cert.*; import org.bouncycastle.cert.ocsp.*; import org.bouncycastle.operator.*... | [
"java.io",
"java.math",
"java.security",
"java.util",
"org.bouncycastle.asn1",
"org.bouncycastle.cert",
"org.bouncycastle.operator"
] | java.io; java.math; java.security; java.util; org.bouncycastle.asn1; org.bouncycastle.cert; org.bouncycastle.operator; | 1,320,951 |
public static String formatDefaultDate(Timestamp time)
{
if (time == null)
time = getDefaultTimestamp();
return DEFAULT_DATE_FORMAT.format(time);
} | static String function(Timestamp time) { if (time == null) time = getDefaultTimestamp(); return DEFAULT_DATE_FORMAT.format(time); } | /**
* Formats as a <code>String</code> the specified time,
* using the default date format: yyyy-MM-dd HH:mm:ss
* @param time The timestamp to format.
* @return Returns the stringified version of the passed timestamp.
*/ | Formats as a <code>String</code> the specified time | formatDefaultDate | {
"repo_name": "tp81/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/ui/UIUtilities.java",
"license": "gpl-2.0",
"size": 90682
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 389,401 |
public File getTrustDir()
{
String trustPath;
String home = System.getProperty( "user.home" );
if ( MavenUtils.isWindows() )
{
// workaround, application data folder is localized
String appData = System.getenv( "APPDATA" );
// use d... | File function() { String trustPath; String home = System.getProperty( STR ); if ( MavenUtils.isWindows() ) { String appData = System.getenv( STR ); if ( appData == null ) { if ( MavenUtils.isWindowsVista() ) { appData = home + STR; } else { appData = home + STR; } } trustPath = appData + STR; } else if ( MavenUtils.isU... | /**
* Retrieves flash player trust folder, based on:
* http://livedocs.adobe.com/flex/3/html/help.html?content=05B_Security_03.html #140756
*/ | Retrieves flash player trust folder, based on: HREF #140756 | getTrustDir | {
"repo_name": "edward-yakop/flexmojos",
"path": "flexmojos-maven-plugin/src/main/java/org/sonatype/flexmojos/truster/DefaultFlashPlayerTruster.java",
"license": "apache-2.0",
"size": 4152
} | [
"java.io.File",
"org.sonatype.flexmojos.plugin.utilities.MavenUtils"
] | import java.io.File; import org.sonatype.flexmojos.plugin.utilities.MavenUtils; | import java.io.*; import org.sonatype.flexmojos.plugin.utilities.*; | [
"java.io",
"org.sonatype.flexmojos"
] | java.io; org.sonatype.flexmojos; | 1,968,939 |
private String generateFieldInfoInputs(Class<?> cls)
{
java.lang.reflect.Field[] fields = cls.getDeclaredFields();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < fields.length; i++) {
java.lang.reflect.Field f = fields[i];
Class<?> c = ClassUtils.primitiveToWrapper(f.getType())... | String function(Class<?> cls) { java.lang.reflect.Field[] fields = cls.getDeclaredFields(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < fields.length; i++) { java.lang.reflect.Field f = fields[i]; Class<?> c = ClassUtils.primitiveToWrapper(f.getType()); sb.append(f.getName()).append(FIELD_SEPARATOR).app... | /**
* Use reflection to generate field info values if the user has not provided
* the inputs mapping
*
* @return String representing the POJO field to Avro field mapping
*/ | Use reflection to generate field info values if the user has not provided the inputs mapping | generateFieldInfoInputs | {
"repo_name": "siyuanh/apex-malhar",
"path": "contrib/src/main/java/com/datatorrent/contrib/avro/AvroToPojo.java",
"license": "apache-2.0",
"size": 12360
} | [
"org.apache.commons.lang3.ClassUtils"
] | import org.apache.commons.lang3.ClassUtils; | import org.apache.commons.lang3.*; | [
"org.apache.commons"
] | org.apache.commons; | 630,420 |
public State nextStateOnEvent(String onEvent, Object args)
throws IllegalStateException {
State oldState = null;
State newState = null;
List<StateChangeListener> copyListeners = null;
//
synchronized (lock) {
oldState = currentState;
State... | State function(String onEvent, Object args) throws IllegalStateException { State oldState = null; State newState = null; List<StateChangeListener> copyListeners = null; synchronized (lock) { oldState = currentState; State[] nextStates = mappings.getNextStates(currentState, onEvent); if (nextStates == null nextStates.le... | /**
* FSM maintains current state and this method is used to proceed to the
* next state
*
* @param onEvent
* @param args
* - optional parameter used for TransitionResolver if needed
* @return next state
* @throws IllegalStateException
*/ | FSM maintains current state and this method is used to proceed to the next state | nextStateOnEvent | {
"repo_name": "bhatti/PlexServices",
"path": "plexsvc-framework/src/main/java/com/plexobject/fsm/FSM.java",
"license": "mit",
"size": 4343
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,479,857 |
@Test
public void should_add_measure_with_big_data() throws Exception {
MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel);
Project p = new Project("struts");
assertThat(cache.entries()).hasSize(0);
assertThat(cache.byResource(p)).hasSize(0);
Measure m = new Measure(Co... | void function() throws Exception { MeasureCache cache = new MeasureCache(caches, metricFinder, techDebtModel); Project p = new Project(STR); assertThat(cache.entries()).hasSize(0); assertThat(cache.byResource(p)).hasSize(0); Measure m = new Measure(CoreMetrics.NCLOC, 1.0).setDate(new Date()); m.setAlertText(STR); Strin... | /**
* This test fails when compression is not enabled for measures. PersistIt seems to be ok with
* put but fail when reading value.
*/ | This test fails when compression is not enabled for measures. PersistIt seems to be ok with put but fail when reading value | should_add_measure_with_big_data | {
"repo_name": "teryk/sonarqube",
"path": "sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java",
"license": "lgpl-3.0",
"size": 11225
} | [
"java.util.Date",
"java.util.Iterator",
"org.fest.assertions.Assertions",
"org.sonar.api.measures.CoreMetrics",
"org.sonar.api.measures.Measure",
"org.sonar.api.measures.RuleMeasure",
"org.sonar.api.resources.Project",
"org.sonar.api.rule.RuleKey",
"org.sonar.api.rules.RulePriority",
"org.sonar.ba... | import java.util.Date; import java.util.Iterator; import org.fest.assertions.Assertions; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.measures.Measure; import org.sonar.api.measures.RuleMeasure; import org.sonar.api.resources.Project; import org.sonar.api.rule.RuleKey; import org.sonar.api.rules.Rule... | import java.util.*; import org.fest.assertions.*; import org.sonar.api.measures.*; import org.sonar.api.resources.*; import org.sonar.api.rule.*; import org.sonar.api.rules.*; import org.sonar.batch.index.*; | [
"java.util",
"org.fest.assertions",
"org.sonar.api",
"org.sonar.batch"
] | java.util; org.fest.assertions; org.sonar.api; org.sonar.batch; | 967,259 |
public boolean isTerminated() {
if (worker == null) {
return true;
}
// It can take a while for the thread to change its state ...
for (int i = 0; i < 10; i++) {
if (worker.getState() == Thread.State.TERMINATED) break;
try {
sleep(... | boolean function() { if (worker == null) { return true; } for (int i = 0; i < 10; i++) { if (worker.getState() == Thread.State.TERMINATED) break; try { sleep(10); } catch (InterruptedException e) { } } return (worker.getState() == Thread.State.TERMINATED); } | /**
* Check if the evaluation has been halted or not.
* If it is halted, nothing can be done with it anymore.
* This is an expensive operation.
*
* @return The evaluation is terminated.
*/ | Check if the evaluation has been halted or not. If it is halted, nothing can be done with it anymore. This is an expensive operation | isTerminated | {
"repo_name": "branscha/lib-scripty",
"path": "src/main/java/branscha/scripty/parser/EvalTrace.java",
"license": "mit",
"size": 28817
} | [
"java.lang.Thread"
] | import java.lang.Thread; | import java.lang.*; | [
"java.lang"
] | java.lang; | 1,053,316 |
@Nullable
@Contract(pure = true)
public FrameworkGroup<?> getParentGroup() {
return null;
} | @Contract(pure = true) FrameworkGroup<?> function() { return null; } | /**
* Puts it under another framework.
* @see #getUnderlyingFrameworkTypeId()
*/ | Puts it under another framework | getParentGroup | {
"repo_name": "smmribeiro/intellij-community",
"path": "java/idea-ui/src/com/intellij/framework/FrameworkTypeEx.java",
"license": "apache-2.0",
"size": 2193
} | [
"org.jetbrains.annotations.Contract"
] | import org.jetbrains.annotations.Contract; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 2,737,517 |
public Observable<ServiceResponse<Page<VirtualNetworkInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<VirtualNetworkInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all virtual networks in a resource group.
*
ServiceResponse<PageImpl<VirtualNetworkInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<Vir... | Gets all virtual networks in a resource group | listByResourceGroupNextSinglePageAsync | {
"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/implementation/VirtualNetworksInner.java",
"license": "mit",
"size": 98691
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,834,850 |
EReference getEndDeviceAsset_ServiceLocation(); | EReference getEndDeviceAsset_ServiceLocation(); | /**
* Returns the meta object for the reference '{@link CIM.IEC61968.Metering.EndDeviceAsset#getServiceLocation <em>Service Location</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Service Location</em>'.
* @see CIM.IEC61968.Metering.EndDeviceAsset#ge... | Returns the meta object for the reference '<code>CIM.IEC61968.Metering.EndDeviceAsset#getServiceLocation Service Location</code>'. | getEndDeviceAsset_ServiceLocation | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61968/Metering/MeteringPackage.java",
"license": "mit",
"size": 264485
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 660,831 |
public Polynomial[] toArray() {
Polynomial[] result = new Polynomial[this.size()];
int ipoly = 0;
while (ipoly < this.size()) {
result[ipoly] = this.get(ipoly);
ipoly ++;
} // while ipoly
return result;
} // toArray
/** Returns a String r... | Polynomial[] function() { Polynomial[] result = new Polynomial[this.size()]; int ipoly = 0; while (ipoly < this.size()) { result[ipoly] = this.get(ipoly); ipoly ++; } return result; } /** Returns a String representation of <em>this</em> {@link RelationSet} | /** Returns <em>this</em> {@link RelationSet} as an array of {@link Polynomial}s.
* @return array of Polynomials
*/ | Returns this <code>RelationSet</code> as an array of <code>Polynomial</code>s | toArray | {
"repo_name": "gfis/ramath",
"path": "src/main/java/org/teherba/ramath/symbolic/RelationSet.java",
"license": "apache-2.0",
"size": 49145
} | [
"org.teherba.ramath.symbolic.Polynomial"
] | import org.teherba.ramath.symbolic.Polynomial; | import org.teherba.ramath.symbolic.*; | [
"org.teherba.ramath"
] | org.teherba.ramath; | 84,111 |
@ApiModelProperty(example = "null", value = "")
public TaxByTypeTax getIssRf() {
return issRf;
} | @ApiModelProperty(example = "null", value = "") TaxByTypeTax function() { return issRf; } | /**
* Get issRf
* @return issRf
**/ | Get issRf | getIssRf | {
"repo_name": "Avalara/avataxbr-clients",
"path": "java-client/src/main/java/io/swagger/client/model/SalesTaxByType.java",
"license": "gpl-3.0",
"size": 9564
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 1,817,502 |
@Test
public void test57820() throws IOException {
SlideShow<?,?> ppt = new HSLFSlideShow(_slTests.openResourceAsStream("bug57820-initTableNullRefrenceException.ppt"));
List<? extends Slide<?,?>> slides = ppt.getSlides();
assertEquals(1, slides.size());
List<? extends Shape<?,?... | void function() throws IOException { SlideShow<?,?> ppt = new HSLFSlideShow(_slTests.openResourceAsStream(STR)); List<? extends Slide<?,?>> slides = ppt.getSlides(); assertEquals(1, slides.size()); List<? extends Shape<?,?>> shapes = slides.get(0).getShapes(); TableShape<?,?> tbl = null; for(Shape<?,?> s : shapes) { if... | /**
* Bug 57820: initTable throws NullPointerException
* when the table is positioned with its top at -1
*/ | Bug 57820: initTable throws NullPointerException when the table is positioned with its top at -1 | test57820 | {
"repo_name": "lvweiwolf/poi-3.16",
"path": "src/scratchpad/testcases/org/apache/poi/hslf/model/TestTable.java",
"license": "apache-2.0",
"size": 5765
} | [
"java.io.IOException",
"java.util.List",
"org.apache.poi.hslf.usermodel.HSLFSlideShow",
"org.apache.poi.sl.usermodel.Shape",
"org.apache.poi.sl.usermodel.Slide",
"org.apache.poi.sl.usermodel.SlideShow",
"org.apache.poi.sl.usermodel.TableShape",
"org.junit.Assert"
] | import java.io.IOException; import java.util.List; import org.apache.poi.hslf.usermodel.HSLFSlideShow; import org.apache.poi.sl.usermodel.Shape; import org.apache.poi.sl.usermodel.Slide; import org.apache.poi.sl.usermodel.SlideShow; import org.apache.poi.sl.usermodel.TableShape; import org.junit.Assert; | import java.io.*; import java.util.*; import org.apache.poi.hslf.usermodel.*; import org.apache.poi.sl.usermodel.*; import org.junit.*; | [
"java.io",
"java.util",
"org.apache.poi",
"org.junit"
] | java.io; java.util; org.apache.poi; org.junit; | 200,011 |
public int deleteEntitiesWithTracing(String userId, List<? extends EntityInstance> entities) {
int changeSetNumber = this.generateLatestChangeSetNumber(userId);
return deleteEntities(changeSetNumber, entities);
} | int function(String userId, List<? extends EntityInstance> entities) { int changeSetNumber = this.generateLatestChangeSetNumber(userId); return deleteEntities(changeSetNumber, entities); } | /**
* Delete entities from database. This method deletes a list of data rows from database.
*
* @param entities the list of entities that will be deleted from the database.
* @param userId the id of current user
* @return returns the changeSetNumber of this transaction
*/ | Delete entities from database. This method deletes a list of data rows from database | deleteEntitiesWithTracing | {
"repo_name": "unsw-cse-soc/CoreDB",
"path": "src/CoreDB-Relational Pluggin/Library/src/coredb/controller/EntityControllerTracing.java",
"license": "apache-2.0",
"size": 20531
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 543,109 |
private static String getMapDirectory() {
return JOptionPane.showInputDialog(null, "Enter the map name (ie. folder name)");
} | static String function() { return JOptionPane.showInputDialog(null, STR); } | /**
* we need the exact map name as indicated in the XML game file ie. "revised" "classic"
* "pact_of_steel" of course, without the quotes.
*/ | we need the exact map name as indicated in the XML game file ie. "revised" "classic" "pact_of_steel" of course, without the quotes | getMapDirectory | {
"repo_name": "DanVanAtta/triplea",
"path": "game-core/src/main/java/tools/image/AutoPlacementFinder.java",
"license": "gpl-3.0",
"size": 18503
} | [
"javax.swing.JOptionPane"
] | import javax.swing.JOptionPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,564,015 |
public void add(Locatable locatable) {
if (locatable instanceof Unit) {
if (!units.contains(locatable)) {
if (units.equals(Collections.emptyList())) {
units = new ArrayList<Unit>();
}
units.add((Unit) locatable);
... | void function(Locatable locatable) { if (locatable instanceof Unit) { if (!units.contains(locatable)) { if (units.equals(Collections.emptyList())) { units = new ArrayList<Unit>(); } units.add((Unit) locatable); ((Unit) locatable).setState(Unit.UnitState.ACTIVE); firePropertyChange(UNIT_CHANGE, null, locatable); } } els... | /**
* Adds a <code>Locatable</code> to this Location.
*
* @param locatable The <code>Locatable</code> to add to this Location.
*/ | Adds a <code>Locatable</code> to this Location | add | {
"repo_name": "tectronics/reformationofeurope",
"path": "src/net/sf/freecol/common/model/Tile.java",
"license": "gpl-2.0",
"size": 60810
} | [
"java.util.ArrayList",
"java.util.Collections",
"net.sf.freecol.common.model.Unit"
] | import java.util.ArrayList; import java.util.Collections; import net.sf.freecol.common.model.Unit; | import java.util.*; import net.sf.freecol.common.model.*; | [
"java.util",
"net.sf.freecol"
] | java.util; net.sf.freecol; | 750,704 |
public List<ExtendedBlocklet> prune(List<Segment> segments, Expression filterExp,
List<PartitionSpec> partitions) throws IOException {
List<ExtendedBlocklet> blocklets = new ArrayList<>();
SegmentProperties segmentProperties;
Map<Segment, List<DataMap>> dataMaps = dataMapFactory.getDataMaps(segments... | List<ExtendedBlocklet> function(List<Segment> segments, Expression filterExp, List<PartitionSpec> partitions) throws IOException { List<ExtendedBlocklet> blocklets = new ArrayList<>(); SegmentProperties segmentProperties; Map<Segment, List<DataMap>> dataMaps = dataMapFactory.getDataMaps(segments); for (Segment segment ... | /**
* Pass the valid segments and prune the datamap using filter expression
*
* @param segments
* @param filterExp
* @return
*/ | Pass the valid segments and prune the datamap using filter expression | prune | {
"repo_name": "ravipesala/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java",
"license": "apache-2.0",
"size": 20484
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"org.apache.carbondata.core.datamap.dev.DataMap",
"org.apache.carbondata.core.datastore.block.SegmentProperties",
"org.apache.carbondata.core.indexstore.Blocklet",
"org.apache.carbondata.core.indexstore.ExtendedBlocklet",... | import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.carbondata.core.datamap.dev.DataMap; import org.apache.carbondata.core.datastore.block.SegmentProperties; import org.apache.carbondata.core.indexstore.Blocklet; import org.apache.carbondata.core.indexs... | import java.io.*; import java.util.*; import org.apache.carbondata.core.datamap.dev.*; import org.apache.carbondata.core.datastore.block.*; import org.apache.carbondata.core.indexstore.*; import org.apache.carbondata.core.scan.expression.*; | [
"java.io",
"java.util",
"org.apache.carbondata"
] | java.io; java.util; org.apache.carbondata; | 412,275 |
public HandlerRegistration addScrollHandler(ScrollHandler handler) {
return addHandler(handler, ScrollEvent.TYPE);
} | HandlerRegistration function(ScrollHandler handler) { return addHandler(handler, ScrollEvent.TYPE); } | /**
* Adds a scroll handler to this grid
*
* @param handler
* the scroll handler to add
* @return a handler registration for the registered scroll handler
*/ | Adds a scroll handler to this grid | addScrollHandler | {
"repo_name": "shahrzadmn/vaadin",
"path": "client/src/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 302957
} | [
"com.google.gwt.event.shared.HandlerRegistration",
"com.vaadin.client.widget.grid.events.ScrollEvent",
"com.vaadin.client.widget.grid.events.ScrollHandler"
] | import com.google.gwt.event.shared.HandlerRegistration; import com.vaadin.client.widget.grid.events.ScrollEvent; import com.vaadin.client.widget.grid.events.ScrollHandler; | import com.google.gwt.event.shared.*; import com.vaadin.client.widget.grid.events.*; | [
"com.google.gwt",
"com.vaadin.client"
] | com.google.gwt; com.vaadin.client; | 1,526,996 |
public void testDateFLR() {
DateDTO dto = new DateDTO();
dto.dateField = createDate("28.02.2007");
assertTrue(JSefaTestUtil.serialize(FLR, dto).indexOf("28.02.2007") >= 0);
JSefaTestUtil.assertRepeatedRoundTripSucceeds(FLR, dto);
} | void function() { DateDTO dto = new DateDTO(); dto.dateField = createDate(STR); assertTrue(JSefaTestUtil.serialize(FLR, dto).indexOf(STR) >= 0); JSefaTestUtil.assertRepeatedRoundTripSucceeds(FLR, dto); } | /**
* Tests Date(FLR).
*/ | Tests Date(FLR) | testDateFLR | {
"repo_name": "Manmay/JSefa",
"path": "standard/src/test/java/org/jsefa/test/all/SimpleTypeWithFormatTest.java",
"license": "apache-2.0",
"size": 7270
} | [
"org.jsefa.test.common.JSefaTestUtil"
] | import org.jsefa.test.common.JSefaTestUtil; | import org.jsefa.test.common.*; | [
"org.jsefa.test"
] | org.jsefa.test; | 1,042,533 |
protected void onPullStarted(PullState previousState, boolean isTop) {
if (isTop) {
if (topManager != null) topManager.onPullStarted();
} else if (bottomManager != null) {
bottomManager.onPullStarted();
}
Log.d(TAG, "[onPullStarted]");
} | void function(PullState previousState, boolean isTop) { if (isTop) { if (topManager != null) topManager.onPullStarted(); } else if (bottomManager != null) { bottomManager.onPullStarted(); } Log.d(TAG, STR); } | /**
* Called when the pull action begins.
*
* Default behaviour updates the default views if they are in use
*
* @param previousState The previous pull state
* @param isTop If true, the top view is begin pulled
*/ | Called when the pull action begins. Default behaviour updates the default views if they are in use | onPullStarted | {
"repo_name": "yggie/pulltorefresh",
"path": "PullToRefreshLib/src/main/java/com/github/yggie/pulltorefresh/PullListFragment.java",
"license": "mit",
"size": 73344
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 2,556,950 |
@Override
public FSDataOutputStream create(Path path) throws IOException {
try {
validateFileNameFormat(path);
} catch (FileNotFoundException e) {
throw new IOException("File creation failed for " + path);
}
return null;
} | FSDataOutputStream function(Path path) throws IOException { try { validateFileNameFormat(path); } catch (FileNotFoundException e) { throw new IOException(STR + path); } return null; } | /**
* Creating a pseudo local file is nothing but validating the file path.
* Actual data of the file is generated on the fly when client tries to open
* the file for reading.
* @param path file path to be created
*/ | Creating a pseudo local file is nothing but validating the file path. Actual data of the file is generated on the fly when client tries to open the file for reading | create | {
"repo_name": "tseen/Federated-HDFS",
"path": "tseenliu/FedHDFS-hadoop-src/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java",
"license": "apache-2.0",
"size": 10129
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"org.apache.hadoop.fs.FSDataOutputStream",
"org.apache.hadoop.fs.Path"
] | import java.io.FileNotFoundException; import java.io.IOException; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,930,620 |
public void fillHolidays() {
try {
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(format.parse("1.01.2017"));
this.holidays.add(cal);
GregorianCalendar cal2 = new Gregorian... | void function() { try { SimpleDateFormat format = new SimpleDateFormat(STR); GregorianCalendar cal = new GregorianCalendar(); cal.setTime(format.parse(STR)); this.holidays.add(cal); GregorianCalendar cal2 = new GregorianCalendar(); cal2.setTime(format.parse(STR)); this.holidays.add(cal2); GregorianCalendar cal3 = new G... | /**
* fills holidays.
*/ | fills holidays | fillHolidays | {
"repo_name": "dsaetgareev/junior",
"path": "chapter_005/wait/src/main/java/ru/job4j/pool/Work.java",
"license": "apache-2.0",
"size": 4921
} | [
"java.text.ParseException",
"java.text.SimpleDateFormat",
"java.util.GregorianCalendar"
] | import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.GregorianCalendar; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 446,733 |
public ROIShape getShape(long id, Coord3D coord)
throws NoSuchROIException
{
return roiCollection.getShape(id, coord);
} | ROIShape function(long id, Coord3D coord) throws NoSuchROIException { return roiCollection.getShape(id, coord); } | /**
* Returns the ROIShape which is part of the ROI id, and exists on the plane
* coordinates.
* This method looks up the ROIIDMap (TreeMap) for the ROI with id
* and then looks up that ROIs TreeMap for the ROIShape on the plane
* coordinates.
*
* @param id The id of the ROI the ROIShape is a member ... | Returns the ROIShape which is part of the ROI id, and exists on the plane coordinates. This method looks up the ROIIDMap (TreeMap) for the ROI with id and then looks up that ROIs TreeMap for the ROIShape on the plane coordinates | getShape | {
"repo_name": "joshmoore/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/roi/ROIComponent.java",
"license": "gpl-2.0",
"size": 22733
} | [
"org.openmicroscopy.shoola.util.roi.exception.NoSuchROIException",
"org.openmicroscopy.shoola.util.roi.model.ROIShape",
"org.openmicroscopy.shoola.util.roi.model.util.Coord3D"
] | import org.openmicroscopy.shoola.util.roi.exception.NoSuchROIException; import org.openmicroscopy.shoola.util.roi.model.ROIShape; import org.openmicroscopy.shoola.util.roi.model.util.Coord3D; | import org.openmicroscopy.shoola.util.roi.exception.*; import org.openmicroscopy.shoola.util.roi.model.*; import org.openmicroscopy.shoola.util.roi.model.util.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 112,039 |
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(ObjectExistence.class)) {
case CvlPackage.OBJECT_EXISTENCE__OPTIONAL_OBJECT:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
... | void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ObjectExistence.class)) { case CvlPackage.OBJECT_EXISTENCE__OPTIONAL_OBJECT: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notifica... | /**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>. | notifyChanged | {
"repo_name": "diverse-project/kcvl",
"path": "fr.inria.diverse.kcvl.metamodel.edit/src/main/java/org/omg/CVLMetamodelMaster/cvl/provider/ObjectExistenceItemProvider.java",
"license": "epl-1.0",
"size": 4277
} | [
"org.eclipse.emf.common.notify.Notification",
"org.eclipse.emf.edit.provider.ViewerNotification",
"org.omg.CVLMetamodelMaster"
] | import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; import org.omg.CVLMetamodelMaster; | import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; import org.omg.*; | [
"org.eclipse.emf",
"org.omg"
] | org.eclipse.emf; org.omg; | 2,675,114 |
public List<DataSet> getDataSetsWithAcquisitionDateAfter(java.util.Date _minDate) {
List<DataSet> result = new ArrayList<DataSet>();
Set<DataSet> cache = _getDataSetCache();
for (DataSet next : cache) {
Date value = next.getAcquisitionDate();
if (value != null && value.getTime() > _minDate.getTime()... | List<DataSet> function(java.util.Date _minDate) { List<DataSet> result = new ArrayList<DataSet>(); Set<DataSet> cache = _getDataSetCache(); for (DataSet next : cache) { Date value = next.getAcquisitionDate(); if (value != null && value.getTime() > _minDate.getTime()) { result.add(next); } } return result; } | /**
* Returns all DataSets where acquisitionDate is set to a value after '_minDate'.
*/ | Returns all DataSets where acquisitionDate is set to a value after '_minDate' | getDataSetsWithAcquisitionDateAfter | {
"repo_name": "CBSti/csv2DB",
"path": "src/main/java/de/peterspan/csv2db/domain/dao/domainCacheBase.java",
"license": "gpl-3.0",
"size": 11850
} | [
"de.peterspan.csv2db.domain.entities.DataSet",
"java.util.ArrayList",
"java.util.Date",
"java.util.List",
"java.util.Set"
] | import de.peterspan.csv2db.domain.entities.DataSet; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; | import de.peterspan.csv2db.domain.entities.*; import java.util.*; | [
"de.peterspan.csv2db",
"java.util"
] | de.peterspan.csv2db; java.util; | 1,042,313 |
@Test void testSubQueryAlias() {
String query = "select t1.\"customer_id\", t2.\"customer_id\"\n"
+ "from (select \"customer_id\" from \"sales_fact_1997\") as t1\n"
+ "inner join (select \"customer_id\" from \"sales_fact_1997\") t2\n"
+ "on t1.\"customer_id\" = t2.\"customer_id\"";
fin... | @Test void testSubQueryAlias() { String query = STRcustomer_id\STRcustomer_id\"\n" + STRcustomer_id\STRsales_fact_1997\STR + STRcustomer_id\STRsales_fact_1997\STR + STRcustomer_id\STRcustomer_id\STRSELECT *\nSTRFROM (SELECT sales_fact_1997.customer_id\nSTRFROM foodmart.sales_fact_1997 AS sales_fact_1997) AS t\nSTRINNER... | /** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-1636">[CALCITE-1636]
* JDBC adapter generates wrong SQL for self join with sub-query</a>. */ | Test case for [CALCITE-1636] | testSubQueryAlias | {
"repo_name": "julianhyde/calcite",
"path": "core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java",
"license": "apache-2.0",
"size": 239559
} | [
"org.junit.jupiter.api.Test"
] | import org.junit.jupiter.api.Test; | import org.junit.jupiter.api.*; | [
"org.junit.jupiter"
] | org.junit.jupiter; | 1,216,492 |
public boolean checkAndSetEnablingTable(final String tableName)
throws KeeperException {
synchronized (this.cache) {
if (isEnablingTable(tableName)) {
return false;
}
setTableState(tableName, TableState.ENABLING);
return true;
}
} | boolean function(final String tableName) throws KeeperException { synchronized (this.cache) { if (isEnablingTable(tableName)) { return false; } setTableState(tableName, TableState.ENABLING); return true; } } | /**
* Sets the specified table as ENABLING in zookeeper atomically
* If the table is already in ENABLING state, no operation is performed
* @param tableName
* @return if the operation succeeds or not
* @throws KeeperException unexpected zookeeper exception
*/ | Sets the specified table as ENABLING in zookeeper atomically If the table is already in ENABLING state, no operation is performed | checkAndSetEnablingTable | {
"repo_name": "indi60/hbase-pmc",
"path": "target/hbase-0.94.1/hbase-0.94.1/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKTable.java",
"license": "apache-2.0",
"size": 14523
} | [
"org.apache.zookeeper.KeeperException"
] | import org.apache.zookeeper.KeeperException; | import org.apache.zookeeper.*; | [
"org.apache.zookeeper"
] | org.apache.zookeeper; | 226,773 |
public static boolean isSuperDevModeCodeServer(ILaunchConfiguration config) throws CoreException {
String mainTypeName = LaunchConfigurationProcessorUtilities.getMainTypeName(config);
return GWT_CODE_SERVER.equals(mainTypeName);
} | static boolean function(ILaunchConfiguration config) throws CoreException { String mainTypeName = LaunchConfigurationProcessorUtilities.getMainTypeName(config); return GWT_CODE_SERVER.equals(mainTypeName); } | /**
* GWT >= 2.7
*/ | GWT >= 2.7 | isSuperDevModeCodeServer | {
"repo_name": "gwt-plugins/gwt-eclipse-plugin",
"path": "plugins/com.gwtplugins.gwt.eclipse.core/src/com/google/gwt/eclipse/core/launch/processors/GwtLaunchConfigurationProcessorUtilities.java",
"license": "epl-1.0",
"size": 2328
} | [
"com.google.gdt.eclipse.core.launch.LaunchConfigurationProcessorUtilities",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.debug.core.ILaunchConfiguration"
] | import com.google.gdt.eclipse.core.launch.LaunchConfigurationProcessorUtilities; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; | import com.google.gdt.eclipse.core.launch.*; import org.eclipse.core.runtime.*; import org.eclipse.debug.core.*; | [
"com.google.gdt",
"org.eclipse.core",
"org.eclipse.debug"
] | com.google.gdt; org.eclipse.core; org.eclipse.debug; | 1,169,501 |
protected RelatedOptions getIncrementalOptions() {
RelatedOptions incrementalOpts =
new RelatedOptions("Incremental import arguments");
incrementalOpts.addOption(OptionBuilder.withArgName("import-type")
.hasArg()
.withDescription(
"Define an incremental import of type 'append'... | RelatedOptions function() { RelatedOptions incrementalOpts = new RelatedOptions(STR); incrementalOpts.addOption(OptionBuilder.withArgName(STR) .hasArg() .withDescription( STR) .withLongOpt(INCREMENT_TYPE_ARG) .create()); incrementalOpts.addOption(OptionBuilder.withArgName(STR) .hasArg() .withDescription(STR) .withLongO... | /**
* Return options for incremental import.
*/ | Return options for incremental import | getIncrementalOptions | {
"repo_name": "beni55/sqoop",
"path": "src/java/com/cloudera/sqoop/tool/ImportTool.java",
"license": "apache-2.0",
"size": 28315
} | [
"com.cloudera.sqoop.cli.RelatedOptions",
"org.apache.commons.cli.OptionBuilder"
] | import com.cloudera.sqoop.cli.RelatedOptions; import org.apache.commons.cli.OptionBuilder; | import com.cloudera.sqoop.cli.*; import org.apache.commons.cli.*; | [
"com.cloudera.sqoop",
"org.apache.commons"
] | com.cloudera.sqoop; org.apache.commons; | 718,284 |
public static Form get(XmlNsForm xnf) {
for (Form v : values()) {
if(v.xnf==xnf)
return v;
}
throw new IllegalArgumentException();
} | static Form function(XmlNsForm xnf) { for (Form v : values()) { if(v.xnf==xnf) return v; } throw new IllegalArgumentException(); } | /**
* Gets the constant the corresponds to the given {@link XmlNsForm}.
*/ | Gets the constant the corresponds to the given <code>XmlNsForm</code> | get | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jaxws/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/schemagen/Form.java",
"license": "gpl-2.0",
"size": 3718
} | [
"javax.xml.bind.annotation.XmlNsForm"
] | import javax.xml.bind.annotation.XmlNsForm; | import javax.xml.bind.annotation.*; | [
"javax.xml"
] | javax.xml; | 279,499 |
private ContainerRequest setupContainerAskForRM(int memory, int vcores,
int priority, String nodeLabel) {
Priority pri = Records.newRecord(Priority.class);
pri.setPriority(priority);
// Set up resource type requirements
// For now, memory and CPU are supported so we set memory and cpu
// re... | ContainerRequest function(int memory, int vcores, int priority, String nodeLabel) { Priority pri = Records.newRecord(Priority.class); pri.setPriority(priority); Resource capability = Records.newRecord(Resource.class); capability.setMemorySize(memory); capability.setVirtualCores(vcores); return new ContainerRequest(capa... | /**
* Setup the request that will be sent to the RM for the container ask.
*
* @return the setup ResourceRequest to be sent to RM
*/ | Setup the request that will be sent to the RM for the container ask | setupContainerAskForRM | {
"repo_name": "plusplusjiajia/hadoop",
"path": "hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/ApplicationMaster.java",
"license": "apache-2.0",
"size": 33544
} | [
"org.apache.hadoop.yarn.api.records.Priority",
"org.apache.hadoop.yarn.api.records.Resource",
"org.apache.hadoop.yarn.client.api.AMRMClient",
"org.apache.hadoop.yarn.util.Records"
] | import org.apache.hadoop.yarn.api.records.Priority; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.client.api.AMRMClient; import org.apache.hadoop.yarn.util.Records; | import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.client.api.*; import org.apache.hadoop.yarn.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,258,079 |
private boolean isKnownVersion(long version) {
if (version > currentVersion || version < 0) {
return false;
}
if (version == currentVersion || chunks.size() == 0) {
// no stored data
return true;
}
// need to check if a chunk for this versi... | boolean function(long version) { if (version > currentVersion version < 0) { return false; } if (version == currentVersion chunks.size() == 0) { return true; } Chunk c = getChunkForVersion(version); if (c == null) { return false; } MVMap<String, String> oldMeta = getMetaMap(version); if (oldMeta == null) { return false... | /**
* Check whether all data can be read from this version. This requires that
* all chunks referenced by this version are still available (not
* overwritten).
*
* @param version the version
* @return true if all data can be read
*/ | Check whether all data can be read from this version. This requires that all chunks referenced by this version are still available (not overwritten) | isKnownVersion | {
"repo_name": "wizardofos/Protozoo",
"path": "extra/h2/src/main/java/org/h2/mvstore/MVStore.java",
"license": "mit",
"size": 99874
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 118,097 |
@RequestMapping(value="remotetypes", method = {RequestMethod.GET}, produces = "application/json; charset=utf-8")
@ResponseBody
public List<String> getRemoteTypes() {
return getDawgShowClient().getRemoteTypes();
} | @RequestMapping(value=STR, method = {RequestMethod.GET}, produces = STR) List<String> function() { return getDawgShowClient().getRemoteTypes(); } | /**
* Get the valid remote types from Dawg-show using DawgShowClient
* @return A list of valid remote types
*/ | Get the valid remote types from Dawg-show using DawgShowClient | getRemoteTypes | {
"repo_name": "vmatha002c/dawg",
"path": "libraries/dawg-house/src/main/java/com/comcast/video/dawg/controller/house/HouseRestController.java",
"license": "apache-2.0",
"size": 18860
} | [
"java.util.List",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod"
] | import java.util.List; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; | import java.util.*; import org.springframework.web.bind.annotation.*; | [
"java.util",
"org.springframework.web"
] | java.util; org.springframework.web; | 2,755,679 |
public Vector3f getMarkerPrimaryLocation() {
if (markerPrimary != null)
return markerPrimary.getLocalTranslation();
else
return null;
} | Vector3f function() { if (markerPrimary != null) return markerPrimary.getLocalTranslation(); else return null; } | /**
* Location of the primary editor marker
*/ | Location of the primary editor marker | getMarkerPrimaryLocation | {
"repo_name": "OpenGrabeso/jmonkeyengine",
"path": "sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/tools/TerrainTool.java",
"license": "bsd-3-clause",
"size": 11205
} | [
"com.jme3.math.Vector3f"
] | import com.jme3.math.Vector3f; | import com.jme3.math.*; | [
"com.jme3.math"
] | com.jme3.math; | 1,877,658 |
public synchronized void setChildren(
int tag,
ReadableArray childrenTags) {
UiThreadUtil.assertOnUiThread();
ViewGroup viewToManage = (ViewGroup) mTagsToViews.get(tag);
ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(tag);
for (int i = 0; i < childrenTags.size(); i++) {
... | synchronized void function( int tag, ReadableArray childrenTags) { UiThreadUtil.assertOnUiThread(); ViewGroup viewToManage = (ViewGroup) mTagsToViews.get(tag); ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(tag); for (int i = 0; i < childrenTags.size(); i++) { View viewToAdd = mTagsToViews.get(chi... | /**
* Simplified version of manageChildren that only deals with adding children views
*/ | Simplified version of manageChildren that only deals with adding children views | setChildren | {
"repo_name": "dikaiosune/react-native",
"path": "ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java",
"license": "bsd-3-clause",
"size": 30316
} | [
"android.view.View",
"android.view.ViewGroup",
"com.facebook.react.bridge.ReadableArray",
"com.facebook.react.bridge.UiThreadUtil"
] | import android.view.View; import android.view.ViewGroup; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.UiThreadUtil; | import android.view.*; import com.facebook.react.bridge.*; | [
"android.view",
"com.facebook.react"
] | android.view; com.facebook.react; | 863,085 |
@Test
public void testGetTypeLibrariesVersionNull() {
String folderConstant = "populateRegistryWithTypeLibraries/1";
setEnvironment(folderConstant);
m_soaTypeRegistry = SOAGlobalRegistryFactory.getSOATypeRegistryInstance();
List<String> typeNames = new ArrayList();
try {
TypeLibraryType pro... | void function() { String folderConstant = STR; setEnvironment(folderConstant); m_soaTypeRegistry = SOAGlobalRegistryFactory.getSOATypeRegistryInstance(); List<String> typeNames = new ArrayList(); try { TypeLibraryType productTypeLibrary = m_soaTypeRegistry.getTypeLibrary(PRODUCT_TYPE_LIBRARY); TypeLibraryType categoryT... | /**
* Validate the working of getTypeLibrariesVersion(List<String> typeLibraryNames) for valid LibraryName list
* along with null libraryName.
*/ | Validate the working of getTypeLibrariesVersion(List typeLibraryNames) for valid LibraryName list along with null libraryName | testGetTypeLibrariesVersionNull | {
"repo_name": "vthangathurai/SOA-Runtime",
"path": "codegen/codegen-tools/src/test/java/org/ebayopensource/turmeric/tools/library/SOAGlobalRegistryQETest.java",
"license": "apache-2.0",
"size": 86836
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"org.ebayopensource.turmeric.common.config.TypeLibraryType",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.List; import java.util.Map; import org.ebayopensource.turmeric.common.config.TypeLibraryType; import org.junit.Assert; | import java.util.*; import org.ebayopensource.turmeric.common.config.*; import org.junit.*; | [
"java.util",
"org.ebayopensource.turmeric",
"org.junit"
] | java.util; org.ebayopensource.turmeric; org.junit; | 736,501 |
public boolean hasFieldValue(int field) {
final Set<String> values = fieldValues.get(field);
return values != null && values.size() > 0;
} | boolean function(int field) { final Set<String> values = fieldValues.get(field); return values != null && values.size() > 0; } | /**
* Predicate for determining if a field has enumerated values.
*
* @param field
* the tag
* @return true if field is enumerated, false otherwise
*/ | Predicate for determining if a field has enumerated values | hasFieldValue | {
"repo_name": "zkkz/OrientalExpress",
"path": "source/step/src/sse/ngts/common/plugin/step/DataDictionary.java",
"license": "mit",
"size": 39722
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,071,143 |
private boolean canSmelt()
{
if (this.furnaceItemStacks[INPUT_INVENTORY_INDEX] == null)
{
return false;
} else
{
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[INPUT_INVENTORY_INDEX]);
if (itemstack == ... | boolean function() { if (this.furnaceItemStacks[INPUT_INVENTORY_INDEX] == null) { return false; } else { ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[INPUT_INVENTORY_INDEX]); if (itemstack == null) return false; if (this.furnaceItemStacks[OUTPUT_INVENTORY_INDEX] == null) retu... | /**
* Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc.
*/ | Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc | canSmelt | {
"repo_name": "P3pp3rF1y/BigMachines",
"path": "src/main/java/com/p3pp3rf1y/bigmachines/tileentity/modules/TileEntityFurnaceModule.java",
"license": "gpl-3.0",
"size": 9001
} | [
"net.minecraft.item.ItemStack",
"net.minecraft.item.crafting.FurnaceRecipes"
] | import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; | import net.minecraft.item.*; import net.minecraft.item.crafting.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 2,259,454 |
@Function(name = "select", arity = 1)
public static Object select(ExecutionContext cx, Object thisValue, Object value) {
PluralRulesObject pluralRules = thisPluralRulesObject(cx, thisValue, "Intl.PluralRules.prototype.select");
double n = To... | @Function(name = STR, arity = 1) static Object function(ExecutionContext cx, Object thisValue, Object value) { PluralRulesObject pluralRules = thisPluralRulesObject(cx, thisValue, STR); double n = ToNumber(cx, value); return ResolvePlural(pluralRules, n); } | /**
* Intl.PluralRules.prototype.select( value )
*
* @param cx
* the execution context
* @param thisValue
* the function this-value
* @param value
* the number value
* @return the bound compare function
... | Intl.PluralRules.prototype.select( value ) | select | {
"repo_name": "anba/es6draft",
"path": "src/main/java/com/github/anba/es6draft/runtime/objects/intl/PluralRulesPrototype.java",
"license": "mit",
"size": 6040
} | [
"com.github.anba.es6draft.runtime.AbstractOperations",
"com.github.anba.es6draft.runtime.ExecutionContext",
"com.github.anba.es6draft.runtime.internal.Properties"
] | import com.github.anba.es6draft.runtime.AbstractOperations; import com.github.anba.es6draft.runtime.ExecutionContext; import com.github.anba.es6draft.runtime.internal.Properties; | import com.github.anba.es6draft.runtime.*; import com.github.anba.es6draft.runtime.internal.*; | [
"com.github.anba"
] | com.github.anba; | 2,703,194 |
EReference getWizard_News(); | EReference getWizard_News(); | /**
* Returns the meta object for the containment reference '{@link org.dawnsci.marketplace.Wizard#getNews <em>News</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>News</em>'.
* @see org.dawnsci.marketplace.Wizard#getNews()
* @see #getWi... | Returns the meta object for the containment reference '<code>org.dawnsci.marketplace.Wizard#getNews News</code>'. | getWizard_News | {
"repo_name": "Itema-as/dawn-marketplace-server",
"path": "org.dawnsci.marketplace.core/src-gen/org/dawnsci/marketplace/MarketplacePackage.java",
"license": "epl-1.0",
"size": 104026
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,373,398 |
public Controller createIQDisplayController(ModuleConfiguration moduleConfiguration, IQSecurityCallback secCallback, UserRequest ureq,
WindowControl wControl, long callingResId, String callingResDetail, NavigatorDelegate delegate) {
//two cases:
// -- VERY RARE CASE -- 1) qti is open in an editor session r... | Controller function(ModuleConfiguration moduleConfiguration, IQSecurityCallback secCallback, UserRequest ureq, WindowControl wControl, long callingResId, String callingResDetail, NavigatorDelegate delegate) { String repositorySoftkey = (String) moduleConfiguration.get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY); Re... | /**
* IMS QTI Display Controller from within course -> moduleConfiguration
*
* concurrent access check needed -> Editor may save (commit changes) while displaying reads old/new data mix (files and xml structure)
*
*/ | IMS QTI Display Controller from within course -> moduleConfiguration concurrent access check needed -> Editor may save (commit changes) while displaying reads old/new data mix (files and xml structure) | createIQDisplayController | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/modules/iq/IQManager.java",
"license": "apache-2.0",
"size": 19613
} | [
"org.olat.core.gui.UserRequest",
"org.olat.core.gui.control.Controller",
"org.olat.core.gui.control.WindowControl",
"org.olat.core.gui.control.generic.messages.MessageUIFactory",
"org.olat.core.gui.translator.Translator",
"org.olat.core.logging.activity.OlatResourceableType",
"org.olat.core.logging.acti... | import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.generic.messages.MessageUIFactory; import org.olat.core.gui.translator.Translator; import org.olat.core.logging.activity.OlatResourceableType; import org.ol... | import org.olat.core.gui.*; import org.olat.core.gui.control.*; import org.olat.core.gui.control.generic.messages.*; import org.olat.core.gui.translator.*; import org.olat.core.logging.activity.*; import org.olat.core.util.*; import org.olat.core.util.coordinate.*; import org.olat.course.nodes.iq.*; import org.olat.ims... | [
"org.olat.core",
"org.olat.course",
"org.olat.ims",
"org.olat.modules",
"org.olat.repository",
"org.olat.util"
] | org.olat.core; org.olat.course; org.olat.ims; org.olat.modules; org.olat.repository; org.olat.util; | 1,591,104 |
@Test
public void testT1RV8D2_T1LV4D6() {
test_id = getTestId("T1RV8D2", "T1LV4D6", "2");
String src = selectTRVD("T1RV8D2");
String dest = selectTLVD("T1LV4D6");
String result = ".";
try {
result = TRVD_TLVD_Action(src, dest);
} catch (RecognitionException e) {
e.printStackTrace();
... | void function() { test_id = getTestId(STR, STR, "2"); String src = selectTRVD(STR); String dest = selectTLVD(STR); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(ParamFailure2, ... | /**
* Perform the test for the given matrix column (T1RV8D2) and row (T1LV4D6).
*
*/ | Perform the test for the given matrix column (T1RV8D2) and row (T1LV4D6) | testT1RV8D2_T1LV4D6 | {
"repo_name": "jason-rhodes/bridgepoint",
"path": "src/org.xtuml.bp.als.oal.test/src/org/xtuml/bp/als/oal/test/SingleDimensionFixedArrayAssigmentTest_16_Generics.java",
"license": "apache-2.0",
"size": 186177
} | [
"org.xtuml.bp.ui.graphics.editor.GraphicalEditor"
] | import org.xtuml.bp.ui.graphics.editor.GraphicalEditor; | import org.xtuml.bp.ui.graphics.editor.*; | [
"org.xtuml.bp"
] | org.xtuml.bp; | 572,870 |
public void setTAccountKey(ObjectKey key) throws TorqueException
{
setAccount(new Integer(((NumberKey) key).intValue()));
}
private TPerson aTPerson; | void function(ObjectKey key) throws TorqueException { setAccount(new Integer(((NumberKey) key).intValue())); } private TPerson aTPerson; | /**
* Provides convenient way to set a relationship based on a
* ObjectKey, for example
* <code>bar.setFooKey(foo.getPrimaryKey())</code>
*
*/ | Provides convenient way to set a relationship based on a ObjectKey, for example <code>bar.setFooKey(foo.getPrimaryKey())</code> | setTAccountKey | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/BaseTCost.java",
"license": "gpl-3.0",
"size": 53870
} | [
"com.aurel.track.persist.TPerson",
"org.apache.torque.TorqueException",
"org.apache.torque.om.NumberKey",
"org.apache.torque.om.ObjectKey"
] | import com.aurel.track.persist.TPerson; import org.apache.torque.TorqueException; import org.apache.torque.om.NumberKey; import org.apache.torque.om.ObjectKey; | import com.aurel.track.persist.*; import org.apache.torque.*; import org.apache.torque.om.*; | [
"com.aurel.track",
"org.apache.torque"
] | com.aurel.track; org.apache.torque; | 2,851,874 |
private boolean isUsingGroovyAllJar() {
try {
ProtectionDomain domain = MarkupTemplateEngine.class
.getProtectionDomain();
CodeSource codeSource = domain.getCodeSource();
if (codeSource != null
&& codeSource.getLocation().toString().contains("-all")) {
return true;
}
return ... | boolean function() { try { ProtectionDomain domain = MarkupTemplateEngine.class .getProtectionDomain(); CodeSource codeSource = domain.getCodeSource(); if (codeSource != null && codeSource.getLocation().toString().contains("-all")) { return true; } return false; } catch (Exception ex) { return false; } } | /**
* MarkupTemplateEngine could be loaded from groovy-templates or groovy-all.
* Unfortunately it's quite common for people to use groovy-all and not actually
* need templating support. This method check attempts to check the source jar so
* that we can skip the {@code /template} folder check for such case... | MarkupTemplateEngine could be loaded from groovy-templates or groovy-all. Unfortunately it's quite common for people to use groovy-all and not actually need templating support. This method check attempts to check the source jar so that we can skip the /template folder check for such cases | isUsingGroovyAllJar | {
"repo_name": "hello2009chen/spring-boot",
"path": "spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAutoConfiguration.java",
"license": "apache-2.0",
"size": 6017
} | [
"groovy.text.markup.MarkupTemplateEngine",
"java.security.CodeSource",
"java.security.ProtectionDomain"
] | import groovy.text.markup.MarkupTemplateEngine; import java.security.CodeSource; import java.security.ProtectionDomain; | import groovy.text.markup.*; import java.security.*; | [
"groovy.text.markup",
"java.security"
] | groovy.text.markup; java.security; | 305,500 |
EAttribute getAbstractElement_Name(); | EAttribute getAbstractElement_Name(); | /**
* Returns the meta object for the attribute '{@link org.example.domainmodel.domainmodel.AbstractElement#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.example.domainmodel.domainmodel.AbstractElement#ge... | Returns the meta object for the attribute '<code>org.example.domainmodel.domainmodel.AbstractElement#getName Name</code>'. | getAbstractElement_Name | {
"repo_name": "adrian-herscu/experiments",
"path": "language-workbenches/xtext/org.example.domainmodel/src-gen/org/example/domainmodel/domainmodel/DomainmodelPackage.java",
"license": "apache-2.0",
"size": 22388
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 306,955 |
static boolean safeContainsKey(Map<?, ?> map, Object key) {
checkNotNull(map);
try {
return map.containsKey(key);
} catch (ClassCastException e) {
return false;
} catch (NullPointerException e) {
return false;
}
} | static boolean safeContainsKey(Map<?, ?> map, Object key) { checkNotNull(map); try { return map.containsKey(key); } catch (ClassCastException e) { return false; } catch (NullPointerException e) { return false; } } | /**
* Delegates to {@link Map#containsKey}. Returns {@code false} on {@code
* ClassCastException} and {@code NullPointerException}.
*/ | Delegates to <code>Map#containsKey</code>. Returns false on ClassCastException and NullPointerException | safeContainsKey | {
"repo_name": "binhvu7/guava",
"path": "guava/src/com/google/common/collect/Maps.java",
"license": "apache-2.0",
"size": 137526
} | [
"com.google.common.base.Preconditions",
"java.util.Map"
] | import com.google.common.base.Preconditions; import java.util.Map; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 775,267 |
synchronized void transactionTerminated ( CompositeTransaction ct )
{
TransactionContextStateHandler nextState = state.transactionTerminated ( ct );
setState ( nextState );
}
| synchronized void transactionTerminated ( CompositeTransaction ct ) { TransactionContextStateHandler nextState = state.transactionTerminated ( ct ); setState ( nextState ); } | /**
* Notification of transaction termination.
* @param ct The transaction. Irrelevant transactions should be ignored.
*/ | Notification of transaction termination | transactionTerminated | {
"repo_name": "hmalphettes/atomikos-essentials-3.5.8-osgified-sandbox",
"path": "com.atomikos.transactions.jta/src/com/atomikos/datasource/xa/session/TransactionContext.java",
"license": "apache-2.0",
"size": 5238
} | [
"com.atomikos.icatch.CompositeTransaction"
] | import com.atomikos.icatch.CompositeTransaction; | import com.atomikos.icatch.*; | [
"com.atomikos.icatch"
] | com.atomikos.icatch; | 1,089,646 |
@NotNull
List<? extends ArrangementMatchRule> getRulesSortedByPriority(); | List<? extends ArrangementMatchRule> getRulesSortedByPriority(); | /**
* <b>Note:</b> It's expected that rules sort is stable
* <p/>
* Example: 'public static' rule would have higher priority then 'public'
* @return list of rules sorted in order of matching
*/ | Note: It's expected that rules sort is stable Example: 'public static' rule would have higher priority then 'public' | getRulesSortedByPriority | {
"repo_name": "asedunov/intellij-community",
"path": "platform/lang-api/src/com/intellij/psi/codeStyle/arrangement/ArrangementSettings.java",
"license": "apache-2.0",
"size": 1839
} | [
"com.intellij.psi.codeStyle.arrangement.match.ArrangementMatchRule",
"java.util.List"
] | import com.intellij.psi.codeStyle.arrangement.match.ArrangementMatchRule; import java.util.List; | import com.intellij.psi.*; import java.util.*; | [
"com.intellij.psi",
"java.util"
] | com.intellij.psi; java.util; | 1,081,418 |
static Configuration configuration(String scheme, String authority, boolean skipEmbed, boolean skipLocShmem) {
final Configuration cfg = new Configuration();
if (scheme != null && authority != null)
cfg.set("fs.defaultFS", scheme + "://" + authority + "/");
setImplClasses(cfg);... | static Configuration configuration(String scheme, String authority, boolean skipEmbed, boolean skipLocShmem) { final Configuration cfg = new Configuration(); if (scheme != null && authority != null) cfg.set(STR, scheme + ": setImplClasses(cfg); if (authority != null) { if (skipEmbed) cfg.setBoolean(String.format(Hadoop... | /**
* Create configuration for test.
*
* @param skipEmbed Whether to skip embedded mode.
* @param skipLocShmem Whether to skip local shmem mode.
* @return Configuration.
*/ | Create configuration for test | configuration | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/igfs/HadoopSecondaryFileSystemConfigurationTest.java",
"license": "apache-2.0",
"size": 19750
} | [
"org.apache.hadoop.conf.Configuration"
] | import org.apache.hadoop.conf.Configuration; | import org.apache.hadoop.conf.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,697,524 |
public static RefLocation fromPerAligned(byte[] encodedBytes) {
RefLocation result = new RefLocation();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
} | static RefLocation function(byte[] encodedBytes) { RefLocation result = new RefLocation(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; } | /**
* Creates a new RefLocation from encoded stream.
*/ | Creates a new RefLocation from encoded stream | fromPerAligned | {
"repo_name": "google/supl-client",
"path": "src/main/java/com/google/location/suplclient/asn1/supl2/rrlp_components/RefLocation.java",
"license": "apache-2.0",
"size": 6301
} | [
"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; | 2,526,031 |
public FeatureVectorDataSet generateTrainingDataForLearning(DataSet<RecordType, SchemaElementType> dataset1,
DataSet<RecordType, SchemaElementType> dataset2, MatchingGoldStandard goldStandard,
LearnableMatchingRule<RecordType, SchemaElementType> rule,
Processable<? extends Correspondence<SchemaElementTyp... | FeatureVectorDataSet function(DataSet<RecordType, SchemaElementType> dataset1, DataSet<RecordType, SchemaElementType> dataset2, MatchingGoldStandard goldStandard, LearnableMatchingRule<RecordType, SchemaElementType> rule, Processable<? extends Correspondence<SchemaElementType, ? extends Matchable>> schemaCorrespondence... | /**
* Generates a data set containing features that can be used to learn
* matching rules.
*
* @param dataset1
* The first data set
* @param dataset2
* The second data set
* @param goldStandard
* The gold standard containing the labels for the generated data
... | Generates a data set containing features that can be used to learn matching rules | generateTrainingDataForLearning | {
"repo_name": "olehmberg/winter",
"path": "winter-framework/src/main/java/de/uni_mannheim/informatik/dws/winter/matching/algorithms/RuleLearner.java",
"license": "apache-2.0",
"size": 8530
} | [
"de.uni_mannheim.informatik.dws.winter.matching.rules.LearnableMatchingRule",
"de.uni_mannheim.informatik.dws.winter.model.Correspondence",
"de.uni_mannheim.informatik.dws.winter.model.DataSet",
"de.uni_mannheim.informatik.dws.winter.model.Matchable",
"de.uni_mannheim.informatik.dws.winter.model.MatchingGol... | import de.uni_mannheim.informatik.dws.winter.matching.rules.LearnableMatchingRule; import de.uni_mannheim.informatik.dws.winter.model.Correspondence; import de.uni_mannheim.informatik.dws.winter.model.DataSet; import de.uni_mannheim.informatik.dws.winter.model.Matchable; import de.uni_mannheim.informatik.dws.winter.mod... | import de.uni_mannheim.informatik.dws.winter.matching.rules.*; import de.uni_mannheim.informatik.dws.winter.model.*; import de.uni_mannheim.informatik.dws.winter.model.defaultmodel.*; import de.uni_mannheim.informatik.dws.winter.processing.*; import de.uni_mannheim.informatik.dws.winter.processing.parallel.*; import de... | [
"de.uni_mannheim.informatik",
"java.time",
"org.apache.commons"
] | de.uni_mannheim.informatik; java.time; org.apache.commons; | 348,245 |
private void showContents(Book b) {
Iterator<Resource> it = b.getResources().getAll().iterator();
while (it.hasNext()) {
Resource r = it.next();
System.out.println(r.getId() + ": " + r.getHref());
}
} | void function(Book b) { Iterator<Resource> it = b.getResources().getAll().iterator(); while (it.hasNext()) { Resource r = it.next(); System.out.println(r.getId() + STR + r.getHref()); } } | /**
* For debugging, can be used to view contents of the ePub file
* @param b
*/ | For debugging, can be used to view contents of the ePub file | showContents | {
"repo_name": "AGES-Initiatives/common-utilities",
"path": "common-utilities/src/main/java/net/ages/alwb/utils/transformer/epub/merger/EpubMerger.java",
"license": "epl-1.0",
"size": 4477
} | [
"java.util.Iterator",
"nl.siegmann.epublib.domain.Book",
"nl.siegmann.epublib.domain.Resource"
] | import java.util.Iterator; import nl.siegmann.epublib.domain.Book; import nl.siegmann.epublib.domain.Resource; | import java.util.*; import nl.siegmann.epublib.domain.*; | [
"java.util",
"nl.siegmann.epublib"
] | java.util; nl.siegmann.epublib; | 1,391,233 |
private static Type inferChecksumTypeByReading(
String clientName, SocketFactory socketFactory, int socketTimeout,
LocatedBlock lb, DatanodeInfo dn,
DataEncryptionKey encryptionKey, boolean connectToDnViaHostname)
throws IOException {
IOStreamPair pair = connectToDN(socketFactory, connectT... | static Type function( String clientName, SocketFactory socketFactory, int socketTimeout, LocatedBlock lb, DatanodeInfo dn, DataEncryptionKey encryptionKey, boolean connectToDnViaHostname) throws IOException { IOStreamPair pair = connectToDN(socketFactory, connectToDnViaHostname, encryptionKey, dn, socketTimeout); try {... | /**
* Infer the checksum type for a replica by sending an OP_READ_BLOCK
* for the first byte of that replica. This is used for compatibility
* with older HDFS versions which did not include the checksum type in
* OpBlockChecksumResponseProto.
*
* @param in input stream from datanode
* @param out ou... | Infer the checksum type for a replica by sending an OP_READ_BLOCK for the first byte of that replica. This is used for compatibility with older HDFS versions which did not include the checksum type in OpBlockChecksumResponseProto | inferChecksumTypeByReading | {
"repo_name": "yelshater/hadoop-2.3.0",
"path": "hadoop-hdfs-2.3.0-cdh5.1.0/src/main/java/org/apache/hadoop/hdfs/DFSClient.java",
"license": "apache-2.0",
"size": 108346
} | [
"java.io.BufferedOutputStream",
"java.io.DataInputStream",
"java.io.DataOutputStream",
"java.io.IOException",
"javax.net.SocketFactory",
"org.apache.hadoop.hdfs.protocol.DatanodeInfo",
"org.apache.hadoop.hdfs.protocol.HdfsConstants",
"org.apache.hadoop.hdfs.protocol.LocatedBlock",
"org.apache.hadoop... | import java.io.BufferedOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import javax.net.SocketFactory; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; import org.apache.hadoop.hdfs.protocol.HdfsConstants; import org.apache.hadoop.hdfs.protocol.LocatedBlock... | import java.io.*; import javax.net.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.protocol.datatransfer.*; import org.apache.hadoop.hdfs.protocol.proto.*; import org.apache.hadoop.hdfs.security.token.block.*; import org.apache.hadoop.hdfs.server.datanode.*; i... | [
"java.io",
"javax.net",
"org.apache.hadoop"
] | java.io; javax.net; org.apache.hadoop; | 2,161,334 |
void createSymlinks(SymlinkTreeAction action,
ActionExecutionContext actionExecutionContext)
throws ActionExecutionException, InterruptedException; | void createSymlinks(SymlinkTreeAction action, ActionExecutionContext actionExecutionContext) throws ActionExecutionException, InterruptedException; | /**
* Creates the symlink tree.
*/ | Creates the symlink tree | createSymlinks | {
"repo_name": "Digas29/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/SymlinkTreeActionContext.java",
"license": "apache-2.0",
"size": 1244
} | [
"com.google.devtools.build.lib.actions.ActionExecutionContext",
"com.google.devtools.build.lib.actions.ActionExecutionException"
] | import com.google.devtools.build.lib.actions.ActionExecutionContext; import com.google.devtools.build.lib.actions.ActionExecutionException; | import com.google.devtools.build.lib.actions.*; | [
"com.google.devtools"
] | com.google.devtools; | 330,630 |
public static void shareOvpnFile(@NonNull Activity activity, @NonNull Server server) {
File file = getFile(activity, server);
if (!file.exists()) {
saveConfigData(activity, server);
}
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
... | static void function(@NonNull Activity activity, @NonNull Server server) { File file = getFile(activity, server); if (!file.exists()) { saveConfigData(activity, server); } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("*/*"); intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(getFile(activity, server)))... | /**
* Shows an intent chooser to share OVPN profile.
*
* @param activity The context of an activity
* @param server The {@link Server} that contains OVPN profile
*/ | Shows an intent chooser to share OVPN profile | shareOvpnFile | {
"repo_name": "jkennethcarino/DroidOVPN",
"path": "app/src/main/java/com/jkenneth/droidovpn/util/OvpnUtils.java",
"license": "gpl-3.0",
"size": 6263
} | [
"android.app.Activity",
"android.content.Intent",
"android.net.Uri",
"android.support.annotation.NonNull",
"com.jkenneth.droidovpn.model.Server",
"java.io.File"
] | import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.support.annotation.NonNull; import com.jkenneth.droidovpn.model.Server; import java.io.File; | import android.app.*; import android.content.*; import android.net.*; import android.support.annotation.*; import com.jkenneth.droidovpn.model.*; import java.io.*; | [
"android.app",
"android.content",
"android.net",
"android.support",
"com.jkenneth.droidovpn",
"java.io"
] | android.app; android.content; android.net; android.support; com.jkenneth.droidovpn; java.io; | 1,069,984 |
public static double haversineDistance(LatLng x, LatLng y) {
// Pretty much copied from http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points
double r = 6371; // Radius of Earth in km
double dLat = Math.toRadians(y.latitude - x.latitude);
... | static double function(LatLng x, LatLng y) { double r = 6371; double dLat = Math.toRadians(y.latitude - x.latitude); double dLng = Math.toRadians(y.longitude - x.latitude); double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(x.latitude)) * Math.cos(Math.toRadians(y.latitude)) * Math.sin(dLng / ... | /**
* Calculates the distance between two points of longitude and latitude.
* @param x the first LatLng
* @param y the second LatLng
* @return the distance in kilometers
*/ | Calculates the distance between two points of longitude and latitude | haversineDistance | {
"repo_name": "pj2/trail-app",
"path": "src/main/uk/co/prenderj/trail/util/Util.java",
"license": "mit",
"size": 3592
} | [
"com.google.android.gms.maps.model.LatLng"
] | import com.google.android.gms.maps.model.LatLng; | import com.google.android.gms.maps.model.*; | [
"com.google.android"
] | com.google.android; | 621,269 |
public void bindWireHelperService(final WireHelperService wireHelperService) {
if (isNull(this.wireHelperService)) {
this.wireHelperService = wireHelperService;
}
} | void function(final WireHelperService wireHelperService) { if (isNull(this.wireHelperService)) { this.wireHelperService = wireHelperService; } } | /**
* Binds the Wire Helper Service.
*
* @param wireHelperService
* the new Wire Helper Service
*/ | Binds the Wire Helper Service | bindWireHelperService | {
"repo_name": "markoer/kura",
"path": "kura/org.eclipse.kura.wire.h2db.component.provider/src/main/java/org/eclipse/kura/internal/wire/h2db/filter/H2DbWireRecordFilter.java",
"license": "epl-1.0",
"size": 12872
} | [
"org.eclipse.kura.wire.WireHelperService"
] | import org.eclipse.kura.wire.WireHelperService; | import org.eclipse.kura.wire.*; | [
"org.eclipse.kura"
] | org.eclipse.kura; | 807,029 |
public static <T extends Chunkable> byte[] bytesFrom(T chunkable, int offset, int length) {
byte[] data = chunkable.getChunkableData();
if ( offset + length > data.length ) {
// Arrays.copyOfRange appends 0s when the array end is exceeded.
// Trim length manually to avoid a... | static <T extends Chunkable> byte[] function(T chunkable, int offset, int length) { byte[] data = chunkable.getChunkableData(); if ( offset + length > data.length ) { return Arrays.copyOfRange(data, offset, data.length); } else { return Arrays.copyOfRange(data, offset, offset + length); } } | /**
* Retrieve a number of raw bytes at an offset.
*
* @param offset The byte at which to start, zero-indexed
* @param length The number of bytes to return. If this is greater than the number of bytes
* available after <code>offset</code>, it will return all available bytes,
... | Retrieve a number of raw bytes at an offset | bytesFrom | {
"repo_name": "colus001/Bean-Android-SDK",
"path": "sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java",
"license": "mit",
"size": 3238
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,310,287 |
void sendMessage(String deliveryId, String beanName, String message, XAResource xaResource, Xid xid) throws ResourceException; | void sendMessage(String deliveryId, String beanName, String message, XAResource xaResource, Xid xid) throws ResourceException; | /**
* <p>This method sends a message to a particular endpoint application via work
* manager and waits until the message is delivered. </p>
*
* <p>This method call blocks until the message delivery is completed.</p>
*
* @param deliveryId the ID related to this message delivery. You can use... | This method sends a message to a particular endpoint application via work manager and waits until the message is delivered. This method call blocks until the message delivery is completed | sendMessage | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.ejbcontainer.fat_tools_rar/src/com/ibm/ws/ejbcontainer/fat/rar/message/FVTMessageProvider.java",
"license": "epl-1.0",
"size": 28856
} | [
"javax.resource.ResourceException",
"javax.transaction.xa.XAResource",
"javax.transaction.xa.Xid"
] | import javax.resource.ResourceException; import javax.transaction.xa.XAResource; import javax.transaction.xa.Xid; | import javax.resource.*; import javax.transaction.xa.*; | [
"javax.resource",
"javax.transaction"
] | javax.resource; javax.transaction; | 1,574,616 |
public void setDouble(int parameterIndex, double x) throws SQLException {
synchronized (checkClosed().getConnectionMutex()) {
if (!this.connection.getAllowNanAndInf()
&& (x == Double.POSITIVE_INFINITY
|| x == Double.NEGATIVE_INFINITY || Double.isNaN(x))) {
throw SQLError.createSQLException("'" +... | void function(int parameterIndex, double x) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { if (!this.connection.getAllowNanAndInf() && (x == Double.POSITIVE_INFINITY x == Double.NEGATIVE_INFINITY Double.isNaN(x))) { throw SQLError.createSQLException("'" + x + STR, SQLError.SQL_STATE_ILLEGAL_A... | /**
* Set a parameter to a Java double value. The driver converts this to a SQL
* DOUBLE value when it sends it to the database
*
* @param parameterIndex
* the first parameter is 1...
* @param x
* the parameter value
*
* @exception SQLException
* if a database ... | Set a parameter to a Java double value. The driver converts this to a SQL DOUBLE value when it sends it to the database | setDouble | {
"repo_name": "hdkim0426/forsenior",
"path": "mysql-connector-java-5.1.30/src/com/mysql/jdbc/PreparedStatement.java",
"license": "gpl-2.0",
"size": 165027
} | [
"java.sql.SQLException",
"java.sql.Types"
] | import java.sql.SQLException; import java.sql.Types; | import java.sql.*; | [
"java.sql"
] | java.sql; | 105,721 |
public void setLoadingDrawable(Drawable drawable); | void function(Drawable drawable); | /**
* Set the drawable used in the loading layout. This is the same as calling
* <code>setLoadingDrawable(drawable, Mode.BOTH)</code>
*
* @param drawable - Drawable to display
*/ | Set the drawable used in the loading layout. This is the same as calling <code>setLoadingDrawable(drawable, Mode.BOTH)</code> | setLoadingDrawable | {
"repo_name": "ice-coffee/WormBook",
"path": "app/src/main/java/com/jie/book/work/view/pullrefresh/ILoadingLayout.java",
"license": "apache-2.0",
"size": 1616
} | [
"android.graphics.drawable.Drawable"
] | import android.graphics.drawable.Drawable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 2,867,915 |
public SELF isAfter(OffsetTime other) {
Objects.instance().assertNotNull(info, actual);
assertOffsetTimeParameterIsNotNull(other);
if (!actual.isAfter(other)) {
throw Failures.instance().failure(info, shouldBeAfter(actual, other));
}
return myself;
}
/**
* Same assertion as {@link #i... | SELF function(OffsetTime other) { Objects.instance().assertNotNull(info, actual); assertOffsetTimeParameterIsNotNull(other); if (!actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeAfter(actual, other)); } return myself; } /** * Same assertion as {@link #isAfter(java.time.OffsetTime)} but the {@li... | /**
* Verifies that the actual {@code OffsetTime} is <b>strictly</b> after the given one.
* <p>
* Example :
* <pre><code class='java'> assertThat(parse("13:00:00Z")).isAfter(parse("12:00:00Z"));</code></pre>
*
* @param other the given {@link java.time.OffsetTime}.
* @return this assertion object.
... | Verifies that the actual OffsetTime is strictly after the given one. Example : <code> assertThat(parse("13:00:00Z")).isAfter(parse("12:00:00Z"));</code></code> | isAfter | {
"repo_name": "xasx/assertj-core",
"path": "src/main/java/org/assertj/core/api/AbstractOffsetTimeAssert.java",
"license": "apache-2.0",
"size": 33295
} | [
"java.time.OffsetTime",
"org.assertj.core.error.ShouldBeAfter",
"org.assertj.core.internal.Failures",
"org.assertj.core.internal.Objects"
] | import java.time.OffsetTime; import org.assertj.core.error.ShouldBeAfter; import org.assertj.core.internal.Failures; import org.assertj.core.internal.Objects; | import java.time.*; import org.assertj.core.error.*; import org.assertj.core.internal.*; | [
"java.time",
"org.assertj.core"
] | java.time; org.assertj.core; | 1,229,876 |
public static Method findPublicSetter( String property, Class<?> clazz )
throws SecurityException, NullPointerException
{
if ( property == null || property.isEmpty() || clazz == null )
{
logger.error( "Property name and class cannot be null." );
throw new NullPointerExce... | static Method function( String property, Class<?> clazz ) throws SecurityException, NullPointerException { if ( property == null property.isEmpty() clazz == null ) { logger.error( STR ); throw new NullPointerException( STR ); } if ( logger.isTraceEnabled() ) logger.trace( STR, property, clazz ); final String setterName... | /**
* Search, in the provided class, for a public access method
* (so called {@code setter}) related to the given property name.
* <p>
* This method works properly for both classes and interfaces.
*
* @param property name of the property to find.
* @param clazz class into which to search.
*
* @ret... | Search, in the provided class, for a public access method (so called setter) related to the given property name. This method works properly for both classes and interfaces | findPublicSetter | {
"repo_name": "nerd4j/nerd4j-core",
"path": "src/main/java/org/nerd4j/util/ReflectionUtil.java",
"license": "lgpl-3.0",
"size": 34395
} | [
"java.lang.reflect.Field",
"java.lang.reflect.Method",
"java.util.LinkedList",
"java.util.List"
] | import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 2,898,247 |
public void testGetReferenceUpdate() {
int id = createEmployee("testGetReference").getId();
clearCache();
EntityManager em = createEntityManager();
beginTransaction(em);
Employee employee = em.getReference(Employee.class, id);
employee.setFirstName("changed");
... | void function() { int id = createEmployee(STR).getId(); clearCache(); EntityManager em = createEntityManager(); beginTransaction(em); Employee employee = em.getReference(Employee.class, id); employee.setFirstName(STR); commitTransaction(em); verifyObjectInCacheAndDatabase(employee); } | /**
* Test getReference() with update.
*/ | Test getReference() with update | testGetReferenceUpdate | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java",
"license": "epl-1.0",
"size": 562083
} | [
"javax.persistence.EntityManager",
"org.eclipse.persistence.testing.models.jpa.advanced.Employee"
] | import javax.persistence.EntityManager; import org.eclipse.persistence.testing.models.jpa.advanced.Employee; | import javax.persistence.*; import org.eclipse.persistence.testing.models.jpa.advanced.*; | [
"javax.persistence",
"org.eclipse.persistence"
] | javax.persistence; org.eclipse.persistence; | 544,105 |
return new TestSuite(CyclicNumberAxisTests.class);
}
public CyclicNumberAxisTests(String name) {
super(name);
} | return new TestSuite(CyclicNumberAxisTests.class); } public CyclicNumberAxisTests(String name) { super(name); } | /**
* Returns the tests as a test suite.
*
* @return The test suite.
*/ | Returns the tests as a test suite | suite | {
"repo_name": "JSansalone/JFreeChart",
"path": "tests/org/jfree/chart/axis/junit/CyclicNumberAxisTests.java",
"license": "lgpl-2.1",
"size": 5925
} | [
"junit.framework.TestSuite"
] | import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 394,960 |
EClass getMRealParamSLSPSwitchCase(); | EClass getMRealParamSLSPSwitchCase(); | /**
* Returns the meta object for class '{@link es.uah.aut.srg.micobs.mclev.mclevslib.MRealParamSLSPSwitchCase <em>MRealParamSLSPSwitchCase</em>}'.
* @return the meta object for class '<em>MRealParamSLSPSwitchCase</em>'.
* @see es.uah.aut.srg.micobs.mclev.mclevslib.MRealParamSLSPSwitchCase
* @generated
*/ | Returns the meta object for class '<code>es.uah.aut.srg.micobs.mclev.mclevslib.MRealParamSLSPSwitchCase MRealParamSLSPSwitchCase</code>' | getMRealParamSLSPSwitchCase | {
"repo_name": "parraman/micobs",
"path": "mclev/es.uah.aut.srg.micobs.mclev/src/es/uah/aut/srg/micobs/mclev/mclevslib/mclevslibPackage.java",
"license": "epl-1.0",
"size": 79415
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,132,401 |
public TemporalDifference getScheduleAdherence() {
// If there is no schedule time for this stop then there
// is no schedule adherence information.
if (scheduledTime == null)
return null;
// Return the schedule adherence
return new TemporalDifference(scheduledTime.getTime() - time.getTime());
}
| TemporalDifference function() { if (scheduledTime == null) return null; return new TemporalDifference(scheduledTime.getTime() - time.getTime()); } | /**
* Returns the schedule adherence for the stop if there was a schedule
* time. Otherwise returns null.
*
* @return
*/ | Returns the schedule adherence for the stop if there was a schedule time. Otherwise returns null | getScheduleAdherence | {
"repo_name": "edsfocci/Transitime_core",
"path": "transitime/src/main/java/org/transitime/db/structs/ArrivalDeparture.java",
"license": "gpl-3.0",
"size": 23351
} | [
"org.transitime.core.TemporalDifference"
] | import org.transitime.core.TemporalDifference; | import org.transitime.core.*; | [
"org.transitime.core"
] | org.transitime.core; | 2,787,871 |
public Field[] createDescriptorFields(BufferedImage image);
| Field[] function(BufferedImage image); | /**
* Creates the feature fields for a Lucene Document without creating the document itself.
*
* @param image the image to analyze.
* @return the fields resulting from the analysis.
*/ | Creates the feature fields for a Lucene Document without creating the document itself | createDescriptorFields | {
"repo_name": "GregBowyer/lire",
"path": "src/main/java/net/semanticmetadata/lire/DocumentBuilder.java",
"license": "gpl-2.0",
"size": 7161
} | [
"java.awt.image.BufferedImage",
"org.apache.lucene.document.Field"
] | import java.awt.image.BufferedImage; import org.apache.lucene.document.Field; | import java.awt.image.*; import org.apache.lucene.document.*; | [
"java.awt",
"org.apache.lucene"
] | java.awt; org.apache.lucene; | 2,438,812 |
@Test
public void bgpUpdateMessageTest28() throws BgpParseException {
byte[] updateMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
... | void function() throws BgpParseException { byte[] updateMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x00, 0x18, 0x02, 0x00, 0x01, 0x00, 0x... | /**
* In this test case, withdrawn routes with prefix length 0 is given as input and expecting
* an exception.
*/ | In this test case, withdrawn routes with prefix length 0 is given as input and expecting an exception | bgpUpdateMessageTest28 | {
"repo_name": "sonu283304/onos",
"path": "protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpUpdateMsgTest.java",
"license": "apache-2.0",
"size": 100189
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.jboss.netty.buffer.ChannelBuffer",
"org.jboss.netty.buffer.ChannelBuffers",
"org.onosproject.bgpio.exceptions.BgpParseException",
"org.onosproject.bgpio.types.BgpHeader"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.onosproject.bgpio.exceptions.BgpParseException; import org.onosproject.bgpio.types.BgpHeader; | import org.hamcrest.*; import org.jboss.netty.buffer.*; import org.onosproject.bgpio.exceptions.*; import org.onosproject.bgpio.types.*; | [
"org.hamcrest",
"org.jboss.netty",
"org.onosproject.bgpio"
] | org.hamcrest; org.jboss.netty; org.onosproject.bgpio; | 2,702,007 |
public void close() {
fsRunning = false;
try {
if (pendingReplications != null) pendingReplications.stop();
if (hbthread != null) hbthread.interrupt();
if (replthread != null) replthread.interrupt();
if (dnthread != null) dnthread.interrupt();
if (smmthread != null) smmthread.int... | void function() { fsRunning = false; try { if (pendingReplications != null) pendingReplications.stop(); if (hbthread != null) hbthread.interrupt(); if (replthread != null) replthread.interrupt(); if (dnthread != null) dnthread.interrupt(); if (smmthread != null) smmthread.interrupt(); if (dtSecretManager != null) dtSec... | /**
* Close down this file system manager.
* Causes heartbeat and lease daemons to stop; waits briefly for
* them to finish, but a short timeout returns control back to caller.
*/ | Close down this file system manager. Causes heartbeat and lease daemons to stop; waits briefly for them to finish, but a short timeout returns control back to caller | close | {
"repo_name": "aseldawy/spatialhadoop",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 220549
} | [
"java.io.IOException",
"org.apache.hadoop.io.IOUtils"
] | import java.io.IOException; import org.apache.hadoop.io.IOUtils; | import java.io.*; import org.apache.hadoop.io.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 398,622 |
protected void populateInterfaceWithModel (final GenotypeFileParser newGenotypeParser) {
setCursor (null); // Turn off the wait cursor
if (newGenotypeParser.getFatalErrorCount() == 0) {
final AppUtils appUtils = AppUtils.getInstance ();
final PropertyChangeSupport errorModelPropSupport = errorMod... | void function (final GenotypeFileParser newGenotypeParser) { setCursor (null); if (newGenotypeParser.getFatalErrorCount() == 0) { final AppUtils appUtils = AppUtils.getInstance (); final PropertyChangeSupport errorModelPropSupport = errorModel.getPropertyChangeSupport(); final HeritablePopulation hPop = genotypeParser.... | /**
* Populate the interface with data from the GenotypeFileParser and contained HeritablePopulation
* Some ActionListeners that depend on handles to a model are also added
* @param newGenotypeParser
*/ | Populate the interface with data from the GenotypeFileParser and contained HeritablePopulation Some ActionListeners that depend on handles to a model are also added | populateInterfaceWithModel | {
"repo_name": "martingraham/viper",
"path": "src/napier/pedigree/swing/app/PedigreeFrame.java",
"license": "gpl-3.0",
"size": 76999
} | [
"java.beans.PropertyChangeEvent",
"java.beans.PropertyChangeListener",
"java.beans.PropertyChangeSupport",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"javax.swing.DefaultComboBoxModel",
"javax.swing.table.TableCellRenderer",
"javax.swing.table.TableModel",
"ja... | import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.swing.DefaultComboBoxModel; import javax.swing.table.TableCellRenderer; import javax.s... | import java.beans.*; import java.util.*; import javax.swing.*; import javax.swing.table.*; import org.resspecies.inheritance.model.*; import org.resspecies.model.*; import org.resspecies.parsing.*; | [
"java.beans",
"java.util",
"javax.swing",
"org.resspecies.inheritance",
"org.resspecies.model",
"org.resspecies.parsing"
] | java.beans; java.util; javax.swing; org.resspecies.inheritance; org.resspecies.model; org.resspecies.parsing; | 735,693 |
public void setProperties(String prefix, java.util.Properties props) {
setPropertyPrefix(prefix);
String realPrefix = PropUtils.getScopedPropertyPrefix(prefix);
String generatorList = props.getProperty(realPrefix + GeneratorLoadersProperty);
if (generatorList != null) {
... | void function(String prefix, java.util.Properties props) { setPropertyPrefix(prefix); String realPrefix = PropUtils.getScopedPropertyPrefix(prefix); String generatorList = props.getProperty(realPrefix + GeneratorLoadersProperty); if (generatorList != null) { Vector<String> generatorMarkers = PropUtils.parseSpacedMarker... | /**
* Sets the properties for the OMComponent.
*
* @param prefix the token to prefix the property names
* @param props the <code>Properties</code> object
*/ | Sets the properties for the OMComponent | setProperties | {
"repo_name": "d2fn/passage",
"path": "src/main/java/com/bbn/openmap/dataAccess/dted/DTEDFrameCacheHandler.java",
"license": "mit",
"size": 25929
} | [
"com.bbn.openmap.omGraphics.grid.GeneratorLoader",
"com.bbn.openmap.util.ComponentFactory",
"com.bbn.openmap.util.Debug",
"com.bbn.openmap.util.PropUtils",
"java.util.Properties",
"java.util.Vector"
] | import com.bbn.openmap.omGraphics.grid.GeneratorLoader; import com.bbn.openmap.util.ComponentFactory; import com.bbn.openmap.util.Debug; import com.bbn.openmap.util.PropUtils; import java.util.Properties; import java.util.Vector; | import com.bbn.openmap.*; import com.bbn.openmap.util.*; import java.util.*; | [
"com.bbn.openmap",
"java.util"
] | com.bbn.openmap; java.util; | 819,271 |
@Test
public void title() {
// title capitalises the significant words of the title
// for the title case the concatenation happens at formatting, which is tested in MakeLabelWithDatabaseTest.java
assertEquals("Application Migration Effort in the Cloud the Case of Cloud Platforms",
... | void function() { assertEquals(STR, BibtexKeyPatternUtil .camelizeSignificantWordsInTitle(TITLE_STRING_ALL_LOWER_FOUR_SMALL_WORDS_ONE_EN_DASH)); assertEquals(STR, BibtexKeyPatternUtil.camelizeSignificantWordsInTitle( TITLE_STRING_ALL_LOWER_FIRST_WORD_IN_BRACKETS_TWO_SMALL_WORDS_SMALL_WORD_AFTER_COLON)); assertEquals(ST... | /**
* Tests [title]
*/ | Tests [title] | title | {
"repo_name": "shitikanth/jabref",
"path": "src/test/java/org/jabref/logic/bibtexkeypattern/BibtexKeyPatternUtilTest.java",
"license": "mit",
"size": 48550
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 709,907 |
private void delete(InputStream inputStream, OutputStream outputStream, byte[] buf) throws IOException {
try {
int type = inputStream.read();
if (type < 0) {
throw new EOFException("Premature end of DELETE request");
}
if (type == CONTENT_ADDRESSABLE) {
BlobKey key = BlobKey.readFromInputStre... | void function(InputStream inputStream, OutputStream outputStream, byte[] buf) throws IOException { try { int type = inputStream.read(); if (type < 0) { throw new EOFException(STR); } if (type == CONTENT_ADDRESSABLE) { BlobKey key = BlobKey.readFromInputStream(inputStream); File blobFile = this.blobServer.getStorageLoca... | /**
* Handles an incoming DELETE request from a BLOB client.
*
* @param inputStream The input stream to read the request from.
* @param outputStream The output stream to write the response to.
* @throws java.io.IOException Thrown if an I/O error occurs while reading the request data from the input stream.
... | Handles an incoming DELETE request from a BLOB client | delete | {
"repo_name": "DieBauer/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServerConnection.java",
"license": "apache-2.0",
"size": 15521
} | [
"java.io.EOFException",
"java.io.File",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"org.apache.flink.api.common.JobID",
"org.apache.flink.runtime.blob.BlobUtils"
] | import java.io.EOFException; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.flink.api.common.JobID; import org.apache.flink.runtime.blob.BlobUtils; | import java.io.*; import org.apache.flink.api.common.*; import org.apache.flink.runtime.blob.*; | [
"java.io",
"org.apache.flink"
] | java.io; org.apache.flink; | 2,540,171 |
public OutputStreamWriter writer() throws HttpRequestException {
try {
openOutput();
return new OutputStreamWriter(output, output.encoder.charset());
} catch (IOException e) {
throw new HttpRequestException(e);
}
}
| OutputStreamWriter function() throws HttpRequestException { try { openOutput(); return new OutputStreamWriter(output, output.encoder.charset()); } catch (IOException e) { throw new HttpRequestException(e); } } | /**
* Create writer to request output stream
*
* @return writer
* @throws HttpRequestException
*/ | Create writer to request output stream | writer | {
"repo_name": "h42i/Hasi-App",
"path": "app/src/main/java/org/hasi/apps/hasi/HttpRequest.java",
"license": "gpl-3.0",
"size": 101719
} | [
"java.io.IOException",
"java.io.OutputStreamWriter"
] | import java.io.IOException; import java.io.OutputStreamWriter; | import java.io.*; | [
"java.io"
] | java.io; | 2,514,003 |
private void eagerlyInitializeCaches(EmbeddedCacheManager cacheManager) {
caches = new ConcurrentHashMap<String, Cache>( 3 );
putInLocalCache( cacheManager, CacheNames.ASSOCIATION_CACHE );
putInLocalCache( cacheManager, CacheNames.ENTITY_CACHE );
putInLocalCache( cacheManager, CacheNames.IDENTIFIER_CACHE );
... | void function(EmbeddedCacheManager cacheManager) { caches = new ConcurrentHashMap<String, Cache>( 3 ); putInLocalCache( cacheManager, CacheNames.ASSOCIATION_CACHE ); putInLocalCache( cacheManager, CacheNames.ENTITY_CACHE ); putInLocalCache( cacheManager, CacheNames.IDENTIFIER_CACHE ); } | /**
* Need to make sure all needed caches are started before state transfer happens.
* This prevents this node to return undefined cache errors during replication
* when other nodes join this one.
* @param cacheManager
*/ | Need to make sure all needed caches are started before state transfer happens. This prevents this node to return undefined cache errors during replication when other nodes join this one | eagerlyInitializeCaches | {
"repo_name": "emmanuelbernard/hibernate-ogm",
"path": "infinispan/src/main/java/org/hibernate/ogm/datastore/infinispan/impl/InfinispanDatastoreProvider.java",
"license": "lgpl-2.1",
"size": 7653
} | [
"java.util.concurrent.ConcurrentHashMap",
"org.infinispan.Cache",
"org.infinispan.manager.EmbeddedCacheManager"
] | import java.util.concurrent.ConcurrentHashMap; import org.infinispan.Cache; import org.infinispan.manager.EmbeddedCacheManager; | import java.util.concurrent.*; import org.infinispan.*; import org.infinispan.manager.*; | [
"java.util",
"org.infinispan",
"org.infinispan.manager"
] | java.util; org.infinispan; org.infinispan.manager; | 771,281 |
@Override
public void addEntry(String logType, LogEntry entry) {
if (!logTypesToInclude.contains(logType)) {
return;
}
if (!localLogs.containsKey(logType)) {
List<LogEntry> entries = new ArrayList<>();
entries.add(entry);
localLogs.put(logType, entries);
} else {
local... | void function(String logType, LogEntry entry) { if (!logTypesToInclude.contains(logType)) { return; } if (!localLogs.containsKey(logType)) { List<LogEntry> entries = new ArrayList<>(); entries.add(entry); localLogs.put(logType, entries); } else { localLogs.get(logType).add(entry); } } | /**
* Add a new log entry to the local storage.
*
* @param logType the log type to store
* @param entry the entry to store
*/ | Add a new log entry to the local storage | addEntry | {
"repo_name": "titusfortner/selenium",
"path": "java/src/org/openqa/selenium/logging/StoringLocalLogs.java",
"license": "apache-2.0",
"size": 2352
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 242,837 |
public static void registerLookupDB(String name,String fileName) throws IOException
{
registerDB(name,new DefaultHibernateAccessService(new File(fileName),null,null,true));
} | static void function(String name,String fileName) throws IOException { registerDB(name,new DefaultHibernateAccessService(new File(fileName),null,null,true)); } | /**
* Convenience method to register a read-only datasource suitable for data lookups.
* It uses a normal hibernate.cfg.xml where jPOS-EE will not do any processing, there
* it's up to the developer to define mappings, specify jdbc driver, class, etc.
*
* @param name The alias name
* @para... | Convenience method to register a read-only datasource suitable for data lookups. It uses a normal hibernate.cfg.xml where jPOS-EE will not do any processing, there it's up to the developer to define mappings, specify jdbc driver, class, etc | registerLookupDB | {
"repo_name": "napramirez/jPOS-EE",
"path": "modules/dbsupport/src/main/java/org/jpos/ee/DBManager.java",
"license": "agpl-3.0",
"size": 3293
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,583,109 |
@Test
public void testSetObjectType() {
INotationSyntaxService syntaxService = this.notationSubsystemFixture.getNotationSubsystem().getSyntaxService();
IShapeObjectType expectedType = syntaxService.getShapeObjectType(CanvasTestFixture.SHAPE1_ATT_OT);
this.testInstance.setObjectType(expectedType);
assertEqua... | void function() { INotationSyntaxService syntaxService = this.notationSubsystemFixture.getNotationSubsystem().getSyntaxService(); IShapeObjectType expectedType = syntaxService.getShapeObjectType(CanvasTestFixture.SHAPE1_ATT_OT); this.testInstance.setObjectType(expectedType); assertEquals(STR, expectedType, this.testIns... | /**
* Test method for {@link org.pathwayeditor.businessobjects.impl.ShapeAttributeFactory#setObjectType(org.pathwayeditor.businessobjects.typedefn.IShapeObjectType)}.
*/ | Test method for <code>org.pathwayeditor.businessobjects.impl.ShapeAttributeFactory#setObjectType(org.pathwayeditor.businessobjects.typedefn.IShapeObjectType)</code> | testSetObjectType | {
"repo_name": "stumoodie/VisualLanguageToolkit",
"path": "test/org/pathwayeditor/businessobjects/impl/ShapeAttributeFactoryTest.java",
"license": "apache-2.0",
"size": 4369
} | [
"org.junit.Assert",
"org.pathwayeditor.businessobjects.notationsubsystem.INotationSyntaxService",
"org.pathwayeditor.businessobjects.typedefn.IShapeObjectType",
"org.pathwayeditor.testfixture.CanvasTestFixture"
] | import org.junit.Assert; import org.pathwayeditor.businessobjects.notationsubsystem.INotationSyntaxService; import org.pathwayeditor.businessobjects.typedefn.IShapeObjectType; import org.pathwayeditor.testfixture.CanvasTestFixture; | import org.junit.*; import org.pathwayeditor.businessobjects.notationsubsystem.*; import org.pathwayeditor.businessobjects.typedefn.*; import org.pathwayeditor.testfixture.*; | [
"org.junit",
"org.pathwayeditor.businessobjects",
"org.pathwayeditor.testfixture"
] | org.junit; org.pathwayeditor.businessobjects; org.pathwayeditor.testfixture; | 2,389,156 |
@Before
public void setUp()
{
this.context = new Context();
try
{
LibUsb.init(this.context);
}
catch (final Throwable e)
{
this.context = null;
}
} | void function() { this.context = new Context(); try { LibUsb.init(this.context); } catch (final Throwable e) { this.context = null; } } | /**
* Set up the test.
*/ | Set up the test | setUp | {
"repo_name": "usb4java/usb4java",
"path": "src/test/java/org/usb4java/TransferTest.java",
"license": "mit",
"size": 5647
} | [
"org.usb4java.Context",
"org.usb4java.LibUsb"
] | import org.usb4java.Context; import org.usb4java.LibUsb; | import org.usb4java.*; | [
"org.usb4java"
] | org.usb4java; | 178,774 |
public static CharSequence generateHtml(String markdown) {
if (markdown != null) {
markdown = parseMarkdown(markdown);
Spanned content = Html.fromHtml(markdown);
return sanitise(content);
}
return null;
} | static CharSequence function(String markdown) { if (markdown != null) { markdown = parseMarkdown(markdown); Spanned content = Html.fromHtml(markdown); return sanitise(content); } return null; } | /**
* Generates HTML content from a markdown string. This is supplied in the API response but a
* parser is required when writing comments etc.
*
* @param markdown a string of Voat markdown (See <a href=https://voat.co/help/markdown>https://voat.co/help/markdown</a>)
* @return formatted html co... | Generates HTML content from a markdown string. This is supplied in the API response but a parser is required when writing comments etc | generateHtml | {
"repo_name": "l3d00m/Vulcan",
"path": "app/src/main/java/com/fractalwrench/vulcan/common/FormatUtils.java",
"license": "mit",
"size": 16813
} | [
"android.text.Html",
"android.text.Spanned"
] | import android.text.Html; import android.text.Spanned; | import android.text.*; | [
"android.text"
] | android.text; | 73,845 |
public static <InputT, CommT> OperatorSubtaskState buildSubtaskState(
OneInputStreamOperatorTestHarness<InputT, CommT> testHarness, List<InputT> input)
throws Exception {
testHarness.initializeEmptyState();
testHarness.open();
testHarness.processElements(
... | static <InputT, CommT> OperatorSubtaskState function( OneInputStreamOperatorTestHarness<InputT, CommT> testHarness, List<InputT> input) throws Exception { testHarness.initializeEmptyState(); testHarness.open(); testHarness.processElements( input.stream().map(StreamRecord::new).collect(Collectors.toList())); testHarness... | /**
* Get the operator's state after processing given inputs.
*
* @param testHarness A operator whose state is computed
* @param input A list of inputs
* @return The operator's snapshot
*/ | Get the operator's state after processing given inputs | buildSubtaskState | {
"repo_name": "lincoln-lil/flink",
"path": "flink-streaming-java/src/test/java/org/apache/flink/streaming/util/TestHarnessUtil.java",
"license": "apache-2.0",
"size": 5428
} | [
"java.util.List",
"java.util.stream.Collectors",
"org.apache.flink.runtime.checkpoint.OperatorSubtaskState",
"org.apache.flink.streaming.runtime.streamrecord.StreamRecord"
] | import java.util.List; import java.util.stream.Collectors; import org.apache.flink.runtime.checkpoint.OperatorSubtaskState; import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; | import java.util.*; import java.util.stream.*; import org.apache.flink.runtime.checkpoint.*; import org.apache.flink.streaming.runtime.streamrecord.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 871,929 |
public void onSessionOpened(GridNioSession ses) throws IgniteCheckedException; | void function(GridNioSession ses) throws IgniteCheckedException; | /**
* Invoked when a new session was created.
*
* @param ses Opened session.
* @throws IgniteCheckedException If GridNioException occurred while handling event.
*/ | Invoked when a new session was created | onSessionOpened | {
"repo_name": "alexzaitzev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioFilter.java",
"license": "apache-2.0",
"size": 10177
} | [
"org.apache.ignite.IgniteCheckedException"
] | import org.apache.ignite.IgniteCheckedException; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,658,468 |
public String makeServiceCall(String url, int method,
List<NameValuePair> params) {
try {
// http client
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpEntity httpEntity = null;
HttpResponse httpResponse = null;
// Checking http request method type
if (method == POST) {
HttpP... | String function(String url, int method, List<NameValuePair> params) { try { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpEntity httpEntity = null; HttpResponse httpResponse = null; if (method == POST) { HttpPost httpPost = new HttpPost(url); if (params != null) { httpPost.setEntity(new UrlEncodedFormEnti... | /**
* Making service call
*
* @url - url to make request
* @method - http request method
* @params - http request params
* */ | Making service call | makeServiceCall | {
"repo_name": "lawrence615/Kodesearch",
"path": "src/com/kodesearch/ServiceHandler.java",
"license": "unlicense",
"size": 2233
} | [
"java.io.IOException",
"java.io.UnsupportedEncodingException",
"java.util.List",
"org.apache.http.HttpEntity",
"org.apache.http.HttpResponse",
"org.apache.http.NameValuePair",
"org.apache.http.client.ClientProtocolException",
"org.apache.http.client.entity.UrlEncodedFormEntity",
"org.apache.http.cli... | import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.entity.UrlEncodedFormEntity; ... | import java.io.*; import java.util.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.entity.*; import org.apache.http.client.methods.*; import org.apache.http.client.utils.*; import org.apache.http.impl.client.*; import org.apache.http.util.*; | [
"java.io",
"java.util",
"org.apache.http"
] | java.io; java.util; org.apache.http; | 2,402,148 |
public static void setDefaultFireOnClick(boolean aDefaultFireOnClick) {
defaultFireOnClick = aDefaultFireOnClick;
}
private T renderingPrototype;
private int fixedSelection;
private ListModel<T> model;
private ListCellRenderer<T> renderer = new DefaultListCellRenderer<T>();
... | static void function(boolean aDefaultFireOnClick) { defaultFireOnClick = aDefaultFireOnClick; } private T renderingPrototype; private int fixedSelection; private ListModel<T> model; private ListCellRenderer<T> renderer = new DefaultListCellRenderer<T>(); private int orientation = VERTICAL; public static final int VERTI... | /**
* Default value for the fire on click behavior
*
* @param aDefaultFireOnClick the defaultFireOnClick to set
*/ | Default value for the fire on click behavior | setDefaultFireOnClick | {
"repo_name": "sannysanoff/CodenameOne",
"path": "CodenameOne/src/com/codename1/ui/List.java",
"license": "gpl-2.0",
"size": 85315
} | [
"com.codename1.ui.animations.Motion",
"com.codename1.ui.geom.Dimension",
"com.codename1.ui.list.DefaultListCellRenderer",
"com.codename1.ui.list.DefaultListModel",
"com.codename1.ui.list.ListCellRenderer",
"com.codename1.ui.list.ListModel",
"com.codename1.ui.util.EventDispatcher",
"java.util.Vector"
] | import com.codename1.ui.animations.Motion; import com.codename1.ui.geom.Dimension; import com.codename1.ui.list.DefaultListCellRenderer; import com.codename1.ui.list.DefaultListModel; import com.codename1.ui.list.ListCellRenderer; import com.codename1.ui.list.ListModel; import com.codename1.ui.util.EventDispatcher; imp... | import com.codename1.ui.animations.*; import com.codename1.ui.geom.*; import com.codename1.ui.list.*; import com.codename1.ui.util.*; import java.util.*; | [
"com.codename1.ui",
"java.util"
] | com.codename1.ui; java.util; | 164,598 |
public synchronized MarketstatEvent cache(MarketstatEvent inEvent)
{
if(!inEvent.getInstrument().equals(instrument)) {
throw new IllegalArgumentException();
}
receivedData = true;
// these values should always be transferred
builder.withMessageId(inEvent.getMe... | synchronized MarketstatEvent function(MarketstatEvent inEvent) { if(!inEvent.getInstrument().equals(instrument)) { throw new IllegalArgumentException(); } receivedData = true; builder.withMessageId(inEvent.getMessageId()) .withTimestamp(inEvent.getTimestamp()) .withSource(inEvent.getSource()) .withEventType(inEvent.get... | /**
* Adds the given {@link MarketstatEvent event} to the cache.
*
* <p>Any non-null attributes on the given event will replace the
* cached attribute.
*
* @param inEvent a <code>MarketstatEvent</code> value
* @return a <code>MarketstatEvent</code> value
* @throws IllegalArgumen... | Adds the given <code>MarketstatEvent event</code> to the cache. Any non-null attributes on the given event will replace the cached attribute | cache | {
"repo_name": "nagyist/marketcetera",
"path": "trunk/core/src/main/java/org/marketcetera/event/util/MarketstatEventCache.java",
"license": "apache-2.0",
"size": 6283
} | [
"org.marketcetera.event.MarketstatEvent",
"org.marketcetera.event.OptionMarketstatEvent"
] | import org.marketcetera.event.MarketstatEvent; import org.marketcetera.event.OptionMarketstatEvent; | import org.marketcetera.event.*; | [
"org.marketcetera.event"
] | org.marketcetera.event; | 2,108,791 |
@Override
protected ModelAndView doResolveHandlerMethodException(HttpServletRequest request,
HttpServletResponse response, HandlerMethod handlerMethod, Exception exception) {
ServletInvocableHandlerMethod exceptionHandlerMethod = getExceptionHandlerMethod(handlerMethod, exception);
if (exceptionHandlerMetho... | ModelAndView function(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod, Exception exception) { ServletInvocableHandlerMethod exceptionHandlerMethod = getExceptionHandlerMethod(handlerMethod, exception); if (exceptionHandlerMethod == null) { return null; } exceptionHandlerMethod.setH... | /**
* Find an {@code @ExceptionHandler} method and invoke it to handle the raised exception.
*/ | Find an @ExceptionHandler method and invoke it to handle the raised exception | doResolveHandlerMethodException | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/spring/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java",
"license": "gpl-2.0",
"size": 17845
} | [
"java.util.Map",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.springframework.http.HttpStatus",
"org.springframework.ui.ModelMap",
"org.springframework.web.bind.annotation.ControllerAdvice",
"org.springframework.web.context.request.ServletWebRequest",
"org.sp... | import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.http.HttpStatus; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.context.request.ServletWe... | import java.util.*; import javax.servlet.http.*; import org.springframework.http.*; import org.springframework.ui.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.*; import org.springframework.web.method.*; import org.springframework.web.method.support.*; import org.sp... | [
"java.util",
"javax.servlet",
"org.springframework.http",
"org.springframework.ui",
"org.springframework.web"
] | java.util; javax.servlet; org.springframework.http; org.springframework.ui; org.springframework.web; | 432,600 |
public CallContext getCallContext() {
return context;
} | CallContext function() { return context; } | /**
* Gets the call context.
*/ | Gets the call context | getCallContext | {
"repo_name": "johanlelan/CMISFileBridgeWithMetadata",
"path": "src/main/java/org/example/cmis/server/FileBridgeCmisService.java",
"license": "apache-2.0",
"size": 17484
} | [
"org.apache.chemistry.opencmis.commons.server.CallContext"
] | import org.apache.chemistry.opencmis.commons.server.CallContext; | import org.apache.chemistry.opencmis.commons.server.*; | [
"org.apache.chemistry"
] | org.apache.chemistry; | 2,362,307 |
public boolean hasAllRequiredFields() {
Optional<EntryType> type = EntryTypes.getType(entry.getType(), this.mode);
if(type.isPresent()) {
return entry.allFieldsPresent(type.get().getRequiredFields(), database.orElse(null));
} else {
return true;
}
} | boolean function() { Optional<EntryType> type = EntryTypes.getType(entry.getType(), this.mode); if(type.isPresent()) { return entry.allFieldsPresent(type.get().getRequiredFields(), database.orElse(null)); } else { return true; } } | /**
* Returns true if this entry contains the fields it needs to be
* complete.
*/ | Returns true if this entry contains the fields it needs to be complete | hasAllRequiredFields | {
"repo_name": "mairdl/jabref",
"path": "src/main/java/net/sf/jabref/logic/TypedBibEntry.java",
"license": "mit",
"size": 3028
} | [
"java.util.Optional",
"net.sf.jabref.model.EntryTypes",
"net.sf.jabref.model.entry.EntryType"
] | import java.util.Optional; import net.sf.jabref.model.EntryTypes; import net.sf.jabref.model.entry.EntryType; | import java.util.*; import net.sf.jabref.model.*; import net.sf.jabref.model.entry.*; | [
"java.util",
"net.sf.jabref"
] | java.util; net.sf.jabref; | 955,144 |
@Path("admin-events")
@DELETE
public void clearAdminEvents() {
auth.init(RealmAuth.Resource.EVENTS).requireManage();
EventStoreProvider eventStore = session.getProvider(EventStoreProvider.class);
eventStore.clearAdmin(realm.getId());
} | @Path(STR) void function() { auth.init(RealmAuth.Resource.EVENTS).requireManage(); EventStoreProvider eventStore = session.getProvider(EventStoreProvider.class); eventStore.clearAdmin(realm.getId()); } | /**
* Delete all admin events
*
*/ | Delete all admin events | clearAdminEvents | {
"repo_name": "jean-merelis/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java",
"license": "apache-2.0",
"size": 26697
} | [
"javax.ws.rs.Path",
"org.keycloak.events.EventStoreProvider"
] | import javax.ws.rs.Path; import org.keycloak.events.EventStoreProvider; | import javax.ws.rs.*; import org.keycloak.events.*; | [
"javax.ws",
"org.keycloak.events"
] | javax.ws; org.keycloak.events; | 1,711,369 |
private LinkedHashMap<Integer, Coordinate> getCoordinate( int nStaz, SimpleFeatureCollection collection, String idField )
throws Exception {
LinkedHashMap<Integer, Coordinate> id2CoordinatesMcovarianceMatrix = new LinkedHashMap<Integer, Coordinate>();
FeatureIterator<SimpleFeature> itera... | LinkedHashMap<Integer, Coordinate> function( int nStaz, SimpleFeatureCollection collection, String idField ) throws Exception { LinkedHashMap<Integer, Coordinate> id2CoordinatesMcovarianceMatrix = new LinkedHashMap<Integer, Coordinate>(); FeatureIterator<SimpleFeature> iterator = collection.features(); Coordinate coord... | /**
* Extract the coordinate of a FeatureCollection in a HashMap with an ID as
* a key.
*
* @param nStaz the number of the stations
* @param collection is the collection of the considered points
* @param idField the field containing the id of the stations
* @return the coordinate of... | Extract the coordinate of a FeatureCollection in a HashMap with an ID as a key | getCoordinate | {
"repo_name": "TheHortonMachine/hortonmachine",
"path": "hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/kriging/OmsKrigingCheckMode.java",
"license": "gpl-3.0",
"size": 17230
} | [
"java.util.LinkedHashMap",
"org.geotools.data.simple.SimpleFeatureCollection",
"org.geotools.feature.FeatureIterator",
"org.locationtech.jts.geom.Coordinate",
"org.locationtech.jts.geom.Geometry",
"org.opengis.feature.simple.SimpleFeature"
] | import java.util.LinkedHashMap; import org.geotools.data.simple.SimpleFeatureCollection; import org.geotools.feature.FeatureIterator; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.Geometry; import org.opengis.feature.simple.SimpleFeature; | import java.util.*; import org.geotools.data.simple.*; import org.geotools.feature.*; import org.locationtech.jts.geom.*; import org.opengis.feature.simple.*; | [
"java.util",
"org.geotools.data",
"org.geotools.feature",
"org.locationtech.jts",
"org.opengis.feature"
] | java.util; org.geotools.data; org.geotools.feature; org.locationtech.jts; org.opengis.feature; | 909,276 |
Artifact create(PathFragment rootRelativePath, Root root);
} | Artifact create(PathFragment rootRelativePath, Root root); } | /**
* Create an artifact with the specified root-relative path under the specified root.
*/ | Create an artifact with the specified root-relative path under the specified root | create | {
"repo_name": "Asana/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java",
"license": "apache-2.0",
"size": 44821
} | [
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.actions.Root",
"com.google.devtools.build.lib.vfs.PathFragment"
] | import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.vfs.PathFragment; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,025,821 |
MarkedContentInfo addTextContentItem(PDFStructElem structElem) {
if (structElem == null) {
return ARTIFACT;
} else {
MarkedContentInfo mci = addToParentTree(structElem);
PDFDictionary contentItem = new PDFDictionary();
contentItem.put("Type", MCR);
... | MarkedContentInfo addTextContentItem(PDFStructElem structElem) { if (structElem == null) { return ARTIFACT; } else { MarkedContentInfo mci = addToParentTree(structElem); PDFDictionary contentItem = new PDFDictionary(); contentItem.put("Type", MCR); contentItem.put("Pg", this.currentPage); contentItem.put("MCID", mci.mc... | /**
* Adds a content item corresponding to text into the structure tree, if
* there is a structure element associated to it.
*
* @param structElem the parent structure element of the piece of text
* @return the necessary information for bracketing the content as a
* marked-content sequence... | Adds a content item corresponding to text into the structure tree, if there is a structure element associated to it | addTextContentItem | {
"repo_name": "chunlinyao/fop",
"path": "fop-core/src/main/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java",
"license": "apache-2.0",
"size": 7614
} | [
"org.apache.fop.pdf.PDFDictionary",
"org.apache.fop.pdf.PDFStructElem"
] | import org.apache.fop.pdf.PDFDictionary; import org.apache.fop.pdf.PDFStructElem; | import org.apache.fop.pdf.*; | [
"org.apache.fop"
] | org.apache.fop; | 882,630 |
@Test(dependsOnMethods = "addPage")
public void changeOrder() throws Exception {
final PageMgmtService pageMgmtService = getPageMgmtService();
JSONObject requestJSONObject = new JSONObject();
final JSONObject page = new JSONObject();
requestJSONObject.put(Page.PAGE, page);
... | @Test(dependsOnMethods = STR) void function() throws Exception { final PageMgmtService pageMgmtService = getPageMgmtService(); JSONObject requestJSONObject = new JSONObject(); final JSONObject page = new JSONObject(); requestJSONObject.put(Page.PAGE, page); page.put(Page.PAGE_CONTENT, STR); page.put(Page.PAGE_PERMALINK... | /**
* Change Order.
*
* @throws Exception exception
*/ | Change Order | changeOrder | {
"repo_name": "sshiting/solo",
"path": "src/test/java/org/b3log/solo/service/PageMgmtServiceTestCase.java",
"license": "apache-2.0",
"size": 6292
} | [
"org.b3log.solo.model.Page",
"org.json.JSONObject",
"org.testng.Assert",
"org.testng.annotations.Test"
] | import org.b3log.solo.model.Page; import org.json.JSONObject; import org.testng.Assert; import org.testng.annotations.Test; | import org.b3log.solo.model.*; import org.json.*; import org.testng.*; import org.testng.annotations.*; | [
"org.b3log.solo",
"org.json",
"org.testng",
"org.testng.annotations"
] | org.b3log.solo; org.json; org.testng; org.testng.annotations; | 960,665 |
boolean isLast() throws InvalidResultSetAccessException; | boolean isLast() throws InvalidResultSetAccessException; | /**
* Retrieves whether the cursor is on the last row of this RowSet.
* @return true if the cursor is after the last row, false otherwise
* @see java.sql.ResultSet#isLast()
*/ | Retrieves whether the cursor is on the last row of this RowSet | isLast | {
"repo_name": "ftomassetti/effectivejava",
"path": "test-resources/sample-codebases/spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java",
"license": "apache-2.0",
"size": 17476
} | [
"org.springframework.jdbc.InvalidResultSetAccessException"
] | import org.springframework.jdbc.InvalidResultSetAccessException; | import org.springframework.jdbc.*; | [
"org.springframework.jdbc"
] | org.springframework.jdbc; | 445,420 |
public DomainInner withContactBilling(Contact contactBilling) {
this.contactBilling = contactBilling;
return this;
} | DomainInner function(Contact contactBilling) { this.contactBilling = contactBilling; return this; } | /**
* Set billing contact.
*
* @param contactBilling the contactBilling value to set
* @return the DomainInner object itself.
*/ | Set billing contact | withContactBilling | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainInner.java",
"license": "mit",
"size": 14023
} | [
"com.microsoft.azure.management.appservice.v2018_02_01.Contact"
] | import com.microsoft.azure.management.appservice.v2018_02_01.Contact; | import com.microsoft.azure.management.appservice.v2018_02_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,791,974 |
public void waitDone() throws ResponseTimeoutException,
InvalidResponseException {
lock.lock();
try {
if (!isDoneResponse()) {
try {
condition.await(timeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
... | void function() throws ResponseTimeoutException, InvalidResponseException { lock.lock(); try { if (!isDoneResponse()) { try { condition.await(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (illegalResponseException != null) { throw illegalResponseException... | /**
* Wait until response received or timeout already reached.
*
* @throws ResponseTimeoutException if timeout reached.
* @throws InvalidResponseException if received invalid response.
*/ | Wait until response received or timeout already reached | waitDone | {
"repo_name": "opentelecoms-org/jsmpp",
"path": "jsmpp/src/main/java/org/jsmpp/extra/PendingResponse.java",
"license": "apache-2.0",
"size": 3356
} | [
"java.util.concurrent.TimeUnit",
"org.jsmpp.InvalidResponseException"
] | import java.util.concurrent.TimeUnit; import org.jsmpp.InvalidResponseException; | import java.util.concurrent.*; import org.jsmpp.*; | [
"java.util",
"org.jsmpp"
] | java.util; org.jsmpp; | 2,143,175 |
public List<URL> getInitScriptUrls()
{
try
{
// find all .sql scripts
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
Resource[] scriptResources = resolver.getResources( initScriptsRoot + "/*.sql" );
List<URL> scriptUrls = new ArrayList<URL>();
fo... | List<URL> function() { try { ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); Resource[] scriptResources = resolver.getResources( initScriptsRoot + STR ); List<URL> scriptUrls = new ArrayList<URL>(); for ( Resource scriptResource : scriptResources ) { scriptUrls.add( scriptResource.getURL()... | /**
* Returns the list of QuartzDesk database schema SQL init scripts.
*
* @return the list of SQL init scripts.
*/ | Returns the list of QuartzDesk database schema SQL init scripts | getInitScriptUrls | {
"repo_name": "quartzdesk/quartzdesk-executor",
"path": "quartzdesk-executor-dao/src/main/java/com/quartzdesk/executor/dao/schema/DatabaseSchemaManager.java",
"license": "mit",
"size": 12099
} | [
"java.util.ArrayList",
"java.util.List",
"org.springframework.core.io.Resource",
"org.springframework.core.io.support.PathMatchingResourcePatternResolver",
"org.springframework.core.io.support.ResourcePatternResolver"
] | import java.util.ArrayList; import java.util.List; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.ResourcePatternResolver; | import java.util.*; import org.springframework.core.io.*; import org.springframework.core.io.support.*; | [
"java.util",
"org.springframework.core"
] | java.util; org.springframework.core; | 1,987,189 |
public Map<String, byte[]> getMetadata() {
return metadata;
} | Map<String, byte[]> function() { return metadata; } | /**
* Custom metadata to apply to this object.
*/ | Custom metadata to apply to this object | getMetadata | {
"repo_name": "peltekster/bigdata-interop-leanplum",
"path": "gcsio/src/main/java/com/google/cloud/hadoop/gcsio/CreateObjectOptions.java",
"license": "apache-2.0",
"size": 3116
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 444,172 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.