signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ClassFile { /** * Returns the constant map index to field * @ param declaringClass * @ param name * @ param type * @ return */ int getFieldIndex ( TypeElement declaringClass , String name , TypeMirror type ) { } }
return getFieldIndex ( declaringClass , name , Descriptor . getFieldDesriptor ( type ) ) ;
public class Timestamp { /** * clean up timestamp argument assuming latest possible values for missing * or bogus digits . * @ param timestamp String * @ return String */ public static String padEndDateStr ( String timestamp ) { } }
return boundTimestamp ( padDigits ( timestamp , LOWER_TIMESTAMP_LIMIT , UPPER_TIMESTAMP_LIMIT , UPPER_TIMESTAMP_LIMIT ) ) ;
public class GuildWars2Utility { /** * This method come from < a href = " https : / / github . com / karlroberts / base64 " > this < / a > library < br / > * Which is released under < a href = " https : / / github . com / karlroberts / base64 / blob / master / LICENSE " > BSD 3 - clause " New " or " Revised " License < / a > : < br / > * Copyright 2005-2013 Karl Roberts & lt ; karl . roberts @ owtelse . com & gt ; * All rights reserved . * Redistribution and use in source and binary forms , with or without modification , are permitted provided that the * following conditions are met : * 1 . Redistributions of source code must retain the above copyright notice , this list of conditions and the following * disclaimer . * 2 . Redistributions in binary form must reproduce the above copyright notice , this list of conditions and the * following disclaimer in the documentation and / or other materials provided with the distribution . * 3 . Neither the name of the author nor the names of his contributors may be used to endorse or promote products * derived from this software without specific prior written permission . * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ` ` AS IS ' ' AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , * BUT NOT LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED . IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL * DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES ; LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT * LIABILITY , OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE . * I use this method to decoding Base64 string , so that I don ' t have to relying on javax library or android library * @ param byteData Base64 string in byte array * @ return decoded byte array * @ throws IllegalArgumentException invalid input */ private static byte [ ] _decode ( byte [ ] byteData ) throws IllegalArgumentException { } }
/* If we received a null argument , exit this method . */ if ( byteData == null ) { throw new IllegalArgumentException ( "byteData cannot be null" ) ; } /* * Declare working variables including an array of bytes that will * contain the decoded data to be returned to the caller . Note that the * decoded array is about 3/4 smaller than the input . This is because * every group of 4 bytes is being encoded into 3 bytes . */ int iSrcIdx ; // index into source ( byteData ) int reviSrcIdx ; // index from end of the src array ( byteData ) int iDestIdx ; // index into destination ( byteDest ) byte [ ] byteTemp = new byte [ byteData . length ] ; /* * remove any ' = ' chars from the end of the byteData they would have * been padding to make it up to groups of 4 bytes note that I don ' t * need to remove it just make sure that when progressing throug array * we don ' t go past reviSrcIdx ; - ) */ for ( reviSrcIdx = byteData . length ; reviSrcIdx - 1 > 0 && byteData [ reviSrcIdx - 1 ] == '=' ; reviSrcIdx -- ) { // do nothing . I ' m just interested in value of reviSrcIdx } /* sanity check */ if ( reviSrcIdx - 1 == 0 ) { return null ; /* ie all padding */ } /* * Set byteDest , this is smaller than byteData due to 4 - > 3 byte munge . * Note that this is an integer division ! This fact is used in the logic * l8r . to make sure we don ' t fall out of the array and create an * OutOfBoundsException and also in handling the remainder */ byte byteDest [ ] = new byte [ ( ( reviSrcIdx * 3 ) / 4 ) ] ; /* * Convert from Base64 alphabet to encoded data ( The Base64 alphabet is * completely documented in RFC 1521 . ) The order of the testing is * important as I use the ' < ' operator which looks at the hex value of * these ASCII chars . So convert from the smallest up * do all of this in a new array so as not to edit the original input */ for ( iSrcIdx = 0 ; iSrcIdx < reviSrcIdx ; iSrcIdx ++ ) { if ( byteData [ iSrcIdx ] == '+' ) byteTemp [ iSrcIdx ] = 62 ; else if ( byteData [ iSrcIdx ] == '/' ) byteTemp [ iSrcIdx ] = 63 ; else if ( byteData [ iSrcIdx ] < '0' + 10 ) byteTemp [ iSrcIdx ] = ( byte ) ( byteData [ iSrcIdx ] + 52 - '0' ) ; else if ( byteData [ iSrcIdx ] < ( 'A' + 26 ) ) byteTemp [ iSrcIdx ] = ( byte ) ( byteData [ iSrcIdx ] - 'A' ) ; else if ( byteData [ iSrcIdx ] < 'a' + 26 ) byteTemp [ iSrcIdx ] = ( byte ) ( byteData [ iSrcIdx ] + 26 - 'a' ) ; } /* * 4bytes - > 3bytes munge Walk through the input array , 32 bits at a * time , converting them from 4 groups of 6 to 3 groups of 8 removing * the two unset most significant bits of each sorce byte as this was * filler , as per Base64 spec . stop before potential buffer overun on * byteDest , remember that byteDest is 3/4 ( integer division ) the size * of input and won ' t necessary divide exactly ( ie iDestIdx must be < * ( integer div byteDest . length / 3 ) * 3 see * http : / / www . javaworld . com / javaworld / javatips / jw - javatip36 - p2 . html for * example */ for ( iSrcIdx = 0 , iDestIdx = 0 ; iSrcIdx < reviSrcIdx && iDestIdx < ( ( byteDest . length / 3 ) * 3 ) ; iSrcIdx += 4 ) { byteDest [ iDestIdx ++ ] = ( byte ) ( ( byteTemp [ iSrcIdx ] << 2 ) & 0xFC | ( byteTemp [ iSrcIdx + 1 ] >>> 4 ) & 0x03 ) ; byteDest [ iDestIdx ++ ] = ( byte ) ( ( byteTemp [ iSrcIdx + 1 ] << 4 ) & 0xF0 | ( byteTemp [ iSrcIdx + 2 ] >>> 2 ) & 0x0F ) ; byteDest [ iDestIdx ++ ] = ( byte ) ( ( byteTemp [ iSrcIdx + 2 ] << 6 ) & 0xC0 | byteTemp [ iSrcIdx + 3 ] & 0x3F ) ; } /* * tidy up any remainders if iDestIdx > = ( ( byteDest . length / 3 ) * 3 ) but * iSrcIdx < reviSrcIdx then we have at most 2 extra destination bytes * to fill and posiblr 3 input bytes yet to process */ if ( iSrcIdx < reviSrcIdx ) { if ( iSrcIdx < reviSrcIdx - 2 ) { // "3 input bytes left " byteDest [ iDestIdx ++ ] = ( byte ) ( ( byteTemp [ iSrcIdx ] << 2 ) & 0xFC | ( byteTemp [ iSrcIdx + 1 ] >>> 4 ) & 0x03 ) ; byteDest [ iDestIdx ++ ] = ( byte ) ( ( byteTemp [ iSrcIdx + 1 ] << 4 ) & 0xF0 | ( byteTemp [ iSrcIdx + 2 ] >>> 2 ) & 0x0F ) ; } else if ( iSrcIdx < reviSrcIdx - 1 ) { // "2 input bytes left " byteDest [ iDestIdx ++ ] = ( byte ) ( ( byteTemp [ iSrcIdx ] << 2 ) & 0xFC | ( byteTemp [ iSrcIdx + 1 ] >>> 4 ) & 0x03 ) ; } /* * wont have just one input byte left ( unless input wasn ' t base64 * encoded ) due to the for loop steps and array sizes , after " = " * pad removed , but for compleatness */ else { throw new IllegalArgumentException ( "Warning: 1 input bytes left to process. This was not Base64 input" ) ; } } return byteDest ;
public class CollectionErasureMatcher { /** * { @ inheritDoc } */ public boolean matches ( T target ) { } }
List < TypeDescription > typeDescriptions = new ArrayList < TypeDescription > ( ) ; for ( TypeDefinition typeDefinition : target ) { typeDescriptions . add ( typeDefinition . asErasure ( ) ) ; } return matcher . matches ( typeDescriptions ) ;
public class CBLVersion { /** * This is information about the system on which we are running . */ public static String getSysInfo ( ) { } }
String info = sysInfo . get ( ) ; if ( info == null ) { info = String . format ( Locale . ENGLISH , SYS_INFO , System . getProperty ( "os.name" , "unknown" ) ) ; sysInfo . compareAndSet ( null , info ) ; } return info ;
public class ParamChecker { /** * Check that a string is not empty if its not null . * @ param value value . * @ param name parameter name for the exception message . * @ return the given value . */ public static String notEmptyIfNotNull ( String value , String name , String info ) { } }
if ( value == null ) { return value ; } if ( value . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( name + " cannot be empty" + ( info == null ? "" : ", " + info ) ) ; } return value . trim ( ) ;
public class Property { /** * Returns the property value which this metamodel property instance * represents from the specified entity instance . * @ param entity The entity instance from which you attempt to get the * property value . < b > The specified entity have to make sure to be JavaBeans * to get property value from it . < / b > * @ return The property value of the specified entity instance . */ @ SuppressWarnings ( "unchecked" ) public T get ( Object entity ) { } }
Object value = entity ; for ( String name : path ( ) ) { try { Field field = value . getClass ( ) . getDeclaredField ( name ) ; field . setAccessible ( true ) ; value = field . get ( value ) ; } catch ( Exception e ) { throw new UncheckedException ( e ) ; } } return ( T ) value ;
public class CommerceOrderNoteUtil { /** * Returns an ordered range of all the commerce order notes where commerceOrderId = & # 63 ; and restricted = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceOrderNoteModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param commerceOrderId the commerce order ID * @ param restricted the restricted * @ param start the lower bound of the range of commerce order notes * @ param end the upper bound of the range of commerce order notes ( not inclusive ) * @ param orderByComparator the comparator to order the results by ( optionally < code > null < / code > ) * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the ordered range of matching commerce order notes */ public static List < CommerceOrderNote > findByC_R ( long commerceOrderId , boolean restricted , int start , int end , OrderByComparator < CommerceOrderNote > orderByComparator , boolean retrieveFromCache ) { } }
return getPersistence ( ) . findByC_R ( commerceOrderId , restricted , start , end , orderByComparator , retrieveFromCache ) ;
public class OpenAPIFilter { /** * { @ inheritDoc } */ @ Override public Server visitServer ( Context context , Server server ) { } }
return filter . filterServer ( server ) ;
public class NumberUtil { /** * 将16进制的String转化为Integer . * 当str为空或非数字字符串时抛NumberFormatException */ public static Integer hexToIntObject ( @ NotNull String str ) { } }
// 统一行为 , 不要有时候抛NPE , 有时候抛NumberFormatException if ( str == null ) { throw new NumberFormatException ( "null" ) ; } return Integer . decode ( str ) ;
public class ViewFetcher { /** * Extracts all { @ code View } s located in the currently active { @ code Activity } , recursively . * @ param parent the { @ code View } whose children should be returned , or { @ code null } for all * @ param onlySufficientlyVisible if only sufficiently visible views should be returned * @ return all { @ code View } s located in the currently active { @ code Activity } , never { @ code null } */ public ArrayList < View > getViews ( View parent , boolean onlySufficientlyVisible ) { } }
final ArrayList < View > views = new ArrayList < View > ( ) ; final View parentToUse ; if ( parent == null ) { return getAllViews ( onlySufficientlyVisible ) ; } else { parentToUse = parent ; views . add ( parentToUse ) ; if ( parentToUse instanceof ViewGroup ) { addChildren ( views , ( ViewGroup ) parentToUse , onlySufficientlyVisible ) ; } } return views ;
public class StyleHandler { /** * Turns input into a Reader . * @ param input A { @ link Reader } , { @ link java . io . InputStream } , { @ link File } , or { @ link * Resource } . */ protected Reader toReader ( Object input ) throws IOException { } }
if ( input instanceof Reader ) { return ( Reader ) input ; } if ( input instanceof InputStream ) { return new InputStreamReader ( ( InputStream ) input ) ; } if ( input instanceof String ) { return new StringReader ( ( String ) input ) ; } if ( input instanceof URL ) { return new InputStreamReader ( ( ( URL ) input ) . openStream ( ) ) ; } if ( input instanceof File ) { return new FileReader ( ( File ) input ) ; } throw new IllegalArgumentException ( "Unable to turn " + input + " into reader" ) ;
public class DiscoveryService { /** * Returns the schema records matching the specified criteria . At least one field matching expression must be supplied . * @ param namespaceRegex The regular expression on which to match the name space field . May be null . * @ param scopeRegex The regular expression on which to match the scope field . May be null . * @ param metricRegex The regular expression on which to match the metric field . May be null . * @ param tagKeyRegex The regular expression on which to match the tag key field . May be null . * @ param tagValueRegex The regular expression on which to match the tag value field . May be null . * @ param limit The maximum number of records to return . Must be a positive non - zero integer . * @ return The matching schema records . * @ throws IOException If the server cannot be reached . * @ throws TokenExpiredException If the token sent along with the request has expired */ public List < MetricSchemaRecord > getMatchingRecords ( String namespaceRegex , String scopeRegex , String metricRegex , String tagKeyRegex , String tagValueRegex , int limit ) throws IOException , TokenExpiredException { } }
StringBuilder urlBuilder = _buildBaseUrl ( namespaceRegex , scopeRegex , metricRegex , tagKeyRegex , tagValueRegex , limit ) ; String requestUrl = urlBuilder . toString ( ) ; ArgusResponse response = getClient ( ) . executeHttpRequest ( ArgusHttpClient . RequestType . GET , requestUrl , null ) ; assertValidResponse ( response , requestUrl ) ; return fromJson ( response . getResult ( ) , new TypeReference < List < MetricSchemaRecord > > ( ) { } ) ;
public class ID3v2Tag { /** * Saves all the information in the tag to the file passed to the * constructor . If a tag doesn ' t exist , a tag is prepended to the file . * If the padding has not changed since the creation of this object and * the size is less than the original size + the original padding , then * the previous tag and part of the previous padding will be overwritten . * Otherwise , a new tag will be prepended to the file . * @ return true if the tag was successfully written * @ exception FileNotFoundException if an error occurs * @ exception IOException if an error occurs */ public void writeTag ( RandomAccessFile raf ) throws FileNotFoundException , IOException { } }
int curSize = getSize ( ) ; origPadding = padding ; padding = getUpdatedPadding ( ) ; // This means that the file does not need to change size if ( ( padding > origPadding ) || ( ( padding == origPadding ) && ( curSize == origSize ) ) ) { byte [ ] out = getBytes ( ) ; raf . seek ( 0 ) ; raf . write ( out ) ; } else { // TODO : This needs copying without full loading int bufSize = ( int ) ( raf . length ( ) + curSize ) ; byte [ ] out = new byte [ bufSize ] ; System . arraycopy ( getBytes ( ) , 0 , out , 0 , curSize ) ; int bufSize2 = ( int ) ( raf . length ( ) - origSize ) ; byte [ ] in = new byte [ bufSize2 ] ; raf . seek ( origSize ) ; if ( raf . read ( in ) != in . length ) { throw new IOException ( "Error reading mp3 file before writing" ) ; } System . arraycopy ( in , 0 , out , curSize , in . length ) ; raf . setLength ( bufSize2 ) ; raf . seek ( 0 ) ; raf . write ( out ) ; } origSize = curSize ; exists = true ;
public class SimpleDocumentDbRepository { /** * FindQuerySpecGenerator * Returns a Page of entities meeting the paging restriction provided in the Pageable object . * @ param pageable * @ return a page of entities */ @ Override public Page < T > findAll ( Pageable pageable ) { } }
Assert . notNull ( pageable , "pageable should not be null" ) ; return operation . findAll ( pageable , information . getJavaType ( ) , information . getCollectionName ( ) ) ;
public class JerseyClientBuilder { /** * Builds the { @ link Client } instance with a custom reactive client provider . * @ return a fully - configured { @ link Client } */ public < RX extends RxInvokerProvider < ? > > Client buildRx ( String name , Class < RX > invokerType ) { } }
return build ( name ) . register ( invokerType ) ;
public class GeneralPurposeFFT_F32_1D { /** * Computes 1D forward DFT of real data leaving the result in < code > a < / code > * . This method computes the full real forward transform , i . e . you will get * the same result as from < code > complexForward < / code > called with all * imaginary part equal 0 . Because the result is stored in < code > a < / code > , * the size of the input array must greater or equal 2 * n , with only the * first n elements filled with real data . To get back the original data , * use < code > complexInverse < / code > on the output of this method . * @ param a * data to transform * @ param offa * index of the first element in array < code > a < / code > */ public void realForwardFull ( final float [ ] a , final int offa ) { } }
final int twon = 2 * n ; switch ( plan ) { case SPLIT_RADIX : { realForward ( a , offa ) ; int idx1 , idx2 ; for ( int k = 0 ; k < n / 2 ; k ++ ) { idx1 = 2 * k ; idx2 = offa + ( ( twon - idx1 ) % twon ) ; a [ idx2 ] = a [ offa + idx1 ] ; a [ idx2 + 1 ] = - a [ offa + idx1 + 1 ] ; } a [ offa + n ] = - a [ offa + 1 ] ; a [ offa + 1 ] = 0 ; } break ; case MIXED_RADIX : { rfftf ( a , offa ) ; int m ; if ( n % 2 == 0 ) { m = n / 2 ; } else { m = ( n + 1 ) / 2 ; } for ( int k = 1 ; k < m ; k ++ ) { int idx1 = offa + twon - 2 * k ; int idx2 = offa + 2 * k ; a [ idx1 + 1 ] = - a [ idx2 ] ; a [ idx1 ] = a [ idx2 - 1 ] ; } for ( int k = 1 ; k < n ; k ++ ) { int idx = offa + n - k ; float tmp = a [ idx + 1 ] ; a [ idx + 1 ] = a [ idx ] ; a [ idx ] = tmp ; } a [ offa + 1 ] = 0 ; } break ; case BLUESTEIN : bluestein_real_full ( a , offa , - 1 ) ; break ; }
public class ContentKey { /** * Create an operation that will list all the content keys at the given * link . * @ param link * Link to request content keys from . * @ return The list operation . */ public static DefaultListOperation < ContentKeyInfo > list ( LinkInfo < ContentKeyInfo > link ) { } }
return new DefaultListOperation < ContentKeyInfo > ( link . getHref ( ) , new GenericType < ListResult < ContentKeyInfo > > ( ) { } ) ;
public class AnnotatedLargeText { /** * Strips annotations using a { @ link PlainTextConsoleOutputStream } . * { @ inheritDoc } */ @ CheckReturnValue @ Override public long writeLogTo ( long start , OutputStream out ) throws IOException { } }
return super . writeLogTo ( start , new PlainTextConsoleOutputStream ( out ) ) ;
public class TriplestoreResource { /** * This code is equivalent to the SPARQL query below . * < p > < pre > < code > * SELECT ? object * WHERE { * GRAPH trellis : PreferServerManaged { ? object dc : isPartOf IDENTIFIER } * < / code > < / pre > */ private Stream < Quad > fetchContainmentQuads ( ) { } }
if ( getInteractionModel ( ) . getIRIString ( ) . endsWith ( "Container" ) ) { final Query q = new Query ( ) ; q . setQuerySelectType ( ) ; q . addResultVar ( OBJECT ) ; final ElementPathBlock epb = new ElementPathBlock ( ) ; epb . addTriple ( create ( OBJECT , rdf . asJenaNode ( DC . isPartOf ) , rdf . asJenaNode ( identifier ) ) ) ; final ElementNamedGraph ng = new ElementNamedGraph ( rdf . asJenaNode ( Trellis . PreferServerManaged ) , epb ) ; final ElementGroup elg = new ElementGroup ( ) ; elg . addElement ( ng ) ; q . setQueryPattern ( elg ) ; final Stream . Builder < Quad > builder = builder ( ) ; rdfConnection . querySelect ( q , qs -> builder . accept ( rdf . createQuad ( LDP . PreferContainment , identifier , LDP . contains , getObject ( qs ) ) ) ) ; return builder . build ( ) ; } return Stream . empty ( ) ;
public class ClientTypeSignature { /** * This field is deprecated and clients should switch to { @ link # getArguments ( ) } */ @ Deprecated @ JsonProperty public List < Object > getLiteralArguments ( ) { } }
List < Object > result = new ArrayList < > ( ) ; for ( ClientTypeSignatureParameter argument : arguments ) { switch ( argument . getKind ( ) ) { case NAMED_TYPE : result . add ( argument . getNamedTypeSignature ( ) . getName ( ) ) ; break ; default : return new ArrayList < > ( ) ; } } return result ;
public class StreamMessage { /** * Get field from message body . * @ param key key * @ return field mapped key */ @ SuppressWarnings ( "rawtypes" ) public Object getField ( String key ) { } }
if ( this . body == null || Map . class . isAssignableFrom ( this . body . getClass ( ) ) == false ) { return null ; } return ( ( Map ) this . body ) . get ( key ) ;
public class StorageUtil { /** * sets a file value to a XML Element * @ param el Element to set value on it * @ param key key to set * @ param value value to set */ public void setFile ( Element el , String key , Resource value ) { } }
if ( value != null && value . toString ( ) . length ( ) > 0 ) el . setAttribute ( key , value . getAbsolutePath ( ) ) ;
public class Maven3Builder { /** * Used by Pipeline jobs only */ public boolean perform ( Run < ? , ? > build , Launcher launcher , TaskListener listener , EnvVars env , FilePath workDir , FilePath tempDir ) throws InterruptedException , IOException { } }
listener . getLogger ( ) . println ( "Jenkins Artifactory Plugin version: " + ActionableHelper . getArtifactoryPluginVersion ( ) ) ; FilePath mavenHome = getMavenHome ( listener , env , launcher ) ; if ( ! mavenHome . exists ( ) ) { listener . getLogger ( ) . println ( "Couldn't find Maven home at " + mavenHome . getRemote ( ) + " on agent " + Utils . getAgentName ( workDir ) + ". This could be because this build is running inside a Docker container." ) ; } ArgumentListBuilder cmdLine = buildMavenCmdLine ( build , listener , env , launcher , mavenHome , workDir , tempDir ) ; String [ ] cmds = cmdLine . toCommandArray ( ) ; return RunMaven ( build , launcher , listener , env , workDir , cmds ) ;
public class FoxHttpClientBuilder { /** * Define a map of FoxHttpInterceptors * < i > This will override the existing map of interceptors < / i > * @ param foxHttpInterceptors Map of interceptors * @ return FoxHttpClientBuilder ( this ) */ public FoxHttpClientBuilder setFoxHttpInterceptors ( Map < FoxHttpInterceptorType , ArrayList < FoxHttpInterceptor > > foxHttpInterceptors ) { } }
foxHttpClient . setFoxHttpInterceptors ( foxHttpInterceptors ) ; return this ;
public class CmsDefaultPageEditor { /** * Returns the list of active elements of the page . < p > * @ return the list of active elements of the page */ protected List < CmsDialogElement > getElementList ( ) { } }
if ( m_elementList == null ) { m_elementList = CmsDialogElements . computeElements ( getCms ( ) , m_page , getParamTempfile ( ) , getElementLocale ( ) ) ; } return m_elementList ;
public class QuaternionEulerTransform { /** * Conversion from quaternion to Euler rotation . * The x value fr * @ param quat4d the quaternion from which the euler rotation is computed . * @ return a vector with the mapping : x = roll , y = pitch , z = yaw */ public static Vector3d transform ( final Quat4d quat4d ) { } }
Vector3d result = new Vector3d ( ) ; double test = quat4d . x * quat4d . z + quat4d . y * quat4d . w ; if ( test >= 0.5 ) { // singularity at north pole result . x = 0 ; result . y = Math . PI / 2 ; result . z = 2 * Math . atan2 ( quat4d . x , quat4d . w ) ; return result ; } if ( test <= - 0.5 ) { // singularity at south pole result . x = 0 ; result . y = - Math . PI / 2 ; result . z = - 2 * Math . atan2 ( quat4d . x , quat4d . w ) ; return result ; } double sqx = quat4d . x * quat4d . x ; double sqz = quat4d . y * quat4d . y ; double sqy = quat4d . z * quat4d . z ; result . x = Math . atan2 ( 2 * quat4d . x * quat4d . w - 2 * quat4d . z * quat4d . y , 1 - 2 * sqx - 2 * sqz ) ; result . y = Math . asin ( 2 * test ) ; result . z = Math . atan2 ( 2 * quat4d . z * quat4d . w - 2 * quat4d . x * quat4d . y , 1 - 2 * sqy - 2 * sqz ) ; return result ;
public class MP3FileID3Controller { /** * Set the composer of this mp3 ( id3v2 only ) . * @ param composer the composer of this mp3 */ public void setComposer ( String composer ) { } }
if ( allow ( ID3V2 ) ) { id3v2 . setTextFrame ( ID3v2Frames . COMPOSER , composer ) ; }
public class ForkJoinPool { /** * Helps and / or blocks until the given task is done or timeout . * @ param w caller * @ param task the task * @ param deadline for timed waits , if nonzero * @ return task status on exit */ final int awaitJoin ( WorkQueue w , ForkJoinTask < ? > task , long deadline ) { } }
int s = 0 ; if ( w != null ) { ForkJoinTask < ? > prevJoin = w . currentJoin ; if ( task != null && ( s = task . status ) >= 0 ) { w . currentJoin = task ; CountedCompleter < ? > cc = ( task instanceof CountedCompleter ) ? ( CountedCompleter < ? > ) task : null ; for ( ; ; ) { if ( cc != null ) helpComplete ( w , cc , 0 ) ; else helpStealer ( w , task ) ; if ( ( s = task . status ) < 0 ) break ; long ms , ns ; if ( deadline == 0L ) ms = 0L ; else if ( ( ns = deadline - System . nanoTime ( ) ) <= 0L ) break ; else if ( ( ms = TimeUnit . NANOSECONDS . toMillis ( ns ) ) <= 0L ) ms = 1L ; if ( tryCompensate ( w ) ) { task . internalWait ( ms ) ; U . getAndAddLong ( this , CTL , AC_UNIT ) ; } if ( ( s = task . status ) < 0 ) break ; } w . currentJoin = prevJoin ; } } return s ;
public class Inode { /** * Wraps an InodeView , providing read - only access . Modifications to the underlying inode will * affect the created read - only inode . * @ param delegate the delegate to wrap * @ return the created read - only inode */ public static Inode wrap ( InodeView delegate ) { } }
if ( delegate instanceof Inode ) { return ( Inode ) delegate ; } if ( delegate . isFile ( ) ) { Preconditions . checkState ( delegate instanceof InodeFileView ) ; return new InodeFile ( ( InodeFileView ) delegate ) ; } else { Preconditions . checkState ( delegate instanceof InodeDirectoryView ) ; return new InodeDirectory ( ( InodeDirectoryView ) delegate ) ; }
public class ipsecprofile { /** * Use this API to add ipsecprofile resources . */ public static base_responses add ( nitro_service client , ipsecprofile resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { ipsecprofile addresources [ ] = new ipsecprofile [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new ipsecprofile ( ) ; addresources [ i ] . name = resources [ i ] . name ; addresources [ i ] . ikeversion = resources [ i ] . ikeversion ; addresources [ i ] . encalgo = resources [ i ] . encalgo ; addresources [ i ] . hashalgo = resources [ i ] . hashalgo ; addresources [ i ] . lifetime = resources [ i ] . lifetime ; addresources [ i ] . psk = resources [ i ] . psk ; addresources [ i ] . publickey = resources [ i ] . publickey ; addresources [ i ] . privatekey = resources [ i ] . privatekey ; addresources [ i ] . peerpublickey = resources [ i ] . peerpublickey ; addresources [ i ] . livenesscheckinterval = resources [ i ] . livenesscheckinterval ; addresources [ i ] . replaywindowsize = resources [ i ] . replaywindowsize ; addresources [ i ] . ikeretryinterval = resources [ i ] . ikeretryinterval ; addresources [ i ] . retransmissiontime = resources [ i ] . retransmissiontime ; } result = add_bulk_request ( client , addresources ) ; } return result ;
public class IDNA { /** * IDNA2003 : Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC . * This operation is done on complete domain names , e . g : " www . example . com " . * < b > Note : < / b > IDNA RFC specifies that a conformant application should divide a domain name * into separate labels , decide whether to apply allowUnassigned and useSTD3ASCIIRules on each , * and then convert . This function does not offer that level of granularity . The options once * set will apply to all labels in the domain name * @ param src The input string as UCharacterIterator to be processed * @ param options A bit set of options : * - IDNA . DEFAULT Use default options , i . e . , do not process unassigned code points * and do not use STD3 ASCII rules * If unassigned code points are found the operation fails with * ParseException . * - IDNA . ALLOW _ UNASSIGNED Unassigned values can be converted to ASCII for query operations * If this option is set , the unassigned code points are in the input * are treated as normal Unicode code points . * - IDNA . USE _ STD3 _ RULES Use STD3 ASCII rules for host name syntax restrictions * If this option is set and the input does not satisfy STD3 rules , * the operation will fail with ParseException * @ return StringBuffer the converted String * @ deprecated ICU 55 Use UTS 46 instead via { @ link # getUTS46Instance ( int ) } . * @ hide original deprecated declaration */ @ Deprecated public static StringBuffer convertIDNToUnicode ( UCharacterIterator src , int options ) throws StringPrepParseException { } }
return convertIDNToUnicode ( src . getText ( ) , options ) ;
public class DateTimeField { /** * Get the Value of this field as a double . * Converts the time from getTime ( ) to a double ( may lose some precision ) . * @ return The value of this field . */ public double getValue ( ) { } }
// Get this field ' s value java . util . Date dateValue = ( java . util . Date ) this . getData ( ) ; // Get the physical data if ( dateValue == null ) return 0 ; return ( double ) dateValue . getTime ( ) ;
public class TransmissionData { /** * Returns the size of the data associated with this transmission * ( in bytes ) * @ return Returns the size of the data associated with this transmission */ protected int getSize ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSize" ) ; int headerSize = 0 ; if ( layout == JFapChannelConstants . XMIT_PRIMARY_ONLY ) headerSize = JFapChannelConstants . SIZEOF_PRIMARY_HEADER ; else if ( layout == JFapChannelConstants . XMIT_CONVERSATION ) headerSize = JFapChannelConstants . SIZEOF_PRIMARY_HEADER + JFapChannelConstants . SIZEOF_CONVERSATION_HEADER ; else if ( layout == JFapChannelConstants . XMIT_SEGMENT_START ) headerSize = JFapChannelConstants . SIZEOF_PRIMARY_HEADER + JFapChannelConstants . SIZEOF_CONVERSATION_HEADER + JFapChannelConstants . SIZEOF_SEGMENT_START_HEADER ; else if ( layout == JFapChannelConstants . XMIT_SEGMENT_MIDDLE ) headerSize = JFapChannelConstants . SIZEOF_PRIMARY_HEADER + JFapChannelConstants . SIZEOF_CONVERSATION_HEADER ; else if ( layout == JFapChannelConstants . XMIT_SEGMENT_END ) headerSize = JFapChannelConstants . SIZEOF_PRIMARY_HEADER + JFapChannelConstants . SIZEOF_CONVERSATION_HEADER ; else { throw new SIErrorException ( TraceNLS . getFormattedMessage ( JFapChannelConstants . MSG_BUNDLE , "TRANSDATA_INTERNAL_SICJ0060" , null , "TRANSDATA_INTERNAL_SICJ0060" ) ) ; // D226223 } int retValue = primaryHeaderFields . segmentLength - headerSize ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSize" , "" + retValue ) ; return retValue ;
public class ClasspathElement { /** * Called by scanPaths ( ) after scan completion . * @ param log * the log */ protected void finishScanPaths ( final LogNode log ) { } }
if ( log != null ) { if ( whitelistedResources . isEmpty ( ) && whitelistedClassfileResources . isEmpty ( ) ) { log . log ( scanSpec . enableClassInfo ? "No whitelisted classfiles or resources found" : "Classfile scanning is disabled, and no whitelisted resources found" ) ; } else if ( whitelistedResources . isEmpty ( ) ) { log . log ( "No whitelisted resources found" ) ; } else if ( whitelistedClassfileResources . isEmpty ( ) ) { log . log ( scanSpec . enableClassInfo ? "No whitelisted classfiles found" : "Classfile scanning is disabled" ) ; } } if ( log != null ) { log . addElapsedTime ( ) ; }
public class MtasSolrComponentList { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # distributedProcess ( org . * apache . solr . handler . component . ResponseBuilder , * mtas . codec . util . CodecComponent . ComponentFields ) */ @ SuppressWarnings ( "unchecked" ) public void distributedProcess ( ResponseBuilder rb , ComponentFields mtasFields ) { } }
if ( mtasFields . doList ) { // compute total from shards HashMap < String , HashMap < String , Integer > > listShardTotals = new HashMap < > ( ) ; for ( ShardRequest sreq : rb . finished ) { if ( sreq . params . getBool ( MtasSolrSearchComponent . PARAM_MTAS , false ) && sreq . params . getBool ( PARAM_MTAS_LIST , false ) ) { for ( ShardResponse response : sreq . responses ) { NamedList < Object > result = response . getSolrResponse ( ) . getResponse ( ) ; try { ArrayList < NamedList < Object > > data = ( ArrayList < NamedList < Object > > ) result . findRecursive ( "mtas" , NAME ) ; if ( data != null ) { for ( NamedList < Object > dataItem : data ) { Object key = dataItem . get ( "key" ) ; Object total = dataItem . get ( "total" ) ; if ( ( key != null ) && ( key instanceof String ) && ( total != null ) && ( total instanceof Integer ) ) { if ( ! listShardTotals . containsKey ( key ) ) { listShardTotals . put ( ( String ) key , new HashMap < String , Integer > ( ) ) ; } HashMap < String , Integer > listShardTotal = listShardTotals . get ( key ) ; listShardTotal . put ( response . getShard ( ) , ( Integer ) total ) ; } } } } catch ( ClassCastException e ) { log . debug ( e ) ; } } } } // compute shard requests HashMap < String , ModifiableSolrParams > shardRequests = new HashMap < > ( ) ; int requestId = 0 ; for ( String field : mtasFields . list . keySet ( ) ) { for ( ComponentList list : mtasFields . list . get ( field ) . listList ) { requestId ++ ; if ( listShardTotals . containsKey ( list . key ) && ( list . number > 0 ) ) { Integer start = list . start ; Integer number = list . number ; HashMap < String , Integer > totals = listShardTotals . get ( list . key ) ; for ( int i = 0 ; i < rb . shards . length ; i ++ ) { if ( number < 0 ) { break ; } int subTotal = totals . get ( rb . shards [ i ] ) ; // System . out . println ( i + " : " + rb . shards [ i ] + " : " // + totals . get ( rb . shards [ i ] ) + " - " + start + " " + number ) ; if ( ( start >= 0 ) && ( start < subTotal ) ) { ModifiableSolrParams params ; if ( ! shardRequests . containsKey ( rb . shards [ i ] ) ) { shardRequests . put ( rb . shards [ i ] , new ModifiableSolrParams ( ) ) ; } params = shardRequests . get ( rb . shards [ i ] ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_FIELD , list . field ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_VALUE , list . queryValue ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_TYPE , list . queryType ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_PREFIX , list . queryPrefix ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_IGNORE , list . queryIgnore ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_MAXIMUM_IGNORE_LENGTH , list . queryMaximumIgnoreLength ) ; int subRequestId = 0 ; for ( String name : list . queryVariables . keySet ( ) ) { if ( list . queryVariables . get ( name ) == null || list . queryVariables . get ( name ) . length == 0 ) { params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_VARIABLE + "." + subRequestId + "." + SUBNAME_MTAS_LIST_QUERY_VARIABLE_NAME , name ) ; subRequestId ++ ; } else { for ( String value : list . queryVariables . get ( name ) ) { params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_VARIABLE + "." + subRequestId + "." + SUBNAME_MTAS_LIST_QUERY_VARIABLE_NAME , name ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_QUERY_VARIABLE + "." + subRequestId + "." + SUBNAME_MTAS_LIST_QUERY_VARIABLE_VALUE , value ) ; subRequestId ++ ; } } } params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_KEY , list . key ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_PREFIX , list . prefix ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_START , Integer . toString ( start ) ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_NUMBER , Integer . toString ( Math . min ( number , ( subTotal - start ) ) ) ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_LEFT , Integer . toString ( list . left ) ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_RIGHT , Integer . toString ( list . right ) ) ; params . add ( PARAM_MTAS_LIST + "." + requestId + "." + NAME_MTAS_LIST_OUTPUT , list . output ) ; number -= ( subTotal - start ) ; start = 0 ; } else { start -= subTotal ; } } } } } for ( Entry < String , ModifiableSolrParams > entry : shardRequests . entrySet ( ) ) { ShardRequest sreq = new ShardRequest ( ) ; sreq . shards = new String [ ] { entry . getKey ( ) } ; sreq . purpose = ShardRequest . PURPOSE_PRIVATE ; sreq . params = new ModifiableSolrParams ( ) ; sreq . params . add ( CommonParams . FQ , rb . req . getParams ( ) . getParams ( CommonParams . FQ ) ) ; sreq . params . add ( CommonParams . Q , rb . req . getParams ( ) . getParams ( CommonParams . Q ) ) ; sreq . params . add ( CommonParams . CACHE , rb . req . getParams ( ) . getParams ( CommonParams . CACHE ) ) ; sreq . params . add ( CommonParams . ROWS , "0" ) ; sreq . params . add ( MtasSolrSearchComponent . PARAM_MTAS , rb . req . getOriginalParams ( ) . getParams ( MtasSolrSearchComponent . PARAM_MTAS ) ) ; sreq . params . add ( PARAM_MTAS_LIST , rb . req . getOriginalParams ( ) . getParams ( PARAM_MTAS_LIST ) ) ; sreq . params . add ( entry . getValue ( ) ) ; rb . addRequest ( searchComponent , sreq ) ; } }
public class Phaser { /** * Resolves lagged phase propagation from root if necessary . * Reconciliation normally occurs when root has advanced but * subphasers have not yet done so , in which case they must finish * their own advance by setting unarrived to parties ( or if * parties is zero , resetting to unregistered EMPTY state ) . * @ return reconciled state */ private long reconcileState ( ) { } }
final Phaser root = this . root ; long s = state ; if ( root != this ) { int phase , p ; // CAS to root phase with current parties , tripping unarrived while ( ( phase = ( int ) ( root . state >>> PHASE_SHIFT ) ) != ( int ) ( s >>> PHASE_SHIFT ) && ! U . compareAndSwapLong ( this , STATE , s , s = ( ( ( long ) phase << PHASE_SHIFT ) | ( ( phase < 0 ) ? ( s & COUNTS_MASK ) : ( ( ( p = ( int ) s >>> PARTIES_SHIFT ) == 0 ) ? EMPTY : ( ( s & PARTIES_MASK ) | p ) ) ) ) ) ) s = state ; } return s ;
public class WebFragmentTypeImpl { /** * If not already created , a new < code > pre - destroy < / code > element will be created and returned . * Otherwise , the first existing < code > pre - destroy < / code > element will be returned . * @ return the instance defined for the element < code > pre - destroy < / code > */ public LifecycleCallbackType < WebFragmentType < T > > getOrCreatePreDestroy ( ) { } }
List < Node > nodeList = childNode . get ( "pre-destroy" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new LifecycleCallbackTypeImpl < WebFragmentType < T > > ( this , "pre-destroy" , childNode , nodeList . get ( 0 ) ) ; } return createPreDestroy ( ) ;
public class FiducialDetectorPnP { /** * Create the list of observed points in 2D3D */ private void createDetectedList ( int which , List < PointIndex2D_F64 > pixels ) { } }
detected2D3D . clear ( ) ; List < Point2D3D > all = getControl3D ( which ) ; for ( int i = 0 ; i < pixels . size ( ) ; i ++ ) { PointIndex2D_F64 a = pixels . get ( i ) ; Point2D3D b = all . get ( i ) ; pixelToNorm . compute ( a . x , a . y , b . observation ) ; detected2D3D . add ( b ) ; }
public class StorableIndex { /** * Returns a StorableIndex instance which is clustered or not . */ public StorableIndex < S > clustered ( boolean clustered ) { } }
if ( clustered == mClustered ) { return this ; } return new StorableIndex < S > ( mProperties , mDirections , mUnique , clustered , false ) ;
public class CacheElement { private static final void auditNamedValues ( String m , Map < String , ? > namedValues ) { } }
if ( logger . isDebugEnabled ( ) ) { assert namedValues != null ; for ( Iterator < String > outer = namedValues . keySet ( ) . iterator ( ) ; outer . hasNext ( ) ; ) { Object name = outer . next ( ) ; assert name instanceof String : "not a string, name==" + name ; StringBuffer sb = new StringBuffer ( m + name + "==" ) ; Object temp = namedValues . get ( name ) ; assert temp instanceof String || temp instanceof Set : "neither string nor set, temp==" + temp ; if ( temp instanceof String ) { sb . append ( temp . toString ( ) ) ; } else if ( temp instanceof Set ) { @ SuppressWarnings ( "unchecked" ) Set < String > values = ( Set < String > ) temp ; sb . append ( "(" + values . size ( ) + ") {" ) ; String punct = "" ; for ( Iterator < String > it = values . iterator ( ) ; it . hasNext ( ) ; ) { String value = it . next ( ) ; sb . append ( punct + value ) ; punct = "," ; } sb . append ( "}" ) ; } logger . debug ( sb . toString ( ) ) ; } }
public class Option { /** * Returns the sub - text of the option . * @ return */ public String getSubtext ( ) { } }
String subtext = attrMixin . getAttribute ( SUBTEXT ) ; return subtext . isEmpty ( ) ? null : subtext ;
public class Classes { /** * Get class by name with checked exception . The same as { @ link # forName ( String ) } but throws checked exception in the * event requested class is not found . * @ param className requested class name , not null . * @ param < T > class to auto - cast named class . * @ return class identified by name . * @ throws ClassNotFoundException if class not found . * @ throws ClassCastException if found class cannot cast to requested auto - cast type . * @ throws NullPointerException if < code > className < / code > argument is null . */ @ SuppressWarnings ( "unchecked" ) public static < T > Class < T > forNameEx ( String className ) throws ClassNotFoundException , ClassCastException , NullPointerException { } }
ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; ClassNotFoundException classNotFoundException = null ; if ( loader != null ) { try { return ( Class < T > ) Class . forName ( className , true , loader ) ; } catch ( ClassNotFoundException expected ) { classNotFoundException = expected ; } } // try library class loader only if not the same as current thread context class loader , already tried if ( classNotFoundException != null && loader . equals ( Classes . class . getClassLoader ( ) ) ) { throw classNotFoundException ; } return ( Class < T > ) Class . forName ( className , true , Classes . class . getClassLoader ( ) ) ;
public class Animation { /** * Draw the animation * @ param x The x position to draw the animation at * @ param y The y position to draw the animation at * @ param width The width to draw the animation at * @ param height The height to draw the animation at * @ param col The colour for the flash */ public void drawFlash ( float x , float y , float width , float height , Color col ) { } }
if ( frames . size ( ) == 0 ) { return ; } if ( autoUpdate ) { long now = getTime ( ) ; long delta = now - lastUpdate ; if ( firstUpdate ) { delta = 0 ; firstUpdate = false ; } lastUpdate = now ; nextFrame ( delta ) ; } Frame frame = ( Frame ) frames . get ( currentFrame ) ; frame . image . drawFlash ( x , y , width , height , col ) ;
public class XString { /** * Cast result object to a result tree fragment . * @ param support Xpath context to use for the conversion * @ return A document fragment with this string as a child node */ public int rtf ( XPathContext support ) { } }
DTM frag = support . createDocumentFragment ( ) ; frag . appendTextChild ( str ( ) ) ; return frag . getDocument ( ) ;
public class FileTrainingCorpus { /** * there is exactly one document per line */ public void addDocument ( Document doc ) throws IOException { } }
// needs to differenciate SimpleDocuments from MultiField ones // each class has its own way of serializing String serial = doc . getStringSerialization ( ) ; raw_file_buffer . write ( serial ) ;
public class Query { /** * Resolves the projection used in this { @ link Query } by validating the { @ link List } of { @ literal selected } * { @ link Column Columns } against the { @ link Column Columns } contained in the { @ link View } . * @ param from { @ link View } to query . * @ return the { @ link List } of { @ link Column Columns } constituting the projection of this { @ link Query } . * @ throws IllegalArgumentException if the projection / selected { @ link Column Columns } are not contained * in the { @ link View } to query . * @ see org . cp . elements . data . struct . tabular . Column * @ see java . util . List * @ see # getProjection ( ) */ private List < Column > resolveProjection ( View from ) { } }
List < Column > projection = getProjection ( ) ; Assert . isTrue ( projection . stream ( ) . allMatch ( from :: contains ) , ( ) -> String . format ( "The View of Columns %1$s does not contain all the selected, or projected Columns %2$s" , from . columns ( ) , projection ) ) ; return projection ;
public class GetFacetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetFacetRequest getFacetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getFacetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getFacetRequest . getSchemaArn ( ) , SCHEMAARN_BINDING ) ; protocolMarshaller . marshall ( getFacetRequest . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CASableSimpleFileIOChannel { /** * { @ inheritDoc } */ @ Override public void write ( String propertyId , ValueData value , ChangedSizeHandler sizeHandler ) throws IOException { } }
CASableWriteValue o = new CASableWriteValue ( value , resources , cleaner , tempDir , propertyId , vcas , cas , sizeHandler ) ; o . execute ( ) ; changes . add ( o ) ;
public class SMailHonestPostie { protected Address verifyFilteredFromAddress ( CardView view , Address filteredFrom ) { } }
if ( filteredFrom == null ) { String msg = "The filtered from-address should not be null: postcard=" + view ; throw new SMailIllegalStateException ( msg ) ; } return filteredFrom ;
public class ClusterConfigurationsInner { /** * Set the configuration object for the specified configuration for the specified cluster . * @ param configurations the configurations value to set * @ return the ClusterConfigurationsInner object itself . */ public ClusterConfigurationsInner withConfigurations ( Map < String , Map < String , String > > configurations ) { } }
this . configurations = configurations ; return this ;
public class TRNImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . TRN__TRNDATA : setTRNDATA ( TRNDATA_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class ServerAzureADAdministratorsInner { /** * Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param properties The required parameters for creating or updating an Active Directory Administrator . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ServerAzureADAdministratorInner object */ public Observable < ServerAzureADAdministratorInner > beginCreateOrUpdateAsync ( String resourceGroupName , String serverName , ServerAzureADAdministratorInner properties ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , properties ) . map ( new Func1 < ServiceResponse < ServerAzureADAdministratorInner > , ServerAzureADAdministratorInner > ( ) { @ Override public ServerAzureADAdministratorInner call ( ServiceResponse < ServerAzureADAdministratorInner > response ) { return response . body ( ) ; } } ) ;
public class FaultMgr { public void constructFault ( FaultException faultException , Object argument ) { } }
// check argument if ( argument != null && faultException . getArgument ( ) == null ) faultException . setArgument ( argument ) ; StackTraceElement stackTraceElement = null ; if ( faultException . getModule ( ) == null ) { if ( this . defaultModule != null && this . defaultModule . length ( ) > 0 ) faultException . setModule ( defaultModule ) ; else { stackTraceElement = determineCauseStackTraceElementsn ( faultException ) ; if ( stackTraceElement != null ) faultException . setModule ( stackTraceElement . getFileName ( ) ) ; } } if ( faultException . getOperation ( ) == null ) { if ( this . defaultOperation != null && this . defaultOperation . length ( ) > 0 ) faultException . setOperation ( this . defaultOperation ) ; else { if ( stackTraceElement == null ) stackTraceElement = determineCauseStackTraceElementsn ( faultException ) ; if ( stackTraceElement != null ) faultException . setOperation ( stackTraceElement . getMethodName ( ) ) ; // add line number if ( ( faultException . getNotes ( ) == null || faultException . getNotes ( ) . length ( ) == 0 ) && stackTraceElement != null ) { faultException . setNotes ( lineNumberNotePrefix + stackTraceElement . getLineNumber ( ) ) ; } } }
public class InstanceFailoverGroupsInner { /** * Creates or updates a failover group . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param locationName The name of the region where the resource is located . * @ param failoverGroupName The name of the failover group . * @ param parameters The failover group parameters . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the InstanceFailoverGroupInner object */ public Observable < InstanceFailoverGroupInner > beginCreateOrUpdateAsync ( String resourceGroupName , String locationName , String failoverGroupName , InstanceFailoverGroupInner parameters ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , locationName , failoverGroupName , parameters ) . map ( new Func1 < ServiceResponse < InstanceFailoverGroupInner > , InstanceFailoverGroupInner > ( ) { @ Override public InstanceFailoverGroupInner call ( ServiceResponse < InstanceFailoverGroupInner > response ) { return response . body ( ) ; } } ) ;
public class Dataframe { /** * Updates the meta data of the Dataframe using the provided Record . * The Meta - data include the supported columns and their DataTypes . * @ param r */ private void updateMeta ( Record r ) { } }
for ( Map . Entry < Object , Object > entry : r . getX ( ) . entrySet ( ) ) { Object column = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( value != null ) { data . xDataTypes . putIfAbsent ( column , TypeInference . getDataType ( value ) ) ; } } if ( data . yDataType == null ) { Object value = r . getY ( ) ; if ( value != null ) { data . yDataType = TypeInference . getDataType ( r . getY ( ) ) ; } }
public class DTMNodeList { /** * Returns the < code > index < / code > th item in the collection . If * < code > index < / code > is greater than or equal to the number of nodes in * the list , this returns < code > null < / code > . * @ param index Index into the collection . * @ return The node at the < code > index < / code > th position in the * < code > NodeList < / code > , or < code > null < / code > if that is not a valid * index . */ public Node item ( int index ) { } }
if ( m_iter != null ) { int handle = m_iter . item ( index ) ; if ( handle == DTM . NULL ) { return null ; } return m_iter . getDTM ( handle ) . getNode ( handle ) ; } else { return null ; }
public class JaxRsFactoryImplicitBeanCDICustomizer { /** * ( non - Javadoc ) * @ see com . ibm . ws . jaxrs20 . api . JaxRsFactoryBeanCustomizer # afterServiceInvoke ( java . lang . Object , boolean , java . lang . Object ) */ @ Override public void afterServiceInvoke ( Object serviceObject , boolean isSingleton , Object context ) { } }
@ SuppressWarnings ( "unchecked" ) Map < Class < ? > , ManagedObject < ? > > newContext = ( Map < Class < ? > , ManagedObject < ? > > ) ( context ) ; ManagedObject < ? > mo = newContext . get ( serviceObject . getClass ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "afterServiceInvoke mo=" + mo + " isSingleton=" + isSingleton + " newContext={0}" , newContext ) ; } if ( ! isSingleton ) { if ( mo != null ) { mo . release ( ) ; } newContext . put ( serviceObject . getClass ( ) , null ) ; }
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getTextOrientation ( ) { } }
if ( textOrientationEClass == null ) { textOrientationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 376 ) ; } return textOrientationEClass ;
public class GeoQuery { /** * Sets the center and radius ( in kilometers ) of this query , and triggers new events if necessary . * @ param center The new center * @ param radius The radius of the query , in kilometers . The maximum radius that is * supported is about 8587km . If a radius bigger than this is passed we ' ll cap it . */ public synchronized void setLocation ( GeoLocation center , double radius ) { } }
this . center = center ; // convert radius to meters this . radius = capRadius ( radius ) * KILOMETER_TO_METER ; if ( this . hasListeners ( ) ) { this . setupQueries ( ) ; }
public class SourceNameResolver { /** * Return the id of the resource pointed by the url without extension * E . g . http : / / example . com / resource . tar return resource * @ param url * @ return */ public static String getIdOfTarballFromUrl ( String url ) { } }
String nameOfTarballResource = getTarballResourceNameFromUrl ( url ) ; return nameOfTarballResource . substring ( 0 , nameOfTarballResource . lastIndexOf ( "." ) ) ;
public class ValidationConfigurator { /** * Internal method to set up the object ' s data */ private void setupData ( ValidationConfig config , ClassLoader classLoader ) { } }
// A config object is always used to use a common code path , so the parsed // ValidationConfig may be null if a validation . xml wasn ' t found . if ( config != null ) { versionID = config . getVersionID ( ) ; defaultProvider = config . getDefaultProvider ( ) ; defaultProvider = defaultProvider != null ? defaultProvider . trim ( ) : defaultProvider ; messageInterpolator = config . getMessageInterpolator ( ) ; messageInterpolator = messageInterpolator != null ? messageInterpolator . trim ( ) : messageInterpolator ; traversableResolver = config . getTraversableResolver ( ) ; traversableResolver = traversableResolver != null ? traversableResolver . trim ( ) : traversableResolver ; constraintMapping = config . getConstraintMappings ( ) ; constraintValidatorFactory = config . getConstraintValidatorFactory ( ) ; constraintValidatorFactory = constraintValidatorFactory != null ? constraintValidatorFactory . trim ( ) : constraintValidatorFactory ; properties = config . getProperties ( ) ; } appClassloader = classLoader ;
public class AbstractColorPickerPreference { /** * Obtains the background of the preview of the preference ' s color from a specific typed array . * @ param typedArray * The typed array , the background should be obtained from , as an instance of the class * { @ link TypedArray } . The typed array may not be null */ private void obtainPreviewBackground ( @ NonNull final TypedArray typedArray ) { } }
int backgroundColor = typedArray . getColor ( R . styleable . AbstractColorPickerPreference_previewBackground , - 1 ) ; if ( backgroundColor != - 1 ) { setPreviewBackgroundColor ( backgroundColor ) ; } else { int resourceId = typedArray . getResourceId ( R . styleable . AbstractColorPickerPreference_previewBackground , R . drawable . color_picker_default_preview_background ) ; setPreviewBackground ( ContextCompat . getDrawable ( getContext ( ) , resourceId ) ) ; }
public class PHPDriver { /** * < p > close . < / p > * @ throws java . io . IOException if any . */ public void close ( ) throws IOException { } }
out . close ( ) ; in . close ( ) ; if ( server != null ) { server . close ( ) ; } if ( client != null ) { client . close ( ) ; }
public class CDIContainerImpl { /** * Create BDAs for either the EJB , Web or Client modules and any libraries they reference on their classpath . */ private void processModules ( WebSphereCDIDeployment applicationContext , DiscoveredBdas discoveredBdas , Collection < CDIArchive > moduleArchives ) throws CDIException { } }
List < WebSphereBeanDeploymentArchive > moduleBDAs = new ArrayList < WebSphereBeanDeploymentArchive > ( ) ; for ( CDIArchive archive : moduleArchives ) { if ( cdiRuntime . isClientProcess ( ) ) { // when on a client process , we only process client modules and ignore the others if ( ArchiveType . CLIENT_MODULE != archive . getType ( ) ) { continue ; } } else { // when on a server process , we do not process client modules , just the others if ( ArchiveType . CLIENT_MODULE == archive . getType ( ) ) { continue ; } } // if the app is not an EAR then there should be only one module and we can just use it ' s classloader if ( applicationContext . getClassLoader ( ) == null ) { applicationContext . setClassLoader ( archive . getClassLoader ( ) ) ; } String archiveID = archive . getJ2EEName ( ) . toString ( ) ; // we need to work our whether to create a bda or not if ( cdiRuntime . skipCreatingBda ( archive ) ) { continue ; } WebSphereBeanDeploymentArchive moduleBda = BDAFactory . createBDA ( applicationContext , archiveID , archive , cdiRuntime ) ; discoveredBdas . addDiscoveredBda ( archive . getType ( ) , moduleBda ) ; moduleBDAs . add ( moduleBda ) ; } // Having processed all the modules , we now process their libraries // We do it in this order in case one of the modules references another of the same type as a library for ( WebSphereBeanDeploymentArchive bda : moduleBDAs ) { processModuleLibraries ( bda , discoveredBdas ) ; }
public class GpioControllerImpl { /** * This method can be called to forcefully shutdown all GPIO controller * monitoring , listening , and task threads / executors . */ @ Override public synchronized void shutdown ( ) { } }
// prevent reentrant invocation if ( isShutdown ( ) ) return ; // create a temporary set of providers to shutdown after completing all the pin instance shutdowns Set < GpioProvider > gpioProvidersToShutdown = new HashSet < > ( ) ; // shutdown explicit configured GPIO pins for ( GpioPin pin : pins ) { // add each GPIO provider to the shutdown set if ( ! gpioProvidersToShutdown . contains ( pin . getProvider ( ) ) ) { gpioProvidersToShutdown . add ( pin . getProvider ( ) ) ; } // perform the shutdown options if configured for the pin GpioPinShutdown shutdownOptions = pin . getShutdownOptions ( ) ; if ( shutdownOptions != null ) { // get shutdown option configuration PinState state = shutdownOptions . getState ( ) ; PinMode mode = shutdownOptions . getMode ( ) ; PinPullResistance resistance = shutdownOptions . getPullResistor ( ) ; Boolean unexport = shutdownOptions . getUnexport ( ) ; // perform shutdown actions if ( ( state != null ) && pin . isMode ( PinMode . DIGITAL_OUTPUT ) ) { ( ( GpioPinDigitalOutput ) pin ) . setState ( state ) ; } if ( resistance != null ) { pin . setPullResistance ( resistance ) ; } if ( mode != null ) { pin . setMode ( mode ) ; } if ( unexport != null && unexport == Boolean . TRUE ) { pin . unexport ( ) ; } } } // perform a shutdown on each GPIO provider for ( GpioProvider gpioProvider : gpioProvidersToShutdown ) { if ( ! gpioProvider . isShutdown ( ) ) { gpioProvider . shutdown ( ) ; } } // shutdown all executor services // NOTE : we are not permitted to access the shutdown ( ) method of the individual // executor services , we must perform the shutdown with the factory GpioFactory . getExecutorServiceFactory ( ) . shutdown ( ) ; // set is shutdown tracking variable isshutdown = true ;
public class SegmentedJournal { /** * Loads a segment . */ private JournalSegment < E > loadSegment ( long segmentId ) { } }
File segmentFile = JournalSegmentFile . createSegmentFile ( name , directory , segmentId ) ; ByteBuffer buffer = ByteBuffer . allocate ( JournalSegmentDescriptor . BYTES ) ; try ( FileChannel channel = openChannel ( segmentFile ) ) { channel . read ( buffer ) ; buffer . flip ( ) ; JournalSegmentDescriptor descriptor = new JournalSegmentDescriptor ( buffer ) ; JournalSegment < E > segment = newSegment ( new JournalSegmentFile ( segmentFile ) , descriptor ) ; log . debug ( "Loaded disk segment: {} ({})" , descriptor . id ( ) , segmentFile . getName ( ) ) ; return segment ; } catch ( IOException e ) { throw new StorageException ( e ) ; }
public class XidParticipant { public synchronized void addWork ( WorkItem item ) throws ProtocolException , TransactionException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addWork" , "WorkItem=" + item ) ; // Check the current transaction state ( use state lock to ensure we see the latest value ) synchronized ( _stateLock ) { if ( ( _state != TransactionState . STATE_ACTIVE ) && ! _indoubt ) { ProtocolException pe = new ProtocolException ( "TRAN_PROTOCOL_ERROR_SIMS1001" , new Object [ ] { } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot add work to transaction. Transaction is complete or completing!" , pe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addWork" ) ; throw pe ; } } if ( _workList == null ) { _workList = new TaskList ( ) ; } if ( item != null ) { _workList . addWork ( item ) ; } else { ProtocolException pe = new ProtocolException ( "TRAN_PROTOCOL_ERROR_SIMS1001" , new Object [ ] { } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot add null work item to transaction!" , pe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addWork" ) ; throw pe ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addWork" ) ;
public class Vector4i { /** * Set all components to zero . * @ return a vector holding the result */ public Vector4i zero ( ) { } }
Vector4i dest = thisOrNew ( ) ; MemUtil . INSTANCE . zero ( dest ) ; return dest ;
public class MessageFormat { /** * Format the current stream , with the optional substitution argument , replacing ' # ' . */ private void format ( Stream outer , String arg ) { } }
// Iterate over text and tags , alternately . int prev = outer . pos ; int length = outer . end ; int next = - 1 ; // Anchor to the starting ' { ' . while ( ( next = outer . find ( '{' ) ) != - 1 ) { // Emit characters before the tag ' s opening ' { ' if ( next > prev ) { emit ( prev , next , arg ) ; prev = next ; } // Locate a tag ' s bounds and evaluate it . Otherwise return , since we ' ve // found a possibly incomplete tag and cannot correctly recover . if ( outer . seekBounds ( tag , '{' , '}' ) ) { prev = tag . end ; evaluateTag ( buf ) ; } else { return ; } } // Copy the remaining trailing characters , if any . if ( prev < length ) { emit ( prev , length , arg ) ; }
public class XData { /** * actually serializes the data * @ param marshallerMap * @ param dOut * @ param primaryNode * @ param progressListener * @ throws IOException */ private static void serialize ( Map < String , AbstractDataMarshaller < ? > > marshallerMap , DataOutputStream dOut , DataNode primaryNode , boolean ignoreMissingMarshallers , ProgressListener progressListener ) throws IOException { } }
// a map containing all serialized objects . This is used // to make sure that we store each deSerializedObject only once . final Map < SerializedObject , SerializedObject > serializedObjects = new HashMap < > ( ) ; final Deque < SerializationFrame > stack = new LinkedList < > ( ) ; final DataNodeSerializationFrame primaryDataNodeFrame = new DataNodeSerializationFrame ( null , primaryNode ) ; progressListener . onTotalSteps ( primaryDataNodeFrame . entries . size ( ) ) ; stack . add ( primaryDataNodeFrame ) ; final SerializedObject testSerializedObject = new SerializedObject ( ) ; while ( ! stack . isEmpty ( ) ) { final SerializationFrame frame = stack . peek ( ) ; // writes the header for that frame ( if needed ) frame . writeHeader ( dOut ) ; if ( frame . hasNext ( ) ) { while ( frame . hasNext ( ) ) { if ( frame . next ( stack , dOut , marshallerMap , serializedObjects , testSerializedObject , ignoreMissingMarshallers ) ) { if ( frame == primaryDataNodeFrame ) { progressListener . onStep ( ) ; } break ; } if ( frame == primaryDataNodeFrame ) { progressListener . onStep ( ) ; } } } else { stack . pop ( ) ; // remember serialized deSerializedObject ' s addresses if ( frame instanceof DataNodeSerializationFrame ) { DataNodeSerializationFrame dataNodeFrame = ( DataNodeSerializationFrame ) frame ; SerializedObject newSerializedObject = new SerializedObject ( ) ; newSerializedObject . object = frame . object ; newSerializedObject . positionInStream = dataNodeFrame . positionInStream ; serializedObjects . put ( newSerializedObject , newSerializedObject ) ; } } }
public class AWSDeviceFarmClient { /** * Gets information about uploads , given an AWS Device Farm project ARN . * @ param listUploadsRequest * Represents a request to the list uploads operation . * @ return Result of the ListUploads operation returned by the service . * @ throws ArgumentException * An invalid argument was specified . * @ throws NotFoundException * The specified entity was not found . * @ throws LimitExceededException * A limit was exceeded . * @ throws ServiceAccountException * There was a problem with the service account . * @ sample AWSDeviceFarm . ListUploads * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / devicefarm - 2015-06-23 / ListUploads " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ListUploadsResult listUploads ( ListUploadsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListUploads ( request ) ;
public class EntityInfo { /** * 根据主键值获取Entity的表名 * @ param primary Entity主键值 * @ return String */ public String getTable ( Serializable primary ) { } }
if ( tableStrategy == null ) return table ; String t = tableStrategy . getTable ( table , primary ) ; return t == null || t . isEmpty ( ) ? table : t ;
public class SimpleDateFormat { /** * Applies the given localized pattern string to this date format . * @ param pattern a String to be mapped to the new date and time format * pattern for this format * @ exception NullPointerException if the given pattern is null * @ exception IllegalArgumentException if the given pattern is invalid */ public void applyLocalizedPattern ( String pattern ) { } }
String p = translatePattern ( pattern , formatData . getLocalPatternChars ( ) , DateFormatSymbols . patternChars ) ; compiledPattern = compile ( p ) ; this . pattern = p ;
public class ApiModule { /** * Changing endpoint */ public void changeEndpoint ( String endpoint ) throws ConnectionEndpointArray . UnknownSchemeException { } }
changeEndpoints ( new Endpoints ( new ConnectionEndpointArray ( ) . addEndpoint ( endpoint ) . toArray ( new ConnectionEndpoint [ 1 ] ) , new TrustedKey [ 0 ] ) ) ;
public class FbBotMillMockMediator { /** * Utility method that instantiates a { @ link BotDefinition } class . * @ param klass * the class to instantiate . * @ return a { @ link BotDefinition } . */ private static BotDefinition instantiateClass ( Class < ? extends BotDefinition > klass ) { } }
BotDefinition definition = null ; try { definition = klass . newInstance ( ) ; } catch ( InstantiationException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } return definition ;
public class CmsPreferences { /** * Builds the html for the editor button style select box . < p > * @ param htmlAttributes optional html attributes for the & lgt ; select & gt ; tag * @ return the html for the editor button style select box */ public String buildSelectEditorButtonStyle ( String htmlAttributes ) { } }
int selectedIndex = Integer . parseInt ( getParamTabEdButtonStyle ( ) ) ; return buildSelectButtonStyle ( htmlAttributes , selectedIndex ) ;
public class OccupantDirector { /** * Returns the occupant info for the user in question if it exists in * the currently occupied place . Returns null if no occupant info * exists for the specified body . */ public OccupantInfo getOccupantInfo ( int bodyOid ) { } }
// make sure we ' re somewhere return ( _place == null ) ? null : _place . occupantInfo . get ( Integer . valueOf ( bodyOid ) ) ;
public class HttpBalancerService { /** * Converts a collection of WS URIs to their equivalent WSN balancer URIs . * @ param uris * the URIs to convert * @ return the converted URIs * @ throws Exception */ private static Collection < String > toWsBalancerURIs ( Collection < String > uris , AcceptOptionsContext acceptOptionsCtx , TransportFactory transportFactory ) throws Exception { } }
List < String > httpURIs = new ArrayList < > ( uris . size ( ) ) ; for ( String uri : uris ) { String schemeFromAcceptURI = uri . substring ( 0 , uri . indexOf ( ':' ) ) ; Protocol protocol = transportFactory . getProtocol ( schemeFromAcceptURI ) ; if ( WsProtocol . WS . equals ( protocol ) || WsProtocol . WSS . equals ( protocol ) ) { for ( String scheme : Arrays . asList ( "wsn" , "wsx" ) ) { boolean secure = protocol . isSecure ( ) ; String wsBalancerUriScheme = secure ? scheme + "+ssl" : scheme ; String httpAuthority = getAuthority ( uri ) ; String httpPath = getPath ( uri ) ; String httpQuery = getQuery ( uri ) ; httpURIs . add ( buildURIAsString ( wsBalancerUriScheme , httpAuthority , httpPath , httpQuery , null ) ) ; // ensure that the accept - options is updated with bindings if they exist for ws and / or wss // so that the Gateway binds to the correct host : port as per the service configuration . String internalURI = acceptOptionsCtx . getInternalURI ( uri ) ; if ( ( internalURI != null ) && ! internalURI . equals ( uri ) ) { String authority = getAuthority ( internalURI ) ; acceptOptionsCtx . addBind ( wsBalancerUriScheme , authority ) ; } } } } return httpURIs ;
public class DefaultGroovyMethods { /** * Create a List composed of the elements of this Iterable , repeated * a certain number of times . Note that for non - primitive * elements , multiple references to the same instance will be added . * < pre class = " groovyTestCase " > assert [ 1,2,3,1,2,3 ] = = [ 1,2,3 ] * 2 < / pre > * Note : if the Iterable happens to not support duplicates , e . g . a Set , then the * method will effectively return a Collection with a single copy of the Iterable ' s items . * @ param self a List * @ param factor the number of times to append * @ return the multiplied List * @ since 2.4.0 */ public static < T > List < T > multiply ( List < T > self , Number factor ) { } }
return ( List < T > ) multiply ( ( Iterable < T > ) self , factor ) ;
public class RadialBargraph { /** * < editor - fold defaultstate = " collapsed " desc = " Visualization " > */ @ Override protected void paintComponent ( Graphics g ) { } }
if ( ! isInitialized ( ) ) { return ; } final Graphics2D G2 = ( Graphics2D ) g . create ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; G2 . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; G2 . setRenderingHint ( RenderingHints . KEY_STROKE_CONTROL , RenderingHints . VALUE_STROKE_NORMALIZE ) ; G2 . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; // Translate coordinate system related to insets G2 . translate ( getFramelessOffset ( ) . getX ( ) , getFramelessOffset ( ) . getY ( ) ) ; // Draw combined background image G2 . drawImage ( bImage , 0 , 0 , null ) ; // Draw an Arc2d object that will visualize the range of measured values if ( isRangeOfMeasuredValuesVisible ( ) ) { G2 . setPaint ( getModel ( ) . getRangeOfMeasuredValuesPaint ( ) ) ; if ( getGaugeType ( ) == GaugeType . TYPE3 || getGaugeType ( ) == GaugeType . TYPE4 ) { final Area area = new Area ( getModel ( ) . getRadialShapeOfMeasuredValues ( ) ) ; area . subtract ( new Area ( LCD ) ) ; G2 . fill ( area ) ; } else { G2 . fill ( getModel ( ) . getRadialShapeOfMeasuredValues ( ) ) ; } } // Draw LED if enabled if ( isLedVisible ( ) ) { G2 . drawImage ( getCurrentLedImage ( ) , ( int ) ( getGaugeBounds ( ) . width * getLedPosition ( ) . getX ( ) ) , ( int ) ( getGaugeBounds ( ) . height * getLedPosition ( ) . getY ( ) ) , null ) ; } // Draw user LED if enabled if ( isUserLedVisible ( ) ) { G2 . drawImage ( getCurrentUserLedImage ( ) , ( int ) ( getGaugeBounds ( ) . width * getUserLedPosition ( ) . getX ( ) ) , ( int ) ( getGaugeBounds ( ) . height * getUserLedPosition ( ) . getY ( ) ) , null ) ; } // Draw LCD display if ( isLcdVisible ( ) ) { if ( getLcdColor ( ) == LcdColor . CUSTOM ) { G2 . setColor ( getCustomLcdForeground ( ) ) ; } else { G2 . setColor ( getLcdColor ( ) . TEXT_COLOR ) ; } G2 . setFont ( getLcdUnitFont ( ) ) ; if ( isLcdTextVisible ( ) ) { final double UNIT_STRING_WIDTH ; if ( isLcdUnitStringVisible ( ) ) { unitLayout = new TextLayout ( getLcdUnitString ( ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; UNIT_BOUNDARY . setFrame ( unitLayout . getBounds ( ) ) ; G2 . drawString ( getLcdUnitString ( ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.03 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; UNIT_STRING_WIDTH = UNIT_BOUNDARY . getWidth ( ) ; } else { UNIT_STRING_WIDTH = 0 ; } G2 . setFont ( getLcdValueFont ( ) ) ; switch ( getModel ( ) . getNumberSystem ( ) ) { case HEX : valueLayout = new TextLayout ( Integer . toHexString ( ( int ) getLcdValue ( ) ) . toUpperCase ( ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; VALUE_BOUNDARY . setFrame ( valueLayout . getBounds ( ) ) ; G2 . drawString ( Integer . toHexString ( ( int ) getLcdValue ( ) ) . toUpperCase ( ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_STRING_WIDTH - VALUE_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.09 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; break ; case OCT : valueLayout = new TextLayout ( Integer . toOctalString ( ( int ) getLcdValue ( ) ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; VALUE_BOUNDARY . setFrame ( valueLayout . getBounds ( ) ) ; G2 . drawString ( Integer . toOctalString ( ( int ) getLcdValue ( ) ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_STRING_WIDTH - VALUE_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.09 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; break ; case DEC : default : valueLayout = new TextLayout ( formatLcdValue ( getLcdValue ( ) ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; VALUE_BOUNDARY . setFrame ( valueLayout . getBounds ( ) ) ; G2 . drawString ( formatLcdValue ( getLcdValue ( ) ) , ( int ) ( LCD . getX ( ) + ( LCD . getWidth ( ) - UNIT_STRING_WIDTH - VALUE_BOUNDARY . getWidth ( ) ) - LCD . getWidth ( ) * 0.09 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) * 0.76 ) ) ; break ; } } // Draw lcd info string if ( ! getLcdInfoString ( ) . isEmpty ( ) ) { G2 . setFont ( getLcdInfoFont ( ) ) ; infoLayout = new TextLayout ( getLcdInfoString ( ) , G2 . getFont ( ) , RENDER_CONTEXT ) ; INFO_BOUNDARY . setFrame ( infoLayout . getBounds ( ) ) ; G2 . drawString ( getLcdInfoString ( ) , LCD . getBounds ( ) . x + 5 , LCD . getBounds ( ) . y + ( int ) INFO_BOUNDARY . getHeight ( ) + 5 ) ; } // Draw lcd threshold indicator if ( getLcdNumberSystem ( ) == NumberSystem . DEC && isLcdThresholdVisible ( ) && getLcdValue ( ) >= getLcdThreshold ( ) ) { G2 . drawImage ( lcdThresholdImage , ( int ) ( LCD . getX ( ) + LCD . getHeight ( ) * 0.0568181818 ) , ( int ) ( LCD . getY ( ) + LCD . getHeight ( ) - lcdThresholdImage . getHeight ( ) - LCD . getHeight ( ) * 0.0568181818 ) , null ) ; } } // Draw the active leds in dependence on the current value final AffineTransform OLD_TRANSFORM = G2 . getTransform ( ) ; final double ACTIVE_LED_ANGLE ; if ( ! isLogScale ( ) ) { ACTIVE_LED_ANGLE = getAngleForValue ( getValue ( ) ) ; } else { ACTIVE_LED_ANGLE = Math . toDegrees ( UTIL . logOfBase ( BASE , getValue ( ) - getMinValue ( ) ) * getLogAngleStep ( ) ) ; } if ( ! getModel ( ) . isSingleLedBargraphEnabled ( ) ) { for ( double angle = 0 ; Double . compare ( angle , ACTIVE_LED_ANGLE ) <= 0 ; angle += 5.0 ) { G2 . rotate ( Math . toRadians ( angle + getModel ( ) . getBargraphOffset ( ) ) , CENTER . getX ( ) , CENTER . getY ( ) ) ; // If sections visible , color the bargraph with the given section colors G2 . setPaint ( ledGradient ) ; if ( isSectionsVisible ( ) ) { // Use defined bargraphColor in areas where no section is defined for ( Section section : getSections ( ) ) { if ( Double . compare ( angle , sectionAngles . get ( section ) . getX ( ) ) >= 0 && angle < sectionAngles . get ( section ) . getY ( ) ) { G2 . setPaint ( sectionGradients . get ( section ) ) ; break ; } } } else { G2 . setPaint ( ledGradient ) ; } G2 . fill ( led ) ; G2 . setTransform ( OLD_TRANSFORM ) ; } } else { // Draw only one led instead of all active leds final double ANGLE = Math . toRadians ( ( ( getValue ( ) - getMinValue ( ) ) / ( getMaxValue ( ) - getMinValue ( ) ) ) * getModel ( ) . getApexAngle ( ) ) ; G2 . rotate ( ANGLE , CENTER . getX ( ) , CENTER . getY ( ) ) ; if ( isSectionsVisible ( ) ) { for ( Section section : getSections ( ) ) { if ( Double . compare ( ANGLE , sectionAngles . get ( section ) . getX ( ) ) >= 0 && ANGLE < sectionAngles . get ( section ) . getY ( ) ) { G2 . setPaint ( sectionGradients . get ( section ) ) ; break ; } } } else { G2 . setPaint ( ledGradient ) ; } G2 . fill ( led ) ; G2 . setTransform ( OLD_TRANSFORM ) ; } // Draw peak value if enabled if ( isPeakValueEnabled ( ) && isPeakValueVisible ( ) ) { G2 . rotate ( Math . toRadians ( ( ( getPeakValue ( ) - getMinValue ( ) ) / ( getMaxValue ( ) - getMinValue ( ) ) ) * getModel ( ) . getApexAngle ( ) + getModel ( ) . getBargraphOffset ( ) ) , CENTER . getX ( ) , CENTER . getY ( ) ) ; G2 . fill ( led ) ; G2 . setTransform ( OLD_TRANSFORM ) ; } // Draw the foreground if ( isForegroundVisible ( ) ) { G2 . drawImage ( fImage , 0 , 0 , null ) ; } // Draw glow indicator if ( isGlowVisible ( ) ) { if ( isGlowing ( ) ) { G2 . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC_OVER , getGlowAlpha ( ) ) ) ; G2 . drawImage ( glowImageOn , 0 , 0 , null ) ; G2 . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC_OVER , 1f ) ) ; } else { G2 . drawImage ( glowImageOff , 0 , 0 , null ) ; } } if ( ! isEnabled ( ) ) { G2 . drawImage ( disabledImage , 0 , 0 , null ) ; } G2 . dispose ( ) ;
public class TransactionLogger { /** * Pause component timer for current instance * @ param type - of component */ public static void pauseTimer ( final String type ) { } }
TransactionLogger instance = getInstance ( ) ; if ( instance == null ) { return ; } instance . components . get ( type ) . pauseTimer ( ) ;
public class ExpressRouteCircuitAuthorizationsInner { /** * Creates or updates an authorization in the specified express route circuit . * @ param resourceGroupName The name of the resource group . * @ param circuitName The name of the express route circuit . * @ param authorizationName The name of the authorization . * @ param authorizationParameters Parameters supplied to the create or update express route circuit authorization operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ExpressRouteCircuitAuthorizationInner object if successful . */ public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate ( String resourceGroupName , String circuitName , String authorizationName , ExpressRouteCircuitAuthorizationInner authorizationParameters ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , circuitName , authorizationName , authorizationParameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class NavMeshQuery { /** * / @ returns The status flags for the query . */ public Result < FindNearestPolyResult > findNearestPoly ( float [ ] center , float [ ] halfExtents , QueryFilter filter ) { } }
float [ ] nearestPt = new float [ ] { center [ 0 ] , center [ 1 ] , center [ 2 ] } ; // Get nearby polygons from proximity grid . Result < List < Long > > polysResult = queryPolygons ( center , halfExtents , filter ) ; if ( polysResult . failed ( ) ) { return Result . of ( polysResult . status , polysResult . message ) ; } List < Long > polys = polysResult . result ; // Find nearest polygon amongst the nearby polygons . long nearest = 0 ; float nearestDistanceSqr = Float . MAX_VALUE ; for ( int i = 0 ; i < polys . size ( ) ; ++ i ) { long ref = polys . get ( i ) ; Result < ClosestPointOnPolyResult > closest = closestPointOnPoly ( ref , center ) ; boolean posOverPoly = closest . result . isPosOverPoly ( ) ; float [ ] closestPtPoly = closest . result . getClosest ( ) ; // If a point is directly over a polygon and closer than // climb height , favor that instead of straight line nearest point . float d = 0 ; float [ ] diff = vSub ( center , closestPtPoly ) ; if ( posOverPoly ) { Tupple2 < MeshTile , Poly > tilaAndPoly = m_nav . getTileAndPolyByRefUnsafe ( polys . get ( i ) ) ; MeshTile tile = tilaAndPoly . first ; d = Math . abs ( diff [ 1 ] ) - tile . data . header . walkableClimb ; d = d > 0 ? d * d : 0 ; } else { d = vLenSqr ( diff ) ; } if ( d < nearestDistanceSqr ) { nearestPt = closestPtPoly ; nearestDistanceSqr = d ; nearest = ref ; } } return Result . success ( new FindNearestPolyResult ( nearest , nearestPt ) ) ;
public class BasicTagList { /** * Returns a tag list containing the union of { @ code t1 } and { @ code t2 } . * If there is a conflict with tag keys , the tag from { @ code t2 } will be * used . */ public static BasicTagList concat ( TagList t1 , TagList t2 ) { } }
return new BasicTagList ( Iterables . concat ( t1 , t2 ) ) ;
public class Functions { /** * A { @ code Function } that always ignores its argument and throws an { @ link AssertionError } . * @ return a { @ code Function } that always ignores its argument and throws an { @ code * AssertionError } . * @ since 0.6 */ public static < T > Function < Object , T > throwAssertionError ( ) { } }
// It is safe to cast this function to have any return type , since it never returns a result . @ SuppressWarnings ( "unchecked" ) Function < Object , T > function = ( Function < Object , T > ) THROW_ASSERTION_ERROR ; return function ;
public class DSUtil { /** * Similar to < code > mapColl < / code > , but filters out all * < code > null < / code > elements produced by < code > func < / code > . * @ see # mapColl ( Iterable , Function , Collection ) */ public static < E1 , E2 > Collection < E2 > mapColl2 ( Iterable < E1 > coll , Function < E1 , E2 > func , Collection < E2 > newColl ) { } }
for ( E1 elem : coll ) { E2 img = func . f ( elem ) ; if ( img != null ) newColl . add ( img ) ; } return newColl ;
public class SerializationChecker { /** * Adapted from { @ link java . io . ObjectStreamClass # computeDefaultSUID ( java . lang . Class ) } method . */ public static long computeSerialVersionUID ( TypeElement type , TypeEnvironment environment ) { } }
TypeElement javaIoSerializable = environment . getElementUtils ( ) . getTypeElement ( "java.io.Serializable" ) ; if ( ! environment . getTypeUtils ( ) . isAssignable ( type . asType ( ) , javaIoSerializable . asType ( ) ) ) { return 0L ; } // if ( ! Serializable . class . isAssignableFrom ( cl ) | | Proxy . isProxyClass ( cl ) ) // return 0L ; try { ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; DataOutputStream dout = new DataOutputStream ( bout ) ; dout . writeUTF ( type . getQualifiedName ( ) . toString ( ) ) ; int classMods = asReflectiveModifiers ( type , Modifier . PUBLIC , Modifier . FINAL , Modifier . ABSTRACT ) ; if ( type . getKind ( ) == ElementKind . INTERFACE ) { classMods |= java . lang . reflect . Modifier . INTERFACE ; } // int classMods = cl . getModifiers ( ) & // ( java . lang . reflect . Modifier . PUBLIC | java . lang . reflect . Modifier . FINAL | // java . lang . reflect . Modifier . INTERFACE | java . lang . reflect . Modifier . ABSTRACT ) ; /* * compensate for javac bug in which ABSTRACT bit was set for an * interface only if the interface declared methods */ if ( type . getKind ( ) == ElementKind . INTERFACE ) { if ( ElementFilter . methodsIn ( type . getEnclosedElements ( ) ) . size ( ) > 0 ) { classMods |= java . lang . reflect . Modifier . ABSTRACT ; } else { classMods &= ~ java . lang . reflect . Modifier . ABSTRACT ; } } // Method [ ] methods = cl . getDeclaredMethods ( ) ; // if ( ( classMods & Modifier . INTERFACE ) ! = 0 ) { // classMods = ( methods . length > 0 ) ? // ( classMods | Modifier . ABSTRACT ) : // ( classMods & ~ Modifier . ABSTRACT ) ; dout . writeInt ( classMods ) ; if ( ! ( type . asType ( ) instanceof javax . lang . model . type . ArrayType ) ) { // if ( ! cl . isArray ( ) ) { /* * compensate for change in 1.2FCS in which * Class . getInterfaces ( ) was modified to return Cloneable and * Serializable for array classes . */ List < ? extends TypeMirror > interfaces = type . getInterfaces ( ) ; String [ ] ifaceNames = new String [ interfaces . size ( ) ] ; for ( int i = 0 ; i < interfaces . size ( ) ; i ++ ) { ifaceNames [ i ] = ( ( TypeElement ) ( ( DeclaredType ) interfaces . get ( i ) ) . asElement ( ) ) . getQualifiedName ( ) . toString ( ) ; } // Class [ ] interfaces = cl . getInterfaces ( ) ; // String [ ] ifaceNames = new String [ interfaces . length ] ; // for ( int i = 0 ; i < interfaces . length ; i + + ) { // ifaceNames [ i ] = interfaces [ i ] . getName ( ) ; Arrays . sort ( ifaceNames ) ; for ( int i = 0 ; i < ifaceNames . length ; i ++ ) { dout . writeUTF ( ifaceNames [ i ] ) ; } } List < ? extends VariableElement > fields = ElementFilter . fieldsIn ( type . getEnclosedElements ( ) ) ; MemberSignature [ ] fieldSigs = new MemberSignature [ fields . size ( ) ] ; for ( int i = 0 ; i < fields . size ( ) ; i ++ ) { fieldSigs [ i ] = new MemberSignature ( fields . get ( i ) ) ; } // Field [ ] fields = cl . getDeclaredFields ( ) ; // MemberSignature [ ] fieldSigs = new MemberSignature [ fields . length ] ; // for ( int i = 0 ; i < fields . length ; i + + ) { // fieldSigs [ i ] = new MemberSignature ( fields [ i ] ) ; Arrays . sort ( fieldSigs , new Comparator < MemberSignature > ( ) { public int compare ( MemberSignature o1 , MemberSignature o2 ) { String name1 = o1 . name ; String name2 = o2 . name ; return name1 . compareTo ( name2 ) ; } } ) ; for ( int i = 0 ; i < fieldSigs . length ; i ++ ) { MemberSignature sig = fieldSigs [ i ] ; int mods = asReflectiveModifiers ( sig . member , Modifier . PUBLIC , Modifier . PRIVATE , Modifier . PROTECTED , Modifier . STATIC , Modifier . FINAL , Modifier . VOLATILE , Modifier . TRANSIENT ) ; // int mods = sig . member . getModifiers ( ) & // ( Modifier . PUBLIC | Modifier . PRIVATE | Modifier . PROTECTED | // Modifier . STATIC | Modifier . FINAL | Modifier . VOLATILE | // Modifier . TRANSIENT ) ; if ( ( ( mods & java . lang . reflect . Modifier . PRIVATE ) == 0 ) || ( ( mods & ( java . lang . reflect . Modifier . STATIC | java . lang . reflect . Modifier . TRANSIENT ) ) == 0 ) ) { dout . writeUTF ( sig . name ) ; dout . writeInt ( mods ) ; dout . writeUTF ( sig . signature ) ; } } boolean hasStaticInitializer = false ; for ( Element e : type . getEnclosedElements ( ) ) { if ( e . getKind ( ) == ElementKind . STATIC_INIT ) { hasStaticInitializer = true ; break ; } } if ( hasStaticInitializer ) { dout . writeUTF ( "<clinit>" ) ; dout . writeInt ( java . lang . reflect . Modifier . STATIC ) ; dout . writeUTF ( "()V" ) ; } // if ( hasStaticInitializer ( cl ) ) { // dout . writeUTF ( " < clinit > " ) ; // dout . writeInt ( Modifier . STATIC ) ; // dout . writeUTF ( " ( ) V " ) ; List < ExecutableElement > ctors = ElementFilter . constructorsIn ( type . getEnclosedElements ( ) ) ; MemberSignature [ ] consSigs = new MemberSignature [ ctors . size ( ) ] ; int i = 0 ; for ( ExecutableElement ctor : ctors ) { consSigs [ i ++ ] = new MemberSignature ( ctor ) ; } // Constructor [ ] cons = cl . getDeclaredConstructors ( ) ; // MemberSignature [ ] consSigs = new MemberSignature [ cons . length ] ; // for ( int i = 0 ; i < cons . length ; i + + ) { // consSigs [ i ] = new MemberSignature ( cons [ i ] ) ; Arrays . sort ( consSigs , new Comparator < MemberSignature > ( ) { public int compare ( MemberSignature o1 , MemberSignature o2 ) { String sig1 = o1 . signature ; String sig2 = o2 . signature ; return sig1 . compareTo ( sig2 ) ; } } ) ; // Arrays . sort ( consSigs , new Comparator ( ) { // public int compare ( Object o1 , Object o2 ) { // String sig1 = ( ( MemberSignature ) o1 ) . signature ; // String sig2 = ( ( MemberSignature ) o2 ) . signature ; // return sig1 . compareTo ( sig2 ) ; for ( MemberSignature sig : consSigs ) { int mods = asReflectiveModifiers ( sig . member , Modifier . PUBLIC , Modifier . PRIVATE , Modifier . PROTECTED , Modifier . STATIC , Modifier . FINAL , Modifier . SYNCHRONIZED , Modifier . NATIVE , Modifier . ABSTRACT , Modifier . STRICTFP ) ; if ( ( mods & java . lang . reflect . Modifier . PRIVATE ) == 0 ) { dout . writeUTF ( "<init>" ) ; dout . writeInt ( mods ) ; dout . writeUTF ( sig . signature . replace ( '/' , '.' ) ) ; } } // for ( int i = 0 ; i < consSigs . length ; i + + ) { // MemberSignature sig = consSigs [ i ] ; // int mods = sig . member . getModifiers ( ) & // ( Modifier . PUBLIC | Modifier . PRIVATE | Modifier . PROTECTED | // Modifier . STATIC | Modifier . FINAL | // Modifier . SYNCHRONIZED | Modifier . NATIVE | // Modifier . ABSTRACT | Modifier . STRICT ) ; // if ( ( mods & Modifier . PRIVATE ) = = 0 ) { // dout . writeUTF ( " < init > " ) ; // dout . writeInt ( mods ) ; // dout . writeUTF ( sig . signature . replace ( ' / ' , ' . ' ) ) ; List < ExecutableElement > methods = ElementFilter . methodsIn ( type . getEnclosedElements ( ) ) ; MemberSignature [ ] methSigs = new MemberSignature [ methods . size ( ) ] ; i = 0 ; for ( ExecutableElement m : methods ) { methSigs [ i ++ ] = new MemberSignature ( m ) ; } // MemberSignature [ ] methSigs = new MemberSignature [ methods . length ] ; // for ( int i = 0 ; i < methods . length ; i + + ) { // methSigs [ i ] = new MemberSignature ( methods [ i ] ) ; Arrays . sort ( methSigs , new Comparator < MemberSignature > ( ) { public int compare ( MemberSignature ms1 , MemberSignature ms2 ) { int comp = ms1 . name . compareTo ( ms2 . name ) ; if ( comp == 0 ) { comp = ms1 . signature . compareTo ( ms2 . signature ) ; } return comp ; } } ) ; // Arrays . sort ( methSigs , new Comparator ( ) { // public int compare ( Object o1 , Object o2 ) { // MemberSignature ms1 = ( MemberSignature ) o1; // MemberSignature ms2 = ( MemberSignature ) o2; // int comp = ms1 . name . compareTo ( ms2 . name ) ; // if ( comp = = 0 ) { // comp = ms1 . signature . compareTo ( ms2 . signature ) ; // return comp ; for ( MemberSignature sig : methSigs ) { int mods = asReflectiveModifiers ( sig . member , Modifier . PUBLIC , Modifier . PRIVATE , Modifier . PROTECTED , Modifier . STATIC , Modifier . FINAL , Modifier . SYNCHRONIZED , Modifier . NATIVE , Modifier . ABSTRACT , Modifier . STRICTFP ) ; if ( ( mods & java . lang . reflect . Modifier . PRIVATE ) == 0 ) { dout . writeUTF ( sig . name ) ; dout . writeInt ( mods ) ; dout . writeUTF ( sig . signature . replace ( '/' , '.' ) ) ; } } // for ( int i = 0 ; i < methSigs . length ; i + + ) { // MemberSignature sig = methSigs [ i ] ; // int mods = sig . member . getModifiers ( ) & // ( Modifier . PUBLIC | Modifier . PRIVATE | Modifier . PROTECTED | // Modifier . STATIC | Modifier . FINAL | // Modifier . SYNCHRONIZED | Modifier . NATIVE | // Modifier . ABSTRACT | Modifier . STRICT ) ; // if ( ( mods & Modifier . PRIVATE ) = = 0 ) { // dout . writeUTF ( sig . name ) ; // dout . writeInt ( mods ) ; // dout . writeUTF ( sig . signature . replace ( ' / ' , ' . ' ) ) ; dout . flush ( ) ; MessageDigest md = MessageDigest . getInstance ( "SHA" ) ; byte [ ] hashBytes = md . digest ( bout . toByteArray ( ) ) ; long hash = 0 ; for ( i = Math . min ( hashBytes . length , 8 ) - 1 ; i >= 0 ; i -- ) { hash = ( hash << 8 ) | ( hashBytes [ i ] & 0xFF ) ; } return hash ; } catch ( IOException | NoSuchAlgorithmException ex ) { throw new IllegalStateException ( "Could not compute default serialization UID for class: " + type . getQualifiedName ( ) . toString ( ) , ex ) ; }
public class SgVariable { /** * Adds a list of annotations . The internal list will not be cleared ! The * annotations will simply be added with < code > addAll ( . . ) < / code > . * @ param annotations * Annotations to add - Cannot be null . */ public final void addAnnotations ( final List < SgAnnotation > annotations ) { } }
if ( annotations == null ) { throw new IllegalArgumentException ( "The argument 'annotations' cannot be NULL!" ) ; } this . annotations . addAll ( annotations ) ;
public class QueryExecutor { /** * Return SQL to get ordered list of docIds . * Method assumes ` sortDocument ` is valid . * @ param docIdSet The original set of document IDs * @ param sortDocument Array of ordering definitions * [ { " fieldName " : " asc " } , { " fieldName2 " , " desc " } ] * @ param indexes dictionary of indexes * @ return the SQL containing the order by clause */ protected static SqlParts sqlToSortIds ( Set < String > docIdSet , List < FieldSort > sortDocument , List < Index > indexes ) throws QueryException { } }
String chosenIndex = chooseIndexForSort ( sortDocument , indexes ) ; if ( chosenIndex == null ) { String msg = String . format ( Locale . ENGLISH , "No single index can satisfy order %s" , sortDocument ) ; logger . log ( Level . SEVERE , msg ) ; throw new QueryException ( msg ) ; } String indexTable = QueryImpl . tableNameForIndex ( chosenIndex ) ; // for small result sets : // SELECT _ id FROM idx WHERE _ id IN ( ? , ? ) ORDER BY fieldName ASC , fieldName2 DESC // for large result sets : // SELECT _ id FROM idx ORDER BY fieldName ASC , fieldName2 DESC List < String > orderClauses = new ArrayList < String > ( ) ; for ( FieldSort clause : sortDocument ) { String fieldName = clause . field ; String direction = clause . sort == FieldSort . Direction . ASCENDING ? "asc" : "desc" ; String orderClause = String . format ( "\"%s\" %s" , fieldName , direction . toUpperCase ( Locale . ENGLISH ) ) ; orderClauses . add ( orderClause ) ; } // If we have few results , it ' s more efficient to reduce the search space // for SQLite . 500 placeholders should be a safe value . List < String > parameterList = new ArrayList < String > ( ) ; String whereClause = "" ; if ( docIdSet . size ( ) < SMALL_RESULT_SET_SIZE_THRESHOLD ) { List < String > placeholders = new ArrayList < String > ( ) ; for ( String docId : docIdSet ) { placeholders . add ( "?" ) ; parameterList . add ( docId ) ; } whereClause = String . format ( "WHERE _id IN (%s)" , Misc . join ( ", " , placeholders ) ) ; } String orderBy = Misc . join ( ", " , orderClauses ) ; String sql = String . format ( "SELECT DISTINCT _id FROM %s %s ORDER BY %s" , indexTable , whereClause , orderBy ) ; String [ ] parameters = new String [ parameterList . size ( ) ] ; return SqlParts . partsForSql ( sql , parameterList . toArray ( parameters ) ) ;
public class LDAPRule { /** * { @ inheritDoc } */ @ Override public Statement apply ( final Statement statement , FrameworkMethod method , Object target ) { } }
LDAP ldap = method . getAnnotation ( LDAP . class ) ; if ( ldap != null ) { try { port = ldap . port ( ) ; baseDN = ldap . baseDN ( ) ; additionalBindDN = ldap . additionalBindDN ( ) ; additionalBindPassword = ldap . additionalBindPassword ( ) ; directoryServer = createDirectoryServer ( ) ; importLdif ( ldap . ldif ( ) , target ) ; } catch ( LDAPException ex ) { throw new RuntimeException ( "could not start in memory directory server" , ex ) ; } return new Statement ( ) { @ Override public void evaluate ( ) throws Throwable { try { directoryServer . startListening ( ) ; statement . evaluate ( ) ; } finally { directoryServer . shutDown ( true ) ; } } } ; } return statement ;
public class PermutationGenerator { /** * Generate the next permutation and return a list containing * the elements in the appropriate order . This overloaded method * allows the caller to provide a list that will be used and returned . * The purpose of this is to improve performance when iterating over * permutations . If the { @ link # nextPermutationAsList ( ) } method is * used it will create a new list every time . When iterating over * permutations this will result in lots of short - lived objects that * have to be garbage collected . This method allows a single list * instance to be reused in such circumstances . * @ param destination Provides a list to use to create the * permutation . This is the list that will be returned , once * it has been filled with the elements in the appropriate order . * @ return The next permutation as a list . */ public List < T > nextPermutationAsList ( List < T > destination ) { } }
generateNextPermutationIndices ( ) ; // Generate actual permutation . destination . clear ( ) ; for ( int i : permutationIndices ) { destination . add ( elements [ i ] ) ; } return destination ;
public class DebugUtil { /** * Builds a prefix message to be used in front of < i > info < / i > messages for identification purposes . * The message format is : * < pre > * * * * * external info : [ timestamp ] [ class name ] : * < / pre > * @ param pObject the { @ code java . lang . Object } to be debugged . If the object ia a { @ code java . lang . String } object , it is assumed that it is the class name given directly . * @ return a prefix for an info message . */ public static String getPrefixInfoMessage ( final Object pObject ) { } }
StringBuilder buffer = new StringBuilder ( ) ; buffer . append ( INFO ) ; buffer . append ( getTimestamp ( ) ) ; buffer . append ( " " ) ; if ( pObject == null ) { buffer . append ( "[unknown class]" ) ; } else { if ( pObject instanceof String ) { buffer . append ( ( String ) pObject ) ; } else { buffer . append ( getClassName ( pObject ) ) ; } } buffer . append ( ": " ) ; return buffer . toString ( ) ;
public class AgentFilter { /** * The current health state of the agent . Values can be set to < b > HEALTHY < / b > or < b > UNHEALTHY < / b > . * @ param agentHealths * The current health state of the agent . Values can be set to < b > HEALTHY < / b > or < b > UNHEALTHY < / b > . * @ return Returns a reference to this object so that method calls can be chained together . * @ see AgentHealth */ public AgentFilter withAgentHealths ( AgentHealth ... agentHealths ) { } }
java . util . ArrayList < String > agentHealthsCopy = new java . util . ArrayList < String > ( agentHealths . length ) ; for ( AgentHealth value : agentHealths ) { agentHealthsCopy . add ( value . toString ( ) ) ; } if ( getAgentHealths ( ) == null ) { setAgentHealths ( agentHealthsCopy ) ; } else { getAgentHealths ( ) . addAll ( agentHealthsCopy ) ; } return this ;
public class MwSitesDumpFileProcessor { /** * Extract the individual fields for one row in the sites table . The entries * are encoded by position , with the following meaning : 0 : site _ id , 1: * site _ global _ key , 2 : site _ type , 3 : site _ group , 4 : site _ source 5: * site _ language , 6 : site _ protocol , 7 : site _ domain , 8 : site _ data , 9: * site _ forward , 10 : site _ config . The method assumes that this is the layout * of the table , which is the case in MediaWiki 1.21 and above . * @ param siteRow * the string representation of a row in the sites table , with * the surrounding parentheses * @ return an array with the individual entries */ String [ ] getSiteRowFields ( String siteRow ) { } }
String [ ] siteRowFields = new String [ 11 ] ; Matcher matcher = Pattern . compile ( "[(,](['][^']*[']|[^'][^),]*)" ) . matcher ( siteRow ) ; int columnIndex = 0 ; while ( matcher . find ( ) ) { String field = matcher . group ( ) . substring ( 1 ) ; if ( field . charAt ( 0 ) == '\'' ) { field = field . substring ( 1 , field . length ( ) - 1 ) ; } siteRowFields [ columnIndex ] = field ; // . . . will throw an exception if there are more fields than // expected ; this is fine . columnIndex ++ ; } return siteRowFields ;
public class LogAction { /** * 显示角色某时间段的登陆记录 */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public String timeIntervalStat ( ) { OqlBuilder < SessioninfoLogBean > query = OqlBuilder . from ( SessioninfoLogBean . class , "sessioninfoLog" ) ; addConditions ( query ) ; query . select ( "hour(sessioninfoLog.loginAt),count(*)" ) . groupBy ( "hour(sessioninfoLog.loginAt)" ) ; List rs = entityDao . search ( query ) ; Collections . sort ( rs , new PropertyComparator ( "[0]" ) ) ; put ( "logonStats" , rs ) ; return forward ( ) ;
public class MolgenisWebAppConfig { /** * Configure freemarker . All freemarker templates should be on the classpath in a package called * ' freemarker ' */ @ Bean public FreeMarkerConfigurer freeMarkerConfigurer ( ) { } }
FreeMarkerConfigurer result = new FreeMarkerConfigurer ( ) { @ Override protected void postProcessConfiguration ( Configuration config ) { config . setObjectWrapper ( new MolgenisFreemarkerObjectWrapper ( VERSION_2_3_23 ) ) ; } @ Override protected void postProcessTemplateLoaders ( List < TemplateLoader > templateLoaders ) { templateLoaders . add ( new ClassTemplateLoader ( FreeMarkerConfigurer . class , "" ) ) ; } } ; result . setPreferFileSystemAccess ( false ) ; result . setTemplateLoaderPath ( "classpath:/templates/" ) ; result . setDefaultEncoding ( "UTF-8" ) ; Properties freemarkerSettings = new Properties ( ) ; freemarkerSettings . setProperty ( Configuration . LOCALIZED_LOOKUP_KEY , Boolean . FALSE . toString ( ) ) ; freemarkerSettings . setProperty ( Configuration . NUMBER_FORMAT_KEY , "computer" ) ; result . setFreemarkerSettings ( freemarkerSettings ) ; Map < String , Object > freemarkerVariables = Maps . newHashMap ( ) ; freemarkerVariables . put ( "hasPermission" , new HasPermissionDirective ( permissionService ) ) ; freemarkerVariables . put ( "notHasPermission" , new NotHasPermissionDirective ( permissionService ) ) ; addFreemarkerVariables ( freemarkerVariables ) ; result . setFreemarkerVariables ( freemarkerVariables ) ; return result ;
public class FileExtractor { /** * Unzip a downloaded zip file ( this will implicitly overwrite any existing files ) * @ param downloadedCompressedFile The downloaded zip file * @ param extractedToFilePath Path to extracted file * @ param possibleFilenames Names of the files we want to extract * @ return boolean * @ throws IOException IOException */ String unzipFile ( File downloadedCompressedFile , String extractedToFilePath , BinaryType possibleFilenames ) throws IOException , ExpectedFileNotFoundException { } }
LOG . debug ( "Attempting to extract binary from .zip file..." ) ; ArrayList < String > filenamesWeAreSearchingFor = new ArrayList < String > ( possibleFilenames . getBinaryFilenames ( ) ) ; ZipFile zip = new ZipFile ( downloadedCompressedFile ) ; try { Enumeration < ZipArchiveEntry > zipFile = zip . getEntries ( ) ; if ( filenamesWeAreSearchingFor . get ( 0 ) . equals ( "*" ) ) { filenamesWeAreSearchingFor . remove ( 0 ) ; LOG . debug ( "Extracting full archive" ) ; return this . unzipFolder ( zip , extractedToFilePath , filenamesWeAreSearchingFor ) ; } else { while ( zipFile . hasMoreElements ( ) ) { ZipArchiveEntry zipFileEntry = zipFile . nextElement ( ) ; for ( String aFilenameWeAreSearchingFor : filenamesWeAreSearchingFor ) { if ( zipFileEntry . getName ( ) . endsWith ( aFilenameWeAreSearchingFor ) ) { LOG . debug ( "Found: " + zipFileEntry . getName ( ) ) ; return copyFileToDisk ( zip . getInputStream ( zipFileEntry ) , extractedToFilePath , aFilenameWeAreSearchingFor ) ; } } } } } finally { zip . close ( ) ; } throw new ExpectedFileNotFoundException ( "Unable to find any expected files for " + possibleFilenames . getBinaryTypeAsString ( ) ) ;
public class DRL5Lexer { /** * $ ANTLR start " LEFT _ PAREN " */ public final void mLEFT_PAREN ( ) throws RecognitionException { } }
try { int _type = LEFT_PAREN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 238:9 : ( ' ( ' ) // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 238:11 : ' ( ' { match ( '(' ) ; if ( state . failed ) return ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class AllocateHostsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < AllocateHostsRequest > getDryRunRequest ( ) { } }
Request < AllocateHostsRequest > request = new AllocateHostsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;