method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
private boolean invokeCall(RTMPConnection conn, IServiceCall call, Object service) {
final IScope scope = conn.getScope();
final IContext context = scope.getContext();
if (isTrace) {
log.trace("Scope: {} context: {} service: {}", scope, context, service);
}
return context.getServiceInvoker().invoke(call, service);
} | boolean function(RTMPConnection conn, IServiceCall call, Object service) { final IScope scope = conn.getScope(); final IContext context = scope.getContext(); if (isTrace) { log.trace(STR, scope, context, service); } return context.getServiceInvoker().invoke(call, service); } | /**
* Remoting call invocation handler.
*
* @param conn
* RTMP connection
* @param call
* Service call
* @param service
* Server-side service object
* @return true if the call was performed, otherwise false
*/ | Remoting call invocation handler | invokeCall | {
"repo_name": "Red5/red5-server-common",
"path": "src/main/java/org/red5/server/net/rtmp/RTMPHandler.java",
"license": "apache-2.0",
"size": 31024
} | [
"org.red5.server.api.IContext",
"org.red5.server.api.scope.IScope",
"org.red5.server.api.service.IServiceCall"
] | import org.red5.server.api.IContext; import org.red5.server.api.scope.IScope; import org.red5.server.api.service.IServiceCall; | import org.red5.server.api.*; import org.red5.server.api.scope.*; import org.red5.server.api.service.*; | [
"org.red5.server"
] | org.red5.server; | 232,680 |
@Override
public final boolean addMatches(SymbolTable entries, List<SymbolTableEntry> matches, SearchContext l) {
boolean result = entries.containsKey(mySearchString);
if (result) {
SymbolTableEntry e = entries.get(mySearchString);
// Parameters of imported modules or facility instantiations are not
// exported and therefore should not be considered for results
if (l.equals(SearchContext.SOURCE_MODULE) || !(e instanceof ProgramParameterEntry)) {
matches.add(entries.get(mySearchString));
}
}
return myStopAfterFirstFlag && result;
} | final boolean function(SymbolTable entries, List<SymbolTableEntry> matches, SearchContext l) { boolean result = entries.containsKey(mySearchString); if (result) { SymbolTableEntry e = entries.get(mySearchString); if (l.equals(SearchContext.SOURCE_MODULE) !(e instanceof ProgramParameterEntry)) { matches.add(entries.get(mySearchString)); } } return myStopAfterFirstFlag && result; } | /**
* <p>
* Refines {@link TableSearcher#addMatches(SymbolTable, List, SearchContext)}} to guarantee that it will not throw a
* {@link DuplicateSymbolException}. Otherwise, behaves identically.
* </p>
*
* @param entries
* The set of symbol table entries to consider.
* @param matches
* A non-<code>null</code> accumulator of matches.
* @param l
* The context from which <code>entries</code> was drawn.
*
* @return <code>true</code> if <code>matches</code> now represents a final list of search results; i.e., no further
* symbol table entries should be considered. <code>false</code> indicates that the search should continue,
* provided there are additional un-searched scopes.
*/ | Refines <code>TableSearcher#addMatches(SymbolTable, List, SearchContext)</code>} to guarantee that it will not throw a <code>DuplicateSymbolException</code>. Otherwise, behaves identically. | addMatches | {
"repo_name": "ClemsonRSRG/RESOLVE",
"path": "src/java/edu/clemson/rsrg/typeandpopulate/query/searcher/NameSearcher.java",
"license": "bsd-3-clause",
"size": 4053
} | [
"edu.clemson.rsrg.typeandpopulate.entry.ProgramParameterEntry",
"edu.clemson.rsrg.typeandpopulate.entry.SymbolTableEntry",
"edu.clemson.rsrg.typeandpopulate.symboltables.SymbolTable",
"java.util.List"
] | import edu.clemson.rsrg.typeandpopulate.entry.ProgramParameterEntry; import edu.clemson.rsrg.typeandpopulate.entry.SymbolTableEntry; import edu.clemson.rsrg.typeandpopulate.symboltables.SymbolTable; import java.util.List; | import edu.clemson.rsrg.typeandpopulate.entry.*; import edu.clemson.rsrg.typeandpopulate.symboltables.*; import java.util.*; | [
"edu.clemson.rsrg",
"java.util"
] | edu.clemson.rsrg; java.util; | 1,630,591 |
public void setStartTime(Date startTime) {
this.startTime = startTime;
} | void function(Date startTime) { this.startTime = startTime; } | /**
* Sets the startTime attribute value.
*
* @param startTime The startTime to set.
*/ | Sets the startTime attribute value | setStartTime | {
"repo_name": "ua-eas/kfs-devops-automation-fork",
"path": "kfs-core/src/main/java/org/kuali/kfs/sys/batch/SimpleTriggerDescriptor.java",
"license": "agpl-3.0",
"size": 2710
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 959,546 |
public StoragePoolIsoMapDAO getStoragePoolIsoMapDao() {
return getDao(StoragePoolIsoMapDAO.class);
} | StoragePoolIsoMapDAO function() { return getDao(StoragePoolIsoMapDAO.class); } | /**
* Retrieves the singleton instance of {@link StoragePoolIsoMapDAO}.
*
* @return the dao
*/ | Retrieves the singleton instance of <code>StoragePoolIsoMapDAO</code> | getStoragePoolIsoMapDao | {
"repo_name": "jtux270/translate",
"path": "ovirt/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacade.java",
"license": "gpl-3.0",
"size": 35845
} | [
"org.ovirt.engine.core.dao.StoragePoolIsoMapDAO"
] | import org.ovirt.engine.core.dao.StoragePoolIsoMapDAO; | import org.ovirt.engine.core.dao.*; | [
"org.ovirt.engine"
] | org.ovirt.engine; | 1,903 |
public static Message checkUniversityFiscalPeriodCode(LaborTransaction transaction) {
String fiscalPeriodCode = transaction.getUniversityFiscalPeriodCode();
if (StringUtils.isBlank(fiscalPeriodCode)) {
return MessageBuilder.buildMessage(KFSKeyConstants.ERROR_ACCOUNTING_PERIOD_NOT_FOUND, fiscalPeriodCode, Message.TYPE_FATAL);
}
return null;
} | static Message function(LaborTransaction transaction) { String fiscalPeriodCode = transaction.getUniversityFiscalPeriodCode(); if (StringUtils.isBlank(fiscalPeriodCode)) { return MessageBuilder.buildMessage(KFSKeyConstants.ERROR_ACCOUNTING_PERIOD_NOT_FOUND, fiscalPeriodCode, Message.TYPE_FATAL); } return null; } | /**
* Checks if the given transaction contains university fiscal period code
*
* @param transaction the given transaction
* @return null if the university fiscal period code is valid; otherwise, return error message
*/ | Checks if the given transaction contains university fiscal period code | checkUniversityFiscalPeriodCode | {
"repo_name": "ua-eas/kfs-devops-automation-fork",
"path": "kfs-ld/src/main/java/org/kuali/kfs/module/ld/document/validation/impl/TransactionFieldValidator.java",
"license": "agpl-3.0",
"size": 21303
} | [
"org.apache.commons.lang.StringUtils",
"org.kuali.kfs.module.ld.businessobject.LaborTransaction",
"org.kuali.kfs.sys.KFSKeyConstants",
"org.kuali.kfs.sys.Message",
"org.kuali.kfs.sys.MessageBuilder"
] | import org.apache.commons.lang.StringUtils; import org.kuali.kfs.module.ld.businessobject.LaborTransaction; import org.kuali.kfs.sys.KFSKeyConstants; import org.kuali.kfs.sys.Message; import org.kuali.kfs.sys.MessageBuilder; | import org.apache.commons.lang.*; import org.kuali.kfs.module.ld.businessobject.*; import org.kuali.kfs.sys.*; | [
"org.apache.commons",
"org.kuali.kfs"
] | org.apache.commons; org.kuali.kfs; | 511,079 |
public void testRemoveAll() {
for (int i = 1; i < SIZE; ++i) {
NavigableSet q = populatedSet(SIZE);
NavigableSet p = populatedSet(i);
assertTrue(q.removeAll(p));
assertEquals(SIZE - i, q.size());
for (int j = 0; j < i; ++j) {
Integer x = (Integer)(p.pollFirst());
assertFalse(q.contains(x));
}
}
} | void function() { for (int i = 1; i < SIZE; ++i) { NavigableSet q = populatedSet(SIZE); NavigableSet p = populatedSet(i); assertTrue(q.removeAll(p)); assertEquals(SIZE - i, q.size()); for (int j = 0; j < i; ++j) { Integer x = (Integer)(p.pollFirst()); assertFalse(q.contains(x)); } } } | /**
* removeAll(c) removes only those elements of c and reports true if changed
*/ | removeAll(c) removes only those elements of c and reports true if changed | testRemoveAll | {
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/libcore/jsr166-tests/src/test/java/jsr166/TreeSubSetTest.java",
"license": "apache-2.0",
"size": 31113
} | [
"java.util.NavigableSet"
] | import java.util.NavigableSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,187,901 |
public String getICalFormat(){
String result = "RRULE:FREQ=";
result.concat(this.freq);
if (count!=0)
result.concat(";COUNT="+String.valueOf(count));
if (until!=null)
result.concat(";UNTIL="+DateUtils.dateToStringCalendarDate(until, "yyyyMMdd'T'HHmmss'Z'"));
if (interval!=0)
result.concat(";INTERVAL="+String.valueOf(count));
if (bySeconds!=null){
result.concat(";BYSECOND=");
result.concat(bySeconds[0]);
if (bySeconds.length>1){
for (int i=0; i<bySeconds.length; i++)
result.concat(","+bySeconds[i]);
}
}
if (byMinute!=null){
result.concat(";BYMINUTE=");
result.concat(byMinute[0]);
if (byMinute.length>1){
for (int i=0; i<byMinute.length; i++)
result.concat(","+byMinute[i]);
}
}
if (byHour!=null){
result.concat(";BYHOUR=");
result.concat(byHour[0]);
if (byHour.length>1){
for (int i=0; i<byHour.length; i++)
result.concat(","+byHour[i]);
}
}
if (byDay!=null){
result.concat(";BYDAY=");
result.concat(byDay[0]);
if (byDay.length>1){
for (int i=0; i<byDay.length; i++)
result.concat(","+byDay[i]);
}
}
if (byMonthDay!=null){
result.concat(";BYMONTHDAY=");
result.concat(byMonthDay[0]);
if (byMonthDay.length>1){
for (int i=0; i<byMonthDay.length; i++)
result.concat(","+byMonthDay[i]);
}
}
if (byYearDay!=null){
result.concat(";BYYEARDAY=");
result.concat(byYearDay[0]);
if (byYearDay.length>1){
for (int i=0; i<byYearDay.length; i++)
result.concat(","+byYearDay[i]);
}
}
if (byWeekNo!=null){
result.concat(";BYWEEKNO=");
result.concat(byWeekNo[0]);
if (byWeekNo.length>1){
for (int i=0; i<byWeekNo.length; i++)
result.concat(","+byWeekNo[i]);
}
}
if (byMonth!=null){
result.concat(";BYMONTH=");
result.concat(byMonth[0]);
if (byMonth.length>1){
for (int i=0; i<byMonth.length; i++)
result.concat(","+byMonth[i]);
}
}
if (bySetPos!=null){
result.concat(";BYSETPOS=");
result.concat(bySetPos[0]);
if (bySetPos.length>1){
for (int i=0; i<bySetPos.length; i++)
result.concat(","+bySetPos[i]);
}
}
if (wkst!=null)
result.concat(";WKST="+wkst);
result.concat("\n");
return result;
}
| String function(){ String result = STR; result.concat(this.freq); if (count!=0) result.concat(STR+String.valueOf(count)); if (until!=null) result.concat(STR+DateUtils.dateToStringCalendarDate(until, STR)); if (interval!=0) result.concat(STR+String.valueOf(count)); if (bySeconds!=null){ result.concat(STR); result.concat(bySeconds[0]); if (bySeconds.length>1){ for (int i=0; i<bySeconds.length; i++) result.concat(","+bySeconds[i]); } } if (byMinute!=null){ result.concat(STR); result.concat(byMinute[0]); if (byMinute.length>1){ for (int i=0; i<byMinute.length; i++) result.concat(","+byMinute[i]); } } if (byHour!=null){ result.concat(STR); result.concat(byHour[0]); if (byHour.length>1){ for (int i=0; i<byHour.length; i++) result.concat(","+byHour[i]); } } if (byDay!=null){ result.concat(STR); result.concat(byDay[0]); if (byDay.length>1){ for (int i=0; i<byDay.length; i++) result.concat(","+byDay[i]); } } if (byMonthDay!=null){ result.concat(STR); result.concat(byMonthDay[0]); if (byMonthDay.length>1){ for (int i=0; i<byMonthDay.length; i++) result.concat(","+byMonthDay[i]); } } if (byYearDay!=null){ result.concat(STR); result.concat(byYearDay[0]); if (byYearDay.length>1){ for (int i=0; i<byYearDay.length; i++) result.concat(","+byYearDay[i]); } } if (byWeekNo!=null){ result.concat(STR); result.concat(byWeekNo[0]); if (byWeekNo.length>1){ for (int i=0; i<byWeekNo.length; i++) result.concat(","+byWeekNo[i]); } } if (byMonth!=null){ result.concat(STR); result.concat(byMonth[0]); if (byMonth.length>1){ for (int i=0; i<byMonth.length; i++) result.concat(","+byMonth[i]); } } if (bySetPos!=null){ result.concat(STR); result.concat(bySetPos[0]); if (bySetPos.length>1){ for (int i=0; i<bySetPos.length; i++) result.concat(","+bySetPos[i]); } } if (wkst!=null) result.concat(STR+wkst); result.concat("\n"); return result; } | /**
* Writes the Rule object as String with the rfc2445 ietf format
* for the RRULE label in ICal spec format
* @return result String with rfc2445 format
*/ | Writes the Rule object as String with the rfc2445 ietf format for the RRULE label in ICal spec format | getICalFormat | {
"repo_name": "dcheng/PhoneGap-Calendar-Plugin",
"path": "phoneGapCalendarAPI/CalendarLib/src/main/java/com/phonegap/calendar/android/adapters/Rule.java",
"license": "apache-2.0",
"size": 11212
} | [
"com.phonegap.calendar.android.utils.DateUtils"
] | import com.phonegap.calendar.android.utils.DateUtils; | import com.phonegap.calendar.android.utils.*; | [
"com.phonegap.calendar"
] | com.phonegap.calendar; | 260,343 |
public Adapter createEObjectAdapter() {
return null;
} | Adapter function() { return null; } | /**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
* @return the new adapter.
* @generated
*/ | Creates a new adapter for the default case. This default implementation returns null. | createEObjectAdapter | {
"repo_name": "gaborbsd/ProtoKit2",
"path": "hu.bme.aut.protokit.meta/src/hu/bme/aut/protokit/model/ModelAdapterFactory.java",
"license": "bsd-2-clause",
"size": 10469
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 479,047 |
private void buildSpecialLabel(LimeQuestion question, Builder builder, String specialLabel) {
for(Attribute attr : question.getImplicitLabel().get(specialLabel).toMagmaAttributes(true)) {
builder.addAttribute(attr);
}
} | void function(LimeQuestion question, Builder builder, String specialLabel) { for(Attribute attr : question.getImplicitLabel().get(specialLabel).toMagmaAttributes(true)) { builder.addAttribute(attr); } } | /**
* Special label are "other" or "comment"
*
* @param question
* @param builder
* @param specialLabel
*/ | Special label are "other" or "comment" | buildSpecialLabel | {
"repo_name": "apruden/magma",
"path": "magma-datasource-limesurvey/src/main/java/org/obiba/magma/datasource/limesurvey/LimesurveyValueTable.java",
"license": "gpl-3.0",
"size": 20407
} | [
"org.obiba.magma.Attribute",
"org.obiba.magma.Variable"
] | import org.obiba.magma.Attribute; import org.obiba.magma.Variable; | import org.obiba.magma.*; | [
"org.obiba.magma"
] | org.obiba.magma; | 910,251 |
protected void sanityCheckRight(byte[] right, Cell cell) throws IOException {
if (!Arrays.equals(StripeStoreFileManager.OPEN_KEY, right)
&& comparator.compareRows(cell, right, 0, right.length) >= 0) {
String error =
"The last row is higher or equal than the right boundary of [" + Bytes.toString(right)
+ "]: ["
+ Bytes.toString(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()) + "]";
LOG.error(error);
throw new IOException(error);
}
}
public static class BoundaryMultiWriter extends StripeMultiFileWriter {
private StoreFileWriter currentWriter;
private byte[] currentWriterEndKey;
private Cell lastCell;
private long cellsInCurrentWriter = 0;
private int majorRangeFromIndex = -1, majorRangeToIndex = -1;
private boolean hasAnyWriter = false;
public BoundaryMultiWriter(CellComparator comparator, List<byte[]> targetBoundaries,
byte[] majorRangeFrom, byte[] majorRangeTo) throws IOException {
super(comparator);
this.boundaries = targetBoundaries;
this.existingWriters = new ArrayList<>(this.boundaries.size() - 1);
// "major" range (range for which all files are included) boundaries, if any,
// must match some target boundaries, let's find them.
assert (majorRangeFrom == null) == (majorRangeTo == null);
if (majorRangeFrom != null) {
majorRangeFromIndex =
Arrays.equals(majorRangeFrom, StripeStoreFileManager.OPEN_KEY) ? 0 : Collections
.binarySearch(boundaries, majorRangeFrom, Bytes.BYTES_COMPARATOR);
majorRangeToIndex =
Arrays.equals(majorRangeTo, StripeStoreFileManager.OPEN_KEY) ? boundaries.size()
: Collections.binarySearch(boundaries, majorRangeTo, Bytes.BYTES_COMPARATOR);
if (this.majorRangeFromIndex < 0 || this.majorRangeToIndex < 0) {
throw new IOException("Major range does not match writer boundaries: ["
+ Bytes.toString(majorRangeFrom) + "] [" + Bytes.toString(majorRangeTo) + "]; from "
+ majorRangeFromIndex + " to " + majorRangeToIndex);
}
}
} | void function(byte[] right, Cell cell) throws IOException { if (!Arrays.equals(StripeStoreFileManager.OPEN_KEY, right) && comparator.compareRows(cell, right, 0, right.length) >= 0) { String error = STR + Bytes.toString(right) + STR + Bytes.toString(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()) + "]"; LOG.error(error); throw new IOException(error); } } public static class BoundaryMultiWriter extends StripeMultiFileWriter { private StoreFileWriter currentWriter; private byte[] currentWriterEndKey; private Cell lastCell; private long cellsInCurrentWriter = 0; private int majorRangeFromIndex = -1, majorRangeToIndex = -1; private boolean hasAnyWriter = false; public BoundaryMultiWriter(CellComparator comparator, List<byte[]> targetBoundaries, byte[] majorRangeFrom, byte[] majorRangeTo) throws IOException { super(comparator); this.boundaries = targetBoundaries; this.existingWriters = new ArrayList<>(this.boundaries.size() - 1); assert (majorRangeFrom == null) == (majorRangeTo == null); if (majorRangeFrom != null) { majorRangeFromIndex = Arrays.equals(majorRangeFrom, StripeStoreFileManager.OPEN_KEY) ? 0 : Collections .binarySearch(boundaries, majorRangeFrom, Bytes.BYTES_COMPARATOR); majorRangeToIndex = Arrays.equals(majorRangeTo, StripeStoreFileManager.OPEN_KEY) ? boundaries.size() : Collections.binarySearch(boundaries, majorRangeTo, Bytes.BYTES_COMPARATOR); if (this.majorRangeFromIndex < 0 this.majorRangeToIndex < 0) { throw new IOException(STR + Bytes.toString(majorRangeFrom) + STR + Bytes.toString(majorRangeTo) + STR + majorRangeFromIndex + STR + majorRangeToIndex); } } } | /**
* Subclasses can call this method to make sure the last KV is within multi-writer range.
* @param right The right boundary of the writer.
*/ | Subclasses can call this method to make sure the last KV is within multi-writer range | sanityCheckRight | {
"repo_name": "ultratendency/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeMultiFileWriter.java",
"license": "apache-2.0",
"size": 15468
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.Collections",
"java.util.List",
"org.apache.hadoop.hbase.Cell",
"org.apache.hadoop.hbase.CellComparator",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.util.Bytes; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 823,593 |
public void addBindings(Map bindings) {
log.info("Adding bindings {}", bindings);
getBindings().putAll(bindings);
} | void function(Map bindings) { log.info(STR, bindings); getBindings().putAll(bindings); } | /**
* adds additional bindings (global variables to use in child pipes expressions)
* @param bindings
*/ | adds additional bindings (global variables to use in child pipes expressions) | addBindings | {
"repo_name": "Nimco/sling",
"path": "contrib/extensions/sling-pipes/src/main/java/org/apache/sling/pipes/PipeBindings.java",
"license": "apache-2.0",
"size": 8902
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,843,387 |
Objects.requireNonNull(l);
Objects.requireNonNull(r);
if (l.length != 9)
throw new IllegalArgumentException("l isn't matrix 3 by 3");
if (r.length != 9)
throw new IllegalArgumentException("r isn't matrix 3 by 3");
// calculate result of the matrix multiplication
double[] res = new double[9];
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) {
double a = 0;
for (int k = 0; k < 3; k++)
a += l[i * 3 + k] * r[k * 3 + j];
res[i * 3 + j] = a;
}
return res;
} | Objects.requireNonNull(l); Objects.requireNonNull(r); if (l.length != 9) throw new IllegalArgumentException(STR); if (r.length != 9) throw new IllegalArgumentException(STR); double[] res = new double[9]; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) { double a = 0; for (int k = 0; k < 3; k++) a += l[i * 3 + k] * r[k * 3 + j]; res[i * 3 + j] = a; } return res; } | /**
* Calculates the matrix multiplication.
* <p>
* {@code res} = {@code l} * {code r}
*
* @param l left argument
* @param r right argument
* @return result of the multiplication
* @throws NullPointerException if l or r is null
*/ | Calculates the matrix multiplication. res = l * {code r} | matrixMul | {
"repo_name": "vznncv/ComplexFractal",
"path": "src/local/complexfractal/util/Point2DTransformer.java",
"license": "mit",
"size": 6908
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 672,869 |
public RetryHistory withError(ManagementError error) {
this.error = error;
return this;
} | RetryHistory function(ManagementError error) { this.error = error; return this; } | /**
* Set the error property: Gets the error response.
*
* @param error the error value to set.
* @return the RetryHistory object itself.
*/ | Set the error property: Gets the error response | withError | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/logic/azure-resourcemanager-logic/src/main/java/com/azure/resourcemanager/logic/models/RetryHistory.java",
"license": "mit",
"size": 4566
} | [
"com.azure.core.management.exception.ManagementError"
] | import com.azure.core.management.exception.ManagementError; | import com.azure.core.management.exception.*; | [
"com.azure.core"
] | com.azure.core; | 1,167,082 |
public String getDomain() {
return domain;
}
}
public static final class SearchCompleteEvent {
private final Map<GroupKey, Integer> groupMap;
private final List<AbstractFilter> searchFilters;
private final DiscoveryAttributes.AttributeType groupingAttribute;
private final Group.GroupSortingAlgorithm groupSort;
private final ResultsSorter.SortingMethod sortMethod;
public SearchCompleteEvent(Map<GroupKey, Integer> groupMap, List<AbstractFilter> searchfilters,
DiscoveryAttributes.AttributeType groupingAttribute, Group.GroupSortingAlgorithm groupSort,
ResultsSorter.SortingMethod sortMethod) {
this.groupMap = groupMap;
this.searchFilters = searchfilters;
this.groupingAttribute = groupingAttribute;
this.groupSort = groupSort;
this.sortMethod = sortMethod;
} | String function() { return domain; } } public static final class SearchCompleteEvent { private final Map<GroupKey, Integer> groupMap; private final List<AbstractFilter> searchFilters; private final DiscoveryAttributes.AttributeType groupingAttribute; private final Group.GroupSortingAlgorithm groupSort; private final ResultsSorter.SortingMethod sortMethod; public SearchCompleteEvent(Map<GroupKey, Integer> groupMap, List<AbstractFilter> searchfilters, DiscoveryAttributes.AttributeType groupingAttribute, Group.GroupSortingAlgorithm groupSort, ResultsSorter.SortingMethod sortMethod) { this.groupMap = groupMap; this.searchFilters = searchfilters; this.groupingAttribute = groupingAttribute; this.groupSort = groupSort; this.sortMethod = sortMethod; } | /**
* Get the domain for the details area.
*
* @return The the domain for the details area.
*/ | Get the domain for the details area | getDomain | {
"repo_name": "eugene7646/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/discovery/search/DiscoveryEventUtils.java",
"license": "apache-2.0",
"size": 16041
} | [
"java.util.List",
"java.util.Map",
"org.sleuthkit.autopsy.discovery.search.DiscoveryKeyUtils"
] | import java.util.List; import java.util.Map; import org.sleuthkit.autopsy.discovery.search.DiscoveryKeyUtils; | import java.util.*; import org.sleuthkit.autopsy.discovery.search.*; | [
"java.util",
"org.sleuthkit.autopsy"
] | java.util; org.sleuthkit.autopsy; | 12,135 |
@Test
public void getPrice() {
Assert.assertEquals(1.00, this.transactionTest.getPrice(), 0.01);
} | void function() { Assert.assertEquals(1.00, this.transactionTest.getPrice(), 0.01); } | /**
* Tests to see if the price of the event involved in the transaction is accessible
*/ | Tests to see if the price of the event involved in the transaction is accessible | getPrice | {
"repo_name": "dataBaseError/FirstVu",
"path": "back_end/src/testSuite/EventTransactionTest.java",
"license": "mit",
"size": 1771
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 817,253 |
@Message(id = 195, value = "EjbJarConfiguration not found as an attachment in deployment unit: %s")
DeploymentUnitProcessingException ejbJarConfigNotFound(DeploymentUnit deploymentUnit); | @Message(id = 195, value = STR) DeploymentUnitProcessingException ejbJarConfigNotFound(DeploymentUnit deploymentUnit); | /**
* Creates an exception indicating that the EjbJarConfiguration was not found as an attachment in deployment unit
*
* @return a {@link DeploymentUnitProcessingException} for the error.
*/ | Creates an exception indicating that the EjbJarConfiguration was not found as an attachment in deployment unit | ejbJarConfigNotFound | {
"repo_name": "xasx/wildfly",
"path": "ejb3/src/main/java/org/jboss/as/ejb3/logging/EjbLogger.java",
"license": "lgpl-2.1",
"size": 147231
} | [
"org.jboss.as.server.deployment.DeploymentUnit",
"org.jboss.as.server.deployment.DeploymentUnitProcessingException",
"org.jboss.logging.annotations.Message"
] | import org.jboss.as.server.deployment.DeploymentUnit; import org.jboss.as.server.deployment.DeploymentUnitProcessingException; import org.jboss.logging.annotations.Message; | import org.jboss.as.server.deployment.*; import org.jboss.logging.annotations.*; | [
"org.jboss.as",
"org.jboss.logging"
] | org.jboss.as; org.jboss.logging; | 49,777 |
public static byte[] marshal(Marshaller marsh, Object obj) throws IgniteCheckedException {
assert marsh != null;
try {
return marsh.marshal(obj);
}
catch (IgniteCheckedException e) {
throw e;
}
catch (Exception e) {
throw new IgniteCheckedException(e);
}
} | static byte[] function(Marshaller marsh, Object obj) throws IgniteCheckedException { assert marsh != null; try { return marsh.marshal(obj); } catch (IgniteCheckedException e) { throw e; } catch (Exception e) { throw new IgniteCheckedException(e); } } | /**
* Marshals object to byte array.
* <p/>
* This method wraps marshaller invocations and guaranty throws {@link IgniteCheckedException} in fail case.
*
* @param marsh Marshaller.
* @param obj Object to marshal.
* @return Byte array.
* @throws IgniteCheckedException If marshalling failed.
*/ | Marshals object to byte array. This method wraps marshaller invocations and guaranty throws <code>IgniteCheckedException</code> in fail case | marshal | {
"repo_name": "mcherkasov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 316648
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.marshaller.Marshaller"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.marshaller.Marshaller; | import org.apache.ignite.*; import org.apache.ignite.marshaller.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,321,866 |
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(MappedStructure.class)) {
case MapperPackage.MAPPED_STRUCTURE__NAME:
case MapperPackage.MAPPED_STRUCTURE__UML_MODEL_URL:
case MapperPackage.MAPPED_STRUCTURE__STRUCTURE_TYPE:
case MapperPackage.MAPPED_STRUCTURE__STRUCTURE_URL:
case MapperPackage.MAPPED_STRUCTURE__TOP_ELEMENT_TYPE:
case MapperPackage.MAPPED_STRUCTURE__TOP_ELEMENT_NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case MapperPackage.MAPPED_STRUCTURE__ROOT_ELEMENT:
case MapperPackage.MAPPED_STRUCTURE__MAPPING_PARAMETERS:
case MapperPackage.MAPPED_STRUCTURE__PARAMETER_CLASSES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
| void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(MappedStructure.class)) { case MapperPackage.MAPPED_STRUCTURE__NAME: case MapperPackage.MAPPED_STRUCTURE__UML_MODEL_URL: case MapperPackage.MAPPED_STRUCTURE__STRUCTURE_TYPE: case MapperPackage.MAPPED_STRUCTURE__STRUCTURE_URL: case MapperPackage.MAPPED_STRUCTURE__TOP_ELEMENT_TYPE: case MapperPackage.MAPPED_STRUCTURE__TOP_ELEMENT_NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case MapperPackage.MAPPED_STRUCTURE__ROOT_ELEMENT: case MapperPackage.MAPPED_STRUCTURE__MAPPING_PARAMETERS: case MapperPackage.MAPPED_STRUCTURE__PARAMETER_CLASSES: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } | /**
* 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": "openmapsoftware/mappingtools",
"path": "openmap-mapper-edit/src/main/java/com/openMap1/mapper/provider/MappedStructureItemProvider.java",
"license": "epl-1.0",
"size": 12696
} | [
"org.eclipse.emf.common.notify.Notification",
"org.eclipse.emf.edit.provider.ViewerNotification"
] | import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; | import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 770,583 |
public void writeDataToXML(Platform platform, Database model, List tableList, String outPath)
{
Table[] tables = model.getTables();
for (int idx = 0; idx < tables.length; idx++)
{
Table table = tables[idx];
if(tableList.contains("*") || tableList.contains(table.getName())){
Iterator beans = getDataForTable(platform, model, table);
writeNewRows(beans,table,null,outPath);
}
}
}
| void function(Platform platform, Database model, List tableList, String outPath) { Table[] tables = model.getTables(); for (int idx = 0; idx < tables.length; idx++) { Table table = tables[idx]; if(tableList.contains("*") tableList.contains(table.getName())){ Iterator beans = getDataForTable(platform, model, table); writeNewRows(beans,table,null,outPath); } } } | /**
* writes all data out. one file for each table.
*
* @param platform The platform; needs to be connected to a live database
* @param model The model for which to retrieve and write the data
* @param writer The data writer
* @param reader The data reader
*/ | writes all data out. one file for each table | writeDataToXML | {
"repo_name": "9ci/ddlutils",
"path": "src/main/java/org/apache/ddlutils/io/DatabaseDataDiffIO.java",
"license": "apache-2.0",
"size": 6936
} | [
"java.util.Iterator",
"java.util.List",
"org.apache.ddlutils.Platform",
"org.apache.ddlutils.model.Database",
"org.apache.ddlutils.model.Table"
] | import java.util.Iterator; import java.util.List; import org.apache.ddlutils.Platform; import org.apache.ddlutils.model.Database; import org.apache.ddlutils.model.Table; | import java.util.*; import org.apache.ddlutils.*; import org.apache.ddlutils.model.*; | [
"java.util",
"org.apache.ddlutils"
] | java.util; org.apache.ddlutils; | 2,273,794 |
@Override
public void showMessage(String message) {
((BaseActivity) getActivity()).showToast(message);
}
/**
* Updates {@code recentTransactionsListAdapter} with {@code recentTransactionList} fetched from
* server
*
* @param recentTransactionList List of {@link Transaction} | void function(String message) { ((BaseActivity) getActivity()).showToast(message); } /** * Updates {@code recentTransactionsListAdapter} with {@code recentTransactionList} fetched from * server * * @param recentTransactionList List of {@link Transaction} | /**
* Shows a Toast
*/ | Shows a Toast | showMessage | {
"repo_name": "openMF/self-service-app",
"path": "app/src/main/java/org/mifos/mobile/ui/fragments/RecentTransactionsFragment.java",
"license": "mpl-2.0",
"size": 8348
} | [
"java.util.List",
"org.mifos.mobile.models.Transaction",
"org.mifos.mobile.ui.activities.base.BaseActivity"
] | import java.util.List; import org.mifos.mobile.models.Transaction; import org.mifos.mobile.ui.activities.base.BaseActivity; | import java.util.*; import org.mifos.mobile.models.*; import org.mifos.mobile.ui.activities.base.*; | [
"java.util",
"org.mifos.mobile"
] | java.util; org.mifos.mobile; | 2,871,847 |
public static byte[] buildAddUsingAllNotes ()
{
PacketBuilder sendbyte = new PacketBuilder( 2 );
sendbyte.setCommand( CMD20.REQ_UsingNoteNotify );
sendbyte.write( ByteConverter.shortTobyte( (short) 0xffff ) );
NLog.d( "[ProtocolParser20] REQ buildAddUsingAllNotes" + "Packet:" + sendbyte.showPacket() );
return sendbyte.getPacket();
} | static byte[] function () { PacketBuilder sendbyte = new PacketBuilder( 2 ); sendbyte.setCommand( CMD20.REQ_UsingNoteNotify ); sendbyte.write( ByteConverter.shortTobyte( (short) 0xffff ) ); NLog.d( STR + STR + sendbyte.showPacket() ); return sendbyte.getPacket(); } | /**
* Build add using all notes byte [ ].
*
* @return the byte [ ]
*/ | Build add using all notes byte [ ] | buildAddUsingAllNotes | {
"repo_name": "NeoSmartpen/AndroidSDK2.0",
"path": "NASDK2.0_Studio/app/src/main/java/kr/neolab/sdk/pen/bluetooth/lib/ProtocolParser20.java",
"license": "gpl-3.0",
"size": 53433
} | [
"kr.neolab.sdk.util.NLog"
] | import kr.neolab.sdk.util.NLog; | import kr.neolab.sdk.util.*; | [
"kr.neolab.sdk"
] | kr.neolab.sdk; | 2,900,287 |
public final Record readRecord(int index) throws IOException {
return readRecord(index, null);
} | final Record function(int index) throws IOException { return readRecord(index, null); } | /**
* Reads the record with the given zero-based index from the product file.
* <p/>
* <p>Note that the method creates a new record instance each time it is called.
*
* @param index the record index, must be <code>>=0</code> and <code><getDSD().getDatasetOffset()</code>
* @throws java.io.IOException if an I/O error occurs
* @throws java.lang.IndexOutOfBoundsException
* if the index is out of bounds
* @see #readRecord(int, org.esa.beam.dataio.envisat.Record)
*/ | Reads the record with the given zero-based index from the product file. Note that the method creates a new record instance each time it is called | readRecord | {
"repo_name": "lveci/nest",
"path": "beam/beam-envisat-reader/src/main/java/org/esa/beam/dataio/envisat/RecordReader.java",
"license": "gpl-3.0",
"size": 8285
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 440,512 |
@WebMethod
@Path("/disallowAllFunctionsForRole")
@Produces("text/plain")
@GET
public String disallowAllFunctionsForRole(
@WebParam(name = "sessionid", partName = "sessionid") @QueryParam("sessionid") String sessionid,
@WebParam(name = "authzgroupid", partName = "authzgroupid") @QueryParam("authzgroupid") String authzgroupid,
@WebParam(name = "roleid", partName = "roleid") @QueryParam("roleid") String roleid) {
Session session = establishSession(sessionid);
try {
AuthzGroup authzgroup = authzGroupService.getAuthzGroup(authzgroupid);
Role role = authzgroup.getRole(roleid);
role.disallowAll();
authzGroupService.save(authzgroup);
} catch (Exception e) {
LOG.error("WS disallowAllFunctionsForRole(): " + e.getClass().getName() + " : " + e.getMessage());
return e.getClass().getName() + " : " + e.getMessage();
}
return "success";
} | @Path(STR) @Produces(STR) String function( @WebParam(name = STR, partName = STR) @QueryParam(STR) String sessionid, @WebParam(name = STR, partName = STR) @QueryParam(STR) String authzgroupid, @WebParam(name = STR, partName = STR) @QueryParam(STR) String roleid) { Session session = establishSession(sessionid); try { AuthzGroup authzgroup = authzGroupService.getAuthzGroup(authzgroupid); Role role = authzgroup.getRole(roleid); role.disallowAll(); authzGroupService.save(authzgroup); } catch (Exception e) { LOG.error(STR + e.getClass().getName() + STR + e.getMessage()); return e.getClass().getName() + STR + e.getMessage(); } return STR; } | /**
* Remove all functions from a role in an authzgroup (realm)
*
* @param sessionid the id of a valid session
* @param authzgroupid the id of the authzgroup that the role is in
* @param roleid the id of the role to remove the functions from
* @return success or exception message
*/ | Remove all functions from a role in an authzgroup (realm) | disallowAllFunctionsForRole | {
"repo_name": "pushyamig/sakai",
"path": "webservices/cxf/src/java/org/sakaiproject/webservices/SakaiScript.java",
"license": "apache-2.0",
"size": 209455
} | [
"javax.jws.WebParam",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.QueryParam",
"org.sakaiproject.authz.api.AuthzGroup",
"org.sakaiproject.authz.api.Role",
"org.sakaiproject.tool.api.Session"
] | import javax.jws.WebParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import org.sakaiproject.authz.api.AuthzGroup; import org.sakaiproject.authz.api.Role; import org.sakaiproject.tool.api.Session; | import javax.jws.*; import javax.ws.rs.*; import org.sakaiproject.authz.api.*; import org.sakaiproject.tool.api.*; | [
"javax.jws",
"javax.ws",
"org.sakaiproject.authz",
"org.sakaiproject.tool"
] | javax.jws; javax.ws; org.sakaiproject.authz; org.sakaiproject.tool; | 1,446,562 |
private void merge(int middle) {
if (array[middle - 1] < array[middle]) {
return; // the arrays are already correctly sorted, so we can skip the merge
}
int[] copy = new int[high - low];
System.arraycopy(array, low, copy, 0, copy.length);
int copyLow = 0;
int copyHigh = high - low;
int copyMiddle = middle - low;
for (int i = low, p = copyLow, q = copyMiddle; i < high; i++) {
if (q >= copyHigh || (p < copyMiddle && copy[p] < copy[q]) ) {
array[i] = copy[p++];
} else {
array[i] = copy[q++];
}
}
}
}
public MergeSort(int parallelism) {
pool = new ForkJoinPool(parallelism);
} | void function(int middle) { if (array[middle - 1] < array[middle]) { return; } int[] copy = new int[high - low]; System.arraycopy(array, low, copy, 0, copy.length); int copyLow = 0; int copyHigh = high - low; int copyMiddle = middle - low; for (int i = low, p = copyLow, q = copyMiddle; i < high; i++) { if (q >= copyHigh (p < copyMiddle && copy[p] < copy[q]) ) { array[i] = copy[p++]; } else { array[i] = copy[q++]; } } } } public MergeSort(int parallelism) { pool = new ForkJoinPool(parallelism); } | /**
* Merges the two sorted arrays this.low, middle - 1 and middle, this.high - 1
* @param middle the index in the array where the second sorted list begins
*/ | Merges the two sorted arrays this.low, middle - 1 and middle, this.high - 1 | merge | {
"repo_name": "codefollower/Cassandra-Research",
"path": "my-test/my/test/MergeSort.java",
"license": "apache-2.0",
"size": 5649
} | [
"java.util.concurrent.ForkJoinPool"
] | import java.util.concurrent.ForkJoinPool; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 622,469 |
public void update() {
for (final GenericStats gs : this) {
for (final StatValue sValue : gs.getAllValues()) {
updateValue((XStatValue) sValue);
}
}
}
/**
* @param attribute
* {@link MBeanAttributeInfo}
* @return {@link StatValue}
| void function() { for (final GenericStats gs : this) { for (final StatValue sValue : gs.getAllValues()) { updateValue((XStatValue) sValue); } } } /** * @param attribute * {@link MBeanAttributeInfo} * @return {@link StatValue} | /**
* Updates all the internal values.
*/ | Updates all the internal values | update | {
"repo_name": "bolbat/moskito",
"path": "moskito-core/java/net/anotheria/moskito/core/predefined/MBeanStatsList.java",
"license": "mit",
"size": 16596
} | [
"javax.management.MBeanAttributeInfo",
"net.anotheria.moskito.core.producers.GenericStats",
"net.anotheria.moskito.core.stats.StatValue"
] | import javax.management.MBeanAttributeInfo; import net.anotheria.moskito.core.producers.GenericStats; import net.anotheria.moskito.core.stats.StatValue; | import javax.management.*; import net.anotheria.moskito.core.producers.*; import net.anotheria.moskito.core.stats.*; | [
"javax.management",
"net.anotheria.moskito"
] | javax.management; net.anotheria.moskito; | 147,746 |
protected static Object buildObject(ResultSet sqlResults, String alias,
ObjectStoreInterMineImpl os, Class<?> type, Set<String> noObjectClassColumns)
throws SQLException {
//long time1 = System.currentTimeMillis();
@SuppressWarnings("unchecked") Set<Class<?>> classes = (Set) Collections.singleton(type);
if (!noObjectClassColumns.contains(alias)) {
String objectClass = null;
try {
//long time3 = System.currentTimeMillis();
objectClass = sqlResults.getString(alias + "objectclass");
//timeSpentSql += System.currentTimeMillis() - time3;
} catch (SQLException e) {
noObjectClassColumns.add(alias);
}
if (objectClass != null) {
classes = new HashSet<Class<?>>();
try {
String[] b = objectClass.split(" ");
for (int i = 0; i < b.length; i++) {
classes.add(Class.forName(b[i]));
}
} catch (ClassNotFoundException e) {
SQLException e2 = new SQLException("Invalid entry in objectclass column");
e2.initCause(e);
throw e2;
}
}
}
FastPathObject retval = DynamicUtil.createObject(classes);
Map<String, FieldDescriptor> fields = os.getModel().getFieldDescriptorsForClass(retval
.getClass());
for (Map.Entry<String, FieldDescriptor> entry : fields.entrySet()) {
String fieldName = entry.getKey();
FieldDescriptor fd = entry.getValue();
if (fd instanceof AttributeDescriptor) {
//long time3 = System.currentTimeMillis();
Object value = sqlResults.getObject(alias + DatabaseUtil.getColumnName(fd));
//timeSpentSql += System.currentTimeMillis() - time3;
Class<?> expectedType = retval.getFieldType(fieldName);
if ((value instanceof Long) && Date.class.equals(expectedType)) {
value = new Date(((Long) value).longValue());
} else if ((value instanceof Integer) && (Short.class.equals(expectedType)
|| Short.TYPE.equals(expectedType))) {
value = new Short((short) ((Integer) value).intValue());
}
try {
retval.setFieldValue(fieldName, value);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
} else if (fd instanceof CollectionDescriptor) {
CollectionDescriptor cd = (CollectionDescriptor) fd;
@SuppressWarnings("unchecked") Collection lazyColl = new ProxyCollection(os,
(InterMineObject) retval, cd.getName(), cd.getReferencedClassDescriptor()
.getType());
retval.setFieldValue(cd.getName(), lazyColl);
} else if (fd instanceof ReferenceDescriptor) {
ReferenceDescriptor rd = (ReferenceDescriptor) fd;
//long time3 = System.currentTimeMillis();
Integer id = (Integer) sqlResults.getObject(alias + DatabaseUtil.getColumnName(fd));
//timeSpentSql += System.currentTimeMillis() - time3;
@SuppressWarnings("unchecked") Class<? extends InterMineObject> refType =
(Class) rd.getReferencedClassDescriptor().getType();
if (id == null) {
retval.setFieldValue(fieldName, null);
} else {
retval.setFieldValue(fieldName, new ProxyReference(os, id, refType));
}
}
}
//long time2 = System.currentTimeMillis();
//timeSpentBuildObject += time2 - time1;
//countBuildObject++;
//if (countBuildObject % 100000 == 0) {
// LOG.info("Called buildObject " + countBuildObject + " times. Time spent: "
// + timeSpentBuildObject + ", Sql: " + timeSpentSql);
//}
return retval;
} | static Object function(ResultSet sqlResults, String alias, ObjectStoreInterMineImpl os, Class<?> type, Set<String> noObjectClassColumns) throws SQLException { @SuppressWarnings(STR) Set<Class<?>> classes = (Set) Collections.singleton(type); if (!noObjectClassColumns.contains(alias)) { String objectClass = null; try { objectClass = sqlResults.getString(alias + STR); } catch (SQLException e) { noObjectClassColumns.add(alias); } if (objectClass != null) { classes = new HashSet<Class<?>>(); try { String[] b = objectClass.split(" "); for (int i = 0; i < b.length; i++) { classes.add(Class.forName(b[i])); } } catch (ClassNotFoundException e) { SQLException e2 = new SQLException(STR); e2.initCause(e); throw e2; } } } FastPathObject retval = DynamicUtil.createObject(classes); Map<String, FieldDescriptor> fields = os.getModel().getFieldDescriptorsForClass(retval .getClass()); for (Map.Entry<String, FieldDescriptor> entry : fields.entrySet()) { String fieldName = entry.getKey(); FieldDescriptor fd = entry.getValue(); if (fd instanceof AttributeDescriptor) { Object value = sqlResults.getObject(alias + DatabaseUtil.getColumnName(fd)); Class<?> expectedType = retval.getFieldType(fieldName); if ((value instanceof Long) && Date.class.equals(expectedType)) { value = new Date(((Long) value).longValue()); } else if ((value instanceof Integer) && (Short.class.equals(expectedType) Short.TYPE.equals(expectedType))) { value = new Short((short) ((Integer) value).intValue()); } try { retval.setFieldValue(fieldName, value); } catch (Exception e) { throw new IllegalArgumentException(e); } } else if (fd instanceof CollectionDescriptor) { CollectionDescriptor cd = (CollectionDescriptor) fd; @SuppressWarnings(STR) Collection lazyColl = new ProxyCollection(os, (InterMineObject) retval, cd.getName(), cd.getReferencedClassDescriptor() .getType()); retval.setFieldValue(cd.getName(), lazyColl); } else if (fd instanceof ReferenceDescriptor) { ReferenceDescriptor rd = (ReferenceDescriptor) fd; Integer id = (Integer) sqlResults.getObject(alias + DatabaseUtil.getColumnName(fd)); @SuppressWarnings(STR) Class<? extends InterMineObject> refType = (Class) rd.getReferencedClassDescriptor().getType(); if (id == null) { retval.setFieldValue(fieldName, null); } else { retval.setFieldValue(fieldName, new ProxyReference(os, id, refType)); } } } return retval; } | /**
* Builds an object from separate fields in flat mode.
*
* @param sqlResults the SQL ResultSet
* @param alias the name of the column being built
* @param os the ObjectStore
* @param type a Class matching the QueryClass that is this column
* @param noObjectClassColumns a Set used internally
* @return an InterMineObject
* @throws SQLException if something goes wrong
*/ | Builds an object from separate fields in flat mode | buildObject | {
"repo_name": "joshkh/intermine",
"path": "intermine/objectstore/main/src/org/intermine/objectstore/intermine/ResultsConverter.java",
"license": "lgpl-2.1",
"size": 32160
} | [
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.Collection",
"java.util.Collections",
"java.util.Date",
"java.util.HashSet",
"java.util.Map",
"java.util.Set",
"org.intermine.metadata.AttributeDescriptor",
"org.intermine.metadata.CollectionDescriptor",
"org.intermine.metadata.FieldDescriptor",
"org.intermine.metadata.ReferenceDescriptor",
"org.intermine.model.FastPathObject",
"org.intermine.model.InterMineObject",
"org.intermine.objectstore.proxy.ProxyCollection",
"org.intermine.objectstore.proxy.ProxyReference",
"org.intermine.sql.DatabaseUtil",
"org.intermine.util.DynamicUtil"
] | import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.intermine.metadata.AttributeDescriptor; import org.intermine.metadata.CollectionDescriptor; import org.intermine.metadata.FieldDescriptor; import org.intermine.metadata.ReferenceDescriptor; import org.intermine.model.FastPathObject; import org.intermine.model.InterMineObject; import org.intermine.objectstore.proxy.ProxyCollection; import org.intermine.objectstore.proxy.ProxyReference; import org.intermine.sql.DatabaseUtil; import org.intermine.util.DynamicUtil; | import java.sql.*; import java.util.*; import org.intermine.metadata.*; import org.intermine.model.*; import org.intermine.objectstore.proxy.*; import org.intermine.sql.*; import org.intermine.util.*; | [
"java.sql",
"java.util",
"org.intermine.metadata",
"org.intermine.model",
"org.intermine.objectstore",
"org.intermine.sql",
"org.intermine.util"
] | java.sql; java.util; org.intermine.metadata; org.intermine.model; org.intermine.objectstore; org.intermine.sql; org.intermine.util; | 2,868,479 |
public ApplicationGatewayPropertiesFormat withAuthenticationCertificates(
List<ApplicationGatewayAuthenticationCertificateInner> authenticationCertificates) {
this.authenticationCertificates = authenticationCertificates;
return this;
} | ApplicationGatewayPropertiesFormat function( List<ApplicationGatewayAuthenticationCertificateInner> authenticationCertificates) { this.authenticationCertificates = authenticationCertificates; return this; } | /**
* Set the authenticationCertificates property: Authentication certificates of the application gateway resource. For
* default limits, see [Application Gateway
* limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits).
*
* @param authenticationCertificates the authenticationCertificates value to set.
* @return the ApplicationGatewayPropertiesFormat object itself.
*/ | Set the authenticationCertificates property: Authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](HREF) | withAuthenticationCertificates | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPropertiesFormat.java",
"license": "mit",
"size": 40780
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 121,000 |
public NamedOperatorHLAPI getContainerNamedOperatorHLAPI() {
if (item.getContainerNamedOperator() == null)
return null;
return new NamedOperatorHLAPI(item.getContainerNamedOperator());
} | NamedOperatorHLAPI function() { if (item.getContainerNamedOperator() == null) return null; return new NamedOperatorHLAPI(item.getContainerNamedOperator()); } | /**
* This accessor automatically encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
*
* @return : null if the element is null
*/ | This accessor automatically encapsulate an element of the current object. WARNING : this creates a new object in memory | getContainerNamedOperatorHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-PT-HLPNG/src/fr/lip6/move/pnml/pthlpng/integers/hlapi/GreaterThanHLAPI.java",
"license": "epl-1.0",
"size": 69869
} | [
"fr.lip6.move.pnml.pthlpng.terms.hlapi.NamedOperatorHLAPI"
] | import fr.lip6.move.pnml.pthlpng.terms.hlapi.NamedOperatorHLAPI; | import fr.lip6.move.pnml.pthlpng.terms.hlapi.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 2,833,679 |
public static <T> Collection<T> intersection( Collection<T> c1, Collection<T> c2 )
{
Set<T> set1 = new HashSet<>( c1 );
set1.retainAll( new HashSet<>( c2 ) );
return set1;
} | static <T> Collection<T> function( Collection<T> c1, Collection<T> c2 ) { Set<T> set1 = new HashSet<>( c1 ); set1.retainAll( new HashSet<>( c2 ) ); return set1; } | /**
* Returns the intersection of the given Collections.
*
* @param c1 the first Collection.
* @param c2 the second Collection.
* @param <T> the type.
* @return the intersection of the Collections.
*/ | Returns the intersection of the given Collections | intersection | {
"repo_name": "steffeli/inf5750-tracker-capture",
"path": "dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java",
"license": "bsd-3-clause",
"size": 3087
} | [
"java.util.Collection",
"java.util.HashSet",
"java.util.Set"
] | import java.util.Collection; import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,440,678 |
public RecordType withFields(DataType... fields) {
return withFields(Arrays.asList(fields));
} | RecordType function(DataType... fields) { return withFields(Arrays.asList(fields)); } | /**
* Adds new fields. Replaces an already existing field that has the same name.
*
* @param fields the fields.
* @return this type.
*/ | Adds new fields. Replaces an already existing field that has the same name | withFields | {
"repo_name": "softelnet/sponge",
"path": "sponge-api/src/main/java/org/openksavi/sponge/type/RecordType.java",
"license": "apache-2.0",
"size": 6626
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,505,561 |
public Actions keyDown(Keys theKey) {
return this.keyDown(null, theKey);
} | Actions function(Keys theKey) { return this.keyDown(null, theKey); } | /**
* Performs a modifier key press. Does not release the modifier key - subsequent interactions
* may assume it's kept pressed.
* Note that the modifier key is <b>never</b> released implicitly - either
* <i>keyUp(theKey)</i> or <i>sendKeys(Keys.NULL)</i>
* must be called to release the modifier.
* @param theKey Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. If the
* provided key is none of those, {@link IllegalArgumentException} is thrown.
* @return A self reference.
*/ | Performs a modifier key press. Does not release the modifier key - subsequent interactions may assume it's kept pressed. Note that the modifier key is never released implicitly - either keyUp(theKey) or sendKeys(Keys.NULL) must be called to release the modifier | keyDown | {
"repo_name": "gurayinan/selenium",
"path": "java/client/src/org/openqa/selenium/interactions/Actions.java",
"license": "apache-2.0",
"size": 12909
} | [
"org.openqa.selenium.Keys"
] | import org.openqa.selenium.Keys; | import org.openqa.selenium.*; | [
"org.openqa.selenium"
] | org.openqa.selenium; | 2,615,775 |
public void setA_Effective_Date (Timestamp A_Effective_Date)
{
set_Value (COLUMNNAME_A_Effective_Date, A_Effective_Date);
} | void function (Timestamp A_Effective_Date) { set_Value (COLUMNNAME_A_Effective_Date, A_Effective_Date); } | /** Set A_Effective_Date.
@param A_Effective_Date A_Effective_Date */ | Set A_Effective_Date | setA_Effective_Date | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_A_Asset_Reval_Index.java",
"license": "gpl-2.0",
"size": 5924
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,901,362 |
public void assignMeasureToLeaf(final Measure measure, Leaf leaf) {
Measure oldMeasure = leaf.getMeasure();
if ((oldMeasure == null) || (!oldMeasure.getUri().equals(measure.getUri()))) {
// schedule removal of old measure
if (oldMeasure != null) {
measuresToDelete.add(oldMeasure);
}
// and apply the new one
leaf.applyMeasure(measure);
}
} | void function(final Measure measure, Leaf leaf) { Measure oldMeasure = leaf.getMeasure(); if ((oldMeasure == null) (!oldMeasure.getUri().equals(measure.getUri()))) { if (oldMeasure != null) { measuresToDelete.add(oldMeasure); } leaf.applyMeasure(measure); } } | /**
* Assigns the values of the given measure to the leaf. For this a copy of
* the measure is created, the original measure is left unchanged.
*
* @param measure
* @param leaf
*/ | Assigns the values of the given measure to the leaf. For this a copy of the measure is created, the original measure is left unchanged | assignMeasureToLeaf | {
"repo_name": "openpreserve/plato",
"path": "plato/src/main/java/eu/scape_project/planning/plato/wf/IdentifyRequirements.java",
"license": "apache-2.0",
"size": 13202
} | [
"eu.scape_project.planning.model.measurement.Measure",
"eu.scape_project.planning.model.tree.Leaf"
] | import eu.scape_project.planning.model.measurement.Measure; import eu.scape_project.planning.model.tree.Leaf; | import eu.scape_project.planning.model.measurement.*; import eu.scape_project.planning.model.tree.*; | [
"eu.scape_project.planning"
] | eu.scape_project.planning; | 255,627 |
@Test
public void shouldGetNeighborsReturnFourNeighborsCase2() {
int rows = 1 ;
int columns = 2 ;
L5<IntegerSolution> neighborhood = new L5<IntegerSolution>(rows, columns) ;
List<IntegerSolution> list = new ArrayList<>(rows*columns) ;
for (int i = 0 ; i < rows*columns; i++) {
list.add(mock(IntegerSolution.class)) ;
}
List<IntegerSolution> result = neighborhood.getNeighbors(list, 0) ;
assertEquals(4, result.size()) ;
assertThat(result, hasItem(list.get(0))) ;
assertThat(result, hasItem(list.get(1))) ;
} | void function() { int rows = 1 ; int columns = 2 ; L5<IntegerSolution> neighborhood = new L5<IntegerSolution>(rows, columns) ; List<IntegerSolution> list = new ArrayList<>(rows*columns) ; for (int i = 0 ; i < rows*columns; i++) { list.add(mock(IntegerSolution.class)) ; } List<IntegerSolution> result = neighborhood.getNeighbors(list, 0) ; assertEquals(4, result.size()) ; assertThat(result, hasItem(list.get(0))) ; assertThat(result, hasItem(list.get(1))) ; } | /**
* Case 2
*
* Solution list:
* 0 1
*
* The solution location is 0, the neighborhood is 0, 1
*/ | Case 2 Solution list: 0 1 The solution location is 0, the neighborhood is 0, 1 | shouldGetNeighborsReturnFourNeighborsCase2 | {
"repo_name": "tarunchhabra26/fss16dst",
"path": "project/jMetal/jmetal-core/src/test/java/org/uma/jmetal/util/neighborhood/impl/L5Test.java",
"license": "apache-2.0",
"size": 7479
} | [
"java.util.ArrayList",
"java.util.List",
"org.hamcrest.CoreMatchers",
"org.hamcrest.MatcherAssert",
"org.junit.Assert",
"org.uma.jmetal.solution.IntegerSolution"
] | import java.util.ArrayList; import java.util.List; import org.hamcrest.CoreMatchers; import org.hamcrest.MatcherAssert; import org.junit.Assert; import org.uma.jmetal.solution.IntegerSolution; | import java.util.*; import org.hamcrest.*; import org.junit.*; import org.uma.jmetal.solution.*; | [
"java.util",
"org.hamcrest",
"org.junit",
"org.uma.jmetal"
] | java.util; org.hamcrest; org.junit; org.uma.jmetal; | 408,144 |
@Override
public String biosketchFileNameRule(DevelopmentProposal developmentProposal) {
for (ProposalPersonBiography ppb : developmentProposal.getPropPersonBios()) {
if (StringUtils.equalsIgnoreCase(ppb.getPropPerDocType().getDescription(), "Biosketch")) {
if (StringUtils.equals(FALSE, specialCharacterRule(ppb.getName()))) {
return FALSE;
}
}
}
return TRUE;
} | String function(DevelopmentProposal developmentProposal) { for (ProposalPersonBiography ppb : developmentProposal.getPropPersonBios()) { if (StringUtils.equalsIgnoreCase(ppb.getPropPerDocType().getDescription(), STR)) { if (StringUtils.equals(FALSE, specialCharacterRule(ppb.getName()))) { return FALSE; } } } return TRUE; } | /**
*
* This method checks to see if the biosketch file names contain any restricted special characters.
* See fn_prop_pers_att_name_rule
* @return 'true' if no special characters are found.
*/ | This method checks to see if the biosketch file names contain any restricted special characters. See fn_prop_pers_att_name_rule | biosketchFileNameRule | {
"repo_name": "jwillia/kc-old1",
"path": "coeus-impl/src/main/java/org/kuali/coeus/propdev/impl/krms/PropDevJavaFunctionKrmsTermServiceImpl.java",
"license": "agpl-3.0",
"size": 46897
} | [
"org.apache.commons.lang3.StringUtils",
"org.kuali.coeus.propdev.impl.core.DevelopmentProposal",
"org.kuali.coeus.propdev.impl.person.attachment.ProposalPersonBiography"
] | import org.apache.commons.lang3.StringUtils; import org.kuali.coeus.propdev.impl.core.DevelopmentProposal; import org.kuali.coeus.propdev.impl.person.attachment.ProposalPersonBiography; | import org.apache.commons.lang3.*; import org.kuali.coeus.propdev.impl.core.*; import org.kuali.coeus.propdev.impl.person.attachment.*; | [
"org.apache.commons",
"org.kuali.coeus"
] | org.apache.commons; org.kuali.coeus; | 1,846,962 |
public static InputStream wrap(RemoteInputStream remoteIn)
throws IOException
{
return wrap(remoteIn, RemoteClient.DEFAULT_RETRY);
} | static InputStream function(RemoteInputStream remoteIn) throws IOException { return wrap(remoteIn, RemoteClient.DEFAULT_RETRY); } | /**
* Wraps a RemoteInputStream as an InputStream using the
* {@link RemoteClient#DEFAULT_RETRY} retry policy.
*
* @param remoteIn a remote input stream interface
* @return an InputStream which will read from the given RemoteInputStream
*/ | Wraps a RemoteInputStream as an InputStream using the <code>RemoteClient#DEFAULT_RETRY</code> retry policy | wrap | {
"repo_name": "kmizumar/rmiio-slf4j",
"path": "src/main/java/com/healthmarketscience/rmiio/RemoteInputStreamClient.java",
"license": "lgpl-2.1",
"size": 8053
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 102,331 |
public static String getDetailedInstalledVersion(Context context, String mainVersion) {
// TODO: This must be faster
return new PythonInterpreter(context, mainVersion).getPythonVersion();
} | static String function(Context context, String mainVersion) { return new PythonInterpreter(context, mainVersion).getPythonVersion(); } | /**
* Returns the detailed version string of the main Python version which is currently installed.
*
* @param context The current Application context
* @param mainVersion The version which detailed version should be checked.
* @return The detailed version string.
*/ | Returns the detailed version string of the main Python version which is currently installed | getDetailedInstalledVersion | {
"repo_name": "Abestanis/APython",
"path": "app/src/main/java/com/apython/python/pythonhost/PackageManager.java",
"license": "mit",
"size": 15077
} | [
"android.content.Context",
"com.apython.python.pythonhost.interpreter.PythonInterpreter"
] | import android.content.Context; import com.apython.python.pythonhost.interpreter.PythonInterpreter; | import android.content.*; import com.apython.python.pythonhost.interpreter.*; | [
"android.content",
"com.apython.python"
] | android.content; com.apython.python; | 460,893 |
public void add(Item item) {
this.addNS(item);
Collections.sort(this.items);
this.saveQ();
} | void function(Item item) { this.addNS(item); Collections.sort(this.items); this.saveQ(); } | /**
* Adds an item to the list and sorts it
*
* @param item The item to be added
*/ | Adds an item to the list and sorts it | add | {
"repo_name": "Thomaash/TV-EET",
"path": "app/src/main/java/tomas_vycital/eet/android_app/items/Items.java",
"license": "apache-2.0",
"size": 6914
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 711,735 |
public static double parseDouble(String text, int type) {
String txt = UNDERSCORE_PATTERN.matcher(text).replaceAll("");
double result = 0;
switch (type) {
case TokenTypes.NUM_FLOAT:
case TokenTypes.NUM_DOUBLE:
result = Double.parseDouble(txt);
break;
case TokenTypes.NUM_INT:
case TokenTypes.NUM_LONG:
int radix = BASE_10;
if (txt.startsWith("0x") || txt.startsWith("0X")) {
radix = BASE_16;
txt = txt.substring(2);
}
else if (txt.charAt(0) == '0') {
radix = BASE_8;
txt = txt.substring(1);
}
if (CommonUtils.endsWithChar(txt, 'L') || CommonUtils.endsWithChar(txt, 'l')) {
txt = txt.substring(0, txt.length() - 1);
}
if (!txt.isEmpty()) {
if (type == TokenTypes.NUM_INT) {
result = parseInt(txt, radix);
}
else {
result = parseLong(txt, radix);
}
}
break;
default:
break;
}
return result;
} | static double function(String text, int type) { String txt = UNDERSCORE_PATTERN.matcher(text).replaceAll(STR0xSTR0X")) { radix = BASE_16; txt = txt.substring(2); } else if (txt.charAt(0) == '0') { radix = BASE_8; txt = txt.substring(1); } if (CommonUtils.endsWithChar(txt, 'L') CommonUtils.endsWithChar(txt, 'l')) { txt = txt.substring(0, txt.length() - 1); } if (!txt.isEmpty()) { if (type == TokenTypes.NUM_INT) { result = parseInt(txt, radix); } else { result = parseLong(txt, radix); } } break; default: break; } return result; } | /**
* Returns the value represented by the specified string of the specified
* type. Returns 0 for types other than float, double, int, and long.
* @param text the string to be parsed.
* @param type the token type of the text. Should be a constant of
* {@link TokenTypes}.
* @return the double value represented by the string argument.
*/ | Returns the value represented by the specified string of the specified type. Returns 0 for types other than float, double, int, and long | parseDouble | {
"repo_name": "rmswimkktt/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtils.java",
"license": "lgpl-2.1",
"size": 15926
} | [
"com.puppycrawl.tools.checkstyle.api.TokenTypes"
] | import com.puppycrawl.tools.checkstyle.api.TokenTypes; | import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 2,844,342 |
public V1alpha1CSIStorageCapacityList listNamespacedCSIStorageCapacity(
String namespace,
String pretty,
Boolean allowWatchBookmarks,
String _continue,
String fieldSelector,
String labelSelector,
Integer limit,
String resourceVersion,
String resourceVersionMatch,
Integer timeoutSeconds,
Boolean watch)
throws ApiException {
ApiResponse<V1alpha1CSIStorageCapacityList> localVarResp =
listNamespacedCSIStorageCapacityWithHttpInfo(
namespace,
pretty,
allowWatchBookmarks,
_continue,
fieldSelector,
labelSelector,
limit,
resourceVersion,
resourceVersionMatch,
timeoutSeconds,
watch);
return localVarResp.getData();
} | V1alpha1CSIStorageCapacityList function( String namespace, String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Integer timeoutSeconds, Boolean watch) throws ApiException { ApiResponse<V1alpha1CSIStorageCapacityList> localVarResp = listNamespacedCSIStorageCapacityWithHttpInfo( namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch); return localVarResp.getData(); } | /**
* list or watch objects of kind CSIStorageCapacity
*
* @param namespace object name and auth scope, such as for teams and projects (required)
* @param pretty If 'true', then the output is pretty printed. (optional)
* @param allowWatchBookmarks allowWatchBookmarks requests watch events with type
* \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and
* bookmarks are sent at the server's discretion. Clients should not assume bookmarks are
* returned at any specific interval, nor may they assume the server will send any BOOKMARK
* event during a session. If this is not a watch, this field is ignored. (optional)
* @param _continue The continue option should be set when retrieving more results from the
* server. Since this value is server defined, clients may only use the continue value from a
* previous query result with identical query parameters (except for the value of continue)
* and the server may reject a continue value it does not recognize. If the specified continue
* value is no longer valid whether due to expiration (generally five to fifteen minutes) or a
* configuration change on the server, the server will respond with a 410 ResourceExpired
* error together with a continue token. If the client needs a consistent list, it must
* restart their list without the continue field. Otherwise, the client may send another list
* request with the token received with the 410 error, the server will respond with a list
* starting from the next key, but from the latest snapshot, which is inconsistent from the
* previous list results - objects that are created, modified, or deleted after the first list
* request will be included in the response, as long as their keys are after the \"next
* key\". This field is not supported when watch is true. Clients may start a watch from
* the last resourceVersion value returned by the server and not miss any modifications.
* (optional)
* @param fieldSelector A selector to restrict the list of returned objects by their fields.
* Defaults to everything. (optional)
* @param labelSelector A selector to restrict the list of returned objects by their labels.
* Defaults to everything. (optional)
* @param limit limit is a maximum number of responses to return for a list call. If more items
* exist, the server will set the `continue` field on the list metadata to a value
* that can be used with the same initial query to retrieve the next set of results. Setting a
* limit may return fewer than the requested amount of items (up to zero items) in the event
* all requested objects are filtered out and clients should only use the presence of the
* continue field to determine whether more results are available. Servers may choose not to
* support the limit argument and will return all of the available results. If limit is
* specified and the continue field is empty, clients may assume that no more results are
* available. This field is not supported if watch is true. The server guarantees that the
* objects returned when using continue will be identical to issuing a single list call
* without a limit - that is, no objects created, modified, or deleted after the first request
* is issued will be included in any subsequent continued requests. This is sometimes referred
* to as a consistent snapshot, and ensures that a client that is using limit to receive
* smaller chunks of a very large result can ensure they see all possible objects. If objects
* are updated during a chunked list the version of the object that was present at the time
* the first list result was calculated is returned. (optional)
* @param resourceVersion resourceVersion sets a constraint on what resource versions a request
* may be served from. See
* https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
* Defaults to unset (optional)
* @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to
* list calls. It is highly recommended that resourceVersionMatch be set for list calls where
* resourceVersion is set See
* https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
* Defaults to unset (optional)
* @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call,
* regardless of any activity or inactivity. (optional)
* @param watch Watch for changes to the described resources and return them as a stream of add,
* update, and remove notifications. Specify resourceVersion. (optional)
* @return V1alpha1CSIStorageCapacityList
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
* @http.response.details
* <table summary="Response Details" border="1">
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* </table>
*/ | list or watch objects of kind CSIStorageCapacity | listNamespacedCSIStorageCapacity | {
"repo_name": "kubernetes-client/java",
"path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/StorageV1alpha1Api.java",
"license": "apache-2.0",
"size": 165216
} | [
"io.kubernetes.client.openapi.ApiException",
"io.kubernetes.client.openapi.ApiResponse",
"io.kubernetes.client.openapi.models.V1alpha1CSIStorageCapacityList"
] | import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.ApiResponse; import io.kubernetes.client.openapi.models.V1alpha1CSIStorageCapacityList; | import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; | [
"io.kubernetes.client"
] | io.kubernetes.client; | 1,093,882 |
synchronized public void processSync(LearnerSyncRequest r){
if(outstandingProposals.isEmpty()){
sendSync(r);
} else {
List<LearnerSyncRequest> l = pendingSyncs.get(lastProposed);
if (l == null) {
l = new ArrayList<LearnerSyncRequest>();
}
l.add(r);
pendingSyncs.put(lastProposed, l);
}
}
| synchronized void function(LearnerSyncRequest r){ if(outstandingProposals.isEmpty()){ sendSync(r); } else { List<LearnerSyncRequest> l = pendingSyncs.get(lastProposed); if (l == null) { l = new ArrayList<LearnerSyncRequest>(); } l.add(r); pendingSyncs.put(lastProposed, l); } } | /**
* Process sync requests
*
* @param r the request
*/ | Process sync requests | processSync | {
"repo_name": "woggle/mesos-old",
"path": "third_party/zookeeper-3.3.1/src/java/main/org/apache/zookeeper/server/quorum/Leader.java",
"license": "apache-2.0",
"size": 23978
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,437,745 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<SourceControlSyncJobByIdInner>> getWithResponseAsync(
String resourceGroupName,
String automationAccountName,
String sourceControlName,
UUID sourceControlSyncJobId,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (automationAccountName == null) {
return Mono
.error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));
}
if (sourceControlName == null) {
return Mono
.error(new IllegalArgumentException("Parameter sourceControlName is required and cannot be null."));
}
if (sourceControlSyncJobId == null) {
return Mono
.error(
new IllegalArgumentException("Parameter sourceControlSyncJobId is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2019-06-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.get(
this.client.getEndpoint(),
resourceGroupName,
automationAccountName,
sourceControlName,
sourceControlSyncJobId,
this.client.getSubscriptionId(),
apiVersion,
accept,
context);
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<SourceControlSyncJobByIdInner>> function( String resourceGroupName, String automationAccountName, String sourceControlName, UUID sourceControlSyncJobId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (automationAccountName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (sourceControlName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (sourceControlSyncJobId == null) { return Mono .error( new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; final String accept = STR; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, this.client.getSubscriptionId(), apiVersion, accept, context); } | /**
* Retrieve the source control sync job identified by job id.
*
* @param resourceGroupName Name of an Azure Resource group.
* @param automationAccountName The name of the automation account.
* @param sourceControlName The source control name.
* @param sourceControlSyncJobId The source control sync job id.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return definition of the source control sync job.
*/ | Retrieve the source control sync job identified by job id | getWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/automation/azure-resourcemanager-automation/src/main/java/com/azure/resourcemanager/automation/implementation/SourceControlSyncJobsClientImpl.java",
"license": "mit",
"size": 42758
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.automation.fluent.models.SourceControlSyncJobByIdInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.automation.fluent.models.SourceControlSyncJobByIdInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.automation.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 34,842 |
public Builder timestamp(Instant timestamp) {
this.timestamp = timestamp;
return this;
}
| Builder function(Instant timestamp) { this.timestamp = timestamp; return this; } | /**
* Sets the UTC timestamp specifying the moment when the reading was taken.
*
* @param timestamp The timestamp.
* @return The builder.
*/ | Sets the UTC timestamp specifying the moment when the reading was taken | timestamp | {
"repo_name": "jeozey/XmppServerTester",
"path": "xmpp-extensions/src/main/java/rocks/xmpp/extensions/geoloc/model/GeoLocation.java",
"license": "mit",
"size": 22356
} | [
"java.time.Instant"
] | import java.time.Instant; | import java.time.*; | [
"java.time"
] | java.time; | 1,232,859 |
public Register index() {
return index;
} | Register function() { return index; } | /**
* Returns the index register.
*
* @return the index register
*/ | Returns the index register | index | {
"repo_name": "iitc/x86",
"path": "src/main/java/com/iancaffey/x86/operand/Offset.java",
"license": "mit",
"size": 9405
} | [
"com.iancaffey.x86.Register"
] | import com.iancaffey.x86.Register; | import com.iancaffey.x86.*; | [
"com.iancaffey.x86"
] | com.iancaffey.x86; | 681,957 |
private void init()
throws IOException
{
_inflater.reset();
_crc.reset();
_inputSize = 0;
_readBufferSize = 0;
byte flg;
int length = _in.read(_tbuffer, 0, 10);
if (length < 0) {
_isGzip = false;
return;
}
else if (length != 10) {
_isGzip = false;
_in.unread(_tbuffer, 0, length);
return;
}
if (_tbuffer[0] != (byte)0x1f || _tbuffer[1] != (byte)0x8b) {
_isGzip = false;
_in.unread(_tbuffer, 0, length);
return;
}
flg = _tbuffer[3];
// Skip optional field
if ((flg & (byte)0x04) > 0) {
length = _in.read(_tbuffer, 0, 2);
if (length != 2)
throw new IOException("Bad GZIP (FEXTRA) header.");
length = (((int)_tbuffer[1]) << 4) | _tbuffer[0];
_in.skip(length);
}
int c;
// Skip optional field
if ((flg & (byte)0x08) > 0) {
c = _in.read();
while (c != 0) {
if (c < 0)
throw new IOException("Bad GZIP (FNAME) header.");
c = _in.read();
}
}
// Skip optional field
if ((flg & 0x10) > 0) {
c = _in.read();
while (c != 0) {
if (c < 0)
throw new IOException("Bad GZIP (FCOMMENT) header.");
c = _in.read();
}
}
// Skip optional field
if ((flg & 0x02) > 0) {
length = _in.read(_tbuffer, 0, 2);
if (length != 2)
throw new IOException("Bad GZIP (FHCRC) header.");
}
_isGzip = true;
} | void function() throws IOException { _inflater.reset(); _crc.reset(); _inputSize = 0; _readBufferSize = 0; byte flg; int length = _in.read(_tbuffer, 0, 10); if (length < 0) { _isGzip = false; return; } else if (length != 10) { _isGzip = false; _in.unread(_tbuffer, 0, length); return; } if (_tbuffer[0] != (byte)0x1f _tbuffer[1] != (byte)0x8b) { _isGzip = false; _in.unread(_tbuffer, 0, length); return; } flg = _tbuffer[3]; if ((flg & (byte)0x04) > 0) { length = _in.read(_tbuffer, 0, 2); if (length != 2) throw new IOException(STR); length = (((int)_tbuffer[1]) << 4) _tbuffer[0]; _in.skip(length); } int c; if ((flg & (byte)0x08) > 0) { c = _in.read(); while (c != 0) { if (c < 0) throw new IOException(STR); c = _in.read(); } } if ((flg & 0x10) > 0) { c = _in.read(); while (c != 0) { if (c < 0) throw new IOException(STR); c = _in.read(); } } if ((flg & 0x02) > 0) { length = _in.read(_tbuffer, 0, 2); if (length != 2) throw new IOException(STR); } _isGzip = true; } | /**
* Inits/resets this class to be ready to read the start of a gzip stream.
*/ | Inits/resets this class to be ready to read the start of a gzip stream | init | {
"repo_name": "moriyoshi/quercus-gae",
"path": "src/main/java/com/caucho/quercus/lib/zlib/GZInputStream.java",
"license": "gpl-2.0",
"size": 8367
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,829,420 |
Observable<ServiceResponse<Void>> getDefaultNone200NoneAsync(); | Observable<ServiceResponse<Void>> getDefaultNone200NoneAsync(); | /**
* Send a 200 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/ | Send a 200 response with no payload | getDefaultNone200NoneAsync | {
"repo_name": "haocs/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/MultipleResponses.java",
"license": "mit",
"size": 33841
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 905,182 |
public int realReadBytes(byte cbuf[], int off, int len)
throws IOException;
} | int function(byte cbuf[], int off, int len) throws IOException; } | /**
* Read new bytes ( usually the internal conversion buffer ).
* The implementation is allowed to ignore the parameters,
* and mutate the chunk if it wishes to implement its own buffering.
*/ | Read new bytes ( usually the internal conversion buffer ). The implementation is allowed to ignore the parameters, and mutate the chunk if it wishes to implement its own buffering | realReadBytes | {
"repo_name": "plumer/codana",
"path": "tomcat_files/6.0.0/ByteChunk.java",
"license": "mit",
"size": 20962
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,419,133 |
@GetMapping("/{id:.+}")
public ResponseEntity<AuditEvent> get(@PathVariable String id) {
return ResponseUtil.wrapOrNotFound(auditEventService.find(id));
} | @GetMapping(STR) ResponseEntity<AuditEvent> function(@PathVariable String id) { return ResponseUtil.wrapOrNotFound(auditEventService.find(id)); } | /**
* GET /audits/:id : get an AuditEvent by id.
*
* @param id
* the id of the entity to get
* @return the ResponseEntity with status 200 (OK) and the AuditEvent in
* body, or status 404 (Not Found)
*/ | GET /audits/:id : get an AuditEvent by id | get | {
"repo_name": "dads-software-brotherhood/sekc",
"path": "src/main/java/mx/infotec/dads/sekc/web/rest/AuditResource.java",
"license": "apache-2.0",
"size": 3382
} | [
"io.github.jhipster.web.util.ResponseUtil",
"org.springframework.boot.actuate.audit.AuditEvent",
"org.springframework.http.ResponseEntity",
"org.springframework.web.bind.annotation.GetMapping",
"org.springframework.web.bind.annotation.PathVariable"
] | import io.github.jhipster.web.util.ResponseUtil; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; | import io.github.jhipster.web.util.*; import org.springframework.boot.actuate.audit.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*; | [
"io.github.jhipster",
"org.springframework.boot",
"org.springframework.http",
"org.springframework.web"
] | io.github.jhipster; org.springframework.boot; org.springframework.http; org.springframework.web; | 2,064,184 |
@Path("/removeOSPFArea")
@Consumes(MediaType.APPLICATION_XML)
@POST
public void removeOSPFArea(OSPFAreaConfiguration ospfAreaConfiguration) throws CapabilityException; | @Path(STR) @Consumes(MediaType.APPLICATION_XML) void function(OSPFAreaConfiguration ospfAreaConfiguration) throws CapabilityException; | /**
* Remove an OSPF area.
*
* @param ospfAreaConfiguration
* @throws CapabilityException
*/ | Remove an OSPF area | removeOSPFArea | {
"repo_name": "dana-i2cat/opennaas-routing-nfv",
"path": "extensions/bundles/router.capability.ospf/src/main/java/org/opennaas/extensions/router/capability/ospf/IOSPFCapability.java",
"license": "lgpl-3.0",
"size": 4868
} | [
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.core.MediaType",
"org.opennaas.core.resources.capability.CapabilityException",
"org.opennaas.extensions.router.model.OSPFAreaConfiguration"
] | import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.core.MediaType; import org.opennaas.core.resources.capability.CapabilityException; import org.opennaas.extensions.router.model.OSPFAreaConfiguration; | import javax.ws.rs.*; import javax.ws.rs.core.*; import org.opennaas.core.resources.capability.*; import org.opennaas.extensions.router.model.*; | [
"javax.ws",
"org.opennaas.core",
"org.opennaas.extensions"
] | javax.ws; org.opennaas.core; org.opennaas.extensions; | 1,313,605 |
DescribeVolumeStatusResult describeStatus(DescribeVolumeStatusRequest
request); | DescribeVolumeStatusResult describeStatus(DescribeVolumeStatusRequest request); | /**
* Performs the <code>DescribeStatus</code> action.
*
* <p>
* The following request parameters will be populated from the data of this
* <code>Volume</code> resource, and any conflicting parameter value set in
* the request will be overridden:
* <ul>
* <li>
* <b><code>VolumeIds.0</code></b>
* - mapped from the <code>Id</code> identifier.
* </li>
* </ul>
*
* <p>
*
* @return The response of the low-level client operation associated with
* this resource action.
* @see DescribeVolumeStatusRequest
*/ | Performs the <code>DescribeStatus</code> action. The following request parameters will be populated from the data of this <code>Volume</code> resource, and any conflicting parameter value set in the request will be overridden: <code>VolumeIds.0</code> - mapped from the <code>Id</code> identifier. | describeStatus | {
"repo_name": "smartpcr/aws-sdk-java-resources",
"path": "aws-resources-ec2/src/main/java/com/amazonaws/resources/ec2/Volume.java",
"license": "apache-2.0",
"size": 20944
} | [
"com.amazonaws.services.ec2.model.DescribeVolumeStatusRequest",
"com.amazonaws.services.ec2.model.DescribeVolumeStatusResult"
] | import com.amazonaws.services.ec2.model.DescribeVolumeStatusRequest; import com.amazonaws.services.ec2.model.DescribeVolumeStatusResult; | import com.amazonaws.services.ec2.model.*; | [
"com.amazonaws.services"
] | com.amazonaws.services; | 560,381 |
public void setDrawing(Drawing drawing){
this.drawing = drawing;
}
| void function(Drawing drawing){ this.drawing = drawing; } | /**
* Set the shape that is drawing.
*
* @param drawing Which shape to drawing current.
*/ | Set the shape that is drawing | setDrawing | {
"repo_name": "wada811/Android-Paint",
"path": "library/src/main/java/com/wada811/android/paint/PaintView.java",
"license": "apache-2.0",
"size": 4296
} | [
"com.wada811.android.paint.drawings.Drawing"
] | import com.wada811.android.paint.drawings.Drawing; | import com.wada811.android.paint.drawings.*; | [
"com.wada811.android"
] | com.wada811.android; | 639,273 |
private JLabel getLblCalcBaseHint() {
if (lblCalcBaseHint == null) {
lblCalcBaseHint = new JLabel(lblCalcBaseHintString);
lblCalcBaseHint.setFont(new Font("Dialog", Font.BOLD, 12));
}
return lblCalcBaseHint;
}
| JLabel function() { if (lblCalcBaseHint == null) { lblCalcBaseHint = new JLabel(lblCalcBaseHintString); lblCalcBaseHint.setFont(new Font(STR, Font.BOLD, 12)); } return lblCalcBaseHint; } | /**
* Gets the button calculate metrics hint.
* @return the button calculate metrics hint
*/ | Gets the button calculate metrics hint | getLblCalcBaseHint | {
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/org.agentgui.core/src/agentgui/simulationService/load/threading/gui/ThreadMonitorMetricsTableTab.java",
"license": "lgpl-2.1",
"size": 16901
} | [
"java.awt.Font",
"javax.swing.JLabel"
] | import java.awt.Font; import javax.swing.JLabel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 398,234 |
private static Process runAAPTCommandForExtractingResourcesAndValues(String aaptPath,
String apkPath, String xmlFileName) throws IOException
{
// execute command: aapt.exe d --values resources <name>.apk <name>.xml
String[] aaptCommand = new String[]
{
aaptPath, "d", "--values", "resources", apkPath, xmlFileName //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
};
return Runtime.getRuntime().exec(aaptCommand);
}
/**
* Put data from {@link Map}, created in method
* {@link #retrieveLocalizationStringsMapFromAPK(String, String, String)} | static Process function(String aaptPath, String apkPath, String xmlFileName) throws IOException { String[] aaptCommand = new String[] { aaptPath, "d", STR, STR, apkPath, xmlFileName }; return Runtime.getRuntime().exec(aaptCommand); } /** * Put data from {@link Map}, created in method * {@link #retrieveLocalizationStringsMapFromAPK(String, String, String)} | /**
* Execute the AAPT command: aapt d --values resources [ApkFile].apk >
* [XMLFileName].xml.
*
* @param aaptPath
* AAPT path.
* @param apkPath
* Target APK File path.
* @param xmlFileName
* XML file name which will be generated.
*
* @return The {@link Process} created the the execution of the AAPT
* command.
*
* @throws IOException
* Exception thrown in case the command execution fails.
*/ | Execute the AAPT command: aapt d --values resources [ApkFile].apk > [XMLFileName].xml | runAAPTCommandForExtractingResourcesAndValues | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "tools/motodev/src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/internal/utils/AaptUtils.java",
"license": "gpl-2.0",
"size": 55948
} | [
"java.io.IOException",
"java.util.Map"
] | import java.io.IOException; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,357,391 |
private void initialize(String title, List<ImportErrorObject> toSubmit)
{
setTitle(title);
initComponents();
buildGUI(toSubmit);
setSize(DEFAULT_SIZE);
}
public MessengerDialog(JFrame parent, String title, String emailAddress)
{
super(parent);
this.emailAddress = emailAddress;
dialogType = COMMENT_TYPE;
initialize(title, null);
}
public MessengerDialog(JFrame parent, String title, String emailAddress,
Exception exception)
{
super(parent);
dialogType = ERROR_TYPE;
this.emailAddress = emailAddress;
this.exception = exception;
initialize(title, null);
}
public MessengerDialog(JFrame parent, String title, String emailAddress,
List<ImportErrorObject> toSubmit)
{
super(parent);
this.dialogType = SUBMIT_ERROR_TYPE;
this.emailAddress = emailAddress;
initialize(title, toSubmit);
}
| void function(String title, List<ImportErrorObject> toSubmit) { setTitle(title); initComponents(); buildGUI(toSubmit); setSize(DEFAULT_SIZE); } MessengerDialog(JFrame parent, String title, String emailAddress) { super(parent); this.emailAddress = emailAddress; dialogType = COMMENT_TYPE; function(title, null); } MessengerDialog(JFrame parent, String title, String emailAddress, Exception exception) { super(parent); dialogType = ERROR_TYPE; this.emailAddress = emailAddress; this.exception = exception; function(title, null); } MessengerDialog(JFrame parent, String title, String emailAddress, List<ImportErrorObject> toSubmit) { super(parent); this.dialogType = SUBMIT_ERROR_TYPE; this.emailAddress = emailAddress; function(title, toSubmit); } | /**
* Initializes the dialog.
*
* @param title The title of the dialog.
* @param toSubmit The collection of files to send.
*/ | Initializes the dialog | initialize | {
"repo_name": "dominikl/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/ui/MessengerDialog.java",
"license": "gpl-2.0",
"size": 25977
} | [
"java.util.List",
"javax.swing.JFrame",
"org.openmicroscopy.shoola.util.file.ImportErrorObject"
] | import java.util.List; import javax.swing.JFrame; import org.openmicroscopy.shoola.util.file.ImportErrorObject; | import java.util.*; import javax.swing.*; import org.openmicroscopy.shoola.util.file.*; | [
"java.util",
"javax.swing",
"org.openmicroscopy.shoola"
] | java.util; javax.swing; org.openmicroscopy.shoola; | 249,577 |
public static Date convertStringToDate(String strDate) throws ParseException {
Date aDate = null;
try {
if (log.isDebugEnabled()) {
log.debug("converting date with pattern: " + getDatePattern());
}
aDate = convertStringToDate(getDatePattern(), strDate);
} catch (ParseException pe) {
log.error("Could not convert '" + strDate + "' to a date, throwing exception");
pe.printStackTrace();
throw new ParseException(pe.getMessage(), pe.getErrorOffset());
}
return aDate;
} | static Date function(String strDate) throws ParseException { Date aDate = null; try { if (log.isDebugEnabled()) { log.debug(STR + getDatePattern()); } aDate = convertStringToDate(getDatePattern(), strDate); } catch (ParseException pe) { log.error(STR + strDate + STR); pe.printStackTrace(); throw new ParseException(pe.getMessage(), pe.getErrorOffset()); } return aDate; } | /**
* This method converts a String to a date using the datePattern.
*
* @param strDate
* the date to convert (in format MM/dd/yyyy)
* @return a date object
* @throws ParseException
* the parse exception
*/ | This method converts a String to a date using the datePattern | convertStringToDate | {
"repo_name": "8090boy/gomall.la",
"path": "legendshop_util/src/java/com/legendshop/util/converter/ConvertDateUtil.java",
"license": "apache-2.0",
"size": 5448
} | [
"java.text.ParseException",
"java.util.Date"
] | import java.text.ParseException; import java.util.Date; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 571,728 |
public void testModifyItem() {
EntityManager em = createEntityManager();
beginTransaction(em);
try {
Item item = em.find(Item.class, itemId);
item.setName("Willy Waller");
item.setDescription("For adults only!");
assertTrue("The manufacturer was not persisted", item.getManufacturer() != null);
assertTrue("The manufacturer of the item was incorrect", item.getManufacturer().getName().equals("Mattel Inc."));
Lego lego = new Lego();
lego.setName("The LEGO Group");
item.setManufacturer(lego);
assertTrue("The distributor was not persisted", item.getDistributor() != null);
assertTrue("The distributor of the item was incorrect", item.getDistributor().getName().equals("Namco Games"));
MegaBrands megaBrands = new MegaBrands();
megaBrands.setName("MegaBrands Inc.");
item.setDistributor(megaBrands);
em.merge(item);
em.persist(lego);
em.persist(megaBrands);
commitTransaction(em);
} catch (RuntimeException e) {
if (isTransactionActive(em)) {
rollbackTransaction(em);
}
closeEntityManager(em);
throw e;
}
closeEntityManager(em);
}
| void function() { EntityManager em = createEntityManager(); beginTransaction(em); try { Item item = em.find(Item.class, itemId); item.setName(STR); item.setDescription(STR); assertTrue(STR, item.getManufacturer() != null); assertTrue(STR, item.getManufacturer().getName().equals(STR)); Lego lego = new Lego(); lego.setName(STR); item.setManufacturer(lego); assertTrue(STR, item.getDistributor() != null); assertTrue(STR, item.getDistributor().getName().equals(STR)); MegaBrands megaBrands = new MegaBrands(); megaBrands.setName(STR); item.setDistributor(megaBrands); em.merge(item); em.persist(lego); em.persist(megaBrands); commitTransaction(em); } catch (RuntimeException e) { if (isTransactionActive(em)) { rollbackTransaction(em); } closeEntityManager(em); throw e; } closeEntityManager(em); } | /**
* Read an item, verify it contents, modify it and commit.
*/ | Read an item, verify it contents, modify it and commit | testModifyItem | {
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipModelJUnitTestSuite.java",
"license": "epl-1.0",
"size": 38000
} | [
"javax.persistence.EntityManager",
"org.eclipse.persistence.testing.models.jpa.relationships.Item",
"org.eclipse.persistence.testing.models.jpa.relationships.Lego",
"org.eclipse.persistence.testing.models.jpa.relationships.MegaBrands"
] | import javax.persistence.EntityManager; import org.eclipse.persistence.testing.models.jpa.relationships.Item; import org.eclipse.persistence.testing.models.jpa.relationships.Lego; import org.eclipse.persistence.testing.models.jpa.relationships.MegaBrands; | import javax.persistence.*; import org.eclipse.persistence.testing.models.jpa.relationships.*; | [
"javax.persistence",
"org.eclipse.persistence"
] | javax.persistence; org.eclipse.persistence; | 301,625 |
public void setProxyConfiguration(ProxyConfiguration proxyConfiguration) {
apiGatewayClientConfiguration.setProxyConfiguration(proxyConfiguration);
} | void function(ProxyConfiguration proxyConfiguration) { apiGatewayClientConfiguration.setProxyConfiguration(proxyConfiguration); } | /**
* Sets the optional proxy configuration of a client.
*
* @param proxyConfiguration The proxy configuration of the client.
*/ | Sets the optional proxy configuration of a client | setProxyConfiguration | {
"repo_name": "jentfoo/aws-sdk-java",
"path": "aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/protect/client/SdkSyncClientBuilder.java",
"license": "apache-2.0",
"size": 10847
} | [
"com.amazonaws.opensdk.config.ProxyConfiguration"
] | import com.amazonaws.opensdk.config.ProxyConfiguration; | import com.amazonaws.opensdk.config.*; | [
"com.amazonaws.opensdk"
] | com.amazonaws.opensdk; | 2,525,664 |
public static Test suite() {
return new TestSuite(ArrayRootMeanSquaredErrorTest.class);
} | static Test function() { return new TestSuite(ArrayRootMeanSquaredErrorTest.class); } | /**
* Returns a test suite.
*
* @return the test suite
*/ | Returns a test suite | suite | {
"repo_name": "automenta/adams-core",
"path": "src/test/java/adams/data/statistics/ArrayRootMeanSquaredErrorTest.java",
"license": "gpl-3.0",
"size": 2677
} | [
"junit.framework.Test",
"junit.framework.TestSuite"
] | import junit.framework.Test; import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 2,783,003 |
private void initialize() {
IBroadcastRouteControl broadcastRouteControl = null;
broadcastRouteControl = mDtvManager.getBroadcastRouteControl();
ICommonRouteControl commonRouteControl = null;
commonRouteControl = mDtvManager.getCommonRouteControl();
// Retrieve demux descriptor.
RouteDemuxDescriptor demuxDescriptor = null;
demuxDescriptor = broadcastRouteControl.getDemuxDescriptor(0);
// Retrieve decoder descriptor.
RouteDecoderDescriptor decoderDescriptor = null;
decoderDescriptor = commonRouteControl.getDecoderDescriptor(0);
// Retrieve output descriptor.
RouteInputOutputDescriptor outputDescriptor = null;
outputDescriptor = commonRouteControl.getInputOutputDescriptor(0);
// get number if frontends
int numberOfFrontends = 0;
numberOfFrontends = broadcastRouteControl.getFrontendNumber();
// Find DVB and IP front-end descriptors.
EnumSet<RouteFrontendType> frontendTypes = null;
for (int i = 0; i < numberOfFrontends; i++) {
RouteFrontendDescriptor frontendDescriptor = null;
frontendDescriptor = broadcastRouteControl.getFrontendDescriptor(i);
frontendTypes = frontendDescriptor.getFrontendType();
for (RouteFrontendType frontendType : frontendTypes) {
switch (frontendType) {
case SAT: {
if (mLiveRouteSat == EC_INVALID_ROUTE) {
mLiveRouteSat = getLiveRouteId(frontendDescriptor, demuxDescriptor,
decoderDescriptor, outputDescriptor, broadcastRouteControl);
mLog.v("mLiveRouteSat: " + mLiveRouteSat);
}
if (mInstallRouteSat == -1) {
mInstallRouteSat = getInstallRouteId(frontendDescriptor,
demuxDescriptor, decoderDescriptor, outputDescriptor,
broadcastRouteControl);
mCurrentInstallRoute = mInstallRouteSat;
mLog.v("mInstallRouteSat: " + mInstallRouteSat);
}
break;
}
case CAB: {
if (mLiveRouteCab == EC_INVALID_ROUTE) {
mLiveRouteCab = getLiveRouteId(frontendDescriptor, demuxDescriptor,
decoderDescriptor, outputDescriptor, broadcastRouteControl);
mLog.v("mLiveRouteCab: " + mLiveRouteCab);
}
if (mInstallRouteCab == -1) {
mInstallRouteCab = getInstallRouteId(frontendDescriptor,
demuxDescriptor, decoderDescriptor, outputDescriptor,
broadcastRouteControl);
mCurrentInstallRoute = mInstallRouteCab;
mLog.v("mInstallRouteCab: " + mInstallRouteCab);
}
break;
}
case TER: {
if (mLiveRouteTer == EC_INVALID_ROUTE) {
mLiveRouteTer = getLiveRouteId(frontendDescriptor, demuxDescriptor,
decoderDescriptor, outputDescriptor, broadcastRouteControl);
mLog.v("mLiveRouteTer: " + mLiveRouteTer);
}
if (mInstallRouteTer == -1) {
mInstallRouteTer = getInstallRouteId(frontendDescriptor,
demuxDescriptor, decoderDescriptor, outputDescriptor,
broadcastRouteControl);
mCurrentInstallRoute = mInstallRouteTer;
mLog.v("mInstallRouteTer: " + mInstallRouteTer);
}
break;
}
case IP: {
if (mLiveRouteIp == EC_INVALID_ROUTE) {
mLiveRouteIp = getLiveRouteId(frontendDescriptor, demuxDescriptor,
decoderDescriptor, outputDescriptor, broadcastRouteControl);
mLog.v("mLiveRouteIp: " + mLiveRouteIp);
}
if (mInstallRouteIp == -1) {
mInstallRouteIp = getInstallRouteId(frontendDescriptor,
demuxDescriptor, decoderDescriptor, outputDescriptor,
broadcastRouteControl);
mCurrentInstallRoute = mInstallRouteIp;
mLog.v("mInstallRouteIp: " + mInstallRouteIp);
}
break;
}
default:
break;
}
}
}
if (mLiveRouteIp != EC_INVALID_ROUTE) {
if ((mLiveRouteCab != EC_INVALID_ROUTE || mLiveRouteSat != EC_INVALID_ROUTE
|| mLiveRouteTer != EC_INVALID_ROUTE)) {
isHybridTuner = true;
}
}
} | void function() { IBroadcastRouteControl broadcastRouteControl = null; broadcastRouteControl = mDtvManager.getBroadcastRouteControl(); ICommonRouteControl commonRouteControl = null; commonRouteControl = mDtvManager.getCommonRouteControl(); RouteDemuxDescriptor demuxDescriptor = null; demuxDescriptor = broadcastRouteControl.getDemuxDescriptor(0); RouteDecoderDescriptor decoderDescriptor = null; decoderDescriptor = commonRouteControl.getDecoderDescriptor(0); RouteInputOutputDescriptor outputDescriptor = null; outputDescriptor = commonRouteControl.getInputOutputDescriptor(0); int numberOfFrontends = 0; numberOfFrontends = broadcastRouteControl.getFrontendNumber(); EnumSet<RouteFrontendType> frontendTypes = null; for (int i = 0; i < numberOfFrontends; i++) { RouteFrontendDescriptor frontendDescriptor = null; frontendDescriptor = broadcastRouteControl.getFrontendDescriptor(i); frontendTypes = frontendDescriptor.getFrontendType(); for (RouteFrontendType frontendType : frontendTypes) { switch (frontendType) { case SAT: { if (mLiveRouteSat == EC_INVALID_ROUTE) { mLiveRouteSat = getLiveRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mLog.v(STR + mLiveRouteSat); } if (mInstallRouteSat == -1) { mInstallRouteSat = getInstallRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mCurrentInstallRoute = mInstallRouteSat; mLog.v(STR + mInstallRouteSat); } break; } case CAB: { if (mLiveRouteCab == EC_INVALID_ROUTE) { mLiveRouteCab = getLiveRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mLog.v(STR + mLiveRouteCab); } if (mInstallRouteCab == -1) { mInstallRouteCab = getInstallRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mCurrentInstallRoute = mInstallRouteCab; mLog.v(STR + mInstallRouteCab); } break; } case TER: { if (mLiveRouteTer == EC_INVALID_ROUTE) { mLiveRouteTer = getLiveRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mLog.v(STR + mLiveRouteTer); } if (mInstallRouteTer == -1) { mInstallRouteTer = getInstallRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mCurrentInstallRoute = mInstallRouteTer; mLog.v(STR + mInstallRouteTer); } break; } case IP: { if (mLiveRouteIp == EC_INVALID_ROUTE) { mLiveRouteIp = getLiveRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mLog.v(STR + mLiveRouteIp); } if (mInstallRouteIp == -1) { mInstallRouteIp = getInstallRouteId(frontendDescriptor, demuxDescriptor, decoderDescriptor, outputDescriptor, broadcastRouteControl); mCurrentInstallRoute = mInstallRouteIp; mLog.v(STR + mInstallRouteIp); } break; } default: break; } } } if (mLiveRouteIp != EC_INVALID_ROUTE) { if ((mLiveRouteCab != EC_INVALID_ROUTE mLiveRouteSat != EC_INVALID_ROUTE mLiveRouteTer != EC_INVALID_ROUTE)) { isHybridTuner = true; } } } | /**
* Initialize MW Routes
*/ | Initialize MW Routes | initialize | {
"repo_name": "iWedia/iWediaSimpleTvInputService",
"path": "app/src/main/java/com/iwedia/example/tvinput/engine/RouteManager.java",
"license": "apache-2.0",
"size": 12647
} | [
"com.iwedia.dtv.route.broadcast.IBroadcastRouteControl",
"com.iwedia.dtv.route.broadcast.RouteDemuxDescriptor",
"com.iwedia.dtv.route.broadcast.RouteFrontendDescriptor",
"com.iwedia.dtv.route.broadcast.RouteFrontendType",
"com.iwedia.dtv.route.common.ICommonRouteControl",
"com.iwedia.dtv.route.common.RouteDecoderDescriptor",
"com.iwedia.dtv.route.common.RouteInputOutputDescriptor",
"java.util.EnumSet"
] | import com.iwedia.dtv.route.broadcast.IBroadcastRouteControl; import com.iwedia.dtv.route.broadcast.RouteDemuxDescriptor; import com.iwedia.dtv.route.broadcast.RouteFrontendDescriptor; import com.iwedia.dtv.route.broadcast.RouteFrontendType; import com.iwedia.dtv.route.common.ICommonRouteControl; import com.iwedia.dtv.route.common.RouteDecoderDescriptor; import com.iwedia.dtv.route.common.RouteInputOutputDescriptor; import java.util.EnumSet; | import com.iwedia.dtv.route.broadcast.*; import com.iwedia.dtv.route.common.*; import java.util.*; | [
"com.iwedia.dtv",
"java.util"
] | com.iwedia.dtv; java.util; | 1,177,039 |
public Adapter createPackageAdapter() {
return null;
} | Adapter function() { return null; } | /**
* Creates a new adapter for an object of class '{@link org.nasdanika.cdo.security.Package <em>Package</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.nasdanika.cdo.security.Package
* @generated
*/ | Creates a new adapter for an object of class '<code>org.nasdanika.cdo.security.Package Package</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. | createPackageAdapter | {
"repo_name": "Nasdanika/server",
"path": "org.nasdanika.cdo.security/src/org/nasdanika/cdo/security/util/SecurityAdapterFactory.java",
"license": "epl-1.0",
"size": 13822
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,631,234 |
Iterator getAll(Iterator ids) throws NoSuchElementException;
| Iterator getAll(Iterator ids) throws NoSuchElementException; | /**
* Returns an iterator pointing to the Object of the given ids. It
* should behave like a call of <tt>getAll(ids, true)</tt>.
*
* @param ids an iterator of object identifiers.
* @return an iterator of objects.
* @throws NoSuchElementException if one of the desired objects is not
* found.
*/ | Returns an iterator pointing to the Object of the given ids. It should behave like a call of getAll(ids, true) | getAll | {
"repo_name": "hannoman/xxl",
"path": "src/xxl/core/collections/containers/Container.java",
"license": "lgpl-3.0",
"size": 17938
} | [
"java.util.Iterator",
"java.util.NoSuchElementException"
] | import java.util.Iterator; import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 1,996,738 |
private LatLngBounds getLatLngBoundsOfCircle(LatLng center, double radius) {
// See the stackoverflow post in the javadoc to understand what these constants really mean.
LatLng southwest = SphericalUtil.computeOffset(center, radius * Math.sqrt(2.0), 225);
LatLng northeast = SphericalUtil.computeOffset(center, radius * Math.sqrt(2.0), 45);
return new LatLngBounds(southwest, northeast);
} | LatLngBounds function(LatLng center, double radius) { LatLng southwest = SphericalUtil.computeOffset(center, radius * Math.sqrt(2.0), 225); LatLng northeast = SphericalUtil.computeOffset(center, radius * Math.sqrt(2.0), 45); return new LatLngBounds(southwest, northeast); } | /**
* Gets the LatLngBounds of a circle given the center and radius of the circle.
* See <a href="http://stackoverflow.com/questions/15319431/how-to-convert-a-latlng-and-a-radius-to-a-latlngbounds-in-android-google-maps-ap">this</a> Stack Overflow post.
*
* @param center
* @param radius
* @return
*/ | Gets the LatLngBounds of a circle given the center and radius of the circle. See this Stack Overflow post | getLatLngBoundsOfCircle | {
"repo_name": "jvivanco28/PegCityTransit",
"path": "app/src/main/java/jessevivanco/com/pegcitytransit/ui/fragments/TransitMapFragment.java",
"license": "mit",
"size": 19771
} | [
"com.google.android.gms.maps.model.LatLng",
"com.google.android.gms.maps.model.LatLngBounds",
"com.google.maps.android.SphericalUtil"
] | import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; import com.google.maps.android.SphericalUtil; | import com.google.android.gms.maps.model.*; import com.google.maps.android.*; | [
"com.google.android",
"com.google.maps"
] | com.google.android; com.google.maps; | 1,934,826 |
@Test
public void test1playerMatching_ReturnEmpty() {
setListWith1Player();
List<Match> actualMatchList = mCreator.createMatchList(mPlayerList);
assertEquals("Result must be empty list;", mExpectedMatchList, actualMatchList);
} | void function() { setListWith1Player(); List<Match> actualMatchList = mCreator.createMatchList(mPlayerList); assertEquals(STR, mExpectedMatchList, actualMatchList); } | /**
* Tests attempt to pair list with one player.
* Must returns empty match list.
*/ | Tests attempt to pair list with one player. Must returns empty match list | test1playerMatching_ReturnEmpty | {
"repo_name": "floring/SwissManager",
"path": "app/src/androidTest/java/com/arles/swissmanager/test/tournament/MatchesCreatorTest.java",
"license": "apache-2.0",
"size": 5640
} | [
"com.arles.swissmanager.tournament.Match",
"java.util.List",
"junit.framework.Assert"
] | import com.arles.swissmanager.tournament.Match; import java.util.List; import junit.framework.Assert; | import com.arles.swissmanager.tournament.*; import java.util.*; import junit.framework.*; | [
"com.arles.swissmanager",
"java.util",
"junit.framework"
] | com.arles.swissmanager; java.util; junit.framework; | 2,629,365 |
@Test(expected = GenieNotFoundException.class)
public void testGetJobNoJobExists() throws GenieException {
this.service.getJob(UUID.randomUUID().toString());
} | @Test(expected = GenieNotFoundException.class) void function() throws GenieException { this.service.getJob(UUID.randomUUID().toString()); } | /**
* Test the get job function.
*
* @throws GenieException
*/ | Test the get job function | testGetJobNoJobExists | {
"repo_name": "gorcz/genie",
"path": "genie-server/src/test/java/com/netflix/genie/server/services/impl/jpa/TestJobServiceJPAImpl.java",
"license": "apache-2.0",
"size": 36789
} | [
"com.netflix.genie.common.exceptions.GenieException",
"com.netflix.genie.common.exceptions.GenieNotFoundException",
"java.util.UUID",
"org.junit.Test"
] | import com.netflix.genie.common.exceptions.GenieException; import com.netflix.genie.common.exceptions.GenieNotFoundException; import java.util.UUID; import org.junit.Test; | import com.netflix.genie.common.exceptions.*; import java.util.*; import org.junit.*; | [
"com.netflix.genie",
"java.util",
"org.junit"
] | com.netflix.genie; java.util; org.junit; | 117,078 |
//@Provides
//@Singleton
public CredentialsMatcher provideCredentialsMatcher(){
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
matcher.setHashAlgorithmName(CREDENTIALS_MATCHER_ALGORITHM_NAME);
return matcher;
}
| HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(); matcher.setHashAlgorithmName(CREDENTIALS_MATCHER_ALGORITHM_NAME); return matcher; } | /**
* When annotations activated, you'll need to hash passwords in your configured Realm (i.e.: shiro.ini file)
* @return credentialsMatcher singleton implementation for this application
*/ | When annotations activated, you'll need to hash passwords in your configured Realm (i.e.: shiro.ini file) | provideCredentialsMatcher | {
"repo_name": "fabioaugustosl/crm-api",
"path": "src/main/java/br/com/virtz/cfc/shiro/modules/BootstrapShiroModule.java",
"license": "gpl-3.0",
"size": 1909
} | [
"org.apache.shiro.authc.credential.HashedCredentialsMatcher"
] | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; | import org.apache.shiro.authc.credential.*; | [
"org.apache.shiro"
] | org.apache.shiro; | 2,869,352 |
Result decode(BinaryBitmap image) throws NotFoundException, ChecksumException, FormatException;
/**
* Locates and decodes a barcode in some format within an image. This method also accepts
* hints, each possibly associated to some data, which may help the implementation decode.
*
* @param image image of barcode to decode
* @param hints passed as a {@link java.util.Map} from {@link DecodeHintType} | Result decode(BinaryBitmap image) throws NotFoundException, ChecksumException, FormatException; /** * Locates and decodes a barcode in some format within an image. This method also accepts * hints, each possibly associated to some data, which may help the implementation decode. * * @param image image of barcode to decode * @param hints passed as a {@link java.util.Map} from {@link DecodeHintType} | /**
* Locates and decodes a barcode in some format within an image.
*
* @param image image of barcode to decode
* @return String which the barcode encodes
* @throws com.google.zxing.NotFoundException if no potential barcode is found
* @throws com.google.zxing.ChecksumException if a potential barcode is found but does not pass its checksum
* @throws com.google.zxing.FormatException if a potential barcode is found but format is invalid
*/ | Locates and decodes a barcode in some format within an image | decode | {
"repo_name": "feluis23/LectorQR",
"path": "app/src/main/java/com/google/zxing/Reader.java",
"license": "mit",
"size": 2872
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,758,057 |
private static String[] parseName(String name) throws UIException
{
String[] parts = new String[3];
String[] split = name.split("_");
if (split.length == 2) {
parts[0] = split[0];
parts[1] = split[1];
parts[2] = null;
} else if (split.length == 3) {
parts[0] = split[0];
parts[1] = split[1];
parts[2] = split[2];
} else {
throw new UIException("Unable to parse metedata field name: "+name);
}
return parts;
} | static String[] function(String name) throws UIException { String[] parts = new String[3]; String[] split = name.split("_"); if (split.length == 2) { parts[0] = split[0]; parts[1] = split[1]; parts[2] = null; } else if (split.length == 3) { parts[0] = split[0]; parts[1] = split[1]; parts[2] = split[2]; } else { throw new UIException(STR+name); } return parts; } | /**
* Parse the given name into three parts, divided by an _. Each part should represent the
* schema, element, and qualifier. You are guaranteed that if no qualifier was supplied the
* third entry is null.
*
* @param name The name to be parsed.
* @return An array of name parts.
*/ | Parse the given name into three parts, divided by an _. Each part should represent the schema, element, and qualifier. You are guaranteed that if no qualifier was supplied the third entry is null | parseName | {
"repo_name": "rnathanday/dryad-repo",
"path": "dspace-xmlui/dspace-xmlui-api/src/main/java/org/dspace/app/xmlui/aspect/authority/FlowAuthorityMetadataValueUtils.java",
"license": "bsd-3-clause",
"size": 7614
} | [
"org.dspace.app.xmlui.utils.UIException"
] | import org.dspace.app.xmlui.utils.UIException; | import org.dspace.app.xmlui.utils.*; | [
"org.dspace.app"
] | org.dspace.app; | 1,118,207 |
@Test
public void setValueDate_givenNameOfColumn_updatesValue() {
LocalDateTime value = LocalDateTime.of(1971, 1, 1, 1, 1);
record.setValue(column3.getName(), value);
LocalDateTime expected = value;
LocalDateTime actual = record.getDateValue(column3.getName());
assertSame(expected, actual);
} | void function() { LocalDateTime value = LocalDateTime.of(1971, 1, 1, 1, 1); record.setValue(column3.getName(), value); LocalDateTime expected = value; LocalDateTime actual = record.getDateValue(column3.getName()); assertSame(expected, actual); } | /**
* Tests whether {@link Record#setValue(String, Object)} updates the value
* of the correct column when given {@link LocalDate} value and the name of
* a column that contains {@link LocalDate}s.
*/ | Tests whether <code>Record#setValue(String, Object)</code> updates the value of the correct column when given <code>LocalDate</code> value and the name of a column that contains <code>LocalDate</code>s | setValueDate_givenNameOfColumn_updatesValue | {
"repo_name": "adamIqbal/Health",
"path": "health/src/test/java/com/health/RecordTest.java",
"license": "mit",
"size": 18473
} | [
"java.time.LocalDateTime",
"org.junit.Assert"
] | import java.time.LocalDateTime; import org.junit.Assert; | import java.time.*; import org.junit.*; | [
"java.time",
"org.junit"
] | java.time; org.junit; | 646,611 |
public static double getDecimalYear(Calendar calendar) {
return calendar.get(Calendar.YEAR)
+ (double) calendar.get(Calendar.DAY_OF_YEAR) / calendar.getActualMaximum(Calendar.DAY_OF_YEAR);
} | static double function(Calendar calendar) { return calendar.get(Calendar.YEAR) + (double) calendar.get(Calendar.DAY_OF_YEAR) / calendar.getActualMaximum(Calendar.DAY_OF_YEAR); } | /**
* Returns the year of the calendar object as a decimal value.
*/ | Returns the year of the calendar object as a decimal value | getDecimalYear | {
"repo_name": "georgeerhan/openhab2-addons",
"path": "addons/binding/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/DateTimeUtils.java",
"license": "epl-1.0",
"size": 5714
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 168,090 |
private void startContentSynchronizations(List<SynchronizeFileOperation> filesToSyncContents) {
RemoteOperationResult contentsResult;
for (SynchronizeFileOperation op : filesToSyncContents) {
contentsResult = op.execute(mStorageManager, mContext); // async
if (!contentsResult.isSuccess()) {
if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) {
mConflictsFound++;
} else {
mFailsInKeptInSyncFound++;
if (contentsResult.getException() != null) {
Log_OC.e(TAG, "Error while synchronizing favourites : "
+ contentsResult.getLogMessage(), contentsResult.getException());
} else {
Log_OC.e(TAG, "Error while synchronizing favourites : "
+ contentsResult.getLogMessage());
}
}
} // won't let these fails break the synchronization process
}
} | void function(List<SynchronizeFileOperation> filesToSyncContents) { RemoteOperationResult contentsResult; for (SynchronizeFileOperation op : filesToSyncContents) { contentsResult = op.execute(mStorageManager, mContext); if (!contentsResult.isSuccess()) { if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) { mConflictsFound++; } else { mFailsInKeptInSyncFound++; if (contentsResult.getException() != null) { Log_OC.e(TAG, STR + contentsResult.getLogMessage(), contentsResult.getException()); } else { Log_OC.e(TAG, STR + contentsResult.getLogMessage()); } } } } } | /**
* Performs a list of synchronization operations, determining if a download or upload is needed
* or if exists conflict due to changes both in local and remote contents of the each file.
*
* If download or upload is needed, request the operation to the corresponding service and goes
* on.
*
* @param filesToSyncContents Synchronization operations to execute.
*/ | Performs a list of synchronization operations, determining if a download or upload is needed or if exists conflict due to changes both in local and remote contents of the each file. If download or upload is needed, request the operation to the corresponding service and goes on | startContentSynchronizations | {
"repo_name": "jsargent7089/android",
"path": "src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java",
"license": "gpl-2.0",
"size": 27978
} | [
"android.util.Log",
"com.owncloud.android.lib.common.operations.RemoteOperationResult",
"java.util.List"
] | import android.util.Log; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import java.util.List; | import android.util.*; import com.owncloud.android.lib.common.operations.*; import java.util.*; | [
"android.util",
"com.owncloud.android",
"java.util"
] | android.util; com.owncloud.android; java.util; | 199,493 |
private static void processFirstStopOfTrip(ArrivalDeparture arrDep) {
// Only need to handle departure for first stop in trip
if (arrDep.getStopPathIndex() != 0)
return;
// Should only process departures for the first stop, so make sure.
// If not a departure then continue to the next stop
if (arrDep.isArrival())
return;
// First stop in trip so just deal with departure time.
// Don't need to deal with travel time.
int lateTimeMsec =
(int) (arrDep.getTime() - arrDep.getScheduledTime());
// If schedule adherence is really far off then ignore the data
// point because it would skew the results.
if (Math.abs(lateTimeMsec) > MAX_SCHED_ADH_FOR_FIRST_STOP_TIME)
return;
// If configured to not use early departures then reset lateTimeMsec
// to 0 if it is negative. This is useful for agencies like commuter
// rail since trains really aren't going to leave early and early
// departures indicates a problem with travel times.
if (shouldResetEarlyTerminalDepartures() && lateTimeMsec < 0)
lateTimeMsec = 0;
// Get the MapKey so can put stop time into map
ProcessedDataMapKey mapKeyForTravelTimes =
getKey(arrDep.getTripId(), arrDep.getStopPathIndex(),
arrDep.getStopId());
// Add this stop time to map so it can be averaged
addStopTimeToMap(mapKeyForTravelTimes, lateTimeMsec);
}
| static void function(ArrivalDeparture arrDep) { if (arrDep.getStopPathIndex() != 0) return; if (arrDep.isArrival()) return; int lateTimeMsec = (int) (arrDep.getTime() - arrDep.getScheduledTime()); if (Math.abs(lateTimeMsec) > MAX_SCHED_ADH_FOR_FIRST_STOP_TIME) return; if (shouldResetEarlyTerminalDepartures() && lateTimeMsec < 0) lateTimeMsec = 0; ProcessedDataMapKey mapKeyForTravelTimes = getKey(arrDep.getTripId(), arrDep.getStopPathIndex(), arrDep.getStopId()); addStopTimeToMap(mapKeyForTravelTimes, lateTimeMsec); } | /**
* For when the arrival/departure is for first stop of trip. If the schedule
* adherence isn't too bad adds the stop time to the stop wait map.
*
* @param arrDep
*/ | For when the arrival/departure is for first stop of trip. If the schedule adherence isn't too bad adds the stop time to the stop wait map | processFirstStopOfTrip | {
"repo_name": "goeuropa/transitime",
"path": "transitime/src/main/java/org/transitime/core/travelTimes/TravelTimesProcessor.java",
"license": "gpl-3.0",
"size": 39792
} | [
"org.transitime.db.structs.ArrivalDeparture"
] | import org.transitime.db.structs.ArrivalDeparture; | import org.transitime.db.structs.*; | [
"org.transitime.db"
] | org.transitime.db; | 791,561 |
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_ASSET,
defaultValue = "")
@SimpleProperty
public void BackgroundImage(String path) {
view.setBackgroundImage(path);
}
/**
* Returns the currently specified paint color as an alpha-red-green-blue
* integer, i.e., {@code 0xAARRGGBB}. An alpha of {@code 00} | @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_ASSET, defaultValue = "") void function(String path) { view.setBackgroundImage(path); } /** * Returns the currently specified paint color as an alpha-red-green-blue * integer, i.e., {@code 0xAARRGGBB}. An alpha of {@code 00} | /**
* Specifies the path of the canvas background image.
*
* <p/>See {@link MediaUtil#determineMediaSource} for information about what
* a path can be.
*
* @param path the path of the canvas background image
*/ | Specifies the path of the canvas background image. See <code>MediaUtil#determineMediaSource</code> for information about what a path can be | BackgroundImage | {
"repo_name": "warren922/appinventor-sources",
"path": "appinventor/components/src/com/google/appinventor/components/runtime/Canvas.java",
"license": "apache-2.0",
"size": 56953
} | [
"com.google.appinventor.components.annotations.DesignerProperty",
"com.google.appinventor.components.common.PropertyTypeConstants"
] | import com.google.appinventor.components.annotations.DesignerProperty; import com.google.appinventor.components.common.PropertyTypeConstants; | import com.google.appinventor.components.annotations.*; import com.google.appinventor.components.common.*; | [
"com.google.appinventor"
] | com.google.appinventor; | 1,443,463 |
@SideOnly(Side.CLIENT)
public void setVelocity(double x, double y, double z)
{
this.motionX = x;
this.motionY = y;
this.motionZ = z;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(x * x + z * z);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI);
}
} | @SideOnly(Side.CLIENT) void function(double x, double y, double z) { this.motionX = x; this.motionY = y; this.motionZ = z; if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); } } | /**
* Sets the velocity to the args. Args: x, y, z
*/ | Sets the velocity to the args. Args: x, y, z | setVelocity | {
"repo_name": "trixmot/mod1",
"path": "build/tmp/recompileMc/sources/net/minecraft/entity/item/EntityFireworkRocket.java",
"license": "lgpl-2.1",
"size": 7245
} | [
"net.minecraft.util.MathHelper",
"net.minecraftforge.fml.relauncher.Side",
"net.minecraftforge.fml.relauncher.SideOnly"
] | import net.minecraft.util.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; | import net.minecraft.util.*; import net.minecraftforge.fml.relauncher.*; | [
"net.minecraft.util",
"net.minecraftforge.fml"
] | net.minecraft.util; net.minecraftforge.fml; | 884,520 |
private String sslExceptionBuilder(SSLException sslEx, HttpMessage httpMessage) {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append(Constant.messages.getString("network.ssl.error.connect"));
strBuilder.append(httpMessage.getRequestHeader().getURI().toString()).append('\n');
strBuilder
.append(Constant.messages.getString("network.ssl.error.exception"))
.append(sslEx.getMessage())
.append('\n');
strBuilder
.append(Constant.messages.getString("network.ssl.error.exception.rootcause"))
.append(ExceptionUtils.getRootCauseMessage(sslEx))
.append('\n');
strBuilder.append(
Constant.messages.getString(
"network.ssl.error.help",
Constant.messages.getString("network.ssl.error.help.url")));
return strBuilder.toString();
}
private class ModeRedirectionValidator implements HttpRedirectionValidator {
private boolean isRequestValid;
private URI invalidRedirection;
public ModeRedirectionValidator() {
isRequestValid = true;
}
@Override
public void notifyMessageReceived(HttpMessage message) {} | String function(SSLException sslEx, HttpMessage httpMessage) { StringBuilder strBuilder = new StringBuilder(); strBuilder.append(Constant.messages.getString(STR)); strBuilder.append(httpMessage.getRequestHeader().getURI().toString()).append('\n'); strBuilder .append(Constant.messages.getString(STR)) .append(sslEx.getMessage()) .append('\n'); strBuilder .append(Constant.messages.getString(STR)) .append(ExceptionUtils.getRootCauseMessage(sslEx)) .append('\n'); strBuilder.append( Constant.messages.getString( STR, Constant.messages.getString(STR))); return strBuilder.toString(); } private class ModeRedirectionValidator implements HttpRedirectionValidator { private boolean isRequestValid; private URI invalidRedirection; public ModeRedirectionValidator() { isRequestValid = true; } public void notifyMessageReceived(HttpMessage message) {} | /**
* Build a descriptive exception message about SSLException
*
* @param sslEx the ssl exception
* @param httpMessage message cause the exception
* @return descriptive message
*/ | Build a descriptive exception message about SSLException | sslExceptionBuilder | {
"repo_name": "kingthorin/zap-extensions",
"path": "addOns/websocket/src/main/java/org/zaproxy/zap/extension/websocket/client/ServerConnectionEstablisher.java",
"license": "apache-2.0",
"size": 14478
} | [
"javax.net.ssl.SSLException",
"org.apache.commons.lang.exception.ExceptionUtils",
"org.parosproxy.paros.Constant",
"org.parosproxy.paros.network.HttpMessage",
"org.zaproxy.zap.network.HttpRedirectionValidator"
] | import javax.net.ssl.SSLException; import org.apache.commons.lang.exception.ExceptionUtils; import org.parosproxy.paros.Constant; import org.parosproxy.paros.network.HttpMessage; import org.zaproxy.zap.network.HttpRedirectionValidator; | import javax.net.ssl.*; import org.apache.commons.lang.exception.*; import org.parosproxy.paros.*; import org.parosproxy.paros.network.*; import org.zaproxy.zap.network.*; | [
"javax.net",
"org.apache.commons",
"org.parosproxy.paros",
"org.zaproxy.zap"
] | javax.net; org.apache.commons; org.parosproxy.paros; org.zaproxy.zap; | 2,358,136 |
String inputFolder = ResourceLoader.getResourcePath(LrrMu.class,"workload/planetlab");
String outputFolder = "output";
String workload = "20110303"; // PlanetLab workload
String vmAllocationPolicy = "lrr"; // Local Regression Robust (LRR) VM allocation policy
String vmSelectionPolicy = "mu"; // Minimum Utilization (MU) VM selection policy
double safetyParameter = 1.2;
new PlanetLabRunner(
true,
false,
inputFolder,
outputFolder,
workload,
vmAllocationPolicy,
vmSelectionPolicy,
safetyParameter);
} | String inputFolder = ResourceLoader.getResourcePath(LrrMu.class,STR); String outputFolder = STR; String workload = STR; String vmAllocationPolicy = "lrr"; String vmSelectionPolicy = "mu"; double safetyParameter = 1.2; new PlanetLabRunner( true, false, inputFolder, outputFolder, workload, vmAllocationPolicy, vmSelectionPolicy, safetyParameter); } | /**
* The main method.
*
* @param args the arguments
* @throws IOException Signals that an I/O exception has occurred.
*/ | The main method | main | {
"repo_name": "RaysaOliveira/cloudsim-plus",
"path": "cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/power/planetlab/LrrMu.java",
"license": "gpl-3.0",
"size": 1885
} | [
"org.cloudbus.cloudsim.examples.power.util.PlanetLabRunner",
"org.cloudbus.cloudsim.util.ResourceLoader"
] | import org.cloudbus.cloudsim.examples.power.util.PlanetLabRunner; import org.cloudbus.cloudsim.util.ResourceLoader; | import org.cloudbus.cloudsim.examples.power.util.*; import org.cloudbus.cloudsim.util.*; | [
"org.cloudbus.cloudsim"
] | org.cloudbus.cloudsim; | 1,890,947 |
protected RuntimeManager createRuntimeManager(Strategy strategy, Map<String, ResourceType> resources, String identifier) {
if (manager != null) {
throw new IllegalStateException("There is already one RuntimeManager active");
}
RuntimeEnvironmentBuilder builder = null;
if (!setupDataSource){
builder = RuntimeEnvironmentBuilder.Factory.get()
.newEmptyBuilder()
.addConfiguration("drools.processSignalManagerFactory", DefaultSignalManagerFactory.class.getName())
.addConfiguration("drools.processInstanceManagerFactory", DefaultProcessInstanceManagerFactory.class.getName())
.registerableItemsFactory(new SimpleRegisterableItemsFactory() { | RuntimeManager function(Strategy strategy, Map<String, ResourceType> resources, String identifier) { if (manager != null) { throw new IllegalStateException(STR); } RuntimeEnvironmentBuilder builder = null; if (!setupDataSource){ builder = RuntimeEnvironmentBuilder.Factory.get() .newEmptyBuilder() .addConfiguration(STR, DefaultSignalManagerFactory.class.getName()) .addConfiguration(STR, DefaultProcessInstanceManagerFactory.class.getName()) .registerableItemsFactory(new SimpleRegisterableItemsFactory() { | /**
* Creates default configuration of <code>RuntimeManager</code> with given <code>strategy</code> and all
* <code>resources</code> being added to knowledge base.
* <br/>
* There should be only one <code>RuntimeManager</code> created during single test.
* @param strategy - selected strategy of those that are supported
* @param resources - resources that shall be added to knowledge base
* @param identifier - identifies the runtime manager
* @return new instance of RuntimeManager
*/ | Creates default configuration of <code>RuntimeManager</code> with given <code>strategy</code> and all <code>resources</code> being added to knowledge base. There should be only one <code>RuntimeManager</code> created during single test | createRuntimeManager | {
"repo_name": "rabbitcount/jbpm",
"path": "jbpm-test/src/main/java/org/jbpm/test/JbpmJUnitBaseTestCase.java",
"license": "apache-2.0",
"size": 40648
} | [
"java.util.Map",
"org.jbpm.process.instance.event.DefaultSignalManagerFactory",
"org.jbpm.process.instance.impl.DefaultProcessInstanceManagerFactory",
"org.jbpm.runtime.manager.impl.SimpleRegisterableItemsFactory",
"org.kie.api.io.ResourceType",
"org.kie.api.runtime.manager.RuntimeEnvironmentBuilder",
"org.kie.api.runtime.manager.RuntimeManager"
] | import java.util.Map; import org.jbpm.process.instance.event.DefaultSignalManagerFactory; import org.jbpm.process.instance.impl.DefaultProcessInstanceManagerFactory; import org.jbpm.runtime.manager.impl.SimpleRegisterableItemsFactory; import org.kie.api.io.ResourceType; import org.kie.api.runtime.manager.RuntimeEnvironmentBuilder; import org.kie.api.runtime.manager.RuntimeManager; | import java.util.*; import org.jbpm.process.instance.event.*; import org.jbpm.process.instance.impl.*; import org.jbpm.runtime.manager.impl.*; import org.kie.api.io.*; import org.kie.api.runtime.manager.*; | [
"java.util",
"org.jbpm.process",
"org.jbpm.runtime",
"org.kie.api"
] | java.util; org.jbpm.process; org.jbpm.runtime; org.kie.api; | 2,490,012 |
public static void shuffle(List<?> list, Random random) {
@SuppressWarnings("unchecked") // we won't put foreign objects in
final List<Object> objectList = (List<Object>) list;
if (list instanceof RandomAccess) {
for (int i = objectList.size() - 1; i > 0; i--) {
int index = random.nextInt(i + 1);
objectList.set(index, objectList.set(i, objectList.get(index)));
}
} else {
Object[] array = objectList.toArray();
for (int i = array.length - 1; i > 0; i--) {
int index = random.nextInt(i + 1);
Object temp = array[i];
array[i] = array[index];
array[index] = temp;
}
int i = 0;
ListIterator<Object> it = objectList.listIterator();
while (it.hasNext()) {
it.next();
it.set(array[i++]);
}
}
} | static void function(List<?> list, Random random) { @SuppressWarnings(STR) final List<Object> objectList = (List<Object>) list; if (list instanceof RandomAccess) { for (int i = objectList.size() - 1; i > 0; i--) { int index = random.nextInt(i + 1); objectList.set(index, objectList.set(i, objectList.get(index))); } } else { Object[] array = objectList.toArray(); for (int i = array.length - 1; i > 0; i--) { int index = random.nextInt(i + 1); Object temp = array[i]; array[i] = array[index]; array[index] = temp; } int i = 0; ListIterator<Object> it = objectList.listIterator(); while (it.hasNext()) { it.next(); it.set(array[i++]); } } } | /**
* Moves every element of the list to a random new position in the list
* using the specified random number generator.
*
* @param list
* the list to shuffle.
* @param random
* the random number generator.
* @throws UnsupportedOperationException
* when replacing an element in the list is not supported.
*/ | Moves every element of the list to a random new position in the list using the specified random number generator | shuffle | {
"repo_name": "Programming-Systems-Lab/phosphor",
"path": "Phosphor/src/main/java/edu/columbia/cs/psl/phosphor/struct/harmony/util/Collections.java",
"license": "mit",
"size": 108292
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 1,164,424 |
public char get1(Field field) {
currentPos = field.start;
return get1();
} // get1
| char function(Field field) { currentPos = field.start; return get1(); } | /** Gets a character from the buffer,
* @param field field to be read
* @return the character
*/ | Gets a character from the buffer | get1 | {
"repo_name": "gfis/dbat",
"path": "src/main/java/org/teherba/xtrans/CharRecord.java",
"license": "apache-2.0",
"size": 13714
} | [
"org.teherba.xtrans.Field"
] | import org.teherba.xtrans.Field; | import org.teherba.xtrans.*; | [
"org.teherba.xtrans"
] | org.teherba.xtrans; | 1,388,504 |
public List<Role> findAllAssignableRoles(boolean showSystemRoles) throws DotDataException;
| List<Role> function(boolean showSystemRoles) throws DotDataException; | /**
* Will retrieve all roles.
* @param showSystemRoles
* @throws DotDataException
* @return
*/ | Will retrieve all roles | findAllAssignableRoles | {
"repo_name": "ggonzales/ksl",
"path": "src/com/dotmarketing/business/RoleAPI.java",
"license": "gpl-3.0",
"size": 8907
} | [
"com.dotmarketing.exception.DotDataException",
"java.util.List"
] | import com.dotmarketing.exception.DotDataException; import java.util.List; | import com.dotmarketing.exception.*; import java.util.*; | [
"com.dotmarketing.exception",
"java.util"
] | com.dotmarketing.exception; java.util; | 387,700 |
public String getContentTypeMIMEType(final String key) {
final String str = ((key == null) ? null : map.get(key.toLowerCase(Locale.US)));
return str;
} | String function(final String key) { final String str = ((key == null) ? null : map.get(key.toLowerCase(Locale.US))); return str; } | /**
* Return the MIME type for a file extension.
*
* @param key the file extension (e.g., "css")
* @return the corresponding MIME type, or null if not found
*/ | Return the MIME type for a file extension | getContentTypeMIMEType | {
"repo_name": "argonium/shortstop",
"path": "src/io/miti/shortstop/util/ContentTypeCache.java",
"license": "mit",
"size": 3252
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 2,404,144 |
public File getLibrariesFile( String... parts )
{
String[] newParts = new String[parts.length + 1];
newParts[0] = "libraries";
System.arraycopy( parts, 0, newParts, 1, parts.length );
return getFile( newParts );
} | File function( String... parts ) { String[] newParts = new String[parts.length + 1]; newParts[0] = STR; System.arraycopy( parts, 0, newParts, 1, parts.length ); return getFile( newParts ); } | /**
* Constructs an absolute path from the "libraries" subdirectory.
*
* @param parts
* The path parts
* @return The absolute file
*/ | Constructs an absolute path from the "libraries" subdirectory | getLibrariesFile | {
"repo_name": "tliron/sincerity",
"path": "components/sincerity/source/com/threecrickets/sincerity/Container.java",
"license": "lgpl-3.0",
"size": 13334
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,162,762 |
public StackInteger stacks(StackInteger stack1, StackInteger stack2) {
this.validateArgs(stack1, stack2);
StackInteger result = new StackInteger(stack1.rows(), stack2.columns());
Iterator<PlateInteger> iter1 = stack1.iterator();
Iterator<PlateInteger> iter2 = stack2.iterator();
while(iter1.hasNext() && iter2.hasNext()) {
PlateInteger resultPlate = this.plates(iter1.next(), iter2.next());
result.add(resultPlate);
}
while(iter1.hasNext()) {
result.add(iter1.next());
}
while(iter2.hasNext()) {
result.add(iter2.next());
}
return result;
} | StackInteger function(StackInteger stack1, StackInteger stack2) { this.validateArgs(stack1, stack2); StackInteger result = new StackInteger(stack1.rows(), stack2.columns()); Iterator<PlateInteger> iter1 = stack1.iterator(); Iterator<PlateInteger> iter2 = stack2.iterator(); while(iter1.hasNext() && iter2.hasNext()) { PlateInteger resultPlate = this.plates(iter1.next(), iter2.next()); result.add(resultPlate); } while(iter1.hasNext()) { result.add(iter1.next()); } while(iter2.hasNext()) { result.add(iter2.next()); } return result; } | /**
* Returns the result of the mathematical operation. Missing data points due
* to data sets of unequal length are treated as zero values.
* @param StackInteger the first stack
* @param StackInteger the second stack
* @return the result of the operation
*/ | Returns the result of the mathematical operation. Missing data points due to data sets of unequal length are treated as zero values | stacks | {
"repo_name": "jessemull/MicroFlex",
"path": "src/main/java/com/github/jessemull/microflex/integerflex/math/MathOperationIntegerBinary.java",
"license": "apache-2.0",
"size": 68307
} | [
"com.github.jessemull.microflex.integerflex.plate.PlateInteger",
"com.github.jessemull.microflex.integerflex.plate.StackInteger",
"java.util.Iterator"
] | import com.github.jessemull.microflex.integerflex.plate.PlateInteger; import com.github.jessemull.microflex.integerflex.plate.StackInteger; import java.util.Iterator; | import com.github.jessemull.microflex.integerflex.plate.*; import java.util.*; | [
"com.github.jessemull",
"java.util"
] | com.github.jessemull; java.util; | 31,633 |
public RestoreSnapshotRequest indexSettings(Settings settings) {
this.indexSettings = settings;
return this;
} | RestoreSnapshotRequest function(Settings settings) { this.indexSettings = settings; return this; } | /**
* Sets settings that should be added/changed in all restored indices
*/ | Sets settings that should be added/changed in all restored indices | indexSettings | {
"repo_name": "ThalaivaStars/OrgRepo1",
"path": "core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java",
"license": "apache-2.0",
"size": 22767
} | [
"org.elasticsearch.common.settings.Settings"
] | import org.elasticsearch.common.settings.Settings; | import org.elasticsearch.common.settings.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 1,464,709 |
public T hl7(Object parser) {
HL7DataFormat hl7 = new HL7DataFormat();
hl7.setParser(parser);
return dataFormat(hl7);
} | T function(Object parser) { HL7DataFormat hl7 = new HL7DataFormat(); hl7.setParser(parser); return dataFormat(hl7); } | /**
* Uses the HL7 data format
*/ | Uses the HL7 data format | hl7 | {
"repo_name": "kevinearls/camel",
"path": "camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java",
"license": "apache-2.0",
"size": 46439
} | [
"org.apache.camel.model.dataformat.HL7DataFormat"
] | import org.apache.camel.model.dataformat.HL7DataFormat; | import org.apache.camel.model.dataformat.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,990,626 |
@Nonnull
public java.util.concurrent.CompletableFuture<IosVppEBookAssignment> deleteAsync() {
return sendAsync(HttpMethod.DELETE, null);
} | java.util.concurrent.CompletableFuture<IosVppEBookAssignment> function() { return sendAsync(HttpMethod.DELETE, null); } | /**
* Delete this item from the service
*
* @return a future with the deletion result
*/ | Delete this item from the service | deleteAsync | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/IosVppEBookAssignmentRequest.java",
"license": "mit",
"size": 6269
} | [
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.IosVppEBookAssignment"
] | import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.IosVppEBookAssignment; | import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; | [
"com.microsoft.graph"
] | com.microsoft.graph; | 1,651,707 |
public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) {
_delegate.emitDirect(taskId, streamId, tuple, messageId);
} | void function(int taskId, String streamId, List<Object> tuple, Object messageId) { _delegate.emitDirect(taskId, streamId, tuple, messageId); } | /**
* Emits a tuple to the specified task on the specified output stream. This output
* stream must have been declared as a direct stream, and the specified task must
* use a direct grouping on this stream to receive the message.
*/ | Emits a tuple to the specified task on the specified output stream. This output stream must have been declared as a direct stream, and the specified task must use a direct grouping on this stream to receive the message | emitDirect | {
"repo_name": "javelinjs/storm",
"path": "src/jvm/backtype/storm/spout/SpoutOutputCollector.java",
"license": "epl-1.0",
"size": 4692
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 809,510 |
public List<Identity> getVisibleIdentitiesByPowerSearch(String login, Map<String, String> userProperties, boolean userPropertiesAsIntersectionSearch,
SecurityGroup[] groups, PermissionOnResourceable[] permissionOnResources, String[] authProviders, Date createdAfter, Date createdBefore); | List<Identity> function(String login, Map<String, String> userProperties, boolean userPropertiesAsIntersectionSearch, SecurityGroup[] groups, PermissionOnResourceable[] permissionOnResources, String[] authProviders, Date createdAfter, Date createdBefore); | /**
* Get a list of identities that match the following conditions. All parameters are additive. NULL values mean "no constraints" (e.g. all parameters NULL would result
* in a list with all identities of the entire system)
*
* @param login
* @param userPropertyHandlers Map of user properties that needs to be matched.
* @param userPropertiesAsIntersectionSearch true: user properties and login name are combined with an AND query; false: user properties and login name are combined
* with an OR query
* @param groups Array of SecurityGroups the user participates in. Search machtches if user is in any of the groups (OR query)
* @param permissionOnResources Array of resource permissions the user has. Search machtches if user has any of the permissions (OR query)
* @param authProviders Array of authenticaton providers the user has. Search machtches if user has any of the authProviders (OR query)
* @param createdAfter date after which the user has been created
* @param createdBefore date before which the user has been created
* @return List of identities
*/ | Get a list of identities that match the following conditions. All parameters are additive. NULL values mean "no constraints" (e.g. all parameters NULL would result in a list with all identities of the entire system) | getVisibleIdentitiesByPowerSearch | {
"repo_name": "RLDevOps/Demo",
"path": "src/main/java/org/olat/basesecurity/BaseSecurity.java",
"license": "apache-2.0",
"size": 15856
} | [
"java.util.Date",
"java.util.List",
"java.util.Map",
"org.olat.core.id.Identity"
] | import java.util.Date; import java.util.List; import java.util.Map; import org.olat.core.id.Identity; | import java.util.*; import org.olat.core.id.*; | [
"java.util",
"org.olat.core"
] | java.util; org.olat.core; | 1,289,623 |
public UpdateRequestBuilder setDoc(IndexRequest indexRequest) {
request.doc(indexRequest);
return this;
} | UpdateRequestBuilder function(IndexRequest indexRequest) { request.doc(indexRequest); return this; } | /**
* Sets the doc to use for updates when a script is not specified.
*/ | Sets the doc to use for updates when a script is not specified | setDoc | {
"repo_name": "robin13/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/action/update/UpdateRequestBuilder.java",
"license": "apache-2.0",
"size": 12166
} | [
"org.elasticsearch.action.index.IndexRequest"
] | import org.elasticsearch.action.index.IndexRequest; | import org.elasticsearch.action.index.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 477,598 |
public static void storeKeyterms(JCas questionView, List<String> keyterms) {
storeConcepts(questionView, keyterms, new ArrayList<String>(),
new ArrayList<String>());
} | static void function(JCas questionView, List<String> keyterms) { storeConcepts(questionView, keyterms, new ArrayList<String>(), new ArrayList<String>()); } | /**
* Store (overwrite) concepts (i.e. key terms) into a view
*
* @param questionView
* @param keyterms
*/ | Store (overwrite) concepts (i.e. key terms) into a view | storeKeyterms | {
"repo_name": "brmson/helloqa",
"path": "src/main/java/edu/cmu/lti/oaqa/openqa/dso/framework/jcas/KeytermJCasManipulator.java",
"license": "apache-2.0",
"size": 4425
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.uima.jcas.JCas"
] | import java.util.ArrayList; import java.util.List; import org.apache.uima.jcas.JCas; | import java.util.*; import org.apache.uima.jcas.*; | [
"java.util",
"org.apache.uima"
] | java.util; org.apache.uima; | 2,247,805 |
public RuleConfiguredTargetBuilder addStarlarkTransitiveInfo(
String name, Object value, Location loc) throws EvalException {
providersBuilder.put(name, value);
return this;
} | RuleConfiguredTargetBuilder function( String name, Object value, Location loc) throws EvalException { providersBuilder.put(name, value); return this; } | /**
* Add a Starlark transitive info. The provider value must be safe (i.e. a String, a Boolean, an
* Integer, an Artifact, a Label, None, a Java TransitiveInfoProvider or something composed from
* these in Starlark using lists, sets, structs or dicts). Otherwise an EvalException is thrown.
*/ | Add a Starlark transitive info. The provider value must be safe (i.e. a String, a Boolean, an Integer, an Artifact, a Label, None, a Java TransitiveInfoProvider or something composed from these in Starlark using lists, sets, structs or dicts). Otherwise an EvalException is thrown | addStarlarkTransitiveInfo | {
"repo_name": "cushon/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java",
"license": "apache-2.0",
"size": 28491
} | [
"net.starlark.java.eval.EvalException",
"net.starlark.java.syntax.Location"
] | import net.starlark.java.eval.EvalException; import net.starlark.java.syntax.Location; | import net.starlark.java.eval.*; import net.starlark.java.syntax.*; | [
"net.starlark.java"
] | net.starlark.java; | 1,765,072 |
public static final <T extends MessageNano> T mergeFrom(T msg, final byte[] data,
final int off, final int len) throws InvalidProtocolBufferNanoException {
try {
final CodedInputByteBufferNano input =
CodedInputByteBufferNano.newInstance(data, off, len);
msg.mergeFrom(input);
input.checkLastTagWas(0);
return msg;
} catch (InvalidProtocolBufferNanoException e) {
throw e;
} catch (IOException e) {
throw new RuntimeException("Reading from a byte array threw an IOException (should "
+ "never happen).");
}
} | static final <T extends MessageNano> T function(T msg, final byte[] data, final int off, final int len) throws InvalidProtocolBufferNanoException { try { final CodedInputByteBufferNano input = CodedInputByteBufferNano.newInstance(data, off, len); msg.mergeFrom(input); input.checkLastTagWas(0); return msg; } catch (InvalidProtocolBufferNanoException e) { throw e; } catch (IOException e) { throw new RuntimeException(STR + STR); } } | /**
* Parse {@code data} as a message of this type and merge it with the
* message being built.
*/ | Parse data as a message of this type and merge it with the message being built | mergeFrom | {
"repo_name": "android-ia/platform_external_protobuf",
"path": "java/src/main/java/com/google/protobuf/nano/MessageNano.java",
"license": "bsd-3-clause",
"size": 6427
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,477,208 |
@Test
public void testReadPDMetadata() throws IOException, URISyntaxException, ParseException {
List<BibEntry> entries = XmpUtilReader.readXmp(Paths.get(XmpUtilShared.class.getResource("PD_metadata.pdf").toURI()), xmpPreferences);
String bibString = Resources.toString(XmpUtilShared.class.getResource("PD_metadata.bib"), StandardCharsets.UTF_8);
Optional<BibEntry> entryFromBibFile = parser.parseSingleEntry(bibString);
Assert.assertEquals(entryFromBibFile.get(), entries.get(0));
} | void function() throws IOException, URISyntaxException, ParseException { List<BibEntry> entries = XmpUtilReader.readXmp(Paths.get(XmpUtilShared.class.getResource(STR).toURI()), xmpPreferences); String bibString = Resources.toString(XmpUtilShared.class.getResource(STR), StandardCharsets.UTF_8); Optional<BibEntry> entryFromBibFile = parser.parseSingleEntry(bibString); Assert.assertEquals(entryFromBibFile.get(), entries.get(0)); } | /**
* Test non XMP metadata. Metadata are included in the PDInformation
*/ | Test non XMP metadata. Metadata are included in the PDInformation | testReadPDMetadata | {
"repo_name": "tobiasdiez/jabref",
"path": "src/test/java/org/jabref/logic/xmp/XmpUtilReaderTest.java",
"license": "mit",
"size": 4410
} | [
"com.google.common.io.Resources",
"java.io.IOException",
"java.net.URISyntaxException",
"java.nio.charset.StandardCharsets",
"java.nio.file.Paths",
"java.util.List",
"java.util.Optional",
"org.jabref.logic.importer.ParseException",
"org.jabref.model.entry.BibEntry",
"org.junit.Assert"
] | import com.google.common.io.Resources; import java.io.IOException; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.List; import java.util.Optional; import org.jabref.logic.importer.ParseException; import org.jabref.model.entry.BibEntry; import org.junit.Assert; | import com.google.common.io.*; import java.io.*; import java.net.*; import java.nio.charset.*; import java.nio.file.*; import java.util.*; import org.jabref.logic.importer.*; import org.jabref.model.entry.*; import org.junit.*; | [
"com.google.common",
"java.io",
"java.net",
"java.nio",
"java.util",
"org.jabref.logic",
"org.jabref.model",
"org.junit"
] | com.google.common; java.io; java.net; java.nio; java.util; org.jabref.logic; org.jabref.model; org.junit; | 531,961 |
public void resetStats() {
mLifeHistory.clear();
mPoisonHistory.clear();
mLife = mDefaultLifeTotal;
mPoison = 0;
mCommanderCasting = 0;
for (CommanderEntry entry : mCommanderDamage) {
entry.mLife = 0;
}
if (mHistoryLifeAdapter != null) {
mHistoryLifeAdapter.notifyDataSetChanged();
}
if (mHistoryPoisonAdapter != null) {
mHistoryPoisonAdapter.notifyDataSetChanged();
}
if (mCommanderDamageAdapter != null) {
mCommanderDamageAdapter.notifyDataSetChanged();
}
if (mLife == -1) {
mLife = LifeCounterFragment.DEFAULT_LIFE;
}
changeValue(0, true);
if (mCommanderCastingButton != null) {
mCommanderCastingButton.setText("" + mCommanderCasting);
}
} | void function() { mLifeHistory.clear(); mPoisonHistory.clear(); mLife = mDefaultLifeTotal; mPoison = 0; mCommanderCasting = 0; for (CommanderEntry entry : mCommanderDamage) { entry.mLife = 0; } if (mHistoryLifeAdapter != null) { mHistoryLifeAdapter.notifyDataSetChanged(); } if (mHistoryPoisonAdapter != null) { mHistoryPoisonAdapter.notifyDataSetChanged(); } if (mCommanderDamageAdapter != null) { mCommanderDamageAdapter.notifyDataSetChanged(); } if (mLife == -1) { mLife = LifeCounterFragment.DEFAULT_LIFE; } changeValue(0, true); if (mCommanderCastingButton != null) { mCommanderCastingButton.setText("" + mCommanderCasting); } } | /**
* Reset the life, poison, and commander damage to default while preserving the name and default life
*/ | Reset the life, poison, and commander damage to default while preserving the name and default life | resetStats | {
"repo_name": "fenfir/mtg-familiar",
"path": "mobile/src/main/java/com/gelakinetic/mtgfam/helpers/LcPlayer.java",
"license": "mit",
"size": 38733
} | [
"com.gelakinetic.mtgfam.fragments.LifeCounterFragment"
] | import com.gelakinetic.mtgfam.fragments.LifeCounterFragment; | import com.gelakinetic.mtgfam.fragments.*; | [
"com.gelakinetic.mtgfam"
] | com.gelakinetic.mtgfam; | 902,479 |
private boolean isLabelValid(String ksLabel) {
if (ksLabel.length() < MIN_KS_LABEL_LENGTH) {
return false;
}
Pattern pattern = Pattern.compile("[A-Za-z0-9_-]+", Pattern.CASE_INSENSITIVE);
Matcher match = pattern.matcher(ksLabel);
return match.matches();
} | boolean function(String ksLabel) { if (ksLabel.length() < MIN_KS_LABEL_LENGTH) { return false; } Pattern pattern = Pattern.compile(STR, Pattern.CASE_INSENSITIVE); Matcher match = pattern.matcher(ksLabel); return match.matches(); } | /**
* Tests to see if a kickstart label is valid or not
* @param ksLabel The label to test
* @return true if it is valid, false otherwise
*/ | Tests to see if a kickstart label is valid or not | isLabelValid | {
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/kickstart/builder/KickstartBuilder.java",
"license": "gpl-2.0",
"size": 29977
} | [
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import java.util.regex.Matcher; import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 237,595 |
VirtualHost createVirtualHost(NetworkId networkId, HostId hostId, MacAddress mac,
VlanId vlan, HostLocation location, Set<IpAddress> ips); | VirtualHost createVirtualHost(NetworkId networkId, HostId hostId, MacAddress mac, VlanId vlan, HostLocation location, Set<IpAddress> ips); | /**
* Creates a new virtual host within the specified network. The host id
* must be unique within the bounds of the network.
*
* @param networkId network identifier
* @param hostId host identifier
* @param mac mac address
* @param vlan vlan identifier
* @param location host location
* @param ips set of ip addresses
* @return newly created virtual host
* @throws org.onlab.util.ItemNotFoundException if no such network found
*/ | Creates a new virtual host within the specified network. The host id must be unique within the bounds of the network | createVirtualHost | {
"repo_name": "osinstom/onos",
"path": "incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java",
"license": "apache-2.0",
"size": 7102
} | [
"java.util.Set",
"org.onlab.packet.IpAddress",
"org.onlab.packet.MacAddress",
"org.onlab.packet.VlanId",
"org.onosproject.net.HostId",
"org.onosproject.net.HostLocation"
] | import java.util.Set; import org.onlab.packet.IpAddress; import org.onlab.packet.MacAddress; import org.onlab.packet.VlanId; import org.onosproject.net.HostId; import org.onosproject.net.HostLocation; | import java.util.*; import org.onlab.packet.*; import org.onosproject.net.*; | [
"java.util",
"org.onlab.packet",
"org.onosproject.net"
] | java.util; org.onlab.packet; org.onosproject.net; | 461,991 |
public void setTusURLStore(TusURLStore store) {
tusURLStore = store;
} | void function(TusURLStore store) { tusURLStore = store; } | /**
* Set custom Url Storage. This should be an implementation of {@link TusURLStore}.
*
* @param store {@link TusURLStore} the storage instance.
*/ | Set custom Url Storage. This should be an implementation of <code>TusURLStore</code> | setTusURLStore | {
"repo_name": "transloadit/java-sdk",
"path": "src/main/java/com/transloadit/sdk/Assembly.java",
"license": "mit",
"size": 23922
} | [
"io.tus.java.client.TusURLStore"
] | import io.tus.java.client.TusURLStore; | import io.tus.java.client.*; | [
"io.tus.java"
] | io.tus.java; | 1,046,505 |
@Override
public void onRestoreInstanceState(Parcelable state) {
d("onRestoreInstanceState");
if (state instanceof Bundle) {
Bundle bundle = (Bundle) state;
mOpen = bundle.getBoolean("mOpen");
// ... load everything
state = bundle.getParcelable("instanceState");
}
super.onRestoreInstanceState(state);
} | void function(Parcelable state) { d(STR); if (state instanceof Bundle) { Bundle bundle = (Bundle) state; mOpen = bundle.getBoolean("mOpen"); state = bundle.getParcelable(STR); } super.onRestoreInstanceState(state); } | /**
* Restores the state of the FAM after a rotation.
*/ | Restores the state of the FAM after a rotation | onRestoreInstanceState | {
"repo_name": "peterfuture/dttv-android",
"path": "dttv/dttv-samples/src/main/java/dttv/app/widget/FloatingActionMenu.java",
"license": "gpl-3.0",
"size": 24947
} | [
"android.os.Bundle",
"android.os.Parcelable"
] | import android.os.Bundle; import android.os.Parcelable; | import android.os.*; | [
"android.os"
] | android.os; | 1,771,745 |
BinaryResource getResource(String resourceId, Object debugInfo) throws IOException; | BinaryResource getResource(String resourceId, Object debugInfo) throws IOException; | /**
* Get the resource with the specified name
* @param resourceId id of the resource
* @param debugInfo helper object for debugging
* @return the resource with the specified name. NULL if not found
* @throws IOException for unexpected behavior.
*/ | Get the resource with the specified name | getResource | {
"repo_name": "MaTriXy/fresco",
"path": "imagepipeline-base/src/main/java/com/facebook/cache/disk/DiskStorage.java",
"license": "bsd-3-clause",
"size": 5980
} | [
"com.facebook.binaryresource.BinaryResource",
"java.io.IOException"
] | import com.facebook.binaryresource.BinaryResource; import java.io.IOException; | import com.facebook.binaryresource.*; import java.io.*; | [
"com.facebook.binaryresource",
"java.io"
] | com.facebook.binaryresource; java.io; | 337,610 |
Set<Tier> getTiers(String tenantDomain) throws APIManagementException; | Set<Tier> getTiers(String tenantDomain) throws APIManagementException; | /**
* Returns a list of pre-defined # {@link org.wso2.carbon.apimgt.api.model.Tier} in the system.
*
* @return Set<Tier>
* @throws APIManagementException if failed to get the predefined tiers
*/ | Returns a list of pre-defined # <code>org.wso2.carbon.apimgt.api.model.Tier</code> in the system | getTiers | {
"repo_name": "hevayo/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIManager.java",
"license": "apache-2.0",
"size": 25015
} | [
"java.util.Set",
"org.wso2.carbon.apimgt.api.model.Tier"
] | import java.util.Set; import org.wso2.carbon.apimgt.api.model.Tier; | import java.util.*; import org.wso2.carbon.apimgt.api.model.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 873,582 |
public EcobeeActionProvider getEcobeeActionProvider() {
return this.actionProvider;
} | EcobeeActionProvider function() { return this.actionProvider; } | /**
* Get the EcobeeActionProvider instance injected by OSGi.
*
* @return the Ecobee Action Provider associated with this Action Service.
*/ | Get the EcobeeActionProvider instance injected by OSGi | getEcobeeActionProvider | {
"repo_name": "openhab/openhab",
"path": "bundles/action/org.openhab.action.ecobee/src/main/java/org/openhab/action/ecobee/internal/EcobeeActionService.java",
"license": "epl-1.0",
"size": 2795
} | [
"org.openhab.binding.ecobee.EcobeeActionProvider"
] | import org.openhab.binding.ecobee.EcobeeActionProvider; | import org.openhab.binding.ecobee.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 2,022,663 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.