method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
@Override
public String getText(Object object) {
String label = ((PixelInCellType)object).getValue();
return label == null || label.length() == 0 ?
getString("_UI_PixelInCellType_type") :
getString("_UI_PixelInCellType_type") + " " + label;
} | String function(Object object) { String label = ((PixelInCellType)object).getValue(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/gml/provider/PixelInCellTypeItemProvider.java",
"license": "apache-2.0",
"size": 3108
} | [
"net.opengis.gml.PixelInCellType"
] | import net.opengis.gml.PixelInCellType; | import net.opengis.gml.*; | [
"net.opengis.gml"
] | net.opengis.gml; | 1,418,059 |
private int handleScrollingMainOrientation(int delta, RecyclerView.Recycler recycler,
RecyclerView.State state) {
if (getChildCount() == 0 || delta == 0) {
return 0;
}
ensureOrientationHelper();
mLayoutState.mShouldRecycle = true;
int layoutDirection;
boolean columnAndRtl = !isMainAxisDirectionHorizontal() && mIsRtl;
if (columnAndRtl) {
layoutDirection = delta < 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START;
} else {
layoutDirection = delta > 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START;
}
int absDelta = Math.abs(delta);
updateLayoutState(layoutDirection, absDelta);
int freeScroll = mLayoutState.mScrollingOffset;
int consumed = freeScroll + fill(recycler, state, mLayoutState);
if (consumed < 0) {
return 0;
}
int scrolled;
if (columnAndRtl) {
scrolled = absDelta > consumed ? -layoutDirection * consumed : delta;
} else {
scrolled = absDelta > consumed ? layoutDirection * consumed : delta;
}
mOrientationHelper.offsetChildren(-scrolled);
mLayoutState.mLastScrollDelta = scrolled;
return scrolled;
} | int function(int delta, RecyclerView.Recycler recycler, RecyclerView.State state) { if (getChildCount() == 0 delta == 0) { return 0; } ensureOrientationHelper(); mLayoutState.mShouldRecycle = true; int layoutDirection; boolean columnAndRtl = !isMainAxisDirectionHorizontal() && mIsRtl; if (columnAndRtl) { layoutDirection = delta < 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START; } else { layoutDirection = delta > 0 ? LayoutState.LAYOUT_END : LayoutState.LAYOUT_START; } int absDelta = Math.abs(delta); updateLayoutState(layoutDirection, absDelta); int freeScroll = mLayoutState.mScrollingOffset; int consumed = freeScroll + fill(recycler, state, mLayoutState); if (consumed < 0) { return 0; } int scrolled; if (columnAndRtl) { scrolled = absDelta > consumed ? -layoutDirection * consumed : delta; } else { scrolled = absDelta > consumed ? layoutDirection * consumed : delta; } mOrientationHelper.offsetChildren(-scrolled); mLayoutState.mLastScrollDelta = scrolled; return scrolled; } | /**
* Handle the scrolling along the direction of {@link #mOrientationHelper}.
*
* @param delta the delta for the amount that is being scrolled
* (either horizontally or vertically)
* @param recycler the Recycler instance
* @param state the Recycler.State instance
* @return the amount actually scrolled
*/ | Handle the scrolling along the direction of <code>#mOrientationHelper</code> | handleScrollingMainOrientation | {
"repo_name": "google/flexbox-layout",
"path": "flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java",
"license": "apache-2.0",
"size": 127399
} | [
"androidx.recyclerview.widget.RecyclerView"
] | import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.*; | [
"androidx.recyclerview"
] | androidx.recyclerview; | 1,842,441 |
@Override
public boolean[] accessList(UUID entityId, UUID userId, UUID tenantId) throws EwpException {
boolean[] accessVector = new boolean[4];
RolePermission permission = getRolePermission(userId, tenantId);
if (permission != null) {
accessVector[0] = permission.getViewOp();
accessVector[1] = permission.getAddOp();
accessVector[2] = permission.getUpdateOp();
accessVector[3] = permission.getDeleteOp();
}
return accessVector;
} | boolean[] function(UUID entityId, UUID userId, UUID tenantId) throws EwpException { boolean[] accessVector = new boolean[4]; RolePermission permission = getRolePermission(userId, tenantId); if (permission != null) { accessVector[0] = permission.getViewOp(); accessVector[1] = permission.getAddOp(); accessVector[2] = permission.getUpdateOp(); accessVector[3] = permission.getDeleteOp(); } return accessVector; } | /**
* Get access vector of EmployeeGroupMember entity for all operation.
* /// :returns: Returns permission bit array against defined set of EmployeeGroupMember operation.
*
* @param entityId
* @param userId
* @param tenantId
* @return boolean[]
*/ | Get access vector of EmployeeGroupMember entity for all operation. :returns: Returns permission bit array against defined set of EmployeeGroupMember operation | accessList | {
"repo_name": "rishabh05/ED",
"path": "employeedirectory/src/main/java/com/eworkplaceapps/employeedirectory/employee/EmployeeGroupMemberAccess.java",
"license": "apache-2.0",
"size": 4975
} | [
"com.eworkplaceapps.platform.exception.EwpException",
"com.eworkplaceapps.platform.security.RolePermission"
] | import com.eworkplaceapps.platform.exception.EwpException; import com.eworkplaceapps.platform.security.RolePermission; | import com.eworkplaceapps.platform.exception.*; import com.eworkplaceapps.platform.security.*; | [
"com.eworkplaceapps.platform"
] | com.eworkplaceapps.platform; | 1,409,547 |
void setFtpClientConfigParameters(Map<String, Object> ftpClientConfigParameters) {
this.ftpClientConfigParameters = new HashMap<>(ftpClientConfigParameters);
} | void setFtpClientConfigParameters(Map<String, Object> ftpClientConfigParameters) { this.ftpClientConfigParameters = new HashMap<>(ftpClientConfigParameters); } | /**
* Used by FtpComponent to provide additional parameters for the FTPClientConfig
*/ | Used by FtpComponent to provide additional parameters for the FTPClientConfig | setFtpClientConfigParameters | {
"repo_name": "punkhorn/camel-upstream",
"path": "components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java",
"license": "apache-2.0",
"size": 14824
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,437,285 |
void read(@Nonnull QDataStream stream); | void read(@Nonnull QDataStream stream); | /**
* Read values from {@link QDataStream}. All local variables will be uninitialized if class doesn't have empty constructor
*
* @param stream the stream
*/ | Read values from <code>QDataStream</code>. All local variables will be uninitialized if class doesn't have empty constructor | read | {
"repo_name": "alesharik/AlesharikWebServer",
"path": "api/src/com/alesharik/webserver/api/qt/QSerializable.java",
"license": "gpl-3.0",
"size": 1456
} | [
"javax.annotation.Nonnull"
] | import javax.annotation.Nonnull; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,947,205 |
public E find(KapuaId scopeId, KapuaId entityId)
throws KapuaException; | E function(KapuaId scopeId, KapuaId entityId) throws KapuaException; | /**
* Find the entity identified by entity and scope identifiers
*
* @param scopeId
* @param entityId
* @return
* @throws KapuaException
*/ | Find the entity identified by entity and scope identifiers | find | {
"repo_name": "cbaerikebc/kapua",
"path": "service/api/src/main/java/org/eclipse/kapua/service/KapuaEntityService.java",
"license": "epl-1.0",
"size": 2467
} | [
"org.eclipse.kapua.KapuaException",
"org.eclipse.kapua.model.id.KapuaId"
] | import org.eclipse.kapua.KapuaException; import org.eclipse.kapua.model.id.KapuaId; | import org.eclipse.kapua.*; import org.eclipse.kapua.model.id.*; | [
"org.eclipse.kapua"
] | org.eclipse.kapua; | 2,670,445 |
public ApiResponse<List<GDPRResponsibleEntity>> gdprEntitiesWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/gdpr/entities";
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"**"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "basicAuth" };
GenericType<List<GDPRResponsibleEntity>> localVarReturnType = new GenericType<List<GDPRResponsibleEntity>>() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} | ApiResponse<List<GDPRResponsibleEntity>> function() throws ApiException { Object localVarPostBody = null; String localVarPath = STR; List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "**" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { STR }; GenericType<List<GDPRResponsibleEntity>> localVarReturnType = new GenericType<List<GDPRResponsibleEntity>>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } | /**
* Fetch entities from the GDPR register
*
* @return ApiResponse<List<GDPRResponsibleEntity>>
* @throws ApiException if fails to make API call
*/ | Fetch entities from the GDPR register | gdprEntitiesWithHttpInfo | {
"repo_name": "LogSentinel/logsentinel-java-client",
"path": "src/main/java/com/logsentinel/api/GdprRegisterApi.java",
"license": "mit",
"size": 18192
} | [
"com.logsentinel.ApiException",
"com.logsentinel.ApiResponse",
"com.logsentinel.Pair",
"com.logsentinel.model.GDPRResponsibleEntity",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"javax.ws.rs.core.GenericType"
] | import com.logsentinel.ApiException; import com.logsentinel.ApiResponse; import com.logsentinel.Pair; import com.logsentinel.model.GDPRResponsibleEntity; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.ws.rs.core.GenericType; | import com.logsentinel.*; import com.logsentinel.model.*; import java.util.*; import javax.ws.rs.core.*; | [
"com.logsentinel",
"com.logsentinel.model",
"java.util",
"javax.ws"
] | com.logsentinel; com.logsentinel.model; java.util; javax.ws; | 275,029 |
public void zoom(final double xmin, final double xmax) {
this.m_zoomArea = null;
IAxis<?> axis = this.getAxisX();
IRangePolicy zoomPolicy = new RangePolicyFixedViewport(new Range(xmin, xmax));
axis.setRangePolicy(zoomPolicy);
} | void function(final double xmin, final double xmax) { this.m_zoomArea = null; IAxis<?> axis = this.getAxisX(); IRangePolicy zoomPolicy = new RangePolicyFixedViewport(new Range(xmin, xmax)); axis.setRangePolicy(zoomPolicy); } | /**
* Zooms to the selected bounds in x-axis.
* <p>
*
* @param xmin
* the lower x bound.
*
* @param xmax
* the upper x bound.
*/ | Zooms to the selected bounds in x-axis. | zoom | {
"repo_name": "cheshirekow/codebase",
"path": "third_party/lcm/lcm-java/jchart2d-code/src/info/monitorenter/gui/chart/ZoomableChart.java",
"license": "gpl-3.0",
"size": 10007
} | [
"info.monitorenter.gui.chart.rangepolicies.RangePolicyFixedViewport",
"info.monitorenter.util.Range"
] | import info.monitorenter.gui.chart.rangepolicies.RangePolicyFixedViewport; import info.monitorenter.util.Range; | import info.monitorenter.gui.chart.rangepolicies.*; import info.monitorenter.util.*; | [
"info.monitorenter.gui",
"info.monitorenter.util"
] | info.monitorenter.gui; info.monitorenter.util; | 420,629 |
@Nullable
private Metadata getAdjustedMetadata(@Nullable Metadata metadata) {
if (metadata == null) {
return null;
}
int length = metadata.length();
int transportStreamTimestampMetadataIndex = C.INDEX_UNSET;
for (int i = 0; i < length; i++) {
Metadata.Entry metadataEntry = metadata.get(i);
if (metadataEntry instanceof PrivFrame) {
PrivFrame privFrame = (PrivFrame) metadataEntry;
if (HlsMediaChunk.PRIV_TIMESTAMP_FRAME_OWNER.equals(privFrame.owner)) {
transportStreamTimestampMetadataIndex = i;
break;
}
}
}
if (transportStreamTimestampMetadataIndex == C.INDEX_UNSET) {
return metadata;
}
if (length == 1) {
return null;
}
Metadata.Entry[] newMetadataEntries = new Metadata.Entry[length - 1];
for (int i = 0; i < length; i++) {
if (i != transportStreamTimestampMetadataIndex) {
int newIndex = i < transportStreamTimestampMetadataIndex ? i : i - 1;
newMetadataEntries[newIndex] = metadata.get(i);
}
}
return new Metadata(newMetadataEntries);
}
} | Metadata function(@Nullable Metadata metadata) { if (metadata == null) { return null; } int length = metadata.length(); int transportStreamTimestampMetadataIndex = C.INDEX_UNSET; for (int i = 0; i < length; i++) { Metadata.Entry metadataEntry = metadata.get(i); if (metadataEntry instanceof PrivFrame) { PrivFrame privFrame = (PrivFrame) metadataEntry; if (HlsMediaChunk.PRIV_TIMESTAMP_FRAME_OWNER.equals(privFrame.owner)) { transportStreamTimestampMetadataIndex = i; break; } } } if (transportStreamTimestampMetadataIndex == C.INDEX_UNSET) { return metadata; } if (length == 1) { return null; } Metadata.Entry[] newMetadataEntries = new Metadata.Entry[length - 1]; for (int i = 0; i < length; i++) { if (i != transportStreamTimestampMetadataIndex) { int newIndex = i < transportStreamTimestampMetadataIndex ? i : i - 1; newMetadataEntries[newIndex] = metadata.get(i); } } return new Metadata(newMetadataEntries); } } | /**
* Strips the private timestamp frame from metadata, if present. See:
* https://github.com/google/ExoPlayer/issues/5063
*/ | Strips the private timestamp frame from metadata, if present. See: HREF | getAdjustedMetadata | {
"repo_name": "saki4510t/ExoPlayer",
"path": "library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java",
"license": "apache-2.0",
"size": 46528
} | [
"androidx.annotation.Nullable",
"com.google.android.exoplayer2.metadata.Metadata",
"com.google.android.exoplayer2.metadata.id3.PrivFrame"
] | import androidx.annotation.Nullable; import com.google.android.exoplayer2.metadata.Metadata; import com.google.android.exoplayer2.metadata.id3.PrivFrame; | import androidx.annotation.*; import com.google.android.exoplayer2.metadata.*; import com.google.android.exoplayer2.metadata.id3.*; | [
"androidx.annotation",
"com.google.android"
] | androidx.annotation; com.google.android; | 2,460,130 |
boolean register(String keyManager, KeyManagerProvider provider); | boolean register(String keyManager, KeyManagerProvider provider); | /**
* Register a new key manager provider, which could be later used to
* build the key manager (uses {@link ConfigurationManager})
*
* @param keyManager String that uniquely identifies a key manager
* @param provider Reference to a key manager provider
* @return {@literal true} if the provider has been registered; {@literal false} otherwise
*/ | Register a new key manager provider, which could be later used to build the key manager (uses <code>ConfigurationManager</code>) | register | {
"repo_name": "icecp/icecp",
"path": "icecp-core/src/main/java/com/intel/icecp/core/security/KeyManagers.java",
"license": "apache-2.0",
"size": 3328
} | [
"com.intel.icecp.core.security.keymanagement.KeyManagerProvider"
] | import com.intel.icecp.core.security.keymanagement.KeyManagerProvider; | import com.intel.icecp.core.security.keymanagement.*; | [
"com.intel.icecp"
] | com.intel.icecp; | 2,079,228 |
CacheBuilder<K, V> strongValues() {
return setValueStrength(Strength.STRONG);
} | CacheBuilder<K, V> strongValues() { return setValueStrength(Strength.STRONG); } | /**
* Specifies that each value (not key) stored in the cache should be strongly referenced.
*
* @throws IllegalStateException if the value strength was already set
*/ | Specifies that each value (not key) stored in the cache should be strongly referenced | strongValues | {
"repo_name": "lshain-android-source/external-guava",
"path": "guava/src/com/google/common/cache/CacheBuilder.java",
"license": "apache-2.0",
"size": 35579
} | [
"com.google.common.cache.LocalCache"
] | import com.google.common.cache.LocalCache; | import com.google.common.cache.*; | [
"com.google.common"
] | com.google.common; | 1,596,884 |
@Override
public int read(byte[] bts, int off, int len) throws IOException {
try {
beforeRead(len);
int n = in.read(bts, off, len);
afterRead(n);
return n;
} catch (IOException e) {
handleIOException(e);
return -1;
}
} | int function(byte[] bts, int off, int len) throws IOException { try { beforeRead(len); int n = in.read(bts, off, len); afterRead(n); return n; } catch (IOException e) { handleIOException(e); return -1; } } | /**
* Invokes the delegate's <code>read(byte[], int, int)</code> method.
* @param bts the buffer to read the bytes into
* @param off The start offset
* @param len The number of bytes to read
* @return the number of bytes read or -1 if the end of stream
* @throws IOException if an I/O error occurs
*/ | Invokes the delegate's <code>read(byte[], int, int)</code> method | read | {
"repo_name": "timmaybrown/commandbox",
"path": "src/java/cliloader/ProxyInputStream.java",
"license": "lgpl-3.0",
"size": 7718
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 237,821 |
Dataverse d = new Dataverse();
Dataverse root = dataverseService.findByAlias("root");
d.setOwner(root);
d.setAlias(dvName);
d.setName(dvName);
d.setAffiliation("affiliation");
d.setPermissionRoot(false);
d.setDescription("description");
d.setDataverseType(Dataverse.DataverseType.RESEARCHERS);
DataverseContact dc = new DataverseContact();
dc.setContactEmail("pete@mailinator.com");
ArrayList<DataverseContact> dcList = new ArrayList<>();
dcList.add(dc);
d.setDataverseContacts(dcList);
try {
d = engineSvc.submit(new CreateDataverseCommand(d, u, null, null));
} catch (EJBException ex) {
Throwable cause = ex;
StringBuilder sb = new StringBuilder();
sb.append("Error creating dataverse.");
while (cause.getCause() != null) {
cause = cause.getCause();
if (cause instanceof ConstraintViolationException) {
ConstraintViolationException constraintViolationException = (ConstraintViolationException) cause;
for (ConstraintViolation<?> violation : constraintViolationException.getConstraintViolations()) {
sb.append(" Invalid value: <<<").append(violation.getInvalidValue()).append(">>> for ").append(violation.getPropertyPath()).append(" at ").append(violation.getLeafBean()).append(" - ").append(violation.getMessage());
}
}
}
logger.log(Level.SEVERE, sb.toString());
System.out.println("Error creating dataverse: " + sb.toString());
throw new ImportException(sb.toString());
} catch (Exception e) {
throw new ImportException(e.getMessage());
}
return d;
} | Dataverse d = new Dataverse(); Dataverse root = dataverseService.findByAlias("root"); d.setOwner(root); d.setAlias(dvName); d.setName(dvName); d.setAffiliation(STR); d.setPermissionRoot(false); d.setDescription(STR); d.setDataverseType(Dataverse.DataverseType.RESEARCHERS); DataverseContact dc = new DataverseContact(); dc.setContactEmail(STR); ArrayList<DataverseContact> dcList = new ArrayList<>(); dcList.add(dc); d.setDataverseContacts(dcList); try { d = engineSvc.submit(new CreateDataverseCommand(d, u, null, null)); } catch (EJBException ex) { Throwable cause = ex; StringBuilder sb = new StringBuilder(); sb.append(STR); while (cause.getCause() != null) { cause = cause.getCause(); if (cause instanceof ConstraintViolationException) { ConstraintViolationException constraintViolationException = (ConstraintViolationException) cause; for (ConstraintViolation<?> violation : constraintViolationException.getConstraintViolations()) { sb.append(STR).append(violation.getInvalidValue()).append(STR).append(violation.getPropertyPath()).append(STR).append(violation.getLeafBean()).append(STR).append(violation.getMessage()); } } } logger.log(Level.SEVERE, sb.toString()); System.out.println(STR + sb.toString()); throw new ImportException(sb.toString()); } catch (Exception e) { throw new ImportException(e.getMessage()); } return d; } | /**
* This is just a convenience method, for testing migration. It creates
* a dummy dataverse with the directory name as dataverse name & alias.
* @param dir
* @param u
* @return
* @throws ImportException
*/ | This is just a convenience method, for testing migration. It creates a dummy dataverse with the directory name as dataverse name & alias | createDataverse | {
"repo_name": "bencomp/dataverse",
"path": "src/main/java/edu/harvard/iq/dataverse/api/imports/ImportServiceBean.java",
"license": "apache-2.0",
"size": 23336
} | [
"edu.harvard.iq.dataverse.Dataverse",
"edu.harvard.iq.dataverse.DataverseContact",
"edu.harvard.iq.dataverse.engine.command.impl.CreateDataverseCommand",
"java.util.ArrayList",
"java.util.logging.Level",
"javax.ejb.EJBException",
"javax.validation.ConstraintViolation",
"javax.validation.ConstraintViol... | import edu.harvard.iq.dataverse.Dataverse; import edu.harvard.iq.dataverse.DataverseContact; import edu.harvard.iq.dataverse.engine.command.impl.CreateDataverseCommand; import java.util.ArrayList; import java.util.logging.Level; import javax.ejb.EJBException; import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; | import edu.harvard.iq.dataverse.*; import edu.harvard.iq.dataverse.engine.command.impl.*; import java.util.*; import java.util.logging.*; import javax.ejb.*; import javax.validation.*; | [
"edu.harvard.iq",
"java.util",
"javax.ejb",
"javax.validation"
] | edu.harvard.iq; java.util; javax.ejb; javax.validation; | 2,715,595 |
@JsonProperty("_id")
public String getId() {
return this.id;
} | @JsonProperty("_id") String function() { return this.id; } | /**
* "_id": "02:00:00:00:00:14"
*/ | "_id": "02:00:00:00:00:14" | getId | {
"repo_name": "dbadia/openhab",
"path": "bundles/binding/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/weather/GetStationsDataResponse.java",
"license": "epl-1.0",
"size": 23138
} | [
"org.codehaus.jackson.annotate.JsonProperty"
] | import org.codehaus.jackson.annotate.JsonProperty; | import org.codehaus.jackson.annotate.*; | [
"org.codehaus.jackson"
] | org.codehaus.jackson; | 2,237,656 |
public List<PDFAnnotation> getAnnots() {
return this.annots;
}
| List<PDFAnnotation> function() { return this.annots; } | /*************************************************************************
* Get a list of all annotations for this PDF page
*
* @return List<PDFAnnotation>
************************************************************************/ | Get a list of all annotations for this PDF page | getAnnots | {
"repo_name": "Bennyz1/PDFrenderer",
"path": "src/com/sun/pdfview/PDFPage.java",
"license": "lgpl-2.1",
"size": 28249
} | [
"com.sun.pdfview.annotation.PDFAnnotation",
"java.util.List"
] | import com.sun.pdfview.annotation.PDFAnnotation; import java.util.List; | import com.sun.pdfview.annotation.*; import java.util.*; | [
"com.sun.pdfview",
"java.util"
] | com.sun.pdfview; java.util; | 698,215 |
@Override
public boolean verifyConnection() {
Connection conn = getEphemeralConnection(true);
if (null == conn) {
return false;
}
boolean result = CentralRepoDbUtil.executeValidationQuery(conn, VALIDATION_QUERY);
CentralRepoDbUtil.closeConnection(conn);
return result;
} | boolean function() { Connection conn = getEphemeralConnection(true); if (null == conn) { return false; } boolean result = CentralRepoDbUtil.executeValidationQuery(conn, VALIDATION_QUERY); CentralRepoDbUtil.closeConnection(conn); return result; } | /**
* Use the current settings and the validation query to test the connection
* to the database.
*
* @return true if successfull connection, else false.
*/ | Use the current settings and the validation query to test the connection to the database | verifyConnection | {
"repo_name": "sleuthkit/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PostgresCentralRepoSettings.java",
"license": "apache-2.0",
"size": 11297
} | [
"java.sql.Connection"
] | import java.sql.Connection; | import java.sql.*; | [
"java.sql"
] | java.sql; | 848,957 |
private boolean pressureMatched(Instant instant, boolean pressed) {
boolean matchPressure = false;
if ((pressed && (instant.Pressure == Constants.UNDER || instant.Pressure == Constants.AVOID)) ||
(!pressed && instant.Pressure == Constants.CLEAR)) {
matchPressure = true;
} else {
matchPressure = false;
}
return matchPressure;
}
| boolean function(Instant instant, boolean pressed) { boolean matchPressure = false; if ((pressed && (instant.Pressure == Constants.UNDER instant.Pressure == Constants.AVOID)) (!pressed && instant.Pressure == Constants.CLEAR)) { matchPressure = true; } else { matchPressure = false; } return matchPressure; } | /**
* Utility method for checking whether an instant is compatible with whether the ball holder is pressed or not
* @param instant The instant checked
* @param pressed The 'pressure status' checked
* @return True if the instant matches the 'pressure status'
*/ | Utility method for checking whether an instant is compatible with whether the ball holder is pressed or not | pressureMatched | {
"repo_name": "lukecampbell99/OpenSoccer",
"path": "src/com/lukeyboy1/core/Match.java",
"license": "gpl-3.0",
"size": 187362
} | [
"com.lukeyboy1.representation.Instant"
] | import com.lukeyboy1.representation.Instant; | import com.lukeyboy1.representation.*; | [
"com.lukeyboy1.representation"
] | com.lukeyboy1.representation; | 1,769,528 |
public void setPropertyClassCache(SimpleCache<Serializable, Object> propertyClassCache)
{
this.propertyClassCache = new EntityLookupCache<Long, Class<?>, String>(
propertyClassCache,
CACHE_REGION_PROPERTY_CLASS,
propertyClassDaoCallback);
}
| void function(SimpleCache<Serializable, Object> propertyClassCache) { this.propertyClassCache = new EntityLookupCache<Long, Class<?>, String>( propertyClassCache, CACHE_REGION_PROPERTY_CLASS, propertyClassDaoCallback); } | /**
* Set the cache to use for <b>alf_prop_class</b> lookups (optional).
*
* @param propertyClassCache the cache of IDs to property classes
*/ | Set the cache to use for alf_prop_class lookups (optional) | setPropertyClassCache | {
"repo_name": "Alfresco/alfresco-repository",
"path": "src/main/java/org/alfresco/repo/domain/propval/AbstractPropertyValueDAOImpl.java",
"license": "lgpl-3.0",
"size": 62653
} | [
"java.io.Serializable",
"org.alfresco.repo.cache.SimpleCache",
"org.alfresco.repo.cache.lookup.EntityLookupCache"
] | import java.io.Serializable; import org.alfresco.repo.cache.SimpleCache; import org.alfresco.repo.cache.lookup.EntityLookupCache; | import java.io.*; import org.alfresco.repo.cache.*; import org.alfresco.repo.cache.lookup.*; | [
"java.io",
"org.alfresco.repo"
] | java.io; org.alfresco.repo; | 220,815 |
EClass getGlobalChoreographyTask(); | EClass getGlobalChoreographyTask(); | /**
* Returns the meta object for class '{@link org.eclipse.bpmn2.GlobalChoreographyTask <em>Global Choreography Task</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Global Choreography Task</em>'.
* @see org.eclipse.bpmn2.GlobalChoreographyTask
* @generated
*/ | Returns the meta object for class '<code>org.eclipse.bpmn2.GlobalChoreographyTask Global Choreography Task</code>'. | getGlobalChoreographyTask | {
"repo_name": "Rikkola/kie-wb-common",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java",
"license": "apache-2.0",
"size": 929298
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,124,295 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
newModule(request, response);
} catch (ParseException e) {
e.printStackTrace();
}
} | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { newModule(request, response); } catch (ParseException e) { e.printStackTrace(); } } | /**
* Standard Java metode for HTTP Post
*
* @param request Et HTTP Request objekt
* @param response Et HTTP Response objekt
* @throws ServletException Standard java exception
* @throws IOException Standard java exception
*/ | Standard Java metode for HTTP Post | doPost | {
"repo_name": "TrumpIT-UiA/Slit",
"path": "src/main/java/moduleManagement/NewModuleServlet.java",
"license": "mit",
"size": 5036
} | [
"java.io.IOException",
"java.text.ParseException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import java.text.ParseException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import java.text.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"java.text",
"javax.servlet"
] | java.io; java.text; javax.servlet; | 2,665,906 |
@Override
public Value evalAssignValue(Env env, Value value) {
Value obj = env.getThis();
obj.putThisField(env, _nameExpr.evalStringValue(env), value);
return value;
} | Value function(Env env, Value value) { Value obj = env.getThis(); obj.putThisField(env, _nameExpr.evalStringValue(env), value); return value; } | /**
* Evaluates the expression.
*
* @param env the calling environment.
* @return the expression value.
*/ | Evaluates the expression | evalAssignValue | {
"repo_name": "CleverCloud/Bianca",
"path": "bianca/src/main/java/com/clevercloud/bianca/expr/ThisFieldVarExpr.java",
"license": "gpl-2.0",
"size": 5231
} | [
"com.clevercloud.bianca.env.Env",
"com.clevercloud.bianca.env.Value"
] | import com.clevercloud.bianca.env.Env; import com.clevercloud.bianca.env.Value; | import com.clevercloud.bianca.env.*; | [
"com.clevercloud.bianca"
] | com.clevercloud.bianca; | 890,724 |
JsonPointer getBasePointer();
| JsonPointer getBasePointer(); | /**
* Returns the JSON pointer of the value which owns this context.
* @return the JSON pointer of the value which owns this context.
*/ | Returns the JSON pointer of the value which owns this context | getBasePointer | {
"repo_name": "i49/Hibiscus",
"path": "hibiscus/src/main/java/com/github/i49/hibiscus/validation/JsonContext.java",
"license": "apache-2.0",
"size": 2193
} | [
"com.github.i49.hibiscus.common.JsonPointer"
] | import com.github.i49.hibiscus.common.JsonPointer; | import com.github.i49.hibiscus.common.*; | [
"com.github.i49"
] | com.github.i49; | 1,538,306 |
@PublicEvolving
public QueryableStateStream<KEY, T> asQueryableState(
String queryableStateName,
ValueStateDescriptor<T> stateDescriptor) {
transform("Queryable state: " + queryableStateName,
getType(),
new QueryableValueStateOperator<>(queryableStateName, stateDescriptor));
stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig());
return new QueryableStateStream<>(
queryableStateName,
stateDescriptor.getSerializer(),
getKeyType().createSerializer(getExecutionConfig()));
} | QueryableStateStream<KEY, T> function( String queryableStateName, ValueStateDescriptor<T> stateDescriptor) { transform(STR + queryableStateName, getType(), new QueryableValueStateOperator<>(queryableStateName, stateDescriptor)); stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig()); return new QueryableStateStream<>( queryableStateName, stateDescriptor.getSerializer(), getKeyType().createSerializer(getExecutionConfig())); } | /**
* Publishes the keyed stream as a queryable ValueState instance.
*
* @param queryableStateName Name under which to the publish the queryable state instance
* @param stateDescriptor State descriptor to create state instance from
* @return Queryable state instance
*/ | Publishes the keyed stream as a queryable ValueState instance | asQueryableState | {
"repo_name": "zohar-mizrahi/flink",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java",
"license": "apache-2.0",
"size": 34115
} | [
"org.apache.flink.api.common.state.ValueStateDescriptor",
"org.apache.flink.streaming.api.functions.query.QueryableValueStateOperator"
] | import org.apache.flink.api.common.state.ValueStateDescriptor; import org.apache.flink.streaming.api.functions.query.QueryableValueStateOperator; | import org.apache.flink.api.common.state.*; import org.apache.flink.streaming.api.functions.query.*; | [
"org.apache.flink"
] | org.apache.flink; | 1,019,797 |
public IGMPGroup deserialize(ByteBuffer bb) throws DeserializationException {
// Make sure there is enough buffer to read the header,
// including the number of sources
checkBufferLength(bb.remaining(), 0, minGroupRecordLen);
recordType = bb.get();
auxDataLength = bb.get();
int nsrcs = bb.getShort();
gaddr = Ip4Address.valueOf(bb.getInt());
for (; nsrcs > 0; nsrcs--) {
// Make sure we have enough buffer to hold all of these sources
checkBufferLength(bb.remaining(), 0, Ip4Address.BYTE_LENGTH * nsrcs);
Ip4Address src = Ip4Address.valueOf(bb.getInt());
this.sources.add(src);
}
if (auxDataLength > 0) {
auxData = new byte[auxDataLength];
bb.get(auxData, 0, auxDataLength);
}
return this;
} | IGMPGroup function(ByteBuffer bb) throws DeserializationException { checkBufferLength(bb.remaining(), 0, minGroupRecordLen); recordType = bb.get(); auxDataLength = bb.get(); int nsrcs = bb.getShort(); gaddr = Ip4Address.valueOf(bb.getInt()); for (; nsrcs > 0; nsrcs--) { checkBufferLength(bb.remaining(), 0, Ip4Address.BYTE_LENGTH * nsrcs); Ip4Address src = Ip4Address.valueOf(bb.getInt()); this.sources.add(src); } if (auxDataLength > 0) { auxData = new byte[auxDataLength]; bb.get(auxData, 0, auxDataLength); } return this; } | /**
* Deserialize the IGMP Membership report packet.
*
* @param bb the ByteBuffer wrapping the serialized message. The position of the
* ByteBuffer should be pointing at the head of either message type.
* @return IGMP Group
* @throws DeserializationException if deserialization fails
*/ | Deserialize the IGMP Membership report packet | deserialize | {
"repo_name": "donNewtonAlpha/onos",
"path": "utils/misc/src/main/java/org/onlab/packet/IGMPMembership.java",
"license": "apache-2.0",
"size": 5111
} | [
"java.nio.ByteBuffer",
"org.onlab.packet.PacketUtils"
] | import java.nio.ByteBuffer; import org.onlab.packet.PacketUtils; | import java.nio.*; import org.onlab.packet.*; | [
"java.nio",
"org.onlab.packet"
] | java.nio; org.onlab.packet; | 2,560,910 |
boolean processHook(Node node) {
Preconditions.checkArgument(
node.getType() == Token.HOOK,
"Expected: HOOK, Got: " + Token.name(node.getType()));
Node condition = node.getFirstChild();
Node ifBranch = condition.getNext();
Node elseBranch = ifBranch.getNext();
boolean thenHasSideEffects = NodeUtil.mayHaveSideEffects(ifBranch);
boolean elseHasSideEffects = NodeUtil.mayHaveSideEffects(elseBranch);
if (thenHasSideEffects || elseHasSideEffects) {
accumulator.keepSimplifiedHookExpression(
node, thenHasSideEffects, elseHasSideEffects);
return false;
} else {
return true;
}
} | boolean processHook(Node node) { Preconditions.checkArgument( node.getType() == Token.HOOK, STR + Token.name(node.getType())); Node condition = node.getFirstChild(); Node ifBranch = condition.getNext(); Node elseBranch = ifBranch.getNext(); boolean thenHasSideEffects = NodeUtil.mayHaveSideEffects(ifBranch); boolean elseHasSideEffects = NodeUtil.mayHaveSideEffects(elseBranch); if (thenHasSideEffects elseHasSideEffects) { accumulator.keepSimplifiedHookExpression( node, thenHasSideEffects, elseHasSideEffects); return false; } else { return true; } } | /**
* Processes a HOOK expression.
*
* @return true to continue traversal, false otherwise
*/ | Processes a HOOK expression | processHook | {
"repo_name": "JonathanWalsh/Granule-Closure-Compiler",
"path": "src/com/google/javascript/jscomp/GatherSideEffectSubexpressionsCallback.java",
"license": "apache-2.0",
"size": 11780
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.Token"
] | import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; | import com.google.common.base.*; import com.google.javascript.rhino.*; | [
"com.google.common",
"com.google.javascript"
] | com.google.common; com.google.javascript; | 1,862,559 |
private String encode(Date date) {
if (date == null) return null;
return INTERNAL_DATE_FORMATTER.format(date);
} | String function(Date date) { if (date == null) return null; return INTERNAL_DATE_FORMATTER.format(date); } | /**
* Helper to encode the date as a String
* @param date
* @return
*/ | Helper to encode the date as a String | encode | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/user/propertyhandlers/DatePropertyHandler.java",
"license": "apache-2.0",
"size": 7385
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,521,475 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } | /**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Handles the HTTP <code>POST</code> method | doPost | {
"repo_name": "imsatyam/skillcheck",
"path": "src/java/com/skill/app/controller/ExaminationServlet.java",
"license": "epl-1.0",
"size": 10991
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 1,327,760 |
@Override
public void doGet( HttpServletRequest request, HttpServletResponse response ) throws IOException{
log.debug("RID URL:"+request.getRequestURI()+"?"+request.getQueryString());
if ( request.getParameter("requestType") == null ) {
handleMissingRequestType(request, response);
return;
}
BasicRequestObject reqObj = RequestObjectFactory.getRequestObject( request );
delegate.getLogger().info("doGet: reqObj:"+reqObj);
int reqTypeCode = RIDRequestObject.INVALID_RID_URL;
if ( reqObj != null ) {
reqTypeCode = reqObj.checkRequest();
}
if ( reqTypeCode == RIDRequestObject.INVALID_RID_URL) {
sendError( response, HttpServletResponse.SC_BAD_REQUEST, "Not a IHE RID URL!" );//missing or wrong request parameter
return;
}
if ( reqTypeCode == RIDRequestObject.RID_REQUEST_NOT_SUPPORTED ) {
sendError( response, HttpServletResponse.SC_NOT_FOUND, "This IHE RID request is not supported!" );
return;
}
RIDResponseObject resp = null; //use RIDResponseObject for encapsulate response.
if ( reqTypeCode == RIDRequestObject.SUMMERY_INFO ) {
resp = delegate.getRIDSummary( (RIDRequestObject) reqObj );
} else if ( reqTypeCode == RIDRequestObject.DOCUMENT ) {
resp = delegate.getRIDDocument( (RIDRequestObject) reqObj );
} else {
sendError( response, HttpServletResponse.SC_NOT_IMPLEMENTED, "This IHE RID request is not yet implemented!" );
return;
}
if ( resp != null ) {
int returnCode = resp.getReturnCode();
delegate.getLogger().info("doGet: resp returnCode:"+returnCode);
if ( returnCode == HttpServletResponse.SC_OK ) {
sendResponse( response, resp );
} else if ( returnCode == HttpServletResponse.SC_TEMPORARY_REDIRECT ) {
response.sendRedirect( resp.getErrorMessage() ); //error message contains redirect host.
} else {
sendError( response, returnCode, resp.getErrorMessage() );
}
} else {
sendError( response, HttpServletResponse.SC_NOT_FOUND, "Not found!" );
}
} | void function( HttpServletRequest request, HttpServletResponse response ) throws IOException{ log.debug(STR+request.getRequestURI()+"?"+request.getQueryString()); if ( request.getParameter(STR) == null ) { handleMissingRequestType(request, response); return; } BasicRequestObject reqObj = RequestObjectFactory.getRequestObject( request ); delegate.getLogger().info(STR+reqObj); int reqTypeCode = RIDRequestObject.INVALID_RID_URL; if ( reqObj != null ) { reqTypeCode = reqObj.checkRequest(); } if ( reqTypeCode == RIDRequestObject.INVALID_RID_URL) { sendError( response, HttpServletResponse.SC_BAD_REQUEST, STR ); return; } if ( reqTypeCode == RIDRequestObject.RID_REQUEST_NOT_SUPPORTED ) { sendError( response, HttpServletResponse.SC_NOT_FOUND, STR ); return; } RIDResponseObject resp = null; if ( reqTypeCode == RIDRequestObject.SUMMERY_INFO ) { resp = delegate.getRIDSummary( (RIDRequestObject) reqObj ); } else if ( reqTypeCode == RIDRequestObject.DOCUMENT ) { resp = delegate.getRIDDocument( (RIDRequestObject) reqObj ); } else { sendError( response, HttpServletResponse.SC_NOT_IMPLEMENTED, STR ); return; } if ( resp != null ) { int returnCode = resp.getReturnCode(); delegate.getLogger().info(STR+returnCode); if ( returnCode == HttpServletResponse.SC_OK ) { sendResponse( response, resp ); } else if ( returnCode == HttpServletResponse.SC_TEMPORARY_REDIRECT ) { response.sendRedirect( resp.getErrorMessage() ); } else { sendError( response, returnCode, resp.getErrorMessage() ); } } else { sendError( response, HttpServletResponse.SC_NOT_FOUND, STR ); } } | /**
* Handles the GET requset.
*
* @param request The http request.
* @param response The http response.
* @throws IOException
*/ | Handles the GET requset | doGet | {
"repo_name": "medicayun/medicayundicom",
"path": "dcm4jboss-all/trunk/dcm4jboss-rid/src/java/org/dcm4chex/rid/web/RIDServlet.java",
"license": "apache-2.0",
"size": 9280
} | [
"java.io.IOException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.dcm4chex.rid.common.BasicRequestObject",
"org.dcm4chex.rid.common.RIDRequestObject",
"org.dcm4chex.rid.common.RIDResponseObject"
] | import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.dcm4chex.rid.common.BasicRequestObject; import org.dcm4chex.rid.common.RIDRequestObject; import org.dcm4chex.rid.common.RIDResponseObject; | import java.io.*; import javax.servlet.http.*; import org.dcm4chex.rid.common.*; | [
"java.io",
"javax.servlet",
"org.dcm4chex.rid"
] | java.io; javax.servlet; org.dcm4chex.rid; | 973,880 |
public void setRawSytaxes(ArrayList<String> rawSytaxes) {
Assert.isNotNull(rawSytaxes);
this.rawSytaxes = rawSytaxes;
}
| void function(ArrayList<String> rawSytaxes) { Assert.isNotNull(rawSytaxes); this.rawSytaxes = rawSytaxes; } | /**
* Sets the raw syntaxes of this command
*
* @param rawSytaxes
* The raw (unprocessed) syntaxes for this command that can be
* used for display purposes
*/ | Sets the raw syntaxes of this command | setRawSytaxes | {
"repo_name": "Krzmbrzl/SQF-EclipsePlugin",
"path": "plugin/Raven.SQDev.Misc/src/raven/sqdev/infoCollection/base/SQFCommand.java",
"license": "mit",
"size": 25597
} | [
"java.util.ArrayList",
"org.eclipse.core.runtime.Assert"
] | import java.util.ArrayList; import org.eclipse.core.runtime.Assert; | import java.util.*; import org.eclipse.core.runtime.*; | [
"java.util",
"org.eclipse.core"
] | java.util; org.eclipse.core; | 1,177,457 |
public List<RafUser> findByRafUserLike(RafUser rafUser,
JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
| List<RafUser> function(RafUser rafUser, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults); | /**
* findByRafUserLike - finds a list of RafUser Like
*
* @param rafUser
* @return the list of RafUser found
*/ | findByRafUserLike - finds a list of RafUser Like | findByRafUserLike | {
"repo_name": "yauritux/venice-legacy",
"path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/RafUserSessionEJBRemote.java",
"license": "apache-2.0",
"size": 2098
} | [
"com.djarum.raf.utilities.JPQLAdvancedQueryCriteria",
"com.gdn.venice.persistence.RafUser",
"java.util.List"
] | import com.djarum.raf.utilities.JPQLAdvancedQueryCriteria; import com.gdn.venice.persistence.RafUser; import java.util.List; | import com.djarum.raf.utilities.*; import com.gdn.venice.persistence.*; import java.util.*; | [
"com.djarum.raf",
"com.gdn.venice",
"java.util"
] | com.djarum.raf; com.gdn.venice; java.util; | 2,388,808 |
void resume(ServiceType service, String hostname, int port) throws IOException; | void resume(ServiceType service, String hostname, int port) throws IOException; | /**
* Resumes the services running on the given host
*/ | Resumes the services running on the given host | resume | {
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-it/src/test/java/org/apache/hadoop/hbase/ClusterManager.java",
"license": "apache-2.0",
"size": 3382
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,343,860 |
Iterator<StructSpec> commonStructs() {
return new Iterator<StructSpec>() {
private final Iterator<String> iter = commonStructNames.iterator(); | Iterator<StructSpec> commonStructs() { return new Iterator<StructSpec>() { private final Iterator<String> iter = commonStructNames.iterator(); | /**
* Returns an iterator that will step through all the common structures.
*/ | Returns an iterator that will step through all the common structures | commonStructs | {
"repo_name": "guozhangwang/kafka",
"path": "generator/src/main/java/org/apache/kafka/message/StructRegistry.java",
"license": "apache-2.0",
"size": 7110
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 955,170 |
private ICacheElement<K, V> readElement( K key )
throws IOException
{
ICacheElement<K, V> object = null;
IndexedDiskElementDescriptor ded = keyHash.get( key );
if ( ded != null )
{
if ( log.isDebugEnabled() )
{
log.debug( logCacheName + "Found on disk, key: " + key );
}
try
{
ICacheElement<K, V> readObject = dataFile.readObject( ded );
object = readObject;
// TODO consider checking key equality and throwing if there is a failure
}
catch ( IOException e )
{
log.error( logCacheName + "IO Exception, Problem reading object from file", e );
throw e;
}
catch ( Exception e )
{
log.error( logCacheName + "Exception, Problem reading object from file", e );
throw new IOException( logCacheName + "Problem reading object from disk. " + e.getMessage() );
}
}
return object;
} | ICacheElement<K, V> function( K key ) throws IOException { ICacheElement<K, V> object = null; IndexedDiskElementDescriptor ded = keyHash.get( key ); if ( ded != null ) { if ( log.isDebugEnabled() ) { log.debug( logCacheName + STR + key ); } try { ICacheElement<K, V> readObject = dataFile.readObject( ded ); object = readObject; } catch ( IOException e ) { log.error( logCacheName + STR, e ); throw e; } catch ( Exception e ) { log.error( logCacheName + STR, e ); throw new IOException( logCacheName + STR + e.getMessage() ); } } return object; } | /**
* Reads the item from disk.
* <p>
* @param key
* @return ICacheElement
* @throws IOException
*/ | Reads the item from disk. | readElement | {
"repo_name": "mohanaraosv/commons-jcs",
"path": "commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCache.java",
"license": "apache-2.0",
"size": 55582
} | [
"java.io.IOException",
"org.apache.commons.jcs.engine.behavior.ICacheElement"
] | import java.io.IOException; import org.apache.commons.jcs.engine.behavior.ICacheElement; | import java.io.*; import org.apache.commons.jcs.engine.behavior.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 1,047,751 |
if (toDelete == null)
throw new NullPointerException ("Can not delete null file");
boolean ok = toDelete.delete ();
if (!ok)
throw new IOException ("Failed to delete file: " +
toDelete.getAbsolutePath ());
} | if (toDelete == null) throw new NullPointerException (STR); boolean ok = toDelete.delete (); if (!ok) throw new IOException (STR + toDelete.getAbsolutePath ()); } | /** Try to delete a file.
* @param toDelete the file to delete
* @throws NullPointerException if toDelete is null
* @throws IOException if file deletion failed
*/ | Try to delete a file | delete | {
"repo_name": "curious-attempt-bunny/rabbit-http-proxy-fake-desktop-headers",
"path": "src/rabbit/io/FileHelper.java",
"license": "apache-2.0",
"size": 1215
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,806,058 |
public void updateFeedbackConversation(FeedbackConversation conversation)
throws Exception; | void function(FeedbackConversation conversation) throws Exception; | /**
* Update feedback conversation.
*
* @param conversation the feedback conversation
* @throws Exception the exception
*/ | Update feedback conversation | updateFeedbackConversation | {
"repo_name": "IHTSDO/OTF-Mapping-Service",
"path": "services/src/main/java/org/ihtsdo/otf/mapping/services/WorkflowService.java",
"license": "apache-2.0",
"size": 15613
} | [
"org.ihtsdo.otf.mapping.model.FeedbackConversation"
] | import org.ihtsdo.otf.mapping.model.FeedbackConversation; | import org.ihtsdo.otf.mapping.model.*; | [
"org.ihtsdo.otf"
] | org.ihtsdo.otf; | 1,963,940 |
public Economy getEconomy() {
return this.econ;
} | Economy function() { return this.econ; } | /**
* Gets the Vault Economy instance.
*
* @return Gets the current economy instance.
*/ | Gets the Vault Economy instance | getEconomy | {
"repo_name": "RockinChaos/ItemJoin",
"path": "src/me/RockinChaos/itemjoin/utils/api/VaultAPI.java",
"license": "lgpl-3.0",
"size": 3448
} | [
"net.milkbowl.vault.economy.Economy"
] | import net.milkbowl.vault.economy.Economy; | import net.milkbowl.vault.economy.*; | [
"net.milkbowl.vault"
] | net.milkbowl.vault; | 353,480 |
public static URI filePathToURI(String path) throws URISyntaxException {
path = path.replace(File.separatorChar, '/');
if (!path.startsWith("/")) { //$NON-NLS-1$
return new URI("file", null, //$NON-NLS-1$
new StringBuilder(path.length() + 1).append('/')
.append(path).toString(), null, null);
}
return new URI("file", null, path, null, null); //$NON-NLS-1$
}
public static interface GeneralExpansionHandler { | static URI function(String path) throws URISyntaxException { path = path.replace(File.separatorChar, '/'); if (!path.startsWith("/")) { return new URI("file", null, new StringBuilder(path.length() + 1).append('/') .append(path).toString(), null, null); } return new URI("file", null, path, null, null); } public static interface GeneralExpansionHandler { | /**
* Converts a file path to URI without accessing file system
* (like {File#toURI()} does).
*
* @param path -
* file path.
* @return - the resulting URI.
* @throws URISyntaxException
*/ | Converts a file path to URI without accessing file system (like {File#toURI()} does) | filePathToURI | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/security/src/main/java/common/org/apache/harmony/security/fortress/PolicyUtils.java",
"license": "apache-2.0",
"size": 23756
} | [
"java.io.File",
"java.net.URISyntaxException"
] | import java.io.File; import java.net.URISyntaxException; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 730,179 |
public static void assertTree(String rootText, String preorder, Tree tree)
{
assertNotNull("tree should be non-null", tree);
assertPreordered(null, preorder, tree);
assertEquals("Comparing root text", rootText, tree.getText());
} | static void function(String rootText, String preorder, Tree tree) { assertNotNull(STR, tree); assertPreordered(null, preorder, tree); assertEquals(STR, rootText, tree.getText()); } | /**
* Asserts a parse tree.
*
* @param rootText the text of the root of the tree.
* @param preorder the preorder traversal of the tree.
* @param tree an ANTLR tree to assert on.
*/ | Asserts a parse tree | assertTree | {
"repo_name": "maguro/aunit",
"path": "junit/src/main/java/com/toolazydogs/aunit/Assert.java",
"license": "apache-2.0",
"size": 13712
} | [
"org.antlr.runtime.tree.Tree",
"org.junit.Assert"
] | import org.antlr.runtime.tree.Tree; import org.junit.Assert; | import org.antlr.runtime.tree.*; import org.junit.*; | [
"org.antlr.runtime",
"org.junit"
] | org.antlr.runtime; org.junit; | 1,078,468 |
private FList<TextRange> improveCamelHumps(@NotNull String name,
int patternIndex,
int nameIndex,
boolean isAsciiName,
int maxFragment,
int minFragment) {
for (int i = minFragment; i < maxFragment; i++) {
if (isUppercasePatternVsLowercaseNameChar(name, patternIndex + i, nameIndex + i)) {
FList<TextRange> ranges = findUppercaseMatchFurther(name, patternIndex + i, nameIndex + i, isAsciiName);
if (ranges != null) {
return prependRange(ranges, nameIndex, i);
}
}
}
return null;
} | FList<TextRange> function(@NotNull String name, int patternIndex, int nameIndex, boolean isAsciiName, int maxFragment, int minFragment) { for (int i = minFragment; i < maxFragment; i++) { if (isUppercasePatternVsLowercaseNameChar(name, patternIndex + i, nameIndex + i)) { FList<TextRange> ranges = findUppercaseMatchFurther(name, patternIndex + i, nameIndex + i, isAsciiName); if (ranges != null) { return prependRange(ranges, nameIndex, i); } } } return null; } | /**
* When pattern is "CU" and the name is "CurrentUser", we already have a prefix "Cu" that matches,
* but we try to find uppercase "U" later in name for better matching degree
*/ | When pattern is "CU" and the name is "CurrentUser", we already have a prefix "Cu" that matches, but we try to find uppercase "U" later in name for better matching degree | improveCamelHumps | {
"repo_name": "leafclick/intellij-community",
"path": "platform/analysis-api/src/com/intellij/psi/codeStyle/MinusculeMatcherImpl.java",
"license": "apache-2.0",
"size": 24111
} | [
"com.intellij.openapi.util.TextRange",
"com.intellij.util.containers.FList",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.openapi.util.TextRange; import com.intellij.util.containers.FList; import org.jetbrains.annotations.NotNull; | import com.intellij.openapi.util.*; import com.intellij.util.containers.*; import org.jetbrains.annotations.*; | [
"com.intellij.openapi",
"com.intellij.util",
"org.jetbrains.annotations"
] | com.intellij.openapi; com.intellij.util; org.jetbrains.annotations; | 2,460,692 |
private String[] sub_variables(String[] variables){
if (variables.length == 0)
return new String[0];
ArrayList<String> sub_variables_tmp = new ArrayList<String>();
String[] sub_variables;
while(sub_variables_tmp.size() == 0) {
for(String v : variables){
if( (Math.random()<0.4) && !sub_variables_tmp.contains(v) ) {
sub_variables_tmp.add(v);
}
}
}
sub_variables = new String[sub_variables_tmp.size()];
System.arraycopy(sub_variables_tmp.toArray(), 0, sub_variables, 0, sub_variables_tmp.size());
return sub_variables;
}
| String[] function(String[] variables){ if (variables.length == 0) return new String[0]; ArrayList<String> sub_variables_tmp = new ArrayList<String>(); String[] sub_variables; while(sub_variables_tmp.size() == 0) { for(String v : variables){ if( (Math.random()<0.4) && !sub_variables_tmp.contains(v) ) { sub_variables_tmp.add(v); } } } sub_variables = new String[sub_variables_tmp.size()]; System.arraycopy(sub_variables_tmp.toArray(), 0, sub_variables, 0, sub_variables_tmp.size()); return sub_variables; } | /** Computes a random sublist of the input list of variables
* @param variables list of variables
* @return a random sublist of variables
*/ | Computes a random sublist of the input list of variables | sub_variables | {
"repo_name": "heniancheng/FRODO",
"path": "src/frodo2/solutionSpaces/hypercube/tests/HypercubeTest.java",
"license": "agpl-3.0",
"size": 72728
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,691,592 |
public List<ActiveUser> list() {
return super.list(new com.eaw1805.data.model.ActiveUser());
} | List<ActiveUser> function() { return super.list(new com.eaw1805.data.model.ActiveUser()); } | /**
* Listing all ActiveUser from the database.
*
* @return a list of all the ActiveUser entries that exist inside the table ActiveUser.
*/ | Listing all ActiveUser from the database | list | {
"repo_name": "EaW1805/data",
"path": "src/main/java/com/eaw1805/data/managers/ActiveUserManager.java",
"license": "mit",
"size": 4162
} | [
"com.eaw1805.data.model.ActiveUser",
"java.util.List"
] | import com.eaw1805.data.model.ActiveUser; import java.util.List; | import com.eaw1805.data.model.*; import java.util.*; | [
"com.eaw1805.data",
"java.util"
] | com.eaw1805.data; java.util; | 359,407 |
return Value.newBuilder().setType(Type.SINT32).setSint32Value(x).build();
} | return Value.newBuilder().setType(Type.SINT32).setSint32Value(x).build(); } | /**
* returns a SINT32 Value
* @param x
* @return
*/ | returns a SINT32 Value | newValue | {
"repo_name": "dhosa/yamcs",
"path": "yamcs-api/src/main/java/org/yamcs/protobuf/ValueHelper.java",
"license": "agpl-3.0",
"size": 1694
} | [
"org.yamcs.protobuf.Yamcs"
] | import org.yamcs.protobuf.Yamcs; | import org.yamcs.protobuf.*; | [
"org.yamcs.protobuf"
] | org.yamcs.protobuf; | 2,058,266 |
public static byte[] getSessionKey() {
// this has to be computed only once.
synchronized (ExchangeServiceBase.class) {
if (ExchangeServiceBase.binarySecret == null) {
Random randomNumberGenerator = new Random();
ExchangeServiceBase.binarySecret = new byte[256 / 8];
randomNumberGenerator.nextBytes(binarySecret);
}
return ExchangeServiceBase.binarySecret;
}
} | static byte[] function() { synchronized (ExchangeServiceBase.class) { if (ExchangeServiceBase.binarySecret == null) { Random randomNumberGenerator = new Random(); ExchangeServiceBase.binarySecret = new byte[256 / 8]; randomNumberGenerator.nextBytes(binarySecret); } return ExchangeServiceBase.binarySecret; } } | /**
* Gets the session key.
*/ | Gets the session key | getSessionKey | {
"repo_name": "relateiq/ews-java-api",
"path": "src/main/java/microsoft/exchange/webservices/data/core/ExchangeServiceBase.java",
"license": "mit",
"size": 28485
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 1,374,125 |
public RestorableMongodbResourcesClient getRestorableMongodbResources() {
return this.restorableMongodbResources;
}
private final CassandraClustersClient cassandraClusters; | RestorableMongodbResourcesClient function() { return this.restorableMongodbResources; } private final CassandraClustersClient cassandraClusters; | /**
* Gets the RestorableMongodbResourcesClient object to access its operations.
*
* @return the RestorableMongodbResourcesClient object.
*/ | Gets the RestorableMongodbResourcesClient object to access its operations | getRestorableMongodbResources | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java",
"license": "mit",
"size": 20901
} | [
"com.azure.resourcemanager.cosmos.fluent.CassandraClustersClient",
"com.azure.resourcemanager.cosmos.fluent.RestorableMongodbResourcesClient"
] | import com.azure.resourcemanager.cosmos.fluent.CassandraClustersClient; import com.azure.resourcemanager.cosmos.fluent.RestorableMongodbResourcesClient; | import com.azure.resourcemanager.cosmos.fluent.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 48,427 |
public static void main(String[] args) throws IOException {
Server server = new Server();
server.startServer(8080);
log.info(String.format("Jersey app started with WADL available at " + "%s/application.wadl", server.serverUri));
server.startSecureServer(8081);
log.info(String.format("Jersey app started with WADL available at " + "%s/application.wadl", server.secureServerUri));
System.out.println("Hit enter to shutdown...");
System.in.read();
server.stopServers();
} | static void function(String[] args) throws IOException { Server server = new Server(); server.startServer(8080); log.info(String.format(STR + STR, server.serverUri)); server.startSecureServer(8081); log.info(String.format(STR + STR, server.secureServerUri)); System.out.println(STR); System.in.read(); server.stopServers(); } | /**
* Main method. Starts http server on port 8080, and starts https server on port 8081.
*
* @param args
* @throws IOException
*/ | Main method. Starts http server on port 8080, and starts https server on port 8081 | main | {
"repo_name": "ch6574/rest-demo",
"path": "src/main/java/hillc/restdemo/Server.java",
"license": "gpl-3.0",
"size": 5660
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 946,640 |
public BigRational rationalLength() {
//BigRational r = new BigRational(length().toString());
return length().getRational();
} | BigRational function() { return length().getRational(); } | /**
* Rational Length.
* @return rational(|ne-sw|**2);
*/ | Rational Length | rationalLength | {
"repo_name": "breandan/java-algebra-system",
"path": "src/edu/jas/root/Rectangle.java",
"license": "gpl-2.0",
"size": 10838
} | [
"edu.jas.arith.BigRational"
] | import edu.jas.arith.BigRational; | import edu.jas.arith.*; | [
"edu.jas.arith"
] | edu.jas.arith; | 2,547,874 |
public static String getResourceAsString(Resource resource)
{
String resourceString = null;
if (resource != null)
{
String resourceClass = resource.getClass().getCanonicalName();
resourceString = resourceClass + ":" + getResourceKey(resource);
}
return resourceString;
} | static String function(Resource resource) { String resourceString = null; if (resource != null) { String resourceClass = resource.getClass().getCanonicalName(); resourceString = resourceClass + ":" + getResourceKey(resource); } return resourceString; } | /**
* <p>
* Returns a {@code String} representation of the specified resource. The format of this representation
* is as follows: {@code resource_fqn:resource_id}, where {@code resource_fqn} is the fully-qualified
* name of the resource class, and {@code resource_id} is the unique identifier of the resource.
* </p>
*
* @param resource the {@code Resource} to be converted.
* @return a {@code String} representation of the resource.
*/ | Returns a String representation of the specified resource. The format of this representation is as follows: resource_fqn:resource_id, where resource_fqn is the fully-qualified name of the resource class, and resource_id is the unique identifier of the resource. | getResourceAsString | {
"repo_name": "picketbox/picketbox",
"path": "security-jboss-sx/acl/src/main/java/org/jboss/security/acl/Util.java",
"license": "lgpl-2.1",
"size": 6901
} | [
"org.jboss.security.authorization.Resource"
] | import org.jboss.security.authorization.Resource; | import org.jboss.security.authorization.*; | [
"org.jboss.security"
] | org.jboss.security; | 754,288 |
// TODO(bazel-team): This is inconsistent with the documentation on CppModel.
public CcLibraryHelper addSources(Iterable<Pair<Artifact, Label>> sources) {
Iterables.addAll(this.sources, sources);
return this;
} | CcLibraryHelper function(Iterable<Pair<Artifact, Label>> sources) { Iterables.addAll(this.sources, sources); return this; } | /**
* Add the corresponding files as source files. These may also be header files, in which case
* they will not be compiled, but also not made visible as includes to dependent rules.
*/ | Add the corresponding files as source files. These may also be header files, in which case they will not be compiled, but also not made visible as includes to dependent rules | addSources | {
"repo_name": "Topher-the-Geek/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java",
"license": "apache-2.0",
"size": 40433
} | [
"com.google.common.collect.Iterables",
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.syntax.Label",
"com.google.devtools.build.lib.util.Pair"
] | import com.google.common.collect.Iterables; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.syntax.Label; import com.google.devtools.build.lib.util.Pair; | import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.syntax.*; import com.google.devtools.build.lib.util.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 1,052,017 |
if ( solid == null ) {
solid = (SFBool)getField( "solid" );
}
return( solid.getValue( ) );
} | if ( solid == null ) { solid = (SFBool)getField( "solid" ); } return( solid.getValue( ) ); } | /** Return the solid boolean value.
* @return The solid boolean value. */ | Return the solid boolean value | getSolid | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/xj3d/sai/internal/node/geometry3d/SAISphere.java",
"license": "gpl-2.0",
"size": 2417
} | [
"org.web3d.x3d.sai.SFBool"
] | import org.web3d.x3d.sai.SFBool; | import org.web3d.x3d.sai.*; | [
"org.web3d.x3d"
] | org.web3d.x3d; | 2,518,655 |
public void setEarliestShipDate(XMLGregorianCalendar value) {
this.earliestShipDate = value;
} | void function(XMLGregorianCalendar value) { this.earliestShipDate = value; } | /**
* Set the value of the EarliestShipDate property.
*
* @param value
*/ | Set the value of the EarliestShipDate property | setEarliestShipDate | {
"repo_name": "VDuda/SyncRunner-Pub",
"path": "src/API/amazon/mws/orders/model/Order.java",
"license": "mit",
"size": 45330
} | [
"javax.xml.datatype.XMLGregorianCalendar"
] | import javax.xml.datatype.XMLGregorianCalendar; | import javax.xml.datatype.*; | [
"javax.xml"
] | javax.xml; | 5,211 |
public List<JFrogPlatformInstance> getJfrogInstances() {
return RepositoriesUtils.getJFrogPlatformInstances();
} | List<JFrogPlatformInstance> function() { return RepositoriesUtils.getJFrogPlatformInstances(); } | /**
* Returns the list of {@link JFrogPlatformInstance} configured.
* Used by Jenkins Jelly for displaying values.
* @return can be empty but never null.
*/ | Returns the list of <code>JFrogPlatformInstance</code> configured. Used by Jenkins Jelly for displaying values | getJfrogInstances | {
"repo_name": "jenkinsci/artifactory-plugin",
"path": "src/main/java/org/jfrog/hudson/AbstractBuildWrapperDescriptor.java",
"license": "apache-2.0",
"size": 8227
} | [
"java.util.List",
"org.jfrog.hudson.util.RepositoriesUtils"
] | import java.util.List; import org.jfrog.hudson.util.RepositoriesUtils; | import java.util.*; import org.jfrog.hudson.util.*; | [
"java.util",
"org.jfrog.hudson"
] | java.util; org.jfrog.hudson; | 423,771 |
private static long of(final int year, final int month) {
long millis = utcMillisAtStartOfYear(year);
millis += getTotalMillisByYearMonth(year, month);
return millis;
}
/**
* Returns the current UTC date-time with milliseconds precision.
* In Java 9+ (as opposed to Java 8) the {@code Clock} implementation uses system's best clock implementation (which could mean
* that the precision of the clock can be milliseconds, microseconds or nanoseconds), whereas in Java 8
* {@code System.currentTimeMillis()} is always used. To account for these differences, this method defines a new {@code Clock} | static long function(final int year, final int month) { long millis = utcMillisAtStartOfYear(year); millis += getTotalMillisByYearMonth(year, month); return millis; } /** * Returns the current UTC date-time with milliseconds precision. * In Java 9+ (as opposed to Java 8) the {@code Clock} implementation uses system's best clock implementation (which could mean * that the precision of the clock can be milliseconds, microseconds or nanoseconds), whereas in Java 8 * {@code System.currentTimeMillis()} is always used. To account for these differences, this method defines a new {@code Clock} | /**
* Return the first day of the month
* @param year the year to return
* @param month the month to return, ranging from 1-12
* @return the milliseconds since the epoch of the first day of the month in the year
*/ | Return the first day of the month | of | {
"repo_name": "gingerwizard/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/time/DateUtils.java",
"license": "apache-2.0",
"size": 18162
} | [
"java.time.Clock",
"org.elasticsearch.common.time.DateUtilsRounding"
] | import java.time.Clock; import org.elasticsearch.common.time.DateUtilsRounding; | import java.time.*; import org.elasticsearch.common.time.*; | [
"java.time",
"org.elasticsearch.common"
] | java.time; org.elasticsearch.common; | 1,510,512 |
@SuppressWarnings("unchecked")
protected IProject getSelectionProject() {
Iterator it = selection.iterator();
if (it.hasNext()) {
Object obj = it.next();
IResource selectedResource = null;
if (obj instanceof IResource) {
selectedResource = (IResource) obj;
} else if (obj instanceof IAdaptable) {
selectedResource = (IResource) ((IAdaptable) obj)
.getAdapter(IResource.class);
}
if (selectedResource != null) {
if(!(selectedResource instanceof IFolder &&
OfsCore.isOfsModelPackage((IFolder) selectedResource))) {
selectedResource = selectedResource.getProject().getFolder(model);
}
}
if (selectedResource != null && selectedResource instanceof IFolder) {
IFolder selectedFolder = (IFolder) selectedResource;
return selectedFolder.getProject();
}
}
return null;
} | @SuppressWarnings(STR) IProject function() { Iterator it = selection.iterator(); if (it.hasNext()) { Object obj = it.next(); IResource selectedResource = null; if (obj instanceof IResource) { selectedResource = (IResource) obj; } else if (obj instanceof IAdaptable) { selectedResource = (IResource) ((IAdaptable) obj) .getAdapter(IResource.class); } if (selectedResource != null) { if(!(selectedResource instanceof IFolder && OfsCore.isOfsModelPackage((IFolder) selectedResource))) { selectedResource = selectedResource.getProject().getFolder(model); } } if (selectedResource != null && selectedResource instanceof IFolder) { IFolder selectedFolder = (IFolder) selectedResource; return selectedFolder.getProject(); } } return null; } | /** This method returns the rule model file for the current selection.
* If the current selection is not a rule model folder, it returns null.
* @return
*/ | This method returns the rule model file for the current selection. If the current selection is not a rule model folder, it returns null | getSelectionProject | {
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/rule/ui/com.odcgroup.visualrules.integration.ui/src/main/java/com/odcgroup/visualrules/integration/ui/wizard/NewRuleFromTemplateCreationWizard.java",
"license": "epl-1.0",
"size": 2777
} | [
"com.odcgroup.workbench.core.OfsCore",
"java.util.Iterator",
"org.eclipse.core.resources.IFolder",
"org.eclipse.core.resources.IProject",
"org.eclipse.core.resources.IResource",
"org.eclipse.core.runtime.IAdaptable"
] | import com.odcgroup.workbench.core.OfsCore; import java.util.Iterator; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IAdaptable; | import com.odcgroup.workbench.core.*; import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; | [
"com.odcgroup.workbench",
"java.util",
"org.eclipse.core"
] | com.odcgroup.workbench; java.util; org.eclipse.core; | 1,006,534 |
private static BiConsumer<IntegerCopyNumberState, DataLine> getBaselineCopyNumberRecordToDataLineEncoder() {
return (baselineCopyNumberState, dataLine) -> dataLine.append(baselineCopyNumberState.getCopyNumber());
} | static BiConsumer<IntegerCopyNumberState, DataLine> function() { return (baselineCopyNumberState, dataLine) -> dataLine.append(baselineCopyNumberState.getCopyNumber()); } | /**
* Generates an instance of {@link DataLine} from {@link IntegerCopyNumberState} for writing baseline
* copy-number collection to a file.
*/ | Generates an instance of <code>DataLine</code> from <code>IntegerCopyNumberState</code> for writing baseline copy-number collection to a file | getBaselineCopyNumberRecordToDataLineEncoder | {
"repo_name": "broadinstitute/hellbender",
"path": "src/main/java/org/broadinstitute/hellbender/tools/copynumber/formats/collections/BaselineCopyNumberCollection.java",
"license": "bsd-3-clause",
"size": 2323
} | [
"java.util.function.BiConsumer",
"org.broadinstitute.hellbender.tools.copynumber.gcnv.IntegerCopyNumberState",
"org.broadinstitute.hellbender.utils.tsv.DataLine"
] | import java.util.function.BiConsumer; import org.broadinstitute.hellbender.tools.copynumber.gcnv.IntegerCopyNumberState; import org.broadinstitute.hellbender.utils.tsv.DataLine; | import java.util.function.*; import org.broadinstitute.hellbender.tools.copynumber.gcnv.*; import org.broadinstitute.hellbender.utils.tsv.*; | [
"java.util",
"org.broadinstitute.hellbender"
] | java.util; org.broadinstitute.hellbender; | 1,705,229 |
public java.sql.Date getCurrentDate(); | java.sql.Date function(); | /**
* Gets the current date based on a system parameter USE_PROCESS_DATE_IND: <br>
* 1) If USE_PROCESS_DATE_IND = Y (true), get the value from CURRENT_PROCESS_DATE. <br>
* 2) If USE_PROCESS_DATE_IND = N (false), get the current date from the local system using standard Java API.
*
* @return the current date
*/ | 1) If USE_PROCESS_DATE_IND = Y (true), get the value from CURRENT_PROCESS_DATE. 2) If USE_PROCESS_DATE_IND = N (false), get the current date from the local system using standard Java API | getCurrentDate | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/document/service/KEMService.java",
"license": "apache-2.0",
"size": 4028
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,292,357 |
protected void checkProperty(String propertyId)
throws XMLConfigurationException {
// check property
if (!fRecognizedProperties.contains(propertyId)) {
if (fParentSettings != null) {
fParentSettings.getProperty(propertyId);
}
else {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, propertyId);
}
}
} // checkProperty(String) | void function(String propertyId) throws XMLConfigurationException { if (!fRecognizedProperties.contains(propertyId)) { if (fParentSettings != null) { fParentSettings.getProperty(propertyId); } else { short type = XMLConfigurationException.NOT_RECOGNIZED; throw new XMLConfigurationException(type, propertyId); } } } | /**
* Check a property. If the property is known and supported, this method
* simply returns. Otherwise, the appropriate exception is thrown.
*
* @param propertyId The unique identifier (URI) of the property
* being set.
* @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
* requested feature is not known.
*/ | Check a property. If the property is known and supported, this method simply returns. Otherwise, the appropriate exception is thrown | checkProperty | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jaxp/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java",
"license": "gpl-2.0",
"size": 9289
} | [
"com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException"
] | import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; | import com.sun.org.apache.xerces.internal.xni.parser.*; | [
"com.sun.org"
] | com.sun.org; | 1,626,094 |
@Override
public void deleteGroupDescription(DeviceId deviceId,
GroupKey appCookie) {
// Check if a group is existing with the provided key
StoredGroupEntry existing = (groupEntriesByKey.get(deviceId) != null) ?
groupEntriesByKey.get(deviceId).get(appCookie) :
null;
if (existing == null) {
return;
}
synchronized (existing) {
existing.setState(GroupState.PENDING_DELETE);
}
notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, existing));
} | void function(DeviceId deviceId, GroupKey appCookie) { StoredGroupEntry existing = (groupEntriesByKey.get(deviceId) != null) ? groupEntriesByKey.get(deviceId).get(appCookie) : null; if (existing == null) { return; } synchronized (existing) { existing.setState(GroupState.PENDING_DELETE); } notifyDelegate(new GroupEvent(Type.GROUP_REMOVE_REQUESTED, existing)); } | /**
* Triggers deleting the existing group entry.
*
* @param deviceId the device ID
* @param appCookie the group key
*/ | Triggers deleting the existing group entry | deleteGroupDescription | {
"repo_name": "kuangrewawa/onos",
"path": "core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java",
"license": "apache-2.0",
"size": 21269
} | [
"org.onosproject.net.DeviceId",
"org.onosproject.net.group.Group",
"org.onosproject.net.group.GroupEvent",
"org.onosproject.net.group.GroupKey",
"org.onosproject.net.group.StoredGroupEntry"
] | import org.onosproject.net.DeviceId; import org.onosproject.net.group.Group; import org.onosproject.net.group.GroupEvent; import org.onosproject.net.group.GroupKey; import org.onosproject.net.group.StoredGroupEntry; | import org.onosproject.net.*; import org.onosproject.net.group.*; | [
"org.onosproject.net"
] | org.onosproject.net; | 903,936 |
public void executeAction() {
if (this.isEnabled()) {
ActionEvent event = new ActionEvent(this, this.getActionCommand());
for (ActionListener listener : listeners) {
listener.actionPerformed(event);
}
}
} | void function() { if (this.isEnabled()) { ActionEvent event = new ActionEvent(this, this.getActionCommand()); for (ActionListener listener : listeners) { listener.actionPerformed(event); } } } | /**
* Call all the listeners to execute their reaction to the action command name.
*/ | Call all the listeners to execute their reaction to the action command name | executeAction | {
"repo_name": "sacooper/ECSE-429-Project-Group1",
"path": "ca.mcgill.sel.ram.gui/src/ca/mcgill/sel/ram/ui/components/RamButton.java",
"license": "gpl-2.0",
"size": 13404
} | [
"ca.mcgill.sel.ram.ui.events.listeners.ActionListener"
] | import ca.mcgill.sel.ram.ui.events.listeners.ActionListener; | import ca.mcgill.sel.ram.ui.events.listeners.*; | [
"ca.mcgill.sel"
] | ca.mcgill.sel; | 2,166,241 |
@NonNull
public static List<FeedItem> getDownloadedItems() {
Log.d(TAG, "getDownloadedItems() called");
PodDBAdapter adapter = PodDBAdapter.getInstance();
adapter.open();
try (Cursor cursor = adapter.getDownloadedItemsCursor()) {
List<FeedItem> items = extractItemlistFromCursor(adapter, cursor);
loadAdditionalFeedItemListData(items);
Collections.sort(items, new FeedItemPubdateComparator());
return items;
} finally {
adapter.close();
}
} | static List<FeedItem> function() { Log.d(TAG, STR); PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); try (Cursor cursor = adapter.getDownloadedItemsCursor()) { List<FeedItem> items = extractItemlistFromCursor(adapter, cursor); loadAdditionalFeedItemListData(items); Collections.sort(items, new FeedItemPubdateComparator()); return items; } finally { adapter.close(); } } | /**
* Loads a list of FeedItems whose episode has been downloaded.
*
* @return A list of FeedItems whose episdoe has been downloaded.
*/ | Loads a list of FeedItems whose episode has been downloaded | getDownloadedItems | {
"repo_name": "johnjohndoe/AntennaPod",
"path": "core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java",
"license": "mit",
"size": 34357
} | [
"android.database.Cursor",
"android.util.Log",
"de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator",
"de.danoeh.antennapod.model.feed.FeedItem",
"java.util.Collections",
"java.util.List"
] | import android.database.Cursor; import android.util.Log; import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator; import de.danoeh.antennapod.model.feed.FeedItem; import java.util.Collections; import java.util.List; | import android.database.*; import android.util.*; import de.danoeh.antennapod.core.util.comparator.*; import de.danoeh.antennapod.model.feed.*; import java.util.*; | [
"android.database",
"android.util",
"de.danoeh.antennapod",
"java.util"
] | android.database; android.util; de.danoeh.antennapod; java.util; | 1,946,597 |
public void setBigDecimal(BigDecimal bigDecimalValue) {
byte[] valueBytes = Bytes.toBytes(bigDecimalValue);
rawBytes = new byte[OFFSET + valueBytes.length];
rawBytes[0] = TYPE_BIG_DECIMAL;
Bytes.putBytes(rawBytes, OFFSET, valueBytes, 0, valueBytes.length);
} | void function(BigDecimal bigDecimalValue) { byte[] valueBytes = Bytes.toBytes(bigDecimalValue); rawBytes = new byte[OFFSET + valueBytes.length]; rawBytes[0] = TYPE_BIG_DECIMAL; Bytes.putBytes(rawBytes, OFFSET, valueBytes, 0, valueBytes.length); } | /**
* Sets the wrapped value as {@code BigDecimal} value.
*
* @param bigDecimalValue value
*/ | Sets the wrapped value as BigDecimal value | setBigDecimal | {
"repo_name": "Venom590/gradoop",
"path": "gradoop-common/src/main/java/org/gradoop/common/model/impl/properties/PropertyValue.java",
"license": "gpl-3.0",
"size": 25827
} | [
"java.math.BigDecimal",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.math.BigDecimal; import org.apache.hadoop.hbase.util.Bytes; | import java.math.*; import org.apache.hadoop.hbase.util.*; | [
"java.math",
"org.apache.hadoop"
] | java.math; org.apache.hadoop; | 319,618 |
protected static DataTypeService prepareDataTypeService(final Object... objects) {
return prepareService(DataTypeService.class, ShareBean.class, objects);
} | static DataTypeService function(final Object... objects) { return prepareService(DataTypeService.class, ShareBean.class, objects); } | /**
* <p>Prepares a DataType Service instance. If the given Objects are
* present, then an internal Share Bean is set and so is the given
* resources. If no Objects are given, an empty service instance is
* returned without any bean or other settings set.</p>
*
* @param objects Resources to be injected into Service instance
* @return New Service instance with given resources injected
*/ | Prepares a DataType Service instance. If the given Objects are present, then an internal Share Bean is set and so is the given resources. If no Objects are given, an empty service instance is returned without any bean or other settings set | prepareDataTypeService | {
"repo_name": "JavaDogs/cws",
"path": "cws-rest/src/test/java/net/haugr/cws/rest/BeanSetup.java",
"license": "apache-2.0",
"size": 9242
} | [
"net.haugr.cws.core.ShareBean"
] | import net.haugr.cws.core.ShareBean; | import net.haugr.cws.core.*; | [
"net.haugr.cws"
] | net.haugr.cws; | 2,245,476 |
private void resizeGround() {
ground.getFixtureList().clear();
float width = camera.viewportWidth / Helper.PIXEL_METER;
PolygonShape shape= new PolygonShape();
shape.setAsBox(width / 2, Helper.BORDER_HEIGHT / 2);
//Fixture fixture = Helper.createShape(ground, shape, "ground");
Helper.createShape(ground, shape, "ground");
shape.dispose();
} | void function() { ground.getFixtureList().clear(); float width = camera.viewportWidth / Helper.PIXEL_METER; PolygonShape shape= new PolygonShape(); shape.setAsBox(width / 2, Helper.BORDER_HEIGHT / 2); Helper.createShape(ground, shape, STR); shape.dispose(); } | /**
* Configure the ground size according the screen size
*/ | Configure the ground size according the screen size | resizeGround | {
"repo_name": "edvaldoszy/Topicos2015-3",
"path": "FlappyBird/core/src/com/edvaldotsi/flappybird/screen/GameScreen.java",
"license": "gpl-2.0",
"size": 11476
} | [
"com.badlogic.gdx.physics.box2d.PolygonShape",
"com.edvaldotsi.flappybird.util.Helper"
] | import com.badlogic.gdx.physics.box2d.PolygonShape; import com.edvaldotsi.flappybird.util.Helper; | import com.badlogic.gdx.physics.box2d.*; import com.edvaldotsi.flappybird.util.*; | [
"com.badlogic.gdx",
"com.edvaldotsi.flappybird"
] | com.badlogic.gdx; com.edvaldotsi.flappybird; | 2,238,032 |
public boolean isRequired(Path field) {
LOGGER.debug("Checking if {} is queried", field);
boolean ret=isRequired(field, Path.EMPTY);
LOGGER.debug("{} queried:{}",field,ret);
return ret;
} | boolean function(Path field) { LOGGER.debug(STR, field); boolean ret=isRequired(field, Path.EMPTY); LOGGER.debug(STR,field,ret); return ret; } | /**
* Returns if the field is required to evaluate this query
*
* @param field The field
*/ | Returns if the field is required to evaluate this query | isRequired | {
"repo_name": "bserdar/lightblue-core",
"path": "query-api/src/main/java/com/redhat/lightblue/query/QueryExpression.java",
"license": "gpl-3.0",
"size": 6634
} | [
"com.redhat.lightblue.util.Path"
] | import com.redhat.lightblue.util.Path; | import com.redhat.lightblue.util.*; | [
"com.redhat.lightblue"
] | com.redhat.lightblue; | 2,367,715 |
@DebugLog
@OnClick(R.id.term_of_service_bbtn_agree_and_go_to_next)
public void agreeAndGoToNextClicked() {
startActivity(new Intent(TermOfServiceActivity.this, SignUpActivity.class));
finish();
} | @OnClick(R.id.term_of_service_bbtn_agree_and_go_to_next) void function() { startActivity(new Intent(TermOfServiceActivity.this, SignUpActivity.class)); finish(); } | /**
* Methods call when agree and go to next button clicked.
*/ | Methods call when agree and go to next button clicked | agreeAndGoToNextClicked | {
"repo_name": "DataSaver-Dev/DataSaver-Android",
"path": "app/src/main/java/com/datasaver/www/activities/term_of_service/TermOfServiceActivity.java",
"license": "apache-2.0",
"size": 4637
} | [
"android.content.Intent",
"com.datasaver.www.activities.sign_up.SignUpActivity"
] | import android.content.Intent; import com.datasaver.www.activities.sign_up.SignUpActivity; | import android.content.*; import com.datasaver.www.activities.sign_up.*; | [
"android.content",
"com.datasaver.www"
] | android.content; com.datasaver.www; | 2,434,971 |
public synchronized void internalRemoveRelationship(Relationship relationship) {
if (relationship == null) {
return;
}
Map<Relationship, Relationship> relationships = getRelationships().get(relationship.getType());
if (relationships == null) {
if (this.allRelationships != null && this.allRelationships.contains(relationship)) {
this.network.removeRelationship(relationship);
this.allRelationships.remove(relationship);
}
return;
}
Relationship existing = relationships.remove(relationship);
if (existing == null) {
if (this.allRelationships != null && this.allRelationships.contains(relationship)) {
this.network.removeRelationship(relationship);
this.allRelationships.remove(relationship);
}
return;
}
this.network.removeRelationship(existing);
// Also remove from allRelationships
if (this.allRelationships != null) {
this.allRelationships.remove(existing);
}
if (relationships.isEmpty()) {
getRelationships().remove(relationship.getType());
return;
}
// Fix indexes.
for (Relationship each : relationships.values()) {
if (each.getIndex() > relationship.getIndex()) {
each.setIndex(each.getIndex() - 1);
}
}
}
| synchronized void function(Relationship relationship) { if (relationship == null) { return; } Map<Relationship, Relationship> relationships = getRelationships().get(relationship.getType()); if (relationships == null) { if (this.allRelationships != null && this.allRelationships.contains(relationship)) { this.network.removeRelationship(relationship); this.allRelationships.remove(relationship); } return; } Relationship existing = relationships.remove(relationship); if (existing == null) { if (this.allRelationships != null && this.allRelationships.contains(relationship)) { this.network.removeRelationship(relationship); this.allRelationships.remove(relationship); } return; } this.network.removeRelationship(existing); if (this.allRelationships != null) { this.allRelationships.remove(existing); } if (relationships.isEmpty()) { getRelationships().remove(relationship.getType()); return; } for (Relationship each : relationships.values()) { if (each.getIndex() > relationship.getIndex()) { each.setIndex(each.getIndex() - 1); } } } | /**
* Remove the relationship.
*/ | Remove the relationship | internalRemoveRelationship | {
"repo_name": "BOTlibre/BOTlibre",
"path": "micro-ai-engine/android/source/org/botlibre/knowledge/BasicVertex.java",
"license": "epl-1.0",
"size": 152940
} | [
"java.util.Map",
"org.botlibre.api.knowledge.Relationship"
] | import java.util.Map; import org.botlibre.api.knowledge.Relationship; | import java.util.*; import org.botlibre.api.knowledge.*; | [
"java.util",
"org.botlibre.api"
] | java.util; org.botlibre.api; | 910,075 |
public ResourceResolver getResourceResolver() {
if (mResourceResolver == null) {
String theme = mConfigChooser.getThemeName();
if (theme == null) {
displayError("Missing theme.");
return null;
}
boolean isProjectTheme = mConfigChooser.getConfiguration().isProjectTheme();
Map<ResourceType, Map<String, ResourceValue>> configuredProjectRes =
getConfiguredProjectResources();
// Get the framework resources
Map<ResourceType, Map<String, ResourceValue>> frameworkResources =
getConfiguredFrameworkResources();
if (configuredProjectRes == null) {
displayError("Missing project resources for current configuration.");
return null;
}
if (frameworkResources == null) {
displayError("Missing framework resources.");
return null;
}
mResourceResolver = ResourceResolver.create(
configuredProjectRes, frameworkResources,
theme, isProjectTheme);
}
return mResourceResolver;
} | ResourceResolver function() { if (mResourceResolver == null) { String theme = mConfigChooser.getThemeName(); if (theme == null) { displayError(STR); return null; } boolean isProjectTheme = mConfigChooser.getConfiguration().isProjectTheme(); Map<ResourceType, Map<String, ResourceValue>> configuredProjectRes = getConfiguredProjectResources(); Map<ResourceType, Map<String, ResourceValue>> frameworkResources = getConfiguredFrameworkResources(); if (configuredProjectRes == null) { displayError(STR); return null; } if (frameworkResources == null) { displayError(STR); return null; } mResourceResolver = ResourceResolver.create( configuredProjectRes, frameworkResources, theme, isProjectTheme); } return mResourceResolver; } | /**
* Returns the {@link ResourceResolver} for this editor
*
* @return the resolver used to resolve resources for the current configuration of
* this editor, or null
*/ | Returns the <code>ResourceResolver</code> for this editor | getResourceResolver | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java",
"license": "gpl-2.0",
"size": 114055
} | [
"com.android.ide.common.rendering.api.ResourceValue",
"com.android.ide.common.resources.ResourceResolver",
"com.android.resources.ResourceType",
"java.util.Map"
] | import com.android.ide.common.rendering.api.ResourceValue; import com.android.ide.common.resources.ResourceResolver; import com.android.resources.ResourceType; import java.util.Map; | import com.android.ide.common.rendering.api.*; import com.android.ide.common.resources.*; import com.android.resources.*; import java.util.*; | [
"com.android.ide",
"com.android.resources",
"java.util"
] | com.android.ide; com.android.resources; java.util; | 2,273,029 |
void setAttribute(PerunSession sess, String key, Attribute attribute) throws WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException; | void setAttribute(PerunSession sess, String key, Attribute attribute) throws WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException; | /**
* Stores entityless attribute (associated with string key).
* @param sess perun session
* @param key store the attribute for this key
* @param attribute attribute to set
* @throws InternalErrorException if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException
* @throws WrongAttributeValueException if the attribute value is illegal
* @throws WrongAttributeAssignmentException if attribute is not entityless attribute
* @throws WrongReferenceAttributeValueException
*/ | Stores entityless attribute (associated with string key) | setAttribute | {
"repo_name": "zlamalp/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/AttributesManagerBl.java",
"license": "bsd-2-clause",
"size": 244560
} | [
"cz.metacentrum.perun.core.api.Attribute",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException",
"cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException",
"cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeVal... | import cz.metacentrum.perun.core.api.Attribute; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException; import cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 1,814,014 |
public boolean exportCsvEmails() throws FileNotFoundException, IOException, InfoLetterException {
boolean exportOk = true;
FileOutputStream fileOutput =
new FileOutputStream(FileRepositoryManager.getTemporaryPath() + getCurrentLetter().
getName() + EXPORT_CSV_NAME);
try {
List<String> emails = getExternalsSuscribers(getCurrentLetter().getPK());
CSVWriter csvWriter = new CSVWriter(getLanguage());
csvWriter.initCSVFormat("org.silverpeas.infoLetter.settings.usersCSVFormat",
"User", ";");
String email;
for (int i = 0; i < emails.size(); i++) {
email = emails.get(i);
fileOutput.write(email.getBytes());
fileOutput.write("\n".getBytes());
}
} catch (Exception e) {
exportOk = false;
throw new InfoLetterException(
"com.stratelia.silverpeas.infoLetter.control.InfoLetterSessionController",
SilverpeasRuntimeException.ERROR, e.getMessage(), e);
} finally {
fileOutput.flush();
fileOutput.close();
}
return exportOk;
}
| boolean function() throws FileNotFoundException, IOException, InfoLetterException { boolean exportOk = true; FileOutputStream fileOutput = new FileOutputStream(FileRepositoryManager.getTemporaryPath() + getCurrentLetter(). getName() + EXPORT_CSV_NAME); try { List<String> emails = getExternalsSuscribers(getCurrentLetter().getPK()); CSVWriter csvWriter = new CSVWriter(getLanguage()); csvWriter.initCSVFormat(STR, "User", ";"); String email; for (int i = 0; i < emails.size(); i++) { email = emails.get(i); fileOutput.write(email.getBytes()); fileOutput.write("\n".getBytes()); } } catch (Exception e) { exportOk = false; throw new InfoLetterException( STR, SilverpeasRuntimeException.ERROR, e.getMessage(), e); } finally { fileOutput.flush(); fileOutput.close(); } return exportOk; } | /**
* Export Csv emails
* @throws FileNotFoundException
* @throws IOException
* @throws InfoLetterException
* @return boolean
*/ | Export Csv emails | exportCsvEmails | {
"repo_name": "NicolasEYSSERIC/Silverpeas-Components",
"path": "infoletter/infoletter-war/src/main/java/com/stratelia/silverpeas/infoLetter/control/InfoLetterSessionController.java",
"license": "agpl-3.0",
"size": 38408
} | [
"com.silverpeas.util.csv.CSVWriter",
"com.stratelia.silverpeas.infoLetter.InfoLetterException",
"com.stratelia.webactiv.util.FileRepositoryManager",
"com.stratelia.webactiv.util.exception.SilverpeasRuntimeException",
"java.io.FileNotFoundException",
"java.io.FileOutputStream",
"java.io.IOException",
"... | import com.silverpeas.util.csv.CSVWriter; import com.stratelia.silverpeas.infoLetter.InfoLetterException; import com.stratelia.webactiv.util.FileRepositoryManager; import com.stratelia.webactiv.util.exception.SilverpeasRuntimeException; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; | import com.silverpeas.util.csv.*; import com.stratelia.silverpeas.*; import com.stratelia.webactiv.util.*; import com.stratelia.webactiv.util.exception.*; import java.io.*; import java.util.*; | [
"com.silverpeas.util",
"com.stratelia.silverpeas",
"com.stratelia.webactiv",
"java.io",
"java.util"
] | com.silverpeas.util; com.stratelia.silverpeas; com.stratelia.webactiv; java.io; java.util; | 2,710,477 |
public static BreakIterator getCharacterInstance(ULocale where)
{
return getBreakInstance(where, KIND_CHARACTER);
} | static BreakIterator function(ULocale where) { return getBreakInstance(where, KIND_CHARACTER); } | /**
* {@icu} Returns a new instance of BreakIterator that locates logical-character
* boundaries.
* @param where A Locale specifying the language of the text being analyzed.
* @return A new instance of BreakIterator that locates logical-character
* boundaries.
* @throws NullPointerException if <code>where</code> is null.
* @stable ICU 3.2
*/ | Returns a new instance of BreakIterator that locates logical-character boundaries | getCharacterInstance | {
"repo_name": "andreynovikov/maptrek",
"path": "app/src/main/java/com/ibm/icu/text/BreakIterator.java",
"license": "gpl-3.0",
"size": 41665
} | [
"com.ibm.icu.util.ULocale"
] | import com.ibm.icu.util.ULocale; | import com.ibm.icu.util.*; | [
"com.ibm.icu"
] | com.ibm.icu; | 804,678 |
public void setPool(Pool pool); | void function(Pool pool); | /**
* Set the pool
* @param pool The pool
*/ | Set the pool | setPool | {
"repo_name": "jpkrohling/ironjacamar",
"path": "core/src/main/java/org/ironjacamar/core/connectionmanager/ConnectionManager.java",
"license": "epl-1.0",
"size": 1762
} | [
"org.ironjacamar.core.connectionmanager.pool.Pool"
] | import org.ironjacamar.core.connectionmanager.pool.Pool; | import org.ironjacamar.core.connectionmanager.pool.*; | [
"org.ironjacamar.core"
] | org.ironjacamar.core; | 2,916,280 |
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 900, 768);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JButton btnNewButton = new JButton("Adventure");
btnNewButton.setBounds(50, 187, 800, 167);
frame.getContentPane().add(btnNewButton);
JButton btnNewButton_2 = new JButton("2-Player");
btnNewButton_2.setBounds(50, 364, 800, 167);
frame.getContentPane().add(btnNewButton_2);
JButton btnNewButton_3 = new JButton("Credits");
btnNewButton_3.setBounds(50, 541, 800, 167);
frame.getContentPane().add(btnNewButton_3);
JLabel label = new JLabel("Eternal Conflict");
label.setBounds(50, 10, 800, 167);
frame.getContentPane().add(label);
Image plane = Toolkit.getDefaultToolkit().getImage("PossiblyTheBestTitlePhraseEver.png");
BackgroundPanel panel = new BackgroundPanel(plane,BackgroundPanel.ACTUAL);
panel.setLayout(null);
panel.setBounds(0, 0, 884, 729);
frame.getContentPane().add(panel);
}
| void function() { frame = new JFrame(); frame.setBounds(100, 100, 900, 768); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JButton btnNewButton = new JButton(STR); btnNewButton.setBounds(50, 187, 800, 167); frame.getContentPane().add(btnNewButton); JButton btnNewButton_2 = new JButton(STR); btnNewButton_2.setBounds(50, 364, 800, 167); frame.getContentPane().add(btnNewButton_2); JButton btnNewButton_3 = new JButton(STR); btnNewButton_3.setBounds(50, 541, 800, 167); frame.getContentPane().add(btnNewButton_3); JLabel label = new JLabel(STR); label.setBounds(50, 10, 800, 167); frame.getContentPane().add(label); Image plane = Toolkit.getDefaultToolkit().getImage(STR); BackgroundPanel panel = new BackgroundPanel(plane,BackgroundPanel.ACTUAL); panel.setLayout(null); panel.setBounds(0, 0, 884, 729); frame.getContentPane().add(panel); } | /**
* Initialize the contents of the frame.
*/ | Initialize the contents of the frame | initialize | {
"repo_name": "JaykeBird/EternalConflict",
"path": "src/ui/MainWindow.java",
"license": "bsd-3-clause",
"size": 1794
} | [
"java.awt.Image",
"java.awt.Toolkit",
"javax.swing.JButton",
"javax.swing.JFrame",
"javax.swing.JLabel"
] | import java.awt.Image; import java.awt.Toolkit; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 314,169 |
public Query parseQuery(String queryString) throws MetaModelException; | Query function(String queryString) throws MetaModelException; | /**
* Parses a string-based SQL query and produces a corresponding
* {@link Query} object.
*
* @param queryString
* the SQL query to parse
* @return a {@link Query} object corresponding to the SQL query.
* @throws MetaModelException
* in case the parsing was unsuccesful.
*/ | Parses a string-based SQL query and produces a corresponding <code>Query</code> object | parseQuery | {
"repo_name": "rafaelgarrote/metamodel",
"path": "core/src/main/java/org/apache/metamodel/DataContext.java",
"license": "apache-2.0",
"size": 7521
} | [
"org.apache.metamodel.query.Query"
] | import org.apache.metamodel.query.Query; | import org.apache.metamodel.query.*; | [
"org.apache.metamodel"
] | org.apache.metamodel; | 503,169 |
public void abort (long id, Serializable context); | void function (long id, Serializable context); | /**
* Called by TransactionManager upon transaction commit.
* Warning: implementation should be able to handle multiple calls
* with the same transaction id (rare crash recovery)
*
* @param id the Transaction identifier
* @param context transaction context
*/ | Called by TransactionManager upon transaction commit. Warning: implementation should be able to handle multiple calls with the same transaction id (rare crash recovery) | abort | {
"repo_name": "napramirez/jPOS",
"path": "jpos/src/main/java/org/jpos/transaction/TransactionParticipant.java",
"license": "agpl-3.0",
"size": 1964
} | [
"java.io.Serializable"
] | import java.io.Serializable; | import java.io.*; | [
"java.io"
] | java.io; | 607,068 |
public String getStatusOfRelationship(String relationshipId) throws InternalWorkflowException {
Connection connection = IdentityDatabaseUtil.getDBConnection();
PreparedStatement prepStmt = null;
String query = SQLConstants.GET_STATUS_OF_RELATIONSHIP;
ResultSet resultSet = null;
try {
prepStmt = connection.prepareStatement(query);
prepStmt.setString(1, relationshipId);
resultSet = prepStmt.executeQuery();
if (resultSet.next()) {
return resultSet.getString(SQLConstants.REQUEST_STATUS_COLUMN);
}
connection.commit();
} catch (SQLException e) {
throw new InternalWorkflowException("Error when executing the sql query:" + query, e);
} finally {
IdentityDatabaseUtil.closeAllConnections(connection, resultSet, prepStmt);
}
return "";
} | String function(String relationshipId) throws InternalWorkflowException { Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; String query = SQLConstants.GET_STATUS_OF_RELATIONSHIP; ResultSet resultSet = null; try { prepStmt = connection.prepareStatement(query); prepStmt.setString(1, relationshipId); resultSet = prepStmt.executeQuery(); if (resultSet.next()) { return resultSet.getString(SQLConstants.REQUEST_STATUS_COLUMN); } connection.commit(); } catch (SQLException e) { throw new InternalWorkflowException(STR + query, e); } finally { IdentityDatabaseUtil.closeAllConnections(connection, resultSet, prepStmt); } return ""; } | /**
* Get requestId of a relationship.
*
* @param relationshipId
* @return
* @throws InternalWorkflowException
*/ | Get requestId of a relationship | getStatusOfRelationship | {
"repo_name": "chanukaranaba/carbon-identity",
"path": "components/workflow-mgt/org.wso2.carbon.identity.workflow.mgt/src/main/java/org/wso2/carbon/identity/workflow/mgt/dao/WorkflowRequestAssociationDAO.java",
"license": "apache-2.0",
"size": 8888
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"org.wso2.carbon.identity.core.util.IdentityDatabaseUtil",
"org.wso2.carbon.identity.workflow.mgt.exception.InternalWorkflowException"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil; import org.wso2.carbon.identity.workflow.mgt.exception.InternalWorkflowException; | import java.sql.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.identity.workflow.mgt.exception.*; | [
"java.sql",
"org.wso2.carbon"
] | java.sql; org.wso2.carbon; | 95,278 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<DscCompilationJobInner>> listByAutomationAccountNextSinglePageAsync(
String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByAutomationAccountNext(nextLink, this.client.getEndpoint(), accept, context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<DscCompilationJobInner>> function( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .listByAutomationAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } | /**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response model for the list job operation.
*/ | Get the next page of items | listByAutomationAccountNextSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/automation/azure-resourcemanager-automation/src/main/java/com/azure/resourcemanager/automation/implementation/DscCompilationJobsClientImpl.java",
"license": "mit",
"size": 54333
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.Context",
"com.azure.resourcemanager.automation.fluent.models.DscCompilationJobInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.automation.fluent.models.DscCompilationJobInner; | 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; | 243,012 |
private void createClearDialog(final QuestionWidget qw) {
Collect.getInstance()
.getActivityLogger()
.logInstanceAction(this, "createClearDialog", "show",
qw.getPrompt().getIndex());
mAlertDialog = new AlertDialog.Builder(this).create();
mAlertDialog.setIcon(android.R.drawable.ic_dialog_info);
mAlertDialog.setTitle(getString(R.string.clear_answer_ask));
String question = qw.getPrompt().getLongText();
if (question.length() > 50) {
question = question.substring(0, 50) + "...";
}
mAlertDialog.setMessage(getString(R.string.clearanswer_confirm, question));
DialogInterface.OnClickListener quitListener = new DialogInterface.OnClickListener() { | void function(final QuestionWidget qw) { Collect.getInstance() .getActivityLogger() .logInstanceAction(this, STR, "show", qw.getPrompt().getIndex()); mAlertDialog = new AlertDialog.Builder(this).create(); mAlertDialog.setIcon(android.R.drawable.ic_dialog_info); mAlertDialog.setTitle(getString(R.string.clear_answer_ask)); String question = qw.getPrompt().getLongText(); if (question.length() > 50) { question = question.substring(0, 50) + "..."; } mAlertDialog.setMessage(getString(R.string.clearanswer_confirm, question)); DialogInterface.OnClickListener quitListener = new DialogInterface.OnClickListener() { | /**
* Confirm clear answer dialog
*/ | Confirm clear answer dialog | createClearDialog | {
"repo_name": "sages-health/sagesmobile-mCollect",
"path": "src/org/odk/collect/android/activities/FormEntryActivity.java",
"license": "apache-2.0",
"size": 97778
} | [
"android.app.AlertDialog",
"android.content.DialogInterface",
"android.view.View",
"org.odk.collect.android.application.Collect",
"org.odk.collect.android.widgets.QuestionWidget"
] | import android.app.AlertDialog; import android.content.DialogInterface; import android.view.View; import org.odk.collect.android.application.Collect; import org.odk.collect.android.widgets.QuestionWidget; | import android.app.*; import android.content.*; import android.view.*; import org.odk.collect.android.application.*; import org.odk.collect.android.widgets.*; | [
"android.app",
"android.content",
"android.view",
"org.odk.collect"
] | android.app; android.content; android.view; org.odk.collect; | 2,146,073 |
public ManagedRulesDefinition managedRules() {
return this.managedRules;
} | ManagedRulesDefinition function() { return this.managedRules; } | /**
* Get describes the managedRules structure.
*
* @return the managedRules value
*/ | Get describes the managedRules structure | managedRules | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/network/v2020_05_01/implementation/WebApplicationFirewallPolicyInner.java",
"license": "mit",
"size": 6966
} | [
"com.microsoft.azure.management.network.v2020_05_01.ManagedRulesDefinition"
] | import com.microsoft.azure.management.network.v2020_05_01.ManagedRulesDefinition; | import com.microsoft.azure.management.network.v2020_05_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,301,199 |
private void waitForTimeoutTestCase(Function<TaskId, ? extends Iterable<? extends Throwable>> wait) throws Exception {
// Start blocking test task
ActionFuture<TestTaskPlugin.NodesResponse> future = new TestTaskPlugin.NodesRequestBuilder(client(),
TestTaskPlugin.TestTaskAction.INSTANCE).execute();
try {
TaskId taskId = waitForTestTaskStartOnAllNodes();
// Wait for the task to start
assertBusy(() -> client().admin().cluster().prepareGetTask(taskId).get());
// Spin up a request that should wait for those tasks to finish
// It will timeout because we haven't unblocked the tasks
Iterable<? extends Throwable> failures = wait.apply(taskId);
for (Throwable failure : failures) {
assertNotNull(
ExceptionsHelper.unwrap(failure, ElasticsearchTimeoutException.class, ReceiveTimeoutTransportException.class));
}
} finally {
// Now we can unblock those requests
new TestTaskPlugin.UnblockTestTasksRequestBuilder(client(), TestTaskPlugin.UnblockTestTasksAction.INSTANCE).get();
}
future.get();
} | void function(Function<TaskId, ? extends Iterable<? extends Throwable>> wait) throws Exception { ActionFuture<TestTaskPlugin.NodesResponse> future = new TestTaskPlugin.NodesRequestBuilder(client(), TestTaskPlugin.TestTaskAction.INSTANCE).execute(); try { TaskId taskId = waitForTestTaskStartOnAllNodes(); assertBusy(() -> client().admin().cluster().prepareGetTask(taskId).get()); Iterable<? extends Throwable> failures = wait.apply(taskId); for (Throwable failure : failures) { assertNotNull( ExceptionsHelper.unwrap(failure, ElasticsearchTimeoutException.class, ReceiveTimeoutTransportException.class)); } } finally { new TestTaskPlugin.UnblockTestTasksRequestBuilder(client(), TestTaskPlugin.UnblockTestTasksAction.INSTANCE).get(); } future.get(); } | /**
* Test waiting for a task that times out.
* @param wait wait for the running task and return all the failures you accumulated waiting for it
*/ | Test waiting for a task that times out | waitForTimeoutTestCase | {
"repo_name": "gfyoung/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java",
"license": "apache-2.0",
"size": 50810
} | [
"java.util.function.Function",
"org.elasticsearch.ElasticsearchTimeoutException",
"org.elasticsearch.ExceptionsHelper",
"org.elasticsearch.action.ActionFuture",
"org.elasticsearch.tasks.TaskId",
"org.elasticsearch.transport.ReceiveTimeoutTransportException"
] | import java.util.function.Function; import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionFuture; import org.elasticsearch.tasks.TaskId; import org.elasticsearch.transport.ReceiveTimeoutTransportException; | import java.util.function.*; import org.elasticsearch.*; import org.elasticsearch.action.*; import org.elasticsearch.tasks.*; import org.elasticsearch.transport.*; | [
"java.util",
"org.elasticsearch",
"org.elasticsearch.action",
"org.elasticsearch.tasks",
"org.elasticsearch.transport"
] | java.util; org.elasticsearch; org.elasticsearch.action; org.elasticsearch.tasks; org.elasticsearch.transport; | 1,426,624 |
public ActivityGenerator getAppCoverData(Context context) {
return getAppCoverData(context, Locale.getDefault());
}
| ActivityGenerator function(Context context) { return getAppCoverData(context, Locale.getDefault()); } | /**
* Returns an ActivityGenerator with data obtained after parsing cover file
* @param context
* @return ActivityGenerator
*/ | Returns an ActivityGenerator with data obtained after parsing cover file | getAppCoverData | {
"repo_name": "emobc/emobc-android",
"path": "src/com/emobc/android/ApplicationData.java",
"license": "agpl-3.0",
"size": 20539
} | [
"android.content.Context",
"com.emobc.android.activities.generators.ActivityGenerator",
"java.util.Locale"
] | import android.content.Context; import com.emobc.android.activities.generators.ActivityGenerator; import java.util.Locale; | import android.content.*; import com.emobc.android.activities.generators.*; import java.util.*; | [
"android.content",
"com.emobc.android",
"java.util"
] | android.content; com.emobc.android; java.util; | 1,354,353 |
private void handleInvokeRangeInsns() {
for (NormalSsaInsn insn : invokeRangeInsns) {
adjustAndMapSourceRangeRange(insn);
}
} | void function() { for (NormalSsaInsn insn : invokeRangeInsns) { adjustAndMapSourceRangeRange(insn); } } | /**
* Handles all insns that want a register range for their sources.
*/ | Handles all insns that want a register range for their sources | handleInvokeRangeInsns | {
"repo_name": "alibaba/atlas",
"path": "atlas-gradle-plugin/dexpatch/src/main/java/com/taobao/android/dx/ssa/back/FirstFitLocalCombiningAllocator.java",
"license": "apache-2.0",
"size": 43945
} | [
"com.taobao.android.dx.ssa.NormalSsaInsn"
] | import com.taobao.android.dx.ssa.NormalSsaInsn; | import com.taobao.android.dx.ssa.*; | [
"com.taobao.android"
] | com.taobao.android; | 2,708,315 |
this.accessType = AccessType.getInstanceFromInt(new Integer(accessType).intValue() );
} | this.accessType = AccessType.getInstanceFromInt(new Integer(accessType).intValue() ); } | /**
* Sets the access type.
*
* @param accessType the new access type
*/ | Sets the access type | setAccessType | {
"repo_name": "boudie65/IBM-ECM-AntDeploymentTasks",
"path": "src/main/java/com/ibm/deploy/ant/task/types/Permission.java",
"license": "gpl-3.0",
"size": 724
} | [
"com.filenet.api.constants.AccessType"
] | import com.filenet.api.constants.AccessType; | import com.filenet.api.constants.*; | [
"com.filenet.api"
] | com.filenet.api; | 1,330,028 |
private List<IFileSpec> buildSetFileAttributesFileSpecsFromCommandResultMaps(
@Nullable final List<Map<String, Object>> resultMaps,
@Nonnull final Function<Map<String, Object>, IFileSpec> handle)
throws RequestException {
List<IFileSpec> resultList = new ArrayList<>();
if (nonNull(resultMaps)) {
List<String> filesSeen = new ArrayList<>();
for (Map<String, Object> map : resultMaps) {
IFileSpec spec = handle.apply(map);
if (spec.getOpStatus() == VALID) {
String file = spec.getAnnotatedPathString(DEPOT);
if (isNotBlank(file)) {
if (!filesSeen.contains(file)) {
filesSeen.add(file);
resultList.add(spec);
}
}
} else {
resultList.add(spec);
}
}
}
return resultList;
} | List<IFileSpec> function( @Nullable final List<Map<String, Object>> resultMaps, @Nonnull final Function<Map<String, Object>, IFileSpec> handle) throws RequestException { List<IFileSpec> resultList = new ArrayList<>(); if (nonNull(resultMaps)) { List<String> filesSeen = new ArrayList<>(); for (Map<String, Object> map : resultMaps) { IFileSpec spec = handle.apply(map); if (spec.getOpStatus() == VALID) { String file = spec.getAnnotatedPathString(DEPOT); if (isNotBlank(file)) { if (!filesSeen.contains(file)) { filesSeen.add(file); resultList.add(spec); } } } else { resultList.add(spec); } } } return resultList; } | /**
* Inner utility class to convert a resultmaps list into attribute filespec objects.
* TODO: this doesn't belong in here, maybe filespecbuilder?
*/ | Inner utility class to convert a resultmaps list into attribute filespec objects | buildSetFileAttributesFileSpecsFromCommandResultMaps | {
"repo_name": "groboclown/p4ic4idea",
"path": "p4java/r19-1/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/AttributeDelegator.java",
"license": "apache-2.0",
"size": 7402
} | [
"com.perforce.p4java.common.function.Function",
"com.perforce.p4java.core.file.IFileSpec",
"com.perforce.p4java.exception.RequestException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"javax.annotation.Nonnull",
"javax.annotation.Nullable"
] | import com.perforce.p4java.common.function.Function; import com.perforce.p4java.core.file.IFileSpec; import com.perforce.p4java.exception.RequestException; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; | import com.perforce.p4java.common.function.*; import com.perforce.p4java.core.file.*; import com.perforce.p4java.exception.*; import java.util.*; import javax.annotation.*; | [
"com.perforce.p4java",
"java.util",
"javax.annotation"
] | com.perforce.p4java; java.util; javax.annotation; | 1,659,403 |
@Override
public int hashCode() {
// see Map.Entry API specification
return Objects.hashCode(getKey()) ^ Objects.hashCode(getValue());
} | int function() { return Objects.hashCode(getKey()) ^ Objects.hashCode(getValue()); } | /**
* <p>Returns a suitable hash code.
* The hash code follows the definition in {@code Map.Entry}.</p>
*
* @return the hash code
*/ | Returns a suitable hash code. The hash code follows the definition in Map.Entry | hashCode | {
"repo_name": "apache/commons-lang",
"path": "src/main/java/org/apache/commons/lang3/tuple/Pair.java",
"license": "apache-2.0",
"size": 7784
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 2,246,092 |
public Builder withExitCode(@Nullable final Integer exitCode) {
this.bExitCode = exitCode;
return this;
} | Builder function(@Nullable final Integer exitCode) { this.bExitCode = exitCode; return this; } | /**
* Set the exit code for the jobs' execution. If not set will default to -1.
*
* @param exitCode The exit code.
* @return The builder
*/ | Set the exit code for the jobs' execution. If not set will default to -1 | withExitCode | {
"repo_name": "Netflix/genie",
"path": "genie-common/src/main/java/com/netflix/genie/common/dto/JobExecution.java",
"license": "apache-2.0",
"size": 8412
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,370,875 |
protected DateBox getToDateBox() {
return toDateBox;
} | DateBox function() { return toDateBox; } | /**
* Retrieves the to date box that is displayed on the DateFilter.
* This function is protected as it is only used by test cases.
*
* @return instance of the to date box that is displayed on the DateFilter
*/ | Retrieves the to date box that is displayed on the DateFilter. This function is protected as it is only used by test cases | getToDateBox | {
"repo_name": "A24Group/ssGWT-lib",
"path": "src/org/ssgwt/client/ui/datagrid/filter/DateFilter.java",
"license": "apache-2.0",
"size": 32220
} | [
"org.ssgwt.client.ui.datepicker.DateBox"
] | import org.ssgwt.client.ui.datepicker.DateBox; | import org.ssgwt.client.ui.datepicker.*; | [
"org.ssgwt.client"
] | org.ssgwt.client; | 1,792,586 |
private void recheckElectability() {
// Maintain lock ordering of elector -> ZKFC
synchronized (elector) {
synchronized (this) {
boolean healthy = lastHealthState == State.SERVICE_HEALTHY;
long remainingDelay = delayJoiningUntilNanotime - System.nanoTime();
if (remainingDelay > 0) {
if (healthy) {
LOG.info("Would have joined master election, but this node is " +
"prohibited from doing so for " +
TimeUnit.NANOSECONDS.toMillis(remainingDelay) + " more ms");
}
scheduleRecheck(remainingDelay);
return;
}
switch (lastHealthState) {
case SERVICE_HEALTHY:
elector.joinElection(targetToData(localTarget));
if (quitElectionOnBadState) {
quitElectionOnBadState = false;
}
break;
case INITIALIZING:
LOG.info("Ensuring that " + localTarget + " does not " +
"participate in active master election");
elector.quitElection(false);
serviceState = HAServiceState.INITIALIZING;
break;
case SERVICE_UNHEALTHY:
case SERVICE_NOT_RESPONDING:
LOG.info("Quitting master election for " + localTarget +
" and marking that fencing is necessary");
elector.quitElection(true);
serviceState = HAServiceState.INITIALIZING;
break;
case HEALTH_MONITOR_FAILED:
fatalError("Health monitor failed!");
break;
default:
throw new IllegalArgumentException("Unhandled state:"
+ lastHealthState);
}
}
}
} | void function() { synchronized (elector) { synchronized (this) { boolean healthy = lastHealthState == State.SERVICE_HEALTHY; long remainingDelay = delayJoiningUntilNanotime - System.nanoTime(); if (remainingDelay > 0) { if (healthy) { LOG.info(STR + STR + TimeUnit.NANOSECONDS.toMillis(remainingDelay) + STR); } scheduleRecheck(remainingDelay); return; } switch (lastHealthState) { case SERVICE_HEALTHY: elector.joinElection(targetToData(localTarget)); if (quitElectionOnBadState) { quitElectionOnBadState = false; } break; case INITIALIZING: LOG.info(STR + localTarget + STR + STR); elector.quitElection(false); serviceState = HAServiceState.INITIALIZING; break; case SERVICE_UNHEALTHY: case SERVICE_NOT_RESPONDING: LOG.info(STR + localTarget + STR); elector.quitElection(true); serviceState = HAServiceState.INITIALIZING; break; case HEALTH_MONITOR_FAILED: fatalError(STR); break; default: throw new IllegalArgumentException(STR + lastHealthState); } } } } | /**
* Check the current state of the service, and join the election
* if it should be in the election.
*/ | Check the current state of the service, and join the election if it should be in the election | recheckElectability | {
"repo_name": "Ethanlm/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java",
"license": "apache-2.0",
"size": 33315
} | [
"java.util.concurrent.TimeUnit",
"org.apache.hadoop.ha.HAServiceProtocol",
"org.apache.hadoop.ha.HealthMonitor"
] | import java.util.concurrent.TimeUnit; import org.apache.hadoop.ha.HAServiceProtocol; import org.apache.hadoop.ha.HealthMonitor; | import java.util.concurrent.*; import org.apache.hadoop.ha.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,626,251 |
public com.google.container.v1.ListNodePoolsResponse listNodePools(com.google.container.v1.ListNodePoolsRequest request) {
return blockingUnaryCall(
getChannel(), getListNodePoolsMethodHelper(), getCallOptions(), request);
} | com.google.container.v1.ListNodePoolsResponse function(com.google.container.v1.ListNodePoolsRequest request) { return blockingUnaryCall( getChannel(), getListNodePoolsMethodHelper(), getCallOptions(), request); } | /**
* <pre>
* Lists the node pools for a cluster.
* </pre>
*/ | <code> Lists the node pools for a cluster. </code> | listNodePools | {
"repo_name": "pongad/api-client-staging",
"path": "generated/java/grpc-google-cloud-container-v1/src/main/java/com/google/container/v1/ClusterManagerGrpc.java",
"license": "bsd-3-clause",
"size": 147597
} | [
"io.grpc.stub.ClientCalls"
] | import io.grpc.stub.ClientCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 2,509,941 |
assertThat(stats1.value1(), is(1));
assertThat(stats1.value2(), is(3));
} | assertThat(stats1.value1(), is(1)); assertThat(stats1.value2(), is(3)); } | /**
* Tests the creation of the MapEvent object.
*/ | Tests the creation of the MapEvent object | testConstruction | {
"repo_name": "rvhub/onos",
"path": "core/api/src/test/java/org/onosproject/store/service/MultiValuedTimestampTest.java",
"license": "apache-2.0",
"size": 3069
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; | import org.hamcrest.*; | [
"org.hamcrest"
] | org.hamcrest; | 2,300,867 |
@Test
public void testQueryRewrite_geometry_geometry() {
Graph graph = model.getGraph();
Node subject = GEOMETRY_A.asNode();
Node predicate = Geo.SF_CONTAINS_NODE;
Node object = GEOMETRY_B.asNode();
GenericPropertyFunction instance = new SfContainsPF();
QueryRewriteIndex queryRewriteIndex = QueryRewriteIndex.createDefault();
Boolean expResult = true;
Boolean result = instance.queryRewrite(graph, subject, predicate, object, queryRewriteIndex);
assertEquals(expResult, result);
} | void function() { Graph graph = model.getGraph(); Node subject = GEOMETRY_A.asNode(); Node predicate = Geo.SF_CONTAINS_NODE; Node object = GEOMETRY_B.asNode(); GenericPropertyFunction instance = new SfContainsPF(); QueryRewriteIndex queryRewriteIndex = QueryRewriteIndex.createDefault(); Boolean expResult = true; Boolean result = instance.queryRewrite(graph, subject, predicate, object, queryRewriteIndex); assertEquals(expResult, result); } | /**
* Test of queryRewrite method, of class GenericPropertyFunction.
*/ | Test of queryRewrite method, of class GenericPropertyFunction | testQueryRewrite_geometry_geometry | {
"repo_name": "apache/jena",
"path": "jena-geosparql/src/test/java/org/apache/jena/geosparql/geo/topological/GenericPropertyFunctionTest.java",
"license": "apache-2.0",
"size": 21628
} | [
"org.apache.jena.geosparql.geo.topological.property_functions.simple_features.SfContainsPF",
"org.apache.jena.geosparql.implementation.index.QueryRewriteIndex",
"org.apache.jena.geosparql.implementation.vocabulary.Geo",
"org.apache.jena.graph.Graph",
"org.apache.jena.graph.Node",
"org.junit.Assert"
] | import org.apache.jena.geosparql.geo.topological.property_functions.simple_features.SfContainsPF; import org.apache.jena.geosparql.implementation.index.QueryRewriteIndex; import org.apache.jena.geosparql.implementation.vocabulary.Geo; import org.apache.jena.graph.Graph; import org.apache.jena.graph.Node; import org.junit.Assert; | import org.apache.jena.geosparql.geo.topological.property_functions.simple_features.*; import org.apache.jena.geosparql.implementation.index.*; import org.apache.jena.geosparql.implementation.vocabulary.*; import org.apache.jena.graph.*; import org.junit.*; | [
"org.apache.jena",
"org.junit"
] | org.apache.jena; org.junit; | 462,563 |
public Iterator<String> getAdditionalNames();
| Iterator<String> function(); | /**
* <p>Returns a list of additional names.</p>
*
* @return {@link Iterator}<String>
*/ | Returns a list of additional names | getAdditionalNames | {
"repo_name": "imspa/NFC-Lottery",
"path": "libraries/CardmeAndroid/src/main/java/net/sourceforge/cardme/vcard/features/NameFeature.java",
"license": "apache-2.0",
"size": 6061
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,525,837 |
protected void processLinkTag(Tag tag) {
String href_ = tag.getAttribute("href");
int linkhandletype = needProcess(href_,false);
if (linkhandletype != this.LINK_NO_PARSER_NO_DISTRIBUTE) {
// href attribute is required
LinkParser parser;
CMSLink link;
String href = tag.getAttribute("href");
switch (m_mode) {
case PROCESS_LINKS:
// macros are replaced with links
link = m_linkTable.getLink(href);
if (link != null) {
// tag.setLink(escapeLink(link.getHref()));
tag.setAttribute("href",link.getHref());
} else {
if (this.baseUrl != null)
link = new CMSLink(baseUrl, href,linkhandletype);
else
link = new CMSLink(href,linkhandletype);
parser = new LinkParser(link);
link = parser.getResult();
m_linkTable.addLink(link);
if (this.isTemplateProcess() && link.isInternal()) {
recordTemplateLink( link);
if(isStyleLink(href))
{
handleStyleLink(link.getRelativeFilePath());
}
}
if(this.handletype == PROCESS_CONTENT)
{
if(link.isInternal())
(this.context).addLink(link);
}
if(this.handletype == PROCESS_EDITCONTENT
|| this.handletype == PROCESS_EDITTEMPLATE)
{
if(link.isInternal() )
{
// this.innerPageLinkTable.addLink(link);
}
else
{
//记录外部链接
if(!link.isJavaScript())
{
if(link.needdownload())
this.externalPageLinkTable.addLink(link);
}
}
}
if((this.handletype == PROCESS_BACKUPCONTENT
|| this.handletype == PROCESS_BACKUPTEMPLATE) )
{
if(link.isInternal())
this.recordTemplateLink(link);
}
else
{
tag.setAttribute("href",link.getHref());
}
}
break;
case REPLACE_LINKS:
// macros are replaced with links
link = m_linkTable.getLink(href);
if (link != null) {
// tag.setLink(escapeLink(link.getHref()));
tag.setAttribute("href",link.getHref());
}
else
{
if (this.baseUrl != null)
link = new CMSLink(baseUrl, href,linkhandletype);
else
link = new CMSLink(href,linkhandletype);
parser = new LinkParser(link);
link = parser.getResult();
m_linkTable.addLink(link);
if (this.isTemplateProcess() && link.isInternal()) {
recordTemplateLink( link);
if(isStyleLink(href))
{
handleStyleLink(link.getRelativeFilePath());
}
}
if(this.handletype == PROCESS_CONTENT)
{
if(link.isInternal())
(this.context).addLink(link);
}
if(this.handletype == PROCESS_EDITCONTENT
|| this.handletype == PROCESS_EDITTEMPLATE)
{
if(link.isInternal() )
{
// this.innerPageLinkTable.addLink(link);
}
else
{
// 记录外部链接
if(!link.isJavaScript())
{
if(link.needdownload())
this.externalPageLinkTable.addLink(link);
}
}
}
if((this.handletype == PROCESS_BACKUPCONTENT
|| this.handletype == PROCESS_BACKUPTEMPLATE) )
{
if(link.isInternal())
this.recordTemplateLink(link);
}
else
{
tag.setAttribute("href",link.getHref());
}
}
break;
default: // noop
}
}
}
//
// private String processLink(CMSLink link) {
//
//
// // if (link.isInternal()) {
// //
// //// // if we have a local link, leave it unchanged
// //// // cms may be null for unit tests
// //// if ((m_cms == null) || (link.getUri().length() == 0) ||
// (link.getUri().charAt(0) == '#')) {
// //// return link.getUri();
// //// }
// //
// // // Explanation why the "m_processEditorLinks" variable is required:
// // // If the VFS is browsed in the root site, this indicates that a user
// has switched
// // // the context to the / in the Workplace. In this case the workplace
// site must be
// // // the active site. If normal link processing would be used, the site
// root in the link
// // // would be replaced with server name / port for the other sites. But
// if a user clicks
// // // on such a link he would leave the workplace site and loose his
// session.
// // // A result is that the "direct edit" mode does not work since he in
// not longer logged in.
// // // Therefore if the user is NOT in the editor, but in the root site,
// the links are generated
// // // without server name / port. However, if the editor is opened, the
// links are generated
// // // _with_ server name / port so that the source code looks identical
// to code
// // // that would normally created when running in a regular site.
// //
// //// // we are in the opencms root site but not in edit mode - use link
// as stored
// //// if (!m_processEditorLinks &&
// (m_cms.getRequestContext().getSiteRoot().length() == 0)) {
// //// return OpenCms.getLinkManager().substituteLink(m_cms,
// link.getUri());
// //// }
// ////
// //// // otherwise get the desired site root from the stored link
// //// // if there is no site root, we have a /system link (or the site was
// deleted),
// //// // return the link prefixed with the opencms context
// //// String siteRoot = link.getSiteRoot();
// //// if (siteRoot == null) {
// //// return OpenCms.getLinkManager().substituteLink(m_cms,
// link.getUri());
// //// }
// ////
// //// // return the link with the server prefix, if necessary
// //// return OpenCms.getLinkManager().substituteLink(m_cms,
// link.getVfsUri(), siteRoot);
// // String link_s = link.getHref();
// // String contextPath =
// this.context.getRequestContext().getRequest().getContextPath();
// // URL test = null;
// // try {
// // test = new URL(link_s);
// // } catch (MalformedURLException e) {
// // return link_s;
// // }
// // System.out.println("file:" + test.getFile());
// // System.out.println("host:" + test.getHost());
// //
// // System.out.println("path:" + test.getPath());
// // System.out.println("port:" + test.getPort());
// // System.out.println("query:" + test.getQuery());
// // System.out.println("ref:" + test.getRef());
// // if(!link_s.startsWith("/"))
// // {
// // if(link_s.toLowerCase().startsWith("http://"))
// // {
// // String protocol =
// this.context.getRequestContext().getRequest().getProtocol();
// // int port =
// this.context.getRequestContext().getRequest().getServerPort();
// //
// // }
// // }
// // else
// // {
// // if(link_s.startsWith(contextPath + context.getAbsoluteImagesPath()))
// // {
// //
// // }
// // else if(link_s.startsWith(context.getAbsoluteImagesPath()))
// // {
// //
// // }
// // else if(link_s.startsWith("../../../"))
// // {
// //
// // }
// //
// // }
// //
// // return "";
// // } else {
// //
// // // don't touch external links
// // return link.getUri();
// // }
// }
//
// public static final String urlpattern =
// "(http://)(([a-zA-Z0-9]+\\.)*[a-zA-Z0-9]+):([0-9]{0,4})(((/[^/^?]*)|(\\\\[^\\\\^?]*))+)\\?(.+)";
//
// public static final String protocolpattern =
// "(https?://([a-zA-Z0-9]+\\.)*[a-zA-Z0-9]+:?[0-9]{0,4})((/[^/^?]*)|(\\\\[^\\\\^?]*))+\\?.+";
public static final String domainpattern = "(http|https|ftp|tps|mailto)://([a-zA-Z0-9]+\\.)+[a-zA-Z0-9]+/?";
public static final String uripattern = "((/+[^/]*)|(\\\\+[^\\\\]*))+";
public static final String r_uripattern = "(([^/^\\\\]+
public static final String simple_uripattern = "(\\.{1,2}/)+[^/]*((/+[^/]*)|(\\\\+[^\\\\]*))*";
public static final String cmstag_pattern = "<cms:[^/^>]+/?>.*";
public static class LinkTimestamp
{
private String filepath;
private long lastmodifiedTime = -1;
public LinkTimestamp(String filepath,long lastmodifiedTime)
{
this.filepath = filepath;
this.lastmodifiedTime = lastmodifiedTime;
} | void function(Tag tag) { String href_ = tag.getAttribute("href"); int linkhandletype = needProcess(href_,false); if (linkhandletype != this.LINK_NO_PARSER_NO_DISTRIBUTE) { LinkParser parser; CMSLink link; String href = tag.getAttribute("href"); switch (m_mode) { case PROCESS_LINKS: link = m_linkTable.getLink(href); if (link != null) { tag.setAttribute("href",link.getHref()); } else { if (this.baseUrl != null) link = new CMSLink(baseUrl, href,linkhandletype); else link = new CMSLink(href,linkhandletype); parser = new LinkParser(link); link = parser.getResult(); m_linkTable.addLink(link); if (this.isTemplateProcess() && link.isInternal()) { recordTemplateLink( link); if(isStyleLink(href)) { handleStyleLink(link.getRelativeFilePath()); } } if(this.handletype == PROCESS_CONTENT) { if(link.isInternal()) (this.context).addLink(link); } if(this.handletype == PROCESS_EDITCONTENT this.handletype == PROCESS_EDITTEMPLATE) { if(link.isInternal() ) { } else { if(!link.isJavaScript()) { if(link.needdownload()) this.externalPageLinkTable.addLink(link); } } } if((this.handletype == PROCESS_BACKUPCONTENT this.handletype == PROCESS_BACKUPTEMPLATE) ) { if(link.isInternal()) this.recordTemplateLink(link); } else { tag.setAttribute("href",link.getHref()); } } break; case REPLACE_LINKS: link = m_linkTable.getLink(href); if (link != null) { tag.setAttribute("href",link.getHref()); } else { if (this.baseUrl != null) link = new CMSLink(baseUrl, href,linkhandletype); else link = new CMSLink(href,linkhandletype); parser = new LinkParser(link); link = parser.getResult(); m_linkTable.addLink(link); if (this.isTemplateProcess() && link.isInternal()) { recordTemplateLink( link); if(isStyleLink(href)) { handleStyleLink(link.getRelativeFilePath()); } } if(this.handletype == PROCESS_CONTENT) { if(link.isInternal()) (this.context).addLink(link); } if(this.handletype == PROCESS_EDITCONTENT this.handletype == PROCESS_EDITTEMPLATE) { if(link.isInternal() ) { } else { if(!link.isJavaScript()) { if(link.needdownload()) this.externalPageLinkTable.addLink(link); } } } if((this.handletype == PROCESS_BACKUPCONTENT this.handletype == PROCESS_BACKUPTEMPLATE) ) { if(link.isInternal()) this.recordTemplateLink(link); } else { tag.setAttribute("href",link.getHref()); } } break; default: } } } public static final String domainpattern = STR((/+[^/]*) (\\\\+[^\\\\]*))+STR(([^/^\\\\]+ public static final String simple_uripattern = STR; public static final String cmstag_pattern = STR; public static class LinkTimestamp { private String filepath; private long lastmodifiedTime = -1; public LinkTimestamp(String filepath,long lastmodifiedTime) { this.filepath = filepath; this.lastmodifiedTime = lastmodifiedTime; } | /**
* Process a link tag.
* <p>
*
* @param tag
* the tag to process
*/ | Process a link tag. | processLinkTag | {
"repo_name": "tzou24/BPS",
"path": "BPS/src/com/frameworkset/platform/cms/driver/htmlconverter/CmsLinkProcessor.java",
"license": "apache-2.0",
"size": 156475
} | [
"org.htmlparser.Tag"
] | import org.htmlparser.Tag; | import org.htmlparser.*; | [
"org.htmlparser"
] | org.htmlparser; | 2,521,509 |
public void registerHeatFrameCoolRecipe(Object input, ItemStack output); | void function(Object input, ItemStack output); | /**
* Adds a behaviour for when an inventory is framed with a Heat Frame, and is cooled below 0 degrees C. If the input item is a container item it will be returned as well.
* @param input either of type ItemStack or Pair<String, Integer>, where the String is the Ore dictionary entry and Integer is the amount (stack size)
* @param output
*/ | Adds a behaviour for when an inventory is framed with a Heat Frame, and is cooled below 0 degrees C. If the input item is a container item it will be returned as well | registerHeatFrameCoolRecipe | {
"repo_name": "wormzjl/PneumaticCraft",
"path": "src/pneumaticCraft/api/recipe/IPneumaticRecipeRegistry.java",
"license": "gpl-3.0",
"size": 3798
} | [
"net.minecraft.item.ItemStack"
] | import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 1,067,053 |
public static final boolean isValidDir(String as_path) {
File file = new File(as_path);
if (!file.isDirectory()) {
return false;
}
if (!file.exists()) {
return false;
}
return true;
} | static final boolean function(String as_path) { File file = new File(as_path); if (!file.isDirectory()) { return false; } if (!file.exists()) { return false; } return true; } | /**
* check if given path is available.
*
* @param as_path
* given path
* @return if available ,return true, otherwise false
*/ | check if given path is available | isValidDir | {
"repo_name": "chinayuans/sysadmin",
"path": "src/common/org/appfuse/common/util/regexpression/ValidatorUtil.java",
"license": "mit",
"size": 14830
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,714,813 |
void flush() throws AsynchronousExecution; | void flush() throws AsynchronousExecution; | /**
* Cause all put operations issued by this thread to complete. This may block until the operations have completed or return an asynchronous handle to that additional work can be done.
*/ | Cause all put operations issued by this thread to complete. This may block until the operations have completed or return an asynchronous handle to that additional work can be done | flush | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Engine/src/main/java/com/opengamma/engine/cache/DeferredViewComputationCache.java",
"license": "apache-2.0",
"size": 1328
} | [
"com.opengamma.util.async.AsynchronousExecution"
] | import com.opengamma.util.async.AsynchronousExecution; | import com.opengamma.util.async.*; | [
"com.opengamma.util"
] | com.opengamma.util; | 957,495 |
public DatumReader<T> createDatumReader() {
if (type.equals(GenericRecord.class)) {
return new GenericDatumReader<>(schema);
} else {
return new ReflectDatumReader<>(schema);
}
} | DatumReader<T> function() { if (type.equals(GenericRecord.class)) { return new GenericDatumReader<>(schema); } else { return new ReflectDatumReader<>(schema); } } | /**
* Returns a new DatumReader that can be used to read from
* an Avro file directly.
*/ | Returns a new DatumReader that can be used to read from an Avro file directly | createDatumReader | {
"repo_name": "chamikaramj/MyDataflowJavaSDK",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/coders/AvroCoder.java",
"license": "apache-2.0",
"size": 22654
} | [
"org.apache.avro.generic.GenericDatumReader",
"org.apache.avro.generic.GenericRecord",
"org.apache.avro.io.DatumReader",
"org.apache.avro.reflect.ReflectDatumReader"
] | import org.apache.avro.generic.GenericDatumReader; import org.apache.avro.generic.GenericRecord; import org.apache.avro.io.DatumReader; import org.apache.avro.reflect.ReflectDatumReader; | import org.apache.avro.generic.*; import org.apache.avro.io.*; import org.apache.avro.reflect.*; | [
"org.apache.avro"
] | org.apache.avro; | 322,894 |
boolean processRow(ResultsFuture<Boolean> hasNext) {
try {
if (!hasNext.get()) {
callback.onComplete(stmt);
return false;
}
List<?> row = stmt.getResultSet().getCurrentRecord();
if (row == null) {
if (callback instanceof ContinuousStatementCallback) {
((ContinuousStatementCallback)callback).beforeNextExecution(this.stmt);
}
return true;
}
callback.onRow(stmt, stmt.getResultSet());
return true;
} catch (Exception e) {
onException(e);
return false;
} catch (Throwable t) {
onException(new TeiidRuntimeException(t));
return false;
}
} | boolean processRow(ResultsFuture<Boolean> hasNext) { try { if (!hasNext.get()) { callback.onComplete(stmt); return false; } List<?> row = stmt.getResultSet().getCurrentRecord(); if (row == null) { if (callback instanceof ContinuousStatementCallback) { ((ContinuousStatementCallback)callback).beforeNextExecution(this.stmt); } return true; } callback.onRow(stmt, stmt.getResultSet()); return true; } catch (Exception e) { onException(e); return false; } catch (Throwable t) { onException(new TeiidRuntimeException(t)); return false; } } | /**
* return true to continue processing
*/ | return true to continue processing | processRow | {
"repo_name": "jagazee/teiid-8.7",
"path": "client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java",
"license": "lgpl-2.1",
"size": 4002
} | [
"java.util.List",
"org.teiid.client.util.ResultsFuture",
"org.teiid.core.TeiidRuntimeException"
] | import java.util.List; import org.teiid.client.util.ResultsFuture; import org.teiid.core.TeiidRuntimeException; | import java.util.*; import org.teiid.client.util.*; import org.teiid.core.*; | [
"java.util",
"org.teiid.client",
"org.teiid.core"
] | java.util; org.teiid.client; org.teiid.core; | 2,151,026 |
@NotNull
@Override
public final Promise<Void> startProcess() {
if (!processStarted) {
processStarted = true;
beforeProcess();
doProcess();
}
return processCompletion;
} | final Promise<Void> function() { if (!processStarted) { processStarted = true; beforeProcess(); doProcess(); } return processCompletion; } | /**
* Starts this communicating process if it is not started yet.
* Consistently executes {@link #beforeProcess()} and
* {@link #doProcess()}.
*
* @return {@code promise} with null result as the marker
* of completion of the process
*/ | Starts this communicating process if it is not started yet. Consistently executes <code>#beforeProcess()</code> and <code>#doProcess()</code> | startProcess | {
"repo_name": "softindex/datakernel",
"path": "core-csp/src/main/java/io/datakernel/csp/AbstractCommunicatingProcess.java",
"license": "apache-2.0",
"size": 6283
} | [
"io.datakernel.promise.Promise"
] | import io.datakernel.promise.Promise; | import io.datakernel.promise.*; | [
"io.datakernel.promise"
] | io.datakernel.promise; | 1,342,142 |
@ServiceMethod(returns = ReturnType.SINGLE)
public DdosProtectionPlanInner createOrUpdate(
String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) {
return createOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) DdosProtectionPlanInner function( String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { return createOrUpdateAsync(resourceGroupName, ddosProtectionPlanName, parameters).block(); } | /**
* Creates or updates a DDoS protection plan.
*
* @param resourceGroupName The name of the resource group.
* @param ddosProtectionPlanName The name of the DDoS protection plan.
* @param parameters Parameters supplied to the create or update 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 a DDoS protection plan in a resource group.
*/ | Creates or updates a DDoS protection plan | createOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/DdosProtectionPlansClientImpl.java",
"license": "mit",
"size": 73865
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,399,609 |
public static void notZero(
final Collection collection,
final String argumentName
) throws InvalidArgumentException {
notNull(collection, "collection");
if (collection.size() == 0) {
throw new InvalidArgumentException(
"The size of argument[{}] must be more then 0", argumentName);
}
} | static void function( final Collection collection, final String argumentName ) throws InvalidArgumentException { notNull(collection, STR); if (collection.size() == 0) { throw new InvalidArgumentException( STR, argumentName); } } | /**
* Test the collection is null or it is emptyArray, if so an exception will be thrown
*
* @param collection
* The collection which will be checked
* @param argumentName
* The argument name
* @throws InvalidArgumentException
* The checked collection is null or it is emptyArray
*/ | Test the collection is null or it is emptyArray, if so an exception will be thrown | notZero | {
"repo_name": "Inactionware/uapi.base",
"path": "uapi.common/src/main/java/uapi/common/ArgumentChecker.java",
"license": "gpl-3.0",
"size": 11026
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,169,514 |
@SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, Range range) {
return primitiveArrayGet(array, range);
} | @SuppressWarnings(STR) static List<Double> function(double[] array, Range range) { return primitiveArrayGet(array, range); } | /**
* Support the subscript operator with a range for a double array
*
* @param array a double array
* @param range a range indicating the indices for the items to retrieve
* @return list of the retrieved doubles
* @since 1.0
*/ | Support the subscript operator with a range for a double array | getAt | {
"repo_name": "apache/incubator-groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 703151
} | [
"groovy.lang.Range",
"java.util.List"
] | import groovy.lang.Range; import java.util.List; | import groovy.lang.*; import java.util.*; | [
"groovy.lang",
"java.util"
] | groovy.lang; java.util; | 2,620,770 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.