signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ValidateInterpretation { /** * Main . * @ param args command line args */ public static void main ( final String [ ] args ) { } }
Switch about = new Switch ( "a" , "about" , "display about message" ) ; Switch help = new Switch ( "h" , "help" , "display help message" ) ; FileArgument expectedFile = new FileArgument ( "e" , "expected-file" , "expected interpretation file, default stdin; at least one of expected or observed file must be provided" , false ) ; FileArgument observedFile = new FileArgument ( "b" , "observed-file" , "observed interpretation file, default stdin; at least one of expected or observed file must be provided" , false ) ; FileArgument outputFile = new FileArgument ( "o" , "output-file" , "output file, default stdout" , false ) ; IntegerArgument resolution = new IntegerArgument ( "r" , "resolution" , "resolution, must be in the range [1..4], default " + DEFAULT_RESOLUTION , false ) ; StringListArgument loci = new StringListArgument ( "l" , "loci" , "list of loci to validate, default " + DEFAULT_LOCI , false ) ; Switch printSummary = new Switch ( "s" , "summary" , "print summary" ) ; ArgumentList arguments = new ArgumentList ( about , help , expectedFile , observedFile , outputFile , resolution , loci , printSummary ) ; CommandLine commandLine = new CommandLine ( args ) ; ValidateInterpretation validateInterpretation = null ; try { CommandLineParser . parse ( commandLine , arguments ) ; if ( about . wasFound ( ) ) { About . about ( System . out ) ; System . exit ( 0 ) ; } if ( help . wasFound ( ) ) { Usage . usage ( USAGE , null , commandLine , arguments , System . out ) ; System . exit ( 0 ) ; } // todo : allow for configuration of glclient validateInterpretation = new ValidateInterpretation ( expectedFile . getValue ( ) , observedFile . getValue ( ) , outputFile . getValue ( ) , resolution . getValue ( DEFAULT_RESOLUTION ) , loci . getValue ( DEFAULT_LOCI ) , printSummary . wasFound ( ) , LocalGlClient . create ( ) ) ; } catch ( CommandLineParseException e ) { if ( about . wasFound ( ) ) { About . about ( System . out ) ; System . exit ( 0 ) ; } if ( help . wasFound ( ) ) { Usage . usage ( USAGE , null , commandLine , arguments , System . out ) ; System . exit ( 0 ) ; } Usage . usage ( USAGE , e , commandLine , arguments , System . err ) ; System . exit ( - 1 ) ; } try { System . exit ( validateInterpretation . call ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . exit ( 1 ) ; }
public class EmptiesCheckPanel { /** * desc = " Generated Code " > / / GEN - BEGIN : initComponents */ private void initComponents ( ) { } }
pnlSummary = new javax . swing . JPanel ( ) ; lblSummary = new javax . swing . JLabel ( ) ; lblSummaryValue = new javax . swing . JLabel ( ) ; pnlEmptiesSummary = new javax . swing . JPanel ( ) ; jScrollConcepts = new javax . swing . JScrollPane ( ) ; jScrollRoles = new javax . swing . JScrollPane ( ) ; setFont ( new java . awt . Font ( "Arial" , 0 , 18 ) ) ; // NOI18N setMinimumSize ( new java . awt . Dimension ( 520 , 400 ) ) ; setPreferredSize ( new java . awt . Dimension ( 520 , 400 ) ) ; setLayout ( new java . awt . BorderLayout ( ) ) ; pnlSummary . setMinimumSize ( new java . awt . Dimension ( 156 , 23 ) ) ; pnlSummary . setPreferredSize ( new java . awt . Dimension ( 156 , 23 ) ) ; pnlSummary . setLayout ( new java . awt . FlowLayout ( java . awt . FlowLayout . LEFT ) ) ; lblSummary . setFont ( new java . awt . Font ( "Tahoma" , 1 , 11 ) ) ; // NOI18N lblSummary . setText ( "Empty concepts and roles" ) ; pnlSummary . add ( lblSummary ) ; lblSummaryValue . setFont ( new java . awt . Font ( "Tahoma" , 1 , 11 ) ) ; // NOI18N pnlSummary . add ( lblSummaryValue ) ; add ( pnlSummary , java . awt . BorderLayout . NORTH ) ; pnlEmptiesSummary . setLayout ( new javax . swing . BoxLayout ( pnlEmptiesSummary , javax . swing . BoxLayout . PAGE_AXIS ) ) ; pnlEmptiesSummary . add ( jScrollConcepts ) ; jScrollRoles . setCursor ( new java . awt . Cursor ( java . awt . Cursor . DEFAULT_CURSOR ) ) ; pnlEmptiesSummary . add ( jScrollRoles ) ; add ( pnlEmptiesSummary , java . awt . BorderLayout . CENTER ) ;
public class ReactionEngine { /** * Return the IParameterReact if it exists given the class . * @ param paramClass The class * @ return The IParameterReact */ public IParameterReact getParameterClass ( Class < ? > paramClass ) { } }
for ( Iterator < IParameterReact > it = paramsMap2 . iterator ( ) ; it . hasNext ( ) ; ) { IParameterReact ipr = it . next ( ) ; if ( ipr . getClass ( ) . equals ( paramClass ) ) return ipr ; } return null ;
public class DefaultQueryBuilder { /** * Sets the proposition ids to be queried . An array of length 0 or * < code > null < / code > means that all proposition ids will be queried . * @ param propIds a { @ link String [ ] } of proposition ids . If * < code > null < / code > , an empty { @ link String [ ] } will be stored . */ public final void setPropositionIds ( String [ ] propIds ) { } }
if ( propIds == null ) { this . propIds = ArrayUtils . EMPTY_STRING_ARRAY ; } else { this . propIds = propIds . clone ( ) ; ProtempaUtil . internAll ( this . propIds ) ; }
public class SymbolTable { /** * Index JSDocInfo . */ void fillJSDocInfo ( Node externs , Node root ) { } }
NodeTraversal . traverseRoots ( compiler , new JSDocInfoCollector ( compiler . getTypeRegistry ( ) ) , externs , root ) ; // Create references to parameters in the JSDoc . for ( Symbol sym : getAllSymbols ( ) ) { JSDocInfo info = sym . getJSDocInfo ( ) ; if ( info == null ) { continue ; } for ( Marker marker : info . getMarkers ( ) ) { SourcePosition < Node > pos = marker . getNameNode ( ) ; if ( pos == null ) { continue ; } Node paramNode = pos . getItem ( ) ; String name = paramNode . getString ( ) ; Symbol param = getParameterInFunction ( sym , name ) ; if ( param == null ) { // There is no reference to this parameter in the actual JavaScript // code , so we ' ll try to create a special JsDoc - only symbol in // a JsDoc - only scope . SourcePosition < Node > typePos = marker . getType ( ) ; JSType type = null ; if ( typePos != null ) { type = typePos . getItem ( ) . getJSType ( ) ; } if ( sym . docScope == null ) { sym . docScope = new SymbolScope ( null /* root */ , null /* parent scope */ , null /* type of this */ , sym ) ; } // Check to make sure there ' s no existing symbol . In theory , this // should never happen , but we check anyway and fail silently // if our assumptions are wrong . ( We do not want to put the symbol // table into an invalid state ) . Symbol existingSymbol = isAnySymbolDeclared ( name , paramNode , sym . docScope ) ; if ( existingSymbol == null ) { declareSymbol ( name , type , type == null , sym . docScope , paramNode , null /* info */ ) ; } } else { param . defineReferenceAt ( paramNode ) ; } } }
public class CollectionExecutor { private < IN > void executeDataSink ( GenericDataSinkBase < ? > sink , int superStep ) throws Exception { } }
Operator < ? > inputOp = sink . getInput ( ) ; if ( inputOp == null ) { throw new InvalidProgramException ( "The data sink " + sink . getName ( ) + " has no input." ) ; } @ SuppressWarnings ( "unchecked" ) List < IN > input = ( List < IN > ) execute ( inputOp ) ; @ SuppressWarnings ( "unchecked" ) GenericDataSinkBase < IN > typedSink = ( GenericDataSinkBase < IN > ) sink ; // build the runtime context and compute broadcast variables , if necessary TaskInfo taskInfo = new TaskInfo ( typedSink . getName ( ) , 1 , 0 , 1 , 0 ) ; RuntimeUDFContext ctx ; MetricGroup metrics = new UnregisteredMetricsGroup ( ) ; if ( RichOutputFormat . class . isAssignableFrom ( typedSink . getUserCodeWrapper ( ) . getUserCodeClass ( ) ) ) { ctx = superStep == 0 ? new RuntimeUDFContext ( taskInfo , userCodeClassLoader , executionConfig , cachedFiles , accumulators , metrics ) : new IterationRuntimeUDFContext ( taskInfo , userCodeClassLoader , executionConfig , cachedFiles , accumulators , metrics ) ; } else { ctx = null ; } typedSink . executeOnCollections ( input , ctx , executionConfig ) ;
public class WTableColumn { /** * Sets the column width . * @ param width the column width as a percentage , or & lt ; = 0 for default width . */ public void setWidth ( final int width ) { } }
if ( width > 100 ) { throw new IllegalArgumentException ( "Width (" + width + ") cannot be greater than 100 percent" ) ; } getOrCreateComponentModel ( ) . width = Math . max ( 0 , width ) ;
public class IpPermission { /** * The IPv4 ranges . * @ param ipv4Ranges * The IPv4 ranges . */ public void setIpv4Ranges ( java . util . Collection < IpRange > ipv4Ranges ) { } }
if ( ipv4Ranges == null ) { this . ipv4Ranges = null ; return ; } this . ipv4Ranges = new com . amazonaws . internal . SdkInternalList < IpRange > ( ipv4Ranges ) ;
public class RegistriesInner { /** * Regenerates the administrator login credentials for the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ 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 < RegistryCredentialsInner > regenerateCredentialsAsync ( String resourceGroupName , String registryName , final ServiceCallback < RegistryCredentialsInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( regenerateCredentialsWithServiceResponseAsync ( resourceGroupName , registryName ) , serviceCallback ) ;
public class ServerRequestQueue { /** * < p > Gets the queued { @ link ServerRequest } object at position with index 0 within the queue , but * unlike { @ link # dequeue ( ) } , does not remove it from the queue . < / p > * @ return The { @ link ServerRequest } object at position with index 0 within the queue . */ ServerRequest peek ( ) { } }
ServerRequest req = null ; synchronized ( reqQueueLockObject ) { try { req = queue . get ( 0 ) ; } catch ( IndexOutOfBoundsException | NoSuchElementException ignored ) { } } return req ;
public class SqsParametersMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SqsParameters sqsParameters , ProtocolMarshaller protocolMarshaller ) { } }
if ( sqsParameters == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sqsParameters . getMessageGroupId ( ) , MESSAGEGROUPID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ContentMatcher { /** * Load a pattern list from an XML formatted file . * Pattern should be enclosed around a { @ code < Patterns > } tag and should be * defined as { @ code < Pattern type = " xxx " > < / Pattern > } . Use " regex " to define * a Regex formatted pattern or " string " for an exact matching pattern . * @ param xmlInputStream the { @ code InputStream } used to read the patterns * @ throws JDOMException if an error occurred while parsing * @ throws IOException if an I / O error occurred while reading the { @ code InputStream } */ protected void loadXMLPatternDefinitions ( InputStream xmlInputStream ) throws JDOMException , IOException { } }
strings = new ArrayList < BoyerMooreMatcher > ( ) ; patterns = new ArrayList < Pattern > ( ) ; SAXBuilder builder = new SAXBuilder ( ) ; Document doc = builder . build ( xmlInputStream ) ; Element el = doc . getRootElement ( ) ; String value ; // now we have the < root > tag indexed so we can // go ahead for boundaries and tests for ( Object obj : el . getChildren ( TAG_PATTERN ) ) { el = ( Element ) obj ; value = el . getText ( ) ; // Check if the pattern has been set to null if ( value != null && ! value . isEmpty ( ) ) { // Check if a regex expression has been set if ( el . getAttributeValue ( TAG_PATTERN_TYPE ) . equalsIgnoreCase ( TAG_PATTERN_TYPE_REGEX ) ) { patterns . add ( Pattern . compile ( el . getText ( ) ) ) ; // Otherwise it ' s by default an exact match model } else { strings . add ( new BoyerMooreMatcher ( el . getText ( ) ) ) ; } } }
public class ZealotConfigManager { /** * 扫描 xml文件所在的文件位置 并识别配置加载到内存缓存中 . * @ param xmlLocations zealot的XML文件所在的位置 * @ return ZealotConfigManager的全局唯一实例 */ public ZealotConfigManager initLoadXmlLocations ( String xmlLocations ) { } }
this . xmlLocations = StringHelper . isBlank ( xmlLocations ) ? "zealot" : xmlLocations ; XmlScanner . newInstance ( ) . scan ( this . xmlLocations ) ; this . cachingXmlAndEval ( ) ; return this ;
public class StreamingJsonBuilder { /** * A closure passed to a JSON builder will create a root JSON object * Example : * < pre class = " groovyTestCase " > * new StringWriter ( ) . with { w - > * def json = new groovy . json . StreamingJsonBuilder ( w ) * json { * name " Tim " * age 39 * assert w . toString ( ) = = ' { " name " : " Tim " , " age " : 39 } ' * < / pre > * @ param c a closure whose method call statements represent key / values of a JSON object */ public Object call ( Closure c ) throws IOException { } }
writer . write ( "{" ) ; StreamingJsonDelegate . cloneDelegateAndGetContent ( writer , c ) ; writer . write ( "}" ) ; return null ;
public class XcapClientImpl { /** * ( non - Javadoc ) * @ see XcapClient # get ( java . net . URI , * Header [ ] , * Credentials ) */ public XcapResponse get ( URI uri , Header [ ] additionalRequestHeaders , Credentials credentials ) throws IOException { } }
if ( log . isDebugEnabled ( ) ) { log . debug ( "get(uri=" + uri + " , additionalRequestHeaders = ( " + Arrays . toString ( additionalRequestHeaders ) + " ) )" ) ; } return execute ( new HttpGet ( uri ) , additionalRequestHeaders , credentials ) ;
public class EventFragment { /** * < p > Performs < b > event listener linking < / b > by invoking { @ link EventUtils # link ( ) } . < / p > */ @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } }
super . onViewCreated ( view , savedInstanceState ) ; EventUtils . link ( EVENT_CONFIGURATION ) ;
public class GenbankReaderHelper { /** * Selecting lazySequenceLoad = true will parse the Genbank file and figure out the accessionid and offsets and return sequence objects * that can in the future read the sequence from the disk . This allows the loading of large Genbank files where you are only interested * in one sequence based on accession id . * @ param file * @ param lazySequenceLoad * @ return * @ throws Exception */ public static LinkedHashMap < String , RNASequence > readGenbankRNASequence ( File file , boolean lazySequenceLoad ) throws Exception { } }
if ( ! lazySequenceLoad ) { return readGenbankRNASequence ( file ) ; } GenbankReader < RNASequence , NucleotideCompound > GenbankProxyReader = new GenbankReader < RNASequence , NucleotideCompound > ( file , new GenericGenbankHeaderParser < RNASequence , NucleotideCompound > ( ) , new FileProxyRNASequenceCreator ( file , RNACompoundSet . getRNACompoundSet ( ) , new GenbankSequenceParser < AbstractSequence < NucleotideCompound > , NucleotideCompound > ( ) ) ) ; return GenbankProxyReader . process ( ) ;
public class CPDefinitionSpecificationOptionValuePersistenceImpl { /** * Returns the first cp definition specification option value in the ordered set where CPSpecificationOptionId = & # 63 ; . * @ param CPSpecificationOptionId the cp specification option ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp definition specification option value * @ throws NoSuchCPDefinitionSpecificationOptionValueException if a matching cp definition specification option value could not be found */ @ Override public CPDefinitionSpecificationOptionValue findByCPSpecificationOptionId_First ( long CPSpecificationOptionId , OrderByComparator < CPDefinitionSpecificationOptionValue > orderByComparator ) throws NoSuchCPDefinitionSpecificationOptionValueException { } }
CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue = fetchByCPSpecificationOptionId_First ( CPSpecificationOptionId , orderByComparator ) ; if ( cpDefinitionSpecificationOptionValue != null ) { return cpDefinitionSpecificationOptionValue ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "CPSpecificationOptionId=" ) ; msg . append ( CPSpecificationOptionId ) ; msg . append ( "}" ) ; throw new NoSuchCPDefinitionSpecificationOptionValueException ( msg . toString ( ) ) ;
public class ListOfferingPromotionsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListOfferingPromotionsRequest listOfferingPromotionsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listOfferingPromotionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listOfferingPromotionsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DrawableContainer { /** * TODO * @ Override public Insets getLayoutInsets ( ) { return ( mCurrDrawable = = * null ) ? Insets . NONE : mCurrDrawable . getLayoutInsets ( ) ; } */ @ Override public void setAlpha ( int alpha ) { } }
if ( mAlpha != alpha ) { mAlpha = alpha ; if ( mCurrDrawable != null ) { if ( mEnterAnimationEnd == 0 ) { mCurrDrawable . setAlpha ( alpha ) ; } else { animate ( false ) ; } } }
public class TrConfigurator { /** * Set the trace specification of the service to the input value . * @ param spec New string trace specification * @ return new TraceSpecification , or null if unchanged */ synchronized static TraceSpecification setTraceSpec ( String spec ) { } }
// If logger is used & configured by logger properties , // we ' re done as far as trace string processing is concerned if ( WsLogManager . isConfiguredByLoggingProperties ( ) ) { return null ; } // If the specified string is null , or it is equal to a string , // or the sensitive flag has not been toggled , // we ' ve already parsed , skip it . if ( ( spec == null || spec . equals ( traceString ) ) && Tr . activeTraceSpec . isSensitiveTraceSuppressed ( ) == suppressSensitiveTrace ) { return null ; } traceString = spec ; // Parse the trace specification string , this will gather // exceptions that occur for different elements of the string TraceSpecification newTs = new TraceSpecification ( spec , safeLevelsIndex , suppressSensitiveTrace ) ; TraceSpecificationException tex = newTs . getExceptions ( ) ; if ( tex != null ) { do { tex . warning ( loggingConfig . get ( ) != null ) ; tex = tex . getPreviousException ( ) ; } while ( tex != null ) ; } Tr . setTraceSpec ( newTs ) ; // Return the new / updated TraceSpecification to the caller . The caller can // then determine whether or not all elements of the TraceSpecification // were known to the system or not . return newTs ;
public class ComplexImg { /** * Shifts this image by the specified translation . * The shift is torus like , so when shifting pixels to the right over the image border , * they will reappear on the left side of the image . * This is useful when the DC value should be centered instead of in the top left corner * ( you may use { @ link # shiftCornerToCenter ( ) } for this special task though ) . * To reset use { @ link # resetShift ( ) } , * use { @ link # getCurrentXshift ( ) } and { @ link # getCurrentYshift ( ) } to get the current shift * of this image . * @ param x shift ( positive shifts right ) * @ param y shift ( positive shift down ) * @ return this */ public ComplexImg shift ( int x , int y ) { } }
while ( x < 0 ) x += getWidth ( ) ; while ( y < 0 ) y += getHeight ( ) ; x %= getWidth ( ) ; y %= getHeight ( ) ; ArrayUtils . shift2D ( real , width , height , x , y ) ; ArrayUtils . shift2D ( imag , width , height , x , y ) ; if ( synchronizePowerSpectrum ) ArrayUtils . shift2D ( power , width , height , x , y ) ; setCurrentShift ( this . currentXshift + x , this . currentYshift + y ) ; return this ;
public class GlobalUsersInner { /** * Stops an environment by stopping all resources inside the environment This operation can take a while to complete . * @ param userName The name of the user . * @ param environmentId The resourceId of the environment * @ 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 < Void > stopEnvironmentAsync ( String userName , String environmentId , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( stopEnvironmentWithServiceResponseAsync ( userName , environmentId ) , serviceCallback ) ;
public class Form { /** * Release any acquired resources . */ protected void localRelease ( ) { } }
super . localRelease ( ) ; _state . clear ( ) ; _hiddenState . clear ( ) ; _focus = null ; _location = null ; _text = null ; _beanName = null ; _explicitBeanType = false ; _beanType = null ; _beanScope = null ; _realName = null ; _setRealName = false ; _targetScope = null ; _mapping = null ; _servlet = null ; _focusMap = null ; _appConfig = null ; _flowController = null ; _formSubmit = false ; _params = null ; _actionUrl = null ; _extraHiddenParams = null ;
public class PDTXMLConverter { /** * Get the passed { @ link Date } as { @ link XMLGregorianCalendar } . * @ param aDate * Source date . May be < code > null < / code > . * @ return < code > null < / code > if the passed date is < code > null < / code > . */ @ Nullable public static XMLGregorianCalendar getXMLCalendar ( @ Nullable final Date aDate ) { } }
if ( aDate == null ) return null ; return s_aDTFactory . newXMLGregorianCalendar ( getCalendar ( aDate ) ) ;
public class HiveSessionImpl { /** * 1 . We ' ll remove the ThreadLocal SessionState as this thread might now serve * other requests . * 2 . We ' ll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup * when this thread is garbage collected later . * @ see org . apache . hive . service . server . ThreadWithGarbageCleanup # finalize ( ) */ protected synchronized void release ( boolean userAccess ) { } }
SessionState . detachSession ( ) ; if ( ThreadWithGarbageCleanup . currentThread ( ) instanceof ThreadWithGarbageCleanup ) { ThreadWithGarbageCleanup currentThread = ( ThreadWithGarbageCleanup ) ThreadWithGarbageCleanup . currentThread ( ) ; currentThread . cacheThreadLocalRawStore ( ) ; } if ( userAccess ) { lastAccessTime = System . currentTimeMillis ( ) ; } if ( opHandleSet . isEmpty ( ) ) { lastIdleTime = System . currentTimeMillis ( ) ; } else { lastIdleTime = 0 ; }
public class ClosableByteArrayOutputStream { /** * Retrieves a copy of < tt > original < / tt > with the given * < tt > newLength < / tt > . < p > * @ param original the object to copy * @ param newLength the length of the copy * @ return copy of < tt > original < / tt > with the given < tt > newLength < / tt > */ protected byte [ ] copyOf ( byte [ ] original , int newLength ) { } }
byte [ ] copy = new byte [ newLength ] ; System . arraycopy ( original , 0 , copy , 0 , Math . min ( original . length , newLength ) ) ; return copy ;
public class Lexer { private Token blank ( ) { } }
Matcher matcher = scanner . getMatcherForPattern ( "^\\n *\\n" ) ; if ( matcher . find ( 0 ) ) { consume ( matcher . end ( ) - 1 ) ; ++ this . lineno ; if ( this . pipeless ) return new Text ( "" , lineno ) ; return this . next ( ) ; } return null ;
public class V1InstanceGetter { /** * Get themes filtered by the criteria specified in the passed in filter . * @ param filter Limit the items returned . If null , then all items returned . * @ return Collection of items as specified in the filter . */ public Collection < Theme > themes ( ThemeFilter filter ) { } }
return get ( Theme . class , ( filter != null ) ? filter : new ThemeFilter ( ) ) ;
public class Quaterniond { /** * / * ( non - Javadoc ) * @ see org . joml . Quaterniondc # rotateZYX ( double , double , double , org . joml . Quaterniond ) */ public Quaterniond rotateZYX ( double angleZ , double angleY , double angleX , Quaterniond dest ) { } }
double sx = Math . sin ( angleX * 0.5 ) ; double cx = Math . cosFromSin ( sx , angleX * 0.5 ) ; double sy = Math . sin ( angleY * 0.5 ) ; double cy = Math . cosFromSin ( sy , angleY * 0.5 ) ; double sz = Math . sin ( angleZ * 0.5 ) ; double cz = Math . cosFromSin ( sz , angleZ * 0.5 ) ; double cycz = cy * cz ; double sysz = sy * sz ; double sycz = sy * cz ; double cysz = cy * sz ; double w = cx * cycz + sx * sysz ; double x = sx * cycz - cx * sysz ; double y = cx * sycz + sx * cysz ; double z = cx * cysz - sx * sycz ; // right - multiply dest . set ( this . w * x + this . x * w + this . y * z - this . z * y , this . w * y - this . x * z + this . y * w + this . z * x , this . w * z + this . x * y - this . y * x + this . z * w , this . w * w - this . x * x - this . y * y - this . z * z ) ; return dest ;
public class Orbitals { /** * Get the function value of a orbital */ public Vector getValues ( int index , Matrix m ) { } }
if ( m . rows != 3 ) return null ; Vector result = basis . getValues ( 0 , m ) . mul ( C . matrix [ 0 ] [ index ] ) ; for ( int i = 1 ; i < count_basis ; i ++ ) if ( C . matrix [ i ] [ index ] != 0d ) result . add ( basis . getValues ( i , m ) . mul ( C . matrix [ 0 ] [ index ] ) ) ; return result ;
public class LoggerWrapper { /** * Delegate to the appropriate method of the underlying logger . */ public void error ( Marker marker , String msg ) { } }
if ( ! logger . isErrorEnabled ( marker ) ) return ; if ( instanceofLAL ) { ( ( LocationAwareLogger ) logger ) . log ( marker , fqcn , LocationAwareLogger . ERROR_INT , msg , null , null ) ; } else { logger . error ( marker , msg ) ; }
public class NotifyApplicationStateRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NotifyApplicationStateRequest notifyApplicationStateRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( notifyApplicationStateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( notifyApplicationStateRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( notifyApplicationStateRequest . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( notifyApplicationStateRequest . getDryRun ( ) , DRYRUN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class HttpsFileUploader { /** * Configures the HTTP / HTTPS connection . * @ param config * @ return * @ throws MalformedURLException * @ throws IOException */ private static HttpURLConnection setup ( HttpsFileUploaderConfig config ) throws MalformedURLException , IOException { } }
HttpURLConnection httpUrlConnection ; boolean isHttps = false ; URL url = config . getURL ( ) ; if ( url . getProtocol ( ) . equalsIgnoreCase ( "https" ) ) { isHttps = true ; } if ( config . usesProxy ( ) ) { Proxy proxy = new Proxy ( Proxy . Type . HTTP , new InetSocketAddress ( config . getProxyAddress ( ) , config . getProxyPort ( ) ) ) ; httpUrlConnection = ( HttpURLConnection ) url . openConnection ( proxy ) ; } else { httpUrlConnection = ( HttpURLConnection ) url . openConnection ( ) ; } if ( ! config . isValidateCertificates ( ) && isHttps ) { SSLUtils . setNoValidate ( ( ( HttpsURLConnection ) httpUrlConnection ) , config . getAcceptedIssuers ( ) ) ; } httpUrlConnection . setUseCaches ( false ) ; // do not use connection caches httpUrlConnection . setDoOutput ( true ) ; // Set timeouts httpUrlConnection . setConnectTimeout ( config . getConnectTimeoutMs ( ) ) ; httpUrlConnection . setReadTimeout ( config . getReadTimeoutMs ( ) ) ; httpUrlConnection . setRequestMethod ( "POST" ) ; httpUrlConnection . setRequestProperty ( "Connection" , "Keep-Alive" ) ; httpUrlConnection . setRequestProperty ( "Cache-Control" , "no-cache" ) ; httpUrlConnection . setRequestProperty ( "Content-Type" , "multipart/form-data;boundary=" + MULTIPART_BOUNDARY ) ; // Sets additional headers if ( config . getAdditionalHeaders ( ) != null ) { for ( Entry < String , String > e : config . getAdditionalHeaders ( ) . entrySet ( ) ) { // We use the ' set ' method here and not the ' add ' method because // it should be allowed for example for the user to override Java ' s default // User - Agent value . httpUrlConnection . setRequestProperty ( e . getKey ( ) , e . getValue ( ) ) ; } } if ( config . endpointRequiresAuthentication ( ) ) { String authString = config . getEndpointUsername ( ) + ":" + config . getEndpointPassword ( ) ; // The only public Base64 encoder that exist in Java 7 and before is from the // JAXB package so we will ( mis ) use that here for Base64 encoding . // Note : Java 8 will finally have a Base64 class in the Util package . String authStringEnc = javax . xml . bind . DatatypeConverter . printBase64Binary ( authString . getBytes ( ) ) ; httpUrlConnection . setRequestProperty ( "Authorization" , "Basic " + authStringEnc ) ; } return httpUrlConnection ;
public class GccProcessor { /** * Returns the contents of the gcc specs file . * The implementation locates gcc . exe in the executable path and then * builds a relative path name from the results of - dumpmachine and * - dumpversion . Attempts to use gcc - dumpspecs to provide this information * resulted in stalling on the Execute . run * @ return contents of the specs file */ public static String [ ] getSpecs ( ) { } }
if ( specs == null ) { final File gccParent = CUtil . getExecutableLocation ( GccCCompiler . CMD_PREFIX + "gcc.exe" ) ; if ( gccParent != null ) { // build a relative path like // . . / lib / gcc - lib / i686 - pc - cygwin / 2.95.3-5 / specs // resolve it relative to the location of gcc . exe final String relativePath = "../lib/gcc-lib/" + getMachine ( ) + '/' + getVersion ( ) + "/specs" ; final File specsFile = new File ( gccParent , relativePath ) ; // found the specs file try { // read the lines in the file final BufferedReader reader = new BufferedReader ( new FileReader ( specsFile ) ) ; final Vector < String > lines = new Vector < > ( 100 ) ; String line = reader . readLine ( ) ; while ( line != null ) { lines . addElement ( line ) ; line = reader . readLine ( ) ; } specs = new String [ lines . size ( ) ] ; lines . copyInto ( specs ) ; } catch ( final IOException ex ) { } } } if ( specs == null ) { specs = new String [ 0 ] ; } return specs ;
public class FingerprintsRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public Fingerprint getLogicalFingerprint ( String logicalName ) throws ApiException { } }
return api . getLogicalFingerprint ( retinaName , logicalName ) ;
public class GregorianCalendar { /** * Returns the maximum value for the given calendar field of this * < code > GregorianCalendar < / code > instance . The maximum value is * defined as the largest value returned by the { @ link * Calendar # get ( int ) get } method for any possible time value , * taking into consideration the current values of the * { @ link Calendar # getFirstDayOfWeek ( ) getFirstDayOfWeek } , * { @ link Calendar # getMinimalDaysInFirstWeek ( ) getMinimalDaysInFirstWeek } , * { @ link # getGregorianChange ( ) getGregorianChange } and * { @ link Calendar # getTimeZone ( ) getTimeZone } methods . * @ param field the calendar field . * @ return the maximum value for the given calendar field . * @ see # getMinimum ( int ) * @ see # getGreatestMinimum ( int ) * @ see # getLeastMaximum ( int ) * @ see # getActualMinimum ( int ) * @ see # getActualMaximum ( int ) */ @ Override public int getMaximum ( int field ) { } }
switch ( field ) { case MONTH : case DAY_OF_MONTH : case DAY_OF_YEAR : case WEEK_OF_YEAR : case WEEK_OF_MONTH : case DAY_OF_WEEK_IN_MONTH : case YEAR : { // On or after Gregorian 200-3-1 , Julian and Gregorian // calendar dates are the same or Gregorian dates are // larger ( i . e . , there is a " gap " ) after 300-3-1. if ( gregorianCutoverYear > 200 ) { break ; } // There might be " overlapping " dates . GregorianCalendar gc = ( GregorianCalendar ) clone ( ) ; gc . setLenient ( true ) ; gc . setTimeInMillis ( gregorianCutover ) ; int v1 = gc . getActualMaximum ( field ) ; gc . setTimeInMillis ( gregorianCutover - 1 ) ; int v2 = gc . getActualMaximum ( field ) ; return Math . max ( MAX_VALUES [ field ] , Math . max ( v1 , v2 ) ) ; } } return MAX_VALUES [ field ] ;
public class Element { /** * Find elements that have attributes that end with the value suffix . Case insensitive . * @ param key name of the attribute * @ param valueSuffix end of the attribute value * @ return elements that have attributes that end with the value suffix */ public Elements getElementsByAttributeValueEnding ( String key , String valueSuffix ) { } }
return Collector . collect ( new Evaluator . AttributeWithValueEnding ( key , valueSuffix ) , this ) ;
public class RAExpressionAttributes { /** * CROSS JOIN ( also denoted by , in SQL ) * @ param re1 a { @ link RAExpressionAttributes } * @ param re2 a { @ link RAExpressionAttributes } * @ return a { @ link RAExpressionAttributes } * @ throws IllegalJoinException if the same alias occurs in both arguments */ public static RAExpressionAttributes crossJoin ( RAExpressionAttributes re1 , RAExpressionAttributes re2 ) throws IllegalJoinException { } }
checkRelationAliasesConsistency ( re1 , re2 ) ; ImmutableMap < QualifiedAttributeID , Term > attributes = merge ( re1 . selectAttributes ( id -> ( id . getRelation ( ) != null ) || re2 . isAbsent ( id . getAttribute ( ) ) ) , re2 . selectAttributes ( id -> ( id . getRelation ( ) != null ) || re1 . isAbsent ( id . getAttribute ( ) ) ) ) ; return new RAExpressionAttributes ( attributes , getAttributeOccurrences ( re1 , re2 , id -> attributeOccurrencesUnion ( id , re1 , re2 ) ) ) ;
public class ListGatewaysResult { /** * An array of < a > GatewayInfo < / a > objects . * @ param gateways * An array of < a > GatewayInfo < / a > objects . */ public void setGateways ( java . util . Collection < GatewayInfo > gateways ) { } }
if ( gateways == null ) { this . gateways = null ; return ; } this . gateways = new com . amazonaws . internal . SdkInternalList < GatewayInfo > ( gateways ) ;
public class RemoteExclusionFilter { /** * / * ( non - Javadoc ) * @ see org . archive . wayback . resourceindex . SearchResultFilter # filterSearchResult ( org . archive . wayback . core . SearchResult ) */ public int filterObject ( CaptureSearchResult r ) { } }
String captureDate = r . getCaptureTimestamp ( ) ; String url = r . getOriginalUrl ( ) ; return isBlocked ( url , captureDate ) ? FILTER_EXCLUDE : FILTER_INCLUDE ;
public class CheckSkuAvailabilitysInner { /** * Check available SKUs . * @ param location Resource location . * @ param skus The SKU of the resource . * @ param kind The Kind of the resource . Possible values include : ' Bing . Autosuggest . v7 ' , ' Bing . CustomSearch ' , ' Bing . Search . v7 ' , ' Bing . Speech ' , ' Bing . SpellCheck . v7 ' , ' ComputerVision ' , ' ContentModerator ' , ' CustomSpeech ' , ' CustomVision . Prediction ' , ' CustomVision . Training ' , ' Emotion ' , ' Face ' , ' LUIS ' , ' QnAMaker ' , ' SpeakerRecognition ' , ' SpeechTranslation ' , ' TextAnalytics ' , ' TextTranslation ' , ' WebLM ' * @ param type The Type of the resource . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the CheckSkuAvailabilityResultListInner object */ public Observable < ServiceResponse < CheckSkuAvailabilityResultListInner > > listWithServiceResponseAsync ( String location , List < SkuName > skus , Kind kind , String type ) { } }
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( location == null ) { throw new IllegalArgumentException ( "Parameter location is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } if ( skus == null ) { throw new IllegalArgumentException ( "Parameter skus is required and cannot be null." ) ; } if ( kind == null ) { throw new IllegalArgumentException ( "Parameter kind is required and cannot be null." ) ; } if ( type == null ) { throw new IllegalArgumentException ( "Parameter type is required and cannot be null." ) ; } Validator . validate ( skus ) ; CheckSkuAvailabilityParameter parameters = new CheckSkuAvailabilityParameter ( ) ; parameters . withSkus ( skus ) ; parameters . withKind ( kind ) ; parameters . withType ( type ) ; return service . list ( this . client . subscriptionId ( ) , location , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , parameters , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < CheckSkuAvailabilityResultListInner > > > ( ) { @ Override public Observable < ServiceResponse < CheckSkuAvailabilityResultListInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < CheckSkuAvailabilityResultListInner > clientResponse = listDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class OptimizerPlanEnvironment { private void setAsContext ( ) { } }
ExecutionEnvironmentFactory factory = new ExecutionEnvironmentFactory ( ) { @ Override public ExecutionEnvironment createExecutionEnvironment ( ) { return OptimizerPlanEnvironment . this ; } } ; initializeContextEnvironment ( factory ) ;
public class JicUnitServletClient { /** * Execute the test at the server * @ param containerUrl * @ param testClassName * @ param testDisplayName * @ return */ public Document runAtServer ( String containerUrl , String testClassName , String testDisplayName ) { } }
DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder ; try { String url = containerUrl + String . format ( "?%s=%s&%s=%s" , TEST_CLASS_NAME_PARAM , testClassName , TEST_NAME_PARAM , URLEncoder . encode ( testDisplayName , ENCODING ) ) ; builder = factory . newDocumentBuilder ( ) ; Document document = builder . parse ( url ) ; return document ; } catch ( FileNotFoundException fe ) { throw new RuntimeException ( "Could not find the test WAR at the server. Make sure jicunit.url points to the correct context root." , fe ) ; } catch ( ConnectException ce ) { throw new RuntimeException ( "Could not connect to the server. Make sure jicunit.url points to the correct host and port." , ce ) ; } catch ( ParserConfigurationException | SAXException | IOException e ) { throw new RuntimeException ( "Could not run the test. Check the jicunit.url so it is correct." , e ) ; }
public class ValueSet { /** * Returns an abbreviated display name for the specified value , if one is * defined . * @ param value a { @ link Value } . Cannot be < code > null < / code > . * @ return a { @ link String } . */ public String abbrevDisplayName ( Value value ) { } }
if ( value == null ) { throw new IllegalArgumentException ( "value cannot be null" ) ; } ValueSetElement vse = this . values . get ( value ) ; if ( vse != null ) { return vse . getAbbrevDisplayName ( ) ; } else { return "" ; }
public class CodecCollector { /** * Collect spans for occurences . * @ param occurences * the occurences * @ param prefixes * the prefixes * @ param field * the field * @ param searcher * the searcher * @ param lrc * the lrc * @ return the map * @ throws IOException * Signals that an I / O exception has occurred . */ private static Map < GroupHit , Spans > collectSpansForOccurences ( Set < GroupHit > occurences , Set < String > prefixes , String field , IndexSearcher searcher , LeafReaderContext lrc ) throws IOException { } }
Map < GroupHit , Spans > list = new HashMap < > ( ) ; IndexReader reader = searcher . getIndexReader ( ) ; final float boost = 0 ; for ( GroupHit hit : occurences ) { MtasSpanQuery queryHit = createQueryFromGroupHit ( prefixes , field , hit ) ; if ( queryHit != null ) { MtasSpanQuery queryHitRewritten = queryHit . rewrite ( reader ) ; SpanWeight weight = queryHitRewritten . createWeight ( searcher , false , boost ) ; Spans spans = weight . getSpans ( lrc , SpanWeight . Postings . POSITIONS ) ; if ( spans != null ) { list . put ( hit , spans ) ; } } } return list ;
public class Block { /** * Returns a solved block that builds on top of this one . This exists for unit tests . */ @ VisibleForTesting public Block createNextBlock ( Address to , long version , long time , int blockHeight ) { } }
return createNextBlock ( to , version , null , time , pubkeyForTesting , FIFTY_COINS , blockHeight ) ;
public class InstallationManagerService { /** * Install the installation manager service . * @ param serviceTarget * @ return the service controller for the installed installation manager */ public static ServiceController < InstallationManager > installService ( ServiceTarget serviceTarget ) { } }
final InstallationManagerService service = new InstallationManagerService ( ) ; return serviceTarget . addService ( InstallationManagerService . NAME , service ) . addDependency ( JBOSS_PRODUCT_CONFIG_SERVICE , ProductConfig . class , service . productConfig ) . setInitialMode ( ServiceController . Mode . ACTIVE ) . install ( ) ;
public class Grammar { /** * TODO : eliminates duplicate helper rules ( e . g . in jp example ) */ private static boolean equal ( int [ ] prod1 , int [ ] prod2 ) { } }
int ofs ; if ( prod1 . length != prod2 . length ) { return false ; } for ( ofs = 0 ; ofs < prod1 . length ; ofs ++ ) { if ( prod1 [ ofs ] != prod2 [ ofs ] ) { if ( ! ( ( prod1 [ ofs ] == prod1 [ 0 ] ) && ( prod2 [ ofs ] == prod2 [ 0 ] ) ) ) { return false ; } } } return true ;
public class CPDefinitionInventoryLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows . * @ param dynamicQuery the dynamic query * @ return the matching rows */ @ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } }
return cpDefinitionInventoryPersistence . findWithDynamicQuery ( dynamicQuery ) ;
public class ModelPackageStatusDetails { /** * The status of the scan of the Docker image container for the model package . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setImageScanStatuses ( java . util . Collection ) } or { @ link # withImageScanStatuses ( java . util . Collection ) } if * you want to override the existing values . * @ param imageScanStatuses * The status of the scan of the Docker image container for the model package . * @ return Returns a reference to this object so that method calls can be chained together . */ public ModelPackageStatusDetails withImageScanStatuses ( ModelPackageStatusItem ... imageScanStatuses ) { } }
if ( this . imageScanStatuses == null ) { setImageScanStatuses ( new java . util . ArrayList < ModelPackageStatusItem > ( imageScanStatuses . length ) ) ; } for ( ModelPackageStatusItem ele : imageScanStatuses ) { this . imageScanStatuses . add ( ele ) ; } return this ;
public class ComponentClass { /** * Returns the render priority appropriate for the specified action , orientation and * component . */ public int getRenderPriority ( String action , String component , int orientation ) { } }
// because we expect there to be relatively few priority overrides , we simply search // linearly through the list for the closest match int ocount = ( _overrides != null ) ? _overrides . size ( ) : 0 ; for ( int ii = 0 ; ii < ocount ; ii ++ ) { PriorityOverride over = _overrides . get ( ii ) ; // based on the way the overrides are sorted , the first match // is the most specific and the one we want if ( over . matches ( action , component , orientation ) ) { return over . renderPriority ; } } return renderPriority ;
public class ImageLoader { /** * Starts the runnable for batched delivery of responses if it is not already started . * @ param cacheKey The cacheKey of the response being delivered . * @ param request The BatchedImageRequest to be delivered . */ private void batchResponse ( String cacheKey , BatchedImageRequest request ) { } }
batchedResponses . put ( cacheKey , request ) ; // If we don ' t already have a batch delivery runnable in flight , make a new one . // Note that this will be used to deliver responses to all callers in batchedResponses . if ( runnable == null ) { runnable = new Runnable ( ) { @ Override public void run ( ) { for ( BatchedImageRequest bir : batchedResponses . values ( ) ) { for ( ImageContainer container : bir . mContainers ) { // If one of the callers in the batched request canceled the request // after the response was received but before it was delivered , // skip them . if ( container . mListener == null ) { continue ; } if ( bir . getError ( ) == null ) { container . mBitmap = bir . mResponseBitmap ; container . mListener . onResponse ( container , false ) ; } else { container . mListener . onError ( bir . getError ( ) ) ; } } } batchedResponses . clear ( ) ; runnable = null ; } } ; // Post the runnable . handler . postDelayed ( runnable , batchResponseDelayMs ) ; }
public class CommerceNotificationTemplateUserSegmentRelLocalServiceWrapper { /** * Returns the commerce notification template user segment rel with the primary key . * @ param commerceNotificationTemplateUserSegmentRelId the primary key of the commerce notification template user segment rel * @ return the commerce notification template user segment rel * @ throws PortalException if a commerce notification template user segment rel with the primary key could not be found */ @ Override public com . liferay . commerce . notification . model . CommerceNotificationTemplateUserSegmentRel getCommerceNotificationTemplateUserSegmentRel ( long commerceNotificationTemplateUserSegmentRelId ) throws com . liferay . portal . kernel . exception . PortalException { } }
return _commerceNotificationTemplateUserSegmentRelLocalService . getCommerceNotificationTemplateUserSegmentRel ( commerceNotificationTemplateUserSegmentRelId ) ;
public class GoogleCloudStorageMergeInput { /** * Creates multiple merging readers for each shard using { @ link # createReaderForShard } below . * These are combined into a single reader via concatenation . The resulting input stream will be * in order except when the input switches from one merging reader to the next the key will very * likely go backwards . */ @ Override public List < ? extends InputReader < KeyValue < ByteBuffer , Iterator < ByteBuffer > > > > createReaders ( ) { } }
Marshaller < ByteBuffer > byteBufferMarshaller = Marshallers . getByteBufferMarshaller ( ) ; Marshaller < KeyValue < ByteBuffer , ? extends Iterable < ByteBuffer > > > marshaller = Marshallers . getKeyValuesMarshaller ( byteBufferMarshaller , byteBufferMarshaller ) ; ImmutableList . Builder < InputReader < KeyValue < ByteBuffer , Iterator < ByteBuffer > > > > result = ImmutableList . builder ( ) ; for ( int shard = 0 ; shard < filesByShard . getShardCount ( ) ; shard ++ ) { List < InputReader < KeyValue < ByteBuffer , Iterator < ByteBuffer > > > > readers = new ArrayList < > ( ) ; for ( List < String > group : Lists . partition ( filesByShard . getFilesForShard ( shard ) . getFileNames ( ) , mergeFanin ) ) { GoogleCloudStorageFileSet fileSet = new GoogleCloudStorageFileSet ( filesByShard . getBucket ( ) , group ) ; readers . add ( createReaderForShard ( marshaller , fileSet ) ) ; } result . add ( new ConcatenatingInputReader < > ( readers ) ) ; } return result . build ( ) ;
public class DoubleMomentStatistics { /** * Return a { @ code Collector } which applies an double - producing mapping * function to each input element , and returns moments - statistics for the * resulting values . * < pre > { @ code * final Stream < SomeObject > stream = . . . * final DoubleMomentStatistics statistics = stream * . collect ( toDoubleMomentStatistics ( v - > v . doubleValue ( ) ) ) ; * } < / pre > * @ param mapper a mapping function to apply to each element * @ param < T > the type of the input elements * @ return a { @ code Collector } implementing the moments - statistics reduction * @ throws java . lang . NullPointerException if the given { @ code mapper } is * { @ code null } */ public static < T > Collector < T , ? , DoubleMomentStatistics > toDoubleMomentStatistics ( final ToDoubleFunction < ? super T > mapper ) { } }
requireNonNull ( mapper ) ; return Collector . of ( DoubleMomentStatistics :: new , ( r , t ) -> r . accept ( mapper . applyAsDouble ( t ) ) , DoubleMomentStatistics :: combine ) ;
public class ClustersInner { /** * Stops a Kusto cluster . * @ param resourceGroupName The name of the resource group containing the Kusto cluster . * @ param clusterName The name of the Kusto cluster . * @ 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 */ public void beginStop ( String resourceGroupName , String clusterName ) { } }
beginStopWithServiceResponseAsync ( resourceGroupName , clusterName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class DefaultQueryAction { /** * Set source filtering on a search request . * zhongshu - comment 即es dsl中的include和exclude * @ param fields * list of fields to source filter . */ public void setFields ( List < Field > fields ) throws SqlParseException { } }
/* zhongshu - comment select * from tbl _ a ; select * 这种sql语句的select . getFields ( ) . size ( ) 为0 */ if ( select . getFields ( ) . size ( ) > 0 ) { ArrayList < String > includeFields = new ArrayList < String > ( ) ; ArrayList < String > excludeFields = new ArrayList < String > ( ) ; for ( Field field : fields ) { if ( field instanceof MethodField ) { // zhongshu - comment MethodField是Field的子类 , 而且Field也就只有MethodField这一个子类了 MethodField method = ( MethodField ) field ; if ( method . getName ( ) . toLowerCase ( ) . equals ( "script" ) ) { /* zhongshu - comment scripted _ field only allows script ( name , script ) or script ( name , lang , script ) script类型的MethodField是不会加到include和exclude中的 */ handleScriptField ( method ) ; } else if ( method . getName ( ) . equalsIgnoreCase ( "include" ) ) { String f ; for ( KVValue kvValue : method . getParams ( ) ) { // zhongshu - comment select a , b , c 中的a 、 b 、 c字段add到includeFields中 f = kvValue . value . toString ( ) ; fieldNames . add ( f ) ; includeFields . add ( f ) ; } } else if ( method . getName ( ) . equalsIgnoreCase ( "exclude" ) ) { for ( KVValue kvValue : method . getParams ( ) ) { excludeFields . add ( kvValue . value . toString ( ) ) ; } } } else if ( field != null ) { fieldNames . add ( field . getName ( ) ) ; includeFields . add ( field . getName ( ) ) ; } } request . setFetchSource ( includeFields . toArray ( new String [ includeFields . size ( ) ] ) , excludeFields . toArray ( new String [ excludeFields . size ( ) ] ) ) ; }
public class SearchInterpolate { /** * Cubic interpolation using the function and derivative computed at two different points . This particular * implementation taken from [ 1 ] and appears to be designed to maximize stability . * [ 1 ] MINPACK - 2 source code http : / / ftp . mcs . anl . gov / pub / MINPACK - 2 / dcstep . f * @ param f0 Value of f ( x0) * @ param g0 Derivative f ' ( x0) * @ param x0 First sample point * @ param f1 Value of f ( x1) * @ param g1 Derivative g ' ( x1) * @ param x1 Second sample point * @ return Interpolated point */ public static double cubic2 ( double f0 , double g0 , double x0 , double f1 , double g1 , double x1 ) { } }
double theta = 3.0 * ( f0 - f1 ) / ( x1 - x0 ) + g0 + g1 ; double s = Math . max ( Math . abs ( theta ) , Math . abs ( g0 ) ) ; s = Math . max ( s , Math . abs ( g1 ) ) ; double gamma = s * Math . sqrt ( ( theta / s ) * ( theta / s ) - ( g0 / s ) * ( g1 / s ) ) ; if ( x1 < x0 ) gamma = - gamma ; double p = ( gamma - g0 ) + theta ; double q = ( ( gamma - g0 ) + gamma ) + g1 ; return x0 + ( p / q ) * ( x1 - x0 ) ;
public class CPDefinitionInventoryUtil { /** * Removes the cp definition inventory where uuid = & # 63 ; and groupId = & # 63 ; from the database . * @ param uuid the uuid * @ param groupId the group ID * @ return the cp definition inventory that was removed */ public static CPDefinitionInventory removeByUUID_G ( String uuid , long groupId ) throws com . liferay . commerce . exception . NoSuchCPDefinitionInventoryException { } }
return getPersistence ( ) . removeByUUID_G ( uuid , groupId ) ;
public class NumberField { /** * If { @ link FieldCase # isBad ( ) } is { @ code true } , an invalid number is generated using * { @ link GeneratingExpression # negateString ( String , int ) } * @ return a character string representing a random number subject to the FieldCase */ @ Override public String getString ( final FieldCase c ) { } }
boolean success = false ; String numberString ; do { double number = getDouble ( c ) ; numberString = format . format ( number ) ; if ( notZero && ZERO_PATTERN . matcher ( numberString ) . matches ( ) ) { log . info ( XMLTags . NOTZERO + " is true and a zero value was generated: value=" + numberString + " - generating new value" ) ; } else { success = true ; } } while ( ! success ) ; if ( c . isBad ( ) ) { numberString = expression . negateString ( numberString , c . getBad ( ) ) ; } return numberString ;
public class ElementBoxView { /** * Gets the box reference from properties . * @ param v * just a view . * @ return the box set in properties , if there is one . */ public static final Box getBox ( View v ) { } }
if ( v instanceof CSSBoxView ) return getBox ( ( CSSBoxView ) v ) ; AttributeSet attr = v . getAttributes ( ) ; if ( attr == null ) { throw new NullPointerException ( "AttributeSet of " + v . getClass ( ) . getName ( ) + "@" + Integer . toHexString ( v . hashCode ( ) ) + " is set to NULL." ) ; } Object obj = attr . getAttribute ( Constants . ATTRIBUTE_BOX_REFERENCE ) ; if ( obj != null && obj instanceof Box ) { return ( Box ) obj ; } else { throw new IllegalArgumentException ( "Box reference in attributes is not an instance of a Box." ) ; }
public class NPTmpRetainingTreeNormalizer { /** * Add - TMP when not present within an NP * @ param tree The tree to add temporal info to . */ private void addTMP9 ( final Tree tree ) { } }
// do the head chain under it Tree ht = headFinder . determineHead ( tree ) ; // special fix for possessives ! - - make noun before head if ( ht . value ( ) . equals ( "POS" ) ) { int j = tree . indexOf ( ht ) ; if ( j > 0 ) { ht = tree . getChild ( j - 1 ) ; } } // Note : this next bit changes the tree label , rather // than creating a new tree node . Beware ! if ( ht . isPreTerminal ( ) || ht . value ( ) . startsWith ( "NP" ) || ht . value ( ) . startsWith ( "PP" ) || ht . value ( ) . startsWith ( "ADVP" ) ) { if ( ! TmpPattern . matcher ( ht . value ( ) ) . matches ( ) ) { LabelFactory lf = ht . labelFactory ( ) ; // System . err . println ( " TMP : Changing " + ht . value ( ) + " to " + // ht . value ( ) + " - TMP " ) ; ht . setLabel ( lf . newLabel ( ht . value ( ) + "-TMP" ) ) ; } if ( ht . value ( ) . startsWith ( "NP" ) || ht . value ( ) . startsWith ( "PP" ) || ht . value ( ) . startsWith ( "ADVP" ) ) { addTMP9 ( ht ) ; } } // do the NPs under it ( which may or may not be the head chain Tree [ ] kidlets = tree . children ( ) ; for ( int k = 0 ; k < kidlets . length ; k ++ ) { ht = kidlets [ k ] ; LabelFactory lf ; if ( tree . isPrePreTerminal ( ) && ! TmpPattern . matcher ( ht . value ( ) ) . matches ( ) ) { // System . err . println ( " TMP : Changing " + ht . value ( ) + " to " + // ht . value ( ) + " - TMP " ) ; lf = ht . labelFactory ( ) ; // Note : this next bit changes the tree label , rather // than creating a new tree node . Beware ! ht . setLabel ( lf . newLabel ( ht . value ( ) + "-TMP" ) ) ; } else if ( ht . value ( ) . startsWith ( "NP" ) ) { // don ' t add - TMP twice ! if ( ! TmpPattern . matcher ( ht . value ( ) ) . matches ( ) ) { lf = ht . labelFactory ( ) ; // System . err . println ( " TMP : Changing " + ht . value ( ) + " to " + // ht . value ( ) + " - TMP " ) ; // Note : this next bit changes the tree label , rather // than creating a new tree node . Beware ! ht . setLabel ( lf . newLabel ( ht . value ( ) + "-TMP" ) ) ; } addTMP9 ( ht ) ; } }
public class ZkOrderedStore { /** * Method to add new entity to the ordered collection . Note : Same entity could be added to the collection multiple times . * Entities are added to the latest collection for the stream . If the collection has exhausted positions allowed for by rollOver limit , * a new successor collection is initiated and the entry is added to the new collection . * Any entries with positions higher than rollover values under a set are ignored and eventually purged . * @ param scope scope * @ param stream stream * @ param entity entity to add * @ return CompletableFuture which when completed returns the position where the entity is added to the set . */ CompletableFuture < Long > addEntity ( String scope , String stream , String entity ) { } }
// add persistent sequential node to the latest collection number // if collectionNum is sealed , increment collection number and write the entity there . return getLatestCollection ( scope , stream ) . thenCompose ( latestcollectionNum -> storeHelper . createPersistentSequentialZNode ( getEntitySequentialPath ( scope , stream , latestcollectionNum ) , entity . getBytes ( Charsets . UTF_8 ) ) . thenCompose ( positionPath -> { int position = getPositionFromPath ( positionPath ) ; if ( position > rollOverAfter ) { // if newly created position exceeds rollover limit , we need to delete that entry // and roll over . // 1 . delete newly created path return storeHelper . deletePath ( positionPath , false ) // 2 . seal latest collection . thenCompose ( v -> storeHelper . createZNodeIfNotExist ( getCollectionSealedPath ( scope , stream , latestcollectionNum ) ) ) // 3 . call addEntity recursively . thenCompose ( v -> addEntity ( scope , stream , entity ) ) // 4 . delete empty sealed collection path . thenCompose ( orderedPosition -> tryDeleteSealedCollection ( scope , stream , latestcollectionNum ) . thenApply ( v -> orderedPosition ) ) ; } else { return CompletableFuture . completedFuture ( Position . toLong ( latestcollectionNum , position ) ) ; } } ) ) . whenComplete ( ( r , e ) -> { if ( e != null ) { log . error ( "error encountered while trying to add entity {} for stream {}/{}" , entity , scope , stream , e ) ; } else { log . debug ( "entity {} added for stream {}/{} at position {}" , entity , scope , stream , r ) ; } } ) ;
public class DefaultInputConnection { /** * Checks that the given ID is valid . */ private boolean checkID ( long id ) { } }
// Ensure that the given ID is a monotonically increasing ID . // If the ID is less than the last received ID then reset the // last received ID since the connection must have been reset . if ( lastReceived == 0 || id == lastReceived + 1 || id < lastReceived ) { lastReceived = id ; // If the ID reaches the end of the current batch then tell the data // source that it ' s okay to remove all previous messages . if ( lastReceived % BATCH_SIZE == 0 ) { ack ( ) ; } return true ; } else { fail ( ) ; } return false ;
public class JobTrackerTraits { /** * Returns specified TaskInProgress , or null . */ public TaskInProgress getTip ( TaskID tipid ) { } }
JobInProgressTraits job = getJobInProgress ( tipid . getJobID ( ) ) ; return ( job == null ? null : job . getTaskInProgress ( tipid ) ) ;
public class ListOfferingsResult { /** * A value representing the list offering results . * @ param offerings * A value representing the list offering results . */ public void setOfferings ( java . util . Collection < Offering > offerings ) { } }
if ( offerings == null ) { this . offerings = null ; return ; } this . offerings = new java . util . ArrayList < Offering > ( offerings ) ;
public class AddTask { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . persistence . Operation # ensureDataAvailable ( ) */ public void ensureDataAvailable ( ) throws PersistentDataEncodingException , SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "ensureDataAvailable" ) ; // Check whether the item is still in the store AbstractItem item = getItem ( ) ; if ( ( item == null ) || ! item . isInStore ( ) ) { throw new NotInMessageStore ( ) ; } // This is an unconditional caching or copy of the data , compared with a conditional // copy of the data which is taken by copyDataIfVulnerable if ( _cachedPersistable == null ) { _cachedPersistable = new CachedPersistable ( _masterPersistable , true ) ; } else { _cachedPersistable . cacheMemberData ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "ensureDataAvailable" ) ;
public class ByteIOUtils { /** * Writes a specific short value ( 2 bytes ) to the output byte buffer at the given offset . * @ param buf output byte buffer * @ param pos offset into the byte buffer to write * @ param v short value to write */ public static void writeShort ( byte [ ] buf , int pos , short v ) { } }
checkBoundary ( buf , pos , 2 ) ; buf [ pos ++ ] = ( byte ) ( 0xff & ( v >> 8 ) ) ; buf [ pos ] = ( byte ) ( 0xff & v ) ;
public class UtilFeature { /** * Normalized the tuple such that the L2 - norm is equal to 1 . This is also often referred to as * the Euclidean or frobenius ( all though that ' s a matrix norm ) . * value [ i ] = value [ i ] / sqrt ( sum ( value [ j ] * value [ j ] , for all j ) ) * @ param desc tuple */ public static void normalizeL2 ( TupleDesc_F64 desc ) { } }
double norm = 0 ; for ( int i = 0 ; i < desc . size ( ) ; i ++ ) { double v = desc . value [ i ] ; norm += v * v ; } if ( norm == 0 ) return ; norm = Math . sqrt ( norm ) ; for ( int i = 0 ; i < desc . size ( ) ; i ++ ) { desc . value [ i ] /= norm ; }
public class DescribeDestinationsResult { /** * The destinations . * @ return The destinations . */ public java . util . List < Destination > getDestinations ( ) { } }
if ( destinations == null ) { destinations = new com . amazonaws . internal . SdkInternalList < Destination > ( ) ; } return destinations ;
public class NistHandler { /** * decodes the given WSQ file and returns a < code > Nist < / code > containing the decoded info . * @ param file the NIST file , not null * @ return a Nist instance containing decoded info , not null * @ see Nist */ public Nist decode ( File file ) { } }
try { return decode ( new FileInputStream ( file ) ) ; } catch ( FileNotFoundException e ) { throw new RuntimeException ( "unexpected error." , e ) ; }
public class MetricSchemaRecordQuery { /** * Specifies the scope of the query . * @ param scope The scope of the query . Cannot be null or empty . */ public void setScope ( String scope ) { } }
SystemAssert . requireArgument ( scope != null && ! scope . isEmpty ( ) , "Scope cannot be null or empty." ) ; this . scope = scope ;
public class LineReader { /** * One double per line . Empty lines and lines starting with # are skipped . * @ return an array of doubles from this file */ public static double [ ] doublesFrom ( InputStream is ) { } }
ArrayList < Double > doubles = new ArrayList < Double > ( ) ; for ( String line : new LineReader ( is ) ) { if ( line . length ( ) > 0 && ! line . startsWith ( "#" ) ) doubles . add ( Double . parseDouble ( line ) ) ; } // copy it , because we can ' t cast from Double to double . . . double [ ] ret = new double [ doubles . size ( ) ] ; for ( int i = 0 ; i < doubles . size ( ) ; i ++ ) { ret [ i ] = doubles . get ( i ) ; } return ret ;
public class DOMHandle { /** * Evaluate a string XPath expression against the retrieved document . * An XPath expression can return a Node or subinterface such as * Element or Text , a NodeList , or a Boolean , Number , or String value . * @ param xpathExpressionthe XPath expression as a string * @ param asthe type expected to be matched by the xpath * @ param < T > the type to return * @ returnthe value produced by the XPath expression * @ throws XPathExpressionException if xpathExpression cannot be evaluated */ public < T > T evaluateXPath ( String xpathExpression , Class < T > as ) throws XPathExpressionException { } }
return evaluateXPath ( xpathExpression , get ( ) , as ) ;
public class ErrorCollector { /** * Adds a non - fatal error to the message set , which may cause a failure if the error threshold is exceeded . * The message is not required to have a source line and column specified , but it is best practice to try * and include that information . */ public void addError ( Message message ) throws CompilationFailedException { } }
addErrorAndContinue ( message ) ; if ( errors != null && this . errors . size ( ) >= configuration . getTolerance ( ) ) { failIfErrors ( ) ; }
public class FastaWriterHelper { /** * Method which will write your given Sequences to the specified * { @ link OutputStream } . This is a very generic method which writes just the * AccessionID of the Sequence as the FASTA header . * @ param outputStream Stream to write to ; can be System . out * @ param sequences The sequences to write out * @ throws Exception Thrown normally thanks to IO problems */ public static void writeSequences ( OutputStream outputStream , Collection < Sequence < ? > > sequences ) throws Exception { } }
FastaHeaderFormatInterface < Sequence < ? > , Compound > fhfi = new FastaHeaderFormatInterface < Sequence < ? > , Compound > ( ) { @ Override public String getHeader ( Sequence < ? > sequence ) { return sequence . getAccession ( ) . toString ( ) ; } ; } ; FastaWriter < Sequence < ? > , Compound > fastaWriter = new FastaWriter < Sequence < ? > , Compound > ( outputStream , sequences , fhfi ) ; fastaWriter . process ( ) ;
public class SipCall { /** * This method sends a basic RE - INVITE on the current dialog . * This method returns when the request message has been sent out . The calling program must * subsequently call the waitReinviteResponse ( ) method ( one or more times ) to get the response ( s ) * and perhaps the sendReinviteOkAck ( ) method to send an ACK . On the receive side , pertinent * methods include waitForReinvite ( ) , respondToReinvite ( ) , and waitForAck ( ) . * @ param newContact An URI string ( ex : sip : bob @ 192.0.2.4:5093 ) for updating the remote target URI * kept by the far end ( target refresh ) , or null to not change that information . * @ param displayName Display name to set in the contact header sent to the far end if newContact * is not null . * @ param body A String to be used as the body of the message , for changing the media session . Use * null for no body bytes . * @ param contentType The body content type ( ie , ' application ' part of ' application / sdp ' ) , * required if there is to be any content ( even if body bytes length 0 ) . Use null for no * message content . * @ param contentSubType The body content sub - type ( ie , ' sdp ' part of ' application / sdp ' ) , required * if there is to be any content ( even if body bytes length 0 ) . Use null for no message * content . * @ return A SipTransaction object if the message was successfully sent , null otherwise . You don ' t * need to do anything with this returned object other than to pass it to methods that you * call subsequently for this operation , namely waitReinviteResponse ( ) and * sendReinviteOkAck ( ) . */ public SipTransaction sendReinvite ( String newContact , String displayName , String body , String contentType , String contentSubType ) { } }
return sendReinvite ( newContact , displayName , body , contentType , contentSubType , null , null ) ;
public class CommandLineParser { /** * This is a property with a boolean value which defaults to false * The user can ' turn this option on ' by passing a command line switch without a value ( e . g . - d ) in which case we need to * set the value to true * @ param property * @ return true if this is a boolean switch property */ private boolean isBooleanSwitchProperty ( ExecutionProperty property ) { } }
return property . hasDefaults ( ) && property . getDefaults ( ) . length == 1 && property . getDefaults ( ) [ 0 ] . equals ( "false" ) ;
public class DynamicList { /** * retrieve the item at the provided index , or return null if the index is past the end of the list */ public E get ( int index ) { } }
lock . readLock ( ) . lock ( ) ; try { if ( index >= size ) return null ; index ++ ; int c = 0 ; Node < E > finger = head ; for ( int i = maxHeight - 1 ; i >= 0 ; i -- ) { while ( c + finger . size [ i ] <= index ) { c += finger . size [ i ] ; finger = finger . next ( i ) ; } } assert c == index ; return finger . value ; } finally { lock . readLock ( ) . unlock ( ) ; }
public class DevicesInner { /** * Installs the updates on the data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ 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 < Void > installUpdatesAsync ( String deviceName , String resourceGroupName , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( installUpdatesWithServiceResponseAsync ( deviceName , resourceGroupName ) , serviceCallback ) ;
public class Engine { /** * Removes the rule block of the given name . * @ param name is the name of the rule block * @ return the rule block of the given name * @ throws RuntimeException if there is no rule block with the given name */ public RuleBlock removeRuleBlock ( String name ) { } }
for ( Iterator < RuleBlock > it = this . ruleBlocks . iterator ( ) ; it . hasNext ( ) ; ) { RuleBlock ruleBlock = it . next ( ) ; if ( ruleBlock . getName ( ) . equals ( name ) ) { it . remove ( ) ; return ruleBlock ; } } throw new RuntimeException ( String . format ( "[engine error] no rule block by name <%s>" , name ) ) ;
public class MetaClassConstant { /** * TODO Jochen : replace with new MetaMethod */ public MetaMethod getMethod ( String name , Class [ ] parameters ) { } }
return impl . pickMethod ( name , parameters ) ;
public class MurmurHash3v2 { /** * Final self mix of h * . * @ param h input to final mix * @ return mix */ private static long finalMix64 ( long h ) { } }
h ^= h >>> 33 ; h *= 0xff51afd7ed558ccdL ; h ^= h >>> 33 ; h *= 0xc4ceb9fe1a85ec53L ; h ^= h >>> 33 ; return h ;
public class TrieIterator { /** * Finding the next element . * This method is called just before returning the result of * next ( ) . * We always store the next element before it is requested . * In the case that we have to continue calculations into the * supplementary planes , a false will be returned . * @ param element return result object * @ return true if the next range is found , false if we have to proceed to * the supplementary range . */ private final boolean calculateNextBMPElement ( Element element ) { } }
int currentValue = m_nextValue_ ; m_currentCodepoint_ = m_nextCodepoint_ ; m_nextCodepoint_ ++ ; m_nextBlockIndex_ ++ ; if ( ! checkBlockDetail ( currentValue ) ) { setResult ( element , m_currentCodepoint_ , m_nextCodepoint_ , currentValue ) ; return true ; } // synwee check that next block index = = 0 here // enumerate BMP - the main loop enumerates data blocks while ( m_nextCodepoint_ < UCharacter . SUPPLEMENTARY_MIN_VALUE ) { // because of the way the character is split to form the index // the lead surrogate and trail surrogate can not be in the // mid of a block if ( m_nextCodepoint_ == LEAD_SURROGATE_MIN_VALUE_ ) { // skip lead surrogate code units , // go to lead surrogate codepoints m_nextIndex_ = BMP_INDEX_LENGTH_ ; } else if ( m_nextCodepoint_ == TRAIL_SURROGATE_MIN_VALUE_ ) { // go back to regular BMP code points m_nextIndex_ = m_nextCodepoint_ >> Trie . INDEX_STAGE_1_SHIFT_ ; } else { m_nextIndex_ ++ ; } m_nextBlockIndex_ = 0 ; if ( ! checkBlock ( currentValue ) ) { setResult ( element , m_currentCodepoint_ , m_nextCodepoint_ , currentValue ) ; return true ; } } m_nextCodepoint_ -- ; // step one back since this value has not been m_nextBlockIndex_ -- ; // retrieved yet . return false ;
public class DocTreeScanner { /** * { @ inheritDoc } This implementation scans the children in left to right order . * @ param node { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of scanning */ @ Override public R visitUses ( UsesTree node , P p ) { } }
R r = scan ( node . getServiceType ( ) , p ) ; r = scanAndReduce ( node . getDescription ( ) , p , r ) ; return r ;
public class Record { /** * Reads { @ code < T > } to the provided { @ code buffer } . * @ param buffer { @ code byte [ ] } ; of size { @ link # getRecordSize ( ) } * @ param t { @ code < T > } * @ throws InvalidArgument Thrown if either argument is null or if * { @ code buffer } is invalid */ public final void readToEntry ( byte [ ] buffer , T t ) { } }
if ( buffer == null ) { throw new InvalidArgument ( "buffer" , buffer ) ; } else if ( t == null ) { throw new InvalidArgument ( "cannot read a null entry" ) ; } else if ( buffer . length != recordSize ) { final String fmt = "invalid buffer (%d bytes, expected %d)" ; final String msg = format ( fmt , buffer . length , recordSize ) ; throw new InvalidArgument ( msg ) ; } readTo ( buffer , t ) ;
public class AbstractConfigAccessorBuilder { /** * { @ inheritDoc } */ @ Override public ConfigAccessorBuilder < T > withDefault ( T value ) { } }
synchronized ( this ) { this . defaultValue = value ; this . defaultString = ConfigProperty . UNCONFIGURED_VALUE ; } return this ;
public class DataMediaPairAction { /** * 批量添加DataMediaPair * @ param dataMediaPairInfo * @ throws Exception */ public void doBatchAdd ( @ FormGroup ( "batchDataMediaPairInfo" ) Group batchDataMediaPairInfo , @ Param ( "pipelineId" ) Long pipelineId , @ FormField ( name = "formBatchDataMediaPairError" , group = "batchDataMediaPairInfo" ) CustomErrors err , Navigator nav ) throws Exception { } }
String batchPairContent = batchDataMediaPairInfo . getField ( "batchPairContent" ) . getStringValue ( ) ; List < String > StringPairs = Arrays . asList ( batchPairContent . split ( "\r\n" ) ) ; try { for ( String stringPair : StringPairs ) { List < String > pairData = Arrays . asList ( stringPair . split ( "," ) ) ; if ( pairData . size ( ) < 4 ) { throw new ManagerException ( "[" + stringPair + "] the line not all parameters" ) ; } // build the pair source DataMedia sourceDataMedia = new DataMedia ( ) ; DataMediaSource sourceDataMediaSource = dataMediaSourceService . findById ( Long . parseLong ( StringUtils . trimToNull ( pairData . get ( 2 ) ) ) ) ; sourceDataMedia . setNamespace ( StringUtils . trimToNull ( pairData . get ( 0 ) ) ) ; sourceDataMedia . setName ( StringUtils . trimToNull ( pairData . get ( 1 ) ) ) ; sourceDataMedia . setSource ( sourceDataMediaSource ) ; Long sourceMediaId = dataMediaService . createReturnId ( sourceDataMedia ) ; sourceDataMedia . setId ( sourceMediaId ) ; // build the pair target DataMedia targetDataMedia = new DataMedia ( ) ; Long weight = 5L ; if ( StringUtils . isNumeric ( pairData . get ( 3 ) ) && pairData . size ( ) <= 5 ) { // 如果是纯数字 , 那说明是简化配置模式 DataMediaSource targetDataMediaSource = dataMediaSourceService . findById ( Long . parseLong ( StringUtils . trimToNull ( pairData . get ( 3 ) ) ) ) ; targetDataMedia . setNamespace ( StringUtils . trimToNull ( pairData . get ( 0 ) ) ) ; targetDataMedia . setName ( StringUtils . trimToNull ( pairData . get ( 1 ) ) ) ; targetDataMedia . setSource ( targetDataMediaSource ) ; Long targetMediaId = dataMediaService . createReturnId ( targetDataMedia ) ; targetDataMedia . setId ( targetMediaId ) ; if ( pairData . size ( ) >= 5 ) { weight = Long . parseLong ( StringUtils . trimToNull ( pairData . get ( 4 ) ) ) ; } } else { DataMediaSource targetDataMediaSource = dataMediaSourceService . findById ( Long . parseLong ( StringUtils . trimToNull ( pairData . get ( 5 ) ) ) ) ; targetDataMedia . setNamespace ( StringUtils . trimToNull ( pairData . get ( 3 ) ) ) ; targetDataMedia . setName ( StringUtils . trimToNull ( pairData . get ( 4 ) ) ) ; targetDataMedia . setSource ( targetDataMediaSource ) ; Long targetMediaId = dataMediaService . createReturnId ( targetDataMedia ) ; targetDataMedia . setId ( targetMediaId ) ; if ( pairData . size ( ) >= 7 ) { weight = Long . parseLong ( StringUtils . trimToNull ( pairData . get ( 6 ) ) ) ; } } // build the pair DataMediaPair dataMediaPair = new DataMediaPair ( ) ; dataMediaPair . setSource ( sourceDataMedia ) ; dataMediaPair . setTarget ( targetDataMedia ) ; dataMediaPair . setPushWeight ( weight ) ; dataMediaPair . setPipelineId ( pipelineId ) ; dataMediaPairService . createIfNotExist ( dataMediaPair ) ; } } catch ( Exception e ) { err . setMessage ( "invalidBatchDataMediaPair" ) ; return ; } nav . redirectToLocation ( "dataMediaPairList.htm?pipelineId=" + pipelineId ) ;
public class ApplicationDescriptorImpl { /** * If not already created , a new < code > administered - object < / code > element will be created and returned . * Otherwise , the first existing < code > administered - object < / code > element will be returned . * @ return the instance defined for the element < code > administered - object < / code > */ public AdministeredObjectType < ApplicationDescriptor > getOrCreateAdministeredObject ( ) { } }
List < Node > nodeList = model . get ( "administered-object" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new AdministeredObjectTypeImpl < ApplicationDescriptor > ( this , "administered-object" , model , nodeList . get ( 0 ) ) ; } return createAdministeredObject ( ) ;
public class FactionWarfareApi { /** * List of the top factions in faction warfare Top 4 leaderboard of factions * for kills and victory points separated by total , last week and yesterday * - - - This route expires daily at 11:05 * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ return ApiResponse & lt ; FactionWarfareLeaderboardResponse & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < FactionWarfareLeaderboardResponse > getFwLeaderboardsWithHttpInfo ( String datasource , String ifNoneMatch ) throws ApiException { } }
com . squareup . okhttp . Call call = getFwLeaderboardsValidateBeforeCall ( datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < FactionWarfareLeaderboardResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class IOUtil { /** * Reads the specified file into a map . The first value is used as key . The * rest is put into a list and used as map value . Each entry is one line of * the file . * Ensures that no null value is returned . * @ param filename * the name of the specification file ( not the path to it ) * @ param delimiter * the delimiter regex for one column * @ return a map with the first column as keys and the other columns as * values . * @ throws IOException * if unable to read the specification file */ public static Map < String , String [ ] > readMap ( String filename , String delimiter ) throws IOException { } }
Map < String , String [ ] > map = new TreeMap < > ( ) ; // read spec - file as resource , e . g . , from a jar try ( InputStreamReader isr = new InputStreamReader ( IOUtil . class . getResourceAsStream ( SPEC_DIR + filename ) ) ; BufferedReader reader = new BufferedReader ( isr ) ) { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { // split line into the values String [ ] values = line . split ( delimiter ) ; // put first element as key , rest as array of value - strings map . put ( values [ 0 ] , Arrays . copyOfRange ( values , 1 , values . length ) ) ; } assert map != null ; return map ; }
public class Data { /** * Filter this data by class . The resulting elements are guaranteed to be of the given type . */ @ CheckResult @ NonNull public final < O > Data < O > filter ( @ NonNull final Class < O > type ) { } }
// noinspection unchecked return ( Data < O > ) new FilterData < > ( this , new Predicate < Object > ( ) { @ Override public boolean apply ( Object o ) { return type . isInstance ( o ) ; } } ) ;
public class AbstractViewQuery { /** * Register a callback method for when the view is clicked . * @ param listener The callback method . * @ return self */ public T clicked ( View . OnClickListener listener ) { } }
if ( view != null ) { view . setOnClickListener ( listener ) ; } return self ( ) ;
public class CommerceNotificationAttachmentUtil { /** * Returns a range of all the commerce notification attachments where uuid = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceNotificationAttachmentModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param uuid the uuid * @ param start the lower bound of the range of commerce notification attachments * @ param end the upper bound of the range of commerce notification attachments ( not inclusive ) * @ return the range of matching commerce notification attachments */ public static List < CommerceNotificationAttachment > findByUuid ( String uuid , int start , int end ) { } }
return getPersistence ( ) . findByUuid ( uuid , start , end ) ;
public class BinaryBitmap { /** * Returns a new object with rotated image data by 90 degrees counterclockwise . * Only callable if { @ link # isRotateSupported ( ) } is true . * @ return A rotated version of this object . */ public BinaryBitmap rotateCounterClockwise ( ) { } }
LuminanceSource newSource = binarizer . getLuminanceSource ( ) . rotateCounterClockwise ( ) ; return new BinaryBitmap ( binarizer . createBinarizer ( newSource ) ) ;
public class IdentityTemplateLibrary { /** * Get all templated coordinates for the provided molecule . The return collection has * coordinates ordered based on the input . * @ param mol molecule ( or fragment ) to lookup * @ return the coordinates */ Collection < Point2d [ ] > getCoordinates ( IAtomContainer mol ) { } }
try { // create the library key to lookup an entry , we also store // the canonical out ordering int n = mol . getAtomCount ( ) ; int [ ] ordering = new int [ n ] ; String smiles = cansmi ( mol , ordering ) ; final Collection < Point2d [ ] > coordSet = templateMap . get ( smiles ) ; final List < Point2d [ ] > orderedCoordSet = new ArrayList < > ( coordSet . size ( ) ) ; for ( Point2d [ ] coords : coordSet ) { Point2d [ ] orderedCoords = new Point2d [ coords . length ] ; for ( int i = 0 ; i < n ; i ++ ) { orderedCoords [ i ] = new Point2d ( coords [ ordering [ i ] ] ) ; } orderedCoordSet . add ( orderedCoords ) ; } return Collections . unmodifiableList ( orderedCoordSet ) ; } catch ( CDKException e ) { return Collections . emptyList ( ) ; }
public class NumberUtil { /** * 数字转 { @ link BigDecimal } * @ param number 数字 * @ return { @ link BigDecimal } * @ since 4.0.9 */ public static BigDecimal toBigDecimal ( Number number ) { } }
if ( null == number ) { return BigDecimal . ZERO ; } return toBigDecimal ( number . toString ( ) ) ;
public class JobHistoryFileParserHadoop2 { /** * maintains compatibility between hadoop 1.0 keys and hadoop 2.0 keys . It also confirms that this * key exists in JobHistoryKeys enum * @ throws IllegalArgumentException NullPointerException */ private String getKey ( String key ) throws IllegalArgumentException { } }
String checkKey = JobHistoryKeys . HADOOP2_TO_HADOOP1_MAPPING . containsKey ( key ) ? JobHistoryKeys . HADOOP2_TO_HADOOP1_MAPPING . get ( key ) : key ; return ( JobHistoryKeys . valueOf ( checkKey ) . toString ( ) ) ;
public class MediaServicesInner { /** * Regenerates a primary or secondary key for a Media Service . * @ param resourceGroupName Name of the resource group within the Azure subscription . * @ param mediaServiceName Name of the Media Service . * @ param keyType The keyType indicating which key you want to regenerate , Primary or Secondary . Possible values include : ' Primary ' , ' Secondary ' * @ 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 < RegenerateKeyOutputInner > regenerateKeyAsync ( String resourceGroupName , String mediaServiceName , KeyType keyType , final ServiceCallback < RegenerateKeyOutputInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( regenerateKeyWithServiceResponseAsync ( resourceGroupName , mediaServiceName , keyType ) , serviceCallback ) ;