signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CoverageDataPng { /** * Draw a coverage data tile and format as PNG bytes from the double array * of " unsigned short " pixel values formatted as short [ row ] [ width ] * @ param pixelValues * " unsigned short " pixel values as [ row ] [ width ] * @ return coverage data image tile bytes */ public ...
BufferedImage image = drawTile ( pixelValues ) ; byte [ ] bytes = getImageBytes ( image ) ; return bytes ;
public class DefaultClientConfigImpl { /** * This is to workaround the issue that { @ link AbstractConfiguration } by default * automatically convert comma delimited string to array */ protected static String getStringValue ( Configuration config , String key ) { } }
try { String values [ ] = config . getStringArray ( key ) ; if ( values == null ) { return null ; } if ( values . length == 0 ) { return config . getString ( key ) ; } else if ( values . length == 1 ) { return values [ 0 ] ; } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < values . length ; i ++ ) { s...
public class BaseRTMPClientHandler { /** * { @ inheritDoc } */ @ Override protected void onPing ( RTMPConnection conn , Channel channel , Header source , Ping ping ) { } }
log . trace ( "onPing" ) ; switch ( ping . getEventType ( ) ) { case Ping . PING_CLIENT : case Ping . STREAM_BEGIN : case Ping . RECORDED_STREAM : case Ping . STREAM_PLAYBUFFER_CLEAR : // the server wants to measure the RTT Ping pong = new Ping ( ) ; pong . setEventType ( Ping . PONG_SERVER ) ; pong . setValue2 ( ( int...
public class EmailAlarmCallback { /** * / * This method should be used when we want to provide user auto - completion to users that have permissions for it */ public ConfigurationRequest getEnrichedRequestedConfiguration ( ) { } }
final Map < String , String > regularUsers = userService . loadAll ( ) . stream ( ) . collect ( Collectors . toMap ( User :: getName , User :: getName ) ) ; final Map < String , String > userNames = ImmutableMap . < String , String > builder ( ) . put ( graylogConfig . getRootUsername ( ) , graylogConfig . getRootUsern...
public class Converter { /** * convert */ private static void convertUnicodeToHex ( String str ) { } }
try { display ( "Unicode to hex: " + Utils . toHexBytes ( Utils . toBytes ( str ) ) ) ; } catch ( Exception e ) { }
public class SimpleHTTPClient { /** * Register an health check task . * @ param task The health check task . */ public void registerHealthCheck ( Task task ) { } }
Optional . ofNullable ( config . getHealthCheck ( ) ) . ifPresent ( healthCheck -> healthCheck . register ( task ) ) ;
public class SyndataXXJobConfig { /** * init */ public void initXxlJobExecutor ( ) { } }
PropertiesContainer propertiesContainer = new PropertiesContainer ( ) ; propertiesContainer . addConfigPropertiesFile ( "application.properties" ) ; Map < Object , Object > objectMap = propertiesContainer . getAllProperties ( ) ; if ( objectMap != null ) { // registry jobhandler Set < Map . Entry < Object , Object > > ...
public class ZipUtils { /** * Unzips the given { @ link File ZIP file } to the specified { @ link File directory } . * @ param zip { @ link File ZIP file } to unzip . * @ param directory { @ link File } referring to the file system path location in which to * unzip the { @ link File ZIP file } . * @ throws Ille...
Assert . notNull ( zip , "ZIP file is required" ) ; Assert . isTrue ( FileUtils . createDirectory ( directory ) , String . format ( "[%s] is not a valid directory" , directory ) ) ; ZipFile zipFile = new ZipFile ( zip , ZipFile . OPEN_READ ) ; zipFile . stream ( ) . forEach ( zipEntry -> { if ( zipEntry . isDirectory (...
public class DynamicWeightedMajority { /** * DWM : : removeWeakestExpert */ @ Override public void trainOnInstanceImpl ( Instance inst ) { } }
this . epochs ++ ; double [ ] Pr = new double [ inst . numClasses ( ) ] ; double maxWeight = 0.0 ; double weakestExpertWeight = 1.0 ; int weakestExpertIndex = - 1 ; // Loop over experts for ( int i = 0 ; i < this . experts . size ( ) ; i ++ ) { double [ ] pr = this . experts . get ( i ) . getVotesForInstance ( inst ) ;...
public class Scanner { /** * Scan the { @ link # input } . * @ return A list of selector groups that contain a list of { @ link Selector } s scanned . * @ throws ScannerException If the input is invalid . */ public List < List < Selector > > scan ( ) throws ScannerException { } }
char [ ] data = input . toCharArray ( ) ; int cs ; int top ; int [ ] stack = new int [ 32 ] ; int eof = data . length ; int p = 0 ; int pe = eof ; int mark = 0 ; LinkedList < List < Selector > > selectors = new LinkedList < List < Selector > > ( ) ; // List < Selector > parts = new LinkedList < Selector > ( ) ; List < ...
public class TagContextBuilder { /** * Adds the key / value pair and metadata regardless of whether the key is present . * @ param key the { @ code TagKey } which will be set . * @ param value the { @ code TagValue } to set for the given key . * @ param tagMetadata the { @ code TagMetadata } associated with this ...
@ SuppressWarnings ( "deprecation" ) TagContextBuilder builder = put ( key , value ) ; return builder ;
public class MappingFilterParser { /** * C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 68:1 : type returns [ TreeModelFilter < OBDAMappingAxiom > value ] : ( ID | TEXT | TARGET | SOURCE ...
TreeModelFilter < SQLPPTriplesMap > value = null ; try { // C : \ \ Project \ \ Obdalib \ \ obdalib - parent \ \ obdalib - core \ \ src \ \ main \ \ java \ \ it \ \ unibz \ \ inf \ \ obda \ \ gui \ \ swing \ \ utils \ \ MappingFilter . g : 69:3 : ( ID | TEXT | TARGET | SOURCE | FUNCT | PRED ) int alt4 = 6 ; switch ( in...
public class FileManager { /** * Called before starting generating proxies files . Create the * { @ code java4cpp . log } log file , and manage the { @ code clean } and * { @ code useHash } settings . */ public void start ( ) { } }
addSymbolsFromSettings ( ) ; File rep = new File ( context . getSettings ( ) . getTargetPath ( ) ) ; rep . mkdirs ( ) ; try { java4cppLog = new FileWriter ( new File ( getPath ( JAVA4CPP_LOG ) ) ) ; } catch ( IOException e ) { System . err . println ( "Can't create log file: " + e . getMessage ( ) ) ; } try { File [ ] ...
public class AbstractSuppressionAnalyzer { /** * The prepare method loads the suppression XML file . * @ param engine a reference the dependency - check engine * @ throws InitializationException thrown if there is an exception */ @ Override public synchronized void prepareAnalyzer ( Engine engine ) throws Initializ...
if ( rules . isEmpty ( ) ) { try { loadSuppressionBaseData ( ) ; } catch ( SuppressionParseException ex ) { throw new InitializationException ( "Error initializing the suppression analyzer: " + ex . getLocalizedMessage ( ) , ex , true ) ; } try { loadSuppressionData ( ) ; } catch ( SuppressionParseException ex ) { thro...
public class FacesBackingBeanFactory { /** * Get a FacesBackingBean instance , given a FacesBackingBean class . * @ param beanClass the Class , which must be assignable to { @ link FacesBackingBean } . * @ return a new FacesBackingBean instance . */ public FacesBackingBean getFacesBackingBeanInstance ( Class beanCl...
assert FacesBackingBean . class . isAssignableFrom ( beanClass ) : "Class " + beanClass . getName ( ) + " does not extend " + FacesBackingBean . class . getName ( ) ; return ( FacesBackingBean ) beanClass . newInstance ( ) ;
public class ProfileController { /** * Display the current user ' s approvals */ @ RequestMapping ( value = "/profile" , method = RequestMethod . GET ) public String get ( Authentication authentication , Model model ) { } }
Map < String , List < DescribedApproval > > approvals = getCurrentApprovalsForUser ( getCurrentUserId ( ) ) ; Map < String , String > clientNames = getClientNames ( approvals ) ; model . addAttribute ( "clientnames" , clientNames ) ; model . addAttribute ( "approvals" , approvals ) ; model . addAttribute ( "isUaaManage...
public class HttpHealthCheckClient { /** * Deletes the specified HttpHealthCheck resource . * < p > Sample code : * < pre > < code > * try ( HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient . create ( ) ) { * ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName ...
DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest . newBuilder ( ) . setHttpHealthCheck ( httpHealthCheck == null ? null : httpHealthCheck . toString ( ) ) . build ( ) ; return deleteHttpHealthCheck ( request ) ;
public class MsgSettingController { /** * Gets validation data lists . * @ param req the req * @ return the validation data lists */ @ GetMapping ( "/setting/param/from/url" ) public List < ValidationData > getValidationDataLists ( HttpServletRequest req ) { } }
this . validationSessionComponent . sessionCheck ( req ) ; ValidationData data = ParameterMapper . requestParamaterToObject ( req , ValidationData . class , "UTF-8" ) ; return this . msgSettingService . getValidationData ( data . getParamType ( ) , data . getMethod ( ) , data . getUrl ( ) ) ;
public class ParameterMetaData { /** * { @ inheritDoc } */ public int getPrecision ( final int param ) throws SQLException { } }
try { return this . parameters . get ( param - 1 ) . precision ; } catch ( NullPointerException e ) { throw new SQLException ( "Parameter is not set: " + param ) ; } catch ( IndexOutOfBoundsException out ) { throw new SQLException ( "Parameter out of bounds: " + param ) ; } // end of catch
public class CmsModelGroupHelper { /** * Returns the model group base element . < p > * @ param modelGroupPage the model group page * @ param modelGroupResource the model group resource * @ return the base element */ private CmsContainerElementBean getModelBaseElement ( CmsContainerPageBean modelGroupPage , CmsRe...
CmsContainerElementBean result = null ; for ( CmsContainerElementBean element : modelGroupPage . getElements ( ) ) { if ( CmsContainerElement . ModelGroupState . isModelGroup . name ( ) . equals ( element . getIndividualSettings ( ) . get ( CmsContainerElement . MODEL_GROUP_STATE ) ) ) { result = element ; break ; } } ...
public class Transforms { /** * Sigmoid function * @ param ndArray * @ param dup * @ return */ public static INDArray sigmoid ( INDArray ndArray , boolean dup ) { } }
return exec ( dup ? new Sigmoid ( ndArray , ndArray . ulike ( ) ) : new Sigmoid ( ndArray ) ) ;
public class DynamicVariableSet { /** * Gets the first variable index which can contain a replicated * variable for the { @ code plateNum } th plate . The returned index is * inclusive and may be used by the plate . * @ param plateNum * @ return */ private int getPlateStartIndex ( int plateNum ) { } }
Preconditions . checkArgument ( plateNum >= 0 && plateNum < plateNames . size ( ) ) ; int startOffset = fixedVariableMaxInd + 1 ; for ( int i = 0 ; i < plateNum ; i ++ ) { startOffset += plates . get ( i ) . getMaximumPlateSize ( ) * maximumReplications [ i ] ; } return startOffset ;
public class AbstractDataBinder { /** * Returns , whether the data , which corresponds to a specific key , is currently cached , or not . * @ param key * The key , which corresponds to the data , which should be checked , as an instance of * the generic type KeyType . The key may not be null * @ return True , i...
Condition . INSTANCE . ensureNotNull ( key , "The key may not be null" ) ; synchronized ( cache ) { return cache . get ( key ) != null ; }
public class ReflectionUtil { /** * Create an Uploader from its fully qualified class name . * The class passed in by name must be assignable to Uploader . * See the secor . upload . class config option . * @ param className The class name of a subclass of Uploader * @ return an UploadManager instance with the ...
Class < ? > clazz = Class . forName ( className ) ; if ( ! Uploader . class . isAssignableFrom ( clazz ) ) { throw new IllegalArgumentException ( String . format ( "The class '%s' is not assignable to '%s'." , className , Uploader . class . getName ( ) ) ) ; } return ( Uploader ) clazz . newInstance ( ) ;
public class RuntimeMojoSupport { /** * Ensure Maven compatibility . Requires Maven 3 + */ private void ensureMavenCompatibility ( final ClassLoader classLoader ) throws MojoExecutionException { } }
Version mavenVersion = mavenVersionHelper . detectVersion ( classLoader ) ; if ( mavenVersion == null ) { // complain and continue log . error ( "Unable to determine Maven version" ) ; } else { log . debug ( "Detected Maven version: {}" , mavenVersion ) ; if ( versionHelper . before ( 3 ) . containsVersion ( mavenVersi...
public class CmsUserSettingsStringPropertyWrapper { /** * Gets the time warp . * @ return the time warp */ @ PrefMetadata ( type = CmsTimeWarpPreference . class ) public String getTimeWarp ( ) { } }
long warp = m_settings . getTimeWarp ( ) ; return warp < 0 ? "" : "" + warp ; // if timewarp < 0 ( i . e . time warp is not set ) , use the empty string because we don ' t want the date selector widget to interpret the negative value
public class JdbcSqlDriver { /** * 查询主键名 */ private Single < String > getIdColName ( String tableName ) { } }
String alias = "idColumnName" ; return new CustomSelectAction ( ) { @ Override protected String patternSql ( ) { return String . format ( "SELECT k.COLUMN_NAME as %s\n" + "FROM information_schema.table_constraints t\n" + "LEFT JOIN information_schema.key_column_usage k\n" + "USING(constraint_name,table_schema,table_nam...
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcElementCompositionEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class OptionsSpiderPanel { /** * This method initializes the Parse robots . txt checkbox . * @ return javax . swing . JCheckBox */ private JCheckBox getChkParseRobotsTxt ( ) { } }
if ( parseRobotsTxt == null ) { parseRobotsTxt = new JCheckBox ( ) ; parseRobotsTxt . setText ( Constant . messages . getString ( "spider.options.label.robotstxt" ) ) ; } return parseRobotsTxt ;
public class UpdateCenter { /** * Gets the plugin with the given name from the first { @ link UpdateSite } to contain it . * @ return Discovered { @ link Plugin } . { @ code null } if it cannot be found */ public @ CheckForNull Plugin getPlugin ( String artifactId ) { } }
for ( UpdateSite s : sites ) { Plugin p = s . getPlugin ( artifactId ) ; if ( p != null ) return p ; } return null ;
public class ConsonantUtil { /** * * * * * * BEGINNING OF FUNCTION * * * * * */ / * / public static boolean is_tavarga ( String str ) { } }
if ( str . equals ( "t" ) || str . equals ( "T" ) || str . equals ( "d" ) || str . equals ( "D" ) || str . equals ( "n" ) ) return true ; return false ;
public class JobScheduleTerminateOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time . * @ param ifUnmodifiedSince the ifUnmodifiedSince value to set ...
if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ;
public class Parser { /** * Found a name in a statement context . If it ' s a label , we gather * up any following labels and the next non - label statement into a * { @ link LabeledStatement } " bundle " and return that . Otherwise we parse * an expression and return it wrapped in an { @ link ExpressionStatement...
if ( currentToken != Token . NAME ) throw codeBug ( ) ; int pos = ts . tokenBeg ; // set check for label and call down to primaryExpr currentFlaggedToken |= TI_CHECK_LABEL ; AstNode expr = expr ( ) ; if ( expr . getType ( ) != Token . LABEL ) { AstNode n = new ExpressionStatement ( expr , ! insideFunction ( ) ) ; n . l...
public class HttpMethodBase { /** * Reads the response headers from the given { @ link HttpConnection connection } . * Subclasses may want to override this method to to customize the * processing . * " It must be possible to combine the multiple header fields into one * " field - name : field - value " pair , w...
LOG . trace ( "enter HttpMethodBase.readResponseHeaders(HttpState," + "HttpConnection)" ) ; getResponseHeaderGroup ( ) . clear ( ) ; Header [ ] headers = HttpParser . parseHeaders ( conn . getResponseInputStream ( ) , getParams ( ) . getHttpElementCharset ( ) ) ; // Wire logging moved to HttpParser getResponseHeaderGro...
public class XParser { /** * Parses the given file , and returns the XLog instances * extracted . The file is first checked against this parser , * to check whether it can be handled . If the parser cannot * handle the given file , or the extraction itself fails , * the parser should raise an < code > IOExcepti...
if ( canParse ( file ) ) { InputStream is = new FileInputStream ( file ) ; return parse ( is ) ; } else { throw new IllegalArgumentException ( "Parser cannot handle this file!" ) ; }
public class MethodWriterImpl { /** * { @ inheritDoc } */ @ Override public Content getMethodDetailsTreeHeader ( TypeElement typeElement , Content memberDetailsTree ) { } }
memberDetailsTree . addContent ( HtmlConstants . START_OF_METHOD_DETAILS ) ; Content methodDetailsTree = writer . getMemberTreeHeader ( ) ; methodDetailsTree . addContent ( writer . getMarkerAnchor ( SectionName . METHOD_DETAIL ) ) ; Content heading = HtmlTree . HEADING ( HtmlConstants . DETAILS_HEADING , contents . me...
public class Matchers { /** * Matches an Annotation AST node if the argument to the annotation with the given name has a * value which matches the given matcher . For example , { @ code hasArgumentWithValue ( " value " , * stringLiteral ( " one " ) ) } matches { @ code @ Thing ( " one " ) } or { @ code @ Thing ( { ...
return new AnnotationHasArgumentWithValue ( argumentName , valueMatcher ) ;
public class SimonUtils { /** * Calls a block of code with stopwatch around , can not return any result or throw an exception * ( use { @ link # doWithStopwatch ( String , java . util . concurrent . Callable ) } instead ) . * @ param name name of the Stopwatch * @ param runnable wrapped block of code * @ since ...
try ( Split split = SimonManager . getStopwatch ( name ) . start ( ) ) { runnable . run ( ) ; }
public class CreateAlipayChargeParams { /** * A currency to give to the charge . Optional . < br > * Default value is MXN < br > * @ param currency * @ return */ public CreateAlipayChargeParams currency ( final Currency currency ) { } }
return this . with ( "currency" , currency == null ? Currency . MXN . name ( ) : currency . name ( ) ) ;
public class NumberUtil { /** * 保留固定位数小数 < br > * 例如保留四位小数 : 123.456789 = 》 123.4567 * @ param v 值 * @ param scale 保留小数位数 * @ param roundingMode 保留小数的模式 { @ link RoundingMode } * @ return 新值 * @ since 3.2.2 */ public static String roundStr ( double v , int scale , RoundingMode roundingMode ) { } }
return round ( v , scale , roundingMode ) . toString ( ) ;
public class DistanceLearnerFactory { /** * find xxx in a string of the form xxx [ yyy = zzz ] or xxxx */ static private Class findClassFor ( String s ) throws ClassNotFoundException { } }
int endClassIndex = s . indexOf ( '[' ) ; if ( endClassIndex >= 0 ) s = s . substring ( 0 , endClassIndex ) ; try { return Class . forName ( s ) ; } catch ( ClassNotFoundException e ) { return Class . forName ( "com.wcohen.ss." + s ) ; }
public class AbstractGenericsContext { /** * Useful for reporting or maybe logging . Resolves all generics and compose resulted type as string . * < pre > { @ code class A extends B < Long > ; * class B < T > { * List < T > doSmth ( ) ; * } } < / pre > * Resolving parameters in type of root class : * { @ co...
return TypeToStringUtils . toStringType ( type , chooseContext ( type ) . contextGenerics ( ) ) ;
public class MapViewerTemplate { /** * initializes the map view position . * @ param mvp the map view position to be set * @ return the mapviewposition set */ protected IMapViewPosition initializePosition ( IMapViewPosition mvp ) { } }
LatLong center = mvp . getCenter ( ) ; if ( center . equals ( new LatLong ( 0 , 0 ) ) ) { mvp . setMapPosition ( this . getInitialPosition ( ) ) ; } mvp . setZoomLevelMax ( getZoomLevelMax ( ) ) ; mvp . setZoomLevelMin ( getZoomLevelMin ( ) ) ; return mvp ;
public class CmsRequestUtil { /** * Parses the parameters of the given request query part , optionally decodes them , and creates a parameter map out of them . < p > * Please note : This does not parse a full request URI / URL , only the query part that * starts after the " ? " . For example , in the URI < code > /...
if ( CmsStringUtil . isEmpty ( query ) ) { // empty query return new HashMap < String , String [ ] > ( ) ; } if ( query . charAt ( 0 ) == URL_DELIMITER . charAt ( 0 ) ) { // remove leading ' ? ' if required query = query . substring ( 1 ) ; } // cut along the different parameters String [ ] params = CmsStringUtil . spl...
public class Scheduler { /** * cal . set ( Calendar . DAY _ OF _ WEEK , dayOfWeek ) ; * @ param dayOfWeek * @ return time date */ public static Date toDateDayOfWeek ( int dayOfWeek ) { } }
Calendar cal = Calendar . getInstance ( ) ; cal . set ( Calendar . DAY_OF_WEEK , dayOfWeek ) ; return cal . getTime ( ) ;
public class EntryStream { /** * Returns a sequential ordered { @ code EntryStream } containing the possible * pairs of elements taken from the provided list . * Both keys and values are taken from the input list . The index of the key * is always strictly less than the index of the value . The pairs in the * s...
return of ( new PairPermutationSpliterator < > ( list , SimpleImmutableEntry :: new ) ) ;
public class HibernateLayer { /** * This implementation does not support the ' offset ' parameter . The maxResultSize parameter is not used ( limiting * the result needs to be done after security { @ link org . geomajas . internal . layer . vector . GetFeaturesEachStep } ) . If * you expect large results to be retu...
try { Session session = getSessionFactory ( ) . getCurrentSession ( ) ; Criteria criteria = session . createCriteria ( getFeatureInfo ( ) . getDataSourceName ( ) ) ; if ( filter != null ) { if ( filter != Filter . INCLUDE ) { CriteriaVisitor visitor = new CriteriaVisitor ( ( HibernateFeatureModel ) featureModel , dateF...
public class CPDefinitionOptionValueRelUtil { /** * Returns a range of all the cp definition option value rels where companyId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , t...
return getPersistence ( ) . findByCompanyId ( companyId , start , end ) ;
public class LruCache { /** * Returns the keys stored in the cache */ public Iterator < K > keys ( ) { } }
KeyIterator < K , V > iter = new KeyIterator < K , V > ( this ) ; iter . init ( this ) ; return iter ;
public class StoragePreferenceFragment { /** * END PERMISSION CHECK */ @ Override public void onClick ( View v ) { } }
switch ( v . getId ( ) ) { case R . id . buttonManualCacheEntry : { showManualEntry ( ) ; } break ; case R . id . buttonSetCache : { showPickCacheFromList ( ) ; } break ; }
public class Descriptor { /** * Unlike { @ link # clazz } , return the parameter type ' T ' , which determines * the { @ link DescriptorExtensionList } that this goes to . * In those situations where subtypes cannot provide the type parameter , * this method can be overridden to provide it . */ public Class < T >...
Type subTyping = Types . getBaseClass ( getClass ( ) , Descriptor . class ) ; if ( ! ( subTyping instanceof ParameterizedType ) ) { throw new IllegalStateException ( getClass ( ) + " doesn't extend Descriptor with a type parameter." ) ; } return Types . erasure ( Types . getTypeArgument ( subTyping , 0 ) ) ;
public class NaiveTokenizer { /** * Sets the minimum allowed token length . Any token discovered shorter than * the minimum length will not be accepted and skipped over . The default * is 0. * @ param minTokenLength the minimum length for a token to be used */ public void setMinTokenLength ( int minTokenLength ) ...
if ( minTokenLength < 0 ) throw new IllegalArgumentException ( "Minimum token length must be non negative, not " + minTokenLength ) ; if ( minTokenLength > maxTokenLength ) throw new IllegalArgumentException ( "Minimum token length can not exced the maximum token length" ) ; this . minTokenLength = minTokenLength ;
public class DocumentQuery { /** * TBD expr IDocumentQuery < T > IDocumentQueryBase < T , IDocumentQuery < T > > . OrderByDistanceDescending < TValue > ( Expression < Func < T , TValue > > propertySelector , string shapeWkt ) */ @ Override public IDocumentQuery < T > orderByDistanceDescending ( String fieldName , Strin...
_orderByDistanceDescending ( fieldName , shapeWkt ) ; return this ;
public class GenClassFactory { /** * Creates generated class by using ClassLoader . Return null if unable to * load class * @ param cls Annotated class acting also as superclass for created parser * @ return * @ throws ClassNotFoundException */ public static Class < ? > loadGenClass ( Class < ? > cls ) throws C...
Class < ? > parserClass = map . get ( cls ) ; if ( parserClass == null ) { GenClassname genClassname = cls . getAnnotation ( GenClassname . class ) ; if ( genClassname == null ) { throw new IllegalArgumentException ( "@GenClassname not set in " + cls ) ; } parserClass = Class . forName ( genClassname . value ( ) ) ; ma...
public class ProjectNodeSupport { /** * @ param origin origin source * @ param ident unique identity for this cached source , used in filename * @ param descr description of the source , used in logging * @ return new source */ private ResourceModelSource createCachingSource ( ResourceModelSource origin , String ...
return createCachingSource ( origin , ident , descr , SourceFactory . CacheType . BOTH , true ) ;
public class RulePluralizer { /** * Defines a word with irregular plural . Ensures that the case of * the first letter is taken over . * < pre > { @ code * irregular ( " cow " , " kine " ) ; * pluralOf ( " cow " ) ; / / - > " kine " * pluralOf ( " Cow " ) ; / / - > " Kine " * singularOf ( " kine " ) ; / / -...
plural = lower ( plural ) ; singular = lower ( singular ) ; plural ( newIrregularRule ( singular , plural , locale ) ) ; singular ( newIrregularRule ( plural , singular , locale ) ) ;
public class CallSimulator { /** * Return the next call event that is safe for delivery or null * if there are no safe objects to deliver . * Null response could mean empty , or could mean all objects * are scheduled for the future . * @ param systemCurrentTimeMillis The current time . * @ return CallEvent */...
// check for time passing if ( systemCurrentTimeMillis > currentSystemMilliTimestamp ) { // build a target for this 1ms window long eventBacklog = targetEventsThisMillisecond - eventsSoFarThisMillisecond ; targetEventsThisMillisecond = ( long ) Math . floor ( targetEventsPerMillisecond ) ; double targetFraction = targe...
public class XTraceBufferedImpl { /** * ( non - Javadoc ) * @ see java . util . List # remove ( int ) */ public XEvent remove ( int index ) { } }
try { XEvent result = events . remove ( index ) ; return result ; } catch ( IOException e ) { e . printStackTrace ( ) ; return null ; }
public class MetricRegistryImpl { /** * Shuts down this registry and the associated { @ link MetricReporter } . * < p > NOTE : This operation is asynchronous and returns a future which is completed * once the shutdown operation has been completed . * @ return Future which is completed once the { @ link MetricRegi...
synchronized ( lock ) { if ( isShutdown ) { return terminationFuture ; } else { isShutdown = true ; final Collection < CompletableFuture < Void > > terminationFutures = new ArrayList < > ( 3 ) ; final Time gracePeriod = Time . seconds ( 1L ) ; if ( metricQueryServiceRpcService != null ) { final CompletableFuture < Void...
public class ClientStats { /** * < p > Return an average throughput of transactions acknowledged per * second for the duration covered by this stats instance . < / p > * < p > Essentially < code > { @ link # getInvocationsCompleted ( ) } divided by * ( { @ link # getStartTimestamp ( ) } - { @ link # getEndTimesta...
assert ( m_startTS != Long . MAX_VALUE ) ; assert ( m_endTS != Long . MIN_VALUE ) ; if ( m_invocationsCompleted == 0 ) return 0 ; if ( m_endTS < m_startTS ) { m_endTS = m_startTS + 1 ; // 1 ms duration is sorta cheatin ' } long durationMs = m_endTS - m_startTS ; return ( long ) ( m_invocationsCompleted / ( durationMs /...
public class TiffITProfile { /** * Validate Screened Data image . * @ param ifd the ifd * @ param p the profile ( default = 0 , P2 = 2) */ private void validateIfdSD ( IFD ifd , int p ) { } }
IfdTags metadata = ifd . getMetadata ( ) ; if ( p == 2 ) { checkRequiredTag ( metadata , "NewSubfileType" , 1 , new long [ ] { 0 } ) ; } checkRequiredTag ( metadata , "ImageLength" , 1 ) ; checkRequiredTag ( metadata , "ImageWidth" , 1 ) ; checkRequiredTag ( metadata , "BitsPerSample" , 1 , new long [ ] { 1 } ) ; check...
public class GetClassifiersResult { /** * The requested list of classifier objects . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setClassifiers ( java . util . Collection ) } or { @ link # withClassifiers ( java . util . Collection ) } if you want to * ...
if ( this . classifiers == null ) { setClassifiers ( new java . util . ArrayList < Classifier > ( classifiers . length ) ) ; } for ( Classifier ele : classifiers ) { this . classifiers . add ( ele ) ; } return this ;
public class CollUtil { /** * 新建一个List < br > * 提供的参数为null时返回空 { @ link ArrayList } * @ param < T > 集合元素类型 * @ param isLinked 是否新建LinkedList * @ param enumration { @ link Enumeration } * @ return ArrayList对象 * @ since 3.0.8 */ public static < T > List < T > list ( boolean isLinked , Enumeration < T > enumra...
final List < T > list = list ( isLinked ) ; if ( null != enumration ) { while ( enumration . hasMoreElements ( ) ) { list . add ( enumration . nextElement ( ) ) ; } } return list ;
public class InvalidationAuditDaemon { /** * This notifies this daemon that a specified cache instance has cleared . It * clears the internal tables * @ param cache The cache instance . */ public void cacheCleared ( String cacheName ) { } }
InvalidationTableList list = ( InvalidationTableList ) cacheinvalidationTables . get ( cacheName ) ; if ( list != null ) list . clear ( ) ;
public class HandoffResultsListener { /** * Builds a runnable to shut down a work unit after a configurable delay once handoff * has completed . If the cluster has been instructed to shut down and the last work unit * has been handed off , this task also directs this Ordasity instance to shut down . */ private Runn...
final Cluster cluster = this . cluster ; final Logger log = LOG ; return new Runnable ( ) { @ Override public void run ( ) { String str = cluster . getHandoffResult ( workUnit ) ; log . info ( "Shutting down {} following handoff to {}." , workUnit , ( str == null ) ? "(None)" : str ) ; cluster . shutdownWork ( workUnit...
public class StringUtils { /** * Join a collection of strings together into one . * @ param chunks the chunks to join . * @ param delimiter the delimiter between the keys . * @ return the fully joined string . */ public static String join ( final Collection < String > chunks , final String delimiter ) { } }
StringBuilder sb = new StringBuilder ( ) ; if ( ! chunks . isEmpty ( ) ) { Iterator < String > itr = chunks . iterator ( ) ; sb . append ( itr . next ( ) ) ; while ( itr . hasNext ( ) ) { sb . append ( delimiter ) ; sb . append ( itr . next ( ) ) ; } } return sb . toString ( ) ;
public class Decoder { /** * < p > Performs RS error correction on an array of bits . < / p > * @ return the corrected array * @ throws FormatException if the input contains too many errors */ private boolean [ ] correctBits ( boolean [ ] rawbits ) throws FormatException { } }
GenericGF gf ; int codewordSize ; if ( ddata . getNbLayers ( ) <= 2 ) { codewordSize = 6 ; gf = GenericGF . AZTEC_DATA_6 ; } else if ( ddata . getNbLayers ( ) <= 8 ) { codewordSize = 8 ; gf = GenericGF . AZTEC_DATA_8 ; } else if ( ddata . getNbLayers ( ) <= 22 ) { codewordSize = 10 ; gf = GenericGF . AZTEC_DATA_10 ; } ...
public class ExpandableFieldDeserializer { /** * Deserializes an expandable field JSON payload ( i . e . either a string with just the ID , or a full * JSON object ) into an { @ link ExpandableField } object . */ @ Override public ExpandableField < ? > deserialize ( JsonElement json , Type typeOfT , JsonDeserializati...
if ( json . isJsonNull ( ) ) { return null ; } ExpandableField < ? > expandableField ; // Check if json is a String ID . If so , the field has not been expanded , so we only need to // serialize a String and create a new ExpandableField with the String id only . if ( json . isJsonPrimitive ( ) ) { JsonPrimitive jsonPri...
public class SessionManagerActor { /** * Spawn new session * @ param uid user ' s id * @ param ownKeyGroup own key group id * @ param theirKeyGroup their key group Id * @ param ownIdentity own identity private key * @ param theirIdentity their identity public key * @ param ownPreKey own pre key * @ param ...
// Calculating Master Secret byte [ ] masterSecret = RatchetMasterSecret . calculateMasterSecret ( new RatchetPrivateKey ( ownIdentity . getKey ( ) ) , new RatchetPrivateKey ( ownPreKey . getKey ( ) ) , new RatchetPublicKey ( theirIdentity . getPublicKey ( ) ) , new RatchetPublicKey ( theirPreKey . getPublicKey ( ) ) )...
public class JMSDestinationDefinitionInjectionBinding { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . injectionengine . InjectionBinding # merge ( java . lang . annotation . Annotation , java . lang . Class , java . lang . reflect . Member ) */ @ Override public void merge ( JMSDestinationDefinition annotation ...
if ( member != null ) { // JMSDestinationDefinition is a class - level annotation only . throw new IllegalArgumentException ( member . toString ( ) ) ; } name = mergeAnnotationValue ( name , isXmlNameSet , annotation . name ( ) , JMSDestinationProperties . NAME . getAnnotationKey ( ) , "" ) ; interfaceName = mergeAnnot...
public class JDBCUtils { /** * query , because need to manually close the resource , so not recommended * for use it * @ param sql * @ param args * @ return ResultSet */ @ Deprecated public static ResultSet query ( String sql , Object ... args ) { } }
ResultSet result = null ; Connection con = getconnnection ( ) ; PreparedStatement ps = null ; try { ps = con . prepareStatement ( sql ) ; if ( args != null ) { for ( int i = 0 ; i < args . length ; i ++ ) { ps . setObject ( ( i + 1 ) , args [ i ] ) ; } } result = ps . executeQuery ( ) ; } catch ( SQLException e ) { e ....
public class SecurityServiceImpl { /** * Retrieve the AuthorizationService for the specified id . * @ param id AuthorizationService id to retrieve * @ return A non - null AuthorizationService instance . */ private AuthorizationService getAuthorizationService ( String id ) { } }
AuthorizationService service = authorization . getService ( id ) ; if ( service == null ) { throwIllegalArgumentExceptionInvalidAttributeValue ( SecurityConfiguration . CFG_KEY_AUTHORIZATION_REF , id ) ; } return service ;
public class XmlUtils { /** * Prints the XML { @ link Document } to standard out with handy indentation . * @ param doc The { @ link Document } to print . */ public static void printDoc ( final Document doc ) { } }
try { final Transformer trans = TransformerFactory . newInstance ( ) . newTransformer ( ) ; trans . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; trans . transform ( new DOMSource ( doc ) , new StreamResult ( System . out ) ) ; } catch ( final TransformerConfigurationException e ) { LOG . error ( "Could not confi...
public class WAjaxControl { /** * Get the target WComponents that will be repainted as a consequence of the AJAX request . * When the AJAX request is triggered only the target component ( s ) will be re - painted . An empty list is returned if * no targets have been defined . * @ return the target regions that ar...
List < AjaxTarget > targets = getComponentModel ( ) . targets ; if ( targets == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( targets ) ;
public class BackupResourceVaultConfigsInner { /** * Fetches resource vault config . * @ param vaultName The name of the recovery services vault . * @ param resourceGroupName The name of the resource group where the recovery services vault is present . * @ throws IllegalArgumentException thrown if parameters fail...
return getWithServiceResponseAsync ( vaultName , resourceGroupName ) . map ( new Func1 < ServiceResponse < BackupResourceVaultConfigResourceInner > , BackupResourceVaultConfigResourceInner > ( ) { @ Override public BackupResourceVaultConfigResourceInner call ( ServiceResponse < BackupResourceVaultConfigResourceInner > ...
public class SubsystemFeatureDefinitionImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . kernel . feature . FeatureDefinition # isCapabilitySatified ( java . util . Collection ) */ @ Override public boolean isCapabilitySatisfied ( Collection < ProvisioningFeatureDefinition > featureDefinitionsToCheck ) { } }
// If it isn ' t an autofeature , it ' s satisfied . if ( ! iAttr . isAutoFeature ) return true ; if ( mfDetails == null ) throw new IllegalStateException ( "Method called outside of provisioining operation or without a registered service" ) ; boolean isCapabilitySatisfied = true ; Iterator < Filter > iter = mfDetails ...
public class ChannelManager { /** * Removes a channel with its given identification . */ public void removeChannel ( T channel , String functionalityName , String requesterID , String conversationID ) { } }
synchronized ( this . channelsWithId ) { this . channelsWithId . remove ( calculateId ( functionalityName , requesterID , conversationID ) ) ; } synchronized ( this . channelsWithFunctionalityName ) { this . channelsWithFunctionalityName . get ( functionalityName ) . remove ( channel ) ; }
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getMDDMDDFlgs ( ) { } }
if ( mddmddFlgsEEnum == null ) { mddmddFlgsEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 46 ) ; } return mddmddFlgsEEnum ;
public class Template { /** * Check to see if the given name is a valid template name . Valid template * names may include only letters , digits , underscores , hyphens , periods , * pluses , and slashes . In addition , each term when split by slashes must * not be empty and must not start with a period . The sec...
// First do the easy check to make sure that the string isn ' t empty and // contains only valid characters . if ( ! validTemplateNameChars . matcher ( name ) . matches ( ) ) { return false ; } // Split the string on slashes and ensure that each one of the terms is // valid . Cannot be empty or start with a period . ( ...
public class ManagedComponent { /** * Emits a notification through this manageable . */ @ Override public void emit ( Level level , String message , long sequence ) { } }
if ( _broadcaster != null ) _broadcaster . sendNotification ( new Notification ( level . toString ( ) , _name != null ? _name : this , sequence , message ) ) ;
public class Job { /** * Execution steps for an execution job , for an Amplify App . * @ param steps * Execution steps for an execution job , for an Amplify App . */ public void setSteps ( java . util . Collection < Step > steps ) { } }
if ( steps == null ) { this . steps = null ; return ; } this . steps = new java . util . ArrayList < Step > ( steps ) ;
public class GenericTransportReceiveListener { /** * Notification that an error occurred when we were expecting to receive * a response . This method is used to " wake up " any conversations using * a connection for which an error occurres . At the point this method is * invoked , the connection will already have...
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "errorOccurred" , new Object [ ] { exception , segmentType , requestNumber , priority , conversation } ) ; FFDCFilter . processException ( exception , CLASS_NAME + ".errorOccurred" , CommsConstants . GENERICTRANSPORTRECEIVELISTENER_ERROR_01 , this ) ; if ( tc ....
public class FactoryMultiView { /** * Triangulate two view using the Discrete Linear Transform ( DLT ) with an uncalibrated camera . * @ see TriangulateProjectiveLinearDLT * @ return Two view triangulation algorithm */ public static Triangulate2ViewsProjective triangulate2ViewProjective ( @ Nullable ConfigTriangula...
if ( config == null ) config = new ConfigTriangulation ( ) ; switch ( config . type ) { case DLT : return new Wrap2ViewsTriangulateProjectiveDLT ( ) ; } throw new IllegalArgumentException ( "Unknown or unsupported type " + config . type ) ;
public class DistributedLogServerContext { /** * Compacts the log by size . */ private void compactBySize ( ) { } }
if ( maxLogSize > 0 && journal . size ( ) > maxLogSize ) { JournalSegment < LogEntry > compactSegment = null ; Long compactIndex = null ; for ( JournalSegment < LogEntry > segment : journal . segments ( ) ) { Collection < JournalSegment < LogEntry > > remainingSegments = journal . segments ( segment . lastIndex ( ) + 1...
public class ValueFactory { /** * 处理类型是数组类型 * < p > Function : createValueArray < / p > * < p > Description : < / p > * @ author acexy @ thankjava . com * @ date 2015-1-27 下午4:30:29 * @ version 1.0 * @ param targetFieldType * @ param targetObject * @ param originValue * @ return */ static Object creat...
if ( originValue == null ) { return null ; } // 获取数组实际容纳的的类型 Class < ? > proxyType = targetFieldType . getComponentType ( ) ; Object [ ] originArray = ( Object [ ] ) originValue ; if ( originArray . length == 0 ) { return null ; } Object [ ] targetArray = ( Object [ ] ) Array . newInstance ( proxyType , originArray . l...
public class UrlBuilder { /** * Creates a new URL relative to the base URL provided in the constructor of this class . The new relative URL * includes the path , query parameters and the internal reference of the { @ link UrlBuilder # baseUrl base URL } * provided with this class . An additional fragment , as well ...
String url = null ; final Optional < String > fragment2 = ofNullable ( trimToNull ( fragment ) ) ; try { final Optional < URL > fragmentUrl = ofNullable ( fragment2 . isPresent ( ) ? new URL ( "http://example.com/" + fragment2 . get ( ) ) : null ) ; final URIBuilder uriBuilder = new URIBuilder ( ) ; // add path uriBuil...
public class CPDefinitionPersistenceImpl { /** * Removes all the cp definitions where uuid = & # 63 ; and companyId = & # 63 ; from the database . * @ param uuid the uuid * @ param companyId the company ID */ @ Override public void removeByUuid_C ( String uuid , long companyId ) { } }
for ( CPDefinition cpDefinition : findByUuid_C ( uuid , companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpDefinition ) ; }
public class AbstractTypeVisitor6 { /** * { @ inheritDoc } * @ implSpec Visits an { @ code IntersectionType } element by calling { @ code * visitUnknown } . * @ param t { @ inheritDoc } * @ param p { @ inheritDoc } * @ return the result of { @ code visitUnknown } * @ since 1.8 */ @ Override public R visitIn...
return visitUnknown ( t , p ) ;
public class CobolComplexTypeFinder { /** * { @ inheritDoc } */ public boolean match ( byte [ ] hostData , int start , int length ) { } }
Cob2ObjectValidator visitor = new Cob2ObjectValidator ( cobolContext , hostData , start , length , stopFieldInclusive ) ; visitor . visit ( cobolComplexType ) ; return visitor . isValid ( ) ;
public class JoinPoint { /** * Shortcut method to create a JoinPoint waiting for the given synchronization points , start the JoinPoint , * and add the given listener to be called when the JoinPoint is unblocked . * If any synchronization point has an error or is cancelled , the JoinPoint is immediately unblocked ....
JoinPoint < Exception > jp = new JoinPoint < > ( ) ; for ( int i = 0 ; i < synchPoints . length ; ++ i ) if ( synchPoints [ i ] != null ) jp . addToJoin ( synchPoints [ i ] ) ; jp . start ( ) ; jp . listenInline ( listener ) ;
public class Screenshots { /** * Take screenshot of WebElement / SelenideElement in iframe * for partially visible WebElement / Selenide horizontal scroll bar will be present * @ return buffered image */ public static BufferedImage takeScreenShotAsImage ( WebElement iframe , WebElement element ) { } }
return screenshots . takeScreenshotAsImage ( driver ( ) , iframe , element ) ;
public class TIFFImageWriter { /** * TODO : Candidate util method */ private int computePixelSize ( final SampleModel sampleModel ) { } }
int size = 0 ; for ( int i = 0 ; i < sampleModel . getNumBands ( ) ; i ++ ) { size += sampleModel . getSampleSize ( i ) ; } return size ;
public class DurableOutputHandler { /** * Create a DurableConfirm reply . * @ param target The target ME for the message . * @ param reqID The request ID of the original request message . * @ param status The status to record in this reply . */ protected static ControlDurableConfirm createDurableConfirm ( Message...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createDurableConfirm" , new Object [ ] { MP , target , new Long ( reqID ) , new Integer ( status ) } ) ; ControlDurableConfirm msg = null ; try { // Create and initialize the message msg = MessageProcessor . getControlMessa...
public class LogicalClock { /** * Increments the clock and updates it using the given timestamp . * @ param timestamp the timestamp with which to update the clock * @ return the updated clock time */ public LogicalTimestamp incrementAndUpdate ( LogicalTimestamp timestamp ) { } }
long nextValue = currentTimestamp . value ( ) + 1 ; if ( timestamp . value ( ) > nextValue ) { return update ( timestamp ) ; } return increment ( ) ;
public class RESTClientEnablerExampleSbb { @ Override public void onResponse ( RESTClientEnablerChildSbbLocalObject child , RESTClientEnablerResponse response ) { } }
String uri = response . getRequest ( ) . getUri ( ) ; RESTClientEnablerRequest . Type type = response . getRequest ( ) . getType ( ) ; HttpResponse httpResponse = response . getHttpResponse ( ) ; if ( httpResponse != null ) { String content = null ; if ( httpResponse . getEntity ( ) != null ) { try { content = EntityUt...
public class ReviewsImpl { /** * This API adds a transcript file ( text version of all the words spoken in a video ) to a video review . The file should be a valid WebVTT format . * @ param teamName Your team name . * @ param reviewId Id of the review . * @ param vTTfile Transcript file of the video . * @ throw...
return addVideoTranscriptWithServiceResponseAsync ( teamName , reviewId , vTTfile ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class GeometryTools { /** * An average of all 2D bond length values is produced . Bonds which have * Atom ' s with no coordinates are disregarded . * See comment for center ( IAtomContainer atomCon , Dimension areaDim , HashMap renderingCoordinates ) for details on coordinate sets * @ param container The A...
double bondLengthSum = 0 ; Iterator < IBond > bonds = container . bonds ( ) . iterator ( ) ; int bondCounter = 0 ; while ( bonds . hasNext ( ) ) { IBond bond = bonds . next ( ) ; IAtom atom1 = bond . getBegin ( ) ; IAtom atom2 = bond . getEnd ( ) ; if ( atom1 . getPoint2d ( ) != null && atom2 . getPoint2d ( ) != null )...
public class DataUtil { /** * Lazy mechanism for stream loading * @ param data file * @ return lazy stream */ public static HasInputStream lazyFileStream ( final File data ) { } }
return new HasInputStream ( ) { @ Override public InputStream getInputStream ( ) throws IOException { return new FileInputStream ( data ) ; } @ Override public long writeContent ( OutputStream outputStream ) throws IOException { return copyStream ( getInputStream ( ) , outputStream ) ; } } ;
public class ClassLoaderWrapper { /** * { @ inheritDoc } */ @ Override protected synchronized Class < ? > loadClass ( String name , boolean resolve ) throws ClassNotFoundException { } }
// Check if class is in the loaded classes cache Class < ? > cachedClass = findLoadedClass ( name ) ; if ( cachedClass != null ) { if ( resolve ) { resolveClass ( cachedClass ) ; } return cachedClass ; } // Check parent class loaders for ( int i = 0 ; i < parents . length ; i ++ ) { ClassLoader parent = parents [ i ] ;...
public class HttpRequestUtil { /** * Method to open / establish a URLConnection . * @ param url The URL to connect to . * @ param proxy The proxy configuration . * @ return { @ link URLConnection } * @ throws IOException */ private static URLConnection getConnection ( String url , final ProxyConfig proxy ) thro...
URLConnection conn = null ; if ( proxy != null && proxy . getProxyUser ( ) != null ) { Authenticator . setDefault ( new Authenticator ( ) { @ Override protected PasswordAuthentication getPasswordAuthentication ( ) { return new PasswordAuthentication ( proxy . getProxyUser ( ) , proxy . getProxyPassword ( ) . toCharArra...