method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public Observable<ServiceResponse<Page<ExpressRoutePortInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); }
Observable<ServiceResponse<Page<ExpressRoutePortInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); }
/** * List all the ExpressRoutePort resources in the specified resource group. * ServiceResponse<PageImpl<ExpressRoutePortInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;ExpressRoutePortInner&gt; object wrapped in {@link ServiceResponse} if successful. */
List all the ExpressRoutePort resources in the specified resource group
listByResourceGroupNextSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/network/v2019_08_01/implementation/ExpressRoutePortsInner.java", "license": "mit", "size": 74971 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
528,676
static boolean isPossibleFP(String val) { final int length = val.length(); for (int i = 0; i < length; ++i) { char c = val.charAt(i); if (!(c >= '0' && c <= '9' || c == '.' || c == '-' || c == '+' || c == 'E' || c == 'e')) { return false; } } return true; } private static final class XDouble implements XSDouble { private final double value; public XDouble(String s) throws NumberFormatException { if (isPossibleFP(s)) { value = Double.parseDouble(s); } else if ( s.equals("INF") ) { value = Double.POSITIVE_INFINITY; } else if ( s.equals("-INF") ) { value = Double.NEGATIVE_INFINITY; } else if ( s.equals("NaN" ) ) { value = Double.NaN; } else { throw new NumberFormatException(s); } }
static boolean isPossibleFP(String val) { final int length = val.length(); for (int i = 0; i < length; ++i) { char c = val.charAt(i); if (!(c >= '0' && c <= '9' c == '.' c == '-' c == '+' c == 'E' c == 'e')) { return false; } } return true; } private static final class XDouble implements XSDouble { private final double value; public XDouble(String s) throws NumberFormatException { if (isPossibleFP(s)) { value = Double.parseDouble(s); } else if ( s.equals("INF") ) { value = Double.POSITIVE_INFINITY; } else if ( s.equals("-INF") ) { value = Double.NEGATIVE_INFINITY; } else if ( s.equals("NaN" ) ) { value = Double.NaN; } else { throw new NumberFormatException(s); } }
/** * Returns true if it's possible that the given * string represents a valid floating point value * (excluding NaN, INF and -INF). */
Returns true if it's possible that the given string represents a valid floating point value (excluding NaN, INF and -INF)
isPossibleFP
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java", "license": "mit", "size": 10027 }
[ "com.sun.org.apache.xerces.internal.xs.datatypes.XSDouble" ]
import com.sun.org.apache.xerces.internal.xs.datatypes.XSDouble;
import com.sun.org.apache.xerces.internal.xs.datatypes.*;
[ "com.sun.org" ]
com.sun.org;
1,700,665
private void parseInstructionsFile( final URL bndFileURL ) throws MalformedURLException { // TODO use the certificate check property from the handler instead of true bellow try { InputStream is = null; try { is = URLUtils.prepareInputStream( bndFileURL, true ); m_wrappingProperties.load( is ); } finally { if( is != null ) { is.close(); } } } catch( IOException e ) { throwAsMalformedURLException( "Could not retrieve the instructions from [" + bndFileURL + "]", e ); } }
void function( final URL bndFileURL ) throws MalformedURLException { try { InputStream is = null; try { is = URLUtils.prepareInputStream( bndFileURL, true ); m_wrappingProperties.load( is ); } finally { if( is != null ) { is.close(); } } } catch( IOException e ) { throwAsMalformedURLException( STR + bndFileURL + "]", e ); } }
/** * Loads the properties out of an url. * * @param bndFileURL url of the file containing the instructions * * @throws MalformedURLException if the file could not be read */
Loads the properties out of an url
parseInstructionsFile
{ "repo_name": "aslakknutsen/fabric8", "path": "sandbox/fabric8-maven-plugin/src/main/java/io/fabric8/maven/WrapUrlParser.java", "license": "apache-2.0", "size": 7007 }
[ "java.io.IOException", "java.io.InputStream", "java.net.MalformedURLException", "org.ops4j.net.URLUtils" ]
import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import org.ops4j.net.URLUtils;
import java.io.*; import java.net.*; import org.ops4j.net.*;
[ "java.io", "java.net", "org.ops4j.net" ]
java.io; java.net; org.ops4j.net;
2,088,443
public Timestamp getLockedDateValue() { return this.lockedDateValue; }
Timestamp function() { return this.lockedDateValue; }
/** * Gets the lockedDate attribute. * @return Returns the lockedDate. */
Gets the lockedDate attribute
getLockedDateValue
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/ken/bo/NotificationBo.java", "license": "apache-2.0", "size": 16409 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,252,812
EReference getState_EndedSteps();
EReference getState_EndedSteps();
/** * Returns the meta object for the reference list '{@link org.eclipse.gemoc.trace.commons.model.trace.State#getEndedSteps <em>Ended Steps</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference list '<em>Ended Steps</em>'. * @see org.eclipse.gemoc.trace.commons.model.trace.State#getEndedSteps() * @see #getState() * @generated */
Returns the meta object for the reference list '<code>org.eclipse.gemoc.trace.commons.model.trace.State#getEndedSteps Ended Steps</code>'.
getState_EndedSteps
{ "repo_name": "SiriusLab/SiriusAnimator", "path": "trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracePackage.java", "license": "epl-1.0", "size": 52505 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
4,290
public void deleteFile( FTPFile file ) throws KettleException { try { this.connection.deleteFile( file ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "JobFTPS.Error.DeletingFile", file.getName() ), e ); } }
void function( FTPFile file ) throws KettleException { try { this.connection.deleteFile( file ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, STR, file.getName() ), e ); } }
/** * * this method is used to delete a file in remote host * * @param file * File on remote host to delete * @throws KettleException */
this method is used to delete a file in remote host
deleteFile
{ "repo_name": "TatsianaKasiankova/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/job/entries/ftpsget/FTPSConnection.java", "license": "apache-2.0", "size": 17969 }
[ "org.ftp4che.util.ftpfile.FTPFile", "org.pentaho.di.core.exception.KettleException", "org.pentaho.di.i18n.BaseMessages" ]
import org.ftp4che.util.ftpfile.FTPFile; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.i18n.BaseMessages;
import org.ftp4che.util.ftpfile.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.i18n.*;
[ "org.ftp4che.util", "org.pentaho.di" ]
org.ftp4che.util; org.pentaho.di;
905,915
public InputStream getSslCaCert() { return sslCaCert; }
InputStream function() { return sslCaCert; }
/** * Get SSL CA cert. * * @return Input stream to the SSL CA cert */
Get SSL CA cert
getSslCaCert
{ "repo_name": "coviu/coviu-java-sdk", "path": "core/src/main/java/com/coviu/core/ApiClient.java", "license": "apache-2.0", "size": 48459 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
685,241
private boolean hasPossibleProcedureDescriptionFormats(String procedureDescriptionFormat, boolean mimeTypeAllowed) { Set<String> possibleFormats = Sets.newHashSet(); if (mimeTypeAllowed) { possibleFormats.addAll(checkForUrlVsMimeType(procedureDescriptionFormat)); } String procedureDescriptionFormatMatchingString = getProcedureDescriptionFormatMatchingString(procedureDescriptionFormat); for (Entry<OwsServiceKey, Set<String>> pdfByServiceOperatorKey : getProcedureDescriptionFormatRepository() .getAllProcedureDescriptionFormats().entrySet()) { for (String pdfFromRepository : pdfByServiceOperatorKey.getValue()) { if (procedureDescriptionFormatMatchingString .equals(getProcedureDescriptionFormatMatchingString(pdfFromRepository))) { possibleFormats.add(pdfFromRepository); } } } possibleFormats.addAll(getConverterRepository().getFromNamespaceConverterTo( procedureDescriptionFormat)); return !possibleFormats.isEmpty(); }
boolean function(String procedureDescriptionFormat, boolean mimeTypeAllowed) { Set<String> possibleFormats = Sets.newHashSet(); if (mimeTypeAllowed) { possibleFormats.addAll(checkForUrlVsMimeType(procedureDescriptionFormat)); } String procedureDescriptionFormatMatchingString = getProcedureDescriptionFormatMatchingString(procedureDescriptionFormat); for (Entry<OwsServiceKey, Set<String>> pdfByServiceOperatorKey : getProcedureDescriptionFormatRepository() .getAllProcedureDescriptionFormats().entrySet()) { for (String pdfFromRepository : pdfByServiceOperatorKey.getValue()) { if (procedureDescriptionFormatMatchingString .equals(getProcedureDescriptionFormatMatchingString(pdfFromRepository))) { possibleFormats.add(pdfFromRepository); } } } possibleFormats.addAll(getConverterRepository().getFromNamespaceConverterTo( procedureDescriptionFormat)); return !possibleFormats.isEmpty(); }
/** * Get possible procedure description formats for this procedure description * format. More precise, are there converter available. * * @param procedureDescriptionFormat * Procedure description format to check * @return All possible procedure description formats */
Get possible procedure description formats for this procedure description format. More precise, are there converter available
hasPossibleProcedureDescriptionFormats
{ "repo_name": "autermann/SOS", "path": "core/api/src/main/java/org/n52/sos/request/operator/AbstractRequestOperator.java", "license": "gpl-2.0", "size": 53375 }
[ "com.google.common.collect.Sets", "java.util.Map", "java.util.Set", "org.n52.shetland.ogc.ows.service.OwsServiceKey" ]
import com.google.common.collect.Sets; import java.util.Map; import java.util.Set; import org.n52.shetland.ogc.ows.service.OwsServiceKey;
import com.google.common.collect.*; import java.util.*; import org.n52.shetland.ogc.ows.service.*;
[ "com.google.common", "java.util", "org.n52.shetland" ]
com.google.common; java.util; org.n52.shetland;
315,366
public Bbox getMaxBounds() { return maxBounds; }
Bbox function() { return maxBounds; }
/** * Get an optional maximum bounds wherein all positions should stay. * * @return An optional maximum bounds. */
Get an optional maximum bounds wherein all positions should stay
getMaxBounds
{ "repo_name": "geomajas/geomajas-project-client-gwt2", "path": "plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/controller/AbstractGeometryIndexController.java", "license": "agpl-3.0", "size": 5629 }
[ "org.geomajas.geometry.Bbox" ]
import org.geomajas.geometry.Bbox;
import org.geomajas.geometry.*;
[ "org.geomajas.geometry" ]
org.geomajas.geometry;
1,924,539
public void parse(ContactEntry contact, ElementParser parser);
void function(ContactEntry contact, ElementParser parser);
/** * Parses an element from the textual description, and sets or adds it to * the contact entry. * * @param contact the contact the parsed element should be added or set. * @param parser the parser used for the parsing of the description. * * @see ElementParser */
Parses an element from the textual description, and sets or adds it to the contact entry
parse
{ "repo_name": "simonrrr/gdata-java-client", "path": "java/sample/contacts/ElementHelperInterface.java", "license": "apache-2.0", "size": 2657 }
[ "com.google.gdata.data.contacts.ContactEntry" ]
import com.google.gdata.data.contacts.ContactEntry;
import com.google.gdata.data.contacts.*;
[ "com.google.gdata" ]
com.google.gdata;
2,667,833
public final InputStream getContentObjectStream(final long contentId) throws FileNotFoundException { String path = getContentObjectPath(contentId); return new FileInputStream(new File(path)); }
final InputStream function(final long contentId) throws FileNotFoundException { String path = getContentObjectPath(contentId); return new FileInputStream(new File(path)); }
/** * Opens InputStream to object of content. * @param contentId ID of content * @return Returns input stream * @throws FileNotFoundException FileNotFoundException could be thrown */
Opens InputStream to object of content
getContentObjectStream
{ "repo_name": "deleidos/digitaledge-platform", "path": "webapp-content/src/java/main/com/deleidos/rtws/webapp/contentapi/dao/SimpleContentStorageDAO.java", "license": "apache-2.0", "size": 5660 }
[ "java.io.File", "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.InputStream" ]
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,565,985
void updatePortStatistics(DeviceId deviceId, Collection<PortStatistics> portStatistics);
void updatePortStatistics(DeviceId deviceId, Collection<PortStatistics> portStatistics);
/** * Updates statistics about all ports of a device. * * @param deviceId identity of the device * @param portStatistics list of device port statistics */
Updates statistics about all ports of a device
updatePortStatistics
{ "repo_name": "sdnwiselab/onos", "path": "incubator/api/src/main/java/org/onosproject/incubator/net/virtual/provider/VirtualDeviceProviderService.java", "license": "apache-2.0", "size": 2495 }
[ "java.util.Collection", "org.onosproject.net.DeviceId", "org.onosproject.net.device.PortStatistics" ]
import java.util.Collection; import org.onosproject.net.DeviceId; import org.onosproject.net.device.PortStatistics;
import java.util.*; import org.onosproject.net.*; import org.onosproject.net.device.*;
[ "java.util", "org.onosproject.net" ]
java.util; org.onosproject.net;
989,637
private void displaySearch() { setIsPageDirty(false); cqlLibraryView.getCellTablePanel().clear(); cqlLibraryView.resetMessageDisplay(); String heading = "CQL Library"; panel.setHeading(heading, CQL_LIBRARY); setSubSkipEmbeddedLink("CQLSearchView_mainPanel"); FlowPanel fp = new FlowPanel(); fp.getElement().setId("fp_FlowPanel_CQL"); int filter = cqlLibraryView.getSelectedFilter(); search(cqlLibraryView.getSearchString().getValue(), filter, 1,Integer.MAX_VALUE); searchRecentLibraries(); buildCreateLibrary(); fp.add(cqlLibraryView.asWidget()); panel.setContent(fp); Mat.focusSkipLists(CQL_LIBRARY); }
void function() { setIsPageDirty(false); cqlLibraryView.getCellTablePanel().clear(); cqlLibraryView.resetMessageDisplay(); String heading = STR; panel.setHeading(heading, CQL_LIBRARY); setSubSkipEmbeddedLink(STR); FlowPanel fp = new FlowPanel(); fp.getElement().setId(STR); int filter = cqlLibraryView.getSelectedFilter(); search(cqlLibraryView.getSearchString().getValue(), filter, 1,Integer.MAX_VALUE); searchRecentLibraries(); buildCreateLibrary(); fp.add(cqlLibraryView.asWidget()); panel.setContent(fp); Mat.focusSkipLists(CQL_LIBRARY); }
/** * This method is called from beforeDisplay and this becomes main method for CQL Library View. */
This method is called from beforeDisplay and this becomes main method for CQL Library View
displaySearch
{ "repo_name": "MeasureAuthoringTool/MeasureAuthoringTool_Release", "path": "mat/src/main/java/mat/client/CqlLibraryPresenter.java", "license": "cc0-1.0", "size": 49257 }
[ "com.google.gwt.user.client.ui.FlowPanel" ]
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
1,650,677
private void forceMainActivityReload() { PackageManager pm = getPackageManager(); Intent launchIntent = pm.getLaunchIntentForPackage(getApplicationContext().getPackageName()); startActivity(launchIntent); }
void function() { PackageManager pm = getPackageManager(); Intent launchIntent = pm.getLaunchIntentForPackage(getApplicationContext().getPackageName()); startActivity(launchIntent); }
/** * Forces the main activity to re-launch if it's unloaded. */
Forces the main activity to re-launch if it's unloaded
forceMainActivityReload
{ "repo_name": "pssaravanan/phonegap-plugin-push", "path": "src/android/com/adobe/phonegap/push/PushHandlerActivity.java", "license": "mit", "size": 2407 }
[ "android.content.Intent", "android.content.pm.PackageManager" ]
import android.content.Intent; import android.content.pm.PackageManager;
import android.content.*; import android.content.pm.*;
[ "android.content" ]
android.content;
1,577,999
@Test public void node_writable_uri_02() throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException { Node n = NodeFactory.createURI("http://user:[email protected]/some/path?key=value#id"); NodeWritable nw = new NodeWritable(n); testWriteRead(nw, nw); }
void function() throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException { Node n = NodeFactory.createURI("http: NodeWritable nw = new NodeWritable(n); testWriteRead(nw, nw); }
/** * Basic node writable round tripping test * * @throws IOException * @throws InstantiationException * @throws IllegalAccessException * @throws ClassNotFoundException */
Basic node writable round tripping test
node_writable_uri_02
{ "repo_name": "CesarPantoja/jena", "path": "jena-elephas/jena-elephas-common/src/test/java/org/apache/jena/hadoop/rdf/io/types/RdfTypesTest.java", "license": "apache-2.0", "size": 14460 }
[ "org.apache.jena.hadoop.rdf.types.NodeWritable" ]
import org.apache.jena.hadoop.rdf.types.NodeWritable;
import org.apache.jena.hadoop.rdf.types.*;
[ "org.apache.jena" ]
org.apache.jena;
1,330,654
public final Player getPlayer() { return player; }
final Player function() { return player; }
/** * Returns the player involved in this event * * @return Player who is involved in this event */
Returns the player involved in this event
getPlayer
{ "repo_name": "UnlimitedFreedom/UF-Essentials", "path": "Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java", "license": "gpl-3.0", "size": 3521 }
[ "org.bukkit.entity.Player" ]
import org.bukkit.entity.Player;
import org.bukkit.entity.*;
[ "org.bukkit.entity" ]
org.bukkit.entity;
1,626,886
public static void setTelephonyProperty(int phoneId, String property, String value) { String propVal = ""; String p[] = null; String prop = SystemProperties.get(property); if (value == null) { value = ""; } if (prop != null) { p = prop.split(","); } if (!SubscriptionManager.isValidPhoneId(phoneId)) { Rlog.d(TAG, "setTelephonyProperty: invalid phoneId=" + phoneId + " property=" + property + " value: " + value + " prop=" + prop); return; } for (int i = 0; i < phoneId; i++) { String str = ""; if ((p != null) && (i < p.length)) { str = p[i]; } propVal = propVal + str + ","; } propVal = propVal + value; if (p != null) { for (int i = phoneId + 1; i < p.length; i++) { propVal = propVal + "," + p[i]; } } if (property.length() > SystemProperties.PROP_NAME_MAX || propVal.length() > SystemProperties.PROP_VALUE_MAX) { Rlog.d(TAG, "setTelephonyProperty: property to long phoneId=" + phoneId + " property=" + property + " value: " + value + " propVal=" + propVal); return; } Rlog.d(TAG, "setTelephonyProperty: success phoneId=" + phoneId + " property=" + property + " value: " + value + " propVal=" + propVal); SystemProperties.set(property, propVal); }
static void function(int phoneId, String property, String value) { String propVal = STRSTR,STRsetTelephonyProperty: invalid phoneId=STR property=STR value: STR prop=STRSTR,STR,STRsetTelephonyProperty: property to long phoneId=STR property=STR value: STR propVal=STRsetTelephonyProperty: success phoneId=STR property=STR value: STR propVal=" + propVal); SystemProperties.set(property, propVal); }
/** * Sets the telephony property with the value specified. * * @hide */
Sets the telephony property with the value specified
setTelephonyProperty
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/telephony/TelephonyManager.java", "license": "gpl-3.0", "size": 165169 }
[ "android.os.SystemProperties" ]
import android.os.SystemProperties;
import android.os.*;
[ "android.os" ]
android.os;
228,143
public IFormatWriter unwrap() throws FormatException, IOException { return unwrap(null, null); }
IFormatWriter function() throws FormatException, IOException { return unwrap(null, null); }
/** * Unwraps nested wrapped writers until the core writer (i.e., not * a {@link WriterWrapper} or {@link ImageWriter}) is found. */
Unwraps nested wrapped writers until the core writer (i.e., not a <code>WriterWrapper</code> or <code>ImageWriter</code>) is found
unwrap
{ "repo_name": "ctrueden/bioformats", "path": "components/formats-api/src/loci/formats/WriterWrapper.java", "license": "gpl-2.0", "size": 10674 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
212,096
private StringBuilder writeSummaryCaseDetails() { StringBuilder summary = new StringBuilder(); String caseName = currentCase.getDisplayName(); String caseNumber = currentCase.getNumber(); String examiner = currentCase.getExaminer(); final boolean agencyLogoSet = reportBranding.getAgencyLogoPath() != null && !reportBranding.getAgencyLogoPath().isEmpty(); int imagecount; try { imagecount = currentCase.getDataSources().size(); } catch (TskCoreException ex) { imagecount = 0; } summary.append("<div class=\"title\">\n"); //NON-NLS if (agencyLogoSet) { summary.append("<div class=\"left\">\n"); //NON-NLS summary.append("<img src=\""); summary.append(Paths.get(reportBranding.getAgencyLogoPath()).getFileName().toString()); summary.append("\" />\n"); //NON-NLS summary.append("</div>\n"); //NON-NLS } final String align = agencyLogoSet ? "right" : "left"; //NON-NLS NON-NLS summary.append("<div class=\"").append(align).append("\">\n"); //NON-NLS summary.append("<table>\n"); //NON-NLS summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName")) //NON-NLS .append("</td><td>").append(caseName).append("</td></tr>\n"); //NON-NLS NON-NLS summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum")) //NON-NLS .append("</td><td>").append(!caseNumber.isEmpty() ? caseNumber : NbBundle //NON-NLS .getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("</td></tr>\n"); //NON-NLS summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("</td><td>") //NON-NLS .append(!examiner.isEmpty() ? examiner : NbBundle .getMessage(this.getClass(), "ReportHTML.writeSum.noExaminer")) .append("</td></tr>\n"); //NON-NLS summary.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages")) //NON-NLS .append("</td><td>").append(imagecount).append("</td></tr>\n"); //NON-NLS summary.append("</table>\n"); //NON-NLS summary.append("</div>\n"); //NON-NLS summary.append("<div class=\"clear\"></div>\n"); //NON-NLS summary.append("</div>\n"); //NON-NLS return summary; }
StringBuilder function() { StringBuilder summary = new StringBuilder(); String caseName = currentCase.getDisplayName(); String caseNumber = currentCase.getNumber(); String examiner = currentCase.getExaminer(); final boolean agencyLogoSet = reportBranding.getAgencyLogoPath() != null && !reportBranding.getAgencyLogoPath().isEmpty(); int imagecount; try { imagecount = currentCase.getDataSources().size(); } catch (TskCoreException ex) { imagecount = 0; } summary.append(STRtitle\">\n"); if (agencyLogoSet) { summary.append(STRleft\">\n"); summary.append(STRSTR\STR); summary.append(STR); } final String align = agencyLogoSet ? "right" : "left"; summary.append(STRSTR\">\n"); summary.append(STR); summary.append(STR).append(NbBundle.getMessage(this.getClass(), STR)) .append(STR).append(caseName).append(STR); summary.append(STR).append(NbBundle.getMessage(this.getClass(), STR)) .append(STR).append(!caseNumber.isEmpty() ? caseNumber : NbBundle .getMessage(this.getClass(), STR)).append(STR); summary.append(STR).append(NbBundle.getMessage(this.getClass(), STR)).append(STR) .append(!examiner.isEmpty() ? examiner : NbBundle .getMessage(this.getClass(), STR)) .append(STR); summary.append(STR).append(NbBundle.getMessage(this.getClass(), STR)) .append(STR).append(imagecount).append(STR); summary.append(STR); summary.append(STR); summary.append(STRclear\STR); summary.append(STR); return summary; }
/** * Write the case details section of the summary for this report. * * @return StringBuilder updated html report with case details */
Write the case details section of the summary for this report
writeSummaryCaseDetails
{ "repo_name": "millmanorama/autopsy", "path": "Core/src/org/sleuthkit/autopsy/report/ReportHTML.java", "license": "apache-2.0", "size": 62031 }
[ "org.openide.util.NbBundle", "org.sleuthkit.datamodel.TskCoreException" ]
import org.openide.util.NbBundle; import org.sleuthkit.datamodel.TskCoreException;
import org.openide.util.*; import org.sleuthkit.datamodel.*;
[ "org.openide.util", "org.sleuthkit.datamodel" ]
org.openide.util; org.sleuthkit.datamodel;
1,063,951
public static Response processCitationPatentPDF(final InputStream inputStream, final boolean consolidate) { LOGGER.debug(methodLogIn()); Response response = null; String retVal = null; boolean isparallelExec = GrobidServiceProperties.isParallelExec(); File originFile = null; Engine engine = null; try { originFile = GrobidRestUtils.writeInputFile(inputStream); if (originFile == null) { response = Response.status(Status.INTERNAL_SERVER_ERROR).build(); } else { // starts conversion process engine = GrobidRestUtils.getEngine(isparallelExec); List<PatentItem> patents = new ArrayList<PatentItem>(); List<BibDataSet> articles = new ArrayList<BibDataSet>(); if (isparallelExec) { retVal = engine.processAllCitationsInPDFPatent(originFile.getAbsolutePath(), articles, patents, consolidate); GrobidPoolingFactory.returnEngine(engine); } else { synchronized (engine) { retVal = engine.processAllCitationsInPDFPatent(originFile.getAbsolutePath(), articles, patents, consolidate); } } GrobidRestUtils.removeTempFile(originFile); if (!GrobidRestUtils.isResultOK(retVal)) { response = Response.status(Status.NO_CONTENT).build(); } else { response = Response.status(Status.OK).entity(retVal).type(MediaType.APPLICATION_XML).build(); } } } catch (NoSuchElementException nseExp) { LOGGER.error("Could not get an engine from the pool within configured time. Sending service unavailable."); response = Response.status(Status.SERVICE_UNAVAILABLE).build(); } catch (Exception exp) { LOGGER.error("An unexpected exception occurs. ", exp); response = Response.status(Status.INTERNAL_SERVER_ERROR).build(); } finally { GrobidRestUtils.removeTempFile(originFile); if (isparallelExec && engine != null) { GrobidPoolingFactory.returnEngine(engine); } } LOGGER.debug(methodLogOut()); return response; }
static Response function(final InputStream inputStream, final boolean consolidate) { LOGGER.debug(methodLogIn()); Response response = null; String retVal = null; boolean isparallelExec = GrobidServiceProperties.isParallelExec(); File originFile = null; Engine engine = null; try { originFile = GrobidRestUtils.writeInputFile(inputStream); if (originFile == null) { response = Response.status(Status.INTERNAL_SERVER_ERROR).build(); } else { engine = GrobidRestUtils.getEngine(isparallelExec); List<PatentItem> patents = new ArrayList<PatentItem>(); List<BibDataSet> articles = new ArrayList<BibDataSet>(); if (isparallelExec) { retVal = engine.processAllCitationsInPDFPatent(originFile.getAbsolutePath(), articles, patents, consolidate); GrobidPoolingFactory.returnEngine(engine); } else { synchronized (engine) { retVal = engine.processAllCitationsInPDFPatent(originFile.getAbsolutePath(), articles, patents, consolidate); } } GrobidRestUtils.removeTempFile(originFile); if (!GrobidRestUtils.isResultOK(retVal)) { response = Response.status(Status.NO_CONTENT).build(); } else { response = Response.status(Status.OK).entity(retVal).type(MediaType.APPLICATION_XML).build(); } } } catch (NoSuchElementException nseExp) { LOGGER.error(STR); response = Response.status(Status.SERVICE_UNAVAILABLE).build(); } catch (Exception exp) { LOGGER.error(STR, exp); response = Response.status(Status.INTERNAL_SERVER_ERROR).build(); } finally { GrobidRestUtils.removeTempFile(originFile); if (isparallelExec && engine != null) { GrobidPoolingFactory.returnEngine(engine); } } LOGGER.debug(methodLogOut()); return response; }
/** * Process a patent document in PDF for extracting and parsing citations in the description body. * * @param inputStream * the data of origin document * * @return a response object mainly containing the TEI representation of the * citation */
Process a patent document in PDF for extracting and parsing citations in the description body
processCitationPatentPDF
{ "repo_name": "Aazhar/grobid", "path": "grobid-service/src/main/java/org/grobid/service/process/GrobidRestProcessFiles.java", "license": "apache-2.0", "size": 13204 }
[ "java.io.File", "java.io.InputStream", "java.util.ArrayList", "java.util.List", "java.util.NoSuchElementException", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.grobid.core.data.BibDataSet", "org.grobid.core.data.PatentItem", "org.grobid.core.engines.Engine", "org.grobid.core.factory.GrobidPoolingFactory", "org.grobid.service.util.GrobidRestUtils", "org.grobid.service.util.GrobidServiceProperties" ]
import java.io.File; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.NoSuchElementException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.grobid.core.data.BibDataSet; import org.grobid.core.data.PatentItem; import org.grobid.core.engines.Engine; import org.grobid.core.factory.GrobidPoolingFactory; import org.grobid.service.util.GrobidRestUtils; import org.grobid.service.util.GrobidServiceProperties;
import java.io.*; import java.util.*; import javax.ws.rs.core.*; import org.grobid.core.data.*; import org.grobid.core.engines.*; import org.grobid.core.factory.*; import org.grobid.service.util.*;
[ "java.io", "java.util", "javax.ws", "org.grobid.core", "org.grobid.service" ]
java.io; java.util; javax.ws; org.grobid.core; org.grobid.service;
2,648,494
@Override public ResourceLocator getPluginResourceLocator() { return plugin; }
ResourceLocator function() { return plugin; }
/** * Returns the singleton instance of the Eclipse plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the singleton instance. * @generated */
Returns the singleton instance of the Eclipse plugin.
getPluginResourceLocator
{ "repo_name": "peterkir/org.eclipse.oomph", "path": "plugins/org.eclipse.oomph.setup.pde.edit/src/org/eclipse/oomph/setup/pde/provider/PDEEditPlugin.java", "license": "epl-1.0", "size": 2393 }
[ "org.eclipse.emf.common.util.ResourceLocator" ]
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,268,177
@Override public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { ContrastEnhancement ce = sf.contrastEnhancement(ff.literal(1.0), ContrastMethod.NONE); // Use of builder is easier for code examples; but fills in SLD defaults // Currently only applies the opacity. RasterSymbolizer symbolizer = sf.rasterSymbolizer( getId(), null, sf.description(Text.text("raster"), null), Units.PIXEL, opacity(), null, null, null, ce, null, null); List<Rule> rules = new ArrayList<>(); MBFilter filter = getFilter(); org.geotools.styling.Rule rule = sf.rule( getId(), null, null, 0.0, Double.MAX_VALUE, Arrays.asList(symbolizer), filter.filter()); rules.add(rule); return Collections.singletonList( sf.featureTypeStyle( getId(), sf.description( Text.text("MBStyle " + getId()), Text.text("Generated for " + getSourceLayer())), null, Collections.emptySet(), filter.semanticTypeIdentifiers(), rules)); } /** * Rendering type of this layer. * * @return {@link #TYPE}
List<FeatureTypeStyle> function(MBStyle styleContext) { ContrastEnhancement ce = sf.contrastEnhancement(ff.literal(1.0), ContrastMethod.NONE); RasterSymbolizer symbolizer = sf.rasterSymbolizer( getId(), null, sf.description(Text.text(STR), null), Units.PIXEL, opacity(), null, null, null, ce, null, null); List<Rule> rules = new ArrayList<>(); MBFilter filter = getFilter(); org.geotools.styling.Rule rule = sf.rule( getId(), null, null, 0.0, Double.MAX_VALUE, Arrays.asList(symbolizer), filter.filter()); rules.add(rule); return Collections.singletonList( sf.featureTypeStyle( getId(), sf.description( Text.text(STR + getId()), Text.text(STR + getSourceLayer())), null, Collections.emptySet(), filter.semanticTypeIdentifiers(), rules)); } /** * Rendering type of this layer. * * @return {@link #TYPE}
/** * Transform {@link RasterMBLayer} to GeoTools FeatureTypeStyle. * * <p>Notes: * * <ul> * <li>Assumes 3-band RGB * </ul> * * @param styleContext The MBStyle to which this layer belongs, used as a context for things * like resolving sprite and glyph names to full urls. * @return FeatureTypeStyle */
Transform <code>RasterMBLayer</code> to GeoTools FeatureTypeStyle. Notes: Assumes 3-band RGB
transformInternal
{ "repo_name": "geotools/geotools", "path": "modules/extension/mbstyle/src/main/java/org/geotools/mbstyle/layer/RasterMBLayer.java", "license": "lgpl-2.1", "size": 8533 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.Collections", "java.util.List", "org.geotools.mbstyle.MBStyle", "org.geotools.mbstyle.parse.MBFilter", "org.geotools.measure.Units", "org.geotools.styling.ContrastEnhancement", "org.geotools.styling.FeatureTypeStyle", "org.geotools.styling.RasterSymbolizer", "org.geotools.text.Text", "org.opengis.style.ContrastMethod", "org.opengis.style.Rule" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.geotools.mbstyle.MBStyle; import org.geotools.mbstyle.parse.MBFilter; import org.geotools.measure.Units; import org.geotools.styling.ContrastEnhancement; import org.geotools.styling.FeatureTypeStyle; import org.geotools.styling.RasterSymbolizer; import org.geotools.text.Text; import org.opengis.style.ContrastMethod; import org.opengis.style.Rule;
import java.util.*; import org.geotools.mbstyle.*; import org.geotools.mbstyle.parse.*; import org.geotools.measure.*; import org.geotools.styling.*; import org.geotools.text.*; import org.opengis.style.*;
[ "java.util", "org.geotools.mbstyle", "org.geotools.measure", "org.geotools.styling", "org.geotools.text", "org.opengis.style" ]
java.util; org.geotools.mbstyle; org.geotools.measure; org.geotools.styling; org.geotools.text; org.opengis.style;
2,143,021
SecurityContext getSecurityContext();
SecurityContext getSecurityContext();
/** * Returns the security context. * * @return See above. */
Returns the security context
getSecurityContext
{ "repo_name": "chris-allan/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java", "license": "gpl-2.0", "size": 24081 }
[ "org.openmicroscopy.shoola.env.data.util.SecurityContext" ]
import org.openmicroscopy.shoola.env.data.util.SecurityContext;
import org.openmicroscopy.shoola.env.data.util.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
950,936
private static int findInsertionPoint(final KeyValue[] kvs, final KeyValue pivotKeyValue) { // Now find where the pivotKeyValue would be placed int binaryResult = Arrays.binarySearch(kvs, pivotKeyValue, KV_COMPARATOR); if (binaryResult < 0) { return -1 - binaryResult; // Algebra on the formula provided in the binary search JavaDoc. } else { return binaryResult; } } private final KeyValue[] mKeyValues; private final EntityId mEntityId; private final KijiColumnName mColumn; private final KijiCellDecoder<T> mDecoder; private final HBaseColumnNameTranslator mColumnNameTranslator; private final int mMaxVersions; private int mCurrentVersions = 0; private int mNextIndex = 0; private KijiCell<T> mNextCell = null; private KijiCellIterator( final HBaseKijiRowData rowData, final KijiColumnName columnName, final HBaseColumnNameTranslator columnNameTranslator ) throws IOException { mKeyValues = SchemaPlatformBridge.get().keyValuesFromResult(rowData.mResult); mEntityId = rowData.mEntityId; mColumn = columnName; mDecoder = rowData.mDecoderProvider.getDecoder(mColumn); mColumnNameTranslator = columnNameTranslator; mMaxVersions = rowData.mDataRequest.getRequestForColumn(mColumn).getMaxVersions(); mNextIndex = findStartIndex(); mNextCell = getNextCell(); }
static int function(final KeyValue[] kvs, final KeyValue pivotKeyValue) { int binaryResult = Arrays.binarySearch(kvs, pivotKeyValue, KV_COMPARATOR); if (binaryResult < 0) { return -1 - binaryResult; } else { return binaryResult; } } private final KeyValue[] mKeyValues; private final EntityId mEntityId; private final KijiColumnName mColumn; private final KijiCellDecoder<T> mDecoder; private final HBaseColumnNameTranslator mColumnNameTranslator; private final int mMaxVersions; private int mCurrentVersions = 0; private int mNextIndex = 0; private KijiCell<T> mNextCell = null; private KijiCellIterator( final HBaseKijiRowData rowData, final KijiColumnName columnName, final HBaseColumnNameTranslator columnNameTranslator ) throws IOException { mKeyValues = SchemaPlatformBridge.get().keyValuesFromResult(rowData.mResult); mEntityId = rowData.mEntityId; mColumn = columnName; mDecoder = rowData.mDecoderProvider.getDecoder(mColumn); mColumnNameTranslator = columnNameTranslator; mMaxVersions = rowData.mDataRequest.getRequestForColumn(mColumn).getMaxVersions(); mNextIndex = findStartIndex(); mNextCell = getNextCell(); }
/** * Finds the insertion point of the pivot KeyValue in the KeyValue array and returns the index. * * @param kvs The KeyValue array to search in. * @param pivotKeyValue A KeyValue that is less than or equal to the first KeyValue for our * column, and larger than any KeyValue that may preceed values for our desired column. * @return The index of the first KeyValue in the desired map type family. */
Finds the insertion point of the pivot KeyValue in the KeyValue array and returns the index
findInsertionPoint
{ "repo_name": "rpinzon/kiji-schema", "path": "kiji-schema/src/main/java/org/kiji/schema/impl/hbase/HBaseKijiRowData.java", "license": "apache-2.0", "size": 32696 }
[ "java.io.IOException", "java.util.Arrays", "org.apache.hadoop.hbase.KeyValue", "org.kiji.schema.EntityId", "org.kiji.schema.KijiCell", "org.kiji.schema.KijiCellDecoder", "org.kiji.schema.KijiColumnName", "org.kiji.schema.layout.HBaseColumnNameTranslator", "org.kiji.schema.platform.SchemaPlatformBridge" ]
import java.io.IOException; import java.util.Arrays; import org.apache.hadoop.hbase.KeyValue; import org.kiji.schema.EntityId; import org.kiji.schema.KijiCell; import org.kiji.schema.KijiCellDecoder; import org.kiji.schema.KijiColumnName; import org.kiji.schema.layout.HBaseColumnNameTranslator; import org.kiji.schema.platform.SchemaPlatformBridge;
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.kiji.schema.*; import org.kiji.schema.layout.*; import org.kiji.schema.platform.*;
[ "java.io", "java.util", "org.apache.hadoop", "org.kiji.schema" ]
java.io; java.util; org.apache.hadoop; org.kiji.schema;
2,133,144
public void save( RepositoryElementInterface repositoryElement, String versionComment, Calendar versionDate, ProgressMonitorListener monitor, boolean overwrite ) throws KettleException;
void function( RepositoryElementInterface repositoryElement, String versionComment, Calendar versionDate, ProgressMonitorListener monitor, boolean overwrite ) throws KettleException;
/** * Save the object to the repository with version comments as well as version dates. This form exists largely to * support the importing of revisions, preserving their revision date. * * @param repositoryElement * @param versionComment * @param versionDate * @param monitor * @param overwrite * @throws KettleException */
Save the object to the repository with version comments as well as version dates. This form exists largely to support the importing of revisions, preserving their revision date
save
{ "repo_name": "roboguy/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/repository/Repository.java", "license": "apache-2.0", "size": 30305 }
[ "java.util.Calendar", "org.pentaho.di.core.ProgressMonitorListener", "org.pentaho.di.core.exception.KettleException" ]
import java.util.Calendar; import org.pentaho.di.core.ProgressMonitorListener; import org.pentaho.di.core.exception.KettleException;
import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.exception.*;
[ "java.util", "org.pentaho.di" ]
java.util; org.pentaho.di;
1,315,085
@ServiceMethod(returns = ReturnType.SINGLE) public void deleteDataFeed(String dataFeedId) { deleteDataFeedWithResponse(dataFeedId, Context.NONE); }
@ServiceMethod(returns = ReturnType.SINGLE) void function(String dataFeedId) { deleteDataFeedWithResponse(dataFeedId, Context.NONE); }
/** * Delete a data feed. * * <p><strong>Code sample</strong></p> * <!-- src_embed com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.deleteDataFeed#String --> * <pre> * final String dataFeedId = &quot;r47053f1-9080-09lo-bacf-8dccf2e86f&quot;; * metricsAdvisorAdminClient.deleteDataFeed&#40;dataFeedId&#41;; * </pre> * <!-- end com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClient.deleteDataFeed#String --> * * @param dataFeedId The data feed unique id. * * @throws IllegalArgumentException If {@code dataFeedId} does not conform to the UUID format specification. * @throws NullPointerException thrown if the {@code dataFeedId} is null. */
Delete a data feed. Code sample <code> final String dataFeedId = &quot;r47053f1-9080-09lo-bacf-8dccf2e86f&quot;; metricsAdvisorAdminClient.deleteDataFeed&#40;dataFeedId&#41;; </code>
deleteDataFeed
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/metricsadvisor/azure-ai-metricsadvisor/src/main/java/com/azure/ai/metricsadvisor/administration/MetricsAdvisorAdministrationClient.java", "license": "mit", "size": 153390 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.Context" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context;
import com.azure.core.annotation.*; import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
1,960,177
@Override public ChannelPipelineFactory getClientPipeline( ) { ChannelPipelineFactory factory = null; if ( ( factory = super.getClientPipeline( ) ) == null ) { factory = ( logPipeline = ( logPipeline != null ? logPipeline : helpGetClientPipeline( "com.eucalyptus.ws.client.pipeline.GatherLogClientPipeline" ) ) ); } return factory; } }
ChannelPipelineFactory function( ) { ChannelPipelineFactory factory = null; if ( ( factory = super.getClientPipeline( ) ) == null ) { factory = ( logPipeline = ( logPipeline != null ? logPipeline : helpGetClientPipeline( STR ) ) ); } return factory; } }
/** * This was born under a bad sign. No touching. * * @return */
This was born under a bad sign. No touching
getClientPipeline
{ "repo_name": "grze/parentheses", "path": "clc/modules/msgs/src/main/java/com/eucalyptus/component/id/ClusterController.java", "license": "gpl-3.0", "size": 6413 }
[ "org.jboss.netty.channel.ChannelPipelineFactory" ]
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.*;
[ "org.jboss.netty" ]
org.jboss.netty;
937,825
public boolean canInsertItem(int par1, ItemStack par2ItemStack, EnumFacing side) { return this.isItemValidForSlot(par1, par2ItemStack); }
boolean function(int par1, ItemStack par2ItemStack, EnumFacing side) { return this.isItemValidForSlot(par1, par2ItemStack); }
/** * Returns true if automation can insert the given item in the given slot from * the given side. Args: Slot, item, side */
Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, side
canInsertItem
{ "repo_name": "EXTER7/Foundry", "path": "src/main/java/exter/foundry/tileentity/TileEntityMoldStation.java", "license": "lgpl-3.0", "size": 10311 }
[ "net.minecraft.item.ItemStack", "net.minecraft.util.EnumFacing" ]
import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing;
import net.minecraft.item.*; import net.minecraft.util.*;
[ "net.minecraft.item", "net.minecraft.util" ]
net.minecraft.item; net.minecraft.util;
1,226,044
private List<Node> possibleParents(Node x, List<Node> nodes, IKnowledge knowledge) { List<Node> possibleParents = new LinkedList<Node>(); String _x = x.getName(); for (Node z : nodes) { String _z = z.getName(); if (PossibleDsepCfci.possibleParentOf(_z, _x, knowledge)) { possibleParents.add(z); } } return possibleParents; }
List<Node> function(Node x, List<Node> nodes, IKnowledge knowledge) { List<Node> possibleParents = new LinkedList<Node>(); String _x = x.getName(); for (Node z : nodes) { String _z = z.getName(); if (PossibleDsepCfci.possibleParentOf(_z, _x, knowledge)) { possibleParents.add(z); } } return possibleParents; }
/** * Removes from the list of nodes any that cannot be parents of x given the background knowledge. */
Removes from the list of nodes any that cannot be parents of x given the background knowledge
possibleParents
{ "repo_name": "jmogarrio/tetrad", "path": "tetrad-lib/src/main/java/edu/cmu/tetrad/search/PossibleDsepCfci.java", "license": "gpl-2.0", "size": 9765 }
[ "edu.cmu.tetrad.data.IKnowledge", "edu.cmu.tetrad.graph.Node", "java.util.LinkedList", "java.util.List" ]
import edu.cmu.tetrad.data.IKnowledge; import edu.cmu.tetrad.graph.Node; import java.util.LinkedList; import java.util.List;
import edu.cmu.tetrad.data.*; import edu.cmu.tetrad.graph.*; import java.util.*;
[ "edu.cmu.tetrad", "java.util" ]
edu.cmu.tetrad; java.util;
626,173
@Override public boolean isEnabled(int position) { for (BaseAdapter adapter: mAdapters) { if (position == 0) { return adapter.isEnabled(position); } int size = adapter.getCount(); if (position < size) { return adapter.isEnabled(position); } position -= size; } return isEnabled(position); }
boolean function(int position) { for (BaseAdapter adapter: mAdapters) { if (position == 0) { return adapter.isEnabled(position); } int size = adapter.getCount(); if (position < size) { return adapter.isEnabled(position); } position -= size; } return isEnabled(position); }
/** * Returns true if the item at the specified position is not a separator. * (A separator is a non-selectable, non-clickable item). * @see android.widget.BaseAdapter#isEnabled(int) */
Returns true if the item at the specified position is not a separator. (A separator is a non-selectable, non-clickable item)
isEnabled
{ "repo_name": "victorhaggqvist/sthlmtraveling", "path": "sthlmtraveling/src/main/java/com/markupartist/sthlmtraveling/MultipleListAdapter.java", "license": "apache-2.0", "size": 8232 }
[ "android.widget.BaseAdapter" ]
import android.widget.BaseAdapter;
import android.widget.*;
[ "android.widget" ]
android.widget;
497,074
@Override @Deprecated public Vector keyFromObject(Object domainObject) throws ValidationException { ClassDescriptor descriptor = getDescriptor(domainObject); return (Vector)keyFromObject(domainObject, descriptor); }
Vector function(Object domainObject) throws ValidationException { ClassDescriptor descriptor = getDescriptor(domainObject); return (Vector)keyFromObject(domainObject, descriptor); }
/** * ADVANCED: * Extract and return the primary key from the object. * @deprecated since EclipseLink 2.1, replaced by getId(Object) * @see #getId(Object) */
Extract and return the primary key from the object
keyFromObject
{ "repo_name": "gameduell/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/AbstractSession.java", "license": "epl-1.0", "size": 198170 }
[ "java.util.Vector", "org.eclipse.persistence.descriptors.ClassDescriptor", "org.eclipse.persistence.exceptions.ValidationException" ]
import java.util.Vector; import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.exceptions.ValidationException;
import java.util.*; import org.eclipse.persistence.descriptors.*; import org.eclipse.persistence.exceptions.*;
[ "java.util", "org.eclipse.persistence" ]
java.util; org.eclipse.persistence;
1,015,736
@ServiceMethod(returns = ReturnType.SINGLE) public void deleteSqlTrigger( String resourceGroupName, String accountName, String databaseName, String containerName, String triggerName, Context context) { deleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, context) .block(); }
@ServiceMethod(returns = ReturnType.SINGLE) void function( String resourceGroupName, String accountName, String databaseName, String containerName, String triggerName, Context context) { deleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, context) .block(); }
/** * Deletes an existing Azure Cosmos DB SQL trigger. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. * @param triggerName Cosmos DB trigger name. * @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. */
Deletes an existing Azure Cosmos DB SQL trigger
deleteSqlTrigger
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java", "license": "mit", "size": 547809 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.Context" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context;
import com.azure.core.annotation.*; import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
1,839,610
@javax.annotation.Nullable @ApiModelProperty( value = "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.") public Map<String, String> getMatchLabels() { return matchLabels; }
@javax.annotation.Nullable @ApiModelProperty( value = STRkey\STRIn\STRvalue\STR) Map<String, String> function() { return matchLabels; }
/** * matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is * equivalent to an element of matchExpressions, whose key field is \&quot;key\&quot;, the * operator is \&quot;In\&quot;, and the values array contains only \&quot;value\&quot;. The * requirements are ANDed. * * @return matchLabels */
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \&quot;key\&quot;, the operator is \&quot;In\&quot;, and the values array contains only \&quot;value\&quot;. The requirements are ANDed
getMatchLabels
{ "repo_name": "kubernetes-client/java", "path": "kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1LabelSelector.java", "license": "apache-2.0", "size": 5253 }
[ "io.swagger.annotations.ApiModelProperty", "java.util.Map" ]
import io.swagger.annotations.ApiModelProperty; import java.util.Map;
import io.swagger.annotations.*; import java.util.*;
[ "io.swagger.annotations", "java.util" ]
io.swagger.annotations; java.util;
2,485,773
public List<Document> getLoadedDocuments() { XEnumerationAccess xEnumerationAccess = this.getDesktopService().getComponents(); XEnumeration xEnumeration = xEnumerationAccess.createEnumeration(); List<Document> docs = new ArrayList<Document>(); while (xEnumeration.hasMoreElements()) { Object component = null; XServiceInfo xServiceInfo = null; XComponent xComponent = null; try { component = xEnumeration.nextElement(); } catch (com.sun.star.container.NoSuchElementException e) { throw new java.util.NoSuchElementException( e.getLocalizedMessage()); } catch (com.sun.star.lang.WrappedTargetException e) { throw new java.lang.RuntimeException(e); } xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, component); if (xServiceInfo == null) { continue; } if (!xServiceInfo.supportsService( "com.sun.star.document.OfficeDocument")) { continue; } xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, component); docs.add(new Document(xComponent)); } Collections.sort(docs); return docs; }
List<Document> function() { XEnumerationAccess xEnumerationAccess = this.getDesktopService().getComponents(); XEnumeration xEnumeration = xEnumerationAccess.createEnumeration(); List<Document> docs = new ArrayList<Document>(); while (xEnumeration.hasMoreElements()) { Object component = null; XServiceInfo xServiceInfo = null; XComponent xComponent = null; try { component = xEnumeration.nextElement(); } catch (com.sun.star.container.NoSuchElementException e) { throw new java.util.NoSuchElementException( e.getLocalizedMessage()); } catch (com.sun.star.lang.WrappedTargetException e) { throw new java.lang.RuntimeException(e); } xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, component); if (xServiceInfo == null) { continue; } if (!xServiceInfo.supportsService( STR)) { continue; } xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class, component); docs.add(new Document(xComponent)); } Collections.sort(docs); return docs; }
/** * Returns the loaded documents. * * @return the loaded documents */
Returns the loaded documents
getLoadedDocuments
{ "repo_name": "imacat/mpresent-android", "path": "src/tw/idv/imacat/android/mpresent/uno/OfficeConnection.java", "license": "gpl-3.0", "size": 23578 }
[ "com.sun.star.container.XEnumeration", "com.sun.star.container.XEnumerationAccess", "com.sun.star.lang.XComponent", "com.sun.star.lang.XServiceInfo", "com.sun.star.uno.UnoRuntime", "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import com.sun.star.container.XEnumeration; import com.sun.star.container.XEnumerationAccess; import com.sun.star.lang.XComponent; import com.sun.star.lang.XServiceInfo; import com.sun.star.uno.UnoRuntime; import java.util.ArrayList; import java.util.Collections; import java.util.List;
import com.sun.star.container.*; import com.sun.star.lang.*; import com.sun.star.uno.*; import java.util.*;
[ "com.sun.star", "java.util" ]
com.sun.star; java.util;
1,042,212
public static Object readField(Field field, Object target, boolean forceAccess) throws IllegalAccessException { if (field == null) { throw new IllegalArgumentException("The field must not be null"); } if (forceAccess && !field.isAccessible()) { field.setAccessible(true); } else { MemberUtils.setAccessibleWorkaround(field); } return field.get(target); }
static Object function(Field field, Object target, boolean forceAccess) throws IllegalAccessException { if (field == null) { throw new IllegalArgumentException(STR); } if (forceAccess && !field.isAccessible()) { field.setAccessible(true); } else { MemberUtils.setAccessibleWorkaround(field); } return field.get(target); }
/** * Read a Field. * @param field the field to use * @param target the object to call on, may be null for static fields * @param forceAccess whether to break scope restrictions using the * <code>setAccessible</code> method. * @return the field value * @throws IllegalArgumentException if the field is null * @throws IllegalAccessException if the field is not made accessible */
Read a Field
readField
{ "repo_name": "glorycloud/GloryMail", "path": "CloudyMail/lib_src/org/apache/commons/lang/reflect/FieldUtils.java", "license": "apache-2.0", "size": 26754 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,602,409
public InputStream marshalXml(XmlEntity rootEntity) { String xmlAsString = rootEntity.getAsConciseXmlString(false, true); InputStream xmlInputStream = null; try { xmlInputStream = new ByteArrayInputStream(xmlAsString.getBytes(myXmlEncodingCharSet)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return xmlInputStream; }
InputStream function(XmlEntity rootEntity) { String xmlAsString = rootEntity.getAsConciseXmlString(false, true); InputStream xmlInputStream = null; try { xmlInputStream = new ByteArrayInputStream(xmlAsString.getBytes(myXmlEncodingCharSet)); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return xmlInputStream; }
/** * Transform the XML object, represented by the root XmlEntity, into an InputStream * that contains the XML (including the XML header). Comments are removed, and * no excess white spaces are included. Processing instructions are maintained. * * @param rootEntity The XmlEntity that is the root of the XML object * @return The XML object represented as an InputStream. */
Transform the XML object, represented by the root XmlEntity, into an InputStream that contains the XML (including the XML header). Comments are removed, and no excess white spaces are included. Processing instructions are maintained
marshalXml
{ "repo_name": "TonyWang-UMU/TFG-TWang", "path": "opencds-parent/opencds-common/src/main/java/org/opencds/common/xml/XmlConverter.java", "license": "apache-2.0", "size": 8628 }
[ "java.io.ByteArrayInputStream", "java.io.InputStream", "java.io.UnsupportedEncodingException" ]
import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException;
import java.io.*;
[ "java.io" ]
java.io;
1,607,351
protected String get(String key) { if (key == null) { return EMPTY_STRING; } try { return this.resourceBundle.getString(key); } catch (MissingResourceException ex) { if (ex.getKey().equals(key)) { throw new MissingStringException("Missing string: " + key, key); } throw ex; } }
String function(String key) { if (key == null) { return EMPTY_STRING; } try { return this.resourceBundle.getString(key); } catch (MissingResourceException ex) { if (ex.getKey().equals(key)) { throw new MissingStringException(STR + key, key); } throw ex; } }
/** * Return the string associated with the specified key * by looking it up in the resource bundle. * Throw a MissingStringException if the string is not in the * resource bundle. * Subclasses can extend this method to manipulate the string * returned from the resource bundle before it gets formatted. */
Return the string associated with the specified key by looking it up in the resource bundle. Throw a MissingStringException if the string is not in the resource bundle. Subclasses can extend this method to manipulate the string returned from the resource bundle before it gets formatted
get
{ "repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs", "path": "utils/eclipselink.utils.workbench/framework/source/org/eclipse/persistence/tools/workbench/framework/resources/ResourceBundleStringRepository.java", "license": "epl-1.0", "size": 5572 }
[ "java.util.MissingResourceException" ]
import java.util.MissingResourceException;
import java.util.*;
[ "java.util" ]
java.util;
1,780,615
private String getChannelName(LogicalChannel lc) { String name = null; Integer value = lc.getEmissionWave(); if (value != null) return ""+value.intValue(); if (lc.getFilterSet() != null) { Iterator<Filter> it = lc.getFilterSet().linkedEmissionFilterIterator(); while (name == null && it.hasNext()) { name = getValueFromFilter(it.next()); } if (name != null) return name; } //Laser if (lc.getLightSourceSettings() != null) { LightSource src = lc.getLightSourceSettings().getLightSource(); if (src instanceof Laser) { Laser laser = (Laser) src; value = laser.getWavelength(); if (value != null) return ""+value.intValue(); } } value = lc.getExcitationWave(); if (value != null) return ""+value.intValue(); if (lc.getFilterSet() != null) { Iterator<Filter> it = lc.getFilterSet().linkedExcitationFilterIterator(); while (name == null && it.hasNext()) { name = getValueFromFilter(it.next()); } if (name != null) return name; } return name; }
String function(LogicalChannel lc) { String name = null; Integer value = lc.getEmissionWave(); if (value != null) return STRSTR"+value.intValue(); if (lc.getFilterSet() != null) { Iterator<Filter> it = lc.getFilterSet().linkedExcitationFilterIterator(); while (name == null && it.hasNext()) { name = getValueFromFilter(it.next()); } if (name != null) return name; } return name; }
/** * Determines the name of the channel if possible. * * @param lc The channel to handle. * @return See above. */
Determines the name of the channel if possible
getChannelName
{ "repo_name": "jballanc/openmicroscopy", "path": "components/server/src/ome/logic/RenderingSettingsImpl.java", "license": "gpl-2.0", "size": 57280 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
122,718
private static void updateQuizzes(SQLiteDatabase writableDatabase, List<Quiz> quizzes) { Quiz quiz; ContentValues quizValues = new ContentValues(); String[] quizArgs = new String[1]; for (int i = 0; i < quizzes.size(); i++) { quiz = quizzes.get(i); quizValues.clear(); quizValues.put(QuizTable.COLUMN_SOLVED, quiz.isSolved()); quizValues.put(QuizTable.USER_ANSWER, quiz.getUserAnswer()); quizValues.put(QuizTable.ANSWER_DATE,quiz.getAnswerDate()); quizArgs[0] = quiz.getQuestion(); writableDatabase.update(QuizTable.NAME, quizValues, QuizTable.COLUMN_QUESTION + "=?", quizArgs); } }
static void function(SQLiteDatabase writableDatabase, List<Quiz> quizzes) { Quiz quiz; ContentValues quizValues = new ContentValues(); String[] quizArgs = new String[1]; for (int i = 0; i < quizzes.size(); i++) { quiz = quizzes.get(i); quizValues.clear(); quizValues.put(QuizTable.COLUMN_SOLVED, quiz.isSolved()); quizValues.put(QuizTable.USER_ANSWER, quiz.getUserAnswer()); quizValues.put(QuizTable.ANSWER_DATE,quiz.getAnswerDate()); quizArgs[0] = quiz.getQuestion(); writableDatabase.update(QuizTable.NAME, quizValues, QuizTable.COLUMN_QUESTION + "=?", quizArgs); } }
/** * Updates a list of given quizzes. * * @param writableDatabase The database to write the quizzes to. * @param quizzes The quizzes to write. */
Updates a list of given quizzes
updateQuizzes
{ "repo_name": "MR612/TheApp", "path": "app/src/main/java/ir/isilearning/lmsapp/persistence/LMSAppDatabaseHelper.java", "license": "apache-2.0", "size": 28595 }
[ "android.content.ContentValues", "android.database.sqlite.SQLiteDatabase", "ir.isilearning.lmsapp.model.quiz.Quiz", "java.util.List" ]
import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase; import ir.isilearning.lmsapp.model.quiz.Quiz; import java.util.List;
import android.content.*; import android.database.sqlite.*; import ir.isilearning.lmsapp.model.quiz.*; import java.util.*;
[ "android.content", "android.database", "ir.isilearning.lmsapp", "java.util" ]
android.content; android.database; ir.isilearning.lmsapp; java.util;
841,602
void asyncSkipEntries(int numEntriesToSkip, IndividualDeletedEntries deletedEntries, final SkipEntriesCallback callback, Object ctx);
void asyncSkipEntries(int numEntriesToSkip, IndividualDeletedEntries deletedEntries, final SkipEntriesCallback callback, Object ctx);
/** * Skip n entries from the read position of this cursor. * * @param numEntriesToSkip * number of entries to skip * @param deletedEntries * skip individual deleted entries * @param callback * callback object * @param ctx * opaque context */
Skip n entries from the read position of this cursor
asyncSkipEntries
{ "repo_name": "yahoo/pulsar", "path": "managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedCursor.java", "license": "apache-2.0", "size": 23481 }
[ "org.apache.bookkeeper.mledger.AsyncCallbacks" ]
import org.apache.bookkeeper.mledger.AsyncCallbacks;
import org.apache.bookkeeper.mledger.*;
[ "org.apache.bookkeeper" ]
org.apache.bookkeeper;
1,025,298
@exception PropertyVetoException If the change is vetoed. **/ public void setFormTypeFilter(String formTypeFilter) throws PropertyVetoException { list_.setFormTypeFilter(formTypeFilter); } /** Sets the output queue filter. A call to load() must be done after calling this funtion inorder to update the details children. @param queueFilter The library and output queues on which to list spooled files. The format of the queueFilter string must be in the format of /QSYS.LIB/libname.LIB/queuename.OUTQ where <br> <I>libname</I> is the library name that contains the queues to search. It can be a specific name or one of these special values: <ul> <li> %LIBL% - The server job's library list. <li> %ALL% - All libraries are searched. This value is only valid if the queuename is %ALL%. </ul> <I>queuename</I> is the name of the output queues to search. It can be a specific name or the special value %ALL%. If it is %ALL%, then the libname must also be %ALL%.
@exception PropertyVetoException If the change is vetoed. **/ void function(String formTypeFilter) throws PropertyVetoException { list_.setFormTypeFilter(formTypeFilter); } /** Sets the output queue filter. A call to load() must be done after calling this funtion inorder to update the details children. @param queueFilter The library and output queues on which to list spooled files. The format of the queueFilter string must be in the format of /QSYS.LIB/libname.LIB/queuename.OUTQ where <br> <I>libname</I> is the library name that contains the queues to search. It can be a specific name or one of these special values: <ul> <li> %LIBL% - The server job's library list. <li> %ALL% - All libraries are searched. This value is only valid if the queuename is %ALL%. </ul> <I>queuename</I> is the name of the output queues to search. It can be a specific name or the special value %ALL%. If it is %ALL%, then the libname must also be %ALL%.
/** Sets the form type filter for the list. A call to load() must be done after calling this funtion inorder to update the details children. @param formTypeFilter The form type the spooled file must be to be included in the list. It cannot be greater than 10 characters. The value can be any specific value or any of these special values: <ul> <li> *ALL - Spooled files with any form type will be included in the list. <li> *STD - Spooled files with the form type *STD will be included in the list. </ul> The default is *ALL. @exception PropertyVetoException If the change is vetoed. **/
ALL - Spooled files with any form type will be included in the list. STD - Spooled files with the form type *STD will be included in the list. ALL
setFormTypeFilter
{ "repo_name": "devjunix/libjt400-java", "path": "src/com/ibm/as400/vaccess/VPrinterOutput.java", "license": "epl-1.0", "size": 37126 }
[ "java.beans.PropertyVetoException" ]
import java.beans.PropertyVetoException;
import java.beans.*;
[ "java.beans" ]
java.beans;
167,415
private boolean flushRegion(HRegion region, boolean emergencyFlush, boolean forceFlushAllStores, FlushLifeCycleTracker tracker) { synchronized (this.regionsInQueue) { FlushRegionEntry fqe = this.regionsInQueue.remove(region); // Use the start time of the FlushRegionEntry if available if (fqe != null && emergencyFlush) { // Need to remove from region from delay queue. When NOT an // emergencyFlush, then item was removed via a flushQueue.poll. flushQueue.remove(fqe); } } tracker.beforeExecution(); lock.readLock().lock(); try { notifyFlushRequest(region, emergencyFlush); FlushResult flushResult = region.flushcache(forceFlushAllStores, false, tracker); boolean shouldCompact = flushResult.isCompactionNeeded(); // We just want to check the size boolean shouldSplit = region.checkSplit() != null; if (shouldSplit) { this.server.compactSplitThread.requestSplit(region); } else if (shouldCompact) { server.compactSplitThread.requestSystemCompaction(region, Thread.currentThread().getName()); } } catch (DroppedSnapshotException ex) { // Cache flush can fail in a few places. If it fails in a critical // section, we get a DroppedSnapshotException and a replay of wal // is required. Currently the only way to do this is a restart of // the server. Abort because hdfs is probably bad (HBASE-644 is a case // where hdfs was bad but passed the hdfs check). server.abort("Replay of WAL required. Forcing server shutdown", ex); return false; } catch (IOException ex) { ex = ex instanceof RemoteException ? ((RemoteException) ex).unwrapRemoteException() : ex; LOG.error( "Cache flush failed" + (region != null ? (" for region " + Bytes.toStringBinary(region.getRegionInfo().getRegionName())) : ""), ex); if (!server.checkFileSystem()) { return false; } } finally { lock.readLock().unlock(); wakeUpIfBlocking(); tracker.afterExecution(); } return true; }
boolean function(HRegion region, boolean emergencyFlush, boolean forceFlushAllStores, FlushLifeCycleTracker tracker) { synchronized (this.regionsInQueue) { FlushRegionEntry fqe = this.regionsInQueue.remove(region); if (fqe != null && emergencyFlush) { flushQueue.remove(fqe); } } tracker.beforeExecution(); lock.readLock().lock(); try { notifyFlushRequest(region, emergencyFlush); FlushResult flushResult = region.flushcache(forceFlushAllStores, false, tracker); boolean shouldCompact = flushResult.isCompactionNeeded(); boolean shouldSplit = region.checkSplit() != null; if (shouldSplit) { this.server.compactSplitThread.requestSplit(region); } else if (shouldCompact) { server.compactSplitThread.requestSystemCompaction(region, Thread.currentThread().getName()); } } catch (DroppedSnapshotException ex) { server.abort(STR, ex); return false; } catch (IOException ex) { ex = ex instanceof RemoteException ? ((RemoteException) ex).unwrapRemoteException() : ex; LOG.error( STR + (region != null ? (STR + Bytes.toStringBinary(region.getRegionInfo().getRegionName())) : ""), ex); if (!server.checkFileSystem()) { return false; } } finally { lock.readLock().unlock(); wakeUpIfBlocking(); tracker.afterExecution(); } return true; }
/** * Flush a region. * @param region Region to flush. * @param emergencyFlush Set if we are being force flushed. If true the region * needs to be removed from the flush queue. If false, when we were called * from the main flusher run loop and we got the entry to flush by calling * poll on the flush queue (which removed it). * @param forceFlushAllStores whether we want to flush all store. * @return true if the region was successfully flushed, false otherwise. If * false, there will be accompanying log messages explaining why the region was * not flushed. */
Flush a region
flushRegion
{ "repo_name": "ChinmaySKulkarni/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java", "license": "apache-2.0", "size": 34405 }
[ "java.io.IOException", "org.apache.hadoop.hbase.DroppedSnapshotException", "org.apache.hadoop.hbase.regionserver.HRegion", "org.apache.hadoop.hbase.util.Bytes", "org.apache.hadoop.ipc.RemoteException" ]
import java.io.IOException; import org.apache.hadoop.hbase.DroppedSnapshotException; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.ipc.RemoteException;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.util.*; import org.apache.hadoop.ipc.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
557,384
protected void beforeCreate(ModeledAuthenticatedUser user, ExternalType object, ModelType model) throws GuacamoleException { // Verify permission to create objects if (!user.getUser().isAdministrator() && !hasCreatePermission(user)) throw new GuacamoleSecurityException("Permission denied."); }
void function(ModeledAuthenticatedUser user, ExternalType object, ModelType model) throws GuacamoleException { if (!user.getUser().isAdministrator() && !hasCreatePermission(user)) throw new GuacamoleSecurityException(STR); }
/** * Called before any object is created through this directory object * service. This function serves as a final point of validation before * the create operation occurs. In its default implementation, * beforeCreate() performs basic permissions checks. * * @param user * The user creating the object. * * @param object * The object being created. * * @param model * The model of the object being created. * * @throws GuacamoleException * If the object is invalid, or an error prevents validating the given * object. */
Called before any object is created through this directory object service. This function serves as a final point of validation before the create operation occurs. In its default implementation, beforeCreate() performs basic permissions checks
beforeCreate
{ "repo_name": "softpymesJeffer/incubator-guacamole-client", "path": "extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java", "license": "apache-2.0", "size": 17664 }
[ "org.apache.guacamole.GuacamoleException", "org.apache.guacamole.GuacamoleSecurityException", "org.apache.guacamole.auth.jdbc.user.ModeledAuthenticatedUser" ]
import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.GuacamoleSecurityException; import org.apache.guacamole.auth.jdbc.user.ModeledAuthenticatedUser;
import org.apache.guacamole.*; import org.apache.guacamole.auth.jdbc.user.*;
[ "org.apache.guacamole" ]
org.apache.guacamole;
1,149,416
public Builder initializeAsRestore(IndexMetaData indexMetaData, RestoreSource restoreSource) { final UnassignedInfo unassignedInfo = new UnassignedInfo(UnassignedInfo.Reason.EXISTING_INDEX_RESTORED, "restore_source[" + restoreSource.snapshot().getRepository() + "/" + restoreSource.snapshot().getSnapshotId().getName() + "]"); return initializeAsRestore(indexMetaData, restoreSource, null, false, unassignedInfo); }
Builder function(IndexMetaData indexMetaData, RestoreSource restoreSource) { final UnassignedInfo unassignedInfo = new UnassignedInfo(UnassignedInfo.Reason.EXISTING_INDEX_RESTORED, STR + restoreSource.snapshot().getRepository() + "/" + restoreSource.snapshot().getSnapshotId().getName() + "]"); return initializeAsRestore(indexMetaData, restoreSource, null, false, unassignedInfo); }
/** * Initializes an existing index, to be restored from a snapshot */
Initializes an existing index, to be restored from a snapshot
initializeAsRestore
{ "repo_name": "girirajsharma/elasticsearch", "path": "core/src/main/java/org/elasticsearch/cluster/routing/IndexRoutingTable.java", "license": "apache-2.0", "size": 22935 }
[ "org.elasticsearch.cluster.metadata.IndexMetaData" ]
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
1,652,285
public Object getObject() throws BeansException { initializeAdvisorChain(); if (isSingleton()) { return getSingletonInstance(); } else { if (this.targetName == null) { logger.warn("Using non-singleton proxies with singleton targets is often undesirable. " + "Enable prototype proxies by setting the 'targetName' property."); } return newPrototypeInstance(); } }
Object function() throws BeansException { initializeAdvisorChain(); if (isSingleton()) { return getSingletonInstance(); } else { if (this.targetName == null) { logger.warn(STR + STR); } return newPrototypeInstance(); } }
/** * Return a proxy. Invoked when clients obtain beans from this factory bean. * Create an instance of the AOP proxy to be returned by this factory. * The instance will be cached for a singleton, and create on each call to * <code>getObject()</code> for a proxy. * @return a fresh AOP proxy reflecting the current state of this factory */
Return a proxy. Invoked when clients obtain beans from this factory bean. Create an instance of the AOP proxy to be returned by this factory. The instance will be cached for a singleton, and create on each call to <code>getObject()</code> for a proxy
getObject
{ "repo_name": "cbeams-archive/spring-framework-2.5.x", "path": "src/org/springframework/aop/framework/ProxyFactoryBean.java", "license": "apache-2.0", "size": 25197 }
[ "org.springframework.beans.BeansException" ]
import org.springframework.beans.BeansException;
import org.springframework.beans.*;
[ "org.springframework.beans" ]
org.springframework.beans;
2,530,006
public void addConstant(StringValue name, Expr expr) { _constMap.put(name, expr); }
void function(StringValue name, Expr expr) { _constMap.put(name, expr); }
/** * Adds a constant definition */
Adds a constant definition
addConstant
{ "repo_name": "TheApacheCats/quercus", "path": "com/caucho/quercus/env/QuercusClass.java", "license": "gpl-2.0", "size": 68876 }
[ "com.caucho.quercus.expr.Expr" ]
import com.caucho.quercus.expr.Expr;
import com.caucho.quercus.expr.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
2,259,011
public static String getCurrentClasspath() { RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); return bean.getClassPath(); }
static String function() { RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); return bean.getClassPath(); }
/** * Gets the classpath with which the current JVM was started. * * @return The classpath with which the current JVM was started. */
Gets the classpath with which the current JVM was started
getCurrentClasspath
{ "repo_name": "tillrohrmann/flink", "path": "flink-runtime/src/test/java/org/apache/flink/runtime/testutils/CommonTestUtils.java", "license": "apache-2.0", "size": 9770 }
[ "java.lang.management.ManagementFactory", "java.lang.management.RuntimeMXBean" ]
import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean;
import java.lang.management.*;
[ "java.lang" ]
java.lang;
2,386,291
@Override public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions) { ApplicationState state = ApplicationState.sharedInstance(context); super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions); newOptions.keySet(); // reify the Bundle's contents so .toString() will format them Log.i(TAG, "WidgetOptionsChanged: " + newOptions); if (Build.VERSION.SDK_INT < 31) { updateWidget(context, appWidgetManager, appWidgetId, state); } }
void function(Context context, AppWidgetManager appWidgetManager, int appWidgetId, Bundle newOptions) { ApplicationState state = ApplicationState.sharedInstance(context); super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions); newOptions.keySet(); Log.i(TAG, STR + newOptions); if (Build.VERSION.SDK_INT < 31) { updateWidget(context, appWidgetManager, appWidgetId, state); } }
/** * Responds to a single widget instance resized by the user. Use this to adjust the layout, * except on API >= 31 where the viewMapping handles it without waking the app. *<p/> * NOTE: newOptions provides a size range as minWidth x maxHeight for portrait orientation; * maxWidth x minHeight for landscape orientation. *<p/> * NOTE: This does not usually get called when the screen rotates landscape/portrait. *<p/> * TODO: Passing newOptions to updateWidget() might save a little time. */
Responds to a single widget instance resized by the user. Use this to adjust the layout, except on API >= 31 where the viewMapping handles it without waking the app. maxWidth x minHeight for landscape orientation.
onAppWidgetOptionsChanged
{ "repo_name": "1fish2/BBQTimer", "path": "app/src/main/java/com/onefishtwo/bbqtimer/TimerAppWidgetProvider.java", "license": "mit", "size": 17910 }
[ "android.appwidget.AppWidgetManager", "android.content.Context", "android.os.Build", "android.os.Bundle", "android.util.Log", "com.onefishtwo.bbqtimer.state.ApplicationState" ]
import android.appwidget.AppWidgetManager; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.util.Log; import com.onefishtwo.bbqtimer.state.ApplicationState;
import android.appwidget.*; import android.content.*; import android.os.*; import android.util.*; import com.onefishtwo.bbqtimer.state.*;
[ "android.appwidget", "android.content", "android.os", "android.util", "com.onefishtwo.bbqtimer" ]
android.appwidget; android.content; android.os; android.util; com.onefishtwo.bbqtimer;
118,326
private void updateCleanupFileInTransaction() throws StorageException, IOException { if (remoteTransaction.isEmpty()) { // No need to bump numbers return; } // Find all existing cleanup files Map<String, CleanupRemoteFile> cleanupFiles = transferManager.list(CleanupRemoteFile.class); long lastRemoteCleanupNumber = getLastRemoteCleanupNumber(cleanupFiles); // Schedule any existing cleanup files for deletion for (CleanupRemoteFile cleanupRemoteFile : cleanupFiles.values()) { remoteTransaction.delete(cleanupRemoteFile); } // Upload a new cleanup file that indicates changes File newCleanupFile = config.getCache().createTempFile("cleanup"); long newCleanupNumber = lastRemoteCleanupNumber + 1; remoteTransaction.upload(newCleanupFile, new CleanupRemoteFile(newCleanupNumber)); localDatabase.writeCleanupNumber(newCleanupNumber); }
void function() throws StorageException, IOException { if (remoteTransaction.isEmpty()) { return; } Map<String, CleanupRemoteFile> cleanupFiles = transferManager.list(CleanupRemoteFile.class); long lastRemoteCleanupNumber = getLastRemoteCleanupNumber(cleanupFiles); for (CleanupRemoteFile cleanupRemoteFile : cleanupFiles.values()) { remoteTransaction.delete(cleanupRemoteFile); } File newCleanupFile = config.getCache().createTempFile(STR); long newCleanupNumber = lastRemoteCleanupNumber + 1; remoteTransaction.upload(newCleanupFile, new CleanupRemoteFile(newCleanupNumber)); localDatabase.writeCleanupNumber(newCleanupNumber); }
/** * This method checks what the current cleanup number is, increments it by one and adds * a new cleanup file to the transaction, to signify to other clients that Cleanup has occurred. */
This method checks what the current cleanup number is, increments it by one and adds a new cleanup file to the transaction, to signify to other clients that Cleanup has occurred
updateCleanupFileInTransaction
{ "repo_name": "brogowski/syncany-plugin-azureblobstorage", "path": "core/syncany-lib/src/main/java/org/syncany/operations/cleanup/CleanupOperation.java", "license": "gpl-3.0", "size": 24961 }
[ "java.io.File", "java.io.IOException", "java.util.Map", "org.syncany.plugins.transfer.StorageException", "org.syncany.plugins.transfer.files.CleanupRemoteFile" ]
import java.io.File; import java.io.IOException; import java.util.Map; import org.syncany.plugins.transfer.StorageException; import org.syncany.plugins.transfer.files.CleanupRemoteFile;
import java.io.*; import java.util.*; import org.syncany.plugins.transfer.*; import org.syncany.plugins.transfer.files.*;
[ "java.io", "java.util", "org.syncany.plugins" ]
java.io; java.util; org.syncany.plugins;
2,474,469
private List<Line> decomposeGeometry(Line line, List<Line> lines) { for (Line part : decompose(line)) { double[] lats = new double[part.length()]; double[] lons = new double[part.length()]; for (int i = 0; i < part.length(); i++) { lats[i] = normalizeLat(part.getY(i)); lons[i] = normalizeLonMinus180Inclusive(part.getX(i)); } lines.add(new Line(lons, lats)); } return lines; }
List<Line> function(Line line, List<Line> lines) { for (Line part : decompose(line)) { double[] lats = new double[part.length()]; double[] lons = new double[part.length()]; for (int i = 0; i < part.length(); i++) { lats[i] = normalizeLat(part.getY(i)); lons[i] = normalizeLonMinus180Inclusive(part.getX(i)); } lines.add(new Line(lons, lats)); } return lines; }
/** * Splits the specified line by datelines and adds them to the supplied lines array */
Splits the specified line by datelines and adds them to the supplied lines array
decomposeGeometry
{ "repo_name": "coding0011/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/mapper/GeoShapeIndexer.java", "license": "apache-2.0", "size": 45809 }
[ "java.util.List", "org.elasticsearch.common.geo.GeoUtils", "org.elasticsearch.geometry.Line" ]
import java.util.List; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.geometry.Line;
import java.util.*; import org.elasticsearch.common.geo.*; import org.elasticsearch.geometry.*;
[ "java.util", "org.elasticsearch.common", "org.elasticsearch.geometry" ]
java.util; org.elasticsearch.common; org.elasticsearch.geometry;
874,733
public Set<String> values() { return Collections.unmodifiableSet(skills); }
Set<String> function() { return Collections.unmodifiableSet(skills); }
/** * Returns an unmodifiable set of skills. All skills are inLowerCase. * * @return set of skills in this containter */
Returns an unmodifiable set of skills. All skills are inLowerCase
values
{ "repo_name": "michalmac/jsprit", "path": "jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/Skills.java", "license": "apache-2.0", "size": 3582 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,697,157
public static int getColorAttribute(Context context, int attribute) { TypedValue typedValue = new TypedValue(); if (!context.getTheme().resolveAttribute(attribute, typedValue, true)) { throw new Resources.NotFoundException("Attribute not found."); } if (typedValue.resourceId != 0) { // Attribute is a resource. return ApiCompatibilityUtils.getColor(context.getResources(), typedValue.resourceId); } else if (typedValue.type >= TypedValue.TYPE_FIRST_COLOR_INT && typedValue.type <= TypedValue.TYPE_LAST_COLOR_INT) { // Attribute is a raw color value. return typedValue.data; } else { throw new Resources.NotFoundException("Attribute not a color."); } }
static int function(Context context, int attribute) { TypedValue typedValue = new TypedValue(); if (!context.getTheme().resolveAttribute(attribute, typedValue, true)) { throw new Resources.NotFoundException(STR); } if (typedValue.resourceId != 0) { return ApiCompatibilityUtils.getColor(context.getResources(), typedValue.resourceId); } else if (typedValue.type >= TypedValue.TYPE_FIRST_COLOR_INT && typedValue.type <= TypedValue.TYPE_LAST_COLOR_INT) { return typedValue.data; } else { throw new Resources.NotFoundException(STR); } }
/** * Returns a color from a theme attribute. * @param context Context with resources to look up. * @param attribute Attribute such as R.attr.colorControlNormal. * @return Color value. * @throws Resources.NotFoundException */
Returns a color from a theme attribute
getColorAttribute
{ "repo_name": "wuhengzhi/chromium-crosswalk", "path": "remoting/android/java/src/org/chromium/chromoting/ChromotingUtil.java", "license": "bsd-3-clause", "size": 3668 }
[ "android.content.Context", "android.content.res.Resources", "android.util.TypedValue", "org.chromium.base.ApiCompatibilityUtils" ]
import android.content.Context; import android.content.res.Resources; import android.util.TypedValue; import org.chromium.base.ApiCompatibilityUtils;
import android.content.*; import android.content.res.*; import android.util.*; import org.chromium.base.*;
[ "android.content", "android.util", "org.chromium.base" ]
android.content; android.util; org.chromium.base;
2,310,310
default void preRegionOffline(final ObserverContext<MasterCoprocessorEnvironment> ctx, final RegionInfo regionInfo) throws IOException {}
default void preRegionOffline(final ObserverContext<MasterCoprocessorEnvironment> ctx, final RegionInfo regionInfo) throws IOException {}
/** * Called prior to marking a given region as offline. * @param ctx the environment to interact with the framework and master * @param regionInfo */
Called prior to marking a given region as offline
preRegionOffline
{ "repo_name": "apurtell/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java", "license": "apache-2.0", "size": 74501 }
[ "java.io.IOException", "org.apache.hadoop.hbase.client.RegionInfo" ]
import java.io.IOException; import org.apache.hadoop.hbase.client.RegionInfo;
import java.io.*; import org.apache.hadoop.hbase.client.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
923,052
public Solution findByTitle(String userName) { Solution item = null; try { item = repository.findByTitle(userName); } catch (NoResultException e) { item = null; } return item; }
Solution function(String userName) { Solution item = null; try { item = repository.findByTitle(userName); } catch (NoResultException e) { item = null; } return item; }
/** * Find by title. * * @param userName * * @return The target */
Find by title
findByTitle
{ "repo_name": "alistairrutherford/trader-rater", "path": "trader-rater-common-jpa/src/main/java/com/netthreads/trader/service/SolutionService.java", "license": "apache-2.0", "size": 2451 }
[ "com.netthreads.trader.domain.Solution", "javax.persistence.NoResultException" ]
import com.netthreads.trader.domain.Solution; import javax.persistence.NoResultException;
import com.netthreads.trader.domain.*; import javax.persistence.*;
[ "com.netthreads.trader", "javax.persistence" ]
com.netthreads.trader; javax.persistence;
1,170,354
public int[] decode(int numberOfChars, BitInputStream bis) { //build an arith decoder and decode the raw values ArithmeticDecoder ad = new ArithmeticDecoder(32, numberOfChars + 1, numberOfChars * 256); int[] data = ad.decode(bis); pf.resetStatistics(); for (int i = 0; i < data.length; i++) { if (data[i] == numberOfChars) { //if the value was predicted pf.predict(data, i); //this is returning false because the prediction doesn't match //the expected value since it is the special value "correct", //but it is needed nonetheless //recover prediction data[i] = pf.getPrediction(); } } return data; }
int[] function(int numberOfChars, BitInputStream bis) { ArithmeticDecoder ad = new ArithmeticDecoder(32, numberOfChars + 1, numberOfChars * 256); int[] data = ad.decode(bis); pf.resetStatistics(); for (int i = 0; i < data.length; i++) { if (data[i] == numberOfChars) { pf.predict(data, i); data[i] = pf.getPrediction(); } } return data; }
/** * Decode the input stream into the original data * @param numberOfChars number of different values present in the original raw data * @param bis the stream from where to read * @return the decoded data */
Decode the input stream into the original data
decode
{ "repo_name": "Daniel-BG/Jypec", "path": "src/com/jypec/arithco/predict/PredictiveArithmeticCodec.java", "license": "gpl-3.0", "size": 2337 }
[ "com.jypec.arithco.ArithmeticDecoder", "com.jypec.util.bits.BitInputStream" ]
import com.jypec.arithco.ArithmeticDecoder; import com.jypec.util.bits.BitInputStream;
import com.jypec.arithco.*; import com.jypec.util.bits.*;
[ "com.jypec.arithco", "com.jypec.util" ]
com.jypec.arithco; com.jypec.util;
811,821
public void attemptPreview() { try { final MasterReport report = handler.createReport(); final PreviewDialog frame = new PreviewDialog(report); frame.pack(); LibSwingUtil.positionFrameRandomly(frame); frame.setVisible(true); frame.requestFocus(); } catch (ReportDefinitionException e) { logger.error("Unable to create the report; report definition contained errors.", e); AbstractDemoFrame.showExceptionDialog(handler.getPresentationComponent(), "report.definitionfailure", e); } }
void function() { try { final MasterReport report = handler.createReport(); final PreviewDialog frame = new PreviewDialog(report); frame.pack(); LibSwingUtil.positionFrameRandomly(frame); frame.setVisible(true); frame.requestFocus(); } catch (ReportDefinitionException e) { logger.error(STR, e); AbstractDemoFrame.showExceptionDialog(handler.getPresentationComponent(), STR, e); } }
/** * Handler method called by the preview action. This method should perform all operations to preview the report. */
Handler method called by the preview action. This method should perform all operations to preview the report
attemptPreview
{ "repo_name": "mbatchelor/pentaho-reporting", "path": "engine/demo/src/main/java/org/pentaho/reporting/engine/classic/demo/util/DefaultPreviewHandler.java", "license": "lgpl-2.1", "size": 2287 }
[ "org.pentaho.reporting.engine.classic.core.MasterReport", "org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog", "org.pentaho.reporting.libraries.designtime.swing.LibSwingUtil" ]
import org.pentaho.reporting.engine.classic.core.MasterReport; import org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog; import org.pentaho.reporting.libraries.designtime.swing.LibSwingUtil;
import org.pentaho.reporting.engine.classic.core.*; import org.pentaho.reporting.engine.classic.core.modules.gui.base.*; import org.pentaho.reporting.libraries.designtime.swing.*;
[ "org.pentaho.reporting" ]
org.pentaho.reporting;
1,472,785
public void dump( Result out ) throws JAXBException;
void function( Result out ) throws JAXBException;
/** * Dumps this model into XML. * * For debug only. * * TODO: not sure if this actually works. We don't really know what are T,C. */
Dumps this model into XML. For debug only
dump
{ "repo_name": "samskivert/ikvm-openjdk", "path": "build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java", "license": "gpl-2.0", "size": 6284 }
[ "javax.xml.bind.JAXBException", "javax.xml.transform.Result" ]
import javax.xml.bind.JAXBException; import javax.xml.transform.Result;
import javax.xml.bind.*; import javax.xml.transform.*;
[ "javax.xml" ]
javax.xml;
545,542
public LegacyXaDataSourceImp buildDsSecurity(String userName, String password, String securityDomain, Extension reauthPlugin) throws Exception { security = new DsSecurityImpl(userName, password, securityDomain, reauthPlugin); return this; }
LegacyXaDataSourceImp function(String userName, String password, String securityDomain, Extension reauthPlugin) throws Exception { security = new DsSecurityImpl(userName, password, securityDomain, reauthPlugin); return this; }
/** * build security part * * @param userName userName * @param password password * @param securityDomain securityDomain * @param reauthPlugin reauthPlugin * @return this * @throws Exception exception */
build security part
buildDsSecurity
{ "repo_name": "ironjacamar/ironjacamar", "path": "as/src/main/java/org/jboss/jca/as/converters/LegacyXaDataSourceImp.java", "license": "lgpl-2.1", "size": 15462 }
[ "org.jboss.jca.common.api.metadata.common.Extension", "org.jboss.jca.common.metadata.ds.DsSecurityImpl" ]
import org.jboss.jca.common.api.metadata.common.Extension; import org.jboss.jca.common.metadata.ds.DsSecurityImpl;
import org.jboss.jca.common.api.metadata.common.*; import org.jboss.jca.common.metadata.ds.*;
[ "org.jboss.jca" ]
org.jboss.jca;
1,820,259
EClass getExternalOperation();
EClass getExternalOperation();
/** * Returns the meta object for class '{@link ucm.performance.ExternalOperation <em>External Operation</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>External Operation</em>'. * @see ucm.performance.ExternalOperation * @generated */
Returns the meta object for class '<code>ucm.performance.ExternalOperation External Operation</code>'.
getExternalOperation
{ "repo_name": "gmussbacher/seg.jUCMNav", "path": "src/ucm/performance/PerformancePackage.java", "license": "epl-1.0", "size": 47378 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,549,990
protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) { Collection<IAction> actions = new ArrayList<IAction>(); if (descriptors != null) { for (Object descriptor : descriptors) { actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); } } return actions; }
Collection<IAction> function(Collection<?> descriptors, ISelection selection) { Collection<IAction> actions = new ArrayList<IAction>(); if (descriptors != null) { for (Object descriptor : descriptors) { actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); } } return actions; }
/** * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>, * and returns the collection of these actions. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This generates a <code>org.eclipse.emf.edit.ui.action.CreateSiblingAction</code> for each object in <code>descriptors</code>, and returns the collection of these actions.
generateCreateSiblingActions
{ "repo_name": "netuh/DecodePlatformPlugin", "path": "br.ufpe.ines.decode/bundles/br.ufpe.ines.decode.model.editor/src/br/ufpe/ines/decode/decode/presentation/DecodeActionBarContributor.java", "license": "gpl-3.0", "size": 13957 }
[ "java.util.ArrayList", "java.util.Collection", "org.eclipse.emf.edit.ui.action.CreateSiblingAction", "org.eclipse.jface.action.IAction", "org.eclipse.jface.viewers.ISelection" ]
import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.edit.ui.action.CreateSiblingAction; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection;
import java.util.*; import org.eclipse.emf.edit.ui.action.*; import org.eclipse.jface.action.*; import org.eclipse.jface.viewers.*;
[ "java.util", "org.eclipse.emf", "org.eclipse.jface" ]
java.util; org.eclipse.emf; org.eclipse.jface;
2,819,991
public void beforeCreate(Model m);
void function(Model m);
/** * Called before creating an object * This gives you more control than a simple beforeSave & afterSave method * but if that's what you need, you can register the callbacks for update * and create (and destroy when implemented) and make them all call a method you created */
Called before creating an object This gives you more control than a simple beforeSave & afterSave method but if that's what you need, you can register the callbacks for update and create (and destroy when implemented) and make them all call a method you created
beforeCreate
{ "repo_name": "luisfontes19/ActiveSQL", "path": "src/main/java/org/fatal/activesql/database/core/callbacks/ModelCallbacksInterface.java", "license": "mit", "size": 3031 }
[ "org.fatal.activesql.database.core.Model" ]
import org.fatal.activesql.database.core.Model;
import org.fatal.activesql.database.core.*;
[ "org.fatal.activesql" ]
org.fatal.activesql;
1,192,899
public String getSmartDeviceLinkFileName() { return (String) parameters.get(Names.smartDeviceLinkFileName); }
String function() { return (String) parameters.get(Names.smartDeviceLinkFileName); }
/** * Gets a file reference name * @return String -a String value */
Gets a file reference name
getSmartDeviceLinkFileName
{ "repo_name": "Luxoft/SDLP2", "path": "SDL_Android/SmartDeviceLinkProxyAndroid/src/com/smartdevicelink/proxy/rpc/SetAppIcon.java", "license": "lgpl-2.1", "size": 1496 }
[ "com.smartdevicelink.proxy.constants.Names" ]
import com.smartdevicelink.proxy.constants.Names;
import com.smartdevicelink.proxy.constants.*;
[ "com.smartdevicelink.proxy" ]
com.smartdevicelink.proxy;
2,596,285
void fillDefaults(CmsDbContext dbc) throws CmsDataAccessException;
void fillDefaults(CmsDbContext dbc) throws CmsDataAccessException;
/** * Fills the OpenCms database tables with default values.<p> * * @param dbc the current database context * * @throws CmsDataAccessException if something goes wrong */
Fills the OpenCms database tables with default values
fillDefaults
{ "repo_name": "victos/opencms-core", "path": "src/org/opencms/db/I_CmsProjectDriver.java", "license": "lgpl-2.1", "size": 27344 }
[ "org.opencms.file.CmsDataAccessException" ]
import org.opencms.file.CmsDataAccessException;
import org.opencms.file.*;
[ "org.opencms.file" ]
org.opencms.file;
1,630,524
int getOtasp() { int provisioningState; if (mMin == null || (mMin.length() < 6)) { if (DBG) log("getOtasp: bad mMin='" + mMin + "'"); provisioningState = OTASP_UNKNOWN; } else { if ((mMin.equals(UNACTIVATED_MIN_VALUE) || mMin.substring(0,6).equals(UNACTIVATED_MIN2_VALUE)) || SystemProperties.getBoolean("test_cdma_setup", false)) { provisioningState = OTASP_NEEDED; } else { provisioningState = OTASP_NOT_NEEDED; } } if (DBG) log("getOtasp: state=" + provisioningState); return provisioningState; }
int getOtasp() { int provisioningState; if (mMin == null (mMin.length() < 6)) { if (DBG) log(STR + mMin + "'"); provisioningState = OTASP_UNKNOWN; } else { if ((mMin.equals(UNACTIVATED_MIN_VALUE) mMin.substring(0,6).equals(UNACTIVATED_MIN2_VALUE)) SystemProperties.getBoolean(STR, false)) { provisioningState = OTASP_NEEDED; } else { provisioningState = OTASP_NOT_NEEDED; } } if (DBG) log(STR + provisioningState); return provisioningState; }
/** * Returns OTASP_UNKNOWN, OTASP_NEEDED or OTASP_NOT_NEEDED */
Returns OTASP_UNKNOWN, OTASP_NEEDED or OTASP_NOT_NEEDED
getOtasp
{ "repo_name": "mateor/pdroid", "path": "android-4.0.3_r1/trunk/frameworks/base/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java", "license": "gpl-3.0", "size": 63175 }
[ "android.os.SystemProperties" ]
import android.os.SystemProperties;
import android.os.*;
[ "android.os" ]
android.os;
273,010
@VisibleForTesting static Node validateResult(Node n) { done: { if (n != null && !n.isScript() && (!n.isBlock() || !n.isSyntheticBlock())) { for (Node parent : n.getAncestors()) { if (parent.isScript()) { break done; } } Preconditions.checkState(false); } } return n; }
static Node validateResult(Node n) { done: { if (n != null && !n.isScript() && (!n.isBlock() !n.isSyntheticBlock())) { for (Node parent : n.getAncestors()) { if (parent.isScript()) { break done; } } Preconditions.checkState(false); } } return n; }
/** * Check if the specified node is null or is still in the AST. */
Check if the specified node is null or is still in the AST
validateResult
{ "repo_name": "zombiezen/cardcpx", "path": "third_party/closure-compiler/src/com/google/javascript/jscomp/AbstractPeepholeOptimization.java", "license": "apache-2.0", "size": 5213 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
420,776
@Test public void getShapeTest() { ShapeEntity entity = data.get(0); ShapeEntity resultEntity = shapeLogic.getShape(entity.getId()); Assert.assertNotNull(resultEntity); Assert.assertEquals(entity.getX(), resultEntity.getX()); Assert.assertEquals(entity.getY(), resultEntity.getY()); }
void function() { ShapeEntity entity = data.get(0); ShapeEntity resultEntity = shapeLogic.getShape(entity.getId()); Assert.assertNotNull(resultEntity); Assert.assertEquals(entity.getX(), resultEntity.getX()); Assert.assertEquals(entity.getY(), resultEntity.getY()); }
/** * Prueba para consultar un Shape * * @generated */
Prueba para consultar un Shape
getShapeTest
{ "repo_name": "aranega/featuretests", "path": "model-logic/src/test/java/co/edu/uniandes/csw/model/test/logic/ShapeLogicTest.java", "license": "mit", "size": 6466 }
[ "co.edu.uniandes.csw.model.entities.ShapeEntity", "org.junit.Assert" ]
import co.edu.uniandes.csw.model.entities.ShapeEntity; import org.junit.Assert;
import co.edu.uniandes.csw.model.entities.*; import org.junit.*;
[ "co.edu.uniandes", "org.junit" ]
co.edu.uniandes; org.junit;
2,561,278
@Test public void shouldFormatResolvedAsFixed() { Notification notification = new Notification("review-changed") .setFieldValue("reviewId", "1") .setFieldValue("project", "Sonar") .setFieldValue("resource", "org.sonar.server.ui.DefaultPages") .setFieldValue("title", "Utility classes should not have a public or default constructor.") .setFieldValue("author", "simon.brandhof") .setFieldValue("old.status", "OPEN") .setFieldValue("old.resolution", null) .setFieldValue("new.status", "RESOLVED") .setFieldValue("new.resolution", "FIXED"); EmailMessage message = template.format(notification); assertThat(message.getMessageId(), is("review/1")); assertThat(message.getSubject(), is("Review #1")); assertThat(message.getFrom(), is("Simon Brandhof")); assertThat(message.getMessage(), is("" + "Project: Sonar\n" + "Resource: org.sonar.server.ui.DefaultPages\n" + "\n" + "Utility classes should not have a public or default constructor.\n" + "\n" + "Status: RESOLVED (was OPEN)\n" + "Resolution: FIXED\n" + "\n" + "--\n" + "See it in Sonar: http://nemo.sonarsource.org/reviews/view/1\n")); }
void function() { Notification notification = new Notification(STR) .setFieldValue(STR, "1") .setFieldValue(STR, "Sonar") .setFieldValue(STR, STR) .setFieldValue("title", STR) .setFieldValue(STR, STR) .setFieldValue(STR, "OPEN") .setFieldValue(STR, null) .setFieldValue(STR, STR) .setFieldValue(STR, "FIXED"); EmailMessage message = template.format(notification); assertThat(message.getMessageId(), is(STR)); assertThat(message.getSubject(), is(STR)); assertThat(message.getFrom(), is(STR)); assertThat(message.getMessage(), is(STRProject: Sonar\nSTRResource: org.sonar.server.ui.DefaultPages\nSTR\nSTRUtility classes should not have a public or default constructor.\nSTR\nSTRStatus: RESOLVED (was OPEN)\nSTRResolution: FIXED\nSTR\nSTR--\nSTRSee it in Sonar: http: }
/** * <pre> * Subject: Review #1 * From: Simon Brandhof * * Project: Sonar * Resource: org.sonar.server.ui.DefaultPages * * Utility classes should not have a public or default constructor. * * Status: RESOLVED (was OPEN) * Resolution: FIXED * * -- * See it in Sonar: http://nemo.sonarsource.org/review/view/1 * </pre> */
<code> Subject: Review #1 From: Simon Brandhof Project: Sonar Resource: org.sonar.server.ui.DefaultPages Utility classes should not have a public or default constructor. Status: RESOLVED (was OPEN) Resolution: FIXED -- See it in Sonar: HREF </code>
shouldFormatResolvedAsFixed
{ "repo_name": "leodmurillo/sonar", "path": "plugins/sonar-email-notifications-plugin/src/test/java/org/sonar/plugins/emailnotifications/reviews/ReviewEmailTemplateTest.java", "license": "lgpl-3.0", "size": 18440 }
[ "org.hamcrest.Matchers", "org.junit.Assert", "org.sonar.api.notifications.Notification", "org.sonar.plugins.emailnotifications.api.EmailMessage" ]
import org.hamcrest.Matchers; import org.junit.Assert; import org.sonar.api.notifications.Notification; import org.sonar.plugins.emailnotifications.api.EmailMessage;
import org.hamcrest.*; import org.junit.*; import org.sonar.api.notifications.*; import org.sonar.plugins.emailnotifications.api.*;
[ "org.hamcrest", "org.junit", "org.sonar.api", "org.sonar.plugins" ]
org.hamcrest; org.junit; org.sonar.api; org.sonar.plugins;
2,912,188
void responseDatetime(String scenario) throws ErrorException, IOException, IllegalArgumentException;
void responseDatetime(String scenario) throws ErrorException, IOException, IllegalArgumentException;
/** * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". * * @param scenario Send a post request with header values "scenario": "valid" or "min" * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters */
Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z"
responseDatetime
{ "repo_name": "tbombach/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/Headers.java", "license": "mit", "size": 62060 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,232,810
public void testRemove2ElementsStart() throws Exception { final Element plainElement = paragraph.getElement(0); final Element boldElement = paragraph.getElement(1); final int offset = plainElement.getStartOffset(); final int length = (boldElement.getStartOffset() + boldElement.getEndOffset()) / 2 - offset; buf.remove(offset, length, createEvent(offset, length)); final List<?> edits = getEdits(event); assertEquals(1, edits.size()); assertChange(edits.get(0), paragraph, 0, new int[] { 0, 5 }, new int[] {}); assertChildren(paragraph, new int[] { 5, 9, 9, 15, 15, 16 }, new AttributeSet[] { bold, italic, null }); }
void function() throws Exception { final Element plainElement = paragraph.getElement(0); final Element boldElement = paragraph.getElement(1); final int offset = plainElement.getStartOffset(); final int length = (boldElement.getStartOffset() + boldElement.getEndOffset()) / 2 - offset; buf.remove(offset, length, createEvent(offset, length)); final List<?> edits = getEdits(event); assertEquals(1, edits.size()); assertChange(edits.get(0), paragraph, 0, new int[] { 0, 5 }, new int[] {}); assertChildren(paragraph, new int[] { 5, 9, 9, 15, 15, 16 }, new AttributeSet[] { bold, italic, null }); }
/** * The remove region affects two consecutive elements: * from the start of the first to the middle of the second. * The element fully contained in the remove region is to be removed * (the first one). */
The remove region affects two consecutive elements: from the start of the first to the middle of the second. The element fully contained in the remove region is to be removed (the first one)
testRemove2ElementsStart
{ "repo_name": "shannah/cn1", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/swing/src/test/api/java.injected/javax/swing/text/DefaultStyledDocument_ElementBuffer_RemoveTest.java", "license": "gpl-2.0", "size": 14303 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,123,477
public static boolean isLocked(Directory directory) throws IOException { return directory.makeLock(WRITE_LOCK_NAME).isLocked(); }
static boolean function(Directory directory) throws IOException { return directory.makeLock(WRITE_LOCK_NAME).isLocked(); }
/** * Returns <code>true</code> iff the index in the named directory is * currently locked. * @param directory the directory to check for a lock * @throws IOException if there is a low-level IO error */
Returns <code>true</code> iff the index in the named directory is currently locked
isLocked
{ "repo_name": "pengzong1111/solr4", "path": "lucene/core/src/java/org/apache/lucene/index/IndexWriter.java", "license": "apache-2.0", "size": 176670 }
[ "java.io.IOException", "org.apache.lucene.store.Directory" ]
import java.io.IOException; import org.apache.lucene.store.Directory;
import java.io.*; import org.apache.lucene.store.*;
[ "java.io", "org.apache.lucene" ]
java.io; org.apache.lucene;
2,852,474
@Test public final void testSize() { String testName = new String("CollectionListe<String>.size()"); System.out.println(testName); int result; // Taille nulle sur collection vide result = collection.size(); assertEquals(testName + " taille nulle sur collection vide", 0, result); // Remplissage remplissage(collection); // Taille après remplissage result = collection.size(); assertEquals(testName + " taille collection après remplissage", elements.length, result); }
final void function() { String testName = new String(STR); System.out.println(testName); int result; result = collection.size(); assertEquals(testName + STR, 0, result); remplissage(collection); result = collection.size(); assertEquals(testName + STR, elements.length, result); }
/** * Test method for {@link listes.CollectionListe#size()}. */
Test method for <code>listes.CollectionListe#size()</code>
testSize
{ "repo_name": "rpereira-dev/ENSIIE", "path": "UE/S2/ILO/TP Listes & Figures/src/tests/CollectionListeTest.java", "license": "gpl-3.0", "size": 22104 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
366,917
KeySequence getRepeatedInvocationKeySequence() { return fRepeatedInvocationKeySequence; }
KeySequence getRepeatedInvocationKeySequence() { return fRepeatedInvocationKeySequence; }
/** * Returns the repeated invocation key sequence. * * @return the repeated invocation key sequence or <code>null</code>, if none * @since 3.2 */
Returns the repeated invocation key sequence
getRepeatedInvocationKeySequence
{ "repo_name": "elucash/eclipse-oxygen", "path": "org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java", "license": "epl-1.0", "size": 84430 }
[ "org.eclipse.jface.bindings.keys.KeySequence" ]
import org.eclipse.jface.bindings.keys.KeySequence;
import org.eclipse.jface.bindings.keys.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,193,772
public byte[] getData() { int size = getSize(); byte[] data = new byte[size]; // Header System.arraycopy(header.getData(size), 0, data, 0, ProfileHeader.HEADERSIZE); // # of tags byte[] tt = getTagTable(); System.arraycopy(tt, 0, data, ProfileHeader.HEADERSIZE, tt.length); Enumeration e = tagTable.elements(); while (e.hasMoreElements()) { TagEntry tag = (TagEntry) e.nextElement(); System.arraycopy(tag.getData(), 0, data, tag.getOffset(), tag.getSize()); } return data; }
byte[] function() { int size = getSize(); byte[] data = new byte[size]; System.arraycopy(header.getData(size), 0, data, 0, ProfileHeader.HEADERSIZE); byte[] tt = getTagTable(); System.arraycopy(tt, 0, data, ProfileHeader.HEADERSIZE, tt.length); Enumeration e = tagTable.elements(); while (e.hasMoreElements()) { TagEntry tag = (TagEntry) e.nextElement(); System.arraycopy(tag.getData(), 0, data, tag.getOffset(), tag.getSize()); } return data; }
/** * Returns the data corresponding to this ICC_Profile as a byte array. * * @return The data in a byte array, * where the first element corresponds to first byte of the profile file. */
Returns the data corresponding to this ICC_Profile as a byte array
getData
{ "repo_name": "unofficial-opensource-apple/gcc_40", "path": "libjava/java/awt/color/ICC_Profile.java", "license": "gpl-2.0", "size": 40326 }
[ "gnu.java.awt.color.ProfileHeader", "gnu.java.awt.color.TagEntry", "java.util.Enumeration" ]
import gnu.java.awt.color.ProfileHeader; import gnu.java.awt.color.TagEntry; import java.util.Enumeration;
import gnu.java.awt.color.*; import java.util.*;
[ "gnu.java.awt", "java.util" ]
gnu.java.awt; java.util;
1,687,742
void setFont(Font font);
void setFont(Font font);
/** * Sets the font of this vertical ruler. * * @param font the new font of the vertical ruler */
Sets the font of this vertical ruler
setFont
{ "repo_name": "brunyuriy/quick-fix-scout", "path": "org.eclipse.jface.text_3.8.1.v20120828-155502/src/org/eclipse/jface/text/source/IVerticalRulerExtension.java", "license": "mit", "size": 1249 }
[ "org.eclipse.swt.graphics.Font" ]
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
828,473
public boolean isImmersive() { verifyMethodCalledFromDelegate("isImmersive()"); return ((CallFun0<Boolean>) mSuperListeners.pop()).call(); }
boolean function() { verifyMethodCalledFromDelegate(STR); return ((CallFun0<Boolean>) mSuperListeners.pop()).call(); }
/** * Bit indicating that this activity is "immersive" and should not be * interrupted by notifications if possible. * <p> * This value is initially set by the manifest property * <code>android:immersive</code> but may be changed at runtime by * {@link #setImmersive}. * * @see #setImmersive(boolean) * @see ActivityInfo#FLAG_IMMERSIVE */
Bit indicating that this activity is "immersive" and should not be interrupted by notifications if possible. This value is initially set by the manifest property <code>android:immersive</code> but may be changed at runtime by <code>#setImmersive</code>
isImmersive
{ "repo_name": "passsy/CompositeAndroid", "path": "activity/src/main/java/com/pascalwelsch/compositeandroid/activity/ActivityPlugin.java", "license": "apache-2.0", "size": 278532 }
[ "com.pascalwelsch.compositeandroid.core.CallFun0" ]
import com.pascalwelsch.compositeandroid.core.CallFun0;
import com.pascalwelsch.compositeandroid.core.*;
[ "com.pascalwelsch.compositeandroid" ]
com.pascalwelsch.compositeandroid;
1,717,950
public EnumFacing getAdjustedHorizontalFacing() { return this.getHorizontalFacing().rotateY(); }
EnumFacing function() { return this.getHorizontalFacing().rotateY(); }
/** * Gets the horizontal facing direction of this Entity, adjusted to take specially-treated entity types into * account. */
Gets the horizontal facing direction of this Entity, adjusted to take specially-treated entity types into account
getAdjustedHorizontalFacing
{ "repo_name": "boredherobrine13/morefuelsmod-1.10", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/item/EntityBoat.java", "license": "lgpl-2.1", "size": 35385 }
[ "net.minecraft.util.EnumFacing" ]
import net.minecraft.util.EnumFacing;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
1,603,133
public void expand(TreeImageDisplay node) { if (node == null) return; view.expandNode(node); }
void function(TreeImageDisplay node) { if (node == null) return; view.expandNode(node); }
/** * Implemented as specified by the {@link Browser} interface. * @see Browser#expand(TreeImageDisplay) */
Implemented as specified by the <code>Browser</code> interface
expand
{ "repo_name": "ximenesuk/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java", "license": "gpl-2.0", "size": 78014 }
[ "org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay" ]
import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay;
import org.openmicroscopy.shoola.agents.util.browser.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
2,437,719
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Map.Entry.class)) { case ExecPackage.HASH_ENTRY__KEY: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case ExecPackage.HASH_ENTRY__VALUE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Map.Entry.class)) { case ExecPackage.HASH_ENTRY__KEY: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case ExecPackage.HASH_ENTRY__VALUE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "Nasdanika/amur-it-js", "path": "org.nasdanika.amur.it.js.edit/src/org/nasdanika/amur/it/js/exec/provider/HashEntryItemProvider.java", "license": "epl-1.0", "size": 6767 }
[ "java.util.Map", "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification", "org.nasdanika.amur.it.js.exec.ExecPackage" ]
import java.util.Map; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; import org.nasdanika.amur.it.js.exec.ExecPackage;
import java.util.*; import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; import org.nasdanika.amur.it.js.exec.*;
[ "java.util", "org.eclipse.emf", "org.nasdanika.amur" ]
java.util; org.eclipse.emf; org.nasdanika.amur;
192,451
public Writable get(int i) { return values[i]; }
Writable function(int i) { return values[i]; }
/** * Get ith Writable from Tuple. */
Get ith Writable from Tuple
get
{ "repo_name": "cloudera/crunch", "path": "crunch/src/main/java/org/apache/crunch/types/writable/TupleWritable.java", "license": "apache-2.0", "size": 6149 }
[ "org.apache.hadoop.io.Writable" ]
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,448,833
@Test public void testSimpleBindComplexDn() throws LdapException, IOException { String dn = "cn=Meissa SAKHO+uid=msakho,dc=example,dc=com"; Entry entry = new DefaultEntry( dn, "objectClass: organizationalPerson", "objectClass: person", "objectClass: inetOrgPerson", "objectClass: top", "cn: meissa sakho", "sn: sakho", "title: cn=Administrator,ou=Groups,dc=example,dc=com", "uid: msakho", "userpassword: meissa" ); connection.add( entry ); connection.bind( dn, "meissa" ); }
void function() throws LdapException, IOException { String dn = STR; Entry entry = new DefaultEntry( dn, STR, STR, STR, STR, STR, STR, STR, STR, STR ); connection.add( entry ); connection.bind( dn, STR ); }
/** * not allowed by the server. We should get a invalidCredentials error. * * @throws Exception on error */
not allowed by the server. We should get a invalidCredentials error
testSimpleBindComplexDn
{ "repo_name": "apache/directory-server", "path": "core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java", "license": "apache-2.0", "size": 8781 }
[ "java.io.IOException", "org.apache.directory.api.ldap.model.entry.DefaultEntry", "org.apache.directory.api.ldap.model.entry.Entry", "org.apache.directory.api.ldap.model.exception.LdapException" ]
import java.io.IOException; import org.apache.directory.api.ldap.model.entry.DefaultEntry; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.exception.LdapException;
import java.io.*; import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.api.ldap.model.exception.*;
[ "java.io", "org.apache.directory" ]
java.io; org.apache.directory;
1,272,600
@Override public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f6 = (particleTextureIndexX + particleTextureJitterX / 4.0F) / 16.0F; float f7 = f6 + 0.015609375F; float f8 = (particleTextureIndexY + particleTextureJitterY / 4.0F) / 16.0F; float f9 = f8 + 0.015609375F; float f10 = 0.1F * particleScale; if (particleIcon != null) { f6 = particleIcon.getInterpolatedU(particleTextureJitterX / 4.0F * 16.0F); f7 = particleIcon.getInterpolatedU((particleTextureJitterX + 1.0F) / 4.0F * 16.0F); f8 = particleIcon.getInterpolatedV(particleTextureJitterY / 4.0F * 16.0F); f9 = particleIcon.getInterpolatedV((particleTextureJitterY + 1.0F) / 4.0F * 16.0F); } float f11 = (float) (prevPosX + (posX - prevPosX) * par2 - interpPosX); float f12 = (float) (prevPosY + (posY - prevPosY) * par2 - interpPosY); float f13 = (float) (prevPosZ + (posZ - prevPosZ) * par2 - interpPosZ); float f14 = 1.0F; par1Tessellator.setColorOpaque_F(f14 * particleRed, f14 * particleGreen, f14 * particleBlue); par1Tessellator.addVertexWithUV(f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f6, f9); par1Tessellator.addVertexWithUV(f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f6, f8); par1Tessellator.addVertexWithUV(f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f7, f8); par1Tessellator.addVertexWithUV(f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f7, f9); }
void function(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f6 = (particleTextureIndexX + particleTextureJitterX / 4.0F) / 16.0F; float f7 = f6 + 0.015609375F; float f8 = (particleTextureIndexY + particleTextureJitterY / 4.0F) / 16.0F; float f9 = f8 + 0.015609375F; float f10 = 0.1F * particleScale; if (particleIcon != null) { f6 = particleIcon.getInterpolatedU(particleTextureJitterX / 4.0F * 16.0F); f7 = particleIcon.getInterpolatedU((particleTextureJitterX + 1.0F) / 4.0F * 16.0F); f8 = particleIcon.getInterpolatedV(particleTextureJitterY / 4.0F * 16.0F); f9 = particleIcon.getInterpolatedV((particleTextureJitterY + 1.0F) / 4.0F * 16.0F); } float f11 = (float) (prevPosX + (posX - prevPosX) * par2 - interpPosX); float f12 = (float) (prevPosY + (posY - prevPosY) * par2 - interpPosY); float f13 = (float) (prevPosZ + (posZ - prevPosZ) * par2 - interpPosZ); float f14 = 1.0F; par1Tessellator.setColorOpaque_F(f14 * particleRed, f14 * particleGreen, f14 * particleBlue); par1Tessellator.addVertexWithUV(f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, f6, f9); par1Tessellator.addVertexWithUV(f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, f6, f8); par1Tessellator.addVertexWithUV(f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, f7, f8); par1Tessellator.addVertexWithUV(f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, f7, f9); }
/** * copy pasted from EntityDiggingFX */
copy pasted from EntityDiggingFX
renderParticle
{ "repo_name": "Mazdallier/AdventureBackpack2", "path": "src/main/java/codechicken/lib/render/EntityDigIconFX.java", "license": "lgpl-3.0", "size": 5079 }
[ "net.minecraft.client.renderer.Tessellator" ]
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.*;
[ "net.minecraft.client" ]
net.minecraft.client;
1,307,275
public static PDImageXObject createFromFile(String imagePath, PDDocument doc) throws IOException { return createFromFile(new File(imagePath), doc); }
static PDImageXObject function(String imagePath, PDDocument doc) throws IOException { return createFromFile(new File(imagePath), doc); }
/** * Create a PDImageXObject from an image file, see {@link #createFromFile(File, PDDocument)} for * more details. * * @param imagePath the image file path. * @param doc the document that shall use this PDImageXObject. * @return a PDImageXObject. * @throws IOException if there is an error when reading the file or creating the * PDImageXObject, or if the image type is not supported. */
Create a PDImageXObject from an image file, see <code>#createFromFile(File, PDDocument)</code> for more details
createFromFile
{ "repo_name": "mdamt/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/PDImageXObject.java", "license": "apache-2.0", "size": 19128 }
[ "java.io.File", "java.io.IOException", "org.apache.pdfbox.pdmodel.PDDocument" ]
import java.io.File; import java.io.IOException; import org.apache.pdfbox.pdmodel.PDDocument;
import java.io.*; import org.apache.pdfbox.pdmodel.*;
[ "java.io", "org.apache.pdfbox" ]
java.io; org.apache.pdfbox;
895,846
public final void writeStringList(List<String> val) { if (val == null) { writeInt(-1); return; } int N = val.size(); int i=0; writeInt(N); while (i < N) { writeString(val.get(i)); i++; } }
final void function(List<String> val) { if (val == null) { writeInt(-1); return; } int N = val.size(); int i=0; writeInt(N); while (i < N) { writeString(val.get(i)); i++; } }
/** * Flatten a List containing String objects into the parcel, at * the current dataPosition() and growing dataCapacity() if needed. They * can later be retrieved with {@link #createStringArrayList} or * {@link #readStringList}. * * @param val The list of strings to be written. * * @see #createStringArrayList * @see #readStringList */
Flatten a List containing String objects into the parcel, at the current dataPosition() and growing dataCapacity() if needed. They can later be retrieved with <code>#createStringArrayList</code> or <code>#readStringList</code>
writeStringList
{ "repo_name": "mateor/PDroidHistory", "path": "frameworks/base/core/java/android/os/Parcel.java", "license": "gpl-3.0", "size": 72041 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,761,261
public Document getWPSXML() throws XPathExpressionException, IOException, SAXException, ParserConfigurationException { // Deprecated Document doc = null; if (this.getWps_reference_type().equals(this.REFERENCE_TYPE_GS)) doc = this.getDocument(this.analysisMethodTemplate2); else if (this.getWps_reference_type().equals(this.INPUT_GEOJSON)) doc = this.getDocument(this.analysisMethodTemplate3); else doc = this.getDocument(this.analysisMethodTemplate); // TODO: set wfs query parameters // Set input values this.setLiteralDataContent(doc, DISTANCE, this.getDistance()); this.setLiteralDataContent(doc, ATTRIBUTENAME, this.getAttributeName()); // add features and inputs to dataInputs node return doc; }
Document function() throws XPathExpressionException, IOException, SAXException, ParserConfigurationException { Document doc = null; if (this.getWps_reference_type().equals(this.REFERENCE_TYPE_GS)) doc = this.getDocument(this.analysisMethodTemplate2); else if (this.getWps_reference_type().equals(this.INPUT_GEOJSON)) doc = this.getDocument(this.analysisMethodTemplate3); else doc = this.getDocument(this.analysisMethodTemplate); this.setLiteralDataContent(doc, DISTANCE, this.getDistance()); this.setLiteralDataContent(doc, ATTRIBUTENAME, this.getAttributeName()); return doc; }
/** * DEPRECATED - NOT IN USE * @return * @throws XPathExpressionException * @throws IOException * @throws SAXException * @throws ParserConfigurationException */
DEPRECATED - NOT IN USE
getWPSXML
{ "repo_name": "nls-oskari/oskari-server", "path": "service-map/src/main/java/fi/nls/oskari/map/analysis/domain/BufferMethodParams.java", "license": "mit", "size": 4874 }
[ "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "javax.xml.xpath.XPathExpressionException", "org.w3c.dom.Document", "org.xml.sax.SAXException" ]
import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; import org.w3c.dom.Document; import org.xml.sax.SAXException;
import java.io.*; import javax.xml.parsers.*; import javax.xml.xpath.*; import org.w3c.dom.*; import org.xml.sax.*;
[ "java.io", "javax.xml", "org.w3c.dom", "org.xml.sax" ]
java.io; javax.xml; org.w3c.dom; org.xml.sax;
1,036,884
void executeSqlBatch(String[] queryarr, JSONArray[] jsonparamsArr, CallbackContext cbc) { if (mydb == null) { // not allowed - can only happen if someone has closed (and possibly deleted) a database and then re-used the database cbc.error("database has been closed"); return; } int len = queryarr.length; JSONArray batchResults = new JSONArray(); for (int i = 0; i < len; i++) { executeSqlBatchStatement(queryarr[i], jsonparamsArr[i], batchResults); } cbc.success(batchResults); }
void executeSqlBatch(String[] queryarr, JSONArray[] jsonparamsArr, CallbackContext cbc) { if (mydb == null) { cbc.error(STR); return; } int len = queryarr.length; JSONArray batchResults = new JSONArray(); for (int i = 0; i < len; i++) { executeSqlBatchStatement(queryarr[i], jsonparamsArr[i], batchResults); } cbc.success(batchResults); }
/** * Executes a batch request and sends the results via cbc. * * @param queryarr Array of query strings * @param jsonparamsArr Array of JSON query parameters * @param cbc Callback context from Cordova API */
Executes a batch request and sends the results via cbc
executeSqlBatch
{ "repo_name": "ederaa01/AgrodadosMobile", "path": "plugins/cordova-sqlite-storage/src/android/io/sqlc/SQLiteAndroidDatabase.java", "license": "apache-2.0", "size": 21367 }
[ "org.apache.cordova.CallbackContext", "org.json.JSONArray" ]
import org.apache.cordova.CallbackContext; import org.json.JSONArray;
import org.apache.cordova.*; import org.json.*;
[ "org.apache.cordova", "org.json" ]
org.apache.cordova; org.json;
2,645,141
private List<Clickable> constructClickables() { List<Clickable> clicks = new ArrayList<Clickable>(); if (showInheritedMembers) { if (g.hasSuperGroup()) { clicks.addAll(getRecursiveInheritedMembers(g.getSuperGroup())); } } if (showBlacklist) { final BlackList black = NameLayerPlugin.getBlackList(); for (final UUID uuid : black.getBlacklist(g)) { ItemStack is = new ItemStack(Material.LEATHER_CHESTPLATE); LeatherArmorMeta meta = (LeatherArmorMeta) is.getItemMeta(); meta.setColor(Color.BLACK); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); is.setItemMeta(meta); ISUtils.setName(is, NameAPI.getCurrentName(uuid)); Clickable c; if (gm.hasAccess(g, p.getUniqueId(), PermissionType.getPermission("BLACKLIST"))) { ISUtils.addLore(is, ChatColor.GREEN + "Click to remove " + NameAPI.getCurrentName(uuid), ChatColor.GREEN + "from the blacklist"); c = new Clickable(is) {
List<Clickable> function() { List<Clickable> clicks = new ArrayList<Clickable>(); if (showInheritedMembers) { if (g.hasSuperGroup()) { clicks.addAll(getRecursiveInheritedMembers(g.getSuperGroup())); } } if (showBlacklist) { final BlackList black = NameLayerPlugin.getBlackList(); for (final UUID uuid : black.getBlacklist(g)) { ItemStack is = new ItemStack(Material.LEATHER_CHESTPLATE); LeatherArmorMeta meta = (LeatherArmorMeta) is.getItemMeta(); meta.setColor(Color.BLACK); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); is.setItemMeta(meta); ISUtils.setName(is, NameAPI.getCurrentName(uuid)); Clickable c; if (gm.hasAccess(g, p.getUniqueId(), PermissionType.getPermission(STR))) { ISUtils.addLore(is, ChatColor.GREEN + STR + NameAPI.getCurrentName(uuid), ChatColor.GREEN + STR); c = new Clickable(is) {
/** * Creates a list of all Clickables representing members, invitees and * blacklisted players, if they are supposed to be displayed. This is whats * directly fed into the middle of the gui * */
Creates a list of all Clickables representing members, invitees and blacklisted players, if they are supposed to be displayed. This is whats directly fed into the middle of the gui
constructClickables
{ "repo_name": "Civcraft/NameLayer", "path": "namelayer-spigot/src/main/java/vg/civcraft/mc/namelayer/gui/MainGroupGUI.java", "license": "bsd-3-clause", "size": 37587 }
[ "java.util.ArrayList", "java.util.List", "org.bukkit.ChatColor", "org.bukkit.Color", "org.bukkit.Material", "org.bukkit.inventory.ItemFlag", "org.bukkit.inventory.ItemStack", "org.bukkit.inventory.meta.LeatherArmorMeta" ]
import java.util.ArrayList; import java.util.List; import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.LeatherArmorMeta;
import java.util.*; import org.bukkit.*; import org.bukkit.inventory.*; import org.bukkit.inventory.meta.*;
[ "java.util", "org.bukkit", "org.bukkit.inventory" ]
java.util; org.bukkit; org.bukkit.inventory;
2,594,612
@Test(invocationCount = 1000) static void testBug8186171NonDeterministic() { final ThreadLocalRandom rnd = ThreadLocalRandom.current(); final Object v1 = rnd.nextBoolean() ? null : 1; final Object v2 = (rnd.nextBoolean() && v1 != null) ? null : 2; final boolean poorHash = rnd.nextBoolean(); class Key implements Comparable<Key> { final int i; Key(int i) { this.i = i; } public int hashCode() { return poorHash ? 0 : super.hashCode(); }
@Test(invocationCount = 1000) static void testBug8186171NonDeterministic() { final ThreadLocalRandom rnd = ThreadLocalRandom.current(); final Object v1 = rnd.nextBoolean() ? null : 1; final Object v2 = (rnd.nextBoolean() && v1 != null) ? null : 2; final boolean poorHash = rnd.nextBoolean(); class Key implements Comparable<Key> { final int i; Key(int i) { this.i = i; } public int hashCode() { return poorHash ? 0 : super.hashCode(); }
/** * Tests and extends the scenario reported in * https://bugs.openjdk.java.net/browse/JDK-8186171 * HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries * Runs 1000 times as it is based on randomization. */
Tests and extends the scenario reported in HREF HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries Runs 1000 times as it is based on randomization
testBug8186171NonDeterministic
{ "repo_name": "JetBrains/jdk8u_jdk", "path": "test/java/util/HashMap/Bug8186171Test.java", "license": "gpl-2.0", "size": 5312 }
[ "java.util.concurrent.ThreadLocalRandom", "org.testng.annotations.Test" ]
import java.util.concurrent.ThreadLocalRandom; import org.testng.annotations.Test;
import java.util.concurrent.*; import org.testng.annotations.*;
[ "java.util", "org.testng.annotations" ]
java.util; org.testng.annotations;
1,877,365
public void testArc2DDoubleSerialization() { Arc2D a1 = new Arc2D.Double(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, Arc2D.PIE); Arc2D a2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(buffer); SerialUtilities.writeShape(a1, out); out.close(); ByteArrayInputStream bais = new ByteArrayInputStream( buffer.toByteArray()); ObjectInputStream in = new ObjectInputStream(bais); a2 = (Arc2D) SerialUtilities.readShape(in); in.close(); } catch (Exception e) { e.printStackTrace(); } assertTrue(ShapeUtilities.equal(a1, a2)); }
void function() { Arc2D a1 = new Arc2D.Double(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, Arc2D.PIE); Arc2D a2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(buffer); SerialUtilities.writeShape(a1, out); out.close(); ByteArrayInputStream bais = new ByteArrayInputStream( buffer.toByteArray()); ObjectInputStream in = new ObjectInputStream(bais); a2 = (Arc2D) SerialUtilities.readShape(in); in.close(); } catch (Exception e) { e.printStackTrace(); } assertTrue(ShapeUtilities.equal(a1, a2)); }
/** * Serialize an <code>Arc2D.Double</code> instance and check that it * can be deserialized correctly. */
Serialize an <code>Arc2D.Double</code> instance and check that it can be deserialized correctly
testArc2DDoubleSerialization
{ "repo_name": "beetri/jfreechart-code", "path": "tests/org/jfree/chart/util/junit/SerialUtilitiesTests.java", "license": "lgpl-2.1", "size": 16991 }
[ "java.awt.geom.Arc2D", "java.io.ByteArrayInputStream", "java.io.ByteArrayOutputStream", "java.io.ObjectInputStream", "java.io.ObjectOutputStream", "org.jfree.chart.util.SerialUtilities", "org.jfree.chart.util.ShapeUtilities" ]
import java.awt.geom.Arc2D; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.jfree.chart.util.SerialUtilities; import org.jfree.chart.util.ShapeUtilities;
import java.awt.geom.*; import java.io.*; import org.jfree.chart.util.*;
[ "java.awt", "java.io", "org.jfree.chart" ]
java.awt; java.io; org.jfree.chart;
943,781
private Result pCConstant$StringConstant$$Plus1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$StringConstant$$Plus1) yyColumn.chunk1.fCConstant$StringConstant$$Plus1 = pCConstant$StringConstant$$Plus1$1(yyStart); return yyColumn.chunk1.fCConstant$StringConstant$$Plus1; }
private Result pCConstant$StringConstant$$Plus1(final int yyStart) throws IOException { JeannieParserColumn yyColumn = (JeannieParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fCConstant$StringConstant$$Plus1) yyColumn.chunk1.fCConstant$StringConstant$$Plus1 = pCConstant$StringConstant$$Plus1$1(yyStart); return yyColumn.chunk1.fCConstant$StringConstant$$Plus1; }
/** * Parse synthetic nonterminal CConstant.StringConstant$$Plus1. * * @param yyStart The index. * @return The result. * @throws IOException Signals an I/O error. */
Parse synthetic nonterminal CConstant.StringConstant$$Plus1
pCConstant$StringConstant$$Plus1
{ "repo_name": "wandoulabs/xtc-rats", "path": "xtc-core/src/main/java/xtc/lang/jeannie/JeannieParser.java", "license": "lgpl-2.1", "size": 647687 }
[ "java.io.IOException", "xtc.parser.Result" ]
import java.io.IOException; import xtc.parser.Result;
import java.io.*; import xtc.parser.*;
[ "java.io", "xtc.parser" ]
java.io; xtc.parser;
2,001,340
private void writeIndex(String path, BlockWriter blockIndex, Iterator<Entry<Object, Object>> iterator) throws IOException { FileOutputStream out = new FileOutputStream(path); BlockWriter block; if (compressed) block = new CompressedBlockWriter(true, true); else block = new DefaultBlockWriter(true, true); int entryCount = 0; int blockOffset = 0; boolean newBlockFile = false; // write each block to disk // note that blocks can become slightly larger than the maxFileSize // depending on the size of the last block while (iterator.hasNext() && !newBlockFile) { // add the next key-value pair to the current block Entry<Object, Object> next = iterator.next(); block.add(next.getKey(), next.getValue()); entryCount++; // if the block size limit has been reached, or there are no more // key-value pairs, serialize the block and write it to disk if (entryCount % maxBlockEntries == 0 || !iterator.hasNext()) { // serialize the offset of the block into a new buffer ReusableBuffer buf = ReusableBuffer.wrap(new byte[(Integer.SIZE / 8) + (Short.SIZE / 8)]); buf.putInt(blockOffset); buf.putShort(blockFileId); // add the key-offset mapping to the block index blockIndex.add(InternalBufferUtil.toBuffer(block.getBlockKey()), buf.array()); // serialize the block and calculate the next block offset SerializedBlock serializedBlock = block.serialize(); blockOffset += serializedBlock.size(); // write the block int writtenBytes = 0; Iterator<Object> it = serializedBlock.iterator(); while (it.hasNext()) { // for robustness: check if the file descriptor is still valid, // re-open the file if necessary if(!out.getFD().valid()) { out.close(); out = new FileOutputStream(path, true); } Object nextBuffer = it.next(); // check if the entry is the last from the buffer; if so, free it if(nextBuffer instanceof ByteRange) { ByteRange rng = (ByteRange) nextBuffer; if(rng.getReusableBuf() != null) BufferPool.free(rng.getReusableBuf()); } writtenBytes += writeBuffer(out, nextBuffer); } assert (writtenBytes == serializedBlock.size()); if (blockOffset >= maxFileSize) { newBlockFile = true; } else { if (iterator.hasNext()) if (compressed) block = new CompressedBlockWriter(true, true); else block = new DefaultBlockWriter(true, true); } } } out.close(); }
void function(String path, BlockWriter blockIndex, Iterator<Entry<Object, Object>> iterator) throws IOException { FileOutputStream out = new FileOutputStream(path); BlockWriter block; if (compressed) block = new CompressedBlockWriter(true, true); else block = new DefaultBlockWriter(true, true); int entryCount = 0; int blockOffset = 0; boolean newBlockFile = false; while (iterator.hasNext() && !newBlockFile) { Entry<Object, Object> next = iterator.next(); block.add(next.getKey(), next.getValue()); entryCount++; if (entryCount % maxBlockEntries == 0 !iterator.hasNext()) { ReusableBuffer buf = ReusableBuffer.wrap(new byte[(Integer.SIZE / 8) + (Short.SIZE / 8)]); buf.putInt(blockOffset); buf.putShort(blockFileId); blockIndex.add(InternalBufferUtil.toBuffer(block.getBlockKey()), buf.array()); SerializedBlock serializedBlock = block.serialize(); blockOffset += serializedBlock.size(); int writtenBytes = 0; Iterator<Object> it = serializedBlock.iterator(); while (it.hasNext()) { if(!out.getFD().valid()) { out.close(); out = new FileOutputStream(path, true); } Object nextBuffer = it.next(); if(nextBuffer instanceof ByteRange) { ByteRange rng = (ByteRange) nextBuffer; if(rng.getReusableBuf() != null) BufferPool.free(rng.getReusableBuf()); } writtenBytes += writeBuffer(out, nextBuffer); } assert (writtenBytes == serializedBlock.size()); if (blockOffset >= maxFileSize) { newBlockFile = true; } else { if (iterator.hasNext()) if (compressed) block = new CompressedBlockWriter(true, true); else block = new DefaultBlockWriter(true, true); } } } out.close(); }
/** * Write blocks to the file at the given path until the maxFileSize is * reached. * * @param path * @param iterator * @throws IOException */
Write blocks to the file at the given path until the maxFileSize is reached
writeIndex
{ "repo_name": "caraboides/babuDB", "path": "src/org/xtreemfs/babudb/index/writer/DiskIndexWriter.java", "license": "bsd-3-clause", "size": 8603 }
[ "java.io.FileOutputStream", "java.io.IOException", "java.util.Iterator", "java.util.Map", "org.xtreemfs.babudb.index.ByteRange", "org.xtreemfs.babudb.index.reader.InternalBufferUtil", "org.xtreemfs.foundation.buffer.BufferPool", "org.xtreemfs.foundation.buffer.ReusableBuffer" ]
import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.Map; import org.xtreemfs.babudb.index.ByteRange; import org.xtreemfs.babudb.index.reader.InternalBufferUtil; import org.xtreemfs.foundation.buffer.BufferPool; import org.xtreemfs.foundation.buffer.ReusableBuffer;
import java.io.*; import java.util.*; import org.xtreemfs.babudb.index.*; import org.xtreemfs.babudb.index.reader.*; import org.xtreemfs.foundation.buffer.*;
[ "java.io", "java.util", "org.xtreemfs.babudb", "org.xtreemfs.foundation" ]
java.io; java.util; org.xtreemfs.babudb; org.xtreemfs.foundation;
2,093,602
Job postprocess(boolean isTerminal) throws ExecutorException;
Job postprocess(boolean isTerminal) throws ExecutorException;
/** * Do after-processing */
Do after-processing
postprocess
{ "repo_name": "rabix/bunny", "path": "rabix-executor/src/main/java/org/rabix/executor/handler/JobHandler.java", "license": "apache-2.0", "size": 1422 }
[ "org.rabix.bindings.model.Job", "org.rabix.executor.ExecutorException" ]
import org.rabix.bindings.model.Job; import org.rabix.executor.ExecutorException;
import org.rabix.bindings.model.*; import org.rabix.executor.*;
[ "org.rabix.bindings", "org.rabix.executor" ]
org.rabix.bindings; org.rabix.executor;
787,405
public Hashtable<Integer, UserProfile> getUserProfileList (IPerson person);
Hashtable<Integer, UserProfile> function (IPerson person);
/** retreive a list of profiles associated with a user * * @param person User * @return a <code>Hashtable</code> mapping user profile ids (<code>Integer</code> objects) to the {@link UserProfile} objects */
retreive a list of profiles associated with a user
getUserProfileList
{ "repo_name": "MichaelVose2/uPortal", "path": "uportal-war/src/main/java/org/apereo/portal/layout/IUserLayoutStore.java", "license": "apache-2.0", "size": 8988 }
[ "java.util.Hashtable", "org.apereo.portal.UserProfile", "org.apereo.portal.security.IPerson" ]
import java.util.Hashtable; import org.apereo.portal.UserProfile; import org.apereo.portal.security.IPerson;
import java.util.*; import org.apereo.portal.*; import org.apereo.portal.security.*;
[ "java.util", "org.apereo.portal" ]
java.util; org.apereo.portal;
707,968
public static IMethodBinding findOverriddenMethodInHierarchy(ITypeBinding type, IMethodBinding binding) { IMethodBinding method= findOverriddenMethodInType(type, binding); if (method != null) return method; ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { method= findOverriddenMethodInHierarchy(superClass, binding); if (method != null) return method; } ITypeBinding[] interfaces= type.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { method= findOverriddenMethodInHierarchy(interfaces[i], binding); if (method != null) return method; } return null; }
static IMethodBinding function(ITypeBinding type, IMethodBinding binding) { IMethodBinding method= findOverriddenMethodInType(type, binding); if (method != null) return method; ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { method= findOverriddenMethodInHierarchy(superClass, binding); if (method != null) return method; } ITypeBinding[] interfaces= type.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { method= findOverriddenMethodInHierarchy(interfaces[i], binding); if (method != null) return method; } return null; }
/** * Finds a method in the hierarchy of <code>type</code> that is overridden by </code>binding</code>. * Returns <code>null</code> if no such method exists. If the method is defined in more than one super type only the first match is * returned. First the super class is examined and then the implemented interfaces. * @param type The type to search the method in * @param binding The method that overrides * @return the method binding overridden the method */
Finds a method in the hierarchy of <code>type</code> that is overridden by </code>binding</code>. Returns <code>null</code> if no such method exists. If the method is defined in more than one super type only the first match is returned. First the super class is examined and then the implemented interfaces
findOverriddenMethodInHierarchy
{ "repo_name": "brunyuriy/quick-fix-scout", "path": "org.eclipse.jdt.ui_3.7.1.r371_v20110824-0800/src/org/eclipse/jdt/internal/corext/dom/Bindings.java", "license": "mit", "size": 52777 }
[ "org.eclipse.jdt.core.dom.IMethodBinding", "org.eclipse.jdt.core.dom.ITypeBinding" ]
import org.eclipse.jdt.core.dom.IMethodBinding; import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
1,044,083
public SslContextBuilder trustManager(File trustCertCollectionFile) { try { return trustManager(SslContext.toX509Certificates(trustCertCollectionFile)); } catch (Exception e) { throw new IllegalArgumentException("File does not contain valid certificates: " + trustCertCollectionFile, e); } }
SslContextBuilder function(File trustCertCollectionFile) { try { return trustManager(SslContext.toX509Certificates(trustCertCollectionFile)); } catch (Exception e) { throw new IllegalArgumentException(STR + trustCertCollectionFile, e); } }
/** * Trusted certificates for verifying the remote endpoint's certificate. The file should * contain an X.509 certificate collection in PEM format. {@code null} uses the system default. */
Trusted certificates for verifying the remote endpoint's certificate. The file should contain an X.509 certificate collection in PEM format. null uses the system default
trustManager
{ "repo_name": "SinaTadayon/netty", "path": "handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java", "license": "apache-2.0", "size": 16430 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,427,167
public void start(Uri remoteAddress) { start(remoteAddress, null); }
void function(Uri remoteAddress) { start(remoteAddress, null); }
/** * Starts downloading a file from the given remote address to be saved in * the default location. * * @param remoteAddress The address to download the file from */
Starts downloading a file from the given remote address to be saved in the default location
start
{ "repo_name": "samcrow/ColonyNavigator", "path": "app/src/main/java/org/samcrow/updater/Download.java", "license": "gpl-3.0", "size": 11694 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
2,557,175
public static String formatMessage(final String msgid, String... args) { final StringBuffer sb = new StringBuffer(); (new MessageFormat(getMessage(msgid))).format(args, sb, null); return sb.toString(); }
static String function(final String msgid, String... args) { final StringBuffer sb = new StringBuffer(); (new MessageFormat(getMessage(msgid))).format(args, sb, null); return sb.toString(); }
/** * Returns the message string for the given message-id for the active * language. The variables {0}, {1}, ... are replaced with the arguments * given in <code>args</code>. * * The class {@link MessageFormat} contains more further information on * formatting the arguments. * * @param msgid - the message id * @param args - an array of arguments. * @return the message string. */
Returns the message string for the given message-id for the active language. The variables {0}, {1}, ... are replaced with the arguments given in <code>args</code>. The class <code>MessageFormat</code> contains more further information on formatting the arguments
formatMessage
{ "repo_name": "Paolo-Maffei/freebus-fts", "path": "freebus-fts-persistence/src/main/java/org/freebus/fts/project/internal/I18n.java", "license": "gpl-3.0", "size": 1259 }
[ "java.text.MessageFormat" ]
import java.text.MessageFormat;
import java.text.*;
[ "java.text" ]
java.text;
2,157,652
String ret = xml; Pattern head = Pattern.compile(".*(<\\?xml(.*?)\\?>).*", Pattern.DOTALL); // just the header line <?xml ... ?> Matcher headm = head.matcher(xml); if (headm.matches()) { String xmlHeaderOrig = headm.group(1); String xmlHeaderNew = headm.group(1); Pattern p = Pattern.compile("(\\w+)=[\"\']?[\\w.-]+[\"\']?"); // key="value" with optional apostrophe Matcher m = p.matcher(xmlHeaderNew); while (m.find()) { String known = m.group(1).toLowerCase(Locale.ROOT); switch (known) { case "version": case "encoding": case "standalone": // valid, do nothing break; default: // replace unknown xmlHeaderNew = xmlHeaderNew.replace(m.group(), ""); break; } xmlHeaderNew = xmlHeaderNew.replaceAll(";", ""); // replace semicolons - should not be there... } if (!xmlHeaderNew.equals(xmlHeaderOrig)) { xmlHeaderNew = xmlHeaderNew.replaceAll(" ", " "); LOGGER.warn("Fixing invalid XML header! " + xmlHeaderOrig + " -> " + xmlHeaderNew); ret = ret.replace(xmlHeaderOrig, xmlHeaderNew); } } return ret.trim(); }
String ret = xml; Pattern head = Pattern.compile(STR, Pattern.DOTALL); Matcher headm = head.matcher(xml); if (headm.matches()) { String xmlHeaderOrig = headm.group(1); String xmlHeaderNew = headm.group(1); Pattern p = Pattern.compile(STR\']?[\\w.-]+[\"\']?"); Matcher m = p.matcher(xmlHeaderNew); while (m.find()) { String known = m.group(1).toLowerCase(Locale.ROOT); switch (known) { case STR: case STR: case STR: break; default: xmlHeaderNew = xmlHeaderNew.replace(m.group(), STR;STRSTR STR STRFixing invalid XML header! STR -> " + xmlHeaderNew); ret = ret.replace(xmlHeaderOrig, xmlHeaderNew); } } return ret.trim(); }
/** * Strips out unknown XML header values which might break validators<br> * like &lt;?xml ... asdf=false ... ?&gt; * * @param xml * @return */
Strips out unknown XML header values which might break validators like &lt;?xml ... asdf=false ... ?&gt
fixXmlHeader
{ "repo_name": "tinyMediaManager/scraper-kodi", "path": "src/main/java/org/tinymediamanager/scraper/kodi/KodiUtil.java", "license": "apache-2.0", "size": 13130 }
[ "java.util.Locale", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
452,169
public Collection<String> getAggregatorStepNames(Aggregator<?, ?> aggregator) { Collection<String> names = new HashSet<>(); Collection<PTransform<?, ?>> transforms = aggregatorTransforms.get(aggregator); for (PTransform<?, ?> transform : transforms) { for (AppliedPTransform<?, ?, ?> applied : transformAppliedTransforms.get(transform)) { names.add(appliedStepNames.get(applied)); } } return names; }
Collection<String> function(Aggregator<?, ?> aggregator) { Collection<String> names = new HashSet<>(); Collection<PTransform<?, ?>> transforms = aggregatorTransforms.get(aggregator); for (PTransform<?, ?> transform : transforms) { for (AppliedPTransform<?, ?, ?> applied : transformAppliedTransforms.get(transform)) { names.add(appliedStepNames.get(applied)); } } return names; }
/** * Gets the step names in which the {@link Aggregator} is used. */
Gets the step names in which the <code>Aggregator</code> is used
getAggregatorStepNames
{ "repo_name": "joshualitt/incubator-beam", "path": "runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/internal/DataflowAggregatorTransforms.java", "license": "apache-2.0", "size": 3246 }
[ "java.util.Collection", "java.util.HashSet", "org.apache.beam.sdk.transforms.Aggregator", "org.apache.beam.sdk.transforms.AppliedPTransform", "org.apache.beam.sdk.transforms.PTransform" ]
import java.util.Collection; import java.util.HashSet; import org.apache.beam.sdk.transforms.Aggregator; import org.apache.beam.sdk.transforms.AppliedPTransform; import org.apache.beam.sdk.transforms.PTransform;
import java.util.*; import org.apache.beam.sdk.transforms.*;
[ "java.util", "org.apache.beam" ]
java.util; org.apache.beam;
374,170
protected void addImpliedArgs(final Vector args, final boolean debug, final boolean multithreaded, final boolean exceptions, final LinkType linkType, final Boolean rtti, final OptimizationEnum optimization) { }
void function(final Vector args, final boolean debug, final boolean multithreaded, final boolean exceptions, final LinkType linkType, final Boolean rtti, final OptimizationEnum optimization) { }
/** * Add arguments for debug, etc. * @param args Vector command argument list * @param debug boolean build for debug if true * @param multithreaded boolean build for multithreading if true * @param exceptions boolean enable exceptions if true * @param linkType LinkType output and runtime type * @param rtti Boolean enable run-time type identification if true * @param optimization OptimizationEnum optimization */
Add arguments for debug, etc
addImpliedArgs
{ "repo_name": "cniweb/ant-contrib", "path": "cpptasks/src/main/java/net/sf/antcontrib/cpptasks/trolltech/UserInterfaceCompiler.java", "license": "apache-2.0", "size": 11615 }
[ "java.util.Vector", "net.sf.antcontrib.cpptasks.OptimizationEnum", "net.sf.antcontrib.cpptasks.compiler.LinkType" ]
import java.util.Vector; import net.sf.antcontrib.cpptasks.OptimizationEnum; import net.sf.antcontrib.cpptasks.compiler.LinkType;
import java.util.*; import net.sf.antcontrib.cpptasks.*; import net.sf.antcontrib.cpptasks.compiler.*;
[ "java.util", "net.sf.antcontrib" ]
java.util; net.sf.antcontrib;
2,061,917
public DTMAxisIterator setStartNode(int node) { if (_isRestartable) { _startNode = node; m_baseIterator.setStartNode(node); resetPosition(); } return this; }
DTMAxisIterator function(int node) { if (_isRestartable) { _startNode = node; m_baseIterator.setStartNode(node); resetPosition(); } return this; }
/** * Set start to END should 'close' the iterator, * i.e. subsequent call to next() should return END. * * @param node Sets the root of the iteration. * * @return A DTMAxisIterator set to the start of the iteration. */
Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END
setStartNode
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java", "license": "apache-2.0", "size": 61260 }
[ "com.sun.org.apache.xml.internal.dtm.DTMAxisIterator" ]
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.*;
[ "com.sun.org" ]
com.sun.org;
111,638