signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Criteria { /** * Creates a criterion using the < b > & lt ; = < / b > operator * @ param o * @ return the criteria */ public Criteria lte ( Object o ) { } }
this . criteriaType = RelationalOperator . LTE ; this . right = ValueNode . toValueNode ( o ) ; return this ;
public class GetConnectorDefinitionVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetConnectorDefinitionVersionRequest getConnectorDefinitionVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getConnectorDefinitionVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getConnectorDefinitionVersionRequest . getConnectorDefinitionId ( ) , CONNECTORDEFINITIONID_BINDING ) ; protocolMarshaller . marshall ( getConnectorDefinitionVersionRequest . getConnectorDefinitionVersionId ( ) , CONNECTORDEFINITIONVERSIONID_BINDING ) ; protocolMarshaller . marshall ( getConnectorDefinitionVersionRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DateTimeExtensions { /** * Formats this date / time with the provided { @ link java . time . format . DateTimeFormatter } pattern . * @ param self a ZonedDateTime * @ param pattern the formatting pattern * @ return a formatted String * @ see java . time . format . DateTimeFormatter * @ since 2.5.0 */ public static String format ( final ZonedDateTime self , String pattern ) { } }
return self . format ( DateTimeFormatter . ofPattern ( pattern ) ) ;
public class DropwizardResourceConfig { /** * Combines types of getClasses ( ) and getSingletons in one Set . * @ return all registered types */ Set < Class < ? > > allClasses ( ) { } }
final Set < Class < ? > > allClasses = new HashSet < > ( getClasses ( ) ) ; for ( Object singleton : getSingletons ( ) ) { allClasses . add ( singleton . getClass ( ) ) ; } return allClasses ;
public class TasksInner { /** * Creates a task for a container registry with the specified parameters . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param taskName The name of the container registry task . * @ param taskCreateParameters The parameters for creating a task . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < TaskInner > beginCreateAsync ( String resourceGroupName , String registryName , String taskName , TaskInner taskCreateParameters , final ServiceCallback < TaskInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginCreateWithServiceResponseAsync ( resourceGroupName , registryName , taskName , taskCreateParameters ) , serviceCallback ) ;
public class CacheableDataProvider { /** * Remove entity from cache , remove from persistence storage operation will be executed in background * @ param entity Target entity * @ return Future for remove from cache operation */ public ListenableFuture < Boolean > removeAsync ( @ NotNull Entry entity ) { } }
Timer timer = getMetrics ( ) . getTimer ( MetricsType . CACHEABLE_DATA_PROVIDER_REMOVE_FROM_CACHE . name ( ) ) ; long key = buildHashCode ( entity ) ; cache . remove ( key ) ; timer . stop ( ) ; return Futures . immediateFuture ( true ) ;
public class TimeZoneApi { /** * Retrieves the { @ link java . util . TimeZone } for the given location . * @ param context The { @ link GeoApiContext } to make requests through . * @ param location The location for which to retrieve a time zone . * @ return Returns the time zone as a { @ link PendingResult } . */ public static PendingResult < TimeZone > getTimeZone ( GeoApiContext context , LatLng location ) { } }
return context . get ( API_CONFIG , Response . class , "location" , location . toString ( ) , // Java has its own lookup for time - > DST , so we really only need to fetch the TZ id . // " timestamp " is , in effect , ignored . "timestamp" , "0" ) ;
public class HttpKitExt { /** * 涉及资金回滚的接口会使用到商户证书 , 包括退款 、 撤销接口的请求 * @ param url * 请求的地址 * @ param data * xml数据 * @ param certPath * 证书文件目录 * @ param certPass * 证书密码 * @ return String 回调的xml信息 */ protected static String postSSL ( String url , String data , String certPath , String certPass ) { } }
HttpsURLConnection conn = null ; OutputStream out = null ; InputStream inputStream = null ; BufferedReader reader = null ; try { KeyStore clientStore = KeyStore . getInstance ( "PKCS12" ) ; clientStore . load ( new FileInputStream ( certPath ) , certPass . toCharArray ( ) ) ; KeyManagerFactory kmf = KeyManagerFactory . getInstance ( KeyManagerFactory . getDefaultAlgorithm ( ) ) ; kmf . init ( clientStore , certPass . toCharArray ( ) ) ; KeyManager [ ] kms = kmf . getKeyManagers ( ) ; SSLContext sslContext = SSLContext . getInstance ( "TLSv1" ) ; sslContext . init ( kms , null , new SecureRandom ( ) ) ; HttpsURLConnection . setDefaultSSLSocketFactory ( sslContext . getSocketFactory ( ) ) ; URL _url = new URL ( url ) ; conn = ( HttpsURLConnection ) _url . openConnection ( ) ; conn . setConnectTimeout ( 25000 ) ; conn . setReadTimeout ( 25000 ) ; conn . setRequestMethod ( "POST" ) ; conn . setDoOutput ( true ) ; conn . setDoInput ( true ) ; conn . setRequestProperty ( "Content-Type" , "application/x-www-form-urlencoded" ) ; conn . setRequestProperty ( "User-Agent" , DEFAULT_USER_AGENT ) ; conn . connect ( ) ; out = conn . getOutputStream ( ) ; out . write ( data . getBytes ( Charsets . UTF_8 ) ) ; out . flush ( ) ; inputStream = conn . getInputStream ( ) ; reader = new BufferedReader ( new InputStreamReader ( inputStream , Charsets . UTF_8 ) ) ; StringBuilder sb = new StringBuilder ( ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { sb . append ( line ) . append ( "\n" ) ; } return sb . toString ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { IOUtils . closeQuietly ( out ) ; IOUtils . closeQuietly ( reader ) ; IOUtils . closeQuietly ( inputStream ) ; if ( conn != null ) { conn . disconnect ( ) ; } }
public class GridCluster { /** * Iterates through the DensityGrids in the cluster and calculates the inclusion probability for each . * @ return 1.0 if instance matches any of the density grids ; 0.0 otherwise . */ @ Override public double getInclusionProbability ( Instance instance ) { } }
Iterator < Map . Entry < DensityGrid , Boolean > > gridIter = grids . entrySet ( ) . iterator ( ) ; while ( gridIter . hasNext ( ) ) { Map . Entry < DensityGrid , Boolean > grid = gridIter . next ( ) ; DensityGrid dg = grid . getKey ( ) ; if ( dg . getInclusionProbability ( instance ) == 1.0 ) return 1.0 ; } return 0.0 ;
public class H2GISFunctions { /** * Return the alias name of the function * @ param function Function instance * @ return the function ALIAS , name of the function in SQL engine */ public static String getAlias ( Function function ) { } }
String functionAlias = getStringProperty ( function , Function . PROP_NAME ) ; if ( ! functionAlias . isEmpty ( ) ) { return functionAlias ; } return function . getClass ( ) . getSimpleName ( ) ;
public class ProxyBuilder { /** * Returns true if { @ code c } is a proxy class created by this builder . */ public static boolean isProxyClass ( Class < ? > c ) { } }
// TODO : use a marker interface instead ? try { c . getDeclaredField ( FIELD_NAME_HANDLER ) ; return true ; } catch ( NoSuchFieldException e ) { return false ; }
public class LTPAToken2 { /** * Convert the String form to the byte representation * @ param str The String form * @ return The byte representation */ private static final byte [ ] getSimpleBytes ( String str ) { } }
StringBuilder sb = new StringBuilder ( str ) ; byte [ ] b = new byte [ sb . length ( ) ] ; for ( int i = 0 , len = sb . length ( ) ; i < len ; i ++ ) { b [ i ] = ( byte ) sb . charAt ( i ) ; } return b ;
public class BaseWorkflowExecutor { /** * Convert map of step execution results keyed by step number , to a collection of step execution results * keyed by node name * @ param failedMap failures * @ return converted */ protected Map < String , Collection < StepExecutionResult > > convertFailures ( final Map < Integer , StepExecutionResult > failedMap ) { } }
final Map < String , Collection < StepExecutionResult > > failures = new HashMap < > ( ) ; for ( final Map . Entry < Integer , StepExecutionResult > entry : failedMap . entrySet ( ) ) { final StepExecutionResult o = entry . getValue ( ) ; if ( NodeDispatchStepExecutor . isWrappedDispatcherResult ( o ) ) { // indicates dispatcher returned node results final DispatcherResult dispatcherResult = NodeDispatchStepExecutor . extractDispatcherResult ( o ) ; for ( final String s : dispatcherResult . getResults ( ) . keySet ( ) ) { final NodeStepResult interpreterResult = dispatcherResult . getResults ( ) . get ( s ) ; if ( ! failures . containsKey ( s ) ) { failures . put ( s , new ArrayList < > ( ) ) ; } failures . get ( s ) . add ( interpreterResult ) ; } } else if ( NodeDispatchStepExecutor . isWrappedDispatcherException ( o ) ) { DispatcherException e = NodeDispatchStepExecutor . extractDispatcherException ( o ) ; final INodeEntry node = e . getNode ( ) ; if ( null != node ) { // dispatch failed for a specific node final String key = node . getNodename ( ) ; if ( ! failures . containsKey ( key ) ) { failures . put ( key , new ArrayList < > ( ) ) ; } NodeStepException nodeStepException = e . getNodeStepException ( ) ; if ( null != nodeStepException ) { failures . get ( key ) . add ( nodeStepResultFromNodeStepException ( node , nodeStepException ) ) ; } } } } return failures ;
public class OjbMetaClassDescriptorNode { /** * Purpose of this method is to fill the children of the node . It should * replace all children in alChildren ( the arraylist containing the children ) * of this node and notify the TreeModel that a change has occurred . */ protected boolean _load ( ) { } }
java . util . ArrayList newChildren = new java . util . ArrayList ( ) ; /* @ todo make this work */ // if ( cld . getConnectionDescriptor ( ) ! = null ) // newChildren . add ( new OjbMetaJdbcConnectionDescriptorNode ( // this . getOjbMetaTreeModel ( ) . getRepository ( ) , // this . getOjbMetaTreeModel ( ) , // this , // cld . getConnectionDescriptor ( ) ) ) ; // Add collection descriptors java . util . Iterator it = cld . getCollectionDescriptors ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { CollectionDescriptor collDesc = ( CollectionDescriptor ) it . next ( ) ; newChildren . add ( new OjbMetaCollectionDescriptorNode ( this . getOjbMetaTreeModel ( ) . getRepository ( ) , this . getOjbMetaTreeModel ( ) , this , collDesc ) ) ; } // Add extent classes Class it = cld . getExtentClassNames ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String extentClassName = ( String ) it . next ( ) ; newChildren . add ( new OjbMetaExtentClassNode ( this . getOjbMetaTreeModel ( ) . getRepository ( ) , this . getOjbMetaTreeModel ( ) , this , extentClassName ) ) ; } // Get Field descriptors FieldDescriptor if ( cld . getFieldDescriptions ( ) != null ) { it = new ArrayIterator ( cld . getFieldDescriptions ( ) ) ; while ( it . hasNext ( ) ) { FieldDescriptor fieldDesc = ( FieldDescriptor ) it . next ( ) ; newChildren . add ( new OjbMetaFieldDescriptorNode ( this . getOjbMetaTreeModel ( ) . getRepository ( ) , this . getOjbMetaTreeModel ( ) , this , fieldDesc ) ) ; } } else { System . out . println ( cld . getClassNameOfObject ( ) + " does not have field descriptors" ) ; } // Get Indices IndexDescriptor it = cld . getIndexes ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { IndexDescriptor indexDesc = ( IndexDescriptor ) it . next ( ) ; newChildren . add ( new OjbMetaIndexDescriptorNode ( this . getOjbMetaTreeModel ( ) . getRepository ( ) , this . getOjbMetaTreeModel ( ) , this , indexDesc ) ) ; } // Get references ObjectReferenceDescriptor it = cld . getObjectReferenceDescriptors ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { ObjectReferenceDescriptor objRefDesc = ( ObjectReferenceDescriptor ) it . next ( ) ; newChildren . add ( new OjbMetaObjectReferenceDescriptorNode ( this . getOjbMetaTreeModel ( ) . getRepository ( ) , this . getOjbMetaTreeModel ( ) , this , objRefDesc ) ) ; } // Add this . alChildren = newChildren ; this . getOjbMetaTreeModel ( ) . nodeStructureChanged ( this ) ; return true ;
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getRevisionSummaryType ( ) { } }
if ( revisionSummaryTypeEClass == null ) { revisionSummaryTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 30 ) ; } return revisionSummaryTypeEClass ;
public class Client { /** * Gets a list of OneLoginApp resources . * @ param queryParameters Query parameters of the Resource * Parameters to filter the result of the list * @ param maxResults * Limit the number of OneLoginApp returned ( optional ) * @ return List of OneLoginApp * @ 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 getResource call * @ see com . onelogin . sdk . model . OneLoginApp * @ see < a target = " _ blank " href = " https : / / developers . onelogin . com / api - docs / 1 / apps / get - apps " > Get Apps documentation < / a > */ public List < OneLoginApp > getApps ( HashMap < String , String > queryParameters , int maxResults ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { } }
ExtractionContext context = getResource ( queryParameters , Constants . GET_APPS_URL ) ; OneloginOAuthJSONResourceResponse oAuthResponse = null ; String afterCursor = null ; List < OneLoginApp > apps = new ArrayList < OneLoginApp > ( maxResults ) ; while ( oAuthResponse == null || ( apps . size ( ) < maxResults && afterCursor != null ) ) { oAuthResponse = context . oAuthClient . resource ( context . bearerRequest , OAuth . HttpMethod . GET , OneloginOAuthJSONResourceResponse . class ) ; if ( ( afterCursor = getOneLoginAppsBatch ( apps , context . url , context . bearerRequest , oAuthResponse ) ) == null ) { break ; } } return apps ;
public class Tile { /** * Returns the tile above this tile . * @ return tile above */ public Tile getAbove ( ) { } }
int y = tileY - 1 ; if ( y < 0 ) { y = getMaxTileNumber ( this . zoomLevel ) ; } return new Tile ( this . tileX , y , this . zoomLevel , this . tileSize ) ;
public class CmsPublishGroupPanel { /** * Adds a resource bean to this group . < p > * @ param resourceBean the resource bean which should be added */ private void addItem ( CmsPublishResource resourceBean ) { } }
CmsTreeItem row = buildItem ( resourceBean , m_model . getStatus ( resourceBean . getId ( ) ) , false ) ; m_panel . add ( row ) ; for ( CmsPublishResource related : resourceBean . getRelated ( ) ) { row . addChild ( buildItem ( related , m_model . getStatus ( related . getId ( ) ) , true ) ) ; }
public class AppointmentCalendarApplet { /** * For Stand - alone . */ public static void main ( String [ ] args ) { } }
BaseApplet . main ( args ) ; BaseApplet applet = AppointmentCalendarApplet . getSharedInstance ( ) ; if ( applet == null ) applet = new AppointmentCalendarApplet ( args ) ; new JBaseFrame ( "Calendar" , applet ) ;
public class WaitPageInterceptor { /** * Intercepts execution to handle { @ link WaitPage } annotation and invoke the event in a background request . */ public Resolution intercept ( ExecutionContext executionContext ) throws Exception { } }
// Remove expired contexts . removeExpired ( contexts ) ; // Get wait context , if any . Context context = getContext ( executionContext ) ; LifecycleStage stage = executionContext . getLifecycleStage ( ) ; if ( executionContext . getActionBeanContext ( ) . getRequest ( ) . getRequestURI ( ) . contains ( THREAD_URL ) ) { // The request we are processing is the one used to invoke event handler in background and to get resolution to send to user when event completes . // Since we are going to invoke the real event , the action bean and event must stay the same . // Binding and validation must be skipped since they were done in the first request . switch ( executionContext . getLifecycleStage ( ) ) { // Use action bean that will process event . case ActionBeanResolution : log . trace ( "injecting ActionBean" ) ; // Since session can be lost from original request ( Tomcat is a good example ) , request must be updated with the background request . context . actionBean . setContext ( executionContext . getActionBeanContext ( ) ) ; executionContext . setActionBean ( context . actionBean ) ; // Skip normal action bean resolution . return null ; // Select event to call . case HandlerResolution : log . trace ( "injecting event handler" ) ; executionContext . setHandler ( context . eventHandler ) ; // Skip normal handler resolution . return null ; // No biding or validation , it was done before a background request was created to handle event . case BindingAndValidation : case CustomValidation : log . trace ( "skipping binding and validation" ) ; // Skip binding and validation . return null ; // Execute event since we are in the background request . case EventHandling : log . trace ( "executing event handler" ) ; // Execute event and save exception if any . try { return executionContext . proceed ( ) ; } catch ( Exception e ) { synchronized ( context . actionBean ) { log . trace ( "setting exception in context" ) ; context . throwable = e ; context . status = Context . Status . COMPLETE ; context . completeMoment = System . currentTimeMillis ( ) ; context . actionBean . notifyAll ( ) ; context . eventFlashScope = FlashScope . getCurrent ( context . actionBean . getContext ( ) . getRequest ( ) , false ) ; } throw e ; } // Save resolution to send to user when he will refresh wait page . case ResolutionExecution : synchronized ( context . actionBean ) { log . trace ( "setting resolution in context" ) ; context . resolution = executionContext . getResolution ( ) ; context . status = Context . Status . COMPLETE ; context . completeMoment = System . currentTimeMillis ( ) ; context . actionBean . notifyAll ( ) ; context . eventFlashScope = FlashScope . getCurrent ( context . actionBean . getContext ( ) . getRequest ( ) , false ) ; } // Use a default resolution to prevent processing the one event returned . executionContext . setResolution ( new StreamingResolution ( "text/plain" , "thread complete" ) ) ; return executionContext . proceed ( ) ; case RequestInit : case RequestComplete : return executionContext . proceed ( ) ; } } else { if ( LifecycleStage . ActionBeanResolution . equals ( stage ) ) { if ( context != null ) { // We are using a wait context for this request . Go to wait page or event ' s resolution depending on status and skip everything else . return checkStatus ( executionContext , context ) ; } } else if ( LifecycleStage . EventHandling . equals ( stage ) ) { WaitPage annotation = executionContext . getHandler ( ) . getAnnotation ( WaitPage . class ) ; if ( annotation != null ) { // Event has @ WaitPage annotation . Create wait context to invoke event in background and redirect user to wait page . return createContextAndRedirect ( executionContext , annotation ) ; } } } return executionContext . proceed ( ) ;
public class FloatingLabelWidgetBase { /** * Initialise the widget : read attributes , inflate layout and set the basic properties * @ param context * @ param attrs * @ param defStyle */ protected void init ( Context context , AttributeSet attrs , int defStyle ) { } }
// Load custom attributes final int layoutId ; final CharSequence floatLabelText ; final int floatLabelTextAppearance ; final int floatLabelTextColor ; final float floatLabelTextSize ; if ( attrs == null ) { layoutId = getDefaultLayoutId ( ) ; isFloatOnFocusEnabled = true ; floatLabelText = null ; floatLabelTextAppearance = - 1 ; floatLabelTextColor = 0x66000000 ; floatLabelTextSize = getResources ( ) . getDimensionPixelSize ( R . dimen . flw_defaultLabelTextSize ) ; } else { final TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . FloatingLabelWidgetBase , defStyle , 0 ) ; layoutId = a . getResourceId ( R . styleable . FloatingLabelWidgetBase_android_layout , getDefaultLayoutId ( ) ) ; isFloatOnFocusEnabled = a . getBoolean ( R . styleable . FloatingLabelWidgetBase_flw_floatOnFocus , true ) ; floatLabelText = a . getText ( R . styleable . FloatingLabelWidgetBase_flw_labelText ) ; floatLabelTextColor = a . getColor ( R . styleable . FloatingLabelWidgetBase_flw_labelTextColor , 0x66000000 ) ; floatLabelTextAppearance = a . getResourceId ( R . styleable . FloatingLabelWidgetBase_flw_labelTextAppearance , - 1 ) ; floatLabelTextSize = a . getDimension ( R . styleable . FloatingLabelWidgetBase_flw_labelTextSize , getResources ( ) . getDimensionPixelSize ( R . dimen . flw_defaultLabelTextSize ) ) ; a . recycle ( ) ; } inflateWidgetLayout ( context , layoutId ) ; getFloatingLabel ( ) . setFocusableInTouchMode ( false ) ; getFloatingLabel ( ) . setFocusable ( false ) ; setLabelAnimator ( getDefaultLabelAnimator ( ) ) ; setLabelText ( floatLabelText ) ; if ( floatLabelTextAppearance != - 1 ) { setLabelTextAppearance ( getContext ( ) , floatLabelTextAppearance ) ; } setLabelColor ( floatLabelTextColor ) ; setLabelTextSize ( TypedValue . COMPLEX_UNIT_PX , floatLabelTextSize ) ; afterLayoutInflated ( context , attrs , defStyle ) ; isLaidOut = false ; getViewTreeObserver ( ) . addOnGlobalLayoutListener ( new ViewTreeObserver . OnGlobalLayoutListener ( ) { @ Override public void onGlobalLayout ( ) { isLaidOut = true ; setInitialWidgetState ( ) ; if ( Build . VERSION . SDK_INT >= 16 ) { getViewTreeObserver ( ) . removeOnGlobalLayoutListener ( this ) ; } else { getViewTreeObserver ( ) . removeGlobalOnLayoutListener ( this ) ; } } } ) ; // Mark init as complete to prevent accidentally breaking the view by // adding children initCompleted = true ; onInitCompleted ( ) ;
public class IntegerProcessingTopology { /** * All Heron topologies require a main function that defines the topology ' s behavior * at runtime */ public static void main ( String [ ] args ) throws Exception { } }
Builder builder = Builder . newBuilder ( ) ; Streamlet < Integer > zeroes = builder . newSource ( ( ) -> 0 ) ; builder . newSource ( ( ) -> ThreadLocalRandom . current ( ) . nextInt ( 1 , 11 ) ) . setName ( "random-ints" ) . map ( i -> i + 1 ) . setName ( "add-one" ) . union ( zeroes ) . setName ( "unify-streams" ) . filter ( i -> i != 2 ) . setName ( "remove-twos" ) . log ( ) ; Config config = Config . newBuilder ( ) . setNumContainers ( NUM_CONTAINERS ) . setPerContainerRamInGigabytes ( GIGABYTES_OF_RAM ) . setPerContainerCpu ( CPU ) . build ( ) ; // Fetches the topology name from the first command - line argument String topologyName = StreamletUtils . getTopologyName ( args ) ; // Finally , the processing graph and configuration are passed to the Runner , which converts // the graph into a Heron topology that can be run in a Heron cluster . new Runner ( ) . run ( topologyName , config , builder ) ;
public class ServiceChangeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ServiceChange serviceChange , ProtocolMarshaller protocolMarshaller ) { } }
if ( serviceChange == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( serviceChange . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( serviceChange . getDnsConfig ( ) , DNSCONFIG_BINDING ) ; protocolMarshaller . marshall ( serviceChange . getHealthCheckConfig ( ) , HEALTHCHECKCONFIG_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Hints { /** * Merges the status . If one of the resource have different status the status will be * chosen according to the following priorities : * < ol > * < li > GONE < / li > * < li > DEPRECATED < / li > * < li > NONE < / li > * < / ol > * @ param hints the hints to merge */ private void mergeStatus ( Hints hints ) { } }
if ( status != null ) { if ( hints . getStatus ( ) != null && ! status . equals ( hints . getStatus ( ) ) ) { switch ( hints . getStatus ( ) ) { case GONE : status = Status . GONE ; break ; case DEPRECATED : if ( status != Status . GONE ) { status = Status . DEPRECATED ; } break ; } } } else { this . status = hints . getStatus ( ) ; }
public class nssimpleacl { /** * Use this API to fetch filtered set of nssimpleacl resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static nssimpleacl [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
nssimpleacl obj = new nssimpleacl ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; nssimpleacl [ ] response = ( nssimpleacl [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class CmsXmlUtils { /** * Removes all Xpath index information from the given input path . < p > * Examples : < br > * < code > title < / code > is left untouched < br > * < code > title [ 1 ] < / code > becomes < code > title < / code > < br > * < code > title / subtitle < / code > is left untouched < br > * < code > title [ 1 ] / subtitle [ 1 ] < / code > becomes < code > title / subtitle < / code > < p > * @ param path the path to remove the Xpath index information from * @ return the simplified Xpath for the given name */ public static String removeXpath ( String path ) { } }
if ( path . indexOf ( '/' ) > - 1 ) { // this is a complex path over more then 1 node StringBuffer result = new StringBuffer ( path . length ( ) + 32 ) ; // split the path into sub - elements List < String > elements = CmsStringUtil . splitAsList ( path , '/' ) ; int end = elements . size ( ) - 1 ; for ( int i = 0 ; i <= end ; i ++ ) { // remove [ i ] from path element if required result . append ( removeXpathIndex ( elements . get ( i ) ) ) ; if ( i < end ) { // append path delimiter if not final path element result . append ( '/' ) ; } } return result . toString ( ) ; } // this path has only 1 node , remove last index if required return removeXpathIndex ( path ) ;
public class RROtherProjectInfoV1_2Generator { /** * This method will set the values to historic destination */ private void setHistoricDestionation ( RROtherProjectInfo12Document . RROtherProjectInfo12 rrOtherProjectInfo ) { } }
String historicDestinationAnswer = getAnswer ( HISTORIC_DESTIONATION_YNQ , answerHeaders ) ; if ( historicDestinationAnswer != null && ! historicDestinationAnswer . equals ( NOT_ANSWERED ) ) { YesNoDataType . Enum answer = getAnswer ( HISTORIC_DESTIONATION_YNQ , answerHeaders ) . equals ( "Y" ) ? YesNoDataType . Y_YES : YesNoDataType . N_NO ; String answerExplanation = getChildQuestionAnswer ( HISTORIC_DESTIONATION_YNQ , EXPLANATION , answerHeaders ) ; rrOtherProjectInfo . setHistoricDesignation ( answer ) ; if ( answerExplanation != null ) { if ( answerExplanation . trim ( ) . length ( ) > EXPLANATION_MAX_LENGTH ) { rrOtherProjectInfo . setHistoricDesignationExplanation ( answerExplanation . trim ( ) . substring ( 0 , EXPLANATION_MAX_LENGTH ) ) ; } else { rrOtherProjectInfo . setHistoricDesignationExplanation ( answerExplanation . trim ( ) ) ; } } else if ( YnqConstant . YES . code ( ) . equals ( historicDestinationAnswer ) ) { rrOtherProjectInfo . setHistoricDesignationExplanation ( answerExplanation ) ; } } else { rrOtherProjectInfo . setHistoricDesignation ( null ) ; }
public class SizeTieredCompactionStrategy { /** * Returns the reads per second per key for this sstable , or 0.0 if the sstable has no read meter */ private static double hotness ( SSTableReader sstr ) { } }
// system tables don ' t have read meters , just use 0.0 for the hotness return sstr . getReadMeter ( ) == null ? 0.0 : sstr . getReadMeter ( ) . twoHourRate ( ) / sstr . estimatedKeys ( ) ;
public class GitRepo { /** * Clones the project . * @ param projectUri - URI of the project * @ return file where the project was cloned */ File cloneProject ( URI projectUri ) { } }
try { log . info ( "Cloning repo from [" + projectUri + "] to [" + this . basedir + "]" ) ; Git git = cloneToBasedir ( projectUri , this . basedir ) ; if ( git != null ) { git . close ( ) ; } File clonedRepo = git . getRepository ( ) . getWorkTree ( ) ; log . info ( "Cloned repo to [" + clonedRepo + "]" ) ; return clonedRepo ; } catch ( Exception e ) { throw new IllegalStateException ( "Exception occurred while cloning repo" , e ) ; }
public class StringUtils { /** * Generates a sha - 256 hash from a string * Taken from http : / / stackoverflow . com / questions / 415953 / generate - md5 - hash - in - java * @ param str a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . * @ since 0.7.2 */ public static String getHashFromString ( String str ) { } }
try { java . security . MessageDigest md = java . security . MessageDigest . getInstance ( "SHA-256" ) ; byte [ ] array = md . digest ( str . getBytes ( "UTF-8" ) ) ; StringBuilder sb = new StringBuilder ( ) ; for ( byte anArray : array ) { sb . append ( Integer . toHexString ( ( anArray & 0xFF ) | 0x100 ) . substring ( 1 , 3 ) ) ; } return sb . toString ( ) ; } catch ( java . security . NoSuchAlgorithmException | UnsupportedEncodingException e ) { throw new IllegalArgumentException ( "Cannot calculate SHA-256 hash for :" + str , e ) ; }
public class QuantityFormatter { /** * Selects the standard plural form for the number / formatter / rules . */ public static StandardPlural selectPlural ( Number number , NumberFormat fmt , PluralRules rules , StringBuffer formattedNumber , FieldPosition pos ) { } }
UFieldPosition fpos = new UFieldPosition ( pos . getFieldAttribute ( ) , pos . getField ( ) ) ; fmt . format ( number , formattedNumber , fpos ) ; // TODO : Long , BigDecimal & BigInteger may not fit into doubleValue ( ) . FixedDecimal fd = new FixedDecimal ( number . doubleValue ( ) , fpos . getCountVisibleFractionDigits ( ) , fpos . getFractionDigits ( ) ) ; String pluralKeyword = rules . select ( fd ) ; pos . setBeginIndex ( fpos . getBeginIndex ( ) ) ; pos . setEndIndex ( fpos . getEndIndex ( ) ) ; return StandardPlural . orOtherFromString ( pluralKeyword ) ;
public class SQLPPMappingToR2RMLConverter { /** * the method to write the R2RML mappings * from an rdf Model to a file * @ param os the output target */ public void write ( OutputStream os ) throws Exception { } }
try { JenaR2RMLMappingManager mm = JenaR2RMLMappingManager . getInstance ( ) ; Collection < TriplesMap > tripleMaps = getTripleMaps ( ) ; final JenaGraph jenaGraph = mm . exportMappings ( tripleMaps ) ; final Graph graph = new JenaRDF ( ) . asJenaGraph ( jenaGraph ) ; final PrefixMapping jenaPrefixMapping = graph . getPrefixMapping ( ) ; prefixmng . getPrefixMap ( ) . forEach ( ( s , s1 ) -> jenaPrefixMapping . setNsPrefix ( s . substring ( 0 , s . length ( ) - 1 ) // remove the last " : " from the prefix , s1 ) ) ; jenaPrefixMapping . setNsPrefix ( "rr" , "http://www.w3.org/ns/r2rml#" ) ; RDFWriter . create ( ) . lang ( Lang . TTL ) . format ( RDFFormat . TURTLE_PRETTY ) . source ( graph ) . output ( os ) ; // use Jena to output pretty turtle syntax // RDFDataMgr . write ( os , graph , org . apache . jena . riot . RDFFormat . TURTLE _ PRETTY ) ; os . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw e ; }
public class AbstractQueuedSynchronizer { /** * Returns an estimate of the number of threads waiting to * acquire . The value is only an estimate because the number of * threads may change dynamically while this method traverses * internal data structures . This method is designed for use in * monitoring system state , not for synchronization control . * @ return the estimated number of threads waiting to acquire */ public final int getQueueLength ( ) { } }
int n = 0 ; for ( Node p = tail ; p != null ; p = p . prev ) { if ( p . thread != null ) ++ n ; } return n ;
public class PersistenceBrokerImpl { /** * I pulled this out of internal store so that when doing multiple table * inheritance , i can recurse this function . * @ param obj * @ param cld * @ param oid BRJ : what is it good for ? ? ? * @ param insert * @ param ignoreReferences */ private void storeToDb ( Object obj , ClassDescriptor cld , Identity oid , boolean insert , boolean ignoreReferences ) { } }
// 1 . link and store 1:1 references storeReferences ( obj , cld , insert , ignoreReferences ) ; Object [ ] pkValues = oid . getPrimaryKeyValues ( ) ; if ( ! serviceBrokerHelper ( ) . assertValidPksForStore ( cld . getPkFields ( ) , pkValues ) ) { // BRJ : fk values may be part of pk , but the are not known during // creation of Identity . so we have to get them here pkValues = serviceBrokerHelper ( ) . getKeyValues ( cld , obj ) ; if ( ! serviceBrokerHelper ( ) . assertValidPksForStore ( cld . getPkFields ( ) , pkValues ) ) { String append = insert ? " on insert" : " on update" ; throw new PersistenceBrokerException ( "assertValidPkFields failed for Object of type: " + cld . getClassNameOfObject ( ) + append ) ; } } // get super class cld then store it with the object /* now for multiple table inheritance 1 . store super classes , topmost parent first 2 . go down through heirarchy until current class 3 . todo : store to full extent ? / / arminw : TODO : The extend - attribute feature dosn ' t work , should we remove this stuff ? This if - clause will go up the inheritance heirarchy to store all the super classes . The id for the top most super class will be the id for all the subclasses too */ if ( cld . getSuperClass ( ) != null ) { ClassDescriptor superCld = getDescriptorRepository ( ) . getDescriptorFor ( cld . getSuperClass ( ) ) ; storeToDb ( obj , superCld , oid , insert ) ; // arminw : why this ? ? I comment out this section // storeCollections ( obj , cld . getCollectionDescriptors ( ) , insert ) ; } // 2 . store primitive typed attributes ( Or is THIS step 3 ? ) // if obj not present in db use INSERT if ( insert ) { dbAccess . executeInsert ( cld , obj ) ; if ( oid . isTransient ( ) ) { // Create a new Identity based on the current set of primary key values . oid = serviceIdentity ( ) . buildIdentity ( cld , obj ) ; } } // else use UPDATE else { try { dbAccess . executeUpdate ( cld , obj ) ; } catch ( OptimisticLockException e ) { // ensure that the outdated object be removed from cache objectCache . remove ( oid ) ; throw e ; } } // cache object for symmetry with getObjectByXXX ( ) // Add the object to the cache . objectCache . doInternalCache ( oid , obj , ObjectCacheInternal . TYPE_WRITE ) ; // 3 . store 1 : n and m : n associations if ( ! ignoreReferences ) storeCollections ( obj , cld , insert ) ;
public class AWSSecurityHubClient { /** * Returns the count of all Security Hub membership invitations that were sent to the current member account , not * including the currently accepted invitation . * @ param getInvitationsCountRequest * @ return Result of the GetInvitationsCount operation returned by the service . * @ throws InternalException * Internal server error . * @ throws InvalidInputException * The request was rejected because an invalid or out - of - range value was supplied for an input parameter . * @ throws InvalidAccessException * AWS Security Hub is not enabled for the account used to make this request . * @ throws LimitExceededException * The request was rejected because it attempted to create resources beyond the current AWS account limits . * The error code describes the limit exceeded . * @ sample AWSSecurityHub . GetInvitationsCount * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / securityhub - 2018-10-26 / GetInvitationsCount " * target = " _ top " > AWS API Documentation < / a > */ @ Override public GetInvitationsCountResult getInvitationsCount ( GetInvitationsCountRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetInvitationsCount ( request ) ;
public class Async { /** * Handle exceptions that async task thrown . < br > * the method would block current thread until async task finished or * thrown with an exception , the handling process would be taken in * current thread . < br > * @ param handler a function to invoke when occurred an exception < br > * for all Throwable caught from the async task would be * packed into StyleRuntimeException * @ see StyleRuntimeException */ public void awaitError ( def < Void > handler ) { } }
while ( ! container . inProcess ) { // block Style . sleep ( 1 ) ; } synchronized ( container ) { if ( null != throwable ) { handler . apply ( Style . $ ( throwable ) ) ; } }
public class EventExtractor { /** * Splits events of a row if they overlap an island . Islands are areas between * the token which are included in the result . * @ param row * @ param graph * @ param text * @ param startTokenIndex token index of the first token in the match * @ param endTokenIndex token index of the last token in the match */ private static void splitRowsOnIslands ( Row row , final SDocumentGraph graph , STextualDS text , long startTokenIndex , long endTokenIndex ) { } }
BitSet tokenCoverage = new BitSet ( ) ; // get the sorted token List < SToken > sortedTokenList = graph . getSortedTokenByText ( ) ; // add all token belonging to the right text to the bit set ListIterator < SToken > itToken = sortedTokenList . listIterator ( ) ; while ( itToken . hasNext ( ) ) { SToken t = itToken . next ( ) ; if ( text == null || text == CommonHelper . getTextualDSForNode ( t , graph ) ) { RelannisNodeFeature feat = ( RelannisNodeFeature ) t . getFeature ( ANNIS_NS , FEAT_RELANNIS_NODE ) . getValue ( ) ; long tokenIndexRaw = feat . getTokenIndex ( ) ; tokenIndexRaw = clip ( tokenIndexRaw , startTokenIndex , endTokenIndex ) ; int tokenIndex = ( int ) ( tokenIndexRaw - startTokenIndex ) ; tokenCoverage . set ( tokenIndex ) ; } } ListIterator < GridEvent > itEvents = row . getEvents ( ) . listIterator ( ) ; while ( itEvents . hasNext ( ) ) { GridEvent event = itEvents . next ( ) ; BitSet eventBitSet = new BitSet ( ) ; eventBitSet . set ( event . getLeft ( ) , event . getRight ( ) + 1 ) ; // restrict event bitset on the locations where token are present eventBitSet . and ( tokenCoverage ) ; // if there is is any 0 bit before the right border there is a break in the event // and we need to split it if ( eventBitSet . nextClearBit ( event . getLeft ( ) ) <= event . getRight ( ) ) { // remove the original event row . removeEvent ( itEvents ) ; // The event bitset now marks all the locations which the event should // cover . // Make a list of new events for each connected range in the bitset int subElement = 0 ; int offset = eventBitSet . nextSetBit ( 0 ) ; while ( offset >= 0 ) { int end = eventBitSet . nextClearBit ( offset ) - 1 ; if ( offset < end ) { GridEvent newEvent = new GridEvent ( event ) ; newEvent . setId ( event . getId ( ) + "_islandsplit_" + subElement ++ ) ; newEvent . setLeft ( offset ) ; newEvent . setRight ( end ) ; row . addEvent ( itEvents , newEvent ) ; } offset = eventBitSet . nextSetBit ( end + 1 ) ; } } // end if we need to split }
public class HttpServletRaSbbInterfaceImpl { /** * ( non - Javadoc ) * @ see net . java . slee . resource . http . HttpServletRaSbbInterface # getHttpSessionActivity ( javax . servlet . http . HttpSession ) */ public HttpSessionActivity getHttpSessionActivity ( HttpSession httpSession ) throws NullPointerException , IllegalArgumentException , IllegalStateException , ActivityAlreadyExistsException , StartActivityException , SLEEException { } }
if ( httpSession == null ) { throw new NullPointerException ( "null http session" ) ; } if ( ! ( httpSession instanceof HttpSessionWrapper ) ) { throw new IllegalArgumentException ( ) ; } final HttpSessionWrapper httpSessionWrapper = ( HttpSessionWrapper ) httpSession ; final HttpSessionActivityImpl activity = new HttpSessionActivityImpl ( httpSessionWrapper ) ; if ( httpSessionWrapper . getResourceEntryPoint ( ) == null ) { ra . getSleeEndpoint ( ) . startActivitySuspended ( activity , activity ) ; httpSessionWrapper . setResourceEntryPoint ( ra . getName ( ) ) ; } return activity ;
public class AmazonSNSClient { /** * Allows a subscription owner to set an attribute of the subscription to a new value . * @ param setSubscriptionAttributesRequest * Input for SetSubscriptionAttributes action . * @ return Result of the SetSubscriptionAttributes operation returned by the service . * @ throws InvalidParameterException * Indicates that a request parameter does not comply with the associated constraints . * @ throws FilterPolicyLimitExceededException * Indicates that the number of filter polices in your AWS account exceeds the limit . To add more filter * polices , submit an SNS Limit Increase case in the AWS Support Center . * @ throws InternalErrorException * Indicates an internal service error . * @ throws NotFoundException * Indicates that the requested resource does not exist . * @ throws AuthorizationErrorException * Indicates that the user has been denied access to the requested resource . * @ sample AmazonSNS . SetSubscriptionAttributes * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / sns - 2010-03-31 / SetSubscriptionAttributes " target = " _ top " > AWS * API Documentation < / a > */ @ Override public SetSubscriptionAttributesResult setSubscriptionAttributes ( SetSubscriptionAttributesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeSetSubscriptionAttributes ( request ) ;
public class InputElement { /** * setter for question - sets * @ generated */ public void setQuestion ( String v ) { } }
if ( InputElement_Type . featOkTst && ( ( InputElement_Type ) jcasType ) . casFeat_question == null ) jcasType . jcas . throwFeatMissing ( "question" , "edu.cmu.lti.oaqa.framework.types.InputElement" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( InputElement_Type ) jcasType ) . casFeatCode_question , v ) ;
public class ContextAwarePolicyAdapter { /** * Method creating context aware policy using user provided policy with needed components . * @ param policy * Policy . * @ param handler * Publications handler . * @ param extendingService * Extender client . * @ return Policy with suitable context . */ public static ContextAwarePolicy createPolicy ( Policy policy , PublicationsHandler handler , KSIExtendingService extendingService ) { } }
if ( policy instanceof UserProvidedPublicationBasedVerificationPolicy ) { throw new IllegalArgumentException ( "Unsupported verification policy." ) ; } Util . notNull ( handler , "Publications handler" ) ; Util . notNull ( extendingService , "Extending service" ) ; return new ContextAwarePolicyAdapter ( policy , new PolicyContext ( handler , extendingService ) ) ;
public class Expression { /** * Create an equal to expression that evaluates whether or not the current expression * is equal to the given expression . * @ param expression the expression to compare with the current expression . * @ return an equal to expression . */ @ NonNull public Expression equalTo ( @ NonNull Expression expression ) { } }
if ( expression == null ) { throw new IllegalArgumentException ( "expression cannot be null." ) ; } return new BinaryExpression ( this , expression , BinaryExpression . OpType . EqualTo ) ;
public class AlternativeAlignment { /** * Set apairs according to a list of ( i , j ) tuples . * @ param jf a JoingFragment */ public void apairs_from_idxlst ( JointFragments jf ) { } }
List < int [ ] > il = jf . getIdxlist ( ) ; // System . out . println ( " Alt Alig apairs _ from _ idxlst " ) ; aligpath = new IndexPair [ il . size ( ) ] ; idx1 = new int [ il . size ( ) ] ; idx2 = new int [ il . size ( ) ] ; for ( int i = 0 ; i < il . size ( ) ; i ++ ) { int [ ] p = il . get ( i ) ; // System . out . print ( " idx1 " + p [ 0 ] + " idx2 " + p [ 1 ] ) ; idx1 [ i ] = p [ 0 ] ; idx2 [ i ] = p [ 1 ] ; aligpath [ i ] = new IndexPair ( ( short ) p [ 0 ] , ( short ) p [ 1 ] ) ; } eqr0 = idx1 . length ; // System . out . println ( " eqr " + eqr0 ) ; gaps0 = count_gaps ( idx1 , idx2 ) ;
public class Console { /** * 同 System . out . println ( ) 方法 , 打印控制台日志 * @ param t 异常对象 * @ param template 文本模板 , 被替换的部分用 { } 表示 * @ param values 值 */ public static void log ( Throwable t , String template , Object ... values ) { } }
out . println ( StrUtil . format ( template , values ) ) ; if ( null != t ) { t . printStackTrace ( ) ; out . flush ( ) ; }
public class AbstractPrintWriter { /** * Writes a string followed by a newline . */ final public void println ( String s ) { } }
if ( s == null ) write ( _nullChars , 0 , _nullChars . length ) ; else write ( s , 0 , s . length ( ) ) ; println ( ) ;
public class DBIDUtil { /** * Produce a random sample of the given DBIDs . * @ param source Original DBIDs , no duplicates allowed * @ param k k Parameter * @ param seed Random generator seed * @ return new DBIDs */ public static ModifiableDBIDs randomSample ( DBIDs source , int k , Long seed ) { } }
return randomSample ( source , k , seed != null ? new Random ( seed . longValue ( ) ) : new Random ( ) ) ;
public class CommerceNotificationAttachmentLocalServiceUtil { /** * Returns a range of all the commerce notification attachments . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link com . liferay . commerce . notification . model . impl . CommerceNotificationAttachmentModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param start the lower bound of the range of commerce notification attachments * @ param end the upper bound of the range of commerce notification attachments ( not inclusive ) * @ return the range of commerce notification attachments */ public static java . util . List < com . liferay . commerce . notification . model . CommerceNotificationAttachment > getCommerceNotificationAttachments ( int start , int end ) { } }
return getService ( ) . getCommerceNotificationAttachments ( start , end ) ;
public class RendererUtils { /** * Find the enclosing form of a component * in the view - tree . * All Subclasses of < code > UIForm < / code > and all known * form - families are searched for . * Currently those are the Trinidad form family , * and the ( old ) ADF Faces form family . * There might be additional form families * which have to be explicitly entered here . * @ param uiComponent * @ param facesContext * @ return FormInfo Information about the form - the form itself and its name . */ public static FormInfo findNestingForm ( UIComponent uiComponent , FacesContext facesContext ) { } }
UIComponent parent = uiComponent . getParent ( ) ; while ( parent != null && ( ! ADF_FORM_COMPONENT_FAMILY . equals ( parent . getFamily ( ) ) && ! TRINIDAD_FORM_COMPONENT_FAMILY . equals ( parent . getFamily ( ) ) && ! ( parent instanceof UIForm ) ) ) { parent = parent . getParent ( ) ; } if ( parent != null ) { // link is nested inside a form String formName = parent . getClientId ( facesContext ) ; return new FormInfo ( parent , formName ) ; } return null ;
public class ClassHelper { /** * Check if the passed class is abstract or not . Note : interfaces and * annotations are also considered as abstract whereas arrays are never * abstract . * @ param aClass * The class to check . * @ return < code > true < / code > if the passed class is abstract */ public static boolean isAbstractClass ( @ Nullable final Class < ? > aClass ) { } }
// Special case for arrays ( see documentation of Class . getModifiers : only // final and interface are set , the rest is indeterministic ) return aClass != null && ! aClass . isArray ( ) && Modifier . isAbstract ( aClass . getModifiers ( ) ) ;
public class MetadataStore { /** * Initialize the routing strategy map for system stores . This is used * during get / put on system stores . */ private void initSystemRoutingStrategies ( Cluster cluster ) { } }
HashMap < String , RoutingStrategy > routingStrategyMap = createRoutingStrategyMap ( cluster , makeStoreDefinitionMap ( getSystemStoreDefList ( ) ) ) ; this . metadataCache . put ( SYSTEM_ROUTING_STRATEGY_KEY , new Versioned < Object > ( routingStrategyMap ) ) ;
public class SipStack { /** * This method is used to create a SipPhone object . The SipPhone class simulates a SIP User Agent . * The SipPhone object is used to communicate with other SIP agents . Using a SipPhone object , the * test program can make one ( or more , in future ) outgoing calls or ( and , in future ) receive one * ( or more , in future ) incoming calls . * @ param proxyHost host name or address of the SIP proxy to use . The proxy is used for * registering and outbound calling on a per - call basis . If this parameter is a null value , * any registration requests will be sent to the " host " part of the " me " parameter ( see * below ) and any attempt to make an outbound call via proxy will fail . If a host name is * given here , it must resolve to a valid , reachable DNS address . * @ param proxyProto used to specify the protocol for communicating with the proxy server - " udp " * or " tcp " . * @ param proxyPort port number into with the proxy server listens to for SIP messages and * connections . * @ param me " Address of Record " URI of the phone user . Each SipPhone is associated with one user . * This parameter is used in the " from " header field . * @ return A new SipPhone object . * @ throws InvalidArgumentException * @ throws ParseException */ public SipPhone createSipPhone ( String proxyHost , String proxyProto , int proxyPort , String me ) throws InvalidArgumentException , ParseException { } }
return new SipPhone ( this , proxyHost , proxyProto , proxyPort , me ) ;
public class AddFlowOutputsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AddFlowOutputsRequest addFlowOutputsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( addFlowOutputsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( addFlowOutputsRequest . getFlowArn ( ) , FLOWARN_BINDING ) ; protocolMarshaller . marshall ( addFlowOutputsRequest . getOutputs ( ) , OUTPUTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ModifyDBInstanceRequest { /** * The number of CPU cores and the number of threads per core for the DB instance class of the DB instance . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setProcessorFeatures ( java . util . Collection ) } or { @ link # withProcessorFeatures ( java . util . Collection ) } if * you want to override the existing values . * @ param processorFeatures * The number of CPU cores and the number of threads per core for the DB instance class of the DB instance . * @ return Returns a reference to this object so that method calls can be chained together . */ public ModifyDBInstanceRequest withProcessorFeatures ( ProcessorFeature ... processorFeatures ) { } }
if ( this . processorFeatures == null ) { setProcessorFeatures ( new com . amazonaws . internal . SdkInternalList < ProcessorFeature > ( processorFeatures . length ) ) ; } for ( ProcessorFeature ele : processorFeatures ) { this . processorFeatures . add ( ele ) ; } return this ;
public class ResponseBuilder { /** * Sets a standard { @ link Card } on the response with the specified title , content and image * @ param cardTitle title for card * @ param cardText text in the card * @ param image image * @ return response builder */ public ResponseBuilder withStandardCard ( String cardTitle , String cardText , Image image ) { } }
this . card = StandardCard . builder ( ) . withText ( cardText ) . withImage ( image ) . withTitle ( cardTitle ) . build ( ) ; return this ;
public class Tag { /** * Uint32 */ public void read ( RandomAccessFile myRandomAccessFile ) throws IOException { } }
TagIdentifier = BinaryTools . readUInt16AsInt ( myRandomAccessFile ) ; DescriptorVersion = BinaryTools . readUInt16AsInt ( myRandomAccessFile ) ; TagChecksum = ( short ) myRandomAccessFile . readUnsignedByte ( ) ; Reserved = myRandomAccessFile . readByte ( ) ; TagSerialNumber = BinaryTools . readUInt16AsInt ( myRandomAccessFile ) ; DescriptorCRC = BinaryTools . readUInt16AsInt ( myRandomAccessFile ) ; DescriptorCRCLength = BinaryTools . readUInt16AsInt ( myRandomAccessFile ) ; TagLocation = BinaryTools . readUInt32AsLong ( myRandomAccessFile ) ;
public class Installer { /** * Install a cloud sdk ( only run this on LATEST ) . */ public void install ( ) throws CommandExitException , CommandExecutionException , InterruptedException { } }
List < String > command = new ArrayList < > ( installScriptProvider . getScriptCommandLine ( installedSdkRoot ) ) ; command . add ( "--path-update=false" ) ; // don ' t update user ' s path command . add ( "--command-completion=false" ) ; // don ' t add command completion command . add ( "--quiet" ) ; // don ' t accept user input during install command . add ( "--usage-reporting=" + usageReporting ) ; // usage reporting passthrough Path workingDirectory = installedSdkRoot . getParent ( ) ; Map < String , String > installerEnvironment = installScriptProvider . getScriptEnvironment ( ) ; progressListener . start ( "Installing Cloud SDK" , ProgressListener . UNKNOWN ) ; commandRunner . run ( command , workingDirectory , installerEnvironment , consoleListener ) ; progressListener . done ( ) ;
public class CommerceTaxMethodPersistenceImpl { /** * Returns the first commerce tax method in the ordered set where groupId = & # 63 ; and active = & # 63 ; . * @ param groupId the group ID * @ param active the active * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce tax method * @ throws NoSuchTaxMethodException if a matching commerce tax method could not be found */ @ Override public CommerceTaxMethod findByG_A_First ( long groupId , boolean active , OrderByComparator < CommerceTaxMethod > orderByComparator ) throws NoSuchTaxMethodException { } }
CommerceTaxMethod commerceTaxMethod = fetchByG_A_First ( groupId , active , orderByComparator ) ; if ( commerceTaxMethod != null ) { return commerceTaxMethod ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ", active=" ) ; msg . append ( active ) ; msg . append ( "}" ) ; throw new NoSuchTaxMethodException ( msg . toString ( ) ) ;
public class CallableStatementHandler { /** * { @ inheritDoc } */ @ Override public void setStatement ( Statement statement , QueryParameters params ) throws SQLException { } }
// setting in parameters super . setStatement ( statement , params ) ; if ( statement instanceof CallableStatement ) { // registering out parameters CallableStatement callStmt = ( CallableStatement ) statement ; String parameterName = null ; for ( int i = 0 ; i < params . orderSize ( ) ; i ++ ) { parameterName = params . getNameByPosition ( i ) ; if ( params . isOutParameter ( parameterName ) == true ) { callStmt . registerOutParameter ( i + 1 , params . getType ( parameterName ) ) ; } } }
public class CarbonClientImpl { /** * Send some XML * @ param doc * @ return * @ throws CarbonException */ public CarbonReply send ( Element element ) throws CarbonException { } }
try { final String responseXml = send ( serialise ( element ) ) ; return new CarbonReply ( deserialise ( responseXml ) ) ; } catch ( CarbonException e ) { throw e ; } catch ( Exception e ) { throw new CarbonException ( e ) ; }
public class DTMDocumentImpl { /** * Given an expanded name , return an ID . If the expanded - name does not * exist in the internal tables , the entry will be created , and the ID will * be returned . Any additional nodes that are created that have this * expanded name will use this ID . * @ return the expanded - name id of the node . */ public int getExpandedTypeID ( String namespace , String localName , int type ) { } }
// Create expanded name // % TBD % jjk Expanded name is bitfield - encoded as // typeID [ 6 ] nsuriID [ 10 ] localID [ 16 ] . Switch to that form , and to // accessing the ns / local via their tables rather than confusing // nsnames and expandednames . String expandedName = namespace + ":" + localName ; int expandedNameID = m_nsNames . stringToIndex ( expandedName ) ; return expandedNameID ;
public class ConsonantUtil { /** * * * * * * BEGINNING OF FUNCTION * * * * * */ / * / public static boolean is_kavargadi ( String str ) { } }
String s1 = VarnaUtil . getAdiVarna ( str ) ; if ( is_kavarga ( s1 ) ) return true ; return false ;
public class Main { /** * Strategy method where we could use some smarts to find the war * using known paths or maybe the local maven repository ? */ protected String findWar ( String ... paths ) { } }
if ( paths != null ) { for ( String path : paths ) { if ( path != null ) { File file = new File ( path ) ; if ( file . exists ( ) ) { if ( file . isFile ( ) ) { String name = file . getName ( ) ; if ( isWarFileName ( name ) ) { return file . getPath ( ) ; } } if ( file . isDirectory ( ) ) { // lets look for a war in this directory File [ ] wars = file . listFiles ( ( dir , name ) -> isWarFileName ( name ) ) ; if ( wars != null && wars . length > 0 ) { return wars [ 0 ] . getPath ( ) ; } } } } } } return null ;
public class RelationshipTypeProperty { /** * Retrieve the RDF { @ link Property } for the BEL { @ link RelationshipType } . * @ param rtype { @ link RelationshipType } , the relationship type , which * cannot be null * @ return { @ link Property } the property for the { @ link RelationshipType } * @ throws InvalidArgument Thrown if < tt > rtype < / tt > is null */ public static final Property propertyFor ( RelationshipType rtype ) { } }
if ( rtype == null ) { throw new InvalidArgument ( "rtype" , rtype ) ; } return TYPETOPROPERTY . get ( rtype ) ;
public class XMLValueNode { /** * { @ inheritDoc } */ @ Override public void setValue ( String value ) { } }
if ( ! value . equals ( this . value ) ) { this . value = value ; if ( parent != null ) { parent . fireValueNodeChanged ( this ) ; } }
public class IntermediateForm { /** * This method is used by the index update combiner and process an * intermediate form into the current intermediate form . More specifically , * the input intermediate forms are a single - document ram index and / or a * single delete term . * @ param form the input intermediate form * @ throws IOException */ public void process ( IntermediateForm form ) throws IOException { } }
if ( form . deleteList . size ( ) > 0 ) { deleteList . addAll ( form . deleteList ) ; } if ( form . dir . sizeInBytes ( ) > 0 ) { if ( writer == null ) { writer = createWriter ( ) ; } writer . addIndexesNoOptimize ( new Directory [ ] { form . dir } ) ; numDocs ++ ; }
public class OpenCSVBatcherExample { /** * install the resource extension on the server */ public static void installResourceExtension ( String host , int port , String user , String password , Authentication authType ) throws IOException { } }
// create the client DatabaseClient client = DatabaseClientFactory . newClient ( host , port , user , password , authType ) ; // create a manager for resource extensions ResourceExtensionsManager resourceMgr = client . newServerConfigManager ( ) . newResourceExtensionsManager ( ) ; // specify metadata about the resource extension ExtensionMetadata metadata = new ExtensionMetadata ( ) ; metadata . setTitle ( "Document Splitter Resource Services" ) ; metadata . setDescription ( "This plugin supports splitting input into multiple documents" ) ; metadata . setProvider ( "MarkLogic" ) ; metadata . setVersion ( "0.1" ) ; // acquire the resource extension source code InputStream sourceStream = Util . openStream ( "scripts" + File . separator + DocumentSplitter . NAME + ".xqy" ) ; if ( sourceStream == null ) throw new RuntimeException ( "Could not read example resource extension" ) ; // create a handle on the extension source code InputStreamHandle handle = new InputStreamHandle ( sourceStream ) ; handle . set ( sourceStream ) ; // write the resource extension to the database resourceMgr . writeServices ( DocumentSplitter . NAME , handle , metadata , new MethodParameters ( MethodType . POST ) ) ; System . out . println ( "Installed the resource extension on the server" ) ; // release the client client . release ( ) ;
public class CasAssertionSecurityContext { /** * If enabled , convert CAS assertion person attributes into uPortal user attributes . * @ param assertion the Assertion that was retrieved from the ThreadLocal . CANNOT be NULL . */ private void copyAssertionAttributesToUserAttributes ( Assertion assertion ) { } }
if ( ! copyAssertionAttributesToUserAttributes ) { return ; } // skip this if there are no attributes or if the attribute set is empty . if ( assertion . getPrincipal ( ) . getAttributes ( ) == null || assertion . getPrincipal ( ) . getAttributes ( ) . isEmpty ( ) ) { return ; } Map < String , List < Object > > attributes = new HashMap < > ( ) ; // loop over the set of person attributes from CAS . . . for ( Map . Entry < String , Object > attrEntry : assertion . getPrincipal ( ) . getAttributes ( ) . entrySet ( ) ) { log . debug ( "Adding attribute '{}' from Assertion with value '{}'; runtime type of value is {}" , attrEntry . getKey ( ) , attrEntry . getValue ( ) , attrEntry . getValue ( ) . getClass ( ) . getName ( ) ) ; // Check for credential if ( decryptCredentialToPassword && key != null && cipher != null && attrEntry . getKey ( ) . equals ( CREDENTIAL_KEY ) ) { try { final String encPwd = ( String ) ( attrEntry . getValue ( ) instanceof List ? ( ( List ) attrEntry . getValue ( ) ) . get ( 0 ) : attrEntry . getValue ( ) ) ; byte [ ] cred64 = DatatypeConverter . parseBase64Binary ( encPwd ) ; cipher . init ( Cipher . DECRYPT_MODE , key ) ; final byte [ ] cipherData = cipher . doFinal ( cred64 ) ; final Object pwd = new String ( cipherData , UTF_8 ) ; attributes . put ( PASSWORD_KEY , Collections . singletonList ( pwd ) ) ; } catch ( Exception e ) { log . warn ( "Cannot decipher credential" , e ) ; } } // convert each attribute to a list , if necessary . . . List < Object > valueList ; if ( attrEntry . getValue ( ) instanceof List ) { valueList = ( List < Object > ) attrEntry . getValue ( ) ; } else { valueList = Collections . singletonList ( attrEntry . getValue ( ) ) ; } // add the attribute . . . attributes . put ( attrEntry . getKey ( ) , valueList ) ; } // get the attribute descriptor from Spring . . . IAdditionalDescriptors additionalDescriptors = ( IAdditionalDescriptors ) applicationContext . getBean ( SESSION_ADDITIONAL_DESCRIPTORS_BEAN ) ; // add the new properties . . . additionalDescriptors . addAttributes ( attributes ) ;
public class TransportMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Transport transport , ProtocolMarshaller protocolMarshaller ) { } }
if ( transport == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( transport . getMaxBitrate ( ) , MAXBITRATE_BINDING ) ; protocolMarshaller . marshall ( transport . getMaxLatency ( ) , MAXLATENCY_BINDING ) ; protocolMarshaller . marshall ( transport . getProtocol ( ) , PROTOCOL_BINDING ) ; protocolMarshaller . marshall ( transport . getSmoothingLatency ( ) , SMOOTHINGLATENCY_BINDING ) ; protocolMarshaller . marshall ( transport . getStreamId ( ) , STREAMID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExpectSteps { /** * Checks if an html element contains expected value . * @ param page * The concerned page of elementName * @ param elementName * The key of the PageElement to check * @ param textOrKey * Is the new data ( text or text in context ( after a save ) ) * @ param conditions * list of ' expected ' values condition and ' actual ' values ( { @ link com . github . noraui . gherkin . GherkinStepCondition } ) . * @ throws TechnicalException * is throws if you have a technical error ( format , configuration , datas , . . . ) in NoraUi . * Exception with message and with screenshot and with exception if functional error but no screenshot and no exception if technical error . * @ throws FailureException * if the scenario encounters a functional error */ @ Conditioned @ Et ( "Je m'attends à avoir '(.*)-(.*)' avec le texte '(.*)'[\\.|\\?]" ) @ And ( "I expect to have '(.*)-(.*)' with the text '(.*)'[\\.|\\?]" ) public void expectText ( String page , String elementName , String textOrKey , List < GherkinStepCondition > conditions ) throws FailureException , TechnicalException { } }
expectText ( Page . getInstance ( page ) . getPageElementByKey ( '-' + elementName ) , textOrKey ) ;
public class EndpointImpl { /** * For both code - first and wsdl - first scenarios , reset the endpoint address * so that it is written to the generated wsdl file . */ private void updateSoapAddress ( ) { } }
final SOAPAddressRewriteMetadata metadata = getSOAPAddressRewriteMetadata ( ) ; if ( metadata . isModifySOAPAddress ( ) ) { // - code - first handling List < ServiceInfo > sevInfos = getServer ( ) . getEndpoint ( ) . getService ( ) . getServiceInfos ( ) ; for ( ServiceInfo si : sevInfos ) { Collection < EndpointInfo > epInfos = si . getEndpoints ( ) ; for ( EndpointInfo ei : epInfos ) { String publishedEndpointUrl = ( String ) ei . getProperty ( WSDLGetUtils . PUBLISHED_ENDPOINT_URL ) ; if ( publishedEndpointUrl != null ) { ei . setAddress ( publishedEndpointUrl ) ; } else { // - wsdl - first handling if ( ei . getAddress ( ) . contains ( ServerConfig . UNDEFINED_HOSTNAME ) ) { String epurl = SoapAddressRewriteHelper . getRewrittenPublishedEndpointUrl ( ei . getAddress ( ) , metadata ) ; ei . setAddress ( epurl ) ; } } } } }
public class ScalebarGraphic { /** * Render the scalebar . * @ param mapContext The context of the map for which the scalebar is created . * @ param scalebarParams The scalebar parameters . * @ param tempFolder The directory in which the graphic file is created . * @ param template The template that containts the scalebar processor */ public final URI render ( final MapfishMapContext mapContext , final ScalebarAttributeValues scalebarParams , final File tempFolder , final Template template ) throws IOException , ParserConfigurationException { } }
final double dpi = mapContext . getDPI ( ) ; // get the map bounds final Rectangle paintArea = new Rectangle ( mapContext . getMapSize ( ) ) ; MapBounds bounds = mapContext . getBounds ( ) ; final DistanceUnit mapUnit = getUnit ( bounds ) ; final Scale scale = bounds . getScale ( paintArea , PDF_DPI ) ; final double scaleDenominator = scale . getDenominator ( scalebarParams . geodetic , bounds . getProjection ( ) , dpi , bounds . getCenter ( ) ) ; DistanceUnit scaleUnit = scalebarParams . getUnit ( ) ; if ( scaleUnit == null ) { scaleUnit = mapUnit ; } // adjust scalebar width and height to the DPI value final double maxLengthInPixel = ( scalebarParams . getOrientation ( ) . isHorizontal ( ) ) ? scalebarParams . getSize ( ) . width : scalebarParams . getSize ( ) . height ; final double maxIntervalLengthInWorldUnits = DistanceUnit . PX . convertTo ( maxLengthInPixel , scaleUnit ) * scaleDenominator / scalebarParams . intervals ; final double niceIntervalLengthInWorldUnits = getNearestNiceValue ( maxIntervalLengthInWorldUnits , scaleUnit , scalebarParams . lockUnits ) ; final ScaleBarRenderSettings settings = new ScaleBarRenderSettings ( ) ; settings . setParams ( scalebarParams ) ; settings . setMaxSize ( scalebarParams . getSize ( ) ) ; settings . setPadding ( getPadding ( settings ) ) ; // start the rendering File path = null ; if ( template . getConfiguration ( ) . renderAsSvg ( scalebarParams . renderAsSvg ) ) { // render scalebar as SVG final SVGGraphics2D graphics2D = CreateMapProcessor . createSvgGraphics ( scalebarParams . getSize ( ) ) ; try { tryLayout ( graphics2D , scaleUnit , scaleDenominator , niceIntervalLengthInWorldUnits , settings , 0 ) ; path = File . createTempFile ( "scalebar-graphic-" , ".svg" , tempFolder ) ; CreateMapProcessor . saveSvgFile ( graphics2D , path ) ; } finally { graphics2D . dispose ( ) ; } } else { // render scalebar as raster graphic double dpiRatio = mapContext . getDPI ( ) / PDF_DPI ; final BufferedImage bufferedImage = new BufferedImage ( ( int ) Math . round ( scalebarParams . getSize ( ) . width * dpiRatio ) , ( int ) Math . round ( scalebarParams . getSize ( ) . height * dpiRatio ) , TYPE_4BYTE_ABGR ) ; final Graphics2D graphics2D = bufferedImage . createGraphics ( ) ; try { AffineTransform saveAF = new AffineTransform ( graphics2D . getTransform ( ) ) ; graphics2D . scale ( dpiRatio , dpiRatio ) ; tryLayout ( graphics2D , scaleUnit , scaleDenominator , niceIntervalLengthInWorldUnits , settings , 0 ) ; graphics2D . setTransform ( saveAF ) ; path = File . createTempFile ( "scalebar-graphic-" , ".png" , tempFolder ) ; ImageUtils . writeImage ( bufferedImage , "png" , path ) ; } finally { graphics2D . dispose ( ) ; } } return path . toURI ( ) ;
public class SpeeDRF { /** * Build random forest for data stored on this node . */ public static void build ( final Key jobKey , final Key modelKey , final DRFParams drfParams , final Data localData , int ntrees , int numSplitFeatures , int [ ] rowsPerChunks ) { } }
Timer t_alltrees = new Timer ( ) ; Tree [ ] trees = new Tree [ ntrees ] ; Log . info ( Log . Tag . Sys . RANDF , "Building " + ntrees + " trees" ) ; Log . info ( Log . Tag . Sys . RANDF , "Number of split features: " + numSplitFeatures ) ; Log . info ( Log . Tag . Sys . RANDF , "Starting RF computation with " + localData . rows ( ) + " rows " ) ; Random rnd = Utils . getRNG ( localData . seed ( ) + ROOT_SEED_ADD ) ; Sampling sampler = createSampler ( drfParams , rowsPerChunks ) ; byte producerId = ( byte ) H2O . SELF . index ( ) ; for ( int i = 0 ; i < ntrees ; ++ i ) { long treeSeed = rnd . nextLong ( ) + TREE_SEED_INIT ; // make sure that enough bits is initialized trees [ i ] = new Tree ( jobKey , modelKey , localData , producerId , drfParams . max_depth , drfParams . stat_type , numSplitFeatures , treeSeed , i , drfParams . _exclusiveSplitLimit , sampler , drfParams . _verbose , drfParams . regression , ! drfParams . _useNonLocalData , ( ( SpeeDRFModel ) UKV . get ( modelKey ) ) . score_pojo ) ; } Log . info ( "Invoking the tree build tasks on all nodes." ) ; DRemoteTask . invokeAll ( trees ) ; Log . info ( Log . Tag . Sys . RANDF , "All trees (" + ntrees + ") done in " + t_alltrees ) ;
public class DefaultApplicationContextBuilder { /** * Allow customizing the configurations that will be loaded . * @ param configurations The configurations to include * @ return This application */ @ Override public @ Nonnull ApplicationContextBuilder include ( @ Nullable String ... configurations ) { } }
if ( configurations != null ) { this . configurationIncludes . addAll ( Arrays . asList ( configurations ) ) ; } return this ;
public class CmsMessageBundleEditorModel { /** * Handles a key change . * @ param event the key change event . * @ param allLanguages < code > true < / code > for changing the key for all languages , < code > false < / code > if the key should be changed only for the current language . * @ return result , indicating if the key change was successful . */ public KeyChangeResult handleKeyChange ( EntryChangeEvent event , boolean allLanguages ) { } }
if ( m_keyset . getKeySet ( ) . contains ( event . getNewValue ( ) ) ) { m_container . getItem ( event . getItemId ( ) ) . getItemProperty ( TableProperty . KEY ) . setValue ( event . getOldValue ( ) ) ; return KeyChangeResult . FAILED_DUPLICATED_KEY ; } if ( allLanguages && ! renameKeyForAllLanguages ( event . getOldValue ( ) , event . getNewValue ( ) ) ) { m_container . getItem ( event . getItemId ( ) ) . getItemProperty ( TableProperty . KEY ) . setValue ( event . getOldValue ( ) ) ; return KeyChangeResult . FAILED_FOR_OTHER_LANGUAGE ; } return KeyChangeResult . SUCCESS ;
public class PomProjectInputStream { /** * Skips bytes from the input stream until it finds the & lt ; project & gt ; * element . * @ throws IOException thrown if an I / O error occurs */ private void skipToProject ( ) throws IOException { } }
final byte [ ] buffer = new byte [ BUFFER_SIZE ] ; super . mark ( BUFFER_SIZE ) ; int count = super . read ( buffer , 0 , BUFFER_SIZE ) ; while ( count > 0 ) { final int pos = findSequence ( PROJECT , buffer ) ; if ( pos >= 0 ) { super . reset ( ) ; super . skip ( pos ) ; return ; } else if ( count - PROJECT . length == 0 ) { return ; } super . reset ( ) ; super . skip ( count - PROJECT . length ) ; super . mark ( BUFFER_SIZE ) ; count = super . read ( buffer , 0 , BUFFER_SIZE ) ; }
public class AbstractParamContainerPanel { /** * Shows the panel with the given name . * The previously shown panel ( if any ) is notified that it will be hidden . * @ param panel the panel that will be notified that is now shown , must not be { @ code null } . * @ param name the name of the panel that will be shown , must not be { @ code null } . * @ see AbstractParamPanel # onHide ( ) * @ see AbstractParamPanel # onShow ( ) */ public void showParamPanel ( AbstractParamPanel panel , String name ) { } }
if ( currentShownPanel == panel ) { return ; } // ZAP : Notify previously shown panel that it was hidden if ( currentShownPanel != null ) { currentShownPanel . onHide ( ) ; } nameLastSelectedPanel = name ; currentShownPanel = panel ; TreePath nodePath = new TreePath ( getTreeNodeFromPanelName ( name ) . getPath ( ) ) ; getTreeParam ( ) . setSelectionPath ( nodePath ) ; ensureNodeVisible ( nodePath ) ; getPanelHeadline ( ) ; getTxtHeadline ( ) . setText ( name ) ; getHelpButton ( ) . setVisible ( panel . getHelpIndex ( ) != null ) ; getShowHelpAction ( ) . setHelpIndex ( panel . getHelpIndex ( ) ) ; CardLayout card = ( CardLayout ) getPanelParam ( ) . getLayout ( ) ; card . show ( getPanelParam ( ) , name ) ; // ZAP : Notify the new panel that it is now shown panel . onShow ( ) ;
public class StringUtility { /** * Word wraps a < code > String < / code > to be no longer than the provided number of characters wide . * @ deprecated Use new version with Appendable for higher performance */ @ Deprecated public static String wordWrap ( String string , int width ) { } }
// Leave room for two word wrap characters every width / 2 characters , on average . int inputLength = string . length ( ) ; int estimatedLines = 2 * inputLength / width ; int initialLength = inputLength + estimatedLines * 2 ; try { StringBuilder buffer = new StringBuilder ( initialLength ) ; wordWrap ( string , width , buffer ) ; return buffer . toString ( ) ; } catch ( IOException e ) { throw new AssertionError ( "Should not get IOException from StringBuilder" , e ) ; }
public class FaultTolerantBlockPlacementPolicy { /** * Helper function to choose less occupied racks first . */ private boolean getGoodNode ( HashMap < String , HashSet < Node > > candidateNodesByRacks , boolean considerLoad , long blockSize , List < DatanodeDescriptor > results ) { } }
List < Map . Entry < String , HashSet < Node > > > sorted = new ArrayList < Map . Entry < String , HashSet < Node > > > ( ) ; for ( Map . Entry < String , HashSet < Node > > entry : candidateNodesByRacks . entrySet ( ) ) { sorted . add ( entry ) ; } Collections . sort ( sorted , new RackComparator ( blockSize ) ) ; int count = sorted . size ( ) / 4 ; Collections . shuffle ( sorted . subList ( 0 , count ) ) ; for ( Map . Entry < String , HashSet < Node > > e : sorted ) { if ( getGoodNode ( e . getValue ( ) , considerLoad , blockSize , results ) ) { return true ; } } return false ;
public class SeleniumSpec { /** * Checks if { @ code expectedCount } webelements are found , with a location { @ code method } . * @ param expectedCount * @ param method * @ param element * @ throws IllegalAccessException * @ throws IllegalArgumentException * @ throws SecurityException * @ throws NoSuchFieldException * @ throws ClassNotFoundException */ @ Then ( "^'(\\d+?)' elements? exists? with '([^:]*?):(.+?)'$" ) public void assertSeleniumNElementExists ( Integer expectedCount , String method , String element ) throws ClassNotFoundException , NoSuchFieldException , SecurityException , IllegalArgumentException , IllegalAccessException { } }
List < WebElement > wel = commonspec . locateElement ( method , element , expectedCount ) ; PreviousWebElements pwel = new PreviousWebElements ( wel ) ; commonspec . setPreviousWebElements ( pwel ) ;
public class Utils { /** * Decode a base62 encoded string into a number ( base10 ) . ( More expensive than encoding ) * @ param s the string to decode * @ return the number */ public static long decode ( String s ) { } }
long n = 0 ; for ( int i = 0 , max = s . length ( ) ; i < max ; i ++ ) { n = ( n * 62 ) + encoding . indexOf ( s . charAt ( i ) ) ; } return n ;
public class SheetBindingErrors { /** * 配列やリストなどのインデックス付きのパスを1つ下位に移動します 。 * @ param subPath ネストするパス * @ param index インデックス番号 ( 0から始まります 。 ) * @ throws IllegalArgumentException { @ literal subPath is empty or index < 0} */ public void pushNestedPath ( final String subPath , final int index ) { } }
final String canonicalPath = normalizePath ( subPath ) ; ArgUtils . notEmpty ( subPath , "subPath" ) ; ArgUtils . notMin ( index , - 1 , "index" ) ; pushNestedPath ( String . format ( "%s[%d]" , canonicalPath , index ) ) ;
public class StringUtils { /** * Replaces the char c in the string S , if it ' s the first character in the string . * @ param s The string to search * @ param c The character to replace * @ param replacement The string to replace the character in S * @ return The string with the character replaced ( or the original string if the char is not found ) */ public static String replaceIfFirstChar ( String s , char c , String replacement ) { } }
return s . charAt ( 0 ) == c ? replacement + s . substring ( 1 ) : s ;
public class DssatTFileInput { /** * DSSAT TFile Data input method for Controller using * @ param brMap The holder for BufferReader objects for all files * @ return result data holder object * @ throws java . io . IOException */ @ Override protected HashMap readFile ( HashMap brMap ) throws IOException { } }
HashMap ret = new HashMap ( ) ; ArrayList < HashMap > expArr = new ArrayList < HashMap > ( ) ; HashMap < String , HashMap > files = readObvData ( brMap ) ; // compressData ( file ) ; ArrayList < HashMap > obvData ; HashMap obv ; HashMap expData ; for ( String exname : files . keySet ( ) ) { obvData = ( ArrayList ) files . get ( exname ) . get ( obvDataKey ) ; for ( HashMap obvSub : obvData ) { expData = new HashMap ( ) ; obv = new HashMap ( ) ; copyItem ( expData , files . get ( exname ) , "exname" ) ; copyItem ( expData , files . get ( exname ) , "crid" ) ; copyItem ( expData , files . get ( exname ) , "local_name" ) ; expData . put ( jsonKey , obv ) ; obv . put ( obvFileKey , obvSub . get ( obvDataKey ) ) ; expArr . add ( expData ) ; } } // remove index variables ArrayList idNames = new ArrayList ( ) ; idNames . add ( "trno_t" ) ; removeIndex ( expArr , idNames ) ; ret . put ( "experiments" , expArr ) ; return ret ;
public class PacketParserUtils { /** * Parse the Compression Feature reported from the server . * @ param parser the XML parser , positioned at the start of the compression stanza . * @ return The CompressionFeature stream element * @ throws IOException * @ throws XmlPullParserException if an exception occurs while parsing the stanza . */ public static Compress . Feature parseCompressionFeature ( XmlPullParser parser ) throws IOException , XmlPullParserException { } }
assert ( parser . getEventType ( ) == XmlPullParser . START_TAG ) ; String name ; final int initialDepth = parser . getDepth ( ) ; List < String > methods = new LinkedList < > ( ) ; outerloop : while ( true ) { int eventType = parser . next ( ) ; switch ( eventType ) { case XmlPullParser . START_TAG : name = parser . getName ( ) ; switch ( name ) { case "method" : methods . add ( parser . nextText ( ) ) ; break ; } break ; case XmlPullParser . END_TAG : name = parser . getName ( ) ; switch ( name ) { case Compress . Feature . ELEMENT : if ( parser . getDepth ( ) == initialDepth ) { break outerloop ; } } } } assert ( parser . getEventType ( ) == XmlPullParser . END_TAG ) ; assert ( parser . getDepth ( ) == initialDepth ) ; return new Compress . Feature ( methods ) ;
public class URLClassLoaderHandler { /** * Find the classpath entries for the associated { @ link ClassLoader } . * @ param classLoader * the { @ link ClassLoader } to find the classpath entries order for . * @ param classpathOrder * a { @ link ClasspathOrder } object to update . * @ param scanSpec * the { @ link ScanSpec } . * @ param log * the log . */ public static void findClasspathOrder ( final ClassLoader classLoader , final ClasspathOrder classpathOrder , final ScanSpec scanSpec , final LogNode log ) { } }
final URL [ ] urls = ( ( URLClassLoader ) classLoader ) . getURLs ( ) ; if ( urls != null ) { for ( final URL url : urls ) { if ( url != null ) { classpathOrder . addClasspathEntry ( url . toString ( ) , classLoader , scanSpec , log ) ; } } }
public class AJP13Packet { public void setDataSize ( int s ) { } }
_bytes = s + __HDR_SIZE ; if ( _buf [ 4 ] == __SEND_BODY_CHUNK ) s = s + 1 ; _buf [ 2 ] = ( byte ) ( ( s >> 8 ) & 0xFF ) ; _buf [ 3 ] = ( byte ) ( s & 0xFF ) ; if ( _buf [ 4 ] == __SEND_BODY_CHUNK ) { s = s - 4 ; _buf [ 5 ] = ( byte ) ( ( s >> 8 ) & 0xFF ) ; _buf [ 6 ] = ( byte ) ( s & 0xFF ) ; }
public class DefaultFastFileStorageClient { /** * 生成缩略图 * @ param inputStream * @ param thumbImage * @ return * @ throws IOException */ private ByteArrayInputStream generateThumbImageStream ( InputStream inputStream , ThumbImage thumbImage ) throws IOException { } }
// 根据传入配置生成缩略图 if ( thumbImage . isDefaultConfig ( ) ) { // 在中间修改配置 , 这里不是一个很好的实践 , 如果有时间再进行优化 thumbImage . setDefaultSize ( thumbImageConfig . getWidth ( ) , thumbImageConfig . getHeight ( ) ) ; return generateThumbImageByDefault ( inputStream ) ; } else if ( thumbImage . getPercent ( ) != 0 ) { return generateThumbImageByPercent ( inputStream , thumbImage ) ; } else { return generateThumbImageBySize ( inputStream , thumbImage ) ; }
public class AbstractCLA { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public void setObject ( final Object valueAsObject ) { } }
setParsed ( true ) ; getValues ( ) . add ( ( E ) valueAsObject ) ;
public class CommercePaymentMethodGroupRelUtil { /** * Returns the commerce payment method group rel where groupId = & # 63 ; and engineKey = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param groupId the group ID * @ param engineKey the engine key * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the matching commerce payment method group rel , or < code > null < / code > if a matching commerce payment method group rel could not be found */ public static CommercePaymentMethodGroupRel fetchByG_E ( long groupId , String engineKey , boolean retrieveFromCache ) { } }
return getPersistence ( ) . fetchByG_E ( groupId , engineKey , retrieveFromCache ) ;
public class BaseFMap { /** * = = = = = COLLECTION VIEWS = = = = = */ public ViewFSet < K > keySet ( ) { } }
if ( keyView == null ) { keyView = new LinkedHashViewFSet < > ( inner . keySet ( ) ) ; } return keyView ;
public class AWSWAFRegionalClient { /** * Returns an array of < a > ActivatedRule < / a > objects . * @ param listActivatedRulesInRuleGroupRequest * @ return Result of the ListActivatedRulesInRuleGroup operation returned by the service . * @ throws WAFInternalErrorException * The operation failed because of a system problem , even though the request was valid . Retry your request . * @ throws WAFNonexistentItemException * The operation failed because the referenced object doesn ' t exist . * @ throws WAFInvalidParameterException * The operation failed because AWS WAF didn ' t recognize a parameter in the request . For example : < / p > * < ul > * < li > * You specified an invalid parameter name . * < / li > * < li > * You specified an invalid value . * < / li > * < li > * You tried to update an object ( < code > ByteMatchSet < / code > , < code > IPSet < / code > , < code > Rule < / code > , or * < code > WebACL < / code > ) using an action other than < code > INSERT < / code > or < code > DELETE < / code > . * < / li > * < li > * You tried to create a < code > WebACL < / code > with a < code > DefaultAction < / code > < code > Type < / code > other than * < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > . * < / li > * < li > * You tried to create a < code > RateBasedRule < / code > with a < code > RateKey < / code > value other than * < code > IP < / code > . * < / li > * < li > * You tried to update a < code > WebACL < / code > with a < code > WafAction < / code > < code > Type < / code > other than * < code > ALLOW < / code > , < code > BLOCK < / code > , or < code > COUNT < / code > . * < / li > * < li > * You tried to update a < code > ByteMatchSet < / code > with a < code > FieldToMatch < / code > < code > Type < / code > other * than HEADER , METHOD , QUERY _ STRING , URI , or BODY . * < / li > * < li > * You tried to update a < code > ByteMatchSet < / code > with a < code > Field < / code > of < code > HEADER < / code > but no * value for < code > Data < / code > . * < / li > * < li > * Your request references an ARN that is malformed , or corresponds to a resource with which a web ACL * cannot be associated . * < / li > * @ sample AWSWAFRegional . ListActivatedRulesInRuleGroup * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / waf - regional - 2016-11-28 / ListActivatedRulesInRuleGroup " * target = " _ top " > AWS API Documentation < / a > */ @ Override public ListActivatedRulesInRuleGroupResult listActivatedRulesInRuleGroup ( ListActivatedRulesInRuleGroupRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListActivatedRulesInRuleGroup ( request ) ;
public class HttpRequest { /** * 发送普通表单内容 * @ param out 输出流 * @ throws IOException */ private void writeForm ( OutputStream out ) throws IOException { } }
if ( CollectionUtil . isNotEmpty ( this . form ) ) { StringBuilder builder = StrUtil . builder ( ) ; for ( Entry < String , Object > entry : this . form . entrySet ( ) ) { builder . append ( "--" ) . append ( BOUNDARY ) . append ( StrUtil . CRLF ) ; builder . append ( StrUtil . format ( CONTENT_DISPOSITION_TEMPLATE , entry . getKey ( ) ) ) ; builder . append ( entry . getValue ( ) ) . append ( StrUtil . CRLF ) ; } IoUtil . write ( out , this . charset , false , builder ) ; }
public class HashCalculator { /** * Calculates 3 hashes for the given bytes : * 1 . Hash of the file without new lines and whitespaces * 2 . Hash of the most significant bits of the file without new lines and whitespaces * 3 . Hash of the least significant bits of the file without new lines and whitespaces * @ param bytes to calculate * @ return HashCalculationResult with all three hashes * @ throws IOException exception2 */ public HashCalculationResult calculateSuperHash ( byte [ ] bytes ) throws IOException { } }
HashCalculationResult result = null ; // Remove white spaces byte [ ] bytesWithoutSpaces = stripWhiteSpaces ( bytes ) ; long fileSize = bytesWithoutSpaces . length ; if ( fileSize < FILE_MIN_SIZE_THRESHOLD ) { // Ignore files smaller 1/2 kb logger . debug ( "Ignoring file with size " + FileUtils . byteCountToDisplaySize ( fileSize ) + ": minimum file size is 512B" ) ; } else if ( fileSize <= FILE_PARTIAL_HASH_MIN_SIZE ) { // Don ' t calculate msb and lsb hashes for files smaller than 2kb String fullFileHash = calculateByteArrayHash ( bytesWithoutSpaces , HashAlgorithm . SHA1 ) ; result = new HashCalculationResult ( fullFileHash ) ; } else if ( fileSize <= FILE_SMALL_SIZE ) { // Handle 2kb - > 3kb files result = hashBuckets ( bytesWithoutSpaces , FILE_SMALL_BUCKET_SIZE ) ; } else { int baseLowNumber = 1 ; int digits = ( int ) Math . log10 ( fileSize ) ; int i = 0 ; while ( i < digits ) { baseLowNumber = baseLowNumber * 10 ; i ++ ; } double highNumber = Math . ceil ( ( fileSize + 1 ) / ( float ) baseLowNumber ) * baseLowNumber ; double lowNumber = highNumber - baseLowNumber ; double bucketSize = ( highNumber + lowNumber ) / 4 ; result = hashBuckets ( bytesWithoutSpaces , bucketSize ) ; } return result ;
public class Get { /** * Executes a getter ( < tt > getX ( ) < / tt > ) on the target object which returns String . * If the specified attribute is , for example , " < tt > name < / tt > " , the called method * will be " < tt > getName ( ) < / tt > " . * @ param attributeName the name of the attribute * @ return the result of the method execution */ public static Function < Object , String > attrOfString ( final String attributeName ) { } }
return new Get < Object , String > ( Types . STRING , attributeName ) ;
public class Internal { /** * Returns a set of scanners , one for each bucket if salted , or one scanner * if salting is disabled . * @ see TsdbQuery # getScanner ( ) */ public static List < Scanner > getScanners ( final Query query ) { } }
final List < Scanner > scanners = new ArrayList < Scanner > ( Const . SALT_WIDTH ( ) > 0 ? Const . SALT_BUCKETS ( ) : 1 ) ; if ( Const . SALT_WIDTH ( ) > 0 ) { for ( int i = 0 ; i < Const . SALT_BUCKETS ( ) ; i ++ ) { scanners . add ( ( ( TsdbQuery ) query ) . getScanner ( i ) ) ; } } else { scanners . add ( ( ( TsdbQuery ) query ) . getScanner ( ) ) ; } return scanners ;
public class StringUtil { /** * Converts the specified byte array into a hexadecimal value . */ public static String toHexStringPadded ( byte [ ] src , int offset , int length ) { } }
return toHexStringPadded ( new StringBuilder ( length << 1 ) , src , offset , length ) . toString ( ) ;
public class IntervalTree { /** * / * [ deutsch ] * < p > Liefert eine Liste aller gespeicherten Intervalle , die sich mit dem angegebenen Suchintervall * & uuml ; berschneiden . < / p > * @ param interval the search interval * @ return unmodifiable list of all stored intervals which intersect the search interval , maybe empty */ public List < I > findIntersections ( ChronoInterval < T > interval ) { } }
// trivial case if ( interval . isEmpty ( ) ) { return Collections . emptyList ( ) ; } // make search interval half - open T low = interval . getStart ( ) . getTemporal ( ) ; T high = interval . getEnd ( ) . getTemporal ( ) ; if ( ( low != null ) && interval . getStart ( ) . isOpen ( ) ) { low = this . timeLine . stepForward ( low ) ; } if ( ( high != null ) && interval . getEnd ( ) . isClosed ( ) ) { high = this . timeLine . stepForward ( high ) ; } // collect recursively List < I > found = new ArrayList < > ( ) ; findIntersections ( low , high , this . root , found ) ; return Collections . unmodifiableList ( found ) ;
public class ProgrammaticWrappingProxyInstaller { /** * Wrap a class doc . * @ param source the source * @ return the wrapper . */ public ClassDoc wrap ( ClassDoc source ) { } }
if ( source == null || source instanceof Proxy < ? > || ! ( source instanceof ClassDocImpl ) ) { return source ; } return new ClassDocWrapper ( ( ClassDocImpl ) source ) ;
public class GVRContext { /** * Throws an exception if the current thread is not a GL thread . * @ since 1.6.5 */ public void assertGLThread ( ) { } }
if ( Thread . currentThread ( ) . getId ( ) != mGLThreadID ) { RuntimeException e = new RuntimeException ( "Should not run GL functions from a non-GL thread!" ) ; e . printStackTrace ( ) ; throw e ; }
public class FIMTDDNumericAttributeClassObserver { /** * Recursive method that first checks all of a node ' s children before * deciding if it is ' bad ' and may be removed */ private boolean removeBadSplitNodes ( SplitCriterion criterion , Node currentNode , double lastCheckRatio , double lastCheckSDR , double lastCheckE ) { } }
boolean isBad = false ; if ( currentNode == null ) { return true ; } if ( currentNode . left != null ) { isBad = removeBadSplitNodes ( criterion , currentNode . left , lastCheckRatio , lastCheckSDR , lastCheckE ) ; } if ( currentNode . right != null && isBad ) { isBad = removeBadSplitNodes ( criterion , currentNode . left , lastCheckRatio , lastCheckSDR , lastCheckE ) ; } if ( isBad ) { double [ ] [ ] postSplitDists = new double [ ] [ ] { { currentNode . leftStatistics . getValue ( 0 ) , currentNode . leftStatistics . getValue ( 1 ) , currentNode . leftStatistics . getValue ( 2 ) } , { currentNode . rightStatistics . getValue ( 0 ) , currentNode . rightStatistics . getValue ( 1 ) , currentNode . rightStatistics . getValue ( 2 ) } } ; double [ ] preSplitDist = new double [ ] { ( currentNode . leftStatistics . getValue ( 0 ) + currentNode . rightStatistics . getValue ( 0 ) ) , ( currentNode . leftStatistics . getValue ( 1 ) + currentNode . rightStatistics . getValue ( 1 ) ) , ( currentNode . leftStatistics . getValue ( 2 ) + currentNode . rightStatistics . getValue ( 2 ) ) } ; double merit = criterion . getMeritOfSplit ( preSplitDist , postSplitDists ) ; if ( ( merit / lastCheckSDR ) < ( lastCheckRatio - ( 2 * lastCheckE ) ) ) { currentNode = null ; return true ; } } return false ;