code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public Headers readHeaders() throws IOException {
Headers.Builder headers=new Headers.Builder();
for (String line; (line=source.readUtf8LineStrict()).length() != 0; ) {
Internal.instance.addLenient(headers,line);
}
return headers.build();
}
| Reads headers or trailers. |
public AllocationRequest initializeFirstAllocation(){
if (mAllocatedSections.size() > 0) {
log.error("ERROR - Request to initialize first allocation, when allocations already present");
return null;
}
if ((mStartBlockSectionSequenceNumber > 0) && (mStartBlock != null)) {
mNextSectionToAllocate=mTransi... | Operating methods |
public static ComponentUI createUI(JComponent x){
return new BasicSplitPaneUI();
}
| Creates a new BasicSplitPaneUI instance |
@GET public SampleResponse sampleRequestHandler(){
SampleResponse sampleResponse=new SampleResponse(1,"Hello, World!");
return sampleResponse;
}
| Handles GET requests on the URL aforementioned above the SampleResource class |
public void squareThisMatrix(){
GF2Polynomial result=new GF2Polynomial(mDegree);
for (int i=0; i < mDegree; i++) {
if (polynomial.vectorMult(((GF2nPolynomialField)mField).squaringMatrix[mDegree - i - 1])) {
result.setBit(i);
}
}
polynomial=result;
}
| Squares this GF2nPolynomialElement using GF2nFields squaring matrix. This is supposed to be fast when using a polynomial (no tri- or pentanomial) as fieldpolynomial. Use squarePreCalc when using a tri- or pentanomial as fieldpolynomial instead. |
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
Console cons=System.console();
if (cons == null && password == null) {
throw new UnsupportedCallbackException(callbacks[0],"Console is not available");
}
for (int i=0; i < callbacks.length; i++) {
if (c... | Handles the callbacks. |
public ShardRestoreStatus(String nodeId,State state,String reason){
this.nodeId=nodeId;
this.state=state;
this.reason=reason;
}
| Constructs a new shard restore status in with specified state on the given node with specified failure reason |
public static void checkAndSetSectorParam(Element context,AVList params,String paramKey,String paramName,XPath xpath){
if (context == null) {
String message=Logging.getMessage("nullValue.ElementIsNull");
Logging.logger().severe(message);
throw new IllegalArgumentException(message);
}
if (params == nul... | Checks a parameter list for a specified key and if not present attempts to find a value for the key from an element matched by an XPath expression. If found, the key and value are added to the parameter list. |
public String convertToString(Class<?> targetClass,Object value){
UIComponent component=getComponent();
Converter converter=app.createConverter(targetClass);
if (null == converter) {
throw new FacesException("Cannot create Converter to convert " + targetClass.getName() + " value "+ value+ " to string.");
}
... | Convert an object of type targetClass to text by delegating to a converter obtained from the Faces application. |
private static byte[] streamToBytes(InputStream in,int length) throws IOException {
byte[] bytes=new byte[length];
int count;
int pos=0;
while (pos < length && ((count=in.read(bytes,pos,length - pos)) != -1)) {
pos+=count;
}
if (pos != length) {
throw new IOException("Expected " + length + " bytes, ... | Reads the contents of an InputStream into a byte[]. |
public void abortUpload() throws RcsGenericException {
try {
mUploadInf.abortUpload();
}
catch ( Exception e) {
throw new RcsGenericException(e);
}
}
| Aborts the upload |
public void add(final T o){
}
| Adds counters to the current counters. |
public SharedPreferences putString(String key,String value){
editor.putString(key,value);
return this;
}
| Set a String value in the preferences editor, to be written back with auto commit. |
public JsonBuilder(JsonGenerator generator){
this.generator=generator;
}
| Instantiates a JSON builder with a configured generator. |
public Path createClasspath(){
if (this.classpath == null) {
this.classpath=new Path(getProject());
}
return this.classpath.createPath();
}
| Classpath as <classpath/> nested element |
@Override public boolean printingEnabled(OptOptions options,boolean before){
return false;
}
| Should we print the IR either before or after this phase? |
public static String requestPath(HttpUrl url){
String path=url.encodedPath();
String query=url.encodedQuery();
return query != null ? (path + '?' + query) : path;
}
| Returns the path to request, like the '/' in 'GET / HTTP/1.1'. Never empty, even if the request URL is. Includes the query component if it exists. |
public boolean isTransferred(){
Object oo=get_Value(COLUMNNAME_IsTransferred);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Transferred. |
public boolean isSymmetricalSet(){
return symmetry;
}
| Returns true, if the set of model values is symmetrical |
public static ImageSource asset(String assetName){
if (assetName == null) {
throw new NullPointerException("Asset name must not be null");
}
return uri(ASSET_SCHEME + assetName);
}
| Create an instance from an asset name. |
public void pauseWork(){
mExitTasksEarly=false;
setPause(true);
if (DEBUG) {
CLog.d(LOG_TAG,"work_status: pauseWork %s",this);
}
}
| Temporarily hand up work, you can call this when the view is scrolling. |
public List<Object> eval(ExpressionAST e) throws ScopeException {
List<Object> results=new ArrayList<Object>();
if (e instanceof Operator && ((Operator)e).getOperatorDefinition().equals(OperatorScope.getDefault().lookupByExtendedID(VectorOperatorDefinition.ID))) {
Operator op=(Operator)e;
for ( Expressio... | evaluate the expression into a list of constants - it supports a Vector as an input expression |
private int lastIndexOf(int elem){
int boffset=m_firstFree & m_MASK;
for (int index=m_firstFree >>> m_SHIFT; index >= 0; --index) {
int[] block=m_map[index];
if (block != null) for (int offset=boffset; offset >= 0; --offset) if (block[offset] == elem) return offset + index * m_blocksize;
bof... | Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. |
private String uploadBase64FileToBucket(String base64Image) throws Exception {
Base64 base64=new Base64();
byte[] bytes=base64.decode(base64Image.getBytes());
File tempFile=File.createTempFile("taxReceipt",".jpg");
FileOutputStream fileOutputStream=new FileOutputStream(tempFile);
fileOutputStream.write(bytes)... | Upload an image encoded in base64 to a AWS bucket |
public HighlightController(WorldWindow wwd,Object highlightEventType){
this.wwd=wwd;
this.highlightEventType=highlightEventType;
this.wwd.addSelectListener(this);
}
| Creates a controller for a specified World Window. |
public Trie(){
m_Root=new Node();
m_lowerCaseOnly=false;
}
| Construct the trie that has a case insensitive search. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-06 08:48:10.279 -0400",hash_original_method="DA4C09BDA6B054227417A77E4BD22C5C",hash_generated_method="59B33FBE6FEB2F39476D20162A46CCAF") public MediaSize asPortrait(){
if (isPortrait()) {
return this;
}
return new MediaSize(mId,mLa... | Returns a new media size instance in a portrait orientation, which is the height is the greater dimension. |
public static void signedMul(final long offset,final ITranslationEnvironment environment,final List<ReilInstruction> instructions,final OperandSize firstOperandSize,final String firstOperand,final OperandSize secondOperandSize,final String secondOperand,final OperandSize resultOperandSize,final String resultOperand){
... | perform signed multiplication |
public RecordAccessDialog(JFrame owner,int AD_Table_ID,int Record_ID){
super(owner,Msg.translate(Env.getCtx(),"RecordAccessDialog"));
log.info("AD_Table_ID=" + AD_Table_ID + ", Record_ID="+ Record_ID);
m_AD_Table_ID=AD_Table_ID;
m_Record_ID=Record_ID;
try {
dynInit();
jbInit();
}
catch ( Exception... | Record Access Dialog |
public static Kind location(){
return new Kind(LOCATION);
}
| Creates a new KIND property whose value is set to "location". |
public boolean strip(String infile,String outfile){
if (infile == null) throw new NullPointerException("Strip: infile cannot be null");
File in=new File(infile);
File out=null;
if (outfile != null) out=new File(outfile);
return strip(in,out);
}
| Strip infile to outfile |
@POST @Path("import") @ZeppelinApi public Response importNote(String req) throws IOException {
AuthenticationInfo subject=new AuthenticationInfo(SecurityUtils.getPrincipal());
Note newNote=notebook.importNote(req,null,subject);
return new JsonResponse<>(Status.CREATED,"",newNote.getId()).build();
}
| import new note REST API |
public static UUIDPersistentHandle makeHandle(final byte[] value){
return new UUIDPersistentHandle(value,0);
}
| <p>Construct from an existing UUID.</p> |
public Builder<VType> putAll(Map<Integer,VType> map){
for ( Map.Entry<Integer,VType> entry : map.entrySet()) {
this.map.put(entry.getKey(),entry.getValue());
}
return this;
}
| Puts all the entries in the map to the builder. |
private void combineBlocks(int alphaLabel,IntList betaLabels){
int szBetas=betaLabels.size();
for (int i=0; i < szBetas; i++) {
int betaLabel=betaLabels.get(i);
BasicBlock bb=blocks.labelToBlock(betaLabel);
IntList preds=ropMethod.labelToPredecessors(bb.getLabel());
int szPreds=preds.size();
for... | Combines blocks proven identical into one alpha block, re-writing all of the successor links that point to the beta blocks to point to the alpha block instead. |
LibraryInfo(String name,VersionInfo version,String localePrefix,String contract,ResourceHelper helper){
this.name=name;
this.version=version;
this.localePrefix=localePrefix;
this.contract=contract;
this.helper=helper;
initPath();
}
| Constructs a new <code>LibraryInfo</code> using the specified details. |
public double distanceSq(final MutableInt2D p){
final double dx=(double)this.x - p.x;
final double dy=(double)this.y - p.y;
return (dx * dx + dy * dy);
}
| Returns the distance FROM this Double2D TO the specified point. |
public void addExtension(ASN1ObjectIdentifier oid,boolean critical,ASN1Encodable value) throws IOException {
this.addExtension(oid,critical,value.toASN1Primitive().getEncoded(ASN1Encoding.DER));
}
| Add an extension with the given oid and the passed in value to be included in the OCTET STRING associated with the extension. |
public void update(Graphics g){
paint(g);
}
| Calls <code>paint</code>. Doesn't clear the background but see <code>ComponentUI.update</code>, which is called by <code>paintComponent</code>. |
public static Builder builder(){
return new Builder(new LeaveResponse());
}
| Returns a new leave response builder. |
public void testCloning() throws CloneNotSupportedException {
DefaultPieDataset d1=new DefaultPieDataset();
d1.setValue("V1",new Integer(1));
d1.setValue("V2",null);
d1.setValue("V3",new Integer(3));
DefaultPieDataset d2=(DefaultPieDataset)d1.clone();
assertTrue(d1 != d2);
assertTrue(d1.getClass() == d2.g... | Confirm that cloning works. |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case N4JSPackage.N4_TYPE_DECLARATION__ANNOTATION_LIST:
return getAnnotationList();
case N4JSPackage.N4_TYPE_DECLARATION__DECLARED_MODIFIERS:
return getDeclaredModifiers();
case N4JSPackage.N4_TYPE_DECLARATION__NAME:... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public SQLTransientConnectionException(String reason,String sqlState,Throwable cause){
super(reason,sqlState,cause);
}
| Creates an SQLTransientConnectionException object. The Reason string is set to the given reason string, the SQLState string is set to the given SQLState string and the cause Throwable object is set to the given cause Throwable object. |
protected void appendDetail(final StringBuffer buffer,final String fieldName,final short value){
buffer.append(value);
}
| <p>Append to the <code>toString</code> a <code>short</code> value.</p> |
public boolean hasLTProfile(){
final boolean certValues=DSSXMLUtils.isNotEmpty(signatureElement,xPathQueryHolder.XPATH_CERTIFICATE_VALUES);
final boolean revocationValues=DSSXMLUtils.isNotEmpty(signatureElement,xPathQueryHolder.XPATH_REVOCATION_VALUES);
boolean notEmptyCRL=DSSXMLUtils.isNotEmpty(signatureElement,... | Checks the presence of CertificateValues and RevocationValues segments in the signature, what is the proof -LT (or -XL) profile existence |
public void startScanning(final BeaconServiceConnection serviceConnection){
final Cursor cursor=mDatabaseHelper.getAllRegions();
while (cursor.moveToNext()) {
final UUID uuid=UUID.fromString(cursor.getString(2));
final int major=cursor.getInt(3);
final int minor=cursor.getInt(4);
final int event=cur... | Registers for monitoring and ranging events for all regions in the database. |
@Override public void onDirectoryPick(String selectedAbsolutePath,int queryTypeId){
DirInfo dirInfo=getOrCreateDirInfo(queryTypeId);
dirInfo.currentPath=selectedAbsolutePath;
FotoSql.set(mFilter,selectedAbsolutePath,queryTypeId);
toGui(mFilter);
}
| called when user picks a new directory |
public ICUFoldingFilterFactory(Map<String,String> args){
super(args);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
| Creates a new ICUFoldingFilterFactory |
public static void checkVersion(){
final TfVersionCommand command=new TfVersionCommand();
cachedVersion=command.runSynchronously();
if (cachedVersion.compare(TF_MIN_VERSION) < 0) {
throw new ToolVersionException(cachedVersion,TF_MIN_VERSION);
}
}
| Determines the version of the TF command being used and throws if the version is too small. |
private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (xmlWriter.getPrefix(namespace) == null) {
xmlWriter.writeNamespace(prefix,namespace);
x... | Util method to write an attribute with the ns prefix |
public String maxDepthTipText(){
return "The maximum depth of the trees, 0 for unlimited.";
}
| Returns the tip text for this property |
@SuppressWarnings("unchecked") void bucketSort(IPoint[] points){
double min=Integer.MAX_VALUE;
double max=Integer.MIN_VALUE;
for ( IPoint p : points) {
double x=p.getX();
if (x < min) {
min=x;
}
if (x > max) {
max=x;
}
}
int n=points.length;
double delta=(max - min) / n;
L... | Take advantage of linear-time sorting over the x-coordinates of the points using BucketSort. Ties are broken using the y-coordinate. All sorting is done in place. |
private Integer insertAllContacts(Iterator<String> contactsIter){
final ArrayList<ContentProviderOperation> batchOperation=new ArrayList<ContentProviderOperation>();
while (contactsIter.hasNext()) addContact(contactsIter.next(),batchOperation);
try {
ContentProviderResult[] results=mContentResolver.applyBat... | Synchronously insert all contacts designated by the Iterator. |
public String convertPropertyNameKindToString(EDataType eDataType,Object instanceValue){
return instanceValue == null ? null : instanceValue.toString();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public final void testIsStatePreserved02(){
int[] a=new int[]{981,2,1};
int[] aCopy=a.clone();
ECFieldF2m f=new ECFieldF2m(2000,aCopy);
f.getMidTermsOfReductionPolynomial()[0]=1532;
assertTrue(Arrays.equals(a,f.getMidTermsOfReductionPolynomial()));
}
| Tests that object state is preserved against modifications through array reference returned by <code>getMidTermsOfReductionPolynomial()</code> method. |
public GravitationalForce(float forceConstant,float direction){
params=new float[]{forceConstant,direction};
minValues=new float[]{DEFAULT_MIN_FORCE_CONSTANT,DEFAULT_MIN_DIRECTION};
maxValues=new float[]{DEFAULT_MAX_FORCE_CONSTANT,DEFAULT_MAX_DIRECTION};
}
| Create a new GravitationForce. |
protected String normalizeNativeGuidForVIPR(String nativeGuid,Map<String,Object> keyMap){
if (keyMap.containsKey(Constants.IS_NEW_SMIS_PROVIDER) && Boolean.valueOf(keyMap.get(Constants.IS_NEW_SMIS_PROVIDER).toString())) {
nativeGuid=nativeGuid.replaceAll(Constants.SMIS_80_STYLE,Constants.SMIS_PLUS_REGEX);
}
r... | Normalize nativeGuid for VIPR consumption, newer SMIs provider 8.x has different delimiters. |
public static String stringFor(int k){
switch (k) {
case cudaResourceTypeArray:
return "cudaResourceTypeArray";
case cudaResourceTypeMipmappedArray:
return "cudaResourceTypeMipmappedArray";
case cudaResourceTypeLinear:
return "cudaResourceTypeLinear";
case cudaResourceTypePitch2D:
return "cudaResourceTypePitch2D"... | Returns the String identifying the given cudaResourceType |
@Override public void deliveryComplete(IMqttDeliveryToken messageToken){
service.traceDebug(TAG,"deliveryComplete(" + messageToken + ")");
MqttMessage message=savedSentMessages.remove(messageToken);
if (message != null) {
String topic=savedTopics.remove(messageToken);
String activityToken=savedActivityTok... | Callback to indicate a message has been delivered (the exact meaning of "has been delivered" is dependent on the QOS value) |
private void fciOrientbk(IKnowledge knowledge,Graph graph,List<Node> variables){
logger.log("info","Starting BK Orientation.");
for (Iterator<KnowledgeEdge> it=knowledge.forbiddenEdgesIterator(); it.hasNext(); ) {
KnowledgeEdge edge=it.next();
Node from=SearchGraphUtils.translate(edge.getFrom(),variables);
... | Orients according to background knowledge |
public void fitScreen(){
Matrix save=mViewPortHandler.fitScreen();
mViewPortHandler.refresh(save,this,true);
}
| Resets all zooming and dragging and makes the chart fit exactly it's bounds. |
public X509CertImpl(byte[] encoding) throws IOException {
this((Certificate)Certificate.ASN1.decode(encoding));
}
| Constructs the instance on the base of ASN.1 encoded form of X.509 certificate provided via array of bytes. |
public static List<Map<Object,Object>> sortMaps(List<Map<Object,Object>> listOfMaps,List<? extends String> sortKeys){
if (listOfMaps == null || sortKeys == null) return null;
List<Map<Object,Object>> toSort=new ArrayList<Map<Object,Object>>(listOfMaps.size());
toSort.addAll(listOfMaps);
try {
MapComparato... | Sort a List of Maps by specified consistent keys. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int row, col, x, y;
double z;
double total;
float progress=0;
int a;
int filterSizeX=3;
int filterSizeY=3;
int dX[];
int dY[];
int midPointX;
int midPointY;
int numPixelsInFilter;
boolean filt... | Used to execute this plugin tool. |
Key unwrap(byte[] wrappedKey,String wrappedKeyAlgorithm,int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException {
byte[] encodedKey;
try {
encodedKey=doFinal(wrappedKey,0,wrappedKey.length);
}
catch ( BadPaddingException ePadding) {
throw new InvalidKeyException("The wrapped key is not ... | Unwrap a previously wrapped key. |
@Get public DebugCounterInfoOutput handleCounterInfoQuery(){
DebugCounterInfoOutput output;
Option choice=Option.ERROR_BAD_PARAM;
String param1=(String)getRequestAttributes().get("param1");
String param2=(String)getRequestAttributes().get("param2");
String param3=(String)getRequestAttributes().get("param3");
... | Return the debug counter data for the get rest-api call URI must be in one of the following forms: "http://{controller-hostname}:8080/wm/debugcounter/{param1}/{param2}/{param3}/{param4}" where {param1} must be one of (no quotes): null if nothing is given then by default all module names are returned f... |
public OMEllipse(LatLonPoint centerPoint,int w,int h,double rotateAngle){
super(centerPoint.getY(),centerPoint.getX(),0,0,w,h);
setRotationAngle(rotateAngle);
}
| Create a OMEllipse, positioned with a lat-lon center and x-y axis. Rendertype is RENDERTYPE_OFFSET. |
private V remove(){
boolean wasHot=(status == Status.HOT);
V result=value;
evict();
if (wasHot) {
LirsEntry end=queueEnd();
if (end != null) {
end.migrateToStack();
}
}
return result;
}
| Removes this entry from the cache. This operation is not specified in the paper, which does not account for forced eviction. |
@SuppressWarnings("unchecked") public void start() throws IgniteException {
A.notNull(igniteConfigFile,"Ignite config file");
A.notNull(cacheName,"Cache name");
A.notNull(igniteTupleField,"Ignite tuple field");
setIgnite(StreamerContext.getIgnite());
final IgniteDataStreamer<K,V> dataStreamer=StreamerContext.... | Starts streamer. |
private void writeLinkData(final List<CountSimComparison> countSimComparisonList,final FolderType folder){
PlacemarkType placemark;
double relativeError;
PointType point;
for ( CountSimComparison csc : countSimComparisonList) {
Id itemId=csc.getId();
Coord coord=null;
if (counts == null) {
Li... | This method writes all the data for each of the links/counts to the kml document. |
public Srinivas(){
super(2,2,2);
}
| Constructs the Srinivas problem. |
public void dequeue(){
if (queue != null) {
SetQueue.IMP.dequeue(queue);
}
}
| Remove this EditSession from the queue<br> - This doesn't necessarily stop it from being queued again |
private String maskSensitiveInformation(Throwable exception,Map<String,Object> variables){
String message=String.valueOf(exception).trim();
if (variables != null) {
for ( Object sensitiveData : variables.values()) {
String sensitiveDataString=String.valueOf(sensitiveData);
message=message.replace... | Returns the message of the given exception, masking any sensitive information indicated by the given collection of sensitive data. If the variables is null, no masking will occur. |
public Query geoCode(final GeoLocation location,final double radius,final String unit){
setGeoCode(location,radius,unit);
return this;
}
| returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile |
public CertPathTrustManagerParameters(CertPathParameters parameters){
this.parameters=(CertPathParameters)parameters.clone();
}
| Construct new CertPathTrustManagerParameters from the specified parameters. The parameters are cloned to protect against subsequent modification. |
protected void storeObject(@NonNull OddObject object,long maxAge){
long expiration=maxAge + new Date().getTime();
objectStore.put(object.getId(),new StoredObject(object,expiration));
List<OddObject> included=object.getIncluded();
if (!included.isEmpty()) {
storeObjects(included,maxAge);
}
}
| stores object and all included. Sets a maxAge for this object and all included objects |
public Course(String courseName){
this.courseName=courseName;
students=new ArrayList<String>();
}
| Create a Course object |
public static TrapCodeOperand Regenerate(){
return new TrapCodeOperand((byte)RuntimeEntrypoints.TRAP_REGENERATE);
}
| Create a trap code operand for a regeneration trap |
public static ExecutionTargetException convertToApi(org.oscm.internal.types.exception.ExecutionTargetException oldEx){
return convertExceptionToApi(oldEx,ExecutionTargetException.class);
}
| Convert source version Exception to target version Exception |
@Override public int hashCode(){
int result;
result=minLatitude.hashCode();
result=29 * result + maxLatitude.hashCode();
result=29 * result + minLongitude.hashCode();
result=29 * result + maxLongitude.hashCode();
return result;
}
| Computes a hash code from the sector's four angles. |
public void addShape3D(float x,float y,float z,ArrayList<Coord2D> coordinates,float depth,int shapeTextureWidth,int shapeTextureHeight,int sideTextureWidth,int sideTextureHeight,int direction){
addShape3D(x,y,z,coordinates,depth,shapeTextureWidth,shapeTextureHeight,sideTextureWidth,sideTextureHeight,direction,null);
... | Creates a shape from a 2D vector shape. |
private void onTargetSaved(RecipeDescriptor recipe){
selectedTarget.setRecipe(recipe);
selectedTarget.setDirty(false);
this.updateTargets(recipe.getName());
notificationManager.notify(machineLocale.targetsViewSaveSuccess(),SUCCESS,FLOAT_MODE);
}
| Performs actions when target is saved. |
static InputValidator inRange(final int min,final int max){
return new InputValidator(null,"not in range: " + min + " - "+ max);
}
| Verifies a value is an integer and falls inside of a given range (inclusive) |
public void testPutGetRemove() throws Exception {
initStore(2);
Set<Integer> exp;
try {
exp=runPutGetRemoveMultithreaded(10,10);
}
finally {
shutdownStore();
}
Map<Integer,String> map=delegate.getMap();
Collection<Integer> extra=new HashSet<>(map.keySet());
extra.removeAll(exp);
assertTrue("... | This test performs complex set of operations on store from multiple threads. |
protected void removeThumbnailData(){
clearThumbnailAndStrips();
mIfdDatas[IfdId.TYPE_IFD_1]=null;
}
| Removes the thumbnail and its related tags. IFD1 will be removed. |
private synchronized void runNodeRecovery() throws Exception {
InterProcessLock lock=null;
try {
log.info("Node recovery begins");
lock=getRecoveryLock();
setRecoveryStatus(RecoveryStatus.Status.PREPARING);
startMulticastService();
setRecoveryStatus(RecoveryStatus.Status.REPAIRING);
runDbRep... | Start cluster recovery in minority nodes corrupted scenario a. PREPARING: start a multicast thread and then the user do node redeployment b. REPAIRING: run db node repair between the alive nodes to make sure the consistency c. SYNCING: wake the redeployed nodes from hibernate status and do data syncing d. DONE: dbsvc a... |
public final CC gapRight(String boundsSize){
hor.setGapAfter(ConstraintParser.parseBoundSize(boundsSize,true,true));
return this;
}
| Sets the gap to the right of the component. |
@Override public Object eGet(int featureID,boolean resolve,boolean coreType){
switch (featureID) {
case N4JSPackage.CATCH_BLOCK__CATCH_VARIABLE:
return getCatchVariable();
}
return super.eGet(featureID,resolve,coreType);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private void enableSharedPreferenceListener(boolean aIsListenerEnabled){
Log.d(LOG_TAG,"## enableSharedPreferenceListener(): aIsListenerEnabled=" + aIsListenerEnabled);
mIsUiUpdateSkipped=!aIsListenerEnabled;
try {
SharedPreferences prefMgr=getDefaultSharedPreferences(getActivity());
if (aIsListenerEnable... | Enable the preference listener according to the aIsListenerEnabled value. |
public String toString(){
StringBuffer sb=new StringBuffer("MRfQLine[");
sb.append(get_ID()).append(",").append(getLine()).append("]");
return sb.toString();
}
| String Representation |
protected CacheConfiguration[] cacheConfiguration(){
CacheConfiguration cacheCfg=defaultCacheConfiguration();
cacheCfg.setName("partitioned");
cacheCfg.setCacheMode(PARTITIONED);
cacheCfg.setNearConfiguration(null);
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setA... | Gets cache configuration. |
public Object[] toArray(){
return al.toArray();
}
| Returns an array containing all of the elements in this set. If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. <p>The returned array will be "safe" in that no references to it are maintained by this set. (In other words,... |
public void acceptType(char[] packageName,char[] simpleTypeName,char[][] enclosingTypeNames,int modifiers,AccessRestriction accessRestriction){
if (this.options.checkDeprecation && (modifiers & ClassFileConstants.AccDeprecated) != 0) return;
if (this.assistNodeIsExtendedType && (modifiers & ClassFileConstants.Acc... | One result of the search consists of a new type. <p/> NOTE - All package and type names are presented in their readable form: Package names are in the form "a.b.c". Nested type names are in the qualified form "A.I". The default package is represented by an empty array. |
public void testGenerateCertPath2() throws Exception {
try {
CertificateFactory.getInstance("X.509").generateCertPath((List<Certificate>)null);
fail("NullPointerException was not thrown");
}
catch ( NullPointerException e) {
}
}
| java.security.cert.CertificateFactory#generateCertPath(List<? extends Certificate> certificates) |
private Annotation createConstituentAnnotationFromTree(JCas aJCas,Parse aNode,Annotation aParentFS,List<Token> aTokens){
if (aNode.isPosTag()) {
Token token=getToken(aTokens,aNode.getSpan().getStart(),aNode.getSpan().getEnd());
if (aParentFS != null) {
token.setParent(aParentFS);
}
if (createPos... | Creates linked constituent annotations + POS annotations |
@Benchmark public long test3_UsingForEachAndJava8() throws IOException {
final long[] i={0};
map.forEach(null);
return i[0];
}
| 3. Using foreach from Java 8 |
public void appendEnd(final StringBuffer buffer,final Object object){
if (this.fieldSeparatorAtEnd == false) {
removeLastFieldSeparator(buffer);
}
appendContentEnd(buffer);
unregister(object);
}
| <p>Append to the <code>toString</code> the end of data indicator.</p> |
void executeNSDecls(TransformerImpl transformer) throws TransformerException {
executeNSDecls(transformer,null);
}
| Send startPrefixMapping events to the result tree handler for all declared prefix mappings in the stylesheet. |
public MySeriesChangeListener(){
this.lastEvent=null;
}
| Creates a new listener. |
public synchronized static String formatLocal(long gmtTime){
_localDate.setGMTTime(gmtTime);
return _localDate.printDate();
}
| Formats a time in the local time zone, using the default format. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.