code
stringlengths
10
174k
nl
stringlengths
3
129k
public SyntheticMethodBinding(MethodBinding overridenMethodToBridge,MethodBinding targetMethod,SourceTypeBinding declaringClass){ this.declaringClass=declaringClass; this.selector=overridenMethodToBridge.selector; this.modifiers=(targetMethod.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccSynchronized | ClassFileConstants.AccAbstract | ClassFileConstants.AccNative| ClassFileConstants.AccFinal| ExtraCompilerModifiers.AccGenericSignature); this.tagBits|=(TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); this.returnType=overridenMethodToBridge.returnType; this.parameters=overridenMethodToBridge.parameters; this.thrownExceptions=overridenMethodToBridge.thrownExceptions; this.targetMethod=targetMethod; this.purpose=SyntheticMethodBinding.BridgeMethod; SyntheticMethodBinding[] knownAccessMethods=declaringClass.syntheticMethods(); int methodId=knownAccessMethods == null ? 0 : knownAccessMethods.length; this.index=methodId; }
Construct a bridge method
public static void start(){ start(Thread.currentThread().getContextClassLoader()); }
Starts the current environment.
public ConnectionConfig(){ super(); }
Ctor for a functional Swing object with no prexisting adapter
public AbstractMRMessage createInitPacket(){ return null; }
Public Method to create an Initialization packet (SerialMessage) for this node. There are currently no Oak Tree boards that need an init message, so this returns null.
public Observable<String> exerciseZip(Observable<String> a,Observable<String> b){ return Observable.error(new RuntimeException("Not Implemented")); }
Combine 2 streams into pairs using zip. a -> "one", "two", "red", "blue" b -> "fish", "fish", "fish", "fish" output -> "one fish", "two fish", "red fish", "blue fish"
protected void tearDown(){ }
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
static String mapLibraryName(String libname){ String libSuffix; if (VM.BuildForLinux || VM.BuildForSolaris) { libSuffix=".so"; } else if (VM.BuildForOsx) { libSuffix=".jnilib"; } else { libSuffix=".a"; } return "lib" + libname + libSuffix; }
Apply library prefixes and suffixes as necessary to libname to produce a full file name. For example, on linux "rvm" would become "librvm.so".
public void removeActionListener(ActionListener a){ if (actionListeners == null) { return; } actionListeners.removeListener(a); if (!actionListeners.hasListeners()) { actionListeners=null; } }
Removes an action listener
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){ updateSize(); }
This is called during layout when the size of this view has changed. If you were just added to the view hierarchy, you're called with the old values of 0.
protected void sequence_FunctionFacet(ISerializationContext context,Facet semanticObject){ genericSequencer.createSequence(context,semanticObject); }
Contexts: FunctionFacet returns Facet Constraint: ((key='function:' | key='->') expr=Expression)
public static URL urlFromString(String location){ return urlFromString(location,null,true); }
From a string description, attempt to generate a URL object. The string may point to an Internet location (e.g., http:// or ftp:// URL), a resource on the class path (resulting in a resource URL that points into the current classpath), or a file on the local filesystem (resulting in a file:// URL). The String will be checked in that order in an attempt to resolve it to a valid URL.
public static List<? extends Node> evaluateXPath(Document doc,String path) throws XPathExpressionException { XPathFactory factory=XPathFactory.newInstance(); XPath xpath=factory.newXPath(); xpath.setNamespaceContext(new NamespaceResolver(doc)); XPathExpression expr=xpath.compile(path); NodeList nodes=(NodeList)expr.evaluate(doc,XPathConstants.NODESET); List<Node> nodelist=new ArrayList<Node>(); for (int i=0; i < nodes.getLength(); ++i) { nodelist.add(nodes.item(i)); } LOG.trace(String.format("Evaluated XPath: %s and found %s",path,nodeListToString(nodelist))); return nodelist; }
Takes a Document and evaluates an XPath expression on it. All matching Nodes are returned as a List.
@HLEFunction(nid=0x8DB83FDC,version=150) public int sceNetAdhocctlGetPeerInfo(pspNetMacAddress macAddress,int size,TPointer peerInfoAddr){ checkInitialized(); int result=SceKernelErrors.ERROR_NET_ADHOC_NO_ENTRY; if (sceNetAdhoc.isMyMacAddress(macAddress.macAddress)) { SceNetAdhocctlPeerInfo peerInfo=new SceNetAdhocctlPeerInfo(); peerInfo.nickName=sceUtility.getSystemParamNickname(); peerInfo.macAddress=new pspNetMacAddress(Wlan.getMacAddress()); peerInfo.timestamp=getCurrentTimestamp(); peerInfo.write(peerInfoAddr); if (log.isDebugEnabled()) { log.debug(String.format("sceNetAdhocctlGetPeerInfo for own MAC address, returning %s",peerInfo)); } result=0; } else { for ( AdhocctlPeer peer : peers) { if (macAddress.equals(peer.macAddress)) { SceNetAdhocctlPeerInfo peerInfo=new SceNetAdhocctlPeerInfo(); peerInfo.nickName=peer.nickName; peerInfo.macAddress=new pspNetMacAddress(peer.macAddress); peerInfo.timestamp=peer.timestamp; peerInfo.write(peerInfoAddr); if (log.isDebugEnabled()) { log.debug(String.format("sceNetAdhocctlGetPeerInfo returning %s",peerInfo)); } result=0; break; } } } if (result != 0) { if (log.isDebugEnabled()) { log.debug(String.format("sceNetAdhocctlGetPeerInfo returning 0x%08X",result)); } } return result; }
Get peer information
public NodeSet(){ m_blocksize=32; m_mapSize=0; }
Create an empty nodelist.
public static void printUsage(final Options options,final OutputStream out){ final PrintWriter writer=new PrintWriter(out); final HelpFormatter usageFormatter=new HelpFormatter(); usageFormatter.printUsage(writer,80,"Usage: hadoop jar <jar name> " + ReplicationJob.class.getName(),options); writer.flush(); }
Print usage information to provided OutputStream.
public boolean contains(final int x){ int i=d; while (i-- != 0) if (!bits.getBoolean(hash(x,i))) return false; return true; }
Checks whether the given integer is in this filter. <P>Note that this method may return true on an integer that has not been added to the filter. This will happen with probability 2<sup>-<var>d</var></sup>, where <var>d</var> is the number of hash functions specified at creation time, if the number of the elements in the filter is less than <var>n</var>, the number of expected elements specified at creation time.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:54:55.108 -0500",hash_original_method="6B2B571AE4F377CE25FA9B4608683BF5",hash_generated_method="285A23FFDABA1DF6F6F9408346D12FBB") public String encode(){ String retval=headerName + COLON; if (optionTag != null) retval+=SP + optionTag; retval+=NEWLINE; return retval; }
Return canonical form of the header.
public void minx(int parseInt){ minx=parseInt; }
Set the starting x number of the subjar file to create. Depends on the subjar zoom to figure out what that means.
public boolean IsPostPiEmpty(){ return this.postPi.isEmpty(); }
Checks if the post PI attribute list is empty.
@Override public boolean removeLastOccurrence(Object o){ throw new UnsupportedOperationException(ERROR_MSG); }
Guaranteed to throw an exception and leave the table unmodified.
public Builder<KType,VType> putAll(Map<KType,VType> map){ for ( Map.Entry<KType,VType> entry : map.entrySet()) { this.map.put(entry.getKey(),entry.getValue()); } return this; }
Puts all the entries in the map to the builder.
public static ByteBuffer wrap(byte[] bytes){ return ByteBuffer.wrap(bytes).order(DEFAULT_BYTE_ORDER); }
Returns a ByteBuffer wrapping the given bytes and configured with the default byte order.
public void println(){ System.err.println(prefix + ":"); }
print a blank line to stderr that is prefixed with the prefix.
public void authorizeComplete(String pin) throws FacebookException { AccessToken token=this.connection.getOAuthAccessToken(pin); setToken(token.getToken()); User user=this.connection.getMe(); this.userName=user.getId(); if (token.getExpires() != null) { this.tokenExpiry=new Date(System.currentTimeMillis() + (token.getExpires() * 1000)); } this.profileName=user.getName(); try { this.page=""; ResponseList<Account> accounts=this.connection.getAccounts(); this.pages=new ArrayList<>(); if (accounts != null) { for ( Account account : accounts) { this.page=account.getName(); this.pages.add(account.getName()); } } } catch ( Exception exception) { log(exception); } }
Authorise a new account to be accessible by Bot.
public <T>void visit(final Class<? super T> type) throws HandleException { checkArgument(type != null,"Type to be visited cannot be null"); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer(" Visit class: " + type); } if (type.getPackage() != null && type.getPackage().getName().startsWith(JAVA_PACKAGE)) { return; } handle(type); handle(type.getDeclaredFields()); handle(type.getDeclaredMethods()); visit((Class<? super T>)type.getSuperclass()); }
Visits all fields, methods and super classes of the input class.
public static String encode(String str) throws RuntimeException { byte[] bytes=str.getBytes(); byte[] encoded=encode(bytes); try { return new String(encoded,"ASCII"); } catch ( UnsupportedEncodingException e) { throw new RuntimeException("ASCII is not supported!",e); } }
<p> Encodes a string. </p> <p> Before the string is encoded in Base64, it is converted in a binary sequence using the system default charset. </p>
public void clearInputs(){ unCache(); for ( TransactionInput input : inputs) { input.setParent(null); } inputs.clear(); this.length=this.unsafeBitcoinSerialize().length; }
Removes all the inputs from this transaction. Note that this also invalidates the length attribute
private void determineSyntaxAndEncoding(String absFileName,JarFile jarFile,String jspConfigPageEnc) throws JasperException, IOException { isXml=false; boolean isExternal=false; boolean revert=false; JspConfig jspConfig=ctxt.getOptions().getJspConfig(); JspProperty jspProperty=jspConfig.findJspProperty(absFileName); if (jspProperty.isXml() != null) { isXml=JspUtil.booleanValue(jspProperty.isXml()); isExternal=true; } else if (absFileName.endsWith(".jspx") || absFileName.endsWith(".tagx")) { isXml=true; isExternal=true; } if (isExternal && !isXml) { sourceEnc=jspConfigPageEnc; if (sourceEnc != null) { return; } sourceEnc="ISO-8859-1"; } else { Object[] ret=XMLEncodingDetector.getEncoding(absFileName,jarFile,ctxt,err); sourceEnc=(String)ret[0]; if (((Boolean)ret[1]).booleanValue()) { isEncodingSpecifiedInProlog=true; } if (ret[2] != null && ((Boolean)ret[2]).booleanValue()) { hasBom=true; } if (!isXml && sourceEnc.equalsIgnoreCase("utf-8") && !hasBom) { sourceEnc="ISO-8859-1"; revert=true; } } if (isXml) { return; } JspReader jspReader=null; try { jspReader=new JspReader(ctxt,absFileName,sourceEnc,jarFile,err); } catch ( FileNotFoundException ex) { throw new JasperException(ex); } jspReader.setSingleFile(true); Mark startMark=jspReader.mark(); if (!isExternal) { jspReader.reset(startMark); if (hasJspRoot(jspReader)) { isXml=true; if (revert) sourceEnc="UTF-8"; return; } else { isXml=false; } } if (!hasBom) { sourceEnc=jspConfigPageEnc; } if (sourceEnc == null) { sourceEnc=getPageEncodingForJspSyntax(jspReader,startMark); if (sourceEnc == null) { sourceEnc="ISO-8859-1"; isDefaultPageEncoding=true; } } }
Determines the syntax (standard or XML) and page encoding properties for the given file, and stores them in the 'isXml' and 'sourceEnc' instance variables, respectively.
public FastAdapterDialog<Item> withTitle(@StringRes int titleRes){ setTitle(titleRes); return this; }
Set the title text for this dialog's window.
private String buildToolTip(final CTaggedGraphNodesContainerNode node){ final StringBuilder tooltip=new StringBuilder("<html>"); boolean first=true; for ( final NaviNode graphnode : node.getGraphNodes()) { if (!first) { tooltip.append("<br>"); } tooltip.append(CNodesDisplayString.getDisplayString(graphnode)); first=false; } return tooltip + "</html>"; }
Generates the tooltip shown when the cursor hovers over a tag tree node that represents a container of graph nodes.
private void stateData(){ Log.d(TAG,"Santa is online."); updateNavigation(); scheduleUIUpdate(); long time=SantaPreferences.getCurrentTime(); AbstractLaunch launchSanta=mCardAdapter.getLauncher(CardAdapter.SANTA); if (time > mFirstDeparture && time < OFFLINE_SANTA_FINALARRIVAL) { enableTrackerMode(true); if (mFlagSwitchOff) { launchSanta.setState(AbstractLaunch.STATE_DISABLED); } else if (time > mFinalArrival) { launchSanta.setState(AbstractLaunch.STATE_DISABLED); } else { launchSanta.setState(AbstractLaunch.STATE_READY); } } else if (time < mFirstDeparture) { startCountdown(mFirstDeparture); launchSanta.setState(AbstractLaunch.STATE_LOCKED); } else { launchSanta.setState(AbstractLaunch.STATE_FINISHED); stopCountdown(); enableTrackerMode(false); } }
Move to 'data' (online) state.
public final int type(){ return m_Type; }
Returns the attribute's type as an integer.
public ProtomechBay(double space,int doors,int bayNumber){ totalSpace=space; currentSpace=space; this.doors=doors; doorsNext=doors; this.bayNumber=bayNumber; }
Create a space for the given tonnage of troops. For this class, only the weight of the troops (and their equipment) are considered; if you'd like to think that they are stacked like lumber, be my guest.
@Override protected EClass eStaticClass(){ return GamlPackage.Literals.STATEMENT; }
<!-- begin-user-doc --> <!-- end-user-doc -->
@RequestMapping(value="podcasts_by_frequency",method=RequestMethod.POST) public String updatePodcastsWithFrequency(@ModelAttribute("updatePodcastsByFrequencyForm") UpdatePodcastsByFrequencyForm updatePodcastsByFrequencyForm,BindingResult bindingResult,ModelMap model){ if (bindingResult.hasErrors()) { return "redirect:/admin"; } LOG.debug("------ executing updatePodcastsWithFrequency -----"); Integer podcastsUpdateFrequencyCode=updatePodcastsByFrequencyForm.getUpdateFrequency() != null ? updatePodcastsByFrequencyForm.getUpdateFrequency().getCode() : null; if (podcastsUpdateFrequencyCode == null) { Integer.valueOf(configBean.get("PODCAST_FREQUENCY_TYPE_TO_UPDATE")); } Integer totalNumberOfPodcasts=null; totalNumberOfPodcasts=readService.getNumberOfPodcastsWithUpdateFrequency(podcastsUpdateFrequencyCode); Integer numberOfWorkerThreads=updatePodcastsByFrequencyForm.getNumberOfWorkingThreads(); if (numberOfWorkerThreads == null) { numberOfWorkerThreads=Integer.valueOf(configBean.get("NO_WORKER_THREADS_FOR_UPDATE_ALL_PODCASTS")); } if (numberOfWorkerThreads == null) { numberOfWorkerThreads=DEFAULT_NO_WORKER_THREADS_FOR_UPDATE_ALL_PODCASTS; } Integer mod=totalNumberOfPodcasts % numberOfWorkerThreads; Integer chunkSize=totalNumberOfPodcasts / numberOfWorkerThreads; for (int i=0; i < numberOfWorkerThreads; i++) { int startRow=i * chunkSize; if (i == numberOfWorkerThreads - 1) { chunkSize=chunkSize + mod; LOG.debug("Thread[" + i + "] - ["+ startRow+ ","+ chunkSize+ "]"); Future<String> future=batchUpdateService.updatePodcastsFromRange(startRow,chunkSize,podcastsUpdateFrequencyCode); } else { batchUpdateService.updatePodcastsFromRange(startRow,chunkSize,podcastsUpdateFrequencyCode); } } return "redirect:/admin/update/batch"; }
UPDATE podcast by id or feed url
public void removeListener(final SelectionListener listener1){ if (this.listener == listener1) this.listener=null; }
Remove listener.
public CompositePersistence(Persistence<O,A> primaryPersistence,Persistence<O,A> secondaryPersistence,List<? extends Persistence<O,A>> additionalPersistences){ validatePersistenceArguments(primaryPersistence,secondaryPersistence,additionalPersistences); this.primaryPersistence=primaryPersistence; this.secondaryPersistence=secondaryPersistence; this.additionalPersistences=additionalPersistences; }
Creates a CompositePersistence wrapping two or more backing persistences. <b>The collection itself will be persisted to the primary persistence.</b>
public PKCS10 createCSRequest(Device device,KeyPair keyPair) throws KeyStoreException { X500Name x500Name=createX500NameForDevice(device); PKCS10 request=null; try { request=new PKCS10(keyPair.getPublic()); Signature signature=Signature.getInstance("MD5withRSA"); signature.initSign(keyPair.getPrivate()); request.encodeAndSign(x500Name,signature); } catch ( Exception e) { throw new KeyStoreException("Unable to create CSR request",e); } return request; }
Creates a Certificate Signing Request and signs it with RSA private key
public void syncAll(){ m_vmasvc.sync(m_nid,0L,0L,true); }
sync. the memory pool to underlying memory device.
private void stripTimings(){ long limit=System.currentTimeMillis() - TIMING_TTL_MILLIS; int endIndex=0; for (; endIndex < myTimings.size(); endIndex++) { if (myTimings.get(endIndex) > limit) { break; } } if (endIndex > 0) { myTimings.remove(0,endIndex); } }
Removes old timings.
@Override public FileLock tryLock(long position,long size,boolean shared) throws IOException { throw new IOException("Method is unsupported."); }
Unsupported method.
public UsageException(final String message){ super(message); }
Creates a new UsageException.
public BasicEffect ground(Assignment grounding){ return this; }
Returns itself.
public UDPMasterTerminal(){ }
Create an uninitialized UDP master connection.
public static void cropAll(String[] strings){ for (int i=0; i < strings.length; i++) { String string=strings[i]; if (string != null) { string=crop(strings[i]); } strings[i]=string; } }
Crops all elements of string array.
public void updateControllerConnections(IOFSwitchBackend sw,OFControllerRole role1,OFBsnControllerConnectionState state1,String uri1,OFControllerRole role2,OFBsnControllerConnectionState state2,String uri2){ OFBsnControllerConnection connection1=factory.buildBsnControllerConnection().setAuxiliaryId(OFAuxId.MAIN).setRole(role1).setState(state1).setUri(uri1).build(); OFBsnControllerConnection connection2=factory.buildBsnControllerConnection().setAuxiliaryId(OFAuxId.MAIN).setRole(role2).setState(state2).setUri(uri2).build(); List<OFBsnControllerConnection> connections=new ArrayList<OFBsnControllerConnection>(); connections.add(connection1); connections.add(connection2); OFBsnControllerConnectionsReply reply=factory.buildBsnControllerConnectionsReply().setConnections(connections).build(); sw.updateControllerConnections(reply); }
Helper to load controller connection messages into a switch for testing.
@Override public void draw(){ background(0); stereoPosition(cameraPositionX,cameraPositionY,cameraPositionZ,0f,0f,-1f,0f,1f,0f); }
Processing draw function. Called before drawLeft and drawRight.
public URI(String scheme,String host,String path,String fragment) throws URISyntaxException { this(scheme,null,host,-1,path,null,fragment); }
Creates a new URI instance of the given unencoded component parts.
public Label(double... c){ this(coordToString(c),AbstractDrawer.DEFAULT_COLOR,c); }
show coord itself
private void scaleStmt(ColumnFormat cf) throws ParserException, IOException { match(SCALE); Token t=matchOne(scaleKeyWords); cf.setScale(Scale.toScale(t.sval)); String scaleString=t.sval; log(pdebug,"Parsed: scale -> " + scaleString); }
scalestmt -> 'scale' scalespec scalespec -> <see above scaleTerminals array>
public double predicted(){ return m_Predicted; }
Gets the predicted class value.
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:47.056 -0500",hash_original_method="61478AA9F56747991020142C67580FB8",hash_generated_method="F44C74B35137AEFCC17E0B0D490721CE") @Override public synchronized void reset() throws IOException { in.reset(); }
Resets this stream to the last marked location. This implementation resets the target stream.
public IteratorSpliterator(Iterator<? extends T> iterator,int characteristics){ this.collection=null; this.it=iterator; this.est=Long.MAX_VALUE; this.characteristics=characteristics & ~(Spliterator.SIZED | Spliterator.SUBSIZED); }
Creates a spliterator using the given iterator for traversal, and reporting the given initial size and characteristics.
public static String[] toStringArray(Array array,String defaultValue){ String[] arr=new String[array.size()]; for (int i=0; i < arr.length; i++) { arr[i]=Caster.toString(array.get(i + 1,defaultValue),defaultValue); } return arr; }
cast a Object Array to a String Array
protected Texture updateTextureWithSubImage(DrawContext dc,Rectangle rect){ Texture texture=this.getTexture(dc); if (texture == null) { String msg=Logging.getMessage("nullValue.TextureIsNull"); Logging.logger().warning(msg); return null; } if (!this.isUseMipMaps() || texture.isUsingAutoMipmapGeneration()) { BufferedImage backingImage=(BufferedImage)this.rectPacker.getBackingStore(); BufferedImage subImage=backingImage.getSubimage(rect.x,rect.y,rect.width,rect.height); GL gl=dc.getGL(); TextureData subTextureData=AWTTextureIO.newTextureData(gl.getGLProfile(),subImage,false); texture.updateSubImage(gl,subTextureData,0,rect.x,rect.y); } else { BufferedImage backingImage=(BufferedImage)this.rectPacker.getBackingStore(); GL gl=dc.getGL(); texture.updateImage(gl,AWTTextureIO.newTextureData(gl.getGLProfile(),backingImage,this.isUseMipMaps())); this.setTextureParameters(dc); } return texture; }
Loads a sub-region of this texture atlas' backing image into its OpenGL texture. This does nothing and returns code <code>null</code> if this texture atlas' does not have an OpenGL texture.
public void rotateY(double degrees){ Transform3D other=new Transform3D(); other.rotY(degrees * Math.PI / 180); transform(other); }
Modifies the global model transform by rotating along the current Y axis the provided number of degrees.
public static long doubleToLong(double value){ return (long)(value / DEGREE_TOLERANCE); }
Function used to convert an angle in degrees to its internal, fixed-precision long representation. Intended for library use only.
public @CheckReturnValue boolean containsProperty(T prop){ return map.keySet().contains(prop); }
Return whether or not the set contains the given WarningProperty.
private CGlobalEdgeCommentSynchronizer(){ }
You are not supposed to instantiate this class.
protected void assertAsCollection(Object collectionObject,int count){ Collection collection=DefaultTypeTransformation.asCollection(collectionObject); assertTrue("Collection is not null",collection != null); assertEquals("Collection size",count,collection.size()); assertIterator("collections iterator",collection.iterator(),count); assertIterator("InvokerHelper.asIterator",InvokerHelper.asIterator(collectionObject),count); assertIterator("InvokerHelper.asIterator(InvokerHelper.asCollection)",InvokerHelper.asIterator(collection),count); assertIterator("InvokerHelper.asIterator(InvokerHelper.asIterator)",InvokerHelper.asIterator(InvokerHelper.asIterator(collectionObject)),count); }
Asserts that the given object can be converted into a collection and iterator of the given size
private void readResponseHeaders(State state,InnerState innerState,HttpResponse response) throws StopRequest { Header header=response.getFirstHeader("Content-Disposition"); if (header != null) { innerState.mHeaderContentDisposition=header.getValue(); } header=response.getFirstHeader("Content-Location"); if (header != null) { innerState.mHeaderContentLocation=header.getValue(); } header=response.getFirstHeader("ETag"); if (header != null) { innerState.mHeaderETag=header.getValue(); } String headerTransferEncoding=null; header=response.getFirstHeader("Transfer-Encoding"); if (header != null) { headerTransferEncoding=header.getValue(); } String headerContentType=null; header=response.getFirstHeader("Content-Type"); if (header != null) { headerContentType=header.getValue(); if (!headerContentType.equals("application/vnd.android.obb")) { throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY,"file delivered with incorrect Mime type"); } } if (headerTransferEncoding == null) { header=response.getFirstHeader("Content-Length"); if (header != null) { innerState.mHeaderContentLength=header.getValue(); long contentLength=Long.parseLong(innerState.mHeaderContentLength); if (contentLength != -1 && contentLength != mInfo.mTotalBytes) { Log.e(Constants.TAG,"Incorrect file size delivered."); } } } else { if (Constants.LOGVV) { Log.v(Constants.TAG,"ignoring content-length because of xfer-encoding"); } } if (Constants.LOGVV) { Log.v(Constants.TAG,"Content-Disposition: " + innerState.mHeaderContentDisposition); Log.v(Constants.TAG,"Content-Length: " + innerState.mHeaderContentLength); Log.v(Constants.TAG,"Content-Location: " + innerState.mHeaderContentLocation); Log.v(Constants.TAG,"ETag: " + innerState.mHeaderETag); Log.v(Constants.TAG,"Transfer-Encoding: " + headerTransferEncoding); } boolean noSizeInfo=innerState.mHeaderContentLength == null && (headerTransferEncoding == null || !headerTransferEncoding.equalsIgnoreCase("chunked")); if (noSizeInfo) { throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR,"can't know size of download, giving up"); } }
Read headers from the HTTP response and store them into local state.
public String readString(int length) throws IOException { byte[] array=new byte[length]; readFully(array); String s=new String(array); return s.trim(); }
Constructs a string from the underlying input stream
public TextOutputCallback(int messageType,String message){ if ((messageType != INFORMATION && messageType != WARNING && messageType != ERROR) || message == null || message.length() == 0) throw new IllegalArgumentException(); this.messageType=messageType; this.message=message; }
Construct a TextOutputCallback with a message type and message to be displayed. <p>
@DSSafe(DSCat.SAFE_OTHERS) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:32:41.939 -0500",hash_original_method="24BC54E57520E50B51FEB9301490242D",hash_generated_method="FAE9CEF2DB2F0021A995BEA229699877") public JWebCoreJavaBridge(){ nativeConstructor(); }
Construct a new JWebCoreJavaBridge to interface with WebCore timers and cookies.
public boolean isCallableConstructor(){ final EObject parent=this.eContainer(); boolean _xifexpression=false; if ((parent instanceof ContainerType<?>)) { TMethod _callableCtor=((ContainerType<?>)parent).getCallableCtor(); _xifexpression=(_callableCtor == this); } else { _xifexpression=false; } return _xifexpression; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public final double min(){ double min=Double.POSITIVE_INFINITY; double[][] fieldx=null; double[] fieldxy=null; final int width=this.width; final int height=this.height; final int length=this.length; for (int x=0; x < width; x++) { fieldx=field[x]; for (int y=0; y < height; y++) { fieldxy=fieldx[y]; for (int z=0; z < length; z++) if (min > fieldxy[z]) min=fieldxy[z]; } } return min; }
Returns the minimum value stored in the grid
public static Date round(final Date date,final int field){ if (date == null) { throw new IllegalArgumentException("The date must not be null"); } final Calendar gval=Calendar.getInstance(); gval.setTime(date); modify(gval,field,ModifyType.ROUND); return gval.getTime(); }
<p>Rounds a date, leaving the field specified as the most significant field.</p> <p>For example, if you had the date-time of 28 Mar 2002 13:45:01.231, if this was passed with HOUR, it would return 28 Mar 2002 14:00:00.000. If this was passed with MONTH, it would return 1 April 2002 0:00:00.000.</p> <p>For a date in a timezone that handles the change to daylight saving time, rounding to Calendar.HOUR_OF_DAY will behave as follows. Suppose daylight saving time begins at 02:00 on March 30. Rounding a date that crosses this time would produce the following values: </p> <ul> <li>March 30, 2003 01:10 rounds to March 30, 2003 01:00</li> <li>March 30, 2003 01:40 rounds to March 30, 2003 03:00</li> <li>March 30, 2003 02:10 rounds to March 30, 2003 03:00</li> <li>March 30, 2003 02:40 rounds to March 30, 2003 04:00</li> </ul>
@Override protected AdminResponse createResponse(DistributionManager dm){ return SubRegionResponse.create(dm,this.getSender(),this.getRegion(dm.getSystem())); }
Must return a proper response to this request.
public static void load(final NiFiProperties properties) throws IOException, ClassNotFoundException { if (initialized.getAndSet(true)) { throw new IllegalStateException("Extensions class loaders have already been loaded."); } final ClassLoader systemClassLoader=ClassLoader.getSystemClassLoader(); ClassLoader currentContextClassLoader=Thread.currentThread().getContextClassLoader(); final Map<String,ClassLoader> extensionDirectoryClassLoaderLookup=new LinkedHashMap<>(); final Map<String,ClassLoader> narIdClassLoaderLookup=new HashMap<>(); final File frameworkWorkingDirectory=properties.getFrameworkWorkingDirectory(); final File extensionsWorkingDirectory=properties.getExtensionsWorkingDirectory(); FileUtils.ensureDirectoryExistAndCanAccess(frameworkWorkingDirectory); FileUtils.ensureDirectoryExistAndCanAccess(extensionsWorkingDirectory); final List<File> narWorkingDirContents=new ArrayList<>(); final File[] frameworkWorkingDirContents=frameworkWorkingDirectory.listFiles(); if (frameworkWorkingDirContents != null) { narWorkingDirContents.addAll(Arrays.asList(frameworkWorkingDirContents)); } final File[] extensionsWorkingDirContents=extensionsWorkingDirectory.listFiles(); if (extensionsWorkingDirContents != null) { narWorkingDirContents.addAll(Arrays.asList(extensionsWorkingDirContents)); } if (!narWorkingDirContents.isEmpty()) { final List<NarDetails> narDetails=new ArrayList<>(); for ( final File unpackedNar : narWorkingDirContents) { final NarDetails narDetail=getNarDetails(unpackedNar); if (narDetail.getNarId() == null) { logger.warn("No NAR Id found. Skipping: " + unpackedNar.getAbsolutePath()); continue; } narDetails.add(narDetail); } int narCount; do { narCount=narDetails.size(); for (final Iterator<NarDetails> narDetailsIter=narDetails.iterator(); narDetailsIter.hasNext(); ) { final NarDetails narDetail=narDetailsIter.next(); final String narDependencies=narDetail.getNarDependencyId(); ClassLoader narClassLoader=null; if (narDependencies == null) { narClassLoader=createNarClassLoader(narDetail.getNarWorkingDirectory(),currentContextClassLoader); } else if (narIdClassLoaderLookup.containsKey(narDetail.getNarDependencyId())) { narClassLoader=createNarClassLoader(narDetail.getNarWorkingDirectory(),narIdClassLoaderLookup.get(narDetail.getNarDependencyId())); } if (narClassLoader != null) { extensionDirectoryClassLoaderLookup.put(narDetail.getNarWorkingDirectory().getCanonicalPath(),narClassLoader); narIdClassLoaderLookup.put(narDetail.getNarId(),narClassLoader); narDetailsIter.remove(); } } } while (narCount != narDetails.size()); for ( final NarDetails narDetail : narDetails) { logger.warn(String.format("Unable to resolve required dependency '%s'. Skipping NAR %s",narDetail.getNarDependencyId(),narDetail.getNarWorkingDirectory().getAbsolutePath())); } } frameworkClassLoader.set(narIdClassLoaderLookup.get(FRAMEWORK_NAR_ID)); extensionClassLoaders.set(new LinkedHashMap<>(extensionDirectoryClassLoaderLookup)); }
Loads the extensions class loaders from the specified working directory. Loading is only performed during the initial invocation of load. Subsequent attempts will be ignored.
public CsvInfo(){ }
Instantiates a new instance.
public boolean isSummary(){ Object oo=get_Value(COLUMNNAME_IsSummary); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Summary Level.
public void execute() throws Exception { startUp(); generateQueryId(); CloseableHttpAsyncClient client=getClient(); client.start(); Pair<String,InputStream> requestInput=getRequestInput(); try (InputStream is=requestInput.getRight()){ sentRequest=new Message(is,requestInput.getLeft()); } AsyncHttpSender sender=new AsyncHttpSender(client); sender.addHeader(HEADER_HASH_ALGO_ID,DEFAULT_DIGEST_ALGORITHM_ID); requestInput=getRequestInput(); try (InputStream is=requestInput.getRight()){ for ( Entry<String,String> e : requestHeaders.entrySet()) { sender.addHeader(e.getKey(),e.getValue()); } if ("post".equalsIgnoreCase(httpMethod)) { sender.doPost(new URI(url),is,CHUNKED_LENGTH,requestInput.getLeft()); } else { sender.doGet(new URI(url)); } sender.waitForResponse(DEFAULT_CLIENT_TIMEOUT); } try { receivedResponse=new Message(sender.getResponseContent(),sender.getResponseContentType()); if (sentRequest != null && sentRequest.getSoap() != null && sentRequest.getSoap() instanceof SoapMessageImpl && ((SoapMessageImpl)sentRequest.getSoap()).isAsync() && !requestHeaders.containsKey(SoapUtils.X_IGNORE_ASYNC)) { sentResponse=receivedResponse; } } finally { sender.close(); client.close(); closeDown(); } if (failed) { throw new Exception("Test failed in previous stage"); } log.debug("Validating SOAP message\n{}",receivedResponse.getSoap().getXml()); if (receivedResponse.isFault()) { log.debug("Validating fault: {}, {}",((SoapFault)receivedResponse.getSoap()).getCode(),((SoapFault)receivedResponse.getSoap()).getString()); validateFaultResponse(receivedResponse); return; } if (!receivedResponse.isResponse()) { throw new Exception("Received SOAP message is not a response"); } if (sentResponse != null && !checkConsistency(sentResponse,receivedResponse)) { throw new Exception("Received response is not the same as sent response"); } log.debug("Validating normal response"); validateNormalResponse(receivedResponse); }
Performs the request and validates the response.
public boolean isInverted(){ return lng.isInverted(); }
Return true if lng_.lo() > lng_.hi(), i.e. the rectangle crosses the 180 degree latitude line.
private void validateLogicalShardId(final long logicalShardId){ if (logicalShardId < MIN_LOGICAL_SHARD_ID || logicalShardId > MAX_LOGICAL_SHARD_ID) { throw new InvalidLogicalShardIdException("The logical shard ID set in Redis is less than " + String.valueOf(MIN_LOGICAL_SHARD_ID) + " or is greater than the supported maximum of "+ String.valueOf(MAX_LOGICAL_SHARD_ID)); } }
Check that the given logical shard ID is within the bounds that we allow. This is important to check, as otherwise when bit-shifting we may lose digits outside of the bits we care about, introducing possible collisions.
public boolean foo(String x,String y){ if (x != null) return foo_bar0(x); else if (y != null) return foo_bar1(y); else return false; }
This private method has 4 branches
public static void ensureOutputDirectory(final File directory){ if (!directory.exists()) { if (!directory.mkdirs()) { throw new NoTalkbackSlimException(ErrorType.DIRECTORY_NOT_CREATED,directory.getPath()); } } else { if (!directory.isDirectory()) { throw new NoTalkbackSlimException(ErrorType.NOT_A_DIRECTORY,directory.getPath()); } } }
Test if the supplied directory is valid for the purposes of writing a SLIM result. This means the directory either exists or does not exist and can be successfully created (which this method will do).
private static void delete(File f){ if (f.isDirectory()) { for ( File c : f.listFiles()) { delete(c); } } if (!f.delete()) { PrintStream err=System.err; err.println("Failed to delete file: " + f); } }
Recursively deletes a file that may represent a directory.
public static void putShortLE(byte[] arr,long off,short val){ if (UNALIGNED) UNSAFE.putShort(arr,off,Short.reverseBytes(val)); else putShortByByte(arr,off,val,false); }
Stores short value into byte array assuming that value should be stored in little-endian byte order and native byte order is big-endian. Alignment aware.
public static void incNumWorkers(){ incNumWorkers(1); }
Increments the number of workers by 1
private void buildAddressSelectionPopUp(){ final CAddressSelectionDialog dlg=new CAddressSelectionDialog(m_parent,m_modules); dlg.setVisible(true); final INaviModule result=dlg.getSelectionResult(); final IAddress address=new CAddress(Long.parseLong(getText(),16)); ZyZoomHelpers.zoomToAddress(m_graph,address,result,true); }
In the case of multiple modules zoom to address does not work therefore the user must select in which module to search.
public boolean isFinal(){ return ffinal; }
Checks if is final.
protected void writeFormStreamData(OutputStream writer) throws IOException { Set<String> keys=mParamKeyValues.keySet(); for ( String key : keys) { List<Object> values=mParamKeyValues.getValues(key); for ( Object value : values) { if (!isCanceled()) { if (value != null && value instanceof String) { if (!(writer instanceof CounterOutputStream)) Logger.i(key + "=" + value); writeFormString(writer,key,value.toString()); } else if (value != null && value instanceof Binary) { if (!(writer instanceof CounterOutputStream)) Logger.i(key + " is Binary"); writeFormBinary(writer,key,(Binary)value); } writer.write("\r\n".getBytes()); } } } writer.write((endBoundary).getBytes()); }
Send form data.
public static <E>Set<E> constrainedSet(Set<E> set,Constraint<? super E> constraint){ return new ConstrainedSet<E>(set,constraint); }
Returns a constrained view of the specified set, using the specified constraint. Any operations that add new elements to the set will call the provided constraint. However, this method does not verify that existing elements satisfy the constraint. <p>The returned set is not serializable.
private void extractMessages(){ Intent lInvokingIntent=getIntent(); String lMsgInit=lInvokingIntent.getStringExtra(MSG_INIT); if (lMsgInit != null) { mMsgInit=lMsgInit; } String lMsgDetect=lInvokingIntent.getStringExtra(MSG_DETECT); if (lMsgDetect != null) { mMsgDetect=lMsgDetect; } String lMsgPlaylist=lInvokingIntent.getStringExtra(MSG_PLAYLIST); if (lMsgPlaylist != null) { mMsgPlaylist=lMsgPlaylist; } String lMsgToken=lInvokingIntent.getStringExtra(MSG_TOKEN); if (lMsgToken != null) { mMsgToken=lMsgToken; } String lMsgLoBand=lInvokingIntent.getStringExtra(MSG_LO_BAND); if (lMsgLoBand != null) { mMsgLowBand=lMsgLoBand; } String lMsgHiBand=lInvokingIntent.getStringExtra(MSG_HI_BAND); if (lMsgHiBand != null) { mMsgHiBand=lMsgHiBand; } String lMsgErrTitle=lInvokingIntent.getStringExtra(MSG_ERROR_TITLE); if (lMsgErrTitle != null) { mMsgErrorTitle=lMsgErrTitle; } String lMsgErrMsg=lInvokingIntent.getStringExtra(MSG_ERROR_MSG); if (lMsgErrMsg != null) { mMsgError=lMsgErrMsg; } }
Determine the messages to display during video load and initialization.
private CNameListGenerators(){ }
You are not supposed to instantiate this class.
public CCheckBox(Action a){ super(a); init(); }
Creates a check box where properties are taken from the Action supplied.
public static ZyLabelContent buildContent(final INaviTextNode node){ Preconditions.checkNotNull(node,"IE01700: Node argument can not be null"); final ZyLabelContent content=new ZyLabelContent(null); buildContent(content,node); return content; }
Builds the content of the text node.
protected void layoutSouth(DockWrapper base,int x,int y,int maxwidth,int maxheight){ for (Iterator iter=base.getDockedWrappers().iterator(); iter.hasNext(); ) { DockWrapper dw=(DockWrapper)iter.next(); Dimension d=dw.getPreferredSize(); int w=min(d.width,maxwidth); int h=min(d.height,maxheight); dw.setBounds(x,y - h,w,h); if (!dw.canOcclude()) { updateBottom(backgroundBounds,y - h); } updateBottom(occludingBounds,y - h); layoutSouth(dw,x,y - h,maxwidth,maxheight - h); x+=w; maxwidth-=w; } }
Layout north side.
public void lostOwnership(Clipboard clipboard,Transferable contents){ }
Required by the AbstractAction interface; does nothing.
public void cancel(){ mCancellationRequested.set(true); }
Cancel operation
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:26.756 -0500",hash_original_method="3F955D64051D380D89135CF7B70C1F05",hash_generated_method="0EC25BC15D68F1E59DA0282A4EDDD537") public void reqGetReconnectIntent(){ Message response=sendMessageSynchronously(REQ_GET_RECONNECT_INTENT); if (DBG) log("reqGetReconnectIntent"); }
Request to get Pending ReconnectIntent to DC. Response RSP_GET_RECONNECT_INTENT when complete.
public void finished(){ m_printstream.flush(); }
Finalizes output file.
public String encode(){ return encode(new StringBuffer()).toString(); }
Get the encoded representation of this namevalue object. Added doublequote for encoding doublequoted values. Bug: RFC3261 stipulates that an opaque parameter in authenticate header has to be: opaque = "opaque" EQUAL quoted-string so returning just the name is not acceptable. (e.g. LinkSys phones are picky about this)
private void computeSnaps(Collection segStrings,Collection snapPts){ for (Iterator i0=segStrings.iterator(); i0.hasNext(); ) { NodedSegmentString ss=(NodedSegmentString)i0.next(); computeSnaps(ss,snapPts); } }
Computes nodes introduced as a result of snapping segments to snap points (hot pixels)
public DotGraph(String graphname){ this.graphname=graphname; this.isSubGraph=false; this.nodes=new HashMap<String,DotGraphNode>(100); this.drawElements=new LinkedList<Renderable>(); this.attributes=new LinkedList<DotGraphAttribute>(); }
Creates a new graph for drawing.
public static LayersBuilder with(Layer... layers){ return new LayersBuilder(Arrays.asList(layers)); }
Returns a new LayersBuilder with all the provided layers included.
@DSComment("Layout info") @DSSafe(DSCat.DATA_STRUCTURE) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:31:46.937 -0500",hash_original_method="E6336A158C939972C1CFCFE234B123CF",hash_generated_method="77CD180C6E32DEBAEFF64B715469A756") public void addRule(int verb,int anchor){ mRules[verb]=anchor; }
Adds a layout rule to be interpreted by the RelativeLayout. Use this for verbs that take a target, such as a sibling (ALIGN_RIGHT) or a boolean value (VISIBLE).
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 Finalizer(Class<?> finalizableReferenceClass,ReferenceQueue<Object> queue,PhantomReference<Object> frqReference){ this.queue=queue; this.finalizableReferenceClassReference=new WeakReference<Class<?>>(finalizableReferenceClass); this.frqReference=frqReference; }
Constructs a new finalizer thread.
void dispose(){ stroking=0; if (!USE_CACHE_HARD_REF) { hardRefArrayCaches=null; } if (dirty) { this.nPCPathIterator.dispose(); this.nPQPathIterator.dispose(); this.dasher.dispose(); this.stroker.dispose(); dirty=false; } }
Disposes this renderer context: clean up before reusing this context