signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CFMLTransformer { /** * Startmethode zum transfomieren einer CFML Datei . < br / > * EBNF : < br / > * < code > { body } < / code > * @ param config * @ param ps CFML File * @ param tlibs Tag Library Deskriptoren , nach denen innerhalb der CFML Datei geprueft werden soll . * @ param flibs Function Library Deskriptoren , nach denen innerhalb der Expressions der CFML Datei * geprueft werden soll . * @ param returnValue if true the method returns the value of the last expression executed inside * when you call the method " call " * @ return uebersetztes CFXD Dokument Element . * @ throws TemplateException * @ throws IOException */ public Page transform ( Factory factory , ConfigImpl config , PageSource ps , TagLib [ ] tlibs , FunctionLib [ ] flibs , boolean returnValue , boolean ignoreScopes ) throws TemplateException , IOException { } }
Page p ; SourceCode sc ; boolean writeLog = config . getExecutionLogEnabled ( ) ; Charset charset = config . getTemplateCharset ( ) ; boolean dotUpper = ps . getDialect ( ) == CFMLEngine . DIALECT_CFML && ( ( MappingImpl ) ps . getMapping ( ) ) . getDotNotationUpperCase ( ) ; // parse regular while ( true ) { try { sc = new PageSourceCode ( ps , charset , writeLog ) ; p = transform ( factory , config , sc , tlibs , flibs , ps . getResource ( ) . lastModified ( ) , dotUpper , returnValue , ignoreScopes ) ; break ; } catch ( ProcessingDirectiveException pde ) { if ( pde . getWriteLog ( ) != null ) writeLog = pde . getWriteLog ( ) . booleanValue ( ) ; if ( pde . getDotNotationUpperCase ( ) != null ) dotUpper = pde . getDotNotationUpperCase ( ) . booleanValue ( ) ; if ( ! StringUtil . isEmpty ( pde . getCharset ( ) ) ) charset = pde . getCharset ( ) ; } } // could it be a component ? boolean isCFML = ps . getDialect ( ) == CFMLEngine . DIALECT_CFML ; boolean isCFMLCompExt = isCFML && Constants . isCFMLComponentExtension ( ResourceUtil . getExtension ( ps . getResource ( ) , "" ) ) ; boolean possibleUndetectedComponent = false ; // we don ' t have a component or interface if ( p . isPage ( ) ) { if ( isCFML ) possibleUndetectedComponent = isCFMLCompExt ; else if ( Constants . isLuceeComponentExtension ( ResourceUtil . getExtension ( ps . getResource ( ) , "" ) ) ) { Expression expr ; Statement stat ; PrintOut po ; LitString ls ; List < Statement > statements = p . getStatements ( ) ; // check the root statements for component Iterator < Statement > it = statements . iterator ( ) ; String str ; while ( it . hasNext ( ) ) { stat = it . next ( ) ; if ( stat instanceof PrintOut && ( expr = ( ( PrintOut ) stat ) . getExpr ( ) ) instanceof LitString ) { ls = ( LitString ) expr ; str = ls . getString ( ) ; if ( str . indexOf ( Constants . LUCEE_COMPONENT_TAG_NAME ) != - 1 || str . indexOf ( Constants . LUCEE_INTERFACE_TAG_NAME ) != - 1 || str . indexOf ( Constants . CFML_COMPONENT_TAG_NAME ) != - 1 // cfml name is supported as alias ) { possibleUndetectedComponent = true ; break ; } } } } } if ( possibleUndetectedComponent ) { Page _p ; TagLibTag scriptTag = CFMLTransformer . getTLT ( sc , isCFML ? Constants . CFML_SCRIPT_TAG_NAME : Constants . LUCEE_SCRIPT_TAG_NAME , config . getIdentification ( ) ) ; sc . setPos ( 0 ) ; SourceCode original = sc ; // try inside a cfscript String text = "<" + scriptTag . getFullName ( ) + ">" + original . getText ( ) + "\n</" + scriptTag . getFullName ( ) + ">" ; sc = new PageSourceCode ( ps , text , charset , writeLog ) ; try { while ( true ) { if ( sc == null ) { sc = new PageSourceCode ( ps , charset , writeLog ) ; text = "<" + scriptTag . getFullName ( ) + ">" + sc . getText ( ) + "\n</" + scriptTag . getFullName ( ) + ">" ; sc = new PageSourceCode ( ps , text , charset , writeLog ) ; } try { _p = transform ( factory , config , sc , tlibs , flibs , ps . getResource ( ) . lastModified ( ) , dotUpper , returnValue , ignoreScopes ) ; break ; } catch ( ProcessingDirectiveException pde ) { if ( pde . getWriteLog ( ) != null ) writeLog = pde . getWriteLog ( ) . booleanValue ( ) ; if ( pde . getDotNotationUpperCase ( ) != null ) dotUpper = pde . getDotNotationUpperCase ( ) . booleanValue ( ) ; if ( ! StringUtil . isEmpty ( pde . getCharset ( ) ) ) charset = pde . getCharset ( ) ; sc = null ; } } } catch ( ComponentTemplateException e ) { throw e . getTemplateException ( ) ; } // we only use that result if it is a component now if ( _p != null && ! _p . isPage ( ) ) return _p ; } if ( isCFMLCompExt && ! p . isComponent ( ) && ! p . isInterface ( ) ) { String msg = "template [" + ps . getDisplayPath ( ) + "] must contain a component or an interface." ; if ( sc != null ) throw new TemplateException ( sc , msg ) ; throw new TemplateException ( msg ) ; } return p ;
public class AesEncrypter { /** * Encrypt . * @ param plainText the plain text * @ param secretKey the secret key * @ return the string */ public static String encrypt ( String secretKey , String plainText ) { } }
if ( plainText == null ) { return null ; } else if ( plainText . startsWith ( "$CRYPT::" ) ) { // Avoid encrypting already encrypted text - APIMAN - 1201 return plainText ; } byte [ ] encrypted ; Cipher cipher ; try { SecretKeySpec skeySpec = keySpecFromSecretKey ( secretKey ) ; cipher = Cipher . getInstance ( "AES" ) ; // $ NON - NLS - 1 $ cipher . init ( Cipher . ENCRYPT_MODE , skeySpec ) ; } catch ( NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e ) { throw new RuntimeException ( e ) ; } try { encrypted = cipher . doFinal ( plainText . getBytes ( ) ) ; } catch ( IllegalBlockSizeException | BadPaddingException e ) { throw new RuntimeException ( e ) ; } return "$CRYPT::" + new String ( Base64 . encodeBase64 ( encrypted ) ) ; // $ NON - NLS - 1 $
public class LongColumn { /** * { @ inheritDoc } */ @ Override protected Long decodeData ( byte [ ] buffer ) { } }
final ByteBuffer bytebuf = allocate ( size ) ; // buffer is guaranteed non - null and proper length bytebuf . put ( buffer ) ; bytebuf . rewind ( ) ; return bytebuf . getLong ( ) ;
public class DListImpl { /** * Returns the element at the specified position in this list . * @ param index index of element to return . * @ return the element at the specified position in this list . * @ throws IndexOutOfBoundsException if the index is out of range ( index * & lt ; 0 | | index & gt ; = size ( ) ) . */ public Object get ( int index ) { } }
DListEntry entry = ( DListEntry ) elements . get ( index ) ; return entry . getRealSubject ( ) ;
public class ManagedObject { /** * Customized deserialization . Notice that subclasses do not have to call this method * in their super class because the deserialisation of the subclass need not concern * itself with restoring the state of the super class . * @ param objectInputStream containing the serialized form of the Object . * @ throws java . io . IOException * @ throws java . lang . ClassNotFoundException */ private void readObject ( java . io . ObjectInputStream objectInputStream ) throws java . io . IOException , java . lang . ClassNotFoundException { } }
final String methodName = "readObject" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { objectInputStream } ) ; objectInputStream . defaultReadObject ( ) ; threadsWaitingForLock = 0 ; forcedUpdateSequence = 0 ; forcedUpdateSequenceLock = new ForcedUpdateSequenceLock ( ) ; transactionLock = new TransactionLock ( null ) ; state = stateReady ; // Initial state . previousState = - 1 ; // No previous state . stateLock = new Object ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ;
public class AjaxHelper { /** * This internal method is used to register an arbitrary target container . It must only used by components which * contain implicit AJAX capability . * @ param triggerId the id of the trigger that will cause the component to be painted . * @ param containerId the target container id . This is not necessarily a WComponent id . * @ param containerContentIds the container content . * @ return the AjaxOperation control configuration object . */ static AjaxOperation registerContainer ( final String triggerId , final String containerId , final List < String > containerContentIds ) { } }
AjaxOperation operation = new AjaxOperation ( triggerId , containerContentIds ) ; operation . setTargetContainerId ( containerId ) ; operation . setAction ( AjaxOperation . AjaxAction . REPLACE_CONTENT ) ; registerAjaxOperation ( operation ) ; return operation ;
public class HlsCaptionLanguageMappingMarshaller { /** * Marshall the given parameter object . */ public void marshall ( HlsCaptionLanguageMapping hlsCaptionLanguageMapping , ProtocolMarshaller protocolMarshaller ) { } }
if ( hlsCaptionLanguageMapping == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hlsCaptionLanguageMapping . getCaptionChannel ( ) , CAPTIONCHANNEL_BINDING ) ; protocolMarshaller . marshall ( hlsCaptionLanguageMapping . getCustomLanguageCode ( ) , CUSTOMLANGUAGECODE_BINDING ) ; protocolMarshaller . marshall ( hlsCaptionLanguageMapping . getLanguageCode ( ) , LANGUAGECODE_BINDING ) ; protocolMarshaller . marshall ( hlsCaptionLanguageMapping . getLanguageDescription ( ) , LANGUAGEDESCRIPTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class WriterEncodedAppender { /** * / * ( non - Javadoc ) * @ see AbstractEncodedAppender # write ( EncodingState , java . lang . String , int , int ) */ @ Override protected void write ( EncodingState encodingState , String str , int off , int len ) throws IOException { } }
target . write ( str , off , len ) ;
public class MonthNames { /** * To pass in localized names directly * @ param longNames * @ param shortNames */ public void localize ( final String [ ] longNames , final String [ ] shortNames ) { } }
assert longNames != null && longNames . length == 12 ; assert shortNames != null && shortNames . length == 12 ; final JsArrayString longOnes = ( JsArrayString ) JsArrayString . createArray ( ) ; for ( final String name : longNames ) { longOnes . push ( name ) ; } final JsArrayString shortOnes = ( JsArrayString ) JsArrayString . createArray ( ) ; for ( final String name : shortNames ) { shortOnes . push ( name ) ; } localize ( longOnes , shortOnes ) ;
public class SarlBatchCompiler { /** * Create a message for the issue . * @ param issue the issue . * @ return the message . */ protected String createIssueMessage ( Issue issue ) { } }
final IssueMessageFormatter formatter = getIssueMessageFormatter ( ) ; final org . eclipse . emf . common . util . URI uriToProblem = issue . getUriToProblem ( ) ; if ( formatter != null ) { final String message = formatter . format ( issue , uriToProblem ) ; if ( message != null ) { return message ; } } if ( uriToProblem != null ) { final org . eclipse . emf . common . util . URI resourceUri = uriToProblem . trimFragment ( ) ; return MessageFormat . format ( Messages . SarlBatchCompiler_4 , issue . getSeverity ( ) , resourceUri . lastSegment ( ) , resourceUri . isFile ( ) ? resourceUri . toFileString ( ) : "" , // $ NON - NLS - 1 $ issue . getLineNumber ( ) , issue . getColumn ( ) , issue . getCode ( ) , issue . getMessage ( ) ) ; } return MessageFormat . format ( Messages . SarlBatchCompiler_5 , issue . getSeverity ( ) , issue . getLineNumber ( ) , issue . getColumn ( ) , issue . getCode ( ) , issue . getMessage ( ) ) ;
public class MDC { /** * Return a copy of the current thread ' s context map , with keys and values of * type String . Returned value may be null . * @ return A copy of the current thread ' s context map . May be null . * @ since 1.5.1 */ public static Map < String , String > getCopyOfContextMap ( ) { } }
if ( mdcAdapter == null ) { throw new IllegalStateException ( "MDCAdapter cannot be null. See also " + NULL_MDCA_URL ) ; } return mdcAdapter . getCopyOfContextMap ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcBoundingBox ( ) { } }
if ( ifcBoundingBoxEClass == null ) { ifcBoundingBoxEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 52 ) ; } return ifcBoundingBoxEClass ;
public class SigningHAServiceConfigurationListener { /** * Gets the aggregator ' s configuration . Invokes configuration updates for all the subclients . * @ return { @ link Future } which eventually provides subconfiguration ' s consolidation result . */ Future < AggregatorConfiguration > getAggregationConfiguration ( ) { } }
return new HAConfFuture < > ( invokeSubServiceConfUpdates ( ) , new HAConfFuture . ConfResultSupplier < ConsolidatedResult < AggregatorConfiguration > > ( ) { public ConsolidatedResult < AggregatorConfiguration > get ( ) { return lastConsolidatedConfiguration ; } } ) ;
public class FctEntitiesFileReportersPdf { /** * < p > Get bean in lazy mode ( if bean is null then initialize it ) . < / p > * @ param pAddParam additional param * @ param pBeanName - bean name * @ return requested bean * @ throws Exception - an exception */ @ Override public final IEntityFileReporter lazyGet ( final Map < String , Object > pAddParam , final String pBeanName ) throws Exception { } }
IEntityFileReporter proc = this . reportersMap . get ( pBeanName ) ; if ( proc == null ) { // locking : synchronized ( this ) { // make sure again whether it ' s null after locking : proc = this . reportersMap . get ( pBeanName ) ; if ( proc == null && pBeanName . equals ( InvoiceReportPdf . class . getSimpleName ( ) ) ) { proc = lazyGetInvoiceReportPdf ( pAddParam ) ; } } } if ( proc == null ) { throw new ExceptionWithCode ( ExceptionWithCode . CONFIGURATION_MISTAKE , "There is no entity processor with name " + pBeanName ) ; } return proc ;
public class TextObject { /** * getter for objectLabel - gets the label of an object * @ generated * @ return value of the feature */ public String getObjectLabel ( ) { } }
if ( TextObject_Type . featOkTst && ( ( TextObject_Type ) jcasType ) . casFeat_objectLabel == null ) jcasType . jcas . throwFeatMissing ( "objectLabel" , "de.julielab.jules.types.TextObject" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( TextObject_Type ) jcasType ) . casFeatCode_objectLabel ) ;
public class OnPremisesTagSet { /** * A list that contains other lists of on - premises instance tag groups . For an instance to be included in the * deployment group , it must be identified by all of the tag groups in the list . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setOnPremisesTagSetList ( java . util . Collection ) } or { @ link # withOnPremisesTagSetList ( java . util . Collection ) } * if you want to override the existing values . * @ param onPremisesTagSetList * A list that contains other lists of on - premises instance tag groups . For an instance to be included in the * deployment group , it must be identified by all of the tag groups in the list . * @ return Returns a reference to this object so that method calls can be chained together . */ public OnPremisesTagSet withOnPremisesTagSetList ( java . util . List < TagFilter > ... onPremisesTagSetList ) { } }
if ( this . onPremisesTagSetList == null ) { setOnPremisesTagSetList ( new com . amazonaws . internal . SdkInternalList < java . util . List < TagFilter > > ( onPremisesTagSetList . length ) ) ; } for ( java . util . List < TagFilter > ele : onPremisesTagSetList ) { this . onPremisesTagSetList . add ( ele ) ; } return this ;
public class BlobContainersInner { /** * Clears legal hold tags . Clearing the same or non - existent tag results in an idempotent operation . ClearLegalHold clears out only the specified tags in the request . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param containerName The name of the blob container within the specified storage account . Blob container names must be between 3 and 63 characters in length and use numbers , lower - case letters and dash ( - ) only . Every dash ( - ) character must be immediately preceded and followed by a letter or number . * @ param tags Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the LegalHoldInner object */ public Observable < ServiceResponse < LegalHoldInner > > clearLegalHoldWithServiceResponseAsync ( String resourceGroupName , String accountName , String containerName , List < String > tags ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( containerName == null ) { throw new IllegalArgumentException ( "Parameter containerName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } if ( tags == null ) { throw new IllegalArgumentException ( "Parameter tags is required and cannot be null." ) ; } Validator . validate ( tags ) ; LegalHoldInner legalHold = new LegalHoldInner ( ) ; legalHold . withTags ( tags ) ; return service . clearLegalHold ( resourceGroupName , accountName , containerName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , legalHold , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < LegalHoldInner > > > ( ) { @ Override public Observable < ServiceResponse < LegalHoldInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < LegalHoldInner > clientResponse = clearLegalHoldDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class Where { /** * Add a IN clause so the column must be equal - to one of the objects passed in . */ public Where < T , ID > in ( String columnName , Object ... objects ) throws SQLException { } }
return in ( true , columnName , objects ) ;
public class AbstractContext { /** * Get the current attribute type . * @ param key the entry ' s key , not null * @ return the current attribute type , or null , if no such attribute exists . */ public Class < ? > getType ( String key ) { } }
Object val = this . data . get ( key ) ; return val == null ? null : val . getClass ( ) ;
public class DeepLearningTask2 { /** * Reduce between worker nodes , with network traffic ( if greater than 1 nodes ) * After all reduce ( ) ' s are done , postGlobal ( ) will be called * @ param drt task to reduce */ @ Override public void reduce ( DeepLearningTask2 drt ) { } }
if ( _res == null ) _res = drt . _res ; else { _res . _chunk_node_count += drt . _res . _chunk_node_count ; _res . model_info ( ) . add ( drt . _res . model_info ( ) ) ; // add models , but don ' t average yet } assert ( _res . model_info ( ) . get_params ( ) . _replicate_training_data ) ;
public class Solo { /** * Simulate touching the specified location and dragging it to a new location . * @ param fromX X coordinate of the initial touch , in screen coordinates * @ param toX X coordinate of the drag destination , in screen coordinates * @ param fromY Y coordinate of the initial touch , in screen coordinates * @ param toY Y coordinate of the drag destination , in screen coordinates * @ param stepCount how many move steps to include in the drag . Less steps results in a faster drag */ public void drag ( float fromX , float toX , float fromY , float toY , int stepCount ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "drag(" + fromX + ", " + toX + ", " + fromY + ", " + toY + ")" ) ; } dialogUtils . hideSoftKeyboard ( null , false , true ) ; scroller . drag ( fromX , toX , fromY , toY , stepCount ) ;
public class Strings { /** * Make the first character lower case * @ param name Any String * @ return A String */ public static String toFirstLower ( String name ) { } }
if ( isEmpty ( name ) ) { return name ; } return "" + name . toLowerCase ( Locale . ROOT ) . charAt ( 0 ) + name . substring ( 1 ) ;
public class PDFView { /** * Change the zoom level , relatively to a pivot point . * It will call moveTo ( ) to make sure the given point stays * in the middle of the screen . * @ param zoom The zoom level . * @ param pivot The point on the screen that should stays . */ public void zoomCenteredTo ( float zoom , PointF pivot ) { } }
float dzoom = zoom / this . zoom ; zoomTo ( zoom ) ; float baseX = currentXOffset * dzoom ; float baseY = currentYOffset * dzoom ; baseX += ( pivot . x - pivot . x * dzoom ) ; baseY += ( pivot . y - pivot . y * dzoom ) ; moveTo ( baseX , baseY ) ;
public class PlaybackService { /** * Start the playback . * Play the track matching the given position in the given playlist . * @ param context context from which the service will be started . * @ param clientId SoundCloud api client id . * @ param track the track which will be played . */ public static void play ( Context context , String clientId , SoundCloudTrack track ) { } }
Intent intent = new Intent ( context , PlaybackService . class ) ; intent . setAction ( ACTION_PLAY ) ; intent . putExtra ( BUNDLE_KEY_SOUND_CLOUD_CLIENT_ID , clientId ) ; intent . putExtra ( BUNDLE_KEY_SOUND_CLOUD_TRACK , track ) ; context . startService ( intent ) ;
public class DefaultGroovyMethods { /** * Iterates over the elements of an Iterator , starting from a * specified startIndex , and returns the index of the first item that satisfies the * condition specified by the closure . * @ param self an Iterator * @ param startIndex start matching from this index * @ param condition the matching condition * @ return an integer that is the index of the first matched object or - 1 if no match was found * @ since 2.5.0 */ public static < T > int findIndexOf ( Iterator < T > self , int startIndex , @ ClosureParams ( FirstParam . FirstGenericType . class ) Closure condition ) { } }
int result = - 1 ; int i = 0 ; BooleanClosureWrapper bcw = new BooleanClosureWrapper ( condition ) ; while ( self . hasNext ( ) ) { Object value = self . next ( ) ; if ( i ++ < startIndex ) { continue ; } if ( bcw . call ( value ) ) { result = i - 1 ; break ; } } return result ;
public class TinValidator { /** * check the Tax Identification Number number , country version for Denmark . * @ param ptin vat id to check * @ return true if checksum is ok */ private boolean checkDkTin ( final String ptin ) { } }
final int checkSum = ptin . charAt ( 9 ) - '0' ; final int sum = ( ( ptin . charAt ( 0 ) - '0' ) * 4 + ( ptin . charAt ( 1 ) - '0' ) * 2 + ( ptin . charAt ( 2 ) - '0' ) * 3 + ( ptin . charAt ( 3 ) - '0' ) * 7 + ( ptin . charAt ( 4 ) - '0' ) * 6 + ( ptin . charAt ( 5 ) - '0' ) * 5 + ( ptin . charAt ( 6 ) - '0' ) * 4 + ( ptin . charAt ( 7 ) - '0' ) * 3 + ( ptin . charAt ( 8 ) - '0' ) * 2 ) % MODULO_11 ; int calculatedCheckSum = MODULO_11 - sum ; if ( calculatedCheckSum == 10 ) { calculatedCheckSum = 0 ; } return checkSum == calculatedCheckSum ;
public class SystemAnimations { /** * TODO add a Policy class that allows a warning to be emitted , instead */ @ VisibleForTesting void checkPermissionStatus ( @ NonNull Context context ) { } }
boolean hasPermission = getPermissionChecker ( ) . hasAnimationPermission ( context ) ; if ( ! hasPermission ) { throw new IllegalStateException ( getPermissionErrorMessage ( ) ) ; }
public class ByteBufUtil { /** * Fast - Path implementation */ static int writeUtf8 ( AbstractByteBuf buffer , int writerIndex , CharSequence seq , int len ) { } }
int oldWriterIndex = writerIndex ; // We can use the _ set methods as these not need to do any index checks and reference checks . // This is possible as we called ensureWritable ( . . . ) before . for ( int i = 0 ; i < len ; i ++ ) { char c = seq . charAt ( i ) ; if ( c < 0x80 ) { buffer . _setByte ( writerIndex ++ , ( byte ) c ) ; } else if ( c < 0x800 ) { buffer . _setByte ( writerIndex ++ , ( byte ) ( 0xc0 | ( c >> 6 ) ) ) ; buffer . _setByte ( writerIndex ++ , ( byte ) ( 0x80 | ( c & 0x3f ) ) ) ; } else if ( isSurrogate ( c ) ) { if ( ! Character . isHighSurrogate ( c ) ) { buffer . _setByte ( writerIndex ++ , WRITE_UTF_UNKNOWN ) ; continue ; } final char c2 ; try { // Surrogate Pair consumes 2 characters . Optimistically try to get the next character to avoid // duplicate bounds checking with charAt . If an IndexOutOfBoundsException is thrown we will // re - throw a more informative exception describing the problem . c2 = seq . charAt ( ++ i ) ; } catch ( IndexOutOfBoundsException ignored ) { buffer . _setByte ( writerIndex ++ , WRITE_UTF_UNKNOWN ) ; break ; } // Extra method to allow inlining the rest of writeUtf8 which is the most likely code path . writerIndex = writeUtf8Surrogate ( buffer , writerIndex , c , c2 ) ; } else { buffer . _setByte ( writerIndex ++ , ( byte ) ( 0xe0 | ( c >> 12 ) ) ) ; buffer . _setByte ( writerIndex ++ , ( byte ) ( 0x80 | ( ( c >> 6 ) & 0x3f ) ) ) ; buffer . _setByte ( writerIndex ++ , ( byte ) ( 0x80 | ( c & 0x3f ) ) ) ; } } return writerIndex - oldWriterIndex ;
public class NatsServerInfo { /** * Removed octal support */ String unescapeString ( String st ) { } }
StringBuilder sb = new StringBuilder ( st . length ( ) ) ; for ( int i = 0 ; i < st . length ( ) ; i ++ ) { char ch = st . charAt ( i ) ; if ( ch == '\\' ) { char nextChar = ( i == st . length ( ) - 1 ) ? '\\' : st . charAt ( i + 1 ) ; switch ( nextChar ) { case '\\' : ch = '\\' ; break ; case 'b' : ch = '\b' ; break ; case 'f' : ch = '\f' ; break ; case 'n' : ch = '\n' ; break ; case 'r' : ch = '\r' ; break ; case 't' : ch = '\t' ; break ; /* case ' \ " ' : ch = ' \ " ' ; break ; case ' \ ' ' : ch = ' \ ' ' ; break ; */ // Hex Unicode : u ? ? ? ? case 'u' : if ( i >= st . length ( ) - 5 ) { ch = 'u' ; break ; } int code = Integer . parseInt ( "" + st . charAt ( i + 2 ) + st . charAt ( i + 3 ) + st . charAt ( i + 4 ) + st . charAt ( i + 5 ) , 16 ) ; sb . append ( Character . toChars ( code ) ) ; i += 5 ; continue ; } i ++ ; } sb . append ( ch ) ; } return sb . toString ( ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcFlowTerminal ( ) { } }
if ( ifcFlowTerminalEClass == null ) { ifcFlowTerminalEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 252 ) ; } return ifcFlowTerminalEClass ;
public class JobExecutionsInner { /** * Gets a job execution . * @ 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 jobAgentName The name of the job agent . * @ param jobName The name of the job . * @ param jobExecutionId The id of the job execution * @ 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 JobExecutionInner object if successful . */ public JobExecutionInner get ( String resourceGroupName , String serverName , String jobAgentName , String jobName , UUID jobExecutionId ) { } }
return getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , jobName , jobExecutionId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AwsSecurityFindingFilters { /** * The destination IPv4 address of network - related information about a finding . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setNetworkDestinationIpV4 ( java . util . Collection ) } or * { @ link # withNetworkDestinationIpV4 ( java . util . Collection ) } if you want to override the existing values . * @ param networkDestinationIpV4 * The destination IPv4 address of network - related information about a finding . * @ return Returns a reference to this object so that method calls can be chained together . */ public AwsSecurityFindingFilters withNetworkDestinationIpV4 ( IpFilter ... networkDestinationIpV4 ) { } }
if ( this . networkDestinationIpV4 == null ) { setNetworkDestinationIpV4 ( new java . util . ArrayList < IpFilter > ( networkDestinationIpV4 . length ) ) ; } for ( IpFilter ele : networkDestinationIpV4 ) { this . networkDestinationIpV4 . add ( ele ) ; } return this ;
public class VectorDrawable { /** * The size of a pixel when scaled from the intrinsic dimension to the viewport dimension . * This is used to calculate the path animation accuracy . * @ hide */ public float getPixelSize ( ) { } }
if ( mVectorState == null && mVectorState . mVPathRenderer == null || mVectorState . mVPathRenderer . mBaseWidth == 0 || mVectorState . mVPathRenderer . mBaseHeight == 0 || mVectorState . mVPathRenderer . mViewportHeight == 0 || mVectorState . mVPathRenderer . mViewportWidth == 0 ) { return 1 ; // fall back to 1:1 pixel mapping . } float intrinsicWidth = mVectorState . mVPathRenderer . mBaseWidth ; float intrinsicHeight = mVectorState . mVPathRenderer . mBaseHeight ; float viewportWidth = mVectorState . mVPathRenderer . mViewportWidth ; float viewportHeight = mVectorState . mVPathRenderer . mViewportHeight ; float scaleX = viewportWidth / intrinsicWidth ; float scaleY = viewportHeight / intrinsicHeight ; return Math . min ( scaleX , scaleY ) ;
public class IHEAuditor { /** * Audit a User Authentication - Login Event * @ param outcome Event outcome indicator * @ param isAuthenticatedSystem Whether the system auditing is the authenticated system ( client ) or authenticator ( server , e . g . kerberos ) * @ param remoteUserIdUser ID of the system that is not sending the audit message * @ param remoteIpAddress IP Address of the system that is not sending the audit message * @ param remoteUserNodeIpAddress IP Address of the user system requesting the login authentication */ public void auditUserAuthenticationLoginEvent ( RFC3881EventOutcomeCodes outcome , boolean isAuthenticatedSystem , String remoteUserId , String remoteIpAddress , String remoteUserNodeIpAddress ) { } }
auditUserAuthenticationEvent ( outcome , new DICOMEventTypeCodes . Login ( ) , isAuthenticatedSystem , remoteUserId , remoteIpAddress , remoteUserNodeIpAddress ) ;
public class ContainerDatasetAction { /** * The values of variables used within the context of the execution of the containerized application ( basically , * parameters passed to the application ) . Each variable must have a name and a value given by one of " stringValue " , * " datasetContentVersionValue " , or " outputFileUriValue " . * @ param variables * The values of variables used within the context of the execution of the containerized application * ( basically , parameters passed to the application ) . Each variable must have a name and a value given by one * of " stringValue " , " datasetContentVersionValue " , or " outputFileUriValue " . */ public void setVariables ( java . util . Collection < Variable > variables ) { } }
if ( variables == null ) { this . variables = null ; return ; } this . variables = new java . util . ArrayList < Variable > ( variables ) ;
public class AWSIotClient { /** * Creates an AWS IoT OTAUpdate on a target group of things or groups . * @ param createOTAUpdateRequest * @ return Result of the CreateOTAUpdate operation returned by the service . * @ throws InvalidRequestException * The request is not valid . * @ throws LimitExceededException * A limit has been exceeded . * @ throws ResourceNotFoundException * The specified resource does not exist . * @ throws ResourceAlreadyExistsException * The resource already exists . * @ throws ThrottlingException * The rate exceeds the limit . * @ throws UnauthorizedException * You are not authorized to perform this operation . * @ throws InternalFailureException * An unexpected error has occurred . * @ throws ServiceUnavailableException * The service is temporarily unavailable . * @ sample AWSIot . CreateOTAUpdate */ @ Override public CreateOTAUpdateResult createOTAUpdate ( CreateOTAUpdateRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCreateOTAUpdate ( request ) ;
public class ProfileManager { /** * This method is invoked by searchImpl ( ) to make sure that each * adapter receives only its corresponding checkpoint in the change * control . * @ param searchDO Input search DataObject * @ param reposId Identifier for the repository whose checkpoint needs to be retained * @ return Object for search containing checkpoint corresponding to reposId only */ @ Trivial private Root keepCheckPointForReposOnly ( Root searchDO , String reposId ) { } }
Root retDO = new Root ( ) ; Map < String , Control > ctrlsMap = ControlsHelper . getControlMap ( searchDO ) ; ChangeControl changeCtrl = ( ChangeControl ) ctrlsMap . get ( DO_CHANGE_CONTROL ) ; ChangeControl returnChangeControl = new ChangeControl ( ) ; CheckPointType returnCheckPoint = new CheckPointType ( ) ; returnChangeControl . getCheckPoint ( ) . add ( returnCheckPoint ) ; retDO . getControls ( ) . add ( returnChangeControl ) ; List < CheckPointType > checkPointList = changeCtrl . getCheckPoint ( ) ; if ( checkPointList != null ) { for ( CheckPointType checkPointDO : checkPointList ) { if ( checkPointDO . getRepositoryId ( ) . equals ( reposId ) ) { returnCheckPoint . setRepositoryCheckPoint ( checkPointDO . getRepositoryCheckPoint ( ) ) ; returnCheckPoint . setRepositoryId ( checkPointDO . getRepositoryId ( ) ) ; } } } return retDO ;
public class LabelParameterVersionRequest { /** * One or more labels to attach to the specified parameter version . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setLabels ( java . util . Collection ) } or { @ link # withLabels ( java . util . Collection ) } if you want to override the * existing values . * @ param labels * One or more labels to attach to the specified parameter version . * @ return Returns a reference to this object so that method calls can be chained together . */ public LabelParameterVersionRequest withLabels ( String ... labels ) { } }
if ( this . labels == null ) { setLabels ( new com . amazonaws . internal . SdkInternalList < String > ( labels . length ) ) ; } for ( String ele : labels ) { this . labels . add ( ele ) ; } return this ;
public class GetOperationsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetOperationsRequest getOperationsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getOperationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getOperationsRequest . getPageToken ( ) , PAGETOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Path3ifx { /** * Replies the isMultiParts property . * @ return the isMultiParts property . */ public BooleanProperty isMultiPartsProperty ( ) { } }
if ( this . isMultipart == null ) { this . isMultipart = new ReadOnlyBooleanWrapper ( this , MathFXAttributeNames . IS_MULTIPARTS , false ) ; this . isMultipart . bind ( Bindings . createBooleanBinding ( ( ) -> { boolean foundOne = false ; for ( final PathElementType type : innerTypesProperty ( ) ) { if ( type == PathElementType . MOVE_TO ) { if ( foundOne ) { return true ; } foundOne = true ; } } return false ; } , innerTypesProperty ( ) ) ) ; } return this . isMultipart ;
public class ExpectedConditions { /** * An expectation for checking whether the given frame is available to switch to . < p > If the frame * is available it switches the given driver to the specified frame . * @ param locator used to find the frame * @ return WebDriver instance after frame has been switched */ public static ExpectedCondition < WebDriver > frameToBeAvailableAndSwitchToIt ( final By locator ) { } }
return new ExpectedCondition < WebDriver > ( ) { @ Override public WebDriver apply ( WebDriver driver ) { try { return driver . switchTo ( ) . frame ( driver . findElement ( locator ) ) ; } catch ( NoSuchFrameException e ) { return null ; } } @ Override public String toString ( ) { return "frame to be available: " + locator ; } } ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/bridge/2.0" , name = "_GenericApplicationPropertyOfBridgeInstallation" ) public JAXBElement < Object > create_GenericApplicationPropertyOfBridgeInstallation ( Object value ) { } }
return new JAXBElement < Object > ( __GenericApplicationPropertyOfBridgeInstallation_QNAME , Object . class , null , value ) ;
public class FileHelper { /** * Determines if a character is a valid " safe filename " character ( which we restrict to : alpha , digits , " - " , " _ " and " . " ) * @ param c * @ return */ private static boolean isSafeFilenameCharacter ( char c ) { } }
if ( Character . isLetterOrDigit ( c ) ) { return true ; } else if ( c == '-' || c == '_' || c == '.' ) { return true ; } else { return false ; }
public class PubSub { /** * Wait 5 seconds and then execute periodic { @ link Broadcaster # broadcast ( java . lang . Object ) } * operations . * @ param message A String from an HTML form * @ return A { @ link Broadcastable } used to broadcast events . */ @ Schedule ( period = 10 , waitFor = 5 ) @ POST @ Path ( "delaySchedule" ) public Broadcastable delaySchedule ( @ FormParam ( "message" ) String message ) { } }
return broadcast ( message ) ;
public class Results { /** * Generates a result with the { @ literal 200 - OK } status and with the given XML content . The result has the * { @ literal Content - Type } header set to { @ literal application / xml } . * @ param document the XML document * @ return a new configured result */ public static Result ok ( Document document ) { } }
return status ( Result . OK ) . render ( document ) . as ( MimeTypes . XML ) ;
public class PropertyParser { /** * Parse property . * @ param name property name * @ return property */ public String parseString ( String name ) { } }
String property = getProperties ( ) . getProperty ( name ) ; if ( property == null ) { throw new NullPointerException ( ) ; } return property ;
public class ClassFileUtils { /** * This method cracks open { @ code ClassLoader # defineClass ( ) } methods using { @ code Unsafe } . * It is invoked during { @ code WeldStartup # startContainer ( ) } and only in case the integrator does not * fully implement { @ link ProxyServices } . * Method first attempts to use { @ code Unsafe } and if that fails then reverts to { @ code setAccessible } */ public static void makeClassLoaderMethodsAccessible ( ) { } }
// the AtomicBoolean make sure this gets invoked only once as WeldStartup is triggered per deployment if ( classLoaderMethodsMadeAccessible . compareAndSet ( false , true ) ) { try { AccessController . doPrivileged ( new PrivilegedExceptionAction < Object > ( ) { public Object run ( ) throws Exception { Class < ? > cl = Class . forName ( "java.lang.ClassLoader" ) ; final String name = "defineClass" ; defineClass1 = cl . getDeclaredMethod ( name , String . class , byte [ ] . class , int . class , int . class ) ; defineClass2 = cl . getDeclaredMethod ( name , String . class , byte [ ] . class , int . class , int . class , ProtectionDomain . class ) ; // First try with Unsafe to avoid illegal access try { // get Unsafe singleton instance Field singleoneInstanceField = Unsafe . class . getDeclaredField ( "theUnsafe" ) ; singleoneInstanceField . setAccessible ( true ) ; Unsafe theUnsafe = ( Unsafe ) singleoneInstanceField . get ( null ) ; // get the offset of the override field in AccessibleObject long overrideOffset = theUnsafe . objectFieldOffset ( AccessibleObject . class . getDeclaredField ( "override" ) ) ; // make both accessible theUnsafe . putBoolean ( defineClass1 , overrideOffset , true ) ; theUnsafe . putBoolean ( defineClass2 , overrideOffset , true ) ; return null ; } catch ( NoSuchFieldException e ) { // This is JDK 12 + , the " override " field isn ' t there anymore , fallback to setAccessible ( ) defineClass1 . setAccessible ( true ) ; defineClass2 . setAccessible ( true ) ; return null ; } } } ) ; } catch ( PrivilegedActionException pae ) { throw new RuntimeException ( "cannot initialize ClassPool" , pae . getException ( ) ) ; } }
public class ValidationObjUtil { /** * Gets value . * @ param obj the obj * @ param field the field * @ return the value */ public static Object getValue ( Object obj , String field ) { } }
Method getter = getGetterMethod ( obj . getClass ( ) , field ) ; try { return getter . invoke ( obj ) ; } catch ( IllegalAccessException | InvocationTargetException e ) { return null ; }
public class OverlapResolver { /** * Calculates a score based on the intersection of bonds . * @ param ac The Atomcontainer to work on * @ param overlappingBonds Description of the Parameter * @ return The overlapScore value */ public double getBondOverlapScore ( IAtomContainer ac , Vector overlappingBonds ) { } }
overlappingBonds . removeAllElements ( ) ; double overlapScore = 0 ; IBond bond1 = null ; IBond bond2 = null ; double bondLength = GeometryUtil . getBondLengthAverage ( ac ) ; ; double overlapCutoff = bondLength / 2 ; for ( int f = 0 ; f < ac . getBondCount ( ) ; f ++ ) { bond1 = ac . getBond ( f ) ; for ( int g = f ; g < ac . getBondCount ( ) ; g ++ ) { bond2 = ac . getBond ( g ) ; /* bonds must not be connected */ if ( ! bond1 . isConnectedTo ( bond2 ) ) { if ( areIntersected ( bond1 , bond2 ) ) { overlapScore += overlapCutoff ; overlappingBonds . addElement ( new OverlapPair ( bond1 , bond2 ) ) ; } } } } return overlapScore ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link TimeInstantType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link TimeInstantType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "TimeInstant" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_TimeGeometricPrimitive" ) public JAXBElement < TimeInstantType > createTimeInstant ( TimeInstantType value ) { } }
return new JAXBElement < TimeInstantType > ( _TimeInstant_QNAME , TimeInstantType . class , null , value ) ;
public class JdbcQueue { /** * { @ inheritDoc } * @ throws Exception */ @ Override public JdbcQueue < ID , DATA > init ( ) throws Exception { } }
SQL_COUNT = MessageFormat . format ( SQL_COUNT , getTableName ( ) ) ; SQL_COUNT_EPHEMERAL = MessageFormat . format ( SQL_COUNT_EPHEMERAL , getTableNameEphemeral ( ) ) ; if ( jdbcHelper == null ) { setJdbcHelper ( buildJdbcHelper ( ) , true ) ; } super . init ( ) ; if ( jdbcHelper == null ) { throw new IllegalStateException ( "JDBC helper is null." ) ; } return this ;
public class CreateBankAccountBicMapConstantsClass { /** * Instantiates a class via deferred binding . * @ return the new instance , which must be cast to the requested class */ public static BankAccountBicSharedConstants create ( ) { } }
if ( bicMapConstants == null ) { // NOPMD it ' s thread save ! synchronized ( BankAccountBicConstantsImpl . class ) { if ( bicMapConstants == null ) { final BankAccountBicConstantsImpl bicMapConstantsTmp = new BankAccountBicConstantsImpl ( ) ; COUNTRIES . stream ( ) . forEach ( country -> bicMapConstantsTmp . addBankAccounts ( country , readMapFromProperties ( "BankAccountBic" + country + "Constants" , "bankAccounts" ) ) ) ; bicMapConstants = bicMapConstantsTmp ; } } } return bicMapConstants ;
public class PortalJobStatusChanged { /** * Gets the signature from a given signer . * @ param signer an identifier referring to a signer of the job . It may be a personal identification number or * contact information , depending of how the { @ link PortalSigner signer } was initially created * ( using { @ link PortalSigner # identifiedByPersonalIdentificationNumber ( String , Notifications ) personal identification number } < sup > 1 < / sup > , * { @ link PortalSigner # identifiedByPersonalIdentificationNumber ( String , NotificationsUsingLookup ) personal identification number } < sup > 2 < / sup > , * { @ link PortalSigner # identifiedByEmail ( String ) email address } , { @ link PortalSigner # identifiedByMobileNumber ( String ) mobile number } or * { @ link PortalSigner # identifiedByEmailAndMobileNumber ( String , String ) both email address and mobile number } ) . * < sup > 1 < / sup > : with contact information provided . < br > * < sup > 2 < / sup > : using contact information from a lookup service . * @ throws IllegalArgumentException if the job response doesn ' t contain a signature from this signer */ public Signature getSignatureFrom ( SignerIdentifier signer ) { } }
return signatures . stream ( ) . filter ( signatureFrom ( signer ) ) . findFirst ( ) . orElseThrow ( ( ) -> new IllegalArgumentException ( "Unable to find signature from this signer" ) ) ;
public class AdobePathBuilder { /** * Builds the path . * @ return the path * @ throws javax . imageio . IIOException if the input contains a bad path data . * @ throws IOException if a general I / O exception occurs during reading . */ public Path2D path ( ) throws IOException { } }
List < List < AdobePathSegment > > subPaths = new ArrayList < List < AdobePathSegment > > ( ) ; List < AdobePathSegment > currentPath = null ; int currentPathLength = 0 ; AdobePathSegment segment ; while ( ( segment = nextSegment ( ) ) != null ) { if ( DEBUG ) { System . out . println ( segment ) ; } if ( segment . selector == AdobePathSegment . OPEN_SUBPATH_LENGTH_RECORD || segment . selector == AdobePathSegment . CLOSED_SUBPATH_LENGTH_RECORD ) { if ( currentPath != null ) { if ( currentPathLength != currentPath . size ( ) ) { throw new IIOException ( String . format ( "Bad path, expected %d segments, found only %d" , currentPathLength , currentPath . size ( ) ) ) ; } subPaths . add ( currentPath ) ; } currentPath = new ArrayList < AdobePathSegment > ( segment . length ) ; currentPathLength = segment . length ; } else if ( segment . selector == AdobePathSegment . OPEN_SUBPATH_BEZIER_LINKED || segment . selector == AdobePathSegment . OPEN_SUBPATH_BEZIER_UNLINKED || segment . selector == AdobePathSegment . CLOSED_SUBPATH_BEZIER_LINKED || segment . selector == AdobePathSegment . CLOSED_SUBPATH_BEZIER_UNLINKED ) { if ( currentPath == null ) { throw new IIOException ( "Bad path, missing subpath length record" ) ; } if ( currentPath . size ( ) >= currentPathLength ) { throw new IIOException ( String . format ( "Bad path, expected %d segments, found%d" , currentPathLength , currentPath . size ( ) ) ) ; } currentPath . add ( segment ) ; } } // now add the last one if ( currentPath != null ) { if ( currentPathLength != currentPath . size ( ) ) { throw new IIOException ( String . format ( "Bad path, expected %d segments, found only %d" , currentPathLength , currentPath . size ( ) ) ) ; } subPaths . add ( currentPath ) ; } // now we have collected the PathPoints now create a Shape . return pathToShape ( subPaths ) ;
public class DZcs_spsolve { /** * solve Gx = b ( : , k ) , where G is either upper ( lo = false ) or lower ( lo = true ) * triangular . * @ param G * lower or upper triangular matrix in column - compressed form * @ param B * right hand side , b = B ( : , k ) * @ param k * use kth column of B as right hand side * @ param xi * size 2 * n , nonzero pattern of x in xi [ top . . n - 1] * @ param x * size n , x in x [ xi [ top . . n - 1 ] ] * @ param pinv * mapping of rows to columns of G , ignored if null * @ param lo * true if lower triangular , false if upper * @ return top , - 1 in error */ public static int cs_spsolve ( DZcs G , DZcs B , int k , int [ ] xi , DZcsa x , int [ ] pinv , boolean lo ) { } }
int j , J , p , q , px , top , n , Gp [ ] , Gi [ ] , Bp [ ] , Bi [ ] ; DZcsa Gx = new DZcsa ( ) , Bx = new DZcsa ( ) ; if ( ! CS_CSC ( G ) || ! CS_CSC ( B ) || xi == null || x == null ) return ( - 1 ) ; Gp = G . p ; Gi = G . i ; Gx . x = G . x ; n = G . n ; Bp = B . p ; Bi = B . i ; Bx . x = B . x ; top = cs_reach ( G , B , k , xi , pinv ) ; /* xi [ top . . n - 1 ] = Reach ( B ( : , k ) ) */ for ( p = top ; p < n ; p ++ ) x . set ( xi [ p ] , cs_czero ( ) ) ; /* clear x */ for ( p = Bp [ k ] ; p < Bp [ k + 1 ] ; p ++ ) x . set ( Bi [ p ] , Bx . get ( p ) ) ; /* scatter B */ for ( px = top ; px < n ; px ++ ) { j = xi [ px ] ; /* x ( j ) is nonzero */ J = pinv != null ? ( pinv [ j ] ) : j ; /* j maps to col J of G */ if ( J < 0 ) continue ; /* column J is empty */ x . set ( j , cs_cdiv ( x . get ( j ) , Gx . get ( lo ? ( Gp [ J ] ) : ( Gp [ J + 1 ] - 1 ) ) ) ) ; /* x ( j ) / = G ( j , j ) */ p = lo ? ( Gp [ J ] + 1 ) : ( Gp [ J ] ) ; /* lo : L ( j , j ) 1st entry */ q = lo ? ( Gp [ J + 1 ] ) : ( Gp [ J + 1 ] - 1 ) ; /* up : U ( j , j ) last entry */ for ( ; p < q ; p ++ ) { x . set ( Gi [ p ] , cs_cminus ( x . get ( Gi [ p ] ) , cs_cmult ( Gx . get ( p ) , x . get ( j ) ) ) ) ; /* x ( i ) - = G ( i , j ) * x ( j ) */ } } return ( top ) ; /* return top of stack */
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertObjectOriginIdentifierSystemToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class InternalSARLParser { /** * $ ANTLR start synpred12 _ InternalSARL */ public final void synpred12_InternalSARL_fragment ( ) throws RecognitionException { } }
// InternalSARL . g : 8629:6 : ( ( ( ( ruleJvmFormalParameter ) ) ' = ' ) ) // InternalSARL . g : 8629:7 : ( ( ( ruleJvmFormalParameter ) ) ' = ' ) { // InternalSARL . g : 8629:7 : ( ( ( ruleJvmFormalParameter ) ) ' = ' ) // InternalSARL . g : 8630:7 : ( ( ruleJvmFormalParameter ) ) ' = ' { // InternalSARL . g : 8630:7 : ( ( ruleJvmFormalParameter ) ) // InternalSARL . g : 8631:8 : ( ruleJvmFormalParameter ) { // InternalSARL . g : 8631:8 : ( ruleJvmFormalParameter ) // InternalSARL . g : 8632:9 : ruleJvmFormalParameter { pushFollow ( FOLLOW_83 ) ; ruleJvmFormalParameter ( ) ; state . _fsp -- ; if ( state . failed ) return ; } } match ( input , 47 , FOLLOW_2 ) ; if ( state . failed ) return ; } }
public class DatabaseAdvisorsInner { /** * Returns a list of database advisors . * @ 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 databaseName The name of the database . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the AdvisorListResultInner object */ public Observable < AdvisorListResultInner > listByDatabaseAsync ( String resourceGroupName , String serverName , String databaseName ) { } }
return listByDatabaseWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < AdvisorListResultInner > , AdvisorListResultInner > ( ) { @ Override public AdvisorListResultInner call ( ServiceResponse < AdvisorListResultInner > response ) { return response . body ( ) ; } } ) ;
public class ControllerEventSerializer { /** * Serializes the given { @ link ControllerEvent } to a { @ link ByteBuffer } . * @ param value The { @ link ControllerEvent } to serialize . * @ return A new { @ link ByteBuffer } wrapping an array that contains the serialization . */ @ SneakyThrows ( IOException . class ) public ByteBuffer toByteBuffer ( ControllerEvent value ) { } }
ByteArraySegment s = serialize ( value ) ; return ByteBuffer . wrap ( s . array ( ) , s . arrayOffset ( ) , s . getLength ( ) ) ;
public class VectorLayerPainter { /** * The actual painting function . Draws the groups . * @ param paintable * A { @ link VectorLayer } object . * @ param group * The group where the object resides in ( optional ) . * @ param context * A MapContext object , responsible for actual drawing . */ public void paint ( Paintable paintable , Object group , MapContext context ) { } }
VectorLayer layer = ( VectorLayer ) paintable ; PictureStyle opacityStyle = new PictureStyle ( layer . getOpacity ( ) ) ; // Create the needed groups in the correct order : context . getVectorContext ( ) . drawGroup ( mapWidget . getGroup ( RenderGroup . VECTOR ) , layer , opacityStyle ) ; context . getVectorContext ( ) . drawGroup ( layer , layer . getFeatureGroup ( ) ) ; context . getVectorContext ( ) . drawGroup ( layer , layer . getSelectionGroup ( ) ) ; FontStyle labelStyle = getLabelFontstyle ( layer ) ; context . getVectorContext ( ) . drawGroup ( layer , layer . getLabelGroup ( ) , labelStyle ) ; // Create the needed groups in the correct order : context . getRasterContext ( ) . drawGroup ( mapWidget . getGroup ( RenderGroup . RASTER ) , layer , opacityStyle ) ; context . getRasterContext ( ) . drawGroup ( layer , layer . getFeatureGroup ( ) ) ; context . getRasterContext ( ) . drawGroup ( layer , layer . getLabelGroup ( ) ) ; // Draw symbol types , as these can change any time : LayerType layerType = layer . getLayerInfo ( ) . getLayerType ( ) ; if ( LayerType . POINT == layerType || LayerType . MULTIPOINT == layerType || LayerType . GEOMETRY == layerType ) { for ( FeatureStyleInfo style : layer . getLayerInfo ( ) . getNamedStyleInfo ( ) . getFeatureStyles ( ) ) { context . getVectorContext ( ) . drawSymbolDefinition ( null , style . getStyleId ( ) , style . getSymbol ( ) , new ShapeStyle ( style ) , null ) ; } } // Check layer visibility : if ( layer . isShowing ( ) ) { context . getVectorContext ( ) . unhide ( layer ) ; context . getRasterContext ( ) . unhide ( layer ) ; } else { context . getVectorContext ( ) . hide ( layer ) ; context . getRasterContext ( ) . hide ( layer ) ; } // Check label visibility : if ( layer . isLabelsShowing ( ) ) { context . getVectorContext ( ) . unhide ( layer . getLabelGroup ( ) ) ; context . getRasterContext ( ) . unhide ( layer . getLabelGroup ( ) ) ; } else { context . getVectorContext ( ) . hide ( layer . getLabelGroup ( ) ) ; context . getRasterContext ( ) . hide ( layer . getLabelGroup ( ) ) ; }
public class StreamMessageHeader { /** * Add key to history . * @ param historyKey history key */ public void addHistory ( Object historyKey ) { } }
if ( this . history == null ) { this . history = new KeyHistory ( ) ; } this . history . addKey ( historyKey . toString ( ) ) ;
public class ExpressRouteCircuitsInner { /** * Gets all stats from an express route circuit in a resource group . * @ param resourceGroupName The name of the resource group . * @ param circuitName The name of the express route circuit . * @ param peeringName The name of the peering . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ExpressRouteCircuitStatsInner object */ public Observable < ServiceResponse < ExpressRouteCircuitStatsInner > > getPeeringStatsWithServiceResponseAsync ( String resourceGroupName , String circuitName , String peeringName ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( circuitName == null ) { throw new IllegalArgumentException ( "Parameter circuitName is required and cannot be null." ) ; } if ( peeringName == null ) { throw new IllegalArgumentException ( "Parameter peeringName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } final String apiVersion = "2018-06-01" ; return service . getPeeringStats ( resourceGroupName , circuitName , peeringName , this . client . subscriptionId ( ) , apiVersion , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ExpressRouteCircuitStatsInner > > > ( ) { @ Override public Observable < ServiceResponse < ExpressRouteCircuitStatsInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ExpressRouteCircuitStatsInner > clientResponse = getPeeringStatsDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class StandardServiceAgentServer { /** * Main method to start this service agent . * < br / > * It accepts a single program argument , the file path of the configuration file that overrides the * defaults for this service agent * @ param args the program arguments * @ throws IOException in case the configuration file cannot be read */ public static void main ( String [ ] args ) throws IOException { } }
Settings settings = null ; if ( args . length > 0 ) settings = PropertiesSettings . from ( new File ( args [ 0 ] ) ) ; Server server = newInstance ( settings ) ; server . start ( ) ;
public class JobScheduler { /** * Updates the job . * < p > This just updates the job , but it doesn ' t schedule it . In order to be executed , the job has * to be scheduled after being set . In case there was a previous job scheduled that has not yet * started , this new job will be executed instead . * @ return whether the job was successfully updated . */ public boolean updateJob ( EncodedImage encodedImage , @ Consumer . Status int status ) { } }
if ( ! shouldProcess ( encodedImage , status ) ) { return false ; } EncodedImage oldEncodedImage ; synchronized ( this ) { oldEncodedImage = mEncodedImage ; mEncodedImage = EncodedImage . cloneOrNull ( encodedImage ) ; mStatus = status ; } EncodedImage . closeSafely ( oldEncodedImage ) ; return true ;
public class Javalin { /** * Adds a HEAD request handler with the given roles for the specified path to the instance . * Requires an access manager to be set on the instance . * @ see AccessManager * @ see < a href = " https : / / javalin . io / documentation # handlers " > Handlers in docs < / a > */ public Javalin head ( @ NotNull String path , @ NotNull Handler handler , @ NotNull Set < Role > permittedRoles ) { } }
return addHandler ( HandlerType . HEAD , path , handler , permittedRoles ) ;
public class VaultsInner { /** * Fetches all the resources of the specified type in the subscription . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; VaultInner & gt ; object */ public Observable < Page < VaultInner > > listAsync ( ) { } }
return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < VaultInner > > , Page < VaultInner > > ( ) { @ Override public Page < VaultInner > call ( ServiceResponse < Page < VaultInner > > response ) { return response . body ( ) ; } } ) ;
public class iptunnel { /** * Use this API to fetch iptunnel resource of given name . */ public static iptunnel get ( nitro_service service , String name ) throws Exception { } }
iptunnel obj = new iptunnel ( ) ; obj . set_name ( name ) ; iptunnel response = ( iptunnel ) obj . get_resource ( service ) ; return response ;
public class druidGLexer { /** * $ ANTLR start " ON " */ public final void mON ( ) throws RecognitionException { } }
try { int _type = ON ; int _channel = DEFAULT_TOKEN_CHANNEL ; // druidG . g : 658:5 : ( ( ' ON ' ) ) // druidG . g : 658:7 : ( ' ON ' ) { // druidG . g : 658:7 : ( ' ON ' ) // druidG . g : 658:8 : ' ON ' { match ( "ON" ) ; } } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class AbstractThriftServerImpl { /** * 启动Thrift服务 * @ exception IkasoaException * 异常 */ public void start ( ) throws IkasoaException { } }
if ( server == null ) { log . debug ( "Server configuration : {}" , configuration ) ; // 不允许使用1024以内的端口 . if ( ! ServerUtil . isSocketPort ( serverPort ) ) throw new IkasoaException ( String . format ( "Server initialize failed ! Port range must is 1025 ~ 65535 . Your port is : %d ." , serverPort ) ) ; try { initServer ( getTransport ( ) ) ; } catch ( TTransportException e ) { throw new IkasoaException ( "Server initialize failed !" , e ) ; } } // 如果服务没有启动 , 则自动启动服务 . if ( server != null ) { if ( server . isServing ( ) ) { log . info ( "Server already run ." ) ; return ; } server . serve ( ) ; log . info ( "Startup server ... (name : {} , port : {})" , getServerName ( ) , getServerPort ( ) ) ; } else log . warn ( "Startup server failed !" ) ;
import java . util . * ; class CheckSequenceLinearity { /** * Function checks if a given sequence is linear or not . * Args : * numbers ( ArrayList ) : A sequence of numbers * Returns : * String : ' Linear Sequence ' if it ' s a linear sequence , ' Non Linear Sequence ' otherwise . * Examples : * > > > checkSequenceLinearity ( [ 0 , 2 , 4 , 6 , 8 , 10 ] ) * ' Linear Sequence ' * > > > check _ sequence _ linearity ( [ 1 , 2 , 3 ] ) * ' Linear Sequence ' * > > > check _ sequence _ linearity ( [ 1 , 5 , 2 ] ) * ' Non Linear Sequence ' */ public static String checkSequenceLinearity ( ArrayList < Integer > numbers ) { } }
ArrayList < Integer > diffs = new ArrayList < > ( numbers . size ( ) - 1 ) ; for ( int i = 1 ; i < numbers . size ( ) ; i ++ ) { diffs . add ( numbers . get ( i ) - numbers . get ( i - 1 ) ) ; } Set < Integer > uniqueDiffs = new HashSet < > ( diffs ) ; return uniqueDiffs . size ( ) == 1 ? "Linear Sequence" : "Non Linear Sequence" ;
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link ObjectNotFoundException } with the given { @ link Throwable cause } * and { @ link String message } formatted with the given { @ link Object [ ] arguments } . * @ param cause { @ link Throwable } identified as the reason this { @ link ObjectNotFoundException } was thrown . * @ param message { @ link String } describing the { @ link ObjectNotFoundException exception } . * @ param args { @ link Object [ ] arguments } used to replace format placeholders in the { @ link String message } . * @ return a new { @ link ObjectNotFoundException } with the given { @ link Throwable cause } and { @ link String message } . * @ see org . cp . elements . lang . ObjectNotFoundException */ public static ObjectNotFoundException newObjectNotFoundException ( Throwable cause , String message , Object ... args ) { } }
return new ObjectNotFoundException ( format ( message , args ) , cause ) ;
public class XMLUtil { /** * Append a space , then a new element to the appendable element , the name of the element is * attrName and the value is attrValue . The value won ' t be escaped . * @ param appendable where to write * @ param attrName the name of the attribute * @ param attrValue escaped attribute * @ throws IOException If an I / O error occurs */ public void appendAttribute ( final Appendable appendable , final CharSequence attrName , final CharSequence attrValue ) throws IOException { } }
appendable . append ( ' ' ) . append ( attrName ) . append ( "=\"" ) . append ( attrValue ) . append ( '"' ) ;
public class FilesImpl { /** * Lists all of the files in task directories on the specified compute node . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ param fileListFromComputeNodeNextOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; NodeFile & gt ; object if successful . */ public PagedList < NodeFile > listFromComputeNodeNext ( final String nextPageLink , final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions ) { } }
ServiceResponseWithHeaders < Page < NodeFile > , FileListFromComputeNodeHeaders > response = listFromComputeNodeNextSinglePageAsync ( nextPageLink , fileListFromComputeNodeNextOptions ) . toBlocking ( ) . single ( ) ; return new PagedList < NodeFile > ( response . body ( ) ) { @ Override public Page < NodeFile > nextPage ( String nextPageLink ) { return listFromComputeNodeNextSinglePageAsync ( nextPageLink , fileListFromComputeNodeNextOptions ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class RequireActiveProfile { /** * Checks if profile is active . * @ param project the project * @ param profileName the profile name * @ return < code > true < / code > if profile is active , otherwise < code > false < / code > */ protected boolean isProfileActive ( MavenProject project , String profileName ) { } }
@ SuppressWarnings ( "unchecked" ) List < Profile > activeProfiles = project . getActiveProfiles ( ) ; if ( activeProfiles != null && ! activeProfiles . isEmpty ( ) ) { for ( Profile profile : activeProfiles ) { if ( profile . getId ( ) . equals ( profileName ) ) { return true ; } } } return false ;
public class Bytes { /** * Decode from hexadecimal */ public static byte [ ] fromHex ( String hex ) { } }
char [ ] c = hex . toCharArray ( ) ; byte [ ] b = new byte [ c . length / 2 ] ; for ( int i = 0 ; i < b . length ; i ++ ) { b [ i ] = ( byte ) ( HEX_DECODE_CHAR [ c [ i * 2 ] & 0xFF ] * 16 + HEX_DECODE_CHAR [ c [ i * 2 + 1 ] & 0xFF ] ) ; } return b ;
public class OnLineStatistics { /** * Computes a new set of statistics that is the equivalent of having removed * all observations in { @ code B } from { @ code A } . < br > * NOTE : removing statistics is not as numerically stable . The values of the * 3rd and 4th moments { @ link # getSkewness ( ) } and { @ link # getKurtosis ( ) } * will be inaccurate for many inputs . The { @ link # getMin ( ) min } and * { @ link # getMax ( ) max } can not be determined in this setting , and will not * be altered . * @ param A the first set of statistics , which must have a larger value for * { @ link # getSumOfWeights ( ) } than { @ code B } * @ param B the set of statistics to remove from { @ code A } . * @ return a new set of statistics that is the removal of { @ code B } from * { @ code A } */ public static OnLineStatistics remove ( OnLineStatistics A , OnLineStatistics B ) { } }
OnLineStatistics toRet = A . clone ( ) ; toRet . remove ( B ) ; return toRet ;
public class PhoneNumberUtil { /** * format phone number in E123 format with cursor position handling . * @ param pphoneNumberData phone number to format with cursor position * @ param pcountryData country data * @ return formated phone number as String with new cursor position */ public final ValueWithPos < String > formatE123WithPos ( final ValueWithPos < PhoneNumberData > pphoneNumberData , final PhoneCountryData pcountryData ) { } }
if ( pphoneNumberData != null && pcountryData != null && StringUtils . equals ( pcountryData . getCountryCodeData ( ) . getCountryCode ( ) , pphoneNumberData . getValue ( ) . getCountryCode ( ) ) ) { return this . formatE123NationalWithPos ( pphoneNumberData ) ; } else { return this . formatE123InternationalWithPos ( pphoneNumberData ) ; }
public class PGPKeyValidator { /** * Validates a PGP public key . * @ param value value to validate * @ param crypto crypto implementation to carry out additional checks * @ throws BadPublicKeyException thrown if validation fails ; getMessage ( ) * contains error code */ public static void validatePublicKey ( String value , PublicKeyCrypto crypto ) throws BadPublicKeyException { } }
if ( org . springframework . util . StringUtils . hasText ( value ) ) { int open = value . indexOf ( "-----BEGIN PGP PUBLIC KEY BLOCK-----" ) ; int close = value . indexOf ( "-----END PGP PUBLIC KEY BLOCK-----" ) ; if ( open < 0 ) { throw new BadPublicKeyException ( "PublicKeyValidator.noBeginBlock" ) ; } if ( close < 0 ) { throw new BadPublicKeyException ( "PublicKeyValidator.noEndBlock" ) ; } if ( open >= 0 && close >= 0 && open >= close ) { throw new BadPublicKeyException ( "PublicKeyValidator.wrongBlockOrder" ) ; } if ( ! crypto . isPublicKeyValid ( value ) ) { throw new BadPublicKeyException ( "PublicKeyValidator.invalidKey" ) ; } }
public class Iterators { /** * Returns a list that represents [ start , end ) . * For example sequence ( 1,5,1 ) = { 1,2,3,4 } , and sequence ( 7,1 , - 2 ) = { 7.5,3} * @ since 1.150 */ public static List < Integer > sequence ( final int start , int end , final int step ) { } }
final int size = ( end - start ) / step ; if ( size < 0 ) throw new IllegalArgumentException ( "List size is negative" ) ; return new AbstractList < Integer > ( ) { public Integer get ( int index ) { if ( index < 0 || index >= size ) throw new IndexOutOfBoundsException ( ) ; return start + index * step ; } public int size ( ) { return size ; } } ;
public class ThriftHttpServlet { /** * Do the GSS - API kerberos authentication . * We already have a logged in subject in the form of serviceUGI , * which GSS - API will extract information from . * In case of a SPNego request we use the httpUGI , * for the authenticating service tickets . * @ param request * @ return * @ throws HttpAuthenticationException */ private String doKerberosAuth ( HttpServletRequest request ) throws HttpAuthenticationException { } }
// Try authenticating with the http / _ HOST principal if ( httpUGI != null ) { try { return httpUGI . doAs ( new HttpKerberosServerAction ( request , httpUGI ) ) ; } catch ( Exception e ) { LOG . info ( "Failed to authenticate with http/_HOST kerberos principal, " + "trying with hive/_HOST kerberos principal" ) ; } } // Now try with hive / _ HOST principal try { return serviceUGI . doAs ( new HttpKerberosServerAction ( request , serviceUGI ) ) ; } catch ( Exception e ) { LOG . error ( "Failed to authenticate with hive/_HOST kerberos principal" ) ; throw new HttpAuthenticationException ( e ) ; }
public class ChainerServlet { /** * Initialize the servlet chainer . */ @ SuppressWarnings ( "unchecked" ) public void init ( ) throws ServletException { } }
// Method re - written for PQ47469 String servlets = getRequiredInitParameter ( PARAM_SERVLET_PATHS ) ; StringTokenizer sTokenizer = new StringTokenizer ( servlets ) ; Vector servletChainPath = new Vector ( ) ; while ( sTokenizer . hasMoreTokens ( ) == true ) { String path = sTokenizer . nextToken ( ) . trim ( ) ; if ( path . length ( ) > 0 ) { servletChainPath . addElement ( path ) ; } } int chainLength = servletChainPath . size ( ) ; if ( chainLength > 0 ) { this . chainPath = new String [ chainLength ] ; for ( int index = 0 ; index < chainLength ; ++ index ) { this . chainPath [ index ] = ( String ) servletChainPath . elementAt ( index ) ; } }
public class PooledObjects { /** * Converts the given object to an unpooled copy and releases the given object . */ public static < T > T toUnpooled ( T o ) { } }
if ( o instanceof ByteBufHolder ) { o = copyAndRelease ( ( ByteBufHolder ) o ) ; } else if ( o instanceof ByteBuf ) { o = copyAndRelease ( ( ByteBuf ) o ) ; } return o ;
public class ResponseMessage { /** * @ see javax . servlet . http . HttpServletResponse # sendRedirect ( java . lang . String ) */ @ Override public void sendRedirect ( String location ) throws IOException { } }
if ( isCommitted ( ) ) { throw new IllegalStateException ( "Response already committed" ) ; } if ( null == location ) { throw new IllegalArgumentException ( "Location is null" ) ; } resetBuffer ( ) ; this . response . setHeader ( "Location" , convertURItoURL ( location . trim ( ) ) ) ; this . response . setStatus ( 307 ) ; flushBuffer ( ) ;
public class ComplianceByConfigRuleMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ComplianceByConfigRule complianceByConfigRule , ProtocolMarshaller protocolMarshaller ) { } }
if ( complianceByConfigRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( complianceByConfigRule . getConfigRuleName ( ) , CONFIGRULENAME_BINDING ) ; protocolMarshaller . marshall ( complianceByConfigRule . getCompliance ( ) , COMPLIANCE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Apptentive { /** * Sends a file to the server . This file will be visible in the conversation view on the server , but will not be shown * in the client ' s Message Center . A local copy of this file will be made until the message is transmitted , at which * point the temporary file will be deleted . * @ param uri The URI of the local resource file . */ public static void sendAttachmentFile ( final String uri ) { } }
dispatchConversationTask ( new ConversationDispatchTask ( ) { @ Override protected boolean execute ( Conversation conversation ) { if ( TextUtils . isEmpty ( uri ) ) { return false ; // TODO : add error message } CompoundMessage message = new CompoundMessage ( ) ; // No body , just attachment message . setBody ( null ) ; message . setRead ( true ) ; message . setHidden ( true ) ; message . setSenderId ( conversation . getPerson ( ) . getId ( ) ) ; ArrayList < StoredFile > attachmentStoredFiles = new ArrayList < StoredFile > ( ) ; /* Make a local copy in the cache dir . By default the file name is " apptentive - api - file + nonce " * If original uri is known , the name will be taken from the original uri */ Context context = ApptentiveInternal . getInstance ( ) . getApplicationContext ( ) ; String localFilePath = Util . generateCacheFilePathFromNonceOrPrefix ( context , message . getNonce ( ) , Uri . parse ( uri ) . getLastPathSegment ( ) ) ; String mimeType = Util . getMimeTypeFromUri ( context , Uri . parse ( uri ) ) ; MimeTypeMap mime = MimeTypeMap . getSingleton ( ) ; String extension = mime . getExtensionFromMimeType ( mimeType ) ; // If we can ' t get the mime type from the uri , try getting it from the extension . if ( extension == null ) { extension = MimeTypeMap . getFileExtensionFromUrl ( uri ) ; } if ( mimeType == null && extension != null ) { mimeType = mime . getMimeTypeFromExtension ( extension ) ; } if ( ! TextUtils . isEmpty ( extension ) ) { localFilePath += "." + extension ; } StoredFile storedFile = Util . createLocalStoredFile ( uri , localFilePath , mimeType ) ; if ( storedFile == null ) { return false ; // TODO : add error message } storedFile . setId ( message . getNonce ( ) ) ; attachmentStoredFiles . add ( storedFile ) ; message . setAssociatedFiles ( attachmentStoredFiles ) ; conversation . getMessageManager ( ) . sendMessage ( message ) ; return true ; } } , "send attachment file" ) ;
public class LocalPortletRequestContextServiceImpl { /** * / * ( non - Javadoc ) * @ see org . apache . pluto . container . PortletRequestContextService # getPortletResourceRequestContext ( org . apache . pluto . container . PortletContainer , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse , org . apache . pluto . container . PortletWindow ) */ @ Override public PortletResourceRequestContext getPortletResourceRequestContext ( PortletContainer container , HttpServletRequest containerRequest , HttpServletResponse containerResponse , PortletWindow window ) { } }
final IPortletWindow portletWindow = this . portletWindowRegistry . convertPortletWindow ( containerRequest , window ) ; final IPortalRequestInfo portalRequestInfo = this . urlSyntaxProvider . getPortalRequestInfo ( containerRequest ) ; return new PortletResourceRequestContextImpl ( container , portletWindow , containerRequest , containerResponse , this . requestPropertiesManager , portalRequestInfo , this . portletCookieService , requestAttributeService ) ;
public class ManagedProperties { /** * Retrieve a { @ link Properties } object that contains the properties managed * by this instance . If a non - < code > null < / code > property name is given , the * values will be the last saved value for each property except the given * one . Otherwise , the properties will all be the current values . This is * useful for saving a change to a single property to disk without also * saving any other changes that have been made . < br > * < br > * Please note that the returned { @ link Properties } object is not connected * in any way to this instance and is only a snapshot of what the properties * looked like at the time the request was fulfilled . * @ param includeDefaults * if < code > true < / code > , values that match the default will be * stored directly in the properties map ; otherwise values * matching the default will only be available through the * { @ link Properties } concept of defaults ( as a fallback and not * written to the file system if this object is stored ) * @ param propertyName * the name of the property whose current value should be * provided while all others will be the last saved value ( if * this is < code > null < / code > , all values will be current ) * @ return a { @ link Properties } instance containing the properties managed * by this instance ( including defaults as defined by the given * flag ) */ public Properties getProperties ( boolean includeDefaults , String propertyName ) { } }
Properties tmpProperties = new Properties ( defaults ) ; for ( Entry < String , ChangeStack < String > > entry : properties . entrySet ( ) ) { String entryName = entry . getKey ( ) ; /* * If we are only concerned with a single property , we need to grab * the last saved value for all of the other properties . */ String value = propertyName == null || propertyName . equals ( entryName ) ? entry . getValue ( ) . getCurrentValue ( ) : entry . getValue ( ) . getSyncedValue ( ) ; /* * The value could be null if the property has no default , was set * without saving , and now the saved value is requested . In which * case , like the case of a default value where defaults are not * being included , the property can be skipped . */ if ( value == null || ( ! includeDefaults && value . equals ( getDefaultValue ( entryName ) ) ) ) { continue ; } tmpProperties . setProperty ( entryName , value ) ; } return tmpProperties ;
public class sslcertkey_crldistribution_binding { /** * Use this API to count sslcertkey _ crldistribution _ binding resources configued on NetScaler . */ public static long count ( nitro_service service , String certkey ) throws Exception { } }
sslcertkey_crldistribution_binding obj = new sslcertkey_crldistribution_binding ( ) ; obj . set_certkey ( certkey ) ; options option = new options ( ) ; option . set_count ( true ) ; sslcertkey_crldistribution_binding response [ ] = ( sslcertkey_crldistribution_binding [ ] ) obj . get_resources ( service , option ) ; if ( response != null ) { return response [ 0 ] . __count ; } return 0 ;
public class UserExecutorConfiguration { /** * Construct a { @ link UserExecutorConfiguration } for the given { @ link io . micronaut . scheduling . executor . ExecutorType } . * @ param type The type * @ param num The number of threads for { @ link io . micronaut . scheduling . executor . ExecutorType # FIXED } or the parallelism for * { @ link io . micronaut . scheduling . executor . ExecutorType # WORK _ STEALING } or the core pool size for { @ link io . micronaut . scheduling . executor . ExecutorType # SCHEDULED } * @ param threadFactoryClass The thread factory class * @ return The configuration */ public static UserExecutorConfiguration of ( ExecutorType type , int num , @ Nullable Class < ? extends ThreadFactory > threadFactoryClass ) { } }
UserExecutorConfiguration configuration = of ( type , num ) ; if ( threadFactoryClass != null ) { configuration . threadFactoryClass = threadFactoryClass ; } return configuration ;
public class KmeansUpdater { /** * { @ inheritDoc } */ @ Override public void updateState ( MapState < KmeansDataSet > state , List < TridentTuple > tuples , TridentCollector collector ) { } }
// データが流れてきていない場合はupdateStateメソッドが呼ばれないため 、 本メソッド内ではデータが存在するとして扱う 。 List < KmeansDataSet > dataSets = state . multiGet ( Arrays . asList ( Arrays . asList ( ( Object ) this . stateName ) ) ) ; KmeansDataSet dataSet = null ; if ( dataSets != null && ! dataSets . isEmpty ( ) ) { dataSet = dataSets . get ( 0 ) ; } // TupleからKMeans用データを抽出する 。 List < KmeansPoint > receiveList = new ArrayList < > ( ) ; for ( TridentTuple targetTuple : tuples ) { KmeansPoint recievedPoint = ( KmeansPoint ) targetTuple . get ( 0 ) ; receiveList . add ( recievedPoint ) ; } // 投入されたKMeans用点から学習モデルを生成する 。 KmeansDataSet generatedDataSet = KmeansCalculator . createDataModel ( receiveList , this . clusterNum , this . maxIteration , this . convergenceThreshold ) ; if ( generatedDataSet != null ) { dataSet = generatedDataSet ; } // 元々データモデルが存在せず 、 かつ投入された点が不足しており学習モデルが生成できなかった場合 、 以後の処理は行わない 。 if ( dataSet == null ) { return ; } // データ通知拡張ポイントに値が設定されていた場合 、 クラスタリング結果を算出し 、 通知を行う 。 if ( this . dataNotifier != null ) { for ( KmeansPoint targetPoint : receiveList ) { KmeansResult result = KmeansCalculator . classify ( targetPoint , dataSet ) ; this . dataNotifier . notifyResult ( result ) ; } } // Save model state . multiPut ( Arrays . asList ( Arrays . asList ( ( Object ) this . stateName ) ) , Arrays . asList ( dataSet ) ) ; if ( this . batchNotifier != null ) { this . batchNotifier . notifyResult ( dataSet ) ; }
public class QueryString { /** * Apply this url QueryString on the given URL . If a query string already * exists , it is replaced by this one . * @ param url the URL to apply this query string . * @ return url with query string added */ public URL applyOnURL ( URL url ) { } }
if ( url == null ) { return url ; } try { return new URL ( applyOnURL ( url . toString ( ) ) ) ; } catch ( MalformedURLException e ) { throw new RuntimeException ( "Cannot applyl query string to: " + url , e ) ; }
public class CmsHtmlList { /** * This method returns the item identified by the parameter id . < p > * Only current visible item can be retrieved using this method . < p > * @ param id the id of the item to look for * @ return the requested item or < code > null < / code > if not found */ public CmsListItem getItem ( String id ) { } }
Iterator < CmsListItem > it = getAllContent ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { CmsListItem item = it . next ( ) ; if ( item . getId ( ) . equals ( id ) ) { return item ; } } return null ;
public class PreferenceFragment { /** * Initializes the preference , which allows to show the single choice list dialog . */ private void initializeShowSingleChoiceListDialogPreference ( ) { } }
Preference preference = findPreference ( getString ( R . string . show_single_choice_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { @ Override public boolean onPreferenceClick ( final Preference preference ) { initializeSingleChoiceListDialog ( ) ; singleChoiceListDialog . setShowAnimation ( createRectangularRevealAnimation ( preference ) ) ; singleChoiceListDialog . setDismissAnimation ( createRectangularRevealAnimation ( preference ) ) ; singleChoiceListDialog . setCancelAnimation ( createRectangularRevealAnimation ( preference ) ) ; singleChoiceListDialog . show ( ) ; return true ; } } ) ;
public class StateMachine { /** * Adds an edge between the current and new state . * @ return true if the new state is not found in the state machine . */ public boolean switchToStateAndCheckIfClone ( final Eventable event , StateVertex newState , CrawlerContext context ) { } }
StateVertex cloneState = this . addStateToCurrentState ( newState , event ) ; runOnInvariantViolationPlugins ( context ) ; if ( cloneState == null ) { changeState ( newState ) ; plugins . runOnNewStatePlugins ( context , newState ) ; return true ; } else { changeState ( cloneState ) ; return false ; }
public class Files { /** * Get file path components . Return a list of path components in their natural order . List first item is path root * stored as an empty string ; if file argument is empty returned list contains only root . If file argument is null * returns empty list . * @ param file file to retrieve path components . * @ return file path components . */ public static List < String > getPathComponents ( File file ) { } }
if ( file == null ) { return Collections . emptyList ( ) ; } List < String > pathComponents = new ArrayList < String > ( ) ; do { pathComponents . add ( 0 , file . getName ( ) ) ; file = file . getParentFile ( ) ; } while ( file != null ) ; return pathComponents ;
public class HttpQuery { /** * Sends an HTTP reply to the client . * @ param status The status of the request ( e . g . 200 OK or 404 Not Found ) . * @ param buf The content of the reply to send . */ private void sendBuffer ( final HttpResponseStatus status , final ChannelBuffer buf ) { } }
final String contentType = ( api_version < 1 ? guessMimeType ( buf ) : serializer . responseContentType ( ) ) ; sendBuffer ( status , buf , contentType ) ;
public class CodecCodeGenerator { /** * Find a field with the @ Id annotation OR with type ObjectId OR with type UUID OR * with name _ id OR with name id */ private static Element lookupId ( List < Element > fields ) { } }
Element objectIdField = null ; Element uuidField = null ; Element _idField = null ; Element idField = null ; for ( Element field : fields ) { if ( field . getAnnotation ( Id . class ) != null ) { return field ; } if ( isObjectId ( field ) ) { objectIdField = field ; } else if ( isUUID ( field ) ) { uuidField = field ; } else if ( field . getSimpleName ( ) . contentEquals ( ID_FIELD_NAME ) ) { _idField = field ; } else if ( field . getSimpleName ( ) . contentEquals ( "id" ) ) { idField = field ; } } if ( objectIdField != null ) { return objectIdField ; } if ( uuidField != null ) { return uuidField ; } if ( _idField != null ) { return _idField ; } if ( idField != null ) { return idField ; } return null ;
public class Datatype_Builder { /** * Sets the value to be returned by { @ link Datatype # getRebuildableType ( ) } . * @ return this { @ code Builder } object */ public Datatype . Builder setRebuildableType ( Optional < ? extends TypeClass > rebuildableType ) { } }
if ( rebuildableType . isPresent ( ) ) { return setRebuildableType ( rebuildableType . get ( ) ) ; } else { return clearRebuildableType ( ) ; }
public class CommerceShippingFixedOptionLocalServiceWrapper { /** * Deletes the commerce shipping fixed option from the database . Also notifies the appropriate model listeners . * @ param commerceShippingFixedOption the commerce shipping fixed option * @ return the commerce shipping fixed option that was removed */ @ Override public com . liferay . commerce . shipping . engine . fixed . model . CommerceShippingFixedOption deleteCommerceShippingFixedOption ( com . liferay . commerce . shipping . engine . fixed . model . CommerceShippingFixedOption commerceShippingFixedOption ) { } }
return _commerceShippingFixedOptionLocalService . deleteCommerceShippingFixedOption ( commerceShippingFixedOption ) ;
public class SecureUtil { /** * sha1计算后进行16进制转换 * @ param data * 待计算的数据 * @ param encoding * 编码 * @ return 计算结果 */ public static byte [ ] sha1X16 ( String data , String encoding ) { } }
byte [ ] bytes = sha1 ( data , encoding ) ; StringBuilder sha1StrBuff = new StringBuilder ( ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { if ( Integer . toHexString ( 0xFF & bytes [ i ] ) . length ( ) == 1 ) { sha1StrBuff . append ( "0" ) . append ( Integer . toHexString ( 0xFF & bytes [ i ] ) ) ; } else { sha1StrBuff . append ( Integer . toHexString ( 0xFF & bytes [ i ] ) ) ; } } try { return sha1StrBuff . toString ( ) . getBytes ( encoding ) ; } catch ( UnsupportedEncodingException e ) { LogUtil . writeErrorLog ( e . getMessage ( ) , e ) ; return null ; }