signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DefaultVOMSTrustStore { /** * Builds a list of trusted directories containing only * { @ link # DEFAULT _ VOMS _ DIR } . * @ return a list of default trusted directory containing the * { @ link # DEFAULT _ VOMS _ DIR } */ protected static List < String > buildDefaultTrustedDirs ( ) { } }
List < String > tDirs = new ArrayList < String > ( ) ; tDirs . add ( DEFAULT_VOMS_DIR ) ; return tDirs ;
public class AudioFactory { /** * Load an audio file and prepare it to be played . * @ param media The audio media ( must not be < code > null < / code > ) . * @ return The loaded audio . * @ throws LionEngineException If invalid audio . */ public static synchronized Audio loadAudio ( Media media ) { } }
Check . notNull ( media ) ; final String extension = UtilFile . getExtension ( media . getPath ( ) ) ; return Optional . ofNullable ( FACTORIES . get ( extension ) ) . orElseThrow ( ( ) -> new LionEngineException ( media , ERROR_FORMAT ) ) . loadAudio ( media ) ;
public class ClientVpnEndpoint { /** * Information about the authentication method used by the Client VPN endpoint . * @ return Information about the authentication method used by the Client VPN endpoint . */ public java . util . List < ClientVpnAuthentication > getAuthenticationOptions ( ) { } }
if ( authenticationOptions == null ) { authenticationOptions = new com . amazonaws . internal . SdkInternalList < ClientVpnAuthentication > ( ) ; } return authenticationOptions ;
public class BeanTypeImpl { /** * Returns all < code > method < / code > elements * @ return list of < code > method < / code > */ public List < MethodType < BeanType < T > > > getAllMethod ( ) { } }
List < MethodType < BeanType < T > > > list = new ArrayList < MethodType < BeanType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "method" ) ; for ( Node node : nodeList ) { MethodType < BeanType < T > > type = new MethodTypeImpl < BeanType < T > > ( this , "method" , childNode , node ) ; list . add ( type ) ; } return list ;
public class AbstractJsonGetter { /** * Traverses given array . If { @ code cursor # getNext ( ) } is * { @ code null } , this method adds all the scalar values in current * array to the result . Otherwise , it traverses all objects in * given array and adds their scalar values named * { @ code cursor # getNext ( ) } to the result . * Assumes the parser points to an array . * @ param parser * @ param cursor * @ return All matches in the current array that conform to * [ any ] . lastPath search * @ throws IOException */ private MultiResult getMultiValue ( JsonParser parser , JsonPathCursor cursor ) throws IOException { } }
cursor . getNext ( ) ; MultiResult < Object > multiResult = new MultiResult < Object > ( ) ; JsonToken currentToken = parser . currentToken ( ) ; if ( currentToken != JsonToken . START_ARRAY ) { return null ; } while ( true ) { currentToken = parser . nextToken ( ) ; if ( currentToken == JsonToken . END_ARRAY ) { break ; } if ( cursor . getCurrent ( ) == null ) { if ( currentToken . isScalarValue ( ) ) { multiResult . add ( convertJsonTokenToValue ( parser ) ) ; } else { parser . skipChildren ( ) ; } } else { if ( currentToken == JsonToken . START_OBJECT && findAttribute ( parser , cursor ) ) { multiResult . add ( convertJsonTokenToValue ( parser ) ) ; while ( parser . getCurrentToken ( ) != JsonToken . END_OBJECT ) { if ( parser . currentToken ( ) . isStructStart ( ) ) { parser . skipChildren ( ) ; } parser . nextToken ( ) ; } } else if ( currentToken == JsonToken . START_ARRAY ) { parser . skipChildren ( ) ; } } } return multiResult ;
public class NetworkInterfaceIPConfigurationsInner { /** * Gets the specified network interface ip configuration . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ param ipConfigurationName The name of the ip configuration name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the NetworkInterfaceIPConfigurationInner object */ public Observable < NetworkInterfaceIPConfigurationInner > getAsync ( String resourceGroupName , String networkInterfaceName , String ipConfigurationName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , ipConfigurationName ) . map ( new Func1 < ServiceResponse < NetworkInterfaceIPConfigurationInner > , NetworkInterfaceIPConfigurationInner > ( ) { @ Override public NetworkInterfaceIPConfigurationInner call ( ServiceResponse < NetworkInterfaceIPConfigurationInner > response ) { return response . body ( ) ; } } ) ;
public class DescribeDatasetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeDatasetRequest describeDatasetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeDatasetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeDatasetRequest . getIdentityPoolId ( ) , IDENTITYPOOLID_BINDING ) ; protocolMarshaller . marshall ( describeDatasetRequest . getIdentityId ( ) , IDENTITYID_BINDING ) ; protocolMarshaller . marshall ( describeDatasetRequest . getDatasetName ( ) , DATASETNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ArgUtils { /** * 検証対象の値が 、 指定したクラスを継承しているかどうか検証する 。 * @ since 2.0 * @ param arg 検証対象の値 * @ param clazz 親クラス * @ param name 検証対象の引数の名前 */ public static void instanceOf ( final Object arg , final Class < ? > clazz , final String name ) { } }
if ( arg == null ) { throw new IllegalArgumentException ( String . format ( "%s should not be null." , name ) ) ; } if ( ! clazz . isAssignableFrom ( arg . getClass ( ) ) ) { throw new IllegalArgumentException ( String . format ( "%s should not be class with '%s'." , name , clazz . getName ( ) ) ) ; }
public class TrainingsImpl { /** * Gets the number of untagged images . * This API returns the images which have no tags for a given project and optionally an iteration . If no iteration is specified the * current workspace is used . * @ param projectId The project id * @ param getUntaggedImageCountOptionalParameter the object representing the optional parameters to be set before calling this API * @ 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 int object if successful . */ public int getUntaggedImageCount ( UUID projectId , GetUntaggedImageCountOptionalParameter getUntaggedImageCountOptionalParameter ) { } }
return getUntaggedImageCountWithServiceResponseAsync ( projectId , getUntaggedImageCountOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ActivationDeployment { /** * Stop */ public void stop ( ) { } }
for ( org . ironjacamar . core . api . deploymentrepository . Deployment d : deployments ) { try { d . deactivate ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { deploymentRepository . unregisterDeployment ( d ) ; } }
public class MultiLineString { /** * Create a new instance of this class by passing in a single { @ link LineString } object . The * LineStrings should comply with the GeoJson specifications described in the documentation . * @ param lineString a single LineString which make up this MultiLineString * @ return a new instance of this class defined by the values passed inside this static factory * method * @ since 3.0.0 */ public static MultiLineString fromLineString ( @ NonNull LineString lineString ) { } }
List < List < Point > > coordinates = Arrays . asList ( lineString . coordinates ( ) ) ; return new MultiLineString ( TYPE , null , coordinates ) ;
public class EventUtils { /** * Adds an event listener to the specified source . This looks for an " add " method corresponding to the event * type ( addActionListener , for example ) . * @ param eventSource the event source * @ param listenerType the event listener type * @ param listener the listener * @ param < L > the event listener type * @ throws IllegalArgumentException if the object doesn ' t support the listener type */ public static < L > void addEventListener ( final Object eventSource , final Class < L > listenerType , final L listener ) { } }
try { MethodUtils . invokeMethod ( eventSource , "add" + listenerType . getSimpleName ( ) , listener ) ; } catch ( final NoSuchMethodException e ) { throw new IllegalArgumentException ( "Class " + eventSource . getClass ( ) . getName ( ) + " does not have a public add" + listenerType . getSimpleName ( ) + " method which takes a parameter of type " + listenerType . getName ( ) + "." ) ; } catch ( final IllegalAccessException e ) { throw new IllegalArgumentException ( "Class " + eventSource . getClass ( ) . getName ( ) + " does not have an accessible add" + listenerType . getSimpleName ( ) + " method which takes a parameter of type " + listenerType . getName ( ) + "." ) ; } catch ( final InvocationTargetException e ) { throw new RuntimeException ( "Unable to add listener." , e . getCause ( ) ) ; }
public class MeasureOverview { /** * Updates the measure overview . If no measures are currently to display , * reset the display to hyphens . Otherwise display the last measured and * mean values . */ public void update ( ) { } }
if ( this . measures == null || this . measures . length == 0 ) { // no measures to show - > empty entries for ( int i = 0 ; i < this . currentValues . length ; i ++ ) { this . currentValues [ i ] . setText ( "-" ) ; this . meanValues [ i ] . setText ( "-" ) ; } return ; } DecimalFormat d = new DecimalFormat ( "0.00" ) ; MeasureCollection mc ; if ( this . measures . length > this . measureCollectionSelected ) { mc = this . measures [ this . measureCollectionSelected ] ; } else { mc = this . measures [ 0 ] ; } for ( int i = 0 ; i < this . currentValues . length ; i ++ ) { // set current value if ( Double . isNaN ( mc . getLastValue ( i ) ) ) { this . currentValues [ i ] . setText ( "-" ) ; } else { this . currentValues [ i ] . setText ( d . format ( mc . getLastValue ( i ) ) ) ; } // set mean value if ( Double . isNaN ( mc . getMean ( i ) ) ) { this . meanValues [ i ] . setText ( "-" ) ; } else { this . meanValues [ i ] . setText ( d . format ( mc . getMean ( i ) ) ) ; } }
public class Base64Encoder { /** * Returns the encoded form of the given unencoded string . * @ param bytes the bytes to encode * @ return the encoded form of the unencoded string */ public static String encode ( byte [ ] bytes ) { } }
if ( null == bytes ) { return null ; } ByteArrayOutputStream out = new ByteArrayOutputStream ( ( int ) ( bytes . length * 1.37 ) ) ; Base64Encoder encodedOut = new Base64Encoder ( out ) ; try { encodedOut . write ( bytes ) ; encodedOut . close ( ) ; return out . toString ( "UTF-8" ) ; } catch ( IOException ignored ) { return null ; }
public class IfcProductImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcRelAssignsToProduct > getReferencedBy ( ) { } }
return ( EList < IfcRelAssignsToProduct > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PRODUCT__REFERENCED_BY , true ) ;
import java . util . * ; public class ReorganizeWords { /** * Function to reverse the sequence of words in a supplied string . * Examples : * reorganize _ words ( ' python program ' ) - > ' program python ' * reorganize _ words ( ' java language ' ) - > ' language java ' * reorganize _ words ( ' indian man ' ) - > ' man indian ' * @ param strInput A string whose word order needs to be reversed . * @ return Returns the input string with the order of words reversed . */ public static String reorganizeWords ( String strInput ) { } }
List < String > words = Arrays . asList ( strInput . split ( " " ) ) ; Collections . reverse ( words ) ; return String . join ( " " , words ) ;
public class Normalizer { /** * Concatenate normalized strings , making sure that the result is normalized * as well . * If both the left and the right strings are in * the normalization form according to " mode " , * then the result will be * < code > * dest = normalize ( left + right , mode ) * < / code > * For details see concatenate * @ param left Left source string . * @ param right Right source string . * @ param mode The normalization mode . * @ param options The normalization options , ORed together ( 0 for no options ) . * @ return result * @ see # concatenate * @ see # normalize * @ see # next * @ see # previous * @ see # concatenate * @ deprecated ICU 56 Use { @ link Normalizer2 } instead . * @ hide original deprecated declaration */ @ Deprecated public static String concatenate ( char [ ] left , char [ ] right , Mode mode , int options ) { } }
StringBuilder dest = new StringBuilder ( left . length + right . length + 16 ) . append ( left ) ; return mode . getNormalizer2 ( options ) . append ( dest , CharBuffer . wrap ( right ) ) . toString ( ) ;
public class DistributionSetSelectComboBox { /** * Overriden in order to return the caption for the selected distribution * set from cache . Otherwise , it could lead to multiple database queries , * trying to retrieve the caption from container , when it is not present in * filtered options . * @ param itemId * the Id of the selected distribution set * @ return the option caption ( name : version ) of the selected distribution * set */ @ Override public String getItemCaption ( final Object itemId ) { } }
if ( itemId != null && itemId . equals ( getValue ( ) ) && ! StringUtils . isEmpty ( selectedValueCaption ) ) { return selectedValueCaption ; } return super . getItemCaption ( itemId ) ;
public class CMap { /** * This will add a mapping . * @ param src The src to the mapping . * @ param dest The dest to the mapping . * @ throws IOException if the src is invalid . */ public void addMapping ( byte [ ] src , String dest ) throws IOException { } }
if ( src . length == 1 ) { singleByteMappings . put ( Integer . valueOf ( src [ 0 ] & 0xff ) , dest ) ; } else if ( src . length == 2 ) { int intSrc = src [ 0 ] & 0xFF ; intSrc <<= 8 ; intSrc |= ( src [ 1 ] & 0xFF ) ; doubleByteMappings . put ( Integer . valueOf ( intSrc ) , dest ) ; } else { throw new IOException ( "Mapping code should be 1 or two bytes and not " + src . length ) ; }
public class JsonUtils { /** * Used to obtain a JSONified object from a string * @ param jsonAsString the json object represented in string form * @ return the JSONified object representation if the input is a valid json string * if the input is not a valid json string , it will be returned as - is and no exception is thrown */ private Object getJson ( String jsonAsString ) { } }
try { return objectMapper . readValue ( jsonAsString , Object . class ) ; } catch ( Exception e ) { logger . info ( "Unable to parse (json?) string: {}" , jsonAsString , e ) ; return jsonAsString ; }
public class CompressionFactory { /** * Float currently does not support any encoding types , and stores values as 4 byte float */ public static Supplier < ColumnarFloats > getFloatSupplier ( int totalSize , int sizePer , ByteBuffer fromBuffer , ByteOrder order , CompressionStrategy strategy ) { } }
if ( strategy == CompressionStrategy . NONE ) { return new EntireLayoutColumnarFloatsSupplier ( totalSize , fromBuffer , order ) ; } else { return new BlockLayoutColumnarFloatsSupplier ( totalSize , sizePer , fromBuffer , order , strategy ) ; }
public class KeyVaultClientBaseImpl { /** * List storage accounts managed by the specified key vault . This operation requires the storage / list permission . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; StorageAccountItem & gt ; object */ public Observable < Page < StorageAccountItem > > getStorageAccountsNextAsync ( final String nextPageLink ) { } }
return getStorageAccountsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < StorageAccountItem > > , Page < StorageAccountItem > > ( ) { @ Override public Page < StorageAccountItem > call ( ServiceResponse < Page < StorageAccountItem > > response ) { return response . body ( ) ; } } ) ;
public class GeopaparazziController { /** * Extract data from the db and add them to the map view . * @ param projectTemplate * @ return * @ throws Exception */ public void loadProjectData ( ProjectInfo currentSelectedProject , boolean zoomTo ) throws Exception { } }
if ( geopapDataLayer != null ) geopapDataLayer . removeAllRenderables ( ) ; Envelope bounds = new Envelope ( ) ; File dbFile = currentSelectedProject . databaseFile ; try ( Connection connection = DriverManager . getConnection ( "jdbc:sqlite:" + dbFile . getAbsolutePath ( ) ) ) { // NOTES List < String [ ] > noteDataList = GeopaparazziUtilities . getNotesText ( connection ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "\n\n// GP NOTES\n" ) ; int index = 0 ; PointPlacemarkAttributes notesAttributes = new PointPlacemarkAttributes ( ) ; // notesAttributes . setLabelMaterial ( mFillMaterial ) ; // notesAttributes . setLineMaterial ( mFillMaterial ) ; // notesAttributes . setUsePointAsDefaultImage ( true ) ; notesAttributes . setImage ( ImageCache . getInstance ( ) . getBufferedImage ( ImageCache . NOTE ) ) ; notesAttributes . setLabelMaterial ( new Material ( Color . BLACK ) ) ; // notesAttributes . setScale ( mMarkerSize ) ; for ( String [ ] noteData : noteDataList ) { // [ lon , lat , altim , dateTimeString , text , descr ] double lon = Double . parseDouble ( noteData [ 0 ] ) ; double lat = Double . parseDouble ( noteData [ 1 ] ) ; String altim = noteData [ 2 ] ; String date = noteData [ 3 ] ; String text = noteData [ 4 ] ; String descr = noteData [ 5 ] ; PointPlacemark marker = new PointPlacemark ( Position . fromDegrees ( lat , lon , 0 ) ) ; marker . setAltitudeMode ( WorldWind . CLAMP_TO_GROUND ) ; marker . setLabelText ( text + " (" + date + ")" ) ; marker . setAttributes ( notesAttributes ) ; if ( geopapDataLayer != null ) geopapDataLayer . addRenderable ( marker ) ; bounds . expandToInclude ( lon , lat ) ; } /* * IMAGES */ PointPlacemarkAttributes imageAttributes = new PointPlacemarkAttributes ( ) ; imageAttributes . setImage ( ImageCache . getInstance ( ) . getBufferedImage ( ImageCache . DBIMAGE ) ) ; imageAttributes . setLabelMaterial ( new Material ( Color . GRAY ) ) ; for ( org . hortonmachine . gears . io . geopaparazzi . geopap4 . Image image : currentSelectedProject . images ) { double lon = image . getLon ( ) ; double lat = image . getLat ( ) ; PointPlacemark marker = new PointPlacemark ( Position . fromDegrees ( lat , lon , 0 ) ) ; marker . setAltitudeMode ( WorldWind . CLAMP_TO_GROUND ) ; marker . setLabelText ( image . getName ( ) ) ; marker . setAttributes ( imageAttributes ) ; if ( geopapDataLayer != null ) geopapDataLayer . addRenderable ( marker ) ; bounds . expandToInclude ( lon , lat ) ; } try ( Statement statement = connection . createStatement ( ) ) { statement . setQueryTimeout ( 30 ) ; // set timeout to 30 sec . String sql = "select " + GpsLogsTableFields . COLUMN_ID . getFieldName ( ) + "," + GpsLogsTableFields . COLUMN_LOG_STARTTS . getFieldName ( ) + "," + GpsLogsTableFields . COLUMN_LOG_ENDTS . getFieldName ( ) + "," + GpsLogsTableFields . COLUMN_LOG_TEXT . getFieldName ( ) + " from " + TABLE_GPSLOGS ; boolean useGpsElev = _useGpsElevationsCheckbox . isSelected ( ) ; int altitudeMode = WorldWind . CLAMP_TO_GROUND ; if ( useGpsElev ) { altitudeMode = WorldWind . ABSOLUTE ; } // first get the logs ResultSet rs = statement . executeQuery ( sql ) ; while ( rs . next ( ) ) { long id = rs . getLong ( 1 ) ; long startDateTime = rs . getLong ( 2 ) ; String startDateTimeString = ETimeUtilities . INSTANCE . TIME_FORMATTER_LOCAL . format ( new Date ( startDateTime ) ) ; long endDateTime = rs . getLong ( 3 ) ; String endDateTimeString = ETimeUtilities . INSTANCE . TIME_FORMATTER_LOCAL . format ( new Date ( endDateTime ) ) ; String text = rs . getString ( 4 ) ; // points String query = "select " + GpsLogsDataTableFields . COLUMN_DATA_LAT . getFieldName ( ) + "," + GpsLogsDataTableFields . COLUMN_DATA_LON . getFieldName ( ) + "," + GpsLogsDataTableFields . COLUMN_DATA_ALTIM . getFieldName ( ) + "," + GpsLogsDataTableFields . COLUMN_DATA_TS . getFieldName ( ) + " from " + TABLE_GPSLOG_DATA + " where " + GpsLogsDataTableFields . COLUMN_LOGID . getFieldName ( ) + " = " + id + " order by " + GpsLogsDataTableFields . COLUMN_DATA_TS . getFieldName ( ) ; List < Position > verticesList = new ArrayList < > ( ) ; try ( Statement newStatement = connection . createStatement ( ) ) { newStatement . setQueryTimeout ( 30 ) ; ResultSet result = newStatement . executeQuery ( query ) ; while ( result . next ( ) ) { double lat = result . getDouble ( 1 ) ; double lon = result . getDouble ( 2 ) ; double elev = 0.0 ; if ( useGpsElev ) elev = result . getDouble ( 3 ) ; Position pos = Position . fromDegrees ( lat , lon , elev ) ; verticesList . add ( pos ) ; bounds . expandToInclude ( lon , lat ) ; } } // color String colorQuery = "select " + GpsLogsPropertiesTableFields . COLUMN_PROPERTIES_COLOR . getFieldName ( ) + "," + GpsLogsPropertiesTableFields . COLUMN_PROPERTIES_WIDTH . getFieldName ( ) + " from " + TABLE_GPSLOG_PROPERTIES + " where " + GpsLogsPropertiesTableFields . COLUMN_LOGID . getFieldName ( ) + " = " + id ; String colorStr = RED_HEXA ; int lineWidth = 3 ; try ( Statement newStatement = connection . createStatement ( ) ) { newStatement . setQueryTimeout ( 30 ) ; ResultSet result = newStatement . executeQuery ( colorQuery ) ; if ( result . next ( ) ) { colorStr = result . getString ( 1 ) ; lineWidth = result . getInt ( 2 ) ; if ( colorStr . equalsIgnoreCase ( "red" ) ) { colorStr = RED_HEXA ; } } if ( colorStr == null || colorStr . length ( ) == 0 ) { colorStr = RED_HEXA ; } } Color color = Color . RED ; try { color = Color . decode ( colorStr ) ; } catch ( Exception e ) { // ignore Logger . INSTANCE . insertError ( " " , " Could not convert color : " + // colorStr , e ) ; } BasicShapeAttributes lineAttributes = new BasicShapeAttributes ( ) ; lineAttributes . setOutlineMaterial ( new Material ( color ) ) ; lineAttributes . setOutlineWidth ( lineWidth ) ; Path path = new Path ( verticesList ) ; path . setAltitudeMode ( altitudeMode ) ; path . setFollowTerrain ( true ) ; path . setAttributes ( lineAttributes ) ; if ( geopapDataLayer != null ) geopapDataLayer . addRenderable ( path ) ; } } } if ( zoomTo ) { bounds . expandBy ( 0.001 ) ; Sector sector = NwwUtilities . envelope2Sector ( new ReferencedEnvelope ( bounds , NwwUtilities . GPS_CRS ) ) ; if ( wwjPanel != null ) wwjPanel . goTo ( sector , false ) ; } currentLoadedProject = currentSelectedProject ;
public class PowerMock { /** * A utility method that may be used to mock several < b > static < / b > methods * ( nice ) in an easy way ( by just passing in the method names of the method * you wish to mock ) . Note that you cannot uniquely specify a method to mock * using this method if there are several methods with the same name in * { @ code type } . This method will mock ALL methods that match the * supplied name regardless of parameter types and signature . If this is the * case you should fall - back on using the * { @ link # mockStaticStrict ( Class , Method . . . ) } method instead . * @ param clazz The class that contains the static methods that should be * mocked . * @ param methodNames The names of the methods that should be mocked . If * { @ code null } , then this method will have the same effect * as just calling { @ link # mockStatic ( Class , Method . . . ) } with the * second parameter as { @ code new Method [ 0 ] } ( i . e . all * methods in that class will be mocked ) . */ public static synchronized void mockStaticPartialNice ( Class < ? > clazz , String ... methodNames ) { } }
mockStaticNice ( clazz , Whitebox . getMethods ( clazz , methodNames ) ) ;
public class ExecutionTraceInspections { /** * Utility methods . */ private static boolean hasRequestedEvents ( BProgramSyncSnapshot bpss ) { } }
return bpss . getBThreadSnapshots ( ) . stream ( ) . anyMatch ( btss -> ( ! btss . getSyncStatement ( ) . getRequest ( ) . isEmpty ( ) ) ) ;
public class ComponentLister { /** * Lists all component ' s names and counts the number of instances which have the same names . * @ return an array of Strings that have the following format : component _ name ( number of instance : X ) */ @ Override String [ ] executeCommand ( int timeout , String componentName , Object ... data ) { } }
mComponentsMap = new HashMap < > ( ) ; Window [ ] displayableWindows = getDisplayableWindows ( ) ; for ( Window window : displayableWindows ) { if ( window . getName ( ) != null ) { addToMap ( window ) ; } browseComponent ( window . getComponents ( ) ) ; } ArrayList < String > list = new ArrayList < > ( ) ; for ( String key : mComponentsMap . keySet ( ) ) { list . add ( key + " (number of instance with this name :" + mComponentsMap . get ( key ) . size ( ) + ")" ) ; } Collections . sort ( list ) ; list . add ( "Number of ownerless windows : " + Window . getOwnerlessWindows ( ) . length ) ; list . add ( "Number of displayable windows : " + displayableWindows . length ) ; return list . toArray ( new String [ list . size ( ) ] ) ;
public class CompilerExecutor { /** * We can ' t access the { @ link org . apache . maven . plugin . compiler . CompilationFailureException } directly , * because the mojo is loaded in another classloader . So , we have to use this method to retrieve the ' compilation * failures ' . * @ param mojo the mojo * @ param exception the exception that must be a { @ link org . apache . maven . plugin . compile . CompilationFailureException } * @ return the long message , { @ literal null } if it can ' t be extracted from the exception */ public static String getLongMessage ( AbstractWisdomMojo mojo , Object exception ) { } }
try { return ( String ) exception . getClass ( ) . getMethod ( "getLongMessage" ) . invoke ( exception ) ; } catch ( IllegalAccessException | InvocationTargetException | NoSuchMethodException e ) { mojo . getLog ( ) . error ( "Cannot extract the long message from the Compilation Failure Exception " + exception , e ) ; } return null ;
public class EJSDeployedSupport { /** * d395666 - added entire method . */ protected Boolean getApplicationExceptionRollback ( Throwable t ) { } }
Boolean rollback ; if ( ivIgnoreApplicationExceptions ) { rollback = null ; } else { ComponentMetaData cmd = getComponentMetaData ( ) ; EJBModuleMetaDataImpl mmd = ( EJBModuleMetaDataImpl ) cmd . getModuleMetaData ( ) ; rollback = mmd . getApplicationExceptionRollback ( t ) ; } return rollback ;
public class SVGAndroidRenderer { /** * Fill a path with a pattern by setting the path as a clip path and * drawing the pattern element as a repeating tile inside it . */ private void fillWithPattern ( SvgElement obj , Path path , Pattern pattern ) { } }
boolean patternUnitsAreUser = ( pattern . patternUnitsAreUser != null && pattern . patternUnitsAreUser ) ; float x , y , w , h ; float originX , originY ; if ( pattern . href != null ) fillInChainedPatternFields ( pattern , pattern . href ) ; if ( patternUnitsAreUser ) { x = ( pattern . x != null ) ? pattern . x . floatValueX ( this ) : 0f ; y = ( pattern . y != null ) ? pattern . y . floatValueY ( this ) : 0f ; w = ( pattern . width != null ) ? pattern . width . floatValueX ( this ) : 0f ; h = ( pattern . height != null ) ? pattern . height . floatValueY ( this ) : 0f ; } else { // Convert objectBoundingBox space to user space x = ( pattern . x != null ) ? pattern . x . floatValue ( this , 1f ) : 0f ; y = ( pattern . y != null ) ? pattern . y . floatValue ( this , 1f ) : 0f ; w = ( pattern . width != null ) ? pattern . width . floatValue ( this , 1f ) : 0f ; h = ( pattern . height != null ) ? pattern . height . floatValue ( this , 1f ) : 0f ; x = obj . boundingBox . minX + x * obj . boundingBox . width ; y = obj . boundingBox . minY + y * obj . boundingBox . height ; w *= obj . boundingBox . width ; h *= obj . boundingBox . height ; } if ( w == 0 || h == 0 ) return ; // " If attribute ' preserveAspectRatio ' is not specified , then the effect is as if a value of xMidYMid meet were specified . " PreserveAspectRatio positioning = ( pattern . preserveAspectRatio != null ) ? pattern . preserveAspectRatio : PreserveAspectRatio . LETTERBOX ; // Push the state statePush ( ) ; // Set path as the clip region canvas . clipPath ( path ) ; // Set the style for the pattern ( inherits from its own ancestors , not from callee ' s state ) RendererState baseState = new RendererState ( ) ; updateStyle ( baseState , Style . getDefaultStyle ( ) ) ; baseState . style . overflow = false ; // By default patterns do not overflow // SVG2 TODO : Patterns now inherit from the element referencing the pattern state = findInheritFromAncestorState ( pattern , baseState ) ; // The bounds of the area we need to cover with pattern to ensure that our shape is filled Box patternArea = obj . boundingBox ; // Apply the patternTransform if ( pattern . patternTransform != null ) { canvas . concat ( pattern . patternTransform ) ; // A pattern transform will affect the area we need to cover with the pattern . // So we need to alter the area bounding rectangle . Matrix inverse = new Matrix ( ) ; if ( pattern . patternTransform . invert ( inverse ) ) { float [ ] pts = { obj . boundingBox . minX , obj . boundingBox . minY , obj . boundingBox . maxX ( ) , obj . boundingBox . minY , obj . boundingBox . maxX ( ) , obj . boundingBox . maxY ( ) , obj . boundingBox . minX , obj . boundingBox . maxY ( ) } ; inverse . mapPoints ( pts ) ; // Find the bounding box of the shape created by the inverse transform RectF rect = new RectF ( pts [ 0 ] , pts [ 1 ] , pts [ 0 ] , pts [ 1 ] ) ; for ( int i = 2 ; i <= 6 ; i += 2 ) { if ( pts [ i ] < rect . left ) rect . left = pts [ i ] ; if ( pts [ i ] > rect . right ) rect . right = pts [ i ] ; if ( pts [ i + 1 ] < rect . top ) rect . top = pts [ i + 1 ] ; if ( pts [ i + 1 ] > rect . bottom ) rect . bottom = pts [ i + 1 ] ; } patternArea = new Box ( rect . left , rect . top , rect . right - rect . left , rect . bottom - rect . top ) ; } } // Calculate the pattern origin originX = x + ( float ) Math . floor ( ( patternArea . minX - x ) / w ) * w ; originY = y + ( float ) Math . floor ( ( patternArea . minY - y ) / h ) * h ; // For each Y step , then each X step float right = patternArea . maxX ( ) ; float bottom = patternArea . maxY ( ) ; Box stepViewBox = new Box ( 0 , 0 , w , h ) ; boolean compositing = pushLayer ( ) ; for ( float stepY = originY ; stepY < bottom ; stepY += h ) { for ( float stepX = originX ; stepX < right ; stepX += w ) { stepViewBox . minX = stepX ; stepViewBox . minY = stepY ; // Push the state statePush ( ) ; // Set pattern clip rectangle if appropriate if ( ! state . style . overflow ) { setClipRect ( stepViewBox . minX , stepViewBox . minY , stepViewBox . width , stepViewBox . height ) ; } // Calculate and set the viewport for each instance of the pattern if ( pattern . viewBox != null ) { canvas . concat ( calculateViewBoxTransform ( stepViewBox , pattern . viewBox , positioning ) ) ; } else { boolean patternContentUnitsAreUser = ( pattern . patternContentUnitsAreUser == null || pattern . patternContentUnitsAreUser ) ; // Simple translate of pattern to step position canvas . translate ( stepX , stepY ) ; if ( ! patternContentUnitsAreUser ) { canvas . scale ( obj . boundingBox . width , obj . boundingBox . height ) ; } } // Render the pattern for ( SVG . SvgObject child : pattern . children ) { render ( child ) ; } // Pop the state statePop ( ) ; } } if ( compositing ) popLayer ( pattern ) ; // Pop the state statePop ( ) ;
public class ResultIterator { /** * Sets the relation entities . * @ param enhanceEntity * the enhance entity * @ param client * the client * @ param m * the m * @ return the e */ private E setRelationEntities ( Object enhanceEntity , Client client , EntityMetadata m ) { } }
E result = null ; if ( enhanceEntity != null ) { if ( ! ( enhanceEntity instanceof EnhanceEntity ) ) { enhanceEntity = new EnhanceEntity ( enhanceEntity , PropertyAccessorHelper . getId ( enhanceEntity , m ) , null ) ; } EnhanceEntity ee = ( EnhanceEntity ) enhanceEntity ; result = ( E ) client . getReader ( ) . recursivelyFindEntities ( ee . getEntity ( ) , ee . getRelations ( ) , m , persistenceDelegator , false , new HashMap < Object , Object > ( ) ) ; } return result ;
public class IDGenerator { /** * Choose a MAC address from one of this machine ' s NICs or a random value . */ private static byte [ ] chooseMACAddress ( ) { } }
byte [ ] result = new byte [ 6 ] ; boolean bFound = false ; try { Enumeration < NetworkInterface > ifaces = NetworkInterface . getNetworkInterfaces ( ) ; while ( ! bFound && ifaces . hasMoreElements ( ) ) { // Look for a real NIC . NetworkInterface iface = ifaces . nextElement ( ) ; try { byte [ ] hwAddress = iface . getHardwareAddress ( ) ; if ( hwAddress != null ) { int copyBytes = Math . min ( result . length , hwAddress . length ) ; for ( int index = 0 ; index < copyBytes ; index ++ ) { result [ index ] = hwAddress [ index ] ; } bFound = true ; } } catch ( SocketException e ) { // Try next NIC } } } catch ( SocketException e ) { // Possibly no NICs on this system ? } if ( ! bFound ) { ( new Random ( ) ) . nextBytes ( result ) ; } return result ;
public class ListNamespacesRequest { /** * A complex type that contains specifications for the namespaces that you want to list . * If you specify more than one filter , a namespace must match all filters to be returned by * < code > ListNamespaces < / code > . * @ param filters * A complex type that contains specifications for the namespaces that you want to list . < / p > * If you specify more than one filter , a namespace must match all filters to be returned by * < code > ListNamespaces < / code > . */ public void setFilters ( java . util . Collection < NamespaceFilter > filters ) { } }
if ( filters == null ) { this . filters = null ; return ; } this . filters = new java . util . ArrayList < NamespaceFilter > ( filters ) ;
public class Shape { /** * Get a single point in this polygon * @ param index The index of the point to retrieve * @ return The point ' s coordinates */ public float [ ] getPoint ( int index ) { } }
checkPoints ( ) ; float result [ ] = new float [ 2 ] ; result [ 0 ] = points [ index * 2 ] ; result [ 1 ] = points [ index * 2 + 1 ] ; return result ;
public class AopProxyWriter { /** * Finalizes the proxy . This method should be called before writing the proxy to disk with { @ link # writeTo ( File ) } */ @ Override public void visitBeanDefinitionEnd ( ) { } }
if ( constructorArgumentTypes == null ) { throw new IllegalStateException ( "The method visitBeanDefinitionConstructor(..) should be called at least once" ) ; } Type [ ] interceptorTypes = getObjectTypes ( this . interceptorTypes ) ; this . constructArgumentMetadata = new LinkedHashMap < > ( this . constructArgumentMetadata ) ; this . constructArgumentMetadata . put ( "interceptors" , new DefaultAnnotationMetadata ( ) { { addDeclaredAnnotation ( io . micronaut . context . annotation . Type . class . getName ( ) , Collections . singletonMap ( "value" , Arrays . stream ( interceptorTypes ) . map ( t -> new AnnotationClassValue ( t . getClassName ( ) ) ) . toArray ( ) ) ) ; } } ) ; String constructorDescriptor = getConstructorDescriptor ( constructorNewArgumentTypes . values ( ) ) ; ClassWriter proxyClassWriter = this . classWriter ; this . constructorWriter = proxyClassWriter . visitMethod ( ACC_PUBLIC , CONSTRUCTOR_NAME , constructorDescriptor , null , null ) ; // Add the interceptor @ Type ( . . ) annotation AnnotationVisitor interceptorTypeAnn = constructorWriter . visitParameterAnnotation ( interceptorArgumentIndex , Type . getDescriptor ( io . micronaut . context . annotation . Type . class ) , true ) . visitArray ( "value" ) ; for ( Type interceptorType : interceptorTypes ) { interceptorTypeAnn . visit ( null , interceptorType ) ; } interceptorTypeAnn . visitEnd ( ) ; this . constructorGenerator = new GeneratorAdapter ( constructorWriter , Opcodes . ACC_PUBLIC , CONSTRUCTOR_NAME , constructorDescriptor ) ; GeneratorAdapter proxyConstructorGenerator = this . constructorGenerator ; proxyConstructorGenerator . loadThis ( ) ; if ( isInterface ) { proxyConstructorGenerator . invokeConstructor ( TYPE_OBJECT , METHOD_DEFAULT_CONSTRUCTOR ) ; } else { Collection < Object > existingArguments = constructorArgumentTypes . values ( ) ; for ( int i = 0 ; i < existingArguments . size ( ) ; i ++ ) { proxyConstructorGenerator . loadArg ( i ) ; } String superConstructorDescriptor = getConstructorDescriptor ( existingArguments ) ; proxyConstructorGenerator . invokeConstructor ( getTypeReference ( targetClassFullName ) , new Method ( CONSTRUCTOR_NAME , superConstructorDescriptor ) ) ; } proxyBeanDefinitionWriter . visitBeanDefinitionConstructor ( constructorAnnotationMedata , constructorRequriesReflection , constructorNewArgumentTypes , constructArgumentMetadata , constructorGenericTypes ) ; GeneratorAdapter targetDefinitionGenerator = null ; GeneratorAdapter targetTypeGenerator = null ; if ( parentWriter != null ) { proxyBeanDefinitionWriter . visitBeanDefinitionInterface ( ProxyBeanDefinition . class ) ; ClassVisitor pcw = proxyBeanDefinitionWriter . getClassWriter ( ) ; targetDefinitionGenerator = new GeneratorAdapter ( pcw . visitMethod ( ACC_PUBLIC , METHOD_PROXY_TARGET_TYPE . getName ( ) , METHOD_PROXY_TARGET_TYPE . getDescriptor ( ) , null , null ) , ACC_PUBLIC , METHOD_PROXY_TARGET_TYPE . getName ( ) , METHOD_PROXY_TARGET_TYPE . getDescriptor ( ) ) ; targetDefinitionGenerator . loadThis ( ) ; targetDefinitionGenerator . push ( getTypeReference ( parentWriter . getBeanDefinitionName ( ) ) ) ; targetDefinitionGenerator . returnValue ( ) ; targetTypeGenerator = new GeneratorAdapter ( pcw . visitMethod ( ACC_PUBLIC , METHOD_PROXY_TARGET_CLASS . getName ( ) , METHOD_PROXY_TARGET_CLASS . getDescriptor ( ) , null , null ) , ACC_PUBLIC , METHOD_PROXY_TARGET_CLASS . getName ( ) , METHOD_PROXY_TARGET_CLASS . getDescriptor ( ) ) ; targetTypeGenerator . loadThis ( ) ; targetTypeGenerator . push ( getTypeReference ( parentWriter . getBeanTypeName ( ) ) ) ; targetTypeGenerator . returnValue ( ) ; } Class interceptedInterface = isIntroduction ? Introduced . class : Intercepted . class ; Type targetType = getTypeReference ( targetClassFullName ) ; // add the $ beanLocator field if ( isProxyTarget ) { proxyClassWriter . visitField ( ACC_PRIVATE | ACC_FINAL , FIELD_BEAN_LOCATOR , TYPE_BEAN_LOCATOR . getDescriptor ( ) , null , null ) ; // add the $ beanQualifier field proxyClassWriter . visitField ( ACC_PRIVATE , FIELD_BEAN_QUALIFIER , Type . getType ( Qualifier . class ) . getDescriptor ( ) , null , null ) ; writeWithQualifierMethod ( proxyClassWriter ) ; if ( lazy ) { interceptedInterface = InterceptedProxy . class ; } else { interceptedInterface = hotswap ? HotSwappableInterceptedProxy . class : InterceptedProxy . class ; // add the $ target field for the target bean int modifiers = hotswap ? ACC_PRIVATE : ACC_PRIVATE | ACC_FINAL ; proxyClassWriter . visitField ( modifiers , FIELD_TARGET , targetType . getDescriptor ( ) , null , null ) ; if ( hotswap ) { // Add ReadWriteLock field // private final ReentrantReadWriteLock $ target _ rwl = new ReentrantReadWriteLock ( ) ; proxyClassWriter . visitField ( ACC_PRIVATE | ACC_FINAL , FIELD_READ_WRITE_LOCK , TYPE_READ_WRITE_LOCK . getDescriptor ( ) , null , null ) ; proxyConstructorGenerator . loadThis ( ) ; pushNewInstance ( proxyConstructorGenerator , TYPE_READ_WRITE_LOCK ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_READ_WRITE_LOCK , TYPE_READ_WRITE_LOCK ) ; // Add Read Lock field // private final Lock $ target _ rl = $ target _ rwl . readLock ( ) ; proxyClassWriter . visitField ( ACC_PRIVATE | ACC_FINAL , FIELD_READ_LOCK , TYPE_LOCK . getDescriptor ( ) , null , null ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . getField ( proxyType , FIELD_READ_WRITE_LOCK , TYPE_READ_WRITE_LOCK ) ; proxyConstructorGenerator . invokeInterface ( Type . getType ( ReadWriteLock . class ) , Method . getMethod ( Lock . class . getName ( ) + " readLock()" ) ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_READ_LOCK , TYPE_LOCK ) ; // Add Write Lock field // private final Lock $ target _ wl = $ target _ rwl . writeLock ( ) ; proxyClassWriter . visitField ( ACC_PRIVATE | ACC_FINAL , FIELD_WRITE_LOCK , Type . getDescriptor ( Lock . class ) , null , null ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . getField ( proxyType , FIELD_READ_WRITE_LOCK , TYPE_READ_WRITE_LOCK ) ; proxyConstructorGenerator . invokeInterface ( Type . getType ( ReadWriteLock . class ) , Method . getMethod ( Lock . class . getName ( ) + " writeLock()" ) ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_WRITE_LOCK , TYPE_LOCK ) ; } } // assign the bean locator proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . loadArg ( beanContextArgumentIndex ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_BEAN_LOCATOR , TYPE_BEAN_LOCATOR ) ; Method resolveTargetMethodDesc = writeResolveTargetMethod ( proxyClassWriter , targetType ) ; if ( ! lazy ) { proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . invokeVirtual ( proxyType , resolveTargetMethodDesc ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_TARGET , targetType ) ; } // Write the Object interceptedTarget ( ) method writeInterceptedTargetMethod ( proxyClassWriter , targetType , resolveTargetMethodDesc ) ; // Write the swap method // e . T swap ( T newInstance ) ; if ( hotswap && ! lazy ) { writeSwapMethod ( proxyClassWriter , targetType ) ; } } String [ ] interfaces = getImplementedInterfaceInternalNames ( ) ; if ( isInterface && implementInterface ) { String [ ] adviceInterfaces = { getInternalName ( targetClassFullName ) , Type . getInternalName ( interceptedInterface ) } ; interfaces = ArrayUtils . concat ( interfaces , adviceInterfaces ) ; } else { String [ ] adviceInterfaces = { Type . getInternalName ( interceptedInterface ) } ; interfaces = ArrayUtils . concat ( interfaces , adviceInterfaces ) ; } proxyClassWriter . visit ( V1_8 , ACC_SYNTHETIC , proxyInternalName , null , isInterface ? TYPE_OBJECT . getInternalName ( ) : getTypeReference ( targetClassFullName ) . getInternalName ( ) , interfaces ) ; // set $ proxyMethods field proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . push ( proxyMethodCount ) ; proxyConstructorGenerator . newArray ( EXECUTABLE_METHOD_TYPE ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_PROXY_METHODS , FIELD_TYPE_PROXY_METHODS ) ; // set $ interceptors field proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . push ( proxyMethodCount ) ; proxyConstructorGenerator . newArray ( INTERCEPTOR_ARRAY_TYPE ) ; proxyConstructorGenerator . putField ( proxyType , FIELD_INTERCEPTORS , FIELD_TYPE_INTERCEPTORS ) ; // now initialize the held values if ( isProxyTarget ) { if ( proxyTargetMethods . size ( ) == proxyMethodCount ) { Iterator < MethodRef > iterator = proxyTargetMethods . iterator ( ) ; for ( int i = 0 ; i < proxyMethodCount ; i ++ ) { MethodRef methodRef = iterator . next ( ) ; // The following will initialize the array of $ proxyMethod instances // Eg . this . $ proxyMethods [ 0 ] = $ PARENT _ BEAN . getRequiredMethod ( " test " , new Class [ ] { String . class } ) ; proxyConstructorGenerator . loadThis ( ) ; // Step 1 : dereference the array - this . $ proxyMethods [ 0] proxyConstructorGenerator . getField ( proxyType , FIELD_PROXY_METHODS , FIELD_TYPE_PROXY_METHODS ) ; proxyConstructorGenerator . push ( i ) ; // Step 2 : lookup the Method instance from the declaring type // context . getProxyTargetMethod ( " test " , new Class [ ] { String . class } ) ; proxyConstructorGenerator . loadArg ( beanContextArgumentIndex ) ; proxyConstructorGenerator . push ( targetType ) ; pushMethodNameAndTypesArguments ( proxyConstructorGenerator , methodRef . name , methodRef . argumentTypes ) ; proxyConstructorGenerator . invokeInterface ( Type . getType ( ExecutionHandleLocator . class ) , METHOD_GET_PROXY_TARGET ) ; // Step 3 : store the result in the array proxyConstructorGenerator . visitInsn ( AASTORE ) ; // Step 4 : Resolve the interceptors // this . $ interceptors [ 0 ] = InterceptorChain . resolveAroundInterceptors ( this . $ proxyMethods [ 0 ] , var2 ) ; pushResolveInterceptorsCall ( proxyConstructorGenerator , i ) ; } } } else { for ( int i = 0 ; i < proxyMethodCount ; i ++ ) { ExecutableMethodWriter executableMethodWriter = proxiedMethods . get ( i ) ; // The following will initialize the array of $ proxyMethod instances // Eg . this . proxyMethods [ 0 ] = new $ blah0 ( ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . getField ( proxyType , FIELD_PROXY_METHODS , FIELD_TYPE_PROXY_METHODS ) ; proxyConstructorGenerator . push ( i ) ; Type methodType = Type . getObjectType ( executableMethodWriter . getInternalName ( ) ) ; proxyConstructorGenerator . newInstance ( methodType ) ; proxyConstructorGenerator . dup ( ) ; proxyConstructorGenerator . loadThis ( ) ; proxyConstructorGenerator . invokeConstructor ( methodType , new Method ( CONSTRUCTOR_NAME , getConstructorDescriptor ( proxyFullName ) ) ) ; proxyConstructorGenerator . visitInsn ( AASTORE ) ; pushResolveInterceptorsCall ( proxyConstructorGenerator , i ) ; } } for ( Runnable fieldInjectionPoint : deferredInjectionPoints ) { fieldInjectionPoint . run ( ) ; } constructorWriter . visitInsn ( RETURN ) ; constructorWriter . visitMaxs ( DEFAULT_MAX_STACK , 1 ) ; this . constructorWriter . visitEnd ( ) ; proxyBeanDefinitionWriter . visitBeanDefinitionEnd ( ) ; if ( targetDefinitionGenerator != null ) { targetDefinitionGenerator . visitMaxs ( 1 , 1 ) ; targetDefinitionGenerator . visitEnd ( ) ; } if ( targetTypeGenerator != null ) { targetTypeGenerator . visitMaxs ( 1 , 1 ) ; targetTypeGenerator . visitEnd ( ) ; } proxyClassWriter . visitEnd ( ) ;
public class DscConfigurationsInner { /** * Retrieve a list of configurations . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; DscConfigurationInner & gt ; object */ public Observable < Page < DscConfigurationInner > > listByAutomationAccountAsync ( final String resourceGroupName , final String automationAccountName ) { } }
return listByAutomationAccountWithServiceResponseAsync ( resourceGroupName , automationAccountName ) . map ( new Func1 < ServiceResponse < Page < DscConfigurationInner > > , Page < DscConfigurationInner > > ( ) { @ Override public Page < DscConfigurationInner > call ( ServiceResponse < Page < DscConfigurationInner > > response ) { return response . body ( ) ; } } ) ;
public class ResourceAssignment { /** * Maps a field index to an AssignmentField instance . * @ param fields array of fields used as the basis for the mapping . * @ param index required field index * @ return AssignmnetField instance */ private AssignmentField selectField ( AssignmentField [ ] fields , int index ) { } }
if ( index < 1 || index > fields . length ) { throw new IllegalArgumentException ( index + " is not a valid field index" ) ; } return ( fields [ index - 1 ] ) ;
public class CoNLLSentence { /** * 获取包含根节点在内的单词数组 * @ return */ public CoNLLWord [ ] getWordArrayWithRoot ( ) { } }
CoNLLWord [ ] wordArray = new CoNLLWord [ word . length + 1 ] ; wordArray [ 0 ] = CoNLLWord . ROOT ; System . arraycopy ( word , 0 , wordArray , 1 , word . length ) ; return wordArray ;
public class MultipleFilesOutput { /** * Open a new stream of the given name * @ param name file name ( which will be appended to the base name ) * @ return stream object for the given name * @ throws IOException */ private PrintStream newStream ( String name ) throws IOException { } }
if ( LOG . isDebuggingFiner ( ) ) { LOG . debugFiner ( "Requested stream: " + name ) ; } // Ensure the directory exists : if ( ! basename . exists ( ) ) { basename . mkdirs ( ) ; } String fn = basename . getAbsolutePath ( ) + File . separator + name + EXTENSION ; fn = usegzip ? fn + GZIP_EXTENSION : fn ; OutputStream os = new FileOutputStream ( fn ) ; if ( usegzip ) { // wrap into gzip stream . os = new GZIPOutputStream ( os ) ; } PrintStream res = new PrintStream ( os ) ; if ( LOG . isDebuggingFiner ( ) ) { LOG . debugFiner ( "Opened new output stream:" + fn ) ; } // cache . return res ;
public class ModelUtils { /** * Returns whether { @ code type } overrides method { @ code methodName ( params ) } . */ public static boolean overrides ( TypeElement type , Types types , String methodName , TypeMirror ... params ) { } }
return override ( type , types , methodName , params ) . isPresent ( ) ;
public class Schema { /** * Load individual ColumnFamily Definition to the schema * ( to make ColumnFamily lookup faster ) * @ param cfm The ColumnFamily definition to load */ public void load ( CFMetaData cfm ) { } }
Pair < String , String > key = Pair . create ( cfm . ksName , cfm . cfName ) ; if ( cfIdMap . containsKey ( key ) ) throw new RuntimeException ( String . format ( "Attempting to load already loaded column family %s.%s" , cfm . ksName , cfm . cfName ) ) ; logger . debug ( "Adding {} to cfIdMap" , cfm ) ; cfIdMap . put ( key , cfm . cfId ) ;
public class TransliteratorRegistry { /** * Register an entry object ( adopted ) with the given ID , source , * target , and variant strings . */ private void registerEntry ( String ID , String source , String target , String variant , Object entry , boolean visible ) { } }
CaseInsensitiveString ciID = new CaseInsensitiveString ( ID ) ; Object [ ] arrayOfObj ; // Store the entry within an array so it can be modified later if ( entry instanceof Object [ ] ) { arrayOfObj = ( Object [ ] ) entry ; } else { arrayOfObj = new Object [ ] { entry } ; } registry . put ( ciID , arrayOfObj ) ; if ( visible ) { registerSTV ( source , target , variant ) ; if ( ! availableIDs . contains ( ciID ) ) { availableIDs . add ( ciID ) ; } } else { removeSTV ( source , target , variant ) ; availableIDs . remove ( ciID ) ; }
public class DataArchiver { /** * Add the given file to the data archive * @ param file * File to add * @ throws IOException */ public void collect ( Path file ) throws IOException { } }
Path targetPath = tempDir . resolve ( projectRoot . relativize ( file ) ) ; Files . createDirectories ( targetPath . getParent ( ) ) ; Files . copy ( file , targetPath ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcStyledRepresentation ( ) { } }
if ( ifcStyledRepresentationEClass == null ) { ifcStyledRepresentationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 571 ) ; } return ifcStyledRepresentationEClass ;
public class NonBlockingStack { /** * Replaces the top element in the stack . This is a shortcut for * < code > pop ( ) ; push ( aItem ) ; < / code > * @ param aItem * the item to be pushed onto this stack . * @ return the < code > aItem < / code > argument . * @ throws EmptyStackException * if the stack is empty */ @ Nullable public ELEMENTTYPE replaceTopElement ( @ Nullable final ELEMENTTYPE aItem ) { } }
if ( isEmpty ( ) ) throw new EmptyStackException ( ) ; setLast ( aItem ) ; return aItem ;
public class CommerceAddressRestrictionPersistenceImpl { /** * Returns the commerce address restriction where classNameId = & # 63 ; and classPK = & # 63 ; and commerceCountryId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param classNameId the class name ID * @ param classPK the class pk * @ param commerceCountryId the commerce country ID * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the matching commerce address restriction , or < code > null < / code > if a matching commerce address restriction could not be found */ @ Override public CommerceAddressRestriction fetchByC_C_C ( long classNameId , long classPK , long commerceCountryId , boolean retrieveFromCache ) { } }
Object [ ] finderArgs = new Object [ ] { classNameId , classPK , commerceCountryId } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_C_C_C , finderArgs , this ) ; } if ( result instanceof CommerceAddressRestriction ) { CommerceAddressRestriction commerceAddressRestriction = ( CommerceAddressRestriction ) result ; if ( ( classNameId != commerceAddressRestriction . getClassNameId ( ) ) || ( classPK != commerceAddressRestriction . getClassPK ( ) ) || ( commerceCountryId != commerceAddressRestriction . getCommerceCountryId ( ) ) ) { result = null ; } } if ( result == null ) { StringBundler query = new StringBundler ( 5 ) ; query . append ( _SQL_SELECT_COMMERCEADDRESSRESTRICTION_WHERE ) ; query . append ( _FINDER_COLUMN_C_C_C_CLASSNAMEID_2 ) ; query . append ( _FINDER_COLUMN_C_C_C_CLASSPK_2 ) ; query . append ( _FINDER_COLUMN_C_C_C_COMMERCECOUNTRYID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( classNameId ) ; qPos . add ( classPK ) ; qPos . add ( commerceCountryId ) ; List < CommerceAddressRestriction > list = q . list ( ) ; if ( list . isEmpty ( ) ) { finderCache . putResult ( FINDER_PATH_FETCH_BY_C_C_C , finderArgs , list ) ; } else { CommerceAddressRestriction commerceAddressRestriction = list . get ( 0 ) ; result = commerceAddressRestriction ; cacheResult ( commerceAddressRestriction ) ; } } catch ( Exception e ) { finderCache . removeResult ( FINDER_PATH_FETCH_BY_C_C_C , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } if ( result instanceof List < ? > ) { return null ; } else { return ( CommerceAddressRestriction ) result ; }
public class GenericFilter { /** * If request is filtered , returns true , otherwise marks request as filtered * and returns false . * A return value of false , indicates that the filter has not yet run . * A return value of true , indicates that the filter has run for this * request , and processing should not continue . * Note that the method will mark the request as filtered on first * invocation . * @ see # ATTRIB _ RUN _ ONCE _ EXT * @ see # ATTRIB _ RUN _ ONCE _ VALUE * @ param pRequest the servlet request * @ return { @ code true } if the request is already filtered , otherwise * { @ code false } . */ private boolean isRunOnce ( final ServletRequest pRequest ) { } }
// If request already filtered , return true ( skip ) if ( pRequest . getAttribute ( attribRunOnce ) == ATTRIB_RUN_ONCE_VALUE ) { return true ; } // Set attribute and return false ( continue ) pRequest . setAttribute ( attribRunOnce , ATTRIB_RUN_ONCE_VALUE ) ; return false ;
public class NotificationConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NotificationConfiguration notificationConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( notificationConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( notificationConfiguration . getTopicArn ( ) , TOPICARN_BINDING ) ; protocolMarshaller . marshall ( notificationConfiguration . getTopicStatus ( ) , TOPICSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ActivePoint { /** * Resizes the active length in the case where we are sitting on a terminal . * @ return true if reset occurs false otherwise . */ private boolean resetActivePointToTerminal ( ) { } }
if ( activeEdge != null && activeEdge . getLength ( ) == activeLength && activeEdge . isTerminating ( ) ) { activeNode = activeEdge . getTerminal ( ) ; activeEdge = null ; activeLength = 0 ; return true ; } return false ;
public class DiffBase { /** * Rehydrate the text in a diff from a string of line hashes to real lines of * text . * @ param diffs LinkedList of DiffBase objects . * @ param lineArray List of unique strings . */ void charsToLines ( LinkedList < Change > diffs , List < String > lineArray ) { } }
StringBuilder text ; for ( Change diff : diffs ) { text = new StringBuilder ( ) ; for ( int y = 0 ; y < diff . text . length ( ) ; y ++ ) { text . append ( lineArray . get ( diff . text . charAt ( y ) ) ) ; } diff . text = text . toString ( ) ; }
public class WebService { /** * method to calculate from a non - ambiguous HELM input the molecular formula * @ param notation * HELM input * @ return molecular formula from the HELM input * @ throws ValidationException * if the HELM input is not valid * @ throws BuilderMoleculeException * if the molecule for the calculation can not be built * @ throws CTKException * general ChemToolKit exception passed to HELMToolKit * @ throws MonomerLoadingException * if the MonomerFactory can not be refreshed * @ throws ChemistryException * if the Chemistry Engine can not be initialized */ public String getMolecularFormula ( String notation ) throws BuilderMoleculeException , CTKException , ValidationException , MonomerLoadingException , ChemistryException { } }
String result = MoleculePropertyCalculator . getMolecularFormular ( validate ( notation ) ) ; setMonomerFactoryToDefault ( notation ) ; return result ;
public class CreateBackupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateBackupRequest createBackupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createBackupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createBackupRequest . getServerName ( ) , SERVERNAME_BINDING ) ; protocolMarshaller . marshall ( createBackupRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public BDDReserved2 createBDDReserved2FromString ( EDataType eDataType , String initialValue ) { } }
BDDReserved2 result = BDDReserved2 . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class FeatureLinkingCandidate { /** * Returns the actual arguments of the expression . These do not include the * receiver . */ @ Override protected List < XExpression > getArguments ( ) { } }
List < XExpression > syntacticArguments = getSyntacticArguments ( ) ; XExpression firstArgument = getFirstArgument ( ) ; if ( firstArgument != null ) { return createArgumentList ( firstArgument , syntacticArguments ) ; } return syntacticArguments ;
public class LookupProcessor { /** * < p > Konstruiert eine neue Instanz mit Hilfe einer { @ code Map } . < / p > * @ param element element to be formatted * @ param resources text resources * @ throws IllegalArgumentException if there not enough text resources to match all values of an enum element type */ static < V > LookupProcessor create ( ChronoElement < V > element , Map < V , String > resources ) { } }
Map < V , String > map ; Class < V > keyType = element . getType ( ) ; if ( keyType . isEnum ( ) ) { if ( resources . size ( ) < keyType . getEnumConstants ( ) . length ) { throw new IllegalArgumentException ( "Not enough text resources defined for enum: " + keyType . getName ( ) ) ; } map = createMap ( keyType ) ; } else { map = new HashMap < > ( resources . size ( ) ) ; } map . putAll ( resources ) ; return new LookupProcessor < > ( element , map ) ;
public class ServerOperations { /** * Creates a remove operation . * @ param address the address for the operation * @ param recursive { @ code true } if the remove should be recursive , otherwise { @ code false } * @ return the operation */ public static ModelNode createRemoveOperation ( final ModelNode address , final boolean recursive ) { } }
final ModelNode op = createRemoveOperation ( address ) ; op . get ( RECURSIVE ) . set ( recursive ) ; return op ;
public class Company { /** * Gets the settings value for this Company . * @ return settings * Specifies the default billing settings of this { @ code Company } . * This attribute is optional . */ public com . google . api . ads . admanager . axis . v201902 . CompanySettings getSettings ( ) { } }
return settings ;
public class AbstractParentCommandNode { /** * Returns the template ' s last child node that matches the given condition . */ @ Nullable public SoyNode lastChildThatMatches ( Predicate < SoyNode > condition ) { } }
int lastChildIndex = numChildren ( ) - 1 ; while ( lastChildIndex >= 0 && ! condition . test ( getChild ( lastChildIndex ) ) ) { lastChildIndex -- ; } if ( lastChildIndex >= 0 ) { return getChild ( lastChildIndex ) ; } return null ;
public class ForwardRule { /** * Returns a new instance of ForwardRule . * @ param transletName the translet name * @ return an instance of ForwardRule * @ throws IllegalRuleException if an illegal rule is found */ public static ForwardRule newInstance ( String transletName ) throws IllegalRuleException { } }
if ( transletName == null ) { throw new IllegalRuleException ( "transletName must not be null" ) ; } ForwardRule fr = new ForwardRule ( ) ; fr . setTransletName ( transletName ) ; return fr ;
public class VisualStudioNETProjectWriter { /** * Get value of AdditionalIncludeDirectories property . * @ param compilerConfig * compiler configuration . * @ param baseDir * base for relative paths . * @ return value of AdditionalIncludeDirectories property . */ private String getAdditionalIncludeDirectories ( final String baseDir , final CommandLineCompilerConfiguration compilerConfig ) { } }
final File [ ] includePath = compilerConfig . getIncludePath ( ) ; final StringBuffer includeDirs = new StringBuffer ( ) ; // Darren Sargent Feb 10 2010 - - reverted to older code to ensure sys // includes get , erm , included final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( arg . startsWith ( "/I" ) ) { includeDirs . append ( arg . substring ( 2 ) ) ; includeDirs . append ( ';' ) ; } } // end Darren if ( includeDirs . length ( ) > 0 ) { includeDirs . setLength ( includeDirs . length ( ) - 1 ) ; } return includeDirs . toString ( ) ;
public class ExcelUtils { /** * 无模板 、 无注解的数据 ( 形如 { @ code List [ ? ] } 、 { @ code List [ List [ ? ] ] } 、 { @ code List [ Object [ ] ] } ) 导出 * @ param data 待导出数据 * @ param header 设置表头信息 * @ param sheetName 指定导出Excel的sheet名称 * @ param isXSSF 导出的Excel是否为Excel2007及以上版本 ( 默认是 ) * @ param os 生成的Excel待输出数据流 * @ throws IOException 异常 * @ author Crab2Died */ public void exportObjects2Excel ( List < ? > data , List < String > header , String sheetName , boolean isXSSF , OutputStream os ) throws IOException { } }
try ( Workbook workbook = exportExcelBySimpleHandler ( data , header , sheetName , isXSSF ) ) { workbook . write ( os ) ; }
public class ProcessExecutorImpl { /** * Cancels a single process instance . * It cancels all active transition instances , all event wait instances , * and sets the process instance into canceled status . * The method does not cancel task instances * @ param pProcessInst * @ return new WorkInstance */ private void cancelProcessInstance ( ProcessInstance pProcessInst ) throws Exception { } }
edao . cancelTransitionInstances ( pProcessInst . getId ( ) , "ProcessInstance has been cancelled." , null ) ; edao . setProcessInstanceStatus ( pProcessInst . getId ( ) , WorkStatus . STATUS_CANCELLED ) ; edao . removeEventWaitForProcessInstance ( pProcessInst . getId ( ) ) ; this . cancelTasksOfProcessInstance ( pProcessInst ) ;
public class DecimalFormat { /** * < strong > [ icu ] < / strong > Returns the MathContext used by this format . * @ return desired MathContext * @ see # getMathContext */ public java . math . MathContext getMathContext ( ) { } }
try { // don ' t allow multiple references return mathContext == null ? null : new java . math . MathContext ( mathContext . getDigits ( ) , java . math . RoundingMode . valueOf ( mathContext . getRoundingMode ( ) ) ) ; } catch ( Exception foo ) { return null ; // should never happen }
public class TimedMap { /** * This method is NOT supported and always throws UnsupportedOperationException * @ see Map # entrySet ( ) */ public Set < Map . Entry < K , V > > entrySet ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && _tc . isEntryEnabled ( ) ) SibTr . entry ( this , _tc , "entrySet" ) ; UnsupportedOperationException uoe = new UnsupportedOperationException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && _tc . isEntryEnabled ( ) ) SibTr . exit ( this , _tc , "entrySet" , uoe ) ; throw uoe ;
public class Request { /** * Executes requests that have already been serialized into an HttpURLConnection . No validation is done that the * contents of the connection actually reflect the serialized requests , so it is the caller ' s responsibility to * ensure that it will correctly generate the desired responses . * This should only be called if you have transitioned off the UI thread . * @ param connection * the HttpURLConnection that the requests were serialized into * @ param requests * the requests represented by the HttpURLConnection * @ return a list of Responses corresponding to the requests * @ throws FacebookException * If there was an error in the protocol used to communicate with the service */ public static List < Response > executeConnectionAndWait ( HttpURLConnection connection , Collection < Request > requests ) { } }
return executeConnectionAndWait ( connection , new RequestBatch ( requests ) ) ;
public class BaseBundleActivator { /** * Get the ( persistent ) configuration dictionary from the service manager . * Note : Properties are stored under the activator ' s package name . * @ return The properties */ @ SuppressWarnings ( "unchecked" ) public Dictionary < String , String > getConfigurationProperties ( Dictionary < String , String > dictionary , boolean returnCopy ) { } }
if ( returnCopy ) dictionary = putAll ( dictionary , null ) ; if ( dictionary == null ) dictionary = new Hashtable < String , String > ( ) ; try { String servicePid = this . getServicePid ( ) ; if ( servicePid != null ) { ServiceReference caRef = context . getServiceReference ( ConfigurationAdmin . class . getName ( ) ) ; if ( caRef != null ) { ConfigurationAdmin configAdmin = ( ConfigurationAdmin ) context . getService ( caRef ) ; Configuration config = configAdmin . getConfiguration ( servicePid ) ; Dictionary < String , String > configProperties = config . getProperties ( ) ; dictionary = putAll ( configProperties , dictionary ) ; } } } catch ( IOException e ) { e . printStackTrace ( ) ; } return dictionary ;
public class Crypto { /** * Decrypt text using private key * @ param text The encrypted text * @ param key The private key * @ return The unencrypted text * @ throws MangooEncryptionException if decryption fails */ public byte [ ] decrypt ( byte [ ] text , PrivateKey key ) throws MangooEncryptionException { } }
Objects . requireNonNull ( text , Required . ENCRYPTED_TEXT . toString ( ) ) ; Objects . requireNonNull ( text , Required . PRIVATE_KEY . toString ( ) ) ; byte [ ] decrypt = null ; try { Cipher cipher = Cipher . getInstance ( ENCRYPTION ) ; cipher . init ( Cipher . DECRYPT_MODE , key ) ; decrypt = cipher . doFinal ( text ) ; } catch ( InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException e ) { throw new MangooEncryptionException ( "Failed to decrypt encrypted text with private key" , e ) ; } return decrypt ;
public class ZeroFile { /** * Zeroes the provided random access file , only writing blocks that contain non - zero . * Reads at the maximum provided bpsIn blocks per second . * Writes at the maximum provided bpsOut blocks per second . * Returns the number of bytes written . */ public static long zeroFile ( int bpsIn , int bpsOut , RandomAccessFile raf ) throws IOException { } }
// Initialize bitset final long len = raf . length ( ) ; final int blocks ; { long blocksLong = len / BLOCK_SIZE ; if ( ( len & ( BLOCK_SIZE - 1 ) ) != 0 ) blocksLong ++ ; if ( blocksLong > Integer . MAX_VALUE ) throw new IOException ( "File too large: " + len ) ; blocks = ( int ) blocksLong ; } BitSet dirtyBlocks = new BitSet ( blocks ) ; int numDirtyBlocks = 0 ; // Pass one : read for non zeros long lastTime = System . currentTimeMillis ( ) ; byte [ ] buff = new byte [ BLOCK_SIZE ] ; int blockIndex = 0 ; String lastVerboseString = "" ; int block = 0 ; for ( long pos = 0 ; pos < len ; pos += BLOCK_SIZE , blockIndex ++ ) { int blockSize ; { long blockSizeLong = len - pos ; blockSize = blockSizeLong > BLOCK_SIZE ? BLOCK_SIZE : ( int ) blockSizeLong ; } raf . seek ( pos ) ; raf . readFully ( buff , 0 , blockSize ) ; block ++ ; lastTime = sleep ( bpsIn , lastTime ) ; boolean allZero = true ; for ( int i = 0 ; i < blockSize ; i ++ ) { if ( buff [ i ] != 0 ) { allZero = false ; break ; } } if ( ! allZero ) { dirtyBlocks . set ( blockIndex ) ; numDirtyBlocks ++ ; } if ( PROGRESS ) { lastVerboseString = TerminalWriter . progressOutput ( lastVerboseString , StringUtility . getApproximateSize ( pos + blockSize ) + ": " + SQLUtility . getDecimal ( ( long ) block * 10000L / ( long ) blocks ) + "% read, " + SQLUtility . getDecimal ( ( long ) numDirtyBlocks * 10000L / ( long ) block ) + "% dirty" , System . err ) ; // System . err . println ( " 0x " + Long . toString ( pos , 16 ) + " - 0x " + Long . toString ( pos + blockSize - 1 , 16 ) + " : " + ( allZero ? " Already zero " : " Dirty " ) ) ; } } if ( PROGRESS ) { System . err . println ( ) ; lastVerboseString = "" ; } // Pass two : write dirty blocks long bytesWritten = 0 ; blockIndex = 0 ; Arrays . fill ( buff , ( byte ) 0 ) ; int written = 0 ; for ( long pos = 0 ; pos < len ; pos += BLOCK_SIZE , blockIndex ++ ) { if ( dirtyBlocks . get ( blockIndex ) ) { int blockSize ; { long blockSizeLong = len - pos ; blockSize = blockSizeLong > BLOCK_SIZE ? BLOCK_SIZE : ( int ) blockSizeLong ; } if ( ! DRY_RUN ) { raf . seek ( pos ) ; raf . write ( buff , 0 , blockSize ) ; lastTime = sleep ( bpsOut , lastTime ) ; bytesWritten += blockSize ; } written ++ ; if ( PROGRESS ) { lastVerboseString = TerminalWriter . progressOutput ( lastVerboseString , StringUtility . getApproximateSize ( bytesWritten ) + ": " + SQLUtility . getDecimal ( ( long ) written * 10000L / ( long ) numDirtyBlocks ) + "% written" , System . err ) ; // System . err . println ( " 0x " + Long . toString ( pos , 16 ) + " - 0x " + Long . toString ( pos + blockSize - 1 , 16 ) + " : Cleared " ) ; } } } if ( PROGRESS ) { System . err . println ( ) ; lastVerboseString = "" ; } return bytesWritten ;
public class Collections { /** * Filter a { @ link List } using { @ link Filter } s and return a new { @ link List } . * { @ link Filter } s are applied in given order on each element from source collection . < br / > * The returned collection contain all the source elements accepted by at least one { @ link Filter } . */ public static < T > List < T > filter ( List < T > list , Filter < T > ... filters ) { } }
if ( Arrays . isEmpty ( filters ) ) { return new ArrayList < T > ( list ) ; } return filterToList ( list , filters ) ;
public class BitVector { /** * NOTE : uncertain future */ long [ ] toLongArray ( ) { } }
// create array through an aligned copy BitVector copy = alignedCopy ( ) ; long [ ] longs = copy . bits ; int length = longs . length ; if ( length == 0 ) return longs ; // reverse the array for ( int i = 0 , mid = length >> 1 , j = length - 1 ; i < mid ; i ++ , j -- ) { long t = longs [ i ] ; longs [ i ] = longs [ j ] ; longs [ j ] = t ; } // mask off top bits in case copy was produced via clone final long mask = - 1L >>> ( ADDRESS_SIZE - copy . finish & ADDRESS_MASK ) ; longs [ 0 ] &= mask ; // return the result return longs ;
public class AbstractSqlFluent { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . fluent . SqlFluent # sqlId ( String ) */ @ SuppressWarnings ( "unchecked" ) @ Override public T sqlId ( final String sqlId ) { } }
context ( ) . setSqlId ( sqlId ) ; return ( T ) this ;
public class SharedPreferenceUtils { /** * Extract number from string , failsafe . If the string is not a proper number it will always return 0l ; * @ param string * : String that should be converted into a number * @ return : 0l if conversion to number is failed anyhow , otherwise converted number is returned */ public static long getNumberLong ( CharSequence string ) { } }
long number = 0l ; try { if ( ! isEmptyString ( string ) ) { if ( TextUtils . isDigitsOnly ( string ) ) { number = Long . parseLong ( string . toString ( ) ) ; } } } catch ( NumberFormatException e ) { e . printStackTrace ( ) ; } return number ;
public class CSSReaderDeclarationList { /** * Read the CSS from the passed { @ link Reader } . * @ param aReader * The reader to use . Will be closed automatically after reading - * independent of success or error . May not be < code > null < / code > . * @ param eVersion * The CSS version to use . May not be < code > null < / code > . * @ param aCustomErrorHandler * An optional custom error handler that can be used to collect the * recoverable parsing errors . May be < code > null < / code > . * @ param aCustomExceptionHandler * An optional custom exception handler that can be used to collect the * unrecoverable parsing errors . May be < code > null < / code > . * @ return < code > null < / code > if reading failed , the CSS declarations * otherwise . */ @ Nullable public static CSSDeclarationList readFromReader ( @ Nonnull @ WillClose final Reader aReader , @ Nonnull final ECSSVersion eVersion , @ Nullable final ICSSParseErrorHandler aCustomErrorHandler , @ Nullable final ICSSParseExceptionCallback aCustomExceptionHandler ) { } }
return readFromReader ( aReader , new CSSReaderSettings ( ) . setCSSVersion ( eVersion ) . setCustomErrorHandler ( aCustomErrorHandler ) . setCustomExceptionHandler ( aCustomExceptionHandler ) ) ;
public class RaygunClient { /** * Attaches a pre - built Raygun exception handler to the thread ' s DefaultUncaughtExceptionHandler . * This automatically sends any exceptions that reaches it to the Raygun API . * @ param tags A list of tags that relate to the calling application ' s currently build or state . * These will be appended to all exception messages sent to Raygun . * @ param userCustomData A set of key - value pairs that will be attached to each exception message * sent to Raygun . This can contain any extra data relating to the calling * application ' s state you would like to see . * @ deprecated Call attachExceptionHandler ( ) , then setUserCustomData ( Map ) instead */ @ Deprecated public static void AttachExceptionHandler ( List tags , Map userCustomData ) { } }
UncaughtExceptionHandler oldHandler = Thread . getDefaultUncaughtExceptionHandler ( ) ; if ( ! ( oldHandler instanceof RaygunUncaughtExceptionHandler ) ) { RaygunClient . handler = new RaygunUncaughtExceptionHandler ( oldHandler , tags , userCustomData ) ; Thread . setDefaultUncaughtExceptionHandler ( RaygunClient . handler ) ; }
public class CommerceOrderPaymentUtil { /** * Returns the commerce order payment with the primary key or throws a { @ link NoSuchOrderPaymentException } if it could not be found . * @ param commerceOrderPaymentId the primary key of the commerce order payment * @ return the commerce order payment * @ throws NoSuchOrderPaymentException if a commerce order payment with the primary key could not be found */ public static CommerceOrderPayment findByPrimaryKey ( long commerceOrderPaymentId ) throws com . liferay . commerce . exception . NoSuchOrderPaymentException { } }
return getPersistence ( ) . findByPrimaryKey ( commerceOrderPaymentId ) ;
public class NodeCache { /** * Return the cache listenable * @ return listenable */ public ListenerContainer < NodeCacheListener > getListenable ( ) { } }
Preconditions . checkState ( state . get ( ) != State . CLOSED , "Closed" ) ; return listeners ;
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createCIM ( int cic ) */ public ChargeInformationMessage createCIM ( int cic ) { } }
ChargeInformationMessage msg = createCIM ( ) ; CircuitIdentificationCode code = this . parameterFactory . createCircuitIdentificationCode ( ) ; code . setCIC ( cic ) ; msg . setCircuitIdentificationCode ( code ) ; return msg ;
public class RowOutputBinary { /** * Calculate the size of byte array required to store a row . * @ param row - a database row * @ return size of byte array * @ exception HsqlException When data is inconsistent */ public int getSize ( Row row ) { } }
Object [ ] data = row . getData ( ) ; Type [ ] types = row . getTable ( ) . getColumnTypes ( ) ; int cols = row . getTable ( ) . getDataColumnCount ( ) ; return INT_STORE_SIZE + getSize ( data , cols , types ) ;
public class DescribeDomainControllersRequest { /** * A list of identifiers for the domain controllers whose information will be provided . * @ param domainControllerIds * A list of identifiers for the domain controllers whose information will be provided . */ public void setDomainControllerIds ( java . util . Collection < String > domainControllerIds ) { } }
if ( domainControllerIds == null ) { this . domainControllerIds = null ; return ; } this . domainControllerIds = new com . amazonaws . internal . SdkInternalList < String > ( domainControllerIds ) ;
public class BuildPlatform { /** * Check the configurations and mark one as primary . * @ throws MojoExecutionException if duplicate configuration names are found */ public void identifyPrimaryConfiguration ( ) throws MojoExecutionException { } }
Set < String > configurationNames = new HashSet < String > ( ) ; for ( BuildConfiguration configuration : configurations ) { if ( configurationNames . contains ( configuration . getName ( ) ) ) { throw new MojoExecutionException ( "Duplicate configuration '" + configuration . getName ( ) + "' for '" + getName ( ) + "', configuration names must be unique" ) ; } configurationNames . add ( configuration . getName ( ) ) ; configuration . setPrimary ( false ) ; } if ( configurations . contains ( RELEASE_CONFIGURATION ) ) { configurations . get ( configurations . indexOf ( RELEASE_CONFIGURATION ) ) . setPrimary ( true ) ; } else if ( configurations . contains ( DEBUG_CONFIGURATION ) ) { configurations . get ( configurations . indexOf ( DEBUG_CONFIGURATION ) ) . setPrimary ( true ) ; } else { configurations . get ( 0 ) . setPrimary ( true ) ; }
public class CmsAutoSetup { /** * Main program entry point when started via the command line . < p > * @ param args parameters passed to the application via the command line */ public static void main ( String [ ] args ) { } }
System . out . println ( ) ; System . out . println ( HR ) ; System . out . println ( "OpenCms setup started at: " + new Date ( System . currentTimeMillis ( ) ) ) ; System . out . println ( HR ) ; System . out . println ( ) ; String path = null ; boolean setupDBOnly = false ; if ( ( args . length > 0 ) && ( args [ 0 ] != null ) ) { for ( int i = 0 ; i < args . length ; i ++ ) { if ( args [ i ] != null ) { if ( PARAM_CONFIG_PATH . equals ( args [ i ] ) && ( args . length > ( i + 1 ) ) ) { path = args [ i + 1 ] ; } else if ( args [ i ] . startsWith ( PARAM_CONFIG_PATH ) ) { path = args [ i ] . substring ( PARAM_CONFIG_PATH . length ( ) ) . trim ( ) ; } else if ( PARAM_DB_ONLY . equals ( args [ i ] ) ) { setupDBOnly = true ; } } } } if ( ( null != path ) && ( new File ( path ) . exists ( ) ) ) { System . out . println ( "Using config file: " + path + "\n" ) ; try { CmsAutoSetupProperties props = new CmsAutoSetupProperties ( path ) ; System . out . println ( "Webapp path : " + props . getSetupWebappPath ( ) ) ; System . out . println ( "Ethernet address: " + props . getEthernetAddress ( ) ) ; System . out . println ( "Server URL : " + props . getServerUrl ( ) ) ; System . out . println ( "Server name : " + props . getServerName ( ) ) ; System . out . println ( "Show progress : " + props . isShowProgress ( ) ) ; System . out . println ( ) ; for ( Map . Entry < String , String [ ] > entry : props . toParameterMap ( ) . entrySet ( ) ) { System . out . println ( entry . getKey ( ) + " = " + entry . getValue ( ) [ 0 ] ) ; } System . out . println ( ) ; CmsAutoSetup setup = new CmsAutoSetup ( props ) ; if ( setupDBOnly ) { System . out . println ( "Creating DB and tables only." ) ; System . out . println ( "The opencms.properties file will not be written and no modules will be installed.\n\n" ) ; setup . initSetupBean ( ) ; setup . setupDB ( ) ; } else { setup . run ( ) ; } } catch ( Exception e ) { System . out . println ( "An error occurred during the setup process with the following error message:" ) ; System . out . println ( e . getMessage ( ) ) ; System . out . println ( "Please have a look into the opencms log file for detailed information." ) ; LOG . error ( e . getMessage ( ) , e ) ; System . exit ( 1 ) ; } } else { System . out . println ( "" ) ; System . err . println ( "Config file not found, please specify a path where to find the setup properties to use." ) ; System . out . println ( "Usage example (Unix): setup.sh -path /path/to/setup.properties" ) ; System . out . println ( "Usage example (Win): setup.bat -path C:\\setup.properties" ) ; System . out . println ( "" ) ; System . out . println ( "Have a look at the package: org/opencms/setup/setup.properties.example" ) ; System . out . println ( "in order to find a sample configuration file." ) ; } System . exit ( 0 ) ;
public class BeaconService { /** * methods for clients */ @ MainThread public void startRangingBeaconsInRegion ( Region region , Callback callback ) { } }
synchronized ( mScanHelper . getRangedRegionState ( ) ) { if ( mScanHelper . getRangedRegionState ( ) . containsKey ( region ) ) { LogManager . i ( TAG , "Already ranging that region -- will replace existing region." ) ; mScanHelper . getRangedRegionState ( ) . remove ( region ) ; // need to remove it , otherwise the old object will be retained because they are . equal / / FIXME That is not true } mScanHelper . getRangedRegionState ( ) . put ( region , new RangeState ( callback ) ) ; LogManager . d ( TAG , "Currently ranging %s regions." , mScanHelper . getRangedRegionState ( ) . size ( ) ) ; } if ( mScanHelper . getCycledScanner ( ) != null ) { mScanHelper . getCycledScanner ( ) . start ( ) ; }
public class InstanceInformationFilter { /** * The filter values . * @ return The filter values . */ public java . util . List < String > getValueSet ( ) { } }
if ( valueSet == null ) { valueSet = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return valueSet ;
public class CmsContentEditorHandler { /** * Opens the XML content editor . < p > * @ param element the container element widget * @ param inline < code > true < / code > to open the in - line editor for the given element if available * @ param wasNew < code > true < / code > in case this is a newly created element not previously edited */ public void openDialog ( final CmsContainerPageElementPanel element , final boolean inline , boolean wasNew ) { } }
if ( ! inline && element . hasEditHandler ( ) ) { m_handler . m_controller . getEditOptions ( element . getId ( ) , false , new I_CmsSimpleCallback < CmsDialogOptionsAndInfo > ( ) { public void execute ( CmsDialogOptionsAndInfo editOptions ) { final I_CmsSimpleCallback < CmsUUID > editCallBack = new I_CmsSimpleCallback < CmsUUID > ( ) { public void execute ( CmsUUID arg ) { String contentId = element . getId ( ) ; if ( ! element . getId ( ) . startsWith ( arg . toString ( ) ) ) { // the content structure ID has changed , the current element needs to be replaced after editing m_replaceElement = element ; contentId = arg . toString ( ) ; } internalOpenDialog ( element , contentId , inline , wasNew ) ; } } ; if ( editOptions == null ) { internalOpenDialog ( element , element . getId ( ) , inline , wasNew ) ; } else if ( editOptions . getOptions ( ) . getOptions ( ) . size ( ) == 1 ) { m_handler . m_controller . prepareForEdit ( element . getId ( ) , editOptions . getOptions ( ) . getOptions ( ) . get ( 0 ) . getValue ( ) , editCallBack ) ; } else { CmsOptionDialog dialog = new CmsOptionDialog ( Messages . get ( ) . key ( Messages . GUI_EDIT_HANDLER_SELECT_EDIT_OPTION_0 ) , editOptions . getOptions ( ) , editOptions . getInfo ( ) , new I_CmsSimpleCallback < String > ( ) { public void execute ( String arg ) { m_handler . m_controller . prepareForEdit ( element . getId ( ) , arg , editCallBack ) ; } } ) ; dialog . addDialogClose ( new Command ( ) { public void execute ( ) { cancelEdit ( ) ; } } ) ; dialog . center ( ) ; } } } ) ; } else { internalOpenDialog ( element , element . getId ( ) , inline , wasNew ) ; }
public class AppServicePlansInner { /** * Update a Virtual Network gateway . * Update a Virtual Network gateway . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service plan . * @ param vnetName Name of the Virtual Network . * @ param gatewayName Name of the gateway . Only the ' primary ' gateway is supported . * @ param connectionEnvelope Definition of the gateway . * @ 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 VnetGatewayInner object if successful . */ public VnetGatewayInner updateVnetGateway ( String resourceGroupName , String name , String vnetName , String gatewayName , VnetGatewayInner connectionEnvelope ) { } }
return updateVnetGatewayWithServiceResponseAsync ( resourceGroupName , name , vnetName , gatewayName , connectionEnvelope ) . toBlocking ( ) . single ( ) . body ( ) ;
public class MiniBenchmark { /** * Prints the usage . */ private static void usage ( ) { } }
new HelpFormatter ( ) . printHelp ( String . format ( "java -cp %s %s -type <[READ, WRITE]> -fileSize <fileSize> -iterations <iterations> " + "-concurrency <concurrency>" , RuntimeConstants . ALLUXIO_JAR , MiniBenchmark . class . getCanonicalName ( ) ) , "run a mini benchmark to write or read a file" , OPTIONS , "" , true ) ;
public class BigDecimal { /** * Compares this { @ code BigDecimal } with the specified * { @ code BigDecimal } . Two { @ code BigDecimal } objects that are * equal in value but have a different scale ( like 2.0 and 2.00) * are considered equal by this method . This method is provided * in preference to individual methods for each of the six boolean * comparison operators ( { @ literal < } , = = , * { @ literal > } , { @ literal > = } , ! = , { @ literal < = } ) . The * suggested idiom for performing these comparisons is : * { @ code ( x . compareTo ( y ) } & lt ; < i > op < / i > & gt ; { @ code 0 ) } , where * & lt ; < i > op < / i > & gt ; is one of the six comparison operators . * @ param val { @ code BigDecimal } to which this { @ code BigDecimal } is * to be compared . * @ return - 1 , 0 , or 1 as this { @ code BigDecimal } is numerically * less than , equal to , or greater than { @ code val } . */ public int compareTo ( BigDecimal val ) { } }
// Quick path for equal scale and non - inflated case . if ( scale == val . scale ) { long xs = intCompact ; long ys = val . intCompact ; if ( xs != INFLATED && ys != INFLATED ) return xs != ys ? ( ( xs > ys ) ? 1 : - 1 ) : 0 ; } int xsign = this . signum ( ) ; int ysign = val . signum ( ) ; if ( xsign != ysign ) return ( xsign > ysign ) ? 1 : - 1 ; if ( xsign == 0 ) return 0 ; int cmp = compareMagnitude ( val ) ; return ( xsign > 0 ) ? cmp : - cmp ;
public class PoBoxBuilder { /** * { @ inheritDoc } */ @ Override public PoBox buildObject ( String namespaceURI , String localName , String namespacePrefix ) { } }
return new PoBoxImpl ( namespaceURI , localName , namespacePrefix ) ;
public class RestrictionValidator { /** * Validates the number of fraction digits present in the { @ code value } received . * @ param fractionDigits The allowed number of fraction digits . * @ param value The { @ link Double } to be validated . */ public static void validateFractionDigits ( int fractionDigits , double value ) { } }
if ( value != ( ( int ) value ) ) { String doubleValue = String . valueOf ( value ) ; int numberOfFractionDigits = doubleValue . substring ( doubleValue . indexOf ( ',' ) ) . length ( ) ; if ( numberOfFractionDigits > fractionDigits ) { throw new RestrictionViolationException ( "Violation of fractionDigits restriction, value should have a maximum of " + fractionDigits + " decimal places." ) ; } }
public class Handler { /** * Returns the instance of the next handler , rather then calling handleRequest * on it . * @ param httpServerExchange * The current requests server exchange . * @ return The HttpHandler that should be executed next . */ public static HttpHandler getNext ( HttpServerExchange httpServerExchange ) { } }
String chainId = httpServerExchange . getAttachment ( CHAIN_ID ) ; List < HttpHandler > handlersForId = handlerListById . get ( chainId ) ; Integer nextIndex = httpServerExchange . getAttachment ( CHAIN_SEQ ) ; // Check if we ' ve reached the end of the chain . if ( nextIndex < handlersForId . size ( ) ) { httpServerExchange . putAttachment ( CHAIN_SEQ , nextIndex + 1 ) ; return handlersForId . get ( nextIndex ) ; } return null ;
public class SignalFxNamingConvention { /** * Dimension value can be any non - empty UTF - 8 string , with a maximum length < = 256 characters . */ @ Override public String tagValue ( String value ) { } }
String formattedValue = StringEscapeUtils . escapeJson ( delegate . tagValue ( value ) ) ; return StringUtils . truncate ( formattedValue , TAG_VALUE_MAX_LENGTH ) ;
public class GammaDistribution { /** * Compute the Psi / Digamma function * Reference : * J . M . Bernando < br > * Algorithm AS 103 : Psi ( Digamma ) Function < br > * Statistical Algorithms * TODO : is there a more accurate version maybe in R ? * @ param x Position * @ return digamma value */ @ Reference ( authors = "J. M. Bernando" , title = "Algorithm AS 103: Psi (Digamma) Function" , booktitle = "Statistical Algorithms" , url = "https://doi.org/10.2307/2347257" , bibkey = "doi:10.2307/2347257" ) public static double digamma ( double x ) { } }
if ( ! ( x > 0 ) ) { return Double . NaN ; } // Method of equation 5: if ( x <= 1e-5 ) { return - EULERS_CONST - 1. / x ; } // Method of equation 4: else if ( x > 49. ) { final double ix2 = 1. / ( x * x ) ; // Partial series expansion return FastMath . log ( x ) - 0.5 / x - ix2 * ( ( 1.0 / 12. ) + ix2 * ( 1.0 / 120. - ix2 / 252. ) ) ; // + O ( x ^ 8 ) error } else { // Stirling expansion return digamma ( x + 1. ) - 1. / x ; }
public class OffsetDateTimeRangeRandomizer { /** * Create a new { @ link OffsetDateTimeRangeRandomizer } . * @ param min min value * @ param max max value * @ param seed initial seed * @ return a new { @ link OffsetDateTimeRangeRandomizer } . */ public static OffsetDateTimeRangeRandomizer aNewOffsetDateTimeRangeRandomizer ( final OffsetDateTime min , final OffsetDateTime max , final long seed ) { } }
return new OffsetDateTimeRangeRandomizer ( min , max , seed ) ;
public class KeyVaultClientBaseImpl { /** * Sets a secret in a specified key vault . * The SET operation adds a secret to the Azure Key Vault . If the named secret already exists , Azure Key Vault creates a new version of that secret . This operation requires the secrets / set permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param secretName The name of the secret . * @ param value The value of the secret . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws KeyVaultErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the SecretBundle object if successful . */ public SecretBundle setSecret ( String vaultBaseUrl , String secretName , String value ) { } }
return setSecretWithServiceResponseAsync ( vaultBaseUrl , secretName , value ) . toBlocking ( ) . single ( ) . body ( ) ;
public class RemoteRepositoryCache { /** * gets number of records in the result based on the information available in this cache . * @ return sum of sizes recorded in start and end arrays */ public int getSize ( ) { } }
if ( size < 0 ) { size = 0 ; for ( byte [ ] cache : start ) { size += new RemoteOneFileCache ( cache ) . getSize ( ) ; } for ( byte [ ] cache : end ) { size += new RemoteOneFileCache ( cache ) . getSize ( ) ; } } return size ;
public class Configs { /** * < p > Add self define configs file . < / p > * Can use self configs path or self class extends { @ link OneProperties } . * @ param configAbsoluteClassPath self configs absolute class path . * This path also is a config file key string . * Can ' t be null , if null add nothing . * @ param configsObj self class extends { @ link OneProperties } . * Can be null , if null means not use self class . * @ see OneProperties */ public static void addSelfConfigs ( String configAbsoluteClassPath , OneProperties configsObj ) { } }
if ( configAbsoluteClassPath == null ) { return ; } if ( configsObj == null ) { OneProperties configs = otherConfigs . get ( configAbsoluteClassPath ) ; if ( configs == null ) { configsObj = new OneProperties ( ) ; } else { configsObj = configs ; } } configsObj . initConfigs ( configAbsoluteClassPath ) ; otherConfigs . put ( configAbsoluteClassPath , configsObj ) ;
public class CreateCustomActionTypeRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateCustomActionTypeRequest createCustomActionTypeRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createCustomActionTypeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createCustomActionTypeRequest . getCategory ( ) , CATEGORY_BINDING ) ; protocolMarshaller . marshall ( createCustomActionTypeRequest . getProvider ( ) , PROVIDER_BINDING ) ; protocolMarshaller . marshall ( createCustomActionTypeRequest . getVersion ( ) , VERSION_BINDING ) ; protocolMarshaller . marshall ( createCustomActionTypeRequest . getSettings ( ) , SETTINGS_BINDING ) ; protocolMarshaller . marshall ( createCustomActionTypeRequest . getConfigurationProperties ( ) , CONFIGURATIONPROPERTIES_BINDING ) ; protocolMarshaller . marshall ( createCustomActionTypeRequest . getInputArtifactDetails ( ) , INPUTARTIFACTDETAILS_BINDING ) ; protocolMarshaller . marshall ( createCustomActionTypeRequest . getOutputArtifactDetails ( ) , OUTPUTARTIFACTDETAILS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class XmlParser { /** * Report a serious error . * @ param message * The error message . * @ param textFound * The text that caused the error ( or null ) . */ private void fatal ( String message , char textFound , String textExpected ) throws SAXException { } }
fatal ( message , Character . valueOf ( textFound ) . toString ( ) , textExpected ) ;
public class AbstractConnectionManager { /** * { @ inheritDoc } */ public synchronized void shutdown ( ) { } }
shutdown . set ( true ) ; if ( pool != null ) pool . shutdown ( ) ; if ( scheduledExecutorService != null ) { if ( scheduledGraceful != null && ! scheduledGraceful . isDone ( ) ) scheduledGraceful . cancel ( true ) ; scheduledGraceful = null ; scheduledExecutorService . shutdownNow ( ) ; scheduledExecutorService = null ; } if ( gracefulCallback != null ) { gracefulCallback . done ( ) ; gracefulCallback = null ; }
public class BoxFolder { /** * Creates metadata on this folder using a specified template . * @ param templateName the name of the metadata template . * @ param metadata the new metadata values . * @ return the metadata returned from the server . */ public Metadata createMetadata ( String templateName , Metadata metadata ) { } }
String scope = Metadata . scopeBasedOnType ( templateName ) ; return this . createMetadata ( templateName , scope , metadata ) ;
public class BasePageShowChildrenRenderer { /** * Called before a menu item is rendered . * @ param aWPEC * Web page execution context . May not be < code > null < / code > . * @ param aMenuObj * The menu object about to be rendered . Never < code > null < / code > . * @ param aPreviousLI * The previous element from the last call . May be < code > null < / code > . */ @ OverrideOnDemand public void beforeAddRenderedMenuItem ( @ Nonnull final IWebPageExecutionContext aWPEC , @ Nonnull final IMenuObject aMenuObj , @ Nullable final IHCElement < ? > aPreviousLI ) { } }
if ( aMenuObj . getMenuObjectType ( ) == EMenuObjectType . SEPARATOR && aPreviousLI != null ) aPreviousLI . addStyle ( CCSSProperties . MARGIN_BOTTOM . newValue ( "1em" ) ) ;