signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DefaultErrorHandler { /** * Render the result directly ( without template ) . * @ param routeContext */ protected void renderDirectly ( int statusCode , RouteContext routeContext ) { } }
if ( application . getPippoSettings ( ) . isProd ( ) ) { routeContext . getResponse ( ) . commit ( ) ; } else { if ( statusCode == HttpConstants . StatusCode . NOT_FOUND ) { StringBuilder content = new StringBuilder ( ) ; content . append ( "<html><body>" ) ; content . append ( "<pre>" ) ; content . append ( "Cannot find a route for '" ) ; content . append ( routeContext . getRequestMethod ( ) ) . append ( ' ' ) . append ( routeContext . getRequestUri ( ) ) ; content . append ( '\'' ) ; content . append ( '\n' ) ; content . append ( "Available routes:" ) ; content . append ( '\n' ) ; List < Route > routes = application . getRouter ( ) . getRoutes ( ) ; for ( Route route : routes ) { content . append ( '\t' ) . append ( route . getRequestMethod ( ) ) . append ( ' ' ) . append ( route . getUriPattern ( ) ) ; content . append ( '\n' ) ; } content . append ( "</pre>" ) ; content . append ( "</body></html>" ) ; routeContext . send ( content ) ; } else if ( statusCode == HttpConstants . StatusCode . INTERNAL_ERROR ) { StringBuilder content = new StringBuilder ( ) ; content . append ( "<html><body>" ) ; content . append ( "<pre>" ) ; Error error = prepareError ( statusCode , routeContext ) ; content . append ( error . toString ( ) ) ; content . append ( "</pre>" ) ; content . append ( "</body></html>" ) ; routeContext . send ( content ) ; } }
public class ExeFindAction { /** * Handles the Find action . * { @ inheritDoc } */ @ Override public ExitCode handleTask ( PrintStream stdout , PrintStream stderr , Arguments args ) { } }
logger . log ( Level . INFO , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_STABILIZING_FEATUREMANAGER" , "find" ) + "\n" ) ; InstallKernel installKernel = InstallKernelFactory . getInstance ( ) ; installKernel . setUserAgent ( InstallConstants . FEATURE_MANAGER ) ; // Load the repository properties instance from properties file try { Properties repoProperties = RepositoryConfigUtils . loadRepoProperties ( ) ; if ( repoProperties != null ) { // Set the repository properties instance in Install Kernel installKernel . setRepositoryProperties ( repoProperties ) ; } } catch ( InstallException e ) { logger . log ( Level . SEVERE , e . getMessage ( ) , e ) ; return InstallExecutor . returnCode ( e . getRc ( ) ) ; } String searchStr = args . getPositionalArguments ( ) . get ( 0 ) ; boolean viewInfo = args . getOption ( "viewinfo" ) != null ; try { logger . log ( Level . INFO , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING" ) ) ; logger . log ( Level . INFO , "" ) ; List < EsaResource > esas = ( ( InstallKernelImpl ) installKernel ) . queryFeatures ( searchStr ) ; if ( esas . isEmpty ( ) ) { logger . log ( Level . INFO , NLS . getMessage ( "find.no.feature" ) ) ; } else { Collections . sort ( esas , new Comparator < EsaResource > ( ) { @ Override public int compare ( EsaResource er1 , EsaResource er2 ) { return getName ( er1 ) . compareTo ( getName ( er2 ) ) ; } } ) ; InstallUtils . log ( esas ) ; for ( EsaResource esa : esas ) { showESA ( esa , viewInfo ) ; } } } catch ( InstallException e ) { logger . log ( Level . SEVERE , e . getMessage ( ) , e ) ; return InstallExecutor . returnCode ( e . getRc ( ) ) ; } return ReturnCode . OK ;
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a multi - role pool of an App Service Environment . * Get metric definitions for a multi - role pool of an App Service Environment . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ResourceMetricDefinitionInner & gt ; object */ public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > listMultiRoleMetricDefinitionsNextWithServiceResponseAsync ( final String nextPageLink ) { } }
return listMultiRoleMetricDefinitionsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > call ( ServiceResponse < Page < ResourceMetricDefinitionInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listMultiRoleMetricDefinitionsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class MSSQLDBInitializer { /** * { @ inheritDoc } */ @ Override protected void postInit ( Connection connection ) throws SQLException { } }
super . postInit ( connection ) ; Statement stmt = null ; ResultSet rs = null ; try { if ( containerConfig . useSequenceForOrderNumber ) { String select = "select * from JCR_" + DBInitializerHelper . getItemTableSuffix ( containerConfig ) + "_SEQ where name='LAST_N_ORDER_NUM'" ; stmt = connection . createStatement ( ) ; rs = stmt . executeQuery ( select ) ; if ( ! rs . next ( ) ) { String insert = "INSERT INTO JCR_" + DBInitializerHelper . getItemTableSuffix ( containerConfig ) + "_SEQ (name, nextVal) VALUES ('LAST_N_ORDER_NUM'," + getStartValue ( connection ) + ")" ; stmt . executeUpdate ( insert ) ; } } } finally { JDBCUtils . freeResources ( rs , stmt , null ) ; }
public class PriorityQueue { /** * Inserts item x at position k , maintaining heap invariant by * promoting x up the tree until it is greater than or equal to * its parent , or is the root . * To simplify and speed up coercions and comparisons . the * Comparable and Comparator versions are separated into different * methods that are otherwise identical . ( Similarly for siftDown . ) * @ param k the position to fill * @ param x the item to insert */ private void siftUp ( int k , E x ) { } }
if ( comparator != null ) siftUpUsingComparator ( k , x ) ; else siftUpComparable ( k , x ) ;
public class Participant { /** * Create a ParticipantCreator to execute create . * @ param pathServiceSid The SID of the parent Service resource * @ param pathSessionSid The SID of the parent Session resource * @ param identifier The phone number of the Participant * @ return ParticipantCreator capable of executing the create */ public static ParticipantCreator creator ( final String pathServiceSid , final String pathSessionSid , final String identifier ) { } }
return new ParticipantCreator ( pathServiceSid , pathSessionSid , identifier ) ;
public class OpenIDConnectConfigMarshaller { /** * Marshall the given parameter object . */ public void marshall ( OpenIDConnectConfig openIDConnectConfig , ProtocolMarshaller protocolMarshaller ) { } }
if ( openIDConnectConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( openIDConnectConfig . getIssuer ( ) , ISSUER_BINDING ) ; protocolMarshaller . marshall ( openIDConnectConfig . getClientId ( ) , CLIENTID_BINDING ) ; protocolMarshaller . marshall ( openIDConnectConfig . getIatTTL ( ) , IATTTL_BINDING ) ; protocolMarshaller . marshall ( openIDConnectConfig . getAuthTTL ( ) , AUTHTTL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ClassNode { /** * Accept a visitor that visit all descendants of the class represetned by * this ` ClassNode ` including this ` ClassNode ` itself . * @ param visitor the visitor * @ param publicOnly specify if only public class shall be visited * @ param noAbstract specify if abstract class can be visited * @ return this ` ClassNode ` instance */ public ClassNode visitTree ( $ . Visitor < ClassNode > visitor , final boolean publicOnly , final boolean noAbstract ) { } }
return visitTree ( $ . guardedVisitor ( classNodeFilter ( publicOnly , noAbstract ) , visitor ) ) ;
public class AmazonLexModelBuildingClient { /** * Exports the contents of a Amazon Lex resource in a specified format . * @ param getExportRequest * @ return Result of the GetExport operation returned by the service . * @ throws NotFoundException * The resource specified in the request was not found . Check the resource and try again . * @ throws LimitExceededException * The request exceeded a limit . Try your request again . * @ throws InternalFailureException * An internal Amazon Lex error occurred . Try your request again . * @ throws BadRequestException * The request is not well formed . For example , a value is invalid or a required field is missing . Check the * field values , and try again . * @ sample AmazonLexModelBuilding . GetExport * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / lex - models - 2017-04-19 / GetExport " target = " _ top " > AWS API * Documentation < / a > */ @ Override public GetExportResult getExport ( GetExportRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetExport ( request ) ;
public class PackageManagerUtils { /** * Get the { @ link android . content . pm . PackageInfo } that contains signature info . * @ param context the context . * @ param targetPackage the the target package name . * @ return the { @ link android . content . pm . PackageInfo } * @ throws NameNotFoundException if no package found . */ public static PackageInfo getSignaturePackageInfo ( Context context , String targetPackage ) throws NameNotFoundException { } }
PackageManager manager = context . getPackageManager ( ) ; return manager . getPackageInfo ( targetPackage , PackageManager . GET_SIGNATURES ) ;
public class ExperimentsInner { /** * Creates an Experiment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long . * @ param experimentName The name of the experiment . Experiment names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ExperimentInner object if successful . */ public ExperimentInner beginCreate ( String resourceGroupName , String workspaceName , String experimentName ) { } }
return beginCreateWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class SamlEndpoint { /** * Creates a { @ link SamlEndpoint } of the specified { @ code uri } and the HTTP Redirect binding protocol . */ public static SamlEndpoint ofHttpRedirect ( URI uri ) { } }
requireNonNull ( uri , "uri" ) ; return new SamlEndpoint ( uri , SamlBindingProtocol . HTTP_REDIRECT ) ;
public class CPRuleUserSegmentRelUtil { /** * Returns the cp rule user segment rels before and after the current cp rule user segment rel in the ordered set where CPRuleId = & # 63 ; . * @ param CPRuleUserSegmentRelId the primary key of the current cp rule user segment rel * @ param CPRuleId the cp rule ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the previous , current , and next cp rule user segment rel * @ throws NoSuchCPRuleUserSegmentRelException if a cp rule user segment rel with the primary key could not be found */ public static CPRuleUserSegmentRel [ ] findByCPRuleId_PrevAndNext ( long CPRuleUserSegmentRelId , long CPRuleId , OrderByComparator < CPRuleUserSegmentRel > orderByComparator ) throws com . liferay . commerce . product . exception . NoSuchCPRuleUserSegmentRelException { } }
return getPersistence ( ) . findByCPRuleId_PrevAndNext ( CPRuleUserSegmentRelId , CPRuleId , orderByComparator ) ;
public class MaxBiotonicSequenceSum { /** * This function calculates the maximum sum of a bi - tonic ( first increasing then decreasing ) subsequence in the given list . * > > > calculate _ max _ biotonic _ sequence _ sum ( new int [ ] { 1 , 15 , 51 , 45 , 33 , 100 , 12 , 18 , 9 } , 9) * 194 * > > > calculate _ max _ biotonic _ sequence _ sum ( new int [ ] { 80 , 60 , 30 , 40 , 20 , 10 } , 6) * 210 * > > > calculate _ max _ biotonic _ sequence _ sum ( new int [ ] { 2 , 3 , 14 , 16 , 21 , 23 , 29 , 30 } , 8) * 138 * @ param array : The input list of integers . * @ param length : The length of the input list . * @ return : The maximum sum of a bi - tonic subsequence . */ public static int calculateMaxBiotonicSequenceSum ( int array [ ] , int length ) { } }
int i , j ; int max ; int incSubSeqSum [ ] = new int [ length ] ; int decSubSeqSum [ ] = new int [ length ] ; for ( i = 0 ; i < length ; i ++ ) { incSubSeqSum [ i ] = array [ i ] ; decSubSeqSum [ i ] = array [ i ] ; } for ( i = 1 ; i < length ; i ++ ) for ( j = 0 ; j < i ; j ++ ) if ( array [ i ] > array [ j ] && incSubSeqSum [ i ] < incSubSeqSum [ j ] + array [ i ] ) incSubSeqSum [ i ] = incSubSeqSum [ j ] + array [ i ] ; for ( i = length - 2 ; i >= 0 ; i -- ) for ( j = length - 1 ; j > i ; j -- ) if ( array [ i ] > array [ j ] && decSubSeqSum [ i ] < decSubSeqSum [ j ] + array [ i ] ) decSubSeqSum [ i ] = decSubSeqSum [ j ] + array [ i ] ; max = incSubSeqSum [ 0 ] + decSubSeqSum [ 0 ] - array [ 0 ] ; for ( i = 1 ; i < length ; i ++ ) if ( incSubSeqSum [ i ] + decSubSeqSum [ i ] - array [ i ] > max ) max = incSubSeqSum [ i ] + decSubSeqSum [ i ] - array [ i ] ; return max ;
public class TaskEventSupport { /** * after methods */ public void fireAfterTaskActivated ( final Task task , TaskContext context ) { } }
final Iterator < TaskLifeCycleEventListener > iter = getEventListenersIterator ( ) ; if ( iter . hasNext ( ) ) { final TaskEventImpl event = new TaskEventImpl ( task , context ) ; do { iter . next ( ) . afterTaskActivatedEvent ( event ) ; } while ( iter . hasNext ( ) ) ; }
public class WrappedByteBuffer { /** * Puts an eight - byte long into the buffer at the specified index . * @ param index the index * @ param v the eight - byte long * @ return the buffer */ public WrappedByteBuffer putLongAt ( int index , long v ) { } }
_checkForWriteAt ( index , 8 ) ; _buf . putLong ( index , v ) ; return this ;
public class UpdatePhoneNumberRequestItemMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdatePhoneNumberRequestItem updatePhoneNumberRequestItem , ProtocolMarshaller protocolMarshaller ) { } }
if ( updatePhoneNumberRequestItem == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updatePhoneNumberRequestItem . getPhoneNumberId ( ) , PHONENUMBERID_BINDING ) ; protocolMarshaller . marshall ( updatePhoneNumberRequestItem . getProductType ( ) , PRODUCTTYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ProcessorBuilder { /** * Create a template from definition * @ param template the template definition * @ return template */ private ProcTemplate createTemplate ( Template template ) { } }
if ( ! template . isEmpty ( ) ) { return new ProcTemplate ( templateElementFactory . createTemplateList ( template . getElements ( ) ) ) ; } else { return ProcTemplate . EMPTY ; }
public class GraphHopper { /** * This method applies the changes to the graph specified as feature collection . It does so by locking the routing * to avoid concurrent changes which could result in incorrect routing ( like when done while a Dijkstra search ) or * also while just reading one edge row ( inconsistent edge properties ) . */ public ChangeGraphResponse changeGraph ( Collection < JsonFeature > collection ) { } }
// TODO allow calling this method if called before CH preparation if ( getCHFactoryDecorator ( ) . isEnabled ( ) ) throw new IllegalArgumentException ( "To use the changeGraph API you need to turn off CH" ) ; Lock writeLock = readWriteLock . writeLock ( ) ; writeLock . lock ( ) ; try { ChangeGraphHelper overlay = createChangeGraphHelper ( ghStorage , locationIndex ) ; long updateCount = overlay . applyChanges ( encodingManager , collection ) ; return new ChangeGraphResponse ( updateCount ) ; } finally { writeLock . unlock ( ) ; }
public class ResourceWatcher { /** * Removes the path mapping of the bundle given in parameter from map which * links Path to resource bundle * @ param bundle * the bundle whose the path mapping should be removed */ private void removePathMappingFromPathMap ( JoinableResourceBundle bundle ) { } }
for ( List < PathMapping > pathMappings : pathToResourceBundle . values ( ) ) { for ( Iterator < PathMapping > iterator = pathMappings . iterator ( ) ; iterator . hasNext ( ) ; ) { PathMapping pathMapping = ( PathMapping ) iterator . next ( ) ; if ( pathMapping . getBundle ( ) . getName ( ) . equals ( bundle . getName ( ) ) ) { iterator . remove ( ) ; } } }
public class ScannerSupplier { /** * Returns a { @ link ScannerSupplier } with a specific list of { @ link BugChecker } classes . */ public static ScannerSupplier fromBugCheckerClasses ( Iterable < Class < ? extends BugChecker > > checkers ) { } }
ImmutableList . Builder < BugCheckerInfo > builder = ImmutableList . builder ( ) ; for ( Class < ? extends BugChecker > checker : checkers ) { builder . add ( BugCheckerInfo . create ( checker ) ) ; } return fromBugCheckerInfos ( builder . build ( ) ) ;
public class AnchorCell { /** * Sets < code > hreflang < / code > attribute for the anchor . * @ param hreflang the hreflang attribute * @ jsptagref . attributedescription The hrefLang attribute for the HTML anchor . * @ jsptagref . attributesyntaxvalue < i > string _ hreflang < / i > * @ netui : attribute required = " false " rtexprvalue = " true " description = " The HREF lang attribute for the HTML anchor . " */ public void setHrefLang ( String hreflang ) { } }
_anchorState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . HREFLANG , hreflang ) ;
public class StreamCharBuffer { /** * Reads the buffer to a char [ ] . * Caches the result if there aren ' t any readers . * @ return the chars */ public char [ ] toCharArray ( ) { } }
// check if there is a cached single charbuffer if ( firstChunk == lastChunk && firstChunk instanceof CharBufferChunk && allocBuffer . charsUsed ( ) == 0 && ( ( CharBufferChunk ) firstChunk ) . isSingleBuffer ( ) ) { return ( ( CharBufferChunk ) firstChunk ) . buffer ; } int initialReaderCount = readerCount ; char [ ] buf = readAsCharArray ( ) ; if ( initialReaderCount == 0 ) { // if there are no readers , the result can be cached reset ( ) ; if ( buf . length > 0 ) { addChunk ( new CharBufferChunk ( - 1 , buf , 0 , buf . length ) ) ; } } return buf ;
public class FeatureListGrid { /** * This method is used only when selection is enabled ( see setSelectionEnabled ) . When a feature deselection event is * sent out from the MapModel , check if we have that row selected and deselect it . */ public void onFeatureDeselected ( FeatureDeselectedEvent event ) { } }
Feature feature = event . getFeature ( ) ; // Only deselect if it is actually selected : boolean selected = false ; ListGridRecord [ ] selections = getSelection ( ) ; for ( ListGridRecord selection : selections ) { if ( selection . getAttribute ( FIELD_NAME_FEATURE_ID ) . equals ( feature . getId ( ) ) ) { selected = true ; break ; } } // If selected , find the correct row and deselect : if ( selected ) { ListGridRecord [ ] records = this . getRecords ( ) ; for ( ListGridRecord record : records ) { if ( record . getAttribute ( FIELD_NAME_FEATURE_ID ) . equals ( feature . getId ( ) ) ) { deselectRecord ( record ) ; break ; } } }
public class MetadataBuilder { /** * Ad an entry to the list of { @ link RuleProvider } classes that should execute after the { @ link Rule } instances in the corresponding * { @ link RuleProvider } instance . * { @ link RuleProvider } s can also be specified based on id ( { @ link # getExecuteBeforeIDs } ) . */ public MetadataBuilder addExecuteAfter ( Class < ? extends RuleProvider > type ) { } }
if ( type != null ) { executeAfter . add ( type ) ; } return this ;
public class ChronosClientWatcher { /** * Get the data from znode . * @ param chronosClientWatcher the ZooKeeper watcher * @ param znode the znode you want to access * @ return the byte array of value in znode * @ throws IOException when error to access ZooKeeper */ public byte [ ] getData ( ChronosClientWatcher chronosClientWatcher , String znode ) throws IOException { } }
byte [ ] data = null ; for ( int i = 0 ; i <= connectRetryTimes ; i ++ ) { try { data = chronosClientWatcher . getZooKeeper ( ) . getData ( znode , null , null ) ; break ; } catch ( Exception e ) { LOG . info ( "Exceptioin to get data from ZooKeeper, retry " + i + " times" ) ; if ( i == connectRetryTimes ) { throw new IOException ( "Error when getting data from " + znode + " after retrying" ) ; } } } return data ;
public class AttributeService { /** * Gets the value of the given attribute for the given file . { @ code attribute } must be of the form * " view : attribute " or " attribute " . */ public Object getAttribute ( File file , String attribute ) { } }
String view = getViewName ( attribute ) ; String attr = getSingleAttribute ( attribute ) ; return getAttribute ( file , view , attr ) ;
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns the first commerce notification attachment in the ordered set where commerceNotificationQueueEntryId = & # 63 ; . * @ param commerceNotificationQueueEntryId the commerce notification queue entry ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce notification attachment , or < code > null < / code > if a matching commerce notification attachment could not be found */ @ Override public CommerceNotificationAttachment fetchByCommerceNotificationQueueEntryId_First ( long commerceNotificationQueueEntryId , OrderByComparator < CommerceNotificationAttachment > orderByComparator ) { } }
List < CommerceNotificationAttachment > list = findByCommerceNotificationQueueEntryId ( commerceNotificationQueueEntryId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class NS { /** * Returns a < a href = * " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . SpecifyingConditions . html # ConditionExpressionReference . Comparators " * > comparator condition < / a > ( that evaluates to true if the value of the * current attribute is not equal to the set of specified values ) for * building condition expression . */ public ComparatorCondition ne ( Number ... values ) { } }
return new ComparatorCondition ( "<>" , this , new LiteralOperand ( new LinkedHashSet < Number > ( Arrays . asList ( values ) ) ) ) ;
public class AbstractFileEncryptor { /** * Factory method for creating a new { @ link Cipher } from the given parameters . This method is * invoked in the constructor from the derived classes and can be overridden so users can * provide their own version of a new { @ link Cipher } from the given parameters . * @ param privateKey * the private key * @ param algorithm * the algorithm * @ param salt * the salt . * @ param iterationCount * the iteration count * @ param operationMode * the operation mode for the new cipher object * @ return the cipher * @ throws NoSuchAlgorithmException * is thrown if instantiation of the SecretKeyFactory object fails . * @ throws InvalidKeySpecException * is thrown if generation of the SecretKey object fails . * @ throws NoSuchPaddingException * is thrown if instantiation of the cypher object fails . * @ throws InvalidKeyException * is thrown if initialization of the cypher object fails . * @ throws InvalidAlgorithmParameterException * is thrown if initialization of the cypher object fails . * @ throws UnsupportedEncodingException * is thrown if the named charset is not supported . */ @ Override protected Cipher newCipher ( final String privateKey , final String algorithm , final byte [ ] salt , final int iterationCount , final int operationMode ) throws NoSuchAlgorithmException , InvalidKeySpecException , NoSuchPaddingException , InvalidKeyException , InvalidAlgorithmParameterException , UnsupportedEncodingException { } }
final KeySpec keySpec = newKeySpec ( privateKey , salt , iterationCount ) ; final SecretKeyFactory factory = newSecretKeyFactory ( algorithm ) ; final SecretKey key = factory . generateSecret ( keySpec ) ; final AlgorithmParameterSpec paramSpec = newAlgorithmParameterSpec ( salt , iterationCount ) ; return newCipher ( operationMode , key , paramSpec , key . getAlgorithm ( ) ) ;
public class JavacElements { /** * Returns the tree for an annotation given a list of annotations * in which to search ( recursively ) and their corresponding trees . * Returns null if the tree cannot be found . */ private JCTree matchAnnoToTree ( Attribute . Compound findme , List < Attribute . Compound > annos , List < JCAnnotation > trees ) { } }
for ( Attribute . Compound anno : annos ) { for ( JCAnnotation tree : trees ) { JCTree match = matchAnnoToTree ( findme , anno , tree ) ; if ( match != null ) return match ; } } return null ;
public class LoadBalancerContext { /** * This is called after a response is received from the client * to update related stats . */ protected void noteResponse ( ServerStats stats , ClientRequest request , Object response , long responseTime ) { } }
if ( stats == null ) { return ; } try { recordStats ( stats , responseTime ) ; RetryHandler errorHandler = getRetryHandler ( ) ; if ( errorHandler != null && response != null ) { stats . clearSuccessiveConnectionFailureCount ( ) ; } } catch ( Exception ex ) { logger . error ( "Error noting stats for client {}" , clientName , ex ) ; }
public class UnsignedInteger64 { /** * Add an unsigned integer to another unsigned integer . * @ param x * @ param y * @ return */ public static UnsignedInteger64 add ( UnsignedInteger64 x , UnsignedInteger64 y ) { } }
return new UnsignedInteger64 ( x . bigInt . add ( y . bigInt ) ) ;
public class PreorderVisitor { /** * Constants */ @ Override public void visitConstantPool ( ConstantPool obj ) { } }
super . visitConstantPool ( obj ) ; Constant [ ] constant_pool = obj . getConstantPool ( ) ; for ( int i = 1 ; i < constant_pool . length ; i ++ ) { constant_pool [ i ] . accept ( this ) ; byte tag = constant_pool [ i ] . getTag ( ) ; if ( ( tag == Const . CONSTANT_Double ) || ( tag == Const . CONSTANT_Long ) ) { i ++ ; } }
public class ReadHandler { /** * Return only those attributes of an mbean which has one of the given names */ private List < String > filterAttributeNames ( MBeanServerExecutor pSeverManager , ObjectName pName , List < String > pNames ) throws IOException , ReflectionException , MBeanException , AttributeNotFoundException , InstanceNotFoundException { } }
Set < String > attrs = new HashSet < String > ( getAllAttributesNames ( pSeverManager , pName ) ) ; List < String > ret = new ArrayList < String > ( ) ; for ( String name : pNames ) { if ( attrs . contains ( name ) ) { ret . add ( name ) ; } } return ret ;
public class AppSummaryService { /** * creates a list of appkeys from the hbase scan * @ param scan * @ param startTime * @ param endTime * @ param maxCount * @ return list of flow keys * @ throws IOException */ public List < AppKey > createNewAppKeysFromResults ( Scan scan , long startTime , long endTime , int maxCount ) throws IOException { } }
ResultScanner scanner = null ; List < AppKey > newAppsKeys = new ArrayList < AppKey > ( ) ; Table versionsTable = null ; try { Stopwatch timer = new Stopwatch ( ) . start ( ) ; int rowCount = 0 ; long colCount = 0 ; long resultSize = 0 ; versionsTable = hbaseConnection . getTable ( TableName . valueOf ( Constants . HISTORY_APP_VERSION_TABLE ) ) ; scanner = versionsTable . getScanner ( scan ) ; for ( Result result : scanner ) { if ( result != null && ! result . isEmpty ( ) ) { rowCount ++ ; colCount += result . size ( ) ; // TODO dogpiledays resultSize + = result . getWritableSize ( ) ; AppKey appKey = getNewAppKeyFromResult ( result , startTime , endTime ) ; if ( appKey != null ) { newAppsKeys . add ( appKey ) ; } if ( newAppsKeys . size ( ) >= maxCount ) { break ; } } } timer . stop ( ) ; LOG . info ( " Fetched from hbase " + rowCount + " rows, " + colCount + " columns, " + resultSize + " bytes ( " + resultSize / ( 1024 * 1024 ) + ") MB, in total time of " + timer ) ; } finally { if ( scanner != null ) { scanner . close ( ) ; } if ( versionsTable != null ) { versionsTable . close ( ) ; } } return newAppsKeys ;
public class TrustGraphNode { /** * Determines the policy for forwarding received messages . * By default this policy drops messages with ttl higher than * getMaxRouteLength ( ) or there are no more hops ( ttl < = 1) * @ return true if the message should be forwarded */ protected boolean shouldForward ( TrustGraphAdvertisement message ) { } }
final int ttl = message . getInboundTTL ( ) ; if ( ttl <= 1 || ttl > getMaxRouteLength ( ) ) { return false ; } return true ;
public class GitlabAPI { /** * Gets a list of a project ' s jobs in Gitlab * @ param projectId the project id * @ return A list of project jobs */ public List < GitlabJob > getProjectJobs ( Integer projectId ) { } }
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabJob . URL + PARAM_MAX_ITEMS_PER_PAGE ; return retrieve ( ) . getAll ( tailUrl , GitlabJob [ ] . class ) ;
public class DefaultRelationshipCreator { /** * { @ inheritDoc } */ @ Override public Relationship createRelationship ( Node first , Node second ) { } }
return first . createRelationshipTo ( second , relationshipType ) ;
public class XmlReader { /** * Get the attribute value . * @ param attribute The attribute name ( must not be < code > null < / code > ) . * @ return The attribute value . * @ throws LionEngineException If attribute is not valid or does not exist . */ private String getValue ( String attribute ) { } }
Check . notNull ( attribute ) ; if ( root . hasAttribute ( attribute ) ) { return root . getAttribute ( attribute ) ; } throw new LionEngineException ( ERROR_ATTRIBUTE + attribute ) ;
public class ExtinctionCoefficient { /** * method to calculate the extinction coefficient for peptide * @ param monomers all monomers of the peptide * @ return extinction coefficient * @ throws IOException * @ throws HELM2HandledException if HELM2 features were there */ private static float calculateExtinctionFromPeptide ( List < Monomer > monomers ) throws IOException , HELM2HandledException { } }
if ( null == monomers || monomers . isEmpty ( ) ) { return 0.0f ; } Map < String , Integer > countMap = new HashMap < String , Integer > ( ) ; for ( Monomer monomer : monomers ) { if ( aminoAcidMap . containsKey ( monomer . getAlternateId ( ) ) ) { int count = 1 ; if ( countMap . containsKey ( monomer . getAlternateId ( ) ) ) { count = count + countMap . get ( monomer . getAlternateId ( ) ) ; } countMap . put ( monomer . getAlternateId ( ) , count ) ; } } float result = 0.0f ; Set < String > keys = countMap . keySet ( ) ; for ( Iterator < String > it = keys . iterator ( ) ; it . hasNext ( ) ; ) { String key = it . next ( ) ; int count = countMap . get ( key ) ; float factor = aminoAcidMap . get ( key ) ; result = result + factor * count ; } return BigDecimal . valueOf ( result ) . floatValue ( ) ;
public class DefaultSecurityControllerManager { /** * Get the security controller for the given id . If the id is registered in our map , * then return the registered controller . If not , then try to obtain a bean with the * given id if it implements the SecurityController interface . * @ param id of controller to retrieve * @ return controller , null if not found */ public SecurityController getSecurityController ( String id ) { } }
SecurityController sc = ( SecurityController ) securityControllerMap . get ( id ) ; if ( sc == null ) { // Try for a named bean try { sc = applicationContext . getBean ( id , SecurityController . class ) ; } catch ( NoSuchBeanDefinitionException e ) { // Try for a fallback sc = getFallbackSecurityController ( ) ; } } return sc ;
public class MaterialTree { /** * Recursive function to expand each tree item . */ protected void expandItems ( MaterialTreeItem item ) { } }
item . expand ( ) ; item . setHide ( true ) ; item . getTreeItems ( ) . forEach ( this :: expandItems ) ;
public class AbsModule { /** * Asserts that the given { @ code object } with name { @ code param } is not null , throws * { @ link IllegalArgumentException } otherwise . */ void assertNotNull ( Object object , String param ) { } }
if ( object == null ) { throw new IllegalArgumentException ( String . format ( "%s may not be null." , param ) ) ; }
public class Cards { /** * 创建优惠券 * @ param coupon * @ return */ public String coupon ( Coupon coupon ) { } }
Card card = new Card ( ) ; card . setCardType ( "GENERAL_COUPON" ) ; card . setCoupon ( coupon ) ; return createCard ( card ) ;
public class FileService { /** * returns the absolute path to the final based file output folder where the * resource is configured * @ param file * Relative file from remote resource * @ param basePath * Absolute path to outputdirectory * @ param destinationFolder * Relative sub path from output directory * @ param isFlatten * @ return absolute path file in output directory */ private static StringBuilder buildAbsoluteFinalFile ( String file , String basePath , File destinationFolder , boolean isFlatten ) { } }
StringBuilder retval = new StringBuilder ( destinationFolder . getAbsolutePath ( ) ) ; PathUtils . addEndingSlashIfNeeded ( retval ) ; if ( ! isFlatten ) { // delete output directory from basePath String relativePath = file . replace ( basePath , "" ) ; retval . append ( relativePath ) ; } else { // skip location file String relativePath = new File ( file ) . getName ( ) ; retval . append ( relativePath ) ; } return retval ;
public class Sum { /** * Backward pass : dG / dx _ i = dG / dy dy / dx _ i = dG / dy */ @ Override public void backward ( ) { } }
Tensor xAdj = modIn . getOutputAdj ( ) ; xAdj . add ( yAdj . getValue ( 0 ) ) ;
public class SessionApi { /** * Get DNs for a place * Get all DNs attached to the specified place . * @ param placeName The name of the place . ( required ) * @ return ApiResponse & lt ; Devices & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < Devices > getDevicesForPlaceWithHttpInfo ( String placeName ) throws ApiException { } }
com . squareup . okhttp . Call call = getDevicesForPlaceValidateBeforeCall ( placeName , null , null ) ; Type localVarReturnType = new TypeToken < Devices > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class Chars { /** * Arrays . copyOf ( ) requires Java 6 */ private static char [ ] copyOf ( char [ ] original , int length ) { } }
char [ ] copy = new char [ length ] ; System . arraycopy ( original , 0 , copy , 0 , Math . min ( original . length , length ) ) ; return copy ;
public class MongoEntityExtractor { /** * { @ inheritDoc } */ @ Override public T transformElement ( Tuple2 < Object , BSONObject > tuple , DeepJobConfig < T , ? extends DeepJobConfig > config ) { } }
try { return ( T ) UtilMongoDB . getObjectFromBson ( config . getEntityClass ( ) , tuple . _2 ( ) ) ; } catch ( Exception e ) { LOG . error ( "Cannot convert BSON: " , e ) ; throw new DeepTransformException ( "Could not transform from Bson to Entity " + e . getMessage ( ) , e ) ; }
public class AlluxioJobMasterMonitor { /** * Starts the Alluxio job _ master monitor . * @ param args command line arguments , should be empty */ public static void main ( String [ ] args ) { } }
if ( args . length != 0 ) { LOG . info ( "java -cp {} {}" , RuntimeConstants . ALLUXIO_JAR , AlluxioJobMasterMonitor . class . getCanonicalName ( ) ) ; LOG . warn ( "ignoring arguments" ) ; } AlluxioConfiguration conf = new InstancedConfiguration ( ConfigurationUtils . defaults ( ) ) ; HealthCheckClient client ; // Only the primary master serves RPCs , so if we ' re configured for HA , fall back to simply // checking for the running process . if ( ConfigurationUtils . isHaMode ( conf ) ) { client = new MasterHealthCheckClient . Builder ( conf ) . withAlluxioMasterType ( MasterHealthCheckClient . MasterType . JOB_MASTER ) . build ( ) ; } else { client = new JobMasterRpcHealthCheckClient ( NetworkAddressUtils . getConnectAddress ( NetworkAddressUtils . ServiceType . JOB_MASTER_RPC , conf ) , AlluxioMasterMonitor . TWO_MIN_EXP_BACKOFF , conf ) ; } if ( ! client . isServing ( ) ) { System . exit ( 1 ) ; } System . exit ( 0 ) ;
public class EMFGeneratorFragment { /** * Sets the target EMF runtime version to generate for to the specified value . * @ param emfRuntimeVersion the EMF runtime version . * @ since 2.3 */ public void setEmfRuntimeVersion ( String emfRuntimeVersion ) { } }
this . emfRuntimeVerison = GenRuntimeVersion . get ( emfRuntimeVersion ) ; if ( this . emfRuntimeVerison == null ) { log . warn ( "Illegal EMF runtime verison " + emfRuntimeVersion + ". Using default version instead." ) ; }
public class AesEncrypter { /** * Returns a { @ link SecretKeySpec } given a secret key . * @ param secretKey */ private static SecretKeySpec keySpecFromSecretKey ( String secretKey ) { } }
if ( ! keySpecs . containsKey ( secretKey ) ) { byte [ ] ivraw = secretKey . getBytes ( ) ; SecretKeySpec skeySpec = new SecretKeySpec ( ivraw , "AES" ) ; // $ NON - NLS - 1 $ keySpecs . put ( secretKey , skeySpec ) ; } return keySpecs . get ( secretKey ) ;
public class FileUtil { /** * Writes the specified byte array to a file . * @ param file The < code > File < / code > to write . * @ param contents The byte array to write to the file . * @ param createDirectory A value indicating whether the directory * containing the file to be written should be created if it does * not exist . * @ throws IOException If the file could not be written . */ public static void setFileContents ( File file , ByteBuffer contents , boolean createDirectory ) throws IOException { } }
if ( createDirectory ) { File directory = file . getParentFile ( ) ; if ( ! directory . exists ( ) ) { directory . mkdirs ( ) ; } } FileOutputStream stream = new FileOutputStream ( file ) ; StreamUtil . writeBytes ( contents , stream ) ; stream . close ( ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcCardinalPointReference ( ) { } }
if ( ifcCardinalPointReferenceEClass == null ) { ifcCardinalPointReferenceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 786 ) ; } return ifcCardinalPointReferenceEClass ;
public class ExpressionUtils { /** * Create a { @ code left in right } expression * @ param < D > type of expressions * @ param left lhs of expression * @ param right rhs of expression * @ return left in right */ public static < D > Predicate in ( Expression < D > left , CollectionExpression < ? , ? extends D > right ) { } }
return predicate ( Ops . IN , left , right ) ;
public class WMenu { /** * Returns the selected item ( WMenUItem / WSubMenu , depending on the menu type ) in the given context . * @ return the selected item , or null if no item has been selected . */ public MenuItemSelectable getSelectedMenuItem ( ) { } }
List < MenuItemSelectable > selectedItems = getSelectedMenuItems ( ) ; if ( selectedItems . isEmpty ( ) ) { return null ; } else { return selectedItems . get ( 0 ) ; }
public class lbvserver { /** * Use this API to add lbvserver . */ public static base_response add ( nitro_service client , lbvserver resource ) throws Exception { } }
lbvserver addresource = new lbvserver ( ) ; addresource . name = resource . name ; addresource . servicetype = resource . servicetype ; addresource . ipv46 = resource . ipv46 ; addresource . ippattern = resource . ippattern ; addresource . ipmask = resource . ipmask ; addresource . port = resource . port ; addresource . range = resource . range ; addresource . persistencetype = resource . persistencetype ; addresource . timeout = resource . timeout ; addresource . persistencebackup = resource . persistencebackup ; addresource . backuppersistencetimeout = resource . backuppersistencetimeout ; addresource . lbmethod = resource . lbmethod ; addresource . hashlength = resource . hashlength ; addresource . netmask = resource . netmask ; addresource . v6netmasklen = resource . v6netmasklen ; addresource . cookiename = resource . cookiename ; addresource . rule = resource . rule ; addresource . listenpolicy = resource . listenpolicy ; addresource . listenpriority = resource . listenpriority ; addresource . resrule = resource . resrule ; addresource . persistmask = resource . persistmask ; addresource . v6persistmasklen = resource . v6persistmasklen ; addresource . pq = resource . pq ; addresource . sc = resource . sc ; addresource . rtspnat = resource . rtspnat ; addresource . m = resource . m ; addresource . tosid = resource . tosid ; addresource . datalength = resource . datalength ; addresource . dataoffset = resource . dataoffset ; addresource . sessionless = resource . sessionless ; addresource . state = resource . state ; addresource . connfailover = resource . connfailover ; addresource . redirurl = resource . redirurl ; addresource . cacheable = resource . cacheable ; addresource . clttimeout = resource . clttimeout ; addresource . somethod = resource . somethod ; addresource . sopersistence = resource . sopersistence ; addresource . sopersistencetimeout = resource . sopersistencetimeout ; addresource . healththreshold = resource . healththreshold ; addresource . sothreshold = resource . sothreshold ; addresource . sobackupaction = resource . sobackupaction ; addresource . redirectportrewrite = resource . redirectportrewrite ; addresource . downstateflush = resource . downstateflush ; addresource . backupvserver = resource . backupvserver ; addresource . disableprimaryondown = resource . disableprimaryondown ; addresource . insertvserveripport = resource . insertvserveripport ; addresource . vipheader = resource . vipheader ; addresource . authenticationhost = resource . authenticationhost ; addresource . authentication = resource . authentication ; addresource . authn401 = resource . authn401 ; addresource . authnvsname = resource . authnvsname ; addresource . push = resource . push ; addresource . pushvserver = resource . pushvserver ; addresource . pushlabel = resource . pushlabel ; addresource . pushmulticlients = resource . pushmulticlients ; addresource . tcpprofilename = resource . tcpprofilename ; addresource . httpprofilename = resource . httpprofilename ; addresource . dbprofilename = resource . dbprofilename ; addresource . comment = resource . comment ; addresource . l2conn = resource . l2conn ; addresource . mssqlserverversion = resource . mssqlserverversion ; addresource . mysqlprotocolversion = resource . mysqlprotocolversion ; addresource . mysqlserverversion = resource . mysqlserverversion ; addresource . mysqlcharacterset = resource . mysqlcharacterset ; addresource . mysqlservercapabilities = resource . mysqlservercapabilities ; addresource . appflowlog = resource . appflowlog ; addresource . netprofile = resource . netprofile ; addresource . icmpvsrresponse = resource . icmpvsrresponse ; addresource . newservicerequest = resource . newservicerequest ; addresource . newservicerequestunit = resource . newservicerequestunit ; addresource . newservicerequestincrementinterval = resource . newservicerequestincrementinterval ; addresource . minautoscalemembers = resource . minautoscalemembers ; addresource . maxautoscalemembers = resource . maxautoscalemembers ; addresource . persistavpno = resource . persistavpno ; addresource . skippersistency = resource . skippersistency ; addresource . td = resource . td ; addresource . authnprofile = resource . authnprofile ; addresource . macmoderetainvlan = resource . macmoderetainvlan ; addresource . dbslb = resource . dbslb ; addresource . dns64 = resource . dns64 ; addresource . bypassaaaa = resource . bypassaaaa ; addresource . recursionavailable = resource . recursionavailable ; return addresource . add_resource ( client ) ;
public class SqlLifecycle { /** * Emit logs and metrics for this query . * @ param e exception that occurred while processing this query * @ param remoteAddress remote address , for logging ; or null if unknown * @ param bytesWritten number of bytes written ; will become a query / bytes metric if > = 0 */ public void emitLogsAndMetrics ( @ Nullable final Throwable e , @ Nullable final String remoteAddress , final long bytesWritten ) { } }
synchronized ( lock ) { if ( sql == null ) { // Never initialized , don ' t log or emit anything . return ; } if ( state == State . DONE ) { log . warn ( "Tried to emit logs and metrics twice for query[%s]!" , sqlQueryId ( ) ) ; } state = State . DONE ; final boolean success = e == null ; final long queryTimeNs = System . nanoTime ( ) - startNs ; try { ServiceMetricEvent . Builder metricBuilder = ServiceMetricEvent . builder ( ) ; if ( plannerContext != null ) { metricBuilder . setDimension ( "id" , plannerContext . getSqlQueryId ( ) ) ; metricBuilder . setDimension ( "nativeQueryIds" , plannerContext . getNativeQueryIds ( ) . toString ( ) ) ; } if ( plannerResult != null ) { metricBuilder . setDimension ( "dataSource" , plannerResult . datasourceNames ( ) . toString ( ) ) ; } metricBuilder . setDimension ( "remoteAddress" , StringUtils . nullToEmptyNonDruidDataString ( remoteAddress ) ) ; metricBuilder . setDimension ( "success" , String . valueOf ( success ) ) ; emitter . emit ( metricBuilder . build ( "sqlQuery/time" , TimeUnit . NANOSECONDS . toMillis ( queryTimeNs ) ) ) ; if ( bytesWritten >= 0 ) { emitter . emit ( metricBuilder . build ( "sqlQuery/bytes" , bytesWritten ) ) ; } final Map < String , Object > statsMap = new LinkedHashMap < > ( ) ; statsMap . put ( "sqlQuery/time" , TimeUnit . NANOSECONDS . toMillis ( queryTimeNs ) ) ; statsMap . put ( "sqlQuery/bytes" , bytesWritten ) ; statsMap . put ( "success" , success ) ; statsMap . put ( "context" , queryContext ) ; if ( plannerContext != null ) { statsMap . put ( "identity" , plannerContext . getAuthenticationResult ( ) . getIdentity ( ) ) ; queryContext . put ( "nativeQueryIds" , plannerContext . getNativeQueryIds ( ) . toString ( ) ) ; } if ( e != null ) { statsMap . put ( "exception" , e . toString ( ) ) ; if ( e instanceof QueryInterruptedException ) { statsMap . put ( "interrupted" , true ) ; statsMap . put ( "reason" , e . toString ( ) ) ; } } requestLogger . logSqlQuery ( RequestLogLine . forSql ( sql , queryContext , DateTimes . utc ( startMs ) , remoteAddress , new QueryStats ( statsMap ) ) ) ; } catch ( Exception ex ) { log . error ( ex , "Unable to log sql [%s]!" , sql ) ; } }
public class Bound { /** * Returns true if left is overlapping or adjacent to right */ public static boolean adOrOver ( Bound < ? > left , Bound < ? > right ) { } }
boolean isValueEqual = left . getValue ( ) . equals ( right . getValue ( ) ) ; boolean isBothOpen = left . getBoundaryType ( ) == RangeBoundary . OPEN && right . getBoundaryType ( ) == RangeBoundary . OPEN ; return isValueEqual && ! isBothOpen ;
public class PrototypeScopedView { /** * You can inject UI scoped beans into a prototype scoped bean */ @ PostConstruct void init ( ) { } }
LOGGER . info ( "I'm being created: {}" , this ) ; setMargin ( true ) ; setSpacing ( true ) ; final Label label = new Label ( String . format ( "This is a prototype scoped view. A new instance is created every time this view is shown. " + "This particular instance is <b>%s</b>. If you navigate away from this view and back, you'll notice that the instance changes every time." , this ) ) ; label . setContentMode ( ContentMode . HTML ) ; addComponent ( label ) ; addComponent ( new Button ( "Invoke a UI scoped business object" , new Button . ClickListener ( ) { @ Override public void buttonClick ( Button . ClickEvent event ) { addComponent ( new Label ( uiScopedBusinessObject . sayHello ( ) ) ) ; } } ) ) ;
public class Primitives { /** * Parses the char sequence argument as a boolean . The boolean returned represents * the value true if the char sequence argument is not null and it ' s digit value * is 1. * @ param cs * @ param radix Must be 2. * @ param beginIndex the index to the first char of the text range . * @ param endIndex the index after the last char of the text range . * @ return * @ throws IllegalArgumentException radix ! = 2 or if code point count ! = 1 * or if input digit is not 0/1. * @ see java . lang . Character # digit ( int , int ) * @ see java . lang . Character # codePointCount ( java . lang . CharSequence , int , int ) */ public static final boolean parseBoolean ( CharSequence cs , int radix , int beginIndex , int endIndex ) { } }
if ( radix != 2 ) { throw new IllegalArgumentException ( "radix must be 2" ) ; } if ( Character . codePointCount ( cs , beginIndex , endIndex ) != 1 ) { throw new IllegalArgumentException ( "input length must be 1" ) ; } int digit = Character . digit ( Character . codePointAt ( cs , beginIndex ) , 2 ) ; switch ( digit ) { case 1 : return true ; case 0 : return false ; default : throw new IllegalArgumentException ( "input must be 0/1" ) ; }
public class PythonStreamExecutionEnvironment { /** * Creates a python data stream from the given iterator . * < p > Note that this operation will result in a non - parallel data stream source , i . e . , * a data stream source with a parallelism of one . < / p > * @ param iter The iterator of elements to create the data stream from * @ return The data stream representing the elements in the iterator * @ see StreamExecutionEnvironment # fromCollection ( java . util . Iterator , org . apache . flink . api . common . typeinfo . TypeInformation ) */ public PythonDataStream from_collection ( Iterator < Object > iter ) throws Exception { } }
return new PythonDataStream < > ( env . addSource ( new PythonIteratorFunction ( iter ) , TypeExtractor . getForClass ( Object . class ) ) . map ( new AdapterMap < > ( ) ) ) ;
public class WorkflowEngineOperationsProcessor { /** * Continue processing from current state */ private void continueProcessing ( ) { } }
try { while ( ! Thread . currentThread ( ) . isInterrupted ( ) ) { HashMap < String , String > changes = new HashMap < > ( ) ; // load all changes already in the queue getAvailableChanges ( changes ) ; if ( changes . isEmpty ( ) ) { if ( inProcess . isEmpty ( ) ) { // no pending operations , signalling no new state changes will occur workflowEngine . event ( WorkflowSystemEventType . EndOfChanges , "No more state changes expected, finishing workflow." ) ; return ; } if ( Thread . currentThread ( ) . isInterrupted ( ) ) { break ; } waitForChanges ( changes ) ; } if ( changes . isEmpty ( ) ) { // no changes within sleep time , try again continue ; } getContextGlobalData ( changes ) ; // handle state changes processStateChanges ( changes ) ; if ( workflowEngine . isWorkflowEndState ( workflowEngine . getState ( ) ) ) { workflowEngine . event ( WorkflowSystemEventType . WorkflowEndState , "Workflow end state reached." ) ; return ; } processOperations ( results :: add ) ; } } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } if ( Thread . currentThread ( ) . isInterrupted ( ) ) { workflowEngine . event ( WorkflowSystemEventType . Interrupted , "Engine interrupted, stopping engine..." ) ; cancelFutures ( ) ; interrupted = Thread . interrupted ( ) ; } awaitFutures ( ) ;
public class Common { /** * Set the default amount of money a account will have * @ param value the default amount of money */ public void setDefaultHoldings ( double value ) { } }
getStorageHandler ( ) . getStorageEngine ( ) . setConfigEntry ( "holdings" , String . valueOf ( value ) ) ; holdings = value ;
public class UicStatsAsHtml { /** * Writes a row containing a single stat . * @ param writer the writer to write the row to . * @ param stat the stat to write . */ private static void writeRow ( final PrintWriter writer , final UicStats . Stat stat ) { } }
writer . print ( "<tr>" ) ; writer . print ( "<td>" + stat . getClassName ( ) + "</td>" ) ; writer . print ( "<td>" + stat . getModelStateAsString ( ) + "</td>" ) ; if ( stat . getSerializedSize ( ) > 0 ) { writer . print ( "<td>" + stat . getSerializedSize ( ) + "</td>" ) ; } else { writer . print ( "<td>&#160;</td>" ) ; } writer . print ( "<td>" + stat . getRef ( ) + "</td>" ) ; writer . print ( "<td>" + stat . getName ( ) + "</td>" ) ; if ( stat . getComment ( ) == null ) { writer . print ( "<td>&#160;</td>" ) ; } else { writer . print ( "<td>" + stat . getComment ( ) + "</td>" ) ; } writer . println ( "</tr>" ) ;
public class ServletContextResourceReaderHandler { /** * ( non - Javadoc ) * @ see * net . jawr . web . resource . handler . reader . ResourceReaderHandler # getFilePath ( * java . lang . String ) */ @ Override public String getFilePath ( String resourcePath ) { } }
String filePath = null ; List < ResourceBrowser > list = new ArrayList < > ( ) ; list . addAll ( resourceInfoProviders ) ; for ( Iterator < ResourceBrowser > iterator = list . iterator ( ) ; iterator . hasNext ( ) && filePath == null ; ) { ResourceBrowser rsBrowser = iterator . next ( ) ; if ( generatorRegistry . isPathGenerated ( resourcePath ) ) { if ( rsBrowser instanceof ResourceGenerator ) { ResourceGenerator rsGeneratorBrowser = ( ResourceGenerator ) rsBrowser ; if ( rsGeneratorBrowser . getResolver ( ) . matchPath ( resourcePath ) ) { filePath = rsBrowser . getFilePath ( resourcePath ) ; } } } else { if ( ! ( rsBrowser instanceof ResourceGenerator ) ) { filePath = rsBrowser . getFilePath ( resourcePath ) ; } } } return filePath ;
public class Component { /** * Configures component by passing configuration parameters . * @ param config configuration parameters to be set . */ public void configure ( ConfigParams config ) throws ConfigException { } }
_dependencyResolver . configure ( config ) ; _logger . configure ( config ) ;
public class Control { /** * This method returns the default value for this control * @ return the default value for this control * @ throws UnsupportedMethod if this control is of type { @ link V4L4JConstants # CTRL _ TYPE _ STRING } * @ throws StateException if this control has been released and must not be used anymore */ public int getDefaultValue ( ) { } }
if ( type == V4L4JConstants . CTRL_TYPE_STRING ) throw new UnsupportedMethod ( "This control is a string control and does not support calls to getDefaultValue()" ) ; if ( type == V4L4JConstants . CTRL_TYPE_LONG ) throw new UnsupportedMethod ( "This control is a long control and does not support calls to getDefaultValue()" ) ; synchronized ( state ) { if ( state . isNotReleased ( ) ) return defaultValue ; else throw new StateException ( "This control has been released and must not be used" ) ; }
public class JSONWriter { /** * / * Overridable concrete typed write methods ; key conversions : */ protected String keyToString ( Object rawKey ) { } }
if ( rawKey instanceof String ) { return ( String ) rawKey ; } return String . valueOf ( rawKey ) ;
public class BlockReconstructor { /** * This reconstructs a single part file block by recovering in sequence each * parity block in the part file block . */ private void processParityHarPartBlock ( FileSystem dfs , Path partFile , long blockOffset , FileStatus partFileStat , HarIndex harIndex , File localBlockFile , Progressable progress ) throws IOException { } }
String partName = partFile . toUri ( ) . getPath ( ) ; // Temporarily . partName = partName . substring ( 1 + partName . lastIndexOf ( Path . SEPARATOR ) ) ; OutputStream out = new FileOutputStream ( localBlockFile ) ; try { // A HAR part file block could map to several parity files . We need to // use all of them to recover this block . final long blockEnd = Math . min ( blockOffset + partFileStat . getBlockSize ( ) , partFileStat . getLen ( ) ) ; for ( long offset = blockOffset ; offset < blockEnd ; ) { HarIndex . IndexEntry entry = harIndex . findEntry ( partName , offset ) ; if ( entry == null ) { String msg = "Lost index file has no matching index entry for " + partName + ":" + offset ; LOG . warn ( msg ) ; throw new IOException ( msg ) ; } Path parityFile = new Path ( entry . fileName ) ; Encoder encoder = null ; for ( Codec codec : Codec . getCodecs ( ) ) { if ( isParityFile ( parityFile , codec ) ) { encoder = new Encoder ( getConf ( ) , codec ) ; } } if ( encoder == null ) { String msg = "Could not figure out codec correctly for " + parityFile ; LOG . warn ( msg ) ; throw new IOException ( msg ) ; } Path srcFile = RaidUtils . sourcePathFromParityPath ( parityFile , dfs ) ; if ( null == srcFile ) { String msg = "Can not find the source path for parity file: " + parityFile ; LOG . warn ( msg ) ; throw new IOException ( msg ) ; } FileStatus srcStat = dfs . getFileStatus ( srcFile ) ; if ( srcStat . getModificationTime ( ) != entry . mtime ) { String msg = "Modification times of " + parityFile + " and " + srcFile + " do not match." ; LOG . warn ( msg ) ; throw new IOException ( msg ) ; } long lostOffsetInParity = offset - entry . startOffset ; LOG . info ( partFile + ":" + offset + " maps to " + parityFile + ":" + lostOffsetInParity + " and will be recovered from " + srcFile ) ; encoder . recoverParityBlockToStream ( dfs , srcStat , srcStat . getBlockSize ( ) , parityFile , lostOffsetInParity , out , progress ) ; // Finished recovery of one parity block . Since a parity block has the // same size as a source block , we can move offset by source block // size . offset += srcStat . getBlockSize ( ) ; LOG . info ( "Recovered " + srcStat . getBlockSize ( ) + " part file bytes " ) ; if ( offset > blockEnd ) { String msg = "Recovered block spills across part file blocks. Cannot continue" ; throw new IOException ( msg ) ; } progress . progress ( ) ; } } finally { out . close ( ) ; }
public class YearMonth { /** * Returns a copy of this year - month with the new year and month , checking * to see if a new object is in fact required . * @ param newYear the year to represent , validated from MIN _ YEAR to MAX _ YEAR * @ param newMonth the month - of - year to represent , validated not null * @ return the year - month , not null */ private YearMonth with ( int newYear , int newMonth ) { } }
if ( year == newYear && month == newMonth ) { return this ; } return new YearMonth ( newYear , newMonth ) ;
public class Matrix4x3d { /** * Set this matrix to a rotation matrix which rotates the given radians about a given axis . * The axis described by the < code > axis < / code > vector needs to be a unit vector . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin . * When used with a left - handed coordinate system , the rotation is clockwise . * @ param angle * the angle in radians * @ param axis * the axis to rotate about * @ return this */ public Matrix4x3d rotation ( double angle , Vector3fc axis ) { } }
return rotation ( angle , axis . x ( ) , axis . y ( ) , axis . z ( ) ) ;
public class CodeWriter { /** * Emits { @ code modifiers } in the standard order . Modifiers in { @ code implicitModifiers } will not * be emitted . */ public void emitModifiers ( Set < Modifier > modifiers , Set < Modifier > implicitModifiers ) throws IOException { } }
if ( modifiers . isEmpty ( ) ) return ; for ( Modifier modifier : EnumSet . copyOf ( modifiers ) ) { if ( implicitModifiers . contains ( modifier ) ) continue ; emitAndIndent ( modifier . name ( ) . toLowerCase ( Locale . US ) ) ; emitAndIndent ( " " ) ; }
public class HTODDependencyTable { /** * This adds a entry to the ValueSet for the specified dependency . The dependency is found * in the dependencyToEntryTable . * @ param dependency The dependency . * @ param valueSet containing all entries for this dependency . * @ param entry The new entry to add . */ public int add ( Object dependency , ValueSet valueSet , Object entry ) { } }
int returnCode = HTODDynacache . NO_EXCEPTION ; dependencyNotUpdatedTable . remove ( dependency ) ; valueSet . add ( entry ) ; if ( valueSet . size ( ) > this . delayOffloadEntriesLimit ) { if ( this . type == DEP_ID_TABLE ) { returnCode = this . htod . writeValueSet ( HTODDynacache . DEP_ID_DATA , dependency , valueSet , HTODDynacache . ALL ) ; // valueSet may be empty after writeValueSet this . htod . cache . getCacheStatisticsListener ( ) . depIdsOffloadedToDisk ( dependency ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "***** add dependency id=" + dependency + " size=" + valueSet . size ( ) ) ; } else { returnCode = this . htod . writeValueSet ( HTODDynacache . TEMPLATE_ID_DATA , dependency , valueSet , HTODDynacache . ALL ) ; // valueSet may be empty after writeValueSet this . htod . cache . getCacheStatisticsListener ( ) . templatesOffloadedToDisk ( dependency ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "***** add dependency id=" + dependency + " size=" + valueSet . size ( ) ) ; } dependencyToEntryTable . remove ( dependency ) ; if ( returnCode == HTODDynacache . DISK_SIZE_OVER_LIMIT_EXCEPTION && valueSet . size ( ) > 0 ) { this . htod . delCacheEntry ( valueSet , CachePerf . DISK_OVERFLOW , CachePerf . LOCAL , ! Cache . FROM_DEPID_TEMPLATE_INVALIDATION , HTODInvalidationBuffer . FIRE_EVENT ) ; returnCode = HTODDynacache . NO_EXCEPTION ; } } return returnCode ;
public class AbstractPageFactory { /** * { @ inheritDoc } */ @ Override public void updated ( Dictionary < String , ? > config ) throws ConfigurationException { } }
if ( config == null ) { synchronized ( this ) { pageServiceRegistration . setProperties ( properties ) ; } return ; } String pagename = ( String ) config . get ( PAGE_NAME ) ; String appname = ( String ) config . get ( APPLICATION_NAME ) ; setPageName ( pagename ) ; setApplicationName ( appname ) ; synchronized ( this ) { pageServiceRegistration . setProperties ( config ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link JournalCode } { @ code > } } */ @ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "JournalCode" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "IntuitObject" ) public JAXBElement < JournalCode > createJournalCode ( JournalCode value ) { } }
return new JAXBElement < JournalCode > ( _JournalCode_QNAME , JournalCode . class , null , value ) ;
public class CDIUtils { /** * Read the file META - INF / services / javax . enterprise . inject . spi . Extension and return the extension class names * @ param metaInfServicesEntry * @ return */ public static Set < String > parseServiceSPIExtensionFile ( Resource metaInfServicesEntry ) { } }
Set < String > serviceClazz = new HashSet < String > ( ) ; URL metaInfServicesUrl = metaInfServicesEntry == null ? null : metaInfServicesEntry . getURL ( ) ; if ( metaInfServicesUrl != null ) { InputStream is = null ; BufferedReader bfReader = null ; InputStreamReader isReader = null ; try { is = metaInfServicesUrl . openStream ( ) ; bfReader = new BufferedReader ( isReader = new InputStreamReader ( is , "UTF-8" ) ) ; String line ; while ( ( line = bfReader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( ! line . isEmpty ( ) && ! ( line . startsWith ( "#" ) ) ) { // just to strip off # int hashPos = line . indexOf ( "#" ) ; if ( hashPos != - 1 ) { line = line . substring ( 0 , hashPos ) ; } serviceClazz . add ( line ) ; } } } catch ( IOException e ) { throw new CDIRuntimeException ( e ) ; } finally { try { if ( is != null ) { is . close ( ) ; } if ( isReader != null ) { isReader . close ( ) ; } if ( bfReader != null ) { bfReader . close ( ) ; } } catch ( IOException e ) { throw new CDIRuntimeException ( e ) ; } } } return serviceClazz ;
public class SmbSessionImpl { /** * { @ inheritDoc } * @ see jcifs . SmbSession # unwrap ( java . lang . Class ) */ @ SuppressWarnings ( "unchecked" ) @ Override public < T extends SmbSession > T unwrap ( Class < T > type ) { } }
if ( type . isAssignableFrom ( this . getClass ( ) ) ) { return ( T ) this ; } throw new ClassCastException ( ) ;
public class IfcConnectedFaceSetImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcFace > getCfsFaces ( ) { } }
return ( EList < IfcFace > ) eGet ( Ifc2x3tc1Package . Literals . IFC_CONNECTED_FACE_SET__CFS_FACES , true ) ;
public class GridBagLayoutFormBuilder { /** * Appends a label and field to the end of the current line . * The label will be to the left of the field , and be right - justified . * < br / > * The field will " grow " horizontally as space allows . * @ param propertyName the name of the property to create the controls for * @ param colSpan the number of columns the field should span * @ return " this " to make it easier to string together append calls * @ see FormComponentInterceptor # processLabel ( String , JComponent ) */ public GridBagLayoutFormBuilder appendLabeledField ( String propertyName , final JComponent field , LabelOrientation labelOrientation , int colSpan ) { } }
return appendLabeledField ( propertyName , field , labelOrientation , colSpan , 1 , true , false ) ;
public class ClientConfiguration { /** * Returns the Java system property for proxy port depending on * { @ link # getProtocol ( ) } : i . e . if protocol is https , returns * the value of the system property https . proxyPort , otherwise * returns value of http . proxyPort . Defaults to { @ link this . proxyPort } * if the system property is not set with a valid port number . */ private int getProxyPortProperty ( ) { } }
final String proxyPortString = ( getProtocol ( ) == Protocol . HTTPS ) ? getSystemProperty ( "https.proxyPort" ) : getSystemProperty ( "http.proxyPort" ) ; try { return Integer . parseInt ( proxyPortString ) ; } catch ( NumberFormatException e ) { return proxyPort ; }
public class Jazz { /** * Displays a static picture in a single window . * You can open multiple windows using this method . * This method used an { @ link Animation } and allows for zooming and panning . * @ since 1.0.0 * @ param title * The title of the displayed window . * @ param width * The width of the displayed window . * @ param height * The height of the displayed window . * @ param picture * The picture to be drawn in the displayed window . * @ return A reference to the newly created window . */ public static Window display ( final String title , final int width , final int height , final Picture picture ) { } }
return play ( title , width , height , new Animation ( ) { @ Override public Picture getPicture ( ) { return picture ; } @ Override public void update ( final double time , final double delta ) { // do nothing , the picture is static . } } ) ;
public class ServletRESTRequestWithParams { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . rest . handler . RESTRequest # getLocales ( ) */ @ Override public Enumeration < Locale > getLocales ( ) { } }
ServletRESTRequestImpl ret = castRequest ( ) ; if ( ret != null ) return ret . getLocales ( ) ; return null ;
public class JBBPBitInputStream { /** * Read number of integer items from the input stream . * @ param items number of items to be read from the input stream , if less than * zero then all stream till the end will be read * @ param byteOrder the order of bytes to be used to decode values * @ return read items as an integer array * @ throws IOException it will be thrown for any transport problem during the * operation * @ see JBBPByteOrder # BIG _ ENDIAN * @ see JBBPByteOrder # LITTLE _ ENDIAN */ public int [ ] readIntArray ( final int items , final JBBPByteOrder byteOrder ) throws IOException { } }
int pos = 0 ; if ( items < 0 ) { int [ ] buffer = new int [ INITIAL_ARRAY_BUFFER_SIZE ] ; // till end while ( hasAvailableData ( ) ) { final int next = readInt ( byteOrder ) ; if ( buffer . length == pos ) { final int [ ] newbuffer = new int [ buffer . length << 1 ] ; System . arraycopy ( buffer , 0 , newbuffer , 0 , buffer . length ) ; buffer = newbuffer ; } buffer [ pos ++ ] = next ; } if ( buffer . length == pos ) { return buffer ; } final int [ ] result = new int [ pos ] ; System . arraycopy ( buffer , 0 , result , 0 , pos ) ; return result ; } else { // number final int [ ] buffer = new int [ items ] ; for ( int i = 0 ; i < items ; i ++ ) { buffer [ i ] = readInt ( byteOrder ) ; } return buffer ; }
public class Wings { /** * Subscribes to link state changes of the endpoints . The subscribing { @ link java . lang . Object } must * have one or more { @ link com . squareup . otto . Subscribe } - annotated methods , each taking a single * parameter that corresponds to the { @ link com . groundupworks . wings . WingsEndpoint . LinkEvent } subclass of the * endpoint subscribed to . * Upon subscription , the subscriber will immediately receive an event with the current link state * even though the link state did not actually change . This initial value allows the subscriber * to reflect the initial link state in the ui . * @ param object the { @ link java . lang . Object } subscribing to the link state changes of the endpoints . * @ throws IllegalStateException Wings must be initialized . See { @ link Wings # init ( IWingsModule , Class [ ] ) } . */ public static void subscribe ( Object object ) throws IllegalStateException { } }
if ( ! sIsInitialized ) { throw new IllegalStateException ( "Wings must be initialized. See Wings#init()." ) ; } WingsInjector . getBus ( ) . register ( object ) ;
public class DefaultCustomizationCollection { /** * Adds a customization to the collection . * @ return always { @ code true } * @ throws IllegalArgumentException if the entry is already existing . */ @ Override public boolean add ( final CustomizationSupplier < T > entry ) { } }
if ( list . contains ( entry ) ) { throw new IllegalArgumentException ( "duplicate entry" ) ; } return list . add ( entry ) ;
public class ResourceServerSecurityConfigurer { /** * Sets a custom { @ link AuthenticationDetailsSource } to use as a source * of authentication details . The default is { @ link OAuth2AuthenticationDetailsSource } . * @ param authenticationDetailsSource the custom { @ link AuthenticationDetailsSource } to use * @ return { @ link ResourceServerSecurityConfigurer } for additional customization */ public ResourceServerSecurityConfigurer authenticationDetailsSource ( AuthenticationDetailsSource < HttpServletRequest , ? > authenticationDetailsSource ) { } }
Assert . state ( authenticationDetailsSource != null , "AuthenticationDetailsSource cannot be null" ) ; this . authenticationDetailsSource = authenticationDetailsSource ; return this ;
public class Iso8601Format { /** * / * [ deutsch ] * < p > Interpretiert den angegebenen ISO - 8601 - kompatiblen Datumstext im < i > basic < / i > - Format * oder im < i > extended < / i > - Format . < / p > * @ param iso text like & quot ; 20160101 & quot ; , & quot ; 2016001 & quot ; , & quot ; 2016W011 & quot ; , * & quot ; 2016-01-01 & quot ; , & quot ; 2016-001 & quot ; or & quot ; 2016 - W01-1 & quot ; * @ return PlainDate * @ throws ParseException if parsing fails for any reason * @ since 3.22/4.18 */ public static PlainDate parseDate ( CharSequence iso ) throws ParseException { } }
ParseLog plog = new ParseLog ( ) ; PlainDate date = parseDate ( iso , plog ) ; if ( ( date == null ) || plog . isError ( ) ) { throw new ParseException ( plog . getErrorMessage ( ) , plog . getErrorIndex ( ) ) ; } else if ( plog . getPosition ( ) < iso . length ( ) ) { throw new ParseException ( "Trailing characters found: " + iso , plog . getPosition ( ) ) ; } else { return date ; }
public class PathUtil { /** * Unzip a file to a target directory . * @ param zip the path to the zip file . * @ param target the path to the target directory into which the zip file will be unzipped . * @ throws IOException */ public static void unzip ( Path zip , Path target ) throws IOException { } }
try ( final ZipFile zipFile = new ZipFile ( zip . toFile ( ) ) ) { unzip ( zipFile , target ) ; }
public class KTypeArrayDeque { /** * { @ inheritDoc } */ @ Override public int removeAll ( KType e1 ) { } }
int removed = 0 ; final int last = tail ; final int bufLen = buffer . length ; int from , to ; for ( from = to = head ; from != last ; from = oneRight ( from , bufLen ) ) { if ( Intrinsics . equals ( this , e1 , buffer [ from ] ) ) { buffer [ from ] = Intrinsics . empty ( ) ; removed ++ ; continue ; } if ( to != from ) { buffer [ to ] = buffer [ from ] ; buffer [ from ] = Intrinsics . empty ( ) ; } to = oneRight ( to , bufLen ) ; } tail = to ; return removed ;
public class Emitter { /** * Check if there is a valid HTML tag here . This method also transforms auto * links and mailto auto links . * @ param out * The StringBuilder to write to . * @ param in * Input String . * @ param start * Starting position . * @ return The new position or - 1 if nothing valid has been found . */ private int checkHtml ( final StringBuilder out , final String in , final int start ) { } }
final StringBuilder temp = new StringBuilder ( ) ; int pos ; // Check for auto links temp . setLength ( 0 ) ; pos = Utils . readUntil ( temp , in , start + 1 , ':' , ' ' , '>' , '\n' ) ; if ( pos != - 1 && in . charAt ( pos ) == ':' && HTML . isLinkPrefix ( temp . toString ( ) ) ) { pos = Utils . readUntil ( temp , in , pos , '>' ) ; if ( pos != - 1 ) { final String link = temp . toString ( ) ; this . config . decorator . openLink ( out ) ; out . append ( " href=\"" ) ; Utils . appendValue ( out , link , 0 , link . length ( ) ) ; out . append ( "\">" ) ; Utils . appendValue ( out , link , 0 , link . length ( ) ) ; this . config . decorator . closeLink ( out ) ; return pos ; } } // Check for mailto auto link temp . setLength ( 0 ) ; pos = Utils . readUntil ( temp , in , start + 1 , '@' , ' ' , '>' , '\n' ) ; if ( pos != - 1 && in . charAt ( pos ) == '@' ) { pos = Utils . readUntil ( temp , in , pos , '>' ) ; if ( pos != - 1 ) { final String link = temp . toString ( ) ; this . config . decorator . openLink ( out ) ; out . append ( " href=\"" ) ; Utils . appendMailto ( out , "mailto:" , 0 , 7 ) ; Utils . appendMailto ( out , link , 0 , link . length ( ) ) ; out . append ( "\">" ) ; Utils . appendMailto ( out , link , 0 , link . length ( ) ) ; this . config . decorator . closeLink ( out ) ; return pos ; } } // Check for inline html if ( start + 2 < in . length ( ) ) { temp . setLength ( 0 ) ; return Utils . readXML ( out , in , start , this . config . safeMode ) ; } return - 1 ;
public class VariantJSONQuery { /** * Return the specified token from the reader . If it is not found , throw an * IOException indicating that . Converting to chr to ( char ) chr is acceptable * because the ' tokens ' allowed in a JSON input stream ( true , false , null ) * are all ASCII . */ private void parseToken ( String token ) { } }
int len = token . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { int chr = sr . read ( ) ; if ( chr == - 1 ) { throw new IllegalArgumentException ( "EOF reached while reading token: " + token ) ; } chr = Character . toLowerCase ( ( char ) chr ) ; int loTokenChar = token . charAt ( i ) ; if ( loTokenChar != chr ) { throw new IllegalArgumentException ( "Expected token: " + token + " at position " + sr . getPosition ( ) ) ; } }
public class TransmitMessage { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteMessageControllable # getMEArrivalTimestamp ( ) */ public long getMEArrivalTimestamp ( ) throws SIMPControllableNotFoundException , SIMPException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMEArrivalTimestamp" ) ; long timestamp = getJsMessage ( ) . getCurrentMEArrivalTimestamp ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMEArrivalTimestamp" , new Long ( timestamp ) ) ; return timestamp ;
public class CaseArgumentAnalyser { /** * A scenario model is structural identical if all cases have exactly the same * steps , except for values of step arguments . * This is implemented by comparing all cases with the first one */ private boolean isStructuralIdentical ( ScenarioModel scenarioModel ) { } }
ScenarioCaseModel firstCase = scenarioModel . getScenarioCases ( ) . get ( 0 ) ; for ( int iCase = 1 ; iCase < scenarioModel . getScenarioCases ( ) . size ( ) ; iCase ++ ) { ScenarioCaseModel caseModel = scenarioModel . getScenarioCases ( ) . get ( iCase ) ; if ( stepsAreDifferent ( firstCase , caseModel ) ) { return false ; } } return true ;
public class JsonRpcMultiServer { /** * Returns the handler ' s class or interfaces . The serviceName is used * to look up a registered handler . * @ param serviceName the optional name of a service * @ return the class */ @ Override protected Class < ? > [ ] getHandlerInterfaces ( String serviceName ) { } }
Class < ? > remoteInterface = interfaceMap . get ( serviceName ) ; if ( remoteInterface != null ) { return new Class < ? > [ ] { remoteInterface } ; } else if ( Proxy . isProxyClass ( getHandler ( serviceName ) . getClass ( ) ) ) { return getHandler ( serviceName ) . getClass ( ) . getInterfaces ( ) ; } else { return new Class < ? > [ ] { getHandler ( serviceName ) . getClass ( ) } ; }
public class DBCluster { /** * Provides a list of the AWS Identity and Access Management ( IAM ) roles that are associated with the DB cluster . * IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other AWS services * on your behalf . * @ param associatedRoles * Provides a list of the AWS Identity and Access Management ( IAM ) roles that are associated with the DB * cluster . IAM roles that are associated with a DB cluster grant permission for the DB cluster to access * other AWS services on your behalf . */ public void setAssociatedRoles ( java . util . Collection < DBClusterRole > associatedRoles ) { } }
if ( associatedRoles == null ) { this . associatedRoles = null ; return ; } this . associatedRoles = new java . util . ArrayList < DBClusterRole > ( associatedRoles ) ;
public class Agg { /** * Get a { @ link Collector } that calculates the < code > MIN ( ) < / code > function . */ public static < T > Collector < T , ? , Optional < T > > min ( Comparator < ? super T > comparator ) { } }
return minBy ( t -> t , comparator ) ;
public class JobDefinitionService { /** * Returns an optional JobDefinition matching the given jobType . * @ param jobType case insensitive { @ link JobDefinition # jobType ( ) job type } * @ return optional JobDefinition */ public Optional < JobDefinition > getJobDefinition ( final String jobType ) { } }
return jobDefinitions . stream ( ) . filter ( ( j ) -> j . jobType ( ) . equalsIgnoreCase ( jobType ) ) . findAny ( ) ;
public class DocumentPermission { /** * Create a DocumentPermissionFetcher to execute fetch . * @ param pathServiceSid Sync Service Instance SID or unique name . * @ param pathDocumentSid Sync Document SID or unique name . * @ param pathIdentity Identity of the user to whom the Sync Document * Permission applies . * @ return DocumentPermissionFetcher capable of executing the fetch */ public static DocumentPermissionFetcher fetcher ( final String pathServiceSid , final String pathDocumentSid , final String pathIdentity ) { } }
return new DocumentPermissionFetcher ( pathServiceSid , pathDocumentSid , pathIdentity ) ;