signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SynchronizedCache { /** * 检测缓存长度是否越界 */ private boolean checkOverFlow ( ) { } }
// 检查长度是否越界 if ( config . getMaxHeapSize ( ) > 0 && info . getSize ( ) >= config . getMaxHeapSize ( ) ) { return true ; } // 检查占用空间是否越界 if ( config . getMaxMemorySize ( ) > 0 && info . getMemorySize ( ) >= config . getMaxMemorySize ( ) ) { return true ; } return false ;
public class ApplicationWrapper { /** * < p class = " changed _ added _ 2_0 " > The default behavior of this method * is to call { @ link Application # publishEvent ( javax . faces . context . FacesContext , Class , Object ) } * on the wrapped { @ link Application } object . < / p > */ @ Override public void publishEvent ( FacesContext context , Class < ? extends SystemEvent > systemEventClass , Object source ) { } }
getWrapped ( ) . publishEvent ( context , systemEventClass , source ) ;
public class ApiOvhTelephony { /** * Get all available SIP domains by country * REST : POST / telephony / setDefaultSipDomain * @ param domain [ required ] SIP domain to set * @ param type [ required ] Product type * @ param country [ required ] Country */ public void setDefaultSipDomain_POST ( OvhNumberCountryEnum country , String domain , OvhSipDomainProductTypeEnum type ) throws IOException { } }
String qPath = "/telephony/setDefaultSipDomain" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "country" , country ) ; addBody ( o , "domain" , domain ) ; addBody ( o , "type" , type ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ;
public class Train { /** * Compute log li gradient . * @ param lambda the lambda * @ param gradLogLi the grad log li * @ param numIter the num iter * @ param fout the fout * @ return the double */ public double computeLogLiGradient ( double [ ] lambda , double [ ] gradLogLi , int numIter , PrintWriter fout ) { } }
double logLi = 0.0 ; int ii , i ; // , j , k ; for ( i = 0 ; i < numFeatures ; i ++ ) { gradLogLi [ i ] = - 1 * lambda [ i ] / model . option . sigmaSquare ; logLi -= ( lambda [ i ] * lambda [ i ] ) / ( 2 * model . option . sigmaSquare ) ; } // go through all training data examples / observations for ( ii = 0 ; ii < model . data . trnData . size ( ) ; ii ++ ) { Observation obsr = ( Observation ) model . data . trnData . get ( ii ) ; for ( i = 0 ; i < numLabels ; i ++ ) { temp [ i ] = 0.0 ; } // log - likelihood value of the current data observation double obsrLogLi = 0.0 ; // start to scan all features at the current obsr model . feaGen . startScanFeatures ( obsr ) ; while ( model . feaGen . hasNextFeature ( ) ) { Feature f = model . feaGen . nextFeature ( ) ; if ( f . label == obsr . humanLabel ) { gradLogLi [ f . idx ] += f . val ; obsrLogLi += lambda [ f . idx ] * f . val ; } temp [ f . label ] += lambda [ f . idx ] * f . val ; } double Zx = 0.0 ; for ( i = 0 ; i < numLabels ; i ++ ) { Zx += Math . exp ( temp [ i ] ) ; } model . feaGen . scanReset ( ) ; while ( model . feaGen . hasNextFeature ( ) ) { Feature f = model . feaGen . nextFeature ( ) ; gradLogLi [ f . idx ] -= f . val * Math . exp ( temp [ f . label ] ) / Zx ; } obsrLogLi -= Math . log ( Zx ) ; logLi += obsrLogLi ; } // end of the main loop System . out . println ( ) ; System . out . println ( "Iteration: " + Integer . toString ( numIter ) ) ; System . out . println ( "\tLog-likelihood = " + Double . toString ( logLi ) ) ; double gradLogLiNorm = Train . norm ( gradLogLi ) ; System . out . println ( "\tNorm (log-likelihood gradient) = " + Double . toString ( gradLogLiNorm ) ) ; double lambdaNorm = Train . norm ( lambda ) ; System . out . println ( "\tNorm (lambda) = " + Double . toString ( lambdaNorm ) ) ; if ( model . option . isLogging ) { fout . println ( ) ; fout . println ( "Iteration: " + Integer . toString ( numIter ) ) ; fout . println ( "\tLog-likelihood = " + Double . toString ( logLi ) ) ; fout . println ( "\tNorm (log-likelihood gradient) = " + Double . toString ( gradLogLiNorm ) ) ; fout . println ( "\tNorm (lambda) = " + Double . toString ( lambdaNorm ) ) ; } return logLi ;
public class GetInstance { /** * This method exists for compatibility with JCE only . It will be removed * once JCE has been changed to use the replacement method . * @ deprecated use getServices ( List < ServiceId > ) instead */ @ Deprecated public static List < Service > getServices ( String type , List < String > algorithms ) { } }
ProviderList list = Providers . getProviderList ( ) ; return list . getServices ( type , algorithms ) ;
public class DefaultCollectionService { /** * ~ Methods * * * * * */ @ Override public void submitMetric ( PrincipalUser submitter , Metric metric ) { } }
submitMetrics ( submitter , Arrays . asList ( new Metric [ ] { metric } ) ) ;
public class Util { /** * Generate a pattern for obtaining the strict superclasses of a concept . * Uses BIND which Requires SPARQL 1.1 * @ param origin the URL of the class we want to find superclasses for * @ param matchVariable the model reference variable * @ param bindingVar the name of the variable we will bind results to for * ulterior inspection * @ param includeUrisBound * @ return the query pattern */ public static String generateMatchStrictSuperclassesPattern ( URI origin , String matchVariable , String bindingVar , boolean includeUrisBound ) { } }
StringBuffer query = new StringBuffer ( ) ; query . append ( Util . generateSuperclassPattern ( origin , matchVariable ) + NL ) ; query . append ( "FILTER NOT EXISTS { " + Util . generateSubclassPattern ( origin , matchVariable ) + "}" + NL ) ; // Bind a variable for inspection query . append ( "BIND (true as ?" + bindingVar + ") ." + NL ) ; // Include origin and destination in the returned bindings if requested if ( includeUrisBound ) { query . append ( "BIND (" ) . append ( sparqlWrapUri ( origin ) ) . append ( " as ?origin) ." ) . append ( NL ) ; query . append ( "BIND (?" ) . append ( matchVariable ) . append ( " as ?destination) ." ) . append ( NL ) ; // FIXME } return query . toString ( ) ;
public class ServletAddHeaderTask { /** * { @ inheritDoc } */ public void perform ( TaskRequest req , TaskResponse res ) { } }
HttpServletResponse sres = ( HttpServletResponse ) response . evaluate ( req , res ) ; String headerName = ( String ) header_name . evaluate ( req , res ) ; String headerValue = ( String ) header_value . evaluate ( req , res ) ; // Send the header sres . addHeader ( headerName , headerValue ) ;
public class SensorIoHandler { /** * Passes the Throwable to the IOAdapter . */ @ Override public void exceptionCaught ( IoSession session , Throwable cause ) throws Exception { } }
log . error ( "Unhandled exception caught in session {}: {}" , session , cause ) ; this . sensorIoAdapter . exceptionCaught ( session , cause ) ;
public class StringColumn { /** * Add all the strings in the list to this column * @ param stringValues a list of values */ public StringColumn addAll ( List < String > stringValues ) { } }
for ( String stringValue : stringValues ) { append ( stringValue ) ; } return this ;
public class AbstractFXMLApplication { /** * { @ inheritDoc } * @ return { @ inheritDoc } * @ throws CouldNotPerformException { @ inheritDoc } */ @ Override protected Scene loadScene ( ) throws CouldNotPerformException { } }
try { // setup scene Scene scene ; try { scene = new Scene ( FXMLProcessor . loadFxmlPane ( FXMLProcessor . loadDefaultFXML ( controllerClass ) , getClass ( ) ) ) ; } catch ( final Exception ex ) { throw new CouldNotPerformException ( "Could not load fxml description!" , ex ) ; } try { scene . getStylesheets ( ) . add ( getDefaultCSS ( ) ) ; } catch ( final Exception ex ) { throw new CouldNotPerformException ( "Could not load css description!" , ex ) ; } return scene ; } catch ( final CouldNotPerformException ex ) { throw new CouldNotPerformException ( "Could not load scene!" , ex ) ; }
public class AbstractManagedType { /** * Check for valid . * @ param paramName * the param name * @ param attribute * the attribute */ private void checkForValid ( String paramName , Attribute < ? super X , ? > attribute ) { } }
if ( attribute == null ) { throw new IllegalArgumentException ( "attribute of the given name and type is not present in the managed type, for name:" + paramName ) ; }
public class DeepLearningTask2 { /** * Finish up the work after all nodes have reduced their models via the above reduce ( ) method . * All we do is average the models and add to the global training sample counter . * After this returns , model _ info ( ) can be queried for the updated model . */ @ Override protected void postGlobal ( ) { } }
assert ( _res . model_info ( ) . get_params ( ) . _replicate_training_data ) ; super . postGlobal ( ) ; // model averaging ( DeepLearningTask only computed the per - node models , each on all the data ) _res . model_info ( ) . div ( _res . _chunk_node_count ) ; _res . model_info ( ) . add_processed_global ( _res . model_info ( ) . get_processed_local ( ) ) ; // switch from local counters to global counters _res . model_info ( ) . set_processed_local ( 0l ) ; DeepLearningModelInfo nodeAverageModel = _res . model_info ( ) ; if ( nodeAverageModel . get_params ( ) . _elastic_averaging ) _sharedmodel = DeepLearningModelInfo . timeAverage ( nodeAverageModel ) ; else _sharedmodel = nodeAverageModel ;
public class MaxCore { /** * Run all the tests contained in < code > request < / code > . * This variant should be used if { @ code core } has attached listeners that this * run should notify . * @ param request the request describing tests * @ param core a JUnitCore to delegate to . * @ return a { @ link Result } describing the details of the test run and the failed tests . */ public Result run ( Request request , JUnitCore core ) { } }
core . addListener ( history . listener ( ) ) ; return core . run ( sortRequest ( request ) . getRunner ( ) ) ;
public class ArrayUtil { /** * Mean double . * @ param op the op * @ return the double */ public static double mean ( @ javax . annotation . Nonnull final double [ ] op ) { } }
return com . simiacryptus . util . ArrayUtil . sum ( op ) / op . length ;
public class RegisteredServiceJwtTicketCipherExecutor { /** * Gets signing key . * @ param registeredService the registered service * @ return the signing key */ public Optional < String > getSigningKey ( final RegisteredService registeredService ) { } }
val property = getSigningKeyRegisteredServiceProperty ( ) ; if ( property . isAssignedTo ( registeredService ) ) { val signingKey = property . getPropertyValue ( registeredService ) . getValue ( ) ; return Optional . of ( signingKey ) ; } return Optional . empty ( ) ;
public class GCPARCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setYCENT ( Integer newYCENT ) { } }
Integer oldYCENT = ycent ; ycent = newYCENT ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . GCPARC__YCENT , oldYCENT , ycent ) ) ;
public class S3RequestEndpointResolver { /** * Converts the current endpoint set for this client into virtual addressing style , by placing * the name of the specified bucket before the S3 service endpoint . * @ param bucketName The name of the bucket to use in the virtual addressing style of the returned URI . * @ return A new URI , creating from the current service endpoint URI and the specified bucket . */ private static URI convertToVirtualHostEndpoint ( URI endpoint , String bucketName ) { } }
try { return new URI ( String . format ( "%s://%s.%s" , endpoint . getScheme ( ) , bucketName , endpoint . getAuthority ( ) ) ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Invalid bucket name: " + bucketName , e ) ; }
public class RequestQueue { /** * Create network dispatchers ( and corresponding threads ) up to the pool size . */ private void setUpNetworkDispatchers ( ) { } }
if ( networkDispatcherFactory == null ) { networkDispatcherFactory = new NetworkDispatcher . NetworkDispatcherFactory ( networkQueue , network , cache , delivery ) ; } for ( int i = 0 ; i < networkDispatchers . length ; i ++ ) { networkDispatchers [ i ] = networkDispatcherFactory . create ( ) ; networkDispatchers [ i ] . start ( ) ; addMarker ( EVENT_NETWORK_DISPATCHER_START , networkDispatchers [ i ] ) ; }
public class MechanizeAgent { /** * / * ( non - Javadoc ) * @ see com . gistlabs . mechanize . Mechanize # post ( java . lang . String , java . util . Map ) */ @ Override public < T extends Resource > T post ( final String uri , final Map < String , String > params ) throws UnsupportedEncodingException { } }
return post ( uri , new Parameters ( unsafeCast ( params ) ) ) ;
public class YearResultsPartitioner { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . resultspartitioner . ResultsPartitioner # rangeToTitle ( java . util . Calendar , java . util . Calendar ) */ protected String rangeToTitle ( Calendar start , Calendar end , WaybackRequest wbRequest ) { } }
return wbRequest . getFormatter ( ) . format ( "ResultPartitions.year" , start . getTime ( ) ) ;
public class LogTemplates { /** * Produces a concrete log template which logs messages into a SLF4J Logger . * @ param loggerName Logger name * @ param levelName Level name ( info , debug , warn , etc . ) * @ param markerName Marker name * @ return Logger */ public static < C > SLF4JLogTemplate < C > toSLF4J ( String loggerName , String levelName , String markerName ) { } }
if ( "debug" . equalsIgnoreCase ( levelName ) ) { return new SLF4JLogTemplate . Debug < > ( loggerName , markerName ) ; } else if ( "info" . equalsIgnoreCase ( levelName ) ) { return new SLF4JLogTemplate . Info < > ( loggerName , markerName ) ; } else if ( "warn" . equalsIgnoreCase ( levelName ) ) { return new SLF4JLogTemplate . Warn < > ( loggerName , markerName ) ; } else { throw new IllegalArgumentException ( "Invalid level name " + levelName ) ; }
public class ExpressionUtil { /** * Return true / false whether an expression contains any aggregate expression * @ param expr * @ return true is expression contains an aggregate subexpression */ public static boolean containsAggregateExpression ( AbstractExpression expr ) { } }
AbstractExpression . SubexprFinderPredicate pred = new AbstractExpression . SubexprFinderPredicate ( ) { @ Override public boolean matches ( AbstractExpression expr ) { return expr . getExpressionType ( ) . isAggregateExpression ( ) ; } } ; return expr . hasAnySubexpressionWithPredicate ( pred ) ;
public class NumbersConverter { /** * Convert a string to a number of given type . If given string can ' t be stored into required type silent rounding is * applied . If given string is empty return 0 since it is considered as an optional numeric input . * @ throws BugError if value type is not supported . */ @ Override public < T > T asObject ( String string , Class < T > valueType ) throws BugError { } }
if ( "null" . equals ( string ) ) { return null ; } Number number = string . isEmpty ( ) ? 0 : parseNumber ( string ) ; // hopefully int and double are most used numeric types and test them first if ( Types . equalsAny ( valueType , int . class , Integer . class ) ) { return ( T ) ( Integer ) number . intValue ( ) ; } if ( Types . equalsAny ( valueType , double . class , Double . class ) ) { return ( T ) ( Double ) number . doubleValue ( ) ; } if ( Types . equalsAny ( valueType , byte . class , Byte . class ) ) { return ( T ) ( Byte ) number . byteValue ( ) ; } if ( Types . equalsAny ( valueType , short . class , Short . class ) ) { return ( T ) ( Short ) number . shortValue ( ) ; } if ( Types . equalsAny ( valueType , long . class , Long . class ) ) { // because converting between doubles and longs may result in loss of precision we need // special treatment for longs . @ see ConverterUnitTest . testConversionPrecision if ( string . length ( ) > 0 && string . indexOf ( '.' ) == - 1 ) { // handle hexadecimal notation if ( string . length ( ) > 1 && string . charAt ( 0 ) == '0' && string . charAt ( 1 ) == 'x' ) { return ( T ) ( Long ) Long . parseLong ( string . substring ( 2 ) , 16 ) ; } return ( T ) ( Long ) Long . parseLong ( string ) ; } return ( T ) ( Long ) number . longValue ( ) ; } if ( Types . equalsAny ( valueType , float . class , Float . class ) ) { return ( T ) ( Float ) number . floatValue ( ) ; } // if ( Classes . equalsAny ( t , BigInteger . class ) { // return ( T ) new BigInteger ( number . doubleValue ( ) ) ; if ( Types . equalsAny ( valueType , BigDecimal . class ) ) { return ( T ) new BigDecimal ( number . doubleValue ( ) ) ; } throw new BugError ( "Unsupported numeric value |%s|." , valueType ) ;
public class CatalogMap { /** * Create a new instance of a CatalogType as a child of this map with a * given name . Note : this just makes a catalog command and calls * catalog . execute ( . . ) . * @ param name The name of the new instance to create , the thing to add * @ return The newly created CatalogType instance */ public T add ( String name ) { } }
try { if ( m_items == null ) { m_items = new TreeMap < String , T > ( ) ; } String mapKey = name . toUpperCase ( ) ; if ( m_items . containsKey ( mapKey ) ) { throw new CatalogException ( "Catalog item '" + mapKey + "' already exists for " + m_parent ) ; } T x = m_cls . newInstance ( ) ; x . setBaseValues ( this , name ) ; x . initChildMaps ( ) ; m_items . put ( mapKey , x ) ; if ( m_hasComputedOrder ) { recomputeRelativeIndexes ( ) ; } return x ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; }
public class ConfigurationModule { /** * Gets a combined configuration list with the default added last so that * { @ code filePaths } will override { @ code defaultFilePath } . */ private List < ConfigurationHelper . ConfigurationInfo < String > > getFilePathConfigurationListWithDefault ( @ Nullable List < String > filePaths , String defaultFilePath ) { } }
List < ConfigurationHelper . ConfigurationInfo < String > > defaultConfigList = ConfigurationHelper . newList ( true , defaultFilePath ) ; List < ConfigurationHelper . ConfigurationInfo < String > > filePathConfigList = ConfigurationHelper . newList ( filePaths , true ) ; if ( defaultConfigList != null ) { if ( filePathConfigList == null ) { filePathConfigList = defaultConfigList ; } else { filePathConfigList . addAll ( defaultConfigList ) ; } } return filePathConfigList ;
public class ExceptionUtils { /** * < p > stackTrace . < / p > * @ param t a { @ link java . lang . Throwable } object . * @ param separator a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String stackTrace ( Throwable t , String separator ) { } }
return stackTrace ( t , separator , FULL ) ;
public class JSParser { /** * Variant : : = " { " TypeDecl ( " | " TypeDecl ) * " } " */ final public JSVariant Variant ( Map refs ) throws ParseException { } }
JSVariant ans = new JSVariant ( ) ; JSType mem ; jj_consume_token ( 5 ) ; mem = TypeDecl ( refs ) ; ans . addCase ( mem ) ; label_2 : while ( true ) { switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 6 : ; break ; default : jj_la1 [ 3 ] = jj_gen ; break label_2 ; } jj_consume_token ( 6 ) ; mem = TypeDecl ( refs ) ; ans . addCase ( mem ) ; } jj_consume_token ( 7 ) ; { if ( true ) return ans ; } throw new Error ( "Missing return statement in function" ) ;
public class CustomizedScalingMetricSpecification { /** * The dimensions of the metric . * Conditional : If you published your metric with dimensions , you must specify the same dimensions in your * customized scaling metric specification . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDimensions ( java . util . Collection ) } or { @ link # withDimensions ( java . util . Collection ) } if you want to * override the existing values . * @ param dimensions * The dimensions of the metric . < / p > * Conditional : If you published your metric with dimensions , you must specify the same dimensions in your * customized scaling metric specification . * @ return Returns a reference to this object so that method calls can be chained together . */ public CustomizedScalingMetricSpecification withDimensions ( MetricDimension ... dimensions ) { } }
if ( this . dimensions == null ) { setDimensions ( new java . util . ArrayList < MetricDimension > ( dimensions . length ) ) ; } for ( MetricDimension ele : dimensions ) { this . dimensions . add ( ele ) ; } return this ;
public class RoutesInner { /** * Gets all routes in a route table . * @ param resourceGroupName The name of the resource group . * @ param routeTableName The name of the route table . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; RouteInner & gt ; object */ public Observable < Page < RouteInner > > listAsync ( final String resourceGroupName , final String routeTableName ) { } }
return listWithServiceResponseAsync ( resourceGroupName , routeTableName ) . map ( new Func1 < ServiceResponse < Page < RouteInner > > , Page < RouteInner > > ( ) { @ Override public Page < RouteInner > call ( ServiceResponse < Page < RouteInner > > response ) { return response . body ( ) ; } } ) ;
public class MinimumEnlargementInsert { /** * Chooses the best path of the specified subtree for insertion of the given * object . * @ param tree the tree to insert into * @ param object the entry to search * @ param subtree the subtree to be tested for insertion * @ return the path of the appropriate subtree to insert the given object */ private IndexTreePath < E > choosePath ( AbstractMTree < ? , N , E , ? > tree , E object , IndexTreePath < E > subtree ) { } }
N node = tree . getNode ( subtree . getEntry ( ) ) ; // leaf if ( node . isLeaf ( ) ) { return subtree ; } // Initialize from first : int bestIdx = 0 ; E bestEntry = node . getEntry ( 0 ) ; double bestDistance = tree . distance ( object . getRoutingObjectID ( ) , bestEntry . getRoutingObjectID ( ) ) ; // Iterate over remaining for ( int i = 1 ; i < node . getNumEntries ( ) ; i ++ ) { E entry = node . getEntry ( i ) ; double distance = tree . distance ( object . getRoutingObjectID ( ) , entry . getRoutingObjectID ( ) ) ; if ( distance < bestDistance ) { bestIdx = i ; bestEntry = entry ; bestDistance = distance ; } } return choosePath ( tree , object , new IndexTreePath < > ( subtree , bestEntry , bestIdx ) ) ;
public class PersonGenerator { /** * Will generate the given number of random people * @ param num the number of people to generate * @ return a list of the generated people */ public List < Person > nextPeople ( int num ) { } }
List < Person > names = new ArrayList < Person > ( num ) ; for ( int i = 0 ; i < num ; i ++ ) { names . add ( nextPerson ( ) ) ; } return names ;
public class ProjectApi { /** * Updates a push rule for the specified project . * < pre > < code > PUT / projects / : id / push _ rule / : push _ rule _ id < / code > < / pre > * The following properties on the PushRules instance are utilized when updating the push rule : * < code > * denyDeleteTag ( optional ) - Deny deleting a tag * memberCheck ( optional ) - Restrict commits by author ( email ) to existing GitLab users * preventSecrets ( optional ) - GitLab will reject any files that are likely to contain secrets * commitMessageRegex ( optional ) - All commit messages must match this , e . g . Fixed \ d + \ . . * * branchNameRegex ( optional ) - All branch names must match this , e . g . ` ( feature * authorEmailRegex ( optional ) - All commit author emails must match this , e . g . @ my - company . com $ * fileNameRegex ( optional ) - All committed filenames must not match this , e . g . ` ( jar * maxFileSize ( optional ) - Maximum file size ( MB * < / code > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required * @ param pushRule the PushRules instance containing the push rule configuration to update * @ return a PushRules instance with the newly created push rule info * @ throws GitLabApiException if any exception occurs */ public PushRules updatePushRules ( Object projectIdOrPath , PushRules pushRule ) throws GitLabApiException { } }
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "deny_delete_tag" , pushRule . getDenyDeleteTag ( ) ) . withParam ( "member_check" , pushRule . getMemberCheck ( ) ) . withParam ( "prevent_secrets" , pushRule . getPreventSecrets ( ) ) . withParam ( "commit_message_regex" , pushRule . getCommitMessageRegex ( ) ) . withParam ( "branch_name_regex" , pushRule . getBranchNameRegex ( ) ) . withParam ( "author_email_regex" , pushRule . getAuthorEmailRegex ( ) ) . withParam ( "file_name_regex" , pushRule . getFileNameRegex ( ) ) . withParam ( "max_file_size" , pushRule . getMaxFileSize ( ) ) ; final Response response = putWithFormData ( Response . Status . OK , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "push_rule" ) ; return ( response . readEntity ( PushRules . class ) ) ;
public class DiGraphIterator { /** * Creates a stream . * @ param < T > * @ param root * @ param edges * @ return */ public static < T > Stream < T > stream ( T root , Function < ? super T , ? extends Stream < T > > edges ) { } }
return StreamSupport . stream ( spliterator ( root , edges ) , false ) ;
public class BProgram { /** * Blocks until an external event is added . Then , if that event is not the * " stop daemon mode " one , returns the event . Otherwise , returns * { @ code null } . * @ return The event , or { @ code null } in case the daemon mode is turned off * during the wait . * @ throws InterruptedException ( blocking call , we have to do this ) */ public BEvent takeExternalEvent ( ) throws InterruptedException { } }
BEvent next = recentlyEnqueuedExternalEvents . take ( ) ; if ( next == NO_MORE_WAIT_EXTERNAL ) { waitForExternalEvents = false ; return null ; } else { return next ; }
public class Controller { /** * TODO not correctly formulated doc */ protected < T > T parseBody ( Class < T > clazz ) throws ParsableException , MediaTypeException { } }
String contentType = context . requestContentType ( ) ; // if the content type header was not provided , we throw if ( contentType == null || contentType . isEmpty ( ) ) { throw new MediaTypeException ( "Missing media type header" ) ; } // extract the actual content type in case charset is also a part of the string contentType = HttpHeaderUtil . getContentTypeFromContentTypeAndCharacterSetting ( contentType ) ; ParserEngine engine = injector . getInstance ( ParserEngineManager . class ) . getParserEngineForContentType ( contentType ) ; if ( engine == null ) { throw new MediaTypeException ( "An engine for media type (" + contentType + ") was not found" ) ; } try { return engine . invoke ( context . requestInputStream ( ) , clazz ) ; } catch ( IOException e ) { throw new ParsableException ( e ) ; }
public class SPUIComponentProvider { /** * Layout of tabs in detail tabsheet . * @ return VerticalLayout */ public static VerticalLayout getDetailTabLayout ( ) { } }
final VerticalLayout layout = new VerticalLayout ( ) ; layout . setSpacing ( true ) ; layout . setMargin ( true ) ; layout . setImmediate ( true ) ; return layout ;
public class SourceToHTMLConverter { /** * Add a line from source to the HTML file that is generated . * @ param pre the content tree to which the line will be added . * @ param line the string to format . * @ param currentLineNo the current number . */ private void addLine ( Content pre , String line , int currentLineNo ) { } }
if ( line != null ) { Content anchor = HtmlTree . A ( configuration . htmlVersion , "line." + Integer . toString ( currentLineNo ) , new StringContent ( utils . replaceTabs ( line ) ) ) ; pre . addContent ( anchor ) ; pre . addContent ( NEW_LINE ) ; }
public class HttpRequest { public Principal getUserPrincipal ( ) { } }
if ( _userPrincipal == __NO_USER ) return null ; if ( _userPrincipal == __NOT_CHECKED ) { _userPrincipal = __NO_USER ; // Try a lazy authentication HttpContext context = getHttpResponse ( ) . getHttpContext ( ) ; if ( context != null ) { Authenticator auth = context . getAuthenticator ( ) ; UserRealm realm = context . getRealm ( ) ; if ( realm != null && auth != null ) { try { // TODO - should not need to recalculate this ! String pathInContext = getPath ( ) . substring ( context . getContextPath ( ) . length ( ) ) ; auth . authenticate ( realm , pathInContext , this , null ) ; } catch ( Exception e ) { LogSupport . ignore ( log , e ) ; } } } if ( _userPrincipal == __NO_USER ) return null ; } return _userPrincipal ;
public class XsdEmitter { /** * If simple type has conditions attached to it , emit enumeration facets . * @ param xsdDataItem COBOL data item decorated with XSD attributes * @ param restriction the current set of constraints */ protected void addEnumerationFacets ( final XsdDataItem xsdDataItem , final XmlSchemaSimpleTypeRestriction restriction ) { } }
if ( getConfig ( ) . mapConditionsToFacets ( ) ) { boolean hasValueThru = false ; for ( XsdDataItem child : xsdDataItem . getChildren ( ) ) { if ( child . getDataEntryType ( ) == DataEntryType . CONDITION ) { for ( String conditionValue : child . getConditionLiterals ( ) ) { restriction . getFacets ( ) . add ( createEnumerationFacet ( ValueUtil . resolveFigurative ( conditionValue , xsdDataItem . getMaxStorageLength ( ) , getConfig ( ) . quoteIsQuote ( ) ) ) ) ; } for ( Range conditionRange : child . getConditionRanges ( ) ) { if ( hasValueThru ) { _log . warn ( xsdDataItem . getCobolName ( ) + " has several VALUE THRU statements." + " Cannot translate to XSD." + " Only the first one will be converted." + " Ignoring: " + conditionRange . toString ( ) ) ; break ; } restriction . getFacets ( ) . add ( createMinInclusiveFacet ( ValueUtil . resolveFigurative ( conditionRange . getFrom ( ) , xsdDataItem . getMaxStorageLength ( ) , getConfig ( ) . quoteIsQuote ( ) ) ) ) ; restriction . getFacets ( ) . add ( createMaxInclusiveFacet ( ValueUtil . resolveFigurative ( conditionRange . getTo ( ) , xsdDataItem . getMaxStorageLength ( ) , getConfig ( ) . quoteIsQuote ( ) ) ) ) ; hasValueThru = true ; } } } }
public class CmsXmlContentEditor { /** * Writes the xml content to the vfs and re - initializes the member variables . < p > * @ throws CmsException if writing the file fails */ private void writeContent ( ) throws CmsException { } }
String decodedContent = m_content . toString ( ) ; try { m_file . setContents ( decodedContent . getBytes ( getFileEncoding ( ) ) ) ; } catch ( UnsupportedEncodingException e ) { throw new CmsException ( Messages . get ( ) . container ( Messages . ERR_INVALID_CONTENT_ENC_1 , getParamResource ( ) ) , e ) ; } // the file content might have been modified during the write operation CmsObject cloneCms = getCloneCms ( ) ; CmsUUID tempProjectId = OpenCms . getWorkplaceManager ( ) . getTempFileProjectId ( ) ; cloneCms . getRequestContext ( ) . setCurrentProject ( getCms ( ) . readProject ( tempProjectId ) ) ; m_file = cloneCms . writeFile ( m_file ) ; m_content = CmsXmlContentFactory . unmarshal ( cloneCms , m_file ) ;
public class SystemInputJsonWriter { /** * Writes the given system test definition the form of a JSON document . */ public void write ( SystemInputDef systemInput ) { } }
JsonWriterFactory writerFactory = Json . createWriterFactory ( MapBuilder . of ( PRETTY_PRINTING , true ) . build ( ) ) ; JsonWriter jsonWriter = writerFactory . createWriter ( getWriter ( ) ) ; jsonWriter . write ( SystemInputJson . toJson ( systemInput ) ) ;
public class RoundedMoney { /** * ( non - Javadoc ) * @ see MonetaryAmount # multiply ( Number ) */ @ Override public RoundedMoney multiply ( Number multiplicand ) { } }
BigDecimal bd = MoneyUtils . getBigDecimal ( multiplicand ) ; if ( isOne ( bd ) ) { return this ; } MathContext mc = monetaryContext . get ( MathContext . class ) ; if ( mc == null ) { mc = MathContext . DECIMAL64 ; } BigDecimal dec = number . multiply ( bd , mc ) ; return new RoundedMoney ( dec , currency , rounding ) . with ( rounding ) ;
public class PHPDriverHelper { /** * < p > Getter for the field < code > phpExec < / code > . < / p > * @ param exec a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . * @ throws java . io . IOException if any . */ public String getPhpExec ( String exec ) throws IOException { } }
if ( phpExec != null ) { return phpExec ; } initPhpExec ( exec ) ; return phpExec ;
public class NetworkWatchersInner { /** * Initiate troubleshooting on a specified resource . * @ param resourceGroupName The name of the resource group . * @ param networkWatcherName The name of the network watcher resource . * @ param parameters Parameters that define the resource to troubleshoot . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < ServiceResponse < TroubleshootingResultInner > > getTroubleshootingWithServiceResponseAsync ( String resourceGroupName , String networkWatcherName , TroubleshootingParameters parameters ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( networkWatcherName == null ) { throw new IllegalArgumentException ( "Parameter networkWatcherName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } Validator . validate ( parameters ) ; final String apiVersion = "2018-06-01" ; Observable < Response < ResponseBody > > observable = service . getTroubleshooting ( resourceGroupName , networkWatcherName , this . client . subscriptionId ( ) , parameters , apiVersion , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) ; return client . getAzureClient ( ) . getPostOrDeleteResultAsync ( observable , new TypeToken < TroubleshootingResultInner > ( ) { } . getType ( ) ) ;
public class QueryUpdateOnSubscribe { /** * Cancels a running PreparedStatement , closing it and the current * Connection but only if auto commit mode . */ private void close ( State state ) { } }
// ensure close happens once only to avoid race conditions if ( state . closed . compareAndSet ( false , true ) ) { Util . closeQuietly ( state . ps ) ; if ( isCommit ( ) || isRollback ( ) ) Util . closeQuietly ( state . con ) ; else Util . closeQuietlyIfAutoCommit ( state . con ) ; }
public class DCacheBase { /** * Increase cache size in bytes to the total count * @ param size * The size to be increased */ public void increaseCacheSizeInBytes ( long size , String msg ) { } }
if ( this . memoryCacheSizeInMBEnabled ) { this . currentMemoryCacheSizeInBytes += size ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "increaseCacheSizeInBytes() cacheName=" + cacheName + " " + msg + " size=" + size + " currentMemoryCacheSizeInBytes=" + this . currentMemoryCacheSizeInBytes ) ; } }
public class PasswordUtils { public static final String replacePossiblePassword ( boolean password , Object o ) { } }
if ( password ) return replaceNonNullObject ( o ) ; else if ( o == null ) return null ; else return o . toString ( ) ;
public class ESTemplate { /** * 根据解析出的语法结构确定sql语句是否是velocity模板 * 如果不是则重置sqlinfo的istpl属性 , 相关的缓存就可以使用sqlname来作为key * 同时避免每次都对token进行拼接 , 提升系统性能 */ private void rechecksqlistpl ( ) { } }
if ( data != null ) { Node [ ] childrens = ( ( SimpleNode ) data ) . getChildren ( ) ; if ( childrens != null && childrens . length > 0 ) { boolean switchcase = true ; for ( Node node : childrens ) { if ( ! ( node instanceof ASTText ) ) { switchcase = false ; break ; } } if ( switchcase ) { this . esInfo . setTpl ( false ) ; } else { this . esInfo . setTpl ( true ) ; } } }
public class GHRequest { /** * For possible values see AlgorithmOptions . * */ public GHRequest setAlgorithm ( String algo ) { } }
if ( algo != null ) this . algo = Helper . camelCaseToUnderScore ( algo ) ; return this ;
public class PostOffice { /** * Create a new EditText Dialog ' Mail ' Delivery to display * - This creates a dialog with 2 buttons and an EditText field for * the content and retrieves text input from your user * @ param ctx the application context * @ param title the dialog title * @ param hint the EditText hint text * @ param inputType the EditText input type * @ param listener the text acceptance listener * @ return the new delivery */ public static Delivery newEditTextMail ( @ NotNull Context ctx , CharSequence title , CharSequence hint , int inputType , EditTextStyle . OnTextAcceptedListener listener ) { } }
// Create the delivery Delivery . Builder builder = newMail ( ctx ) . setTitle ( title ) . setStyle ( new EditTextStyle . Builder ( ctx ) . setHint ( hint ) . setInputType ( inputType ) . setOnTextAcceptedListener ( listener ) . build ( ) ) ; // Return the delivery return builder . build ( ) ;
public class LayoutUtils { /** * Moves the elements contained in " band " in the Y axis " yOffset " * @ param yOffset * @ param band */ public static void moveBandsElemnts ( int yOffset , JRDesignBand band ) { } }
if ( band == null ) return ; for ( JRChild jrChild : band . getChildren ( ) ) { JRDesignElement elem = ( JRDesignElement ) jrChild ; elem . setY ( elem . getY ( ) + yOffset ) ; }
public class Flowable { /** * Returns a Flowable that correlates two Publishers when they overlap in time and groups the results . * There are no guarantees in what order the items get combined when multiple * items from one or both source Publishers overlap . * < img width = " 640 " height = " 380 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / groupJoin . png " alt = " " > * < dl > * < dt > < b > Backpressure : < / b > < / dt > * < dd > The operator doesn ' t support backpressure and consumes all participating { @ code Publisher } s in * an unbounded mode ( i . e . , not applying any backpressure to them ) . < / dd > * < dt > < b > Scheduler : < / b > < / dt > * < dd > { @ code groupJoin } does not operate by default on a particular { @ link Scheduler } . < / dd > * < / dl > * @ param < TRight > the value type of the right Publisher source * @ param < TLeftEnd > the element type of the left duration Publishers * @ param < TRightEnd > the element type of the right duration Publishers * @ param < R > the result type * @ param other * the other Publisher to correlate items from the source Publisher with * @ param leftEnd * a function that returns a Publisher whose emissions indicate the duration of the values of * the source Publisher * @ param rightEnd * a function that returns a Publisher whose emissions indicate the duration of the values of * the { @ code right } Publisher * @ param resultSelector * a function that takes an item emitted by each Publisher and returns the value to be emitted * by the resulting Publisher * @ return a Flowable that emits items based on combining those items emitted by the source Publishers * whose durations overlap * @ see < a href = " http : / / reactivex . io / documentation / operators / join . html " > ReactiveX operators documentation : Join < / a > */ @ CheckReturnValue @ BackpressureSupport ( BackpressureKind . ERROR ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < TRight , TLeftEnd , TRightEnd , R > Flowable < R > groupJoin ( Publisher < ? extends TRight > other , Function < ? super T , ? extends Publisher < TLeftEnd > > leftEnd , Function < ? super TRight , ? extends Publisher < TRightEnd > > rightEnd , BiFunction < ? super T , ? super Flowable < TRight > , ? extends R > resultSelector ) { } }
ObjectHelper . requireNonNull ( other , "other is null" ) ; ObjectHelper . requireNonNull ( leftEnd , "leftEnd is null" ) ; ObjectHelper . requireNonNull ( rightEnd , "rightEnd is null" ) ; ObjectHelper . requireNonNull ( resultSelector , "resultSelector is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableGroupJoin < T , TRight , TLeftEnd , TRightEnd , R > ( this , other , leftEnd , rightEnd , resultSelector ) ) ;
public class TargetsApi { /** * Get recently used targets * Get recently used targets for the current agent . * @ param limit The number of results to return . The default value is 50 . ( optional ) * @ return TargetsResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public TargetsResponse getRecentTargets ( BigDecimal limit ) throws ApiException { } }
ApiResponse < TargetsResponse > resp = getRecentTargetsWithHttpInfo ( limit ) ; return resp . getData ( ) ;
public class CharBuffer { /** * clear the content of the buffer */ public void clear ( ) { } }
if ( size ( ) == 0 ) return ; buffer = new char [ buffer . length ] ; root . next = null ; pos = 0 ; length = 0 ; curr = root ;
public class Viterbi { /** * Divide . * @ param cols the cols * @ param val the val */ public void divide ( PairDblInt [ ] cols , double val ) { } }
for ( int i = 0 ; i < numLabels ; i ++ ) { cols [ i ] . first /= val ; }
public class SnackBar { /** * Set the text that the ActionButton is to display . * @ param id If 0 , then the ActionButton will be hidden . * @ return This SnackBar for chaining methods . */ public SnackBar actionText ( int id ) { } }
if ( id == 0 ) return actionText ( null ) ; return actionText ( getContext ( ) . getResources ( ) . getString ( id ) ) ;
public class NetUtils { /** * Returns an address in a normalized format for Akka . * When an IPv6 address is specified , it normalizes the IPv6 address to avoid * complications with the exact URL match policy of Akka . * @ param host The hostname , IPv4 or IPv6 address * @ return host which will be normalized if it is an IPv6 address */ public static String unresolvedHostToNormalizedString ( String host ) { } }
// Return loopback interface address if host is null // This represents the behavior of { @ code InetAddress . getByName } and RFC 3330 if ( host == null ) { host = InetAddress . getLoopbackAddress ( ) . getHostAddress ( ) ; } else { host = host . trim ( ) . toLowerCase ( ) ; } // normalize and valid address if ( IPAddressUtil . isIPv6LiteralAddress ( host ) ) { byte [ ] ipV6Address = IPAddressUtil . textToNumericFormatV6 ( host ) ; host = getIPv6UrlRepresentation ( ipV6Address ) ; } else if ( ! IPAddressUtil . isIPv4LiteralAddress ( host ) ) { try { // We don ' t allow these in hostnames Preconditions . checkArgument ( ! host . startsWith ( "." ) ) ; Preconditions . checkArgument ( ! host . endsWith ( "." ) ) ; Preconditions . checkArgument ( ! host . contains ( ":" ) ) ; } catch ( Exception e ) { throw new IllegalConfigurationException ( "The configured hostname is not valid" , e ) ; } } return host ;
public class DI { /** * delegator */ public static < T > Class < ? extends T > resolveImplementingClass ( final Class < T > interf ) { } }
return ImplementingClassResolver . resolve ( interf ) ;
public class ThaiSolarCalendar { /** * / * [ deutsch ] * < p > Entspricht { @ code at ( PlainTime . of ( hour , minute ) ) } . < / p > * @ param hour hour of day in range ( 0-24) * @ param minute minute of hour in range ( 0-59) * @ return general timestamp as composition of this date and given time * @ throws IllegalArgumentException if any argument is out of range * @ since 3.19/4.15 */ public GeneralTimestamp < ThaiSolarCalendar > atTime ( int hour , int minute ) { } }
return this . at ( PlainTime . of ( hour , minute ) ) ;
public class Functions { /** * Increases the saturation of the given color by N percent . * @ param generator the surrounding generator * @ param input the function call to evaluate * @ return the result of the evaluation */ public static Expression saturate ( Generator generator , FunctionCall input ) { } }
Color color = input . getExpectedColorParam ( 0 ) ; int increase = input . getExpectedIntParam ( 1 ) ; return changeSaturation ( color , increase ) ;
public class CreateDirectConnectGatewayAssociationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateDirectConnectGatewayAssociationRequest createDirectConnectGatewayAssociationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createDirectConnectGatewayAssociationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDirectConnectGatewayAssociationRequest . getDirectConnectGatewayId ( ) , DIRECTCONNECTGATEWAYID_BINDING ) ; protocolMarshaller . marshall ( createDirectConnectGatewayAssociationRequest . getGatewayId ( ) , GATEWAYID_BINDING ) ; protocolMarshaller . marshall ( createDirectConnectGatewayAssociationRequest . getAddAllowedPrefixesToDirectConnectGateway ( ) , ADDALLOWEDPREFIXESTODIRECTCONNECTGATEWAY_BINDING ) ; protocolMarshaller . marshall ( createDirectConnectGatewayAssociationRequest . getVirtualGatewayId ( ) , VIRTUALGATEWAYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Mode { /** * Adds a set of element actions to be performed in this mode * for elements in a specified namespace . * @ param ns The namespace pattern . * @ param wildcard The wildcard character . * @ param actions The set of element actions . * @ return true if successfully added , that is the namespace was * not already present in the elementMap , otherwise false , the * caller should signal a script error in this case . */ boolean bindElement ( String ns , String wildcard , ActionSet actions ) { } }
NamespaceSpecification nss = new NamespaceSpecification ( ns , wildcard ) ; if ( nssElementMap . get ( nss ) != null ) return false ; for ( Enumeration e = nssElementMap . keys ( ) ; e . hasMoreElements ( ) ; ) { NamespaceSpecification nssI = ( NamespaceSpecification ) e . nextElement ( ) ; if ( nss . compete ( nssI ) ) { return false ; } } nssElementMap . put ( nss , actions ) ; return true ;
public class Input { /** * Fire an event indicating that a control has been pressed * @ param index The index of the control pressed * @ param controllerIndex The index of the controller on which the control was pressed */ private void fireControlPress ( int index , int controllerIndex ) { } }
consumed = false ; for ( int i = 0 ; i < controllerListeners . size ( ) ; i ++ ) { ControllerListener listener = ( ControllerListener ) controllerListeners . get ( i ) ; if ( listener . isAcceptingInput ( ) ) { switch ( index ) { case LEFT : listener . controllerLeftPressed ( controllerIndex ) ; break ; case RIGHT : listener . controllerRightPressed ( controllerIndex ) ; break ; case UP : listener . controllerUpPressed ( controllerIndex ) ; break ; case DOWN : listener . controllerDownPressed ( controllerIndex ) ; break ; default : // assume button pressed listener . controllerButtonPressed ( controllerIndex , ( index - BUTTON1 ) + 1 ) ; break ; } if ( consumed ) { break ; } } }
public class Sherdog { /** * Gets an organization via it ' s sherdog page HTML , in case you want to have your own way of getting teh HTML content * @ param html The web page HTML * @ return an Organization * @ throws IOException if connecting to sherdog fails * @ throws ParseException if the page structure has changed * @ throws SherdogParserException if anythign related to the parser goes wrong */ public Organization getOrganizationFromHtml ( String html ) throws IOException , ParseException , SherdogParserException { } }
return new OrganizationParser ( zoneId ) . parseFromHtml ( html ) ;
public class IpCamDeviceRegistry { /** * Is device registered ? * @ param ipcam the IP camera device * @ return True if device is registsred , false otherwise */ public static boolean isRegistered ( IpCamDevice ipcam ) { } }
if ( ipcam == null ) { throw new IllegalArgumentException ( "IP camera device cannot be null" ) ; } Iterator < IpCamDevice > di = DEVICES . iterator ( ) ; while ( di . hasNext ( ) ) { if ( di . next ( ) . getName ( ) . equals ( ipcam . getName ( ) ) ) { return true ; } } return false ;
public class AbstractServletModule { /** * Constructs an init parameter map for the * { @ link Cas20ProxyReceivingTicketValidationFilter } filter . * @ return the init parameter map . */ protected Map < String , String > getCasValidationFilterInitParams ( ) { } }
Map < String , String > params = new HashMap < > ( ) ; CasEurekaClinicalProperties properties = this . servletModuleSupport . getApplicationProperties ( ) ; params . put ( "casServerUrlPrefix" , properties . getCasUrl ( ) ) ; params . put ( "serverName" , properties . getProxyCallbackServer ( ) ) ; params . put ( "proxyCallbackUrl" , getCasProxyCallbackUrl ( ) ) ; params . put ( "proxyReceptorUrl" , getCasProxyCallbackPath ( ) ) ; return params ;
public class InternalSARLParser { /** * InternalSARL . g : 15966:1 : ruleXFunctionTypeRef returns [ EObject current = null ] : ( ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? otherlv _ 5 = ' = > ' ( ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) ) ) ; */ public final EObject ruleXFunctionTypeRef ( ) throws RecognitionException { } }
EObject current = null ; Token otherlv_0 = null ; Token otherlv_2 = null ; Token otherlv_4 = null ; Token otherlv_5 = null ; EObject lv_paramTypes_1_0 = null ; EObject lv_paramTypes_3_0 = null ; EObject lv_returnType_6_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 15972:2 : ( ( ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? otherlv _ 5 = ' = > ' ( ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) ) ) ) // InternalSARL . g : 15973:2 : ( ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? otherlv _ 5 = ' = > ' ( ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) ) ) { // InternalSARL . g : 15973:2 : ( ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? otherlv _ 5 = ' = > ' ( ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) ) ) // InternalSARL . g : 15974:3 : ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? otherlv _ 5 = ' = > ' ( ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) ) { // InternalSARL . g : 15974:3 : ( otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' ) ? int alt369 = 2 ; int LA369_0 = input . LA ( 1 ) ; if ( ( LA369_0 == 49 ) ) { alt369 = 1 ; } switch ( alt369 ) { case 1 : // InternalSARL . g : 15975:4 : otherlv _ 0 = ' ( ' ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? otherlv _ 4 = ' ) ' { otherlv_0 = ( Token ) match ( input , 49 , FOLLOW_87 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_0 , grammarAccess . getXFunctionTypeRefAccess ( ) . getLeftParenthesisKeyword_0_0 ( ) ) ; } // InternalSARL . g : 15979:4 : ( ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * ) ? int alt368 = 2 ; int LA368_0 = input . LA ( 1 ) ; if ( ( LA368_0 == RULE_ID || LA368_0 == 44 || LA368_0 == 49 || LA368_0 == 76 || ( LA368_0 >= 92 && LA368_0 <= 95 ) ) ) { alt368 = 1 ; } switch ( alt368 ) { case 1 : // InternalSARL . g : 15980:5 : ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * { // InternalSARL . g : 15980:5 : ( ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) ) // InternalSARL . g : 15981:6 : ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) { // InternalSARL . g : 15981:6 : ( lv _ paramTypes _ 1_0 = ruleJvmTypeReference ) // InternalSARL . g : 15982:7 : lv _ paramTypes _ 1_0 = ruleJvmTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXFunctionTypeRefAccess ( ) . getParamTypesJvmTypeReferenceParserRuleCall_0_1_0_0 ( ) ) ; } pushFollow ( FOLLOW_51 ) ; lv_paramTypes_1_0 = ruleJvmTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXFunctionTypeRefRule ( ) ) ; } add ( current , "paramTypes" , lv_paramTypes_1_0 , "org.eclipse.xtext.xbase.Xtype.JvmTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalSARL . g : 15999:5 : ( otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) ) * loop367 : do { int alt367 = 2 ; int LA367_0 = input . LA ( 1 ) ; if ( ( LA367_0 == 32 ) ) { alt367 = 1 ; } switch ( alt367 ) { case 1 : // InternalSARL . g : 16000:6 : otherlv _ 2 = ' , ' ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) { otherlv_2 = ( Token ) match ( input , 32 , FOLLOW_41 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_2 , grammarAccess . getXFunctionTypeRefAccess ( ) . getCommaKeyword_0_1_1_0 ( ) ) ; } // InternalSARL . g : 16004:6 : ( ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) ) // InternalSARL . g : 16005:7 : ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) { // InternalSARL . g : 16005:7 : ( lv _ paramTypes _ 3_0 = ruleJvmTypeReference ) // InternalSARL . g : 16006:8 : lv _ paramTypes _ 3_0 = ruleJvmTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXFunctionTypeRefAccess ( ) . getParamTypesJvmTypeReferenceParserRuleCall_0_1_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_51 ) ; lv_paramTypes_3_0 = ruleJvmTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXFunctionTypeRefRule ( ) ) ; } add ( current , "paramTypes" , lv_paramTypes_3_0 , "org.eclipse.xtext.xbase.Xtype.JvmTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } } break ; default : break loop367 ; } } while ( true ) ; } break ; } otherlv_4 = ( Token ) match ( input , 50 , FOLLOW_88 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_4 , grammarAccess . getXFunctionTypeRefAccess ( ) . getRightParenthesisKeyword_0_2 ( ) ) ; } } break ; } otherlv_5 = ( Token ) match ( input , 76 , FOLLOW_41 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_5 , grammarAccess . getXFunctionTypeRefAccess ( ) . getEqualsSignGreaterThanSignKeyword_1 ( ) ) ; } // InternalSARL . g : 16034:3 : ( ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) ) // InternalSARL . g : 16035:4 : ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) { // InternalSARL . g : 16035:4 : ( lv _ returnType _ 6_0 = ruleJvmTypeReference ) // InternalSARL . g : 16036:5 : lv _ returnType _ 6_0 = ruleJvmTypeReference { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXFunctionTypeRefAccess ( ) . getReturnTypeJvmTypeReferenceParserRuleCall_2_0 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; lv_returnType_6_0 = ruleJvmTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getXFunctionTypeRefRule ( ) ) ; } set ( current , "returnType" , lv_returnType_6_0 , "org.eclipse.xtext.xbase.Xtype.JvmTypeReference" ) ; afterParserOrEnumRuleCall ( ) ; } } } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class RandomAccessFile { /** * Returns the length of this file in bytes . * @ return the file ' s length in bytes . * @ throws IOException * if this file is closed or some other I / O error occurs . */ public long length ( ) throws IOException { } }
try { return Libcore . os . fstat ( fd ) . st_size ; } catch ( ErrnoException errnoException ) { throw errnoException . rethrowAsIOException ( ) ; }
public class Parser { /** * * * * * * Definition Lists * * * * * */ public Rule DefinitionList ( ) { } }
return NodeSequence ( // test for successful definition list match before actually building it to reduce backtracking TestNot ( Spacechar ( ) ) , Test ( OneOrMore ( TestNot ( BlankLine ( ) ) , TestNot ( DefListBullet ( ) ) , OneOrMore ( NotNewline ( ) , ANY ) , Newline ( ) ) , ZeroOrMore ( BlankLine ( ) ) , DefListBullet ( ) ) , push ( new DefinitionListNode ( ) ) , OneOrMore ( push ( new SuperNode ( ) ) , OneOrMore ( DefListTerm ( ) , addAsChild ( ) ) , OneOrMore ( Definition ( ) , addAsChild ( ) ) , ( ( SuperNode ) peek ( 1 ) ) . getChildren ( ) . addAll ( popAsNode ( ) . getChildren ( ) ) , Optional ( BlankLine ( ) ) ) ) ;
public class WSRdbManagedConnectionImpl { /** * Used by the container to change the association of an application - level * connection handle with a ManagedConneciton instance . The container should * find the right ManagedConnection instance and call the associateConnection * method . * The resource adapter is required to implement the associateConnection method . * The method implementation for a ManagedConnection should dissociate the * connection handle ( passed as a parameter ) from its currently associated * ManagedConnection and associate the new connection handle with itself . In addition * the state of the old ManagedConnection needs to be copied into the new ManagedConnection * in case the association occurs between methods during a transaction . * @ param Object connection - Application - level connection handle * @ exception ResourceException - Possible causes for this exception are : * 1 ) The connection is not in a valid state for reassociation . * 2 ) A fatal connection error was detected during reassoctiation . */ public void associateConnection ( Object connection ) throws ResourceException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "associateConnection" , connection ) ; WSJdbcConnection connHandle = ( WSJdbcConnection ) connection ; // JDBC Handles do not support reassociation during a transaction because of the // inability to reassociate " child " handles . ( Statement , ResultSet , . . . ) // Therefore , we do not reassociate the handle , but instead " reserve " it for token // reassociation back to the same MC . This relies on the guarantee we will always // be reassociated back to the original MC for use during the same transaction . try { WSRdbManagedConnectionImpl oldMC = ( WSRdbManagedConnectionImpl ) connHandle . getManagedConnection ( key ) ; int tranState = oldMC == null ? WSStateManager . NO_TRANSACTION_ACTIVE : oldMC . stateMgr . transtate ; // store the value just in case . if ( oldMC != null ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Old ManagedConnection rrsGlobalTransactionReallyActive :" , Boolean . valueOf ( oldMC . rrsGlobalTransactionReallyActive ) ) ; rrsGlobalTransactionReallyActive = oldMC . rrsGlobalTransactionReallyActive ; } if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Old ManagedConnection transaction state:" , oldMC == null ? null : oldMC . getTransactionStateAsString ( ) ) ; Tr . debug ( this , tc , "New ManagedConnection transaction state:" , this . getTransactionStateAsString ( ) ) ; } // The CRI must be retrieved from the connection handle when we are certain the // handle is inactive since handles only keep track of the CRI when they are // inactive . Object newCRI ; if ( ( tranState == WSStateManager . GLOBAL_TRANSACTION_ACTIVE || ( tranState == WSStateManager . RRS_GLOBAL_TRANSACTION_ACTIVE ) // to be on the safe side , we don ' t want to check for rrsGlobalTransactionReallyActive here will take the case where its not really started . || tranState == WSStateManager . LOCAL_TRANSACTION_ACTIVE ) && ! connHandle . isReserved ( ) ) { if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "Reassociation requested within a transaction; " + "handle reassociation will be ignored." ) ; // A transaction is active ; ignore the reassociation , but mark the handle as // reserved for its current ManagedConnection . connHandle . reserve ( key ) ; // Drop the handle from its current ManagedConnection . We may not be able to // drop handle ' s reference to the ManagedConnection , but we can at least drop // the ManagedConnection ' s reference to the handle . oldMC . dissociateHandle ( connHandle ) ; newCRI = connHandle . getCRI ( ) ; } else { // No transaction is active , so a full reassociation is allowed . // If the handle is still ACTIVE , dissociate it from its previous MC . if ( connHandle . getState ( ) == WSJdbcConnection . State . ACTIVE ) connHandle . dissociate ( ) ; // Retrieve the CRI while the handle is inactive . newCRI = connHandle . getCRI ( ) ; // - The connection handle must be supplied with both the new // ManagedConnection and underlying JDBC Connection . The handle will handle // making the state of the new underlying Connection consistent with the // previously held one . connHandle . reassociate ( this , sqlConn , key ) ; } if ( ! cri . equals ( newCRI ) ) replaceCRI ( ( WSConnectionRequestInfoImpl ) newCRI ) ; // Avoid resetting properties when a handle has already been created . if ( numHandlesInUse == 0 ) { // Refresh our copy of the connectionSharing setting with each first connection handle connectionSharing = dsConfig . get ( ) . connectionSharing ; synchronizePropertiesWithCRI ( ) ; // - Synchronize the connection properties with CRI } addHandle ( connHandle ) ; } catch ( ResourceException resX ) { FFDCFilter . processException ( resX , "com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.associateConnection" , "1981" , this ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "associateConnection" , "Exception" ) ; throw resX ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "associateConnection" ) ;
public class PGPUtils { /** * Performs decryption of a given stream using a PGP private key . * @ param encryptedStream stream providing the encrypted data * @ param targetStream stream to receive the decrypted data * @ param privateKeyStream stream providing the encoded PGP private key * @ param password passphrase for the private key * @ throws IOException if there is an error reading or writing from the streams * @ throws PGPException if the decryption process fails */ @ SuppressWarnings ( "rawtypes" ) public static void decrypt ( InputStream encryptedStream , OutputStream targetStream , InputStream privateKeyStream , char [ ] password ) throws Exception { } }
BcKeyFingerprintCalculator calculator = new BcKeyFingerprintCalculator ( ) ; PGPObjectFactory factory = new PGPObjectFactory ( PGPUtil . getDecoderStream ( encryptedStream ) , calculator ) ; PGPEncryptedDataList dataList ; Object object = factory . nextObject ( ) ; if ( object instanceof PGPEncryptedDataList ) { dataList = ( PGPEncryptedDataList ) object ; } else { dataList = ( PGPEncryptedDataList ) factory . nextObject ( ) ; } Iterator objects = dataList . getEncryptedDataObjects ( ) ; PGPPrivateKey privateKey = null ; PGPPublicKeyEncryptedData data = null ; while ( privateKey == null && objects . hasNext ( ) ) { data = ( PGPPublicKeyEncryptedData ) objects . next ( ) ; privateKey = findSecretKey ( privateKeyStream , data . getKeyID ( ) , password ) ; } if ( privateKey == null ) { throw new IllegalArgumentException ( "Secret key for message not found." ) ; } decryptData ( privateKey , data , calculator , targetStream ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcBuildingElementPart ( ) { } }
if ( ifcBuildingElementPartEClass == null ) { ifcBuildingElementPartEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 59 ) ; } return ifcBuildingElementPartEClass ;
public class VisLmlSyntax { /** * Extra common attributes : */ @ Override protected void registerBuildingAttributes ( ) { } }
super . registerBuildingAttributes ( ) ; // DragPaneLmlActorBuilder : addBuildingAttributeProcessor ( new GroupTypeLmlAttribute ( ) , "type" ) ; // VisWindowLmlActorBuilder : addBuildingAttributeProcessor ( new ShowWindowBorderLmlAttribute ( ) , "showBorder" , "showWindowBorder" ) ; // MenuItemLmlActorBuilder : addBuildingAttributeProcessor ( new MenuItemImageLmlAttribute ( ) , "icon" , "image" , "drawable" ) ; // ListViewLmlActorBuilder : addBuildingAttributeProcessor ( new ListAdapterLmlAttribute ( ) , "adapter" , "listAdapter" ) ; // IntRangeLmlActorBuilder : addBuildingAttributeProcessor ( new IntMaxLmlAttribute ( ) , "max" ) ; addBuildingAttributeProcessor ( new IntMinLmlAttribute ( ) , "min" ) ; addBuildingAttributeProcessor ( new IntStepLmlAttribute ( ) , "step" ) ; addBuildingAttributeProcessor ( new IntValueLmlAttribute ( ) , "value" ) ; // StringRangeLmlActorBuilder : addBuildingAttributeProcessor ( new StringMaxLmlAttribute ( ) , "max" ) ; addBuildingAttributeProcessor ( new StringMinLmlAttribute ( ) , "min" ) ; addBuildingAttributeProcessor ( new StringStepLmlAttribute ( ) , "step" ) ; addBuildingAttributeProcessor ( new StringValueLmlAttribute ( ) , "value" ) ;
public class Array { /** * { @ link Arrays # binarySearch ( Object [ ] , Object , Comparator ) } * @ param a * @ param key * @ param cmp * @ return */ static < T > int binarySearch ( final T [ ] a , final T key , final Comparator < ? super T > cmp ) { } }
if ( N . isNullOrEmpty ( a ) ) { return N . INDEX_NOT_FOUND ; } return Arrays . binarySearch ( a , key , cmp == null ? Comparators . NATURAL_ORDER : cmp ) ;
public class UpdateDatastoreRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateDatastoreRequest updateDatastoreRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateDatastoreRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDatastoreRequest . getDatastoreName ( ) , DATASTORENAME_BINDING ) ; protocolMarshaller . marshall ( updateDatastoreRequest . getRetentionPeriod ( ) , RETENTIONPERIOD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BaseNeo4jDialect { /** * A regular embedded is an element that it is embedded but it is not a key or a collection . * @ param keyColumnNames the column names representing the identifier of the entity * @ param column the column we want to check * @ return { @ code true } if the column represent an attribute of a regular embedded element , { @ code false } otherwise */ public static boolean isPartOfRegularEmbedded ( String [ ] keyColumnNames , String column ) { } }
return isPartOfEmbedded ( column ) && ! ArrayHelper . contains ( keyColumnNames , column ) ;
public class route { /** * Use this API to fetch all the route resources that are configured on netscaler . */ public static route [ ] get ( nitro_service service , options option ) throws Exception { } }
route obj = new route ( ) ; route [ ] response = ( route [ ] ) obj . get_resources ( service , option ) ; return response ;
public class WorkspaceApi { /** * Activates the voice channel using the provided resources . If the channel is successfully activated , * Workspace sends additional information about the state of active resources ( DNs , channels ) via events . The * resources you provide are associated with the agent for the duration of the session . * @ param agentId The unique ID of the agent . * @ param dn The DN ( number ) to use for the agent . You must provide either the place name or DN . * @ param placeName The name of the place to use for the agent . You must provide either the place name or DN . * @ param queueName The queue name . ( optional ) * @ param workMode The workmode . The possible values are AUTO _ IN or MANUAL _ IN . ( optional ) */ public void activateChannels ( String agentId , String dn , String placeName , String queueName , AgentWorkMode workMode ) throws WorkspaceApiException { } }
try { String msg = "Activating channels with agentId [" + agentId + "] " ; ActivatechannelsData data = new ActivatechannelsData ( ) ; data . setAgentId ( agentId ) ; if ( placeName != null ) { data . setPlaceName ( placeName ) ; msg += "place [" + placeName + "]" ; } else { data . setDn ( dn ) ; msg += "dn [" + dn + "]" ; } if ( queueName != null ) { data . setQueueName ( queueName ) ; msg += " queueName [" + queueName + "]" ; } if ( workMode != null ) { if ( AgentWorkMode . MANUAL_IN . equals ( workMode ) ) { data . setAgentWorkMode ( ActivatechannelsData . AgentWorkModeEnum . MANUALIN ) ; } else if ( AgentWorkMode . AUTO_IN . equals ( workMode ) ) { data . setAgentWorkMode ( ActivatechannelsData . AgentWorkModeEnum . AUTOIN ) ; } else { throw new WorkspaceApiException ( "only workmode MANUAL_IN or AUTO_IN can be used" ) ; } } ChannelsData channelsData = new ChannelsData ( ) ; channelsData . data ( data ) ; logger . debug ( msg + "..." ) ; ApiSuccessResponse response = this . sessionApi . activateChannels ( channelsData ) ; if ( response . getStatus ( ) . getCode ( ) != 0 ) { throw new WorkspaceApiException ( "activateChannels failed with code: " + response . getStatus ( ) . getCode ( ) ) ; } } catch ( ApiException e ) { throw new WorkspaceApiException ( "activateChannels failed." , e ) ; }
public class AbstractHBaseUtils { /** * Creates an HBase configuration object . * @ param properties the configuration properties */ public void createConfiguration ( final Properties properties ) { } }
setHbcfg ( HBaseConfiguration . create ( ) ) ; getHbcfg ( ) . set ( HBASE_ZOOKEEPER_QUORUM , properties . getProperty ( HBASE_ZOOKEEPER_QUORUM , "hlt-services4" ) ) ; getHbcfg ( ) . set ( HBASE_ZOOKEEPER_CLIENT_PORT , properties . getProperty ( HBASE_ZOOKEEPER_CLIENT_PORT , "2181" ) ) ; getHbcfg ( ) . set ( HADOOP_FS_DEFAULT_NAME , properties . getProperty ( HADOOP_FS_DEFAULT_NAME , "hdfs://hlt-services4:9000" ) ) ; // getHbcfg ( ) . set ( " hbase . client . retries . number " , " 1 " ) ;
public class CmsSitemapController { /** * Ensure the uniqueness of a given URL - name within the children of the given parent site - map entry . < p > * @ param parent the parent entry * @ param newName the proposed name * @ param callback the callback to execute */ public void ensureUniqueName ( CmsClientSitemapEntry parent , String newName , I_CmsSimpleCallback < String > callback ) { } }
ensureUniqueName ( parent . getSitePath ( ) , newName , callback ) ;
public class RealmTableImpl { /** * ( non - Javadoc ) * @ see org . jdiameter . client . api . controller . IRealmTable # removeRealmApplicationId ( java . lang . String , org . jdiameter . api . ApplicationId ) */ @ Override public Realm removeRealmApplicationId ( String realmName , ApplicationId appId ) { } }
RealmSet set = this . realmNameToRealmSet . get ( realmName ) ; if ( set != null ) { Realm r = set . getRealm ( appId ) ; set . removeRealm ( appId ) ; if ( set . size ( ) == 0 && ! realmName . equals ( this . localRealmName ) ) { this . realmNameToRealmSet . remove ( realmName ) ; this . allRealmsSet . remove ( realmName ) ; } return r ; } return null ;
public class AesCtr { /** * See < a href = * " http : / / csrc . nist . gov / publications / nistpubs / 800-38D / SP - 800-38D . pdf " > * NIST Special Publication 800-38D . < / a > for the definition of J0 , the * " pre - counter block " . * Reference : < a href = * " https : / / github . com / bcgit / bc - java / blob / master / core / src / main / java / org / bouncycastle / crypto / modes / GCMBlockCipher . java " * > GCMBlockCipher . java < / a > */ private byte [ ] computeJ0 ( byte [ ] nonce ) { } }
final int blockSize = getBlockSizeInBytes ( ) ; byte [ ] J0 = new byte [ blockSize ] ; System . arraycopy ( nonce , 0 , J0 , 0 , nonce . length ) ; J0 [ blockSize - 1 ] = 0x01 ; return incrementBlocks ( J0 , 1 ) ;
public class FineUploader5Validation { /** * Specify file valid file extensions here to restrict uploads to specific * types . * @ param sAllowedExtension * The allowed extension to be added . E . g . ( " jpeg " , " jpg " , " gif " ) * @ return this for chaining */ @ Nonnull public FineUploader5Validation addAllowedExtension ( @ Nonnull @ Nonempty final String sAllowedExtension ) { } }
ValueEnforcer . notEmpty ( sAllowedExtension , "AllowedExtension" ) ; m_aValidationAllowedExtensions . add ( sAllowedExtension ) ; return this ;
public class Bytes { /** * Converts a byte array to an int value . * @ param bytes byte array * @ param offset offset into array * @ param length length of int ( has to be { @ link # SIZEOF _ INT } ) * @ return the int value * @ throws IllegalArgumentException if length is not { @ link # SIZEOF _ INT } or * if there ' s not enough room in the array at the offset indicated . */ public static int toInt ( byte [ ] bytes , int offset , final int length ) { } }
if ( length != SIZEOF_INT || offset + length > bytes . length ) { throw explainWrongLengthOrOffset ( bytes , offset , length , SIZEOF_INT ) ; } int n = 0 ; for ( int i = offset ; i < ( offset + length ) ; i ++ ) { n <<= 8 ; n ^= bytes [ i ] & 0xFF ; } return n ;
public class Dater { /** * Returns a new Dater instance with the given date and date style * @ param date * @ return */ public static Dater of ( String date , DateStyle dateStyle ) { } }
return from ( date ) . with ( dateStyle ) ;
public class NetworkSecurityGroupsInner { /** * Gets the specified network security group . * @ param resourceGroupName The name of the resource group . * @ param networkSecurityGroupName The name of the network security group . * @ 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 < NetworkSecurityGroupInner > getByResourceGroupAsync ( String resourceGroupName , String networkSecurityGroupName , final ServiceCallback < NetworkSecurityGroupInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , networkSecurityGroupName ) , serviceCallback ) ;
public class ParserDDL { /** * Responsible for handling tail of ALTER COLUMN . . . RENAME . . . */ private void processAlterColumnRename ( Table table , ColumnSchema column ) { } }
checkIsSimpleName ( ) ; if ( table . findColumn ( token . tokenString ) > - 1 ) { throw Error . error ( ErrorCode . X_42504 , token . tokenString ) ; } database . schemaManager . checkColumnIsReferenced ( table . getName ( ) , column . getName ( ) ) ; session . commit ( false ) ; table . renameColumn ( column , token . tokenString , isDelimitedIdentifier ( ) ) ; read ( ) ;
public class Tags { /** * Return a stream of the contained tags . * @ return a tags stream */ public Stream < Tag > stream ( ) { } }
return StreamSupport . stream ( Spliterators . spliteratorUnknownSize ( iterator ( ) , Spliterator . ORDERED | Spliterator . DISTINCT | Spliterator . NONNULL | Spliterator . SORTED ) , false ) ;
public class MethodParameter { /** * Enables converters to get the value type from the " value " expression . * @ param name DOCUMENT _ ME * @ return DOCUMENT _ ME */ @ Override public ValueExpression getValueExpression ( final String name ) { } }
if ( "value" . equals ( name ) ) { // get type from parent component // MethodSignatureTagHandler stores all parameters to the parent component final UIComponent parent = getParent ( ) ; final Map < String , Object > parentAttribtues = parent . getAttributes ( ) ; final Class < ? > [ ] parameterTypes = ( Class < ? > [ ] ) parentAttribtues . get ( MethodSignatureTagHandler . PARAMETERS_TYPES_ATTRIBUTE_NAME ) ; final Class < ? > parameterType = parameterTypes [ parent . getChildren ( ) . indexOf ( this ) ] ; return new DummyValueExpression ( parameterType ) ; } return super . getValueExpression ( name ) ;
public class BasicColorPicker { /** * Updates picker ui from current color */ protected void updateValuesFromCurrentColor ( ) { } }
int [ ] hsv = ColorUtils . RGBtoHSV ( color ) ; int ch = hsv [ 0 ] ; int cs = hsv [ 1 ] ; int cv = hsv [ 2 ] ; verticalBar . setValue ( ch ) ; palette . setValue ( cs , cv ) ;
public class CmsSitemapController { /** * Moves the given sitemap entry with all its descendants to the new position . < p > * @ param entry the sitemap entry to move * @ param toPath the destination path * @ param position the new position between its siblings */ public void move ( CmsClientSitemapEntry entry , String toPath , int position ) { } }
// check for valid data if ( ! isValidEntryAndPath ( entry , toPath ) ) { // invalid data , do nothing CmsDebugLog . getInstance ( ) . printLine ( "invalid data, doing nothing" ) ; return ; } // check for relevance if ( isChangedPosition ( entry , toPath , position ) ) { // only register real changes CmsSitemapChange change = new CmsSitemapChange ( entry . getId ( ) , entry . getSitePath ( ) , ChangeType . modify ) ; change . setDefaultFileId ( entry . getDefaultFileId ( ) ) ; if ( ! toPath . equals ( entry . getSitePath ( ) ) ) { change . setParentId ( getEntry ( CmsResource . getParentFolder ( toPath ) ) . getId ( ) ) ; change . setName ( CmsResource . getName ( toPath ) ) ; } if ( CmsSitemapView . getInstance ( ) . isNavigationMode ( ) ) { change . setPosition ( position ) ; } change . setLeafType ( entry . isLeafType ( ) ) ; CmsSitemapClipboardData data = getData ( ) . getClipboardData ( ) . copy ( ) ; data . addModified ( entry ) ; change . setClipBoardData ( data ) ; commitChange ( change , null ) ; }
public class Assert { /** * Asserts that a cookies with the provided name has a value equal to the * expected value . This information will be logged and recorded , with a * screenshot for traceability and added debugging support . * @ param cookieName the name of the cookie * @ param expectedCookieValue the expected value of the cookie */ @ Override public void cookieEquals ( String cookieName , String expectedCookieValue ) { } }
assertEquals ( "Cookie Value Mismatch" , expectedCookieValue , checkCookieEquals ( cookieName , expectedCookieValue , 0 , 0 ) ) ;
public class FYShuffle { /** * Randomly shuffle a char array * @ param charArray array of char to shuffle . */ public static void shuffle ( char [ ] charArray ) { } }
int swapPlace = - 1 ; for ( int i = 0 ; i < charArray . length ; i ++ ) { swapPlace = ( int ) ( Math . random ( ) * ( charArray . length - 1 ) ) ; XORSwap . swap ( charArray , i , swapPlace ) ; }
public class RemoteUIAElement { /** * TODO freynaud fix that server side . */ @ Override public boolean isDisplayed ( ) { } }
WebDriverLikeRequest request = buildRequest ( WebDriverLikeCommand . DISPLAYED ) ; return ( Boolean ) commandExecutor . execute ( request ) ;
public class MessageDetailScreen { /** * Add all the screen listeners . */ public void addListeners ( ) { } }
super . addListeners ( ) ; ( ( MessageDetail ) this . getMainRecord ( ) ) . addPropertyListeners ( ) ; this . getMainRecord ( ) . addListener ( new MessageDetailDefTransHandler ( null ) ) ; String strManualTransportID = Integer . toString ( ( ( ReferenceField ) this . getMainRecord ( ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) ) . getIDFromCode ( MessageTransport . MANUAL ) ) ; this . getMainRecord ( ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) . addListener ( new DisableOnFieldHandler ( this . getMainRecord ( ) . getField ( MessageDetail . INITIAL_MANUAL_TRANSPORT_STATUS_ID ) , strManualTransportID , false ) ) ; Converter convCheckMark = new RadioConverter ( this . getMainRecord ( ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) , strManualTransportID , false ) ; this . getMainRecord ( ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) . addListener ( new RemoveConverterOnFreeHandler ( convCheckMark ) ) ; this . getMainRecord ( ) . getField ( MessageDetail . MESSAGE_TRANSPORT_ID ) . addListener ( new CopyDataHandler ( this . getMainRecord ( ) . getField ( MessageDetail . INITIAL_MANUAL_TRANSPORT_STATUS_ID ) , null , convCheckMark ) ) ;
public class AppGameContainer { /** * Start running the game * @ throws SlickException Indicates a failure to initialise the system */ public void start ( ) throws SlickException { } }
try { setup ( ) ; getDelta ( ) ; while ( running ( ) ) { gameLoop ( ) ; } } finally { destroy ( ) ; } if ( forceExit ) { System . exit ( 0 ) ; }
public class BNFHeadersImpl { /** * Read the next byte [ ] from the input stream instance . * @ param input * @ return byte [ ] - - value read , or null if length marker indicates no byte [ ] * @ throws IOException */ protected byte [ ] readByteArray ( ObjectInput input ) throws IOException { } }
int len = input . readInt ( ) ; if ( - 1 == len ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "read byte[] found -1 length marker" ) ; } return null ; } byte [ ] value = new byte [ len ] ; input . readFully ( value ) ; return value ;
public class EurekaClinicalClient { /** * Submits a form and gets back a JSON object . Adds appropriate Accepts and * Content Type headers . * @ param < T > the type of object that is expected in the response . * @ param path the API to call . * @ param formParams the form parameters to send . * @ param cls the type of object that is expected in the response . * @ return the object in the response . * @ throws ClientException if a status code other than 200 ( OK ) is returned . */ protected < T > T doPost ( String path , MultivaluedMap < String , String > formParams , Class < T > cls ) throws ClientException { } }
return doPost ( path , formParams , cls , null ) ;
public class AbstractEntry { /** * Writes the index entry into the provided buffer at the current position . */ public void index ( final ByteBuffer index , final int position ) { } }
index . putInt ( tag ) . putInt ( getType ( ) ) . putInt ( position ) . putInt ( count ) ;