code
stringlengths
10
174k
nl
stringlengths
3
129k
@BeforeClass public static void createCelerraConnection(){ boolean wasException=false; try { ArrayList<CelerraMessageSpec> msgSpecs=new ArrayList<CelerraMessageSpec>(); _msgSpecList=new CelerraMessageSpecList(msgSpecs); _connection=new CelerraConnection(createConnectionInfo(),createListener(),new CimFilterMap(),_msgSpecList); } catch ( Exception e) { wasException=true; } Assert.assertFalse(wasException); }
Creates a Celerra connection.
private String normalizeRequestURI(String uri,String mapping){ if (mapping == null || !Util.isPrefixMapped(mapping)) { return uri; } else { int length=mapping.length() + 1; StringBuilder builder=new StringBuilder(length); builder.append(mapping).append('/'); String mappingMod=builder.toString(); boolean logged=false; while (uri.startsWith(mappingMod)) { if (!logged && LOGGER.isLoggable(Level.WARNING)) { logged=true; LOGGER.log(Level.WARNING,"jsf.viewhandler.requestpath.recursion",new Object[]{uri,mapping}); } uri=uri.substring(length - 1); } return uri; } }
<p>if the specified mapping is a prefix mapping, and the provided request URI (usually the value from <code>ExternalContext.getRequestServletPath()</code>) starts with <code>mapping + '/'</code>, prune the mapping from the URI and return it, otherwise, return the original URI.
@After public void cleanUp(){ if ((model != null) && (model.getId() != null)) { try { service.deleteCustomVoiceModel(model).execute(); } catch ( Exception e) { } } }
Clean up.
public TitlePaneCloseButtonPainter(Which state){ super(); this.state=state; this.ctx=new PaintContext(CacheMode.FIXED_SIZES); }
Creates a new TitlePaneCloseButtonPainter object.
public void callPredicateVisitors(XPathVisitor visitor){ m_expr.callVisitors(new filterExprOwner(),visitor); super.callPredicateVisitors(visitor); }
This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.
public void clear(){ lineTypes=null; lines=null; writeIndex=0; readIndex=0; }
Clears the console document.
public boolean isVerbose(){ return verbose; }
True iff verbose output should be printed.
@Override public Object clone() throws CloneNotSupportedException { XIntervalSeriesCollection clone=(XIntervalSeriesCollection)super.clone(); clone.data=(List)ObjectUtilities.deepClone(this.data); return clone; }
Returns a clone of this instance.
public static byte[] longToBytes(long data,int n){ byte buf[]=new byte[n]; for (int i=n - 1; i >= 0; i--) { buf[i]=(byte)data; data=data >> 8; } return buf; }
Convert 64 bit long to n bytes.
@AfterMethod(alwaysRun=true) public void afterTestMethod(final Object[] parameters,final Method method,final ITestContext testContex,final XmlTest xmlTest){ List<TearDownService> serviceList=SeleniumTestsContextManager.getThreadContext().getTearDownServices(); if (serviceList != null && !serviceList.isEmpty()) { for ( TearDownService service : serviceList) { service.tearDown(); } } WebUIDriver.cleanUp(); logger.info(Thread.currentThread() + " Finish method " + method.getName()); }
clean up.
public AttributeInUseException(){ super(); }
Constructs a new instance of AttributeInUseException. All fields are initialized to null.
public static final void copy(final Memory source,final long srcOffsetBytes,final Memory destination,final long dstOffsetBytes,final long lengthBytes){ assertBounds(srcOffsetBytes,lengthBytes,source.getCapacity()); assertBounds(dstOffsetBytes,lengthBytes,destination.getCapacity()); if (destination.isReadOnly()) { throw new ReadOnlyMemoryException(); } long srcAdd=source.getCumulativeOffset(srcOffsetBytes); long dstAdd=destination.getCumulativeOffset(dstOffsetBytes); Object srcParent=(source.isDirect()) ? null : source.getNativeMemory().memArray_; Object dstParent=(destination.isDirect()) ? null : destination.getNativeMemory().memArray_; long lenBytes=lengthBytes; while (lenBytes > 0) { long chunkBytes=(lenBytes > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : lenBytes; unsafe.copyMemory(srcParent,srcAdd,dstParent,dstAdd,lenBytes); lenBytes-=chunkBytes; srcAdd+=chunkBytes; dstAdd+=chunkBytes; } }
Copies bytes from a source Memory to the destination Memory. If the source and destination are the same Memory use the single Memory copy method. Nonetheless, if the source and destination Memories are derived from the same underlying base Memory, the source and the destination regions should not overlap within the base Memory region. This is difficult to check at run time, so be warned that this overlap could cause unpredictable results.
public Tokenizer(Reader reader){ this(reader,4096); }
Instantiates a new tokenizer.
public int next(){ int current; int node; int type; final int nodeType=_nodeType; int currentNodeID=makeNodeIdentity(_currentNode); if (nodeType >= DTM.NTYPES) { do { node=currentNodeID; current=node; do { current++; type=_type2(current); } while (type != NULL && (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)); currentNodeID=(type != NULL) ? current : NULL; } while (node != DTM.NULL && _exptype2(node) != nodeType); } else { do { node=currentNodeID; current=node; do { current++; type=_type2(current); } while (type != NULL && (ATTRIBUTE_NODE == type || NAMESPACE_NODE == type)); currentNodeID=(type != NULL) ? current : NULL; } while (node != DTM.NULL && (_exptype2(node) != nodeType && _type2(node) != nodeType)); } _currentNode=makeNodeHandle(currentNodeID); return (node == DTM.NULL ? DTM.NULL : returnNode(makeNodeHandle(node))); }
Get the next node in the iteration.
public static Member email(String email){ return new Member("mailto:" + email); }
Creates a member property whose value is an email address.
public int execute(DatabaseConnection databaseConnection,T data,ID newId,ObjectCache objectCache) throws SQLException { try { Object[] args=new Object[]{convertIdToFieldObject(newId),extractIdToFieldObject(data)}; int rowC=databaseConnection.update(statement,args,argFieldTypes); if (rowC > 0) { if (objectCache != null) { Object oldId=idField.extractJavaFieldValue(data); T obj=objectCache.updateId(clazz,oldId,newId); if (obj != null && obj != data) { idField.assignField(obj,newId,false,objectCache); } } idField.assignField(data,newId,false,objectCache); } logger.debug("updating-id with statement '{}' and {} args, changed {} rows",statement,args.length,rowC); if (args.length > 0) { logger.trace("updating-id arguments: {}",(Object)args); } return rowC; } catch ( SQLException e) { throw SqlExceptionUtil.create("Unable to run update-id stmt on object " + data + ": "+ statement,e); } }
Update the id field of the object in the database.
public static Object instantiate(Class implementedOrExtendedClass,String className) throws ClassInstantiationException { Class clazz; try { ClassLoader cl=Thread.currentThread().getContextClassLoader(); clazz=Class.forName(className,true,cl); } catch ( ClassNotFoundException ex) { throw new ClassInstantiationException("Unable to load class '" + className + "', class not found",ex); } return instantiate(implementedOrExtendedClass,clazz); }
Looks up the given class and checks that it implements or extends the required interface, and instantiates an object.
@Override public boolean batchFinished() throws Exception { if (getInputFormat() == null) { throw new IllegalStateException("No input instance format defined"); } if (outputFormatPeek() == null) { Instances toFilter=getInputFormat(); Instances[] toFilterIgnoringAttributes; if ((toFilter.classIndex() >= 0) && toFilter.classAttribute().isNominal()) { toFilterIgnoringAttributes=new Instances[toFilter.numClasses()]; for (int i=0; i < toFilter.numClasses(); i++) { toFilterIgnoringAttributes[i]=new Instances(toFilter,toFilter.numInstances()); } for (int i=0; i < toFilter.numInstances(); i++) { toFilterIgnoringAttributes[(int)toFilter.instance(i).classValue()].add(toFilter.instance(i)); } m_priors=new double[toFilter.numClasses()]; for (int i=0; i < toFilter.numClasses(); i++) { toFilterIgnoringAttributes[i].compactify(); m_priors[i]=toFilterIgnoringAttributes[i].sumOfWeights(); } Utils.normalize(m_priors); } else { toFilterIgnoringAttributes=new Instances[1]; toFilterIgnoringAttributes[0]=toFilter; m_priors=new double[1]; m_priors[0]=1; } for (int i=0; i < toFilterIgnoringAttributes.length; i++) { toFilterIgnoringAttributes[i]=removeIgnored(toFilterIgnoringAttributes[i]); } if ((toFilter.classIndex() <= 0) || !toFilter.classAttribute().isNominal()) { m_clusterers=AbstractDensityBasedClusterer.makeCopies(m_clusterer,1); m_clusterers[0].buildClusterer(toFilterIgnoringAttributes[0]); } else { m_clusterers=AbstractDensityBasedClusterer.makeCopies(m_clusterer,toFilter.numClasses()); for (int i=0; i < m_clusterers.length; i++) { if (toFilterIgnoringAttributes[i].numInstances() == 0) { m_clusterers[i]=null; } else { m_clusterers[i].buildClusterer(toFilterIgnoringAttributes[i]); } } } ArrayList<Attribute> attInfo=new ArrayList<Attribute>(); for (int j=0; j < m_clusterers.length; j++) { if (m_clusterers[j] != null) { for (int i=0; i < m_clusterers[j].numberOfClusters(); i++) { attInfo.add(new Attribute("pCluster_" + j + "_"+ i)); } } } if (toFilter.classIndex() >= 0) { attInfo.add((Attribute)toFilter.classAttribute().copy()); } attInfo.trimToSize(); Instances filtered=new Instances(toFilter.relationName() + "_clusterMembership",attInfo,0); if (toFilter.classIndex() >= 0) { filtered.setClassIndex(filtered.numAttributes() - 1); } setOutputFormat(filtered); for (int i=0; i < toFilter.numInstances(); i++) { convertInstance(toFilter.instance(i)); } } flushInput(); m_NewBatch=true; return (numPendingOutput() != 0); }
Signify that this batch of input to the filter is finished.
@JsonProperty("paging") void paging(String paging){ builder.paging(IndexPagingState.fromByteBuffer(ByteBufferUtils.byteBuffer(paging))); }
Sets the specified starting partition key.
public boolean isMeteringEnabled(){ return meteringEnabled; }
Default to false. If enabled, metering is performed to determine focus area.
@Override protected void doAction(){ showAbout(); }
Do action.
public static _Fields findBYNAME(String name){ return BY_NAME.get(name); }
Find the _Fields constant that matches name, or null if its not found.
public static void main(String[] args) throws Exception { if (args.length > 0) { if (args[0].toLowerCase().endsWith(".xml")) { System.out.println(new XMLSerialization().read(args[0]).toString()); } else { FileInputStream fi=new FileInputStream(args[0]); ObjectInputStream oi=new ObjectInputStream(new BufferedInputStream(fi)); Object o=oi.readObject(); oi.close(); new XMLSerialization().write(new BufferedOutputStream(new FileOutputStream(args[0] + ".xml")),o); FileOutputStream fo=new FileOutputStream(args[0] + ".exp"); ObjectOutputStream oo=new ObjectOutputStream(new BufferedOutputStream(fo)); oo.writeObject(o); oo.close(); } } }
for testing only. if the first argument is a filename with ".xml" as extension it tries to generate an instance from the XML description and does a <code>toString()</code> of the generated object.
public CommandProcessingException(String message,int errorType,Object errorData){ super(message); this.errorType=errorType; this.errorData=errorData; }
Constructs a new <code>CommandProcessingException</code>
public void testThreeOfFourNodeSubmitCommand() throws Throwable { testSubmitCommand(3,4); }
Tests submitting a command.
public static PropertyExistsExpression existsProperty(String propertyName){ return new PropertyExistsExpression(propertyName); }
Exists-function for use with dynamic properties to test property existence.
protected AbstractPooledConnAdapter(ClientConnectionManager manager,AbstractPoolEntry entry){ super(manager,entry.connection); this.poolEntry=entry; }
Creates a new connection adapter.
private void registerDefaultValidatorIds(Application application,LinkedHashSet<String> defaultValidatorIds){ if (defaultValidatorIds == null) { defaultValidatorIds=new LinkedHashSet<>(); if (isBeanValidatorAvailable()) { WebConfiguration webConfig=WebConfiguration.getInstance(); if (!webConfig.isOptionEnabled(WebConfiguration.BooleanWebContextInitParameter.DisableDefaultBeanValidator)) { defaultValidatorIds.add(BeanValidator.VALIDATOR_ID); } } } for ( String validatorId : defaultValidatorIds) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE,MessageFormat.format("Calling Application.addDefaultValidatorId({0})",validatorId)); } application.addDefaultValidatorId(validatorId); } }
If defaultValidatorIds is null, then no &lt;default-validators&gt; element appeared in any configuration file. In that case, add javax.faces.Bean if Bean Validation is available. If the &lt;default-validators&gt; appeared at least once, don't add the default (and empty &lt;default-validator&gt; element disabled default validators)
private void insertBigFrameStackOverflowCheck(Instruction plg){ if (!ir.method.isInterruptible()) { plg.remove(); return; } if (ir.compiledMethod.isSaveVolatile()) { return; } PhysicalRegisterSet phys=(PhysicalRegisterSet)ir.regpool.getPhysicalRegisterSet(); Register ESP=phys.getESP(); Register ECX=phys.getECX(); MemoryOperand M=MemoryOperand.BD(ir.regpool.makeTROp(),Entrypoints.stackLimitField.getOffset(),(byte)WORDSIZE,null,null); plg.insertBefore(MIR_Move.create(IA32_MOV,new RegisterOperand((ECX),PRIMITIVE_TYPE_FOR_WORD),M)); int frameSize=getFrameFixedSize(); plg.insertBefore(MIR_BinaryAcc.create(IA32_ADD,new RegisterOperand(ECX,PRIMITIVE_TYPE_FOR_WORD),VM.BuildFor32Addr ? IC(frameSize) : LC(frameSize))); MIR_TrapIf.mutate(plg,IA32_TRAPIF,null,new RegisterOperand(ESP,PRIMITIVE_TYPE_FOR_WORD),new RegisterOperand(ECX,PRIMITIVE_TYPE_FOR_WORD),IA32ConditionOperand.LE(),TrapCodeOperand.StackOverflow()); }
Insert an explicit stack overflow check in the prologue <em>before</em> buying the stack frame. SIDE EFFECT: mutates the plg into a trap instruction. We need to mutate so that the trap instruction is in the GC map data structures.
public boolean isEmpty(){ if (lastBatch != null) { if (!lastBatch.isEmpty()) { return false; } } return currentBatch.isEmpty(); }
Returns true if the window is empty, or false if not empty.
public void removeListener(ILabelProviderListener listener){ }
Not used. Must be implemented due to IBaseLabelProvider.
static int kindFromString(String kindStr){ if (kindStr.equalsIgnoreCase("prj")) return IClasspathEntry.CPE_PROJECT; if (kindStr.equalsIgnoreCase("var")) return IClasspathEntry.CPE_VARIABLE; if (kindStr.equalsIgnoreCase("con")) return IClasspathEntry.CPE_CONTAINER; if (kindStr.equalsIgnoreCase("src")) return IClasspathEntry.CPE_SOURCE; if (kindStr.equalsIgnoreCase("lib")) return IClasspathEntry.CPE_LIBRARY; if (kindStr.equalsIgnoreCase("output")) return ClasspathEntry.K_OUTPUT; return -1; }
Returns the kind of a <code>PackageFragmentRoot</code> from its <code>String</code> form.
public static void main(String[] args){ try { if (args.length < 2) { System.out.println("Arguments not valid : {model, folder}."); } else { URI modelURI=URI.createFileURI(args[0]); File folder=new File(args[1]); List<String> arguments=new ArrayList<String>(); GenerateJavaRoutes generator=new GenerateJavaRoutes(modelURI,folder,arguments); for (int i=2; i < args.length; i++) { generator.addPropertiesFile(args[i]); } generator.doGenerate(new BasicMonitor()); } } catch ( IOException e) { e.printStackTrace(); } }
This can be used to launch the generation from a standalone application.
public void postCompileStep(Compiler compiler){ m_isTopLevel=compiler.getLocationPathDepth() == -1; }
Figure out if we're executing a toplevel expression. If so, we can't be inside of a predicate.
public static FetchResponse createFetchResponse(FetchRequest req,Map userData) throws MessageException { FetchResponse resp=new FetchResponse(); Map attributes=req.getAttributes(); for (Iterator i=attributes.keySet().iterator(); i.hasNext(); ) { String alias=(String)i.next(); Object value=userData.get(alias); if (value == null) { continue; } if (value instanceof String) { resp.addAttribute(alias,(String)attributes.get(alias),(String)value); } else if (value instanceof List) { Iterator values=((List)value).iterator(); int max=req.getCount(alias); if (max == 0) max=((List)values).size(); int count; for (count=0; count < max && values.hasNext(); count++) { String val=(String)values.next(); if (val == null) { count--; continue; } resp.addAttribute(alias,(String)attributes.get(alias),val); } } } return resp; }
Creates a FetchResponse from a FetchRequest message and the data released by the user.
private Instances makeHeader(){ ArrayList<Attribute> fv=new ArrayList<Attribute>(); fv.add(new Attribute("Margin")); fv.add(new Attribute("Current")); fv.add(new Attribute("Cumulative")); return new Instances("MarginCurve",fv,100); }
Creates an Instances object with the attributes we will be calculating.
public boolean equals(Object obj){ if (obj instanceof ObjID) { ObjID id=(ObjID)obj; return objNum == id.objNum && space.equals(id.space); } else { return false; } }
Compares the specified object with this <code>ObjID</code> for equality. This method returns <code>true</code> if and only if the specified object is an <code>ObjID</code> instance with the same object number and address space identifier as this one.
public ToolBarEastState(){ super("East"); }
Creates a new ToolBarEastState object.
public static void illegalCodeContent(Exception e,String methodName,String className,String content){ throw new IllegalCodeException(MSG.INSTANCE.message(nullPointerContent,methodName,className,content,e.getClass().getSimpleName(),"" + e.getMessage())); }
Thrown when the explicit conversion method defined has a null pointer.<br> Used in the generated code, in case of dynamic methods defined.
public void testGetExtensions() throws Exception { Extension ext=(Extension)parserFactory.getExtensions("text/html").get(0); assertEquals("parse-tika",ext.getDescriptor().getPluginId()); ext=(Extension)parserFactory.getExtensions("text/html; charset=ISO-8859-1").get(0); assertEquals("parse-tika",ext.getDescriptor().getPluginId()); ext=(Extension)parserFactory.getExtensions("foo/bar").get(0); assertEquals("parse-tika",ext.getDescriptor().getPluginId()); }
Unit test for <code>getExtensions(String)</code> method.
public boolean removeJobGroupToNeverDelete(String group){ return group != null && jobGroupsToNeverDelete.remove(group); }
Remove the given group to the list of job groups that will never be deleted by this processor, even if a pre-processing-command to delete the group is encountered.
public boolean contains(final Object key){ return this.parameters.containsKey(key); }
Checks for existence of key in parameter set.
public float curveTangent(float a,float b,float c,float d,float t){ curveInitCheck(); float tt3=t * t * 3; float t2=t * 2; PMatrix3D cb=curveBasisMatrix; return (a * (tt3 * cb.m00 + t2 * cb.m10 + cb.m20) + b * (tt3 * cb.m01 + t2 * cb.m11 + cb.m21) + c * (tt3 * cb.m02 + t2 * cb.m12 + cb.m22) + d * (tt3 * cb.m03 + t2 * cb.m13 + cb.m23)); }
Calculate the tangent at a t value (0..1) on a Catmull-Rom curve. Code thanks to Dave Bollinger (Bug #715)
public boolean isApproved(){ Object oo=get_Value(COLUMNNAME_IsApproved); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Approved.
public SusiTransfer(String mappingExpression){ this.selectionMapping=parse(mappingExpression); }
Create a new transfer. The mapping must be given in the same way as SQL column selection statements. The selection of sub-objects of json object can be done using dot-notion. Arrays can be accessed using brackets '[' and ']'. An example is: mapping = "location.lon AS longitude, location.lat AS latitude" or mapping = "names[0] AS firstname" As a reference, the mappingExpression shall be superset of a list of https://mariadb.com/kb/en/mariadb/select/#select-expressions
public Task<FileShareRestRep> removeExport(URI id,String protocol,String securityType,String permissions,String rootUserMapping){ return removeExport(id,protocol,securityType,permissions,rootUserMapping,null); }
Removes an export from the given file system by ID. <p> API Call: <tt>DELETE /file/filesystems/{id}/exports/{protocol},{securityType},{permissions},{rootUserMapping}</tt>
public boolean testRightmostBit(){ return (mPol[mLength - 1] & mBitmask[mBit - 1]) != 0L; }
Returns whether the highest bit of the bit representation is set
public static PubSubClient startClient(String serverHostName,int serverPort,int maxPendingMessages,boolean isDaemon) throws IOException { PubSubClient client=new PubSubClient(serverHostName,serverPort,maxPendingMessages); client.setDaemon(isDaemon); client.start(); return client; }
Create a pub sub client and connect it to the specified server
public Address plus(int v){ return new Address(value.plus(v)); }
Add an integer to this <code>Address</code>, and return the sum.
public CDebuggerToolbar(final CDebugPerspectiveModel debugger){ m_debugger=debugger; setFloatable(false); final IGraphModel model=debugger.getGraphModel(); final CGraphWindow parent=model.getParent(); final ZyGraph graph=model.getGraph(); m_startAction=new CAttachAction(parent,debugger); m_detachAction=new CDetachAction(parent,debugger); m_terminateAction=new CTerminateAction(parent,debugger); m_stepIntoAction=new CStepIntoAction(parent,debugger); m_stepOverAction=new CStepOverAction(parent,debugger,graph); m_stepBlockAction=new CStepBlockAction(parent,debugger,graph); m_stepEndAction=new CStepEndAction(parent,debugger,graph); m_resumeAction=new CResumeAction(parent,debugger); m_haltAction=new CHaltAction(parent,debugger); m_startTraceAction=new CStartTraceAction(parent,debugger,graph); m_stopTraceAction=new CStopTraceAction(parent,debugger); createAndAddIconToToolbar(m_startAction,"data/startdebugger_up.jpg","data/startdebugger_hover.jpg","data/startdebugger_down.jpg"); m_detachButton=createAndAddIconToToolbar(m_detachAction,"data/detachdebugger_up.jpg","data/detachdebugger_hover.jpg","data/detachdebugger_down.jpg"); m_terminateButton=createAndAddIconToToolbar(m_terminateAction,"data/terminatedebugger_up.jpg","data/terminatedebugger_hover.jpg","data/terminatedebugger_down.jpg"); final JButton stepButton=createAndAddIconToToolbar(m_stepIntoAction,"data/stepnext_up.jpg","data/stepnext_hover.jpg","data/stepnext_down.jpg"); addHotkey(stepButton,HotKeys.DEBUGGER_SINGLE_STEP_KEY.getKeyStroke(),m_stepIntoAction,HotKeys.DEBUGGER_SINGLE_STEP_KEY.getDescription()); final JButton stepOverButton=createAndAddIconToToolbar(m_stepOverAction,"data/stepover_up.jpg","data/stepover_hover.jpg","data/stepover_down.jpg"); addHotkey(stepOverButton,HotKeys.DEBUGGER_STEP_OVER_KEY.getKeyStroke(),m_stepOverAction,HotKeys.DEBUGGER_STEP_OVER_KEY.getDescription()); final JButton stepBlockButton=createAndAddIconToToolbar(m_stepBlockAction,"data/stepnextnode_up.jpg","data/stepnextnode_hover.jpg","data/stepnextnode_down.jpg"); addHotkey(stepBlockButton,HotKeys.DEBUGGER_STEP_BLOCK_KEY.getKeyStroke(),m_stepBlockAction,HotKeys.DEBUGGER_STEP_BLOCK_KEY.getDescription()); createAndAddIconToToolbar(m_stepEndAction,"data/step_to_end_up.png","data/step_to_end_hover.png","data/step_to_end_down.png"); final JButton resumeButton=createAndAddIconToToolbar(m_resumeAction,"data/resumedebugger_up.jpg","data/resumedebugger_hover.jpg","data/resumedebugger_down.jpg"); addHotkey(resumeButton,HotKeys.DEBUGGER_RESUME_KEY.getKeyStroke(),m_resumeAction,HotKeys.DEBUGGER_RESUME_KEY.getDescription()); m_haltButton=createAndAddIconToToolbar(m_haltAction,"data/suspenddebugger_up.jpg","data/suspenddebugger_hover.jpg","data/suspenddebugger_down.jpg"); createAndAddIconToToolbar(m_startTraceAction,"data/record_up.jpg","data/record_hover.jpg","data/record_down.jpg"); createAndAddIconToToolbar(m_stopTraceAction,"data/recordstop_up.jpg","data/recordstop_hover.jpg","data/recordstop_down.jpg"); }
Creates a new debugger toolbar object that can be used by the user to interact with the debugger.
private final boolean checkMissSpace(){ if (this.readMissCache == null) return false; if (this.missLimit > 0 && this.readMissCache.size() >= this.missLimit) return false; long available=MemoryControl.available(); if (MemoryControl.shortStatus() || available - 2 * 1024 * 1024 < this.readMissCache.memoryNeededForGrow()) { this.readMissCache.clear(); } available=MemoryControl.available(); return (available - 2 * 1024 * 1024 > this.readMissCache.memoryNeededForGrow()); }
checks for space in the miss cache
public static void dump(HttpServletRequest request){ log.config("Request " + request.getProtocol() + " "+ request.getMethod()); if (!CLogMgt.isLevelFiner()) return; log.finer("- Server=" + request.getServerName() + ", Port="+ request.getServerPort()); log.finer("- ContextPath=" + request.getContextPath() + ", ServletPath="+ request.getServletPath()+ ", Query="+ request.getQueryString()); log.finer("- From " + request.getRemoteHost() + "/"+ request.getRemoteAddr()+ " - User="+ request.getRemoteUser()); log.finer("- URI=" + request.getRequestURI() + ", URL="+ request.getRequestURL()); log.finer("- AuthType=" + request.getAuthType()); log.finer("- Secure=" + request.isSecure()); log.finer("- PathInfo=" + request.getPathInfo() + " - "+ request.getPathTranslated()); log.finer("- UserPrincipal=" + request.getUserPrincipal()); boolean first=true; Enumeration e=request.getHeaderNames(); while (e.hasMoreElements()) { if (first) log.finer("- Header:"); first=false; String key=(String)e.nextElement(); Object value=request.getHeader(key); log.finer(" - " + key + " = "+ value); } first=true; try { String enc=request.getCharacterEncoding(); if (enc == null) request.setCharacterEncoding(MobileEnv.ENCODING); } catch ( Exception ee) { log.log(Level.SEVERE,"Set CharacterEncoding=" + MobileEnv.ENCODING,ee); } e=request.getParameterNames(); while (e.hasMoreElements()) { if (first) log.finer("- Parameter:"); first=false; String key=(String)e.nextElement(); String value=MobileUtil.getParameter(request,key); log.finer(" - " + key + " = "+ value); } first=true; e=request.getAttributeNames(); while (e.hasMoreElements()) { if (first) log.finer("- Attributes:"); first=false; String key=(String)e.nextElement(); Object value=request.getAttribute(key); log.finer(" - " + key + " = "+ value); } Cookie[] ccc=request.getCookies(); if (ccc != null) { for (int i=0; i < ccc.length; i++) { if (i == 0) log.finer("- Cookies:"); log.finer(" - " + ccc[i].getName() + ", Domain="+ ccc[i].getDomain()+ ", Path="+ ccc[i].getPath()+ ", MaxAge="+ ccc[i].getMaxAge()); } } log.finer("- Encoding=" + request.getCharacterEncoding()); log.finer("- Locale=" + request.getLocale()); first=true; e=request.getLocales(); while (e.hasMoreElements()) { if (first) log.finer("- Locales:"); first=false; log.finer(" - " + e.nextElement()); } log.finer("- Class=" + request.getClass().getName()); }
Dump Request
public boolean isDescendentOf(Node node1,Node node2){ return node1 == node2 || GraphUtils.existsDirectedPathFromToBreathFirst(node2,node1,this); }
Determines whether one node is a descendent of another.
private void fciOrientbk(IKnowledge bk,Graph graph,List<Node> variables){ logger.log("info","Starting BK Orientation."); for (Iterator<KnowledgeEdge> it=bk.forbiddenEdgesIterator(); it.hasNext(); ) { KnowledgeEdge edge=it.next(); Node from=SearchGraphUtils.translate(edge.getFrom(),variables); Node to=SearchGraphUtils.translate(edge.getTo(),variables); if (from == null || to == null) { continue; } if (graph.getEdge(from,to) == null) { continue; } graph.setEndpoint(to,from,Endpoint.ARROW); graph.setEndpoint(from,to,Endpoint.CIRCLE); changeFlag=true; logger.log("knowledgeOrientation",SearchLogUtils.edgeOrientedMsg("Knowledge",graph.getEdge(from,to))); } for (Iterator<KnowledgeEdge> it=bk.requiredEdgesIterator(); it.hasNext(); ) { KnowledgeEdge edge=it.next(); Node from=SearchGraphUtils.translate(edge.getFrom(),variables); Node to=SearchGraphUtils.translate(edge.getTo(),variables); if (from == null || to == null) { continue; } if (graph.getEdge(from,to) == null) { continue; } graph.setEndpoint(to,from,Endpoint.TAIL); graph.setEndpoint(from,to,Endpoint.ARROW); changeFlag=true; logger.log("knowledgeOrientation",SearchLogUtils.edgeOrientedMsg("Knowledge",graph.getEdge(from,to))); } logger.log("info","Finishing BK Orientation."); }
Orients according to background knowledge
public final double magSquared(){ double sq=0.0; for (int i=0; i < length; i++) { sq+=values[i] * values[i]; } return sq; }
Returns the sum of the squares of this vector (its length squared in n-dimensional space).
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.listenerList=new EventListenerList(); stream.registerValidation(this,10); }
Restores a serialized object.
public void reset(){ close(); allocateNewBlock(); index=0; current=blocks.get(index); }
Resets the write buffer to empty.
public void testMessageRelayAbort(){ Message m1=new Message(h1,h2,msgId1,BUFFER_SIZE); h1.createNewMessage(m1); checkCreates(1); h1.connect(h2); updateAllNodes(); assertTrue(mc.next()); assertEquals(mc.TYPE_START,mc.getLastType()); assertFalse(mc.next()); clock.advance(1); updateAllNodes(); assertFalse(mc.next()); h2.setLocation(farAway); updateAllNodes(); assertTrue(mc.next()); assertEquals(mc.TYPE_ABORT,mc.getLastType()); assertEquals(h1,mc.getLastFrom()); assertFalse(mc.next()); }
Tests aborting transfer when connections is disconnected during the transfer
@FlashException public static void removeNetworks(String virtualArrayId,@As(",") String[] ids){ if ((ids == null) || (ids.length == 0)) { networks(virtualArrayId); } VirtualArrayRestRep virtualArray=getVirtualArray(virtualArrayId); updateNetworks(uris(ids),removeVirtualArray(virtualArray)); networks(virtualArrayId); }
Removes a number of networks from the given virtual array, and redisplays the networks page.
public void addHeaderView(View v){ addHeaderView(v,null,true); }
Add a fixed view to appear at the top of the grid. If addHeaderView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want. <p/> NOTE: Call this before calling setAdapter. This is so HeaderGridView can wrap the supplied cursor with one that will also account for header views.
public TermsLookupQueryBuilder lookupType(String lookupType){ this.lookupType=lookupType; return this; }
Sets the index type to lookup the terms from.
static double svd_fsign(double a,double b){ if ((a >= 0.0 && b >= 0.0) || (a < 0.0 && b < 0.0)) return a; else return -a; }
returns |a| if b is positive; else fsign returns -|a|
private void sortAddItem(ValueNamePair vn){ sortBy1.addItem(vn); sortBy2.addItem(vn); sortBy3.addItem(vn); sortBy4.addItem(vn); }
Add to Sort
public static void mergeSort(byte[] a,int fromIndex,int toIndex){ rangeCheck(a.length,fromIndex,toIndex); byte aux[]=(byte[])a.clone(); mergeSort1(aux,a,fromIndex,toIndex); }
Sorts the specified range of the specified array of elements. <p>This sort is guaranteed to be <i>stable</i>: equal elements will not be reordered as a result of the sort.<p> The sorting algorithm is a modified mergesort (in which the merge is omitted if the highest element in the low sublist is less than the lowest element in the high sublist). This algorithm offers guaranteed n*log(n) performance, and can approach linear performance on nearly sorted lists.
public Pair(F first,S second){ this.first=first; this.second=second; }
Creates a new <tt>Pair</tt>
public static CStandardProgressDialog show(final Window parent,final String description,final CStandardHelperThread thread){ final CStandardProgressDialog dlg=new CStandardProgressDialog(parent,Constants.DEFAULT_WINDOW_TITLE,description,thread); CIconInitializer.initializeWindowIcons(dlg); thread.start(); dlg.setSize(400,150); dlg.setVisible(true); return dlg; }
Shows a new standard dialog.
public IteratingGSS(OperatorDescription description){ super(description); }
Must pass the given object to the superclass.
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:40.812 -0500",hash_original_method="5E2706ACF0BEEE9ADCFD58329E615807",hash_generated_method="28E9B033F43A6657D4E841C5908095A9") final void chompNewline() throws IOException { if ((pos != end || fillBuf() != -1) && buf[pos] == '\n') { pos++; } }
Peeks at the next input character, refilling the buffer if necessary. If this character is a newline character ("\n"), it is discarded.
public void addLast(Object obj){ if (this.last == null) addBefore(root,obj); else addAfter(this.last,obj); }
Adds a new object to the end of the list.
public WFPopupItem(String title,MWFNode node,int AD_WF_NodeTo_ID){ super(title); m_node=node; m_AD_WF_NodeTo_ID=AD_WF_NodeTo_ID; }
Add Line Item
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-06 12:50:58.288 -0400",hash_original_method="41AED877D51F56AB121F4235E96580E7",hash_generated_method="FAE5E8273CFAE7048C4C302C5D04574C") public boolean isCompleted(){ return getInfo().getState() == PrintJobInfo.STATE_COMPLETED; }
Gets whether this print job is completed. Such a print job is successfully printed. You can neither cancel nor restart such a print job.
public ProgressMonitor(Component parentComponent,Object message,String note,int min,int max){ this(parentComponent,message,note,min,max,null); }
Constructs a graphic object that shows progress, typically by filling in a rectangular bar as the process nears completion.
public double orientedDistance(Coordinate p){ Vector3D pb=new Vector3D(p,basePt); double pbdDotNormal=pb.dot(normal); if (Double.isNaN(pbdDotNormal)) throw new IllegalArgumentException("3D Coordinate has NaN ordinate"); double d=pbdDotNormal / normal.length(); return d; }
Computes the oriented distance from a point to the plane. The distance is: <ul> <li><b>positive</b> if the point lies above the plane (relative to the plane normal) <li><b>zero</b> if the point is on the plane <li><b>negative</b> if the point lies below the plane (relative to the plane normal) </ul>
protected void tagHandlerSetterMethods() throws Exception { writer.writeLineComment("Setter Methods"); PropertyBean[] properties=component.getProperties(); for (int i=0, len=properties.length; i < len; i++) { PropertyBean property=properties[i]; if (property == null) { continue; } if (!property.isTagAttribute()) { continue; } String propertyName=property.getPropertyName(); String propertyType=property.getPropertyClass(); if ("binding".equals(propertyName) || "id".equals(propertyName) || "rendered".equals(propertyName)) { continue; } if (property.isValueExpressionEnabled() || property.isMethodExpressionEnabled()) { writer.writeWriteOnlyProperty(propertyName,"java.lang.String"); } else { writer.writeWriteOnlyProperty(propertyName,propertyType); } } AttributeBean[] attributes=renderer.getAttributes(); for (int i=0, len=attributes.length; i < len; i++) { AttributeBean attribute=attributes[i]; if (attribute == null) { continue; } if (!attribute.isTagAttribute()) { continue; } String attributeName=attribute.getAttributeName(); writer.writeWriteOnlyProperty(attributeName,"java.lang.String"); } writer.write("\n"); }
Generate Tag Handler setter methods from component properties and renderer attributes.
public GregorianCalendar toGregorianCalendar(){ DateTimeZone zone=getZone(); GregorianCalendar cal=new GregorianCalendar(zone.toTimeZone()); cal.setTime(toDate()); return cal; }
Get the date time as a <code>java.util.GregorianCalendar</code>, assigning exactly the same millisecond instant. <p> The JDK and Joda-Time both have time zone implementations and these differ in accuracy. Joda-Time's implementation is generally more up to date and thus more accurate - for example JDK1.3 has no historical data. The effect of this is that the field values of the <code>Calendar</code> may differ from those of this object, even though the milliseond value is the same. Most of the time this just means that the JDK field values are wrong, as our time zone information is more up to date.
protected void listSetTopIndex(int index){ }
Sets the index of the item to be at the top of the viewable area. <p> Default implementation does nothing. </p>
protected NullTypeImpl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void addInterface(CtClass anInterface){ checkModify(); }
Adds an interface.
protected Set performAdjunctMessaging(EntryEventImpl event,Set cacheOpRecipients,Set adjunctRecipients,FilterRoutingInfo filterRoutingInfo,DirectReplyProcessor processor,boolean calculateDelta,boolean sendDeltaWithFullValue){ Set failures=Collections.EMPTY_SET; PartitionMessage msg=event.getPartitionMessage(); if (calculateDelta) { setDeltaIfNeeded(event); } if (msg != null) { msg=msg.getMessageForRelayToListeners(event,adjunctRecipients); msg.setSender(this.partitionedRegion.getDistributionManager().getDistributionManagerId()); msg.setSendDeltaWithFullValue(sendDeltaWithFullValue); failures=msg.relayToListeners(cacheOpRecipients,adjunctRecipients,filterRoutingInfo,event,this.partitionedRegion,processor); } else { Operation op=event.getOperation(); if (op.isCreate() || op.isUpdate()) { failures=PutMessage.notifyListeners(cacheOpRecipients,adjunctRecipients,filterRoutingInfo,this.partitionedRegion,event,op.isCreate(),!op.isCreate(),processor,sendDeltaWithFullValue); } else if (op.isDestroy()) { failures=DestroyMessage.notifyListeners(cacheOpRecipients,adjunctRecipients,filterRoutingInfo,this.partitionedRegion,event,processor); } else if (op.isInvalidate()) { failures=InvalidateMessage.notifyListeners(cacheOpRecipients,adjunctRecipients,filterRoutingInfo,this.partitionedRegion,event,processor); } else { failures=adjunctRecipients; } } return failures; }
perform adjunct messaging for the given operation and return a set of members that should be attached to the operation's reply processor (if any)
private void showResultNow(final ResultObject result,final String id){ ResultTab tab=(ResultTab)RapidMinerGUI.getMainFrame().getDockingDesktop().getContext().getDockableByKey(ResultTab.DOCKKEY_PREFIX + id); if (tab == null) { tab=new ResultTab(ResultTab.DOCKKEY_PREFIX + id); } showTab(tab); tab.showResult(result); }
Creates a display on the current thread and displays it (on the EDT).
private String generateStorageHADomainKey(StorageSystem storageSystem,String directorName){ return String.format("%s-%s",storageSystem.getNativeGuid(),directorName); }
Return a unique key used for caching
public boolean isBigEndian(){ return bigEndian; }
Indicates whether the audio data is stored in big-endian or little-endian byte order. If the sample size is not more than one byte, the return value is irrelevant.
public void removeLogFile(LogFile logFile){ logFileMap.remove(logFile.getFile()); }
Removes a logfile from the list.
public ViewAttributes clone(){ ViewAttributes result=new ViewAttributes(); result.SpecifiedAttributes=SpecifiedAttributes; result.DisplayName=DisplayName; result.Description=Description; result.WriteMask=WriteMask; result.UserWriteMask=UserWriteMask; result.ContainsNoLoops=ContainsNoLoops; result.EventNotifier=EventNotifier; return result; }
Deep clone
public final AC growPrio(int p,int... indexes){ for (int i=indexes.length - 1; i >= 0; i--) { int ix=indexes[i]; makeSize(ix); cList.get(ix).setGrowPriority(p); } return this; }
Specifies the indicated rows'/columns' grow priority. <p> For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.
public SeaGlassTitlePane(JRootPane rootPane,SeaGlassRootPaneUI ui){ this.rootPane=rootPane; this.rootPaneUI=ui; rootParent=(RootPaneContainer)rootPane.getParent(); installTitlePane(); }
Creates a new SeaGlassTitlePane object.
public DiskStoreID(){ }
for deserialization
public static void assertNotNull(Object object,String message){ checkAssertion(!(object == null),message); }
Asserts that the given object is not null, with given message
public PlacesDetailsResponse details(final String placeId) throws IOException { Uri.Builder uriBuilder=Uri.parse(PLACES_API_BASE).buildUpon().appendPath(PATH_DETAILS).appendPath(PATH_JSON).appendQueryParameter(PARAMETER_KEY,googleApiKey).appendQueryParameter(PARAMETER_PLACE_ID,placeId); if (languageCode != null) { uriBuilder.appendQueryParameter(PARAMETER_LANGUAGE,languageCode); } return httpClient.executeDetailsRequest(uriBuilder.build()); }
Fetches the PlaceDetails for the given place_id. This is a synchronous call, you must provide your own Async if you need it
public <T extends Match>T addMatch(T match) throws IllegalArgumentException { if (match == null) { throw new IllegalArgumentException("'Match' must not be null"); } if (match.getProtein() != null) { match.getProtein().removeMatch(match); } match.setProtein(this); matches.add(match); return match; }
Adds and returns filtered match to sequence
protected void appendShortLength(int value){ append(value); }
Append a short length into mMessage. This implementation doesn't check the validity of parameter, since it assumes that the values are validated in the GenericPdu setter methods.
protected PropertyNameValuePairImpl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Override public void close() throws JMSException { if (ActiveMQRASession.trace) { ActiveMQRALogger.LOGGER.trace("close()"); } sf.closeSession(this); closeSession(); }
Closes the session. Sends a ConnectionEvent.CONNECTION_CLOSED to the managed connection.
private Cache createCache(Properties props) throws Exception { DistributedSystem ds=getSystem(props); ds.disconnect(); ds=getSystem(props); Cache cache=null; cache=CacheFactory.create(ds); if (cache == null) { throw new Exception("CacheFactory.create() returned null "); } return cache; }
Create the cache
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
public JSONArray(){ this.myArrayList=new ArrayList(); }
Construct an empty JSONArray.
private void initializeData(Locale locale){ SoftReference<DateFormatSymbols> ref=cachedInstances.get(locale); DateFormatSymbols dfs; if (ref == null || (dfs=ref.get()) == null) { if (ref != null) { cachedInstances.remove(locale,ref); } dfs=new DateFormatSymbols(false); LocaleProviderAdapter adapter=LocaleProviderAdapter.getAdapter(DateFormatSymbolsProvider.class,locale); if (!(adapter instanceof ResourceBundleBasedAdapter)) { adapter=LocaleProviderAdapter.getResourceBundleBased(); } ResourceBundle resource=((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(locale); dfs.locale=locale; if (resource.containsKey("Eras")) { dfs.eras=resource.getStringArray("Eras"); } else if (resource.containsKey("long.Eras")) { dfs.eras=resource.getStringArray("long.Eras"); } else if (resource.containsKey("short.Eras")) { dfs.eras=resource.getStringArray("short.Eras"); } dfs.months=resource.getStringArray("MonthNames"); dfs.shortMonths=resource.getStringArray("MonthAbbreviations"); dfs.ampms=resource.getStringArray("AmPmMarkers"); dfs.localPatternChars=resource.getString("DateTimePatternChars"); dfs.weekdays=toOneBasedArray(resource.getStringArray("DayNames")); dfs.shortWeekdays=toOneBasedArray(resource.getStringArray("DayAbbreviations")); ref=new SoftReference<>(dfs); SoftReference<DateFormatSymbols> x=cachedInstances.putIfAbsent(locale,ref); if (x != null) { DateFormatSymbols y=x.get(); if (y == null) { cachedInstances.replace(locale,x,ref); } else { ref=x; dfs=y; } } Locale bundleLocale=resource.getLocale(); if (!bundleLocale.equals(locale)) { SoftReference<DateFormatSymbols> z=cachedInstances.putIfAbsent(bundleLocale,ref); if (z != null && z.get() == null) { cachedInstances.replace(bundleLocale,z,ref); } } } copyMembers(dfs,this); }
Initializes this DateFormatSymbols with the locale data. This method uses a cached DateFormatSymbols instance for the given locale if available. If there's no cached one, this method creates an uninitialized instance and populates its fields from the resource bundle for the locale, and caches the instance. Note: zoneStrings isn't initialized in this method.
public void startNested(String boundary) throws IOException { startPart(MimeUtils.mpMixedContentType(boundary)); parts.add(boundary); }
Begins a nested section with the specified boundary.
private void addAccount(){ (new AddAccountAlertDialog(this)).show(); }
Add an existing account
private void shutdown(){ if (execSvc != null) execSvc.shutdown(5000); if (msgExecSvc != null) msgExecSvc.shutdownNow(); try { job.dispose(true); } catch ( IgniteCheckedException e) { U.error(log,"Failed to dispose job.",e); } }
Stops all executors and running tasks.