signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class StructuralNodeModifiersTableModel { /** * Adds a new structural node modifiers to this model
* @ param snm the structural node modifier */
public void addStructuralNodeModifier ( StructuralNodeModifier snm ) { } } | this . snms . add ( snm ) ; this . fireTableRowsInserted ( this . snms . size ( ) - 1 , this . snms . size ( ) - 1 ) ; |
public class ProxyCertificateUtil { /** * Determines if a specified certificate type indicates a GSI - 2 or GSI - 3 or
* GSI - 4 impersonation proxy certificate .
* @ param certType the certificate type to check .
* @ return true if certType is a GSI - 2 or GSI - 3 or GSI - 4 impersonation
* proxy , false otherwise . */
public static boolean isImpersonationProxy ( GSIConstants . CertificateType certType ) { } } | return certType == GSIConstants . CertificateType . GSI_3_IMPERSONATION_PROXY || certType == GSIConstants . CertificateType . GSI_3_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_4_IMPERSONATION_PROXY || certType == GSIConstants . CertificateType . GSI_4_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_2_LIMITED_PROXY || certType == GSIConstants . CertificateType . GSI_2_PROXY ; |
public class OverallVolume { /** * An object that contains inbox and junk mail placement metrics for individual email providers .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDomainIspPlacements ( java . util . Collection ) } or { @ link # withDomainIspPlacements ( java . util . Collection ) }
* if you want to override the existing values .
* @ param domainIspPlacements
* An object that contains inbox and junk mail placement metrics for individual email providers .
* @ return Returns a reference to this object so that method calls can be chained together . */
public OverallVolume withDomainIspPlacements ( DomainIspPlacement ... domainIspPlacements ) { } } | if ( this . domainIspPlacements == null ) { setDomainIspPlacements ( new java . util . ArrayList < DomainIspPlacement > ( domainIspPlacements . length ) ) ; } for ( DomainIspPlacement ele : domainIspPlacements ) { this . domainIspPlacements . add ( ele ) ; } return this ; |
public class Storage { /** * Factory method to create a new storage backed by a hashmap .
* @ param name
* @ param < K >
* @ param < V >
* @ return */
public static < K , V > Storage < K , V > createHashMapStorage ( String name ) { } } | return new Storage < K , V > ( name , new MapStorageWrapper < K , V > ( new HashMap < K , V > ( ) ) ) ; |
public class GCLINEImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EList < GCLINERG > getRg ( ) { } } | if ( rg == null ) { rg = new EObjectContainmentEList . Resolving < GCLINERG > ( GCLINERG . class , this , AfplibPackage . GCLINE__RG ) ; } return rg ; |
public class PropertyGen { List < String > generateConstructorAssign ( String fromBean ) { } } | return data . getCopyGen ( ) . generateCopyToImmutable ( "\t\t" , fromBean , data ) ; |
public class ServerConfigurationChecker { /** * Checks the server - side configurations and records the check results . */
public synchronized void regenerateReport ( ) { } } | // Generate the configuration map from master and worker configuration records
Map < PropertyKey , Map < Optional < String > , List < String > > > confMap = generateConfMap ( ) ; // Update the errors and warnings configuration
Map < Scope , List < InconsistentProperty > > confErrors = new HashMap < > ( ) ; Map < Scope , List < InconsistentProperty > > confWarns = new HashMap < > ( ) ; for ( Map . Entry < PropertyKey , Map < Optional < String > , List < String > > > entry : confMap . entrySet ( ) ) { if ( entry . getValue ( ) . size ( ) >= 2 ) { PropertyKey key = entry . getKey ( ) ; InconsistentProperty inconsistentProperty = new InconsistentProperty ( ) . setName ( key . getName ( ) ) . setValues ( entry . getValue ( ) ) ; Scope scope = key . getScope ( ) . equals ( Scope . ALL ) ? Scope . SERVER : key . getScope ( ) ; if ( entry . getKey ( ) . getConsistencyLevel ( ) . equals ( ConsistencyCheckLevel . ENFORCE ) ) { confErrors . putIfAbsent ( scope , new ArrayList < > ( ) ) ; confErrors . get ( scope ) . add ( inconsistentProperty ) ; } else { confWarns . putIfAbsent ( scope , new ArrayList < > ( ) ) ; confWarns . get ( scope ) . add ( inconsistentProperty ) ; } } } // Update configuration status
ConfigStatus status = confErrors . values ( ) . stream ( ) . anyMatch ( a -> a . size ( ) > 0 ) ? ConfigStatus . FAILED : confWarns . values ( ) . stream ( ) . anyMatch ( a -> a . size ( ) > 0 ) ? ConfigStatus . WARN : ConfigStatus . PASSED ; if ( ! status . equals ( mConfigCheckReport . getConfigStatus ( ) ) ) { logConfigReport ( ) ; } mConfigCheckReport = new ConfigCheckReport ( confErrors , confWarns , status ) ; |
public class AndroidPaint { /** * Shifts the bitmap pattern so that it will always start at a multiple of
* itself for any tile the pattern is used . This ensures that regardless of
* size of the pattern it tiles correctly .
* @ param origin the reference point */
@ Override public void setBitmapShaderShift ( Point origin ) { } } | Shader shader = this . paint . getShader ( ) ; if ( shader != null ) { int relativeDx = ( ( int ) - origin . x ) % this . shaderWidth ; int relativeDy = ( ( int ) - origin . y ) % this . shaderHeight ; Matrix localMatrix = new Matrix ( ) ; localMatrix . setTranslate ( relativeDx , relativeDy ) ; shader . setLocalMatrix ( localMatrix ) ; } |
public class ApikeyManager { /** * / * create now */
public Apikey createNowFromMap ( @ Nullable String user , long duration , @ Nullable Arr roles , Map < String , Object > nameAndValMap ) { } } | return createFromMap ( user , nowStartMs ( ) , duration , roles , nameAndValMap ) ; |
public class SDKUtil { /** * 写文件方法
* @ param filePath
* 文件路径
* @ param fileContent
* 文件内容
* @ param encoding
* 编码
* @ return */
public static boolean writeFile ( String filePath , String fileContent , String encoding ) { } } | FileOutputStream fout = null ; FileChannel fcout = null ; File file = new File ( filePath ) ; if ( file . exists ( ) ) { file . delete ( ) ; } try { fout = new FileOutputStream ( filePath ) ; // 获取输出通道
fcout = fout . getChannel ( ) ; // 创建缓冲区
// ByteBuffer buffer = ByteBuffer . allocate ( 1024 ) ;
ByteBuffer buffer = ByteBuffer . wrap ( fileContent . getBytes ( encoding ) ) ; fcout . write ( buffer ) ; fout . flush ( ) ; } catch ( FileNotFoundException e ) { LogUtil . writeErrorLog ( "WriteFile fail" , e ) ; return false ; } catch ( IOException ex ) { LogUtil . writeErrorLog ( "WriteFile fail" , ex ) ; return false ; } finally { try { if ( null != fout ) fout . close ( ) ; if ( null != fcout ) fcout . close ( ) ; } catch ( IOException ex ) { LogUtil . writeErrorLog ( "Releases any system resources fail" , ex ) ; return false ; } } return true ; |
public class VirtualMachineErrorTerminator { /** * Terminates the JVM . It will cause System . exit ( ) with exit code set in
* { @ link # setExitCode ( int ) } to be invoked on a separate thread .
* @ param e the virtual machine error that is the cause for terminating the
* JVM
* @ throws IllegalArgumentException if e = = null */
public static void terminateVM ( VirtualMachineError e ) { } } | if ( e == null ) { throw new IllegalArgumentException ( "e == null" ) ; } if ( terminating ) { return ; } // Ordering is important - these fields are volatile ; we must first
// set terminationCause and only after that terminating so that
// checkTerminating ( ) never observes ( terminating = = true & &
// terminationCause = = null )
terminationCause = e ; synchronized ( lock ) { terminating = true ; lock . notify ( ) ; } |
public class ProtoLexer { /** * $ ANTLR start " COMMENT " */
public final void mCOMMENT ( ) throws RecognitionException { } } | try { int _type = COMMENT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // com / dyuproject / protostuff / parser / ProtoLexer . g : 260:5 : ( ' / / ' ( ~ ( ' \ \ n ' | ' \ \ r ' ) ) * ( ' \ \ r ' ) ? ' \ \ n ' | ' / * ' ( options { greedy = false ; } : . ) * ' * / ' )
int alt16 = 2 ; switch ( input . LA ( 1 ) ) { case '/' : { switch ( input . LA ( 2 ) ) { case '/' : { alt16 = 1 ; } break ; case '*' : { alt16 = 2 ; } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 16 , 1 , input ) ; throw nvae ; } } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 16 , 0 , input ) ; throw nvae ; } switch ( alt16 ) { case 1 : // com / dyuproject / protostuff / parser / ProtoLexer . g : 260:9 : ' / / ' ( ~ ( ' \ \ n ' | ' \ \ r ' ) ) * ( ' \ \ r ' ) ? ' \ \ n '
{ match ( "//" ) ; // com / dyuproject / protostuff / parser / ProtoLexer . g : 260:14 : ( ~ ( ' \ \ n ' | ' \ \ r ' ) ) *
loop13 : do { int alt13 = 2 ; int LA13_0 = input . LA ( 1 ) ; if ( ( ( LA13_0 >= '\u0000' && LA13_0 <= '\t' ) || ( LA13_0 >= '\u000B' && LA13_0 <= '\f' ) || ( LA13_0 >= '\u000E' && LA13_0 <= '\uFFFF' ) ) ) { alt13 = 1 ; } switch ( alt13 ) { case 1 : // com / dyuproject / protostuff / parser / ProtoLexer . g : 260:14 : ~ ( ' \ \ n ' | ' \ \ r ' )
{ if ( ( input . LA ( 1 ) >= '\u0000' && input . LA ( 1 ) <= '\t' ) || ( input . LA ( 1 ) >= '\u000B' && input . LA ( 1 ) <= '\f' ) || ( input . LA ( 1 ) >= '\u000E' && input . LA ( 1 ) <= '\uFFFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; default : break loop13 ; } } while ( true ) ; // com / dyuproject / protostuff / parser / ProtoLexer . g : 260:28 : ( ' \ \ r ' ) ?
int alt14 = 2 ; switch ( input . LA ( 1 ) ) { case '\r' : { alt14 = 1 ; } break ; } switch ( alt14 ) { case 1 : // com / dyuproject / protostuff / parser / ProtoLexer . g : 260:28 : ' \ \ r '
{ match ( '\r' ) ; } break ; } match ( '\n' ) ; skip ( ) ; } break ; case 2 : // com / dyuproject / protostuff / parser / ProtoLexer . g : 261:9 : ' / * ' ( options { greedy = false ; } : . ) * ' * / '
{ match ( "/*" ) ; // com / dyuproject / protostuff / parser / ProtoLexer . g : 261:14 : ( options { greedy = false ; } : . ) *
loop15 : do { int alt15 = 2 ; int LA15_0 = input . LA ( 1 ) ; if ( ( LA15_0 == '*' ) ) { int LA15_1 = input . LA ( 2 ) ; if ( ( LA15_1 == '/' ) ) { alt15 = 2 ; } else if ( ( ( LA15_1 >= '\u0000' && LA15_1 <= '.' ) || ( LA15_1 >= '0' && LA15_1 <= '\uFFFF' ) ) ) { alt15 = 1 ; } } else if ( ( ( LA15_0 >= '\u0000' && LA15_0 <= ')' ) || ( LA15_0 >= '+' && LA15_0 <= '\uFFFF' ) ) ) { alt15 = 1 ; } switch ( alt15 ) { case 1 : // com / dyuproject / protostuff / parser / ProtoLexer . g : 261:42 : .
{ matchAny ( ) ; } break ; default : break loop15 ; } } while ( true ) ; match ( "*/" ) ; skip ( ) ; } break ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class A_CmsImportExportUserDialog { /** * Initializes the download button . < p > */
protected void initDownloadButton ( ) { } } | if ( m_fileDownloader != null ) { m_fileDownloader . remove ( ) ; } m_fileDownloader = new FileDownloader ( getDownloadResource ( ) ) ; m_fileDownloader . extend ( getDownloadButton ( ) ) ; |
public class ScriptProtect { /** * translate string to script - protected form
* @ param str
* @ return translated String */
public static String translate ( String str ) { } } | if ( str == null ) return "" ; // TODO do - while machen
int index , last = 0 , endIndex ; StringBuilder sb = null ; String tagName ; while ( ( index = str . indexOf ( '<' , last ) ) != - 1 ) { // read tagname
int len = str . length ( ) ; char c ; for ( endIndex = index + 1 ; endIndex < len ; endIndex ++ ) { c = str . charAt ( endIndex ) ; if ( ( c < 'a' || c > 'z' ) && ( c < 'A' || c > 'Z' ) ) break ; } tagName = str . substring ( index + 1 , endIndex ) ; if ( compareTagName ( tagName ) ) { if ( sb == null ) { sb = new StringBuilder ( ) ; last = 0 ; } sb . append ( str . substring ( last , index + 1 ) ) ; sb . append ( "invalidTag" ) ; last = endIndex ; } else if ( sb != null ) { sb . append ( str . substring ( last , index + 1 ) ) ; last = index + 1 ; } else last = index + 1 ; } if ( sb != null ) { if ( last != str . length ( ) ) sb . append ( str . substring ( last ) ) ; return sb . toString ( ) ; } return str ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCableCarrierFittingType ( ) { } } | if ( ifcCableCarrierFittingTypeEClass == null ) { ifcCableCarrierFittingTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 70 ) ; } return ifcCableCarrierFittingTypeEClass ; |
public class TokenUtil { /** * Obtain an authentication token for the given user and add it to the
* user ' s credentials .
* @ param client The Elasticsearch client
* @ param user The user for obtaining and storing the token
* @ throws IOException If making a remote call to the authentication service fails */
public static void obtainAndCache ( RestClient client , User user ) throws IOException { } } | EsToken token = obtainEsToken ( client , user ) ; if ( token == null ) { throw new IOException ( "No token returned for user " + user . getKerberosPrincipal ( ) . getName ( ) ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Obtained token " + EsTokenIdentifier . KIND_NAME + " for user " + user . getKerberosPrincipal ( ) . getName ( ) ) ; } user . addEsToken ( token ) ; |
public class CharsetConversion { /** * Loads character set information . */
@ Deprecated static void putEntry ( final int charsetId , String mysqlCharset , String mysqlCollation ) { } } | entries [ charsetId ] = new Entry ( charsetId , mysqlCharset , // NL
mysqlCollation , /* Unknown java charset */
null ) ; |
public class RuntimeMojoSupport { /** * Ensure Groovy compatibility . Requires Groovy 2 + */
private void ensureGroovyComparability ( final ClassLoader classLoader ) throws MojoExecutionException { } } | Version groovyVersion = groovyVersionHelper . detectVersion ( classLoader ) ; if ( groovyVersion == null ) { // complain and continue
log . error ( "Unable to determine Groovy version" ) ; } else { log . debug ( "Detected Groovy version: {}" , groovyVersion ) ; if ( versionHelper . before ( 2 ) . containsVersion ( groovyVersion ) ) { throw new MojoExecutionException ( "Unsupported Groovy version: " + groovyVersion ) ; } } |
public class APITraceFileSystem { /** * start auto ( wrap : FileSystem ) */
public String getName ( ) { } } | APITrace . CallEvent ce ; String rv ; ce = new APITrace . CallEvent ( ) ; rv = super . getName ( ) ; ce . logCall ( APITrace . CALL_getName , rv , null ) ; return rv ; |
public class GlacierMethod { /** * Invokes the method and returns the response headers
* @ return map of response headers ; duplicate header keys are ignored
* @ throws InternalException
* @ throws CloudException
* @ throws GlacierException */
public Map < String , String > invokeHeaders ( ) throws InternalException , CloudException { } } | ClientAndResponse clientAndResponse = invokeInternal ( ) ; try { Map < String , String > headers = new HashMap < String , String > ( ) ; // doesn ' t support duplicate header keys , but they are unused by glacier
for ( Header header : clientAndResponse . response . getAllHeaders ( ) ) { headers . put ( header . getName ( ) . toLowerCase ( ) , header . getValue ( ) ) ; } return headers ; } finally { clientAndResponse . client . getConnectionManager ( ) . shutdown ( ) ; } |
public class ScriptUtil { /** * Returns the configured script factory in the context or a new one . */
public static ScriptFactory getScriptFactory ( ) { } } | ProcessEngineConfigurationImpl processEngineConfiguration = Context . getProcessEngineConfiguration ( ) ; if ( processEngineConfiguration != null ) { return processEngineConfiguration . getScriptFactory ( ) ; } else { return new ScriptFactory ( ) ; } |
public class ClientWorldModelInterface { /** * Sets - up the connector for this MINA session .
* @ return { @ code true } if the setup succeeds , else { @ code false } . */
protected boolean setConnector ( ) { } } | if ( this . host == null ) { log . error ( "No host value set, cannot set up socket connector." ) ; return false ; } if ( this . port < 0 || this . port > 65535 ) { log . error ( "Port value is invalid {}." , Integer . valueOf ( this . port ) ) ; return false ; } if ( this . executors == null ) { this . executors = new ExecutorFilter ( 1 ) ; } this . connector = new NioSocketConnector ( ) ; this . connector . getSessionConfig ( ) . setIdleTime ( IdleStatus . WRITER_IDLE , ClientWorldModelInterface . TIMEOUT_PERIOD / 2 ) ; // this . connector . getSessionConfig ( ) . setIdleTime ( IdleStatus . READER _ IDLE ,
// ( int ) ( ClientWorldModelInterface . TIMEOUT _ PERIOD * 1.1f ) ) ;
if ( ! this . connector . getFilterChain ( ) . contains ( WorldModelClientProtocolCodecFactory . CODEC_NAME ) ) { this . connector . getFilterChain ( ) . addLast ( WorldModelClientProtocolCodecFactory . CODEC_NAME , new ProtocolCodecFilter ( new WorldModelClientProtocolCodecFactory ( true ) ) ) ; } this . connector . getFilterChain ( ) . addLast ( "ExecutorPool" , this . executors ) ; this . connector . setHandler ( this . ioHandler ) ; log . debug ( "Connector set up successful." ) ; return true ; |
public class GVRCursorController { /** * Update the state of the picker . If it has an owner , the picker
* will use that object to derive its position and orientation .
* The " active " state of this controller is used to indicate touch .
* The cursor position is updated after picking . */
protected void updatePicker ( MotionEvent event , boolean isActive ) { } } | final MotionEvent newEvent = ( event != null ) ? event : null ; final ControllerPick controllerPick = new ControllerPick ( mPicker , newEvent , isActive ) ; context . runOnGlThread ( controllerPick ) ; |
public class InternalXtextParser { /** * InternalXtext . g : 795:1 : entryRuleRuleID : ruleRuleID EOF ; */
public final void entryRuleRuleID ( ) throws RecognitionException { } } | try { // InternalXtext . g : 796:1 : ( ruleRuleID EOF )
// InternalXtext . g : 797:1 : ruleRuleID EOF
{ before ( grammarAccess . getRuleIDRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleRuleID ( ) ; state . _fsp -- ; after ( grammarAccess . getRuleIDRule ( ) ) ; match ( input , EOF , FollowSets000 . FOLLOW_2 ) ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ; |
public class CoinbaseAccountServiceRaw { /** * Authenticated resource that returns the user ’ s current Bitcoin receive address .
* @ return The user ’ s current { @ code CoinbaseAddress } .
* @ throws IOException
* @ see < a
* href = " https : / / coinbase . com / api / doc / 1.0 / accounts / receive _ address . html " > coinbase . com / api / doc / 1.0 / accounts / receive _ address . html < / a > */
public CoinbaseAddress getCoinbaseReceiveAddress ( ) throws IOException { } } | final CoinbaseAddress receiveResult = coinbase . getReceiveAddress ( exchange . getExchangeSpecification ( ) . getApiKey ( ) , signatureCreator , exchange . getNonceFactory ( ) ) ; return receiveResult ; |
public class MtasTokenizer { /** * ( non - Javadoc )
* @ see org . apache . lucene . analysis . TokenStream # incrementToken ( ) */
@ Override public boolean incrementToken ( ) throws IOException { } } | clearAttributes ( ) ; MtasToken token ; Integer positionIncrement ; MtasPayloadEncoder payloadEncoder ; if ( tokenCollectionIterator == null ) { return false ; } else if ( tokenCollectionIterator . hasNext ( ) ) { token = tokenCollectionIterator . next ( ) ; // compute info
positionIncrement = token . getPositionStart ( ) - currentPosition ; currentPosition = token . getPositionStart ( ) ; payloadEncoder = new MtasPayloadEncoder ( token , encodingFlags ) ; // set info
termAtt . append ( token . getValue ( ) ) ; positionIncrementAtt . setPositionIncrement ( positionIncrement ) ; offsetAtt . setOffset ( token . getOffsetStart ( ) , token . getOffsetEnd ( ) ) ; payloadAtt . setPayload ( payloadEncoder . getPayload ( ) ) ; return true ; } return false ; |
public class WebhookOperations { /** * < p > Método que permite optener la información de un webhook < / p >
* @ param webhookId Identificador único del webhook
* @ return Regresa un objeto Webhook */
public Webhook get ( final String webhookId ) throws OpenpayServiceException , ServiceUnavailableException { } } | String path = String . format ( GET_PATH , this . getMerchantId ( ) , webhookId ) ; return this . getJsonClient ( ) . get ( path , Webhook . class ) ; |
public class ZoomableGraphicsContext { /** * Transform a JavaFX angle to its document equivalent .
* @ param angle the JavaFX angle .
* @ return the document angle . */
@ Pure public double fx2docAngle ( double angle ) { } } | final ZoomableCanvas < ? > canvas = getCanvas ( ) ; if ( canvas . isInvertedAxisX ( ) != canvas . isInvertedAxisY ( ) ) { return - angle ; } return angle ; |
public class JAXBSerialiser { /** * Deserialise a DOM Node to an Object ( or JAXBElement )
* @ param node
* @ return */
public Object deserialise ( final Node node ) { } } | if ( node == null ) throw new IllegalArgumentException ( "Null argument passed to deserialise!" ) ; final Unmarshaller unmarshaller = getUnmarshaller ( ) ; try { final Object obj = unmarshaller . unmarshal ( node ) ; if ( obj == null ) throw new RuntimeException ( "Error deserialising from " + node ) ; else return obj ; } catch ( JAXBException e ) { throw new JAXBRuntimeException ( "deserialisation" , e ) ; } |
public class SCMController { /** * Updating a change log file filter */
@ RequestMapping ( value = "changeLog/fileFilter/{projectId}/{name}/update" , method = RequestMethod . PUT ) public Resource < SCMFileChangeFilter > saveChangeLogFileFilter ( @ PathVariable ID projectId , @ PathVariable String name , @ RequestBody SCMFileChangeFilter filter ) { } } | if ( ! StringUtils . equals ( name , filter . getName ( ) ) ) { throw new IllegalStateException ( "The name of the filter in the request body must match the one in the URL" ) ; } return createChangeLogFileFilter ( projectId , filter ) ; |
public class ParserDQL { /** * < with clause > : : = WITH [ RECURSIVE ] < with list > */
private WithList XreadWithClause ( ) { } } | boolean recursive = false ; if ( withStatementDepth > 0 ) { throw Error . error ( "With statements may not be nested." ) ; } int oldStatementDepth = withStatementDepth ; try { session . clearLocalTables ( ) ; withStatementDepth += 1 ; readThis ( Tokens . WITH ) ; if ( token . tokenType == Tokens . RECURSIVE ) { recursive = true ; read ( ) ; } WithList withList = new WithList ( recursive ) ; XreadWithList ( withList ) ; return withList ; } finally { withStatementDepth = oldStatementDepth ; } |
public class Yank { /** * Executes a given INSERT SQL prepared statement matching the sqlKey String in a properties file
* loaded via Yank . addSQLStatements ( . . . ) . Returns the auto - increment id of the inserted row .
* @ param poolName The name of the connection pool to query against
* @ param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement
* value
* @ param params The replacement parameters
* @ return the auto - increment id of the inserted row , or null if no id is available
* @ throws SQLStatementNotFoundException if an SQL statement could not be found for the given
* sqlKey String */
public static Long insertSQLKey ( String poolName , String sqlKey , Object [ ] params ) throws SQLStatementNotFoundException , YankSQLException { } } | String sql = YANK_POOL_MANAGER . getMergedSqlProperties ( ) . getProperty ( sqlKey ) ; if ( sql == null || sql . equalsIgnoreCase ( "" ) ) { throw new SQLStatementNotFoundException ( ) ; } else { return insert ( poolName , sql , params ) ; } |
public class TermIndex { /** * Looks up the term for the given offset .
* @ param offset The offset for which to look up the term .
* @ return The term for the entry at the given offset . */
public synchronized long lookup ( long offset ) { } } | Map . Entry < Long , Long > entry = terms . floorEntry ( offset ) ; return entry != null ? entry . getValue ( ) : 0 ; |
public class CmsSecurityManager { /** * Returns a user object based on the id of a user . < p >
* @ param context the current request context
* @ param id the id of the user to read
* @ return the user read
* @ throws CmsException if something goes wrong */
public CmsUser readUser ( CmsRequestContext context , CmsUUID id ) throws CmsException { } } | CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; CmsUser result = null ; try { result = m_driverManager . readUser ( dbc , id ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_READ_USER_FOR_ID_1 , id . toString ( ) ) , e ) ; } finally { dbc . clear ( ) ; } return result ; |
public class CmsPathIncludeExcludeSet { /** * Adds an included path . < p >
* @ param include the path to add */
public void addInclude ( String include ) { } } | include = normalizePath ( include ) ; m_includes . add ( include ) ; m_allPaths . add ( include ) ; |
public class MethodDesc { /** * Returns this in Java method signature syntax .
* @ param name method name */
public String toMethodSignature ( String name ) { } } | StringBuffer buf = new StringBuffer ( ) ; buf . append ( mRetType . getFullName ( ) ) ; buf . append ( ' ' ) ; buf . append ( name ) ; buf . append ( '(' ) ; TypeDesc [ ] params = mParams ; for ( int i = 0 ; i < params . length ; i ++ ) { if ( i > 0 ) { buf . append ( ", " ) ; } buf . append ( params [ i ] . getFullName ( ) ) ; } return buf . append ( ')' ) . toString ( ) ; |
public class PermissionTemplateService { /** * Apply a permission template to a set of projects . Authorization to administrate these projects
* is not verified . The projects must exist , so the " project creator " permissions defined in the
* template are ignored . */
public void applyAndCommit ( DbSession dbSession , PermissionTemplateDto template , Collection < ComponentDto > projects ) { } } | if ( projects . isEmpty ( ) ) { return ; } for ( ComponentDto project : projects ) { copyPermissions ( dbSession , template , project , null ) ; } projectIndexers . commitAndIndex ( dbSession , projects , ProjectIndexer . Cause . PERMISSION_CHANGE ) ; |
public class SessionDataManager { /** * Merge a list of nodes and properties of root data . NOTE . Properties in the list will have empty
* value data . I . e . for operations not changes properties content . USED FOR DELETE .
* @ param rootData
* @ param dataManager
* @ param deep
* @ param action
* @ return
* @ throws RepositoryException */
protected List < ? extends ItemData > mergeList ( ItemData rootData , DataManager dataManager , boolean deep , int action ) throws RepositoryException { } } | // 1 get all transient descendants
List < ItemState > transientDescendants = new ArrayList < ItemState > ( ) ; traverseTransientDescendants ( rootData , action , transientDescendants ) ; if ( deep || ! transientDescendants . isEmpty ( ) ) { // 2 get ALL persisted descendants
Map < String , ItemData > descendants = new LinkedHashMap < String , ItemData > ( ) ; traverseStoredDescendants ( rootData , dataManager , action , descendants , true , transientDescendants ) ; // merge data
for ( ItemState state : transientDescendants ) { ItemData data = state . getData ( ) ; if ( ! state . isDeleted ( ) ) { descendants . put ( data . getIdentifier ( ) , data ) ; } else { descendants . remove ( data . getIdentifier ( ) ) ; } } Collection < ItemData > desc = descendants . values ( ) ; List < ItemData > retval ; if ( deep ) { int size = desc . size ( ) ; retval = new ArrayList < ItemData > ( size < 10 ? 10 : size ) ; for ( ItemData itemData : desc ) { retval . add ( itemData ) ; if ( deep && itemData . isNode ( ) ) { retval . addAll ( mergeList ( itemData , dataManager , true , action ) ) ; } } } else { retval = new ArrayList < ItemData > ( desc ) ; } return retval ; } else { return getStoredDescendants ( rootData , dataManager , action ) ; } |
public class MethodCallClassTransformer { /** * { @ link Properties } entries like :
* < ul >
* < li > name : full qualified class name and method name separated by ' { @ link # METHOD _ TOKEN # } '
* < li > value : Javassist statement - starts with ' { @ link # JAVASSIST _ STATEMENT _ START _ TOKEN & # 123 ; } '
* and ends with ' { @ link # JAVASSIST _ STATEMENT _ END _ TOKEN & # 125 ; } '
* < / ul >
* < pre >
* { @ code
* my . example . App # doSomthing = { $ 2 = " injected value for sec . parameter " ; $ _ = $ proceed ( $ $ ) ; }
* < / pre >
* @ param properties maybe { @ code null }
* @ throws Exception provided by interface
* @ see < a href = " https : / / jboss - javassist . github . io / javassist / tutorial / tutorial2 . html # before " >
* https : / / jboss - javassist . github . io / javassist / tutorial / tutorial2 . html # before < / a > */
@ Override public void configure ( final Properties properties ) throws Exception { } } | this . properties = ( null == properties ) ? new Properties ( ) : ( Properties ) properties . clone ( ) ; |
public class Watchers { /** * Un - registers a watcher .
* @ param session the Maven session
* @ param watcher the watcher to remove
* @ return { @ literal true } if the watcher was removed , { @ literal false } otherwise . */
public static synchronized boolean remove ( MavenSession session , Watcher watcher ) { } } | return ! ( session == null || watcher == null ) && get ( session ) . remove ( watcher ) ; |
public class AbstractListJsonDeserializer { /** * < p > newInstance < / p >
* @ param deserializer { @ link JsonDeserializer } used to deserialize the objects inside the { @ link AbstractList } .
* @ param < T > Type of the elements inside the { @ link AbstractList }
* @ return a new instance of { @ link AbstractListJsonDeserializer } */
public static < T > AbstractListJsonDeserializer < T > newInstance ( JsonDeserializer < T > deserializer ) { } } | return new AbstractListJsonDeserializer < T > ( deserializer ) ; |
public class TermTable { /** * { @ inheritDoc } */
@ Override protected void _from ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | // 1 : read number of terms
final int size = in . readInt ( ) ; indexedTerms = sizedHashMap ( size ) ; for ( int i = 0 ; i < size ; ++ i ) { // 1 : read each term
final Term term = ( Term ) in . readObject ( ) ; addTerm ( term ) ; } // 2 : read number of global terms
int gtisize = in . readInt ( ) ; globalTermIndex = sizedHashMap ( gtisize ) ; for ( int i = 0 ; i < gtisize ; i ++ ) { // 1 : read global term key
int key = in . readInt ( ) ; // 2 : read global term value
int value = in . readInt ( ) ; globalTermIndex . put ( key , value ) ; } |
public class CmsMessageBundleEditorOptions { /** * Sets the currently edited locale .
* @ param locale the locale to set . */
void setLanguage ( final Locale locale ) { } } | if ( ! m_languageSelect . getValue ( ) . equals ( locale ) ) { m_languageSelect . setValue ( locale ) ; } |
public class ContextItems { /** * Returns a date item associated with the specified item name .
* @ param itemName Item name
* @ return Date value */
public Date getDate ( String itemName ) { } } | try { return DateUtil . parseDate ( getItem ( itemName ) ) ; } catch ( Exception e ) { return null ; } |
public class BaseDestinationHandler { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . DestinationHandler # deletePubSubOutputHandler ( com . ibm . ws . sib . utils . SIBUuid8) */
@ Override public synchronized void deletePubSubOutputHandler ( SIBUuid8 neighbourUUID ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deletePubSubOutputHandler" , neighbourUUID ) ; _pubSubRealization . deletePubSubOutputHandler ( neighbourUUID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deletePubSubOutputHandler" ) ; |
public class AcraToChiliprojectSyncer { /** * Invoked when detecting a duplicate issue ( two issues with the same
* { @ link ConfigurationManager # CHILIPROJECT _ STACKTRACE _ MD5 _ CF _ ID } customfield value .
* The oldest issue is kept , the others are closed .
* @ param pDuplicateIssues
* the list of duplicate issues
* @ return the kept issue
* @ throws RedmineException
* @ throws NotFoundException
* @ throws AuthenticationException
* @ throws IOException */
private Issue handleMultipleIssuesForSameStacktrace ( final List < Issue > pDuplicateIssues ) throws IOException , AuthenticationException , NotFoundException , RedmineException { } } | Collections . sort ( pDuplicateIssues , new CreationDateIssueComparator ( ) ) ; final Issue originalIssue = pDuplicateIssues . get ( 0 ) ; final List < Issue > issuesToClose = pDuplicateIssues . subList ( 1 , pDuplicateIssues . size ( ) ) ; if ( LOGGER . isInfoEnabled ( ) ) { LOGGER . info ( "Closing issues {} duplicates of issue id={}" , Arrays . toString ( issuesToClose . toArray ( ) ) , originalIssue . getId ( ) ) ; } for ( final Issue issue : issuesToClose ) { // add duplicate relation ;
final IssueRelation duplicate = new IssueRelation ( ) ; duplicate . setIssueId ( originalIssue . getId ( ) ) ; duplicate . setType ( config . CHILIPROJECT_RELATION_DUPLICATE_NAME ) ; issue . getRelations ( ) . add ( duplicate ) ; // close issue
issue . setStatusId ( config . CHILIPROJECT_STATUS_CLOSED_ID ) ; redmineClient . updateIssue ( issue ) ; } return originalIssue ; |
public class SorensonVideo { /** * { @ inheritDoc } */
@ Override public IoBuffer getKeyframe ( ) { } } | if ( dataCount > 0 ) { IoBuffer result = IoBuffer . allocate ( dataCount ) ; result . put ( blockData , 0 , dataCount ) ; result . rewind ( ) ; return result ; } return null ; |
public class CollisionConfig { /** * Create the collision data from node .
* @ param configurer The configurer reference ( must not be < code > null < / code > ) .
* @ return The collisions data .
* @ throws LionEngineException If unable to read node . */
public static CollisionConfig imports ( Configurer configurer ) { } } | Check . notNull ( configurer ) ; final Map < String , Collision > collisions = new HashMap < > ( 0 ) ; for ( final Xml node : configurer . getRoot ( ) . getChildren ( NODE_COLLISION ) ) { final String coll = node . readString ( ATT_NAME ) ; final Collision collision = createCollision ( node ) ; collisions . put ( coll , collision ) ; } return new CollisionConfig ( collisions ) ; |
public class VersionsImpl { /** * Deleted an unlabelled utterance .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param utterance The utterance text to delete .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the OperationStatus object */
public Observable < OperationStatus > deleteUnlabelledUtteranceAsync ( UUID appId , String versionId , String utterance ) { } } | return deleteUnlabelledUtteranceWithServiceResponseAsync ( appId , versionId , utterance ) . map ( new Func1 < ServiceResponse < OperationStatus > , OperationStatus > ( ) { @ Override public OperationStatus call ( ServiceResponse < OperationStatus > response ) { return response . body ( ) ; } } ) ; |
public class Logger { /** * Issue a log message with a level of INFO .
* @ param message the message */
public void info ( Object message ) { } } | doLog ( Level . INFO , FQCN , message , null , null ) ; |
public class JaxbFactory { /** * get a fitting Unmarshaller
* @ return - the Unmarshaller for the classOfT set
* @ throws JAXBException */
public Unmarshaller getUnmarshaller ( ) throws JAXBException { } } | JAXBContext context = JAXBContext . newInstance ( classOfT ) ; Unmarshaller u = context . createUnmarshaller ( ) ; u . setEventHandler ( new ValidationEventHandler ( ) { @ Override public boolean handleEvent ( ValidationEvent event ) { return true ; } } ) ; return u ; |
public class HtmlPageUtil { /** * Creates a { @ link HtmlPage } from a given { @ link String } that contains the HTML code for that page .
* @ param string { @ link String } that contains the HTML code
* @ return { @ link HtmlPage } for this { @ link String } */
public static HtmlPage toHtmlPage ( String string ) { } } | try { URL url = new URL ( "http://bitvunit.codescape.de/some_page.html" ) ; return HTMLParser . parseHtml ( new StringWebResponse ( string , url ) , new WebClient ( ) . getCurrentWindow ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error creating HtmlPage from String." , e ) ; } |
public class ListWidget { /** * Get view displays the data at the specified position in the { @ link Adapter }
* @ param index - item index in { @ link Adapter }
* @ param host - view using as a host for the adapter view
* @ return view displays the data at the specified position */
protected Widget getViewFromAdapter ( final int index , ListItemHostWidget host ) { } } | return mAdapter == null ? null : mAdapter . getView ( index , host . getGuest ( ) , host ) ; |
public class SerializingTranscoder { /** * ( non - Javadoc )
* @ see net . spy . memcached . Transcoder # decode ( net . spy . memcached . CachedData ) */
public final Object decode ( CachedData d ) { } } | Object obj = d . decodedObject ; if ( obj != null ) { return obj ; } byte [ ] data = d . data ; int flags = d . flag ; if ( ( flags & COMPRESSED ) != 0 ) { data = decompress ( data ) ; } flags = flags & SPECIAL_MASK ; obj = decode0 ( d , data , flags ) ; d . decodedObject = obj ; return obj ; |
public class RaftSessionSequencer { /** * Sequences a response .
* When an operation is sequenced , it ' s first sequenced in the order in which it was submitted to the cluster .
* Once placed in sequential request order , if a response ' s { @ code eventIndex } is greater than the last completed
* { @ code eventIndex } , we attempt to sequence pending events . If after sequencing pending events the response ' s
* { @ code eventIndex } is equal to the last completed { @ code eventIndex } then the response can be immediately
* completed . If not enough events are pending to meet the sequence requirement , the sequencing of responses is
* stopped until events are received .
* @ param sequence The request sequence number .
* @ param response The response to sequence .
* @ param callback The callback to sequence . */
public void sequenceResponse ( long sequence , OperationResponse response , Runnable callback ) { } } | // If the request sequence number is equal to the next response sequence number , attempt to complete the response .
if ( sequence == responseSequence + 1 ) { if ( completeResponse ( response , callback ) ) { ++ responseSequence ; completeResponses ( ) ; } else { responseCallbacks . put ( sequence , new ResponseCallback ( response , callback ) ) ; } } // If the response has not yet been sequenced , store it in the response callbacks map .
// Otherwise , the response for the operation with this sequence number has already been handled .
else if ( sequence > responseSequence ) { responseCallbacks . put ( sequence , new ResponseCallback ( response , callback ) ) ; } |
public class MutableBigInteger { /** * This method implements algorithm 1 from pg . 4 of the Burnikel - Ziegler paper .
* It divides a 2n - digit number by a n - digit number . < br / >
* The parameter beta is 2 < sup > 32 < / sup > so all shifts are multiples of 32 bits .
* < br / >
* { @ code this } must be a nonnegative number such that { @ code this . bitLength ( ) < = 2 * b . bitLength ( ) }
* @ param b a positive number such that { @ code b . bitLength ( ) } is even
* @ param quotient output parameter for { @ code this / b }
* @ return { @ code this % b } */
private MutableBigInteger divide2n1n ( MutableBigInteger b , MutableBigInteger quotient ) { } } | int n = b . intLen ; // step 1 : base case
if ( n % 2 != 0 || n < BigInteger . BURNIKEL_ZIEGLER_THRESHOLD ) { return divideKnuth ( b , quotient ) ; } // step 2 : view this as [ a1 , a2 , a3 , a4 ] where each ai is n / 2 ints or less
MutableBigInteger aUpper = new MutableBigInteger ( this ) ; aUpper . safeRightShift ( 32 * ( n / 2 ) ) ; // aUpper = [ a1 , a2 , a3]
keepLower ( n / 2 ) ; // this = a4
// step 3 : q1 = aUpper / b , r1 = aUpper % b
MutableBigInteger q1 = new MutableBigInteger ( ) ; MutableBigInteger r1 = aUpper . divide3n2n ( b , q1 ) ; // step 4 : quotient = [ r1 , this ] / b , r2 = [ r1 , this ] % b
addDisjoint ( r1 , n / 2 ) ; // this = [ r1 , this ]
MutableBigInteger r2 = divide3n2n ( b , quotient ) ; // step 5 : let quotient = [ q1 , quotient ] and return r2
quotient . addDisjoint ( q1 , n / 2 ) ; return r2 ; |
public class CommerceAccountUserRelPersistenceImpl { /** * Returns the last commerce account user rel in the ordered set where commerceAccountId = & # 63 ; .
* @ param commerceAccountId the commerce account ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce account user rel , or < code > null < / code > if a matching commerce account user rel could not be found */
@ Override public CommerceAccountUserRel fetchByCommerceAccountId_Last ( long commerceAccountId , OrderByComparator < CommerceAccountUserRel > orderByComparator ) { } } | int count = countByCommerceAccountId ( commerceAccountId ) ; if ( count == 0 ) { return null ; } List < CommerceAccountUserRel > list = findByCommerceAccountId ( commerceAccountId , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class SceneStructureProjective { /** * Call this function first . Specifies number of each type of data which is available .
* @ param totalViews Number of views
* @ param totalPoints Number of points */
public void initialize ( int totalViews , int totalPoints ) { } } | views = new View [ totalViews ] ; points = new Point [ totalPoints ] ; for ( int i = 0 ; i < views . length ; i ++ ) { views [ i ] = new View ( ) ; } for ( int i = 0 ; i < points . length ; i ++ ) { points [ i ] = new Point ( pointSize ) ; } |
public class ApplicationExceptionResolver { protected ActionResponse handleMessagingApplicationException ( ActionRuntime runtime , MessagingApplicationException appEx ) { } } | // no save here because of saved as embedded message later
// saveErrors ( appEx . getErrors ( ) ) ;
if ( appEx instanceof MessageResponseApplicationException ) { return ( ( MessageResponseApplicationException ) appEx ) . getResponseHook ( ) . map ( hook -> { return hook . hook ( ) ; } ) . orElseGet ( ( ) -> prepareShowErrorsForward ( runtime ) ) ; } else { return prepareShowErrorsForward ( runtime ) ; } |
public class CommercePriceListLocalServiceUtil { /** * Returns the commerce price list matching the UUID and group .
* @ param uuid the commerce price list ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce price list , or < code > null < / code > if a matching commerce price list could not be found */
public static com . liferay . commerce . price . list . model . CommercePriceList fetchCommercePriceListByUuidAndGroupId ( String uuid , long groupId ) { } } | return getService ( ) . fetchCommercePriceListByUuidAndGroupId ( uuid , groupId ) ; |
public class SoundLoader { /** * Loads the sounds for key from the config in
* < code > & lt ; packagePath & gt ; / sound . properties < / code > */
public byte [ ] [ ] load ( String packagePath , String key ) throws IOException { } } | String [ ] paths = getPaths ( packagePath , key ) ; if ( paths == null ) { log . warning ( "No such sound" , "key" , key ) ; return null ; } byte [ ] [ ] data = new byte [ paths . length ] [ ] ; String bundle = getBundle ( packagePath ) ; for ( int ii = 0 ; ii < paths . length ; ii ++ ) { data [ ii ] = loadClipData ( bundle , paths [ ii ] ) ; } return data ; |
public class StopEntitiesDetectionJobRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StopEntitiesDetectionJobRequest stopEntitiesDetectionJobRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( stopEntitiesDetectionJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopEntitiesDetectionJobRequest . getJobId ( ) , JOBID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AstNode { /** * Set the parent for this node . If this node already has a parent , this method will remove this node from the current parent .
* If the supplied parent is not null , then this node will be added to the supplied parent ' s children .
* @ param parent the new parent , or null if this node is to have no parent */
public void setParent ( AstNode parent ) { } } | removeFromParent ( ) ; if ( parent != null ) { this . parent = parent ; this . parent . children . add ( this ) ; } |
public class RequestConfigurationItemsJsonCommandHandler { /** * { @ inheritDoc } */
@ Override public void handle ( String chargingStationId , JsonObject commandObject , IdentityContext identityContext ) throws UserIdentityUnauthorizedException { } } | ChargingStationId csId = new ChargingStationId ( chargingStationId ) ; if ( ! commandAuthorizationService . isAuthorized ( csId , identityContext . getUserIdentity ( ) , RequestConfigurationItemsCommand . class ) ) { throw new UserIdentityUnauthorizedException ( chargingStationId , identityContext . getUserIdentity ( ) , RequestConfigurationItemsCommand . class ) ; } try { ChargingStation chargingStation = repository . findOne ( chargingStationId ) ; if ( chargingStation != null && chargingStation . communicationAllowed ( ) ) { RequestGetConfigurationApiCommand command = gson . fromJson ( commandObject , RequestGetConfigurationApiCommand . class ) ; commandGateway . send ( new RequestConfigurationItemsCommand ( csId , new HashSet < > ( command . getKeys ( ) ) , identityContext ) ) ; } else { throw new IllegalStateException ( "It is not possible to get configuration for a charging station that is not registered" ) ; } } catch ( JsonSyntaxException ex ) { throw new IllegalArgumentException ( "Get configuration command is not able to parse the payload, is your json correctly formatted?" , ex ) ; } |
public class BatchDetectKeyPhrasesResult { /** * A list of objects containing the results of the operation . The results are sorted in ascending order by the
* < code > Index < / code > field and match the order of the documents in the input list . If all of the documents contain
* an error , the < code > ResultList < / code > is empty .
* @ param resultList
* A list of objects containing the results of the operation . The results are sorted in ascending order by
* the < code > Index < / code > field and match the order of the documents in the input list . If all of the
* documents contain an error , the < code > ResultList < / code > is empty . */
public void setResultList ( java . util . Collection < BatchDetectKeyPhrasesItemResult > resultList ) { } } | if ( resultList == null ) { this . resultList = null ; return ; } this . resultList = new java . util . ArrayList < BatchDetectKeyPhrasesItemResult > ( resultList ) ; |
public class Http { /** * Handles reading an uploaded file .
* @ param request The http request .
* @ return A temp file containing the file data .
* @ throws IOException If an error occurs in processing the file . */
public static Path getFile ( HttpServletRequest request ) throws IOException { } } | Path result = null ; // Set up the objects that do all the heavy lifting
DiskFileItemFactory factory = new DiskFileItemFactory ( ) ; ServletFileUpload upload = new ServletFileUpload ( factory ) ; try { // Read the items - this will save the values to temp files
for ( FileItem item : upload . parseRequest ( request ) ) { if ( ! item . isFormField ( ) ) { result = Files . createTempFile ( "upload" , ".file" ) ; item . write ( result . toFile ( ) ) ; } } } catch ( Exception e ) { // item . write throws a general Exception , so specialise it by wrapping with IOException
throw new IOException ( "Error processing uploaded file" , e ) ; } return result ; |
public class StackdriverStatsExporter { /** * Creates a StackdriverStatsExporter for an explicit project ID and using explicit credentials ,
* with default Monitored Resource .
* < p > Only one Stackdriver exporter can be created .
* @ param credentials a credentials used to authenticate API calls .
* @ param projectId the cloud project id .
* @ param exportInterval the interval between pushing stats to StackDriver .
* @ throws IllegalStateException if a Stackdriver exporter already exists .
* @ deprecated in favor of { @ link # createAndRegister ( StackdriverStatsConfiguration ) } .
* @ since 0.9 */
@ Deprecated public static void createAndRegisterWithCredentialsAndProjectId ( Credentials credentials , String projectId , Duration exportInterval ) throws IOException { } } | checkNotNull ( credentials , "credentials" ) ; checkNotNull ( projectId , "projectId" ) ; checkNotNull ( exportInterval , "exportInterval" ) ; createInternal ( credentials , projectId , exportInterval , DEFAULT_RESOURCE , null , DEFAULT_CONSTANT_LABELS ) ; |
public class TraceSummary { /** * A collection of FaultRootCause structures corresponding to the the trace segments .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setFaultRootCauses ( java . util . Collection ) } or { @ link # withFaultRootCauses ( java . util . Collection ) } if you
* want to override the existing values .
* @ param faultRootCauses
* A collection of FaultRootCause structures corresponding to the the trace segments .
* @ return Returns a reference to this object so that method calls can be chained together . */
public TraceSummary withFaultRootCauses ( FaultRootCause ... faultRootCauses ) { } } | if ( this . faultRootCauses == null ) { setFaultRootCauses ( new java . util . ArrayList < FaultRootCause > ( faultRootCauses . length ) ) ; } for ( FaultRootCause ele : faultRootCauses ) { this . faultRootCauses . add ( ele ) ; } return this ; |
public class TangoHostManager { /** * Returns the TANGO _ HOST with full qualified name .
* @ param tangoHost default Tango _ host
* @ return the TANGO _ HOST with full qualified name .
* @ throws DevFailed if TANGO _ HOST value has a bad syntax . */
public static String getFirstFullTangoHost ( ) throws DevFailed { } } | // TODO
final String TANGO_HOST_ERROR = "API_GetTangoHostFailed" ; // Get the tango _ host
String host = getFirstHost ( ) ; try { // Get FQDN for host
final InetAddress iadd = InetAddress . getByName ( host ) ; host = iadd . getCanonicalHostName ( ) ; } catch ( final UnknownHostException e ) { throw DevFailedUtils . newDevFailed ( TANGO_HOST_ERROR , e . toString ( ) ) ; } return host + ':' + getFirstPort ( ) ; |
public class MethodsMonomerUtils { /** * method to get all MonomerNotations for all given polymers
* @ param polymers List of PolymerNotation
* @ return List of MonomerNotation */
public static List < MonomerNotation > getListOfMonomerNotation ( List < PolymerNotation > polymers ) { } } | List < MonomerNotation > items = new ArrayList < MonomerNotation > ( ) ; for ( PolymerNotation polymer : polymers ) { items . addAll ( polymer . getListMonomers ( ) ) ; } return items ; |
public class TouchEffectDrawable { /** * Called from the drawable ' s draw ( ) method after the canvas has been set to
* draw the shape at ( 0,0 ) . Subclasses can override for special effects such
* as multiple layers , stroking , etc . */
protected void onDraw ( Effect shape , Canvas canvas , Paint paint ) { } } | shape . draw ( canvas , paint ) ; |
public class DoubleField { /** * Set this field to the maximum or minimum value .
* @ param iAreaDesc END _ SELECT _ KEY means set to largest value , others mean smallest . */
public void setToLimit ( int iAreaDesc ) // Set this field to the largest or smallest value
{ } } | // By default compare as ASCII strings
Double tempdouble = MIN ; // Lowest value
if ( iAreaDesc == DBConstants . END_SELECT_KEY ) tempdouble = MAX ; this . doSetData ( tempdouble , DBConstants . DONT_DISPLAY , DBConstants . SCREEN_MOVE ) ; |
public class CaseFoldMapEncoding { /** * onigenc _ get _ case _ fold _ codes _ by _ str _ with _ map */
protected final CaseFoldCodeItem [ ] getCaseFoldCodesByStringWithMap ( int mapSize , int [ ] [ ] map , boolean essTsettFlag , int flag , byte [ ] bytes , int p , int end ) { } } | int b = bytes [ p ] & 0xff ; if ( 0x41 <= b && b <= 0x5a ) { CaseFoldCodeItem item0 = CaseFoldCodeItem . create ( 1 , b + 0x20 ) ; if ( b == 0x53 && essTsettFlag && end > p + 1 && ( bytes [ p + 1 ] == ( byte ) 0x53 || bytes [ p + 1 ] == ( byte ) 0x73 ) ) { /* SS */
CaseFoldCodeItem item1 = CaseFoldCodeItem . create ( 2 , 0xdf ) ; return new CaseFoldCodeItem [ ] { item0 , item1 } ; } else { return new CaseFoldCodeItem [ ] { item0 } ; } } else if ( 0x61 <= b && b <= 0x7a ) { CaseFoldCodeItem item0 = CaseFoldCodeItem . create ( 1 , b - 0x20 ) ; if ( b == 0x73 && essTsettFlag && end > p + 1 && ( bytes [ p + 1 ] == ( byte ) 0x73 || bytes [ p + 1 ] == ( byte ) 0x53 ) ) { /* ss */
CaseFoldCodeItem item1 = CaseFoldCodeItem . create ( 2 , 0xdf ) ; return new CaseFoldCodeItem [ ] { item0 , item1 } ; } else { return new CaseFoldCodeItem [ ] { item0 } ; } } else if ( b == 0xdf && essTsettFlag ) { CaseFoldCodeItem item0 = CaseFoldCodeItem . create ( 1 , 's' , 's' ) ; CaseFoldCodeItem item1 = CaseFoldCodeItem . create ( 1 , 'S' , 'S' ) ; CaseFoldCodeItem item2 = CaseFoldCodeItem . create ( 1 , 's' , 'S' ) ; CaseFoldCodeItem item3 = CaseFoldCodeItem . create ( 1 , 'S' , 's' ) ; return new CaseFoldCodeItem [ ] { item0 , item1 , item2 , item3 } ; } else { for ( int i = 0 ; i < mapSize ; i ++ ) { if ( b == map [ i ] [ 0 ] ) { return new CaseFoldCodeItem [ ] { CaseFoldCodeItem . create ( 1 , map [ i ] [ 1 ] ) } ; } else if ( b == map [ i ] [ 1 ] ) { return new CaseFoldCodeItem [ ] { CaseFoldCodeItem . create ( 1 , map [ i ] [ 0 ] ) } ; } } } return CaseFoldCodeItem . EMPTY_FOLD_CODES ; |
public class Canvas { protected synchronized void resetObjects ( Graphics g ) { } } | for ( Element e : elementList ) { if ( e instanceof Resettable ) { ( ( Resettable ) e ) . reset ( g . getGL ( ) ) ; } } |
public class ComplexDouble2DFFT { /** * Compute the Fast Fourier Transform of data leaving the result in data .
* The array data must be dimensioned ( at least ) 2 * nrows * ncols , consisting of
* alternating real and imaginary parts . */
public void transform ( double data [ ] , int rowspan ) { } } | checkData ( data , rowspan ) ; for ( int i = 0 ; i < nrows ; i ++ ) { rowFFT . transform ( data , i * rowspan , 2 ) ; } for ( int j = 0 ; j < ncols ; j ++ ) { colFFT . transform ( data , 2 * j , rowspan ) ; } |
public class ImageUtil { /** * Creates an { @ link Image } with full opacity ( new PictureStyle ( 1 ) ) .
* horMargin , verMargin and diameter are used to create the { @ link Bbox }
* @ param id is used to create the actual { @ link Image } ( new Image ( id ) ) .
* @ param url
* @ param horMargin
* @ param verMargin
* @ param width
* @ param height
* @ return */
public static Image createSquareImage ( String id , String location , double horMargin , double verMargin , double d ) { } } | return createRectangleImage ( id , location , horMargin , verMargin , d , d ) ; |
public class DependencyResolver { /** * Creates a new DependencyResolver from a list of key - value pairs called tuples
* where key is dependency name and value the depedency locator ( descriptor ) .
* @ param tuples a list of values where odd elements are dependency name and the
* following even elements are dependency locator ( descriptor )
* @ return a newly created DependencyResolver . */
public static DependencyResolver fromTuples ( Object ... tuples ) { } } | DependencyResolver result = new DependencyResolver ( ) ; if ( tuples == null || tuples . length == 0 ) return result ; for ( int index = 0 ; index < tuples . length ; index += 2 ) { if ( index + 1 >= tuples . length ) break ; String name = StringConverter . toString ( tuples [ index ] ) ; Object locator = tuples [ index + 1 ] ; result . put ( name , locator ) ; } return result ; |
public class StringUtils { /** * Returns the string left - padded with the string pad to a length of len characters .
* If str is longer than len , the return value is shortened to len characters .
* Lpad and rpad functions are migrated from flink ' s scala function with minor refactor
* https : / / github . com / apache / flink / blob / master / flink - table / flink - table - planner / src / main / scala / org / apache / flink / table / runtime / functions / ScalarFunctions . scala
* @ param base The base string to be padded
* @ param len The length of padded string
* @ param pad The pad string
* @ return the string left - padded with pad to a length of len */
public static String lpad ( String base , Integer len , String pad ) { } } | if ( len < 0 ) { return null ; } else if ( len == 0 ) { return "" ; } char [ ] data = new char [ len ] ; // The length of the padding needed
int pos = Math . max ( len - base . length ( ) , 0 ) ; // Copy the padding
for ( int i = 0 ; i < pos ; i += pad . length ( ) ) { for ( int j = 0 ; j < pad . length ( ) && j < pos - i ; j ++ ) { data [ i + j ] = pad . charAt ( j ) ; } } // Copy the base
for ( int i = 0 ; pos + i < len && i < base . length ( ) ; i ++ ) { data [ pos + i ] = base . charAt ( i ) ; } return new String ( data ) ; |
public class ModelAdapter { /** * set a new list of model items and apply it to the existing list ( clear - add ) for this adapter
* NOTE may consider using setNewList if the items list is a reference to the list which is used inside the adapter
* @ param list the items to set
* @ param resetFilter ` true ` if the filter should get reset
* @ param adapterNotifier a ` IAdapterNotifier ` allowing to modify the notify logic for the adapter ( keep null for default )
* @ return this */
public ModelAdapter < Model , Item > set ( List < Model > list , boolean resetFilter , @ Nullable IAdapterNotifier adapterNotifier ) { } } | List < Item > items = intercept ( list ) ; return setInternal ( items , resetFilter , adapterNotifier ) ; |
public class QueryStats { /** * Marks the query as complete and logs it to the proper logs . This is called
* after the data has been sent to the client . */
public void markSent ( ) { } } | sent_to_client = true ; overall_stats . put ( QueryStat . TOTAL_TIME , DateTime . nanoTime ( ) - query_start_ns ) ; LOG . info ( "Completing query=" + JSON . serializeToString ( this ) ) ; QUERY_LOG . info ( this . toString ( ) ) ; |
public class PrimaveraPMFileReader { /** * Read details of any activity codes assigned to this task .
* @ param task parent task
* @ param codes activity code assignments */
private void readActivityCodes ( Task task , List < CodeAssignmentType > codes ) { } } | for ( CodeAssignmentType assignment : codes ) { ActivityCodeValue code = m_activityCodeMap . get ( Integer . valueOf ( assignment . getValueObjectId ( ) ) ) ; if ( code != null ) { task . addActivityCode ( code ) ; } } |
public class OjbTagsHandler { /** * Processes the template for all extents of the current class .
* @ param template The template
* @ param attributes The attributes of the tag
* @ exception XDocletException if an error occurs
* @ doc . tag type = " block " */
public void forAllExtents ( String template , Properties attributes ) throws XDocletException { } } | for ( Iterator it = _curClassDef . getExtentClasses ( ) ; it . hasNext ( ) ; ) { _curExtent = ( ClassDescriptorDef ) it . next ( ) ; generate ( template ) ; } _curExtent = null ; |
public class UserProfileHandlerImpl { /** * { @ inheritDoc } */
public UserProfile removeUserProfile ( String userName , boolean broadcast ) throws Exception { } } | Session session = service . getStorageSession ( ) ; try { return removeUserProfile ( session , userName , broadcast ) ; } finally { session . logout ( ) ; } |
public class Check { /** * Ensures that an object reference passed as a parameter to the calling method is not { @ code null } .
* @ param reference
* an object reference
* @ param name
* name of object reference ( in source code )
* @ return the non - null reference that was validated
* @ throws IllegalNullArgumentException
* if the given argument { @ code reference } is { @ code null } */
@ Throws ( IllegalNullArgumentException . class ) public static < T > T notNull ( @ Nonnull final T reference , @ Nullable final String name ) { } } | if ( reference == null ) { throw new IllegalNullArgumentException ( name ) ; } return reference ; |
public class PresentationControlImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setPRSFlg ( Integer newPRSFlg ) { } } | Integer oldPRSFlg = prsFlg ; prsFlg = newPRSFlg ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . PRESENTATION_CONTROL__PRS_FLG , oldPRSFlg , prsFlg ) ) ; |
public class CodeBuilderUtil { /** * Generates code to compare two values on the stack , and branch to the
* provided Label if they are not equal . Both values must be of the same
* type . If they are floating point values , NaN is considered equal to NaN ,
* which is inconsistent with the usual treatment for NaN .
* < P > The generated instruction consumes both values on the stack .
* @ param b { @ link CodeBuilder } to which to add the code
* @ param valueType the type of the values
* @ param testForNull if true and the values are references , they will be considered
* unequal unless neither or both are null . If false , assume neither is null .
* @ param label the label to branch to
* @ param choice when true , branch to label if values are equal , else
* branch to label if values are unequal . */
public static void addValuesEqualCall ( final CodeBuilder b , final TypeDesc valueType , final boolean testForNull , final Label label , final boolean choice ) { } } | if ( valueType . getTypeCode ( ) != TypeDesc . OBJECT_CODE ) { if ( valueType . getTypeCode ( ) == TypeDesc . FLOAT_CODE ) { // Special treatment to handle NaN .
b . invokeStatic ( TypeDesc . FLOAT . toObjectType ( ) , "compare" , TypeDesc . INT , new TypeDesc [ ] { TypeDesc . FLOAT , TypeDesc . FLOAT } ) ; b . ifZeroComparisonBranch ( label , choice ? "==" : "!=" ) ; } else if ( valueType . getTypeCode ( ) == TypeDesc . DOUBLE_CODE ) { // Special treatment to handle NaN .
b . invokeStatic ( TypeDesc . DOUBLE . toObjectType ( ) , "compare" , TypeDesc . INT , new TypeDesc [ ] { TypeDesc . DOUBLE , TypeDesc . DOUBLE } ) ; b . ifZeroComparisonBranch ( label , choice ? "==" : "!=" ) ; } else { b . ifComparisonBranch ( label , choice ? "==" : "!=" , valueType ) ; } return ; } if ( ! testForNull ) { String op = addEqualsCallTo ( b , valueType , choice ) ; b . ifZeroComparisonBranch ( label , op ) ; return ; } Label isNotNull = b . createLabel ( ) ; LocalVariable value = b . createLocalVariable ( null , valueType ) ; b . storeLocal ( value ) ; b . loadLocal ( value ) ; b . ifNullBranch ( isNotNull , false ) ; // First value popped off stack is null . Just test remaining one for null .
b . ifNullBranch ( label , choice ) ; Label cont = b . createLabel ( ) ; b . branch ( cont ) ; // First value popped off stack is not null , but second one might be .
isNotNull . setLocation ( ) ; if ( compareToType ( valueType ) == null ) { // Call equals method , but swap values so that the second value is
// an argument into the equals method .
b . loadLocal ( value ) ; b . swap ( ) ; } else { // Need to test for second argument too , since compareTo method
// cannot cope with null .
LocalVariable value2 = b . createLocalVariable ( null , valueType ) ; b . storeLocal ( value2 ) ; b . loadLocal ( value2 ) ; b . ifNullBranch ( label , ! choice ) ; // Load both values in preparation for calling compareTo method .
b . loadLocal ( value ) ; b . loadLocal ( value2 ) ; } String op = addEqualsCallTo ( b , valueType , choice ) ; b . ifZeroComparisonBranch ( label , op ) ; cont . setLocation ( ) ; |
public class SeleniumAssert { /** * Checks a selenium list of WebElements .
* @ param commong common object that contains relevant execution info
* @ param actual webElement used in assert
* @ return SeleniumAssert */
public static SeleniumAssert assertThat ( CommonG commong , List < WebElement > actual ) { } } | return new SeleniumAssert ( commong , actual ) ; |
public class SearchResult { /** * Sets the result objects .
* The objects are appended in the order that they are returned
* by the collection ' s iterator .
* @ param elements
* the result objects . */
public void setElements ( final Collection < ? extends T > elements ) { } } | clear ( ) ; if ( elements == null || elements . size ( ) == 0 ) { return ; } for ( T obj : elements ) { addElement ( obj ) ; } |
public class CFMLEngineFactory { /** * method to initialize a update of the CFML Engine . checks if there is a new Version and update it
* when a new version is available
* @ param password
* @ return has updated
* @ throws IOException
* @ throws ServletException */
public boolean update ( final Password password , final Identification id ) throws IOException , ServletException { } } | if ( ! singelton . can ( CFMLEngine . CAN_UPDATE , password ) ) throw new IOException ( "access denied to update CFMLEngine" ) ; // new RunUpdate ( this ) . start ( ) ;
return _update ( id ) ; |
public class StringUtility { /** * Splits a string into multiple words on either whitespace or commas
* @ return java . lang . String [ ]
* @ param line java . lang . String */
public static List < String > splitStringCommaSpace ( String line ) { } } | List < String > words = new ArrayList < > ( ) ; int len = line . length ( ) ; int pos = 0 ; while ( pos < len ) { // Skip past blank space
char ch ; while ( pos < len && ( ( ch = line . charAt ( pos ) ) <= ' ' || ch == ',' ) ) pos ++ ; int start = pos ; // Skip to the next blank space
while ( pos < len && ( ch = line . charAt ( pos ) ) > ' ' && ch != ',' ) pos ++ ; if ( pos > start ) words . add ( line . substring ( start , pos ) ) ; } return words ; |
public class SecurityActions { /** * Get the declared classes
* @ param c The class
* @ return The classes */
static Class < ? > [ ] getDeclaredClasses ( final Class < ? > c ) { } } | if ( System . getSecurityManager ( ) == null ) return c . getDeclaredClasses ( ) ; return AccessController . doPrivileged ( new PrivilegedAction < Class < ? > [ ] > ( ) { public Class < ? > [ ] run ( ) { return c . getDeclaredClasses ( ) ; } } ) ; |
public class CampaignSmsMessageMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CampaignSmsMessage campaignSmsMessage , ProtocolMarshaller protocolMarshaller ) { } } | if ( campaignSmsMessage == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( campaignSmsMessage . getBody ( ) , BODY_BINDING ) ; protocolMarshaller . marshall ( campaignSmsMessage . getMessageType ( ) , MESSAGETYPE_BINDING ) ; protocolMarshaller . marshall ( campaignSmsMessage . getSenderId ( ) , SENDERID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class BackgroundLruEvictionStrategy { /** * Called by the cache when it needs to discard an object from the cache . < p >
* The cache will be holding the lock on the bucket when this method is
* invoked . Enables the eviction strategy to change the " decision " on
* evicting an object with the bucket lock held ( a consistent state ) . < p >
* @ param element element that is to be evicted .
* @ return boolean to indicate whether to proceed with eviction or not . */
@ Override public boolean canBeDiscarded ( Element element ) { } } | if ( element . pinned != 0 || element . ivEvictionIneligible ) { // d465813
return false ; } if ( ContainerProperties . StrictMaxCacheSize ) { return true ; } // Very simple algorithm , if the element has been around for
// more than the discard threshold number of sweep intervals ,
// we evict it .
long sweepCount = 0 ; if ( element . accessedSweep <= ivCache . numSweeps ) sweepCount = ivCache . numSweeps - element . accessedSweep ; else sweepCount = ( Long . MAX_VALUE - element . accessedSweep ) + ivCache . numSweeps ; return sweepCount > ivDiscardThreshold ; |
public class ColumnMetadata { /** * Returns this path ' s column metadata if present . Otherwise returns default
* metadata where the column name is equal to the path ' s name . */
public static ColumnMetadata getColumnMetadata ( Path < ? > path ) { } } | Path < ? > parent = path . getMetadata ( ) . getParent ( ) ; if ( parent instanceof EntityPath ) { Object columnMetadata = ( ( EntityPath < ? > ) parent ) . getMetadata ( path ) ; if ( columnMetadata instanceof ColumnMetadata ) { return ( ColumnMetadata ) columnMetadata ; } } return ColumnMetadata . named ( path . getMetadata ( ) . getName ( ) ) ; |
public class InternalAuthentication { /** * Set default configuration
* @ param config JSON configuration
* @ throws IOException if fails to initialise */
private void setConfig ( JsonSimpleConfig config ) throws IOException { } } | // Get the basics
user_object = new InternalUser ( ) ; file_path = config . getString ( null , "authentication" , "internal" , "path" ) ; loadUsers ( ) ; |
public class CharsTrie { /** * Finds each char which continues the string from the current state .
* That is , each char c for which it would be next ( c ) ! = Result . NO _ MATCH now .
* @ param out Each next char is appended to this object .
* ( Only uses the out . append ( c ) method . )
* @ return The number of chars which continue the string from here . */
public int getNextChars ( Appendable out ) /* const */
{ } } | int pos = pos_ ; if ( pos < 0 ) { return 0 ; } if ( remainingMatchLength_ >= 0 ) { append ( out , chars_ . charAt ( pos ) ) ; // Next unit of a pending linear - match node .
return 1 ; } int node = chars_ . charAt ( pos ++ ) ; if ( node >= kMinValueLead ) { if ( ( node & kValueIsFinal ) != 0 ) { return 0 ; } else { pos = skipNodeValue ( pos , node ) ; node &= kNodeTypeMask ; } } if ( node < kMinLinearMatch ) { if ( node == 0 ) { node = chars_ . charAt ( pos ++ ) ; } getNextBranchChars ( chars_ , pos , ++ node , out ) ; return node ; } else { // First unit of the linear - match node .
append ( out , chars_ . charAt ( pos ) ) ; return 1 ; } |
public class GrowingSparseMatrix { /** * { @ inheritDoc }
* The size of the matrix will be expanded if either row or
* col is larger than the largest previously seen row or column value .
* When the matrix is expanded by either dimension , the values for the new
* row / column will all be assumed to be zero . */
public void setRow ( int row , DoubleVector data ) { } } | checkIndices ( row , data . length ( ) - 1 ) ; if ( cols <= data . length ( ) ) cols = data . length ( ) ; Vectors . copy ( updateRow ( row ) , data ) ; |
public class MercatorUtils { /** * Get lat - long bounds from tile index .
* @ param tx tile x .
* @ param ty tile y .
* @ param zoom zoomlevel .
* @ param tileSize tile size .
* @ return [ minx , miny , maxx , maxy ] */
public static double [ ] tileLatLonBounds ( int tx , int ty , int zoom , int tileSize ) { } } | double [ ] bounds = tileBounds3857 ( tx , ty , zoom , tileSize ) ; double [ ] mins = metersToLatLon ( bounds [ 0 ] , bounds [ 1 ] ) ; double [ ] maxs = metersToLatLon ( bounds [ 2 ] , bounds [ 3 ] ) ; return new double [ ] { mins [ 1 ] , maxs [ 0 ] , maxs [ 1 ] , mins [ 0 ] } ; |
public class JsonBuilder { /** * A collection and closure passed to a JSON builder will create a root JSON array applying
* the closure to each object in the collection
* Example :
* < pre > < code class = " groovyTestCase " >
* class Author {
* String name
* def authors = [ new Author ( name : " Guillaume " ) , new Author ( name : " Jochen " ) , new Author ( name : " Paul " ) ]
* def json = new groovy . json . JsonBuilder ( )
* json authors , { Author author { @ code - > }
* name author . name
* assert json . toString ( ) = = ' [ { " name " : " Guillaume " } , { " name " : " Jochen " } , { " name " : " Paul " } ] '
* < / code > < / pre >
* @ param coll a collection
* @ param c a closure used to convert the objects of coll
* @ return a list of values */
public Object call ( Iterable coll , Closure c ) { } } | List < Object > listContent = new ArrayList < Object > ( ) ; if ( coll != null ) { for ( Object it : coll ) { listContent . add ( JsonDelegate . curryDelegateAndGetContent ( c , it ) ) ; } } content = listContent ; return content ; |
public class LastModifiedDateFileComparator { /** * ( non - Javadoc )
* @ see java . util . Comparator # compare ( java . lang . Object , java . lang . Object ) */
@ Override public int compare ( File o1 , File o2 ) { } } | return - 1 * new Long ( o1 . lastModified ( ) ) . compareTo ( new Long ( o2 . lastModified ( ) ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.