code
stringlengths
10
174k
nl
stringlengths
3
129k
public static VirtualFile[] scanAndSelectDetectedJavaSourceRoots(Component parentComponent,final VirtualFile[] rootCandidates){ final List<OrderRoot> orderRoots=RootDetectionUtil.detectRoots(Arrays.asList(rootCandidates),parentComponent,null,new LibraryRootsDetectorImpl(Collections.singletonList(JAVA_SOURCE_ROOT_DETECTOR)),new OrderRootType[0]); final List<VirtualFile> result=new ArrayList<VirtualFile>(); for ( OrderRoot root : orderRoots) { result.add(root.getFile()); } return VfsUtil.toVirtualFileArray(result); }
This method takes a candidates for the project root, then scans the candidates and if multiple candidates or non root source directories are found whithin some directories, it shows a dialog that allows selecting or deselecting them.
public JSONObject optJSONObject(String key){ Object object=this.opt(key); return object instanceof JSONObject ? (JSONObject)object : null; }
Get an optional JSONObject associated with a key. It returns null if there is no such key, or if its value is not a JSONObject.
public _QueuedBuildUpdate(){ super(); }
Constructs a _QueuedBuildUpdate with no flags initially set.
public HashedBlockInputStream(InputStream inputStream){ this(inputStream,false); }
Create a Big Endian Hash Block Input Stream
protected Position computeEdgeLocation(LatLon center,LatLon location,double length){ Vec4 centerPoint=getWwd().getModel().getGlobe().computeEllipsoidalPointFromLocation(center); Vec4 surfaceNormal=getWwd().getModel().getGlobe().computeEllipsoidalNormalAtLocation(center.getLatitude(),center.getLongitude()); Vec4 point1=getWwd().getModel().getGlobe().computeEllipsoidalPointFromLocation(location); Vec4 vecToLocation=point1.subtract3(centerPoint).normalize3(); Vec4 vecToEdge=surfaceNormal.cross3(vecToLocation).normalize3().multiply3(length); LatLon edgeLocation=getWwd().getModel().getGlobe().computePositionFromEllipsoidalPoint(vecToEdge.add3(centerPoint)); double edgeAltitude=this.getControlPointAltitude(edgeLocation); return new Position(edgeLocation,edgeAltitude); }
Computes a control point location at the edge of a shape.
public DefaultOrderNumberGeneratorImpl(final GenericDAO<CustomerOrder,Long> customerOrderDao){ this.customerOrderDao=customerOrderDao; orderSequence=-1; }
Construct order number generator service.
@MethodDesc(description="Exit replicator immediately without cleanup",usage="kill") public void kill() throws Exception { exitProcess(true,"Shutting down process immediately without stopping services"); }
Terminates the replicator process immediately. Only the PID file is cleaned up.
public Select<T> and(DataFilterClause clause){ mFilterCriteria.addClause(clause,DataFilterConjunction.AND); return this; }
Adds the specified clause with and AND conjunction
protected boolean binarySearch(String filename,String string){ string=string.toLowerCase(); long startTime=System.currentTimeMillis(); RandomAccessFile raf=null; boolean result=false; try { File file=new File(filename); raf=new RandomAccessFile(file,"r"); long low=0; long high=file.length(); long p=-1; while (low < high) { long mid=(low + high) / 2; p=mid; while (p >= 0) { raf.seek(p); char c=(char)raf.readByte(); if (c == '\n') break; p--; } if (p < 0) raf.seek(0); String line=raf.readLine(); if (line == null) { low=high; } else { int compare=line.compareTo(string); if (compare < 0) { low=mid + 1; } else if (compare == 0) { return true; } else { high=mid; } } } p=low; while (p >= 0 && p < high) { raf.seek(p); if (((char)raf.readByte()) == '\n') break; p--; } if (p < 0) raf.seek(0); while (true) { String line=raf.readLine(); if (line == null) { result=false; break; } else if (line.equals(string)) { result=true; break; } else if (!line.startsWith(string)) { result=false; break; } } } catch ( Throwable t) { Raptor.getInstance().onError("Error reading dictionary file: " + DICTIONARY_PATH,t); } finally { try { raf.close(); } catch ( Throwable t) { } if (LOG.isDebugEnabled()) { LOG.debug("Searched " + string + " ("+ (System.currentTimeMillis() - startTime)+ ") "+ result); } } return result; }
This method started out as code from http://stackoverflow.com/questions/736556/binary -search-in-a-sorted-memory-mapped-file-in-java It has been altered to fix some bugs.
public boolean isActiveFtp(){ return activeFtp; }
Gets the value of the activeFtp property.
public Span(int start,int end){ this.start=start; this.end=end; }
Constructs a new span with the given inclusive starting and exclusive ending indices.
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request){ ActionErrors errors=new ActionErrors(); if ((tipoBusqueda == TIPO_BUSQUEDA_POR_GESTOR) && StringUtils.isBlank(gestor)) errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionError(Constants.ERROR_REQUIRED,Messages.getString(PrestamosConstants.LABEL_PRESTAMOS_GESTOR_PRESTAMO,request.getLocale()))); return errors; }
Valida el formulario de busqueda.
public synchronized void register(Platform platform){ checkNotNull(platform); logger.log(Level.FINE,"Got request to register " + platform.getClass() + " with WorldEdit ["+ super.toString()+ "]"); platforms.add(platform); if (firstSeenVersion != null) { if (!firstSeenVersion.equals(platform.getVersion())) { logger.log(Level.WARNING,"Multiple ports of WorldEdit are installed but they report different versions ({0} and {1}). " + "If these two versions are truly different, then you may run into unexpected crashes and errors.",new Object[]{firstSeenVersion,platform.getVersion()}); } } else { firstSeenVersion=platform.getVersion(); } }
Register a platform with WorldEdit.
@NotNull @ObjectiveCName("isMemberModel") public BooleanValueModel isMember(){ return isMember; }
Get membership Value Model
@Override public String toString(){ if (eIsProxy()) return super.toString(); StringBuffer result=new StringBuffer(super.toString()); result.append(" (strictMode: "); result.append(strictMode); result.append(')'); return result.toString(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public GroupQueryNode(QueryNode query){ if (query == null) { throw new QueryNodeError(new MessageImpl(QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED,"query","null")); } allocate(); setLeaf(false); add(query); }
This QueryNode is used to identify parenthesis on the original query string
public void tapOnWifi(){ System.out.println("Size of iphone 6 is " + appiumDriver.manage().window().getSize()); if (deviceName.equalsIgnoreCase("iphone 5")) { appiumDriver.tap(85,85,175,0); } else if (deviceName.equalsIgnoreCase("iphone 6")) { appiumDriver.tap(120,120,278,0); } }
Tap on wifi(only for ios)
public CRLNumberExtension(BigInteger crlNum) throws IOException { this(PKIXExtensions.CRLNumber_Id,false,crlNum,NAME,LABEL); }
Create a CRLNumberExtension with the BigInteger value . The criticality is set to false.
public static CatalogEntry toCatalogEntry(VOCatalogEntry voCatalogEntry) throws ValidationException { if (voCatalogEntry == null) { IllegalArgumentException e=new IllegalArgumentException("Parameters must not be null"); logger.logError(Log4jLogger.SYSTEM_LOG,e,LogMessageIdentifier.ERROR_PARAMETER_NULL); throw e; } CatalogEntry catalogEntry=new CatalogEntry(); catalogEntry.setKey(voCatalogEntry.getKey()); copyAttributes(catalogEntry,voCatalogEntry); if (voCatalogEntry.getMarketplace() != null) { catalogEntry.setMarketplace(MarketplaceAssembler.toMarketplace(voCatalogEntry.getMarketplace())); } return catalogEntry; }
Creates a detached catalog entry domain object holding the information of the given VO.
public static boolean usingEip(){ boolean ret=false; try { ret=getUserDataAsMap().get(TankConstants.KEY_USING_BIND_EIP) != null; } catch ( IOException e) { LOG.warn("Error getting is using EIP: " + e.toString()); } return ret; }
gets if we are using EIP from user data
protected String byteArrayToHexString(byte[] bytes){ StringBuilder sb=new StringBuilder(bytes.length * 2); for ( byte element : bytes) { int v=element & 0xff; if (v < 16) { sb.append('0'); } sb.append(Integer.toHexString(v)); } return sb.toString().toUpperCase(Locale.US); }
Using some super basic byte array &lt;-&gt; hex conversions so we don't have to rely on any large Base64 libraries. Can be overridden if you like!
public void testSecretKeyFactory05() throws NoSuchAlgorithmException, NoSuchProviderException { if (!DEFSupported) { fail(NotSupportMsg); return; } String prov=null; for (int i=0; i < validValues.length; i++) { try { SecretKeyFactory.getInstance(validValues[i],prov); fail("IllegalArgumentException was not thrown as expected (algorithm: ".concat(validValues[i]).concat(" provider: null")); } catch ( IllegalArgumentException e) { } try { SecretKeyFactory.getInstance(validValues[i],""); fail("IllegalArgumentException was not thrown as expected (algorithm: ".concat(validValues[i]).concat(" provider: empty")); } catch ( IllegalArgumentException e) { } for (int j=1; j < invalidValues.length; j++) { try { SecretKeyFactory.getInstance(validValues[i],invalidValues[j]); fail("NoSuchProviderException was not thrown as expected (algorithm: ".concat(validValues[i]).concat(" provider: ").concat(invalidValues[j]).concat(")")); } catch ( NoSuchProviderException e) { } } } }
Test for <code>getInstance(String algorithm, String provider)</code> method Assertion: throws IllegalArgumentException when provider is null or empty; throws NoSuchProviderException when provider has invalid value
public AccountHeaderBuilder withTypeface(@NonNull Typeface typeface){ this.mTypeface=typeface; return this; }
Define the typeface which will be used for all textViews in the AccountHeader
public ISO_8859_1Decoder(InputStream is){ super(is); }
Creates a new ISO_8859_1Decoder.
public int calcoffset(int base){ int len=getTableLength(base); if (len < 1240) { return 107; } else if (len < 33900) { return 1131; } else { return 32768; } }
calculate an offset code for a dictionary. Uses the count of entries to determine what the offset should be.
public void addIncludedAttribute(final String elementName,final String attrName){ if ((elementName == null) || (elementName.trim().equals(""))) { return; } if ((attrName == null) || (attrName.trim().equals(""))) { return; } List attrNames=null; if ((attrNames=(List)_includedElementAttrsMap.get(elementName)) == null) { attrNames=new ArrayList(); } attrNames.add(attrName); _includedElementAttrsMap.put(elementName,attrNames); }
Adds Attribute to be included in the Element comparison.
public byte[] decrypt(String string){ return decrypt(string.getBytes()); }
Decrypt the string with the secret key.
public int intersectAab(float minX,float minY,float minZ,float maxX,float maxY,float maxZ){ int plane=PLANE_NX; boolean inside=true; if (nxX * (nxX < 0 ? minX : maxX) + nxY * (nxY < 0 ? minY : maxY) + nxZ * (nxZ < 0 ? minZ : maxZ) >= -nxW) { plane=PLANE_PX; inside&=nxX * (nxX < 0 ? maxX : minX) + nxY * (nxY < 0 ? maxY : minY) + nxZ * (nxZ < 0 ? maxZ : minZ) >= -nxW; if (pxX * (pxX < 0 ? minX : maxX) + pxY * (pxY < 0 ? minY : maxY) + pxZ * (pxZ < 0 ? minZ : maxZ) >= -pxW) { plane=PLANE_NY; inside&=pxX * (pxX < 0 ? maxX : minX) + pxY * (pxY < 0 ? maxY : minY) + pxZ * (pxZ < 0 ? maxZ : minZ) >= -pxW; if (nyX * (nyX < 0 ? minX : maxX) + nyY * (nyY < 0 ? minY : maxY) + nyZ * (nyZ < 0 ? minZ : maxZ) >= -nyW) { plane=PLANE_PY; inside&=nyX * (nyX < 0 ? maxX : minX) + nyY * (nyY < 0 ? maxY : minY) + nyZ * (nyZ < 0 ? maxZ : minZ) >= -nyW; if (pyX * (pyX < 0 ? minX : maxX) + pyY * (pyY < 0 ? minY : maxY) + pyZ * (pyZ < 0 ? minZ : maxZ) >= -pyW) { plane=PLANE_NZ; inside&=pyX * (pyX < 0 ? maxX : minX) + pyY * (pyY < 0 ? maxY : minY) + pyZ * (pyZ < 0 ? maxZ : minZ) >= -pyW; if (nzX * (nzX < 0 ? minX : maxX) + nzY * (nzY < 0 ? minY : maxY) + nzZ * (nzZ < 0 ? minZ : maxZ) >= -nzW) { plane=PLANE_PZ; inside&=nzX * (nzX < 0 ? maxX : minX) + nzY * (nzY < 0 ? maxY : minY) + nzZ * (nzZ < 0 ? maxZ : minZ) >= -nzW; if (pzX * (pzX < 0 ? minX : maxX) + pzY * (pzY < 0 ? minY : maxY) + pzZ * (pzZ < 0 ? minZ : maxZ) >= -pzW) { inside&=pzX * (pzX < 0 ? maxX : minX) + pzY * (pzY < 0 ? maxY : minY) + pzZ * (pzZ < 0 ? maxZ : minZ) >= -pzW; return inside ? INSIDE : INTERSECT; } } } } } } return plane; }
Determine whether the given axis-aligned box is partly or completely within or outside of the frustum defined by <code>this</code> frustum culler and, if the box is not inside this frustum, return the index of the plane that culled it. The box is specified via its min and max corner coordinates. <p> The algorithm implemented by this method is conservative. This means that in certain circumstances a <i>false positive</i> can occur, when the method returns <tt>-1</tt> for boxes that are actually not visible/do not intersect the frustum. See <a href="http://iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm">iquilezles.org</a> for an examination of this problem. <p> Reference: <a href="http://www.cescg.org/CESCG-2002/DSykoraJJelinek/">Efficient View Frustum Culling</a>
public void testSimpleRemoteDeployment() throws Exception { final URL url=new URL("http://localhost:" + System.getProperty("http.port") + "/simple-test/index.jsp"); final String expected="Sample page for testing"; PingUtils.assertPingTrue(url.getPath() + " not started",expected,url,logger); }
Test remotely deployed Web application.
void readBytes(byte[] buffer) throws IOException { mDexFile.readFully(buffer); }
Fills the buffer by reading bytes from the DEX file.
public static ServiceFault toServiceFault(Throwable t){ ResponseHeader rh=new ResponseHeader(); ServiceFault result=new ServiceFault(rh); rh.setServiceResult(t instanceof ServiceResultException ? ((ServiceResultException)t).getStatusCode() : new StatusCode(StatusCodes.Bad_InternalError)); rh.setTimestamp(new DateTime()); List<String> stringTable=new ArrayList<String>(); DiagnosticInfo di=null; while (t != null) { if (di == null) { rh.setServiceDiagnostics(di=new DiagnosticInfo()); } else { di.setInnerDiagnosticInfo(di=new DiagnosticInfo()); } di.setStringTable(stringTable); di.setLocalizedTextStr(t instanceof ServiceResultException ? t.getMessage() : t.toString()); StringWriter sw=new StringWriter(100); PrintWriter pw=new PrintWriter(sw); for ( StackTraceElement e : t.getStackTrace()) pw.println("\tat " + e); di.setAdditionalInfo(sw.toString()); di.setInnerStatusCode(t instanceof ServiceResultException ? ((ServiceResultException)t).getStatusCode() : new StatusCode(StatusCodes.Bad_InternalError)); t=t.getCause(); } rh.setStringTable(stringTable.toArray(new String[stringTable.size()])); return result; }
Gathers info from an exception and puts the description into a new ServiceFault. Stack Trace is converted into a DiagnosticInfo.
private Voicemails(){ }
Not instantiable.
@Override public Instruction enter(double now,FSMAgent agent){ emergency=((AmbulanceAgent)agent).getEmergency(); return super.enter(now,agent); }
Expose the emergency object from the agent to the actual agent states.
public void precomputeForScalarMultiplication(){ if (null != this.precomputedForSingle) { return; } Ed25519GroupElement Bi=this; this.precomputedForSingle=new Ed25519GroupElement[32][8]; for (int i=0; i < 32; i++) { Ed25519GroupElement Bij=Bi; for (int j=0; j < 8; j++) { final Ed25519FieldElement inverse=Bij.Z.invert(); final Ed25519FieldElement x=Bij.X.multiply(inverse); final Ed25519FieldElement y=Bij.Y.multiply(inverse); this.precomputedForSingle[i][j]=precomputed(y.add(x),y.subtract(x),x.multiply(y).multiply(Ed25519Field.D_Times_TWO)); Bij=Bij.add(Bi.toCached()).toP3(); } for (int k=0; k < 8; k++) { Bi=Bi.add(Bi.toCached()).toP3(); } } }
Precomputes the group elements needed to speed up a scalar multiplication.
public static void main(String[] args) throws Exception { System.err.println("Running Jetty 7.6.8.v20121106"); Configs configs=new Configs(); configs.validation(); server=new Server(); initConnnector(server,configs); initWebappContext(server,configs); if (configs.getJettyXML() != null && !"".equals(configs.getJettyXML().trim())) { System.err.println("Loading Jetty.xml:" + configs.getJettyXML()); try { XmlConfiguration configuration=new XmlConfiguration(new File(configs.getJettyXML()).toURI().toURL()); configuration.configure(server); } catch ( Exception ex) { System.err.println("Exception happened when loading Jetty.xml:"); ex.printStackTrace(); } } if (configs.getEnablescanner()) initScanner(web,configs); initEclipseListener(configs); initCommandListener(configs); try { server.start(); server.join(); } catch ( Exception e) { e.printStackTrace(); System.exit(100); } return; }
Main function, starts the jetty server.
protected ComponentBuilder(ComponentBuilder original){ this.current=new TextComponent(original.current); original.parts.getExtra().stream().map(null).forEach(null); }
Construct new ComponentBuilder as copy of old one.
public Builder noTransform(){ this.noTransform=true; return this; }
Don't accept a transformed response.
public static byte[] decode(byte[] source) throws java.io.IOException { byte[] decoded=null; decoded=decode(source,0,source.length,Base64.NO_OPTIONS); return decoded; }
Low-level access to decoding ASCII characters in the form of a byte array. <strong>Ignores GUNZIP option, if it's set.</strong> This is not generally a recommended method, although it is used internally as part of the decoding process. Special case: if len = 0, an empty array is returned. Still, if you need more speed and reduced memory footprint (and aren't gzipping), consider this method.
private void pushRun(int runBase,int runLen){ this.runBase[stackSize]=runBase; this.runLen[stackSize]=runLen; stackSize++; }
Pushes the specified run onto the pending-run stack.
private List<String> buildNames(Tree node,boolean multiply){ List<String> result=new ArrayList<String>(); if (node == null) { return result; } if (node.getChildCount() == 1 && !multiply) { result.add(typeName + node.getChild(0).getText()); return result; } StringBuilder name=new StringBuilder(); for (int i=0; i < node.getChildCount(); ++i) { if (multiply) { result.add(node.getChild(i).getText()); } else { name.append(node.getChild(i).getText()); } } if (!multiply) { result.add(name.toString()); } return result; }
Build names from current node (TkVariableIdents of TkFunctionName node)
public static ReplaceableImage create(EncodedImage placeholder){ return new ReplaceableImage(placeholder); }
Creates an encoded image that can later be replaced with a different image
public static <T>T requireNonNull(T obj){ if (obj == null) throw new NullPointerException(); return obj; }
Checks that object reference is not null.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case DomPackage.TAG__TITLE: return title != null; case DomPackage.TAG__VALUES: return values != null && !values.isEmpty(); case DomPackage.TAG__TAG_DEFINITION: return TAG_DEFINITION_EDEFAULT == null ? tagDefinition != null : !TAG_DEFINITION_EDEFAULT.equals(tagDefinition); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
method_info findMethod(String s){ method_info m; int i; for (i=0; i < methods_count; i++) { m=methods[i]; if (s.equals(m.toName(constant_pool))) { return m; } } return null; }
Locates a method by name.
@Override public void merge(Result<List<ListBasedResultWrapper>,Object> otherResult){ if (otherResult.size() > 0) { totalNumberOfRecords+=otherResult.size(); this.allRowsResult.add(otherResult.getResult()); } }
below method will be used to merge the scanned result
public static void storagePools(String id){ VirtualArrayRestRep virtualArray=getVirtualArray(id); VirtualArrayStoragePoolsDataTable dataTable=new VirtualArrayStoragePoolsDataTable(); render(virtualArray,dataTable); }
Displays a page listing all storage pools associated with the given virtual array.
public Matrix(double[][] A){ m=A.length; n=A[0].length; for (int i=0; i < m; i++) { if (A[i].length != n) { throw new IllegalArgumentException("All rows must have the same length."); } } this.A=A; }
Construct a matrix from a 2-D array.
public void updateNextRunDateTime(final DateTime nextRunDateTime){ if (nextRunDateTime != null) { this.nextRunDateTime=nextRunDateTime.toDate(); } else { this.nextRunDateTime=null; } }
update the nextRunDateTime
public void createWeekScenarioBug10265_UpgradeAndParChange2() throws Exception { BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-02-22 23:00:00")); VOServiceDetails serviceDetails=serviceSetup.createPublishAndActivateMarketableService(basicSetup.getSupplierAdminKey(),"BUG10265_UPG_PARCHG2",TestService.EXAMPLE_ASYNC,TestPriceModel.EXAMPLE_PERUNIT_WEEK_ROLES_PARS2,3,technicalServiceAsync,supplierMarketplace); setCutOffDay(basicSetup.getSupplierAdminKey(),1); VOSubscriptionDetails subDetails=subscrSetup.subscribeToService(basicSetup.getCustomerAdminKey(),"BUG10265_UPG_PARCHG2",serviceDetails,basicSetup.getCustomerUser1(),VOServiceFactory.getRole(serviceDetails,"ADMIN")); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-02-23 00:00:00")); subDetails=subscrSetup.completeAsyncSubscription(basicSetup.getSupplierAdminKey(),basicSetup.getCustomerAdmin(),subDetails); subDetails=subscrSetup.modifyParameterForSubscription(subDetails,DateTimeHandling.calculateMillis("2013-02-24 23:00:00"),"MAX_FOLDER_NUMBER","3"); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-02-25 00:00:00")); subDetails=subscrSetup.completeAsyncModifySubscription(basicSetup.getSupplierAdminKey(),basicSetup.getCustomerAdmin(),subDetails); VOServiceDetails perUnitService=serviceSetup.createPublishAndActivateMarketableService(basicSetup.getSupplierAdminKey(),"BUG10265_UPG_PARCHG2_SERVICE2",TestService.EXAMPLE_ASYNC,TestPriceModel.EXAMPLE_PERUNIT_WEEK_ROLES_PARS3,0,technicalServiceAsync,supplierMarketplace); serviceSetup.registerCompatibleServices(basicSetup.getSupplierAdminKey(),serviceDetails,perUnitService); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-02-27 23:00:00")); VOSubscriptionDetails upgradedSubDetails=subscrSetup.copyParametersAndUpgradeSubscription(basicSetup.getCustomerAdminKey(),subDetails,perUnitService); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-02-28 00:00:00")); upgradedSubDetails=subscrSetup.completeAsyncUpgradeSubscription(basicSetup.getSupplierAdminKey(),basicSetup.getCustomerAdmin(),upgradedSubDetails); upgradedSubDetails=subscrSetup.modifyParameterForSubscription(upgradedSubDetails,DateTimeHandling.calculateMillis("2013-02-28 23:00:00"),"MAX_FOLDER_NUMBER","5"); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-03-01 00:00:00")); upgradedSubDetails=subscrSetup.completeAsyncModifySubscription(basicSetup.getSupplierAdminKey(),basicSetup.getCustomerAdmin(),upgradedSubDetails); upgradedSubDetails=subscrSetup.modifyParameterForSubscription(upgradedSubDetails,DateTimeHandling.calculateMillis("2013-03-01 06:00:00"),"MAX_FOLDER_NUMBER","7"); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-03-01 07:00:00")); upgradedSubDetails=subscrSetup.completeAsyncModifySubscription(basicSetup.getSupplierAdminKey(),basicSetup.getCustomerAdmin(),upgradedSubDetails); upgradedSubDetails=subscrSetup.modifyParameterForSubscription(upgradedSubDetails,DateTimeHandling.calculateMillis("2013-03-02 11:00:00"),"MAX_FOLDER_NUMBER","4"); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-03-02 12:00:00")); upgradedSubDetails=subscrSetup.completeAsyncModifySubscription(basicSetup.getSupplierAdminKey(),basicSetup.getCustomerAdmin(),upgradedSubDetails); BillingIntegrationTestBase.setDateFactoryInstance(DateTimeHandling.calculateMillis("2013-03-03 07:00:00")); subscrSetup.unsubscribeToService(upgradedSubDetails.getSubscriptionId()); resetCutOffDay(basicSetup.getSupplierAdminKey()); BillingIntegrationTestBase.updateSubscriptionListForTests("BUG10265_UPG_PARCHG2",subDetails); BillingIntegrationTestBase.updateSubscriptionListForTests("BUG10265_UPG_PARCHG2",upgradedSubDetails); }
Upgrade a service with a free period to another service without a free period. Both services have a per unit/week price model. Change a parameter in the free period and after it. Charged week overlaps billing period.
public static String extractFileDir(String filename){ String splitted[]=filename.replaceAll("\\\\","/").split("/"); if (splitted.length > 1) return filename.substring(0,filename.length() - splitted[splitted.length - 1].length() - 1); return ""; }
Extracts file's directory Excludes last / \
public JSONObject putOpt(String key,Object value) throws JSONException { if (key != null && value != null) { this.put(key,value); } return this; }
Put a key/value pair in the JSONObject, but only if the key and the value are both non-null.
public static boolean fileMove(String src,String dest){ Logger.getInstance().logVerbose("FileMove","From " + src + " to "+ dest); File fileSrc=new File(src); File fileDest=new File(dest); return fileSrc.renameTo(fileDest); }
Moves a file
public boolean removeParser(Parser parser){ boolean removed=false; if (parserManager != null) { removed=parserManager.removeParser(parser); } return removed; }
Removes a parser from this text area.
public Document read(String source) throws DocumentException { try { return getReader().read(source); } catch ( JAXBRuntimeException ex) { Throwable cause=ex.getCause(); throw new DocumentException(cause.getMessage(),cause); } }
Parses the the given URL or filename.
public static FSArray toFSArray(JCas jCas,Collection<? extends FeatureStructure> collection){ if (collection == null || collection.isEmpty()) { return new FSArray(jCas,0); } else { FSArray array=new FSArray(jCas,collection.size()); int i=0; for ( FeatureStructure fs : collection) { array.set(i,fs); i++; } return array; } }
Convert a collection (of annotation) to an FSArray
private void processIncomingDataPacket(DatagramPacket packet) throws Exception { this.peerAddress=packet.getAddress(); int packetLength=packet.getLength(); byte[] bytes=packet.getData(); byte[] msgBytes=new byte[packetLength]; System.arraycopy(bytes,0,msgBytes,0,packetLength); if (sipStack.isLoggingEnabled()) { this.sipStack.getStackLogger().logDebug("UDPMessageChannel: processIncomingDataPacket : peerAddress = " + peerAddress.getHostAddress() + "/"+ packet.getPort()+ " Length = "+ packetLength); } SIPMessage sipMessage=null; try { this.receptionTime=System.currentTimeMillis(); sipMessage=myParser.parseSIPMessage(msgBytes); myParser=null; } catch ( ParseException ex) { myParser=null; if (sipStack.isLoggingEnabled()) { this.sipStack.getStackLogger().logDebug("Rejecting message ! " + new String(msgBytes)); this.sipStack.getStackLogger().logDebug("error message " + ex.getMessage()); this.sipStack.getStackLogger().logException(ex); } String msgString=new String(msgBytes,0,packetLength); if (!msgString.startsWith("SIP/") && !msgString.startsWith("ACK ")) { SIPMessage badReqRes=createBadReqRes(msgString,ex); if (badReqRes != null) { if (sipStack.isLoggingEnabled()) { sipStack.getStackLogger().logDebug("Sending automatic 400 Bad Request:"); sipStack.getStackLogger().logDebug(msgString); } try { this.sendMessage(badReqRes,peerAddress,packet.getPort(),"UDP",false); } catch ( IOException e) { if (sipStack.isLoggingEnabled()) this.sipStack.getStackLogger().logException(e); } } else { if (sipStack.isLoggingEnabled()) { sipStack.getStackLogger().logDebug("Could not formulate automatic 400 Bad Request"); } } } return; } if (sipMessage == null) { if (sipStack.isLoggingEnabled()) { this.sipStack.getStackLogger().logDebug("Rejecting message ! + Null message parsed."); } if (pingBackRecord.get(packet.getAddress().getHostAddress() + ":" + packet.getPort()) == null) { byte[] retval="\r\n\r\n".getBytes(); DatagramPacket keepalive=new DatagramPacket(retval,0,retval.length,packet.getAddress(),packet.getPort()); ((UDPMessageProcessor)this.messageProcessor).sock.send(keepalive); this.sipStack.getTimer().schedule(new PingBackTimerTask(packet.getAddress().getHostAddress(),packet.getPort()),1000); } return; } ViaList viaList=sipMessage.getViaHeaders(); if (sipMessage.getFrom() == null || sipMessage.getTo() == null || sipMessage.getCallId() == null || sipMessage.getCSeq() == null || sipMessage.getViaHeaders() == null) { String badmsg=new String(msgBytes); if (sipStack.isLoggingEnabled()) { this.sipStack.getStackLogger().logError("bad message " + badmsg); this.sipStack.getStackLogger().logError(">>> Dropped Bad Msg " + "From = " + sipMessage.getFrom() + "To = "+ sipMessage.getTo()+ "CallId = "+ sipMessage.getCallId()+ "CSeq = "+ sipMessage.getCSeq()+ "Via = "+ sipMessage.getViaHeaders()); } return; } if (sipMessage instanceof SIPRequest) { Via v=(Via)viaList.getFirst(); Hop hop=sipStack.addressResolver.resolveAddress(v.getHop()); this.peerPort=hop.getPort(); this.peerProtocol=v.getTransport(); this.peerPacketSourceAddress=packet.getAddress(); this.peerPacketSourcePort=packet.getPort(); try { this.peerAddress=packet.getAddress(); boolean hasRPort=v.hasParameter(Via.RPORT); if (hasRPort || !hop.getHost().equals(this.peerAddress.getHostAddress())) { v.setParameter(Via.RECEIVED,this.peerAddress.getHostAddress()); } if (hasRPort) { v.setParameter(Via.RPORT,Integer.toString(this.peerPacketSourcePort)); } } catch ( java.text.ParseException ex1) { InternalErrorHandler.handleException(ex1); } } else { this.peerPacketSourceAddress=packet.getAddress(); this.peerPacketSourcePort=packet.getPort(); this.peerAddress=packet.getAddress(); this.peerPort=packet.getPort(); this.peerProtocol=((Via)viaList.getFirst()).getTransport(); } this.processMessage(sipMessage); }
Process an incoming datagram
public void runTest() throws Throwable { Document doc; NodeList elementList; Element firstNode; Node testNode; NamedNodeMap attributes; Attr domesticAttr; Attr setAttr; Node setNode; doc=(Document)load("hc_staff",true); elementList=doc.getElementsByTagName("acronym"); firstNode=(Element)elementList.item(0); domesticAttr=doc.createAttribute("title"); domesticAttr.setValue("Y\u03b1"); setAttr=firstNode.setAttributeNode(domesticAttr); elementList=doc.getElementsByTagName("acronym"); testNode=elementList.item(2); attributes=testNode.getAttributes(); { boolean success=false; try { setNode=attributes.setNamedItem(domesticAttr); } catch ( DOMException ex) { success=(ex.code == DOMException.INUSE_ATTRIBUTE_ERR); } assertTrue("throw_INUSE_ATTRIBUTE_ERR",success); } }
Runs the test case.
public static void notifyTimeline(final JSONObject message){ final String msgStr=message.toString(); synchronized (SESSIONS) { for ( final Session session : SESSIONS) { if (session.isOpen()) { session.getAsyncRemote().sendText(msgStr); } } } }
Notifies the specified comment message to browsers.
public JSONArray names(){ JSONArray ja=new JSONArray(); Iterator keys=keys(); while (keys.hasNext()) { ja.put(keys.next()); } return ja.length() == 0 ? null : ja; }
Produce a JSONArray containing the names of the elements of this JSONObject.
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:57:33.361 -0500",hash_original_method="CC5347E979B0813386EC9E9DE77BBA76",hash_generated_method="2369D231E720E4DD7AA31AD4AE508C0D") @Override public Object clone(){ try { ZipEntry result=(ZipEntry)super.clone(); result.extra=extra != null ? extra.clone() : null; return result; } catch ( CloneNotSupportedException e) { throw new AssertionError(e); } }
Returns a deep copy of this zip entry.
public ScanManagerConfig copy(String newname){ return copy(newname,this); }
Creates a copy of this object, with the specified name.
@NotNull public static List<List<ClusterNode>> readPartitionAssignment(BinaryRawReader reader,PlatformContext ctx){ assert reader != null; assert ctx != null; int partCnt=reader.readInt(); List<List<ClusterNode>> res=new ArrayList<>(partCnt); IgniteClusterEx cluster=ctx.kernalContext().grid().cluster(); for (int i=0; i < partCnt; i++) { int partSize=reader.readInt(); List<ClusterNode> part=new ArrayList<>(partSize); for (int j=0; j < partSize; j++) part.add(cluster.node(reader.readUuid())); res.add(part); } return res; }
Reads the partition assignment.
public void clear(){ time=0.0; }
Clears any timing data collected.
protected byte[] encode0(String cstring,String sstring){ byte[] c=cstring.getBytes(StandardCharsets.UTF_8); ; byte[] s=sstring.getBytes(StandardCharsets.UTF_8); ; byte[] zero=new byte[1]; int len=4 + c.length + 1+ 4+ s.length+ 1+ 4+ 4; ByteBuffer bb=ByteBuffer.allocate(len).order(ByteOrder.nativeOrder()); bb.putInt(c.length + 1).put(c).put(zero).putInt(s.length + 1).put(s).put(zero).putInt(cusec).putInt(ctime); return bb.array(); }
Encodes to be used in a dfl file
public JSONArray names(){ JSONArray ja=new JSONArray(); Iterator keys=keys(); while (keys.hasNext()) { ja.put(keys.next()); } return ja.length() == 0 ? null : ja; }
Produce a JSONArray containing the names of the elements of this JSONObject.
private void addToken(int tokenType){ addToken(zzStartRead,zzMarkedPos - 1,tokenType); }
Adds the token specified to the current linked list of tokens.
public LabelServiceCall(ResolutionContext context,List<Resolution> resolutions){ this.context=context; this.resolutions=resolutions; }
Build with all the right stuff resolved.
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){ switch (featureID) { case UmplePackage.TRACE_DIRECTIVE___TRACE_ITEM_1: getTraceItem_1().clear(); getTraceItem_1().addAll((Collection<? extends TraceItem_>)newValue); return; case UmplePackage.TRACE_DIRECTIVE___ANONYMOUS_TRACE_DIRECTIVE_11: getAnonymous_traceDirective_1_1().clear(); getAnonymous_traceDirective_1_1().addAll((Collection<? extends Anonymous_traceDirective_1_>)newValue); return; } super.eSet(featureID,newValue); }
<!-- begin-user-doc --> <!-- end-user-doc -->
protected void continueOutputProcessingJoin(boolean doOutput,boolean forceUpdate){ if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".continueOutputProcessingJoin"); } boolean isGenerateSynthetic=parent.getStatementResultService().isMakeSynthetic(); UniformPair<EventBean[]> newOldEvents=resultSetProcessor.continueOutputLimitedLastAllNonBufferedJoin(isGenerateSynthetic,isAll); continueOutputProcessingViewAndJoin(doOutput,forceUpdate,newOldEvents); }
Called once the output condition has been met. Invokes the result set processor. Used for join event data.
public ReversedList(List<T> target){ this.target=target; }
Creates a new instance of ReversedList
@Override public E remove(int location){ E result; if (location < 0 || location >= size) { throw new IndexOutOfBoundsException("" + location + " out of: "+ size); } if (location == 0) { result=array[firstIndex]; array[firstIndex++]=null; } else if (location == size - 1) { int lastIndex=firstIndex + size - 1; result=array[lastIndex]; array[lastIndex]=null; } else { int elementIndex=firstIndex + location; result=array[elementIndex]; if (location < size / 2) { System.arraycopy(array,firstIndex,array,firstIndex + 1,location); array[firstIndex++]=null; } else { System.arraycopy(array,elementIndex + 1,array,elementIndex,size - location - 1); array[firstIndex + size - 1]=null; } } size--; if (size == 0) { firstIndex=0; } modCount++; return result; }
Removes the object at the specified location from this list.
public synchronized void remove(int index){ mCategories.remove(index); mValues.remove(index); }
Removes an existing value from the series.
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){ switch (featureID) { case UmplePackage.INTERFACE_MEMBER_DECLARATION___CONSTANT_DECLARATION_1: return ((InternalEList<?>)getConstantDeclaration_1()).basicRemove(otherEnd,msgs); case UmplePackage.INTERFACE_MEMBER_DECLARATION___ABSTRACT_METHOD_DECLARATION_1: return ((InternalEList<?>)getAbstractMethodDeclaration_1()).basicRemove(otherEnd,msgs); case UmplePackage.INTERFACE_MEMBER_DECLARATION___POSITION_1: return ((InternalEList<?>)getPosition_1()).basicRemove(otherEnd,msgs); case UmplePackage.INTERFACE_MEMBER_DECLARATION___DISPLAY_COLOR_1: return ((InternalEList<?>)getDisplayColor_1()).basicRemove(otherEnd,msgs); case UmplePackage.INTERFACE_MEMBER_DECLARATION___IS_A1: return ((InternalEList<?>)getIsA_1()).basicRemove(otherEnd,msgs); case UmplePackage.INTERFACE_MEMBER_DECLARATION___EXTRA_CODE_1: return ((InternalEList<?>)getExtraCode_1()).basicRemove(otherEnd,msgs); } return super.eInverseRemove(otherEnd,featureID,msgs); }
<!-- begin-user-doc --> <!-- end-user-doc -->
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
public void clear(){ synchronized (this) { internalMap=new HashMap<K,V>(); } }
Removes all entries in this map.
public void start(){ mView.removeCallbacks(mAnimationStarter); startAnimation(); }
Starts the currently pending property animations immediately. Calling <code>start()</code> is optional because all animations start automatically at the next opportunity. However, if the animations are needed to start immediately and synchronously (not at the time when the next event is processed by the hierarchy, which is when the animations would begin otherwise), then this method can be used.
@Override public void draw(Canvas canvas){ if (mText == null) { return; } RectF rect=new RectF(mText.getBoundingBox()); rect.left=translateX(rect.left); rect.top=translateY(rect.top); rect.right=translateX(rect.right); rect.bottom=translateY(rect.bottom); canvas.drawRect(rect,sRectPaint); List<? extends Text> textComponents=mText.getComponents(); for ( Text currentText : textComponents) { float left=translateX(currentText.getBoundingBox().left); float bottom=translateY(currentText.getBoundingBox().bottom); canvas.drawText(currentText.getValue(),left,bottom,sTextPaint); } }
Draws the text block annotations for position, size, and raw value on the supplied canvas.
public static int inferContentType(String fileName){ if (fileName == null) { return TYPE_OTHER; } else if (fileName.endsWith(".mpd")) { return TYPE_DASH; } else if (fileName.endsWith(".ism")) { return TYPE_SS; } else if (fileName.endsWith(".m3u8")) { return TYPE_HLS; } else { return TYPE_OTHER; } }
Makes a best guess to infer the type from a file name.
public final AC gap(){ curIx++; return this; }
Specifies the gap size to be the default one <b>AND</b> moves to the next column/row. The method is called <code>.gap()</code> rather the more natural <code>.next()</code> to indicate that it is very much related to the other <code>.gap(..)</code> methods. <p> For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.
public final boolean hasPackageDeclaration(){ for (int i=0, length=this.patterns.length; i < length; i++) { if (this.patterns[i] instanceof PackageDeclarationPattern) return true; } return false; }
Returns whether the pattern has one or several package declaration or not.
@Override public int readInt(String filePath){ FileChannel fileChannel=updateCache(filePath); ByteBuffer byteBffer=read(fileChannel,CarbonCommonConstants.INT_SIZE_IN_BYTE); return byteBffer.getInt(); }
This method will be used to read int from file from postion(offset), here length will be always 4 bacause int byte size if 4
private int[] expandKey(byte[] uKey){ int[] key=new int[52]; if (uKey.length < 16) { byte[] tmp=new byte[16]; System.arraycopy(uKey,0,tmp,tmp.length - uKey.length,uKey.length); uKey=tmp; } for (int i=0; i < 8; i++) { key[i]=bytesToWord(uKey,i * 2); } for (int i=8; i < 52; i++) { if ((i & 7) < 6) { key[i]=((key[i - 7] & 127) << 9 | key[i - 6] >> 7) & MASK; } else if ((i & 7) == 6) { key[i]=((key[i - 7] & 127) << 9 | key[i - 14] >> 7) & MASK; } else { key[i]=((key[i - 15] & 127) << 9 | key[i - 14] >> 7) & MASK; } } return key; }
The following function is used to expand the user key to the encryption subkey. The first 16 bytes are the user key, and the rest of the subkey is calculated by rotating the previous 16 bytes by 25 bits to the left, and so on until the subkey is completed.
public void updateGraph(){ buildLine(); if (vertexCount > -1) { state.setData(graphVertex,vertexCount,graphXMin,graphXMax,graphYMin,graphYMax,vertex); } }
Update the graph
@PostConstruct protected void init(){ parseRecipientsString(); parseAdditionalPropertiesString(); checkConnection(); }
Initialize E-Mail service.
public static RationaleDialog newInstance(int requestCode,boolean finishActivity){ Bundle arguments=new Bundle(); arguments.putInt(ARGUMENT_PERMISSION_REQUEST_CODE,requestCode); arguments.putBoolean(ARGUMENT_FINISH_ACTIVITY,finishActivity); RationaleDialog dialog=new RationaleDialog(); dialog.setArguments(arguments); return dialog; }
Creates a new instance of a dialog displaying the rationale for the use of the location permission. <p> The permission is requested after clicking 'ok'.
public static TStream<JsonObject> sensorsAB(Topology topology){ TStream<JsonObject> sensorA=SimulatedSensors.burstySensor(topology,"A"); TStream<JsonObject> sensorB=SimulatedSensors.burstySensor(topology,"B"); TStream<JsonObject> sensors=sensorA.union(sensorB); TWindow<JsonObject,JsonElement> sensorWindow=sensors.last(50,null); sensors=JsonAnalytics.aggregate(sensorWindow,"name","reading",MIN,MAX,MEAN,STDDEV); sensors=sensors.filter(null); return sensors; }
Create a stream containing two aggregates from two bursty sensors A and B that only produces output when the sensors (independently) are having a burst period out of their normal range.
public static double quantile(double x,double location,double shape){ return (x <= .5) ? (x == .5) ? location : (x == 0.) ? Double.NEGATIVE_INFINITY : location - shape / Math.tan(Math.PI * x) : (x == 1.) ? Double.POSITIVE_INFINITY : location + shape / Math.tan(Math.PI * (1 - x)); }
PDF function, static version.
public BreakpointSetSynchronizer(final IDebugger debugger,final ListenerProvider<IDebugEventListener> listeners){ super(debugger,listeners); }
Creates a new Breakpoint Set synchronizer.
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"PKHBT"); translateAll(environment,instruction,"PKHBT",instructions); }
PKHBT {<cond>} <Rd>, <Rn>, <Rm> {, LSL #<shift_imm>} Operation: if ConditionPassed(cond) then Rd[15:0] = Rn[15:0] Rd[31:16] = (Rm Logical_Shift_Left shift_imm)[31:16]
@Timed @ExceptionMetered @Path("{name}/backfill-expiration") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) public boolean backfillExpiration(@Auth AutomationClient automationClient,@PathParam("name") String name,List<String> passwords){ Optional<Secret> secretOptional=secretController.getSecretByName(name); if (!secretOptional.isPresent()) { throw new NotFoundException("No such secret: " + name); } Secret secret=secretOptional.get(); String secretName=secret.getName(); byte[] secretContent=Base64.getDecoder().decode(secret.getSecret()); passwords.add(""); Instant expiry=null; if (secretName.endsWith(".crt") || secretName.endsWith(".pem") || secretName.endsWith(".key")) { expiry=ExpirationExtractor.expirationFromEncodedCertificateChain(secretContent); } else if (secretName.endsWith(".gpg") || secretName.endsWith(".pgp")) { expiry=ExpirationExtractor.expirationFromOpenPGP(secretContent); } else if (secretName.endsWith(".p12") || secretName.endsWith(".pfx")) { while (expiry == null && !passwords.isEmpty()) { String password=passwords.remove(0); expiry=ExpirationExtractor.expirationFromKeystore("PKCS12",password,secretContent); } } else if (secretName.endsWith(".jceks")) { while (expiry == null && !passwords.isEmpty()) { String password=passwords.remove(0); expiry=ExpirationExtractor.expirationFromKeystore("JCEKS",password,secretContent); } } else if (secretName.endsWith(".jks")) { while (expiry == null && !passwords.isEmpty()) { String password=passwords.remove(0); expiry=ExpirationExtractor.expirationFromKeystore("JKS",password,secretContent); } } if (expiry != null) { logger.info("Found expiry for secret {}: {}",secretName,expiry.getEpochSecond()); boolean success=secretDAO.setExpiration(name,expiry); if (success) { Map<String,String> extraInfo=new HashMap<>(); extraInfo.put("backfilled expiry",Long.toString(expiry.getEpochSecond())); auditLog.recordEvent(new Event(Instant.now(),EventTag.SECRET_BACKFILLEXPIRY,automationClient.getName(),name,extraInfo)); } return success; } logger.info("Unable to determine expiry for secret {}",secretName); return false; }
Backfill expiration for this secret.
public static void printGroups(PrintStream out){ for ( Group group : groups) { out.println(group); } }
Prints all the counter groups to a given stream.
@Override public boolean clonePropertiesOf(PLIObject object){ if (super.clonePropertiesOf(object)) { if (object instanceof PLIHotspot) { PLIHotspot hotspot=(PLIHotspot)object; this.setAtv(hotspot.getAtv()); this.setAth(hotspot.getAth()); this.setWidth(hotspot.getWidth()); this.setHeight(hotspot.getHeight()); this.setOverAlpha(hotspot.getOverAlpha()); this.setDefaultOverAlpha(hotspot.getDefaultOverAlpha()); } return true; } return false; }
clone methods
public SymbolTableEntryOriginal basicGetDelegationBaseType(){ return delegationBaseType; }
<!-- begin-user-doc --> <!-- end-user-doc -->
private void clearAsyncQueue(LocalRegion region,boolean needsWriteLock,RegionVersionVector rvv){ DiskRegion dr=region.getDiskRegion(); if (needsWriteLock) { acquireWriteLock(dr); } try { Iterator<Object> it=this.asyncQueue.iterator(); while (it.hasNext()) { Object o=it.next(); if (o instanceof AsyncDiskEntry) { AsyncDiskEntry ade=(AsyncDiskEntry)o; if (shouldClear(region,rvv,ade)) { rmAsyncItem(o); } } } } finally { if (needsWriteLock) { releaseWriteLock(dr); } } }
Removes anything found in the async queue for the given region
private void drawXAxisMarker(Canvas canvas,double value,NumberFormat numberFormat,int spacing){ String marker=chartByDistance ? numberFormat.format(value) : StringUtils.formatElapsedTime((long)value); Rect rect=getRect(xAxisMarkerPaint,marker); canvas.drawText(marker,getX(value),topBorder + effectiveHeight + spacing+ rect.height(),xAxisMarkerPaint); }
Draws a x axis marker.
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
public boolean isExpiredDelivery() throws RcsPersistentStorageException, RcsGenericException { try { return mTransferInf.isExpiredDelivery(); } catch ( Exception e) { RcsPersistentStorageException.assertException(e); throw new RcsGenericException(e); } }
Returns true if delivery for this file has expired or false otherwise. Note: false means either that delivery for this file has not yet expired, delivery has been successful, delivery expiration has been cleared (see clearFileTransferDeliveryExpiration) or that this particular file is not eligible for delivery expiration in the first place.
public NokiaOperatorLogo(byte[] bitmapData,int mcc,int mnc){ super(SmsPort.NOKIA_OPERATOR_LOGO,SmsPort.ZERO); bitmapData_=bitmapData; mcc_=mcc; mnc_=mnc; }
Creates a Nokia Operator Logo message
public static void clearStartupLogMessages(){ startupLogMessages=null; }
Clear down the list of startup messages. (Just saves a little RAM if there were a lot?)
public IsA statelessClone(){ return new IsA(type); }
Create a new <code>IsA</code> filter with the same control class as this one.