method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public static String generateResetKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); }
static String function() { return RandomStringUtils.randomNumeric(DEF_COUNT); }
/** * Generates a reset key. * * @return the generated reset key */
Generates a reset key
generateResetKey
{ "repo_name": "rootzoll/konfetti-api", "path": "src/main/java/de/konfetti/utils/RandomUtil.java", "license": "gpl-3.0", "size": 1151 }
[ "org.apache.commons.lang3.RandomStringUtils" ]
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
1,919,616
EList<IfcIndexedColourMap> getHasColours();
EList<IfcIndexedColourMap> getHasColours();
/** * Returns the value of the '<em><b>Has Colours</b></em>' reference list. * The list contents are of type {@link org.bimserver.models.ifc4.IfcIndexedColourMap}. * It is bidirectional and its opposite is '{@link org.bimserver.models.ifc4.IfcIndexedColourMap#getMappedTo <em>Mapped To</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Has Colours</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Has Colours</em>' reference list. * @see #isSetHasColours() * @see #unsetHasColours() * @see org.bimserver.models.ifc4.Ifc4Package#getIfcTessellatedFaceSet_HasColours() * @see org.bimserver.models.ifc4.IfcIndexedColourMap#getMappedTo * @model opposite="MappedTo" unsettable="true" upper="2" * annotation="inverse" * @generated */
Returns the value of the 'Has Colours' reference list. The list contents are of type <code>org.bimserver.models.ifc4.IfcIndexedColourMap</code>. It is bidirectional and its opposite is '<code>org.bimserver.models.ifc4.IfcIndexedColourMap#getMappedTo Mapped To</code>'. If the meaning of the 'Has Colours' reference list isn't clear, there really should be more of a description here...
getHasColours
{ "repo_name": "opensourceBIM/BIMserver", "path": "PluginBase/generated/org/bimserver/models/ifc4/IfcTessellatedFaceSet.java", "license": "agpl-3.0", "size": 8469 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,257,031
@Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case mclevflatmcadPackage.MFLAT_MCAD: { MFlatMCAD mFlatMCAD = (MFlatMCAD)theEObject; T result = caseMFlatMCAD(mFlatMCAD); if (result == null) result = caseMMCLEVFLATMCADPackageElement(mFlatMCAD); if (result == null) result = caseMCommonPackageReferencingElement(mFlatMCAD); if (result == null) result = caseMCommonPackageElement(mFlatMCAD); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_MCAD_TARGET: { MFlatMCADTarget mFlatMCADTarget = (MFlatMCADTarget)theEObject; T result = caseMFlatMCADTarget(mFlatMCADTarget); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_SERVICE_LIBRARY_INSTANCE: { MFlatServiceLibraryInstance mFlatServiceLibraryInstance = (MFlatServiceLibraryInstance)theEObject; T result = caseMFlatServiceLibraryInstance(mFlatServiceLibraryInstance); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_DRIVER_SLIB_INSTANCE: { MFlatDriverSLibInstance mFlatDriverSLibInstance = (MFlatDriverSLibInstance)theEObject; T result = caseMFlatDriverSLibInstance(mFlatDriverSLibInstance); if (result == null) result = caseMFlatServiceLibraryInstance(mFlatDriverSLibInstance); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_COMPONENT_INSTANCE: { MFlatComponentInstance mFlatComponentInstance = (MFlatComponentInstance)theEObject; T result = caseMFlatComponentInstance(mFlatComponentInstance); if (result == null) result = caseMCommonReferenceableObj(mFlatComponentInstance); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_CONNECTION: { MFlatConnection mFlatConnection = (MFlatConnection)theEObject; T result = caseMFlatConnection(mFlatConnection); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MMCLEVFLATMCAD_PACKAGE_FILE: { MMCLEVFLATMCADPackageFile mmclevflatmcadPackageFile = (MMCLEVFLATMCADPackageFile)theEObject; T result = caseMMCLEVFLATMCADPackageFile(mmclevflatmcadPackageFile); if (result == null) result = caseMCommonPackageFile(mmclevflatmcadPackageFile); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MMCLEVFLATMCAD_PACKAGE_ELEMENT: { MMCLEVFLATMCADPackageElement mmclevflatmcadPackageElement = (MMCLEVFLATMCADPackageElement)theEObject; T result = caseMMCLEVFLATMCADPackageElement(mmclevflatmcadPackageElement); if (result == null) result = caseMCommonPackageElement(mmclevflatmcadPackageElement); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_DEVICE_DRIVER_MAPPING: { MFlatDeviceDriverMapping mFlatDeviceDriverMapping = (MFlatDeviceDriverMapping)theEObject; T result = caseMFlatDeviceDriverMapping(mFlatDeviceDriverMapping); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } }
T function(int classifierID, EObject theEObject) { switch (classifierID) { case mclevflatmcadPackage.MFLAT_MCAD: { MFlatMCAD mFlatMCAD = (MFlatMCAD)theEObject; T result = caseMFlatMCAD(mFlatMCAD); if (result == null) result = caseMMCLEVFLATMCADPackageElement(mFlatMCAD); if (result == null) result = caseMCommonPackageReferencingElement(mFlatMCAD); if (result == null) result = caseMCommonPackageElement(mFlatMCAD); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_MCAD_TARGET: { MFlatMCADTarget mFlatMCADTarget = (MFlatMCADTarget)theEObject; T result = caseMFlatMCADTarget(mFlatMCADTarget); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_SERVICE_LIBRARY_INSTANCE: { MFlatServiceLibraryInstance mFlatServiceLibraryInstance = (MFlatServiceLibraryInstance)theEObject; T result = caseMFlatServiceLibraryInstance(mFlatServiceLibraryInstance); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_DRIVER_SLIB_INSTANCE: { MFlatDriverSLibInstance mFlatDriverSLibInstance = (MFlatDriverSLibInstance)theEObject; T result = caseMFlatDriverSLibInstance(mFlatDriverSLibInstance); if (result == null) result = caseMFlatServiceLibraryInstance(mFlatDriverSLibInstance); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_COMPONENT_INSTANCE: { MFlatComponentInstance mFlatComponentInstance = (MFlatComponentInstance)theEObject; T result = caseMFlatComponentInstance(mFlatComponentInstance); if (result == null) result = caseMCommonReferenceableObj(mFlatComponentInstance); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_CONNECTION: { MFlatConnection mFlatConnection = (MFlatConnection)theEObject; T result = caseMFlatConnection(mFlatConnection); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MMCLEVFLATMCAD_PACKAGE_FILE: { MMCLEVFLATMCADPackageFile mmclevflatmcadPackageFile = (MMCLEVFLATMCADPackageFile)theEObject; T result = caseMMCLEVFLATMCADPackageFile(mmclevflatmcadPackageFile); if (result == null) result = caseMCommonPackageFile(mmclevflatmcadPackageFile); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MMCLEVFLATMCAD_PACKAGE_ELEMENT: { MMCLEVFLATMCADPackageElement mmclevflatmcadPackageElement = (MMCLEVFLATMCADPackageElement)theEObject; T result = caseMMCLEVFLATMCADPackageElement(mmclevflatmcadPackageElement); if (result == null) result = caseMCommonPackageElement(mmclevflatmcadPackageElement); if (result == null) result = defaultCase(theEObject); return result; } case mclevflatmcadPackage.MFLAT_DEVICE_DRIVER_MAPPING: { MFlatDeviceDriverMapping mFlatDeviceDriverMapping = (MFlatDeviceDriverMapping)theEObject; T result = caseMFlatDeviceDriverMapping(mFlatDeviceDriverMapping); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } }
/** * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */
Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result
doSwitch
{ "repo_name": "parraman/micobs", "path": "mclev/es.uah.aut.srg.micobs.mclev/src/es/uah/aut/srg/micobs/mclev/mclevflatmcad/util/mclevflatmcadSwitch.java", "license": "epl-1.0", "size": 12299 }
[ "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatComponentInstance", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatConnection", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDeviceDriverMapping", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDriverSLibInstance", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatMCAD", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatMCADTarget", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatServiceLibraryInstance", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MMCLEVFLATMCADPackageElement", "es.uah.aut.srg.micobs.mclev.mclevflatmcad.MMCLEVFLATMCADPackageFile", "org.eclipse.emf.ecore.EObject" ]
import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatComponentInstance; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatConnection; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDeviceDriverMapping; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatDriverSLibInstance; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatMCAD; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatMCADTarget; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MFlatServiceLibraryInstance; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MMCLEVFLATMCADPackageElement; import es.uah.aut.srg.micobs.mclev.mclevflatmcad.MMCLEVFLATMCADPackageFile; import org.eclipse.emf.ecore.EObject;
import es.uah.aut.srg.micobs.mclev.mclevflatmcad.*; import org.eclipse.emf.ecore.*;
[ "es.uah.aut", "org.eclipse.emf" ]
es.uah.aut; org.eclipse.emf;
2,628,903
protected void selectSomething() { int sel = choices.getSelectedIndex(); if ( sel != -1 ) { Command cmd = cmds.get( choices.getValue( sel ) ); if ( cmd != null ) { cmd.execute(); ruleModeller.refreshWidget(); } } }
void function() { int sel = choices.getSelectedIndex(); if ( sel != -1 ) { Command cmd = cmds.get( choices.getValue( sel ) ); if ( cmd != null ) { cmd.execute(); ruleModeller.refreshWidget(); } } }
/** * Executed when a selection has been made. Refreshes the underlying * RuleModeller widget */
Executed when a selection has been made. Refreshes the underlying RuleModeller widget
selectSomething
{ "repo_name": "cristianonicolai/drools-wb", "path": "drools-wb-screens/drools-wb-guided-rule-editor/drools-wb-guided-rule-editor-client/src/main/java/org/drools/workbench/screens/guided/rule/client/editor/AbstractRuleModellerSelectorPopup.java", "license": "apache-2.0", "size": 4018 }
[ "com.google.gwt.user.client.Command" ]
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.*;
[ "com.google.gwt" ]
com.google.gwt;
231,190
public void print (double number, int fieldSize, int decimalPlaces) { double posValue = Math.abs (number); int placesRemaining = fieldSize; String format = null, numStr; StringBuffer padding = new StringBuffer (); if (number < 0) placesRemaining--; // Space for the minus sign if (posValue < 10.0) format = "0"; else if (posValue < 100.0) format = "00"; else if (posValue < 1000.0) format = "000"; else if (posValue < 10000.0) format = "0000"; else if (posValue < 100000.0) format = "00000"; else if (posValue < 1000000.0) format = "000000"; else if (posValue < 10000000.0) format = "0000000"; else if (posValue < 100000000.0) format = "00000000"; if (Math.abs (number) >= 100000000.0) { // We're using scientific notation numStr = String.valueOf (number); } else { format = "0."; // For any addition room, add decimal places for (int cnt = 0 ; cnt < decimalPlaces ; cnt++) { format = format + "0"; } // Convert the number NumberFormat form = new DecimalFormat (format); form.setMinimumIntegerDigits (1); numStr = form.format (number); } // If the number is not long enough, pad with spaces for (int cnt = 0 ; cnt < fieldSize - numStr.length () ; cnt++) { padding.append (' '); } print (padding + numStr); } // print (double, int, int)
void function (double number, int fieldSize, int decimalPlaces) { double posValue = Math.abs (number); int placesRemaining = fieldSize; String format = null, numStr; StringBuffer padding = new StringBuffer (); if (number < 0) placesRemaining--; if (posValue < 10.0) format = "0"; else if (posValue < 100.0) format = "00"; else if (posValue < 1000.0) format = "000"; else if (posValue < 10000.0) format = "0000"; else if (posValue < 100000.0) format = "00000"; else if (posValue < 1000000.0) format = STR; else if (posValue < 10000000.0) format = STR; else if (posValue < 100000000.0) format = STR; if (Math.abs (number) >= 100000000.0) { numStr = String.valueOf (number); } else { format = "0."; for (int cnt = 0 ; cnt < decimalPlaces ; cnt++) { format = format + "0"; } NumberFormat form = new DecimalFormat (format); form.setMinimumIntegerDigits (1); numStr = form.format (number); } for (int cnt = 0 ; cnt < fieldSize - numStr.length () ; cnt++) { padding.append (' '); } print (padding + numStr); }
/** * Write a double precision floating point number (a "double") to * the file with a specified field size and a specified number of * decimal places. * * @param number The number to be written to the file. * @param fieldSize The field width that the number is to be written in. * @param decimalPlaces The number of decimal places of the number * to be displayed. */
Write a double precision floating point number (a "double") to the file with a specified field size and a specified number of decimal places
print
{ "repo_name": "salamander2/HSA2", "path": "hsa2/TextOutputFile.java", "license": "gpl-2.0", "size": 22355 }
[ "java.text.DecimalFormat", "java.text.NumberFormat" ]
import java.text.DecimalFormat; import java.text.NumberFormat;
import java.text.*;
[ "java.text" ]
java.text;
1,449,533
private void lillipop_connect(final WifiConfiguration wifiConfig, final int networkId, final long timeoutMsec) { Log.i(TAG, "lillipop_connect SSID=" + wifiConfig.SSID + " within " + timeoutMsec); boolean res; synchronized (this) { targetWifiConfiguration = wifiConfig; }
void function(final WifiConfiguration wifiConfig, final int networkId, final long timeoutMsec) { Log.i(TAG, STR + wifiConfig.SSID + STR + timeoutMsec); boolean res; synchronized (this) { targetWifiConfiguration = wifiConfig; }
/** * Make the actual connection to the requested Wi-Fi target. * * @param wifiConfig * details of the Wi-Fi access point used by the WifiManger * @param networkId * id of the Wi-Fi configuration * @param timeoutMsec * period of time in Msec to complete Wi-Fi connection task */
Make the actual connection to the requested Wi-Fi target
lillipop_connect
{ "repo_name": "octoblu/alljoyn", "path": "alljoyn/services/onboarding/java/OnboardingManager/android/src/org/alljoyn/onboarding/sdk/OnboardingSDKWifiManager.java", "license": "isc", "size": 45776 }
[ "android.net.wifi.WifiConfiguration", "android.util.Log" ]
import android.net.wifi.WifiConfiguration; import android.util.Log;
import android.net.wifi.*; import android.util.*;
[ "android.net", "android.util" ]
android.net; android.util;
2,749,375
protected Category getDefaultCategory() { return Category.XSS; }
Category function() { return Category.XSS; }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getDefaultCategory
{ "repo_name": "RIGS-IT/sonar-xanitizer", "path": "src/test/resources/webgoat/plugin_extracted/trace-xss-1.0/org/owasp/webgoat/plugin/TraceXSS.java", "license": "apache-2.0", "size": 10946 }
[ "org.owasp.webgoat.lessons.Category" ]
import org.owasp.webgoat.lessons.Category;
import org.owasp.webgoat.lessons.*;
[ "org.owasp.webgoat" ]
org.owasp.webgoat;
10,773
ListenerRegistration addChildListener(E parent, ElementListener<E> listener);
ListenerRegistration addChildListener(E parent, ElementListener<E> listener);
/** * Attaches an element listener that listens on children being added to and * removed from the specified parent. The listener will be removed if the * element is deleted. */
Attaches an element listener that listens on children being added to and removed from the specified parent. The listener will be removed if the element is deleted
addChildListener
{ "repo_name": "gburd/wave", "path": "src/org/waveprotocol/wave/model/document/util/DocumentEventRouter.java", "license": "apache-2.0", "size": 2169 }
[ "org.waveprotocol.wave.model.util.ElementListener" ]
import org.waveprotocol.wave.model.util.ElementListener;
import org.waveprotocol.wave.model.util.*;
[ "org.waveprotocol.wave" ]
org.waveprotocol.wave;
1,893,652
public void cdata(@Nonnull final String text) throws TagValidationException, CssValidationException, IOException { // Validate that JSON can be parsed. if (!this.context.getTagStack().hasAncestor("TEMPLATE") && this.context.getTagStack().isScriptTypeJsonChild()) { try { OBJECT_MAPPER.readTree(text); } catch (JsonProcessingException e) { List<String> params = new ArrayList<>(); this.context.addWarning( ValidatorProtos.ValidationError.Code.INVALID_JSON_CDATA, this.context.getLineCol(), params, "", this.validationResult); } } final CdataMatcher matcher = this.context.getTagStack().cdataMatcher(); if (matcher != null) { matcher.match(text, this.context, this.validationResult); } }
void function(@Nonnull final String text) throws TagValidationException, CssValidationException, IOException { if (!this.context.getTagStack().hasAncestor(STR) && this.context.getTagStack().isScriptTypeJsonChild()) { try { OBJECT_MAPPER.readTree(text); } catch (JsonProcessingException e) { List<String> params = new ArrayList<>(); this.context.addWarning( ValidatorProtos.ValidationError.Code.INVALID_JSON_CDATA, this.context.getLineCol(), params, "", this.validationResult); } } final CdataMatcher matcher = this.context.getTagStack().cdataMatcher(); if (matcher != null) { matcher.match(text, this.context, this.validationResult); } }
/** * Callback for cdata. * * @param text the css content to validate * @throws TagValidationException tag validation exception. * @throws CssValidationException css validation exception. * @throws IOException IO exception. */
Callback for cdata
cdata
{ "repo_name": "ampproject/validator-java", "path": "src/main/java/dev/amp/validator/AMPHtmlHandler.java", "license": "apache-2.0", "size": 14647 }
[ "com.fasterxml.jackson.core.JsonProcessingException", "dev.amp.validator.css.CssValidationException", "dev.amp.validator.exception.TagValidationException", "java.io.IOException", "java.util.ArrayList", "java.util.List", "javax.annotation.Nonnull" ]
import com.fasterxml.jackson.core.JsonProcessingException; import dev.amp.validator.css.CssValidationException; import dev.amp.validator.exception.TagValidationException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.annotation.Nonnull;
import com.fasterxml.jackson.core.*; import dev.amp.validator.css.*; import dev.amp.validator.exception.*; import java.io.*; import java.util.*; import javax.annotation.*;
[ "com.fasterxml.jackson", "dev.amp.validator", "java.io", "java.util", "javax.annotation" ]
com.fasterxml.jackson; dev.amp.validator; java.io; java.util; javax.annotation;
1,774,543
public Observable<ServiceResponse<Page<VirtualNetworkTapInner>>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); }
Observable<ServiceResponse<Page<VirtualNetworkTapInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); }
/** * Gets all the VirtualNetworkTaps in a subscription. * ServiceResponse<PageImpl<VirtualNetworkTapInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;VirtualNetworkTapInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Gets all the VirtualNetworkTaps in a subscription
listNextSinglePageAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/implementation/VirtualNetworkTapsInner.java", "license": "mit", "size": 72534 }
[ "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;
373,409
public void syncProtocolFundingSourcesWithSpecialReviews() { String fundingSourceNumber = form.getAwardDocument().getAward().getAwardNumber(); String fundingSourceTypeCode = FundingSourceType.AWARD; String fundingSourceName = form.getAwardDocument().getAward().getSponsorName(); String fundingSourceTitle = form.getAwardDocument().getAward().getTitle(); syncProtocolFundingSourcesWithSpecialReviews(fundingSourceNumber, fundingSourceTypeCode, fundingSourceName, fundingSourceTitle); }
void function() { String fundingSourceNumber = form.getAwardDocument().getAward().getAwardNumber(); String fundingSourceTypeCode = FundingSourceType.AWARD; String fundingSourceName = form.getAwardDocument().getAward().getSponsorName(); String fundingSourceTitle = form.getAwardDocument().getAward().getTitle(); syncProtocolFundingSourcesWithSpecialReviews(fundingSourceNumber, fundingSourceTypeCode, fundingSourceName, fundingSourceTitle); }
/** * Synchronizes the information between this Award's Special Reviews and the corresponding Protocol Funding Sources. */
Synchronizes the information between this Award's Special Reviews and the corresponding Protocol Funding Sources
syncProtocolFundingSourcesWithSpecialReviews
{ "repo_name": "vivantech/kc_fixes", "path": "src/main/java/org/kuali/kra/award/specialreview/SpecialReviewHelper.java", "license": "apache-2.0", "size": 3522 }
[ "org.kuali.kra.bo.FundingSourceType" ]
import org.kuali.kra.bo.FundingSourceType;
import org.kuali.kra.bo.*;
[ "org.kuali.kra" ]
org.kuali.kra;
2,623,368
public boolean validateMySection_validateMySectionTitle(MySection mySection, DiagnosticChain diagnostics, Map<Object, Object> context) { return mySection.validateMySectionTitle(diagnostics, context); }
boolean function(MySection mySection, DiagnosticChain diagnostics, Map<Object, Object> context) { return mySection.validateMySectionTitle(diagnostics, context); }
/** * Validates the validateMySectionTitle constraint of '<em>My Section</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Validates the validateMySectionTitle constraint of 'My Section'.
validateMySection_validateMySectionTitle
{ "repo_name": "drbgfc/mdht", "path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.example/src/org/openhealthtools/mdht/uml/cda/example/util/ExampleValidator.java", "license": "epl-1.0", "size": 29681 }
[ "java.util.Map", "org.eclipse.emf.common.util.DiagnosticChain", "org.openhealthtools.mdht.uml.cda.example.MySection" ]
import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; import org.openhealthtools.mdht.uml.cda.example.MySection;
import java.util.*; import org.eclipse.emf.common.util.*; import org.openhealthtools.mdht.uml.cda.example.*;
[ "java.util", "org.eclipse.emf", "org.openhealthtools.mdht" ]
java.util; org.eclipse.emf; org.openhealthtools.mdht;
2,735,150
private JButton makeButton(String image, String cmd, String tip, String name) { String imageLoc = AbstractMainFrame.SRC_PATH + image + ".png"; JButton button = new JButton(name); button.setActionCommand(cmd); button.setToolTipText(tip); button.addActionListener(this); try { // image found button.setIcon(new ImageIcon(imageLoc, name)); } catch (Exception e) { // no image found } return button; }
JButton function(String image, String cmd, String tip, String name) { String imageLoc = AbstractMainFrame.SRC_PATH + image + ".png"; JButton button = new JButton(name); button.setActionCommand(cmd); button.setToolTipText(tip); button.addActionListener(this); try { button.setIcon(new ImageIcon(imageLoc, name)); } catch (Exception e) { } return button; }
/** * Create a button with system specified parameters. * * @param image the URL of the icon image * @param cmd the command name of the button * @param tip the tool tip text * @param name the name to be displayed * * @return the instance of a tool bar button */
Create a button with system specified parameters
makeButton
{ "repo_name": "halayudha/bearded-octo-bugfixes", "path": "BestPeerDevelop/sg/edu/nus/gui/server/ToolBar.java", "license": "gpl-3.0", "size": 4055 }
[ "javax.swing.ImageIcon", "javax.swing.JButton", "sg.edu.nus.gui.AbstractMainFrame" ]
import javax.swing.ImageIcon; import javax.swing.JButton; import sg.edu.nus.gui.AbstractMainFrame;
import javax.swing.*; import sg.edu.nus.gui.*;
[ "javax.swing", "sg.edu.nus" ]
javax.swing; sg.edu.nus;
1,175,441
@SuppressWarnings("unchecked") @Test(timeout = 5000) public void testDoesNotWaitForPendingRecordsIfFlushingDisabled() throws Throwable { final DummyFlinkKafkaProducer<String> producer = new DummyFlinkKafkaProducer<>( FakeStandardProducerConfig.get(), new KeyedSerializationSchemaWrapper<>(new SimpleStringSchema()), null); producer.setFlushOnCheckpoint(false); final KafkaProducer<?, ?> mockProducer = producer.getMockKafkaProducer(); final OneInputStreamOperatorTestHarness<String, Object> testHarness = new OneInputStreamOperatorTestHarness<>(new StreamSink<>(producer)); testHarness.open(); testHarness.processElement(new StreamRecord<>("msg")); // make sure that all callbacks have not been completed verify(mockProducer, times(1)).send(any(ProducerRecord.class), any(Callback.class)); // should return even if there are pending records testHarness.snapshot(123L, 123L); testHarness.close(); } // ------------------------------------------------------------------------ private static class DummyFlinkKafkaProducer<T> extends FlinkKafkaProducerBase<T> { private static final long serialVersionUID = 1L; private static final String DUMMY_TOPIC = "dummy-topic"; private transient KafkaProducer<?, ?> mockProducer; private transient List<Callback> pendingCallbacks; private transient MultiShotLatch flushLatch; private boolean isFlushed; @SuppressWarnings("unchecked") DummyFlinkKafkaProducer(Properties producerConfig, KeyedSerializationSchema<T> schema, FlinkKafkaPartitioner partitioner) { super(DUMMY_TOPIC, schema, producerConfig, partitioner);
@SuppressWarnings(STR) @Test(timeout = 5000) void function() throws Throwable { final DummyFlinkKafkaProducer<String> producer = new DummyFlinkKafkaProducer<>( FakeStandardProducerConfig.get(), new KeyedSerializationSchemaWrapper<>(new SimpleStringSchema()), null); producer.setFlushOnCheckpoint(false); final KafkaProducer<?, ?> mockProducer = producer.getMockKafkaProducer(); final OneInputStreamOperatorTestHarness<String, Object> testHarness = new OneInputStreamOperatorTestHarness<>(new StreamSink<>(producer)); testHarness.open(); testHarness.processElement(new StreamRecord<>("msg")); verify(mockProducer, times(1)).send(any(ProducerRecord.class), any(Callback.class)); testHarness.snapshot(123L, 123L); testHarness.close(); } private static class DummyFlinkKafkaProducer<T> extends FlinkKafkaProducerBase<T> { private static final long serialVersionUID = 1L; private static final String DUMMY_TOPIC = STR; private transient KafkaProducer<?, ?> mockProducer; private transient List<Callback> pendingCallbacks; private transient MultiShotLatch flushLatch; private boolean isFlushed; @SuppressWarnings(STR) DummyFlinkKafkaProducer(Properties producerConfig, KeyedSerializationSchema<T> schema, FlinkKafkaPartitioner partitioner) { super(DUMMY_TOPIC, schema, producerConfig, partitioner);
/** * This test is meant to assure that testAtLeastOnceProducer is valid by testing that if flushing is disabled, * the snapshot method does indeed finishes without waiting for pending records; * we set a timeout because the test will not finish if the logic is broken. */
This test is meant to assure that testAtLeastOnceProducer is valid by testing that if flushing is disabled, the snapshot method does indeed finishes without waiting for pending records; we set a timeout because the test will not finish if the logic is broken
testDoesNotWaitForPendingRecordsIfFlushingDisabled
{ "repo_name": "greghogan/flink", "path": "flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducerBaseTest.java", "license": "apache-2.0", "size": 16898 }
[ "java.util.List", "java.util.Properties", "org.apache.flink.api.common.serialization.SimpleStringSchema", "org.apache.flink.core.testutils.MultiShotLatch", "org.apache.flink.streaming.api.operators.StreamSink", "org.apache.flink.streaming.connectors.kafka.internals.KeyedSerializationSchemaWrapper", "org.apache.flink.streaming.connectors.kafka.partitioner.FlinkKafkaPartitioner", "org.apache.flink.streaming.connectors.kafka.testutils.FakeStandardProducerConfig", "org.apache.flink.streaming.runtime.streamrecord.StreamRecord", "org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness", "org.apache.flink.streaming.util.serialization.KeyedSerializationSchema", "org.apache.kafka.clients.producer.Callback", "org.apache.kafka.clients.producer.KafkaProducer", "org.apache.kafka.clients.producer.ProducerRecord", "org.junit.Test", "org.mockito.Mockito" ]
import java.util.List; import java.util.Properties; import org.apache.flink.api.common.serialization.SimpleStringSchema; import org.apache.flink.core.testutils.MultiShotLatch; import org.apache.flink.streaming.api.operators.StreamSink; import org.apache.flink.streaming.connectors.kafka.internals.KeyedSerializationSchemaWrapper; import org.apache.flink.streaming.connectors.kafka.partitioner.FlinkKafkaPartitioner; import org.apache.flink.streaming.connectors.kafka.testutils.FakeStandardProducerConfig; import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness; import org.apache.flink.streaming.util.serialization.KeyedSerializationSchema; import org.apache.kafka.clients.producer.Callback; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import org.junit.Test; import org.mockito.Mockito;
import java.util.*; import org.apache.flink.api.common.serialization.*; import org.apache.flink.core.testutils.*; import org.apache.flink.streaming.api.operators.*; import org.apache.flink.streaming.connectors.kafka.internals.*; import org.apache.flink.streaming.connectors.kafka.partitioner.*; import org.apache.flink.streaming.connectors.kafka.testutils.*; import org.apache.flink.streaming.runtime.streamrecord.*; import org.apache.flink.streaming.util.*; import org.apache.flink.streaming.util.serialization.*; import org.apache.kafka.clients.producer.*; import org.junit.*; import org.mockito.*;
[ "java.util", "org.apache.flink", "org.apache.kafka", "org.junit", "org.mockito" ]
java.util; org.apache.flink; org.apache.kafka; org.junit; org.mockito;
2,624,301
@Override ParameterMode getMode(); /** * Controls how unbound values for this IN/INOUT parameter registration will be handled prior to * execution. There are 2 possible options to handle it:<ul> * <li>bind the NULL to the parameter</li> * <li>do not bind the NULL to the parameter</li> * </ul> * <p/> * The reason for the distinction comes from default values defined on the corresponding * database procedure/function argument. Any time a value (including NULL) is bound to the * argument, its default value will not be used. So effectively this setting controls * whether the NULL should be interpreted as "pass the NULL" or as "apply the argument default". * <p/> * The (global) default this setting is defined by {@link org.hibernate.cfg.AvailableSettings#PROCEDURE_NULL_PARAM_PASSING}
ParameterMode getMode(); /** * Controls how unbound values for this IN/INOUT parameter registration will be handled prior to * execution. There are 2 possible options to handle it:<ul> * <li>bind the NULL to the parameter</li> * <li>do not bind the NULL to the parameter</li> * </ul> * <p/> * The reason for the distinction comes from default values defined on the corresponding * database procedure/function argument. Any time a value (including NULL) is bound to the * argument, its default value will not be used. So effectively this setting controls * whether the NULL should be interpreted as STR or as STR. * <p/> * The (global) default this setting is defined by {@link org.hibernate.cfg.AvailableSettings#PROCEDURE_NULL_PARAM_PASSING}
/** * Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure * definition (is it an INPUT parameter? An OUTPUT parameter? etc). * * @return The parameter mode. */
Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure definition (is it an INPUT parameter? An OUTPUT parameter? etc)
getMode
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/hibernate-core/org/hibernate/procedure/ParameterRegistration.java", "license": "gpl-2.0", "size": 3815 }
[ "javax.persistence.ParameterMode" ]
import javax.persistence.ParameterMode;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
89,856
private void logTransactionCommit(String redelivered, String ids) { if ("true".equals(redelivered)) { // okay its a redelivered message so log at INFO level if rollbackLoggingLevel is INFO or higher // this allows people to know that the redelivered message was committed this time if (rollbackLoggingLevel == LoggingLevel.INFO || rollbackLoggingLevel == LoggingLevel.WARN || rollbackLoggingLevel == LoggingLevel.ERROR) { log.info("Transaction commit ({}) redelivered({}) for {})", transactionKey, redelivered, ids); // return after we have logged return; } } // log non redelivered by default at DEBUG level log.debug("Transaction commit ({}) redelivered({}) for {})", transactionKey, redelivered, ids); }
void function(String redelivered, String ids) { if ("true".equals(redelivered)) { if (rollbackLoggingLevel == LoggingLevel.INFO rollbackLoggingLevel == LoggingLevel.WARN rollbackLoggingLevel == LoggingLevel.ERROR) { log.info(STR, transactionKey, redelivered, ids); return; } } log.debug(STR, transactionKey, redelivered, ids); }
/** * Logs the transaction commit */
Logs the transaction commit
logTransactionCommit
{ "repo_name": "kevinearls/camel", "path": "components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandler.java", "license": "apache-2.0", "size": 15816 }
[ "org.apache.camel.LoggingLevel" ]
import org.apache.camel.LoggingLevel;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
1,784,213
int delete( ProgramStageInstance programStageInstance );
int delete( ProgramStageInstance programStageInstance );
/** * Deletes a {@link TrackedEntityDataValue}. * * @param programStageInstance ProgramStageInstance. */
Deletes a <code>TrackedEntityDataValue</code>
delete
{ "repo_name": "troyel/dhis2-core", "path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStore.java", "license": "bsd-3-clause", "size": 4716 }
[ "org.hisp.dhis.program.ProgramStageInstance" ]
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.*;
[ "org.hisp.dhis" ]
org.hisp.dhis;
1,664,987
public List<StampCapacityInner> environmentCapacities() { return this.environmentCapacities; }
List<StampCapacityInner> function() { return this.environmentCapacities; }
/** * Get current total, used, and available worker capacities. * * @return the environmentCapacities value */
Get current total, used, and available worker capacities
environmentCapacities
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/appservice/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/appservice/v2019_08_01/implementation/AppServiceEnvironmentInner.java", "license": "mit", "size": 27475 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
344,969
@Override public String toString() { Objects.ToStringHelper s = Objects.toStringHelper(this); if (initialCapacity != UNSET_INT) { s.add("initialCapacity", initialCapacity); } if (concurrencyLevel != UNSET_INT) { s.add("concurrencyLevel", concurrencyLevel); } if (maximumSize != UNSET_INT) { s.add("maximumSize", maximumSize); } if (maximumWeight != UNSET_INT) { s.add("maximumWeight", maximumWeight); } if (expireAfterWriteNanos != UNSET_INT) { s.add("expireAfterWrite", expireAfterWriteNanos + "ns"); } if (expireAfterAccessNanos != UNSET_INT) { s.add("expireAfterAccess", expireAfterAccessNanos + "ns"); } if (keyStrength != null) { s.add("keyStrength", Ascii.toLowerCase(keyStrength.toString())); } if (valueStrength != null) { s.add("valueStrength", Ascii.toLowerCase(valueStrength.toString())); } if (keyEquivalence != null) { s.addValue("keyEquivalence"); } if (valueEquivalence != null) { s.addValue("valueEquivalence"); } if (removalListener != null) { s.addValue("removalListener"); } return s.toString(); }
String function() { Objects.ToStringHelper s = Objects.toStringHelper(this); if (initialCapacity != UNSET_INT) { s.add(STR, initialCapacity); } if (concurrencyLevel != UNSET_INT) { s.add(STR, concurrencyLevel); } if (maximumSize != UNSET_INT) { s.add(STR, maximumSize); } if (maximumWeight != UNSET_INT) { s.add(STR, maximumWeight); } if (expireAfterWriteNanos != UNSET_INT) { s.add(STR, expireAfterWriteNanos + "ns"); } if (expireAfterAccessNanos != UNSET_INT) { s.add(STR, expireAfterAccessNanos + "ns"); } if (keyStrength != null) { s.add(STR, Ascii.toLowerCase(keyStrength.toString())); } if (valueStrength != null) { s.add(STR, Ascii.toLowerCase(valueStrength.toString())); } if (keyEquivalence != null) { s.addValue(STR); } if (valueEquivalence != null) { s.addValue(STR); } if (removalListener != null) { s.addValue(STR); } return s.toString(); }
/** * Returns a string representation for this CacheBuilder instance. The exact form of the returned * string is not specified. */
Returns a string representation for this CacheBuilder instance. The exact form of the returned string is not specified
toString
{ "repo_name": "eoneil1942/voltdb-4.7fix", "path": "third_party/java/src/com/google_voltpatches/common/cache/CacheBuilder.java", "license": "agpl-3.0", "size": 38141 }
[ "com.google_voltpatches.common.base.Ascii", "com.google_voltpatches.common.base.Objects" ]
import com.google_voltpatches.common.base.Ascii; import com.google_voltpatches.common.base.Objects;
import com.google_voltpatches.common.base.*;
[ "com.google_voltpatches.common" ]
com.google_voltpatches.common;
2,838,435
public ResourceNameAvailabilityInner checkNameAvailability(String name, CheckNameResourceTypes type, Boolean isFqdn) { return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).toBlocking().single().body(); }
ResourceNameAvailabilityInner function(String name, CheckNameResourceTypes type, Boolean isFqdn) { return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).toBlocking().single().body(); }
/** * Check if a resource name is available. * Check if a resource name is available. * * @param name Resource name to verify. * @param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment' * @param isFqdn Is fully qualified domain name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResourceNameAvailabilityInner object if successful. */
Check if a resource name is available. Check if a resource name is available
checkNameAvailability
{ "repo_name": "martinsawicki/azure-sdk-for-java", "path": "azure-mgmt-appservice/src/main/java/com/microsoft/azure/management/appservice/implementation/WebSiteManagementClientImpl.java", "license": "mit", "size": 101428 }
[ "com.microsoft.azure.management.appservice.CheckNameResourceTypes" ]
import com.microsoft.azure.management.appservice.CheckNameResourceTypes;
import com.microsoft.azure.management.appservice.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
535,932
public void processPacket(INetHandlerPlayClient handler) { handler.handleUseBed(this); }
void function(INetHandlerPlayClient handler) { handler.handleUseBed(this); }
/** * Passes this Packet on to the NetHandler for processing. */
Passes this Packet on to the NetHandler for processing
processPacket
{ "repo_name": "TorchPowered/CraftBloom", "path": "src/net/minecraft/network/play/server/S0APacketUseBed.java", "license": "mit", "size": 1354 }
[ "net.minecraft.network.play.INetHandlerPlayClient" ]
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.network.play.*;
[ "net.minecraft.network" ]
net.minecraft.network;
1,996,422
private static void checkArguments(final Object parent) { Preconditions.checkNotNull(parent, "IE01920: Parent argument can not be null"); }
static void function(final Object parent) { Preconditions.checkNotNull(parent, STR); }
/** * Checks whether the arguments are null and throws an exception if they are null. * * @param parent Parent window used for dialogs. */
Checks whether the arguments are null and throws an exception if they are null
checkArguments
{ "repo_name": "juneJuly/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Gui/MainWindow/ProjectTree/Actions/CSearchAction.java", "license": "apache-2.0", "size": 3487 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,350,499
private static boolean resolveAndArchiveFile(Path archiveDir, File currentFile, String archiveStartTime) throws IOException { // build path as it should be in the archive String filename = currentFile.getName(); Path archiveFile = new Path(archiveDir, filename); FileSystem fs = currentFile.getFileSystem(); // if the file already exists in the archive, move that one to a timestamped backup. This is a // really, really unlikely situtation, where we get the same name for the existing file, but // is included just for that 1 in trillion chance. if (fs.exists(archiveFile)) { if (LOG.isDebugEnabled()) { LOG.debug("File:" + archiveFile + " already exists in archive, moving to " + "timestamped backup and overwriting current."); } // move the archive file to the stamped backup Path backedupArchiveFile = new Path(archiveDir, filename + SEPARATOR + archiveStartTime); if (!fs.rename(archiveFile, backedupArchiveFile)) { LOG.error("Could not rename archive file to backup: " + backedupArchiveFile + ", deleting existing file in favor of newer."); // try to delete the exisiting file, if we can't rename it if (!fs.delete(archiveFile, false)) { throw new IOException("Couldn't delete existing archive file (" + archiveFile + ") or rename it to the backup file (" + backedupArchiveFile + ") to make room for similarly named file."); } } LOG.debug("Backed up archive file from " + archiveFile); } if (LOG.isTraceEnabled()) { LOG.trace("No existing file in archive for: " + archiveFile + ", free to archive original file."); } // at this point, we should have a free spot for the archive file boolean success = false; for (int i = 0; !success && i < DEFAULT_RETRIES_NUMBER; ++i) { if (i > 0) { // Ensure that the archive directory exists. // The previous "move to archive" operation has failed probably because // the cleaner has removed our archive directory (HBASE-7643). // (we're in a retry loop, so don't worry too much about the exception) try { if (!fs.exists(archiveDir)) { if (fs.mkdirs(archiveDir)) { LOG.debug("Created archive directory:" + archiveDir); } } } catch (IOException e) { LOG.warn("Failed to create directory: " + archiveDir, e); } } try { success = currentFile.moveAndClose(archiveFile); } catch (IOException e) { LOG.warn("Failed to archive " + currentFile + " on try #" + i, e); success = false; } } if (!success) { LOG.error("Failed to archive " + currentFile); return false; } if (LOG.isDebugEnabled()) { LOG.debug("Finished archiving from " + currentFile + ", to " + archiveFile); } return true; }
static boolean function(Path archiveDir, File currentFile, String archiveStartTime) throws IOException { String filename = currentFile.getName(); Path archiveFile = new Path(archiveDir, filename); FileSystem fs = currentFile.getFileSystem(); if (fs.exists(archiveFile)) { if (LOG.isDebugEnabled()) { LOG.debug("File:" + archiveFile + STR + STR); } Path backedupArchiveFile = new Path(archiveDir, filename + SEPARATOR + archiveStartTime); if (!fs.rename(archiveFile, backedupArchiveFile)) { LOG.error(STR + backedupArchiveFile + STR); if (!fs.delete(archiveFile, false)) { throw new IOException(STR + archiveFile + STR + backedupArchiveFile + STR); } } LOG.debug(STR + archiveFile); } if (LOG.isTraceEnabled()) { LOG.trace(STR + archiveFile + STR); } boolean success = false; for (int i = 0; !success && i < DEFAULT_RETRIES_NUMBER; ++i) { if (i > 0) { try { if (!fs.exists(archiveDir)) { if (fs.mkdirs(archiveDir)) { LOG.debug(STR + archiveDir); } } } catch (IOException e) { LOG.warn(STR + archiveDir, e); } } try { success = currentFile.moveAndClose(archiveFile); } catch (IOException e) { LOG.warn(STR + currentFile + STR + i, e); success = false; } } if (!success) { LOG.error(STR + currentFile); return false; } if (LOG.isDebugEnabled()) { LOG.debug(STR + currentFile + STR + archiveFile); } return true; }
/** * Attempt to archive the passed in file to the archive directory. * <p> * If the same file already exists in the archive, it is moved to a timestamped directory under * the archive directory and the new file is put in its place. * @param archiveDir {@link Path} to the directory that stores the archives of the hfiles * @param currentFile {@link Path} to the original HFile that will be archived * @param archiveStartTime time the archiving started, to resolve naming conflicts * @return <tt>true</tt> if the file is successfully archived. <tt>false</tt> if there was a * problem, but the operation still completed. * @throws IOException on failure to complete {@link FileSystem} operations. */
Attempt to archive the passed in file to the archive directory. If the same file already exists in the archive, it is moved to a timestamped directory under the archive directory and the new file is put in its place
resolveAndArchiveFile
{ "repo_name": "Guavus/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java", "license": "apache-2.0", "size": 26785 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
598,443
public Location getLocation() { return location; }
Location function() { return location; }
/** * Returns the current location * * @return */
Returns the current location
getLocation
{ "repo_name": "CMPUT301F17T01/Bronzify", "path": "app/src/main/java/cmput301f17t01/bronzify/models/User.java", "license": "mit", "size": 8368 }
[ "android.location.Location" ]
import android.location.Location;
import android.location.*;
[ "android.location" ]
android.location;
445,954
@Override public ErrorPage findErrorPage(int errorCode) { if (errorCode == 200) { return (okErrorPage); } else { return (statusPages.get(Integer.valueOf(errorCode))); } }
ErrorPage function(int errorCode) { if (errorCode == 200) { return (okErrorPage); } else { return (statusPages.get(Integer.valueOf(errorCode))); } }
/** * Return the error page entry for the specified HTTP error code, * if any; otherwise return <code>null</code>. * * @param errorCode Error code to look up */
Return the error page entry for the specified HTTP error code, if any; otherwise return <code>null</code>
findErrorPage
{ "repo_name": "xiaolds/tomcat7", "path": "java/org/apache/catalina/core/StandardContext.java", "license": "apache-2.0", "size": 218176 }
[ "org.apache.catalina.deploy.ErrorPage" ]
import org.apache.catalina.deploy.ErrorPage;
import org.apache.catalina.deploy.*;
[ "org.apache.catalina" ]
org.apache.catalina;
2,064,427
@Test(expected = ParseException.class) public void testBodyNegative03() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = "constrainttypes/bodyNegative03.ocl"; modelFileName = "testmodel.uml"; testPerformer = TestPerformer.getInstance( AllConstraintTypeTests.META_MODEL_ID, AllConstraintTypeTests.MODEL_BUNDLE, AllConstraintTypeTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); testPerformer.parseFile(oclFileName); }
@Test(expected = ParseException.class) void function() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = STR; modelFileName = STR; testPerformer = TestPerformer.getInstance( AllConstraintTypeTests.META_MODEL_ID, AllConstraintTypeTests.MODEL_BUNDLE, AllConstraintTypeTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); testPerformer.parseFile(oclFileName); }
/** * <p> * A test case to parse a body expression that should not be parsed * appropriately. * </p> */
A test case to parse a body expression that should not be parsed appropriately.
testBodyNegative03
{ "repo_name": "dresden-ocl/dresdenocl", "path": "tests/org.dresdenocl.ocl2parser.test/src/org/dresdenocl/ocl2parser/test/constrainttypes/TestBody.java", "license": "lgpl-3.0", "size": 4730 }
[ "org.dresdenocl.ocl2parser.test.TestPerformer", "org.dresdenocl.parser.ParseException", "org.junit.Test" ]
import org.dresdenocl.ocl2parser.test.TestPerformer; import org.dresdenocl.parser.ParseException; import org.junit.Test;
import org.dresdenocl.ocl2parser.test.*; import org.dresdenocl.parser.*; import org.junit.*;
[ "org.dresdenocl.ocl2parser", "org.dresdenocl.parser", "org.junit" ]
org.dresdenocl.ocl2parser; org.dresdenocl.parser; org.junit;
339,335
public long getStorageQueuedWriteTaskCount(StorageData storageData) { try { StorageData local = getLocalStorageDataObject(storageData); if (!isStorageOpen(local)) { return 0; } StorageWriter storageWriter = openedStoragesMap.get(local); if (null == storageWriter) { return 0; } else { return storageWriter.getQueuedTaskCount(); } } catch (BusinessException e) { return 0; } } /** * {@inheritDoc}
long function(StorageData storageData) { try { StorageData local = getLocalStorageDataObject(storageData); if (!isStorageOpen(local)) { return 0; } StorageWriter storageWriter = openedStoragesMap.get(local); if (null == storageWriter) { return 0; } else { return storageWriter.getQueuedTaskCount(); } } catch (BusinessException e) { return 0; } } /** * {@inheritDoc}
/** * Returns the amount of writing tasks storage still has to process. Note that this is an * approximate number. * * @param storageData * Storage data to get information for. * @return Returns number of queued tasks. Note that if the storage is not in writable mode * <code>0</code> will be returned. */
Returns the amount of writing tasks storage still has to process. Note that this is an approximate number
getStorageQueuedWriteTaskCount
{ "repo_name": "inspectIT/inspectIT", "path": "inspectit.server/src/main/java/rocks/inspectit/server/storage/CmrStorageManager.java", "license": "agpl-3.0", "size": 42931 }
[ "rocks.inspectit.shared.all.exception.BusinessException", "rocks.inspectit.shared.cs.storage.StorageData", "rocks.inspectit.shared.cs.storage.StorageWriter" ]
import rocks.inspectit.shared.all.exception.BusinessException; import rocks.inspectit.shared.cs.storage.StorageData; import rocks.inspectit.shared.cs.storage.StorageWriter;
import rocks.inspectit.shared.all.exception.*; import rocks.inspectit.shared.cs.storage.*;
[ "rocks.inspectit.shared" ]
rocks.inspectit.shared;
2,488,559
private boolean setArcsUp(HashSet<Arc> arcs) throws NullAggContextException, AggEdgeConstructionException { if (arcs != null && !arcs.isEmpty()) { for (Arc arc : arcs) { switch (arc.getType().getName()) { case "Transition": addAnAggEdge(new Transition(IOHelper.getRandomString(), arc, this)); break; default: throw new InconsistentEdgeTypeException(); } } return true; } return false; }
boolean function(HashSet<Arc> arcs) throws NullAggContextException, AggEdgeConstructionException { if (arcs != null && !arcs.isEmpty()) { for (Arc arc : arcs) { switch (arc.getType().getName()) { case STR: addAnAggEdge(new Transition(IOHelper.getRandomString(), arc, this)); break; default: throw new InconsistentEdgeTypeException(); } } return true; } return false; }
/** * Sets up the transitions of this DTMC model from a hash set of agg arcs; * It'll only be called when the nodes were set up ok * * @param arcs the underlying agg graph arcs * @return true if everything ran fine and when there were arcs to setup; false otherwise * @throws NullAggContextException should never happen * @throws AggEdgeConstructionException when something wrong happens while setting up an transition from an arc */
Sets up the transitions of this DTMC model from a hash set of agg arcs; It'll only be called when the nodes were set up ok
setArcsUp
{ "repo_name": "abiliooliveira/UnB-DALi", "path": "src/main/java/br/unb/dali/models/agg/markovchains/DTMC.java", "license": "mit", "size": 8531 }
[ "br.unb.dali.models.agg.exceptions.AggEdgeConstructionException", "br.unb.dali.models.agg.exceptions.InconsistentEdgeTypeException", "br.unb.dali.models.agg.exceptions.NullAggContextException", "br.unb.dali.models.agg.markovchains.dtmc.transitions.Transition", "br.unb.dali.util.io.IOHelper", "java.util.HashSet" ]
import br.unb.dali.models.agg.exceptions.AggEdgeConstructionException; import br.unb.dali.models.agg.exceptions.InconsistentEdgeTypeException; import br.unb.dali.models.agg.exceptions.NullAggContextException; import br.unb.dali.models.agg.markovchains.dtmc.transitions.Transition; import br.unb.dali.util.io.IOHelper; import java.util.HashSet;
import br.unb.dali.models.agg.exceptions.*; import br.unb.dali.models.agg.markovchains.dtmc.transitions.*; import br.unb.dali.util.io.*; import java.util.*;
[ "br.unb.dali", "java.util" ]
br.unb.dali; java.util;
1,793,938
@Nullable Match find(Binary haystack, long startPosition, SearchParams params);
Match find(Binary haystack, long startPosition, SearchParams params);
/** * Searches the binary. * * @param haystack the binary being searched. * @param startPosition the position to start searching from. * @param params the search parameters. * @return the found position, or {@code null} if there is no match. */
Searches the binary
find
{ "repo_name": "trejkaz/hex", "path": "main/src/main/java/org/trypticon/hex/gui/find/Searcher.java", "license": "gpl-3.0", "size": 1334 }
[ "org.trypticon.hex.binary.Binary" ]
import org.trypticon.hex.binary.Binary;
import org.trypticon.hex.binary.*;
[ "org.trypticon.hex" ]
org.trypticon.hex;
2,037,757
private void txtaDescriptionFocusGained(final java.awt.event.FocusEvent evt) { //GEN-FIRST:event_txtaDescriptionFocusGained NbBundle.setBranding(branding); provideInformation(org.openide.util.NbBundle.getMessage( BasicPropertiesPanel.class, "BasicPropertiesPanel.txtaDescriptionFocusGained().info")); NbBundle.setBranding(null); } //GEN-LAST:event_txtaDescriptionFocusGained
void function(final java.awt.event.FocusEvent evt) { NbBundle.setBranding(branding); provideInformation(org.openide.util.NbBundle.getMessage( BasicPropertiesPanel.class, STR)); NbBundle.setBranding(null); }
/** * DOCUMENT ME! * * @param evt DOCUMENT ME! */
DOCUMENT ME
txtaDescriptionFocusGained
{ "repo_name": "switchonproject/cids-custom-switchon", "path": "src/main/java/de/cismet/cids/custom/switchon/objecteditors/BasicPropertiesPanel.java", "license": "lgpl-3.0", "size": 19772 }
[ "org.openide.util.NbBundle" ]
import org.openide.util.NbBundle;
import org.openide.util.*;
[ "org.openide.util" ]
org.openide.util;
2,543,539
public Scriptable getPeople(String filter, int maxResults) { Object[] people = null; if (filter == null || filter.length() == 0) { people = personService.getAllPeople().toArray(); if (maxResults > 0 && people.length > maxResults) { Object[] dest = new Object[maxResults]; System.arraycopy(people, 0, dest, 0, maxResults); people = dest; } } else { filter = filter.trim(); if (filter.length() != 0) { SearchParameters params = new SearchParameters(); // define the query to find people by their first or last name StringBuilder query = new StringBuilder(256); query.append("TYPE:\"").append(ContentModel.TYPE_PERSON).append("\" AND ("); String term = filter.replace("\\", "").replace("\"", ""); StringTokenizer t = new StringTokenizer(term, " "); if (t.countTokens() == 1) { int propIndex = term.indexOf(':'); if (propIndex == -1) { // simple search: first name, last name, username starting with term, or username ending with "-term" query.append("firstName:\""); query.append(term); query.append("*\" lastName:\""); query.append(term); query.append("*\" userName:\""); query.append(term); query.append("*\" userName:\"*-"); query.append(term); query.append("*\""); } else { // fts-alfresco property search i.e. location:"maidenhead" query.append(term.substring(0, propIndex+1)) .append('"') .append(term.substring(propIndex+1)) .append('"'); } } else { // scan for non-fts-alfresco property search tokens int nonFtsTokens = 0; while (t.hasMoreTokens()) { if (t.nextToken().indexOf(':') == -1) nonFtsTokens++; } t = new StringTokenizer(term, " "); // multiple terms supplied - look for first and second name etc. // assume first term is first name, any more are second i.e. "Fraun van de Wiels" // also allow fts-alfresco property search to reduce results params.setDefaultOperator(SearchParameters.Operator.AND); boolean firstToken = true; boolean tokenSurname = false; boolean propertySearch = false; while (t.hasMoreTokens()) { term = t.nextToken(); if (!propertySearch && term.indexOf(':') == -1) { if (nonFtsTokens == 1) { // simple search: first name, last name, username starting with term and username ending with "-term" query.append("(firstName:\""); query.append(term); query.append("*\" OR lastName:\""); query.append(term); query.append("*\" OR userName:\""); query.append(term); query.append("*\" OR userName:\"*-"); query.append(term); query.append("*\") "); } else { if (firstToken) { query.append("firstName:\""); query.append(term); query.append("*\" "); firstToken = false; } else { if (tokenSurname) { query.append("OR "); } query.append("lastName:\""); query.append(term); query.append("*\" "); tokenSurname = true; } } } else { // fts-alfresco property search i.e. "location:maidenhead" int propIndex = term.indexOf(':'); query.append(term.substring(0, propIndex+1)) .append('"') .append(term.substring(propIndex+1)) .append('"'); propertySearch = true; } } } query.append(")"); // define the search parameters params.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO); params.addStore(this.storeRef); params.setQuery(query.toString()); if (maxResults > 0) { params.setLimitBy(LimitBy.FINAL_SIZE); params.setLimit(maxResults); } ResultSet results = null; try { results = services.getSearchService().query(params); people = results.getNodeRefs().toArray(); } catch (Throwable err) { // hide query parse error from users if (logger.isDebugEnabled()) logger.debug("Failed to execute people search: " + query.toString(), err); } finally { if (results != null) { results.close(); } } } } if (people == null) { people = new Object[0]; } return Context.getCurrentContext().newArray(getScope(), people); }
Scriptable function(String filter, int maxResults) { Object[] people = null; if (filter == null filter.length() == 0) { people = personService.getAllPeople().toArray(); if (maxResults > 0 && people.length > maxResults) { Object[] dest = new Object[maxResults]; System.arraycopy(people, 0, dest, 0, maxResults); people = dest; } } else { filter = filter.trim(); if (filter.length() != 0) { SearchParameters params = new SearchParameters(); StringBuilder query = new StringBuilder(256); query.append(STRSTR\STR); String term = filter.replace("\\", STR\STRSTR STRfirstName:\STR*\" lastName:\STR*\" userName:\STR*\STR*-STR*\STR') .append(term.substring(propIndex+1)) .append('STR STR(firstName:\STR*\" OR lastName:\STR*\" OR userName:\STR*\STR*-STR*\STR); } else { if (firstToken) { query.append("firstName:\STR*\" "); firstToken = false; } else { if (tokenSurname) { query.append(STR); } query.append("lastName:\STR*\" "); tokenSurname = true; } } } else { int propIndex = term.indexOf(':'); query.append(term.substring(0, propIndex+1)) .append('STR'); propertySearch = true; } } } query.append(")"); params.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO); params.addStore(this.storeRef); params.setQuery(query.toString()); if (maxResults > 0) { params.setLimitBy(LimitBy.FINAL_SIZE); params.setLimit(maxResults); } ResultSet results = null; try { results = services.getSearchService().query(params); people = results.getNodeRefs().toArray(); } catch (Throwable err) { if (logger.isDebugEnabled()) logger.debug(STR + query.toString(), err); } finally { if (results != null) { results.close(); } } } } if (people == null) { people = new Object[0]; } return Context.getCurrentContext().newArray(getScope(), people); }
/** * Get the collection of people stored in the repository. * An optional filter query may be provided by which to filter the people collection. * Space separate the query terms i.e. "john bob" will find all users who's first or * second names contain the strings "john" or "bob". * * @param filter filter query string by which to filter the collection of people. * If <pre>null</pre> then all people stored in the repository are returned * @param maxResults maximum results to return or all if <= 0 * * @return people collection as a JavaScript array */
Get the collection of people stored in the repository. An optional filter query may be provided by which to filter the people collection. Space separate the query terms i.e. "john bob" will find all users who's first or second names contain the strings "john" or "bob"
getPeople
{ "repo_name": "surevine/alfresco-repository-client-customisations", "path": "source/java/com/surevine/alfresco/repo/jscript/People.java", "license": "gpl-2.0", "size": 36669 }
[ "org.alfresco.service.cmr.search.LimitBy", "org.alfresco.service.cmr.search.ResultSet", "org.alfresco.service.cmr.search.SearchParameters", "org.alfresco.service.cmr.search.SearchService", "org.mozilla.javascript.Context", "org.mozilla.javascript.Scriptable" ]
import org.alfresco.service.cmr.search.LimitBy; import org.alfresco.service.cmr.search.ResultSet; import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchService; import org.mozilla.javascript.Context; import org.mozilla.javascript.Scriptable;
import org.alfresco.service.cmr.search.*; import org.mozilla.javascript.*;
[ "org.alfresco.service", "org.mozilla.javascript" ]
org.alfresco.service; org.mozilla.javascript;
2,385,698
public synchronized static IngestManager getInstance() { if (instance == null) { instance = new IngestManager(); instance.subscribeToCaseEvents(); } return instance; } private IngestManager() { this.ingestModuleRunTimes = new ConcurrentHashMap<>(); this.ingestThreadActivitySnapshots = new ConcurrentHashMap<>(); this.ingestErrorMessagePosts = new AtomicLong(0L); this.ingestMonitor = new IngestMonitor(); this.eventPublishingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("IM-ingest-events-%d").build()); //NON-NLS this.jobEventPublisher = new AutopsyEventPublisher(); this.moduleEventPublisher = new AutopsyEventPublisher(); this.dataSourceIngestThreadPool = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("IM-data-source-ingest-%d").build()); //NON-NLS this.startIngestJobsThreadPool = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("IM-start-ingest-jobs-%d").build()); //NON-NLS this.nextThreadId = new AtomicLong(0L); this.jobsById = new ConcurrentHashMap<>(); this.ingestJobStarters = new ConcurrentHashMap<>(); this.servicesMonitor = ServicesMonitor.getInstance(); subscribeToServiceMonitorEvents(); this.startDataSourceIngestThread(); numberOfFileIngestThreads = UserPreferences.numberOfFileIngestThreads(); if ((numberOfFileIngestThreads < MIN_NUMBER_OF_FILE_INGEST_THREADS) || (numberOfFileIngestThreads > MAX_NUMBER_OF_FILE_INGEST_THREADS)) { numberOfFileIngestThreads = DEFAULT_NUMBER_OF_FILE_INGEST_THREADS; UserPreferences.setNumberOfFileIngestThreads(numberOfFileIngestThreads); } fileIngestThreadPool = Executors.newFixedThreadPool(numberOfFileIngestThreads, new ThreadFactoryBuilder().setNameFormat("IM-file-ingest-%d").build()); //NON-NLS for (int i = 0; i < numberOfFileIngestThreads; ++i) { startFileIngestThread(); } }
synchronized static IngestManager function() { if (instance == null) { instance = new IngestManager(); instance.subscribeToCaseEvents(); } return instance; } private IngestManager() { this.ingestModuleRunTimes = new ConcurrentHashMap<>(); this.ingestThreadActivitySnapshots = new ConcurrentHashMap<>(); this.ingestErrorMessagePosts = new AtomicLong(0L); this.ingestMonitor = new IngestMonitor(); this.eventPublishingExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(STR).build()); this.jobEventPublisher = new AutopsyEventPublisher(); this.moduleEventPublisher = new AutopsyEventPublisher(); this.dataSourceIngestThreadPool = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(STR).build()); this.startIngestJobsThreadPool = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(STR).build()); this.nextThreadId = new AtomicLong(0L); this.jobsById = new ConcurrentHashMap<>(); this.ingestJobStarters = new ConcurrentHashMap<>(); this.servicesMonitor = ServicesMonitor.getInstance(); subscribeToServiceMonitorEvents(); this.startDataSourceIngestThread(); numberOfFileIngestThreads = UserPreferences.numberOfFileIngestThreads(); if ((numberOfFileIngestThreads < MIN_NUMBER_OF_FILE_INGEST_THREADS) (numberOfFileIngestThreads > MAX_NUMBER_OF_FILE_INGEST_THREADS)) { numberOfFileIngestThreads = DEFAULT_NUMBER_OF_FILE_INGEST_THREADS; UserPreferences.setNumberOfFileIngestThreads(numberOfFileIngestThreads); } fileIngestThreadPool = Executors.newFixedThreadPool(numberOfFileIngestThreads, new ThreadFactoryBuilder().setNameFormat(STR).build()); for (int i = 0; i < numberOfFileIngestThreads; ++i) { startFileIngestThread(); } }
/** * Gets the manager of the creation and execution of ingest jobs, i.e., the * processing of data sources by ingest modules. * * @return A singleton ingest manager object. */
Gets the manager of the creation and execution of ingest jobs, i.e., the processing of data sources by ingest modules
getInstance
{ "repo_name": "mhmdfy/autopsy", "path": "Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java", "license": "apache-2.0", "size": 45441 }
[ "com.google.common.util.concurrent.ThreadFactoryBuilder", "java.util.concurrent.ConcurrentHashMap", "java.util.concurrent.Executors", "java.util.concurrent.atomic.AtomicLong", "org.sleuthkit.autopsy.core.ServicesMonitor", "org.sleuthkit.autopsy.core.UserPreferences", "org.sleuthkit.autopsy.events.AutopsyEventPublisher" ]
import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicLong; import org.sleuthkit.autopsy.core.ServicesMonitor; import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.events.AutopsyEventPublisher;
import com.google.common.util.concurrent.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.sleuthkit.autopsy.core.*; import org.sleuthkit.autopsy.events.*;
[ "com.google.common", "java.util", "org.sleuthkit.autopsy" ]
com.google.common; java.util; org.sleuthkit.autopsy;
2,671,821
public static boolean updateMeterstand(Meterstanden m){ Session session = HibernateUtil.getSessionFactory().openSession(); try { Meterstanden mOld = session.get(Meterstanden.class, m.getId()); Meterstanden mNieuw = new Meterstanden(); mNieuw.copyFrom(m); deleteMeterstand(mOld.getId()); persistMeterstand(mNieuw); } catch(Exception e){ log.error("Could not update meterstand, got error: " + e.toString()); return false; } finally { session.close(); } return true; }
static boolean function(Meterstanden m){ Session session = HibernateUtil.getSessionFactory().openSession(); try { Meterstanden mOld = session.get(Meterstanden.class, m.getId()); Meterstanden mNieuw = new Meterstanden(); mNieuw.copyFrom(m); deleteMeterstand(mOld.getId()); persistMeterstand(mNieuw); } catch(Exception e){ log.error(STR + e.toString()); return false; } finally { session.close(); } return true; }
/** * Update the meterstand with this one * * @param m the meterstand to be updated * @return true if succes */
Update the meterstand with this one
updateMeterstand
{ "repo_name": "borrob/Meterstanden", "path": "src/main/java/meterstanden/hibernate/HibernateUtil.java", "license": "mit", "size": 7862 }
[ "org.hibernate.Session" ]
import org.hibernate.Session;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
236,279
public void pushCurrentPlace(Place targetPlace);
void function(Place targetPlace);
/** * This method can be used to change the URL in the browser without reloading the page. * * @param currentPlace */
This method can be used to change the URL in the browser without reloading the page
pushCurrentPlace
{ "repo_name": "Sage-Bionetworks/SynapseWebClient", "path": "src/main/java/org/sagebionetworks/web/client/GlobalApplicationState.java", "license": "apache-2.0", "size": 3121 }
[ "com.google.gwt.place.shared.Place" ]
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.*;
[ "com.google.gwt" ]
com.google.gwt;
1,059,676
protected void clearReferences() { // De-register any remaining JDBC drivers clearReferencesJdbc(); // Stop any threads the web application started clearReferencesThreads(); // Check for leaks triggered by ThreadLocals loaded by this class loader checkThreadLocalsForLeaks(); // Clear RMI Targets loaded by this class loader clearReferencesRmiTargets(); // Null out any static or final fields from loaded classes, // as a workaround for apparent garbage collection bugs if (clearReferencesStatic) { clearReferencesStaticFinal(); } // Clear the IntrospectionUtils cache. IntrospectionUtils.clear(); // Clear the classloader reference in common-logging if (clearReferencesLogFactoryRelease) { org.apache.juli.logging.LogFactory.release(this); } // Clear the resource bundle cache // This shouldn't be necessary, the cache uses weak references but // it has caused leaks. Oddly, using the leak detection code in // standard host allows the class loader to be GC'd. This has been seen // on Sun but not IBM JREs. Maybe a bug in Sun's GC impl? clearReferencesResourceBundles(); // Clear the classloader reference in the VM's bean introspector java.beans.Introspector.flushCaches(); }
void function() { clearReferencesJdbc(); clearReferencesThreads(); checkThreadLocalsForLeaks(); clearReferencesRmiTargets(); if (clearReferencesStatic) { clearReferencesStaticFinal(); } IntrospectionUtils.clear(); if (clearReferencesLogFactoryRelease) { org.apache.juli.logging.LogFactory.release(this); } clearReferencesResourceBundles(); java.beans.Introspector.flushCaches(); }
/** * Clear references. */
Clear references
clearReferences
{ "repo_name": "wenzhucjy/tomcat_source", "path": "tomcat-7.0.63-sourcecode/target/classes/org/apache/catalina/loader/WebappClassLoader.java", "license": "apache-2.0", "size": 125620 }
[ "org.apache.tomcat.util.IntrospectionUtils" ]
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.*;
[ "org.apache.tomcat" ]
org.apache.tomcat;
690,390
public List<EventTypeInner> listEventTypes(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body(); }
List<EventTypeInner> function(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) { return listEventTypesWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).toBlocking().single().body(); }
/** * List topic event types. * List event types for a topic. * * @param resourceGroupName The name of the resource group within the user's subscription. * @param providerNamespace Namespace of the provider of the topic. * @param resourceTypeName Name of the topic type. * @param resourceName Name of the topic. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List&lt;EventTypeInner&gt; object if successful. */
List topic event types. List event types for a topic
listEventTypes
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/eventgrid/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_06_01/implementation/TopicsInner.java", "license": "mit", "size": 112449 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,732,542
public static void saveFile(File file, String contents) { writeBytesToFile(file, contents.getBytes()); }
static void function(File file, String contents) { writeBytesToFile(file, contents.getBytes()); }
/** * Writes a string to a file. */
Writes a string to a file
saveFile
{ "repo_name": "Tankernn/AccountManager", "path": "src/main/java/eu/tankernn/accounts/FileManager.java", "license": "mit", "size": 3015 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,254,306
public synchronized Enumeration enumerateInstances(CIMObjectPath pClassPath, boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers, boolean pIncludeClassOrigin, java.lang.String[] pPropertyList) throws CIMException { Benchmark.startTimer(); preCheck(); Enumeration enumeration = iHandle.enumerateInstances(pClassPath, pDeepInheritance, pLocalOnly, pIncludeQualifiers, pIncludeClassOrigin, pPropertyList); Benchmark.stopTimer(); return enumeration; }
synchronized Enumeration function(CIMObjectPath pClassPath, boolean pDeepInheritance, boolean pLocalOnly, boolean pIncludeQualifiers, boolean pIncludeClassOrigin, java.lang.String[] pPropertyList) throws CIMException { Benchmark.startTimer(); preCheck(); Enumeration enumeration = iHandle.enumerateInstances(pClassPath, pDeepInheritance, pLocalOnly, pIncludeQualifiers, pIncludeClassOrigin, pPropertyList); Benchmark.stopTimer(); return enumeration; }
/** * Enumerates the CIM instances on the target CIM server that are of the * specified class or its subclasses and returns copies of these instances. * * @param pClassPath * CIM class path to the CIM class whose instances will be * enumerated. Instances of its subclasses in the same namespace * will also be enumerated. Must be an intra-server or * intra-namespace object path within the target CIM server. In * the latter case, the default namespace name is added to this * parameter before being used. The CIM class must exist. * @param pDeepInheritance * Allows to restrict the set of properties present in the * returned instances. If true, the set of properties will not be * restricted by this parameter. If false, the set of properties * will be restricted such that any properties in subclasses of * the specified class are removed. When combined with other * property restriction filters, all restrictions are * accumulated. Note: There is an erroneous interpretation of * this parameter which consists in believing that the parameter * removes all instances of subclasses from the enumerated set of * instances. This is wrong as it does not remove such instances, * instead it removes their subclass properties. * @param pLocalOnly * Allows to restrict the set of properties present in the * returned instances. If false, the set of properties will not * be restricted by this parameter. If true, the set of * properties will be restricted in a way that dependens on the * CIM server implementation. When combined with other property * restriction filters, all restrictions are accumulated. <br> * <span style="color: rgb(255,0,0);">Deprecation Note: The CIM * Operations over HTTP specification [DSP0200] V1.2 has * deprecated this parameter. It is recommended that CIM client * applications set <code>pLocalOnly</code> to * <code>false</code> and not to rely on * <code>pLocalOnly</code> filtering. To minimize the impact of * implementing this recommendation in CIM client applications, a * CIM server may choose to treat the value of * <code>pLocalOnly</code> as <code>false</code>, regardless * how it is actually set in an operation. Details: In DSP0200 * V1.0, the pLocalOnly parameter was specified ambiguously. In * DSP0200 V1.1, the definition of the pLocalOnly parameter was * modified with the intent to clarify the ambiguity, so that it * now restricted the set of properties to those of the specified * class (removing any properties of its superclasses). This * change introduced backward compatibility problems for CIM * client applications when working with CIM servers that * implemented <code>pLocalOnly</code> support with the (quite * common) interpretation of the V1.0 definition that restricted * the set of properties to those defined in the CIM class of * each instance and its superclasses. In DSP0200 V1.2, a CIM * server must consistently support a single interpretation of * the <code>pLocalOnly</code> parameter, but which one is left * open.</span> * @param pIncludeQualifiers * If false, no qualifiers will be included. If true, all * qualifiers for each object will be included in the objects * returned. <br> * <span style="color: rgb(255,0,0);">Deprecation Note: The CIM * Operations over HTTP specification [DSP0200] V1.2 has * deprecated this parameter. The preferred way to retrieve * qualifier information is to use the class operations (for * example, <code>getClass</code>) instead, and to set this * parameter to <code>false</code>.</span> * @param pIncludeClassOrigin * If true, class origin information will be present in the * returned objects. Class origin information indicates the class * in which a CIM property, method, or reference was first * defined in the class hierarchy. It can be retrieved from the * Java objects representing these CIM elements by means of the * <code>getOriginClass()</code> method. If false, class origin * information will not be present in the returned objects. * @param pPropertyList * An array of CIM property names that allows to restrict the set * of properties in the returned objects (classes or instances). * If null, the set of properties will not be restricted by this * parameter. If not null, the set of properties will be * restricted such that any properties missing from this list * will not be present in the returned objects. In this case, the * members of the array must define zero or more property names * of the specified class. This may include inherited property * names or property names explicitly defined in the specified * class, but must not include property names defined in * subclasses of the specified class. Duplicate property names * are tolerated and the duplicates are ignored. When combined * with other property restriction filters, all restrictions are * accumulated. * @return A <code>CIMEnumeration</code> object containing zero or more * <code>CIMInstance</code> objects. * @throws CIMException * with one of these CIM status codes: * <dl style="margin-left: 80px;"> * <dt>{@link CIMException#CIM_ERR_ACCESS_DENIED CIM_ERR_ACCESS_DENIED}</dt> * <dt>{@link CIMException#CIM_ERR_NOT_SUPPORTED CIM_ERR_NOT_SUPPORTED}</dt> * <dt>{@link CIMException#CIM_ERR_INVALID_NAMESPACE CIM_ERR_INVALID_NAMESPACE}</dt> * <dt>{@link CIMException#CIM_ERR_INVALID_PARAMETER CIM_ERR_INVALID_PARAMETER}</dt> * <dt>{@link CIMException#CIM_ERR_INVALID_CLASS CIM_ERR_INVALID_CLASS}</dt> * <dt>{@link CIMException#CIM_ERR_FAILED CIM_ERR_FAILED}</dt> * </dl> * @see org.sblim.wbem.cim.CIMProperty#getOriginClass() * @see org.sblim.wbem.cim.CIMMethod#getOriginClass() */
Enumerates the CIM instances on the target CIM server that are of the specified class or its subclasses and returns copies of these instances
enumerateInstances
{ "repo_name": "acleasby/sblim-cim-client", "path": "cim-client-java/src/main/java/org/sblim/wbem/client/CIMClient.java", "license": "epl-1.0", "size": 203192 }
[ "java.util.Enumeration", "org.sblim.wbem.cim.CIMException", "org.sblim.wbem.cim.CIMObjectPath", "org.sblim.wbem.util.Benchmark" ]
import java.util.Enumeration; import org.sblim.wbem.cim.CIMException; import org.sblim.wbem.cim.CIMObjectPath; import org.sblim.wbem.util.Benchmark;
import java.util.*; import org.sblim.wbem.cim.*; import org.sblim.wbem.util.*;
[ "java.util", "org.sblim.wbem" ]
java.util; org.sblim.wbem;
268,012
public static List<Integer> quickSort(List<Integer> array){ if(array.isEmpty()) { return array; } else { List<Integer> answer = new ArrayList<>(); List<Integer> less = new ArrayList<>(); List<Integer> equal = new ArrayList<>(); List<Integer> more = new ArrayList<>(); int pivot = array.get(0); for(int a: array){ if(a > pivot) more.add(a); if(a < pivot) less.add(a); if(a == pivot) equal.add(a); } less = quickSort(less); more = quickSort(more); answer.addAll(less); answer.addAll(equal); answer.addAll(more); return answer; } }
static List<Integer> function(List<Integer> array){ if(array.isEmpty()) { return array; } else { List<Integer> answer = new ArrayList<>(); List<Integer> less = new ArrayList<>(); List<Integer> equal = new ArrayList<>(); List<Integer> more = new ArrayList<>(); int pivot = array.get(0); for(int a: array){ if(a > pivot) more.add(a); if(a < pivot) less.add(a); if(a == pivot) equal.add(a); } less = quickSort(less); more = quickSort(more); answer.addAll(less); answer.addAll(equal); answer.addAll(more); return answer; } }
/** * QuickSort algorithm that uses a pivot value and sorts the * array into 3 groups, items higher, equal and less than the * pivot. It then combines those groups at the end * @param list of unsorted integers * @return sorted list */
QuickSort algorithm that uses a pivot value and sorts the array into 3 groups, items higher, equal and less than the pivot. It then combines those groups at the end
quickSort
{ "repo_name": "bkstamm67/java", "path": "algos/QuickSort.java", "license": "mit", "size": 1766 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,645,411
public IAuthorizationPrincipal newPrincipal(String key, Class type) { final Tuple<String, Class> principalKey = new Tuple<String, Class>(key, type); final Element element = this.principalCache.get(principalKey); //principalCache is self populating, it can never return a null entry return (IAuthorizationPrincipal)element.getObjectValue(); }
IAuthorizationPrincipal function(String key, Class type) { final Tuple<String, Class> principalKey = new Tuple<String, Class>(key, type); final Element element = this.principalCache.get(principalKey); return (IAuthorizationPrincipal)element.getObjectValue(); }
/** * Factory method for IAuthorizationPrincipal. First check the principal * cache, and if not present, create the principal and cache it. * * @return org.jasig.portal.security.IAuthorizationPrincipal * @param key java.lang.String * @param type java.lang.Class */
Factory method for IAuthorizationPrincipal. First check the principal cache, and if not present, create the principal and cache it
newPrincipal
{ "repo_name": "pspaude/uPortal", "path": "uportal-war/src/main/java/org/jasig/portal/security/provider/AuthorizationImpl.java", "license": "apache-2.0", "size": 38152 }
[ "net.sf.ehcache.Element", "org.jasig.portal.security.IAuthorizationPrincipal", "org.jasig.portal.utils.Tuple" ]
import net.sf.ehcache.Element; import org.jasig.portal.security.IAuthorizationPrincipal; import org.jasig.portal.utils.Tuple;
import net.sf.ehcache.*; import org.jasig.portal.security.*; import org.jasig.portal.utils.*;
[ "net.sf.ehcache", "org.jasig.portal" ]
net.sf.ehcache; org.jasig.portal;
1,298,950
public void setViewportLocationInStorage(int x, int y) { Activator.getDefault().getDialogSettings().put(getViewportXValueKey(), x); Activator.getDefault().getDialogSettings().put(getViewportYValueKey(), y); }
void function(int x, int y) { Activator.getDefault().getDialogSettings().put(getViewportXValueKey(), x); Activator.getDefault().getDialogSettings().put(getViewportYValueKey(), y); }
/** * Convience method for manually setting the persisted scroll values */
Convience method for manually setting the persisted scroll values
setViewportLocationInStorage
{ "repo_name": "nmohamad/bridgepoint", "path": "src/org.xtuml.bp.ui.graphics/src/org/xtuml/bp/ui/graphics/editor/GraphicalEditor.java", "license": "apache-2.0", "size": 53993 }
[ "org.xtuml.bp.ui.graphics.Activator" ]
import org.xtuml.bp.ui.graphics.Activator;
import org.xtuml.bp.ui.graphics.*;
[ "org.xtuml.bp" ]
org.xtuml.bp;
454,853
public UnsignedShort getNumberOfAttempts() { return this.numberOfAttempts; }
UnsignedShort function() { return this.numberOfAttempts; }
/** * get numberOfAttempts of type UnsignedShort. * @return type UnsignedShort to be set */
get numberOfAttempts of type UnsignedShort
getNumberOfAttempts
{ "repo_name": "yalewkidane/Oliot-FC", "path": "fc-server/src/main/java/kr/ac/kaist/resl/ltk/generated/parameters/TagObservationTrigger.java", "license": "lgpl-2.1", "size": 12733 }
[ "org.llrp.ltk.types.UnsignedShort" ]
import org.llrp.ltk.types.UnsignedShort;
import org.llrp.ltk.types.*;
[ "org.llrp.ltk" ]
org.llrp.ltk;
2,433,729
@Override public void populate(HttpServletRequest request) { super.populate(request); // now run through all of the accounting lines and make sure they've been uppercased and populated appropriately SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(getNewAdvanceDeposit()); List<AdvanceDepositDetail> advancedDeposits = getAdvanceDepositDocument().getAdvanceDeposits(); for (AdvanceDepositDetail detail : advancedDeposits) { SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(detail); } }
void function(HttpServletRequest request) { super.populate(request); SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(getNewAdvanceDeposit()); List<AdvanceDepositDetail> advancedDeposits = getAdvanceDepositDocument().getAdvanceDeposits(); for (AdvanceDepositDetail detail : advancedDeposits) { SpringContext.getBean(BusinessObjectDictionaryService.class).performForceUppercase(detail); } }
/** * Overrides the parent to call super.populate and then tells each line to check the associated data dictionary and modify the * values entered to follow all the attributes set for the values of the accounting line. * * @see org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase#populate(javax.servlet.http.HttpServletRequest) */
Overrides the parent to call super.populate and then tells each line to check the associated data dictionary and modify the values entered to follow all the attributes set for the values of the accounting line
populate
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/fp/document/web/struts/AdvanceDepositForm.java", "license": "apache-2.0", "size": 4083 }
[ "java.util.List", "javax.servlet.http.HttpServletRequest", "org.kuali.kfs.fp.businessobject.AdvanceDepositDetail", "org.kuali.kfs.sys.context.SpringContext", "org.kuali.rice.kns.service.BusinessObjectDictionaryService" ]
import java.util.List; import javax.servlet.http.HttpServletRequest; import org.kuali.kfs.fp.businessobject.AdvanceDepositDetail; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.kns.service.BusinessObjectDictionaryService;
import java.util.*; import javax.servlet.http.*; import org.kuali.kfs.fp.businessobject.*; import org.kuali.kfs.sys.context.*; import org.kuali.rice.kns.service.*;
[ "java.util", "javax.servlet", "org.kuali.kfs", "org.kuali.rice" ]
java.util; javax.servlet; org.kuali.kfs; org.kuali.rice;
901,041
if (configurableListableBeanFactory.containsBean(validatorFactoryBeanName)) { BeanDefinition validatorFactoryBeanDefinition = configurableListableBeanFactory.getBeanDefinition(validatorFactoryBeanName); MutablePropertyValues propertyValues = validatorFactoryBeanDefinition.getPropertyValues(); PropertyValue propertyValue = propertyValues.getPropertyValue("validationConfigLocations"); //value is expected to be a list. List existingValidationConfigLocations = (List) propertyValue.getValue(); existingValidationConfigLocations.addAll(validationConfigLocations); } }
if (configurableListableBeanFactory.containsBean(validatorFactoryBeanName)) { BeanDefinition validatorFactoryBeanDefinition = configurableListableBeanFactory.getBeanDefinition(validatorFactoryBeanName); MutablePropertyValues propertyValues = validatorFactoryBeanDefinition.getPropertyValues(); PropertyValue propertyValue = propertyValues.getPropertyValue(STR); List existingValidationConfigLocations = (List) propertyValue.getValue(); existingValidationConfigLocations.addAll(validationConfigLocations); } }
/** * Adds the validation configuration files to the list already held in the validator factory bean configuration. * @param configurableListableBeanFactory the bean factory */
Adds the validation configuration files to the list already held in the validator factory bean configuration
postProcessBeanFactory
{ "repo_name": "mkanev/kur2", "path": "src/main/java/ru/leti/webapp/spring/ValidatorExtensionPostProcessor.java", "license": "apache-2.0", "size": 3812 }
[ "java.util.List", "org.springframework.beans.MutablePropertyValues", "org.springframework.beans.PropertyValue", "org.springframework.beans.factory.config.BeanDefinition" ]
import java.util.List; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; import org.springframework.beans.factory.config.BeanDefinition;
import java.util.*; import org.springframework.beans.*; import org.springframework.beans.factory.config.*;
[ "java.util", "org.springframework.beans" ]
java.util; org.springframework.beans;
2,673,993
@Test public void suspendRequestDebugTargetTerminated() { final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable()); target.setName("target"); target.setState(DebugTargetState.TERMINATED); createThreads(target); try { ThreadUtils.suspendRequest(target.getThreads().get(runningThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(steppingIntoThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(steppingOverThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(steppingReturnThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(suspendedThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(suspendingThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(terminatedThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(terminatingThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( "can't suspend a not running or stepping thread or a thread in a not connected debug target.", e.getMessage()); } }
void function() { final DebugTarget target = DebugPackage.eINSTANCE.getDebugFactory().createDebugTarget(); target.setContext(DebugPackage.eINSTANCE.getDebugFactory().createVariable()); target.setName(STR); target.setState(DebugTargetState.TERMINATED); createThreads(target); try { ThreadUtils.suspendRequest(target.getThreads().get(runningThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(steppingIntoThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(steppingOverThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(steppingReturnThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(suspendedThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(suspendingThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(terminatedThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } try { ThreadUtils.suspendRequest(target.getThreads().get(terminatingThreadIndex)); fail(); } catch (IllegalStateException e) { assertEquals( STR, e.getMessage()); } }
/** * Tests {@link ThreadUtils#suspendRequest(Thread)} in {@link DebugTargetState#TERMINATING}. */
Tests <code>ThreadUtils#suspendRequest(Thread)</code> in <code>DebugTargetState#TERMINATING</code>
suspendRequestDebugTargetTerminated
{ "repo_name": "SiriusLab/SiriusAnimator", "path": "simulationmodelanimation/tests/org.eclipse.gemoc.dsl.debug.tests/src/org/eclipse/gemoc/dsl/debug/tests/ThreadUtilsTests.java", "license": "epl-1.0", "size": 179513 }
[ "org.eclipse.gemoc.dsl.debug.DebugPackage", "org.eclipse.gemoc.dsl.debug.DebugTarget", "org.eclipse.gemoc.dsl.debug.DebugTargetState", "org.eclipse.gemoc.dsl.debug.ThreadUtils", "org.junit.Assert" ]
import org.eclipse.gemoc.dsl.debug.DebugPackage; import org.eclipse.gemoc.dsl.debug.DebugTarget; import org.eclipse.gemoc.dsl.debug.DebugTargetState; import org.eclipse.gemoc.dsl.debug.ThreadUtils; import org.junit.Assert;
import org.eclipse.gemoc.dsl.debug.*; import org.junit.*;
[ "org.eclipse.gemoc", "org.junit" ]
org.eclipse.gemoc; org.junit;
1,920,636
public static String getServerID(ConnectionInfo info) { return getServerID(KaaThriftService.OPERATIONS_SERVICE, info); }
static String function(ConnectionInfo info) { return getServerID(KaaThriftService.OPERATIONS_SERVICE, info); }
/** * Build server ID from ConnectionInfo object. * * @param info * ConnectionInfo * @return server ID in format thriftHost:thriftPort */
Build server ID from ConnectionInfo object
getServerID
{ "repo_name": "Oleh-Kravchenko/kaa", "path": "server/common/server-shared/src/main/java/org/kaaproject/kaa/server/thrift/Neighbors.java", "license": "apache-2.0", "size": 7807 }
[ "org.kaaproject.kaa.server.common.thrift.KaaThriftService", "org.kaaproject.kaa.server.common.zk.gen.ConnectionInfo" ]
import org.kaaproject.kaa.server.common.thrift.KaaThriftService; import org.kaaproject.kaa.server.common.zk.gen.ConnectionInfo;
import org.kaaproject.kaa.server.common.thrift.*; import org.kaaproject.kaa.server.common.zk.gen.*;
[ "org.kaaproject.kaa" ]
org.kaaproject.kaa;
132,123
public void setRetriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel) { this.retriesExhaustedLogLevel = retriesExhaustedLogLevel; }
void function(LoggingLevel retriesExhaustedLogLevel) { this.retriesExhaustedLogLevel = retriesExhaustedLogLevel; }
/** * Sets the logging level to use for log messages when retries have been exhausted. */
Sets the logging level to use for log messages when retries have been exhausted
setRetriesExhaustedLogLevel
{ "repo_name": "engagepoint/camel", "path": "camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java", "license": "apache-2.0", "size": 22036 }
[ "org.apache.camel.LoggingLevel" ]
import org.apache.camel.LoggingLevel;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
1,529,722
public ContentType getContentType() { return contentType; }
ContentType function() { return contentType; }
/** * Gets the Content-Type for the notification. * * @return The Content-Type for the notification. */
Gets the Content-Type for the notification
getContentType
{ "repo_name": "Azure/azure-notificationhubs-java-backend", "path": "NotificationHubs/src/com/windowsazure/messaging/Notification.java", "license": "apache-2.0", "size": 6916 }
[ "org.apache.hc.core5.http.ContentType" ]
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.*;
[ "org.apache.hc" ]
org.apache.hc;
2,101,800
@Override public boolean onPrepareOptionsMenu(final Menu menu) { super.onPrepareOptionsMenu(menu); final boolean isHistory = type == CacheListType.HISTORY; final boolean isOffline = type == CacheListType.OFFLINE; final boolean isEmpty = cacheList.isEmpty(); final boolean isConcrete = isConcreteList(); final boolean isNonDefaultList = isConcrete && listId != StoredList.STANDARD_LIST_ID; final List<CacheListApp> listNavigationApps = CacheListApps.getActiveApps(); try { // toplevel menu items setEnabled(menu, R.id.menu_show_on_map, !isEmpty); setEnabled(menu, R.id.menu_filter, search != null && search.getCount() > 0); setVisibleEnabled(menu, R.id.menu_sort, !isHistory, !isEmpty); if (adapter.isSelectMode()) { menu.findItem(R.id.menu_switch_select_mode).setTitle(res.getString(R.string.caches_select_mode_exit)) .setIcon(R.drawable.ic_menu_clear_playlist); } else { menu.findItem(R.id.menu_switch_select_mode).setTitle(res.getString(R.string.caches_select_mode)) .setIcon(R.drawable.ic_menu_agenda); } setEnabled(menu, R.id.menu_switch_select_mode, !isEmpty); setVisible(menu, R.id.menu_invert_selection, adapter.isSelectMode()); // exception to the general rule: only show in select mode setVisibleEnabled(menu, R.id.menu_cache_list_app_provider, listNavigationApps.size() > 1, !isEmpty); setVisibleEnabled(menu, R.id.menu_cache_list_app, listNavigationApps.size() == 1, !isEmpty); // Manage Caches submenu setEnabled(menu, R.id.menu_refresh_stored, !isEmpty); if (!isOffline && !isHistory) { menu.findItem(R.id.menu_refresh_stored).setTitle(R.string.caches_store_offline); } setVisibleEnabled(menu, R.id.menu_move_to_list, isHistory || isOffline, !isEmpty); setVisibleEnabled(menu, R.id.menu_copy_to_list, isHistory || isOffline, !isEmpty); setVisibleEnabled(menu, R.id.menu_drop_caches, isHistory || containsStoredCaches(), !isEmpty); setVisibleEnabled(menu, R.id.menu_delete_events, isConcrete, !isEmpty && containsPastEvents()); setVisibleEnabled(menu, R.id.menu_clear_offline_logs, isHistory || isOffline, !isEmpty && containsOfflineLogs()); setVisibleEnabled(menu, R.id.menu_remove_from_history, isHistory, !isEmpty); setMenuItemLabel(menu, R.id.menu_remove_from_history, R.string.cache_remove_from_history, R.string.cache_clear_history); if (isOffline || type == CacheListType.HISTORY) { // only offline list setMenuItemLabel(menu, R.id.menu_drop_caches, R.string.caches_remove_selected, R.string.caches_remove_all); setMenuItemLabel(menu, R.id.menu_refresh_stored, R.string.caches_refresh_selected, R.string.caches_refresh_all); setMenuItemLabel(menu, R.id.menu_move_to_list, R.string.caches_move_selected, R.string.caches_move_all); setMenuItemLabel(menu, R.id.menu_copy_to_list, R.string.caches_copy_selected, R.string.caches_copy_all); } else { // search and global list (all other than offline and history) setMenuItemLabel(menu, R.id.menu_refresh_stored, R.string.caches_store_selected, R.string.caches_store_offline); } // Manage Lists submenu setVisible(menu, R.id.menu_lists, isOffline); setVisible(menu, R.id.menu_drop_list, isNonDefaultList); setVisible(menu, R.id.menu_rename_list, isNonDefaultList); setVisibleEnabled(menu, R.id.menu_make_list_unique, listId != PseudoList.ALL_LIST.id, !isEmpty); // Import submenu setVisible(menu, R.id.menu_import, isOffline && listId != PseudoList.ALL_LIST.id); setEnabled(menu, R.id.menu_import_android, Compatibility.isStorageAccessFrameworkAvailable()); setEnabled(menu, R.id.menu_import_pq, Settings.isGCConnectorActive() && Settings.isGCPremiumMember()); // Export setVisibleEnabled(menu, R.id.menu_export, isHistory || isOffline, !isEmpty); } catch (final RuntimeException e) { Log.e("CacheListActivity.onPrepareOptionsMenu", e); } return true; }
boolean function(final Menu menu) { super.onPrepareOptionsMenu(menu); final boolean isHistory = type == CacheListType.HISTORY; final boolean isOffline = type == CacheListType.OFFLINE; final boolean isEmpty = cacheList.isEmpty(); final boolean isConcrete = isConcreteList(); final boolean isNonDefaultList = isConcrete && listId != StoredList.STANDARD_LIST_ID; final List<CacheListApp> listNavigationApps = CacheListApps.getActiveApps(); try { setEnabled(menu, R.id.menu_show_on_map, !isEmpty); setEnabled(menu, R.id.menu_filter, search != null && search.getCount() > 0); setVisibleEnabled(menu, R.id.menu_sort, !isHistory, !isEmpty); if (adapter.isSelectMode()) { menu.findItem(R.id.menu_switch_select_mode).setTitle(res.getString(R.string.caches_select_mode_exit)) .setIcon(R.drawable.ic_menu_clear_playlist); } else { menu.findItem(R.id.menu_switch_select_mode).setTitle(res.getString(R.string.caches_select_mode)) .setIcon(R.drawable.ic_menu_agenda); } setEnabled(menu, R.id.menu_switch_select_mode, !isEmpty); setVisible(menu, R.id.menu_invert_selection, adapter.isSelectMode()); setVisibleEnabled(menu, R.id.menu_cache_list_app_provider, listNavigationApps.size() > 1, !isEmpty); setVisibleEnabled(menu, R.id.menu_cache_list_app, listNavigationApps.size() == 1, !isEmpty); setEnabled(menu, R.id.menu_refresh_stored, !isEmpty); if (!isOffline && !isHistory) { menu.findItem(R.id.menu_refresh_stored).setTitle(R.string.caches_store_offline); } setVisibleEnabled(menu, R.id.menu_move_to_list, isHistory isOffline, !isEmpty); setVisibleEnabled(menu, R.id.menu_copy_to_list, isHistory isOffline, !isEmpty); setVisibleEnabled(menu, R.id.menu_drop_caches, isHistory containsStoredCaches(), !isEmpty); setVisibleEnabled(menu, R.id.menu_delete_events, isConcrete, !isEmpty && containsPastEvents()); setVisibleEnabled(menu, R.id.menu_clear_offline_logs, isHistory isOffline, !isEmpty && containsOfflineLogs()); setVisibleEnabled(menu, R.id.menu_remove_from_history, isHistory, !isEmpty); setMenuItemLabel(menu, R.id.menu_remove_from_history, R.string.cache_remove_from_history, R.string.cache_clear_history); if (isOffline type == CacheListType.HISTORY) { setMenuItemLabel(menu, R.id.menu_drop_caches, R.string.caches_remove_selected, R.string.caches_remove_all); setMenuItemLabel(menu, R.id.menu_refresh_stored, R.string.caches_refresh_selected, R.string.caches_refresh_all); setMenuItemLabel(menu, R.id.menu_move_to_list, R.string.caches_move_selected, R.string.caches_move_all); setMenuItemLabel(menu, R.id.menu_copy_to_list, R.string.caches_copy_selected, R.string.caches_copy_all); } else { setMenuItemLabel(menu, R.id.menu_refresh_stored, R.string.caches_store_selected, R.string.caches_store_offline); } setVisible(menu, R.id.menu_lists, isOffline); setVisible(menu, R.id.menu_drop_list, isNonDefaultList); setVisible(menu, R.id.menu_rename_list, isNonDefaultList); setVisibleEnabled(menu, R.id.menu_make_list_unique, listId != PseudoList.ALL_LIST.id, !isEmpty); setVisible(menu, R.id.menu_import, isOffline && listId != PseudoList.ALL_LIST.id); setEnabled(menu, R.id.menu_import_android, Compatibility.isStorageAccessFrameworkAvailable()); setEnabled(menu, R.id.menu_import_pq, Settings.isGCConnectorActive() && Settings.isGCPremiumMember()); setVisibleEnabled(menu, R.id.menu_export, isHistory isOffline, !isEmpty); } catch (final RuntimeException e) { Log.e(STR, e); } return true; }
/** * Menu items which are not at all usable with the current list type should be hidden. * Menu items which are usable with the current list type but not in the current situation should be disabled. */
Menu items which are not at all usable with the current list type should be hidden. Menu items which are usable with the current list type but not in the current situation should be disabled
onPrepareOptionsMenu
{ "repo_name": "pstorch/cgeo", "path": "main/src/cgeo/geocaching/CacheListActivity.java", "license": "apache-2.0", "size": 84358 }
[ "android.view.Menu", "java.util.List" ]
import android.view.Menu; import java.util.List;
import android.view.*; import java.util.*;
[ "android.view", "java.util" ]
android.view; java.util;
2,720,550
public double getEuclideanMetric() { double sumSq = 0; for (Entry<Axis, Double> entry : location.entrySet()) { if (entry.getKey() instanceof ControllerAxis) { sumSq += Math.pow(entry.getValue(), 2); } } return Math.sqrt(sumSq); }
double function() { double sumSq = 0; for (Entry<Axis, Double> entry : location.entrySet()) { if (entry.getKey() instanceof ControllerAxis) { sumSq += Math.pow(entry.getValue(), 2); } } return Math.sqrt(sumSq); }
/** * Returns the Euclidean metric i.e. the distance in N-dimensional space of the AxesLocation from the origin * i.e. treated as a vector. * * @return */
Returns the Euclidean metric i.e. the distance in N-dimensional space of the AxesLocation from the origin i.e. treated as a vector
getEuclideanMetric
{ "repo_name": "openpnp/openpnp", "path": "src/main/java/org/openpnp/model/AxesLocation.java", "license": "gpl-3.0", "size": 23830 }
[ "java.util.Map", "org.openpnp.spi.Axis", "org.openpnp.spi.ControllerAxis" ]
import java.util.Map; import org.openpnp.spi.Axis; import org.openpnp.spi.ControllerAxis;
import java.util.*; import org.openpnp.spi.*;
[ "java.util", "org.openpnp.spi" ]
java.util; org.openpnp.spi;
2,094,884
SwingUtilities.invokeLater(new Runnable() {
SwingUtilities.invokeLater(new Runnable() {
/** * Waits for the user to click the Continue button. */
Waits for the user to click the Continue button
waitForUserInput
{ "repo_name": "victorfsf/testing-cin", "path": "texasholdem/src/main/java/org/ozsoft/texasholdem/gui/ControlPanel.java", "license": "mit", "size": 7678 }
[ "javax.swing.SwingUtilities" ]
import javax.swing.SwingUtilities;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,190,464
private boolean isCompressable() { // Check if content is not already gzipped MessageBytes contentEncodingMB = response.getMimeHeaders().getValue("Content-Encoding"); if ((contentEncodingMB != null) && (contentEncodingMB.indexOf("gzip") != -1)) { return false; } // If force mode, always compress (test purposes only) if (compressionLevel == 2) { return true; } // Check if sufficient length to trigger the compression long contentLength = response.getContentLengthLong(); if ((contentLength == -1) || (contentLength > compressionMinSize)) { // Check for compatible MIME-TYPE if (compressableMimeTypes != null) { return (startsWithStringArray(compressableMimeTypes, response.getContentType())); } } return false; }
boolean function() { MessageBytes contentEncodingMB = response.getMimeHeaders().getValue(STR); if ((contentEncodingMB != null) && (contentEncodingMB.indexOf("gzip") != -1)) { return false; } if (compressionLevel == 2) { return true; } long contentLength = response.getContentLengthLong(); if ((contentLength == -1) (contentLength > compressionMinSize)) { if (compressableMimeTypes != null) { return (startsWithStringArray(compressableMimeTypes, response.getContentType())); } } return false; }
/** * Check if the resource could be compressed, if the client supports it. */
Check if the resource could be compressed, if the client supports it
isCompressable
{ "repo_name": "pistolove/sourcecode4junit", "path": "Source4Tomcat/src/org/apache/coyote/http11/AbstractHttp11Processor.java", "license": "apache-2.0", "size": 53973 }
[ "org.apache.tomcat.util.buf.MessageBytes" ]
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.buf.*;
[ "org.apache.tomcat" ]
org.apache.tomcat;
2,566,831
@VisibleForTesting static List<XAttr> filterINodeXAttrs( final List<XAttr> existingXAttrs, final List<XAttr> toFilter, final List<XAttr> filtered) throws AccessControlException { if (existingXAttrs == null || existingXAttrs.isEmpty() || toFilter == null || toFilter.isEmpty()) { return existingXAttrs; } // Populate a new list with XAttrs that pass the filter List<XAttr> newXAttrs = Lists.newArrayListWithCapacity(existingXAttrs.size()); for (XAttr a : existingXAttrs) { boolean add = true; for (ListIterator<XAttr> it = toFilter.listIterator(); it.hasNext() ;) { XAttr filter = it.next(); Preconditions.checkArgument( !KEYID_XATTR.equalsIgnoreValue(filter), "The encryption zone xattr should never be deleted."); if (UNREADABLE_BY_SUPERUSER_XATTR.equalsIgnoreValue(filter)) { throw new AccessControlException("The xattr '" + SECURITY_XATTR_UNREADABLE_BY_SUPERUSER + "' can not be deleted."); } if (a.equalsIgnoreValue(filter)) { add = false; it.remove(); filtered.add(filter); break; } } if (add) { newXAttrs.add(a); } } return newXAttrs; }
static List<XAttr> filterINodeXAttrs( final List<XAttr> existingXAttrs, final List<XAttr> toFilter, final List<XAttr> filtered) throws AccessControlException { if (existingXAttrs == null existingXAttrs.isEmpty() toFilter == null toFilter.isEmpty()) { return existingXAttrs; } List<XAttr> newXAttrs = Lists.newArrayListWithCapacity(existingXAttrs.size()); for (XAttr a : existingXAttrs) { boolean add = true; for (ListIterator<XAttr> it = toFilter.listIterator(); it.hasNext() ;) { XAttr filter = it.next(); Preconditions.checkArgument( !KEYID_XATTR.equalsIgnoreValue(filter), STR); if (UNREADABLE_BY_SUPERUSER_XATTR.equalsIgnoreValue(filter)) { throw new AccessControlException(STR + SECURITY_XATTR_UNREADABLE_BY_SUPERUSER + STR); } if (a.equalsIgnoreValue(filter)) { add = false; it.remove(); filtered.add(filter); break; } } if (add) { newXAttrs.add(a); } } return newXAttrs; }
/** * Filter XAttrs from a list of existing XAttrs. Removes matched XAttrs from * toFilter and puts them into filtered. Upon completion, * toFilter contains the filter XAttrs that were not found, while * fitleredXAttrs contains the XAttrs that were found. * * @param existingXAttrs Existing XAttrs to be filtered * @param toFilter XAttrs to filter from the existing XAttrs * @param filtered Return parameter, XAttrs that were filtered * @return List of XAttrs that does not contain filtered XAttrs */
Filter XAttrs from a list of existing XAttrs. Removes matched XAttrs from toFilter and puts them into filtered. Upon completion, toFilter contains the filter XAttrs that were not found, while fitleredXAttrs contains the XAttrs that were found
filterINodeXAttrs
{ "repo_name": "leechoongyon/HadoopSourceAnalyze", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java", "license": "apache-2.0", "size": 15726 }
[ "com.google.common.base.Preconditions", "com.google.common.collect.Lists", "java.util.List", "java.util.ListIterator", "org.apache.hadoop.fs.XAttr", "org.apache.hadoop.security.AccessControlException" ]
import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import java.util.List; import java.util.ListIterator; import org.apache.hadoop.fs.XAttr; import org.apache.hadoop.security.AccessControlException;
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.security.*;
[ "com.google.common", "java.util", "org.apache.hadoop" ]
com.google.common; java.util; org.apache.hadoop;
964,065
@ApiModelProperty(example = "null", value = "When exempt, taxable with zero, suspended, not taxable, this field holds the official code number") public String getCofinsExemptLegalReasonCode() { return cofinsExemptLegalReasonCode; }
@ApiModelProperty(example = "null", value = STR) String function() { return cofinsExemptLegalReasonCode; }
/** * When exempt, taxable with zero, suspended, not taxable, this field holds the official code number * @return cofinsExemptLegalReasonCode **/
When exempt, taxable with zero, suspended, not taxable, this field holds the official code number
getCofinsExemptLegalReasonCode
{ "repo_name": "Avalara/avataxbr-clients", "path": "java-client/src/main/java/io/swagger/client/model/CfopConf.java", "license": "gpl-3.0", "size": 29385 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
856,681
void notifyViewAutomaticallyStarted(UniqueId viewProcessId, String autoStartName);
void notifyViewAutomaticallyStarted(UniqueId viewProcessId, String autoStartName);
/** * Called immediately after a view process has been created. * * @param viewProcessId * the unique identifier of the view process that has been created * @param autoStartName * the name of the configuration which was auto-started */
Called immediately after a view process has been created
notifyViewAutomaticallyStarted
{ "repo_name": "McLeodMoores/starling", "path": "projects/engine/src/main/java/com/opengamma/engine/view/event/ViewProcessorEventListener.java", "license": "apache-2.0", "size": 1972 }
[ "com.opengamma.id.UniqueId" ]
import com.opengamma.id.UniqueId;
import com.opengamma.id.*;
[ "com.opengamma.id" ]
com.opengamma.id;
2,042,783
Map<String, String> getServiceEndpoints();
Map<String, String> getServiceEndpoints();
/** * Returns a map of the available services in this region and their * endpoints. The keys of the map are service abbreviations, as defined in * {@link ServiceAbbreviations}, and the values are the endpoint URLs. * * @return A map of the available services in this region. */
Returns a map of the available services in this region and their endpoints. The keys of the map are service abbreviations, as defined in <code>ServiceAbbreviations</code>, and the values are the endpoint URLs
getServiceEndpoints
{ "repo_name": "zhangzhx/aws-toolkit-eclipse", "path": "bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/regions/Region.java", "license": "apache-2.0", "size": 4348 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
707,750
void setViewState(GroupViewState newViewState) { if (isNull(newViewState) || isNull(newViewState.getGroup().orElse(null))) { if (nonNull(getGroup())) { getGroup().getFileIDs().removeListener(filesSyncListener); } this.grouping.set(null); Platform.runLater(() -> { gridView.getItems().setAll(Collections.emptyList()); setCenter(new Label("No group selected")); slideShowToggle.setDisable(true); groupLabel.setText(""); resetScrollBar(); if (false == Case.isCaseOpen()) { cellMap.values().stream().forEach(DrawableCell::resetItem); cellMap.clear(); } }); } else { if (nonNull(getGroup()) && getGroup() != newViewState.getGroup().get()) { getGroup().getFileIDs().removeListener(filesSyncListener); } this.grouping.set(newViewState.getGroup().get()); getGroup().getFileIDs().addListener(filesSyncListener); final String header = getHeaderString(); Platform.runLater(() -> { gridView.getItems().setAll(getGroup().getFileIDs()); boolean empty = gridView.getItems().isEmpty(); slideShowToggle.setDisable(empty); groupLabel.setText(header); resetScrollBar(); if (empty) { setCenter(new Label("There are no files in the selected group.")); } else if (newViewState.getMode() == GroupViewMode.TILE) { activateTileViewer(); } else { activateSlideShowViewer(newViewState.getSlideShowfileID().orElse(null)); } }); } }
void setViewState(GroupViewState newViewState) { if (isNull(newViewState) isNull(newViewState.getGroup().orElse(null))) { if (nonNull(getGroup())) { getGroup().getFileIDs().removeListener(filesSyncListener); } this.grouping.set(null); Platform.runLater(() -> { gridView.getItems().setAll(Collections.emptyList()); setCenter(new Label(STR)); slideShowToggle.setDisable(true); groupLabel.setText(STRThere are no files in the selected group.")); } else if (newViewState.getMode() == GroupViewMode.TILE) { activateTileViewer(); } else { activateSlideShowViewer(newViewState.getSlideShowfileID().orElse(null)); } }); } }
/** * assigns a grouping for this pane to represent and initializes grouping * specific properties and listeners * * @param newViewState */
assigns a grouping for this pane to represent and initializes grouping specific properties and listeners
setViewState
{ "repo_name": "esaunders/autopsy", "path": "ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/drawableviews/GroupPane.java", "license": "apache-2.0", "size": 38773 }
[ "java.util.Collections", "java.util.Objects", "org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewMode", "org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState" ]
import java.util.Collections; import java.util.Objects; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewMode; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.GroupViewState;
import java.util.*; import org.sleuthkit.autopsy.imagegallery.datamodel.grouping.*;
[ "java.util", "org.sleuthkit.autopsy" ]
java.util; org.sleuthkit.autopsy;
1,725,558
protected void fireCancelStarted() { EventQueue.invokeLater(new Runnable() {
void function() { EventQueue.invokeLater(new Runnable() {
/** * DOCUMENT ME! */
DOCUMENT ME
fireCancelStarted
{ "repo_name": "cismet/belis-client", "path": "src/main/java/de/cismet/belis/broker/BelisBroker.java", "license": "gpl-3.0", "size": 138018 }
[ "java.awt.EventQueue" ]
import java.awt.EventQueue;
import java.awt.*;
[ "java.awt" ]
java.awt;
69,600
private void buildDl_Color_BadColorMap4() { badColorMap4.addBody(new FileLine("ncolors = 6", 11)); ADLWidget whiteColor = new ADLWidget("dl_color", null, 12); whiteColor.addBody(new FileLine("r=255", 13)); whiteColor.addBody(new FileLine("g=255", 14)); whiteColor.addBody(new FileLine("b=255", 15)); whiteColor.addBody(new FileLine("inten=255", 16)); ADLWidget greyColor = new ADLWidget("dl_color", null, 22); greyColor.addBody(new FileLine("r=128", 23)); greyColor.addBody(new FileLine("g=A", 24)); //Bad line here value after equals is invalid greyColor.addBody(new FileLine("b=128", 25)); greyColor.addBody(new FileLine("inten=128", 26)); ADLWidget blackColor = new ADLWidget("dl_color", null, 17); blackColor.addBody(new FileLine("r=0", 18)); blackColor.addBody(new FileLine("g=0", 19)); blackColor.addBody(new FileLine("b=0", 20)); blackColor.addBody(new FileLine("inten=0", 21)); ADLWidget redColor = new ADLWidget("dl_color", null, 27); redColor.addBody(new FileLine("r=255", 28)); redColor.addBody(new FileLine("g=0", 29)); redColor.addBody(new FileLine("b=0", 30)); redColor.addBody(new FileLine("inten=128", 31)); ADLWidget greenColor = new ADLWidget("dl_color", null, 32); greenColor.addBody(new FileLine("r=0", 33)); greenColor.addBody(new FileLine("g=255", 34)); greenColor.addBody(new FileLine("b=0", 35)); greenColor.addBody(new FileLine("inten=128", 36)); ADLWidget blueColor = new ADLWidget("dl_color", null, 37); blueColor.addBody(new FileLine("r=0", 38)); blueColor.addBody(new FileLine("b=255", 39)); blueColor.addBody(new FileLine("g=0", 40)); blueColor.addBody(new FileLine("inten=128", 41)); badColorMap4.addObject(whiteColor); badColorMap4.addObject(greyColor); badColorMap4.addObject(blackColor); badColorMap4.addObject(redColor); badColorMap4.addObject(greenColor); badColorMap4.addObject(blueColor); } /** * Test method for * {@link org.csstudio.utility.adlparser.fileParser.ColorMap#ColorMap(org.csstudio.utility.adlparser.fileParser.ADLWidget)}
void function() { badColorMap4.addBody(new FileLine(STR, 11)); ADLWidget whiteColor = new ADLWidget(STR, null, 12); whiteColor.addBody(new FileLine("r=255", 13)); whiteColor.addBody(new FileLine("g=255", 14)); whiteColor.addBody(new FileLine("b=255", 15)); whiteColor.addBody(new FileLine(STR, 16)); ADLWidget greyColor = new ADLWidget(STR, null, 22); greyColor.addBody(new FileLine("r=128", 23)); greyColor.addBody(new FileLine("g=A", 24)); greyColor.addBody(new FileLine("b=128", 25)); greyColor.addBody(new FileLine(STR, 26)); ADLWidget blackColor = new ADLWidget(STR, null, 17); blackColor.addBody(new FileLine("r=0", 18)); blackColor.addBody(new FileLine("g=0", 19)); blackColor.addBody(new FileLine("b=0", 20)); blackColor.addBody(new FileLine(STR, 21)); ADLWidget redColor = new ADLWidget(STR, null, 27); redColor.addBody(new FileLine("r=255", 28)); redColor.addBody(new FileLine("g=0", 29)); redColor.addBody(new FileLine("b=0", 30)); redColor.addBody(new FileLine(STR, 31)); ADLWidget greenColor = new ADLWidget(STR, null, 32); greenColor.addBody(new FileLine("r=0", 33)); greenColor.addBody(new FileLine("g=255", 34)); greenColor.addBody(new FileLine("b=0", 35)); greenColor.addBody(new FileLine(STR, 36)); ADLWidget blueColor = new ADLWidget(STR, null, 37); blueColor.addBody(new FileLine("r=0", 38)); blueColor.addBody(new FileLine("b=255", 39)); blueColor.addBody(new FileLine("g=0", 40)); blueColor.addBody(new FileLine(STR, 41)); badColorMap4.addObject(whiteColor); badColorMap4.addObject(greyColor); badColorMap4.addObject(blackColor); badColorMap4.addObject(redColor); badColorMap4.addObject(greenColor); badColorMap4.addObject(blueColor); } /** * Test method for * {@link org.csstudio.utility.adlparser.fileParser.ColorMap#ColorMap(org.csstudio.utility.adlparser.fileParser.ADLWidget)}
/** * An example of a good color map */
An example of a good color map
buildDl_Color_BadColorMap4
{ "repo_name": "css-iter/cs-studio", "path": "applications/apputil/apputil-plugins/org.csstudio.utility.adlParser/test/org/csstudio/utility/adlparser/fileParser/ColorMapTest.java", "license": "epl-1.0", "size": 19630 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
287,322
protected void addInstanceTypePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_I2_xlarge_instanceType_feature"), getString("_UI_PropertyDescriptor_description", "_UI_I2_xlarge_instanceType_feature", "_UI_I2_xlarge_type"), Ec2Package.eINSTANCE.getI2_xlarge_InstanceType(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), Ec2Package.eINSTANCE.getI2_xlarge_InstanceType(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Instance Type feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Instance Type feature.
addInstanceTypePropertyDescriptor
{ "repo_name": "occiware/Multi-Cloud-Studio", "path": "plugins/org.eclipse.cmf.occi.multicloud.aws.ec2.edit/src-gen/org/eclipse/cmf/occi/multicloud/aws/ec2/provider/I2_xlargeItemProvider.java", "license": "epl-1.0", "size": 6989 }
[ "org.eclipse.cmf.occi.multicloud.aws.ec2.Ec2Package", "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor" ]
import org.eclipse.cmf.occi.multicloud.aws.ec2.Ec2Package; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.cmf.occi.multicloud.aws.ec2.*; import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.cmf", "org.eclipse.emf" ]
org.eclipse.cmf; org.eclipse.emf;
2,489,276
public DNASummary[] getSelected( DBconnection conn, List libraryIDs, String queryID ) throws SQLException { ArrayList found = null; LibrarySummary[] libraries = null; LibrarySummary library = null; ResultSet results = null; String query = "SELECT " + getTableColumns( "result" ) + " " + "FROM RESULT_LIBRARY WHERE QUERY_ID = '" + queryID + "' " + "AND library_id = ?"; conn.setQuery( query ); Iterator iter = libraryIDs.iterator(); while ( iter.hasNext() ) { conn.setQueryVariable( (Long) iter.next() ); results = conn.getResultSet(); while ( results.next() ) { library = getLibraryRow( results ); if ( found == null ) { found = new ArrayList(); } found.add( library ); } } conn.releaseResources(); if ( found != null && !found.isEmpty() ) { libraries = makeArray( conn, found ); } return libraries; }
DNASummary[] function( DBconnection conn, List libraryIDs, String queryID ) throws SQLException { ArrayList found = null; LibrarySummary[] libraries = null; LibrarySummary library = null; ResultSet results = null; String query = STR + getTableColumns( STR ) + " " + STR + queryID + STR + STR; conn.setQuery( query ); Iterator iter = libraryIDs.iterator(); while ( iter.hasNext() ) { conn.setQueryVariable( (Long) iter.next() ); results = conn.getResultSet(); while ( results.next() ) { library = getLibraryRow( results ); if ( found == null ) { found = new ArrayList(); } found.add( library ); } } conn.releaseResources(); if ( found != null && !found.isEmpty() ) { libraries = makeArray( conn, found ); } return libraries; }
/** * Retrieves selected libraries as <code>LibrarySummary</code> objects, * which implement the <code>DNASummary</code> interface, from result set * using supplied ids. This method is used for downloading information * for selected objects. * * @param conn An active connection to the database * @param stockIDs Selected stock ids to retrieve from total result set * @param sessionID User's session id. Used to retrieve data from person * specific temp table * @return Array of <code>LibrarySummary</code> objects * @throws SQLException thrown if a database error occurs */
Retrieves selected libraries as <code>LibrarySummary</code> objects, which implement the <code>DNASummary</code> interface, from result set using supplied ids. This method is used for downloading information for selected objects
getSelected
{ "repo_name": "tair/tairwebapp", "path": "src/org/tair/search/dna/LibrarySearcher.java", "license": "gpl-3.0", "size": 26002 }
[ "java.sql.ResultSet", "java.sql.SQLException", "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.tair.tfc.DBconnection" ]
import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.tair.tfc.DBconnection;
import java.sql.*; import java.util.*; import org.tair.tfc.*;
[ "java.sql", "java.util", "org.tair.tfc" ]
java.sql; java.util; org.tair.tfc;
118,630
public boolean processRealtimeStats(byte[] data) { HPlusDataRecordRealtime record; try{ record = new HPlusDataRecordRealtime(data); } catch(IllegalArgumentException e){ LOG.debug((e.getMessage())); return false; } //Skip duplicated messages as the device seems to send the same record multiple times //This can be used to detect the user is moving (not sleeping) if(prevRealTimeRecord != null && record.same(prevRealTimeRecord)) return true; prevRealTimeRecord = record; getDevice().setBatteryLevel(record.battery); //Skip when measuring heart rate //Calories and Distance are updated and these values will be lost. //Because a message with a valid Heart Rate will be provided, this loss very limited if(record.heartRate == ActivityKind.TYPE_NOT_MEASURED) { getDevice().setFirmwareVersion2("---"); getDevice().sendDeviceUpdateIntent(getContext()); }else { getDevice().setFirmwareVersion2("" + record.heartRate); getDevice().sendDeviceUpdateIntent(getContext()); } try (DBHandler dbHandler = GBApplication.acquireDB()) { HPlusHealthSampleProvider provider = new HPlusHealthSampleProvider(getDevice(), dbHandler.getDaoSession()); HPlusHealthActivitySample sample = createSample(dbHandler, record.timestamp); sample.setRawKind(record.type); sample.setRawIntensity(record.intensity); sample.setHeartRate(record.heartRate); sample.setDistance(record.distance); sample.setCalories(record.calories); sample.setSteps(record.steps); sample.setRawHPlusHealthData(record.getRawData()); sample.setProvider(provider); provider.addGBActivitySample(sample); sample.setSteps(sample.getSteps() - prevRealTimeRecord.steps); Intent intent = new Intent(DeviceService.ACTION_REALTIME_SAMPLES) .putExtra(DeviceService.EXTRA_REALTIME_SAMPLE, sample) .putExtra(DeviceService.EXTRA_TIMESTAMP, System.currentTimeMillis()); LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent); //TODO: Handle Active Time. With Overlay? } catch (GBException ex) { LOG.debug((ex.getMessage())); } catch (Exception ex) { LOG.debug(ex.getMessage()); } return true; }
boolean function(byte[] data) { HPlusDataRecordRealtime record; try{ record = new HPlusDataRecordRealtime(data); } catch(IllegalArgumentException e){ LOG.debug((e.getMessage())); return false; } if(prevRealTimeRecord != null && record.same(prevRealTimeRecord)) return true; prevRealTimeRecord = record; getDevice().setBatteryLevel(record.battery); if(record.heartRate == ActivityKind.TYPE_NOT_MEASURED) { getDevice().setFirmwareVersion2("---"); getDevice().sendDeviceUpdateIntent(getContext()); }else { getDevice().setFirmwareVersion2("" + record.heartRate); getDevice().sendDeviceUpdateIntent(getContext()); } try (DBHandler dbHandler = GBApplication.acquireDB()) { HPlusHealthSampleProvider provider = new HPlusHealthSampleProvider(getDevice(), dbHandler.getDaoSession()); HPlusHealthActivitySample sample = createSample(dbHandler, record.timestamp); sample.setRawKind(record.type); sample.setRawIntensity(record.intensity); sample.setHeartRate(record.heartRate); sample.setDistance(record.distance); sample.setCalories(record.calories); sample.setSteps(record.steps); sample.setRawHPlusHealthData(record.getRawData()); sample.setProvider(provider); provider.addGBActivitySample(sample); sample.setSteps(sample.getSteps() - prevRealTimeRecord.steps); Intent intent = new Intent(DeviceService.ACTION_REALTIME_SAMPLES) .putExtra(DeviceService.EXTRA_REALTIME_SAMPLE, sample) .putExtra(DeviceService.EXTRA_TIMESTAMP, System.currentTimeMillis()); LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent); } catch (GBException ex) { LOG.debug((ex.getMessage())); } catch (Exception ex) { LOG.debug(ex.getMessage()); } return true; }
/** * Process a message containing real time information * * @param data the message from the device * @return boolean indicating success or fail */
Process a message containing real time information
processRealtimeStats
{ "repo_name": "roidelapluie/Gadgetbridge", "path": "app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/hplus/HPlusHandlerThread.java", "license": "agpl-3.0", "size": 20853 }
[ "android.content.Intent", "android.support.v4.content.LocalBroadcastManager" ]
import android.content.Intent; import android.support.v4.content.LocalBroadcastManager;
import android.content.*; import android.support.v4.content.*;
[ "android.content", "android.support" ]
android.content; android.support;
2,746,183
@Override public TradeHistoryParams createTradeHistoryParams() { BitcoindeTradeHistoryParams params = new BitcoindeTradeHistoryParams(); params.setState(BitcoindeMyTrade.State.SUCCESSFUL); return params; }
TradeHistoryParams function() { BitcoindeTradeHistoryParams params = new BitcoindeTradeHistoryParams(); params.setState(BitcoindeMyTrade.State.SUCCESSFUL); return params; }
/** * Create trade history parameters with state specified to "Successful" * * @return tradeHistoryParams */
Create trade history parameters with state specified to "Successful"
createTradeHistoryParams
{ "repo_name": "stachon/XChange", "path": "xchange-bitcoinde/src/main/java/org/knowm/xchange/bitcoinde/v4/service/BitcoindeTradeService.java", "license": "mit", "size": 6126 }
[ "org.knowm.xchange.bitcoinde.v4.dto.trade.BitcoindeMyTrade", "org.knowm.xchange.service.trade.params.TradeHistoryParams" ]
import org.knowm.xchange.bitcoinde.v4.dto.trade.BitcoindeMyTrade; import org.knowm.xchange.service.trade.params.TradeHistoryParams;
import org.knowm.xchange.bitcoinde.v4.dto.trade.*; import org.knowm.xchange.service.trade.params.*;
[ "org.knowm.xchange" ]
org.knowm.xchange;
144,478
@Test public void testSetKeysIndex() { assertSame(-1, this.model.getKeysIndex()); this.model.setKeysIndex(2); assertSame(2, this.model.getKeysIndex()); }
void function() { assertSame(-1, this.model.getKeysIndex()); this.model.setKeysIndex(2); assertSame(2, this.model.getKeysIndex()); }
/** * Test method for {@link ch.unibe.iam.scg.archie.model.ChartModel#setKeysIndex(int)}. */
Test method for <code>ch.unibe.iam.scg.archie.model.ChartModel#setKeysIndex(int)</code>
testSetKeysIndex
{ "repo_name": "DavidGutknecht/elexis-3-base", "path": "bundles/ch.unibe.iam.scg.archie/src/ch/unibe/iam/scg/archie/tests/ChartModelTest.java", "license": "epl-1.0", "size": 8015 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,373,334
public JSDocInfo getOwnPropertyJSDocInfo(String propertyName) { return null; }
JSDocInfo function(String propertyName) { return null; }
/** * Gets the docInfo on the specified property on this type. This should not * be done implemented recursively, as you generally need to know exactly on * which type in the prototype chain the JSDocInfo exists. */
Gets the docInfo on the specified property on this type. This should not be done implemented recursively, as you generally need to know exactly on which type in the prototype chain the JSDocInfo exists
getOwnPropertyJSDocInfo
{ "repo_name": "Dandandan/wikiprogramming", "path": "jsrepl/tools/closure-compiler/trunk/src/com/google/javascript/rhino/jstype/ObjectType.java", "license": "mit", "size": 19192 }
[ "com.google.javascript.rhino.JSDocInfo" ]
import com.google.javascript.rhino.JSDocInfo;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
466,572
private void accelerate(float dt) { if (up) { float initialVelocity = (float) Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); if (initialVelocity < maxSpeed) { dx += MathUtils.cos(orientation) * acceleration * dt; dy += MathUtils.sin(orientation) * acceleration * dt; } acceleratingTimer += dt; if (acceleratingTimer > 0.1f) acceleratingTimer = 0; } else { acceleratingTimer = 0; } }
void function(float dt) { if (up) { float initialVelocity = (float) Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); if (initialVelocity < maxSpeed) { dx += MathUtils.cos(orientation) * acceleration * dt; dy += MathUtils.sin(orientation) * acceleration * dt; } acceleratingTimer += dt; if (acceleratingTimer > 0.1f) acceleratingTimer = 0; } else { acceleratingTimer = 0; } }
/** * Acceleration. * If the Ship velocity is less than its max speed, increase speed. * * @param dt Time elapsed */
Acceleration. If the Ship velocity is less than its max speed, increase speed
accelerate
{ "repo_name": "BlueDi/Evolution", "path": "src/entities/Ship.java", "license": "mit", "size": 14360 }
[ "com.badlogic.gdx.math.MathUtils" ]
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
1,178,342
EventQueue.invokeLater(new Runnable() {
EventQueue.invokeLater(new Runnable() {
/** * Launch the application. */
Launch the application
main
{ "repo_name": "JuanCarbo/POSFiscal", "path": "src/ui/ListaVentas.java", "license": "mit", "size": 6645 }
[ "java.awt.EventQueue" ]
import java.awt.EventQueue;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,279,801
@Test public void getKey() throws Exception { KeyStore ks = provider.getKeyStore(); RSAPrivateKey key = (RSAPrivateKey) ks.getKey("kangaroo", "kangaroo".toCharArray()); Certificate[] chain = provider.getKeyStore().getCertificateChain("kangaroo"); assertEquals(1, chain.length); RSAPublicKey pubKey = (RSAPublicKey) chain[0].getPublicKey(); assertEquals(key.getModulus(), pubKey.getModulus()); }
void function() throws Exception { KeyStore ks = provider.getKeyStore(); RSAPrivateKey key = (RSAPrivateKey) ks.getKey(STR, STR.toCharArray()); Certificate[] chain = provider.getKeyStore().getCertificateChain(STR); assertEquals(1, chain.length); RSAPublicKey pubKey = (RSAPublicKey) chain[0].getPublicKey(); assertEquals(key.getModulus(), pubKey.getModulus()); }
/** * Assert that the key is valid, and can be used to verify the cert. * * @throws Exception Should not be thrown. */
Assert that the key is valid, and can be used to verify the cert
getKey
{ "repo_name": "kangaroo-server/kangaroo", "path": "kangaroo-common/src/test/java/net/krotscheck/kangaroo/server/keystore/GeneratedKeystoreProviderTest.java", "license": "apache-2.0", "size": 7163 }
[ "java.security.KeyStore", "java.security.cert.Certificate", "java.security.interfaces.RSAPrivateKey", "java.security.interfaces.RSAPublicKey", "junit.framework.TestCase" ]
import java.security.KeyStore; import java.security.cert.Certificate; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import junit.framework.TestCase;
import java.security.*; import java.security.cert.*; import java.security.interfaces.*; import junit.framework.*;
[ "java.security", "junit.framework" ]
java.security; junit.framework;
2,548,801
private Response.ResponseBuilder createViolationResponse( Set<ConstraintViolation<?>> violations) { log.fine("Validation completed. violations found: " + violations.size()); Map<String, String> responseObj = new HashMap<String, String>(); for (ConstraintViolation<?> violation : violations) { responseObj.put(violation.getPropertyPath().toString(), violation.getMessage()); } return Response.status(Response.Status.BAD_REQUEST).entity(responseObj); }
Response.ResponseBuilder function( Set<ConstraintViolation<?>> violations) { log.fine(STR + violations.size()); Map<String, String> responseObj = new HashMap<String, String>(); for (ConstraintViolation<?> violation : violations) { responseObj.put(violation.getPropertyPath().toString(), violation.getMessage()); } return Response.status(Response.Status.BAD_REQUEST).entity(responseObj); }
/** * Creates a JAX-RS "Bad Request" response including a map of all violation * fields, and their message. This can then be used by clients to show * violations. * * @param violations * A set of violations that needs to be reported * @return JAX-RS response containing all violations */
Creates a JAX-RS "Bad Request" response including a map of all violation fields, and their message. This can then be used by clients to show violations
createViolationResponse
{ "repo_name": "uaijug/chronos", "path": "src/main/java/br/com/uaijug/chronos/blog/resources/PageResource.java", "license": "gpl-3.0", "size": 6614 }
[ "java.util.HashMap", "java.util.Map", "java.util.Set", "javax.validation.ConstraintViolation", "javax.ws.rs.core.Response" ]
import java.util.HashMap; import java.util.Map; import java.util.Set; import javax.validation.ConstraintViolation; import javax.ws.rs.core.Response;
import java.util.*; import javax.validation.*; import javax.ws.rs.core.*;
[ "java.util", "javax.validation", "javax.ws" ]
java.util; javax.validation; javax.ws;
2,790,548
public void abortTranslation(PascalErrorCode errorCode, Parser parser) { // Notify the parser's listeners and then abort. String fatalText = "FATAL ERROR: " + errorCode.toString(); parser.sendMessage(new Message(SYNTAX_ERROR, new Object[] { 0, 0, "", fatalText })); System.exit(errorCode.getStatus()); }
void function(PascalErrorCode errorCode, Parser parser) { String fatalText = STR + errorCode.toString(); parser.sendMessage(new Message(SYNTAX_ERROR, new Object[] { 0, 0, "", fatalText })); System.exit(errorCode.getStatus()); }
/** * Abort the translation. * * @param errorCode the error code. * @param parser the parser. */
Abort the translation
abortTranslation
{ "repo_name": "zavakid/parser-learning", "path": "src/main/java/com/zavakid/learn/parser/frontend/pascal/PascalErrorHandler.java", "license": "apache-2.0", "size": 1668 }
[ "com.zavakid.learn.parser.frontend.Parser", "com.zavakid.learn.parser.message.Message" ]
import com.zavakid.learn.parser.frontend.Parser; import com.zavakid.learn.parser.message.Message;
import com.zavakid.learn.parser.frontend.*; import com.zavakid.learn.parser.message.*;
[ "com.zavakid.learn" ]
com.zavakid.learn;
762,497
protected void sendSaslMessage(NegotiationStatus status, byte[] payload) throws TTransportException { if (payload == null) payload = new byte[0]; messageHeader[0] = status.getValue(); EncodingUtils.encodeBigEndian(payload.length, messageHeader, STATUS_BYTES); if (LOGGER.isDebugEnabled()) LOGGER.debug(getRole() + ": Writing message with status {} and payload length {}", status, payload.length); underlyingTransport.write(messageHeader); underlyingTransport.write(payload); underlyingTransport.flush(); }
void function(NegotiationStatus status, byte[] payload) throws TTransportException { if (payload == null) payload = new byte[0]; messageHeader[0] = status.getValue(); EncodingUtils.encodeBigEndian(payload.length, messageHeader, STATUS_BYTES); if (LOGGER.isDebugEnabled()) LOGGER.debug(getRole() + STR, status, payload.length); underlyingTransport.write(messageHeader); underlyingTransport.write(payload); underlyingTransport.flush(); }
/** * Send a complete Thrift SASL message. * * @param status * The status to send. * @param payload * The data to send as the payload of this message. * @throws TTransportException */
Send a complete Thrift SASL message
sendSaslMessage
{ "repo_name": "mapr/impala", "path": "thirdparty/thrift-0.9.0/lib/java/src/org/apache/thrift/transport/TSaslTransport.java", "license": "apache-2.0", "size": 17390 }
[ "org.apache.thrift.EncodingUtils" ]
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.*;
[ "org.apache.thrift" ]
org.apache.thrift;
1,553,882
@XmlElementRef public DefaultTelephone getElement() { return DefaultTelephone.castOrCopy(metadata); }
DefaultTelephone function() { return DefaultTelephone.castOrCopy(metadata); }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <cit:CI_Telephone>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */
Invoked by JAXB at marshalling time for getting the actual metadata to write inside the XML element. This is the value or a copy of the value given in argument to the wrap method
getElement
{ "repo_name": "apache/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Telephone.java", "license": "apache-2.0", "size": 3129 }
[ "org.apache.sis.metadata.iso.citation.DefaultTelephone" ]
import org.apache.sis.metadata.iso.citation.DefaultTelephone;
import org.apache.sis.metadata.iso.citation.*;
[ "org.apache.sis" ]
org.apache.sis;
134,483
public static final void encodeQuotedPrintable (final int b, @Nonnull final NonBlockingByteArrayOutputStream aBAOS) { final char cHigh = Character.toUpperCase (StringHelper.getHexChar ((b >> 4) & 0xF)); final char cLow = Character.toUpperCase (StringHelper.getHexChar (b & 0xF)); aBAOS.write (ESCAPE_CHAR); aBAOS.write (cHigh); aBAOS.write (cLow); }
static final void function (final int b, @Nonnull final NonBlockingByteArrayOutputStream aBAOS) { final char cHigh = Character.toUpperCase (StringHelper.getHexChar ((b >> 4) & 0xF)); final char cLow = Character.toUpperCase (StringHelper.getHexChar (b & 0xF)); aBAOS.write (ESCAPE_CHAR); aBAOS.write (cHigh); aBAOS.write (cLow); }
/** * Encodes byte into its quoted-printable representation. * * @param b * byte to encode * @param aBAOS * the buffer to write to */
Encodes byte into its quoted-printable representation
encodeQuotedPrintable
{ "repo_name": "lsimons/phloc-schematron-standalone", "path": "phloc-commons/src/main/java/com/phloc/commons/codec/QuotedPrintableCodec.java", "license": "apache-2.0", "size": 7579 }
[ "com.phloc.commons.io.streams.NonBlockingByteArrayOutputStream", "com.phloc.commons.string.StringHelper", "javax.annotation.Nonnull" ]
import com.phloc.commons.io.streams.NonBlockingByteArrayOutputStream; import com.phloc.commons.string.StringHelper; import javax.annotation.Nonnull;
import com.phloc.commons.io.streams.*; import com.phloc.commons.string.*; import javax.annotation.*;
[ "com.phloc.commons", "javax.annotation" ]
com.phloc.commons; javax.annotation;
818,533
private void buildMap() { for (Attribute attribute : this.attributes) { List<Attribute> listAttributes = this.attributesById.get(attribute.getAttributeId()); if (listAttributes == null) { listAttributes = new ArrayList<Attribute>(); this.attributesById.put(attribute.getAttributeId(), listAttributes); } listAttributes.add(attribute); } } public StdMutableAttributeCategory() { } public StdMutableAttributeCategory(Identifier identifierCategory, Collection<Attribute> listAttributes) { this.category = identifierCategory; if (listAttributes != null) { this.attributes.addAll(listAttributes); this.buildMap(); } } public StdMutableAttributeCategory(AttributeCategory attributeCategory) { this.category = attributeCategory.getCategory(); this.attributes.addAll(attributeCategory.getAttributes()); this.buildMap(); }
void function() { for (Attribute attribute : this.attributes) { List<Attribute> listAttributes = this.attributesById.get(attribute.getAttributeId()); if (listAttributes == null) { listAttributes = new ArrayList<Attribute>(); this.attributesById.put(attribute.getAttributeId(), listAttributes); } listAttributes.add(attribute); } } public StdMutableAttributeCategory() { } public StdMutableAttributeCategory(Identifier identifierCategory, Collection<Attribute> listAttributes) { this.category = identifierCategory; if (listAttributes != null) { this.attributes.addAll(listAttributes); this.buildMap(); } } public StdMutableAttributeCategory(AttributeCategory attributeCategory) { this.category = attributeCategory.getCategory(); this.attributes.addAll(attributeCategory.getAttributes()); this.buildMap(); }
/** * Builds the <code>Map</code> from {@link org.apache.openaz.xacml.api.Identifier}s for XACML AttributeIds * to {@link org.apache.openaz.xacml.api.Attribute}s. */
Builds the <code>Map</code> from <code>org.apache.openaz.xacml.api.Identifier</code>s for XACML AttributeIds to <code>org.apache.openaz.xacml.api.Attribute</code>s
buildMap
{ "repo_name": "dash-/apache-openaz", "path": "openaz-xacml/src/main/java/org/apache/openaz/xacml/std/StdMutableAttributeCategory.java", "license": "apache-2.0", "size": 7723 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.List", "org.apache.openaz.xacml.api.Attribute", "org.apache.openaz.xacml.api.AttributeCategory", "org.apache.openaz.xacml.api.Identifier" ]
import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.openaz.xacml.api.Attribute; import org.apache.openaz.xacml.api.AttributeCategory; import org.apache.openaz.xacml.api.Identifier;
import java.util.*; import org.apache.openaz.xacml.api.*;
[ "java.util", "org.apache.openaz" ]
java.util; org.apache.openaz;
2,678,089
public double[] value(double x) throws NoDataException { // safety check checkInterpolation(); final double[] value = new double[topDiagonal.get(0).length]; double valueCoeff = 1; for (int i = 0; i < topDiagonal.size(); ++i) { double[] dividedDifference = topDiagonal.get(i); for (int k = 0; k < value.length; ++k) { value[k] += dividedDifference[k] * valueCoeff; } final double deltaX = x - abscissae.get(i); valueCoeff *= deltaX; } return value; }
double[] function(double x) throws NoDataException { checkInterpolation(); final double[] value = new double[topDiagonal.get(0).length]; double valueCoeff = 1; for (int i = 0; i < topDiagonal.size(); ++i) { double[] dividedDifference = topDiagonal.get(i); for (int k = 0; k < value.length; ++k) { value[k] += dividedDifference[k] * valueCoeff; } final double deltaX = x - abscissae.get(i); valueCoeff *= deltaX; } return value; }
/** Interpolate value at a specified abscissa. * <p> * Calling this method is equivalent to call the {@link PolynomialFunction#value(double) * value} methods of all polynomials returned by {@link #getPolynomials() getPolynomials}, * except it does not build the intermediate polynomials, so this method is faster and * numerically more stable. * </p> * @param x interpolation abscissa * @return interpolated value * @exception NoDataException if sample is empty */
Interpolate value at a specified abscissa. Calling this method is equivalent to call the <code>PolynomialFunction#value(double) value</code> methods of all polynomials returned by <code>#getPolynomials() getPolynomials</code>, except it does not build the intermediate polynomials, so this method is faster and numerically more stable.
value
{ "repo_name": "charles-cooper/idylfin", "path": "src/org/apache/commons/math3/analysis/interpolation/HermiteInterpolator.java", "license": "apache-2.0", "size": 9494 }
[ "org.apache.commons.math3.exception.NoDataException" ]
import org.apache.commons.math3.exception.NoDataException;
import org.apache.commons.math3.exception.*;
[ "org.apache.commons" ]
org.apache.commons;
80,759
protected Collection<JcrRepository> repositories() { if (this.state == State.RUNNING) { final Lock lock = this.lock.readLock(); try { lock.lock(); return new ArrayList<JcrRepository>(repositories.values()); } finally { lock.unlock(); } } return Collections.emptyList(); }
Collection<JcrRepository> function() { if (this.state == State.RUNNING) { final Lock lock = this.lock.readLock(); try { lock.lock(); return new ArrayList<JcrRepository>(repositories.values()); } finally { lock.unlock(); } } return Collections.emptyList(); }
/** * Returns a copy of the repositories. Note that when returned, not all repositories may be active. * * @return a copy of the repositories; never null */
Returns a copy of the repositories. Note that when returned, not all repositories may be active
repositories
{ "repo_name": "pleacu/modeshape", "path": "modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java", "license": "apache-2.0", "size": 28070 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Collections", "java.util.concurrent.locks.Lock" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.concurrent.locks.Lock;
import java.util.*; import java.util.concurrent.locks.*;
[ "java.util" ]
java.util;
1,758,893
@Test public void testBasico() throws ParametrosNoValidosException { List<POJOPartida> partidas = new ArrayList<POJOPartida>(); final int CANTIDAD_PARTIDAS = 3; for (int i = 0; i < CANTIDAD_PARTIDAS; i++) { partidas.add(new POJOPartida(new POJOCreacionPartida(5, 5, "test"), "juan")); } Gson gson = new Gson(); ControladorListadoPartidas controlador = new ControladorListadoPartidas(); RespuestaGenerica respuesta = gson.fromJson(controlador.procesar( gson.toJson(new POJOListadoPartidas(partidas))), RespuestaGenerica.class); Assert.assertTrue(respuesta.fuePeticionExitosa()); Assert.assertNotNull(partidasRecibidas); Assert.assertEquals(partidas, partidasRecibidas.getPartidas()); }
void function() throws ParametrosNoValidosException { List<POJOPartida> partidas = new ArrayList<POJOPartida>(); final int CANTIDAD_PARTIDAS = 3; for (int i = 0; i < CANTIDAD_PARTIDAS; i++) { partidas.add(new POJOPartida(new POJOCreacionPartida(5, 5, "test"), "juan")); } Gson gson = new Gson(); ControladorListadoPartidas controlador = new ControladorListadoPartidas(); RespuestaGenerica respuesta = gson.fromJson(controlador.procesar( gson.toJson(new POJOListadoPartidas(partidas))), RespuestaGenerica.class); Assert.assertTrue(respuesta.fuePeticionExitosa()); Assert.assertNotNull(partidasRecibidas); Assert.assertEquals(partidas, partidasRecibidas.getPartidas()); }
/** * Prueba crear un par de partidas y recuperarlas. * @throws ParametrosNoValidosException */
Prueba crear un par de partidas y recuperarlas
testBasico
{ "repo_name": "nicolassatragno/zombieland", "path": "zombieland-cliente/test/com/rzg/zombieland/cliente/comunicacion/controlador/ControladorListadoPartidasTest.java", "license": "lgpl-3.0", "size": 3047 }
[ "com.google.gson.Gson", "com.rzg.zombieland.comunes.comunicacion.pojo.POJOCreacionPartida", "com.rzg.zombieland.comunes.comunicacion.pojo.POJOPartida", "com.rzg.zombieland.comunes.comunicacion.respuesta.POJOListadoPartidas", "com.rzg.zombieland.comunes.comunicacion.respuesta.RespuestaGenerica", "com.rzg.zombieland.comunes.misc.ParametrosNoValidosException", "java.util.ArrayList", "java.util.List", "org.junit.Assert" ]
import com.google.gson.Gson; import com.rzg.zombieland.comunes.comunicacion.pojo.POJOCreacionPartida; import com.rzg.zombieland.comunes.comunicacion.pojo.POJOPartida; import com.rzg.zombieland.comunes.comunicacion.respuesta.POJOListadoPartidas; import com.rzg.zombieland.comunes.comunicacion.respuesta.RespuestaGenerica; import com.rzg.zombieland.comunes.misc.ParametrosNoValidosException; import java.util.ArrayList; import java.util.List; import org.junit.Assert;
import com.google.gson.*; import com.rzg.zombieland.comunes.comunicacion.pojo.*; import com.rzg.zombieland.comunes.comunicacion.respuesta.*; import com.rzg.zombieland.comunes.misc.*; import java.util.*; import org.junit.*;
[ "com.google.gson", "com.rzg.zombieland", "java.util", "org.junit" ]
com.google.gson; com.rzg.zombieland; java.util; org.junit;
1,968,499
public void show(String title) { final Display display = new Display(null, true); voxels.forEach(v -> display.addObject(v.getView())); display.run(); }
void function(String title) { final Display display = new Display(null, true); voxels.forEach(v -> display.addObject(v.getView())); display.run(); }
/** * Display voxels in an new Window * <pre><code> * Voxel v = new Voxel(new Point(minx, miny, minz), new Point(maxx, maxy, maxz)); * Voxels voxels=new Voxels(); * voxels.add(v); * final Display display = new Display(null, true); * voxels.forEach(v -> display.addObject(v.getView())); * display.run(); * </code></pre> * * @param title Window title */
Display voxels in an new Window <code><code> Voxel v = new Voxel(new Point(minx, miny, minz), new Point(maxx, maxy, maxz)); Voxels voxels=new Voxels(); voxels.add(v); final Display display = new Display(null, true); voxels.forEach(v -> display.addObject(v.getView())); display.run(); </code></code>
show
{ "repo_name": "JJponciano/JavaPointCloud", "path": "src/main/java/info/ponciano/lab/jpc/pointcloud/stucture/octree/Voxels.java", "license": "lgpl-3.0", "size": 7308 }
[ "info.ponciano.lab.jpc.opengl.Display" ]
import info.ponciano.lab.jpc.opengl.Display;
import info.ponciano.lab.jpc.opengl.*;
[ "info.ponciano.lab" ]
info.ponciano.lab;
2,330,061
public static boolean hasTransientState(@NonNull View view) { if (Build.VERSION.SDK_INT >= 16) { return Api16Impl.hasTransientState(view); } return false; }
static boolean function(@NonNull View view) { if (Build.VERSION.SDK_INT >= 16) { return Api16Impl.hasTransientState(view); } return false; }
/** * Indicates whether the view is currently tracking transient state that the * app should not need to concern itself with saving and restoring, but that * the framework should take special note to preserve when possible. * * @param view View to check for transient state * @return true if the view has transient state */
Indicates whether the view is currently tracking transient state that the app should not need to concern itself with saving and restoring, but that the framework should take special note to preserve when possible
hasTransientState
{ "repo_name": "AndroidX/androidx", "path": "core/core/src/main/java/androidx/core/view/ViewCompat.java", "license": "apache-2.0", "size": 224652 }
[ "android.os.Build", "android.view.View", "androidx.annotation.NonNull" ]
import android.os.Build; import android.view.View; import androidx.annotation.NonNull;
import android.os.*; import android.view.*; import androidx.annotation.*;
[ "android.os", "android.view", "androidx.annotation" ]
android.os; android.view; androidx.annotation;
605,199
public BastionHostIPConfiguration withPublicIPAddress(SubResource publicIPAddress) { this.publicIPAddress = publicIPAddress; return this; }
BastionHostIPConfiguration function(SubResource publicIPAddress) { this.publicIPAddress = publicIPAddress; return this; }
/** * Set reference of the PublicIP resource. * * @param publicIPAddress the publicIPAddress value to set * @return the BastionHostIPConfiguration object itself. */
Set reference of the PublicIP resource
withPublicIPAddress
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/network/v2019_04_01/BastionHostIPConfiguration.java", "license": "mit", "size": 5038 }
[ "com.microsoft.azure.SubResource" ]
import com.microsoft.azure.SubResource;
import com.microsoft.azure.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
235,387
public DemoBuilder addComponent(Object parent, String target, ModelComponent componentToAdd) { effect(parent, makeAddComponent(target, componentToAdd)); return this; } // ////////////////////////////////////////////////////////// // Methods for making model pieces (do not modify entities) // ///////////////////////////////////////////////////////// /** * Creates a * {@link es.eucm.ead.schema.effects.controlstructures.ControlStructure} * effect of the given type ({@code clazz} ) with the given * {@code condition} * * @param clazz * Type of control structure. Could be * {@link es.eucm.ead.schema.effects.controlstructures.If}, * {@link es.eucm.ead.schema.effects.controlstructures.IfThenElseIf}
DemoBuilder function(Object parent, String target, ModelComponent componentToAdd) { effect(parent, makeAddComponent(target, componentToAdd)); return this; } /** * Creates a * {@link es.eucm.ead.schema.effects.controlstructures.ControlStructure} * effect of the given type ({@code clazz} ) with the given * {@code condition} * * @param clazz * Type of control structure. Could be * {@link es.eucm.ead.schema.effects.controlstructures.If}, * {@link es.eucm.ead.schema.effects.controlstructures.IfThenElseIf}
/** * Creates an {@link es.eucm.ead.schema.effects.AddComponent} effect with * the given {@code target} and {@code componentToAdd} and adds it to the * given {@code parent} container. For container supported types, see * {@link #effect(Object, es.eucm.ead.schema.effects.Effect)}. */
Creates an <code>es.eucm.ead.schema.effects.AddComponent</code> effect with the given target and componentToAdd and adds it to the given parent container. For container supported types, see <code>#effect(Object, es.eucm.ead.schema.effects.Effect)</code>
addComponent
{ "repo_name": "gorco/ead", "path": "editor/desktop/src/main/java/es/eucm/ead/editor/demobuilder/DemoBuilder.java", "license": "gpl-3.0", "size": 43690 }
[ "es.eucm.ead.schema.components.ModelComponent", "es.eucm.ead.schema.effects.controlstructures.ControlStructure" ]
import es.eucm.ead.schema.components.ModelComponent; import es.eucm.ead.schema.effects.controlstructures.ControlStructure;
import es.eucm.ead.schema.components.*; import es.eucm.ead.schema.effects.controlstructures.*;
[ "es.eucm.ead" ]
es.eucm.ead;
1,037,172
void remove(SecurableResourceId resourceId, IAuthorizationContext authCtx) throws UnauthorizedAccessAttemptException, EntityNotFoundException;
void remove(SecurableResourceId resourceId, IAuthorizationContext authCtx) throws UnauthorizedAccessAttemptException, EntityNotFoundException;
/** * Remove the existing resource from the authorization infrastructure together * with its references and extra grants. * * @param resourceId The id of the resource to unregister. * @param authCtx The <code>IAuthorizationContext</code> used to authorize * this operation. * * @throws UnauthorizedAccessAttemptException If the given * <code>IAuthorizationContext</code> doesn't have a sufficient role. * @throws EntityNotFoundException If the resource doesn't exist. */
Remove the existing resource from the authorization infrastructure together with its references and extra grants
remove
{ "repo_name": "kit-data-manager/base", "path": "Authorization/src/main/java/edu/kit/dama/authorization/services/administration/IResourceService.java", "license": "apache-2.0", "size": 18423 }
[ "edu.kit.dama.authorization.entities.IAuthorizationContext", "edu.kit.dama.authorization.entities.SecurableResourceId", "edu.kit.dama.authorization.exceptions.EntityNotFoundException", "edu.kit.dama.authorization.exceptions.UnauthorizedAccessAttemptException" ]
import edu.kit.dama.authorization.entities.IAuthorizationContext; import edu.kit.dama.authorization.entities.SecurableResourceId; import edu.kit.dama.authorization.exceptions.EntityNotFoundException; import edu.kit.dama.authorization.exceptions.UnauthorizedAccessAttemptException;
import edu.kit.dama.authorization.entities.*; import edu.kit.dama.authorization.exceptions.*;
[ "edu.kit.dama" ]
edu.kit.dama;
629,476
public Map<String,Object> pUnitProperties(Dictionary dict) { Map<String,Object> props = new HashMap<String,Object>(); Enumeration keysEnum = dict.keys(); // Dump in all of the config props while (keysEnum.hasMoreElements()) { String key = (String)keysEnum.nextElement(); props.put(key, dict.get(key)); } // Now remove all the ones we know are not actual persistence "<properties>" props.remove(GeminiPersistenceUnitProperties.PUNIT_NAME); props.remove(GeminiPersistenceUnitProperties.PUNIT_BSN); props.remove(GeminiPersistenceUnitProperties.PUNIT_CLASSES); props.remove(GeminiPersistenceUnitProperties.PUNIT_EXCLUDE_UNLISTED_CLASSES); props.remove(GeminiPersistenceUnitProperties.PUNIT_REFRESH); props.remove(GeminiUtil.JPA_PROVIDER_PROPERTY); // Don't expect this, but remove if present props.remove(Constants.SERVICE_PID); props.remove(ConfigurationAdmin.SERVICE_FACTORYPID); props.remove(ConfigurationAdmin.SERVICE_BUNDLELOCATION); return props; }
Map<String,Object> function(Dictionary dict) { Map<String,Object> props = new HashMap<String,Object>(); Enumeration keysEnum = dict.keys(); while (keysEnum.hasMoreElements()) { String key = (String)keysEnum.nextElement(); props.put(key, dict.get(key)); } props.remove(GeminiPersistenceUnitProperties.PUNIT_NAME); props.remove(GeminiPersistenceUnitProperties.PUNIT_BSN); props.remove(GeminiPersistenceUnitProperties.PUNIT_CLASSES); props.remove(GeminiPersistenceUnitProperties.PUNIT_EXCLUDE_UNLISTED_CLASSES); props.remove(GeminiPersistenceUnitProperties.PUNIT_REFRESH); props.remove(GeminiUtil.JPA_PROVIDER_PROPERTY); props.remove(Constants.SERVICE_PID); props.remove(ConfigurationAdmin.SERVICE_FACTORYPID); props.remove(ConfigurationAdmin.SERVICE_BUNDLELOCATION); return props; }
/** * Helper method to remove all of the reserved config properties and * treat the rest as persistence descriptor <property> elements. */
Helper method to remove all of the reserved config properties and treat the rest as persistence descriptor elements
pUnitProperties
{ "repo_name": "lunifera/lunifera-gemini-jpa", "path": "org.lunifera.org.eclipse.gemini.jpa/src/org/eclipse/gemini/jpa/configadmin/PersistenceUnitConfiguration.java", "license": "epl-1.0", "size": 9686 }
[ "java.util.Dictionary", "java.util.Enumeration", "java.util.HashMap", "java.util.Map", "org.eclipse.gemini.jpa.GeminiPersistenceUnitProperties", "org.eclipse.gemini.jpa.GeminiUtil", "org.osgi.framework.Constants", "org.osgi.service.cm.ConfigurationAdmin" ]
import java.util.Dictionary; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import org.eclipse.gemini.jpa.GeminiPersistenceUnitProperties; import org.eclipse.gemini.jpa.GeminiUtil; import org.osgi.framework.Constants; import org.osgi.service.cm.ConfigurationAdmin;
import java.util.*; import org.eclipse.gemini.jpa.*; import org.osgi.framework.*; import org.osgi.service.cm.*;
[ "java.util", "org.eclipse.gemini", "org.osgi.framework", "org.osgi.service" ]
java.util; org.eclipse.gemini; org.osgi.framework; org.osgi.service;
2,187,314
public boolean addElement(E element, int index) { if (fElements.contains(element)) { return false; } fElements.add(index, element); if (isOkToUse(fTableControl)) { fTable.refresh(); fTable.setSelection(new StructuredSelection(element)); } dialogFieldChanged(); return true; }
boolean function(E element, int index) { if (fElements.contains(element)) { return false; } fElements.add(index, element); if (isOkToUse(fTableControl)) { fTable.refresh(); fTable.setSelection(new StructuredSelection(element)); } dialogFieldChanged(); return true; }
/** * Adds an element at a position. */
Adds an element at a position
addElement
{ "repo_name": "elucash/eclipse-oxygen", "path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java", "license": "epl-1.0", "size": 25112 }
[ "org.eclipse.jface.viewers.StructuredSelection" ]
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,538,493
@Authorized( { PrivilegeConstants.PURGE_USERS }) public void purgeUser(User user) throws APIException;
@Authorized( { PrivilegeConstants.PURGE_USERS }) void function(User user) throws APIException;
/** * Completely remove a location from the database (not reversible). This method delegates to * #purgeLocation(location, boolean) method. * * @param user the User to remove from the database. * @should delete given user */
Completely remove a location from the database (not reversible). This method delegates to #purgeLocation(location, boolean) method
purgeUser
{ "repo_name": "Winbobob/openmrs-core", "path": "api/src/main/java/org/openmrs/api/UserService.java", "license": "mpl-2.0", "size": 21666 }
[ "org.openmrs.User", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import org.openmrs.User; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "org.openmrs", "org.openmrs.annotation", "org.openmrs.util" ]
org.openmrs; org.openmrs.annotation; org.openmrs.util;
2,198,744
protected byte[] execute(Connection conn) throws SQLException, UnsupportedEncodingException, IOException, UnsupportedOperationException { log.debug("executing jdbc"); Statement stmt = null; try { // Based on query return value, get results String _queryType = getQueryType(); if (SELECT.equals(_queryType)) { stmt = conn.createStatement(); stmt.setQueryTimeout(getIntegerQueryTimeout()); ResultSet rs = null; try { rs = stmt.executeQuery(getQuery()); return getStringFromResultSet(rs).getBytes(ENCODING); } finally { close(rs); } } else if (CALLABLE.equals(_queryType)) { CallableStatement cstmt = getCallableStatement(conn); int out[]=setArguments(cstmt); // A CallableStatement can return more than 1 ResultSets // plus a number of update counts. boolean hasResultSet = cstmt.execute(); String sb = resultSetsToString(cstmt,hasResultSet, out); return sb.getBytes(ENCODING); } else if (UPDATE.equals(_queryType)) { stmt = conn.createStatement(); stmt.setQueryTimeout(getIntegerQueryTimeout()); stmt.executeUpdate(getQuery()); int updateCount = stmt.getUpdateCount(); String results = updateCount + " updates"; return results.getBytes(ENCODING); } else if (PREPARED_SELECT.equals(_queryType)) { PreparedStatement pstmt = getPreparedStatement(conn); setArguments(pstmt); ResultSet rs = null; try { rs = pstmt.executeQuery(); return getStringFromResultSet(rs).getBytes(ENCODING); } finally { close(rs); } } else if (PREPARED_UPDATE.equals(_queryType)) { PreparedStatement pstmt = getPreparedStatement(conn); setArguments(pstmt); pstmt.executeUpdate(); String sb = resultSetsToString(pstmt,false,null); return sb.getBytes(ENCODING); } else if (ROLLBACK.equals(_queryType)){ conn.rollback(); return ROLLBACK.getBytes(ENCODING); } else if (COMMIT.equals(_queryType)){ conn.commit(); return COMMIT.getBytes(ENCODING); } else if (AUTOCOMMIT_FALSE.equals(_queryType)){ conn.setAutoCommit(false); return AUTOCOMMIT_FALSE.getBytes(ENCODING); } else if (AUTOCOMMIT_TRUE.equals(_queryType)){ conn.setAutoCommit(true); return AUTOCOMMIT_TRUE.getBytes(ENCODING); } else { // User provided incorrect query type throw new UnsupportedOperationException("Unexpected query type: "+_queryType); } } finally { close(stmt); } }
byte[] function(Connection conn) throws SQLException, UnsupportedEncodingException, IOException, UnsupportedOperationException { log.debug(STR); Statement stmt = null; try { String _queryType = getQueryType(); if (SELECT.equals(_queryType)) { stmt = conn.createStatement(); stmt.setQueryTimeout(getIntegerQueryTimeout()); ResultSet rs = null; try { rs = stmt.executeQuery(getQuery()); return getStringFromResultSet(rs).getBytes(ENCODING); } finally { close(rs); } } else if (CALLABLE.equals(_queryType)) { CallableStatement cstmt = getCallableStatement(conn); int out[]=setArguments(cstmt); boolean hasResultSet = cstmt.execute(); String sb = resultSetsToString(cstmt,hasResultSet, out); return sb.getBytes(ENCODING); } else if (UPDATE.equals(_queryType)) { stmt = conn.createStatement(); stmt.setQueryTimeout(getIntegerQueryTimeout()); stmt.executeUpdate(getQuery()); int updateCount = stmt.getUpdateCount(); String results = updateCount + STR; return results.getBytes(ENCODING); } else if (PREPARED_SELECT.equals(_queryType)) { PreparedStatement pstmt = getPreparedStatement(conn); setArguments(pstmt); ResultSet rs = null; try { rs = pstmt.executeQuery(); return getStringFromResultSet(rs).getBytes(ENCODING); } finally { close(rs); } } else if (PREPARED_UPDATE.equals(_queryType)) { PreparedStatement pstmt = getPreparedStatement(conn); setArguments(pstmt); pstmt.executeUpdate(); String sb = resultSetsToString(pstmt,false,null); return sb.getBytes(ENCODING); } else if (ROLLBACK.equals(_queryType)){ conn.rollback(); return ROLLBACK.getBytes(ENCODING); } else if (COMMIT.equals(_queryType)){ conn.commit(); return COMMIT.getBytes(ENCODING); } else if (AUTOCOMMIT_FALSE.equals(_queryType)){ conn.setAutoCommit(false); return AUTOCOMMIT_FALSE.getBytes(ENCODING); } else if (AUTOCOMMIT_TRUE.equals(_queryType)){ conn.setAutoCommit(true); return AUTOCOMMIT_TRUE.getBytes(ENCODING); } else { throw new UnsupportedOperationException(STR+_queryType); } } finally { close(stmt); } }
/** * Execute the test element. * * @param conn a {@link SampleResult} in case the test should sample; <code>null</code> if only execution is requested * @return the result of the execute command * @throws SQLException if a database error occurs * @throws UnsupportedEncodingException when the result can not be converted to the required charset * @throws IOException when I/O error occurs * @throws UnsupportedOperationException if the user provided incorrect query type */
Execute the test element
execute
{ "repo_name": "ThiagoGarciaAlves/jmeter", "path": "src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java", "license": "apache-2.0", "size": 25879 }
[ "java.io.IOException", "java.io.UnsupportedEncodingException", "java.sql.CallableStatement", "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import java.io.IOException; import java.io.UnsupportedEncodingException; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
2,057,876
private OverflowBlob setStreamAsTempData(MessageFormatter messageFormatter,MessageContext msgContext,OMOutputFormat format) throws IOException { OverflowBlob serialized = new OverflowBlob(256, 4096, "http-nio_", ".dat"); OutputStream out = serialized.getOutputStream(); try { messageFormatter.writeTo(msgContext, format, out, false); } finally { out.close(); } return serialized; }
OverflowBlob function(MessageFormatter messageFormatter,MessageContext msgContext,OMOutputFormat format) throws IOException { OverflowBlob serialized = new OverflowBlob(256, 4096, STR, ".dat"); OutputStream out = serialized.getOutputStream(); try { messageFormatter.writeTo(msgContext, format, out, false); } finally { out.close(); } return serialized; }
/** * Write the stream to a temporary storage and calculate the content length * * @throws IOException if an exception occurred while writing data */
Write the stream to a temporary storage and calculate the content length
setStreamAsTempData
{ "repo_name": "maheshika/wso2-synapse", "path": "modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/PassThroughHttpSender.java", "license": "apache-2.0", "size": 26835 }
[ "java.io.IOException", "java.io.OutputStream", "org.apache.axiom.om.OMOutputFormat", "org.apache.axiom.util.blob.OverflowBlob", "org.apache.axis2.context.MessageContext", "org.apache.axis2.transport.MessageFormatter" ]
import java.io.IOException; import java.io.OutputStream; import org.apache.axiom.om.OMOutputFormat; import org.apache.axiom.util.blob.OverflowBlob; import org.apache.axis2.context.MessageContext; import org.apache.axis2.transport.MessageFormatter;
import java.io.*; import org.apache.axiom.om.*; import org.apache.axiom.util.blob.*; import org.apache.axis2.context.*; import org.apache.axis2.transport.*;
[ "java.io", "org.apache.axiom", "org.apache.axis2" ]
java.io; org.apache.axiom; org.apache.axis2;
241,869
public void forgetTemporaryStateInImplications() { if( frozen ) throw new IllegalStateException("Cannot change frozen object. Get a mutable copy to do this."); List<Pair<Aliasing, ConsList<Implication>>> new_entries = new LinkedList<Pair<Aliasing, ConsList<Implication>>>(); for(Map.Entry<Aliasing, ConsList<Implication>> impls : knownImplications.entrySet()) { ConsList<Implication> cur_list = impls.getValue();
void function() { if( frozen ) throw new IllegalStateException(STR); List<Pair<Aliasing, ConsList<Implication>>> new_entries = new LinkedList<Pair<Aliasing, ConsList<Implication>>>(); for(Map.Entry<Aliasing, ConsList<Implication>> impls : knownImplications.entrySet()) { ConsList<Implication> cur_list = impls.getValue();
/** * Remove temporary state information for all of the implications * contained by this DynamicStateLogic object. */
Remove temporary state information for all of the implications contained by this DynamicStateLogic object
forgetTemporaryStateInImplications
{ "repo_name": "plaidgroup/plural", "path": "Plural/src/edu/cmu/cs/plural/concrete/DynamicStateLogic.java", "license": "gpl-2.0", "size": 26879 }
[ "edu.cmu.cs.crystal.analysis.alias.Aliasing", "edu.cmu.cs.crystal.util.ConsList", "edu.cmu.cs.crystal.util.Pair", "java.util.LinkedList", "java.util.List", "java.util.Map" ]
import edu.cmu.cs.crystal.analysis.alias.Aliasing; import edu.cmu.cs.crystal.util.ConsList; import edu.cmu.cs.crystal.util.Pair; import java.util.LinkedList; import java.util.List; import java.util.Map;
import edu.cmu.cs.crystal.analysis.alias.*; import edu.cmu.cs.crystal.util.*; import java.util.*;
[ "edu.cmu.cs", "java.util" ]
edu.cmu.cs; java.util;
1,968,214
private static String createFileTypeInCondition(Collection<String> mimeTypes) { String types = StringUtils.join(mimeTypes, "', '"); return "mime_type IN ('" + types + "')"; }
static String function(Collection<String> mimeTypes) { String types = StringUtils.join(mimeTypes, STR); return STR + types + "')"; }
/** * Converts a list of MIME types into an SQL "mime_type IN" condition. * * @param mimeTypes The MIIME types. * * @return The condition string. */
Converts a list of MIME types into an SQL "mime_type IN" condition
createFileTypeInCondition
{ "repo_name": "dgrove727/autopsy", "path": "Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java", "license": "apache-2.0", "size": 30949 }
[ "java.util.Collection", "org.apache.commons.lang3.StringUtils" ]
import java.util.Collection; import org.apache.commons.lang3.StringUtils;
import java.util.*; import org.apache.commons.lang3.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
1,162,825
@Test public void testGetRowKey() { TaskSeriesCollection c = createCollection1(); assertEquals("S1", c.getRowKey(0)); assertEquals("S2", c.getRowKey(1)); }
void function() { TaskSeriesCollection c = createCollection1(); assertEquals("S1", c.getRowKey(0)); assertEquals("S2", c.getRowKey(1)); }
/** * Some tests for the getRowKey() method. */
Some tests for the getRowKey() method
testGetRowKey
{ "repo_name": "simon04/jfreechart", "path": "src/test/java/org/jfree/data/gantt/TaskSeriesCollectionTest.java", "license": "lgpl-2.1", "size": 23212 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,099,321
public void testCreateExtendedResponse005() { StartTlsRequest str = new StartTlsRequest(); try { str.createExtendedResponse("", null, 1, 2); fail("NamingException expected"); } catch (NamingException e) {} }
void function() { StartTlsRequest str = new StartTlsRequest(); try { str.createExtendedResponse(STRNamingException expected"); } catch (NamingException e) {} }
/** * <p>Test method for 'javax.naming.ldap.StartTlsRequest.createExtendedResponse(String, byte[], int, int)'</p> * <p>Here we are testing if this method creates an extended response object that corresponds to the LDAP StartTLS extended request. * In this case we are testing the extended response with the argument ID=""</p> * <p>The expected result is an exception.</p> */
Test method for 'javax.naming.ldap.StartTlsRequest.createExtendedResponse(String, byte[], int, int)' Here we are testing if this method creates an extended response object that corresponds to the LDAP StartTLS extended request. In this case we are testing the extended response with the argument ID="" The expected result is an exception
testCreateExtendedResponse005
{ "repo_name": "freeVM/freeVM", "path": "enhanced/archive/classlib/java6/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/StartTlsRequestTest.java", "license": "apache-2.0", "size": 5698 }
[ "javax.naming.NamingException", "javax.naming.ldap.StartTlsRequest" ]
import javax.naming.NamingException; import javax.naming.ldap.StartTlsRequest;
import javax.naming.*; import javax.naming.ldap.*;
[ "javax.naming" ]
javax.naming;
1,027,860
public Builder addSpendingLimit(SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } this.spendingLimits.add(element); return this; }
Builder function(SpendingLimit element) { if (this.spendingLimits == null) { this.spendingLimits = new ArrayList<>(); } this.spendingLimits.add(element); return this; }
/** * Add an element to `spendingLimits` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link * CardUpdateParams.SpendingControls#spendingLimits} for the field documentation. */
Add an element to `spendingLimits` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See <code>CardUpdateParams.SpendingControls#spendingLimits</code> for the field documentation
addSpendingLimit
{ "repo_name": "stripe/stripe-java", "path": "src/main/java/com/stripe/param/issuing/CardUpdateParams.java", "license": "mit", "size": 125778 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
147,889
private void waitForTasksToFinish(List<PublisherBase> tasksList) throws Exception { boolean allTasksFinished = false; while (!allTasksFinished) { allTasksFinished = true; for (PublisherBase task : tasksList) { if (!task.isTaskComplete()) allTasksFinished = false; } logger.info("Waiting for publishers to cleanly shutdown...."); Thread.sleep(2000); } if (allTasksFinished) logger.info("All Publishers have shutdown."); }
void function(List<PublisherBase> tasksList) throws Exception { boolean allTasksFinished = false; while (!allTasksFinished) { allTasksFinished = true; for (PublisherBase task : tasksList) { if (!task.isTaskComplete()) allTasksFinished = false; } logger.info(STR); Thread.sleep(2000); } if (allTasksFinished) logger.info(STR); }
/** * Wait for tasks to finish * * @param tasksList * @throws Exception */
Wait for tasks to finish
waitForTasksToFinish
{ "repo_name": "tmtsoftware/es-perftest", "path": "mbsuite-publisher-base/src/com/persistent/bcsuite/process/Generator.java", "license": "mit", "size": 16053 }
[ "com.persistent.bcsuite.base.PublisherBase", "java.util.List" ]
import com.persistent.bcsuite.base.PublisherBase; import java.util.List;
import com.persistent.bcsuite.base.*; import java.util.*;
[ "com.persistent.bcsuite", "java.util" ]
com.persistent.bcsuite; java.util;
2,826,541
public Optional<Power> getSupplyCenterHomePower(final Province province) { final ProvinceData pd = provArray.get(province.getIndex()); if (pd != null) { return Optional.ofNullable(pd.getSCHomePower()); } return Optional.empty(); }// getSupplyCenterHomePower()
Optional<Power> function(final Province province) { final ProvinceData pd = provArray.get(province.getIndex()); if (pd != null) { return Optional.ofNullable(pd.getSCHomePower()); } return Optional.empty(); }
/** * Get the home power of the supply center; null if no supply center or home power */
Get the home power of the supply center; null if no supply center or home power
getSupplyCenterHomePower
{ "repo_name": "takaki/jdip", "path": "src/main/java/dip/world/Position.java", "license": "gpl-2.0", "size": 22008 }
[ "java.util.Optional" ]
import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
1,942,123
private static int enumerate(Iterator<int[]> iter) { long time = System.currentTimeMillis(); int count = 0; while (iter.hasNext()) { iter.next(); count++; } time = System.currentTimeMillis() - time; System.out.print("Enumerated "); System.out.print(count); System.out.print(" elements in "); System.out.print(time); System.out.println(" [ms]"); return count; }
static int function(Iterator<int[]> iter) { long time = System.currentTimeMillis(); int count = 0; while (iter.hasNext()) { iter.next(); count++; } time = System.currentTimeMillis() - time; System.out.print(STR); System.out.print(count); System.out.print(STR); System.out.print(time); System.out.println(STR); return count; }
/** * Enumerates all elements from the iterator and prints some statistics * @param iter * @return the number of elements enumerated */
Enumerates all elements from the iterator and prints some statistics
enumerate
{ "repo_name": "prasser/jhpl", "path": "src/test/de/linearbits/jhpl/test/Test6.java", "license": "apache-2.0", "size": 3177 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
932,918
@Override public final void prepareWrite(final int recordCount, final int inputSize, final int idealSize) { try { this.inputCount = inputSize; this.idealCount = idealSize; this.output = new PrintStream(new FileOutputStream(this.file)); } catch (final IOException ex) { throw new BufferedDataError(ex); } }
final void function(final int recordCount, final int inputSize, final int idealSize) { try { this.inputCount = inputSize; this.idealCount = idealSize; this.output = new PrintStream(new FileOutputStream(this.file)); } catch (final IOException ex) { throw new BufferedDataError(ex); } }
/** * Prepare to write to a CSV file. * * @param recordCount * The total record count, that will be written. * @param inputSize * The input size. * @param idealSize * The ideal size. */
Prepare to write to a CSV file
prepareWrite
{ "repo_name": "larhoy/SentimentProjectV2", "path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/ml/data/buffer/codec/CSVDataCODEC.java", "license": "mit", "size": 6954 }
[ "java.io.FileOutputStream", "java.io.IOException", "java.io.PrintStream", "org.encog.ml.data.buffer.BufferedDataError" ]
import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import org.encog.ml.data.buffer.BufferedDataError;
import java.io.*; import org.encog.ml.data.buffer.*;
[ "java.io", "org.encog.ml" ]
java.io; org.encog.ml;
13,627
public static Short convertToShort(Schema schema, Object value) throws DataException { return (Short) convertTo(Schema.OPTIONAL_INT16_SCHEMA, schema, value); }
static Short function(Schema schema, Object value) throws DataException { return (Short) convertTo(Schema.OPTIONAL_INT16_SCHEMA, schema, value); }
/** * Convert the specified value to an {@link Type#INT16} short value. The supplied schema is required if the value is a logical * type when the schema contains critical information that might be necessary for converting to a short. * * @param schema the schema for the value; may be null * @param value the value to be converted; may be null * @return the representation as a short, or null if the supplied value was null * @throws DataException if the value could not be converted to a short */
Convert the specified value to an <code>Type#INT16</code> short value. The supplied schema is required if the value is a logical type when the schema contains critical information that might be necessary for converting to a short
convertToShort
{ "repo_name": "ollie314/kafka", "path": "connect/api/src/main/java/org/apache/kafka/connect/data/Values.java", "license": "apache-2.0", "size": 50847 }
[ "org.apache.kafka.connect.errors.DataException" ]
import org.apache.kafka.connect.errors.DataException;
import org.apache.kafka.connect.errors.*;
[ "org.apache.kafka" ]
org.apache.kafka;
43,158
public static ViewParent getParentForAccessibility(View view) { return IMPL.getParentForAccessibility(view); }
static ViewParent function(View view) { return IMPL.getParentForAccessibility(view); }
/** * Gets the parent for accessibility purposes. Note that the parent for * accessibility is not necessary the immediate parent. It is the first * predecessor that is important for accessibility. * * @param view View to retrieve parent for * @return The parent for use in accessibility inspection */
Gets the parent for accessibility purposes. Note that the parent for accessibility is not necessary the immediate parent. It is the first predecessor that is important for accessibility
getParentForAccessibility
{ "repo_name": "madhavanks26/com.vliesaputra.deviceinformation", "path": "src/com/vliesaputra/cordova/plugins/android/support/v4/src/java/android/support/v4/view/ViewCompat.java", "license": "mit", "size": 127830 }
[ "android.view.View", "android.view.ViewParent" ]
import android.view.View; import android.view.ViewParent;
import android.view.*;
[ "android.view" ]
android.view;
757,715
public void processStream(InputStream stream, String systemId) throws ValidationException, ParserConfigurationException, SAXException, IOException, SchedulerException, ClassNotFoundException, ParseException { clearValidationExceptions(); scheduledJobs.clear(); jobsToSchedule.clear(); calsToSchedule.clear(); getLog().info("Parsing XML from stream with systemId: " + systemId + " validating: " + digester.getValidating() + " validating schema: " + digester.getSchema()); InputSource is = new InputSource(stream); is.setSystemId(systemId); digester.push(this); digester.parse(is); maybeThrowValidationException(); }
void function(InputStream stream, String systemId) throws ValidationException, ParserConfigurationException, SAXException, IOException, SchedulerException, ClassNotFoundException, ParseException { clearValidationExceptions(); scheduledJobs.clear(); jobsToSchedule.clear(); calsToSchedule.clear(); getLog().info(STR + systemId + STR + digester.getValidating() + STR + digester.getSchema()); InputSource is = new InputSource(stream); is.setSystemId(systemId); digester.push(this); digester.parse(is); maybeThrowValidationException(); }
/** * Process the xmlfile named <code>fileName</code> with the given system * ID. * * @param stream * an input stream containing the xml content. * @param systemId * system ID. */
Process the xmlfile named <code>fileName</code> with the given system ID
processStream
{ "repo_name": "chandrasekhar4u/opensymphony-quartz-backup", "path": "trunk/src/java/org/quartz/xml/JobSchedulingDataProcessor.java", "license": "apache-2.0", "size": 52482 }
[ "java.io.IOException", "java.io.InputStream", "java.text.ParseException", "javax.xml.parsers.ParserConfigurationException", "org.quartz.SchedulerException", "org.xml.sax.InputSource", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.io.InputStream; import java.text.ParseException; import javax.xml.parsers.ParserConfigurationException; import org.quartz.SchedulerException; import org.xml.sax.InputSource; import org.xml.sax.SAXException;
import java.io.*; import java.text.*; import javax.xml.parsers.*; import org.quartz.*; import org.xml.sax.*;
[ "java.io", "java.text", "javax.xml", "org.quartz", "org.xml.sax" ]
java.io; java.text; javax.xml; org.quartz; org.xml.sax;
2,324,647
E decode(GamePacket packet);
E decode(GamePacket packet);
/** * Decodes the specified packet into a message. * * @param packet The packet. * @return The message. */
Decodes the specified packet into a message
decode
{ "repo_name": "atomicint/aj8", "path": "server/src/src/main/java/org/apollo/game/msg/MessageDecoder.java", "license": "isc", "size": 652 }
[ "org.apollo.net.codec.game.GamePacket" ]
import org.apollo.net.codec.game.GamePacket;
import org.apollo.net.codec.game.*;
[ "org.apollo.net" ]
org.apollo.net;
1,961,446