code
stringlengths
10
174k
nl
stringlengths
3
129k
public double worldToView(Axis axis,Number value,boolean extrapolate){ checkAxisBounds(axis); double min=axis.getMin().doubleValue(); double max=axis.getMax().doubleValue(); double val=value.doubleValue(); if (!extrapolate) { if (val <= min) { return 0.0; } if (val >= max) { return getShapeLength(); } } double minLog=(min > 0.0) ? Math.log10(min) : 0.0; double maxLog=(max > 0.0) ? Math.log10(max) : 1.0; return (Math.log10(val) - minLog) * getShapeLength() / (maxLog - minLog); }
Converts a world (axis) coordinate value to a view (screen) coordinate value.
@SuppressWarnings("unchecked") public Continuation(Name top,Hashtable<?,?> environment){ super(); starter=top; this.environment=(Hashtable<?,?>)((environment == null) ? null : environment.clone()); }
Constructs a new instance of Continuation.
private void testProbability(double probability){ Replace replace=new Replace(probability); int count=0; for (int i=0; i < TestThresholds.SAMPLES; i++) { Solution original=new Solution(1,0); original.setVariable(0,new Subset(50,100)); Solution mutated=replace.evolve(new Solution[]{original})[0]; if (testSubset((Subset)original.getVariable(0),(Subset)mutated.getVariable(0))) { count++; } } Assert.assertEquals((double)count / TestThresholds.SAMPLES,probability,TestThresholds.VARIATION_EPS); }
Tests if the replace mutation occurs with the specified probability.
private void LINK(BasicBlock block1,BasicBlock block2){ if (DEBUG) { System.out.println(" Linking " + block1 + " with "+ block2); } BasicBlock s=block2; while (getSemi(getLabel(block2)) < getSemi(getLabel(getChild(s)))) { if (getSize(s) + getSize(getChild(getChild(s))) >= 2 * getSize(getChild(s))) { LTDominatorInfo.getInfo(getChild(s),ir).setAncestor(s); LTDominatorInfo.getInfo(s,ir).setChild(getChild(getChild(s))); } else { LTDominatorInfo.getInfo(getChild(s),ir).setSize(getSize(s)); LTDominatorInfo.getInfo(s,ir).setAncestor(getChild(s)); s=getChild(s); } } LTDominatorInfo.getInfo(s,ir).setLabel(getLabel(block2)); LTDominatorInfo.getInfo(block1,ir).setSize(getSize(block1) + getSize(block2)); if (getSize(block1) < 2 * getSize(block2)) { BasicBlock tmp=s; s=getChild(block1); LTDominatorInfo.getInfo(block1,ir).setChild(tmp); } while (s != null) { LTDominatorInfo.getInfo(s,ir).setAncestor(block1); s=getChild(s); } if (DEBUG) { System.out.println(" .... done"); } }
Adds edge (block1, block2) to the forest maintained as an auxiliary data structure. This implementation uses path compression and results in a O(e * alpha(e,n)) complexity, where e is the number of edges in the CFG and n is the number of nodes.
public boolean contains(Object value,Object filter,Locale locale){ String filterText=(filter == null) ? null : filter.toString().trim(); if (StringUtils.isBlank(filterText)) { return true; } if (value == null) { return false; } return StringUtils.containsIgnoreCase(value.toString(),filterText); }
Filters by contains
@Override public DPState compute(Rule rule,List<HGNode> tailNodes,int i,int j,SourcePath sourcePath,Sentence sentence,Accumulator acc){ if (rule != null && rule.getOwner().equals(ownerID)) { if (rule.getPrecomputableCost() <= Float.NEGATIVE_INFINITY) { rule.setPrecomputableCost(phrase_weights,weights); } for (int k=0; k < phrase_weights.length; k++) { acc.add(k + denseFeatureIndex,rule.getDenseFeature(k)); } for ( String key : rule.getFeatureVector().keySet()) acc.add(key,rule.getFeatureVector().getSparse(key)); } return null; }
Just chain to computeFeatures(rule), since this feature doesn't use the sourcePath or sentID.
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { super.reset(componentManager); fDoctypeName=null; fDoctypePublicId=null; fDoctypeSystemId=null; fSeenDoctypeDecl=false; fScanningDTD=false; fExternalSubsetSource=null; if (!fParserSettings) { fNamespaceContext.reset(); setScannerState(SCANNER_STATE_XML_DECL); setDispatcher(fXMLDeclDispatcher); return; } try { fLoadExternalDTD=componentManager.getFeature(LOAD_EXTERNAL_DTD); } catch ( XMLConfigurationException e) { fLoadExternalDTD=true; } try { fDisallowDoctype=componentManager.getFeature(DISALLOW_DOCTYPE_DECL_FEATURE); } catch ( XMLConfigurationException e) { fDisallowDoctype=false; } fDTDScanner=(XMLDTDScanner)componentManager.getProperty(DTD_SCANNER); try { fValidationManager=(ValidationManager)componentManager.getProperty(VALIDATION_MANAGER); } catch ( XMLConfigurationException e) { fValidationManager=null; } try { fNamespaceContext=(NamespaceContext)componentManager.getProperty(NAMESPACE_CONTEXT); } catch ( XMLConfigurationException e) { } if (fNamespaceContext == null) { fNamespaceContext=new NamespaceSupport(); } fNamespaceContext.reset(); setScannerState(SCANNER_STATE_XML_DECL); setDispatcher(fXMLDeclDispatcher); }
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
public boolean optBoolean(int index){ return this.optBoolean(index,false); }
Get the optional boolean value associated with an index. It returns false if there is no value at that index, or if the value is not Boolean.TRUE or the String "true".
@PostConstruct @Override public void init() throws ConfigException { try { _codeSource=new CodeSource(new URL(_path.getURL()),(Certificate[])null); } catch ( Exception e) { log.log(Level.FINE,e.toString(),e); } super.init(); getClassLoader().addURL(_path,_isScanned); }
Initializes the loader.
public noscript addElement(String hashcode,String element){ addElementToRegistry(hashcode,element); return (this); }
Adds an Element to the element.
protected void parseC() throws ParseException, IOException { current=reader.read(); skipSpaces(); boolean expectNumber=true; for (; ; ) { switch (current) { default : if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x1=parseFloat(); skipCommaSpaces(); float y1=parseFloat(); skipCommaSpaces(); float x2=parseFloat(); skipCommaSpaces(); float y2=parseFloat(); skipCommaSpaces(); float x=parseFloat(); skipCommaSpaces(); float y=parseFloat(); pathHandler.curvetoCubicAbs(x1,y1,x2,y2,x,y); expectNumber=skipCommaSpaces2(); } }
Parses a 'C' command.
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String name=m_arg0.execute(xctxt).str(); int context=xctxt.getCurrentNode(); DTM dtm=xctxt.getDTM(context); int doc=dtm.getDocument(); String uri=dtm.getUnparsedEntityURI(name); return new XString(uri); }
Execute the function. The function must return a valid object.
public void revokeModerator(String nickname) throws XMPPException { changeRole(nickname,"participant",null); }
Revokes moderator privileges from another user. The occupant that loses moderator privileges will become a participant. Room administrators may revoke moderator privileges only to occupants whose affiliation is member or none. This means that an administrator is not allowed to revoke moderator privileges from other room administrators or owners.
public static void saveData(final AbstractSQLProvider provider,final INaviModule module,final byte[] data) throws CouldntSaveDataException { Preconditions.checkNotNull(provider,"IE01267: Provider argument can not be null"); Preconditions.checkNotNull(module,"IE01268: Module argument can not be null"); Preconditions.checkNotNull(data,"IE01269: Data argument can not be null"); final CConnection connection=provider.getConnection(); try { connection.executeUpdate("DELETE FROM " + CTableNames.DATA_PARTS_TABLE + " WHERE module_id = "+ module.getConfiguration().getId(),true); } catch ( final SQLException exception) { throw new CouldntSaveDataException(exception); } final String preparedStatement="INSERT INTO " + CTableNames.DATA_PARTS_TABLE + "(module_id, part_id, data) VALUES(?, ?, ?)"; try (PreparedStatement statement=provider.getConnection().getConnection().prepareStatement(preparedStatement)){ statement.setInt(1,module.getConfiguration().getId()); statement.setInt(2,0); statement.setBinaryStream(3,new ByteArrayInputStream(data,0,data.length),data.length); statement.execute(); } catch ( final SQLException exception) { throw new CouldntSaveDataException(exception); } }
Saves the data of a module to the database.
public void addSource(ITLAPMOutputSource source){ ITLAPMOutputSource existingSource=(ITLAPMOutputSource)sources.get(source.getFullModulePath()); if (existingSource != null) { ITLAPMOutputSourceListener[] existingListeners=existingSource.getListeners(); for (int i=0; i < existingListeners.length; i++) { source.addListener(existingListeners[i]); existingSource.removeListener(existingListeners[i]); } } else { List list=(List)listenerLists.get(source.getFullModulePath()); if (list != null) { for (Iterator it=list.iterator(); it.hasNext(); ) { source.addListener((ITLAPMOutputSourceListener)it.next()); it.remove(); } } } sources.put(source.getFullModulePath(),source); }
Adds a source to this registry. This source will replace the most recently added source such that existingSource.getFullModulePath().equals(newSource.getFullModulePath()).
public NoBilingSharesDataAvailableException(){ }
Constructs a new exception with <code>null</code> as its detail message. The cause is not initialized.
private CollectorUtil(){ instanceNotAllowed(getClass()); }
Utility classes should not be instantiated.
public String toString(){ StringBuffer sb=new StringBuffer(m_apps_host); sb.append("{").append(m_db_host).append("-").append(m_db_name).append("-").append(m_db_uid).append("}"); return sb.toString(); }
Short String representation
public boolean match(URI uri){ return matchNormalized(uri.normalize()); }
Returns true if the given uri matches the pattern
private static void writeOp(byte[] inBuffer,int inOffset,int count,byte[] outBuffer,int write_pos,int buff_len){ if ((write_pos + count) <= buff_len) { System.arraycopy(inBuffer,inOffset,outBuffer,write_pos,count); } else { int tillEndCount; int fromStartCount; tillEndCount=buff_len - write_pos; fromStartCount=count - tillEndCount; System.arraycopy(inBuffer,inOffset,outBuffer,write_pos,tillEndCount); System.arraycopy(inBuffer,inOffset + tillEndCount,outBuffer,0,fromStartCount); } }
Utility method for write operations
public Builder addJavadoc(String javadoc){ javadocs.add(javadoc); return this; }
Adds class level javadoc.
private void updateProducerDescription(){ StringBuffer sb=new StringBuffer(); sb.append(getFilter().getDescription()); sb.append(" at ("); sb.append(receptiveField.getCenterX()); sb.append(", "); sb.append(receptiveField.getCenterY()); sb.append(")"); description=sb.toString(); }
Update producer description.
synchronized public void close(){ this.valid=false; for ( DBConnectionWrapper conn : this.connections) { logger.fine("Closing connection to (" + conn.getAppUser() + ", "+ conn.getDb()+ ")"); try { if (conn.isInuse() && conn.getCurrentStatement() != null) { logger.fine("Cancel pending query, connection (" + conn.getAppUser() + ", "+ conn.getDb()+ ")"); conn.getCurrentStatement().cancel(); } } catch ( Exception ex) { logger.log(Level.SEVERE,"Exception",ex); } conn.close(); logger.fine("Closed connection to (" + conn.getAppUser() + ", "+ conn.getDb()+ ")"); } this.connections.clear(); }
Close all connections
public java.sql.Statement createStatement() throws SQLException { checkClosed(); try { return StatementWrapper.getInstance(this,this.pooledConnection,this.mc.createStatement()); } catch ( SQLException sqlException) { checkAndFireConnectionError(sqlException); } return null; }
Passes call to method on physical connection instance. Notifies listeners of any caught exceptions before re-throwing to client.
public CodeItem(CstMethodRef ref,DalvCode code,boolean isStatic,TypeList throwsList){ super(ALIGNMENT,-1); if (ref == null) { throw new NullPointerException("ref == null"); } if (code == null) { throw new NullPointerException("code == null"); } if (throwsList == null) { throw new NullPointerException("throwsList == null"); } this.ref=ref; this.code=code; this.isStatic=isStatic; this.throwsList=throwsList; this.catches=null; this.debugInfo=null; }
Constructs an instance.
public static Transformer<Duo<Object,Object>,Boolean> ne(){ return FunctionalTools.compose(eq(),not()); }
ne, not equals.
@Override public boolean exists(){ ClassLoader loader=Thread.currentThread().getContextClassLoader(); return loader.getResource(getTrimPath()) != null; }
Returns true if the file exists.
public static boolean isTrue(boolean expression,String message){ if (!expression) throw new AssertionFailedException("assertion failed: " + message); return expression; }
Asserts that the given boolean is <code>true</code>. If this is not the case, some kind of unchecked exception is thrown. The given message is included in that exception, to aid debugging.
public static Matrix centerCorpImageview(DragImageView imageView,Bitmap bitmap){ float height, width; int x1=0, y1=0; float scale=1; if (imageView.imageViewHeight / bitmap.getHeight() > imageView.imageViewWidth / bitmap.getWidth()) { height=bitmap.getHeight(); scale=imageView.imageViewHeight / height; width=imageView.imageViewWidth / scale; x1=(int)((bitmap.getWidth() - width) / 2); y1=0; } else { width=bitmap.getWidth(); scale=imageView.imageViewWidth / width; height=imageView.imageViewHeight / scale; y1=(int)((bitmap.getHeight() - height) / 2); x1=0; } Bitmap cutBitmap=Bitmap.createBitmap(bitmap,x1,y1,(int)width,(int)height); imageView.setImageBitmap(cutBitmap); return imageView.resetMatrix(); }
help DragImageView to CENTER_CORP
public static void initialize_update_sources(Context ctx){ if (_SOURCES != null) { return; } _SOURCES=new ArrayList<UpdateSource>(); Log.v(MainActivity.TAG,"Reading update sources..."); try { InputStream is=ctx.getAssets().open("sources.json"); StringBuilder buffer=new StringBuilder(); BufferedReader br=new BufferedReader(new InputStreamReader(is,"UTF-8")); String s; while ((s=br.readLine()) != null) { buffer.append(s); } JSONArray sources=new JSONArray(buffer.toString()); for (int i=0; i < sources.length(); ++i) { String name=sources.getJSONObject(i).getString("name"); Log.v(MainActivity.TAG,"Reading " + name); String url=sources.getJSONObject(i).getString("url"); JSONObject packages=sources.getJSONObject(i).optJSONObject("packages"); if (packages == null || packages.length() == 0) { throw new JSONException("packages missing or empty for " + name); } ArrayList<UpdateSourceEntry> entries=new ArrayList<UpdateSourceEntry>(); Iterator<String> it=packages.keys(); while (it.hasNext()) { String applicable_packages=it.next(); JSONObject entry=packages.getJSONObject(applicable_packages); UpdateSourceEntry use=new UpdateSourceEntry(applicable_packages); use.set_version_regexp(entry.getString("version")); try { use.set_download_regexp(entry.getString("download_regexp")); } catch ( JSONException ignored) { } try { use.set_download_url(entry.getString("download")); } catch ( JSONException ignored) { } try { use.set_changelog_regexp(entry.getString("changelog")); } catch ( JSONException ignored) { } entries.add(use); } UpdateSource us=new UpdateSource(name,url,entries); JSONArray conditions=sources.getJSONObject(i).optJSONArray("autoselect_if"); if (conditions != null) { List<String> autoselect_conditions=new ArrayList<String>(); for (int j=0; j < conditions.length(); ++j) { autoselect_conditions.add(conditions.getString(j)); } if (autoselect_conditions.size() > 0) { us.set_autoselect_conditions(autoselect_conditions); } } int delay=sources.getJSONObject(i).optInt("request_delay",0); if (delay > 0) { us.set_request_delay(delay); } _SOURCES.add(us); } } catch ( IOException e) { Log.e(MainActivity.TAG,"Could not open sources.json!",e); } catch ( JSONException e) { Log.e(MainActivity.TAG,"sources.json seems to be malformed!",e); } }
Initializes the update sources by reading the ones available in sources.json. They are kept in memory in order to avoid looking them up in the assets every time.
private IRuntimeClasspathEntry[] resolveClasspathEntries(List<IClasspathEntry> classpathEntries) throws CoreException { LinkedHashSet<IRuntimeClasspathEntry> runtimeClasspathEntries=new LinkedHashSet<IRuntimeClasspathEntry>(); for ( IClasspathEntry classpathEntry : classpathEntries) { if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_PROJECT) { String projectName=classpathEntry.getPath().lastSegment(); IJavaProject theproject=JavaProjectUtilities.findJavaProject(projectName); IRuntimeClasspathEntry projectEntry=JavaRuntime.newProjectRuntimeClasspathEntry(theproject); runtimeClasspathEntries.add(projectEntry); runtimeClasspathEntries.addAll(dependenciesForProject(theproject)); } else { runtimeClasspathEntries.add(JavaRuntime.newArchiveRuntimeClasspathEntry(classpathEntry.getPath())); } } return runtimeClasspathEntries.toArray(NO_ENTRIES); }
Given a list of IClasspathEntry, produce an array of IRuntimeClasspathEntry based on that list.
public void redraw(){ if (Double.parseDouble(tfRectangle1X.getText()) != rectangle1.getX()) { rectangle1.setX(Double.parseDouble(tfRectangle1X.getText())); } if (Double.parseDouble(tfRectangle1Y.getText()) != rectangle1.getY()) { rectangle1.setY(Double.parseDouble(tfRectangle1Y.getText())); } if (Double.parseDouble(tfRectangle1Width.getText()) != rectangle1.getWidth()) { rectangle1.setWidth(Double.parseDouble(tfRectangle1Width.getText())); } if (Double.parseDouble(tfRectangle1Height.getText()) != rectangle1.getHeight()) { rectangle1.setHeight(Double.parseDouble(tfRectangle1Height.getText())); } if (Double.parseDouble(tfRectangle2X.getText()) != rectangle2.getX()) { rectangle2.setX(Double.parseDouble(tfRectangle2X.getText())); } if (Double.parseDouble(tfRectangle2Y.getText()) != rectangle2.getY()) { rectangle2.setY(Double.parseDouble(tfRectangle2Y.getText())); } if (Double.parseDouble(tfRectangle2Width.getText()) != rectangle2.getWidth()) { rectangle2.setWidth(Double.parseDouble(tfRectangle2Width.getText())); } if (Double.parseDouble(tfRectangle2Height.getText()) != rectangle2.getHeight()) { rectangle2.setHeight(Double.parseDouble(tfRectangle2Height.getText())); } }
Set retangles to text field data
public static void addSaslMech(String mech){ if (!defaultMechs.contains(mech)) { defaultMechs.add(mech); } }
Add a SASL mechanism to the list to be used.
public void enable() throws IOException { synchronized (optOutLock) { if (isOptOut()) { config.getNode("mcstats.opt-out").setValue(false); configurationLoader.save(config); } if (task == null) { start(); } } }
Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
public void testGetFormat(){ byte[] key=new byte[]{1,2,3,4,5}; String algorithm="Algorithm"; SecretKeySpec ks=new SecretKeySpec(key,algorithm); assertTrue("The returned value is not \"RAW\".",ks.getFormat() == "RAW"); }
getFormat() method testing. Tests that returned value is "RAW".
public static void notEmpty(Object[] arr,String name){ notNull(arr,name); if (arr.length == 0) throw new IllegalArgumentException(INVALID_ARG_MSG_PREFIX + name + NOT_EMPTY_SUFFIX); }
Checks that given array is not empty.
public void invokeStatic(final Type owner,final Method method){ invokeInsn(Opcodes.INVOKESTATIC,owner,method,false); }
Generates the instruction to invoke a static method.
public CommentedLineReader(Reader in){ super(in); }
Constructs a buffered reader that ignores lines starting with the # character.
public IssueCollector(IssueFilter issueFilter){ this.issueFilter=Objects.requireNonNull(issueFilter); this.collectedIssues=new LinkedList<>(); }
Creates a new issue collector instance that accepts only those issues that match the given issue filter.
public static int[] copyOfRange(int[] original,int start,int end){ if (start <= end) { if (original.length >= start && 0 <= start) { int length=end - start; int copyLength=Math.min(length,original.length - start); int[] copy=new int[length]; System.arraycopy(original,start,copy,0,copyLength); return copy; } throw new ArrayIndexOutOfBoundsException(); } throw new IllegalArgumentException(); }
Copies elements in original array to a new array, from index start(inclusive) to end(exclusive). The first element (if any) in the new array is original[from], and other elements in the new array are in the original order. The padding value whose index is bigger than or equal to original.length - start is 0.
public void loadAndPopulateStaticAspects(NBTTagCompound nbt,long aspectSeed){ if (nbt != null && nbt.hasKey("entries")) { this.loadStaticAspects(nbt); this.updateAspects(aspectSeed); } else { this.generateStaticAspects(aspectSeed); } }
Loads all static aspects from an NBT and complements any missing data
private void upgradeLeaf(TableEntry10 table,TableUpgrade upgradeTable,Page10 page) throws IOException { try (ReadStream is=openRead(page.segment().address(),page.segment().length())){ is.position(page.address()); byte[] minKey=new byte[table.keyLength()]; byte[] maxKey=new byte[table.keyLength()]; is.read(minKey,0,minKey.length); is.read(maxKey,0,maxKey.length); int blocks=BitsUtil.readInt16(is); for (int i=0; i < blocks; i++) { upgradeLeafBlock(is,table,upgradeTable,page); } } }
Upgrade a table page.
private static double[] reparameterize(ArrayList<Point2D.Double> d,int first,int last,double[] u,Point2D.Double[] bezCurve){ int nPts=last - first + 1; int i; double[] uPrime; uPrime=new double[nPts]; for (i=first; i <= last; i++) { uPrime[i - first]=newtonRaphsonRootFind(bezCurve,d.get(i),u[i - first]); } return (uPrime); }
Given set of points and their parameterization, try to find a better parameterization.
@Override public void send(DatagramPacket p) throws IOException { socketDelegate.send(p); }
Sends a datagram packet from this socket. The <tt>DatagramPacket</tt> includes information indicating the data to be sent, its length, the IP address of the remote host, and the port number on the remote host.
public CryptoException(){ super(); }
Creates a new CryptoException.
@POST @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("/{id}/protection/snapshot-sessions/{sid}/restore") @CheckPermission(roles={Role.TENANT_ADMIN},acls={ACL.ANY}) public TaskResourceRep restoreConsistencyGroupSnapshotSession(@PathParam("id") final URI consistencyGroupId,@PathParam("sid") final URI snapSessionId){ final BlockConsistencyGroup consistencyGroup=(BlockConsistencyGroup)queryResource(consistencyGroupId); final BlockSnapshotSession snapSession=(BlockSnapshotSession)queryResource(snapSessionId); verifySnapshotSessionIsForConsistencyGroup(snapSession,consistencyGroup); return getSnapshotSessionManager().restoreSnapshotSession(snapSessionId); }
Restores the data on the array snapshot point-in-time copy represented by the BlockSnapshotSession instance with the passed id, to the snapshot session source object.
public void initializeLogging(){ LogWrapper logWrapper=new LogWrapper(); Log.setLogNode(logWrapper); MessageOnlyLogFilter msgFilter=new MessageOnlyLogFilter(); logWrapper.setNext(msgFilter); LogFragment logFragment=(LogFragment)getSupportFragmentManager().findFragmentById(R.id.log_fragment); msgFilter.setNext(logFragment.getLogView()); }
Set up targets to receive log data
public Vertex synthesize(Vertex source){ log("synthesize",Level.FINE); return synthesizeResponse(null,null,null,false,null,source.getNetwork()); }
Self API for synthesizing a new response.
public AEADBadTagException(){ super(); }
Constructs a AEADBadTagException with no detail message.
public EntryStream<K,V> filterKeyValue(BiPredicate<? super K,? super V> predicate){ return filter(null); }
Returns a stream consisting of the elements of this stream which elements match the given predicate. <p> This is an <a href="package-summary.html#StreamOps">intermediate</a> operation.
void draw(Graphics2D g,int x,int y){ sprite.draw(g,x + xOffset,y + yOffset); }
Draw the sprite at the EntityView's location.
public ConfigSetter(Class<?> configInterface,Method method){ super(configInterface,method); Method getMethod=ConfigUtil.getGetMethod(configInterface,method); Preconditions.checkNotNullArgument(getMethod,String.format("Cannot find getter for config \"%s\" property \"%s\"",configInterface.getSimpleName(),getPropertyName())); sourceType=ConfigUtil.getSourceType(configInterface,method); if (!String.class.equals(ConfigUtil.getMethodType(method))) stringifier=TypeStringify.getInstance(configInterface,method); }
Create a new ConfigSetter instance.
public ServiceStateException(String message,ApplicationExceptionBean bean){ super(message,bean); }
Constructs a new exception with the specified detail message and bean for JAX-WS exception serialization.
public CpcRunner(Graph graph,Parameters params,KnowledgeBoxModel knowledgeBoxModel){ super(graph,params,knowledgeBoxModel); }
Constucts a wrapper for the given EdgeListGraph.
static Instruction makeMoveInstruction(IR ir,Register r1,ConstantOperand c){ Operator mv=IRTools.getMoveOp(c.getType()); RegisterOperand o1=new RegisterOperand(r1,c.getType()); Operand o2=c.copy(); Instruction s=Move.create(mv,o1,o2); s.setSourcePosition(SSA_SYNTH_BCI,ir.getGc().getInlineSequence()); return s; }
Create a move instruction r1 := c.<p> !!TODO: put this functionality elsewhere.
public void test_munge03(){ assertEquals("test_context",GangliaMunge.munge("test context")); }
Note: The ganglia UI messes up when there is whitespace in a metric name.
public Uniform(RandomEngine randomGenerator){ this(0,1,randomGenerator); }
Constructs a uniform distribution with <tt>min=0.0</tt> and <tt>max=1.0</tt>.
public void testGeneratingJsonSchema() throws Exception { ObjectMapper mapper=new ObjectMapper(); JsonSchema jsonSchema=mapper.generateJsonSchema(SimpleBean.class); assertNotNull(jsonSchema); assertTrue(jsonSchema.equals(jsonSchema)); assertFalse(jsonSchema.equals(null)); assertFalse(jsonSchema.equals("foo")); assertNotNull(jsonSchema.toString()); assertNotNull(JsonSchema.getDefaultSchemaNode()); ObjectNode root=jsonSchema.getSchemaNode(); assertEquals("object",root.get("type").asText()); assertEquals(false,root.path("required").getBooleanValue()); JsonNode propertiesSchema=root.get("properties"); assertNotNull(propertiesSchema); JsonNode property1Schema=propertiesSchema.get("property1"); assertNotNull(property1Schema); assertEquals("integer",property1Schema.get("type").asText()); assertEquals(false,property1Schema.path("required").getBooleanValue()); JsonNode property2Schema=propertiesSchema.get("property2"); assertNotNull(property2Schema); assertEquals("string",property2Schema.get("type").asText()); assertEquals(false,property2Schema.path("required").getBooleanValue()); JsonNode property3Schema=propertiesSchema.get("property3"); assertNotNull(property3Schema); assertEquals("array",property3Schema.get("type").asText()); assertEquals(false,property3Schema.path("required").getBooleanValue()); assertEquals("string",property3Schema.get("items").get("type").asText()); JsonNode property4Schema=propertiesSchema.get("property4"); assertNotNull(property4Schema); assertEquals("array",property4Schema.get("type").asText()); assertEquals(false,property4Schema.path("required").getBooleanValue()); assertEquals("number",property4Schema.get("items").get("type").asText()); }
tests generating json-schema stuff.
private void init(DerValue encoding) throws Asn1Exception, KrbApErrException, IOException { if (((encoding.getTag() & (byte)(0x1F)) != Krb5.KRB_AP_REP) || (encoding.isApplication() != true) || (encoding.isConstructed() != true)) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } DerValue der=encoding.getData().getDerValue(); if (der.getTag() != DerValue.tag_Sequence) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } DerValue subDer=der.getData().getDerValue(); if ((subDer.getTag() & (byte)0x1F) != (byte)0x00) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } pvno=subDer.getData().getBigInteger().intValue(); if (pvno != Krb5.PVNO) { throw new KrbApErrException(Krb5.KRB_AP_ERR_BADVERSION); } subDer=der.getData().getDerValue(); if ((subDer.getTag() & (byte)0x1F) != (byte)0x01) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } msgType=subDer.getData().getBigInteger().intValue(); if (msgType != Krb5.KRB_AP_REP) { throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE); } encPart=EncryptedData.parse(der.getData(),(byte)0x02,false); if (der.getData().available() > 0) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } }
Initializes an APRep object.
static public void assertEquals(String message,boolean expected,boolean actual){ assertEquals(message,new Boolean(expected),new Boolean(actual)); }
Asserts that two booleans are equal. If they are not an AssertionFailedError is thrown with the given message.
public void testFilteredClassifier(){ try { Instances data=getFilteredClassifierData(); for (int i=0; i < data.numAttributes(); i++) { if (data.classIndex() == i) continue; if (data.attribute(i).isNominal()) { ((MakeIndicator)m_FilteredClassifier.getFilter()).setAttributeIndex("" + (i + 1)); break; } } } catch ( Exception e) { fail("Problem setting up test for FilteredClassifier: " + e.toString()); } super.testFilteredClassifier(); }
tests the filter in conjunction with the FilteredClassifier
public synchronized boolean hasSectionToday(){ try { final Query query=new Query().addSort(Keys.OBJECT_ID,SortDirection.DESCENDING).setCurrentPageNum(1).setPageSize(1); query.setFilter(new PropertyFilter(Article.ARTICLE_TYPE,FilterOperator.EQUAL,Article.ARTICLE_TYPE_C_JOURNAL_SECTION)); final JSONObject result=articleRepository.get(query); final List<JSONObject> journals=CollectionUtils.<JSONObject>jsonArrayToList(result.optJSONArray(Keys.RESULTS)); if (journals.isEmpty()) { return false; } final JSONObject maybeToday=journals.get(0); final long created=maybeToday.optLong(Article.ARTICLE_CREATE_TIME); return DateUtils.isSameDay(new Date(created),new Date()); } catch ( final RepositoryException e) { LOGGER.log(Level.ERROR,"Check section generated failed",e); return false; } }
Section generated today?
public List<NamedRelatedResourceRep> listByConsistencyGroup(URI consistencyGroupId){ return getList(getByConsistencyGroupUrl(),consistencyGroupId); }
Lists the block snapshots for a consistency group by ID. <p> API Call: <tt>GET /block/consistency-groups/{consistencyGroupId}/protection/snapshots</tt>
private void returnData(Object ret){ if (myHost != null) { myHost.returnData(ret); } }
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
protected void countProximityPosition(int i){ if (i < m_proximityPositions.length) m_proximityPositions[i]--; }
Count backwards one proximity position.
public final int read(byte b[],int off,int len){ if (len > buf.length - position) { len=buf.length - position; } for (int i=0; i < len; i++) { b[off + i]=buf[position++]; } return len; }
Reads up to <code>len</code> bytes of data from the contained input stream into an array of bytes. An attempt is made to read as many as <code>len</code> bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer. <p> This method blocks until input data is available, end of file is detected, or an exception is thrown. <p> If <code>len</code> is zero, then no bytes are read and <code>0</code> is returned; otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, the value <code>-1</code> is returned; otherwise, at least one byte is read and stored into <code>b</code>. <p> The first byte read is stored into element <code>b[off]</code>, the next one into <code>b[off+1]</code>, and so on. The number of bytes read is, at most, equal to <code>len</code>. Let <i>k</i> be the number of bytes actually read; these bytes will be stored in elements <code>b[off]</code> through <code>b[off+</code><i>k</i><code>-1]</code>, leaving elements <code>b[off+</code><i>k</i><code>]</code> through <code>b[off+len-1]</code> unaffected. <p> In every case, elements <code>b[0]</code> through <code>b[off]</code> and elements <code>b[off+len]</code> through <code>b[b.length-1]</code> are unaffected.
protected void startNode(Node node) throws org.xml.sax.SAXException { if (node instanceof Locator) { Locator loc=(Locator)node; fLocator.setColumnNumber(loc.getColumnNumber()); fLocator.setLineNumber(loc.getLineNumber()); fLocator.setPublicId(loc.getPublicId()); fLocator.setSystemId(loc.getSystemId()); } else { fLocator.setColumnNumber(0); fLocator.setLineNumber(0); } switch (node.getNodeType()) { case Node.DOCUMENT_TYPE_NODE: serializeDocType((DocumentType)node,true); break; case Node.COMMENT_NODE: serializeComment((Comment)node); break; case Node.DOCUMENT_FRAGMENT_NODE: break; case Node.DOCUMENT_NODE: break; case Node.ELEMENT_NODE: serializeElement((Element)node,true); break; case Node.PROCESSING_INSTRUCTION_NODE: serializePI((ProcessingInstruction)node); break; case Node.CDATA_SECTION_NODE: serializeCDATASection((CDATASection)node); break; case Node.TEXT_NODE: serializeText((Text)node); break; case Node.ENTITY_REFERENCE_NODE: serializeEntityReference((EntityReference)node,true); break; default : } }
Start processing given node
protected ExpandedItem(Parcel parcel){ ParcelInfo parcelInfo=Concierge.receiveParcel(parcel); int parcelableVersion=parcelInfo.getParcelVersion(); if (parcelableVersion >= Build.CM_VERSION_CODES.APRICOT) { if (parcel.readInt() != 0) { onClickPendingIntent=PendingIntent.CREATOR.createFromParcel(parcel); } if (parcel.readInt() != 0) { itemTitle=parcel.readString(); } if (parcel.readInt() != 0) { itemSummary=parcel.readString(); } itemDrawableResourceId=parcel.readInt(); } if (parcelableVersion >= Build.CM_VERSION_CODES.BOYSENBERRY) { if (parcel.readInt() != 0) { itemBitmapResource=Bitmap.CREATOR.createFromParcel(parcel); } } parcelInfo.complete(); }
Unflatten the ExpandedItem from a parcel.
public void addObserveRelation(ObserveRelation relation){ relations.add(relation); }
Adds the specified observe relation.
public StateContext<S,E> postTransition(StateContext<S,E> stateContext){ for ( StateMachineInterceptor<S,E> interceptor : interceptors) { if ((stateContext=interceptor.postTransition(stateContext)) == null) { break; } } return stateContext; }
Post transition.
public void clear(){ while (this.positions.size() > 0 || this.controlPoints.size() > 0) { this.removeControlPoint(); } this.shapeCenterPosition=null; this.shapeOrientation=null; this.shapeRectangle=null; }
Removes all positions from the shape, clear attributes.
protected String valueToString(ValueType value){ if (value == null) { return "null"; } return value.toString(); }
Subclasses may override this if they want to do something special to convert Value objects to Strings. By default, we just call toString() on the values.
Vset checkBlockStatement(Environment env,Context ctx,Vset vset,Hashtable exp){ return check(env,ctx,vset,exp); }
This is called in contexts where declarations are valid.
private void postPlugin(boolean isPing) throws IOException { PluginDescriptionFile description=plugin.getDescription(); String pluginName=description.getName(); boolean onlineMode=Bukkit.getServer().getOnlineMode(); String pluginVersion=description.getVersion(); String serverVersion=Bukkit.getVersion(); int playersOnline=this.getOnlinePlayers(); StringBuilder json=new StringBuilder(1024); json.append('{'); appendJSONPair(json,"guid",guid); appendJSONPair(json,"plugin_version",pluginVersion); appendJSONPair(json,"server_version",serverVersion); appendJSONPair(json,"players_online",Integer.toString(playersOnline)); String osname=System.getProperty("os.name"); String osarch=System.getProperty("os.arch"); String osversion=System.getProperty("os.version"); String java_version=System.getProperty("java.version"); int coreCount=Runtime.getRuntime().availableProcessors(); if (osarch.equals("amd64")) { osarch="x86_64"; } appendJSONPair(json,"osname",osname); appendJSONPair(json,"osarch",osarch); appendJSONPair(json,"osversion",osversion); appendJSONPair(json,"cores",Integer.toString(coreCount)); appendJSONPair(json,"auth_mode",onlineMode ? "1" : "0"); appendJSONPair(json,"java_version",java_version); if (isPing) { appendJSONPair(json,"ping","1"); } json.append('}'); URL url=new URL(BASE_URL + String.format(REPORT_URL,urlEncode(pluginName))); URLConnection connection; if (isMineshafterPresent()) { connection=url.openConnection(Proxy.NO_PROXY); } else { connection=url.openConnection(); } byte[] uncompressed=json.toString().getBytes(); byte[] compressed=gzip(json.toString()); connection.addRequestProperty("User-Agent","MCStats/" + REVISION); connection.addRequestProperty("Content-Type","application/json"); connection.addRequestProperty("Content-Encoding","gzip"); connection.addRequestProperty("Content-Length",Integer.toString(compressed.length)); connection.addRequestProperty("Accept","application/json"); connection.addRequestProperty("Connection","close"); connection.setDoOutput(true); if (debug) { System.out.println("[Metrics] Prepared request for " + pluginName + " uncompressed="+ uncompressed.length+ " compressed="+ compressed.length); } OutputStream os=connection.getOutputStream(); os.write(compressed); os.flush(); final BufferedReader reader=new BufferedReader(new InputStreamReader(connection.getInputStream())); String response=reader.readLine(); os.close(); reader.close(); if (response == null || response.startsWith("ERR") || response.startsWith("7")) { if (response == null) { response="null"; } else if (response.startsWith("7")) { response=response.substring(response.startsWith("7,") ? 2 : 1); } throw new IOException(response); } }
Generic method that posts a plugin to the metrics website
private void debugReflection(String msg){ if (debug) { checker.message(javax.tools.Diagnostic.Kind.NOTE,MSG_PREFEX_REFLECTION + msg); } }
Reports debug information about the reflection resolution iff the corresponding debug flag is set
public String serialize(){ return serialize(CUR_VERSION); }
Serialize the DLSN into base64 encoded string.
public void write(CDATA cdata) throws SAXException { String text=cdata.getText(); if (lexicalHandler != null) { lexicalHandler.startCDATA(); write(text); lexicalHandler.endCDATA(); } else { write(text); } }
Generates SAX events for the given CDATA
public Builder deleteMembers(){ deleteFields.add("members"); return this; }
deletes all group members of a existing group
public void removeModel(ModelRenderer model){ models.remove(model); modelBaseRot.remove(model); }
Removes the given model from the Bone. Always detach the model before adding it to another Bone. The best thing however is to just keep the model to one bone.
public void update(){ checkPermission(Permission.MANAGE_ROLES); checkPosition(); JSONObject frame=getFrame(); if (name != null) frame.put("name",name); if (color >= 0) frame.put("color",color); if (grouped != null) frame.put("hoist",grouped.booleanValue()); if (mentionable != null) frame.put("mentionable",mentionable.booleanValue()); update(frame); }
This method will apply all accumulated changes received by setters
Vector processSIMPLEPATTERNLIST(StylesheetHandler handler,String uri,String name,String rawName,String value,ElemTemplateElement owner) throws org.xml.sax.SAXException { try { StringTokenizer tokenizer=new StringTokenizer(value," \t\n\r\f"); int nPatterns=tokenizer.countTokens(); Vector patterns=new Vector(nPatterns); for (int i=0; i < nPatterns; i++) { XPath pattern=handler.createMatchPatternXPath(tokenizer.nextToken(),owner); patterns.addElement(pattern); } return patterns; } catch ( TransformerException te) { throw new org.xml.sax.SAXException(te); } }
Process an attribute string of type T_SIMPLEPATTERNLIST into a vector of XPath match patterns.
public Deck subdeck(int low,int high){ Deck sub=new Deck(high - low + 1); for (int i=0; i < sub.cards.length; i++) { sub.cards[i]=this.cards[low + i]; } return sub; }
Returns a subset of the cards in the deck.
public void readBinary(BinaryRawReader reader){ items=new TreeMap<>(); int count=reader.readInt(); for (int i=0; i < count; i++) items.put(reader.readString(),reader.readByteArray()); staticObjects=reader.readByteArray(); timeout=reader.readInt(); lockNodeId=reader.readUuid(); lockId=reader.readLong(); lockTime=reader.readTimestamp(); }
Reads from a binary reader.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:28.977 -0500",hash_original_method="C99C4952C168074F3FBA7AB2C1372665",hash_generated_method="F33ED7C3E1DB2DC82243B965350B6674") public boolean isMessagePartOfTransaction(SIPMessage messageToTest){ ViaList viaHeaders=messageToTest.getViaHeaders(); boolean transactionMatches; String messageBranch=((Via)viaHeaders.getFirst()).getBranch(); boolean rfc3261Compliant=getBranch() != null && messageBranch != null && getBranch().toLowerCase().startsWith(SIPConstants.BRANCH_MAGIC_COOKIE_LOWER_CASE) && messageBranch.toLowerCase().startsWith(SIPConstants.BRANCH_MAGIC_COOKIE_LOWER_CASE); transactionMatches=false; if (TransactionState.COMPLETED == this.getState()) { if (rfc3261Compliant) { transactionMatches=getBranch().equalsIgnoreCase(((Via)viaHeaders.getFirst()).getBranch()) && getMethod().equals(messageToTest.getCSeq().getMethod()); } else { transactionMatches=getBranch().equals(messageToTest.getTransactionId()); } } else if (!isTerminated()) { if (rfc3261Compliant) { if (viaHeaders != null) { if (getBranch().equalsIgnoreCase(((Via)viaHeaders.getFirst()).getBranch())) { transactionMatches=getOriginalRequest().getCSeq().getMethod().equals(messageToTest.getCSeq().getMethod()); } } } else { if (getBranch() != null) { transactionMatches=getBranch().equalsIgnoreCase(messageToTest.getTransactionId()); } else { transactionMatches=getOriginalRequest().getTransactionId().equalsIgnoreCase(messageToTest.getTransactionId()); } } } return transactionMatches; }
Deterines if the message is a part of this transaction.
public ParameterRef newParameterRef(Type paramType,int number){ return new ParameterRef(paramType,number); }
Constructs a ParameterRef(SootMethod, int) grammar chunk.
public void storeKnownDevices(){ StringBuffer listKnownDevices=new StringBuffer(); boolean first=true; for ( String id : knownDevices) { if (id.length() > 0) { if (!first) listKnownDevices=listKnownDevices.append(","); else first=false; listKnownDevices=listKnownDevices.append(id); } } SharedPreferences.Editor editor=settings.edit(); editor.putString("knownDevices",listKnownDevices.toString()); editor.commit(); }
method to store the current status of my known devices. this info will be used to restore status.
private static int decode4to3(final byte[] source,final int srcOffset,final byte[] destination,final int destOffset,final int options){ byte[] DECODABET=Base64.getDecodabet(options); if (source[srcOffset + 2] == Base64.EQUALS_SIGN) { int outBuff=(DECODABET[source[srcOffset]] & 0xFF) << 18 | (DECODABET[source[srcOffset + 1]] & 0xFF) << 12; destination[destOffset]=(byte)(outBuff >>> 16); return 1; } else if (source[srcOffset + 3] == Base64.EQUALS_SIGN) { int outBuff=(DECODABET[source[srcOffset]] & 0xFF) << 18 | (DECODABET[source[srcOffset + 1]] & 0xFF) << 12 | (DECODABET[source[srcOffset + 2]] & 0xFF) << 6; destination[destOffset]=(byte)(outBuff >>> 16); destination[destOffset + 1]=(byte)(outBuff >>> 8); return 2; } else { try { int outBuff=(DECODABET[source[srcOffset]] & 0xFF) << 18 | (DECODABET[source[srcOffset + 1]] & 0xFF) << 12 | (DECODABET[source[srcOffset + 2]] & 0xFF) << 6 | DECODABET[source[srcOffset + 3]] & 0xFF; destination[destOffset]=(byte)(outBuff >> 16); destination[destOffset + 1]=(byte)(outBuff >> 8); destination[destOffset + 2]=(byte)outBuff; return 3; } catch ( Exception e) { System.out.println("" + source[srcOffset] + ": "+ DECODABET[source[srcOffset]]); System.out.println("" + source[srcOffset + 1] + ": "+ DECODABET[source[srcOffset + 1]]); System.out.println("" + source[srcOffset + 2] + ": "+ DECODABET[source[srcOffset + 2]]); System.out.println("" + source[srcOffset + 3] + ": "+ DECODABET[source[srcOffset + 3]]); return -1; } } }
Decodes four bytes from array <var>source</var> and writes the resulting bytes (up to three of them) to <var>destination</var>. The source and destination arrays can be manipulated anywhere along their length by specifying <var>srcOffset</var> and <var>destOffset</var>. This method does not check to make sure your arrays are large enough to accommodate <var>srcOffset</var> + 4 for the <var>source</var> array or <var>destOffset</var> + 3 for the <var>destination</var> array. This method returns the actual number of bytes that were converted from the Base64 encoding. <p>This is the lowest level of the decoding methods with all possible parameters.</p>
private static String generateSPNativeGuidFromIndication(Hashtable<String,String> cimIndication,String poolNativeId_IndicationAttribute){ String serialNumber=null; String deviceType=null; String poolNativeId=null; String spInstanceId=null; try { spInstanceId=cimIndication.get(poolNativeId_IndicationAttribute); String[] individualIds=spInstanceId.split(Constants.PATH_DELIMITER_REGEX); try { serialNumber=individualIds[1]; poolNativeId=spInstanceId.substring(spInstanceId.indexOf(serialNumber) + serialNumber.length() + 1,spInstanceId.length()); } catch ( Exception e) { _logger.error("Format of SourceInstanceModelPathSPInstanceID is not correct {}",spInstanceId); return null; } String modelPathCompositeId=cimIndication.get(CIMConstants.SOURCE_INSTANCE_MODEL_PATH_COMPOSITE_ID); if (modelPathCompositeId != null && modelPathCompositeId.indexOf(CIMConstants.CLARIION_PREFIX) != -1) { deviceType=_deviceTypeMap.get(StorageSystem.Type.vnxblock.name()); } else if (modelPathCompositeId != null && modelPathCompositeId.indexOf(CIMConstants.SYMMETRIX_PREFIX) != -1) { deviceType=_deviceTypeMap.get(StorageSystem.Type.vmax.name()); } _logger.debug("Using serialNumber - {}, deviceType - {} poolNativeId - {} to compute NativeGuid ",new Object[]{serialNumber,deviceType,poolNativeId}); if (serialNumber == null || (serialNumber != null && serialNumber.length() <= 0) || deviceType == null || (deviceType != null && deviceType.length() <= 0) || poolNativeId == null || (poolNativeId != null && poolNativeId.length() <= 0)) { return null; } String nativeGuid=getNativeGuidforPool(deviceType,serialNumber,poolNativeId); _logger.debug("Required format of NativeGuid computed : {}",nativeGuid); return nativeGuid; } catch ( Exception e) { _logger.error("Unable to compute native guid using indication's SourceInstanceModelPathSPInstanceID {} - {}",spInstanceId,e.getMessage()); return null; } }
Generates the native guid for provider triggered indications of type VNX and VMAX StoragePool and VolumeView Indications Example Values for reference : SourceInstanceModelPathInstanceID : SYMMETRIX+000195900704+TP+GopiTest SourceInstanceModelPathCompositeID : SYMMETRIX+000195900704+TP+GopiTest
public boolean isNegative(){ return signum() == -1; }
Returns true if and only if this instance represents a monetary value less than zero, otherwise false.
@Override public void writeCData(String data) throws XMLStreamException { log.log(Level.FINE,"writeCData({0})",data); writeCharsInternal(data,false); }
Writes a CData section. In delegates to writeCharsInternal.
private boolean isAVL(Node x){ if (x == null) return true; int bf=balanceFactor(x); if (bf > 1 || bf < -1) return false; return isAVL(x.left) && isAVL(x.right); }
Checks if AVL property is consistent in the subtree.
private void showFeedback(String feedback){ if (myHost != null) { myHost.showFeedback(feedback); } else { System.out.println(feedback); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
private void closeDatabases(){ s_logger.log(Level.INFO,""); s_logger.log(Level.INFO,"migrateCloseDatabases"); m_source.close(); m_target.close(); m_source.reset(); m_source=null; m_target.reset(); m_target=null; m_direction=null; m_objectType=null; m_objectTypes=null; m_sourceMap=null; m_targetMap=null; m_objectList=new ArrayList<String>(); m_trackingList=new ArrayList<String>(); m_tempIndexes=null; m_counterPrg=null; m_counterDrp=null; m_counterUpd=null; m_counterAdd=null; m_totalPrg=null; m_totalDrp=null; m_totalUpd=null; m_totalAdd=null; m_detailType=null; m_detailTypes=null; m_detailCounterDrp=null; m_detailCounterUpd=null; m_detailCounterAdd=null; System.gc(); }
closes target and source databases
public boolean contains(CharSequence cs){ return map.containsKey(cs); }
true if the <code>CharSequence</code> is in the set
public JSONObject makeReferralInfoProps(final String utmSource,final String utmCampaign,final String utmMedium,final String utmContent,final String utmTerm){ JSONObject props; try { props=new JSONObject(); props.put("Referral Source",utmSource); props.put("Referral Campaign",utmCampaign); props.put("Referral Medium",utmMedium); props.put("Referral Campaign Content",utmContent); props.put("Referral Term",utmTerm); } catch ( JSONException e) { Logger.e(TAG,"Error building Mixpanel Props",e); props=null; } return props; }
Create a JsonObject props for the referral info
private void applyForegroundColor(Color color,Control control,List exclusions){ if (exclusions.contains(control)) return; control.setForeground(color); if (control instanceof Composite) { Control[] children=((Composite)control).getChildren(); for (int i=0; i < children.length; i++) { applyForegroundColor(color,children[i],exclusions); } } }
Set the specified foreground color for the specified control and all of its children, except for those specified in the list of exclusions.
public void tagFreeCharacter(int charId) throws IOException { startTag(TAG_FREECHARACTER,false); out.writeUI16(charId); completeTag(); }
SWFTagTypes interface
public boolean isPlayable(){ return mPlayable; }
Is a playable content
public AuthenticationFailedSynchronizer(final IDebugger debugger,final ListenerProvider<IDebugEventListener> listeners){ super(debugger,listeners); }
Creates a new Authentication Failed synchronizer.
public boolean put(Object object) throws CacheException, InterruptedException { boolean putDone=super.put(object); if (takeFirst) { this.take(); this.takeFirst=false; } synchronized (forWaiting) { forWaiting.notifyAll(); } return putDone; }
Does a put and a notifyAll() multiple threads can possibly be waiting on this queue to put