signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BlockNameSpace { /** * do we need this ? */ private NameSpace getNonBlockParent ( ) { } }
NameSpace parent = super . getParent ( ) ; if ( parent instanceof BlockNameSpace ) return ( ( BlockNameSpace ) parent ) . getNonBlockParent ( ) ; else return parent ;
public class AssociatedPair { /** * Assigns this object to be equal to the passed in values . */ public void set ( double p1_x , double p1_y , double p2_x , double p2_y ) { } }
this . p1 . set ( p1_x , p1_y ) ; this . p2 . set ( p2_x , p2_y ) ;
public class IAPlatformClient { /** * Get App Menu returns list of all the applications that are linked with * the selected company * @ return List < String > : Returns HTML as a list of Strings * @ throws ConnectionException */ public List < String > getAppMenu ( String consumerKey , String consumerSecret , String accessToken , String accessTokenSecret ) throws ConnectionException { } }
try { List < String > menulist ; httpClient = new PlatformHttpClient ( consumerKey , consumerSecret , accessToken , accessTokenSecret ) ; menulist = this . httpClient . getAppMenu ( ) ; return menulist ; } catch ( ConnectionException conEx ) { throw conEx ; } catch ( Exception e ) { throw new ConnectionException ( "Failed to fetch appmenu: " + e . getMessage ( ) ) ; }
public class ChatLinearLayoutManager { /** * Converts a focusDirection to orientation . * @ param focusDirection One of { @ link View # FOCUS _ UP } , { @ link View # FOCUS _ DOWN } , * { @ link View # FOCUS _ LEFT } , { @ link View # FOCUS _ RIGHT } , * { @ link View # FOCUS _ BACKWARD } , { @ link View # FOCUS _ FORWARD } * or 0 for not applicable * @ return { @ link LayoutState # LAYOUT _ START } or { @ link LayoutState # LAYOUT _ END } if focus direction * is applicable to current state , { @ link LayoutState # INVALID _ LAYOUT } otherwise . */ private int convertFocusDirectionToLayoutDirection ( int focusDirection ) { } }
switch ( focusDirection ) { case View . FOCUS_BACKWARD : return LayoutState . LAYOUT_START ; case View . FOCUS_FORWARD : return LayoutState . LAYOUT_END ; case View . FOCUS_UP : return mOrientation == VERTICAL ? LayoutState . LAYOUT_START : LayoutState . INVALID_LAYOUT ; case View . FOCUS_DOWN : return mOrientation == VERTICAL ? LayoutState . LAYOUT_END : LayoutState . INVALID_LAYOUT ; case View . FOCUS_LEFT : return mOrientation == HORIZONTAL ? LayoutState . LAYOUT_START : LayoutState . INVALID_LAYOUT ; case View . FOCUS_RIGHT : return mOrientation == HORIZONTAL ? LayoutState . LAYOUT_END : LayoutState . INVALID_LAYOUT ; default : if ( DEBUG ) { Log . d ( TAG , "Unknown focus request:" + focusDirection ) ; } return LayoutState . INVALID_LAYOUT ; }
public class FormatterBuilder { /** * Create a FormatterBuilder from the supplied arguments . If no formatter is specified by configuration , return a default CSV formatter builder . */ public static FormatterBuilder createFormatterBuilder ( Properties formatterProperties ) throws Exception { } }
FormatterBuilder builder ; AbstractFormatterFactory factory ; if ( formatterProperties . size ( ) > 0 ) { String formatterClass = formatterProperties . getProperty ( "formatter" ) ; String format = formatterProperties . getProperty ( "format" , "csv" ) ; Class < ? > classz = Class . forName ( formatterClass ) ; Class < ? > [ ] ctorParmTypes = new Class [ ] { String . class , Properties . class } ; Constructor < ? > ctor = classz . getDeclaredConstructor ( ctorParmTypes ) ; Object [ ] ctorParms = new Object [ ] { format , formatterProperties } ; factory = new AbstractFormatterFactory ( ) { @ Override public Formatter create ( String formatName , Properties props ) { try { return ( Formatter ) ctor . newInstance ( ctorParms ) ; } catch ( Exception e ) { VoltDB . crashLocalVoltDB ( "Failed to create formatter " + formatName ) ; return null ; } } } ; builder = new FormatterBuilder ( format , formatterProperties ) ; } else { factory = new VoltCSVFormatterFactory ( ) ; Properties props = new Properties ( ) ; factory . create ( "csv" , props ) ; builder = new FormatterBuilder ( "csv" , props ) ; } builder . setFormatterFactory ( factory ) ; return builder ;
public class GuaranteedTargetStream { /** * Writes the range of Silence specified by the TickRange into the stream */ private void writeSilenceInternal ( TickRange tr , boolean forced ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeSilenceInternal" , new Object [ ] { tr , Boolean . valueOf ( forced ) } ) ; List msgList = null ; // Take lock on target stream and hold it until messages have been // added to batch by deliverOrderedMessages synchronized ( this ) { // We are only allowed to remove a message from the stream and replace // it with Silence if it has not yet been added to a Batch to be delivered // We know that this can ' t happen asynchronously once we hold the targetStream lock // and the nextCompletedPrefix tells us the last message in the current batch if ( ! forced || tr . valuestamp > this . nextCompletedPrefix ) { synchronized ( oststream ) { // Get the completedPrefix long completedPrefix = oststream . getCompletedPrefix ( ) ; // check if all ticks in Silence msg are already acked as if // so they will be changed to Completed anyway and we don ' t need // to do it now if ( tr . endstamp > completedPrefix ) { if ( forced == false ) oststream . writeRange ( tr ) ; else oststream . writeCompletedRangeForced ( tr ) ; // Get updated completedPrefix completedPrefix = oststream . getCompletedPrefix ( ) ; } // The completedPrefix may have advanced when the Silence message // was writen to the stream or both if ( ( completedPrefix + 1 ) > doubtHorizon ) { // advance the doubt horizon doubtHorizon = completedPrefix + 1 ; // now call the method which trys to advance the doubtHorizon // from it ' s current setting by moving over any ticks in Completed // state and sending Values messages until it reaches a tick in // Unknown or Requested msgList = advanceDoubtHorizon ( null ) ; } if ( ( doubtHorizon - 1 ) > unknownHorizon ) unknownHorizon = doubtHorizon - 1 ; // the message was writen to the stream // see if this message created a gap if ( tr . endstamp > unknownHorizon ) { // check if gap created if ( tr . startstamp > ( unknownHorizon + 1 ) ) { handleNewGap ( unknownHorizon + 1 , tr . startstamp - 1 ) ; } unknownHorizon = tr . endstamp ; } // Reset the health state if ( lastNackTick >= 0 ) { if ( tr . startstamp <= lastNackTick && tr . endstamp >= lastNackTick ) { getControlAdapter ( ) . getHealthState ( ) . updateHealth ( HealthStateListener . MSG_LOST_ERROR_STATE , HealthState . GREEN ) ; lastNackTick = - 1 ; } } // If the stream is blocked , see if we have a silence for the blocking tick if ( isStreamBlocked ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Stream is blocked on tick: " + linkBlockingTick + ", see if we can unblock it" ) ; if ( tr . endstamp >= linkBlockingTick ) { if ( tr . startstamp <= linkBlockingTick ) { // The stream is no longer blocked setStreamIsBlocked ( false , DestinationHandler . OUTPUT_HANDLER_FOUND , null , null ) ; } } } // eof isStreamBlocked ( ) } // end sync ( release the oststream lock ) // Deliver messages outside of synchronise // We do this because deliverOrderedMessages takes the // BatchHandler lock and the BatchHandler callbacks require // the stream lock to update the completedPrefix . If we call // the BatchHandler when we hold the stream lock it could cause // a deadlock if ( msgList != null ) { // Call the Input or Output Handler to deliver the messages try { deliverer . deliverOrderedMessages ( msgList , this , priority , reliability ) ; } catch ( SINotPossibleInCurrentConfigurationException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "writeSilenceInternal" , "GDException" ) ; // Dont rethrow the exception . The GD protocols will handle the resend of // the message } catch ( SIException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.GuaranteedTargetStream.writeSilenceInternal" , "1:960:1.110" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.gd.GuaranteedTargetStream" , "1:967:1.110" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilenceInternal" , "GDException" ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.gd.GuaranteedTargetStream" , "1:977:1.110" , e } , null ) , e ) ; } } } // else can ' t remove as already in batch } // end sync - release lock on target stream if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeSilenceInternal" ) ;
public class DescribeRaidArraysResult { /** * A < code > RaidArrays < / code > object that describes the specified RAID arrays . * @ param raidArrays * A < code > RaidArrays < / code > object that describes the specified RAID arrays . */ public void setRaidArrays ( java . util . Collection < RaidArray > raidArrays ) { } }
if ( raidArrays == null ) { this . raidArrays = null ; return ; } this . raidArrays = new com . amazonaws . internal . SdkInternalList < RaidArray > ( raidArrays ) ;
public class EnableRadiusRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( EnableRadiusRequest enableRadiusRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( enableRadiusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( enableRadiusRequest . getDirectoryId ( ) , DIRECTORYID_BINDING ) ; protocolMarshaller . marshall ( enableRadiusRequest . getRadiusSettings ( ) , RADIUSSETTINGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Messenger { /** * Get Group View Model Collection * @ return Group ViewModel Collection */ @ Nullable @ ObjectiveCName ( "getGroups" ) public MVVMCollection < Group , GroupVM > getGroups ( ) { } }
if ( modules . getGroupsModule ( ) == null ) { return null ; } return modules . getGroupsModule ( ) . getGroupsCollection ( ) ;
public class PersistSessionDialog { /** * This method initializes startSessionButton * @ return javax . swing . JButton */ private JButton getStartSessionButton ( ) { } }
if ( startSessionButton == null ) { startSessionButton = new JButton ( ) ; startSessionButton . setText ( Constant . messages . getString ( "database.newsession.button.start" ) ) ; startSessionButton . setEnabled ( false ) ; startSessionButton . addActionListener ( new java . awt . event . ActionListener ( ) { @ Override public void actionPerformed ( java . awt . event . ActionEvent e ) { PersistSessionDialog . this . dispose ( ) ; } } ) ; } return startSessionButton ;
public class VirtualMachineExtensionsInner { /** * The operation to create or update the extension . * @ param resourceGroupName The name of the resource group . * @ param vmName The name of the virtual machine where the extension should be created or updated . * @ param vmExtensionName The name of the virtual machine extension . * @ param extensionParameters Parameters supplied to the Create Virtual Machine Extension 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 VirtualMachineExtensionInner object if successful . */ public VirtualMachineExtensionInner createOrUpdate ( String resourceGroupName , String vmName , String vmExtensionName , VirtualMachineExtensionInner extensionParameters ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , vmName , vmExtensionName , extensionParameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class FacebookBatcher { /** * / * ( non - Javadoc ) * @ see com . googlecode . batchfb . Batcher # graph ( java . lang . String , java . lang . Class , com . googlecode . batchfb . Param [ ] ) */ @ Override public < T > GraphRequest < T > graph ( String object , Class < T > type , Param ... params ) { } }
return this . getBatchForGraph ( ) . graph ( object , type , params ) ;
public class IconicsDrawable { /** * Set the padding of the drawable from res * @ return The current IconicsDrawable for chaining . */ @ NonNull public IconicsDrawable paddingRes ( @ DimenRes int sizeResId ) { } }
return paddingPx ( mContext . getResources ( ) . getDimensionPixelSize ( sizeResId ) ) ;
public class DistinguishedName { /** * ( non - Javadoc ) * @ see javax . naming . Name # getPrefix ( int ) */ public Name getPrefix ( int index ) { } }
LinkedList newNames = new LinkedList ( ) ; for ( int i = 0 ; i < index ; i ++ ) { newNames . add ( names . get ( i ) ) ; } return new DistinguishedName ( newNames ) ;
public class NameValueData { /** * { @ inheritDoc } */ protected boolean internalEquals ( ValueData another ) { } }
if ( another instanceof NameValueData ) { return ( ( NameValueData ) another ) . value . equals ( value ) ; } return false ;
public class InvocationDirector { /** * Requests that the specified invocation request be packaged up and sent to the supplied * invocation oid . */ public void sendRequest ( int invOid , int invCode , int methodId , Object [ ] args ) { } }
sendRequest ( invOid , invCode , methodId , args , Transport . DEFAULT ) ;
public class ListenerPortImpl { /** * Stops the listener port listening . * @ see ListenerPort # close ( ) */ public void close ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; // begin F177053 ChannelFramework framework = ChannelFrameworkFactory . getChannelFramework ( ) ; // F196678.10 try { framework . stopChain ( chainInbound , CHAIN_STOP_TIME ) ; } catch ( ChainException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.jfapchannel.impl.ListenerPortImpl.close" , JFapChannelConstants . LISTENERPORTIMPL_CLOSE_01 , new Object [ ] { framework , chainInbound } ) ; // D232185 if ( tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , e ) ; } catch ( ChannelException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.jfapchannel.impl.ListenerPortImpl.close" , JFapChannelConstants . LISTENERPORTIMPL_CLOSE_02 , new Object [ ] { framework , chainInbound } ) ; // D232185 if ( tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , e ) ; } // end F177053 if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ;
public class DigestUtil { /** * 计算SHA - 1摘要值 * @ param data 被摘要数据 * @ param charset 编码 * @ return SHA - 1摘要 */ public static byte [ ] sha1 ( String data , String charset ) { } }
return new Digester ( DigestAlgorithm . SHA1 ) . digest ( data , charset ) ;
public class WWindow { /** * Override preparePaintComponent to clear the scratch map before the window content is being painted . * @ param request the request being responded to . */ @ Override protected void preparePaintComponent ( final Request request ) { } }
super . preparePaintComponent ( request ) ; // Check if window in request ( might not have gone through handle request , eg Step error ) boolean targeted = isPresent ( request ) ; setTargeted ( targeted ) ; if ( getState ( ) == ACTIVE_STATE && isTargeted ( ) ) { getComponentModel ( ) . wrappedContent . preparePaint ( request ) ; }
public class FileTransferHelper { /** * File Service MXBean */ private synchronized FileServiceMXBean getFileService ( ) { } }
if ( fileService == null ) { try { fileService = JMX . newMXBeanProxy ( ManagementFactory . getPlatformMBeanServer ( ) , new ObjectName ( FileServiceMXBean . OBJECT_NAME ) , FileServiceMXBean . class ) ; } catch ( MalformedObjectNameException e ) { throw ErrorHelper . createRESTHandlerJsonException ( e , null , APIConstants . STATUS_INTERNAL_SERVER_ERROR ) ; } catch ( NullPointerException e ) { throw ErrorHelper . createRESTHandlerJsonException ( e , null , APIConstants . STATUS_INTERNAL_SERVER_ERROR ) ; } } return fileService ;
public class BuildTasksInner { /** * Updates a build task with the specified parameters . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param buildTaskName The name of the container registry build task . * @ param buildTaskUpdateParameters The parameters for updating a build task . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < BuildTaskInner > updateAsync ( String resourceGroupName , String registryName , String buildTaskName , BuildTaskUpdateParameters buildTaskUpdateParameters , final ServiceCallback < BuildTaskInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , buildTaskUpdateParameters ) , serviceCallback ) ;
public class HtmlUtil { /** * < p > cleanUpResults . < / p > * @ param resultsToClean a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String cleanUpResults ( String resultsToClean ) { } }
if ( resultsToClean != null ) { String cleanedString = resultsToClean . replace ( "</html><html>" , "<br/><br/>" ) ; cleanedString = cleanedString . replace ( "</HTML><HTML>" , "<br/><br/>" ) ; cleanedString = cleanedString . replace ( "<html>" , "" ) ; cleanedString = cleanedString . replace ( "</html>" , "" ) ; cleanedString = cleanedString . replace ( "<HTML>" , "" ) ; cleanedString = cleanedString . replace ( "</HTML>" , "" ) ; cleanedString = cleanedString . replace ( "<body>" , "" ) ; cleanedString = cleanedString . replace ( "</body>" , "" ) ; cleanedString = cleanedString . replace ( "<BODY>" , "" ) ; cleanedString = cleanedString . replace ( "</BODY>" , "" ) ; return cleanedString ; } return null ;
public class FSDirectory { /** * Get the extended file info for a specific file . * @ param src * The string representation of the path to the file * @ param targetNode * the INode for the corresponding file * @ param leaseHolder * the lease holder for the file * @ return object containing information regarding the file or null if file * not found * @ throws IOException * if permission to access file is denied by the system */ FileStatusExtended getFileInfoExtended ( String src , INode targetNode , String leaseHolder ) throws IOException { } }
readLock ( ) ; try { if ( targetNode == null ) { return null ; } FileStatus stat = createFileStatus ( src , targetNode ) ; long hardlinkId = ( targetNode instanceof INodeHardLinkFile ) ? ( ( INodeHardLinkFile ) targetNode ) . getHardLinkID ( ) : - 1 ; return new FileStatusExtended ( stat , ( ( INodeFile ) targetNode ) . getBlocks ( ) , leaseHolder , hardlinkId ) ; } finally { readUnlock ( ) ; }
public class JsDocInfoParser { /** * BasicTypeExpression : = ' * ' | ' null ' | ' undefined ' | TypeName | FunctionType | UnionType | * RecordType | TypeofType */ private Node parseBasicTypeExpression ( JsDocToken token ) { } }
if ( token == JsDocToken . STAR ) { return newNode ( Token . STAR ) ; } else if ( token == JsDocToken . LEFT_CURLY ) { skipEOLs ( ) ; return parseRecordType ( next ( ) ) ; } else if ( token == JsDocToken . LEFT_PAREN ) { skipEOLs ( ) ; return parseUnionType ( next ( ) ) ; } else if ( token == JsDocToken . STRING ) { String string = stream . getString ( ) ; switch ( string ) { case "function" : skipEOLs ( ) ; return parseFunctionType ( next ( ) ) ; case "null" : case "undefined" : return newStringNode ( string ) ; case "typeof" : skipEOLs ( ) ; return parseTypeofType ( next ( ) ) ; default : return parseTypeName ( token ) ; } } restoreLookAhead ( token ) ; return reportGenericTypeSyntaxWarning ( ) ;
public class UsersApi { /** * Creates a user ( [ CfgPerson ] ( https : / / docs . genesys . com / Documentation / PSDK / latest / ConfigLayerRef / CfgPerson ) ) with the given attributes . * @ param user The user to be created . ( required ) * @ throws ProvisioningApiException if the call is unsuccessful . * @ return Person a Person object with info on the user created . */ public Person addUser ( User user ) throws ProvisioningApiException { } }
try { CreateUserSuccessResponse resp = usersApi . addUser ( new AddUserData ( ) . data ( Converters . convertUserToAddUserDataData ( user ) ) ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new ProvisioningApiException ( "Error adding user. Code: " + resp . getStatus ( ) . getCode ( ) ) ; } return Converters . convertCreateUserSuccessResponseDataPersonToPerson ( resp . getData ( ) . getPerson ( ) ) ; } catch ( ApiException e ) { throw new ProvisioningApiException ( "Error adding user" , e ) ; }
public class Nodes { /** * Removes the currently installed { @ link InputMap } ( InputMap1 ) on the given node and installs the { @ code im } * ( InputMap2 ) in its place . When finished , InputMap2 can be uninstalled and InputMap1 reinstalled via * { @ link # popInputMap ( Node ) } . Multiple InputMaps can be installed so that InputMap ( n ) will be installed over * InputMap ( n - 1) */ public static void pushInputMap ( Node node , InputMap < ? > im ) { } }
// store currently installed im ; getInputMap calls init InputMap < ? > previousInputMap = getInputMap ( node ) ; getStack ( node ) . push ( previousInputMap ) ; // completely override the previous one with the given one setInputMapUnsafe ( node , im ) ;
public class AbstractFormModel { /** * Creates a new value mode for the the given property . Usually delegates to * the underlying property access strategy but subclasses may provide * alternative value model creation strategies . */ protected ValueModel createValueModel ( String formProperty ) { } }
Assert . notNull ( formProperty , "formProperty" ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating " + ( buffered ? "buffered" : "" ) + " value model for form property '" + formProperty + "'." ) ; } return buffered ? new BufferedValueModel ( propertyAccessStrategy . getPropertyValueModel ( formProperty ) ) : propertyAccessStrategy . getPropertyValueModel ( formProperty ) ;
public class JobGraphGenerator { private JobVertex createSingleInputVertex ( SingleInputPlanNode node ) throws CompilerException { } }
final String taskName = node . getNodeName ( ) ; final DriverStrategy ds = node . getDriverStrategy ( ) ; // check , whether chaining is possible boolean chaining ; { Channel inConn = node . getInput ( ) ; PlanNode pred = inConn . getSource ( ) ; chaining = ds . getPushChainDriverClass ( ) != null && ! ( pred instanceof NAryUnionPlanNode ) && // first op after union is stand - alone , because union is merged ! ( pred instanceof BulkPartialSolutionPlanNode ) && // partial solution merges anyways ! ( pred instanceof WorksetPlanNode ) && // workset merges anyways ! ( pred instanceof IterationPlanNode ) && // cannot chain with iteration heads currently inConn . getShipStrategy ( ) == ShipStrategyType . FORWARD && inConn . getLocalStrategy ( ) == LocalStrategy . NONE && pred . getOutgoingChannels ( ) . size ( ) == 1 && node . getParallelism ( ) == pred . getParallelism ( ) && node . getBroadcastInputs ( ) . isEmpty ( ) ; // cannot chain the nodes that produce the next workset or the next solution set , if they are not the // in a tail if ( this . currentIteration instanceof WorksetIterationPlanNode && node . getOutgoingChannels ( ) . size ( ) > 0 ) { WorksetIterationPlanNode wspn = ( WorksetIterationPlanNode ) this . currentIteration ; if ( wspn . getSolutionSetDeltaPlanNode ( ) == pred || wspn . getNextWorkSetPlanNode ( ) == pred ) { chaining = false ; } } // cannot chain the nodes that produce the next workset in a bulk iteration if a termination criterion follows if ( this . currentIteration instanceof BulkIterationPlanNode ) { BulkIterationPlanNode wspn = ( BulkIterationPlanNode ) this . currentIteration ; if ( node == wspn . getRootOfTerminationCriterion ( ) && wspn . getRootOfStepFunction ( ) == pred ) { chaining = false ; } else if ( node . getOutgoingChannels ( ) . size ( ) > 0 && ( wspn . getRootOfStepFunction ( ) == pred || wspn . getRootOfTerminationCriterion ( ) == pred ) ) { chaining = false ; } } } final JobVertex vertex ; final TaskConfig config ; if ( chaining ) { vertex = null ; config = new TaskConfig ( new Configuration ( ) ) ; this . chainedTasks . put ( node , new TaskInChain ( node , ds . getPushChainDriverClass ( ) , config , taskName ) ) ; } else { // create task vertex vertex = new JobVertex ( taskName ) ; vertex . setResources ( node . getMinResources ( ) , node . getPreferredResources ( ) ) ; vertex . setInvokableClass ( ( this . currentIteration != null && node . isOnDynamicPath ( ) ) ? IterationIntermediateTask . class : BatchTask . class ) ; config = new TaskConfig ( vertex . getConfiguration ( ) ) ; config . setDriver ( ds . getDriverClass ( ) ) ; } // set user code config . setStubWrapper ( node . getProgramOperator ( ) . getUserCodeWrapper ( ) ) ; config . setStubParameters ( node . getProgramOperator ( ) . getParameters ( ) ) ; // set the driver strategy config . setDriverStrategy ( ds ) ; for ( int i = 0 ; i < ds . getNumRequiredComparators ( ) ; i ++ ) { config . setDriverComparator ( node . getComparator ( i ) , i ) ; } // assign memory , file - handles , etc . assignDriverResources ( node , config ) ; return vertex ;
public class TaskRuntime { /** * Calls the configured Task close handler and catches exceptions it may throw . */ @ SuppressWarnings ( "checkstyle:illegalcatch" ) private void closeTask ( final byte [ ] message ) throws TaskCloseHandlerFailure { } }
LOG . log ( Level . FINEST , "Invoking close handler." ) ; try { this . fCloseHandler . get ( ) . onNext ( new CloseEventImpl ( message ) ) ; } catch ( final Throwable throwable ) { throw new TaskCloseHandlerFailure ( throwable ) ; }
public class FTPServer { /** * Starts the FTP server asynchronously . * @ param address The server address or { @ code null } for a local address * @ param port The server port or { @ code 0 } to automatically allocate the port * @ throws IOException When an error occurs while starting the server */ public void listen ( InetAddress address , int port ) throws IOException { } }
if ( auth == null ) throw new NullPointerException ( "The Authenticator is null" ) ; if ( socket != null ) throw new IOException ( "Server already started" ) ; socket = Utils . createServer ( port , 50 , address , ssl , ! explicitSecurity ) ; serverThread = new ServerThread ( ) ; serverThread . setDaemon ( true ) ; serverThread . start ( ) ;
public class UnsignedLong { /** * Returns an { @ code UnsignedLong } holding the value of the specified { @ code String } , parsed as * an unsigned { @ code long } value in the specified radix . * @ throws NumberFormatException if the string does not contain a parsable unsigned { @ code long } * value , or { @ code radix } is not between { @ link Character # MIN _ RADIX } and * { @ link Character # MAX _ RADIX } */ public static UnsignedLong valueOf ( String string , int radix ) { } }
return fromLongBits ( UnsignedLongs . parseUnsignedLong ( string , radix ) ) ;
public class EnvUtil { /** * Join a list of objects to a string with a given separator by calling Object . toString ( ) on the elements . * @ param list to join * @ param separator separator to use * @ return the joined string . */ public static String stringJoin ( List list , String separator ) { } }
StringBuilder ret = new StringBuilder ( ) ; boolean first = true ; for ( Object o : list ) { if ( ! first ) { ret . append ( separator ) ; } ret . append ( o ) ; first = false ; } return ret . toString ( ) ;
public class ServiceInfoCache { /** * Adds the given service to this cache replacing an eventually existing entry . * @ param service The service to cache * @ return a result whose previous is the replaced service and where current is the given service */ public Result < T > put ( T service ) { } }
check ( service ) ; ServiceType serviceType = service . resolveServiceType ( ) ; T previous = null ; lock ( ) ; try { ServiceType existingServiceType = keysToServiceTypes . get ( service . getKey ( ) ) ; if ( existingServiceType != null && ! existingServiceType . equals ( serviceType ) ) throw new ServiceLocationException ( "Invalid registration of service " + service . getKey ( ) + ": already registered under service type " + existingServiceType + ", cannot be registered also under service type " + serviceType , SLPError . INVALID_REGISTRATION ) ; keysToServiceTypes . put ( service . getKey ( ) , serviceType ) ; previous = keysToServiceInfos . put ( service . getKey ( ) , service ) ; service . setRegistered ( true ) ; if ( previous != null ) previous . setRegistered ( false ) ; } finally { unlock ( ) ; } notifyServiceAdded ( previous , service ) ; return new Result < T > ( previous , service ) ;
public class PyExpressionGenerator { /** * Generate the given object . * @ param breakStatement the break statement . * @ param it the target for the generated content . * @ param context the context . * @ return the statement . */ @ SuppressWarnings ( "static-method" ) protected XExpression _generate ( SarlBreakExpression breakStatement , IAppendable it , IExtraLanguageGeneratorContext context ) { } }
if ( context . getExpectedExpressionType ( ) == null ) { it . append ( "break" ) ; // $ NON - NLS - 1 $ } else { it . append ( "return " ) . append ( toDefaultValue ( context . getExpectedExpressionType ( ) . toJavaCompliantTypeReference ( ) ) ) ; // $ NON - NLS - 1 $ } return breakStatement ;
public class PdfGraphics2D { /** * Sets a rendering hint * @ param arg0 * @ param arg1 */ public void setRenderingHint ( Key arg0 , Object arg1 ) { } }
if ( arg1 != null ) { rhints . put ( arg0 , arg1 ) ; } else { if ( arg0 instanceof HyperLinkKey ) { rhints . put ( arg0 , HyperLinkKey . VALUE_HYPERLINKKEY_OFF ) ; } else { rhints . remove ( arg0 ) ; } }
public class PGXADataSource { /** * Gets a XA - enabled connection to the PostgreSQL database . The database is identified by the * DataSource properties serverName , databaseName , and portNumber . The user to connect as is * identified by the arguments user and password , which override the DataSource properties by the * same name . * @ return A valid database connection . * @ throws SQLException Occurs when the database connection cannot be established . */ public XAConnection getXAConnection ( String user , String password ) throws SQLException { } }
Connection con = super . getConnection ( user , password ) ; return new PGXAConnection ( ( BaseConnection ) con ) ;
public class PatternUtils { /** * / * pp */ static boolean isPossibleQualifiedName ( @ Nonnull String value , @ Nonnull String extraAllowedCharacters ) { } }
// package - info violates the spec for Java Identifiers . // Nevertheless , expressions that end with this string are still legal . // See 7.4.1.1 of the Java language spec for discussion . if ( value . endsWith ( PACKAGE_INFO ) ) { value = value . substring ( 0 , value . length ( ) - PACKAGE_INFO . length ( ) ) ; } for ( int i = 0 , len = value . length ( ) ; i < len ; i ++ ) { char c = value . charAt ( i ) ; if ( Character . isJavaIdentifierPart ( c ) ) continue ; if ( extraAllowedCharacters . indexOf ( c ) >= 0 ) continue ; return false ; } return true ;
public class ParameterTypeImpl { /** * Returns all < code > constraint < / code > elements * @ return list of < code > constraint < / code > */ public List < ConstraintType < ParameterType < T > > > getAllConstraint ( ) { } }
List < ConstraintType < ParameterType < T > > > list = new ArrayList < ConstraintType < ParameterType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "constraint" ) ; for ( Node node : nodeList ) { ConstraintType < ParameterType < T > > type = new ConstraintTypeImpl < ParameterType < T > > ( this , "constraint" , childNode , node ) ; list . add ( type ) ; } return list ;
public class RegionClient { /** * Retrieves the list of region resources available to the specified project . * < p > Sample code : * < pre > < code > * try ( RegionClient regionClient = RegionClient . create ( ) ) { * ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ; * for ( Region element : regionClient . listRegions ( project ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param project Project ID for this request . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final ListRegionsPagedResponse listRegions ( ProjectName project ) { } }
ListRegionsHttpRequest request = ListRegionsHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . build ( ) ; return listRegions ( request ) ;
public class AmazonSimpleWorkflowClient { /** * Returns the estimated number of decision tasks in the specified task list . The count returned is an approximation * and isn ' t guaranteed to be exact . If you specify a task list that no decision task was ever scheduled in then * < code > 0 < / code > is returned . * < b > Access Control < / b > * You can use IAM policies to control this action ' s access to Amazon SWF resources as follows : * < ul > * < li > * Use a < code > Resource < / code > element with the domain name to limit the action to only specified domains . * < / li > * < li > * Use an < code > Action < / code > element to allow or deny permission to call this action . * < / li > * < li > * Constrain the < code > taskList . name < / code > parameter by using a < code > Condition < / code > element with the * < code > swf : taskList . name < / code > key to allow the action to access only certain task lists . * < / li > * < / ul > * If the caller doesn ' t have sufficient permissions to invoke the action , or the parameter values fall outside the * specified constraints , the action fails . The associated event attribute ' s < code > cause < / code > parameter is set to * < code > OPERATION _ NOT _ PERMITTED < / code > . For details and example IAM policies , see < a * href = " http : / / docs . aws . amazon . com / amazonswf / latest / developerguide / swf - dev - iam . html " > Using IAM to Manage Access to * Amazon SWF Workflows < / a > in the < i > Amazon SWF Developer Guide < / i > . * @ param countPendingDecisionTasksRequest * @ return Result of the CountPendingDecisionTasks operation returned by the service . * @ throws UnknownResourceException * Returned when the named resource cannot be found with in the scope of this operation ( region or domain ) . * This could happen if the named resource was never created or is no longer available for this operation . * @ throws OperationNotPermittedException * Returned when the caller doesn ' t have sufficient permissions to invoke the action . * @ sample AmazonSimpleWorkflow . CountPendingDecisionTasks * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / swf - 2012-01-25 / CountPendingDecisionTasks " target = " _ top " > AWS * API Documentation < / a > */ @ Override public PendingTaskCount countPendingDecisionTasks ( CountPendingDecisionTasksRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeCountPendingDecisionTasks ( request ) ;
public class SessionBeans { /** * Identifiers */ public static String createIdentifier ( EnhancedAnnotatedType < ? > type , EjbDescriptor < ? > descriptor ) { } }
StringBuilder builder = BeanIdentifiers . getPrefix ( SessionBean . class ) ; appendEjbNameAndClass ( builder , descriptor ) ; if ( ! type . isDiscovered ( ) ) { builder . append ( BEAN_ID_SEPARATOR ) . append ( type . slim ( ) . getIdentifier ( ) . asString ( ) ) ; } return builder . toString ( ) ;
public class AbstractItemLink { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . deliverydelay . DeliveryDelayable # deliveryDelayableUnlock ( com . ibm . ws . sib . msgstore . transactions . impl . PersistentTransaction ) * Note : synchronized block must not be used here ! If intrensic lock is acquired and then unlock is invoked , * The ready consumer ( different thread ) will try to check if the item is available using * the intrensic lock which will not be available . * And the ready consumer will not be able to proceed with the consumption . * unlock ( ) uses the intrensic lock so we are safe here */ @ Override public boolean deliveryDelayableUnlock ( PersistentTransaction tran , long lockID ) throws MessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deliveryDelayableUnlock" , "tran=" + tran + "lockID=" + lockID ) ; boolean removeFromDeliveryDelayIndex = false ; try { /* * Only if the item is not expiring and its in store and if its not being * removed ( removal can happen when destination is being deleted ) * we have to unlock . * Else it means the item is being expired and there is no point unlocking an expired item */ if ( ! isExpired ( ) && isInStore ( ) && isStateLocked ( ) ) { // Unlock the item and dont increment the unlock count unlock ( lockID , tran , false ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Did not unlock item " + getID ( ) + "whoes item link state is :" + _itemLinkState + " because: either" + "its expired or its not in store or the item link state is not " + "ItemLinkState.STATE_LOCKED" ) ; } // Remove from the unlock index removeFromDeliveryDelayIndex = true ; } catch ( MessageStoreException e ) { // Something wrong has happened . We should not remove from the DeliveryDelayManager so that we can try next time removeFromDeliveryDelayIndex = false ; com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.deliveryDelayableUnlock" , "1:231:1.145" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "failed to unlock item " + getID ( ) + " because: " + e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deliveryDelayableUnlock" , removeFromDeliveryDelayIndex ) ; return removeFromDeliveryDelayIndex ;
public class LinearLayout { /** * Set the { @ link Gravity } of the layout . * The new gravity can be rejected if it is in conflict with the currently applied Orientation * @ param gravity * One of the { @ link Gravity } constants . */ public void setGravity ( final Gravity gravity ) { } }
if ( mGravity != gravity ) { mGravity = gravity ; if ( mContainer != null ) { mContainer . onLayoutChanged ( this ) ; } }
public class SwingUtil { /** * Apply the specified ComponentOp to the supplied component and then all its descendants . */ public static void applyToHierarchy ( Component comp , ComponentOp op ) { } }
applyToHierarchy ( comp , Integer . MAX_VALUE , op ) ;
public class HttpResponse { /** * Update header to return as a Header object , if a header with * the same name already exists it will be modified * @ param name the header name * @ param values the header values */ public HttpResponse replaceHeader ( String name , String ... values ) { } }
this . headers . replaceEntry ( name , values ) ; return this ;
public class InodeLockManager { /** * Tries to acquire a lock for persisting the specified inode id . * @ param inodeId the inode to acquire the lock for * @ return an optional wrapping a closure for releasing the lock on success , or Optional . empty if * the lock is already taken */ public Optional < Scoped > tryAcquirePersistingLock ( long inodeId ) { } }
AtomicBoolean lock = mPersistingLocks . getUnchecked ( inodeId ) ; if ( lock . compareAndSet ( false , true ) ) { return Optional . of ( ( ) -> lock . set ( false ) ) ; } return Optional . empty ( ) ;
public class EnvironmentUtils { /** * Retrieve string value for the environment variable name * @ param name The name of the variable without prefix * @ param defaultValue The default value if not found * @ return The value found , or the default if not found */ public static String getEnvironmentString ( String name , String defaultValue ) { } }
if ( envVars == null ) { throw new IllegalStateException ( "The environment vars must be provided before calling getEnvironmentString." ) ; } return envVars . get ( ENV_PREFIX + name ) != null ? envVars . get ( ENV_PREFIX + name ) : defaultValue ;
public class TransformationPolicyBuilder { /** * Gets the assertion . * @ param message the message * @ return the assertion * @ throws SAXException the sAX exception * @ throws IOException Signals that an I / O exception has occurred . * @ throws ParserConfigurationException the parser configuration exception */ public static AssertionInfo getAssertion ( Message message ) throws SAXException , IOException , ParserConfigurationException { } }
AssertionInfoMap aim = message . get ( AssertionInfoMap . class ) ; if ( aim != null ) { Collection < AssertionInfo > ais = aim . get ( TransformationPolicyBuilder . TRANSFORMATION ) ; if ( ais == null ) { return null ; } for ( AssertionInfo ai : ais ) { if ( ai . getAssertion ( ) instanceof TransformationAssertion ) { return ai ; } } } return null ;
public class CharUtils { /** * < p > Converts the string to the Unicode format ' \ u0020 ' . < / p > * < p > This format is the Java source code format . < / p > * < p > If { @ code null } is passed in , { @ code null } will be returned . < / p > * < pre > * CharUtils . unicodeEscaped ( null ) = null * CharUtils . unicodeEscaped ( ' ' ) = " \ u0020" * CharUtils . unicodeEscaped ( ' A ' ) = " \ u0041" * < / pre > * @ param ch the character to convert , may be null * @ return the escaped Unicode string , null if null input */ public static String unicodeEscaped ( final Character ch ) { } }
if ( ch == null ) { return null ; } return unicodeEscaped ( ch . charValue ( ) ) ;
public class TypedIsomorphicGraphCounter { /** * { @ inheritDoc } */ public G max ( ) { } }
int maxCount = - 1 ; G max = null ; for ( LinkedList < Map . Entry < G , Integer > > graphs : typesToGraphs . values ( ) ) { for ( Map . Entry < G , Integer > e : graphs ) { if ( e . getValue ( ) > maxCount ) { maxCount = e . getValue ( ) ; max = e . getKey ( ) ; } } } return max ;
public class ThreadSafeBitSet { /** * this = this ^ other , bitwise * @ param other The bit set to xor with . */ public final void xor ( ThreadSafeBitSet other ) { } }
if ( other . size != size ) throw new IllegalArgumentException ( "BitSets must be of equal size" ) ; for ( int i = 0 ; i < bits . length ; i ++ ) { bits [ i ] ^= other . bits [ i ] ; }
public class WeakObjectRegistry { /** * Registers an object in this model identified by a newly created id . * @ param object * The object to register . * @ return The generated id . */ private UUID registerObject ( final Object object ) { } }
UUID id = UUID . randomUUID ( ) ; registerObject ( object , id ) ; return id ;
public class TiffReader { /** * Processes a TIFF data sequence . * @ param reader the { @ link RandomAccessReader } from which the data should be read * @ param handler the { @ link TiffHandler } that will coordinate processing and accept read values * @ param tiffHeaderOffset the offset within < code > reader < / code > at which the TIFF header starts * @ throws TiffProcessingException if an error occurred during the processing of TIFF data that could not be * ignored or recovered from * @ throws IOException an error occurred while accessing the required data */ public void processTiff ( @ NotNull final RandomAccessReader reader , @ NotNull final TiffHandler handler , final int tiffHeaderOffset ) throws TiffProcessingException , IOException { } }
// This must be either " MM " or " II " . short byteOrderIdentifier = reader . getInt16 ( tiffHeaderOffset ) ; if ( byteOrderIdentifier == 0x4d4d ) { // " MM " reader . setMotorolaByteOrder ( true ) ; } else if ( byteOrderIdentifier == 0x4949 ) { // " II " reader . setMotorolaByteOrder ( false ) ; } else { throw new TiffProcessingException ( "Unclear distinction between Motorola/Intel byte ordering: " + byteOrderIdentifier ) ; } // Check the next two values for correctness . final int tiffMarker = reader . getUInt16 ( 2 + tiffHeaderOffset ) ; handler . setTiffMarker ( tiffMarker ) ; int firstIfdOffset = reader . getInt32 ( 4 + tiffHeaderOffset ) + tiffHeaderOffset ; // David Ekholm sent a digital camera image that has this problem // TODO getLength should be avoided as it causes RandomAccessStreamReader to read to the end of the stream if ( firstIfdOffset >= reader . getLength ( ) - 1 ) { handler . warn ( "First IFD offset is beyond the end of the TIFF data segment -- trying default offset" ) ; // First directory normally starts immediately after the offset bytes , so try that firstIfdOffset = tiffHeaderOffset + 2 + 2 + 4 ; } Set < Integer > processedIfdOffsets = new HashSet < Integer > ( ) ; processIfd ( handler , reader , processedIfdOffsets , firstIfdOffset , tiffHeaderOffset ) ;
public class PeerGroup { /** * You can override this to customise the creation of { @ link Peer } objects . */ @ GuardedBy ( "lock" ) protected Peer createPeer ( PeerAddress address , VersionMessage ver ) { } }
return new Peer ( params , ver , address , chain , downloadTxDependencyDepth ) ;
public class ProxyIdpAuthnContextServiceImpl { /** * { @ inheritDoc } */ @ Override public List < String > getSendAuthnContextClassRefs ( ProfileRequestContext < ? , ? > context , List < String > assuranceURIs , boolean idpSupportsSignMessage ) throws ExternalAutenticationErrorCodeException { } }
final String logId = this . getLogString ( context ) ; AuthnContextClassContext authnContextClassContext = this . getAuthnContextClassContext ( context ) ; authnContextClassContext . setProxiedIdPSupportsSignMessage ( idpSupportsSignMessage ) ; // Intermediate list holding the URI : s that should be sent in the AuthnRequest to the IdP . List < String > urisToSend = new ArrayList < > ( ) ; if ( assuranceURIs == null || assuranceURIs . isEmpty ( ) ) { log . info ( "No assurance certification specified by IdP - No matching against SP AuthnContext URI:s will be performed [{}]" , logId ) ; urisToSend . addAll ( authnContextClassContext . getAuthnContextClassRefs ( ) ) ; } else { // If the IdP understands sign message , we simply delete the requested URI : s that are not supported // by the IdP . if ( idpSupportsSignMessage ) { for ( String uri : authnContextClassContext . getAuthnContextClassRefs ( ) ) { if ( this . isSupported ( context , uri , assuranceURIs ) ) { urisToSend . add ( uri ) ; } else { log . info ( "Requested AuthnContext URI '{}' is not supported by receiving IdP - will remove [{}]" , uri , logId ) ; authnContextClassContext . deleteAuthnContextClassRef ( uri ) ; } } } // Otherwise it is a bit trickier , we have to remove requested sigmessage URI : s based on their base URI : s // if the base URI is not supported by the IdP . else { for ( String uri : authnContextClassContext . getAuthnContextClassRefs ( ) ) { String baseUri = this . toBaseURI ( uri ) ; if ( this . isSupported ( context , baseUri , assuranceURIs ) ) { urisToSend . add ( baseUri ) ; } else { log . info ( "Requested AuthnContext URI '{}' is not supported by receiving IdP - will remove [{}]" , uri , logId ) ; authnContextClassContext . deleteAuthnContextClassRef ( uri ) ; } } } } // There may be duplicates in the list . urisToSend . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ; // Transform list so that the IdP understands it . urisToSend = this . transformForIdp ( context , urisToSend ) ; // Now , if no more AuthContext URI : s remain , we must fail since there is not point is sending a request // to the IdP and get back an Assertion that we can ' t return back to the SP . if ( urisToSend . isEmpty ( ) ) { final String msg = "No matching AuthnContext URI:s remain after matching against IdP declared assurance certification" ; log . info ( "{} - failing [{}]" , msg , logId ) ; throw new ExternalAutenticationErrorCodeException ( AuthnEventIds . REQUEST_UNSUPPORTED , msg ) ; } authnContextClassContext . setProxiedAuthnContextClassRefs ( urisToSend ) ; log . debug ( "Will include the following AuthnContextClassRef URI:s in AuthnContext: {} [{}]" , urisToSend , logId ) ; return authnContextClassContext . getProxiedAuthnContextClassRefs ( ) ;
public class CorpusTools { /** * 分析语料库 */ private static void analyzeCorpus ( ) { } }
String zipFile = "src/main/resources/corpus/corpora.zip" ; LOGGER . info ( "开始分析语料库" ) ; long start = System . currentTimeMillis ( ) ; try { analyzeCorpus ( zipFile ) ; } catch ( IOException ex ) { LOGGER . info ( "分析语料库失败:" , ex ) ; } long cost = System . currentTimeMillis ( ) - start ; LOGGER . info ( "完成分析语料库,耗时:" + cost + "毫秒" ) ; LOGGER . info ( "语料库行数为:" + LINES_COUNT . get ( ) + ",总字符数目为:" + CHAR_COUNT . get ( ) + ",总词数目为:" + WORD_COUNT . get ( ) + ",不重复词数目为:" + WORDS . size ( ) ) ;
public class Resty { /** * Set the proxy for this instance of Resty . * Note , that the proxy settings will be carried over to Resty instances created by this instance only if you used * new Resty ( Option . proxy ( . . . ) ) ! * @ param proxyhost name of the host * @ param proxyport port to be used */ public void setProxy ( String proxyhost , int proxyport ) { } }
proxy = new java . net . Proxy ( java . net . Proxy . Type . HTTP , new InetSocketAddress ( proxyhost , proxyport ) ) ;
public class EvalHelper { /** * Inverse of { @ link # getAccessor ( Class , String ) } */ public static Optional < String > propertyFromAccessor ( Method accessor ) { } }
if ( accessor . getParameterCount ( ) != 0 || accessor . getReturnType ( ) . equals ( Void . class ) ) { return Optional . empty ( ) ; } String methodName = accessor . getName ( ) ; if ( methodName . startsWith ( "get" ) ) { return Optional . of ( lcFirst ( methodName . substring ( 3 , methodName . length ( ) ) ) ) ; } else if ( methodName . startsWith ( "is" ) ) { return Optional . of ( lcFirst ( methodName . substring ( 2 , methodName . length ( ) ) ) ) ; } else { return Optional . of ( lcFirst ( methodName ) ) ; }
public class MetadataProviderImpl { /** * Determines if an { @ link AnnotatedType } represents a specific type identified * by a meta annotation . * @ param annotatedType * The { @ link AnnotatedType } . * @ param definitionType * The meta annotation . * @ return < code > true < / code > if the annotated type represents relation type . */ private boolean isOfDefinitionType ( AnnotatedType annotatedType , Class < ? extends Annotation > definitionType ) { } }
Annotation definition = annotatedType . getByMetaAnnotation ( definitionType ) ; if ( definition != null ) { return true ; } for ( Class < ? > superType : annotatedType . getAnnotatedElement ( ) . getInterfaces ( ) ) { if ( isOfDefinitionType ( new AnnotatedType ( superType ) , definitionType ) ) { return true ; } } return false ;
public class ChangeObjects { /** * method to add a PolymerNotation at a specific position of the * HELM2Notation * @ param position * position of the PolymerNotation * @ param polymer * new PolymerNotation * @ param helm2notation * input HELM2Notation */ public final static void addPolymerNotation ( int position , PolymerNotation polymer , HELM2Notation helm2notation ) { } }
helm2notation . getListOfPolymers ( ) . add ( position , polymer ) ;
public class FctBnSeSelProcessors { /** * < p > Get PrcEntitiesPage ( create and put into map ) . < / p > * @ return requested PrcEntitiesPage * @ throws Exception - an exception */ protected final PrcEntitiesPage createPutPrcEntitiesPage ( ) throws Exception { } }
PrcEntitiesPage proc = new PrcEntitiesPage ( ) ; proc . setSrvEntitiesPage ( this . srvEntitiesPage ) ; // assigning fully initialized object : this . processorsMap . put ( PrcEntitiesPage . class . getSimpleName ( ) , proc ) ; return proc ;
public class V1InstanceCreator { /** * Create a new response to an existing note with a name , content , and ' personal ' flag * @ param responseTo The Note to respond to . * @ param name The initial name of the note . * @ param content The content of the note . * @ param personal True if this note is only visible to . * @ param attributes additional attributes for the note . * @ return A newly minted Note in response to the original one that exists in the VersionOne system . */ public Note note ( Note responseTo , String name , String content , boolean personal , Map < String , Object > attributes ) { } }
Note note = new Note ( responseTo , instance ) ; note . setName ( name ) ; note . setContent ( content ) ; note . setPersonal ( personal ) ; addAttributes ( note , attributes ) ; note . save ( ) ; return note ;
public class BatchDeleteClusterSnapshotsRequest { /** * A list of identifiers for the snapshots that you want to delete . * @ param identifiers * A list of identifiers for the snapshots that you want to delete . */ public void setIdentifiers ( java . util . Collection < DeleteClusterSnapshotMessage > identifiers ) { } }
if ( identifiers == null ) { this . identifiers = null ; return ; } this . identifiers = new com . amazonaws . internal . SdkInternalList < DeleteClusterSnapshotMessage > ( identifiers ) ;
public class VolumeStatisticsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( VolumeStatistics volumeStatistics , ProtocolMarshaller protocolMarshaller ) { } }
if ( volumeStatistics == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( volumeStatistics . getInboxRawCount ( ) , INBOXRAWCOUNT_BINDING ) ; protocolMarshaller . marshall ( volumeStatistics . getSpamRawCount ( ) , SPAMRAWCOUNT_BINDING ) ; protocolMarshaller . marshall ( volumeStatistics . getProjectedInbox ( ) , PROJECTEDINBOX_BINDING ) ; protocolMarshaller . marshall ( volumeStatistics . getProjectedSpam ( ) , PROJECTEDSPAM_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class StreamSegmentNameUtils { /** * Returns the transaction name for a TransactionStreamSegment based on the name of the current Parent StreamSegment , and the transactionId . * @ param parentStreamSegmentName The name of the Parent StreamSegment for this transaction . * @ param transactionId The unique Id for the transaction . * @ return The name of the Transaction StreamSegmentId . */ public static String getTransactionNameFromId ( String parentStreamSegmentName , UUID transactionId ) { } }
StringBuilder result = new StringBuilder ( ) ; result . append ( parentStreamSegmentName ) ; result . append ( TRANSACTION_DELIMITER ) ; result . append ( String . format ( FULL_HEX_FORMAT , transactionId . getMostSignificantBits ( ) ) ) ; result . append ( String . format ( FULL_HEX_FORMAT , transactionId . getLeastSignificantBits ( ) ) ) ; return result . toString ( ) ;
public class IntegerExtensions { /** * The bitwise < code > and < / code > operation . This is the equivalent to the java < code > & < / code > operator . * @ param a * an integer . * @ param b * an integer . * @ return < code > a & b < / code > */ @ Pure @ Inline ( value = "($1 & $2)" , constantExpression = true ) public static int bitwiseAnd ( int a , int b ) { } }
return a & b ;
public class FieldValue { /** * Returns a special value that can be used with set ( ) , create ( ) or update ( ) that tells the server * to remove the given elements from any array value that already exists on the server . All * instances of each element specified will be removed from the array . If the field being modified * is not already an array it will be overwritten with an empty array . * @ param elements The elements to remove from the array . * @ return The FieldValue sentinel for use in a call to set ( ) or update ( ) . */ @ Nonnull public static FieldValue arrayRemove ( @ Nonnull Object ... elements ) { } }
Preconditions . checkArgument ( elements . length > 0 , "arrayRemove() expects at least 1 element" ) ; return new ArrayRemoveFieldValue ( Arrays . asList ( elements ) ) ;
public class Matcher { /** * Resets this matcher and then attempts to find the next subsequence of * the input sequence that matches the pattern , starting at the specified * index . * < p > If the match succeeds then more information can be obtained via the * < tt > start < / tt > , < tt > end < / tt > , and < tt > group < / tt > methods , and subsequent * invocations of the { @ link # find ( ) } method will start at the first * character not matched by this match . < / p > * @ throws IndexOutOfBoundsException * If start is less than zero or if start is greater than the * length of the input sequence . * @ return < tt > true < / tt > if , and only if , a subsequence of the input * sequence starting at the given index matches this matcher ' s * pattern */ public boolean find ( int start ) { } }
int limit = matcher . targetEnd ( ) ; if ( ( start < 0 ) || ( start > limit ) ) throw new IndexOutOfBoundsException ( "Illegal start index" ) ; reset ( ) ; matcher . setPosition ( start ) ; return matcher . find ( ) ;
public class MisoScenePanel { /** * Called when the user presses the mouse button over an object . */ protected void handleObjectPressed ( final SceneObject scobj , int mx , int my ) { } }
String action = scobj . info . action ; final ObjectActionHandler handler = ObjectActionHandler . lookup ( action ) ; // if there ' s no handler , just fire the action immediately if ( handler == null ) { fireObjectAction ( null , scobj , new SceneObjectActionEvent ( this , 0 , action , 0 , scobj ) ) ; return ; } // if the action ' s not allowed , pretend like we handled it if ( ! handler . actionAllowed ( action ) ) { return ; } // if there ' s no menu for this object , fire the action immediately RadialMenu menu = handler . handlePressed ( scobj ) ; if ( menu == null ) { fireObjectAction ( handler , scobj , new SceneObjectActionEvent ( this , 0 , action , 0 , scobj ) ) ; return ; } // make the menu surround the clicked object , but with consistent size Rectangle mbounds = getRadialMenuBounds ( scobj ) ; _activeMenu = menu ; _activeMenu . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { if ( e instanceof CommandEvent ) { fireObjectAction ( handler , scobj , e ) ; } else { SceneObjectActionEvent event = new SceneObjectActionEvent ( e . getSource ( ) , e . getID ( ) , e . getActionCommand ( ) , e . getModifiers ( ) , scobj ) ; fireObjectAction ( handler , scobj , event ) ; } } } ) ; _activeMenu . activate ( this , mbounds , scobj ) ;
public class OpenTok { /** * Sets the layout type for a composed archive . For a description of layout types , see * < a href = " https : / / tokbox . com / developer / guides / archiving / layout - control . html " > Customizing * the video layout for composed archives < / a > . * @ param archiveId { String } The archive ID . * @ param properties This ArchiveProperties object defining the arachive layout . */ public void setArchiveLayout ( String archiveId , ArchiveProperties properties ) throws OpenTokException { } }
if ( StringUtils . isEmpty ( archiveId ) || properties == null ) { throw new InvalidArgumentException ( "ArchiveId is not valid or properties are null" ) ; } this . client . setArchiveLayout ( archiveId , properties ) ;
public class AbstractExtensionDependency { /** * Replace existing properties with provided properties . * @ param properties the properties */ public void setProperties ( Map < String , Object > properties ) { } }
this . properties . clear ( ) ; this . properties . putAll ( properties ) ;
public class TextRankKeyword { /** * 返回分数最高的前size个分词结果和对应的rank * @ param content * @ param size * @ return */ public Map < String , Float > getTermAndRank ( String content , int size ) { } }
Map < String , Float > map = getTermAndRank ( content ) ; Map < String , Float > result = top ( size , map ) ; return result ;
public class InventoryNavigator { /** * Get the first ManagedObjectReference from current node for the specified type */ public ManagedEntity [ ] searchManagedEntities ( String type ) throws InvalidProperty , RuntimeFault , RemoteException { } }
String [ ] [ ] typeinfo = new String [ ] [ ] { new String [ ] { type , "name" , } , } ; return searchManagedEntities ( typeinfo , true ) ;
public class LoggerFactory { /** * Return the most appropriate log type . This should _ never _ return null . */ private static LogType findLogType ( ) { } }
// see if the log - type was specified as a system property String logTypeString = System . getProperty ( LOG_TYPE_SYSTEM_PROPERTY ) ; if ( logTypeString != null ) { try { return LogType . valueOf ( logTypeString ) ; } catch ( IllegalArgumentException e ) { Log log = new LocalLog ( LoggerFactory . class . getName ( ) ) ; log . log ( Level . WARNING , "Could not find valid log-type from system property '" + LOG_TYPE_SYSTEM_PROPERTY + "', value '" + logTypeString + "'" ) ; } } for ( LogType logType : LogType . values ( ) ) { if ( logType . isAvailable ( ) ) { return logType ; } } // fall back is always LOCAL , never reached return LogType . LOCAL ;
public class MethodUtils { /** * < p > Invoke a named method whose parameter type matches the object type . < / p > * < p > The behaviour of this method is less deterministic * than { @ link # invokeExactMethod ( Object object , String methodName , Object [ ] args ) } . * It loops through all methods with names that match * and then executes the first it finds with compatible parameters . < / p > * < p > This method supports calls to methods taking primitive parameters * via passing in wrapping classes . So , for example , a { @ code Boolean } class * would match a { @ code boolean } primitive . < / p > * < p > This is a convenient wrapper for * { @ link # invokeMethod ( Object object , String methodName , Object [ ] args , Class [ ] paramTypes ) } . * @ param object invoke method on this object * @ param methodName get method with this name * @ param args use these arguments - treat null as empty array * @ return the value returned by the invoked method * @ throws NoSuchMethodException if there is no such accessible method * @ throws InvocationTargetException wraps an exception thrown by the method invoked * @ throws IllegalAccessException if the requested method is not accessible via reflection */ public static Object invokeMethod ( Object object , String methodName , Object [ ] args ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { } }
Class < ? > [ ] paramTypes ; if ( args == null ) { args = EMPTY_OBJECT_ARRAY ; paramTypes = EMPTY_CLASS_PARAMETERS ; } else { int arguments = args . length ; if ( arguments == 0 ) { paramTypes = EMPTY_CLASS_PARAMETERS ; } else { paramTypes = new Class < ? > [ arguments ] ; for ( int i = 0 ; i < arguments ; i ++ ) { if ( args [ i ] != null ) { paramTypes [ i ] = args [ i ] . getClass ( ) ; } } } } return invokeMethod ( object , methodName , args , paramTypes ) ;
public class AttributeSwapperHelperImpl { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . portlets . swapper . IAttributeSwapperHelper # getOriginalUserAttributes ( java . lang . String ) */ @ Override public IPersonAttributes getOriginalUserAttributes ( String uid ) { } }
final IPersonAttributeDao delegatePersonAttributeDao = this . portalRootPersonAttributeDao . getDelegatePersonAttributeDao ( ) ; return delegatePersonAttributeDao . getPerson ( uid ) ;
public class QueryableStateUtils { /** * Initializes the { @ link KvStateClientProxy client proxy } responsible for * receiving requests from the external ( to the cluster ) client and forwarding them internally . * @ param address the address to bind to . * @ param ports the range of ports the proxy will attempt to listen to * ( see { @ link org . apache . flink . configuration . QueryableStateOptions # PROXY _ PORT _ RANGE * QueryableStateOptions . PROXY _ PORT _ RANGE } ) . * @ param eventLoopThreads the number of threads to be used to process incoming requests . * @ param queryThreads the number of threads to be used to send the actual state . * @ param stats statistics to be gathered about the incoming requests . * @ return the { @ link KvStateClientProxy client proxy } . */ public static KvStateClientProxy createKvStateClientProxy ( final InetAddress address , final Iterator < Integer > ports , final int eventLoopThreads , final int queryThreads , final KvStateRequestStats stats ) { } }
Preconditions . checkNotNull ( address , "address" ) ; Preconditions . checkNotNull ( stats , "stats" ) ; Preconditions . checkArgument ( eventLoopThreads >= 1 ) ; Preconditions . checkArgument ( queryThreads >= 1 ) ; try { String classname = "org.apache.flink.queryablestate.client.proxy.KvStateClientProxyImpl" ; Class < ? extends KvStateClientProxy > clazz = Class . forName ( classname ) . asSubclass ( KvStateClientProxy . class ) ; Constructor < ? extends KvStateClientProxy > constructor = clazz . getConstructor ( InetAddress . class , Iterator . class , Integer . class , Integer . class , KvStateRequestStats . class ) ; return constructor . newInstance ( address , ports , eventLoopThreads , queryThreads , stats ) ; } catch ( ClassNotFoundException e ) { final String msg = "Could not load Queryable State Client Proxy. " + ERROR_MESSAGE_ON_LOAD_FAILURE ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( msg + " Cause: " + e . getMessage ( ) ) ; } else { LOG . info ( msg ) ; } return null ; } catch ( InvocationTargetException e ) { LOG . error ( "Queryable State Client Proxy could not be created: " , e . getTargetException ( ) ) ; return null ; } catch ( Throwable t ) { LOG . error ( "Failed to instantiate the Queryable State Client Proxy." , t ) ; return null ; }
public class CassandraKeyspace { /** * Returns the actual partitioner in use by Cassandra if it does not match the expected partitioner , null if it matches . */ private String getMismatchedPartitioner ( Class < ? extends IPartitioner > expectedPartitioner ) { } }
String partitioner = null ; try { partitioner = _astyanaxKeyspace . describePartitioner ( ) ; boolean matches = CassandraPartitioner . fromClass ( partitioner ) . matches ( expectedPartitioner . getName ( ) ) ; if ( matches ) { return null ; } else { return partitioner ; } } catch ( ConnectionException e ) { throw Throwables . propagate ( e ) ; } catch ( IllegalArgumentException e ) { // Only thrown if the partitioner doesn ' t match any compatible partitioner , so by definition it is mismatched . return partitioner ; }
public class AbstractRemoteClient { /** * Method blocks until the remote reaches the desired connection state . * @ param connectionState the desired connection state * @ throws InterruptedException is thrown in case the thread is externally * interrupted . * @ throws org . openbase . jul . exception . CouldNotPerformException is thrown in case the * the remote is not active and the waiting condition is based on ConnectionState . State CONNECTED or CONNECTING . */ public void waitForConnectionState ( final ConnectionState . State connectionState ) throws InterruptedException , CouldNotPerformException { } }
try { waitForConnectionState ( connectionState , 0 ) ; } catch ( TimeoutException ex ) { assert false ; }
public class CommerceSubscriptionEntryUtil { /** * Returns the first commerce subscription entry in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce subscription entry , or < code > null < / code > if a matching commerce subscription entry could not be found */ public static CommerceSubscriptionEntry fetchByGroupId_First ( long groupId , OrderByComparator < CommerceSubscriptionEntry > orderByComparator ) { } }
return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ;
public class SimpleCookieManager { @ Override public OptionalThing < Cookie > getCookie ( String key ) { } }
assertKeyNotNull ( key ) ; final Cookie [ ] cookies = getRequest ( ) . getCookies ( ) ; if ( cookies != null ) { for ( Cookie cookie : cookies ) { if ( key . equals ( cookie . getName ( ) ) ) { return OptionalThing . of ( createSnapshotCookie ( cookie ) ) ; } } } return OptionalThing . ofNullable ( null , ( ) -> { throw new CookieNotFoundException ( "Not found the cookie by the key: " + key ) ; } ) ;
public class WRepeater { /** * Removes any stale contexts from the row context map . * @ param rowIds the current set of row Ids . */ protected void cleanupStaleContexts ( final Set < ? > rowIds ) { } }
RepeaterModel model = getOrCreateComponentModel ( ) ; if ( model . rowContextMap != null ) { for ( Iterator < Map . Entry < Object , SubUIContext > > i = model . rowContextMap . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry < Object , SubUIContext > entry = i . next ( ) ; Object rowId = entry . getKey ( ) ; if ( ! rowIds . contains ( rowId ) ) { i . remove ( ) ; } } if ( model . rowContextMap . isEmpty ( ) ) { model . rowContextMap = null ; } }
public class Ssh2Session { /** * This overidden method handles the " exit - status " , " exit - signal " and * " xon - xoff " channel requests . */ protected void channelRequest ( String requesttype , boolean wantreply , byte [ ] requestdata ) throws SshException { } }
try { if ( requesttype . equals ( "exit-status" ) ) { if ( requestdata != null ) { exitcode = ( int ) ByteArrayReader . readInt ( requestdata , 0 ) ; } } if ( requesttype . equals ( "exit-signal" ) ) { if ( requestdata != null ) { ByteArrayReader bar = new ByteArrayReader ( requestdata , 0 , requestdata . length ) ; try { exitsignalinfo = "Signal=" + bar . readString ( ) + " CoreDump=" + String . valueOf ( bar . read ( ) != 0 ) + " Message=" + bar . readString ( ) ; } finally { try { bar . close ( ) ; } catch ( IOException e ) { } } } } if ( requesttype . equals ( "xon-xoff" ) ) { flowControlEnabled = ( requestdata != null && requestdata [ 0 ] != 0 ) ; } super . channelRequest ( requesttype , wantreply , requestdata ) ; } catch ( IOException ex ) { throw new SshException ( ex , SshException . INTERNAL_ERROR ) ; }
public class AndroidUtil { /** * Get the number of tiles that can be stored on the file system . * @ param directory where the cache will reside * @ param fileSize average size of tile to be cached * @ return number of tiles that can be stored without running out of space */ @ SuppressWarnings ( "deprecation" ) @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN_MR2 ) public static long getAvailableCacheSlots ( String directory , int fileSize ) { } }
StatFs statfs = new StatFs ( directory ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR2 ) { return statfs . getAvailableBytes ( ) / fileSize ; } // problem is overflow with devices with large storage , so order is important here // additionally avoid division by zero in devices with a large block size int blocksPerFile = Math . max ( fileSize / statfs . getBlockSize ( ) , 1 ) ; return statfs . getAvailableBlocks ( ) / blocksPerFile ;
public class UtcRules { /** * Converts a { @ code UtcInstant } to a { @ code TaiInstant } . * This method converts from the UTC to the TAI time - scale using the * leap - second rules of the implementation . * @ param utcInstant the UTC instant to convert , not null * @ return the converted TAI instant , not null * @ throws DateTimeException if the valid range is exceeded * @ throws ArithmeticException if numeric overflow occurs */ public TaiInstant convertToTai ( UtcInstant utcInstant ) { } }
long mjd = utcInstant . getModifiedJulianDay ( ) ; long nod = utcInstant . getNanoOfDay ( ) ; long taiUtcDaySeconds = Math . multiplyExact ( Math . subtractExact ( mjd , OFFSET_MJD_TAI ) , SECS_PER_DAY ) ; long taiSecs = Math . addExact ( taiUtcDaySeconds , nod / NANOS_PER_SECOND + getTaiOffset ( mjd ) ) ; int nos = ( int ) ( nod % NANOS_PER_SECOND ) ; return TaiInstant . ofTaiSeconds ( taiSecs , nos ) ;
public class SoyMsgIdComputer { /** * Private helper to build the canonical message content string that should be used for msg id * computation . * < p > Note : For people who know what " presentation " means in this context , the result string * should be exactly the presentation string . * @ param msgParts The parts of the message . * @ param doUseBracedPhs Whether to use braced placeholders . * @ return The canonical message content string that should be used for msg id computation . */ @ VisibleForTesting static String buildMsgContentStrForMsgIdComputation ( ImmutableList < SoyMsgPart > msgParts , boolean doUseBracedPhs ) { } }
msgParts = IcuSyntaxUtils . convertMsgPartsToEmbeddedIcuSyntax ( msgParts ) ; StringBuilder msgStrSb = new StringBuilder ( ) ; for ( SoyMsgPart msgPart : msgParts ) { if ( msgPart instanceof SoyMsgRawTextPart ) { msgStrSb . append ( ( ( SoyMsgRawTextPart ) msgPart ) . getRawText ( ) ) ; } else if ( msgPart instanceof SoyMsgPlaceholderPart ) { if ( doUseBracedPhs ) { msgStrSb . append ( '{' ) ; } msgStrSb . append ( ( ( SoyMsgPlaceholderPart ) msgPart ) . getPlaceholderName ( ) ) ; if ( doUseBracedPhs ) { msgStrSb . append ( '}' ) ; } } else { throw new AssertionError ( "unexpected child: " + msgPart ) ; } } return msgStrSb . toString ( ) ;
public class DateParser { /** * Strip the searchString with and trim the result . * @ param input the source string * @ param searchString the string to look for in the source * @ return the stripped string */ private String stripPrefix ( final String input , final String searchString ) { } }
return input . substring ( searchString . length ( ) , input . length ( ) ) . trim ( ) ;
public class ColumnDescriptorAdapter { /** * Construct an Bigtable { @ link GCRule } from the given column descriptor . * @ param columnDescriptor a { @ link org . apache . hadoop . hbase . HColumnDescriptor } object . * @ return a { @ link GCRule } object . */ public static GCRule buildGarbageCollectionRule ( HColumnDescriptor columnDescriptor ) { } }
int maxVersions = columnDescriptor . getMaxVersions ( ) ; int minVersions = columnDescriptor . getMinVersions ( ) ; int ttlSeconds = columnDescriptor . getTimeToLive ( ) ; Preconditions . checkState ( minVersions < maxVersions , "HColumnDescriptor min versions must be less than max versions." ) ; if ( ttlSeconds == HColumnDescriptor . DEFAULT_TTL ) { if ( maxVersions == Integer . MAX_VALUE ) { return null ; } else { return GCRULES . maxVersions ( maxVersions ) ; } } // minVersions only comes into play with a TTL : GCRule ageRule = GCRULES . maxAge ( Duration . ofSeconds ( ttlSeconds ) ) ; if ( minVersions != HColumnDescriptor . DEFAULT_MIN_VERSIONS ) { // The logic here is : only delete a cell if : // 1 ) the age is older than : ttlSeconds AND // 2 ) the cell ' s relative version number is greater than : minVersions // Bigtable ' s nomenclature for this is : // Intersection ( AND ) // - maxAge = : HBase _ ttlSeconds // - maxVersions = : HBase _ minVersion ageRule = GCRULES . intersection ( ) . rule ( ageRule ) . rule ( GCRULES . maxVersions ( minVersions ) ) ; } if ( maxVersions == Integer . MAX_VALUE ) { return ageRule ; } else { return GCRULES . union ( ) . rule ( ageRule ) . rule ( GCRULES . maxVersions ( maxVersions ) ) ; }
public class ActionButton { /** * Initializes the image inside < b > Action Button < / b > * @ param attrs attributes of the XML tag that is inflating the view */ private void initImage ( TypedArray attrs ) { } }
int index = R . styleable . ActionButton_image ; if ( attrs . hasValue ( index ) ) { image = attrs . getDrawable ( index ) ; LOGGER . trace ( "Initialized Action Button image" ) ; }
public class JaxRsMethodBindings { /** * Get the key for the baseMethodBinding . This is : * < ul > * < li > the compartName for SearchMethodBindings * < li > the methodName for OperationMethodBindings * < li > { @ link # DEFAULT _ METHOD _ KEY } for all other MethodBindings * < / ul > * @ param theBinding the methodbinding * @ return the key for the methodbinding . */ private String getBindingKey ( final BaseMethodBinding < ? > theBinding ) { } }
if ( theBinding instanceof OperationMethodBinding ) { return ( ( OperationMethodBinding ) theBinding ) . getName ( ) ; } else if ( theBinding instanceof SearchMethodBinding ) { Search search = theBinding . getMethod ( ) . getAnnotation ( Search . class ) ; return search . compartmentName ( ) ; } else { return DEFAULT_METHOD_KEY ; }
public class AppServiceEnvironmentsInner { /** * Get available SKUs for scaling a worker pool . * Get available SKUs for scaling a worker pool . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param workerPoolName Name of the worker pool . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; SkuInfoInner & gt ; object */ public Observable < Page < SkuInfoInner > > listWorkerPoolSkusAsync ( final String resourceGroupName , final String name , final String workerPoolName ) { } }
return listWorkerPoolSkusWithServiceResponseAsync ( resourceGroupName , name , workerPoolName ) . map ( new Func1 < ServiceResponse < Page < SkuInfoInner > > , Page < SkuInfoInner > > ( ) { @ Override public Page < SkuInfoInner > call ( ServiceResponse < Page < SkuInfoInner > > response ) { return response . body ( ) ; } } ) ;
public class EurekaHttpClients { /** * / * testing */ static ClosableResolver < AwsEndpoint > compositeQueryResolver ( final ClusterResolver < AwsEndpoint > remoteResolver , final ClusterResolver < AwsEndpoint > localResolver , final EurekaClientConfig clientConfig , final EurekaTransportConfig transportConfig , final InstanceInfo myInstanceInfo ) { } }
String [ ] availZones = clientConfig . getAvailabilityZones ( clientConfig . getRegion ( ) ) ; String myZone = InstanceInfo . getZone ( availZones , myInstanceInfo ) ; ClusterResolver < AwsEndpoint > compositeResolver = new ClusterResolver < AwsEndpoint > ( ) { @ Override public String getRegion ( ) { return clientConfig . getRegion ( ) ; } @ Override public List < AwsEndpoint > getClusterEndpoints ( ) { List < AwsEndpoint > result = localResolver . getClusterEndpoints ( ) ; if ( result . isEmpty ( ) ) { result = remoteResolver . getClusterEndpoints ( ) ; } return result ; } } ; return new AsyncResolver < > ( EurekaClientNames . QUERY , new ZoneAffinityClusterResolver ( compositeResolver , myZone , true ) , transportConfig . getAsyncExecutorThreadPoolSize ( ) , transportConfig . getAsyncResolverRefreshIntervalMs ( ) , transportConfig . getAsyncResolverWarmUpTimeoutMs ( ) ) ;
public class Job { /** * Renames a job . */ @ Override public void renameTo ( String newName ) throws IOException { } }
File oldBuildDir = getBuildDir ( ) ; super . renameTo ( newName ) ; File newBuildDir = getBuildDir ( ) ; if ( oldBuildDir . isDirectory ( ) && ! newBuildDir . isDirectory ( ) ) { if ( ! newBuildDir . getParentFile ( ) . isDirectory ( ) ) { newBuildDir . getParentFile ( ) . mkdirs ( ) ; } if ( ! oldBuildDir . renameTo ( newBuildDir ) ) { throw new IOException ( "failed to rename " + oldBuildDir + " to " + newBuildDir ) ; } }
public class Menus { /** * 获取自定义菜单配置 * 操蛋的微信 , JSON太混乱了 ; 本接口拒绝支持 ' 公众号是在公众平台官网通过网站功能发布菜单 ' * @ return */ public MenuConfig getMenuConfig ( ) { } }
String url = WxEndpoint . get ( "url.menu.get.self" ) ; String content = wxClient . get ( url ) ; logger . debug ( "get menu config: {}" , content ) ; return JsonMapper . nonEmptyMapper ( ) . fromJson ( content , MenuConfig . class ) ;
public class ContextFromVertx { /** * Get the ( first ) request header with the given name . * @ return The header value */ @ Override public String header ( String name ) { } }
List < String > list = request . headers ( ) . get ( name ) ; if ( list != null && ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class BaseIdTokenGeneratorService { /** * Encode and finalize token . * @ param claims the claims * @ param registeredService the registered service * @ param accessToken the access token * @ return the string */ protected String encodeAndFinalizeToken ( final JwtClaims claims , final OAuthRegisteredService registeredService , final AccessToken accessToken ) { } }
LOGGER . debug ( "Received claims for the id token [{}] as [{}]" , accessToken , claims ) ; val idTokenResult = getConfigurationContext ( ) . getIdTokenSigningAndEncryptionService ( ) . encode ( registeredService , claims ) ; accessToken . setIdToken ( idTokenResult ) ; LOGGER . debug ( "Updating access token [{}] in ticket registry with ID token [{}]" , accessToken . getId ( ) , idTokenResult ) ; getConfigurationContext ( ) . getTicketRegistry ( ) . updateTicket ( accessToken ) ; return idTokenResult ;
public class WebUtils { /** * Returns the sufficiently shown WebElements * @ param javaScriptWasExecuted true if JavaScript was executed * @ param onlySufficientlyVisible true if only sufficiently visible { @ link WebElement } objects should be returned * @ return the sufficiently shown WebElements */ private ArrayList < WebElement > getWebElements ( boolean javaScriptWasExecuted , boolean onlySufficientlyVisbile ) { } }
ArrayList < WebElement > webElements = new ArrayList < WebElement > ( ) ; if ( javaScriptWasExecuted ) { for ( WebElement webElement : webElementCreator . getWebElementsFromWebViews ( ) ) { if ( ! onlySufficientlyVisbile ) { webElements . add ( webElement ) ; } else if ( isWebElementSufficientlyShown ( webElement ) ) { webElements . add ( webElement ) ; } } } return webElements ;
public class TokenClientParam { /** * Create a search criterion that matches against the given system * value but does not specify a code . This means that any code / identifier with * the given system should match . * Use { @ link # exactly ( ) } if you want to specify a code . */ public ICriterion < TokenClientParam > hasSystemWithAnyCode ( String theSystem ) { } }
return new TokenCriterion ( getParamName ( ) , theSystem , ( String ) null ) ;
public class UP3iFinishingOperationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setSeqnum ( Integer newSeqnum ) { } }
Integer oldSeqnum = seqnum ; seqnum = newSeqnum ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . UP_3I_FINISHING_OPERATION__SEQNUM , oldSeqnum , seqnum ) ) ;
public class AipContentCensor { /** * 组合审核接口 * @ param imgData 图片二进制数据 * @ param scenes 需要审核的服务类型 * @ param options 可选参数 * @ return JSONObject */ public JSONObject imageCensorComb ( byte [ ] imgData , List < String > scenes , HashMap < String , String > options ) { } }
AipRequest request = new AipRequest ( ) ; String base64Content = Base64Util . encode ( imgData ) ; request . addBody ( "image" , base64Content ) ; return imageCensorCombHelper ( request , scenes , options ) ;