signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class RemoteMessageReceiver { /** * Update this filter with this new information .
* Override this to do something if there is a remote version of this filter .
* @ param messageFilter The message filter I am updating .
* @ param properties New filter information ( ie , bookmark = 345 ) . */
public void setNewFilterProperties ( BaseMessageFilter messageFilter , Object [ ] [ ] mxProperties , Map < String , Object > propFilter ) { } } | super . setNewFilterProperties ( messageFilter , mxProperties , propFilter ) ; // Does nothing .
try { if ( messageFilter . isUpdateRemoteFilter ( ) ) // Almost always true
if ( messageFilter . getRemoteFilterID ( ) != null ) // If the remote filter exists
m_receiveQueue . updateRemoteFilterProperties ( messageFilter , mxProperties , propFilter ) ; } catch ( RemoteException ex ) { ex . printStackTrace ( ) ; } |
public class AppsImpl { /** * Updates the name or description of the application .
* @ param appId The application ID .
* @ param applicationUpdateObject A model containing Name and Description of the application .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws ErrorResponseException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the OperationStatus object if successful . */
public OperationStatus update ( UUID appId , ApplicationUpdateObject applicationUpdateObject ) { } } | return updateWithServiceResponseAsync ( appId , applicationUpdateObject ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class JavaLexer { /** * $ ANTLR start " T _ _ 90" */
public final void mT__90 ( ) throws RecognitionException { } } | try { int _type = T__90 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 71:7 : ( ' insert ' )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 71:9 : ' insert '
{ match ( "insert" ) ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class BackwardTypeQualifierDataflowFactoryFactory { /** * ( non - Javadoc )
* @ see
* edu . umd . cs . findbugs . classfile . IAnalysisEngine # analyze ( edu . umd . cs . findbugs
* . classfile . IAnalysisCache , java . lang . Object ) */
@ Override public BackwardTypeQualifierDataflowFactory analyze ( IAnalysisCache analysisCache , MethodDescriptor descriptor ) throws CheckedAnalysisException { } } | return new BackwardTypeQualifierDataflowFactory ( descriptor ) ; |
public class SimpleEncrypt { /** * 混合加密
* @ param string { @ link String }
* @ param key { @ link Integer }
* @ return { @ link String } */
public static String mix ( String string , int key ) { } } | return ascii ( JavaEncrypt . base64 ( xor ( string , key ) ) , key ) ; |
public class nsrpcnode { /** * Use this API to fetch nsrpcnode resource of given name . */
public static nsrpcnode get ( nitro_service service , String ipaddress ) throws Exception { } } | nsrpcnode obj = new nsrpcnode ( ) ; obj . set_ipaddress ( ipaddress ) ; nsrpcnode response = ( nsrpcnode ) obj . get_resource ( service ) ; return response ; |
public class Es6RewriteBlockScopedDeclaration { /** * Whether n is inside a loop . If n is inside a function which is inside a loop , we do not
* consider it to be inside a loop . */
private boolean inLoop ( Node n ) { } } | Node enclosingNode = NodeUtil . getEnclosingNode ( n , isLoopOrFunction ) ; return enclosingNode != null && ! enclosingNode . isFunction ( ) ; |
public class GenerateBuildInfoMojo { /** * Important : parameter type must match member type ! */
public void setSelectedSystemProperties ( final Set < String > aCollection ) { } } | selectedSystemProperties = new HashSet < > ( ) ; if ( aCollection != null ) { for ( final String sName : aCollection ) if ( StringHelper . hasText ( sName ) ) if ( ! selectedSystemProperties . add ( sName ) ) getLog ( ) . warn ( "The selected system property '" + sName + "' is contained more than once" ) ; } if ( ! selectedSystemProperties . isEmpty ( ) ) { // If we have a set of selected , don ' t use all system properties
if ( withAllSystemProperties ) { getLog ( ) . warn ( "Disabling all system properties, because selected system properties are defined!" ) ; setWithAllSystemProperties ( false ) ; } } |
public class LaunchConfigurationConfigurator { /** * Change the main java class within the given configuration .
* @ param wc the configuration to change .
* @ param name the qualified name of the main Java class .
* @ since 0.7 */
protected static void setMainJavaClass ( ILaunchConfigurationWorkingCopy wc , String name ) { } } | wc . setAttribute ( IJavaLaunchConfigurationConstants . ATTR_MAIN_TYPE_NAME , name ) ; |
public class ByteArrayISO8859Writer { private void writeEncoded ( char [ ] ca , int offset , int length ) throws IOException { } } | if ( _bout == null ) { _bout = new ByteArrayOutputStream2 ( 2 * length ) ; _writer = new OutputStreamWriter ( _bout , StringUtil . __ISO_8859_1 ) ; } else _bout . reset ( ) ; _writer . write ( ca , offset , length ) ; _writer . flush ( ) ; ensureSpareCapacity ( _bout . getCount ( ) ) ; System . arraycopy ( _bout . getBuf ( ) , 0 , _buf , _size , _bout . getCount ( ) ) ; _size += _bout . getCount ( ) ; |
public class AdductFormula { /** * Returns a List for looping over all isotopes in this adduct formula .
* @ return A List with the isotopes in this adduct formula */
private List < IIsotope > isotopesList ( ) { } } | List < IIsotope > isotopes = new ArrayList < IIsotope > ( ) ; Iterator < IMolecularFormula > componentIterator = components . iterator ( ) ; while ( componentIterator . hasNext ( ) ) { Iterator < IIsotope > compIsotopes = componentIterator . next ( ) . isotopes ( ) . iterator ( ) ; while ( compIsotopes . hasNext ( ) ) { IIsotope isotope = compIsotopes . next ( ) ; if ( ! isotopes . contains ( isotope ) ) { isotopes . add ( isotope ) ; } } } return isotopes ; |
public class Builder { /** * Returns a new { @ link BitemporalMapper } .
* @ param vtFrom the column name containing the valid time start
* @ param vtTo the column name containing the valid time stop
* @ param ttFrom the column name containing the transaction time start
* @ param ttTo the column name containing the transaction time stop
* @ return a new { @ link BitemporalMapper } */
public static BitemporalMapper bitemporalMapper ( String vtFrom , String vtTo , String ttFrom , String ttTo ) { } } | return new BitemporalMapper ( vtFrom , vtTo , ttFrom , ttTo ) ; |
public class ErdosRenyiRelationshipGenerator { /** * Improved implementation of Erdos - Renyi generator based on bijection from
* edge labels to edge realisations . Works very well for large number of nodes ,
* but is slow with increasing number of edges . Best for denser networks , with
* a clear giant component .
* @ return edge list */
private List < Pair < Integer , Integer > > doGenerateEdgesWithOmitList ( ) { } } | final int numberOfNodes = getConfiguration ( ) . getNumberOfNodes ( ) ; final int numberOfEdges = getConfiguration ( ) . getNumberOfEdges ( ) ; final long maxEdges = numberOfNodes * ( numberOfNodes - 1 ) / 2 ; final List < Pair < Integer , Integer > > edges = new LinkedList < > ( ) ; for ( Long index : edgeIndices ( numberOfEdges , maxEdges ) ) { edges . add ( indexToEdgeBijection ( index ) ) ; } return edges ; |
public class HistQuotesRequest { /** * Put everything smaller than days at 0
* @ param cal calendar to be cleaned */
private Calendar cleanHistCalendar ( Calendar cal ) { } } | cal . set ( Calendar . MILLISECOND , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; cal . set ( Calendar . MINUTE , 0 ) ; cal . set ( Calendar . HOUR , 0 ) ; return cal ; |
public class PluginClassLoader { /** * Extracts a resource from the plugin artifact ZIP and saves it to the work
* directory . If the resource has already been extracted ( we ' re re - using the
* work directory ) then this simply returns what is already there .
* @ param zipEntry a ZIP file entry
* @ throws IOException if an I / O error has occurred */
private URL extractResource ( ZipEntry zipEntry ) throws IOException { } } | File resourceWorkDir = new File ( workDir , "resources" ) ; if ( ! resourceWorkDir . exists ( ) ) { resourceWorkDir . mkdirs ( ) ; } File resourceFile = new File ( resourceWorkDir , zipEntry . getName ( ) ) ; if ( ! resourceFile . isFile ( ) ) { resourceFile . getParentFile ( ) . mkdirs ( ) ; File tmpFile = File . createTempFile ( "res" , ".tmp" , resourceWorkDir ) ; tmpFile . deleteOnExit ( ) ; InputStream input = null ; OutputStream output = null ; try { input = this . pluginArtifactZip . getInputStream ( zipEntry ) ; output = new FileOutputStream ( tmpFile ) ; IOUtils . copy ( input , output ) ; output . flush ( ) ; tmpFile . renameTo ( resourceFile ) ; } catch ( IOException e ) { throw e ; } finally { IOUtils . closeQuietly ( input ) ; IOUtils . closeQuietly ( output ) ; } } return resourceFile . toURI ( ) . toURL ( ) ; |
public class ContextManager { /** * THIS ASSUMES THAT IT IS CALLED ON A THREAD HOLDING THE LOCK ON THE HeartBeatManager . */
private void handleTaskException ( final TaskClientCodeException e ) { } } | LOG . log ( Level . SEVERE , "TaskClientCodeException" , e ) ; final ByteString exception = ByteString . copyFrom ( this . exceptionCodec . toBytes ( e . getCause ( ) ) ) ; final ReefServiceProtos . TaskStatusProto taskStatus = ReefServiceProtos . TaskStatusProto . newBuilder ( ) . setContextId ( e . getContextId ( ) ) . setTaskId ( e . getTaskId ( ) ) . setResult ( exception ) . setState ( ReefServiceProtos . State . FAILED ) . build ( ) ; LOG . log ( Level . SEVERE , "Sending heartbeat: {0}" , taskStatus ) ; this . heartBeatManager . sendTaskStatus ( taskStatus ) ; |
public class FacebookRestClient { /** * Adds several tags to a photo .
* @ param photoId The photo id of the photo to be tagged .
* @ param tags A list of PhotoTags .
* @ return a list of booleans indicating whether the tag was successfully added . */
public T photos_addTags ( Long photoId , Collection < PhotoTag > tags ) throws FacebookException , IOException { } } | assert ( photoId > 0 ) ; assert ( null != tags && ! tags . isEmpty ( ) ) ; JSONArray jsonTags = new JSONArray ( ) ; for ( PhotoTag tag : tags ) { jsonTags . add ( tag . jsonify ( ) ) ; } return this . callMethod ( FacebookMethod . PHOTOS_ADD_TAG , new Pair < String , CharSequence > ( "pid" , photoId . toString ( ) ) , new Pair < String , CharSequence > ( "tags" , jsonTags . toString ( ) ) ) ; |
public class CmsPdfResourceHandler { /** * Handles a request for a PDF thumbnail . < p >
* @ param cms the current CMS context
* @ param request the servlet request
* @ param response the servlet response
* @ param uri the current uri
* @ throws Exception if something goes wrong */
private void handleThumbnailLink ( CmsObject cms , HttpServletRequest request , HttpServletResponse response , String uri ) throws Exception { } } | String options = request . getParameter ( CmsPdfThumbnailLink . PARAM_OPTIONS ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( options ) ) { options = "w:64" ; } CmsPdfThumbnailLink linkObj = new CmsPdfThumbnailLink ( cms , uri , options ) ; CmsResource pdf = linkObj . getPdfResource ( ) ; CmsFile pdfFile = cms . readFile ( pdf ) ; CmsPdfThumbnailGenerator thumbnailGenerator = new CmsPdfThumbnailGenerator ( ) ; // use a wrapped resource because we want the cache to store files with the correct ( image file ) extensions
CmsWrappedResource wrapperWithImageExtension = new CmsWrappedResource ( pdfFile ) ; wrapperWithImageExtension . setRootPath ( pdfFile . getRootPath ( ) + "." + linkObj . getFormat ( ) ) ; String cacheName = m_thumbnailCache . getCacheName ( wrapperWithImageExtension . getResource ( ) , options + ";" + linkObj . getFormat ( ) ) ; byte [ ] imageData = m_thumbnailCache . getCacheContent ( cacheName ) ; if ( imageData == null ) { imageData = thumbnailGenerator . generateThumbnail ( new ByteArrayInputStream ( pdfFile . getContents ( ) ) , linkObj . getWidth ( ) , linkObj . getHeight ( ) , linkObj . getFormat ( ) , linkObj . getPage ( ) ) ; m_thumbnailCache . saveCacheFile ( cacheName , imageData ) ; } response . setContentType ( IMAGE_MIMETYPES . get ( linkObj . getFormat ( ) ) ) ; response . getOutputStream ( ) . write ( imageData ) ; CmsResourceInitException initEx = new CmsResourceInitException ( CmsPdfResourceHandler . class ) ; initEx . setClearErrors ( true ) ; throw initEx ; |
public class POIUtils { /** * 指定した書式のインデックス番号を取得する 。 シートに存在しない場合は 、 新しく作成する 。
* @ param sheet シート
* @ param pattern 作成する書式のパターン
* @ return 書式のインデックス番号 。
* @ throws IllegalArgumentException { @ literal sheet = = null . }
* @ throws IllegalArgumentException { @ literal pattern = = null | | pattern . isEmpty ( ) . } */
public static short getDataFormatIndex ( final Sheet sheet , final String pattern ) { } } | ArgUtils . notNull ( sheet , "sheet" ) ; ArgUtils . notEmpty ( pattern , "pattern" ) ; return sheet . getWorkbook ( ) . getCreationHelper ( ) . createDataFormat ( ) . getFormat ( pattern ) ; |
public class CiModelInterpolator { /** * Empirical data from 3 . x , actual = 40 */
public Model interpolateModel ( Model model , File projectDir , ModelBuildingRequest config , ModelProblemCollector problems ) { } } | interpolateObject ( model , model , projectDir , config , problems ) ; return model ; |
public class TwitterEndpointServices { /** * Per { @ link https : / / dev . twitter . com / oauth / overview / creating - signatures } , a signature for an authorized request takes the
* following form :
* [ HTTP Method ] + " & " + [ Percent encoded URL ] + " & " + [ Percent encoded parameter string ]
* - HTTP Method : Request method ( either " GET " or " POST " ) . Must be in uppercase .
* - Percent encoded URL : Base URL to which the request is directed , minus any query string or hash parameters . Be sure the
* URL uses the correct protocol ( http or https ) that matches the actual request sent to the Twitter API .
* - Percent encoded parameter string : Each request parameter name and value is percent encoded according to a specific
* structure
* @ param requestMethod
* @ param baseUrl
* Raw base URL , not percent encoded . This method will perform the percent encoding .
* @ param parameters
* Raw parameter names and values , not percent encoded . This method will perform the percent encoding .
* @ return */
public String createSignatureBaseString ( String requestMethod , String baseUrl , Map < String , String > parameters ) { } } | if ( requestMethod == null || ( ! requestMethod . equalsIgnoreCase ( "GET" ) && ! requestMethod . equalsIgnoreCase ( "POST" ) ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Request method was not an expected value (GET or POST) so defaulting to POST" ) ; } requestMethod = "POST" ; } String cleanedUrl = removeQueryAndFragment ( baseUrl ) ; String parameterString = createParameterStringForSignature ( parameters ) ; StringBuilder signatureBaseString = new StringBuilder ( ) ; signatureBaseString . append ( requestMethod . toUpperCase ( ) ) ; signatureBaseString . append ( "&" ) ; signatureBaseString . append ( Utils . percentEncode ( cleanedUrl ) ) ; signatureBaseString . append ( "&" ) ; signatureBaseString . append ( Utils . percentEncode ( parameterString ) ) ; return signatureBaseString . toString ( ) ; |
public class DRL5Lexer { /** * $ ANTLR start " FLOAT " */
public final void mFLOAT ( ) throws RecognitionException { } } | try { int _type = FLOAT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:5 : ( ( ' 0 ' . . ' 9 ' ) + ' . ' ( ' 0 ' . . ' 9 ' ) * ( Exponent ) ? ( FloatTypeSuffix ) ? | ' . ' ( ' 0 ' . . ' 9 ' ) + ( Exponent ) ? ( FloatTypeSuffix ) ? | ( ' 0 ' . . ' 9 ' ) + Exponent ( FloatTypeSuffix ) ? | ( ' 0 ' . . ' 9 ' ) + FloatTypeSuffix )
int alt13 = 4 ; alt13 = dfa13 . predict ( input ) ; switch ( alt13 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:9 : ( ' 0 ' . . ' 9 ' ) + ' . ' ( ' 0 ' . . ' 9 ' ) * ( Exponent ) ? ( FloatTypeSuffix ) ?
{ // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:9 : ( ' 0 ' . . ' 9 ' ) +
int cnt3 = 0 ; loop3 : while ( true ) { int alt3 = 2 ; int LA3_0 = input . LA ( 1 ) ; if ( ( ( LA3_0 >= '0' && LA3_0 <= '9' ) ) ) { alt3 = 1 ; } switch ( alt3 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt3 >= 1 ) break loop3 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 3 , input ) ; throw eee ; } cnt3 ++ ; } match ( '.' ) ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:25 : ( ' 0 ' . . ' 9 ' ) *
loop4 : while ( true ) { int alt4 = 2 ; int LA4_0 = input . LA ( 1 ) ; if ( ( ( LA4_0 >= '0' && LA4_0 <= '9' ) ) ) { alt4 = 1 ; } switch ( alt4 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop4 ; } } // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:37 : ( Exponent ) ?
int alt5 = 2 ; int LA5_0 = input . LA ( 1 ) ; if ( ( LA5_0 == 'E' || LA5_0 == 'e' ) ) { alt5 = 1 ; } switch ( alt5 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:37 : Exponent
{ mExponent ( ) ; if ( state . failed ) return ; } break ; } // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 88:47 : ( FloatTypeSuffix ) ?
int alt6 = 2 ; int LA6_0 = input . LA ( 1 ) ; if ( ( LA6_0 == 'B' || LA6_0 == 'D' || LA6_0 == 'F' || LA6_0 == 'd' || LA6_0 == 'f' ) ) { alt6 = 1 ; } switch ( alt6 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( input . LA ( 1 ) == 'B' || input . LA ( 1 ) == 'D' || input . LA ( 1 ) == 'F' || input . LA ( 1 ) == 'd' || input . LA ( 1 ) == 'f' ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; } } break ; case 2 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 89:9 : ' . ' ( ' 0 ' . . ' 9 ' ) + ( Exponent ) ? ( FloatTypeSuffix ) ?
{ match ( '.' ) ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 89:13 : ( ' 0 ' . . ' 9 ' ) +
int cnt7 = 0 ; loop7 : while ( true ) { int alt7 = 2 ; int LA7_0 = input . LA ( 1 ) ; if ( ( ( LA7_0 >= '0' && LA7_0 <= '9' ) ) ) { alt7 = 1 ; } switch ( alt7 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt7 >= 1 ) break loop7 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 7 , input ) ; throw eee ; } cnt7 ++ ; } // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 89:25 : ( Exponent ) ?
int alt8 = 2 ; int LA8_0 = input . LA ( 1 ) ; if ( ( LA8_0 == 'E' || LA8_0 == 'e' ) ) { alt8 = 1 ; } switch ( alt8 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 89:25 : Exponent
{ mExponent ( ) ; if ( state . failed ) return ; } break ; } // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 89:35 : ( FloatTypeSuffix ) ?
int alt9 = 2 ; int LA9_0 = input . LA ( 1 ) ; if ( ( LA9_0 == 'B' || LA9_0 == 'D' || LA9_0 == 'F' || LA9_0 == 'd' || LA9_0 == 'f' ) ) { alt9 = 1 ; } switch ( alt9 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( input . LA ( 1 ) == 'B' || input . LA ( 1 ) == 'D' || input . LA ( 1 ) == 'F' || input . LA ( 1 ) == 'd' || input . LA ( 1 ) == 'f' ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; } } break ; case 3 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 90:9 : ( ' 0 ' . . ' 9 ' ) + Exponent ( FloatTypeSuffix ) ?
{ // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 90:9 : ( ' 0 ' . . ' 9 ' ) +
int cnt10 = 0 ; loop10 : while ( true ) { int alt10 = 2 ; int LA10_0 = input . LA ( 1 ) ; if ( ( ( LA10_0 >= '0' && LA10_0 <= '9' ) ) ) { alt10 = 1 ; } switch ( alt10 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt10 >= 1 ) break loop10 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 10 , input ) ; throw eee ; } cnt10 ++ ; } mExponent ( ) ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 90:30 : ( FloatTypeSuffix ) ?
int alt11 = 2 ; int LA11_0 = input . LA ( 1 ) ; if ( ( LA11_0 == 'B' || LA11_0 == 'D' || LA11_0 == 'F' || LA11_0 == 'd' || LA11_0 == 'f' ) ) { alt11 = 1 ; } switch ( alt11 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( input . LA ( 1 ) == 'B' || input . LA ( 1 ) == 'D' || input . LA ( 1 ) == 'F' || input . LA ( 1 ) == 'd' || input . LA ( 1 ) == 'f' ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; } } break ; case 4 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 91:9 : ( ' 0 ' . . ' 9 ' ) + FloatTypeSuffix
{ // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 91:9 : ( ' 0 ' . . ' 9 ' ) +
int cnt12 = 0 ; loop12 : while ( true ) { int alt12 = 2 ; int LA12_0 = input . LA ( 1 ) ; if ( ( ( LA12_0 >= '0' && LA12_0 <= '9' ) ) ) { alt12 = 1 ; } switch ( alt12 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g :
{ if ( ( input . LA ( 1 ) >= '0' && input . LA ( 1 ) <= '9' ) ) { input . consume ( ) ; state . failed = false ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : if ( cnt12 >= 1 ) break loop12 ; if ( state . backtracking > 0 ) { state . failed = true ; return ; } EarlyExitException eee = new EarlyExitException ( 12 , input ) ; throw eee ; } cnt12 ++ ; } mFloatTypeSuffix ( ) ; if ( state . failed ) return ; } break ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving
} |
public class AbstractMultipartUtility { /** * Adds a upload file section to the request
* @ param fieldName name attribute in & lt ; input type = " file " name = " . . . " / & gt ;
* @ param uploadFile a File to be uploaded
* @ throws IOException if problems */
public void addFilePart ( final String fieldName , final File uploadFile ) throws IOException { } } | String fileName = uploadFile . getName ( ) ; addFilePart ( fieldName , new FileInputStream ( uploadFile ) , fileName , URLConnection . guessContentTypeFromName ( fileName ) ) ; |
public class DeleteCorsPolicyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteCorsPolicyRequest deleteCorsPolicyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteCorsPolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteCorsPolicyRequest . getContainerName ( ) , CONTAINERNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class GlobalProperties { /** * Sets the partitioning property for the global properties .
* @ param partitioning The new partitioning to set .
* @ param partitionedFields */
public void setHashPartitioned ( FieldList partitionedFields ) { } } | this . partitioning = PartitioningProperty . HASH_PARTITIONED ; this . partitioningFields = partitionedFields ; this . ordering = null ; |
public class ClassScaner { /** * 加载类
* @ param className 类名
* @ return 加载的类 */
private Class < ? > loadClass ( String className ) { } } | Class < ? > clazz = null ; try { clazz = Class . forName ( className , this . initialize , ClassUtil . getClassLoader ( ) ) ; } catch ( NoClassDefFoundError e ) { // 由于依赖库导致的类无法加载 , 直接跳过此类
} catch ( UnsupportedClassVersionError e ) { // 版本导致的不兼容的类 , 跳过
} catch ( Exception e ) { throw new RuntimeException ( e ) ; // Console . error ( e ) ;
} return clazz ; |
public class FSDirectory { /** * Verify quota for adding or moving a new INode with required
* namespace and diskspace to a given position .
* This functiuon assumes that the nsQuotaStartPos is less or equal than the dsQuotaStartPos
* @ param inodes INodes corresponding to a path
* @ param dsQuotaStartPos the start position where the NS quota needs to be updated
* @ param dsQuotaStartPos the start position where the DS quota needs to be updated
* @ param endPos the end position where the NS and DS quota need to be updated
* @ param nsDelta needed namespace
* @ param dsDelta needed diskspace
* @ throws QuotaExceededException if quota limit is exceeded . */
private void verifyQuota ( INode [ ] inodes , int nsQuotaStartPos , int dsQuotaStartPos , int endPos , long nsDelta , long dsDelta ) throws QuotaExceededException { } } | if ( ! ready ) { // Do not check quota if edits log is still being processed
return ; } if ( endPos > inodes . length ) { endPos = inodes . length ; } int i = endPos - 1 ; Assert . assertTrue ( "nsQuotaStartPos shall be less or equal than the dsQuotaStartPos" , ( nsQuotaStartPos <= dsQuotaStartPos ) ) ; try { // check existing components in the path
for ( ; i >= nsQuotaStartPos ; i -- ) { if ( inodes [ i ] . isQuotaSet ( ) ) { // a directory with quota
INodeDirectoryWithQuota node = ( INodeDirectoryWithQuota ) inodes [ i ] ; if ( i >= dsQuotaStartPos ) { // Verify both nsQuota and dsQuota
node . verifyQuota ( nsDelta , dsDelta ) ; } else { // Verify the nsQuota only
node . verifyQuota ( nsDelta , 0 ) ; } } } } catch ( QuotaExceededException e ) { e . setPathName ( getFullPathName ( inodes , i ) ) ; throw e ; } |
public class CommerceVirtualOrderItemPersistenceImpl { /** * Caches the commerce virtual order item in the entity cache if it is enabled .
* @ param commerceVirtualOrderItem the commerce virtual order item */
@ Override public void cacheResult ( CommerceVirtualOrderItem commerceVirtualOrderItem ) { } } | entityCache . putResult ( CommerceVirtualOrderItemModelImpl . ENTITY_CACHE_ENABLED , CommerceVirtualOrderItemImpl . class , commerceVirtualOrderItem . getPrimaryKey ( ) , commerceVirtualOrderItem ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { commerceVirtualOrderItem . getUuid ( ) , commerceVirtualOrderItem . getGroupId ( ) } , commerceVirtualOrderItem ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_COMMERCEORDERITEMID , new Object [ ] { commerceVirtualOrderItem . getCommerceOrderItemId ( ) } , commerceVirtualOrderItem ) ; commerceVirtualOrderItem . resetOriginalValues ( ) ; |
public class GitHubProjectMojo { /** * Log given message at info level
* @ param message */
protected void info ( String message ) { } } | final Log log = getLog ( ) ; if ( log != null ) log . info ( message ) ; |
public class BufferedDiskCache { /** * Removes the item from the disk cache and the staging area . */
public Task < Void > remove ( final CacheKey key ) { } } | Preconditions . checkNotNull ( key ) ; mStagingArea . remove ( key ) ; try { return Task . call ( new Callable < Void > ( ) { @ Override public Void call ( ) throws Exception { try { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . beginSection ( "BufferedDiskCache#remove" ) ; } mStagingArea . remove ( key ) ; mFileCache . remove ( key ) ; } finally { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . endSection ( ) ; } } return null ; } } , mWriteExecutor ) ; } catch ( Exception exception ) { // Log failure
// TODO : 3697790
FLog . w ( TAG , exception , "Failed to schedule disk-cache remove for %s" , key . getUriString ( ) ) ; return Task . forError ( exception ) ; } |
public class TypeSimplifier { /** * Returns the name of the given type , including any enclosing types but not the package . */
static String classNameOf ( TypeElement type ) { } } | String name = type . getQualifiedName ( ) . toString ( ) ; String pkgName = packageNameOf ( type ) ; return pkgName . isEmpty ( ) ? name : name . substring ( pkgName . length ( ) + 1 ) ; |
public class AsyncQueue { /** * Invoke { @ code function } with up to { @ code maxSize } elements removed from the head of the queue ,
* and insert elements in the return value to the tail of the queue .
* If no element is currently available , invocation of { @ code function } will be deferred until some
* element is available , or no more elements will be . Spurious invocation of { @ code function } is
* possible .
* Insertion through return value of { @ code function } will be effective even if { @ link # finish ( ) } has been invoked .
* When borrow ( of a non - empty list ) is ongoing , { @ link # isFinished ( ) } will return false .
* If an empty list is supplied to { @ code function } , it must not return a result indicating intention
* to insert elements into the queue . */
public < O > ListenableFuture < O > borrowBatchAsync ( int maxSize , Function < List < T > , BorrowResult < T , O > > function ) { } } | checkArgument ( maxSize >= 0 , "maxSize must be at least 0" ) ; ListenableFuture < List < T > > borrowedListFuture ; synchronized ( this ) { List < T > list = getBatch ( maxSize ) ; if ( ! list . isEmpty ( ) ) { borrowedListFuture = immediateFuture ( list ) ; borrowerCount ++ ; } else if ( finishing && borrowerCount == 0 ) { borrowedListFuture = immediateFuture ( ImmutableList . of ( ) ) ; } else { borrowedListFuture = Futures . transform ( notEmptySignal , ignored -> { synchronized ( this ) { List < T > batch = getBatch ( maxSize ) ; if ( ! batch . isEmpty ( ) ) { borrowerCount ++ ; } return batch ; } } , executor ) ; } } return Futures . transform ( borrowedListFuture , elements -> { // The borrowerCount field was only incremented for non - empty lists .
// Decrements should only happen for non - empty lists .
// When it should , it must always happen even if the caller - supplied function throws .
try { BorrowResult < T , O > borrowResult = function . apply ( elements ) ; if ( elements . isEmpty ( ) ) { checkArgument ( borrowResult . getElementsToInsert ( ) . isEmpty ( ) , "Function must not insert anything when no element is borrowed" ) ; return borrowResult . getResult ( ) ; } for ( T element : borrowResult . getElementsToInsert ( ) ) { offer ( element ) ; } return borrowResult . getResult ( ) ; } finally { if ( ! elements . isEmpty ( ) ) { synchronized ( this ) { borrowerCount -- ; signalIfFinishing ( ) ; } } } } , directExecutor ( ) ) ; |
public class KAMStoreSchemaServiceImpl { /** * { @ inheritDoc } */
@ Override public boolean deleteKAMStoreSchema ( DBConnection dbc , String schemaName ) throws IOException { } } | boolean deleteSchemas = getSchemaManagementStatus ( dbc ) ; if ( deleteSchemas ) { runScripts ( dbc , "/" + dbc . getType ( ) + DELETE_KAM_SQL_PATH , schemaName , deleteSchemas ) ; } else { // Truncate the schema instead of deleting it .
InputStream sqlStream = null ; if ( dbc . isMysql ( ) ) { sqlStream = getClass ( ) . getResourceAsStream ( "/" + dbc . getType ( ) + KAM_SQL_PATH + "1.sql" ) ; } else if ( dbc . isOracle ( ) ) { sqlStream = getClass ( ) . getResourceAsStream ( "/" + dbc . getType ( ) + KAM_SQL_PATH + "0.sql" ) ; } if ( sqlStream != null ) { runScript ( dbc , sqlStream , schemaName ) ; } } return deleteSchemas ; |
public class ThriftDocServicePlugin { /** * Methods related with extracting documentation strings . */
@ Override public Map < String , String > loadDocStrings ( Set < ServiceConfig > serviceConfigs ) { } } | return serviceConfigs . stream ( ) . flatMap ( c -> c . service ( ) . as ( THttpService . class ) . get ( ) . entries ( ) . values ( ) . stream ( ) ) . flatMap ( entry -> entry . interfaces ( ) . stream ( ) . map ( Class :: getClassLoader ) ) . flatMap ( loader -> docstringExtractor . getAllDocStrings ( loader ) . entrySet ( ) . stream ( ) ) . collect ( toImmutableMap ( Map . Entry :: getKey , Map . Entry :: getValue , ( a , b ) -> a ) ) ; |
public class SourceFile { /** * setter for author - sets
* @ generated
* @ param v value to set into the feature */
public void setAuthor ( String v ) { } } | if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_author == null ) jcasType . jcas . throwFeatMissing ( "author" , "de.julielab.jules.types.ace.SourceFile" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_author , v ) ; |
public class TurfAssertions { /** * Enforce expectations about types of { @ link Feature } inputs for Turf . Internally this uses
* { @ link Feature # type ( ) } to judge geometry types .
* @ param feature with an expected geometry type
* @ param type type expected GeoJson type
* @ param name name of calling function
* @ see < a href = " http : / / turfjs . org / docs / # featureof " > Turf featureOf documentation < / a >
* @ since 1.2.0 */
public static void featureOf ( Feature feature , String type , String name ) { } } | if ( name == null || name . length ( ) == 0 ) { throw new TurfException ( ".featureOf() requires a name" ) ; } if ( feature == null || ! feature . type ( ) . equals ( "Feature" ) || feature . geometry ( ) == null ) { throw new TurfException ( String . format ( "Invalid input to %s, Feature with geometry required" , name ) ) ; } if ( feature . geometry ( ) == null || ! feature . geometry ( ) . type ( ) . equals ( type ) ) { throw new TurfException ( String . format ( "Invalid input to %s: must be a %s, given %s" , name , type , feature . geometry ( ) . type ( ) ) ) ; } |
public class GetRequestValidatorsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetRequestValidatorsRequest getRequestValidatorsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getRequestValidatorsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getRequestValidatorsRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( getRequestValidatorsRequest . getPosition ( ) , POSITION_BINDING ) ; protocolMarshaller . marshall ( getRequestValidatorsRequest . getLimit ( ) , LIMIT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class DynamoDBConstraint { public Condition asCondition ( ) { } } | Condition condition = new Condition ( ) . withComparisonOperator ( operator . getComparisonOperator ( ) ) ; int argumentCount = operator . getArgumentCount ( ) ; if ( argumentCount == 1 ) { condition . withAttributeValueList ( ConversionUtil . toAttributeValue ( values [ 0 ] ) ) ; } else if ( argumentCount == 2 ) { condition . withAttributeValueList ( ConversionUtil . toAttributeValue ( values [ 0 ] ) , ConversionUtil . toAttributeValue ( values [ 1 ] ) ) ; } else if ( argumentCount != 0 ) { // N arguments
condition . setAttributeValueList ( ConversionUtil . toAttributeValueList ( values [ 0 ] ) ) ; } return condition ; |
public class ServiceNameToTraceIds { /** * Returns service names orphaned by removing the trace ID */
Set < String > removeServiceIfTraceId ( String lowTraceId ) { } } | Set < String > result = new LinkedHashSet < > ( ) ; for ( Map . Entry < String , Collection < String > > entry : delegate . entrySet ( ) ) { Collection < String > lowTraceIds = entry . getValue ( ) ; if ( lowTraceIds . remove ( lowTraceId ) && lowTraceIds . isEmpty ( ) ) { result . add ( entry . getKey ( ) ) ; } } delegate . keySet ( ) . removeAll ( result ) ; return result ; |
public class Interruptibles { /** * Sleep for the length of time . */
public static void sleep ( long length , TimeUnit unit ) { } } | try { unit . sleep ( length ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } |
public class ActionModeHelper { /** * updates the title to reflect the current selected items or to show a user defined title
* @ param selected number of selected items */
private void updateTitle ( int selected ) { } } | if ( mActionMode != null ) { if ( mTitleProvider != null ) mActionMode . setTitle ( mTitleProvider . getTitle ( selected ) ) ; else mActionMode . setTitle ( String . valueOf ( selected ) ) ; } |
public class TranspilationPasses { /** * Adds transpilation passes that should run after all checks are done . */
public static void addPostCheckTranspilationPasses ( List < PassFactory > passes , CompilerOptions options ) { } } | if ( options . needsTranspilationFrom ( FeatureSet . ES_NEXT ) ) { passes . add ( rewriteCatchWithNoBinding ) ; } if ( options . needsTranspilationFrom ( ES2018 ) ) { passes . add ( rewriteAsyncIteration ) ; passes . add ( rewriteObjectSpread ) ; } if ( options . needsTranspilationFrom ( ES8 ) ) { // Trailing commas in parameter lists are flagged as present by the parser ,
// but never actually represented in the AST .
// The only thing we need to do is mark them as not present in the AST .
passes . add ( createFeatureRemovalPass ( "markTrailingCommasInParameterListsRemoved" , Feature . TRAILING_COMMA_IN_PARAM_LIST ) ) ; passes . add ( rewriteAsyncFunctions ) ; } if ( options . needsTranspilationFrom ( ES7 ) ) { passes . add ( rewriteExponentialOperator ) ; } if ( options . needsTranspilationFrom ( ES6 ) ) { // TODO ( b / 73387406 ) : Move passes here as typechecking & other check passes are updated to cope
// with the features they transpile and as the passes themselves are updated to propagate type
// information to the transpiled code .
// Binary and octal literals are effectively transpiled by the parser .
// There ' s no transpilation we can do for the new regexp flags .
passes . add ( createFeatureRemovalPass ( "markEs6FeaturesNotRequiringTranspilationAsRemoved" , Feature . BINARY_LITERALS , Feature . OCTAL_LITERALS , Feature . REGEXP_FLAG_U , Feature . REGEXP_FLAG_Y ) ) ; passes . add ( es6NormalizeShorthandProperties ) ; passes . add ( es6RewriteClassExtends ) ; passes . add ( es6ConvertSuper ) ; passes . add ( es6RenameVariablesInParamLists ) ; passes . add ( es6SplitVariableDeclarations ) ; passes . add ( getEs6RewriteDestructuring ( ObjectDestructuringRewriteMode . REWRITE_ALL_OBJECT_PATTERNS ) ) ; passes . add ( es6RewriteArrowFunction ) ; passes . add ( es6ExtractClasses ) ; passes . add ( es6RewriteClass ) ; passes . add ( es6RewriteRestAndSpread ) ; passes . add ( lateConvertEs6ToEs3 ) ; passes . add ( es6ForOf ) ; passes . add ( rewriteBlockScopedFunctionDeclaration ) ; passes . add ( rewriteBlockScopedDeclaration ) ; passes . add ( rewriteGenerators ) ; passes . add ( es6ConvertSuperConstructorCalls ) ; } else if ( options . needsTranspilationOf ( Feature . OBJECT_PATTERN_REST ) ) { passes . add ( es6RenameVariablesInParamLists ) ; passes . add ( es6SplitVariableDeclarations ) ; passes . add ( getEs6RewriteDestructuring ( ObjectDestructuringRewriteMode . REWRITE_OBJECT_REST ) ) ; } |
public class Matchers { /** * Returns a Matcher that matches all nodes that are function calls that match the provided name .
* @ param name The name of the function to match . For non - static functions , this must be the fully
* qualified name that includes the type of the object . For instance : { @ code
* ns . AppContext . prototype . get } will match { @ code appContext . get } and { @ code this . get } when
* called from the AppContext class . */
public static Matcher functionCall ( final String name ) { } } | return new Matcher ( ) { @ Override public boolean matches ( Node node , NodeMetadata metadata ) { // TODO ( mknichel ) : Handle the case when functions are applied through . call or . apply .
return node . isCall ( ) && propertyAccess ( name ) . matches ( node . getFirstChild ( ) , metadata ) ; } } ; |
public class DependencyGraph { /** * Returns whether elem1 is designated to depend on elem2. */
public boolean dependsOn ( T elem1 , T elem2 ) { } } | DependencyNode < T > node1 = _nodes . get ( elem1 ) ; DependencyNode < T > node2 = _nodes . get ( elem2 ) ; List < DependencyNode < T > > nodesToCheck = new ArrayList < DependencyNode < T > > ( ) ; List < DependencyNode < T > > nodesAlreadyChecked = new ArrayList < DependencyNode < T > > ( ) ; nodesToCheck . addAll ( node1 . parents ) ; // We prevent circular dependencies when we add dependencies . Otherwise , this ' d be
// potentially non - terminating .
while ( ! nodesToCheck . isEmpty ( ) ) { // We take it off the end since we don ' t care about order and this is faster .
DependencyNode < T > checkNode = nodesToCheck . remove ( nodesToCheck . size ( ) - 1 ) ; if ( nodesAlreadyChecked . contains ( checkNode ) ) { // We ' ve seen him before , no need to check again .
continue ; } else if ( checkNode == node2 ) { // We ' ve found our dependency
return true ; } else { nodesAlreadyChecked . add ( checkNode ) ; nodesToCheck . addAll ( checkNode . parents ) ; } } return false ; |
public class LNGHeap { /** * Rebuilds the heap from a given vector of elements .
* @ param ns the vector of elements */
public void build ( final LNGIntVector ns ) { } } | for ( int i = 0 ; i < this . heap . size ( ) ; i ++ ) this . indices . set ( this . heap . get ( i ) , - 1 ) ; this . heap . clear ( ) ; for ( int i = 0 ; i < ns . size ( ) ; i ++ ) { this . indices . set ( ns . get ( i ) , i ) ; this . heap . push ( ns . get ( i ) ) ; } for ( int i = this . heap . size ( ) / 2 - 1 ; i >= 0 ; i -- ) this . percolateDown ( i ) ; |
public class ImageExtensions { /** * Converts the given BufferedImage to a byte array .
* @ param bi
* the bi
* @ param formatName
* the format name
* @ return the byte [ ]
* @ throws IOException
* Signals that an I / O exception has occurred . */
public static byte [ ] toByteArray ( final BufferedImage bi , final String formatName ) throws IOException { } } | try ( ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ) { ImageIO . write ( bi , formatName , baos ) ; baos . flush ( ) ; final byte [ ] byteArray = baos . toByteArray ( ) ; return byteArray ; } |
public class CmsLoginForm { /** * Sets visibility of ' advanced ' options . < p >
* @ param optionsVisible true if the options should be shown , false if not */
public void setOptionsVisible ( boolean optionsVisible ) { } } | m_optionsVisible = optionsVisible ; boolean ousVisible = optionsVisible && ! m_ouSelect . isAlwaysHidden ( ) ; m_ouSelect . setVisible ( ousVisible ) ; m_forgotPasswordButton . setVisible ( optionsVisible ) ; String optionsMessage = CmsVaadinUtils . getMessageText ( optionsVisible ? Messages . GUI_LOGIN_OPTIONS_HIDE_0 : Messages . GUI_LOGIN_OPTIONS_SHOW_0 ) ; m_optionsButton . setCaption ( optionsMessage ) ; |
public class EmbeddedHandler { /** * Acquires an IP address among available ones .
* @ param parameters the target parameters
* @ param machineId the machine ID
* @ return The acquired IP address */
protected String acquireIpAddress ( TargetHandlerParameters parameters , String machineId ) { } } | // Load IP addresses on demand ( that ' s the case if we are in this method ) .
// This implementation is compliant with a same IP address being used in
// several " target . properties " files .
String result = null ; String ips = parameters . getTargetProperties ( ) . get ( IP_ADDRESSES ) ; ips = ips == null ? "" : ips ; for ( String ip : Utils . splitNicely ( ips , "," ) ) { if ( Utils . isEmptyOrWhitespaces ( ip ) ) continue ; if ( this . usedIps . putIfAbsent ( ip , 1 ) == null ) { this . machineIdToIp . put ( machineId , ip ) ; result = ip ; save ( this ) ; break ; } } return result ; |
public class CommonOps_DDF3 { /** * Performs an element by element scalar division . Scalar denominator . < br >
* < br >
* b < sub > i < / sub > = a < sub > i < / sub > / & alpha ;
* @ param alpha the amount each element is divided by .
* @ param a The vector whose elements are to be divided . Not modified .
* @ param b Where the results are stored . Modified . */
public static void divide ( DMatrix3 a , double alpha , DMatrix3 b ) { } } | b . a1 = a . a1 / alpha ; b . a2 = a . a2 / alpha ; b . a3 = a . a3 / alpha ; |
public class ClockInterval { /** * / * [ deutsch ]
* < p > Erzeugt einen { @ code Stream } , der jeweils eine Uhrzeit als Vielfaches der Dauer angewandt auf
* den Start und bis zum Ende geht . < / p >
* < p > Diese statische Methode vermeidet die Kosten der Intervallerzeugung . Die Gr & ouml ; & szlig ; e des
* { @ code Stream } ist maximal { @ code Integer . MAX _ VALUE - 1 } , ansonsten wird eine { @ code ArithmeticException }
* geworfen . < / p >
* @ param duration duration which has to be added to the start multiple times
* @ param start start boundary - inclusive
* @ param end end boundary - exclusive
* @ throws IllegalArgumentException if start is after end or if the duration is not positive
* @ return stream consisting of distinct clock times which are the result of adding the duration to the start
* @ since 4.18 */
public static Stream < PlainTime > stream ( Duration < ClockUnit > duration , PlainTime start , PlainTime end ) { } } | if ( ! duration . isPositive ( ) ) { throw new IllegalArgumentException ( "Duration must be positive: " + duration ) ; } int comp = start . compareTo ( end ) ; if ( comp > 0 ) { throw new IllegalArgumentException ( "Start after end: " + start + "/" + end ) ; } else if ( comp == 0 ) { return Stream . empty ( ) ; } double secs = 0.0 ; for ( TimeSpan . Item < ClockUnit > item : duration . getTotalLength ( ) ) { secs += item . getUnit ( ) . getLength ( ) * item . getAmount ( ) ; } double est ; // first estimate
if ( secs < 1.0 ) { est = ( ClockUnit . NANOS . between ( start , end ) / ( secs * 1_000_000_000 ) ) ; } else { est = ( ClockUnit . SECONDS . between ( start , end ) / secs ) ; } if ( Double . compare ( est , Integer . MAX_VALUE ) >= 0 ) { throw new ArithmeticException ( ) ; } int n = ( int ) Math . floor ( est ) ; boolean backwards = false ; while ( ( n > 0 ) && ! start . plus ( duration . multipliedBy ( n ) ) . isBefore ( end ) ) { n -- ; backwards = true ; } int size = n + 1 ; if ( ! backwards ) { do { size = Math . addExact ( n , 1 ) ; n ++ ; } while ( start . plus ( duration . multipliedBy ( n ) ) . isBefore ( end ) ) ; } if ( size == 1 ) { return Stream . of ( start ) ; // short - cut
} return IntStream . range ( 0 , size ) . mapToObj ( index -> start . plus ( duration . multipliedBy ( index ) ) ) ; |
public class ArrayList { /** * Returns a list iterator over the elements in this list ( in proper
* sequence ) , starting at the specified position in the list .
* The specified index indicates the first element that would be
* returned by an initial call to { @ link ListIterator # next next } .
* An initial call to { @ link ListIterator # previous previous } would
* return the element with the specified index minus one .
* < p > The returned list iterator is < a href = " # fail - fast " > < i > fail - fast < / i > < / a > .
* @ throws IndexOutOfBoundsException { @ inheritDoc } */
public ListIterator < E > listIterator ( int index ) { } } | if ( index < 0 || index > size ) throw new IndexOutOfBoundsException ( "Index: " + index ) ; return new ListItr ( index ) ; |
public class JaxbUtils { /** * Converts the contents of the string to a List with objects of the given class .
* @ param cl Type to be used
* @ param s Input string
* @ return List with objects of the given type */
public static < T > List < T > unmarshalCollection ( Class < T > cl , String s ) throws JAXBException { } } | return unmarshalCollection ( cl , new StringReader ( s ) ) ; |
public class AttributeMapper { /** * Return the attribute identifier from the variable - id
* @ param variableId
* @ return
* @ throws MIDDParsingException */
public String getAttributeId ( int variableId ) throws MIDDParsingException { } } | if ( ! attributeMapper . containsValue ( variableId ) ) { throw new MIDDParsingException ( "Variable identifier '" + variableId + "' not found" ) ; } for ( String attrId : attributeMapper . keySet ( ) ) { if ( attributeMapper . get ( attrId ) == variableId ) { return attrId ; } } throw new MIDDParsingException ( "Variable identifier '" + variableId + "' not found" ) ; |
public class CpnlElFunctions { /** * Builds the URL for a repository path using the LinkUtil . getURL ( ) method .
* @ param request the current request ( domain host hint )
* @ param path the repository path
* @ return the URL built in the context of the requested domain host */
public static String url ( SlingHttpServletRequest request , String path ) { } } | return LinkUtil . getUrl ( request , path ) ; |
public class ReportDefinition { /** * A list of manifests that you want Amazon Web Services to create for this report .
* @ param additionalArtifacts
* A list of manifests that you want Amazon Web Services to create for this report .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see AdditionalArtifact */
public ReportDefinition withAdditionalArtifacts ( AdditionalArtifact ... additionalArtifacts ) { } } | java . util . ArrayList < String > additionalArtifactsCopy = new java . util . ArrayList < String > ( additionalArtifacts . length ) ; for ( AdditionalArtifact value : additionalArtifacts ) { additionalArtifactsCopy . add ( value . toString ( ) ) ; } if ( getAdditionalArtifacts ( ) == null ) { setAdditionalArtifacts ( additionalArtifactsCopy ) ; } else { getAdditionalArtifacts ( ) . addAll ( additionalArtifactsCopy ) ; } return this ; |
public class AbstractStateMachine { /** * Creates named state with functional interface .
* @ param name
* @ param enter Called when state is entered . */
public void addState ( String name , Runnable enter ) { } } | addState ( name , ( S ) new AdhocState ( name , enter , null , null ) ) ; |
public class ApiInvoker { /** * Serialize an Object .
* @ param host the targeted host
* @ param path the targeted rest endpoint
* @ param method the HTTP method
* @ param queryParams the query parameters
* @ param body the obligatory body of a post
* @ param headerParams the HTTP header parameters
* @ param contentType the content type
* @ throws APIException if an exception occurs during querying of the API . */
public Object invokeAPI ( String host , String path , String method , Map < String , String > queryParams , Object body , Map < String , String > headerParams , String contentType ) throws ApiException { } } | Client client = getClient ( host ) ; StringBuilder b = new StringBuilder ( ) ; for ( String key : queryParams . keySet ( ) ) { String value = queryParams . get ( key ) ; if ( value != null ) { if ( b . toString ( ) . length ( ) == 0 ) b . append ( "?" ) ; else b . append ( "&" ) ; b . append ( escapeString ( key ) ) . append ( "=" ) . append ( escapeString ( value ) ) ; } } String querystring = b . toString ( ) ; try { querystring = URIUtil . encodeQuery ( querystring ) ; } catch ( URIException e ) { throw new ApiException ( 0 , e . getStackTrace ( ) . toString ( ) ) ; } Builder builder = client . resource ( host + path + querystring ) . accept ( new String [ ] { "application/json" , "image/png" } ) ; for ( String key : headerParams . keySet ( ) ) { builder . header ( key , headerParams . get ( key ) ) ; } for ( String key : defaultHeaderMap . keySet ( ) ) { if ( ! headerParams . containsKey ( key ) ) { builder . header ( key , defaultHeaderMap . get ( key ) ) ; } } ClientResponse response = null ; if ( "GET" . equals ( method ) ) { response = ( ClientResponse ) builder . get ( ClientResponse . class ) ; } else if ( "POST" . equals ( method ) ) { if ( body == null ) response = builder . post ( ClientResponse . class , serialize ( body ) ) ; else response = builder . type ( "application/json" ) . post ( ClientResponse . class , serialize ( body ) ) ; } else if ( "PUT" . equals ( method ) ) { if ( body == null ) response = builder . put ( ClientResponse . class , serialize ( body ) ) ; else response = builder . type ( "application/json" ) . put ( ClientResponse . class , serialize ( body ) ) ; } else if ( "DELETE" . equals ( method ) ) { if ( body == null ) response = builder . delete ( ClientResponse . class , serialize ( body ) ) ; else response = builder . type ( "application/json" ) . delete ( ClientResponse . class , serialize ( body ) ) ; } else { throw new ApiException ( 500 , "unknown method type " + method ) ; } if ( response . getClientResponseStatus ( ) == ClientResponse . Status . NO_CONTENT ) { return null ; } else if ( response . getClientResponseStatus ( ) . getFamily ( ) == Family . SUCCESSFUL ) { // Handle the casting of the response based on the type .
if ( ! response . getHeaders ( ) . get ( "Content-Type" ) . get ( 0 ) . equals ( MediaType . APPLICATION_JSON ) ) { return response . getEntityInputStream ( ) ; } return ( String ) response . getEntity ( String . class ) ; } else { throw new ApiException ( response . getClientResponseStatus ( ) . getStatusCode ( ) , response . getEntity ( String . class ) ) ; } |
public class BinaryHeapPriorityQueue { /** * Demotes a key in the queue , adding it if it wasn ' t there already . If the specified priority is better than the current priority , nothing happens . If you decrease the priority on a non - present key , it will get added , but at it ' s old implicit priority of Double . NEGATIVE _ INFINITY .
* @ param key an < code > Object < / code > value
* @ return whether the priority actually improved . */
public boolean decreasePriority ( E key , double priority ) { } } | Entry < E > entry = getEntry ( key ) ; if ( entry == null ) { entry = makeEntry ( key ) ; } if ( compare ( priority , entry . priority ) >= 0 ) { return false ; } entry . priority = priority ; heapifyDown ( entry ) ; return true ; |
public class XLSReader { /** * Main HSSFListener method , processes events , and outputs the
* CSV as the file is processed .
* 开始解析Excel文档 */
public void process ( ) throws ReadExcelException { } } | MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener ( this ) ; formatListener = new FormatTrackingHSSFListenerPlus ( listener ) ; HSSFEventFactory factory = new HSSFEventFactory ( ) ; HSSFRequest request = new HSSFRequest ( ) ; if ( outputFormulaValues ) { request . addListenerForAllRecords ( formatListener ) ; } else { workbookBuildingListener = new EventWorkbookBuilder . SheetRecordCollectingListener ( formatListener ) ; request . addListenerForAllRecords ( workbookBuildingListener ) ; } try { factory . processWorkbookEvents ( request , fs ) ; } catch ( IOException e ) { throw new ReadExcelException ( e . getMessage ( ) ) ; } // 解析完后 , 判断用户是否设置了limit , 若设置了执行以下操作
if ( this . limit > 0 ) { if ( ! this . datas . isEmpty ( ) ) { if ( this . callback != null ) { // 若数据不为空且回调函数被设置 , 则调用回调函数
this . callback . callback ( this . currentRowInSheet , this . currentSheetInExcel , this . realRowInSheet , this . realRowInExcel , this . allSheetInExcel , this . titles , this . columns , this . datas ) ; } this . datas . clear ( ) ; } } |
public class Extensions { /** * Get the extension name with the author prefix removed
* @ param extensionName
* extension name
* @ return extension name , no author
* @ since 1.1.0 */
public static String getExtensionNameNoAuthor ( String extensionName ) { } } | String value = null ; if ( extensionName != null ) { value = extensionName . substring ( extensionName . indexOf ( EXTENSION_NAME_DIVIDER ) + 1 , extensionName . length ( ) ) ; } return value ; |
public class WsdlToDll { /** * Search for the wsdl command and execute it when it is found */
private void wsdlCommand ( ) throws MojoExecutionException { } } | String cmd = findWsdlCommand ( ) ; int i = 0 ; for ( String location : wsdlLocations ) { String outputFilename = new File ( outputDirectory , namespace + ( i ++ ) + ".cs" ) . getAbsolutePath ( ) ; String [ ] command = new String [ ] { cmd , serverParameter , "/n:" + namespace , location , "/out:" + outputFilename } ; ProcessBuilder builder = new ProcessBuilder ( ) ; builder . redirectErrorStream ( true ) ; builder . command ( command ) ; try { executeACommand ( builder . start ( ) ) ; } catch ( IOException | InterruptedException e ) { throw new MojoExecutionException ( "Error, while executing command: " + Arrays . toString ( command ) + "\n" , e ) ; } cspath . add ( outputFilename ) ; } try { FileComparer . removeSimilaritiesAndSaveFiles ( cspath , getLog ( ) , windowsModus ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "It was not possible, to remove similarities form the files" , e ) ; } |
public class JsHdrsImpl { /** * Get the value of the Reliability field from the message header .
* Javadoc description supplied by SIBusMessage interface . */
public final Reliability getReliability ( ) { } } | // If the transient is not set , get the int value from the message then
// obtain the corresponding Reliability instance and cache it .
if ( cachedReliability == null ) { Byte rType = ( Byte ) getHdr2 ( ) . getField ( JsHdr2Access . RELIABILITY ) ; cachedReliability = Reliability . getReliability ( rType ) ; } // Return the ( possibly newly ) cached value
return cachedReliability ; |
public class NewRelicManager { /** * Synchronise the server configuration with the cache .
* @ param cache The provider cache
* @ return < CODE > true < / CODE > if the operation was successful */
public boolean syncServers ( NewRelicCache cache ) { } } | boolean ret = true ; if ( apiClient == null ) throw new IllegalArgumentException ( "null API client" ) ; // Get the server configuration using the REST API
if ( cache . isServersEnabled ( ) ) { ret = false ; logger . info ( "Getting the servers" ) ; cache . servers ( ) . add ( apiClient . servers ( ) . list ( ) ) ; cache . setUpdatedAt ( ) ; ret = true ; } return ret ; |
public class AccessorSyntheticField { /** * Get field value .
* @ param object object which contains the field .
* @ return field value
* @ throws IllegalAccessException illegal access
* @ throws IllegalArgumentException illegal argument */
public Object get ( Object object ) throws IllegalAccessException , IllegalArgumentException { } } | if ( null != getter ) { try { return getter . invoke ( object ) ; } catch ( InvocationTargetException ite ) { if ( ite . getCause ( ) instanceof RuntimeException && ! ( ite . getCause ( ) instanceof JTransfoException ) ) { throw ( RuntimeException ) ite . getCause ( ) ; } throw new JTransfoException ( String . format ( GET_SET_ITO , getter . getName ( ) , object . getClass ( ) . getName ( ) , getter . getDeclaringClass ( ) . getName ( ) , ite . getCause ( ) . getMessage ( ) ) , ite . getCause ( ) ) ; } } else { if ( ! getUsingFieldLogged ) { log . warn ( "Cannot find getter (not public, wrong name or wrong type), " + "using field to access field {} of {}." , name , field . getType ( ) . getName ( ) ) ; getUsingFieldLogged = true ; } return field . get ( object ) ; } |
public class CustomerConnectorInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CustomerConnectorInfo customerConnectorInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( customerConnectorInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( customerConnectorInfo . getActiveConnectors ( ) , ACTIVECONNECTORS_BINDING ) ; protocolMarshaller . marshall ( customerConnectorInfo . getHealthyConnectors ( ) , HEALTHYCONNECTORS_BINDING ) ; protocolMarshaller . marshall ( customerConnectorInfo . getBlackListedConnectors ( ) , BLACKLISTEDCONNECTORS_BINDING ) ; protocolMarshaller . marshall ( customerConnectorInfo . getShutdownConnectors ( ) , SHUTDOWNCONNECTORS_BINDING ) ; protocolMarshaller . marshall ( customerConnectorInfo . getUnhealthyConnectors ( ) , UNHEALTHYCONNECTORS_BINDING ) ; protocolMarshaller . marshall ( customerConnectorInfo . getTotalConnectors ( ) , TOTALCONNECTORS_BINDING ) ; protocolMarshaller . marshall ( customerConnectorInfo . getUnknownConnectors ( ) , UNKNOWNCONNECTORS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class StyleCounter { /** * Obtains the most frequent style . If there are multiple styles with the same frequency then
* only one of them is returned .
* @ return The most frequent style or { @ code null } when the counter is empty . */
public T getMostFrequent ( ) { } } | T ret = null ; int freq = 0 ; for ( Map . Entry < T , Integer > entry : styles . entrySet ( ) ) { if ( entry . getValue ( ) > freq ) { ret = entry . getKey ( ) ; freq = entry . getValue ( ) ; } } return ret ; |
public class SOS { /** * Estimate beta from the distances in a row .
* This lacks a thorough mathematical argument , but is a handcrafted heuristic
* to avoid numerical problems . The average distance is usually too large , so
* we scale the average distance by 2 * N / perplexity . Then estimate beta as 1 / x .
* @ param ignore Object to skip
* @ param it Distance iterator
* @ param perplexity Desired perplexity
* @ return Estimated beta . */
@ Reference ( authors = "Erich Schubert, Michael Gertz" , title = "Intrinsic t-Stochastic Neighbor Embedding for Visualization and Outlier Detection: A Remedy Against the Curse of Dimensionality?" , booktitle = "Proc. Int. Conf. Similarity Search and Applications, SISAP'2017" , url = "https://doi.org/10.1007/978-3-319-68474-1_13" , bibkey = "DBLP:conf/sisap/SchubertG17" ) protected static double estimateInitialBeta ( DBIDRef ignore , DoubleDBIDListIter it , double perplexity ) { } } | double sum = 0. ; int size = 0 ; for ( it . seek ( 0 ) ; it . valid ( ) ; it . advance ( ) ) { if ( DBIDUtil . equal ( ignore , it ) ) { continue ; } sum += it . doubleValue ( ) < Double . POSITIVE_INFINITY ? it . doubleValue ( ) : 0. ; ++ size ; } // In degenerate cases , simply return 1.
return ( sum > 0. && sum < Double . POSITIVE_INFINITY ) ? ( .5 / sum * perplexity * ( size - 1. ) ) : 1. ; |
public class Attachment { /** * Creates a non - binary attachment from the given file .
* @ throws IOException if an I / O error occurs
* @ throws java . lang . IllegalArgumentException if mediaType is either binary or has no specified charset */
public static Attachment fromTextFile ( File file , MediaType mediaType ) throws IOException { } } | return fromText ( Files . toString ( file , mediaType . getCharset ( ) ) , mediaType ) ; |
public class BigComplex { /** * Returns a complex number with the specified real and imaginary { @ code double } parts .
* @ param real the real { @ code double } part
* @ param imaginary the imaginary { @ code double } part
* @ return the complex number */
public static BigComplex valueOf ( double real , double imaginary ) { } } | return valueOf ( BigDecimal . valueOf ( real ) , BigDecimal . valueOf ( imaginary ) ) ; |
public class DifferenceEngine { /** * The number of attributes not related to namespace declarations
* and / or Schema location . */
private Integer getNonSpecialAttrLength ( NamedNodeMap attributes ) { } } | int length = 0 , maxLength = attributes . getLength ( ) ; for ( int i = 0 ; i < maxLength ; ++ i ) { Attr a = ( Attr ) attributes . item ( i ) ; if ( ! isXMLNSAttribute ( a ) && ! isRecognizedXMLSchemaInstanceAttribute ( a ) ) { ++ length ; } } return new Integer ( length ) ; |
public class ChronicleMapBuilder { /** * { @ inheritDoc }
* < p > For example , if your keys are Git commit hashes : < pre > { @ code
* Map < byte [ ] , String > gitCommitMessagesByHash =
* ChronicleMapBuilder . of ( byte [ ] . class , String . class )
* . constantKeySizeBySample ( new byte [ 20 ] )
* . create ( ) ; } < / pre >
* @ see # averageKeySize ( double )
* @ see # averageKey ( Object )
* @ see # constantValueSizeBySample ( Object ) */
@ Override public ChronicleMapBuilder < K , V > constantKeySizeBySample ( K sampleKey ) { } } | this . sampleKey = sampleKey ; averageKey = null ; averageKeySize = UNDEFINED_DOUBLE_CONFIG ; return this ; |
public class EventProducerInterceptor { /** * / * ( non - Javadoc )
* @ see org . apache . cxf . interceptor . Interceptor # handleMessage ( org . apache . cxf . message . Message ) */
@ Override public void handleMessage ( Message message ) throws Fault { } } | // ignore the messages from SAM Server service itself
BindingOperationInfo boi = message . getExchange ( ) . getBindingOperationInfo ( ) ; if ( null != boi ) { String operationName = boi . getName ( ) . toString ( ) ; if ( SAM_OPERATION . equals ( operationName ) ) { return ; } } if ( isRestWadlRequest ( message ) ) { // skip handling REST service WADL requests - temporary fix since will be fixed in CXF soon
return ; } if ( isOnewayResponse ( message ) ) { // skip oneway response events
return ; } // Skip Swagger UI web static , swagger . json and swagger . yaml requests
if ( isSwaggerResourceRequest ( message ) ) { return ; } // check MessageID
checkMessageID ( message ) ; Event event = mapper . mapToEvent ( message ) ; if ( LOG . isLoggable ( Level . FINE ) ) { String id = ( event . getMessageInfo ( ) != null ) ? event . getMessageInfo ( ) . getMessageId ( ) : null ; LOG . fine ( "Store event [message_id=" + id + "] in cache." ) ; } if ( null != event ) { queue . add ( event ) ; } // TESB - 20624 skip duplicated event processing
message . getInterceptorChain ( ) . remove ( this ) ; |
public class GraphicAwt { /** * Graphic */
@ Override public void clear ( int x , int y , int width , int height ) { } } | g . clearRect ( x , y , width , height ) ; |
public class Transfer { /** * Method declaration
* @ param t */
private void displayTable ( TransferTable t ) { } } | tCurrent = t ; if ( t == null ) { return ; } tSourceTable . setText ( t . Stmts . sSourceTable ) ; tDestTable . setText ( t . Stmts . sDestTable ) ; tDestDrop . setText ( t . Stmts . sDestDrop ) ; tDestCreateIndex . setText ( t . Stmts . sDestCreateIndex ) ; tDestDropIndex . setText ( t . Stmts . sDestDropIndex ) ; tDestCreate . setText ( t . Stmts . sDestCreate ) ; tDestDelete . setText ( t . Stmts . sDestDelete ) ; tSourceSelect . setText ( t . Stmts . sSourceSelect ) ; tDestInsert . setText ( t . Stmts . sDestInsert ) ; tDestAlter . setText ( t . Stmts . sDestAlter ) ; cTransfer . setState ( t . Stmts . bTransfer ) ; cDrop . setState ( t . Stmts . bDrop ) ; cCreate . setState ( t . Stmts . bCreate ) ; cDropIndex . setState ( t . Stmts . bDropIndex ) ; cCreateIndex . setState ( t . Stmts . bCreateIndex ) ; cDelete . setState ( t . Stmts . bDelete ) ; cInsert . setState ( t . Stmts . bInsert ) ; cAlter . setState ( t . Stmts . bAlter ) ; cFKForced . setState ( t . Stmts . bFKForced ) ; cIdxForced . setState ( t . Stmts . bIdxForced ) ; |
public class EntityInfo { /** * 拼接UPDATE给字段赋值的SQL片段
* @ param col 表字段名
* @ param attr Attribute
* @ param cv ColumnValue
* @ return CharSequence */
protected CharSequence formatSQLValue ( String col , Attribute < T , Serializable > attr , final ColumnValue cv ) { } } | if ( cv == null ) return null ; Object val = cv . getValue ( ) ; CryptHandler handler = attr . attach ( ) ; if ( handler != null ) val = handler . encrypt ( val ) ; switch ( cv . getExpress ( ) ) { case INC : return new StringBuilder ( ) . append ( col ) . append ( " + " ) . append ( val ) ; case MUL : return new StringBuilder ( ) . append ( col ) . append ( " * " ) . append ( val ) ; case AND : return new StringBuilder ( ) . append ( col ) . append ( " & " ) . append ( val ) ; case ORR : return new StringBuilder ( ) . append ( col ) . append ( " | " ) . append ( val ) ; case MOV : return formatToString ( val ) ; } return formatToString ( val ) ; |
public class Links { /** * / * all local pids get notified about broken connection */
synchronized OtpErlangPid [ ] localPids ( ) { } } | OtpErlangPid [ ] ret = null ; if ( count != 0 ) { ret = new OtpErlangPid [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { ret [ i ] = links [ i ] . local ( ) ; } } return ret ; |
public class RepositoryConfigUtils { /** * Finds the repository properties file location
* @ return the location of the repo properties */
public static String getRepoPropertiesFileLocation ( ) { } } | String installDirPath = Utils . getInstallDir ( ) . getAbsolutePath ( ) ; String overrideLocation = System . getProperty ( InstallConstants . OVERRIDE_PROPS_LOCATION_ENV_VAR ) ; // Gets the repository properties file path from the default location
if ( overrideLocation == null ) { return installDirPath + InstallConstants . DEFAULT_REPO_PROPERTIES_LOCATION ; } else { // Gets the repository properties file from user specified location
return overrideLocation ; } |
public class GlobalizationPreferences { /** * Set an explicit date format . Overrides the locale priority list for
* a particular combination of dateStyle and timeStyle . DF _ NONE should
* be used if for the style , where only the date or time format individually
* is being set .
* @ param dateStyle DF _ FULL , DF _ LONG , DF _ MEDIUM , DF _ SHORT or DF _ NONE
* @ param timeStyle DF _ FULL , DF _ LONG , DF _ MEDIUM , DF _ SHORT or DF _ NONE
* @ param format The date format
* @ return this , for chaining
* @ hide draft / provisional / internal are hidden on Android */
public GlobalizationPreferences setDateFormat ( int dateStyle , int timeStyle , DateFormat format ) { } } | if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify immutable object" ) ; } if ( dateFormats == null ) { dateFormats = new DateFormat [ DF_LIMIT ] [ DF_LIMIT ] ; } dateFormats [ dateStyle ] [ timeStyle ] = ( DateFormat ) format . clone ( ) ; // for safety
return this ; |
public class QSufSort { /** * Subroutine for { @ link # select _ sort _ split ( int , int ) } and
* { @ link # sort _ split ( int , int ) } . Sets group numbers for a group whose lowest position
* in { @ link # I } is < code > pl < / code > and highest position is < code > pm < / code > . */
private void update_group ( int pl , int pm ) { } } | int g ; g = pm ; /* group number . */
V [ start + I [ pl ] ] = g ; /* update group number of first position . */
if ( pl == pm ) I [ pl ] = - 1 ; /* one element , sorted group . */
else do /* more than one element , unsorted group . */
V [ start + I [ ++ pl ] ] = g ; /* update group numbers . */
while ( pl < pm ) ; |
public class RandomVariableDifferentiableAAD { /** * Returns the gradient of this random variable with respect to all its leaf nodes .
* The method calculated the map \ ( v \ mapsto \ frac { d u } { d v } \ ) where \ ( u \ ) denotes < code > this < / code > .
* Performs a backward automatic differentiation .
* @ return The gradient map . */
@ Override public Map < Long , RandomVariable > getGradient ( Set < Long > independentIDs ) { } } | // The map maintaining the derivatives id - > derivative
Map < Long , RandomVariable > derivatives = new HashMap < > ( ) ; // Put derivative of this node w . r . t . itself
derivatives . put ( getID ( ) , getFactory ( ) . createRandomVariableNonDifferentiable ( Double . NEGATIVE_INFINITY , 1.0 ) ) ; // The set maintaining the independents . Note : TreeMap is maintaining a sorting on the keys .
TreeMap < Long , OperatorTreeNode > independents = new TreeMap < > ( ) ; // Initialize with root node
independents . put ( getID ( ) , this . getOperatorTreeNode ( ) ) ; while ( independents . size ( ) > 0 ) { // Get and remove node with the highest id in independents
Map . Entry < Long , OperatorTreeNode > independentEntry = independents . pollLastEntry ( ) ; Long id = independentEntry . getKey ( ) ; OperatorTreeNode independent = independentEntry . getValue ( ) ; // Process this node ( node with highest id in independents )
List < OperatorTreeNode > arguments = independent . arguments ; if ( arguments != null && arguments . size ( ) > 0 ) { // Node has arguments : Propagate derivative to arguments .
independent . propagateDerivativesFromResultToArgument ( derivatives ) ; // Remove id of this node from derivatives - keep only leaf nodes .
if ( isGradientRetainsLeafNodesOnly ( ) ) { derivatives . remove ( id ) ; } // Add all non leaf node arguments to the list of independents
for ( OperatorTreeNode argument : arguments ) { // If an argument is null , it is a ( non - differentiable ) constant .
if ( argument != null ) { independents . put ( argument . id , argument ) ; } } } if ( independentIDs != null && independentIDs . contains ( id ) ) { derivatives . remove ( id ) ; } } return derivatives ; |
public class DatabaseAccountsInner { /** * Changes the failover priority for the Azure Cosmos DB database account . A failover priority of 0 indicates a write region . The maximum value for a failover priority = ( total number of regions - 1 ) . Failover priority values must be unique for each of the regions in which the database account exists .
* @ param resourceGroupName Name of an Azure resource group .
* @ param accountName Cosmos DB database account name .
* @ param failoverPolicies List of failover policies .
* @ 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 beginFailoverPriorityChange ( String resourceGroupName , String accountName , List < FailoverPolicy > failoverPolicies ) { } } | beginFailoverPriorityChangeWithServiceResponseAsync ( resourceGroupName , accountName , failoverPolicies ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Fu { /** * Query by context . getContentResolver ( ) .
* @ param targetClass entity class with getter / setting method .
* @ param uri
* @ param projection
* @ param selection
* @ param selectionArgs
* @ param sortOrder
* @ return */
public static < T > List < T > query ( Class < T > targetClass , final Uri uri , String [ ] projection , String selection , String [ ] selectionArgs , String sortOrder ) { } } | return query ( targetClass , uri , projection , selection , selectionArgs , sortOrder , null ) ; |
public class ModelHelper { /** * This method translates the REST request object CreateStreamRequest into internal object StreamConfiguration .
* @ param createStreamRequest An object conforming to the createStream REST API json
* @ return StreamConfiguration internal object */
public static final StreamConfiguration getCreateStreamConfig ( final CreateStreamRequest createStreamRequest ) { } } | ScalingPolicy scalingPolicy ; if ( createStreamRequest . getScalingPolicy ( ) . getType ( ) == ScalingConfig . TypeEnum . FIXED_NUM_SEGMENTS ) { scalingPolicy = ScalingPolicy . fixed ( createStreamRequest . getScalingPolicy ( ) . getMinSegments ( ) ) ; } else if ( createStreamRequest . getScalingPolicy ( ) . getType ( ) == ScalingConfig . TypeEnum . BY_RATE_IN_EVENTS_PER_SEC ) { scalingPolicy = ScalingPolicy . byEventRate ( createStreamRequest . getScalingPolicy ( ) . getTargetRate ( ) , createStreamRequest . getScalingPolicy ( ) . getScaleFactor ( ) , createStreamRequest . getScalingPolicy ( ) . getMinSegments ( ) ) ; } else { scalingPolicy = ScalingPolicy . byDataRate ( createStreamRequest . getScalingPolicy ( ) . getTargetRate ( ) , createStreamRequest . getScalingPolicy ( ) . getScaleFactor ( ) , createStreamRequest . getScalingPolicy ( ) . getMinSegments ( ) ) ; } RetentionPolicy retentionPolicy = null ; if ( createStreamRequest . getRetentionPolicy ( ) != null ) { switch ( createStreamRequest . getRetentionPolicy ( ) . getType ( ) ) { case LIMITED_SIZE_MB : retentionPolicy = RetentionPolicy . bySizeBytes ( createStreamRequest . getRetentionPolicy ( ) . getValue ( ) * 1024 * 1024 ) ; break ; case LIMITED_DAYS : retentionPolicy = RetentionPolicy . byTime ( Duration . ofDays ( createStreamRequest . getRetentionPolicy ( ) . getValue ( ) ) ) ; break ; } } return StreamConfiguration . builder ( ) . scalingPolicy ( scalingPolicy ) . retentionPolicy ( retentionPolicy ) . build ( ) ; |
public class Cache { /** * Return a new memory cache with the specified maximum size , unlimited
* lifetime for entries , with the values held by standard references . */
public static < K , V > Cache < K , V > newHardMemoryCache ( int size ) { } } | return new MemoryCache < > ( false , size ) ; |
public class ClassDelegateActivityBehavior { /** * Activity Behavior */
@ Override public void execute ( final ActivityExecution execution ) throws Exception { } } | this . executeWithErrorPropagation ( execution , new Callable < Void > ( ) { @ Override public Void call ( ) throws Exception { getActivityBehaviorInstance ( execution ) . execute ( execution ) ; return null ; } } ) ; |
public class MembershipHandlerImpl { /** * Use this method to find all the memberships of an user in a group . */
private Collection < Membership > findMembershipsByUserAndGroup ( Session session , Node refUserNode , Node groupNode ) throws Exception { } } | List < Membership > memberships = new ArrayList < Membership > ( ) ; NodeIterator refTypes = refUserNode . getNodes ( ) ; while ( refTypes . hasNext ( ) ) { Node refTypeNode = refTypes . nextNode ( ) ; String id = utils . composeMembershipId ( groupNode , refUserNode , refTypeNode ) ; String groupId = utils . getGroupIds ( groupNode ) . groupId ; MembershipImpl membership = new MembershipImpl ( ) ; membership . setUserName ( refUserNode . getName ( ) ) ; membership . setMembershipType ( ( refTypeNode . getName ( ) . equals ( JCROrganizationServiceImpl . JOS_MEMBERSHIP_TYPE_ANY ) ? MembershipTypeHandler . ANY_MEMBERSHIP_TYPE : refTypeNode . getName ( ) ) ) ; membership . setGroupId ( groupId ) ; membership . setId ( id ) ; memberships . add ( membership ) ; } return memberships ; |
public class AsteriskChannelImpl { /** * Sets dateOfRemoval , hangupCause and hangupCauseText and changes state to
* { @ link ChannelState # HUNGUP } . Fires a PropertyChangeEvent for state .
* @ param dateOfRemoval date the channel was hung up
* @ param hangupCause cause for hangup
* @ param hangupCauseText textual representation of hangup cause */
synchronized void hungup ( Date dateOfRemoval , HangupCause hangupCause , String hangupCauseText ) { } } | this . dateOfRemoval = dateOfRemoval ; this . hangupCause = hangupCause ; this . hangupCauseText = hangupCauseText ; // update state and fire PropertyChangeEvent
stateChanged ( dateOfRemoval , ChannelState . HUNGUP ) ; |
public class ConfluenceGreenPepper { /** * Verifies if the specification can be Implemented .
* @ param page a { @ link com . atlassian . confluence . pages . Page } object .
* @ return true if the specification can be Implemented . */
public boolean canBeImplemented ( Page page ) { } } | Integer implementedVersion = getImplementedVersion ( page ) ; return implementedVersion == null || page . getVersion ( ) != implementedVersion ; |
public class BusStop { @ Override protected void checkPrimitiveValidity ( ) { } } | BusPrimitiveInvalidity invalidityReason = null ; if ( this . position == null ) { invalidityReason = new BusPrimitiveInvalidity ( BusPrimitiveInvalidityType . NO_STOP_POSITION , null ) ; } else { final BusNetwork busNetwork = getBusNetwork ( ) ; if ( busNetwork == null ) { invalidityReason = new BusPrimitiveInvalidity ( BusPrimitiveInvalidityType . STOP_NOT_IN_NETWORK , null ) ; } else { final RoadNetwork roadNetwork = busNetwork . getRoadNetwork ( ) ; if ( roadNetwork == null ) { invalidityReason = new BusPrimitiveInvalidity ( BusPrimitiveInvalidityType . STOP_NOT_IN_NETWORK , null ) ; } else { final Rectangle2d bounds = roadNetwork . getBoundingBox ( ) ; if ( bounds == null || ! bounds . contains ( this . position . getPoint ( ) ) ) { invalidityReason = new BusPrimitiveInvalidity ( BusPrimitiveInvalidityType . OUTSIDE_MAP_BOUNDS , bounds == null ? null : bounds . toString ( ) ) ; } } } } setPrimitiveValidity ( invalidityReason ) ; |
public class PersistenceContextRefTypeImpl { /** * If not already created , a new < code > persistence - property < / code > element will be created and returned .
* Otherwise , the first existing < code > persistence - property < / code > element will be returned .
* @ return the instance defined for the element < code > persistence - property < / code > */
public PropertyType < PersistenceContextRefType < T > > getOrCreatePersistenceProperty ( ) { } } | List < Node > nodeList = childNode . get ( "persistence-property" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new PropertyTypeImpl < PersistenceContextRefType < T > > ( this , "persistence-property" , childNode , nodeList . get ( 0 ) ) ; } return createPersistenceProperty ( ) ; |
public class ServerModule { /** * Override this method to provide your own Jackson provider .
* @ return ObjectMapper provider for Jackson */
protected Provider < ObjectMapper > getJacksonProvider ( ) { } } | return new Provider < ObjectMapper > ( ) { @ Override public ObjectMapper get ( ) { final ObjectMapper mapper = new ObjectMapper ( ) ; mapper . registerModule ( new JodaModule ( ) ) ; mapper . disable ( SerializationFeature . WRITE_DATES_AS_TIMESTAMPS ) ; return mapper ; } } ; |
public class StructrHttpServiceConfig { /** * - - - - - private methods - - - - - */
private Class loadClass ( final String name ) { } } | ClassLoader loader = NodeExtender . getClassLoader ( ) ; Class loadedClass = null ; if ( loader == null ) { loader = getClass ( ) . getClassLoader ( ) ; } try { loadedClass = Class . forName ( name , true , loader ) ; } catch ( Throwable ignore ) { } if ( loadedClass == null ) { try { loadedClass = Class . forName ( name ) ; } catch ( Throwable ignore ) { } } return loadedClass ; |
public class BasicDistributionSummary { /** * { @ inheritDoc } */
@ Override public Long getValue ( int pollerIndex ) { } } | final long cnt = count . getCurrentCount ( pollerIndex ) ; final long total = totalAmount . getCurrentCount ( pollerIndex ) ; final long value = ( long ) ( ( double ) total / cnt ) ; return ( cnt == 0 ) ? 0L : value ; |
public class DeviceImpl { /** * Initializes the device : < br >
* < ul >
* < li > reloads device and class properties < / li >
* < li > applies memorized value to attributes < / li >
* < li > restarts polling < / li >
* < li > calls delete method { @ link Delete }
* < li >
* < li > calls init method { @ link Init }
* < li >
* < / ul > */
public synchronized void initDevice ( ) { } } | MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; if ( stateImpl == null ) { stateImpl = new StateImpl ( businessObject , null , null ) ; } if ( statusImpl == null ) { statusImpl = new StatusImpl ( businessObject , null , null ) ; } if ( initImpl == null ) { buildInit ( null , false ) ; } doInit ( ) ; try { pushInterfaceChangeEvent ( true ) ; } catch ( final DevFailed e ) { // ignore
logger . error ( "error pushing event" , e ) ; } logger . debug ( "device init done" ) ; xlogger . exit ( ) ; |
public class InvertedIndex { /** * Query list .
* @ param keys the keys
* @ param filter the filter
* @ return the list */
public Set < DOCUMENT > query ( @ NonNull Iterable < KEY > keys , @ NonNull Predicate < ? super DOCUMENT > filter ) { } } | return Streams . asParallelStream ( keys ) . flatMap ( key -> index . get ( key ) . stream ( ) ) . map ( documents :: get ) . filter ( filter ) . collect ( Collectors . toSet ( ) ) ; |
public class IdentityDescription { /** * The provider names .
* @ param logins
* The provider names . */
public void setLogins ( java . util . Collection < String > logins ) { } } | if ( logins == null ) { this . logins = null ; return ; } this . logins = new java . util . ArrayList < String > ( logins ) ; |
public class ArchiveRepositoriesResource { /** * Get a list of all of the repository summaries */
@ GET @ Path ( "/repositorysummaries" ) public List < RepositorySummary > getRepositorySummaries ( ) { } } | List < RepositorySummary > result = new ArrayList < RepositorySummary > ( repositories . size ( ) ) ; for ( String repositoryId : repositories . keySet ( ) ) { RepositorySummary repositorySummary = getScriptRepo ( repositoryId ) . getRepositorySummary ( ) ; result . add ( repositorySummary ) ; } return result ; |
public class Elements { /** * Inserts the specified element into the parent of the after element if not already present . If parent already
* contains child , this method does nothing . */
public static void lazyInsertAfter ( Element newElement , Element after ) { } } | if ( ! after . parentNode . contains ( newElement ) ) { after . parentNode . insertBefore ( newElement , after . nextSibling ) ; } |
public class SubscriptionClientChildSbb { public void onTimerEvent ( TimerEvent event , ActivityContextInterface aci ) { } } | // time to refresh : )
if ( getSubscribeRequestTypeCMP ( ) != null ) { return ; } try { DialogActivity da = ( DialogActivity ) aci . getActivity ( ) ; Request refreshSubscribe = createRefresh ( da , getSubscriptionData ( ) ) ; setSubscribeRequestTypeCMP ( SubscribeRequestType . REFRESH ) ; da . sendRequest ( refreshSubscribe ) ; } catch ( Exception e ) { if ( tracer . isSevereEnabled ( ) ) { tracer . severe ( "Failed to send unSUBSCRIBE for forked dialog." , e ) ; } } |
public class ComThread { /** * Kills this { @ link ComThread } gracefully
* and blocks until a thread dies . */
public void kill ( ) { } } | die = true ; lock . activate ( ) ; // wake up the sleeping thread .
// wait for it to die . if someone interrupts us , process that later .
try { join ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.