signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RemoveTagsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RemoveTagsRequest removeTagsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( removeTagsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( removeTagsRequest . getARN ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( removeTagsRequest . getTagKeys ( ) , TAGKEYS_BINDING ) ; } catch ( Exception e ) { thr...
public class Ed25519FieldElement { /** * $ h = f + g $ * TODO - CR BR : $ h $ is allocated via new , probably not a good idea . Do we need the copying into * temp variables if we do that ? * Preconditions : * < / p > < ul > * < li > $ | f | $ bounded by $ 1.1*2 ^ { 25 } , 1.1*2 ^ { 24 } , 1.1*2 ^ { 25 } , 1.1...
int [ ] g = ( ( org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . ed25519 . Ed25519FieldElement ) val ) . t ; int [ ] h = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { h [ i ] = t [ i ] + g [ i ] ; } return new org . mariadb . jdbc . internal . com . send . authentication . ed25519...
public class Response { /** * Renders a template and writes the output directly to the response . * < p > This method commits the response . < / p > * @ param templateName * @ param model */ public void render ( String templateName , Map < String , Object > model ) { } }
send ( renderToString ( templateName , model ) ) ;
public class IPv6Address { /** * Whether the address is IPv4 - compatible * @ see java . net . Inet6Address # isIPv4CompatibleAddress ( ) */ public boolean isIPv4Compatible ( ) { } }
return getSegment ( 0 ) . isZero ( ) && getSegment ( 1 ) . isZero ( ) && getSegment ( 2 ) . isZero ( ) && getSegment ( 3 ) . isZero ( ) && getSegment ( 4 ) . isZero ( ) && getSegment ( 5 ) . isZero ( ) ;
public class DefinitelyDerefedParamsDriver { /** * Accounts the bytecode size of analyzed method for statistics . * @ param mtd Analyzed method . */ private static void accountCodeBytes ( IMethod mtd ) { } }
// Get method bytecode size if ( mtd instanceof ShrikeCTMethod ) { analyzedBytes += ( ( ShrikeCTMethod ) mtd ) . getBytecodes ( ) . length ; }
public class TableContainer { /** * Retrieve the correct index for the supplied Table instance . * @ param table Table instance * @ return index */ private Map < String , Table > getIndex ( Table table ) { } }
Map < String , Table > result ; if ( ! table . getResourceFlag ( ) ) { result = m_taskTablesByName ; } else { result = m_resourceTablesByName ; } return result ;
public class DnsBatch { /** * Adds a request representing the " get zone " operation to this batch . The { @ code options } can be * used to restrict the fields returned in the same way as for { @ link Dns # getZone ( String , * Dns . ZoneOption . . . ) } . Calling { @ link DnsBatchResult # get ( ) } on the return ...
DnsBatchResult < Zone > result = new DnsBatchResult < > ( ) ; RpcBatch . Callback < ManagedZone > callback = createZoneCallback ( this . options , result , true , true ) ; Map < DnsRpc . Option , ? > optionMap = DnsImpl . optionMap ( options ) ; batch . addGetZone ( zoneName , callback , optionMap ) ; return result ;
public class FileBitReaderFactory { /** * Opens a reader over the bits of the file . The characteristics of the * returned reader are determined by the { @ link Mode } in which the factory * was created . * Any reader returned by this method SHOULD eventually be closed by passing * it to the { @ link # closeRea...
try { switch ( mode ) { case MEMORY : return new ByteArrayBitReader ( getBytes ( ) ) ; case STREAM : return new InputStreamBitReader ( new BufferedInputStream ( new FileInputStream ( file ) , bufferSize ) ) ; case CHANNEL : return new FileChannelBitReader ( new RandomAccessFile ( file , "r" ) . getChannel ( ) , ByteBuf...
public class HttpHandlerImpl { /** * TODO extract to an independent Filter */ private final boolean filteringResources ( Response response , final String path ) throws IOException { } }
String translated = translateResource ( path ) ; if ( translated != null ) { // Setting default headers for static files // One week - Google recommendation // https : / / developers . google . com / speed / docs / insights / LeverageBrowserCaching response . header ( HttpHeaders . CACHE_CONTROL , "public, max-age=6048...
public class Delay { /** * Creates a new { @ link ExponentialDelay } on a base different from powers of two , with custom boundaries and factor * ( eg . with upper 9000 , lower 0 , growBy 3 , powerOf 10 : 3 , 30 , 300 , 3000 , 9000 , 9000 , 9000 , . . . ) . * @ param unit the unit of the delay . * @ param upper t...
return new ExponentialDelay ( unit , upper , lower , growBy , powersOf ) ;
public class MaybeLens { /** * Given a lens with < code > S < / code > lifted into { @ link Maybe } , flatten < code > S < / code > back down . * @ param lens the lens * @ param < S > the type of the " larger " value for reading * @ param < T > the type of the " larger " value for putting * @ param < A > the ty...
return lens . mapS ( Maybe :: just ) ;
public class CmsJspVfsAccessBean { /** * Returns a map that lazily reads all resource properties from the OpenCms VFS , with search and provides locale specific access to them . < p > * Usage example on a JSP with the EL : < pre > * Title property of the " / index . html " resource ( searched ) : $ { cms : vfs ( pa...
if ( m_propertiesSearchLocale == null ) { // create lazy map only on demand m_propertiesSearchLocale = CmsCollectionsGenericWrapper . createLazyMap ( new CmsResourceLocalePropertyLoaderTransformer ( true ) ) ; } return m_propertiesSearchLocale ;
public class Parsers { /** * A { @ link Parser } that runs every element of { @ code parsers } and selects the longest match . * If two matches have the same length , the first one is favored . */ public static < T > Parser < T > longest ( Parser < ? extends T > ... parsers ) { } }
if ( parsers . length == 0 ) return never ( ) ; if ( parsers . length == 1 ) return parsers [ 0 ] . cast ( ) ; return new BestParser < T > ( parsers , IntOrder . GT ) ;
public class RunTime { /** * Create a detail record and add it as a child . < br > * 创建一条详细记录并加为下级 。 * @ param descriptionAny text that describes the detailed RunTime . * @ returnThe detailed RunTime created . */ public RunTime addDetail ( String description ) { } }
RunTime child = new RunTime ( description ) ; detail . put ( description , child ) ; return child ;
public class CalcBalanceHandler { /** * Set the field that owns this listener . * @ owner The field that this listener is being added to ( if null , this listener is being removed ) . */ public void setOwner ( ListenerOwner owner ) { } }
super . setOwner ( owner ) ; if ( owner != null ) { if ( m_fldValue1 != null ) if ( m_fldValue1 . getRecord ( ) != this . getOwner ( ) . getRecord ( ) ) m_fldValue1 . addListener ( new FieldRemoveBOnCloseHandler ( this ) ) ; // Not same file , if target file closes , remove this listener ! if ( m_fldValue2 != null ) if...
public class Neo4JClient { /** * Deletes an entity from database . * @ param entity * the entity * @ param key * the key */ @ Override public void delete ( Object entity , Object key ) { } }
// All Modifying Neo4J operations must be executed within a transaction checkActiveTransaction ( ) ; GraphDatabaseService graphDb = getConnection ( ) ; // Find Node for this particular entity EntityMetadata m = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entity . getClass ( ) ) ; Node node = mapper ....
public class LocPathIterator { /** * Evaluate this operation directly to a boolean . * @ param xctxt The runtime execution context . * @ return The result of the operation as a boolean . * @ throws javax . xml . transform . TransformerException */ public boolean bool ( XPathContext xctxt ) throws javax . xml . tr...
return ( asNode ( xctxt ) != DTM . NULL ) ;
public class MessageDispatcher { /** * Sends a unicast message and - depending on the options - returns a result * @ param dest the target to which to send the unicast message . Must not be null . * @ param data the payload to send * @ param opts the options to be used * @ return T the result . Null if the call...
if ( dest == null ) throw new IllegalArgumentException ( "message destination is null, cannot send message" ) ; if ( opts == null ) { log . warn ( "request options were null, using default of sync" ) ; opts = RequestOptions . SYNC ( ) ; } // invoke an async RPC directly and return null , without creating a UnicastReque...
public class DFSAdmin { /** * Command to request current distributed upgrade status , * a detailed status , or to force the upgrade to proceed . * Usage : java DFSAdmin - upgradeProgress [ status | details | force ] * @ exception IOException */ public int upgradeProgress ( String [ ] argv , int idx ) throws IOExc...
DistributedFileSystem dfs = getDFS ( ) ; if ( dfs == null ) { System . out . println ( "FileSystem is " + getFS ( ) . getUri ( ) ) ; return - 1 ; } if ( idx != argv . length - 1 ) { printUsage ( "-upgradeProgress" ) ; return - 1 ; } UpgradeAction action ; if ( "status" . equalsIgnoreCase ( argv [ idx ] ) ) { action = U...
public class LongFormType { /** * deprecated / / / / / */ public Object convertFormValueToModelValue ( Object propertyValue ) { } }
if ( propertyValue == null || "" . equals ( propertyValue ) ) { return null ; } return new Long ( propertyValue . toString ( ) ) ;
public class Page { /** * Returns all elements with the given attribute name as { @ link HtmlElement } instances . * @ param attributeName name of the attribute to filter by * @ return all elements with the given attribute name as { @ link HtmlElement } instances */ @ SuppressWarnings ( "unchecked" ) public List < ...
return ( List < HtmlElement > ) htmlPage . getByXPath ( "//*[@" + attributeName + "]" ) ;
public class QueryImpl { /** * find data using lucene . * @ param m * the m * @ param client * the client * @ param primaryKeys * the primary keys * @ return the list */ private List < Object > findUsingLucene ( EntityMetadata m , Client client , Object [ ] primaryKeys ) { } }
String idField = m . getIdAttribute ( ) . getName ( ) ; String equals = "=" ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( m . getEntityClazz ( ) ) ; String columnName = ( ( AbstractA...
public class DomXmlMessageValidator { /** * Perform validation on namespace qualified attribute values if present . This includes the validation of namespace presence * and equality . * @ param receivedElement * @ param receivedAttribute * @ param sourceElement * @ param sourceAttribute */ private void doName...
String receivedValue = receivedAttribute . getNodeValue ( ) ; String sourceValue = sourceAttribute . getNodeValue ( ) ; if ( receivedValue . contains ( ":" ) && sourceValue . contains ( ":" ) ) { // value has namespace prefix set , do special QName validation String receivedPrefix = receivedValue . substring ( 0 , rece...
public class ASTUtil { /** * Returns the < CODE > FieldDeclaration < / CODE > for the specified field name . * The field has to be declared in the specified * < CODE > TypeDeclaration < / CODE > . * @ param type * The < CODE > TypeDeclaration < / CODE > , where the * < CODE > FieldDeclaration < / CODE > is de...
requireNonNull ( type , "type declaration" ) ; requireNonNull ( fieldName , "field name" ) ; for ( FieldDeclaration field : type . getFields ( ) ) { for ( Object fragObj : field . fragments ( ) ) { VariableDeclarationFragment fragment = ( VariableDeclarationFragment ) fragObj ; if ( fieldName . equals ( fragment . getN...
public class Neo4JGraph { /** * { @ inheritDoc } */ @ Override public < C extends GraphComputer > C compute ( Class < C > implementation ) throws IllegalArgumentException { } }
throw Graph . Exceptions . graphComputerNotSupported ( ) ;
public class SimpleDocTreeVisitor { /** * Invokes the appropriate visit method on each of a sequence of nodes . * @ param nodes the nodes on which to dispatch * @ param p a parameter value to be passed to each appropriate visit method * @ return the value return from the last of the visit methods , or null * if...
R r = null ; if ( nodes != null ) { for ( DocTree node : nodes ) r = visit ( node , p ) ; } return r ;
public class Level { /** * Retrieves an existing Level or creates on if it didn ' t previously exist . * @ param name The name of the level . * @ param intValue The integer value for the Level . If the level was previously created this value is ignored . * @ return The Level . * @ throws java . lang . IllegalAr...
final Level level = LEVELS . get ( name ) ; if ( level != null ) { return level ; } try { return new Level ( name , intValue ) ; } catch ( final IllegalStateException ex ) { // The level was added by something else so just return that one . return LEVELS . get ( name ) ; }
public class Solo { /** * Sets the date in the specified DatePicker . * @ param datePicker the { @ link DatePicker } object * @ param year the year e . g . 2011 * @ param monthOfYear the month which starts from zero e . g . 03 for April * @ param dayOfMonth the day e . g . 10 */ public void setDatePicker ( Date...
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setDatePicker(" + datePicker + ", " + year + ", " + monthOfYear + ", " + dayOfMonth + ")" ) ; } datePicker = ( DatePicker ) waiter . waitForView ( datePicker , Timeout . getSmallTimeout ( ) ) ; setter . setDatePicker ( datePicker , year , monthOfY...
public class ISPNLockTableHandler { /** * { @ inheritDoc } */ public InspectionQuery getDeleteQuery ( String nodeId ) throws SQLException { } }
return new InspectionQuery ( "DELETE FROM " + getTableName ( ) + " WHERE " + getIdColumn ( ) + "='" + nodeId + "'" , new String [ ] { } , "" , new DummyRepair ( ) ) ;
public class LinkHelper { /** * Prefix the passed href with the absolute server + context path in case the * passed href has no protocol yet . * @ param aRequestScope * The request web scope to be used . Required for cookie - less handling . * May not be < code > null < / code > . * @ param sHRef * The href...
ValueEnforcer . notNull ( aRequestScope , "RequestScope" ) ; ValueEnforcer . notNull ( sHRef , "HRef" ) ; // If known protocol , keep it if ( hasKnownProtocol ( sHRef ) ) return sHRef ; final String sContextPath = aRequestScope . getContextPath ( ) ; final String sURI = aRequestScope . getFullServerPath ( ) + _getURIWi...
public class AbstractResultSet { /** * { @ inheritDoc } */ public < T extends Object > T getObject ( final String columnLabel , final Class < T > clazz ) throws SQLException { } }
throw new RuntimeException ( "Not implemented" ) ;
public class ClassGenerator { /** * Invoke a super . method ( ) style superclass method on an object instance . * This is not a normal function of the Java reflection API and is * provided by generated class accessor methods . */ public Object invokeSuperclassMethod ( BshClassManager bcm , Object instance , String ...
// Delegate to the static method return invokeSuperclassMethodImpl ( bcm , instance , methodName , args ) ;
public class CacheableAnnotationDefinitionServiceImpl { /** * Reads the first line after the annotation header as a regular expression * for the annotation definition . * @ param annotationCacheCopy * { @ link File } , the annotation cache copy to parse * @ param characterOffset * < tt > long < / tt > , the c...
BufferedReader reader = null ; try { reader = new BufferedReader ( new FileReader ( annotationCacheCopy ) ) ; reader . skip ( characterOffset ) ; return reader . readLine ( ) ; } finally { if ( reader != null ) { try { reader . close ( ) ; } catch ( Exception e ) { } } }
public class OpenSSLKey { /** * Converts to PEM encoding . * Assumes keyData is initialized . */ private String toPEM ( ) { } }
byte [ ] data = ( this . keyData == null ) ? this . encodedKey : Base64 . encode ( this . keyData ) ; String header = HEADER ; if ( isEncrypted ( ) ) { StringBuffer buf = new StringBuffer ( header ) ; buf . append ( PEMUtil . LINE_SEP ) ; buf . append ( "Proc-Type: 4,ENCRYPTED" ) ; buf . append ( PEMUtil . LINE_SEP ) ;...
public class ArcBuilder { /** * Builds the path for a closed arc , returning a PolygonOptions that can be * further customised before use . * @ param center * @ param start * @ param end * @ param arcType Pass in either ArcType . CHORD or ArcType . ROUND * @ return PolygonOptions with the paths element popu...
MVCArray res = buildArcPoints ( center , start , end ) ; if ( ArcType . ROUND . equals ( arcType ) ) { res . push ( center ) ; } return new PolygonOptions ( ) . paths ( res ) ;
public class TableRow { /** * Set the merging of multiple cells to one cell . * @ param colIndex The column , 0 is the first column * @ param rowMerge the number of rows to merge * @ param columnMerge the number of cells to merge * @ throws IOException if the cells can ' t be merged */ public void setCellMerge ...
if ( rowMerge <= 0 || columnMerge <= 0 ) return ; if ( rowMerge <= 1 && columnMerge <= 1 ) return ; this . parent . setCellMerge ( this . rowIndex , colIndex , rowMerge , columnMerge ) ;
public class RESTVOMSResponse { /** * ( non - Javadoc ) * @ see org . glite . voms . contact . VOMSResponseIF # getAC ( ) */ public byte [ ] getAC ( ) { } }
Element acElement = ( Element ) xmlResponse . getElementsByTagName ( "ac" ) . item ( 0 ) ; if ( acElement == null || ! acElement . hasChildNodes ( ) ) return null ; String acString = acElement . getFirstChild ( ) . getNodeValue ( ) ; ACDecodingStrategy acDecodingStrategy = new GoodACDecodingStrategy ( ) ; byte [ ] deco...
public class RemoteRefPolling { /** * return a future which is completed upon connection close * @ param reg * @ return future completed upon termination of scheduling ( disconnect ) */ public IPromise scheduleSendLoop ( ConnectionRegistry reg ) { } }
Promise promise = new Promise ( ) ; sendJobs . add ( new ScheduleEntry ( reg , promise ) ) ; synchronized ( this ) { if ( ! loopStarted ) { loopStarted = true ; Actor . current ( ) . execute ( this ) ; } } return promise ;
public class VirtualNetworkGatewaysInner { /** * Updates a virtual network gateway tags . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkGatewayName The name of the virtual network gateway . * @ param tags Resource tags . * @ throws IllegalArgumentException thrown if parame...
return beginUpdateTagsWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName , tags ) . map ( new Func1 < ServiceResponse < VirtualNetworkGatewayInner > , VirtualNetworkGatewayInner > ( ) { @ Override public VirtualNetworkGatewayInner call ( ServiceResponse < VirtualNetworkGatewayInner > response ) { ...
public class TilesExtractor { /** * Check if tile has already been extracted regarding the current tile on level rip . * @ param level The level rip reference . * @ param x The current level rip horizontal location . * @ param y The current level rip vertical location . * @ param tiles The current extracted til...
final int tw = level . getTileWidth ( ) ; final int th = level . getTileHeight ( ) ; final ImageBuffer surface = level . getSurface ( ) ; for ( final ImageBuffer tile : tiles ) { if ( compareTile ( tw , th , surface , x , y , tile , 0 , 0 ) ) { return true ; } } return false ;
public class ComputerVisionImpl { /** * This operation returns the list of domain - specific models that are supported by the Computer Vision API . Currently , the API only supports one domain - specific model : a celebrity recognizer . A successful response will be returned in JSON . If the request failed , the respon...
return ServiceFuture . fromResponse ( listModelsWithServiceResponseAsync ( ) , serviceCallback ) ;
public class VirtualNetworkGatewaysInner { /** * Creates or updates a virtual network gateway in the specified resource group . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkGatewayName The name of the virtual network gateway . * @ param parameters Parameters supplied to cre...
return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName , parameters ) , serviceCallback ) ;
public class HashAlgorithmOptionsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( HashAlgorithmOptions hashAlgorithmOptions , ProtocolMarshaller protocolMarshaller ) { } }
if ( hashAlgorithmOptions == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hashAlgorithmOptions . getAllowedValues ( ) , ALLOWEDVALUES_BINDING ) ; protocolMarshaller . marshall ( hashAlgorithmOptions . getDefaultValue ( ) , DEFAULTVALUE_BI...
public class Equation { /** * Parse a macro defintion . * " macro NAME ( var0 , var1 ) = 5 + var0 + var1' */ private void parseMacro ( TokenList tokens , Sequence sequence ) { } }
Macro macro = new Macro ( ) ; TokenList . Token t = tokens . getFirst ( ) . next ; if ( t . word == null ) { throw new ParseError ( "Expected the macro's name after " + tokens . getFirst ( ) . word ) ; } List < TokenList . Token > variableTokens = new ArrayList < TokenList . Token > ( ) ; macro . name = t . word ; t = ...
public class Billings { /** * Generate Billing Reports for a Specific Buyer ' s Team * @ param buyerTeamReference Buyer team reference * @ param params Parameters * @ throwsJSONException If error occurred * @ return { @ link JSONObject } */ public JSONObject getByBuyersTeam ( String buyerTeamReference , HashMap...
return oClient . get ( "/finreports/v2/buyer_teams/" + buyerTeamReference + "/billings" , params ) ;
public class SVGAndroidRenderer { /** * Renderers for each element type */ private void render ( SVG . Svg obj ) { } }
// < svg > elements establish a new viewport . Box viewPort = makeViewPort ( obj . x , obj . y , obj . width , obj . height ) ; render ( obj , viewPort , obj . viewBox , obj . preserveAspectRatio ) ;
public class FedoraSessionImpl { /** * Add session data * @ param key the data key * @ param value the data value * Note : while the FedoraSession interface permits multi - valued * session data , this implementation constrains that to be single - valued . * That is , calling obj . addSessionData ( " key " , ...
sessionData . put ( key , value ) ;
public class SoLoader { /** * Load a shared library , initializing any JNI binding it contains . * @ param shortName Name of library to find , without " lib " prefix or " . so " suffix * @ param loadFlags Control flags for the loading behavior . See available flags under { @ link * SoSource } ( LOAD _ FLAG _ XXX ...
sSoSourcesLock . readLock ( ) . lock ( ) ; try { if ( sSoSources == null ) { // This should never happen during normal operation , // but if we ' re running in a non - Android environment , // fall back to System . loadLibrary . if ( "http://www.android.com/" . equals ( System . getProperty ( "java.vendor.url" ) ) ) { ...
public class CPInstanceLocalServiceBaseImpl { /** * Returns a range of cp instances matching the UUID and company . * @ param uuid the UUID of the cp instances * @ param companyId the primary key of the company * @ param start the lower bound of the range of cp instances * @ param end the upper bound of the ran...
return cpInstancePersistence . findByUuid_C ( uuid , companyId , start , end , orderByComparator ) ;
public class CreateRelationalDatabaseFromSnapshotRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateRelationalDatabaseFromSnapshotRequest createRelationalDatabaseFromSnapshotRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createRelationalDatabaseFromSnapshotRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createRelationalDatabaseFromSnapshotRequest . getRelationalDatabaseName ( ) , RELATIONALDATABASENAME_BINDING ) ; protocolMarshaller . marshal...
public class PreprocessorSymbolTable { /** * Adds a synthetic reference for a ' string ' node representing a reference name . * < p > This does some work to set the source info for the reference as well . */ void addStringNode ( Node n , AbstractCompiler compiler ) { } }
String name = n . getString ( ) ; Node syntheticRef = NodeUtil . newQName ( compiler , name , n /* real source offsets will be filled in below */ , name ) ; // Offsets to add to source . Named for documentation purposes . final int forQuote = 1 ; final int forDot = 1 ; Node current = null ; for ( current = syntheticRef...
public class InjectAdapterProcessor { /** * Write a companion class for { @ code type } that extends { @ link StaticInjection } . */ private void generateStaticInjection ( TypeElement type , List < Element > fields ) throws IOException { } }
ClassName typeName = ClassName . get ( type ) ; ClassName adapterClassName = adapterName ( ClassName . get ( type ) , STATIC_INJECTION_SUFFIX ) ; TypeSpec . Builder result = TypeSpec . classBuilder ( adapterClassName . simpleName ( ) ) . addOriginatingElement ( type ) . addJavadoc ( AdapterJavadocs . STATIC_INJECTION_T...
public class PDF417Writer { /** * Takes and rotates the it 90 degrees */ private static byte [ ] [ ] rotateArray ( byte [ ] [ ] bitarray ) { } }
byte [ ] [ ] temp = new byte [ bitarray [ 0 ] . length ] [ bitarray . length ] ; for ( int ii = 0 ; ii < bitarray . length ; ii ++ ) { // This makes the direction consistent on screen when rotating the // screen ; int inverseii = bitarray . length - ii - 1 ; for ( int jj = 0 ; jj < bitarray [ 0 ] . length ; jj ++ ) { t...
public class RelationColumn { /** * { @ inheritDoc } */ @ Override protected int readData ( byte [ ] buffer , int offset ) { } }
StringsWithLengthBlock data = new StringsWithLengthBlock ( ) . read ( buffer , offset , true ) ; m_data = data . getData ( ) ; offset = data . getOffset ( ) ; return offset ;
public class AsyncTwitterImpl { /** * / * Places & Geo Resources */ @ Override public void getGeoDetails ( final String id ) { } }
getDispatcher ( ) . invokeLater ( new AsyncTask ( GEO_DETAILS , listeners ) { @ Override public void invoke ( List < TwitterListener > listeners ) throws TwitterException { Place place = twitter . getGeoDetails ( id ) ; for ( TwitterListener listener : listeners ) { try { listener . gotGeoDetails ( place ) ; } catch ( ...
public class CommonsOJBLockManager { /** * Creates { @ link org . apache . commons . transaction . locking . GenericLock } based * { @ link org . apache . commons . transaction . locking . MultiLevelLock2 } instances * dependend on the specified isolation identity object . */ public OJBLock createIsolationLevel ( O...
OJBLock result = null ; switch ( ( ( Integer ) isolationId ) . intValue ( ) ) { case LockManager . IL_READ_UNCOMMITTED : result = new ReadUncommittedLock ( resourceId , logger ) ; break ; case LockManager . IL_READ_COMMITTED : result = new ReadCommitedLock ( resourceId , logger ) ; break ; case LockManager . IL_REPEATA...
public class MultiChoiceListPreference { /** * Loads and returns the currently persisted set , which belongs to the preference ' s key , from * the shared preferences . * @ param defaultValue * The default value , which should be returned , if no set with the preference ' s key is * currently persisted , as an ...
if ( ! shouldPersist ( ) ) { return defaultValue ; } return getPreferenceManager ( ) . getSharedPreferences ( ) . getStringSet ( getKey ( ) , defaultValue ) ;
public class UnionPayApi { /** * APP缴费 * @ param reqData * 请求参数 * @ return Map < String , String > */ public static Map < String , String > jfAppTransByMap ( Map < String , String > reqData ) { } }
return SDKUtil . convertResultStringToMap ( jfAppTrans ( reqData ) ) ;
public class Main { /** * Input Properties * @ param classname belong to which java class * @ param in BufferedReader * @ param supportRequired need input required property * @ return List < ConfigPropType > list of properties * @ throws IOException ioException */ private static List < ConfigPropType > inputP...
List < ConfigPropType > props = new ArrayList < > ( ) ; Set < String > propsNamesSet = new HashSet < > ( ) ; while ( true ) { System . out . println ( rb . getString ( classname + ".config.properties" ) + " " + rb . getString ( "confirm.quit" ) + ": " ) ; String name ; do { System . out . print ( " " + rb . getStrin...
public class AbstractJSBlock { /** * Insert a < code > delete aExpr ; < / code > statement * @ param aExpr * the expression to be deleted . May not be < code > null < / code > . * @ return this */ @ Nonnull public IMPLTYPE delete ( @ Nonnull final IJSExpression aExpr ) { } }
addStatement ( new JSDelete ( aExpr ) ) ; return thisAsT ( ) ;
public class JKFormatUtil { /** * Format number . * @ param count the count * @ return the string */ public static String formatNumber ( Number count ) { } }
Format numberFormatter = getNumberFormatter ( DEFAULT_NUMBER_FORMAT ) ; return numberFormatter . format ( count ) ;
public class FileResourceBundle { /** * Strips the . jar off of jar file paths . */ protected static String stripSuffix ( String path ) { } }
if ( path . endsWith ( ".jar" ) ) { return path . substring ( 0 , path . length ( ) - 4 ) ; } else { // we have to change the path somehow return path + "-cache" ; }
public class VecUtils { /** * Create a new { @ link Vec } of string values from a UUID { @ link Vec } . * String { @ link Vec } is the standard hexadecimal representations of a UUID . * @ param src a UUID { @ link Vec } * @ return a string { @ link Vec } */ public static Vec UUIDToStringVec ( Vec src ) { } }
if ( ! src . isUUID ( ) ) throw new H2OIllegalArgumentException ( "UUIDToStringVec() conversion only works on UUID columns" ) ; Vec res = new MRTask ( ) { @ Override public void map ( Chunk chk , NewChunk newChk ) { if ( chk instanceof C0DChunk ) { // all NAs for ( int i = 0 ; i < chk . _len ; i ++ ) newChk . addNA ( )...
public class UpdateProducts { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param productId the ID of the product to update . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the ...
// Get the ProductService . ProductServiceInterface productService = adManagerServices . get ( session , ProductServiceInterface . class ) ; // Create a statement to only select a single product by ID . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "id = :id" ) . orderBy ( "id ASC" ) . limit ( ...
public class TraitComposer { /** * Creates a method to dispatch to " super traits " in a " stackable " fashion . The generated method looks like this : * < code > ReturnType trait $ super $ method ( Class clazz , Arg1 arg1 , Arg2 arg2 , . . . ) { * if ( SomeTrait . is ( A ) { return SomeOtherTrait $ Trait $ Helper ...
Parameter [ ] parameters = forwarderMethod . getParameters ( ) ; Parameter [ ] superForwarderParams = new Parameter [ parameters . length ] ; for ( int i = 0 ; i < parameters . length ; i ++ ) { Parameter parameter = parameters [ i ] ; ClassNode originType = parameter . getOriginType ( ) ; superForwarderParams [ i ] = ...
public class DataForm { /** * Adds a new field as part of the form . * @ param field the field to add to the form . */ public void addField ( FormField field ) { } }
String fieldVariableName = field . getVariable ( ) ; // Form field values must be unique unless they are of type ' fixed ' , in // which case their variable name may be ' null ' , and therefore could // appear multiple times within the same form . if ( fieldVariableName != null && hasField ( fieldVariableName ) ) { thr...
public class FileOutputCommitter { /** * Delete the work directory */ @ Override public void abortTask ( TaskAttemptContext context ) throws IOException { } }
try { if ( workPath != null ) { context . progress ( ) ; if ( ! outputFileSystem . delete ( workPath , true ) ) { LOG . warn ( "Deleting output in " + workPath + " returns false" ) ; } } } catch ( IOException ie ) { LOG . warn ( "Error discarding output in " + workPath , ie ) ; throw ie ; }
public class DocEnv { /** * Look up PackageDoc by qualified name . */ public PackageDocImpl lookupPackage ( String name ) { } }
// # # # Jing alleges that class check is needed // # # # to avoid a compiler bug . Most likely // # # # instead a dummy created for error recovery . // # # # Should investigate this . PackageSymbol p = syms . packages . get ( names . fromString ( name ) ) ; ClassSymbol c = getClassSymbol ( name ) ; if ( p != null && c...
public class JDBC4Statement { /** * Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet objects genrated by this Statement . */ @ Override public void setFetchSize ( int rows ) throws SQLException { } }
checkClosed ( ) ; if ( rows < 0 ) { throw SQLError . get ( SQLError . ILLEGAL_ARGUMENT , rows ) ; } this . fetchSize = rows ;
public class UrlUtilities { /** * Build a request URL . * @ param host * The host * @ param port * The port * @ param path * The path * @ param parameters * The parameters * @ return The URL * @ throws MalformedURLException * @ deprecated use { @ link # buildSecureUrl ( java . lang . String , int ...
return buildUrl ( "http" , port , path , parameters ) ;
public class Classfile { /** * Extend scanning to a superclass , interface or annotation . * @ param className * the class name * @ param relationship * the relationship type */ private void scheduleScanningIfExternalClass ( final String className , final String relationship ) { } }
// Don ' t scan Object if ( className != null && ! className . equals ( "java.lang.Object" ) // Only schedule each external class once for scanning , across all threads && classNamesScheduledForScanning . add ( className ) ) { // Search for the named class ' classfile among classpath elements , in classpath order ( thi...
public class OkRequest { /** * Write part of a multipart request to the request body * @ param name * @ param filename * @ param part * @ return this request */ public OkRequest < T > part ( final String name , final String filename , final File part ) throws IOException { } }
return part ( name , filename , null , part ) ;
public class MaterialProgressBar { /** * compatibility . */ @ SuppressLint ( "NewApi" ) private void applyTintForDrawable ( @ NonNull Drawable drawable , @ Nullable ColorStateList tint , boolean hasTint , @ Nullable PorterDuff . Mode tintMode , boolean hasTintMode ) { } }
if ( hasTint || hasTintMode ) { if ( hasTint ) { if ( drawable instanceof TintableDrawable ) { // noinspection RedundantCast ( ( TintableDrawable ) drawable ) . setTintList ( tint ) ; } else { logDrawableTintWarning ( ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { drawable . setTintList ( ti...
public class DevLockManager { String getLockerStatus ( final DeviceProxy deviceProxy ) throws DevFailed { } }
final LockerInfo info = getLockerInfo ( deviceProxy ) ; return info . getStatus ( ) ;
public class DeprecatedAPIListBuilder { /** * Build the sorted list of all the deprecated APIs in this run . * Build separate lists for deprecated packages , classes , constructors , * methods and fields . * @ param configuration the current configuration of the doclet . */ private void buildDeprecatedAPIInfo ( C...
PackageDoc [ ] packages = configuration . packages ; PackageDoc pkg ; for ( int c = 0 ; c < packages . length ; c ++ ) { pkg = packages [ c ] ; if ( Util . isDeprecated ( pkg ) ) { getList ( PACKAGE ) . add ( pkg ) ; } } ClassDoc [ ] classes = configuration . root . classes ( ) ; for ( int i = 0 ; i < classes . length ...
public class GuacamoleSession { /** * Closes all associated tunnels and prevents any further use of this * session . */ public void invalidate ( ) { } }
// Close all associated tunnels , if possible for ( GuacamoleTunnel tunnel : tunnels . values ( ) ) { try { tunnel . close ( ) ; } catch ( GuacamoleException e ) { logger . debug ( "Unable to close tunnel." , e ) ; } } // Invalidate all user contextx for ( UserContext userContext : userContexts ) userContext . invalida...
public class DateUtils { /** * Returns a Java representation of a { @ code date } string . * @ param date * Date in string format . * @ return Java date representation of the given { @ code date } string or { @ code null } if { @ code date } is { @ code null } * or invalid . */ private static Date toDateWithFor...
if ( date == null ) { return null ; } try { return strategy . formatFor ( format ) . parse ( date ) ; } catch ( ParseException e ) { UTILS_LOGGER . trace ( "Unable to parse date '{}' using format string '{}': {}" , date , format , e ) ; return null ; }
public class ServerParams { /** * Get the parameters loaded for the given module name , if any . The result will be * null if the module name is unknown or no parameters have been loaded . Otherwise , * the object returned is a Map < String , Object > . * @ param moduleName Name of module to get parameters for . ...
return ( Map < String , Object > ) m_params . get ( moduleName ) ;
public class AuthResult { /** * Contains any missing context values found while evaluating policy . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setMissingContextValues ( java . util . Collection ) } or { @ link # withMissingContextValues ( java . util . C...
if ( this . missingContextValues == null ) { setMissingContextValues ( new java . util . ArrayList < String > ( missingContextValues . length ) ) ; } for ( String ele : missingContextValues ) { this . missingContextValues . add ( ele ) ; } return this ;
public class ULocale { /** * < strong > [ icu ] < / strong > Returns a locale ' s script localized for display in the provided locale . * @ param localeID the id of the locale whose script will be displayed . * @ param displayLocale the locale in which to display the name . * @ return the localized script name . ...
return getDisplayScriptInContextInternal ( new ULocale ( localeID ) , displayLocale ) ;
public class EmbeddedServerFactory { /** * Create an embedded host controller with an already established module loader . * @ param moduleLoader the module loader . Cannot be { @ code null } * @ param jbossHomeDir the location of the root of server installation . Cannot be { @ code null } or empty . * @ param cmd...
EmbeddedManagedProcess emp = EmbeddedProcessFactory . createHostController ( moduleLoader , jbossHomeDir , cmdargs ) ; return new EmbeddedServerReference ( emp , true ) ;
public class JsonPathHelper { /** * Evaluates a JsonPath expression returning a multiple elements . * @ param json JSON value . * @ param jsonPath expression to evaluate . * @ return result results of expression . * @ throws java . lang . RuntimeException if jsonPath would return a single element . */ public Li...
List < Object > result ; if ( JsonPath . isPathDefinite ( jsonPath ) ) { Object val = getJsonPath ( json , jsonPath ) ; if ( val == null ) { result = Collections . emptyList ( ) ; } else { result = Collections . singletonList ( val ) ; } } else { result = parseJson ( json ) . read ( jsonPath ) ; } return result ;
public class BeforeAudioRendition { /** * Transform tills , mordants , grupetto , arpeggio , staccato * into multiple notes ( and rests ) . * e . g . + trill + C2 will be transformed into DCDC * @ return the Music object which contents has been changed */ public static Music transformDecorations ( Music music ) {...
Music ret = new Music ( ) ; KeySignature tuneKey = null ; KeySignature currentKey = null ; Hashtable partsKey = new Hashtable ( ) ; MusicElement element ; for ( Object o : music . getFirstVoice ( ) ) { element = ( MusicElement ) o ; } return music ;
public class JGTProcessingRegion { /** * Transforms degree string into the decimal value . * @ param value the string in degrees . * @ return the translated value . */ private double degreeToNumber ( String value ) { } }
double number = - 1 ; String [ ] valueSplit = value . trim ( ) . split ( ":" ) ; // $ NON - NLS - 1 $ if ( valueSplit . length == 3 ) { // deg : min : sec . ss double deg = Double . parseDouble ( valueSplit [ 0 ] ) ; double min = Double . parseDouble ( valueSplit [ 1 ] ) ; double sec = Double . parseDouble ( valueSplit...
public class HoconFactory { /** * / * Overridden parser factory methods ( for 2.1) */ @ SuppressWarnings ( "resource" ) @ Override public HoconTreeTraversingParser createParser ( String content ) throws IOException , JsonParseException { } }
Reader r = new StringReader ( content ) ; IOContext ctxt = _createContext ( r , true ) ; // true - > own , can close // [ JACKSON - 512 ] : allow wrapping with InputDecorator if ( _inputDecorator != null ) { r = _inputDecorator . decorate ( ctxt , r ) ; } return _createParser ( r , ctxt ) ;
public class IotHubResourcesInner { /** * Import , update , or delete device identities in the IoT hub identity registry from a blob . For more information , see : https : / / docs . microsoft . com / azure / iot - hub / iot - hub - devguide - identity - registry # import - and - export - device - identities . * Impo...
return importDevicesWithServiceResponseAsync ( resourceGroupName , resourceName , importDevicesParameters ) . map ( new Func1 < ServiceResponse < JobResponseInner > , JobResponseInner > ( ) { @ Override public JobResponseInner call ( ServiceResponse < JobResponseInner > response ) { return response . body ( ) ; } } ) ;
public class AnalyticHelper { /** * Adds an accumulator by prepending the given name with a random string . * @ param name The name of the accumulator * @ param accumulator The accumulator * @ param < V > Type of values that are added to the accumulator * @ param < A > Type of the accumulator result as it will ...
getRuntimeContext ( ) . addAccumulator ( id + SEPARATOR + name , accumulator ) ;
public class ClosureRewriteModule { /** * Rewrites object literal exports to the standard named exports style . i . e . * exports = { Foo , Bar } * to * exports . Foo = Foo ; * exports . Bar = Bar ; * This makes the module exports into a more standard format for later passes . */ private void preprocessExport...
if ( ! n . getString ( ) . equals ( "exports" ) || ! isAssignTarget ( n ) || ! n . getGrandparent ( ) . isExprResult ( ) ) { return ; } checkState ( currentScript . defaultExportRhs == null ) ; Node exportRhs = n . getNext ( ) ; if ( isNamedExportsLiteral ( exportRhs ) ) { Node insertionPoint = n . getGrandparent ( ) ;...
public class ConicalGradientPaint { /** * With the START _ COLOR at the beginning and the DESTINATION _ COLOR at the end of the given RANGE the method will calculate * and return the color that equals the given VALUE . * e . g . a START _ COLOR of BLACK ( R : 0 , G : 0 , B : 0 , A : 255 ) and a DESTINATION _ COLOR ...
final float SOURCE_RED = START_COLOR . getRed ( ) * INT_TO_FLOAT_CONST ; final float SOURCE_GREEN = START_COLOR . getGreen ( ) * INT_TO_FLOAT_CONST ; final float SOURCE_BLUE = START_COLOR . getBlue ( ) * INT_TO_FLOAT_CONST ; final float SOURCE_ALPHA = START_COLOR . getAlpha ( ) * INT_TO_FLOAT_CONST ; final float DESTIN...
public class GroovyRootDocBuilder { /** * TODO remove dup with SimpleGroovyClassDoc */ private String replaceTags ( String orig , String relPath ) { } }
String result = orig . replaceAll ( "(?m)^\\s*\\*" , "" ) ; // todo precompile regex // { @ link processing hack } result = replaceAllTags ( result , "" , "" , LINK_REGEX , relPath ) ; // { @ code processing hack } result = replaceAllTags ( result , "<TT>" , "</TT>" , CODE_REGEX , relPath ) ; // hack to reformat other ...
public class Vacuum { /** * Manually control the robot * @ param rotationSpeed The speed of rotation in deg / s . * @ param speed The speed of the robot in m / s . Must be greater then - 0.3 and less then 0.3. * @ param runDuration The time to run the command in ms . Values less than 0 will be replaced by a defau...
if ( manualControlSequence < 1 ) manualControlStart ( ) ; JSONObject payload = new JSONObject ( ) ; if ( rotationSpeed > 180.0f ) rotationSpeed = 180.0f ; if ( rotationSpeed < - 180.0f ) rotationSpeed = - 180.0f ; float rotationRadians = Math . round ( ( rotationSpeed / 180.0f ) * 272.0d ) / 100.0f ; // Found out after...
public class DeviceManagerClient { /** * Gets a device registry configuration . * < p > Sample code : * < pre > < code > * try ( DeviceManagerClient deviceManagerClient = DeviceManagerClient . create ( ) ) { * RegistryName name = RegistryName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ REGISTRY ] " ) ; * ...
GetDeviceRegistryRequest request = GetDeviceRegistryRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return getDeviceRegistry ( request ) ;
public class GraphqlApiMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GraphqlApi graphqlApi , ProtocolMarshaller protocolMarshaller ) { } }
if ( graphqlApi == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( graphqlApi . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( graphqlApi . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( graphqlApi . getAuth...
public class Sender { /** * Simulates pressing the hardware back key . */ public void goBack ( ) { } }
sleeper . sleep ( ) ; try { inst . sendKeyDownUpSync ( KeyEvent . KEYCODE_BACK ) ; sleeper . sleep ( ) ; } catch ( Throwable ignored ) { }
public class SharedLock { /** * Retrieve a value produced by a { @ link Supplier } guarded by an exclusive lock . * @ param supplier the { @ link Supplier } , must not be { @ literal null } . * @ param < T > the return type * @ return the return value */ < T > T doExclusive ( Supplier < T > supplier ) { } }
LettuceAssert . notNull ( supplier , "Supplier must not be null" ) ; synchronized ( this ) { try { lockWritersExclusive ( ) ; return supplier . get ( ) ; } finally { unlockWritersExclusive ( ) ; } }
public class DOMDifferenceEngine { /** * Compares xsi : type attribute values */ private ComparisonState compareXsiType ( Attr controlAttr , XPathContext controlContext , Attr testAttr , XPathContext testContext ) { } }
boolean mustChangeControlContext = controlAttr != null ; boolean mustChangeTestContext = testAttr != null ; if ( ! mustChangeControlContext && ! mustChangeTestContext ) { return new OngoingComparisonState ( ) ; } boolean attributePresentOnBothSides = mustChangeControlContext && mustChangeTestContext ; try { QName contr...
public class CoNLLDocumentReaderAndWriter { /** * Return the coding scheme to IOB1 coding , regardless of what was used * internally . This is useful for scoring against CoNLL test output . * @ param tokens List of tokens in some NER encoding */ private void deEndify ( List < CoreLabel > tokens ) { } }
if ( flags . retainEntitySubclassification ) { return ; } tokens = new PaddedList < CoreLabel > ( tokens , new CoreLabel ( ) ) ; int k = tokens . size ( ) ; String [ ] newAnswers = new String [ k ] ; for ( int i = 0 ; i < k ; i ++ ) { CoreLabel c = tokens . get ( i ) ; CoreLabel p = tokens . get ( i - 1 ) ; if ( c . ge...
public class SuroControl { /** * Processes user command . For now it supports only " exit " , case insensitive . * @ param clientSocket The client socket after connection is established between a client and this server * @ return the last processed command */ private Command processCommand ( Socket clientSocket ) {...
BufferedReader in = null ; BufferedWriter out = null ; try { in = new BufferedReader ( new InputStreamReader ( clientSocket . getInputStream ( ) ) ) ; out = new BufferedWriter ( new OutputStreamWriter ( clientSocket . getOutputStream ( ) ) ) ; String s ; while ( ( s = in . readLine ( ) ) != null ) { if ( "exit" . equal...
public class KeyVaultClientBaseImpl { /** * Imports an externally created key , stores it , and returns key parameters and attributes to the client . * The import key operation may be used to import any key type into an Azure Key Vault . If the named key already exists , Azure Key Vault creates a new version of the k...
return ServiceFuture . fromResponse ( importKeyWithServiceResponseAsync ( vaultBaseUrl , keyName , key ) , serviceCallback ) ;
public class KnowledgeBaseManagerSparql { /** * Event Processing of internal changes */ @ Override @ Subscribe public void handleServiceCreated ( ServiceCreatedEvent event ) { } }
log . debug ( "Processing Service Created Event {}" , event ) ; this . fetchModelsForService ( event . getService ( ) ) ;