code
stringlengths
10
174k
nl
stringlengths
3
129k
public static TypeReference newTypeReference(int sort){ return new TypeReference(sort << 24); }
Returns a type reference of the given sort.
@DSComment("System settings, info collection") @DSSpec(DSCat.SYSTEM) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:51.969 -0500",hash_original_method="0140B0C084561EBE6D9CB9F916362E53",hash_generated_method="2E5FD5211A5DBC3FA7DD1C6845765FB6") public static boolean putString(Con...
Store a name/value pair into the database.
public void subscribeToResellerServiceNoDiscount() throws Exception { VendorData supplierData=setupNewSupplier("2013-01-01 08:00:00"); setDateFactory("2013-01-02 20:00:00"); VOServiceDetails supplService=createPublishActivateService(supplierData,TestPriceModel.EXAMPLE_RATA_WEEK_ROLES,"supplSrvForReseller"); upd...
Subscribe to reseller service. Customer has no discount.
public NotificationChain basicSetIfFalse(Expression newIfFalse,NotificationChain msgs){ Expression oldIfFalse=ifFalse; ifFalse=newIfFalse; if (eNotificationRequired()) { ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,GamlPackage.IF__IF_FALSE,oldIfFalse,newIfFalse); if (msgs == ...
<!-- begin-user-doc --> <!-- end-user-doc -->
public static void ERROR(Throwable e) throws JMapperException { logger.error("{}: {}",e.getClass().getSimpleName(),e.getMessage()); throw new JMapperException(e); }
This method handles error log.
private Object readResolve(){ return ToStringStyle.DEFAULT_STYLE; }
<p>Ensure <code>Singleton</code> after serialization.</p>
public static long toLongValue(Object o,long defaultValue){ if (o instanceof Character) return (((Character)o).charValue()); else if (o instanceof Boolean) return ((((Boolean)o).booleanValue()) ? 1L : 0L); else if (o instanceof Number) return (((Number)o).longValue()); else if (o instanceof String) r...
cast a Object to a long value (primitive value type)
static int crossBound(double bound[],int bc,double py1,double py2){ if (bc == 0) { return 0; } int up=0; int down=0; for (int i=2; i < bc; i+=4) { if (bound[i] < py1) { up++; continue; } if (bound[i] > py2) { down++; continue; } return CROSSING; } if (down =...
Returns are bounds intersect or not intersect rectangle
public void testGetWebModuleContextRootUndefined() throws Exception { String xml="<application>" + " <module>" + " <java>javaclient.jar</java>"+ " </module>"+ "</application>"; ApplicationXml applicationXml=ApplicationXmlIo.parseApplicationXml(new ByteArrayInputStream(xml.getBytes("UTF-8")),null); try { ...
Verifies that the method <code>getWebModuleContextRoot()</code> throws an <code>IllegalARgumentException</code> when the specified web module is not defined.
@Override public void configure(Binder binder){ binder.bind(IResourceSetInitializer.class).to(BuiltInSchemeResourceSetInitializer.class); binder.bind(BuiltInSchemeRegistrar.class); binder.bind(ClassLoader.class).toInstance(ContributingModule.class.getClassLoader()); }
Every binding must explicitly mentioned here.
public static double[] trimZeroTail(final double[] data){ return Arrays.copyOfRange(data,0,countNonZeroBeginning(data)); }
Trims zeros at the end of an array.
public void testOverwriteFlag() throws Exception { File file=new File(XMLSchedulingDataProcessor.QUARTZ_XML_DEFAULT_FILE_NAME); copyResourceToFile("/org/quartz/xml/simple-job-trigger.xml",file); Scheduler scheduler=null; try { StdSchedulerFactory factory=new StdSchedulerFactory("org/quartz/xml/quartz-test.p...
QTZ-185 <p>The default XMLSchedulingDataProcessor will setOverWriteExistingData(true), and we want to test programmatically overriding this value. <p>Note that XMLSchedulingDataProcessor#processFileAndScheduleJobs(Scheduler,boolean) will only read default "quartz_data.xml" in current working directory. So to test this,...
public MethodBinding[] availableMethods(){ return methods(); }
Return the array of resolvable methods (resilience)
public ComplexTypeComplexContent(AttributeUse attributeUses,Particle particle,boolean mixed){ super(attributeUses); this.particle=particle; this.mixed=mixed; }
particle may be null
public WeightVector(WeightVector wv){ float in[]=wv.getInternalArray(); u=new float[in.length]; System.arraycopy(in,0,u,0,in.length); size=in.length; }
Duplicate a weight vector
private boolean isVowel(char ch){ return VOWELS.indexOf(ch) != -1; }
Determines whether or not a character is a vowel or not
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
private void updateProgress(String progressLabel,int progress){ if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) { myHost.updateProgress(progressLabel,progress); } previousProgress=progress; previousProgressLabel=progressLabel; }
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
public static Context fromUserKtab(String user,String ktab,boolean storeKey) throws Exception { return fromUserKtab(new Subject(),user,ktab,storeKey); }
Logins with username/keytab as an existing Subject. The same subject can be used multiple times to simulate multiple logins.
public SelectShiftClicked(Collection<DefaultNode> paintedNodes,GraphPanel component,Color color){ this.paintedNodes=paintedNodes; this.component=component; this.color=color; }
Constructs a new instance of SelectShiftClicked
public ItemHit currencyCode(String value){ setString(CURRENCY_CODE,value); return this; }
<div class="ind"> <p> Optional. </p> <p>When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.</p> <table border="1"> <tbody> <tr> <th>Parameter</th> <th>Value Type</th> <th>Default Value</th> <th>Max Length</th> <th>Supported Hit Types</th> </tr> ...
public void removeBreakpoints(final BreakpointType type,final Set<BreakpointAddress> breakpoints){ Preconditions.checkNotNull(type,"IE00178: Type argument can not be null"); Preconditions.checkNotNull(breakpoints,"IE00179: breakpoints argument can not be null"); if (breakpoints.size() == 0) { return; } swit...
Remove a set of breakpoints given as breakpoint addresses.
private void output(){ for ( String channel : countPerChannel.keySet()) { int count=countPerChannel.get(channel); if (count > 0) { g.ignoredMessagesCount(channel,"Ignored " + count + " message"+ (count == 1 ? "" : "s")+ " in the last "+ DELAY+ "s"); } } countPerChannel.clear(); }
Output ignored messages for all channels that have ignored messages and reset count.
public Boolean isMLDPWallet(){ return mldpWallet; }
Gets the value of the mldpWallet property.
@Override public void addVehicle(final Vehicle v){ if (this.getVehicles().containsKey(v.getId())) { throw new IllegalArgumentException("Vehicle with id = " + v.getId() + " already exists."); } if (!this.vehicleTypes.containsKey(v.getType().getId())) { throw new IllegalArgumentException("Cannot add Vehicle...
Add the vehicle to the container.
private void writeQName(javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI=qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix=xmlWriter.getPrefix(namespaceURI); if (prefix == null) {...
method to handle Qnames
@Override public int hashCode(){ int result=193; result=37 * result + ObjectUtilities.hashCode(this.fillPaint); return result; }
Returns a hash code for this instance.
public Define(String functionName,Class<?> returnType,String name1,Class<?> type1,String name2,Class<?> type2){ this(functionName,returnType,new String[]{name1,name2},new Class<?>[]{type1,type2}); }
Constructs a new node for defining a function that takes two arguments.
public void updateCommandState(){ for ( CommandHandlerBase c : mCommandHandlersSet) { c.updateAndReturnStatus(); } }
Update and refresh the activation status of the command
public ComputeTaskCancelledException(String msg){ super(msg); }
Creates new task cancellation exception with given error message.
@Override public Drawable mutate(){ if (!mMutated && super.mutate() == this) { mState=new ColorState(mState); mMutated=true; } return this; }
A mutable BitmapDrawable still shares its Bitmap with any other Drawable that comes from the same resource.
private boolean journalRebuildRequired(){ final int REDUNDANT_OP_COMPACT_THRESHOLD=2000; return redundantOpCount >= REDUNDANT_OP_COMPACT_THRESHOLD && redundantOpCount >= lruEntries.size(); }
We only rebuild the journal when it will halve the size of the journal and eliminate at least 2000 ops.
public FilteredImageSource(ImageProducer orig,ImageFilter imgf){ src=orig; filter=imgf; }
Constructs an ImageProducer object from an existing ImageProducer and a filter object.
protected void redraw(){ while (!updateQueue.isEmpty()) { Visualization vis=updateQueue.pop(); vis.incrementalRedraw(); } }
Redraw all pending updates.
static synchronized JmriConfigurationProvider findProvider(Profile project){ if (providers.get(project) == null) { providers.put(project,new JmriConfigurationProvider(project)); } return providers.get(project); }
Get the JmriPrefererncesProvider for the specified profile.
@DSSink({DSSinkKind.IO}) @DSComment("IO movement methodName") @DSSpec(DSCat.IO) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:51.556 -0500",hash_original_method="7E641CDBDB4194A4ABD6D1C9C473BCDE",hash_generated_method="926C6B4F4B203D16211A7DFF9C2165F3") public void print(int in...
Prints the string representation of the specified integer to the target.
public Vector(int initialCapacity,int capacityIncrement){ super(); if (initialCapacity < 0) throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity); this.elementData=new Object[initialCapacity]; this.capacityIncrement=capacityIncrement; }
Constructs an empty vector with the specified initial capacity and capacity increment.
public EditFilterDialog(Frame owner,String frameTitle,JList filterList,boolean isAdd){ super(owner,frameTitle,true); try { setIconImage(TDA.createImageIcon("Filters.png").getImage()); } catch ( NoSuchMethodError nsme) { } this.isAdd=isAdd; this.filterList=filterList; frame=owner; getContentPane()....
Creates a new instance of PreferencesDialog
public String toString(){ StringBuilder sb=new StringBuilder(); DoubleNode<IMove> node=moves.first(); boolean endsWithComma=false; while (node != null) { sb.append(node.value() + ","); node=node.next(); endsWithComma=true; } if (endsWithComma) { sb.deleteCharAt(sb.length() - 1); } return...
Return solution as a string.
public LayoutResult layoutMenuItem(){ LayoutResult lr=createLayoutResult(); prepareForLayout(lr); if (isColumnLayout()) { if (isLeftToRight()) { doLTRColumnLayout(lr,getLTRColumnAlignment()); } else { doRTLColumnLayout(lr,getRTLColumnAlignment()); } } else { if (isLeftToRight()) { ...
Layout icon, text, check icon, accelerator text and arrow icon in the viewRect and return their positions. If horizontalAlignment, verticalTextPosition and horizontalTextPosition are default (user doesn't set any manually) the layouting algorithm is: Elements are layouted in the five columns: check icon + icon + text +...
@Override protected int computeVerticalScrollRange(){ int count=getChildCount(); return count == 0 ? getHeight() : (getChildAt(0)).getBottom(); }
<p>The scroll range of a scroll view is the overall height of all of its children.</p>
private PropertyInfoExt loadVdcConfig() throws Exception { PropertyInfoExt targetVdcPropInfo=new PropertyInfoExt(vdcConfigUtil.genVdcProperties()); targetVdcPropInfo.addProperty(Constants.IPSEC_STATUS,ipsecConfig.getIpsecStatus()); targetVdcPropInfo.addProperty(Constants.IPSEC_KEY,ipsecConfig.getPreSharedKey()); ...
Load the vdc configurations
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:44.100 -0500",hash_original_method="44AA99B3E06F91C4A28CA95A02F486A4",hash_generated_method="1FF68244F39CE237A2FA2C3738169987") public ActivityMonitor(IntentFilter which,ActivityResult result,boolean block){ mWhich=which; mClass...
Create a new ActivityMonitor that looks for a particular kind of intent to be started.
public static LostAlarmE parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { LostAlarmE object=new LostAlarmE(); int event; java.lang.String nillableValue=null; java.lang.String prefix=""; java.lang.String namespaceuri=""; try { while (!reader.isStartElement() && !reader.isEndEle...
static method to create the object Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable If this object is not an element, it is a complex type and the reader is at the event just after the outer start element Postcondition: If t...
public Extent loadExtent(){ return new Extent(loadArchitecturalWord()); }
Loads an extent value from the memory location pointed to by the current instance.
public static final String nestStackTrace(String stackTrace,Throwable t){ String newStackTrace=null; if (t instanceof NestingException) { NestingException ex=(NestingException)t; newStackTrace=stackTrace + ex.getStackTrace(); } else { newStackTrace=stackTrace + captureStackTrace(t); } return newS...
Method nestStackTrace.
public CharSequence format(String fileName,CharSequence code){ File file=new File(fileName); FileHandle fileHandle=new FileHandleImpl(new Outlet(),file); fileHandle.setBuffer(code); csharpBeautifier.beforeWriteAndClose(fileHandle); return fileHandle.getBuffer(); }
Format code with PostProcessor (XPand style).
public JToggleButton createJToolbarToggleButton(String name) throws MissingResourceException, ResourceFormatException, MissingListenerException { JToggleButton result; try { result=new JToolbarToggleButton(getString(name + TEXT_SUFFIX)); } catch ( MissingResourceException e) { result=new JToolbarToggleB...
Creates and returns a new swing button initialised to be used as a toolbar toggle button
protected boolean isLink(Element e){ return (e.getAttributes().getAttribute(HTML.Tag.A) != null); }
Returns true if the Element contains a HTML.Tag.A attribute, false otherwise.
public PathHierarchyTokenizerFactory(Map<String,String> args){ super(args); delimiter=getChar(args,"delimiter",PathHierarchyTokenizer.DEFAULT_DELIMITER); replacement=getChar(args,"replace",delimiter); reverse=getBoolean(args,"reverse",false); skip=getInt(args,"skip",PathHierarchyTokenizer.DEFAULT_SKIP); if ...
Creates a new PathHierarchyTokenizerFactory
private long acquireWrite(boolean interruptible,long deadline){ WNode node=null, p; for (int spins=-1; ; ) { long m, s, ns; if ((m=(s=state) & ABITS) == 0L) { if (U.compareAndSwapLong(this,STATE,s,ns=s + WBIT)) return ns; } else if (spins < 0) spins=(m == WBIT && wtail == whead) ? S...
See above for explanation.
private void createPolygon(Graphics2D x_graphics,Rectangle2D x_dataArea,XYPlot x_plot,ValueAxis x_domainAxis,ValueAxis x_rangeAxis,boolean x_positive,LinkedList x_xValues,LinkedList x_yValues){ PlotOrientation l_orientation=x_plot.getOrientation(); RectangleEdge l_domainAxisLocation=x_plot.getDomainAxisEdge(); Re...
Draws the visual representation of a polygon
private String dumpRawRecord(final long addr){ if (journal.getBufferStrategy() instanceof IRWStrategy) { final IStore store=((IRWStrategy)journal.getBufferStrategy()).getStore(); try { final InputStream is=store.getInputStream(addr); try { } finally { try { is.close(); ...
Utility method dumps the data associated with an address on the backing store. A variety of methods are attempted.
public int documentID(int position){ return results.get(position).getIndexNumber(); }
Returns the id of the document within the respective Lucene IndexReader
public boolean isDisabled(){ return (java.lang.Boolean)getStateHelper().eval(PropertyKeys.disabled,false); }
<p>Return the value of the <code>disabled</code> property.</p> <p>Contents: Flag indicating that this element must never receive focus or be included in a subsequent submit. A value of false causes no attribute to be rendered, while a value of true causes the attribute to be rendered as disabled="disabled".
public boolean atEnd(){ return (currentLocation.compareTo(endLocation) >= 0); }
Is cursor at the end location?
@Override public void mouseClicked(MouseEvent e){ }
Invoked when the mouse has been clicked on a component.
public String globalInfo(){ return "Loads local files from disk."; }
Description to be displayed in the GUI.
public static Vector3f interpolateLinear(float scale,Vector3f startValue,Vector3f endValue){ return interpolateLinear(scale,startValue,endValue,null); }
Linear interpolation from startValue to endValue by the given percent. Basically: ((1 - percent) * startValue) + (percent * endValue)
public static Collection<ClusterNode> affinityNodes(final GridCacheContext ctx){ return ctx.discovery().cacheAffinityNodes(ctx.namex(),AffinityTopologyVersion.NONE); }
Gets all nodes on which cache with the same name is started and the local DHT storage is enabled.
public void currentLog(Long endingOffset) throws ApiException { Object postBody=null; byte[] postBinaryBody=null; String path="/v1/system/logs".replaceAll("\\{format\\}","json"); List<Pair> queryParams=new ArrayList<Pair>(); Map<String,String> headerParams=new HashMap<String,String>(); Map<String,Object> fo...
Return latest log file contents
public JsonArrayRequest(int method,String url,JSONObject jsonRequest,Listener<JSONArray> listener,ErrorListener errorListener){ super(method,url,(jsonRequest == null) ? null : jsonRequest.toString(),listener,errorListener); }
Creates a new request.
public static boolean parseBoolean(CharSequence csq){ Cursor cursor=new Cursor(); boolean result=parseBoolean(csq,cursor); if (!cursor.atEnd(csq)) throw new IllegalArgumentException("Extraneous characters \"" + cursor.tail(csq) + "\""); return result; }
Parses the whole specified character sequence as a <code>boolean</code>.
protected void writeNamespaces() throws IOException { if (namespacesMap != null) { for ( Map.Entry<String,String> entry : namespacesMap.entrySet()) { String prefix=entry.getKey(); String uri=entry.getValue(); writeNamespace(prefix,uri); } namespacesMap=null; } }
Writes the SAX namepsaces
public static byte[] decode(char[] in,int iOff,int iLen){ if (iLen % 4 != 0) throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4."); while (iLen > 0 && in[iOff + iLen - 1] == '=') iLen--; int oLen=(iLen * 3) / 4; byte[] out=new byte[oLen]; int ip=iOff; int iE...
Decodes a byte array from Base64 format. No blanks or line breaks are allowed within the Base64 encoded input data.
public RoundedToolbar(final Composite parent,final int style){ super(parent,style | SWT.DOUBLE_BUFFERED); items=new ArrayList<RoundedToolItem>(); cornerRadius=2; addListeners(); }
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, us...
public Whirlpool0(){ super(T0,T1,T2,T3,T4,T5,T6,T7,RC); }
Create the object.
private Object checkValueEL(Object value){ if (dimension > 1) { if (value instanceof Array) { if (((Array)value).getDimension() != dimension - 1) return null; } else return null; } return value; }
!!! all methods that use this method must be sync check if value is valid to insert to array (to a multidimesnional array only array with one smaller dimension can be inserted), if value is invalid return null;
@NotNull public List<HgRevisionNumber> parents(@NotNull VirtualFile repo){ return getRevisions(repo,"parents",null,null,true); }
Current repository revision(s).
public Numbers(int i){ id=i; id1=-1 * id; id2=1000 - id; avg1=(id + id1 + id2) / 3; max1=id; range=(id - id1); l=id * 100000000; }
Creates a new instance of Numbers
public static void registerAllEditors(){ Properties props; Enumeration enm; String name; String value; registerEditors(); if (m_MekaEditorsRegistered) return; System.err.println("---Registering MEKA Editors---"); m_MekaEditorsRegistered=true; try { props=PropsUtils.read(MEKA_GUIEDITORS_PROPERTY_...
registers all the editors in WEKA and MEKA.
public ConfigExceptionLocation(String msg){ super(msg); }
Creates an exception with a message
public static Map<String,Object> packBulk(DispatchContext dctx,Map<String,? extends Object> context){ PackingSession session=(PackingSession)context.get("packingSession"); String orderId=(String)context.get("orderId"); String shipGroupSeqId=(String)context.get("shipGroupSeqId"); Boolean updateQuantity=(Boolean)...
<p>Create or update package lines.</p> <p>Context parameters: <ul> <li>selInfo - selected rows</li> <li>iteInfo - orderItemIds</li> <li>prdInfo - productIds</li> <li>pkgInfo - package numbers</li> <li>wgtInfo - weights to pack</li> <li>numPackagesInfo - number of packages to pack per line (>= 1, default: 1)<br/> Packs ...
public Vector4i add(Vector4i v,Vector4i dest){ dest.x=x + v.x; dest.y=y + v.y; dest.z=z + v.z; dest.w=w + v.w; return dest; }
Add the supplied vector to this one and store the result in <code>dest</code>.
private void parseFollowingResponse(String json){ try { JSONObject root=(JSONObject)parser.parse(json); int updatedClients=((Number)root.get("updated_clients")).intValue(); listener.wsUserInfo("Updated following buttons for " + updatedClients + " users."); } catch ( Exception ex) { LOGGER.warning(...
Parses the response to the "/ffz following" command.
public static String fullVersion(){ return version("full"); }
The current full version number as a string.
public void addTransitPath(Map<LegMode,StreetRouter> accessRouter,Map<LegMode,StreetRouter> egressRouter,TIntObjectMap<LegMode> stopModeAccessMap,TIntObjectMap<LegMode> stopModeEgressMap,PathWithTimes currentTransitPath,TransportNetwork transportNetwork,ZonedDateTime fromTimeDateZD){ HashPath hashPath=new HashPath(cu...
It creates option, transit/street segment itinerary and segments It creates options, transitSegment, segmentPatterns as needed. Transit paths with same stops but different patterns are in same transitSegment but different segmentPatterns. Paths with same pattern but different times are in same segmentPattern but differ...
public void addThreadPool(String tag,int size){ if (size <= 0) { throw new RuntimeException("pool size at least one"); } RequestQueue requestQueue=VolleyManager.newRequestQueue(mContext,size); VinciImageLoader imageLoader=new VinciImageLoader(mContext,requestQueue); queues.put(tag,requestQueue); loaders...
add other thread pool
public void addEventListeners(MBeanServer server,Map<String,Map<String,Object>> descriptor){ for ( Map.Entry<String,Map<String,Object>> item : descriptor.entrySet()) { Map<String,Object> listener=item.getValue(); ObjectName broadcaster=(ObjectName)listener.get("from"); try { String eventType=(Strin...
Sets up event listeners for this MBean as described in the descriptor. The descriptor contains a map with layout {item -> Map[event:"...", from:ObjectName, callback:&amp;Closure],...,}
protected Object extractAndConvertValue(ConsumerRecord<?,?> record,Type type){ return record.value() == null ? KafkaNull.INSTANCE : record.value(); }
Subclasses can convert the value; by default, it's returned as provided by Kafka.
public static void toggleBreakpoint(final BackEndDebuggerProvider debuggerProvider,final INaviFunctionNode functionNode){ Preconditions.checkNotNull(debuggerProvider,"IE01721: Debugger provider argument can not be null"); Preconditions.checkNotNull(functionNode,"IE01722: Function node argument can not be null"); ...
Sets or removes a breakpoint from a function node.
public MultipartStream(InputStream input,byte[] boundary,int bufSize){ if (boundary == null) { throw new IllegalArgumentException("boundary may not be null"); } this.boundaryLength=boundary.length + BOUNDARY_PREFIX.length; if (bufSize < this.boundaryLength + 1) { throw new IllegalArgumentException("The ...
<p> Constructs a <code>MultipartStream</code> with a custom size buffer. <p> Note that the buffer must be at least big enough to contain the boundary string, plus 4 characters for CR/LF and double dash, plus at least one byte of data. Too small a buffer size setting will degrade performance.
public void forceCleanupBuffer(){ Arrays.fill(buffer.array(),(byte)0x00); }
Force buffer cleanup.
private static void exit(@Nullable String errMsg,boolean showUsage,int exitCode){ if (errMsg != null) X.error(errMsg); String runner=System.getProperty(IGNITE_PROG_NAME,"ignite.{sh|bat}"); int space=runner.indexOf(' '); runner=runner.substring(0,space == -1 ? runner.length() : space); if (showUsage) { b...
Exists with optional error message, usage show and exit code.
public static Options defaultOptions(){ return new Options(HELP,VERSION,PROPERTY,PROPERTIES_URL,SERVER_CONFIG,STAGE_CONFIG,ACTIVE_STAGE,BIND); }
Default set of options
public String errorString(String err,Object arg0,Object arg1,Object arg2){ if (err.startsWith("rmic.") || err.startsWith("warn.rmic.")) { String result=Main.getText(err,(arg0 != null ? arg0.toString() : null),(arg1 != null ? arg1.toString() : null),(arg2 != null ? arg2.toString() : null)); if (err.startsWith(...
Return the formatted, localized string for a named error message and supplied arguments. For rmic error messages, with names that being with "rmic.", look up the error message in rmic's resource bundle; otherwise, defer to java's superclass method.
public static int overloadError(double one,double two){ return (int)(one + two); }
This method is called via reflection from the database.
public static boolean isNullOrEmpty(String text){ return (text == null) || (text.trim().isEmpty()); }
Returns TRUE if the passed in text is either a NULL value or is an empty string.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-01-27 09:54:12.387 -0500",hash_original_method="D16C073A10FD3671AE05EBC49E38DA17",hash_generated_method="80887C79768229A316C39532A8C6419F") public void delete(int key){ int i=binarySearch(mKeys,0,mSize,key); if (i >= 0) { if (mValues[i]...
Removes the mapping from the specified key, if there was any.
public void rectValueToPixel(RectF r,float phaseY){ if (r.top > 0) r.top*=phaseY; else r.bottom*=phaseY; mMatrixValueToPx.mapRect(r); mViewPortHandler.getMatrixTouch().mapRect(r); mMatrixOffset.mapRect(r); }
Transform a rectangle with all matrices with potential animation phases.
private Referenceable registerInstance(Referenceable referenceable) throws Exception { String typeName=referenceable.getTypeName(); LOG.debug("creating instance of type " + typeName); String entityJSON=InstanceSerialization.toJson(referenceable,true); LOG.debug("Submitting new entity {} = {}",referenceable.getT...
Registers an entity in atlas
public void add(double time,double cpuTime){ createContainerIfNecessary(); container.add(time,cpuTime); }
Adds a new time and cpu time value to the current data container.
protected void printChildren() throws TranscoderException, XMLException, IOException { int op=0; loop: for (; ; ) { switch (type) { default : throw new RuntimeException("Invalid XML"); case LexicalUnits.NAME: writer.write(getCurrentValue()); type=scanner.next(); break; case LexicalUnits.LEFT_BRACE: wr...
Prints the children of an element declaration.
public NetworkResponse(int statusCode,byte[] data,Map<String,String> headers,boolean notModified){ this.statusCode=statusCode; this.data=data; this.headers=headers; this.notModified=notModified; }
Creates a new network response.
public static boolean checkFineLocationPermission(Context context){ return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(context,Manifest.permission.ACCESS_FINE_LOCATION); }
Check if the app has access to fine location permission. On pre-M devices this will always return true.
@SuppressFBWarnings(value="SF_SWITCH_FALLTHROUGH") public OrderedCollection<PortChangeEvent> handlePortStatusMessage(OFPortStatus ps){ if (ps == null) { throw new NullPointerException("OFPortStatus message must " + "not be null"); } lock.writeLock().lock(); try { OFPortDesc port=ps.getDesc(); OFPort...
Handle a OFPortStatus message, update the internal data structures that store ports and return the list of OFChangeEvents. This method will increment error/warn counters and log
@DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:43.891 -0500",hash_original_method="EFEABC4C711DA14ECED12A57E29FC504",hash_generated_method="C1E7128B8ABE2E8FF3DAA6D0223CE426") public CircularRedirectException(String message){ super(message); }
Creates a new CircularRedirectException with the specified detail message.
@Override public void configure(){ RfidTrafficController control; RfidProtocol protocol; String opt1=getOptionState(option1Name); switch (opt1) { case "Generic Stand-alone": log.debug("Create Generic Standalone SpecificTrafficController"); control=new StandaloneTrafficController(this.getSystemConnectionMemo...
set up all of the other objects to operate connected to this port
public DefaultClientRequestContext(EventLoop eventLoop,SessionProtocol sessionProtocol,Endpoint endpoint,String method,String path,String fragment,ClientOptions options,Object request){ super(sessionProtocol,method,path,request); this.eventLoop=requireNonNull(eventLoop,"eventLoop"); this.options=requireNonNull(op...
Creates a new instance.
public static TypeReference copyType(TypeReference ref,ASTNode source){ if (ref instanceof ParameterizedQualifiedTypeReference) { ParameterizedQualifiedTypeReference iRef=(ParameterizedQualifiedTypeReference)ref; TypeReference[][] args=null; if (iRef.typeArguments != null) { args=new TypeReference[i...
You can't share TypeReference objects or subtle errors start happening. Unfortunately the TypeReference type hierarchy is complicated and there's no clone method on TypeReference itself. This method can clone them.