signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class GroupService { /** * Get billing stats by GroupFilter * @ param groupFilter group filter * @ return List of Group billing stats */ public List < BillingStats > getBillingStats ( GroupFilter groupFilter ) { } }
return findLazy ( groupFilter ) . map ( groupMetadata -> converter . convertBillingStats ( client . getGroupBillingStats ( groupMetadata . getId ( ) ) ) ) . collect ( toList ( ) ) ;
public class AppServicePlansInner { /** * Retrieve all Hybrid Connections in use in an App Service plan . * Retrieve all Hybrid Connections in use in an App Service plan . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service plan . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; HybridConnectionInner & gt ; object if successful . */ public PagedList < HybridConnectionInner > listHybridConnections ( final String resourceGroupName , final String name ) { } }
ServiceResponse < Page < HybridConnectionInner > > response = listHybridConnectionsSinglePageAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) ; return new PagedList < HybridConnectionInner > ( response . body ( ) ) { @ Override public Page < HybridConnectionInner > nextPage ( String nextPageLink ) { return listHybridConnectionsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class BloodhoundRemote { /** * The method used to rate - limit network requests . Can be either * < code > debounce < / code > or < code > throttle < / code > . Defaults to * < code > debounce < / code > . * @ param eRateLimitBy * function to use . May not be < code > null < / code > . * @ return this */ @ Nonnull public BloodhoundRemote setRateLimitBy ( @ Nonnull final EBloodhoundRemoteRateLimitBy eRateLimitBy ) { } }
m_eRateLimitBy = ValueEnforcer . notNull ( eRateLimitBy , "RateLimitBy" ) ; return this ;
public class DINameSpace { /** * Retrieves the fully qualified name of the given Method object . < p > * @ param m The Method object for which to retreive the fully * qualified name * @ return the fully qualified name of the specified Method object . */ static String getMethodFQN ( Method m ) { } }
return m == null ? null : m . getDeclaringClass ( ) . getName ( ) + '.' + m . getName ( ) ;
public class FieldUtils { /** * < p > Takes the target { @ link Activity } and finds the < b > only < / b > * field which is marked for injection with the given annotation . < / p > * @ param context * the context whose { @ link Field } s are to be scanned * < br > < br > * @ param annotation * the { @ link Class } of the { @ link Annotation } to look for * < br > < br > * @ return the { @ link Field } which is designated for injection * < br > < br > * @ throws DuplicateInjectionException * when multiple fields exist with the given annotation * < br > < br > * @ since 1.0.0 */ public static Field getUniqeField ( Object context , Class < ? extends Annotation > annotation ) { } }
Set < Field > fields = FieldUtils . getAllFields ( context , annotation ) ; if ( fields . isEmpty ( ) ) { return null ; } else if ( fields . size ( ) > 1 ) { throw new DuplicateInjectionException ( context . getClass ( ) , annotation ) ; } return new ArrayList < Field > ( fields ) . get ( 0 ) ;
public class Messenger { /** * Register apple push kit tokens * @ param apnsId internal APNS cert key * @ param token APNS token */ @ ObjectiveCName ( "registerApplePushKitWithApnsId:withToken:" ) public void registerApplePushKit ( int apnsId , String token ) { } }
modules . getPushesModule ( ) . registerApplePushKit ( apnsId , token ) ;
public class Functional { /** * Returns a functional wrapper for the input map , providing a way to apply * a function on all its entries in a functional style . * @ param map * the map to which the functor will be applied . * @ return * a map that also extends this abstract class . */ public static final < S , K , V > Functional < S > functionalMap ( Map < K , V > map ) { } }
return new FunctionalMap < S , K , V > ( map ) ;
public class ReflectUtils { /** * 根据方法签名从类中找出方法 。 * @ param clazz * 查找的类 。 * @ param methodName * 方法签名 , 形如method1 ( int , String ) 。 也允许只给方法名不参数只有方法名 , 形如method2。 * @ return 返回查找到的方法 。 * @ throws NoSuchMethodException * @ throws ClassNotFoundException * @ throws IllegalStateException * 给定的方法签名找到多个方法 ( 方法签名中没有指定参数 , 又有有重载的方法的情况 ) */ public static Method findMethodByMethodSignature ( Class < ? > clazz , String methodName , String [ ] parameterTypes ) throws NoSuchMethodException , ClassNotFoundException { } }
String signature = methodName ; if ( parameterTypes != null && parameterTypes . length > 0 ) { signature = methodName + StringUtils . join ( parameterTypes ) ; } Method method = Signature_METHODS_CACHE . get ( signature ) ; if ( method != null ) { return method ; } if ( parameterTypes == null ) { List < Method > finded = new ArrayList < Method > ( ) ; for ( Method m : clazz . getMethods ( ) ) { if ( m . getName ( ) . equals ( methodName ) ) { finded . add ( m ) ; } } if ( finded . isEmpty ( ) ) { throw new NoSuchMethodException ( "No such method " + methodName + " in class " + clazz ) ; } if ( finded . size ( ) > 1 ) { String msg = String . format ( "Not unique method for method name(%s) in class(%s), find %d methods." , methodName , clazz . getName ( ) , finded . size ( ) ) ; throw new IllegalStateException ( msg ) ; } method = finded . get ( 0 ) ; } else { Class < ? > [ ] types = new Class < ? > [ parameterTypes . length ] ; for ( int i = 0 ; i < parameterTypes . length ; i ++ ) { types [ i ] = ReflectUtils . name2class ( parameterTypes [ i ] ) ; } method = clazz . getMethod ( methodName , types ) ; } Signature_METHODS_CACHE . put ( signature , method ) ; return method ;
public class Config { /** * { @ inheritDoc } */ public void setHistoryEntriesForOperation ( String pMBean , String pOperation , String pTarget , int pMaxEntries ) throws MalformedObjectNameException { } }
setHistoryLimitForOperation ( pMBean , pOperation , pTarget , pMaxEntries , 0L ) ;
public class DocEnv { /** * Return the AnnotationTypeElementDoc for a MethodSymbol . * Should be called only on symbols representing annotation type elements . */ public AnnotationTypeElementDocImpl getAnnotationTypeElementDoc ( MethodSymbol meth ) { } }
AnnotationTypeElementDocImpl result = ( AnnotationTypeElementDocImpl ) methodMap . get ( meth ) ; if ( result != null ) return result ; result = new AnnotationTypeElementDocImpl ( this , meth ) ; methodMap . put ( meth , result ) ; return result ;
public class AbstrCFMLScriptTransformer { /** * Liest ein Switch Block ein * @ param block * @ throws TemplateException */ private final void switchBlock ( Data data , Body body ) throws TemplateException { } }
while ( data . srcCode . isValidIndex ( ) ) { comments ( data ) ; if ( data . srcCode . isCurrent ( "case " ) || data . srcCode . isCurrent ( "default" , ':' ) || data . srcCode . isCurrent ( '}' ) ) return ; Body prior = data . setParent ( body ) ; statement ( data , body , CTX_SWITCH ) ; data . setParent ( prior ) ; }
public class AmazonRoute53Client { /** * Gets the maximum number of hosted zones that you can associate with the specified reusable delegation set . * For the default limit , see < a * href = " https : / / docs . aws . amazon . com / Route53 / latest / DeveloperGuide / DNSLimitations . html " > Limits < / a > in the < i > Amazon * Route 53 Developer Guide < / i > . To request a higher limit , < a href = * " https : / / console . aws . amazon . com / support / home # / case / create ? issueType = service - limit - increase & amp ; limitType = service - code - route53" * > open a case < / a > . * @ param getReusableDelegationSetLimitRequest * A complex type that contains information about the request to create a hosted zone . * @ return Result of the GetReusableDelegationSetLimit operation returned by the service . * @ throws InvalidInputException * The input is not valid . * @ throws NoSuchDelegationSetException * A reusable delegation set with the specified ID does not exist . * @ sample AmazonRoute53 . GetReusableDelegationSetLimit * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / route53-2013-04-01 / GetReusableDelegationSetLimit " * target = " _ top " > AWS API Documentation < / a > */ @ Override public GetReusableDelegationSetLimitResult getReusableDelegationSetLimit ( GetReusableDelegationSetLimitRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetReusableDelegationSetLimit ( request ) ;
public class JFapUtils { /** * Produces a debug trace entry for a WsByteBuffer . This should be used * as follows : * < code > * if ( TraceComponent . isAnyTracingEnabled ( ) & & tc . isDebugEnabled ( ) ) debugTraceWsByteBuffer ( . . . ) ; * < / code > * @ param _ this Reference to the object invoking this method . * @ param _ tc Reference to TraceComponent to use for outputing trace entry . * @ param buffer Buffer to trace . * @ param amount Maximum amount of data from the buffer to trace . * @ param comment A comment to associate with the trace entry . */ public static void debugTraceWsByteBuffer ( Object _this , TraceComponent _tc , WsByteBuffer buffer , int amount , String comment ) { } }
byte [ ] data = null ; int start ; int count = amount ; if ( count > buffer . remaining ( ) ) count = buffer . remaining ( ) ; if ( buffer . hasArray ( ) ) { data = buffer . array ( ) ; start = buffer . arrayOffset ( ) + buffer . position ( ) ; ; } else { data = new byte [ count ] ; int pos = buffer . position ( ) ; buffer . get ( data ) ; buffer . position ( pos ) ; start = 0 ; } StringBuffer sb = new StringBuffer ( comment ) ; sb . append ( "\nbuffer hashcode: " ) ; sb . append ( buffer . hashCode ( ) ) ; sb . append ( "\nbuffer position: " ) ; sb . append ( buffer . position ( ) ) ; sb . append ( "\nbuffer remaining: " ) ; sb . append ( buffer . remaining ( ) ) ; sb . append ( "\n" ) ; SibTr . debug ( _this , _tc , sb . toString ( ) ) ; if ( count > 0 ) SibTr . bytes ( _this , _tc , data , start , count , "First " + count + " bytes of buffer data:" ) ;
public class UpworkRestClient { /** * Execute POST request * @ param url Request object for POST * @ param method HTTP method * @ param params POST parameters * @ throws JSONException * @ return { @ link JSONObject } */ private static JSONObject doPostRequest ( HttpPost httpPost , HashMap < String , String > params ) throws JSONException { } }
JSONObject json = null ; HttpClient postClient = HttpClientBuilder . create ( ) . build ( ) ; HttpResponse response ; try { response = postClient . execute ( httpPost ) ; if ( response . getStatusLine ( ) . getStatusCode ( ) == 200 ) { HttpEntity entity = response . getEntity ( ) ; if ( entity != null ) { InputStream instream = entity . getContent ( ) ; String result = convertStreamToString ( instream ) ; instream . close ( ) ; json = new JSONObject ( result ) ; } } else { json = UpworkRestClient . genError ( response ) ; } } catch ( ClientProtocolException e ) { json = UpworkRestClient . genError ( HTTP_RESPONSE_503 , "Exception: ClientProtocolException" ) ; } catch ( IOException e ) { json = UpworkRestClient . genError ( HTTP_RESPONSE_503 , "Exception: IOException" ) ; } catch ( JSONException e ) { json = UpworkRestClient . genError ( HTTP_RESPONSE_503 , "Exception: JSONException" ) ; } catch ( Exception e ) { json = UpworkRestClient . genError ( HTTP_RESPONSE_503 , "Exception: Exception " + e . toString ( ) ) ; } finally { httpPost . abort ( ) ; } return json ;
public class MappingManagerPanel { /** * GEN - LAST : event _ removeMappingButtonActionPerformed */ private void removeMapping ( ) { } }
int [ ] indexes = mappingList . getSelectedIndices ( ) ; if ( indexes == null ) { return ; } int confirm = JOptionPane . showConfirmDialog ( this , "Proceed deleting " + indexes . length + " mappings?" , "Conform" , JOptionPane . WARNING_MESSAGE , JOptionPane . YES_NO_OPTION ) ; if ( confirm == JOptionPane . CANCEL_OPTION || confirm == JOptionPane . CLOSED_OPTION ) { return ; } // The manager panel can handle multiple deletions . Object [ ] values = mappingList . getSelectedValues ( ) ; OBDAModel controller = apic ; URI srcuri = selectedSource . getSourceID ( ) ; for ( int i = 0 ; i < values . length ; i ++ ) { SQLPPTriplesMap mapping = ( SQLPPTriplesMap ) values [ i ] ; if ( mapping != null ) controller . removeTriplesMap ( srcuri , mapping . getId ( ) ) ; } mappingList . clearSelection ( ) ;
public class DeltaAssertion { /** * Get information for the assertion . * @ param type Type of iterator * @ return An iterator for the specified data . */ Iterator < Row > data ( IteratorType type ) { } }
Iterator < Row > itr ; switch ( type ) { case OLD_DATA_EXPECTED : itr = oldData . getRows ( ) . iterator ( ) ; break ; case NEW_DATA_EXPECTED : itr = newData . getRows ( ) . iterator ( ) ; break ; case OLD_DATA_ERRORS_EXPECTED : itr = oldDataMatch . deleted ( ) ; break ; case OLD_DATA_ERRORS_ACTUAL : itr = oldDataMatch . inserted ( ) ; break ; case NEW_DATA_ERRORS_EXPECTED : itr = newDataMatch . deleted ( ) ; break ; case NEW_DATA_ERRORS_ACTUAL : itr = newDataMatch . inserted ( ) ; break ; default : throw new InternalErrorException ( "Unexpected case!" ) ; } return itr ;
public class Vector4d { /** * / * ( non - Javadoc ) * @ see org . joml . Vector4dc # get ( int , java . nio . DoubleBuffer ) */ public DoubleBuffer get ( int index , DoubleBuffer buffer ) { } }
MemUtil . INSTANCE . put ( this , index , buffer ) ; return buffer ;
public class PathfindableConfig { /** * Create a path data from its node . * @ param data The path data ( must not be < code > null < / code > ) . * @ return The path data node . */ public static Xml exportPathData ( PathData data ) { } }
Check . notNull ( data ) ; final Xml node = new Xml ( NODE_PATH ) ; node . writeString ( ATT_CATEGORY , data . getName ( ) ) ; node . writeDouble ( ATT_COST , data . getCost ( ) ) ; node . writeBoolean ( ATT_BLOCK , data . isBlocking ( ) ) ; exportAllowedMovements ( node , data . getAllowedMovements ( ) ) ; return node ;
public class VariableMap { /** * Deserializes the variable map from a byte array returned by * { @ link # toBytes ( ) } . */ @ GwtIncompatible ( "com.google.common.base.Splitter.onPattern()" ) public static VariableMap fromBytes ( byte [ ] bytes ) throws ParseException { } }
String string = new String ( bytes , UTF_8 ) ; ImmutableMap . Builder < String , String > map = ImmutableMap . builder ( ) ; int startOfLine = 0 ; while ( startOfLine < string . length ( ) ) { int newLine = string . indexOf ( '\n' , startOfLine ) ; if ( newLine == - 1 ) { newLine = string . length ( ) ; } int endOfLine = newLine ; if ( string . charAt ( newLine - 1 ) == '\r' ) { newLine -- ; } String line = string . substring ( startOfLine , newLine ) ; startOfLine = endOfLine + 1 ; // update index for next iteration if ( line . isEmpty ( ) ) { continue ; } int pos = findIndexOfUnescapedChar ( line , SEPARATOR ) ; if ( pos <= 0 ) { throw new ParseException ( "Bad line: " + line , 0 ) ; } map . put ( unescape ( line . substring ( 0 , pos ) ) , pos == line . length ( ) - 1 ? "" : unescape ( line . substring ( pos + 1 ) ) ) ; } return new VariableMap ( map . build ( ) ) ;
public class HttpClient { /** * HTTP Websocket to connect the { @ link HttpClient } . * @ param subprotocols a websocket subprotocol comma separated list * @ param maxFramePayloadLength maximum allowable frame payload length * @ return a { @ link WebsocketSender } ready to consume for response */ public final WebsocketSender websocket ( String subprotocols , int maxFramePayloadLength ) { } }
Objects . requireNonNull ( subprotocols , "subprotocols" ) ; TcpClient tcpConfiguration = tcpConfiguration ( ) . bootstrap ( b -> HttpClientConfiguration . websocketSubprotocols ( b , subprotocols ) ) . bootstrap ( b -> HttpClientConfiguration . websocketMaxFramePayloadLength ( b , maxFramePayloadLength ) ) ; return new WebsocketFinalizer ( tcpConfiguration ) ;
public class ServletUtil { /** * Returns a { @ code URL } containing the real path for a given virtual * path , on URL form . * Note that this method will return { @ code null } for all the same reasons * as { @ code ServletContext . getRealPath ( java . lang . String ) } does . * @ param pContext the servlet context * @ param pPath the virtual path * @ return a { @ code URL } object containing the path , or { @ code null } . * @ throws MalformedURLException if the path refers to a malformed URL * @ see ServletContext # getRealPath ( java . lang . String ) * @ see ServletContext # getResource ( java . lang . String ) */ public static URL getRealURL ( final ServletContext pContext , final String pPath ) throws MalformedURLException { } }
String realPath = pContext . getRealPath ( pPath ) ; if ( realPath != null ) { // NOTE : First convert to URI , as of Java 6 File . toURL is deprecated return new File ( realPath ) . toURI ( ) . toURL ( ) ; } return null ;
public class CPDefinitionSpecificationOptionValueUtil { /** * Returns the last cp definition specification option value in the ordered set where CPDefinitionId = & # 63 ; and CPSpecificationOptionId = & # 63 ; . * @ param CPDefinitionId the cp definition ID * @ param CPSpecificationOptionId the cp specification option ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp definition specification option value , or < code > null < / code > if a matching cp definition specification option value could not be found */ public static CPDefinitionSpecificationOptionValue fetchByC_CSO_Last ( long CPDefinitionId , long CPSpecificationOptionId , OrderByComparator < CPDefinitionSpecificationOptionValue > orderByComparator ) { } }
return getPersistence ( ) . fetchByC_CSO_Last ( CPDefinitionId , CPSpecificationOptionId , orderByComparator ) ;
public class ClassManagerImpl { /** * Clear global class cache and notify namespaces to clear their * class caches . * The listener list is implemented with weak references so that we * will not keep every namespace in existence forever . */ @ Override protected void classLoaderChanged ( ) { } }
Vector toRemove = new Vector ( ) ; // safely remove for ( Enumeration e = listeners . elements ( ) ; e . hasMoreElements ( ) ; ) { WeakReference wr = ( WeakReference ) e . nextElement ( ) ; Listener l = ( Listener ) wr . get ( ) ; if ( l == null ) // garbage collected toRemove . add ( wr ) ; else l . classLoaderChanged ( ) ; } for ( Enumeration e = toRemove . elements ( ) ; e . hasMoreElements ( ) ; ) listeners . removeElement ( e . nextElement ( ) ) ;
public class ImageLoaderCurrent { /** * Process the INodes under construction section of the fsimage . * @ param in DataInputStream to process * @ param v Visitor to walk over inodes * @ param skipBlocks Walk over each block ? */ private void processINodesUC ( DataInputStream in , ImageVisitor v , boolean skipBlocks ) throws IOException { } }
int numINUC = in . readInt ( ) ; v . visitEnclosingElement ( ImageElement . INODES_UNDER_CONSTRUCTION , ImageElement . NUM_INODES_UNDER_CONSTRUCTION , numINUC ) ; for ( int i = 0 ; i < numINUC ; i ++ ) { checkInterruption ( ) ; v . visitEnclosingElement ( ImageElement . INODE_UNDER_CONSTRUCTION ) ; byte [ ] name = FSImageSerialization . readBytes ( in ) ; String n = new String ( name , "UTF8" ) ; v . visit ( ImageElement . INODE_PATH , n ) ; if ( LayoutVersion . supports ( Feature . ADD_INODE_ID , imageVersion ) ) { v . visit ( ImageElement . INODE_ID , in . readLong ( ) ) ; } v . visit ( ImageElement . REPLICATION , in . readShort ( ) ) ; v . visit ( ImageElement . MODIFICATION_TIME , formatDate ( in . readLong ( ) ) ) ; v . visit ( ImageElement . PREFERRED_BLOCK_SIZE , in . readLong ( ) ) ; int numBlocks = in . readInt ( ) ; processBlocks ( in , v , numBlocks , skipBlocks ) ; processPermission ( in , v ) ; v . visit ( ImageElement . CLIENT_NAME , FSImageSerialization . readString ( in ) ) ; v . visit ( ImageElement . CLIENT_MACHINE , FSImageSerialization . readString ( in ) ) ; // Skip over the datanode descriptors , which are still stored in the // file but are not used by the datanode or loaded into memory int numLocs = in . readInt ( ) ; for ( int j = 0 ; j < numLocs ; j ++ ) { in . readShort ( ) ; in . readLong ( ) ; in . readLong ( ) ; in . readLong ( ) ; in . readInt ( ) ; FSImageSerialization . readString ( in ) ; FSImageSerialization . readString ( in ) ; WritableUtils . readEnum ( in , AdminStates . class ) ; } v . leaveEnclosingElement ( ) ; // INodeUnderConstruction } v . leaveEnclosingElement ( ) ; // INodesUnderConstruction
public class X509CertPath { /** * Encode the CertPath using PKCS # 7 format . * @ return a byte array containing the binary encoding of the PKCS # 7 object * @ exception CertificateEncodingException if an exception occurs */ private byte [ ] encodePKCS7 ( ) throws CertificateEncodingException { } }
PKCS7 p7 = new PKCS7 ( new AlgorithmId [ 0 ] , new ContentInfo ( ContentInfo . DATA_OID , null ) , certs . toArray ( new X509Certificate [ certs . size ( ) ] ) , new SignerInfo [ 0 ] ) ; DerOutputStream derout = new DerOutputStream ( ) ; try { p7 . encodeSignedData ( derout ) ; } catch ( IOException ioe ) { throw new CertificateEncodingException ( ioe . getMessage ( ) ) ; } return derout . toByteArray ( ) ;
public class ExtensionEdit { /** * Gets the default keyboard shortcut for find functionality . * Should be called / used only when in view mode . * @ return the keyboard shortcut , never { @ code null } . * @ since 2.7.0 */ public static KeyStroke getFindDefaultKeyStroke ( ) { } }
if ( findDefaultKeyStroke == null ) { findDefaultKeyStroke = View . getSingleton ( ) . getMenuShortcutKeyStroke ( KeyEvent . VK_F , 0 , false ) ; } return findDefaultKeyStroke ;
public class AbstractCodeGenerator { /** * get error message info by type not matched . * @ param type the type * @ param field the field * @ return error message for mismatch type */ private String getMismatchTypeErroMessage ( FieldType type , Field field ) { } }
return "Type mismatch. @Protobuf required type '" + type . getJavaType ( ) + "' but field type is '" + field . getType ( ) . getSimpleName ( ) + "' of field name '" + field . getName ( ) + "' on class " + field . getDeclaringClass ( ) . getCanonicalName ( ) ;
public class ExtensionHttpSessions { /** * Checks if a particular token is part of the default session tokens set by the user using the * options panel . The default session tokens are valid for all sites . The check is being * performed in a lower - case manner , as default session tokens are case - insensitive . * @ param token the token * @ return true , if it is a default session token */ public boolean isDefaultSessionToken ( String token ) { } }
if ( getParam ( ) . getDefaultTokensEnabled ( ) . contains ( token . toLowerCase ( Locale . ENGLISH ) ) ) return true ; return false ;
public class DataStore { /** * Check if this DataStore has the given columns . * @ param columns Columns to check for * @ return True if the column sets are equal */ public boolean hasColumns ( Collection < String > columns ) { } }
return columns != null && this . columns . equals ( new TreeSet < String > ( columns ) ) ;
public class AbstractClientOptionsBuilder { /** * Adds the specified HTTP - level { @ code decorator } . * @ param decorator the { @ link Function } that transforms a { @ link Client } to another * @ param < T > the type of the { @ link Client } being decorated * @ param < R > the type of the { @ link Client } produced by the { @ code decorator } * @ param < I > the { @ link Request } type of the { @ link Client } being decorated * @ param < O > the { @ link Response } type of the { @ link Client } being decorated */ public < T extends Client < I , O > , R extends Client < I , O > , I extends HttpRequest , O extends HttpResponse > B decorator ( Function < T , R > decorator ) { } }
decoration . add ( decorator ) ; return self ( ) ;
public class JsonUtils { /** * Print a new line with indention at the beginning of the new line . * @ param indentLevel * @ param stringBuilder */ private static void appendIndentedNewLine ( int indentLevel , StringBuilder stringBuilder ) { } }
stringBuilder . append ( "\n" ) ; for ( int i = 0 ; i < indentLevel ; i ++ ) { // Assuming indention using 2 spaces stringBuilder . append ( " " ) ; }
public class ClassFieldsGridScreen { /** * Add all the screen listeners . */ public void addListeners ( ) { } }
super . addListeners ( ) ; Record record = this . getMainRecord ( ) ; Record recClassInfo = this . getRecord ( ClassInfo . CLASS_INFO_FILE ) ; if ( recClassInfo != null ) { record . setKeyArea ( ClassFields . CLASS_INFO_CLASS_NAME_KEY ) ; SubFileFilter listener = new SubFileFilter ( recClassInfo . getField ( ClassInfo . CLASS_NAME ) , ClassFields . CLASS_INFO_CLASS_NAME , null , null , null , null , true ) ; record . addListener ( listener ) ; recClassInfo . getField ( ClassInfo . CLASS_NAME ) . addListener ( new FieldReSelectHandler ( this ) ) ; }
public class Strings { /** * Return a string padded with the given string value of an object for the given count . * @ param obj Object to convert to a string . * @ param count Pad count . * @ return Padded string . */ public static String pad ( final Object obj , final int count ) { } }
return pad ( new StringBuffer ( ) , String . valueOf ( obj ) , count ) ;
public class MkTabTreeIndex { /** * Returns the knn distance of the object with the specified id . * @ param object the query object * @ return the knn distance of the object with the specified id */ private double [ ] knnDistances ( O object ) { } }
KNNList knns = knnq . getKNNForObject ( object , getKmax ( ) - 1 ) ; double [ ] distances = new double [ getKmax ( ) ] ; int i = 0 ; for ( DoubleDBIDListIter iter = knns . iter ( ) ; iter . valid ( ) && i < getKmax ( ) ; iter . advance ( ) , i ++ ) { distances [ i ] = iter . doubleValue ( ) ; } return distances ;
public class CacheAwareServlet { /** * Check if the if - unmodified - since condition is satisfied . * @ param request * The servlet request we are processing * @ param response * The servlet response we are creating * @ param resourceAttributes * File object * @ return boolean true if the resource meets the specified condition , and * false if the condition is not satisfied , in which case request * processing is stopped */ protected boolean checkIfUnmodifiedSince ( final HttpServletRequest request , final HttpServletResponse response , final Attributes resourceAttributes ) throws IOException { } }
try { final long lastModified = resourceAttributes . getLastModified ( ) ; final long headerValue = request . getDateHeader ( "If-Unmodified-Since" ) ; if ( headerValue != - 1 ) { if ( lastModified >= ( headerValue + 1000 ) ) { // The entity has not been modified since the date // specified by the client . This is not an error case . response . sendError ( HttpServletResponse . SC_PRECONDITION_FAILED ) ; return false ; } } } catch ( final IllegalArgumentException illegalArgument ) { return true ; } return true ;
public class RedmineManager { /** * Uploads an attachement . * @ param fileName * file name of the attachement . * @ param contentType * content type of the attachement . * @ param content * attachement content stream . * @ return attachement content . * @ throws RedmineException * if something goes wrong . * @ throws IOException * if input cannot be read . This exception cannot be thrown yet * ( I am not sure if http client can distinguish " network " * errors and local errors ) but is will be good to distinguish * reading errors and transport errors . */ public Attachment uploadAttachment ( String fileName , String contentType , InputStream content ) throws RedmineException , IOException { } }
final InputStream wrapper = new MarkedInputStream ( content , "uploadStream" ) ; final String token ; try { token = transport . upload ( wrapper ) ; final Attachment result = new Attachment ( ) ; result . setToken ( token ) ; result . setContentType ( contentType ) ; result . setFileName ( fileName ) ; return result ; } catch ( RedmineException e ) { unwrapIO ( e , "uploadStream" ) ; throw e ; }
public class SourceMapGeneratorV3 { /** * Merges current mapping with { @ code mapSectionContents } considering the * offset { @ code ( line , column ) } . Any extension in the map section will be * ignored . * @ param line The line offset * @ param column The column offset * @ param mapSectionContents The map section to be appended * @ throws SourceMapParseException */ public void mergeMapSection ( int line , int column , String mapSectionContents ) throws SourceMapParseException { } }
setStartingPosition ( line , column ) ; SourceMapConsumerV3 section = new SourceMapConsumerV3 ( ) ; section . parse ( mapSectionContents ) ; section . visitMappings ( new ConsumerEntryVisitor ( ) ) ;
public class ClassUtils { /** * Tries to find a class fields . Supports inheritance and doesn ' t return synthetic fields . * @ param beanClass class to be searched for * @ param fieldName field name * @ return a list of found fields */ public static Field findClassField ( Class < ? > beanClass , String fieldName ) { } }
Class < ? > currentClass = beanClass ; while ( currentClass != null && currentClass != Object . class ) { for ( Field field : currentClass . getDeclaredFields ( ) ) { if ( field . isSynthetic ( ) ) { continue ; } if ( field . getName ( ) . equals ( fieldName ) ) { return field ; } } currentClass = currentClass . getSuperclass ( ) ; } return null ;
public class ExampleQueriesPanel { /** * Loads the available example queries for a specific corpus . * @ param corpusNames Specifies the corpora example queries are fetched for . If * it is null or empty all available example queries are * fetched . */ private static List < ExampleQuery > loadExamplesFromRemote ( Set < String > corpusNames ) { } }
List < ExampleQuery > result = new LinkedList < > ( ) ; WebResource service = Helper . getAnnisWebResource ( ) ; try { if ( corpusNames == null || corpusNames . isEmpty ( ) ) { result = service . path ( "query" ) . path ( "corpora" ) . path ( "example-queries" ) . get ( new GenericType < List < ExampleQuery > > ( ) { } ) ; } else { String concatedCorpusNames = StringUtils . join ( corpusNames , "," ) ; result = service . path ( "query" ) . path ( "corpora" ) . path ( "example-queries" ) . queryParam ( "corpora" , concatedCorpusNames ) . get ( new GenericType < List < ExampleQuery > > ( ) { } ) ; } } catch ( UniformInterfaceException ex ) { // ignore } catch ( ClientHandlerException ex ) { log . error ( "problems with getting example queries from remote for {}" , corpusNames , ex ) ; } return result ;
public class CmsWorkplaceEditorConfiguration { /** * Sets the list of compiled browser patterns . < p > * @ param pattern the list of compiled browser patterns */ private void setBrowserPattern ( List < Pattern > pattern ) { } }
if ( ( pattern == null ) || ( pattern . size ( ) == 0 ) ) { setValidConfiguration ( false ) ; LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_EDITOR_CONFIG_NO_PATTERN_0 ) ) ; } m_browserPattern = pattern ;
public class LByteFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < R > LByteFunction < R > byteFunctionFrom ( Consumer < LByteFunctionBuilder < R > > buildingFunction ) { } }
LByteFunctionBuilder builder = new LByteFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class ModbusSerialTransport { /** * Spins until the timeout or the condition is met . * This method will repeatedly poll the available bytes , so it should not have any side effects . * @ param waitTimeMicroSec The time to wait for the condition to be true in microseconds * @ return true if the condition ended the spin , false if the tim */ boolean spinUntilBytesAvailable ( long waitTimeMicroSec ) { } }
long start = System . nanoTime ( ) ; while ( availableBytes ( ) < 1 ) { long delta = System . nanoTime ( ) - start ; if ( delta > waitTimeMicroSec * 1000 ) { return false ; } } return true ;
public class FieldUtils { /** * Return the value contained in the specified field of the candidate object . * @ param candidate the object to retrieve the value of . * @ param field the field . * @ return the value contained in the field of the candidate . */ public static Object getFieldValue ( Object candidate , Field field ) { } }
try { return ReflectUtils . getValue ( ReflectUtils . makeAccessible ( field ) , candidate ) ; } catch ( Exception e ) { throw BusinessException . wrap ( e , BusinessErrorCode . ERROR_ACCESSING_FIELD ) . put ( "className" , candidate . getClass ( ) ) . put ( "fieldName" , field . getName ( ) ) ; }
public class DataSynchronizer { /** * Returns the undo collection representing the given namespace for recording documents that * may need to be reverted after a system failure . * @ param namespace the namespace referring to the undo collection . * @ return the undo collection representing the given namespace for recording documents that * may need to be reverted after a system failure . */ MongoCollection < BsonDocument > getUndoCollection ( final MongoNamespace namespace ) { } }
return localClient . getDatabase ( String . format ( "sync_undo_%s" , namespace . getDatabaseName ( ) ) ) . getCollection ( namespace . getCollectionName ( ) , BsonDocument . class ) . withCodecRegistry ( MongoClientSettings . getDefaultCodecRegistry ( ) ) ;
public class Engine { /** * get template by parent template ' s name and it ' s relative name . * @ param parentName parent template ' s name * @ param name template ' s relative name * @ return Template * @ throws ResourceNotFoundException if resource not found */ public Template getTemplate ( final String parentName , final String name ) throws ResourceNotFoundException { } }
return getTemplate ( this . loader . concat ( parentName , name ) ) ;
public class AsynchronousRequest { /** * For more info on Mini API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / minis " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } methods for custom interactions * @ param callback callback that is going to be used for { @ link Call # enqueue ( Callback ) } * @ throws NullPointerException if given { @ link Callback } is empty * @ see Mini mini info */ public void getAllMiniID ( Callback < List < Integer > > callback ) throws NullPointerException { } }
gw2API . getAllMiniIDs ( ) . enqueue ( callback ) ;
public class XAnnotationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < XAnnotationElementValuePair > getElementValuePairs ( ) { } }
if ( elementValuePairs == null ) { elementValuePairs = new EObjectContainmentEList < XAnnotationElementValuePair > ( XAnnotationElementValuePair . class , this , XAnnotationsPackage . XANNOTATION__ELEMENT_VALUE_PAIRS ) ; } return elementValuePairs ;
public class EnableReceiveNotifyMsgApi { /** * 打开 / 关闭自呈现消息 * @ param enable 打开 / 关闭 */ public void enableReceiveNotifyMsg ( boolean enable , EnableReceiveNotifyMsgHandler handler ) { } }
HMSAgentLog . i ( "enableReceiveNotifyMsg:enable=" + enable + " handler=" + StrUtils . objDesc ( handler ) ) ; this . enable = enable ; this . handler = handler ; connect ( ) ;
public class BytesMessageImpl { /** * ( non - Javadoc ) * @ see javax . jms . BytesMessage # writeChar ( char ) */ @ Override public void writeChar ( char value ) throws JMSException { } }
try { getOutput ( ) . writeChar ( value ) ; } catch ( IOException e ) { throw new FFMQException ( "Cannot write message body" , "IO_ERROR" , e ) ; }
public class CacheEventListenerConfigurationBuilder { /** * Builds the { @ link CacheEventListenerConfiguration } this builder represents . * @ return the { @ code CacheEventListenerConfiguration } */ public DefaultCacheEventListenerConfiguration build ( ) { } }
DefaultCacheEventListenerConfiguration defaultCacheEventListenerConfiguration ; if ( this . listenerClass != null ) { defaultCacheEventListenerConfiguration = new DefaultCacheEventListenerConfiguration ( this . eventsToFireOn , this . listenerClass , this . listenerArguments ) ; } else { defaultCacheEventListenerConfiguration = new DefaultCacheEventListenerConfiguration ( this . eventsToFireOn , this . listenerInstance ) ; } if ( eventOrdering != null ) { defaultCacheEventListenerConfiguration . setEventOrderingMode ( this . eventOrdering ) ; } if ( eventFiringMode != null ) { defaultCacheEventListenerConfiguration . setEventFiringMode ( this . eventFiringMode ) ; } return defaultCacheEventListenerConfiguration ;
public class Iterators { /** * Returns an { @ link Iterable } that lists items in the normal order * but which hides the base iterator implementation details . * @ since 1.492 */ public static < T > Iterable < T > wrap ( final Iterable < T > base ) { } }
return new Iterable < T > ( ) { public Iterator < T > iterator ( ) { final Iterator < T > itr = base . iterator ( ) ; return new Iterator < T > ( ) { public boolean hasNext ( ) { return itr . hasNext ( ) ; } public T next ( ) { return itr . next ( ) ; } public void remove ( ) { itr . remove ( ) ; } } ; } } ;
public class Matrix3d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix3dc # transformTranspose ( org . joml . Vector3dc , org . joml . Vector3d ) */ public Vector3d transformTranspose ( Vector3dc v , Vector3d dest ) { } }
v . mulTranspose ( this , dest ) ; return dest ;
public class Kernel2D_F32 { /** * Creates a kernel whose elements are the specified data array and has * the specified width . * @ param data The array who will be the kernel ' s data . Reference is saved . * @ param width The kernel ' s width . * @ param offset Kernel origin ' s offset from element 0. * @ return A new kernel . */ public static Kernel2D_F32 wrap ( float data [ ] , int width , int offset ) { } }
if ( width % 2 == 0 && width <= 0 && width * width > data . length ) throw new IllegalArgumentException ( "invalid width" ) ; Kernel2D_F32 ret = new Kernel2D_F32 ( ) ; ret . data = data ; ret . width = width ; ret . offset = offset ; return ret ;
public class X509CertInfo { /** * Get the Issuer or Subject name */ private Object getX500Name ( String name , boolean getIssuer ) throws IOException { } }
if ( name . equalsIgnoreCase ( X509CertInfo . DN_NAME ) ) { return getIssuer ? issuer : subject ; } else if ( name . equalsIgnoreCase ( "x500principal" ) ) { return getIssuer ? issuer . asX500Principal ( ) : subject . asX500Principal ( ) ; } else { throw new IOException ( "Attribute name not recognized." ) ; }
public class ReceiverQueue { /** * Receives an object from a channel . * @ param object */ public void onReceive ( Object object ) { } }
if ( ! closed && object != null ) { synchronized ( queue ) { queue . addLast ( object ) ; if ( limit > 0 && queue . size ( ) > limit && ! queue . isEmpty ( ) ) { queue . removeFirst ( ) ; } } }
public class WindowOperator { /** * Assumes input grouped on relevant pagesHashStrategy columns */ private static int findGroupEnd ( PagesIndex pagesIndex , PagesHashStrategy pagesHashStrategy , int startPosition ) { } }
checkArgument ( pagesIndex . getPositionCount ( ) > 0 , "Must have at least one position" ) ; checkPositionIndex ( startPosition , pagesIndex . getPositionCount ( ) , "startPosition out of bounds" ) ; return findEndPosition ( startPosition , pagesIndex . getPositionCount ( ) , ( firstPosition , secondPosition ) -> pagesIndex . positionEqualsPosition ( pagesHashStrategy , firstPosition , secondPosition ) ) ;
public class SymbolType { /** * Clones replacing the symbol type name . * @ param name the symbol type name * @ return Returns a copy of this symbol type replacing the name */ public SymbolType withName ( String name ) { } }
return clone ( marker , name , arrayCount , typeVariable , null , null ) ;
public class WTabSet { /** * Set the { @ link com . github . bordertech . wcomponents . CollapsibleGroup } that this component belongs to . This will * enable a { @ link com . github . bordertech . wcomponents . WCollapsibleToggle } component to target the tabset as part of * the group . * @ param group the group to set */ public void setGroup ( final CollapsibleGroup group ) { } }
if ( TabSetType . ACCORDION . equals ( getType ( ) ) ) { getOrCreateComponentModel ( ) . group = group ; group . addCollapsible ( this ) ; }
public class BitUtils { /** * Add Long to the current position with the specified size * Be careful with java long bit sign * @ param pValue * the value to set * @ param pLength * the length of the long */ public void setNextLong ( final long pValue , final int pLength ) { } }
if ( pLength > Long . SIZE ) { throw new IllegalArgumentException ( "Long overflow with length > 64" ) ; } setNextValue ( pValue , pLength , Long . SIZE - 1 ) ;
public class CraftingHelper { /** * Attempt to find a smelting recipe that results in the requested output . * @ param output * @ return an ItemStack representing the required input . */ public static ItemStack getSmeltingRecipeForRequestedOutput ( String output ) { } }
ItemStack target = MinecraftTypeHelper . getItemStackFromParameterString ( output ) ; Iterator < ? > furnaceIt = FurnaceRecipes . instance ( ) . getSmeltingList ( ) . keySet ( ) . iterator ( ) ; while ( furnaceIt . hasNext ( ) ) { ItemStack isInput = ( ItemStack ) furnaceIt . next ( ) ; ItemStack isOutput = ( ItemStack ) FurnaceRecipes . instance ( ) . getSmeltingList ( ) . get ( isInput ) ; if ( itemStackIngredientsMatch ( target , isOutput ) ) return isInput ; } return null ;
public class SARLQuickfixProvider { /** * Quick fix for " Override final operation " . * @ param issue the issue . * @ param acceptor the quick fix acceptor . */ @ Fix ( IssueCodes . OVERRIDDEN_FINAL ) public void fixOverriddenFinal ( Issue issue , IssueResolutionAcceptor acceptor ) { } }
final MultiModification modifications = new MultiModification ( this , issue , acceptor , Messages . SARLQuickfixProvider_0 , Messages . SARLQuickfixProvider_1 ) ; modifications . bind ( XtendTypeDeclaration . class , SuperTypeRemoveModification . class ) ; modifications . bind ( XtendMember . class , MemberRemoveModification . class ) ;
public class DataBuilder { /** * Appends a device pattern to the map of pattern sorted by ID . * @ param pattern * a pattern for a device * @ return itself * @ throws net . sf . qualitycheck . exception . IllegalNullArgumentException * if the given argument is { @ code null } */ @ Nonnull public DataBuilder appendDevicePattern ( @ Nonnull final DevicePattern pattern ) { } }
Check . notNull ( pattern , "pattern" ) ; if ( ! devicePatterns . containsKey ( pattern . getId ( ) ) ) { devicePatterns . put ( pattern . getId ( ) , new TreeSet < DevicePattern > ( DEVICE_PATTERN_COMPARATOR ) ) ; } devicePatterns . get ( pattern . getId ( ) ) . add ( pattern ) ; return this ;
public class EntityDataModelUtil { /** * Gets the OData type for a Java type and throws an exception if there is no OData type for the Java type . * @ param entityDataModel The entity data model . * @ param javaType The Java type . * @ return The OData type for the Java type . * @ throws ODataSystemException If there is no OData type for the specified Java type . */ public static Type getAndCheckType ( EntityDataModel entityDataModel , Class < ? > javaType ) { } }
Type type = entityDataModel . getType ( javaType ) ; if ( type == null ) { throw new ODataSystemException ( "No type found in the entity data model for Java type: " + javaType . getName ( ) ) ; } return type ;
public class DataLayout { /** * Called to apply an error message when an error occurs . Assigns the text to the error view by default . */ protected void applyErrorMessage ( @ Nullable CharSequence errorMessage ) { } }
if ( mErrorView instanceof TextView ) { ( ( TextView ) mErrorView ) . setText ( errorMessage ) ; }
public class TypeValidator { /** * Expect that the type of a switch condition matches the type of its case condition . */ void expectSwitchMatchesCase ( Node n , JSType switchType , JSType caseType ) { } }
// ECMA - 262 , page 68 , step 3 of evaluation of CaseBlock , // but allowing extra autoboxing . // TODO ( user ) : remove extra conditions when type annotations // in the code base have adapted to the change in the compiler . if ( ! switchType . canTestForShallowEqualityWith ( caseType ) && ( caseType . autoboxesTo ( ) == null || ! caseType . autoboxesTo ( ) . isSubtypeOf ( switchType ) ) ) { mismatch ( n . getFirstChild ( ) , "case expression doesn't match switch" , caseType , switchType ) ; } else if ( ! switchType . canTestForShallowEqualityWith ( caseType ) && ( caseType . autoboxesTo ( ) == null || ! caseType . autoboxesTo ( ) . isSubtypeWithoutStructuralTyping ( switchType ) ) ) { TypeMismatch . recordImplicitInterfaceUses ( this . implicitInterfaceUses , n , caseType , switchType ) ; TypeMismatch . recordImplicitUseOfNativeObject ( this . mismatches , n , caseType , switchType ) ; }
public class Navis { /** * Returns the speed needed to move from ( time1 , lat1 , lon1 ) to ( time2 , lat2 , lon2) * @ param time1 * @ param lat1 * @ param lon1 * @ param time2 * @ param lat2 * @ param lon2 * @ return Knots */ public static final double speed ( long time1 , double lat1 , double lon1 , long time2 , double lat2 , double lon2 ) { } }
checkLatitude ( lat1 ) ; checkLongitude ( lon1 ) ; checkLatitude ( lat2 ) ; checkLongitude ( lon2 ) ; double distance = distance ( lat1 , lon1 , lat2 , lon2 ) ; double duration = time2 - time1 ; double hours = duration / 3600000.0 ; double speed = distance / hours ; return speed ;
public class AlertService { /** * Returns the alert for the given ID . * @ param alertId The alert ID . * @ return The alert for the given ID . May be null . * @ throws IOException If the server cannot be reached . * @ throws TokenExpiredException If the token sent along with the request has expired */ public Alert getAlert ( BigInteger alertId ) throws IOException , TokenExpiredException { } }
String requestUrl = RESOURCE + "/" + alertId . toString ( ) ; ArgusResponse response = getClient ( ) . executeHttpRequest ( ArgusHttpClient . RequestType . GET , requestUrl , null ) ; assertValidResponse ( response , requestUrl ) ; return fromJson ( response . getResult ( ) , Alert . class ) ;
public class JavassistProxyFactory { /** * Generate Javassist Proxy Classes */ private static < T > void generateProxyClass ( Class < T > primaryInterface , String superClassName , String methodBody ) throws Exception { } }
String newClassName = superClassName . replaceAll ( "(.+)\\.(\\w+)" , "$1.Hikari$2" ) ; CtClass superCt = classPool . getCtClass ( superClassName ) ; CtClass targetCt = classPool . makeClass ( newClassName , superCt ) ; targetCt . setModifiers ( Modifier . FINAL ) ; System . out . println ( "Generating " + newClassName ) ; targetCt . setModifiers ( Modifier . PUBLIC ) ; // Make a set of method signatures we inherit implementation for , so we don ' t generate delegates for these Set < String > superSigs = new HashSet < > ( ) ; for ( CtMethod method : superCt . getMethods ( ) ) { if ( ( method . getModifiers ( ) & Modifier . FINAL ) == Modifier . FINAL ) { superSigs . add ( method . getName ( ) + method . getSignature ( ) ) ; } } Set < String > methods = new HashSet < > ( ) ; for ( Class < ? > intf : getAllInterfaces ( primaryInterface ) ) { CtClass intfCt = classPool . getCtClass ( intf . getName ( ) ) ; targetCt . addInterface ( intfCt ) ; for ( CtMethod intfMethod : intfCt . getDeclaredMethods ( ) ) { final String signature = intfMethod . getName ( ) + intfMethod . getSignature ( ) ; // don ' t generate delegates for methods we override if ( superSigs . contains ( signature ) ) { continue ; } // Ignore already added methods that come from other interfaces if ( methods . contains ( signature ) ) { continue ; } // Track what methods we ' ve added methods . add ( signature ) ; // Clone the method we want to inject into CtMethod method = CtNewMethod . copy ( intfMethod , targetCt , null ) ; String modifiedBody = methodBody ; // If the super - Proxy has concrete methods ( non - abstract ) , transform the call into a simple super . method ( ) call CtMethod superMethod = superCt . getMethod ( intfMethod . getName ( ) , intfMethod . getSignature ( ) ) ; if ( ( superMethod . getModifiers ( ) & Modifier . ABSTRACT ) != Modifier . ABSTRACT && ! isDefaultMethod ( intf , intfMethod ) ) { modifiedBody = modifiedBody . replace ( "((cast) " , "" ) ; modifiedBody = modifiedBody . replace ( "delegate" , "super" ) ; modifiedBody = modifiedBody . replace ( "super)" , "super" ) ; } modifiedBody = modifiedBody . replace ( "cast" , primaryInterface . getName ( ) ) ; // Generate a method that simply invokes the same method on the delegate if ( isThrowsSqlException ( intfMethod ) ) { modifiedBody = modifiedBody . replace ( "method" , method . getName ( ) ) ; } else { modifiedBody = "{ return ((cast) delegate).method($$); }" . replace ( "method" , method . getName ( ) ) . replace ( "cast" , primaryInterface . getName ( ) ) ; } if ( method . getReturnType ( ) == CtClass . voidType ) { modifiedBody = modifiedBody . replace ( "return" , "" ) ; } method . setBody ( modifiedBody ) ; targetCt . addMethod ( method ) ; } } targetCt . getClassFile ( ) . setMajorVersion ( ClassFile . JAVA_8 ) ; targetCt . writeFile ( genDirectory + "target/classes" ) ;
public class TaskContext { /** * Get a { @ link Extractor } instance . * @ return a { @ link Extractor } instance */ public Extractor getExtractor ( ) { } }
try { this . rawSourceExtractor = getSource ( ) . getExtractor ( this . taskState ) ; boolean throttlingEnabled = this . taskState . getPropAsBoolean ( ConfigurationKeys . EXTRACT_LIMIT_ENABLED_KEY , ConfigurationKeys . DEFAULT_EXTRACT_LIMIT_ENABLED ) ; if ( throttlingEnabled ) { Limiter limiter = DefaultLimiterFactory . newLimiter ( this . taskState ) ; if ( ! ( limiter instanceof NonRefillableLimiter ) ) { throw new IllegalArgumentException ( "The Limiter used with an Extractor should be an instance of " + NonRefillableLimiter . class . getSimpleName ( ) ) ; } return new LimitingExtractorDecorator < > ( this . rawSourceExtractor , limiter , this . taskState ) ; } return this . rawSourceExtractor ; } catch ( IOException ioe ) { throw new RuntimeException ( ioe ) ; }
public class CoreAuthenticationUtils { /** * Transform principal attributes into map . * Items in the list are defined in the syntax of " cn " , or " cn : commonName " for virtual renaming and maps . * @ param list the list * @ return the map */ public static Multimap < String , Object > transformPrincipalAttributesListIntoMultiMap ( final List < String > list ) { } }
val multimap = ArrayListMultimap . < String , Object > create ( ) ; if ( list . isEmpty ( ) ) { LOGGER . debug ( "No principal attributes are defined" ) ; } else { list . forEach ( a -> { val attributeName = a . trim ( ) ; if ( attributeName . contains ( ":" ) ) { val attrCombo = Splitter . on ( ":" ) . splitToList ( attributeName ) ; val name = attrCombo . get ( 0 ) . trim ( ) ; val value = attrCombo . get ( 1 ) . trim ( ) ; LOGGER . debug ( "Mapped principal attribute name [{}] to [{}]" , name , value ) ; multimap . put ( name , value ) ; } else { LOGGER . debug ( "Mapped principal attribute name [{}]" , attributeName ) ; multimap . put ( attributeName , attributeName ) ; } } ) ; } return multimap ;
public class JPAPersistenceManagerImpl { /** * DS inject */ @ Reference ( name = "jobStore" , target = "(id=unbound)" ) protected void setDatabaseStore ( DatabaseStore databaseStore , Map < String , Object > props ) { } }
this . databaseStore = databaseStore ; this . databaseStoreDisplayId = ( String ) props . get ( "config.displayId" ) ;
public class HK2WhenBinder { /** * Implement to provide binding definitions using the exposed binding * methods . */ @ Override protected void configure ( ) { } }
install ( new com . englishtown . promises . hk2 . WhenBinder ( ) ) ; bind ( VertxExecutor . class ) . to ( Executor . class ) . in ( Singleton . class ) . ranked ( 10 ) ; bind ( DefaultWhenVertx . class ) . to ( WhenVertx . class ) . in ( Singleton . class ) ; bind ( DefaultWhenEventBus . class ) . to ( WhenEventBus . class ) . in ( Singleton . class ) ; bind ( DefaultWhenHttpClient . class ) . to ( WhenHttpClient . class ) . in ( Singleton . class ) ; bind ( DefaultWhenFileSystem . class ) . to ( WhenFileSystem . class ) . in ( Singleton . class ) ; bind ( DefaultPromiseAdapter . class ) . to ( PromiseAdapter . class ) . in ( Singleton . class ) ;
public class SimpleJob { /** * Job Conbiner class setting . * @ param clazz { @ link Summarizer } class * @ param cache In - Mapper Combine output cahce number . Default value is 200. * @ return this */ public SimpleJob setCombiner ( Class < ? extends Reducer < Key , Value , Key , Value > > clazz , int cache ) throws IllegalStateException { } }
super . setCombinerClass ( clazz ) ; getConfiguration ( ) . setInt ( COMBINE_CACHE , cache ) ; return this ;
public class CassandraSchemaManager { /** * Creates the column families . * @ param tableInfos * the table infos * @ param ksDef * the ks def * @ throws Exception * the exception */ private void createColumnFamilies ( List < TableInfo > tableInfos , KsDef ksDef ) throws Exception { } }
for ( TableInfo tableInfo : tableInfos ) { if ( isCql3Enabled ( tableInfo ) ) { createOrUpdateUsingCQL3 ( tableInfo , ksDef ) ; createIndexUsingCql ( tableInfo ) ; } else { createOrUpdateColumnFamily ( tableInfo , ksDef ) ; } // Create Inverted Indexed Table if required . createInvertedIndexTable ( tableInfo , ksDef ) ; }
public class MatrixVectorReader { /** * Reads the vector info for the Matrix Market exchange format . The line * must consist of exactly 4 space - separated entries , the first being * " % % MatrixMarket " */ public VectorInfo readVectorInfo ( ) throws IOException { } }
String [ ] component = readTrimmedLine ( ) . split ( " +" ) ; if ( component . length != 4 ) throw new IOException ( "Current line unparsable. It must consist of 4 tokens" ) ; // Read header if ( ! component [ 0 ] . equalsIgnoreCase ( "%%MatrixMarket" ) ) throw new IOException ( "Not in Matrix Market exchange format" ) ; // This will always be " vector " if ( ! component [ 1 ] . equalsIgnoreCase ( "vector" ) ) throw new IOException ( "Expected \"vector\", got " + component [ 1 ] ) ; // Sparse or dense ? boolean sparse = false ; if ( component [ 2 ] . equalsIgnoreCase ( "coordinate" ) ) sparse = true ; else if ( component [ 2 ] . equalsIgnoreCase ( "array" ) ) sparse = false ; else throw new IOException ( "Unknown layout " + component [ 2 ] ) ; // Dataformat VectorInfo . VectorField field = null ; if ( component [ 3 ] . equalsIgnoreCase ( "real" ) ) field = VectorInfo . VectorField . Real ; else if ( component [ 3 ] . equalsIgnoreCase ( "integer" ) ) field = VectorInfo . VectorField . Integer ; else if ( component [ 3 ] . equalsIgnoreCase ( "complex" ) ) field = VectorInfo . VectorField . Complex ; else if ( component [ 3 ] . equalsIgnoreCase ( "pattern" ) ) field = VectorInfo . VectorField . Pattern ; else throw new IOException ( "Unknown field specification " + component [ 3 ] ) ; // Pack together . This also verifies the format return new VectorInfo ( sparse , field ) ;
public class RingPartitioner { /** * Partitions a RingSet into RingSets of connected rings . Rings which share * an Atom , a Bond or three or more atoms with at least on other ring in * the RingSet are considered connected . Thus molecules such as azulene and * indole will return a List with 1 element . * < p > Note that an isolated ring is considered to be < i > self - connect < / i > . As a result * a molecule such as biphenyl will result in a 2 - element List being returned ( each * element corresponding to a phenyl ring ) . * @ param ringSet The RingSet to be partitioned * @ return A { @ link List } of connected RingSets */ public static List < IRingSet > partitionRings ( IRingSet ringSet ) { } }
List < IRingSet > ringSets = new ArrayList < IRingSet > ( ) ; if ( ringSet . getAtomContainerCount ( ) == 0 ) return ringSets ; IRing ring = ( IRing ) ringSet . getAtomContainer ( 0 ) ; if ( ring == null ) return ringSets ; IRingSet rs = ring . getBuilder ( ) . newInstance ( IRingSet . class ) ; for ( int f = 0 ; f < ringSet . getAtomContainerCount ( ) ; f ++ ) { rs . addAtomContainer ( ringSet . getAtomContainer ( f ) ) ; } do { ring = ( IRing ) rs . getAtomContainer ( 0 ) ; IRingSet newRs = ring . getBuilder ( ) . newInstance ( IRingSet . class ) ; newRs . addAtomContainer ( ring ) ; ringSets . add ( walkRingSystem ( rs , ring , newRs ) ) ; } while ( rs . getAtomContainerCount ( ) > 0 ) ; return ringSets ;
public class ItemDAOImpl { @ Override public List < Item > getItemsSince ( long date ) { } }
Selector query = new Selector ( ) ; query . selectGreaterThan ( "publicationTime" , date ) ; long l = System . currentTimeMillis ( ) ; List < String > jsonItems = mongoHandler . findMany ( query , 0 ) ; l = System . currentTimeMillis ( ) - l ; System . out . println ( "Fetch time: " + l + " msecs" ) ; l = System . currentTimeMillis ( ) - l ; List < Item > results = new ArrayList < Item > ( ) ; for ( String json : jsonItems ) { results . add ( ItemFactory . create ( json ) ) ; } l = System . currentTimeMillis ( ) - l ; System . out . println ( "List time: " + l + " msecs" ) ; return results ;
public class ApiOvhDedicatedserver { /** * Alter this object properties * REST : PUT / dedicated / server / { serviceName } / features / firewall * @ param body [ required ] New object properties * @ param serviceName [ required ] The internal name of your dedicated server */ public void serviceName_features_firewall_PUT ( String serviceName , OvhFirewall body ) throws IOException { } }
String qPath = "/dedicated/server/{serviceName}/features/firewall" ; StringBuilder sb = path ( qPath , serviceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class DefaultNodeManager { /** * Deploys a verticle . */ private void doDeployVerticle ( final Message < JsonObject > message ) { } }
String main = message . body ( ) . getString ( "main" ) ; if ( main == null ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , "No verticle main specified." ) ) ; return ; } JsonObject config = message . body ( ) . getObject ( "config" ) ; if ( config == null ) { config = new JsonObject ( ) ; } int instances = message . body ( ) . getInteger ( "instances" , 1 ) ; boolean worker = message . body ( ) . getBoolean ( "worker" , false ) ; if ( worker ) { boolean multiThreaded = message . body ( ) . getBoolean ( "multi-threaded" , false ) ; platform . deployWorkerVerticle ( main , config , instances , multiThreaded , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , result . cause ( ) . getMessage ( ) ) ) ; } else { final String deploymentID = result . result ( ) ; context . execute ( new Action < String > ( ) { @ Override public String perform ( ) { deployments . put ( node , message . body ( ) . copy ( ) . putString ( "id" , deploymentID ) . encode ( ) ) ; return deploymentID ; } } , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { message . reply ( new JsonObject ( ) . putString ( "status" , "ok" ) . putString ( "id" , deploymentID ) ) ; } } ) ; } } } ) ; } else { platform . deployVerticle ( main , config , instances , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , result . cause ( ) . getMessage ( ) ) ) ; } else { final String deploymentID = result . result ( ) ; context . execute ( new Action < String > ( ) { @ Override public String perform ( ) { deployments . put ( node , message . body ( ) . copy ( ) . putString ( "id" , deploymentID ) . encode ( ) ) ; return deploymentID ; } } , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { message . reply ( new JsonObject ( ) . putString ( "status" , "ok" ) . putString ( "id" , deploymentID ) ) ; } } ) ; } } } ) ; }
public class StandardResponsesApi { /** * Get the attachment of the Standard Response * Get the attachment of the Standard Response specified in the documentId path parameter * @ param id id of the Standard Response ( required ) * @ param documentId id of document to get ( required ) * @ return ApiResponse & lt ; String & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < String > getStandardResponseAttachmentWithHttpInfo ( String id , String documentId ) throws ApiException { } }
com . squareup . okhttp . Call call = getStandardResponseAttachmentValidateBeforeCall ( id , documentId , null , null ) ; Type localVarReturnType = new TypeToken < String > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class InsnList { /** * Removes the given instruction from this list . * @ param insn * the instruction < i > of this list < / i > that must be removed . */ public void remove ( final AbstractInsnNode insn ) { } }
-- size ; AbstractInsnNode next = insn . next ; AbstractInsnNode prev = insn . prev ; if ( next == null ) { if ( prev == null ) { first = null ; last = null ; } else { prev . next = null ; last = prev ; } } else { if ( prev == null ) { first = next ; next . prev = null ; } else { prev . next = next ; next . prev = prev ; } } cache = null ; insn . index = - 1 ; // insn no longer belongs to an InsnList insn . prev = null ; insn . next = null ;
public class AbstractCommonShapeFileReader { /** * Replies the bounds read from the shape file header . * @ return the bounds or < code > null < / code > */ public ESRIBounds getBoundsFromHeader ( ) { } }
try { readHeader ( ) ; } catch ( IOException exception ) { return null ; } return new ESRIBounds ( this . minx , this . maxx , this . miny , this . maxy , this . minz , this . maxz , this . minm , this . maxm ) ;
public class TrueTypeFont { /** * Draw a string * @ param x * The x position to draw the string * @ param y * The y position to draw the string * @ param whatchars * The string to draw * @ param color * The color to draw the text */ public void drawString ( float x , float y , String whatchars , org . newdawn . slick . Color color ) { } }
drawString ( x , y , whatchars , color , 0 , whatchars . length ( ) - 1 ) ;
public class SVNCommands { /** * Revert all changes pending in the given SVN Working Copy . * @ param directory The local working directory * @ throws IOException Execution of the SVN sub - process failed or the * sub - process returned a exit value indicating a failure */ public static void revertAll ( File directory ) throws IOException { } }
log . info ( "Reverting SVN Working copy at " + directory ) ; CommandLine cmdLine = new CommandLine ( SVN_CMD ) ; cmdLine . addArgument ( CMD_REVERT ) ; addDefaultArguments ( cmdLine , null , null ) ; cmdLine . addArgument ( OPT_DEPTH ) ; cmdLine . addArgument ( INFINITY ) ; cmdLine . addArgument ( directory . getAbsolutePath ( ) ) ; try ( InputStream result = ExecutionHelper . getCommandResult ( cmdLine , directory , 0 , 120000 ) ) { log . info ( "Svn-RevertAll reported:\n" + extractResult ( result ) ) ; }
public class Rectangle { /** * Gets a Rectangle that is altered to fit on the page . * @ param topthe top position * @ param bottomthe bottom position * @ return a < CODE > Rectangle < / CODE > */ public Rectangle rectangle ( float top , float bottom ) { } }
Rectangle tmp = new Rectangle ( this ) ; if ( getTop ( ) > top ) { tmp . setTop ( top ) ; tmp . disableBorderSide ( TOP ) ; } if ( getBottom ( ) < bottom ) { tmp . setBottom ( bottom ) ; tmp . disableBorderSide ( BOTTOM ) ; } return tmp ;
public class MappingsManager { /** * Add a mappings configuration bean to the actual context . * @ param other * the mappings bean to add */ public void addMappings ( Mappings other ) { } }
mappings . getKeywords ( ) . addAll ( other . getKeywords ( ) ) ; mappings . getClasses ( ) . addAll ( other . getClasses ( ) ) ; mappings . getNamespaces ( ) . addAll ( other . getNamespaces ( ) ) ;
public class DescribeProvisionedProductPlanResult { /** * Information about the resource changes that will occur when the plan is executed . * @ param resourceChanges * Information about the resource changes that will occur when the plan is executed . */ public void setResourceChanges ( java . util . Collection < ResourceChange > resourceChanges ) { } }
if ( resourceChanges == null ) { this . resourceChanges = null ; return ; } this . resourceChanges = new java . util . ArrayList < ResourceChange > ( resourceChanges ) ;
public class Filters { /** * Updates the filter on the provided FullFrameRect * @ return the int code of the new filter */ public static void updateFilter ( FullFrameRect rect , int newFilter ) { } }
Texture2dProgram . ProgramType programType ; float [ ] kernel = null ; float colorAdj = 0.0f ; if ( VERBOSE ) Log . d ( TAG , "Updating filter to " + newFilter ) ; switch ( newFilter ) { case FILTER_NONE : programType = Texture2dProgram . ProgramType . TEXTURE_EXT ; break ; case FILTER_BLACK_WHITE : // ( In a previous version the TEXTURE _ EXT _ BW variant was enabled by a flag called // ROSE _ COLORED _ GLASSES , because the shader set the red channel to the B & W color // and green / blue to zero . ) programType = Texture2dProgram . ProgramType . TEXTURE_EXT_BW ; break ; case FILTER_NIGHT : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_NIGHT ; break ; case FILTER_CHROMA_KEY : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_CHROMA_KEY ; break ; case FILTER_SQUEEZE : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_SQUEEZE ; break ; case FILTER_TWIRL : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_TWIRL ; break ; case FILTER_TUNNEL : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_TUNNEL ; break ; case FILTER_BULGE : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_BULGE ; break ; case FILTER_DENT : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_DENT ; break ; case FILTER_FISHEYE : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_FISHEYE ; break ; case FILTER_STRETCH : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_STRETCH ; break ; case FILTER_MIRROR : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_MIRROR ; break ; case FILTER_BLUR : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_FILT ; kernel = new float [ ] { 1f / 16f , 2f / 16f , 1f / 16f , 2f / 16f , 4f / 16f , 2f / 16f , 1f / 16f , 2f / 16f , 1f / 16f } ; break ; case FILTER_SHARPEN : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_FILT ; kernel = new float [ ] { 0f , - 1f , 0f , - 1f , 5f , - 1f , 0f , - 1f , 0f } ; break ; case FILTER_EDGE_DETECT : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_FILT ; kernel = new float [ ] { - 1f , - 1f , - 1f , - 1f , 8f , - 1f , - 1f , - 1f , - 1f } ; break ; case FILTER_EMBOSS : programType = Texture2dProgram . ProgramType . TEXTURE_EXT_FILT ; kernel = new float [ ] { 2f , 0f , 0f , 0f , - 1f , 0f , 0f , 0f , - 1f } ; colorAdj = 0.5f ; break ; default : throw new RuntimeException ( "Unknown filter mode " + newFilter ) ; } // Do we need a whole new program ? ( We want to avoid doing this if we don ' t have // too - - compiling a program could be expensive . ) if ( programType != rect . getProgram ( ) . getProgramType ( ) ) { rect . changeProgram ( new Texture2dProgram ( programType ) ) ; } // Update the filter kernel ( if any ) . if ( kernel != null ) { rect . getProgram ( ) . setKernel ( kernel , colorAdj ) ; }
public class Spies { /** * Proxies a binary function spying for result . * @ param < T1 > the function first parameter type * @ param < T2 > the function second parameter type * @ param < R > the function result type * @ param function the function that will be spied * @ param result a box that will be containing spied result * @ return the proxied function */ public static < T1 , T2 , R > BiFunction < T1 , T2 , R > spyRes ( BiFunction < T1 , T2 , R > function , Box < R > result ) { } }
return spy ( function , result , Box . < T1 > empty ( ) , Box . < T2 > empty ( ) ) ;
public class SipApplicationSessionImpl { /** * Does it need to be synchronized ? */ protected Map < String , Object > getAttributeMap ( ) { } }
if ( sipApplicationSessionAttributeMap == null ) { sipApplicationSessionAttributeMap = new ConcurrentHashMap < String , Object > ( ) ; } return sipApplicationSessionAttributeMap ;
public class Op { /** * Creates a list with the specified elements and an < i > operation expression < / i > on it . * @ param elements the elements of the list being created * @ return an operator , ready for chaining */ public static < T > Level0ListOperator < List < T > , T > onListFor ( final T ... elements ) { } }
return new Level0ListOperator < List < T > , T > ( ExecutionTarget . forOp ( VarArgsUtil . asRequiredObjectList ( elements ) , Normalisation . LIST ) ) ;
public class FileSystemUtil { /** * URL decodes a path element */ private static String decode ( String pathElement ) { } }
try { return URLDecoder . decode ( pathElement , Charsets . UTF_8 . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw Throwables . propagate ( e ) ; // Should never happen }
public class StringUtils { /** * Calls { @ link String # getBytes ( Charset ) } * @ param string * The string to encode ( if null , return null ) . * @ param charset * The { @ link Charset } to encode the { @ code String } * @ return the encoded bytes */ private static byte [ ] getBytes ( String string , Charset charset ) { } }
if ( string == null ) { return null ; } return string . getBytes ( charset ) ;
public class CryptoModuleDispatcher { /** * { @ inheritDoc } * < b > NOTE : < / b > Because the encryption process requires context from block * N - 1 in order to encrypt block N , parts uploaded with the * AmazonS3EncryptionClient ( as opposed to the normal AmazonS3Client ) must * be uploaded serially , and in order . Otherwise , the previous encryption * context isn ' t available to use when encrypting the current part . */ @ Override public UploadPartResult uploadPartSecurely ( UploadPartRequest req ) throws SdkClientException , AmazonServiceException { } }
return defaultCryptoMode == EncryptionOnly ? eo . uploadPartSecurely ( req ) : ae . uploadPartSecurely ( req ) ;
public class DataMediaPairServiceImpl { private DataMediaPair doToModel ( DataMediaPairDO dataMediaPairDo , List < ColumnPair > columnPairs , List < ColumnGroup > columnGroups ) { } }
DataMediaPair dataMediaPair = new DataMediaPair ( ) ; try { dataMediaPair . setId ( dataMediaPairDo . getId ( ) ) ; dataMediaPair . setPipelineId ( dataMediaPairDo . getPipelineId ( ) ) ; dataMediaPair . setPullWeight ( dataMediaPairDo . getPullWeight ( ) ) ; dataMediaPair . setPushWeight ( dataMediaPairDo . getPushWeight ( ) ) ; if ( StringUtils . isNotBlank ( dataMediaPairDo . getFilter ( ) ) ) { dataMediaPair . setFilterData ( JsonUtils . unmarshalFromString ( dataMediaPairDo . getFilter ( ) , ExtensionData . class ) ) ; } if ( StringUtils . isNotBlank ( dataMediaPairDo . getResolver ( ) ) ) { dataMediaPair . setResolverData ( JsonUtils . unmarshalFromString ( dataMediaPairDo . getResolver ( ) , ExtensionData . class ) ) ; } dataMediaPair . setColumnPairs ( columnPairs ) ; dataMediaPair . setColumnGroups ( columnGroups ) ; dataMediaPair . setColumnPairMode ( dataMediaPairDo . getColumnPairMode ( ) ) ; dataMediaPair . setGmtCreate ( dataMediaPairDo . getGmtCreate ( ) ) ; dataMediaPair . setGmtModified ( dataMediaPairDo . getGmtModified ( ) ) ; // 组装DataMedia List < DataMedia > dataMedias = dataMediaService . listByIds ( dataMediaPairDo . getSourceDataMediaId ( ) , dataMediaPairDo . getTargetDataMediaId ( ) ) ; if ( null == dataMedias || dataMedias . size ( ) != 2 ) { // 抛出异常 return dataMediaPair ; } for ( DataMedia dataMedia : dataMedias ) { if ( dataMedia . getId ( ) . equals ( dataMediaPairDo . getSourceDataMediaId ( ) ) ) { dataMediaPair . setSource ( dataMedia ) ; } else if ( dataMedia . getId ( ) . equals ( dataMediaPairDo . getTargetDataMediaId ( ) ) ) { dataMediaPair . setTarget ( dataMedia ) ; } } } catch ( Exception e ) { logger . error ( "ERROR ## change the dataMediaPair Do to Model has an exception" , e ) ; throw new ManagerException ( e ) ; } return dataMediaPair ;
public class DeviceImpl { private void setNotActive ( final String [ ] names ) throws DevFailed { } }
for ( final String name : names ) { dev_attr . get_attr_by_name ( name ) . setActive ( false ) ; }
public class RefactoringUtils { /** * Looks for a goog . require ( ) , goog . provide ( ) or goog . module ( ) call in the node ' s file . */ public static boolean isInClosurizedFile ( Node node , NodeMetadata metadata ) { } }
Node script = NodeUtil . getEnclosingScript ( node ) ; if ( script == null ) { return false ; } Node child = script . getFirstChild ( ) ; while ( child != null ) { if ( NodeUtil . isExprCall ( child ) ) { if ( Matchers . googRequire ( ) . matches ( child . getFirstChild ( ) , metadata ) ) { return true ; } // goog . require or goog . module . } else if ( child . isVar ( ) && child . getBooleanProp ( Node . IS_NAMESPACE ) ) { return true ; } child = child . getNext ( ) ; } return false ;
public class ImplicitScanner2 { /** * syck _ tagcmp */ public static boolean tagcmp ( String tag1 , String tag2 ) { } }
if ( tag1 == tag2 ) return true ; if ( tag1 == null || tag2 == null ) return false ; if ( tag1 . equals ( tag2 ) ) return true ; int slen1 = tag1 . indexOf ( '#' ) ; if ( slen1 == - 1 ) slen1 = tag1 . length ( ) ; int slen2 = tag2 . indexOf ( '#' ) ; if ( slen2 == - 1 ) slen2 = tag2 . length ( ) ; return tag1 . substring ( 0 , slen1 ) . equals ( tag2 . substring ( 0 , slen2 ) ) ;
public class Model { /** * Deletes immediate polymorphic children */ private void deletePolymorphicChildrenShallow ( OneToManyPolymorphicAssociation association ) { } }
String targetTable = metaModelOf ( association . getTargetClass ( ) ) . getTableName ( ) ; String parentType = association . getTypeLabel ( ) ; new DB ( metaModelLocal . getDbName ( ) ) . exec ( "DELETE FROM " + targetTable + " WHERE parent_id = ? AND parent_type = ?" , getId ( ) , parentType ) ;
public class NettyMessagingService { /** * Binds the given bootstrap to the appropriate interfaces . * @ param bootstrap the bootstrap to bind * @ return a future to be completed once the bootstrap has been bound to all interfaces */ private CompletableFuture < Void > bind ( ServerBootstrap bootstrap ) { } }
CompletableFuture < Void > future = new CompletableFuture < > ( ) ; int port = config . getPort ( ) != null ? config . getPort ( ) : returnAddress . port ( ) ; if ( config . getInterfaces ( ) . isEmpty ( ) ) { bind ( bootstrap , Lists . newArrayList ( "0.0.0.0" ) . iterator ( ) , port , future ) ; } else { bind ( bootstrap , config . getInterfaces ( ) . iterator ( ) , port , future ) ; } return future ;