signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CmsDriverManager { /** * Returns all projects which are owned by the current user or which are manageable
* for the group of the user . < p >
* @ param dbc the current database context
* @ param orgUnit the organizational unit to search project in
* @ param includeSubOus if to include sub organizational units
* @ return a list of objects of type < code > { @ link CmsProject } < / code >
* @ throws CmsException if operation was not successful */
public List < CmsProject > getAllManageableProjects ( CmsDbContext dbc , CmsOrganizationalUnit orgUnit , boolean includeSubOus ) throws CmsException { } } | Set < CmsProject > projects = new HashSet < CmsProject > ( ) ; // get the ous where the user has the project manager role
List < CmsOrganizationalUnit > ous = getOrgUnitsForRole ( dbc , CmsRole . PROJECT_MANAGER . forOrgUnit ( orgUnit . getName ( ) ) , includeSubOus ) ; // get the groups of the user if needed
Set < CmsUUID > userGroupIds = new HashSet < CmsUUID > ( ) ; Iterator < CmsGroup > itGroups = getGroupsOfUser ( dbc , dbc . currentUser ( ) . getName ( ) , false ) . iterator ( ) ; while ( itGroups . hasNext ( ) ) { CmsGroup group = itGroups . next ( ) ; userGroupIds . add ( group . getId ( ) ) ; } // TODO : this could be optimize if this method would have an additional parameter ' includeSubOus '
// get all projects that might come in question
projects . addAll ( getProjectDriver ( dbc ) . readProjects ( dbc , orgUnit . getName ( ) ) ) ; // filter hidden and not manageable projects
Iterator < CmsProject > itProjects = projects . iterator ( ) ; while ( itProjects . hasNext ( ) ) { CmsProject project = itProjects . next ( ) ; boolean manageable = true ; // if online
manageable = manageable && ! project . isOnlineProject ( ) ; // if hidden
manageable = manageable && ! project . isHidden ( ) ; if ( ! includeSubOus ) { // if not exact in the given ou
manageable = manageable && project . getOuFqn ( ) . equals ( orgUnit . getName ( ) ) ; } else { // if not in the given ou
manageable = manageable && project . getOuFqn ( ) . startsWith ( orgUnit . getName ( ) ) ; } if ( ! manageable ) { itProjects . remove ( ) ; continue ; } manageable = false ; // if owner
manageable = manageable || project . getOwnerId ( ) . equals ( dbc . currentUser ( ) . getId ( ) ) ; // project managers
Iterator < CmsOrganizationalUnit > itOus = ous . iterator ( ) ; while ( ! manageable && itOus . hasNext ( ) ) { CmsOrganizationalUnit ou = itOus . next ( ) ; // for project managers check visibility
manageable = manageable || project . getOuFqn ( ) . startsWith ( ou . getName ( ) ) ; } if ( ! manageable ) { // if manager of project
if ( userGroupIds . contains ( project . getManagerGroupId ( ) ) ) { String oufqn = readGroup ( dbc , project . getManagerGroupId ( ) ) . getOuFqn ( ) ; manageable = manageable || ( oufqn . startsWith ( dbc . getRequestContext ( ) . getOuFqn ( ) ) ) ; } } if ( ! manageable ) { // remove not accessible project
itProjects . remove ( ) ; } } List < CmsProject > manageableProjects = new ArrayList < CmsProject > ( projects ) ; // sort the list of projects based on the project name
Collections . sort ( manageableProjects ) ; // ensure the online project is not in the list
CmsProject onlineProject = readProject ( dbc , CmsProject . ONLINE_PROJECT_ID ) ; if ( manageableProjects . contains ( onlineProject ) ) { manageableProjects . remove ( onlineProject ) ; } return manageableProjects ; |
public class ISPNQuotaPersister { /** * { @ inheritDoc } */
public void clearWorkspaceData ( String repositoryName , String workspaceName ) throws BackupException { } } | String workspaceUniqueName = composeWorkspaceUniqueName ( repositoryName , workspaceName ) ; for ( Serializable cacheKey : cache . keySet ( ) ) { if ( cacheKey instanceof WorkspaceBasedKey ) { if ( workspaceUniqueName . equals ( ( ( WorkspaceBasedKey ) cacheKey ) . getWorkspaceUniqueName ( ) ) ) { cache . remove ( cacheKey ) ; } } } |
public class Client { /** * Generates an access token for a user
* @ param userId
* Id of the user
* @ param expiresIn
* Set the duration of the token in seconds . ( default : 259200 seconds = 72h )
* 72 hours is the max value .
* @ param reusable
* Defines if the token reusable . ( default : false ) If set to true , token can be used for multiple apps , until it expires .
* @ return Created MFAToken
* @ throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
* @ throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
* @ throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
* @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / multi - factor - authentication / generate - mfa - token " > Generate MFA Token documentation < / a > */
public MFAToken generateMFAToken ( long userId , Integer expiresIn , Boolean reusable ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } } | cleanError ( ) ; prepareToken ( ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . GENERATE_MFA_TOKEN_URL , Long . toString ( userId ) ) ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , Object > mfaParams = new HashMap < String , Object > ( ) ; mfaParams . put ( "expires_in" , expiresIn ) ; mfaParams . put ( "reusable" , reusable ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; String body = JSONUtils . buildJSON ( mfaParams ) ; bearerRequest . setBody ( body ) ; MFAToken mfaToken = null ; OneloginOAuth2JSONResourceResponse oAuth2Response = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . POST , OneloginOAuth2JSONResourceResponse . class ) ; if ( oAuth2Response . getResponseCode ( ) == 201 ) { JSONObject data = oAuth2Response . getJSONObjectFromContent ( ) ; mfaToken = new MFAToken ( data ) ; } else { error = oAuth2Response . getError ( ) ; errorDescription = oAuth2Response . getErrorDescription ( ) ; } return mfaToken ; |
public class SignMessage { /** * Internal function used in creating a SignMessage object from a byte string .
* @ param obj COSE _ Sign encoded object .
* @ throws CoseException Errors generated by the COSE module */
@ Override protected void DecodeFromCBORObject ( CBORObject obj ) throws CoseException { } } | if ( obj . size ( ) != 4 ) throw new CoseException ( "Invalid SignMessage structure" ) ; if ( obj . get ( 0 ) . getType ( ) == CBORType . ByteString ) { rgbProtected = obj . get ( 0 ) . GetByteString ( ) ; if ( obj . get ( 0 ) . GetByteString ( ) . length == 0 ) { objProtected = CBORObject . NewMap ( ) ; } else { objProtected = CBORObject . DecodeFromBytes ( rgbProtected ) ; if ( objProtected . size ( ) == 0 ) rgbProtected = new byte [ 0 ] ; } } else throw new CoseException ( "Invalid SignMessage structure" ) ; if ( obj . get ( 1 ) . getType ( ) == CBORType . Map ) { objUnprotected = obj . get ( 1 ) ; } else throw new CoseException ( "Invalid SignMessage structure" ) ; if ( obj . get ( 2 ) . getType ( ) == CBORType . ByteString ) rgbContent = obj . get ( 2 ) . GetByteString ( ) ; else if ( ! obj . get ( 2 ) . isNull ( ) ) throw new CoseException ( "Invalid SignMessage structure" ) ; if ( obj . get ( 3 ) . getType ( ) == CBORType . Array ) { for ( int i = 0 ; i < obj . get ( 3 ) . size ( ) ; i ++ ) { Signer signer = new Signer ( ) ; signer . DecodeFromCBORObject ( obj . get ( 3 ) . get ( i ) ) ; signerList . add ( signer ) ; } } else throw new CoseException ( "Invalid SignMessage structure" ) ; |
public class CheckerModel { /** * { @ inheritDoc } */
@ Override protected void initModel ( ) { } } | LOGGER . debug ( "Init Sample Model" ) ; // Initialize default values
object ( ) . sourcePath ( new File ( ComparisonParameters . sourcePath . get ( ) ) ) . targetPath ( new File ( ComparisonParameters . targetPath . get ( ) ) ) . missing ( false ) . newer ( false ) . upgraded ( false ) . downgraded ( false ) ; this . filteredList = new FilteredList < > ( object ( ) . pLastResult ( ) , this :: filter ) ; this . sortedList = new SortedList < > ( this . filteredList ) ; |
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getModelMergerPluginConfiguration ( ) { } } | if ( modelMergerPluginConfigurationEClass == null ) { modelMergerPluginConfigurationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 52 ) ; } return modelMergerPluginConfigurationEClass ; |
public class IconAwesome { /** * Use the free brand font of FontAwesome 5 . As a side effect , every FontAwesome icon on the same page is switched to FontAwesome 5.2.0 . By default , the icon set is the older version 4.7.0 . < P >
* Usually this method is called internally by the JSF engine . */
public void setBrand ( boolean _brand ) { } } | if ( _brand ) { AddResourcesListener . setFontAwesomeVersion ( 5 , this ) ; } getStateHelper ( ) . put ( PropertyKeys . brand , _brand ) ; |
public class ModuleAdapterProcessor { /** * Returns a map containing all { @ code @ Provides } methods , indexed by class . */
private Map < String , List < ExecutableElement > > providerMethodsByClass ( RoundEnvironment env ) { } } | Elements elementUtils = processingEnv . getElementUtils ( ) ; Types types = processingEnv . getTypeUtils ( ) ; Map < String , List < ExecutableElement > > result = new HashMap < String , List < ExecutableElement > > ( ) ; provides : for ( Element providerMethod : findProvidesMethods ( env ) ) { switch ( providerMethod . getEnclosingElement ( ) . getKind ( ) ) { case CLASS : break ; // valid , move along
default : // TODO ( tbroyer ) : pass annotation information
error ( "Unexpected @Provides on " + elementToString ( providerMethod ) , providerMethod ) ; continue ; } TypeElement type = ( TypeElement ) providerMethod . getEnclosingElement ( ) ; Set < Modifier > typeModifiers = type . getModifiers ( ) ; if ( typeModifiers . contains ( PRIVATE ) || typeModifiers . contains ( ABSTRACT ) ) { error ( "Classes declaring @Provides methods must not be private or abstract: " + type . getQualifiedName ( ) , type ) ; continue ; } Set < Modifier > methodModifiers = providerMethod . getModifiers ( ) ; if ( methodModifiers . contains ( PRIVATE ) || methodModifiers . contains ( ABSTRACT ) || methodModifiers . contains ( STATIC ) ) { error ( "@Provides methods must not be private, abstract or static: " + type . getQualifiedName ( ) + "." + providerMethod , providerMethod ) ; continue ; } ExecutableElement providerMethodAsExecutable = ( ExecutableElement ) providerMethod ; if ( ! providerMethodAsExecutable . getThrownTypes ( ) . isEmpty ( ) ) { error ( "@Provides methods must not have a throws clause: " + type . getQualifiedName ( ) + "." + providerMethod , providerMethod ) ; continue ; } // Invalidate return types .
TypeMirror returnType = types . erasure ( providerMethodAsExecutable . getReturnType ( ) ) ; if ( ! returnType . getKind ( ) . equals ( TypeKind . ERROR ) ) { // Validate if we have a type to validate ( a type yet to be generated by other
// processors is not " invalid " in this way , so ignore ) .
for ( String invalidTypeName : INVALID_RETURN_TYPES ) { TypeElement invalidTypeElement = elementUtils . getTypeElement ( invalidTypeName ) ; if ( invalidTypeElement != null && types . isSameType ( returnType , types . erasure ( invalidTypeElement . asType ( ) ) ) ) { error ( String . format ( "@Provides method must not return %s directly: %s.%s" , invalidTypeElement , type . getQualifiedName ( ) , providerMethod ) , providerMethod ) ; continue provides ; // Skip to next provides method .
} } } List < ExecutableElement > methods = result . get ( type . getQualifiedName ( ) . toString ( ) ) ; if ( methods == null ) { methods = new ArrayList < ExecutableElement > ( ) ; result . put ( type . getQualifiedName ( ) . toString ( ) , methods ) ; } methods . add ( providerMethodAsExecutable ) ; } TypeMirror objectType = elementUtils . getTypeElement ( "java.lang.Object" ) . asType ( ) ; // Catch any stray modules without @ Provides since their injectable types
// should still be registered and a ModuleAdapter should still be written .
for ( Element module : env . getElementsAnnotatedWith ( Module . class ) ) { if ( ! module . getKind ( ) . equals ( ElementKind . CLASS ) ) { error ( "Modules must be classes: " + elementToString ( module ) , module ) ; continue ; } TypeElement moduleType = ( TypeElement ) module ; // Verify that all modules do not extend from non - Object types .
if ( ! types . isSameType ( moduleType . getSuperclass ( ) , objectType ) ) { error ( "Modules must not extend from other classes: " + elementToString ( module ) , module ) ; } String moduleName = moduleType . getQualifiedName ( ) . toString ( ) ; if ( result . containsKey ( moduleName ) ) continue ; result . put ( moduleName , new ArrayList < ExecutableElement > ( ) ) ; } return result ; |
public class EmbedVaadinConfig { /** * Build a url for the specified port and context .
* If the < tt > httpPort < / tt > is equal to { @ link # PORT _ AUTO } , the
* returned url is not used as is because no http port has been
* allocated yet .
* @ param httpPort the http port to use
* @ param context the context of the url
* @ return a < tt > localhost < / tt > url for the specified port and context */
static String buildUrl ( int httpPort , String context ) { } } | final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "http://localhost:" ) ; if ( httpPort == PORT_AUTO ) { sb . append ( "[auto]" ) ; } else { sb . append ( httpPort ) ; } sb . append ( context ) ; return sb . toString ( ) ; |
public class EDBConverter { /** * Converts an OpenEngSBModel object to an EDBObject ( the version retrieving is not considered here . This is done in
* the EDB directly ) . */
public List < EDBObject > convertModelToEDBObject ( Object model , ConnectorInformation info ) { } } | if ( ! OpenEngSBModel . class . isAssignableFrom ( model . getClass ( ) ) ) { throw new IllegalArgumentException ( "This function need to get a model passed" ) ; } List < EDBObject > objects = new ArrayList < > ( ) ; if ( model != null ) { convertSubModel ( ( OpenEngSBModel ) model , objects , info ) ; } return objects ; |
public class OtpOutputStream { /** * Write an Erlang port to the stream .
* @ param node
* the nodename .
* @ param id
* an arbitrary number . Only the low order 28 bits will be used .
* @ param creation
* another arbitrary number . Only the low order 2 bits will
* be used . */
public void write_port ( final String node , final int id , final int creation ) { } } | write1 ( OtpExternal . portTag ) ; write_atom ( node ) ; write4BE ( id & 0xfffffff ) ; // 28 bits
write1 ( creation & 0x3 ) ; // 2 bits |
public class Log4JLogger { /** * { @ inheritDoc } */
@ Override public void debug ( String msg , Throwable throwable ) { } } | LOGGER . debug ( msg , throwable ) ; |
public class CommerceAccountPersistenceImpl { /** * Returns all the commerce accounts where userId = & # 63 ; and type = & # 63 ; .
* @ param userId the user ID
* @ param type the type
* @ return the matching commerce accounts */
@ Override public List < CommerceAccount > findByU_T ( long userId , int type ) { } } | return findByU_T ( userId , type , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class TreeInfo { /** * The position of the first statement in a block , or the position of
* the block itself if it is empty . */
public static int firstStatPos ( JCTree tree ) { } } | if ( tree . hasTag ( BLOCK ) && ( ( JCBlock ) tree ) . stats . nonEmpty ( ) ) return ( ( JCBlock ) tree ) . stats . head . pos ; else return tree . pos ; |
public class RaftSemaphore { /** * Changes the number of permits by adding the given permit value . Permits
* are not changed if it is a retry of a previous successful change request
* of a session - aware proxy . Permits are changed again if it is a retry of
* a successful change request of a sessionless proxy . If number of permits
* increase , new assignments can be done . Returns completed wait keys after
* successful change if there are any . Returns cancelled wait keys of
* the same endpoint if there are any . */
ReleaseResult change ( SemaphoreEndpoint endpoint , UUID invocationUid , int permits ) { } } | if ( permits == 0 ) { return ReleaseResult . failed ( Collections . < AcquireInvocationKey > emptyList ( ) ) ; } Collection < AcquireInvocationKey > cancelled = cancelWaitKeys ( endpoint , invocationUid ) ; long sessionId = endpoint . sessionId ( ) ; if ( sessionId != NO_SESSION_ID ) { SessionSemaphoreState state = sessionStates . get ( sessionId ) ; if ( state == null ) { state = new SessionSemaphoreState ( ) ; sessionStates . put ( sessionId , state ) ; } long threadId = endpoint . threadId ( ) ; if ( state . containsInvocation ( threadId , invocationUid ) ) { Collection < AcquireInvocationKey > c = Collections . emptyList ( ) ; return ReleaseResult . successful ( c , c ) ; } state . invocationRefUids . put ( threadId , Tuple2 . of ( invocationUid , permits ) ) ; } available += permits ; initialized = true ; Collection < AcquireInvocationKey > acquired = permits > 0 ? assignPermitsToWaitKeys ( ) : Collections . < AcquireInvocationKey > emptyList ( ) ; return ReleaseResult . successful ( acquired , cancelled ) ; |
public class JsonTokenizer { /** * Expect a string literal JSON token . A string literal is a double - quote
* delimited UTF - 8 encoded , JSON - escaped string .
* @ param message Message to add to exception if there are no more JSON
* tokens on the stream .
* @ param symbols List of symbol characters to expect . If
* @ return The symbol that was encountered .
* @ throws JsonException If no more tokens , or the token is illegally
* formatted .
* @ throws IOException If unable to read from stream . */
public char expectSymbol ( String message , char ... symbols ) throws IOException , JsonException { } } | if ( symbols . length == 0 ) { throw new IllegalArgumentException ( "No symbols to match." ) ; } if ( ! hasNext ( ) ) { if ( symbols . length == 1 ) { throw newParseException ( "Expected %s ('%c'): Got end of file" , message , symbols [ 0 ] ) ; } throw newParseException ( "Expected %s (one of ['%s']): Got end of file" , message , Strings . joinP ( "', '" , symbols ) ) ; } else { for ( char symbol : symbols ) { if ( unreadToken . isSymbol ( symbol ) ) { unreadToken = null ; return symbol ; } } if ( symbols . length == 1 ) { throw newMismatchException ( "Expected %s ('%c'): but found '%s'" , message , symbols [ 0 ] , unreadToken . asString ( ) ) ; } throw newMismatchException ( "Expected %s (one of ['%s']): but found '%s'" , message , Strings . joinP ( "', '" , symbols ) , unreadToken . asString ( ) ) ; } |
public class DistinctOperator { private static < IN , K > org . apache . flink . api . common . operators . SingleInputOperator < ? , IN , ? > translateSelectorFunctionDistinct ( SelectorFunctionKeys < IN , ? > rawKeys , ReduceFunction < IN > function , TypeInformation < IN > outputType , String name , Operator < IN > input , int parallelism , CombineHint hint ) { } } | @ SuppressWarnings ( "unchecked" ) final SelectorFunctionKeys < IN , K > keys = ( SelectorFunctionKeys < IN , K > ) rawKeys ; TypeInformation < Tuple2 < K , IN > > typeInfoWithKey = KeyFunctions . createTypeWithKey ( keys ) ; Operator < Tuple2 < K , IN > > keyedInput = KeyFunctions . appendKeyExtractor ( input , keys ) ; PlanUnwrappingReduceOperator < IN , K > reducer = new PlanUnwrappingReduceOperator < > ( function , keys , name , outputType , typeInfoWithKey ) ; reducer . setInput ( keyedInput ) ; reducer . setCombineHint ( hint ) ; reducer . setParallelism ( parallelism ) ; return KeyFunctions . appendKeyRemover ( reducer , keys ) ; |
public class ConstructorIntrospector { /** * Finds and returns a method handle for new instance of a Builder class .
* @ param clazz
* the persistence class
* @ return the method handle for the newBuilder / builder method */
public static MethodHandle findNewBuilderMethod ( Class < ? > clazz ) { } } | MethodHandle mh = null ; for ( String methodName : NEW_BUILDER_METHOD_NAMES ) { mh = IntrospectionUtils . findStaticMethod ( clazz , methodName , Object . class ) ; if ( mh != null ) { break ; } } return mh ; |
public class TiffImage { /** * Uncompress packbits compressed image data . */
public static void decodePackbits ( byte data [ ] , byte [ ] dst ) { } } | int srcCount = 0 , dstCount = 0 ; byte repeat , b ; try { while ( dstCount < dst . length ) { b = data [ srcCount ++ ] ; if ( b >= 0 && b <= 127 ) { // literal run packet
for ( int i = 0 ; i < ( b + 1 ) ; i ++ ) { dst [ dstCount ++ ] = data [ srcCount ++ ] ; } } else if ( b <= - 1 && b >= - 127 ) { // 2 byte encoded run packet
repeat = data [ srcCount ++ ] ; for ( int i = 0 ; i < ( - b + 1 ) ; i ++ ) { dst [ dstCount ++ ] = repeat ; } } else { // no - op packet . Do nothing
srcCount ++ ; } } } catch ( Exception e ) { // do nothing
} |
public class Type { /** * Retrieves the SQL character sequence required to ( re ) create the
* trigger , as a StringBuffer
* @ return the SQL character sequence required to ( re ) create the
* trigger */
@ Override public String getSQL ( ) { } } | if ( userTypeModifier == null ) { throw Error . runtimeError ( ErrorCode . U_S0500 , "Type" ) ; } return userTypeModifier . getSQL ( ) ; |
public class InstancesCountMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InstancesCount instancesCount , ProtocolMarshaller protocolMarshaller ) { } } | if ( instancesCount == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instancesCount . getAssigning ( ) , ASSIGNING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getBooting ( ) , BOOTING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getConnectionLost ( ) , CONNECTIONLOST_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getDeregistering ( ) , DEREGISTERING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getOnline ( ) , ONLINE_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getPending ( ) , PENDING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getRebooting ( ) , REBOOTING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getRegistered ( ) , REGISTERED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getRegistering ( ) , REGISTERING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getRequested ( ) , REQUESTED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getRunningSetup ( ) , RUNNINGSETUP_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getSetupFailed ( ) , SETUPFAILED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getShuttingDown ( ) , SHUTTINGDOWN_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getStartFailed ( ) , STARTFAILED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getStopFailed ( ) , STOPFAILED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getStopped ( ) , STOPPED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getStopping ( ) , STOPPING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getTerminated ( ) , TERMINATED_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getTerminating ( ) , TERMINATING_BINDING ) ; protocolMarshaller . marshall ( instancesCount . getUnassigning ( ) , UNASSIGNING_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class GetDomainDetailRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetDomainDetailRequest getDomainDetailRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getDomainDetailRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getDomainDetailRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Snappy { /** * Zero - copy compress using memory addresses .
* @ param inputAddr input memory address
* @ param inputSize input byte size
* @ param destAddr destination address of the compressed data
* @ return the compressed data size
* @ throws IOException */
public static long rawCompress ( long inputAddr , long inputSize , long destAddr ) throws IOException { } } | return impl . rawCompress ( inputAddr , inputSize , destAddr ) ; |
public class SipStandardService { /** * Find a sip Connector by it ' s ip address , port and transport
* @ param ipAddress ip address of the connector to find
* @ param port port of the connector to find
* @ param transport transport of the connector to find
* @ return the found sip connector or null if noting found */
private Connector findSipConnector ( String ipAddress , int port , String transport ) { } } | Connector connectorToRemove = null ; for ( Connector connector : connectors ) { final ProtocolHandler protocolHandler = connector . getProtocolHandler ( ) ; if ( protocolHandler instanceof SipProtocolHandler ) { final SipProtocolHandler sipProtocolHandler = ( SipProtocolHandler ) protocolHandler ; if ( sipProtocolHandler . getIpAddress ( ) . equals ( ipAddress ) && sipProtocolHandler . getPort ( ) == port && sipProtocolHandler . getSignalingTransport ( ) . equalsIgnoreCase ( transport ) ) { // connector . destroy ( ) ;
connectorToRemove = connector ; break ; } } } return connectorToRemove ; |
public class FileComparer { /** * Removes similar classes in the first cs File
* @ throws IOException */
public void removeSimilarClassesFromFile1 ( ) throws IOException { } } | logging . info ( "Start reding cs File" ) ; List < String > linescs1 = getFileLinesAsList ( csFile1 ) ; logging . info ( "Start reding cs File" ) ; List < String > linescs2 = getFileLinesAsList ( csFile2 ) ; logging . info ( "Search classes" ) ; List < String > classNames1 = searchClasses ( linescs1 ) ; logging . info ( "Found " + classNames1 . size ( ) + " classes" ) ; logging . info ( "Search classes" ) ; List < String > classNames2 = searchClasses ( linescs2 ) ; logging . info ( "Found " + classNames2 . size ( ) + " classes" ) ; logging . info ( "Removing similarities from the file" ) ; for ( String name : findSimilarClassNames ( classNames1 , classNames2 ) ) { linescs1 = removeLinesContainingClassname ( linescs1 , name ) ; } logging . info ( "Remove Attributes, which stands alone" ) ; linescs1 = removeAttributesNotBoundToClass ( linescs1 ) ; if ( ! windows ) { logging . info ( "Replace abstract classes with interfaces" ) ; linescs1 = replaceAbstractClasses ( linescs1 ) ; linescs2 = replaceAbstractClasses ( linescs2 ) ; logging . info ( "Save files" ) ; } replaceFilesWithNewContent ( linescs1 , csFile1 ) ; replaceFilesWithNewContent ( linescs2 , csFile2 ) ; |
public class sslocspresponder { /** * Use this API to add sslocspresponder resources . */
public static base_responses add ( nitro_service client , sslocspresponder resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { sslocspresponder addresources [ ] = new sslocspresponder [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new sslocspresponder ( ) ; addresources [ i ] . name = resources [ i ] . name ; addresources [ i ] . url = resources [ i ] . url ; addresources [ i ] . cache = resources [ i ] . cache ; addresources [ i ] . cachetimeout = resources [ i ] . cachetimeout ; addresources [ i ] . batchingdepth = resources [ i ] . batchingdepth ; addresources [ i ] . batchingdelay = resources [ i ] . batchingdelay ; addresources [ i ] . resptimeout = resources [ i ] . resptimeout ; addresources [ i ] . respondercert = resources [ i ] . respondercert ; addresources [ i ] . trustresponder = resources [ i ] . trustresponder ; addresources [ i ] . producedattimeskew = resources [ i ] . producedattimeskew ; addresources [ i ] . signingcert = resources [ i ] . signingcert ; addresources [ i ] . usenonce = resources [ i ] . usenonce ; addresources [ i ] . insertclientcert = resources [ i ] . insertclientcert ; } result = add_bulk_request ( client , addresources ) ; } return result ; |
public class DatabaseStoreService { /** * Declarative Services method for setting the UserTransaction service reference
* @ param ref reference to service object ; type of service object is verified */
protected void setUserTransaction ( ServiceReference < UserTransaction > ref ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_WAS . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_WAS . logp ( Level . FINE , methodClassName , "setUserTransaction" , "setting " + ref ) ; } userTransactionRef . setReference ( ref ) ; |
public class DatePanel { /** * Get days of a month
* @ param year value of the year
* @ param month value of the month
* @ return days array of this month */
private String [ ] getDays ( int year , int month ) { } } | Calendar cal = Calendar . getInstance ( ) ; cal . set ( year , month , 1 ) ; int dayNum = cal . getActualMaximum ( Calendar . DAY_OF_MONTH ) ; String [ ] days = new String [ dayNum ] ; for ( int i = 0 ; i < dayNum ; i ++ ) { days [ i ] = String . valueOf ( i + 1 ) ; } return days ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcSimplePropertyTemplateTypeEnum ( ) { } } | if ( ifcSimplePropertyTemplateTypeEnumEEnum == null ) { ifcSimplePropertyTemplateTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1063 ) ; } return ifcSimplePropertyTemplateTypeEnumEEnum ; |
public class StandardFieldsDialog { /** * Adds a { @ link ZapLabel } field , with the given label and , optionally , the given value , to the tab with the given index .
* @ param tabIndex the index of the tab where the read - only text field should be added .
* @ param fieldLabel the name of the label of the read - only text field .
* @ param value the value of the field , might be { @ code null } .
* @ since TODO add version
* @ throws IllegalArgumentException if any of the following conditions is true :
* < ul >
* < li > the dialogue does not have tabs ; < / li >
* < li > the dialogue has tabs but the given tab index is not valid ; < / li >
* < li > a field with the given label already exists . < / li >
* < / ul >
* @ see # addTextFieldReadOnly ( String , String )
* @ see # addTextField ( int , String , String ) */
public void addTextFieldReadOnly ( int tabIndex , String fieldLabel , String value ) { } } | addTextComponent ( tabIndex , new ZapLabel ( ) , fieldLabel , value ) ; |
public class TimingBufferSource { /** * Try to terminate the VM as soon as possible no matter the method and how abrupt it may be .
* @ param msg an error message which may end up being reported . */
private static void commitSuicide ( String msg ) { } } | Thread t = new Thread ( ( ) -> { // halt the JVM immediately unless the security manager prevents this
try { System . exit ( - 1 ) ; } catch ( SecurityException ex ) { LOGGER . info ( "SecurityException prevented system exit" , ex ) ; } // log an error stating that the JVM should be manually aborted
try { while ( true ) { Thread . sleep ( 5000L ) ; LOGGER . error ( "VM is in an unreliable state - please abort it!" ) ; } } catch ( InterruptedException e ) { LOGGER . info ( "JVM Instability logger terminated by interrupt" ) ; } } ) ; t . setDaemon ( true ) ; // spawn a thread here to avoid provoking deadlocks
t . start ( ) ; throw new Error ( msg ) ; |
public class Updater { /** * Check to see if the program should continue by evaluation whether the plugin is already updated , or shouldn ' t be updated */
private boolean versionCheck ( String title ) { } } | if ( this . type != UpdateType . NO_VERSION_CHECK ) { final String version = caller . getPluginVersion ( ) ; final String remoteVersion = title ; // Get the newest file ' s version number
if ( this . hasTag ( version ) || version . contains ( remoteVersion ) ) { // We already have the latest version , or this build is tagged for no - update
this . result = Updater . UpdateResult . NO_UPDATE ; return false ; } } return true ; |
public class SpiderTransaction { /** * Add a column to the " _ shards " row for the given shard number and date , indicating
* that this shard is being used . The " _ shards " row lives in the table ' s Terms store
* and uses the format :
* < pre >
* _ shards = { { shard 1 } : { date 1 } , { shard 1 } : { date 2 } , . . . }
* < / pre >
* Dates are stored as { @ link Date # getTime ( ) } values , converted to strings via
* { @ link Long # toString ( ) } .
* @ param tableDef { @ link TableDefinition } of a sharded table .
* @ param shardNumber Number of a new shard ( must be > 0 ) .
* @ param startDate Date that marks the beginning of object timestamp values that
* reside in the shard . */
public void addShardStart ( TableDefinition tableDef , int shardNumber , Date startDate ) { } } | assert tableDef . isSharded ( ) && shardNumber > 0 ; addColumn ( SpiderService . termsStoreName ( tableDef ) , SHARDS_ROW_KEY , Integer . toString ( shardNumber ) , Utils . toBytes ( Long . toString ( startDate . getTime ( ) ) ) ) ; |
public class ESigList { /** * Returns true if items exist that the user may sign .
* @ param selectedOnly If true , examine only selected items .
* @ return True if items exist that the user may sign . */
public boolean canSign ( boolean selectedOnly ) { } } | for ( ESigItem item : items ) { if ( ( ! selectedOnly || item . isSelected ( ) ) && ( item . getSignState ( ) != SignState . FORCED_NO ) ) { return true ; } } return false ; |
public class AbstractHibernateCriteriaBuilder { /** * Applies a sql restriction to the results to allow something like :
* @ param sqlRestriction the sql restriction
* @ param values jdbc parameters
* @ return a Criteria instance */
public org . grails . datastore . mapping . query . api . Criteria sqlRestriction ( String sqlRestriction , List < ? > values ) { } } | if ( ! validateSimpleExpression ( ) ) { throwRuntimeException ( new IllegalArgumentException ( "Call to [sqlRestriction] with value [" + sqlRestriction + "] not allowed here." ) ) ; } final int numberOfParameters = values . size ( ) ; final Type [ ] typesArray = new Type [ numberOfParameters ] ; final Object [ ] valuesArray = new Object [ numberOfParameters ] ; if ( numberOfParameters > 0 ) { final TypeHelper typeHelper = sessionFactory . getTypeHelper ( ) ; for ( int i = 0 ; i < typesArray . length ; i ++ ) { final Object value = values . get ( i ) ; typesArray [ i ] = typeHelper . basic ( value . getClass ( ) ) ; valuesArray [ i ] = value ; } } addToCriteria ( Restrictions . sqlRestriction ( sqlRestriction , valuesArray , typesArray ) ) ; return this ; |
public class UserImpl { /** * { @ inheritDoc } */
@ Override public void addRole ( final String role ) { } } | try { roles . add ( UserRoleName . valueOf ( role ) ) ; } catch ( Exception e ) { logger . warn ( "Tried to add unrecognized role: " + role ) ; } |
public class PubchemFingerprinter { /** * Section 1 : Hierarchic Element Counts - These bs test for the presence or
* count of individual chemical atoms represented by their atomic symbol . */
private static void countElements ( byte [ ] fp , IAtomContainer mol ) { } } | int b ; CountElements ce = new CountElements ( mol ) ; b = 0 ; if ( ce . getCount ( "H" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 1 ; if ( ce . getCount ( "H" ) >= 8 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 2 ; if ( ce . getCount ( "H" ) >= 16 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 3 ; if ( ce . getCount ( "H" ) >= 32 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 4 ; if ( ce . getCount ( "Li" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 5 ; if ( ce . getCount ( "Li" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 6 ; if ( ce . getCount ( "B" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 7 ; if ( ce . getCount ( "B" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 8 ; if ( ce . getCount ( "B" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 9 ; if ( ce . getCount ( "C" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 10 ; if ( ce . getCount ( "C" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 11 ; if ( ce . getCount ( "C" ) >= 8 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 12 ; if ( ce . getCount ( "C" ) >= 16 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 13 ; if ( ce . getCount ( "C" ) >= 32 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 14 ; if ( ce . getCount ( "N" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 15 ; if ( ce . getCount ( "N" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 16 ; if ( ce . getCount ( "N" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 17 ; if ( ce . getCount ( "N" ) >= 8 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 18 ; if ( ce . getCount ( "O" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 19 ; if ( ce . getCount ( "O" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 20 ; if ( ce . getCount ( "O" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 21 ; if ( ce . getCount ( "O" ) >= 8 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 22 ; if ( ce . getCount ( "O" ) >= 16 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 23 ; if ( ce . getCount ( "F" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 24 ; if ( ce . getCount ( "F" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 25 ; if ( ce . getCount ( "F" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 26 ; if ( ce . getCount ( "Na" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 27 ; if ( ce . getCount ( "Na" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 28 ; if ( ce . getCount ( "Si" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 29 ; if ( ce . getCount ( "Si" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 30 ; if ( ce . getCount ( "P" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 31 ; if ( ce . getCount ( "P" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 32 ; if ( ce . getCount ( "P" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 33 ; if ( ce . getCount ( "S" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 34 ; if ( ce . getCount ( "S" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 35 ; if ( ce . getCount ( "S" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 36 ; if ( ce . getCount ( "S" ) >= 8 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 37 ; if ( ce . getCount ( "Cl" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 38 ; if ( ce . getCount ( "Cl" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 39 ; if ( ce . getCount ( "Cl" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 40 ; if ( ce . getCount ( "Cl" ) >= 8 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 41 ; if ( ce . getCount ( "K" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 42 ; if ( ce . getCount ( "K" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 43 ; if ( ce . getCount ( "Br" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 44 ; if ( ce . getCount ( "Br" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 45 ; if ( ce . getCount ( "Br" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 46 ; if ( ce . getCount ( "I" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 47 ; if ( ce . getCount ( "I" ) >= 2 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 48 ; if ( ce . getCount ( "I" ) >= 4 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 49 ; if ( ce . getCount ( "Be" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 50 ; if ( ce . getCount ( "Mg" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 51 ; if ( ce . getCount ( "Al" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 52 ; if ( ce . getCount ( "Ca" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 53 ; if ( ce . getCount ( "Sc" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 54 ; if ( ce . getCount ( "Ti" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 55 ; if ( ce . getCount ( "V" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 56 ; if ( ce . getCount ( "Cr" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 57 ; if ( ce . getCount ( "Mn" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 58 ; if ( ce . getCount ( "Fe" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 59 ; if ( ce . getCount ( "Co" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 60 ; if ( ce . getCount ( "Ni" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 61 ; if ( ce . getCount ( "Cu" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 62 ; if ( ce . getCount ( "Zn" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 63 ; if ( ce . getCount ( "Ga" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 64 ; if ( ce . getCount ( "Ge" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 65 ; if ( ce . getCount ( "As" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 66 ; if ( ce . getCount ( "Se" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 67 ; if ( ce . getCount ( "Kr" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 68 ; if ( ce . getCount ( "Rb" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 69 ; if ( ce . getCount ( "Sr" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 70 ; if ( ce . getCount ( "Y" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 71 ; if ( ce . getCount ( "Zr" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 72 ; if ( ce . getCount ( "Nb" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 73 ; if ( ce . getCount ( "Mo" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 74 ; if ( ce . getCount ( "Ru" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 75 ; if ( ce . getCount ( "Rh" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 76 ; if ( ce . getCount ( "Pd" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 77 ; if ( ce . getCount ( "Ag" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 78 ; if ( ce . getCount ( "Cd" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 79 ; if ( ce . getCount ( "In" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 80 ; if ( ce . getCount ( "Sn" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 81 ; if ( ce . getCount ( "Sb" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 82 ; if ( ce . getCount ( "Te" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 83 ; if ( ce . getCount ( "Xe" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 84 ; if ( ce . getCount ( "Cs" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 85 ; if ( ce . getCount ( "Ba" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 86 ; if ( ce . getCount ( "Lu" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 87 ; if ( ce . getCount ( "Hf" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 88 ; if ( ce . getCount ( "Ta" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 89 ; if ( ce . getCount ( "W" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 90 ; if ( ce . getCount ( "Re" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 91 ; if ( ce . getCount ( "Os" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 92 ; if ( ce . getCount ( "Ir" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 93 ; if ( ce . getCount ( "Pt" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 94 ; if ( ce . getCount ( "Au" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 95 ; if ( ce . getCount ( "Hg" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 96 ; if ( ce . getCount ( "Tl" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 97 ; if ( ce . getCount ( "Pb" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 98 ; if ( ce . getCount ( "Bi" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 99 ; if ( ce . getCount ( "La" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 100 ; if ( ce . getCount ( "Ce" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 101 ; if ( ce . getCount ( "Pr" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 102 ; if ( ce . getCount ( "Nd" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 103 ; if ( ce . getCount ( "Pm" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 104 ; if ( ce . getCount ( "Sm" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 105 ; if ( ce . getCount ( "Eu" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 106 ; if ( ce . getCount ( "Gd" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 107 ; if ( ce . getCount ( "Tb" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 108 ; if ( ce . getCount ( "Dy" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 109 ; if ( ce . getCount ( "Ho" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 110 ; if ( ce . getCount ( "Er" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 111 ; if ( ce . getCount ( "Tm" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 112 ; if ( ce . getCount ( "Yb" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 113 ; if ( ce . getCount ( "Tc" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; b = 114 ; if ( ce . getCount ( "U" ) >= 1 ) fp [ b >> 3 ] |= MASK [ b % 8 ] ; |
public class AdminRunner { /** * Main entry point for the Admin Tools Runner .
* To speed up setup , create a config . properties file and put the following properties ( at a minimum ) :
* pravegaservice . containerCount = { number of containers }
* pravegaservice . zkURL = { host : port for ZooKeeper }
* bookkeeper . bkLedgerPath = { path in ZooKeeper where BookKeeper stores Ledger metadata }
* bookkeeper . zkMetadataPath = { path in ZooKeeper where Pravega stores BookKeeperLog metadata }
* Then invoke this program with :
* - Dpravega . configurationFile = config . properties
* @ param args Arguments .
* @ throws Exception If one occurred . */
public static void main ( String [ ] args ) throws Exception { } } | LoggerContext context = ( LoggerContext ) LoggerFactory . getILoggerFactory ( ) ; context . getLoggerList ( ) . get ( 0 ) . setLevel ( Level . ERROR ) ; System . out . println ( "Pravega Admin Tools.\n" ) ; @ Cleanup AdminCommandState state = new AdminCommandState ( ) ; // Output loaded config .
System . out . println ( "Initial configuration:" ) ; val initialConfigCmd = new ConfigListCommand ( new CommandArgs ( Collections . emptyList ( ) , state ) ) ; initialConfigCmd . execute ( ) ; // Continuously accept new commands as long as the user entered one .
System . out . println ( String . format ( "%nType \"%s\" for list of commands, or \"%s\" to exit." , CMD_HELP , CMD_EXIT ) ) ; @ Cleanup Scanner input = new Scanner ( System . in ) ; while ( true ) { System . out . print ( System . lineSeparator ( ) + "> " ) ; String line = input . nextLine ( ) ; if ( Strings . isNullOrEmpty ( line . trim ( ) ) ) { continue ; } Parser . Command pc = Parser . parse ( line ) ; switch ( pc . getComponent ( ) ) { case CMD_HELP : printHelp ( null ) ; break ; case CMD_EXIT : System . exit ( 0 ) ; break ; default : execCommand ( pc , state ) ; break ; } } |
public class DelegatedClientAuthenticationAction { /** * Handle the thrown exception .
* @ param webContext the web context
* @ param client the authentication client
* @ param e the thrown exception
* @ return the event to trigger */
protected Event handleException ( final J2EContext webContext , final BaseClient < Credentials , CommonProfile > client , final Exception e ) { } } | if ( e instanceof RequestSloException ) { try { webContext . getResponse ( ) . sendRedirect ( "logout" ) ; } catch ( final IOException ioe ) { throw new IllegalArgumentException ( "Unable to call logout" , ioe ) ; } return stopWebflow ( ) ; } val msg = String . format ( "Delegated authentication has failed with client %s" , client . getName ( ) ) ; LOGGER . error ( msg , e ) ; throw new IllegalArgumentException ( msg ) ; |
public class JXMapViewer { /** * Set the current zoom level
* @ param zoom the new zoom level */
public void setZoom ( int zoom ) { } } | if ( zoom == this . zoomLevel ) { return ; } TileFactoryInfo info = getTileFactory ( ) . getInfo ( ) ; // don ' t repaint if we are out of the valid zoom levels
if ( info != null && ( zoom < info . getMinimumZoomLevel ( ) || zoom > info . getMaximumZoomLevel ( ) ) ) { return ; } // if ( zoom > = 0 & & zoom < = 15 & & zoom ! = this . zoom ) {
int oldzoom = this . zoomLevel ; Point2D oldCenter = getCenter ( ) ; Dimension oldMapSize = getTileFactory ( ) . getMapSize ( oldzoom ) ; this . zoomLevel = zoom ; this . firePropertyChange ( "zoom" , oldzoom , zoom ) ; Dimension mapSize = getTileFactory ( ) . getMapSize ( zoom ) ; setCenter ( new Point2D . Double ( oldCenter . getX ( ) * ( mapSize . getWidth ( ) / oldMapSize . getWidth ( ) ) , oldCenter . getY ( ) * ( mapSize . getHeight ( ) / oldMapSize . getHeight ( ) ) ) ) ; repaint ( ) ; |
public class MasterSlaveSQLRewriteEngine { /** * Rewrite SQL .
* @ return SQL */
public String rewrite ( ) { } } | if ( sqlTokens . isEmpty ( ) ) { return originalSQL ; } SQLBuilder result = new SQLBuilder ( Collections . emptyList ( ) ) ; int count = 0 ; for ( SQLToken each : sqlTokens ) { if ( 0 == count ) { result . appendLiterals ( originalSQL . substring ( 0 , each . getStartIndex ( ) ) ) ; } if ( each instanceof SchemaToken ) { appendSchemaPlaceholder ( originalSQL , result , ( SchemaToken ) each , count ) ; } count ++ ; } return result . toSQL ( masterSlaveRule , metaData . getDataSource ( ) ) ; |
public class MinimumSwaps { /** * Determine the minimum number of swaps required to transform one binary string into another .
* If the transformation isn ' t possible , return a message indicating this .
* Examples :
* > > > minimumSwaps ( " 1101 " , " 1110 " )
* > > > minimumSwaps ( " 1111 " , " 0100 " )
* " Not Possible "
* > > > minimumSwaps ( " 1110000 " , " 0001101 " ) */
public static String minimumSwaps ( String binary_str1 , String binary_str2 ) { } } | int diff_count = 0 ; for ( int i = 0 ; i < binary_str1 . length ( ) ; i ++ ) { if ( binary_str1 . charAt ( i ) != binary_str2 . charAt ( i ) ) { diff_count += 1 ; } } if ( diff_count % 2 == 0 ) { return Integer . toString ( diff_count / 2 ) ; } else { return "Not Possible" ; } |
public class Approximation { /** * Calculate Sin using Quadratic curve .
* @ param x An angle , in radians .
* @ return Result . */
public static double Lowprecision_Sin ( double x ) { } } | // always wrap input angle to - PI . . PI
if ( x < - 3.14159265 ) x += 6.28318531 ; else if ( x > 3.14159265 ) x -= 6.28318531 ; // compute sine
if ( x < 0 ) return 1.27323954 * x + .405284735 * x * x ; else return 1.27323954 * x - 0.405284735 * x * x ; |
public class SourceTableRowProcessingPublisher { /** * Inspects the row processed tables primary keys . If all primary keys are
* in the source columns of the AnalysisJob , they will be added to the
* physically queried columns .
* Adding the primary keys to the query is a trade - off : It helps a lot in
* making eg . annotated rows referenceable to the source table , but it may
* also potentially make the job heavier to execute since a lot of ( unique )
* values will be retrieved . */
public void addPrimaryKeysIfSourced ( ) { } } | final List < Column > primaryKeyColumns = getTable ( ) . getPrimaryKeys ( ) ; if ( primaryKeyColumns == null || primaryKeyColumns . isEmpty ( ) ) { logger . info ( "No primary keys defined for table {}, not pre-selecting primary keys" , getTable ( ) . getName ( ) ) ; return ; } final Collection < InputColumn < ? > > sourceInputColumns = getAnalysisJob ( ) . getSourceColumns ( ) ; final List < Column > sourceColumns = CollectionUtils . map ( sourceInputColumns , InputColumn :: getPhysicalColumn ) ; for ( final Column primaryKeyColumn : primaryKeyColumns ) { if ( ! sourceColumns . contains ( primaryKeyColumn ) ) { logger . info ( "Primary key column {} not added to source columns, not pre-selecting primary keys" ) ; return ; } } addPhysicalColumns ( primaryKeyColumns ) ; |
public class ExperimentsInner { /** * Gets information about an Experiment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ param experimentName The name of the experiment . Experiment names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ 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 < ExperimentInner > getAsync ( String resourceGroupName , String workspaceName , String experimentName , final ServiceCallback < ExperimentInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName ) , serviceCallback ) ; |
public class UnifiedPushConfig { /** * Validates categories against Google ' s pattern .
* @ param categories a group of Strings each will be validated .
* @ throws IllegalArgumentException if a category fails to match [ a - zA - Z0-9 - _ . ~ % ] + */
private static void validateCategories ( String ... categories ) { } } | for ( String category : categories ) { if ( ! category . matches ( FCM_TOPIC_PATTERN ) ) { throw new IllegalArgumentException ( String . format ( "%s does not match %s" , category , FCM_TOPIC_PATTERN ) ) ; } } |
public class JobVersionsInner { /** * Gets all versions of a job .
* @ 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 to get .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; JobVersionInner & gt ; object */
public Observable < Page < JobVersionInner > > listByJobAsync ( final String resourceGroupName , final String serverName , final String jobAgentName , final String jobName ) { } } | return listByJobWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , jobName ) . map ( new Func1 < ServiceResponse < Page < JobVersionInner > > , Page < JobVersionInner > > ( ) { @ Override public Page < JobVersionInner > call ( ServiceResponse < Page < JobVersionInner > > response ) { return response . body ( ) ; } } ) ; |
public class DhtGetPeersReplyAlert { /** * This method creates a new list each time is called .
* @ return the list of peers */
public ArrayList < TcpEndpoint > peers ( ) { } } | tcp_endpoint_vector v = alert . peers ( ) ; int size = ( int ) v . size ( ) ; ArrayList < TcpEndpoint > peers = new ArrayList < > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { tcp_endpoint endp = v . get ( i ) ; String ip = new Address ( endp . address ( ) ) . toString ( ) ; // clone
peers . add ( new TcpEndpoint ( ip , endp . port ( ) ) ) ; } return peers ; |
public class CmsRelationFilter { /** * Returns an extended filter with the given source relation path restriction . < p >
* @ param path the source relation path to filter
* @ return an extended filter with the given source relation path restriction */
public CmsRelationFilter filterPath ( String path ) { } } | CmsRelationFilter filter = ( CmsRelationFilter ) clone ( ) ; filter . m_path = path ; return filter ; |
public class UnixPath { /** * Returns component in { @ code path } at { @ code index } .
* @ see java . nio . file . Path # getName ( int ) */
public UnixPath getName ( int index ) { } } | if ( path . isEmpty ( ) ) { return this ; } try { return new UnixPath ( permitEmptyComponents , getParts ( ) . get ( index ) ) ; } catch ( IndexOutOfBoundsException e ) { throw new IllegalArgumentException ( ) ; } |
public class OfferRequestProvider { /** * happen anytime soon . */
@ Override public OfferRequestPacket parse ( XmlPullParser parser , int initialDepth , XmlEnvironment xmlEnvironment ) throws XmlPullParserException , IOException , SmackParsingException { } } | int eventType = parser . getEventType ( ) ; String sessionID = null ; int timeout = - 1 ; OfferContent content = null ; boolean done = false ; Map < String , List < String > > metaData = new HashMap < > ( ) ; if ( eventType != XmlPullParser . START_TAG ) { // throw exception
} Jid userJID = ParserUtils . getJidAttribute ( parser ) ; // Default userID to the JID .
Jid userID = userJID ; while ( ! done ) { eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG ) { String elemName = parser . getName ( ) ; if ( "timeout" . equals ( elemName ) ) { timeout = Integer . parseInt ( parser . nextText ( ) ) ; } else if ( MetaData . ELEMENT_NAME . equals ( elemName ) ) { metaData = MetaDataUtils . parseMetaData ( parser ) ; } else if ( SessionID . ELEMENT_NAME . equals ( elemName ) ) { sessionID = parser . getAttributeValue ( "" , "id" ) ; } else if ( UserID . ELEMENT_NAME . equals ( elemName ) ) { userID = ParserUtils . getJidAttribute ( parser , "id" ) ; } else if ( "user-request" . equals ( elemName ) ) { content = UserRequest . getInstance ( ) ; } else if ( RoomInvitation . ELEMENT_NAME . equals ( elemName ) ) { RoomInvitation invitation = ( RoomInvitation ) PacketParserUtils . parseExtensionElement ( RoomInvitation . ELEMENT_NAME , RoomInvitation . NAMESPACE , parser , xmlEnvironment ) ; content = new InvitationRequest ( invitation . getInviter ( ) , invitation . getRoom ( ) , invitation . getReason ( ) ) ; } else if ( RoomTransfer . ELEMENT_NAME . equals ( elemName ) ) { RoomTransfer transfer = ( RoomTransfer ) PacketParserUtils . parseExtensionElement ( RoomTransfer . ELEMENT_NAME , RoomTransfer . NAMESPACE , parser , xmlEnvironment ) ; content = new TransferRequest ( transfer . getInviter ( ) , transfer . getRoom ( ) , transfer . getReason ( ) ) ; } } else if ( eventType == XmlPullParser . END_TAG ) { if ( "offer" . equals ( parser . getName ( ) ) ) { done = true ; } } } OfferRequestPacket offerRequest = new OfferRequestPacket ( userJID , userID , timeout , metaData , sessionID , content ) ; offerRequest . setType ( IQ . Type . set ) ; return offerRequest ; |
public class EnumMapping { /** * generate the field initializer for the map */
void translate ( ) { } } | make . at ( pos . getStartPosition ( ) ) ; JCClassDecl owner = classDef ( ( ClassSymbol ) mapVar . owner ) ; // synthetic static final int [ ] $ SwitchMap $ Color = new int [ Color . values ( ) . length ] ;
MethodSymbol valuesMethod = lookupMethod ( pos , names . values , forEnum . type , List . nil ( ) ) ; JCExpression size = make // Color . values ( ) . length
. Select ( make . App ( make . QualIdent ( valuesMethod ) ) , syms . lengthVar ) ; JCExpression mapVarInit = make . NewArray ( make . Type ( syms . intType ) , List . of ( size ) , null ) . setType ( new ArrayType ( syms . intType , syms . arrayClass ) ) ; // try { $ SwitchMap $ Color [ red . ordinal ( ) ] = 1 ; } catch ( java . lang . NoSuchFieldError ex ) { }
ListBuffer < JCStatement > stmts = new ListBuffer < > ( ) ; Symbol ordinalMethod = lookupMethod ( pos , names . ordinal , forEnum . type , List . nil ( ) ) ; List < JCCatch > catcher = List . < JCCatch > nil ( ) . prepend ( make . Catch ( make . VarDef ( new VarSymbol ( PARAMETER , names . ex , syms . noSuchFieldErrorType , syms . noSymbol ) , null ) , make . Block ( 0 , List . nil ( ) ) ) ) ; for ( Map . Entry < VarSymbol , Integer > e : values . entrySet ( ) ) { VarSymbol enumerator = e . getKey ( ) ; Integer mappedValue = e . getValue ( ) ; JCExpression assign = make . Assign ( make . Indexed ( mapVar , make . App ( make . Select ( make . QualIdent ( enumerator ) , ordinalMethod ) ) ) , make . Literal ( mappedValue ) ) . setType ( syms . intType ) ; JCStatement exec = make . Exec ( assign ) ; JCStatement _try = make . Try ( make . Block ( 0 , List . of ( exec ) ) , catcher , null ) ; stmts . append ( _try ) ; } owner . defs = owner . defs . prepend ( make . Block ( STATIC , stmts . toList ( ) ) ) . prepend ( make . VarDef ( mapVar , mapVarInit ) ) ; |
public class AdminSetUserSettingsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AdminSetUserSettingsRequest adminSetUserSettingsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( adminSetUserSettingsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( adminSetUserSettingsRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( adminSetUserSettingsRequest . getUsername ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( adminSetUserSettingsRequest . getMFAOptions ( ) , MFAOPTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AnalyzeDataSourceRiskDetails { /** * < code >
* . google . privacy . dlp . v2 . AnalyzeDataSourceRiskDetails . LDiversityResult l _ diversity _ result = 6;
* < / code > */
public com . google . privacy . dlp . v2 . AnalyzeDataSourceRiskDetails . LDiversityResult getLDiversityResult ( ) { } } | if ( resultCase_ == 6 ) { return ( com . google . privacy . dlp . v2 . AnalyzeDataSourceRiskDetails . LDiversityResult ) result_ ; } return com . google . privacy . dlp . v2 . AnalyzeDataSourceRiskDetails . LDiversityResult . getDefaultInstance ( ) ; |
public class MviBasePresenter { /** * This method creates a decorator around the original view ' s " intent " . This method ensures that
* no memory leak by using a { @ link ViewIntentBinder } is caused by the subscription to the original
* view ' s intent when the view gets detached .
* Typically , this method is used in { @ link # bindIntents ( ) } like this :
* < pre > < code >
* Observable < Boolean > loadIntent = intent ( new ViewIntentBinder ( ) {
* @ Override
* public Observable < Boolean > bind ( MyView view ) {
* return view . loadIntent ( ) ;
* < / code > < / pre >
* @ param binder The { @ link ViewIntentBinder } from where the the real view ' s intent will be
* bound
* @ param < I > The type of the intent
* @ return The decorated intent Observable emitting the intent */
@ MainThread protected < I > Observable < I > intent ( ViewIntentBinder < V , I > binder ) { } } | Subject < I > intentRelay = UnicastSubject . create ( ) ; intentRelaysBinders . add ( new IntentRelayBinderPair < I > ( intentRelay , binder ) ) ; return intentRelay ; |
public class Projection3D { /** * Returns the camera coordinates .
* @ param xyz the world coordinates .
* @ return the camera coordinates . */
public double [ ] project ( double [ ] xyz ) { } } | double [ ] coord = new double [ 3 ] ; coord [ 0 ] = cosTheta * xyz [ 1 ] - sinTheta * xyz [ 0 ] ; coord [ 1 ] = cosPhi * xyz [ 2 ] - sinPhi * cosTheta * xyz [ 0 ] - sinPhi * sinTheta * xyz [ 1 ] ; coord [ 2 ] = cosPhi * sinTheta * xyz [ 1 ] + sinPhi * xyz [ 2 ] + cosPhi * cosTheta * xyz [ 0 ] ; return coord ; |
public class WriteClass { /** * GetMethodVariables . */
public String getMethodVariables ( String strMethodInterface ) { } } | int endChar = 0 , startChar = 0 ; String strMethodVariables = "" ; int i = 0 ; boolean bBracketFound = false ; for ( i = 0 ; i < strMethodInterface . length ( ) ; i ++ ) { if ( strMethodInterface . charAt ( i ) == '<' ) bBracketFound = true ; if ( strMethodInterface . charAt ( i ) == '>' ) bBracketFound = false ; if ( bBracketFound ) continue ; // Skip the area between the brackets .
if ( strMethodInterface . charAt ( i ) == ' ' ) startChar = i + 1 ; if ( strMethodInterface . charAt ( i ) == ',' ) { endChar = i ; if ( endChar > startChar ) { if ( strMethodVariables . length ( ) != 0 ) strMethodVariables += ", " ; strMethodVariables += strMethodInterface . substring ( startChar , endChar ) ; } } } endChar = i ; if ( endChar > startChar ) { if ( strMethodVariables . length ( ) != 0 ) strMethodVariables += ", " ; strMethodVariables += strMethodInterface . substring ( startChar , endChar ) ; } return strMethodVariables ; |
public class DiffBuilder { /** * Registers listeners that are notified of each comparison with
* outcome other than { @ link ComparisonResult # EQUAL } .
* @ see org . xmlunit . diff . DifferenceEngine # addDifferenceListener ( ComparisonListener ) */
@ Override public DiffBuilder withDifferenceListeners ( final ComparisonListener ... comparisonListeners ) { } } | this . differenceListeners . addAll ( Arrays . asList ( comparisonListeners ) ) ; return this ; |
public class PutEventsResult { /** * The successfully and unsuccessfully ingested events results . If the ingestion was successful , the entry has the
* event ID in it . Otherwise , you can use the error code and error message to identify the problem with the entry .
* @ param entries
* The successfully and unsuccessfully ingested events results . If the ingestion was successful , the entry
* has the event ID in it . Otherwise , you can use the error code and error message to identify the problem
* with the entry . */
public void setEntries ( java . util . Collection < PutEventsResultEntry > entries ) { } } | if ( entries == null ) { this . entries = null ; return ; } this . entries = new java . util . ArrayList < PutEventsResultEntry > ( entries ) ; |
public class AbstractElementGenerator { /** * { @ inheritDoc } */
public ElementGenerator findAll ( final Constraint constraint ) { } } | return new AbstractElementGenerator ( this ) { public void run ( final Closure closure ) { getWrappedTemplate ( ) . run ( new IfBlock ( constraint , closure ) ) ; } } ; |
public class TargetPoolClient { /** * Adds health check URLs to a target pool .
* < p > Sample code :
* < pre > < code >
* try ( TargetPoolClient targetPoolClient = TargetPoolClient . create ( ) ) {
* ProjectRegionTargetPoolName targetPool = ProjectRegionTargetPoolName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ TARGET _ POOL ] " ) ;
* TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource = TargetPoolsAddHealthCheckRequest . newBuilder ( ) . build ( ) ;
* Operation response = targetPoolClient . addHealthCheckTargetPool ( targetPool . toString ( ) , targetPoolsAddHealthCheckRequestResource ) ;
* < / code > < / pre >
* @ param targetPool Name of the target pool to add a health check to .
* @ param targetPoolsAddHealthCheckRequestResource
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation addHealthCheckTargetPool ( String targetPool , TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource ) { } } | AddHealthCheckTargetPoolHttpRequest request = AddHealthCheckTargetPoolHttpRequest . newBuilder ( ) . setTargetPool ( targetPool ) . setTargetPoolsAddHealthCheckRequestResource ( targetPoolsAddHealthCheckRequestResource ) . build ( ) ; return addHealthCheckTargetPool ( request ) ; |
public class BucketingSink { /** * Closes the current part file and moves it from the in - progress state to the pending state . */
private void closeCurrentPartFile ( BucketState < T > bucketState ) throws Exception { } } | if ( bucketState . isWriterOpen ) { bucketState . writer . close ( ) ; bucketState . isWriterOpen = false ; } if ( bucketState . currentFile != null ) { Path currentPartPath = new Path ( bucketState . currentFile ) ; Path inProgressPath = getInProgressPathFor ( currentPartPath ) ; Path pendingPath = getPendingPathFor ( currentPartPath ) ; fs . rename ( inProgressPath , pendingPath ) ; LOG . debug ( "Moving in-progress bucket {} to pending file {}" , inProgressPath , pendingPath ) ; bucketState . pendingFiles . add ( currentPartPath . toString ( ) ) ; bucketState . currentFile = null ; } |
public class FileLock { /** * partial writes of prior lines */
private void logProgress ( String fileOffset , boolean prefixNewLine ) throws IOException { } } | long now = System . currentTimeMillis ( ) ; LogEntry entry = new LogEntry ( now , componentID , fileOffset ) ; String line = entry . toString ( ) ; if ( prefixNewLine ) { lockFileStream . writeBytes ( System . lineSeparator ( ) + line ) ; } else { lockFileStream . writeBytes ( line ) ; } lockFileStream . hflush ( ) ; lastEntry = entry ; // update this only after writing to hdfs |
public class Query { /** * Creates and returns a new Query with the additional filter that documents must contain the
* specified field and the value should be less than the specified value .
* @ param field The name of the field to compare .
* @ param value The value for comparison .
* @ return The created Query . */
@ Nonnull public Query whereLessThan ( @ Nonnull String field , @ Nonnull Object value ) { } } | return whereLessThan ( FieldPath . fromDotSeparatedString ( field ) , value ) ; |
public class TimeSeries { /** * Add one histogram to the current one . We preserve the width in the current TimeSeries .
* @ param other the TimeSeries instance to add */
public void add ( TimeSeries other ) { } } | TreeMap < Long , Integer > otherSeries = other . getSeries ( ) ; for ( Map . Entry < Long , Integer > event : otherSeries . entrySet ( ) ) { record ( event . getKey ( ) + other . getWidthNano ( ) / 2 , event . getValue ( ) ) ; } |
public class RedisJobStore { /** * Retrieve the given < code > { @ link org . quartz . Trigger } < / code > .
* @ param calName The name of the < code > Calendar < / code > to be retrieved .
* @ return The desired < code > Calendar < / code > , or null if there is no
* match . */
@ Override public Calendar retrieveCalendar ( final String calName ) throws JobPersistenceException { } } | return doWithLock ( new LockCallback < Calendar > ( ) { @ Override public Calendar doWithLock ( JedisCommands jedis ) throws JobPersistenceException { return storage . retrieveCalendar ( calName , jedis ) ; } } , "Could not retrieve calendar." ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link NotinType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "notin" ) public JAXBElement < NotinType > createNotin ( NotinType value ) { } } | return new JAXBElement < NotinType > ( _Notin_QNAME , NotinType . class , null , value ) ; |
public class ModelHelper { /** * Decodes RetentionPolicy and returns an instance of Retention Policy impl .
* @ param policyModel The Retention Policy .
* @ return Instance of Retention Policy Impl . */
public static final Controller . RetentionPolicy decode ( final RetentionPolicy policyModel ) { } } | if ( policyModel != null ) { return Controller . RetentionPolicy . newBuilder ( ) . setRetentionType ( Controller . RetentionPolicy . RetentionPolicyType . valueOf ( policyModel . getRetentionType ( ) . name ( ) ) ) . setRetentionParam ( policyModel . getRetentionParam ( ) ) . build ( ) ; } else { return null ; } |
public class ExportBackupPlanTemplateRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ExportBackupPlanTemplateRequest exportBackupPlanTemplateRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( exportBackupPlanTemplateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( exportBackupPlanTemplateRequest . getBackupPlanId ( ) , BACKUPPLANID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AdHocPlannedStmtBatch { /** * For convenience , serialization is accomplished with this single method ,
* but deserialization is piecemeal via the static methods userParamsFromBuffer
* and planArrayFromBuffer with no dummy " AdHocPlannedStmtBatch receiver " instance required . */
public ByteBuffer flattenPlanArrayToBuffer ( ) throws IOException { } } | int size = 0 ; // sizeof batch
ParameterSet userParamCache = null ; if ( userParamSet == null ) { userParamCache = ParameterSet . emptyParameterSet ( ) ; } else { Object [ ] typedUserParams = new Object [ userParamSet . length ] ; int ii = 0 ; for ( AdHocPlannedStatement cs : plannedStatements ) { for ( VoltType paramType : cs . core . parameterTypes ) { if ( ii >= typedUserParams . length ) { String errorMsg = "Too few actual arguments were passed for the parameters in the sql statement(s): (" + typedUserParams . length + " vs. " + ii + ")" ; // Volt - TYPE - Exception is slightly cheating , here , should there be a more general VoltArgumentException ?
throw new VoltTypeException ( errorMsg ) ; } typedUserParams [ ii ] = ParameterConverter . tryToMakeCompatible ( paramType . classFromType ( ) , userParamSet [ ii ] ) ; // System . out . println ( " DEBUG typed parameter : " + work . userParamSet [ ii ] +
// " using type : " + paramType + " as : " + typedUserParams [ ii ] ) ;
ii ++ ; } } // Each parameter referenced in each statements should be represented
// exactly once in userParams .
if ( ii < typedUserParams . length ) { // Volt - TYPE - Exception is slightly cheating , here , should there be a more general VoltArgumentException ?
String errorMsg = "Too many actual arguments were passed for the parameters in the sql statement(s): (" + typedUserParams . length + " vs. " + ii + ")" ; throw new VoltTypeException ( errorMsg ) ; } userParamCache = ParameterSet . fromArrayNoCopy ( typedUserParams ) ; } size += userParamCache . getSerializedSize ( ) ; size += 2 ; // sizeof batch
for ( AdHocPlannedStatement cs : plannedStatements ) { size += cs . getSerializedSize ( ) ; } ByteBuffer buf = ByteBuffer . allocate ( size ) ; userParamCache . flattenToBuffer ( buf ) ; buf . putShort ( ( short ) plannedStatements . size ( ) ) ; for ( AdHocPlannedStatement cs : plannedStatements ) { cs . flattenToBuffer ( buf ) ; } return buf ; |
public class Requests { /** * Create a new { @ link PublishNotify } instance that is used to publish
* metadata on a link between two { @ link Identifier } instances .
* @ param i1 the first { @ link Identifier } of the link
* @ param i2 the second { @ link Identifier } of the link
* @ param md the metadata that shall be published
* @ return the new { @ link PublishNotify } instance */
public static PublishNotify createPublishNotify ( Identifier i1 , Identifier i2 , Document md ) { } } | if ( md == null ) { throw new NullPointerException ( "md is null" ) ; } List < Document > mdlist = new ArrayList < Document > ( 1 ) ; mdlist . add ( md ) ; return createPublishNotify ( i1 , i2 , mdlist ) ; |
public class RDBERule { /** * Create the table with the common oxidation states */
private void createTable ( ) { } } | if ( oxidationStateTable == null ) { oxidationStateTable = new HashMap < String , int [ ] > ( ) ; oxidationStateTable . put ( "H" , new int [ ] { 1 } ) ; // oxidationStateTable . put ( " Li " , 1 ) ;
// oxidationStateTable . put ( " Be " , 2 ) ;
oxidationStateTable . put ( "B" , new int [ ] { 3 } ) ; oxidationStateTable . put ( "C" , new int [ ] { 4 } ) ; oxidationStateTable . put ( "N" , new int [ ] { 3 } ) ; oxidationStateTable . put ( "O" , new int [ ] { 2 } ) ; oxidationStateTable . put ( "F" , new int [ ] { 1 } ) ; oxidationStateTable . put ( "Na" , new int [ ] { 1 } ) ; oxidationStateTable . put ( "Mg" , new int [ ] { 2 } ) ; oxidationStateTable . put ( "Al" , new int [ ] { 3 } ) ; oxidationStateTable . put ( "Si" , new int [ ] { 4 } ) ; oxidationStateTable . put ( "P" , new int [ ] { 3 , 5 } ) ; oxidationStateTable . put ( "S" , new int [ ] { 2 , 4 , 6 } ) ; oxidationStateTable . put ( "Cl" , new int [ ] { 1 } ) ; // oxidationStateTable . put ( " K " , 1 ) ;
// oxidationStateTable . put ( " Ca " , 2 ) ;
// oxidationStateTable . put ( " Ga " , 3 ) ;
// oxidationStateTable . put ( " Ge " , 4 ) ;
// oxidationStateTable . put ( " As " , 5 ) ;
// oxidationStateTable . put ( " Se " , 6 ) ;
// oxidationStateTable . put ( " Br " , 7 ) ;
// oxidationStateTable . put ( " Rb " , 1 ) ;
// oxidationStateTable . put ( " Sr " , 2 ) ;
// oxidationStateTable . put ( " In " , 3 ) ;
// oxidationStateTable . put ( " Sn " , 4 ) ;
// oxidationStateTable . put ( " Sb " , 5 ) ;
// oxidationStateTable . put ( " Te " , 6 ) ;
oxidationStateTable . put ( "I" , new int [ ] { 1 } ) ; // oxidationStateTable . put ( " Cs " , 1 ) ;
// oxidationStateTable . put ( " Ba " , 2 ) ;
// oxidationStateTable . put ( " Tl " , 3 ) ;
// oxidationStateTable . put ( " Pb " , 4 ) ;
// oxidationStateTable . put ( " Bi " , 5 ) ;
// oxidationStateTable . put ( " Po " , 6 ) ;
// oxidationStateTable . put ( " At " , 7 ) ;
// oxidationStateTable . put ( " Fr " , 1 ) ;
// oxidationStateTable . put ( " Ra " , 2 ) ;
// oxidationStateTable . put ( " Cu " , 2 ) ;
// oxidationStateTable . put ( " Mn " , 2 ) ;
// oxidationStateTable . put ( " Co " , 2 ) ;
} |
public class GraphvizMojo { /** * Returns a list with file names of dot files that have been changed since
* previous image generation run . Empty if no files changed or
* < code > null < / code > if there is no status file to compare against . */
protected Set < String > getChangedDotFiles ( ) { } } | Set < String > generatedFiles = getGeneratedFiles ( ) ; // If there is no status file to compare against or no files are
// generated then skip image generation
if ( generatedFiles == null || generatedFiles . isEmpty ( ) ) { return null ; } // Check if images for generated dot files are missing or outdated
Set < String > changedDotFiles = new HashSet < String > ( ) ; for ( String generatedFile : generatedFiles ) { if ( generatedFile . endsWith ( ".dot" ) ) { File dotFile = new File ( getProject ( ) . getBasedir ( ) , generatedFile ) ; File imageFile = new File ( getProject ( ) . getBasedir ( ) , generatedFile + ".png" ) ; if ( ! imageFile . exists ( ) || imageFile . lastModified ( ) < dotFile . lastModified ( ) ) { changedDotFiles . add ( generatedFile ) ; } } } // Print info of result
if ( changedDotFiles . size ( ) == 1 ) { String fileName = changedDotFiles . iterator ( ) . next ( ) ; if ( fileName . startsWith ( project . getBasedir ( ) . getAbsolutePath ( ) ) ) { fileName = fileName . substring ( project . getBasedir ( ) . getAbsolutePath ( ) . length ( ) + 1 ) ; } final String message = MessageFormat . format ( "\"{0}\" has been changed" , fileName ) ; getLog ( ) . info ( message ) ; } else if ( changedDotFiles . size ( ) > 1 ) { final String message = MessageFormat . format ( "{0} dot files have been changed" , changedDotFiles . size ( ) ) ; getLog ( ) . info ( message ) ; } else { getLog ( ) . info ( "Everything is up to date - no image generation is needed" ) ; } return changedDotFiles ; |
public class AnnotatedElementNameUtil { /** * Returns the value of the { @ link Param } annotation which is specified on the { @ code element } if
* the value is not blank . If the value is blank , it returns the name of the specified
* { @ code nameRetrievalTarget } object which is an instance of { @ link Parameter } or { @ link Field } . */
static String findName ( Param param , Object nameRetrievalTarget ) { } } | requireNonNull ( nameRetrievalTarget , "nameRetrievalTarget" ) ; final String value = param . value ( ) ; if ( DefaultValues . isSpecified ( value ) ) { checkArgument ( ! value . isEmpty ( ) , "value is empty" ) ; return value ; } return getName ( nameRetrievalTarget ) ; |
public class STTY { /** * Set the current STTY mode , and return the closable switcher to turn back .
* @ param mode The STTY mode to set .
* @ return The mode switcher . */
public STTYModeSwitcher setSTTYMode ( STTYMode mode ) { } } | try { return new STTYModeSwitcher ( mode , runtime ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } |
public class SeleniumHelper { /** * Executes Javascript in browser . If statementPattern contains the magic variable ' arguments '
* the parameters will also be passed to the statement . In the latter case the parameters
* must be a number , a boolean , a String , WebElement , or a List of any combination of the above .
* @ link http : / / selenium . googlecode . com / git / docs / api / java / org / openqa / selenium / JavascriptExecutor . html # executeScript ( java . lang . String , % 20java . lang . Object . . . )
* @ param statementPattern javascript to run , possibly with placeholders to be replaced .
* @ param parameters placeholder values that should be replaced before executing the script .
* @ return return value from statement . */
public Object executeJavascript ( String statementPattern , Object ... parameters ) { } } | Object result ; String script = String . format ( statementPattern , parameters ) ; if ( statementPattern . contains ( "arguments" ) ) { result = executeScript ( script , parameters ) ; } else { result = executeScript ( script ) ; } return result ; |
public class RunbooksInner { /** * Retrieve the runbook identified by runbook name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param runbookName The runbook name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the RunbookInner object */
public Observable < RunbookInner > getAsync ( String resourceGroupName , String automationAccountName , String runbookName ) { } } | return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , runbookName ) . map ( new Func1 < ServiceResponse < RunbookInner > , RunbookInner > ( ) { @ Override public RunbookInner call ( ServiceResponse < RunbookInner > response ) { return response . body ( ) ; } } ) ; |
public class MigrateToChatEvent { /** * Gets the Chat that was migrated to that triggered this Event
* @ return The Chat that was migrated to that triggred this Event */
@ Override public SuperGroupChat getChat ( ) { } } | return ( SuperGroupChat ) getMessage ( ) . getBotInstance ( ) . getChat ( ( ( MigrateToChatIDContent ) getMessage ( ) . getContent ( ) ) . getContent ( ) ) ; |
public class StandardCache { public void put ( final K key , final V value ) { } } | incrementReportEntity ( this . putCount ) ; final CacheEntry < V > entry = new CacheEntry < V > ( value , this . useSoftReferences ) ; // newSize will be - 1 if traceExecution is false
final int newSize = this . dataContainer . put ( key , entry ) ; if ( this . traceExecution ) { this . logger . trace ( "[THYMELEAF][{}][{}][CACHE_ADD][{}] Adding cache entry in cache \"{}\" for key \"{}\". New size is {}." , new Object [ ] { TemplateEngine . threadIndex ( ) , this . name , Integer . valueOf ( newSize ) , this . name , key , Integer . valueOf ( newSize ) } ) ; outputReportIfNeeded ( ) ; } |
public class SecondaryTableImpl { /** * If not already created , a new < code > index < / code > element will be created and returned .
* Otherwise , the first existing < code > index < / code > element will be returned .
* @ return the instance defined for the element < code > index < / code > */
public Index < SecondaryTable < T > > getOrCreateIndex ( ) { } } | List < Node > nodeList = childNode . get ( "index" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new IndexImpl < SecondaryTable < T > > ( this , "index" , childNode , nodeList . get ( 0 ) ) ; } return createIndex ( ) ; |
public class XmlUtil { /** * Return a QName for the node
* @ param nd
* @ return boolean true for match */
public static QName fromNode ( final Node nd ) { } } | String ns = nd . getNamespaceURI ( ) ; if ( ns == null ) { /* It appears a node can have a NULL namespace but a QName has a zero length */
ns = "" ; } return new QName ( ns , nd . getLocalName ( ) ) ; |
public class AbstractRadial { /** * Returns an image that simulates a glowing ring which could be used to visualize
* a state of the gauge by a color . The LED might be too small if you are not in front
* of the screen and so one could see the current state more easy .
* @ param WIDTH
* @ param GLOW _ COLOR
* @ param ON
* @ param GAUGE _ TYPE
* @ param KNOBS
* @ param ORIENTATION
* @ return an image that simulates a glowing ring */
protected BufferedImage create_GLOW_Image ( final int WIDTH , final Color GLOW_COLOR , final boolean ON , final GaugeType GAUGE_TYPE , final boolean KNOBS , final Orientation ORIENTATION ) { } } | switch ( getFrameType ( ) ) { case ROUND : return GLOW_FACTORY . createRadialGlow ( WIDTH , GLOW_COLOR , ON , GAUGE_TYPE , KNOBS , ORIENTATION ) ; case SQUARE : return GLOW_FACTORY . createLinearGlow ( WIDTH , WIDTH , GLOW_COLOR , ON ) ; default : return GLOW_FACTORY . createRadialGlow ( WIDTH , GLOW_COLOR , ON , GAUGE_TYPE , KNOBS , ORIENTATION ) ; } |
public class ApiOvhMe { /** * Get services impacted by this SLA
* REST : GET / me / sla / { id } / services
* @ param id [ required ] Id of the object */
public ArrayList < OvhSlaOperationService > sla_id_services_GET ( Long id ) throws IOException { } } | String qPath = "/me/sla/{id}/services" ; StringBuilder sb = path ( qPath , id ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; |
public class ExtendedPathView { /** * Given the nodes in the previous relation , determine which of the nodes in
* the next relation is new and return that .
* @ param prev the dependency relation that was previously seen in the path
* @ param cur the current dependency relation */
private DependencyTreeNode getNextNode ( DependencyRelation prev , DependencyRelation cur ) { } } | return ( prev . headNode ( ) == cur . headNode ( ) || prev . dependentNode ( ) == cur . headNode ( ) ) ? cur . dependentNode ( ) : cur . headNode ( ) ; |
public class DescribeRepositoriesRequest { /** * A list of repositories to describe . If this parameter is omitted , then all repositories in a registry are
* described .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRepositoryNames ( java . util . Collection ) } or { @ link # withRepositoryNames ( java . util . Collection ) } if you
* want to override the existing values .
* @ param repositoryNames
* A list of repositories to describe . If this parameter is omitted , then all repositories in a registry are
* described .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeRepositoriesRequest withRepositoryNames ( String ... repositoryNames ) { } } | if ( this . repositoryNames == null ) { setRepositoryNames ( new java . util . ArrayList < String > ( repositoryNames . length ) ) ; } for ( String ele : repositoryNames ) { this . repositoryNames . add ( ele ) ; } return this ; |
public class WorkbookUtil { /** * 将普通工作簿转换为SXSSFWorkbook
* @ param book 工作簿
* @ return SXSSFWorkbook
* @ since 4.1.13 */
private static SXSSFWorkbook toSXSSFBook ( Workbook book ) { } } | if ( book instanceof SXSSFWorkbook ) { return ( SXSSFWorkbook ) book ; } if ( book instanceof XSSFWorkbook ) { return new SXSSFWorkbook ( ( XSSFWorkbook ) book ) ; } throw new POIException ( "The input is not a [xlsx] format." ) ; |
public class TypeValidator { /** * Expect that the type of an argument matches the type of the parameter that it ' s fulfilling .
* @ param t The node traversal .
* @ param n The node to issue warnings on .
* @ param argType The type of the argument .
* @ param paramType The type of the parameter .
* @ param callNode The call node , to help with the warning message .
* @ param ordinal The argument ordinal , to help with the warning message . */
void expectArgumentMatchesParameter ( Node n , JSType argType , JSType paramType , Node callNode , int ordinal ) { } } | if ( ! argType . isSubtypeOf ( paramType ) ) { mismatch ( n , SimpleFormat . format ( "actual parameter %d of %s does not match formal parameter" , ordinal , typeRegistry . getReadableTypeNameNoDeref ( callNode . getFirstChild ( ) ) ) , argType , paramType ) ; } else if ( ! argType . isSubtypeWithoutStructuralTyping ( paramType ) ) { TypeMismatch . recordImplicitInterfaceUses ( this . implicitInterfaceUses , n , argType , paramType ) ; TypeMismatch . recordImplicitUseOfNativeObject ( this . mismatches , n , argType , paramType ) ; } |
public class TagAPI { /** * Returns the tags on the given space . This includes both items and
* statuses . The tags are ordered firstly by the number of uses , secondly by
* the tag text .
* @ param spaceId
* The id of the space to return tags from
* @ return The list of tags with their count */
public List < TagCount > getTagsOnSpace ( int spaceId ) { } } | return getResourceFactory ( ) . getApiResource ( "/tag/space/" + spaceId + "/" ) . get ( new GenericType < List < TagCount > > ( ) { } ) ; |
public class ApiOvhHostingweb { /** * Alter this object properties
* REST : PUT / hosting / web / { serviceName } / cron / { id }
* @ param body [ required ] New object properties
* @ param serviceName [ required ] The internal name of your hosting
* @ param id [ required ] Cron ' s id */
public void serviceName_cron_id_PUT ( String serviceName , Long id , OvhCron body ) throws IOException { } } | String qPath = "/hosting/web/{serviceName}/cron/{id}" ; StringBuilder sb = path ( qPath , serviceName , id ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class WritingRepository { /** * Erzeugt eine Referenz ( d . h . eine Art Link ) unter dem Name
* < code > reference < / code > , welche auf das Blob mit der Id < code > id < / code >
* verweist .
* @ param reference
* Name der Referenz
* @ param id
* Id des Blobs welches referenziert werden soll
* @ throws IOException
* @ throws IdNotFoundException
* falls unter < code > id < / code > kein Blob abgelegt ist */
public void createReference ( String reference , String id ) throws IOException { } } | Assert . isNotNull ( reference ) ; Assert . isFalse ( reference . length ( ) == 0 , "Die Referenz darf nicht leer sein" ) ; Assert . isNotNull ( id , "Es muss die Id des Items übergeben werden" ) ; Assert . isTrue ( id . length ( ) > WritingRepositoryStrategy . SUBDIR_POLICY , "Die Id '" + id + "' ist zu kurz, um im Repository abgelegt zu werden" ) ; if ( ! contains ( id ) ) { throw new IdNotFoundException ( id ) ; } strategy . createReference ( reference , id ) ; |
public class TuneInfos { /** * Add the string s as new line to field b */
public void add ( byte b , String s ) { } } | if ( s != null ) { String s2 = get ( b ) ; if ( s2 == null ) s2 = s ; else s2 += lineSeparator + s ; set ( b , s2 ) ; } |
public class Int10TripleHashed { /** * Packs given x , y , z coordinates . The coords must represent a point within a 1024 sized cuboid with the base at the ( bx , by , bz )
* @ param x an < code > int < / code > value
* @ param y an < code > int < / code > value
* @ param z an < code > int < / code > value
* @ return the packed int */
public final int key ( int x , int y , int z ) { } } | return ( ( ( x - bx ) & 0x3FF ) << 22 ) | ( ( ( y - by ) & 0x3FF ) << 11 ) | ( ( z - bz ) & 0x3FF ) ; |
public class AdminCoreContext { /** * Used for setting or creating a multiple beans .
* We must consider that the operation may include beans that have
* references betewen eachother . User provided beans are
* prioritized and the storage is secondary for looking up references . */
@ SuppressWarnings ( "unused" ) private void initalizeReferences ( Collection < Bean > beans ) { } } | Map < BeanId , Bean > userProvided = BeanUtils . uniqueIndex ( beans ) ; for ( Bean bean : beans ) { for ( String name : bean . getReferenceNames ( ) ) { List < BeanId > values = bean . getReference ( name ) ; if ( values == null ) { continue ; } for ( BeanId beanId : values ) { // the does not exist in storage , but may exist in the
// set of beans provided by the user .
Bean ref = userProvided . get ( beanId ) ; if ( ref == null ) { Optional < Bean > optional = beanManager . getEager ( beanId ) ; if ( optional . isPresent ( ) ) { ref = optional . get ( ) ; } } beanId . setBean ( ref ) ; schemaManager . setSchema ( Arrays . asList ( beanId . getBean ( ) ) ) ; } } } |
public class SarlDocumentationParser { /** * Extract the dynamic name of that from the raw text .
* @ param tag the tag to extract for .
* @ param name the raw text .
* @ param dynamicName the dynamic name . */
protected void extractDynamicName ( Tag tag , CharSequence name , OutParameter < String > dynamicName ) { } } | if ( tag . hasDynamicName ( ) ) { final Pattern pattern = Pattern . compile ( getDynamicNameExtractionPattern ( ) ) ; final Matcher matcher = pattern . matcher ( name ) ; if ( matcher . matches ( ) ) { dynamicName . set ( Strings . nullToEmpty ( matcher . group ( 1 ) ) ) ; return ; } } dynamicName . set ( name . toString ( ) ) ; |
public class ConfigurationPropertyRegistry { /** * Register an instance of a property - consuming type ; the registry will use a weak reference to hold on to this instance , so
* that it can be discarded if it has a short lifespan
* @ param discoveredType
* @ param newlyConstructed */
void addInstance ( final Class < ? > discoveredType , final Object newlyConstructed ) { } } | WeakHashMap < Object , Void > map ; synchronized ( instances ) { map = instances . get ( discoveredType ) ; if ( map == null ) { map = new WeakHashMap < > ( ) ; instances . put ( discoveredType , map ) ; } } synchronized ( map ) { map . put ( newlyConstructed , null ) ; } |
public class MultiPartParser { private void parsePreamble ( ByteBuffer buffer ) { } } | if ( _partialBoundary > 0 ) { int partial = _delimiterSearch . startsWith ( buffer . array ( ) , buffer . arrayOffset ( ) + buffer . position ( ) , buffer . remaining ( ) , _partialBoundary ) ; if ( partial > 0 ) { if ( partial == _delimiterSearch . getLength ( ) ) { buffer . position ( buffer . position ( ) + partial - _partialBoundary ) ; _partialBoundary = 0 ; setState ( State . DELIMITER ) ; return ; } _partialBoundary = partial ; BufferUtils . clear ( buffer ) ; return ; } _partialBoundary = 0 ; } int delimiter = _delimiterSearch . match ( buffer . array ( ) , buffer . arrayOffset ( ) + buffer . position ( ) , buffer . remaining ( ) ) ; if ( delimiter >= 0 ) { buffer . position ( delimiter - buffer . arrayOffset ( ) + _delimiterSearch . getLength ( ) ) ; setState ( State . DELIMITER ) ; return ; } _partialBoundary = _delimiterSearch . endsWith ( buffer . array ( ) , buffer . arrayOffset ( ) + buffer . position ( ) , buffer . remaining ( ) ) ; BufferUtils . clear ( buffer ) ; |
public class VaadinForHeroku { /** * Add filter mappings to the server configuration .
* A filter with the same name as the one defined in the mapping should also be defined
* using { @ link # withFilterDefinition ( FilterDefinitionBuilder . . . ) }
* @ param filterMaps the filter mapping ( s )
* @ since 0.3 */
public VaadinForHeroku withFilterMapping ( final FilterMapBuilder ... filterMaps ) { } } | checkVarArgsArguments ( filterMaps ) ; this . filterMaps . addAll ( Arrays . asList ( filterMaps ) ) ; return self ( ) ; |
public class WriteHandler { /** * { @ inheritDoc } */
@ Override public Object doHandleRequest ( MBeanServerConnection server , JmxWriteRequest request ) throws InstanceNotFoundException , AttributeNotFoundException , ReflectionException , MBeanException , IOException { } } | try { return setAttribute ( request , server ) ; } catch ( IntrospectionException exp ) { throw new IllegalArgumentException ( "Cannot get info for MBean " + request . getObjectName ( ) + ": " + exp , exp ) ; } catch ( InvalidAttributeValueException e ) { throw new IllegalArgumentException ( "Invalid value " + request . getValue ( ) + " for attribute " + request . getAttributeName ( ) + ", MBean " + request . getObjectNameAsString ( ) , e ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( "Cannot set value " + request . getValue ( ) + " for attribute " + request . getAttributeName ( ) + ", MBean " + request . getObjectNameAsString ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new IllegalArgumentException ( "Cannot set value " + request . getValue ( ) + " for attribute " + request . getAttributeName ( ) + ", MBean " + request . getObjectNameAsString ( ) , e ) ; } |
public class HubProxy { /** * Executes a method on the server asynchronously */
@ Override public void Invoke ( final String method , JSONArray args , HubInvokeCallback callback ) { } } | if ( method == null ) { throw new IllegalArgumentException ( "method" ) ; } if ( args == null ) { throw new IllegalArgumentException ( "args" ) ; } final String callbackId = mConnection . RegisterCallback ( callback ) ; HubInvocation hubData = new HubInvocation ( mHubName , method , args , callbackId ) ; String value = hubData . Serialize ( ) ; mConnection . Send ( value , new SendCallback ( ) { @ Override public void OnSent ( CharSequence messageSent ) { Log . v ( TAG , "Invoke of " + method + "sent to " + mHubName ) ; // callback . OnSent ( ) ? ? ! ? ! ?
} @ Override public void OnError ( Exception ex ) { // TODO Cancel the callback
Log . e ( TAG , "Failed to invoke " + method + "on " + mHubName ) ; mConnection . RemoveCallback ( callbackId ) ; // callback . OnError ( ) ? ! ? ! ?
} } ) ; |
public class JsJmsTextMessageImpl { /** * Provide an estimate of encoded length of the payload */
int guessPayloadLength ( ) { } } | int length = 0 ; // It is likely that the String length will be the same as the length in bytes
// when it has been encoded ( to UTF8 ) plus a small overhead .
try { if ( jmo . getPayloadPart ( ) . getChoiceField ( JsPayloadAccess . PAYLOAD ) != JsPayloadAccess . IS_PAYLOAD_EMPTY ) { String payload = ( String ) getPayload ( ) . getField ( JmsTextBodyAccess . BODY_DATA_VALUE ) ; if ( payload != null ) length = payload . length ( ) + 24 ; } } catch ( MFPUnsupportedEncodingRuntimeException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.JsJmsTextMessageImpl.getText" , "129" ) ; // hmm . . . how do we figure out a reasonable length
} return length ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.