signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcSolidOrShell ( ) { } } | if ( ifcSolidOrShellEClass == null ) { ifcSolidOrShellEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1160 ) ; } return ifcSolidOrShellEClass ; |
public class MetricsData { /** * Adds the given entity id to the list of entities for the widget .
* @ param entityId The entity id to add to the list of entities */
public void addEntityId ( long entityId ) { } } | if ( this . entityIds == null ) this . entityIds = new ArrayList < Long > ( ) ; this . entityIds . add ( entityId ) ; |
public class JPATxEntityManager { /** * d638095.4 */
protected void registerEmInvocation ( UOWCoordinator uowCoord , Synchronization emInvocation ) { } } | try { ivAbstractJPAComponent . getEmbeddableWebSphereTransactionManager ( ) . registerSynchronization ( uowCoord , emInvocation , SYNC_TIER_OUTER ) ; // d638095.4
} catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "registerEmInvocation experienced unexpected exception while registering with transaction: " + e ) ; FFDCFilter . processException ( e , CLASS_NAME + ".registerEmInvocation" , "507" , this ) ; throw new RuntimeException ( "Registration of Entity Manager invocation with Transaction failed." , e ) ; } |
public class XAttributeUtils { /** * Derives a prototype for the given attribute . This prototype attribute
* will be equal in all respects , expect for the value of the attribute .
* This value will be set to a default value , depending on the specific type
* of the given attribute .
* @ param instance
* Attribute to derive prototype from .
* @ return The derived prototype attribute . */
public static XAttribute derivePrototype ( XAttribute instance ) { } } | XAttribute prototype = ( XAttribute ) instance . clone ( ) ; if ( prototype instanceof XAttributeList ) { } else if ( prototype instanceof XAttributeContainer ) { } else if ( prototype instanceof XAttributeLiteral ) { ( ( XAttributeLiteral ) prototype ) . setValue ( "DEFAULT" ) ; } else if ( prototype instanceof XAttributeBoolean ) { ( ( XAttributeBoolean ) prototype ) . setValue ( true ) ; } else if ( prototype instanceof XAttributeContinuous ) { ( ( XAttributeContinuous ) prototype ) . setValue ( 0.0 ) ; } else if ( prototype instanceof XAttributeDiscrete ) { ( ( XAttributeDiscrete ) prototype ) . setValue ( 0 ) ; } else if ( prototype instanceof XAttributeTimestamp ) { ( ( XAttributeTimestamp ) prototype ) . setValueMillis ( 0 ) ; } else if ( prototype instanceof XAttributeID ) { ( ( XAttributeID ) prototype ) . setValue ( XIDFactory . instance ( ) . createId ( ) ) ; } else { throw new AssertionError ( "Unexpected attribute type!" ) ; } return prototype ; |
public class BuilderModel { /** * Gathers component class and component information from the
* character manager for later reference by others . */
protected void gatherComponentInfo ( ComponentRepository crepo ) { } } | // get the list of all component classes
Iterators . addAll ( _classes , crepo . enumerateComponentClasses ( ) ) ; for ( int ii = 0 ; ii < _classes . size ( ) ; ii ++ ) { // get the list of components available for this class
ComponentClass cclass = _classes . get ( ii ) ; Iterator < Integer > iter = crepo . enumerateComponentIds ( cclass ) ; while ( iter . hasNext ( ) ) { Integer cid = iter . next ( ) ; ArrayList < Integer > clist = _components . get ( cclass ) ; if ( clist == null ) { _components . put ( cclass , clist = Lists . newArrayList ( ) ) ; } clist . add ( cid ) ; } } |
public class AdminApplication { /** * This implementation uses hard coded link information , but other
* applications can dynamically determine their admin links . */
public AppAdminLinks getAdminLinks ( ) { } } | AppAdminLinks links = new AppAdminLinks ( mConfig . getName ( ) ) ; // links . addAdminLink ( " Instrumentation " , " / system / console ? page = instrumentation " ) ;
// links . addAdminLink ( " Dashboard " , " / system / console ? page = dashboard " ) ;
// links . addAdminLink ( " Janitor " , " / system / console ? page = janitor " ) ;
// links . addAdminLink ( " Compile " , " / system / console ? page = compile " ) ;
// links . addAdminLink ( " Templates " , " / system / console ? page = templates " ) ;
// links . addAdminLink ( " Functions " , " / system / console ? page = functions " ) ;
// links . addAdminLink ( " Applications " , " / system / console ? page = applications " ) ;
// links . addAdminLink ( " Logs " , " / system / console ? page = logs " ) ;
// links . addAdminLink ( " Servlet Engine " , " / system / console ? page = servlet _ engine " ) ;
// links . addAdminLink ( " Echo Request " , " / system / console ? page = echo _ request " ) ;
links . addAdminLink ( "Templates" , "/system/teaservlet/AdminTemplates" ) ; links . addAdminLink ( "Functions" , "/system/teaservlet/AdminFunctions" ) ; links . addAdminLink ( "Applications" , "/system/teaservlet/AdminApplications" ) ; links . addAdminLink ( "Logs" , "/system/teaservlet/LogViewer" ) ; links . addAdminLink ( "Servlet Engine" , "/system/teaservlet/AdminServletEngine" ) ; return links ; |
public class Files2 { /** * Copies a source to a destination , works recursively on directories .
* @ param source the source path
* @ param dest the destination path
* @ throws IOException if the source cannot be copied to the destination */
public static void copy ( final Path source , final Path dest ) throws IOException { } } | if ( Files . exists ( source ) ) { Files . walkFileTree ( source , new SimpleFileVisitor < Path > ( ) { @ Override public FileVisitResult visitFile ( final Path file , final BasicFileAttributes attrs ) throws IOException { Files . copy ( file , resolve ( dest , relativize ( source , file ) ) ) ; return super . visitFile ( file , attrs ) ; } @ Override public FileVisitResult preVisitDirectory ( final Path dir , final BasicFileAttributes attrs ) throws IOException { Files . createDirectories ( resolve ( dest , relativize ( source , dir ) ) ) ; return super . preVisitDirectory ( dir , attrs ) ; } } ) ; } |
public class DistributedCache { /** * and does chmod for the files */
private static Path localizeCache ( Configuration conf , URI cache , long confFileStamp , CacheStatus cacheStatus , boolean isArchive ) throws IOException { } } | FileSystem fs = getFileSystem ( cache , conf ) ; FileSystem localFs = FileSystem . getLocal ( conf ) ; Path parchive = null ; if ( isArchive ) { parchive = new Path ( cacheStatus . localizedLoadPath , new Path ( cacheStatus . localizedLoadPath . getName ( ) ) ) ; } else { parchive = cacheStatus . localizedLoadPath ; } if ( ! localFs . mkdirs ( parchive . getParent ( ) ) ) { throw new IOException ( "Mkdirs failed to create directory " + cacheStatus . localizedLoadPath . toString ( ) ) ; } String cacheId = cache . getPath ( ) ; fs . copyToLocalFile ( new Path ( cacheId ) , parchive ) ; if ( isArchive ) { String tmpArchive = parchive . toString ( ) . toLowerCase ( ) ; File srcFile = new File ( parchive . toString ( ) ) ; File destDir = new File ( parchive . getParent ( ) . toString ( ) ) ; if ( tmpArchive . endsWith ( ".jar" ) ) { RunJar . unJar ( srcFile , destDir ) ; } else if ( tmpArchive . endsWith ( ".zip" ) ) { FileUtil . unZip ( srcFile , destDir ) ; } else if ( isTarFile ( tmpArchive ) ) { FileUtil . unTar ( srcFile , destDir ) ; } // else will not do anyhting
// and copy the file into the dir as it is
} long cacheSize = FileUtil . getDU ( new File ( parchive . getParent ( ) . toString ( ) ) ) ; cacheStatus . size = cacheSize ; addCacheInfoUpdate ( cacheStatus ) ; // do chmod here
try { // Setting recursive permission to grant everyone read and execute
Path localDir = new Path ( cacheStatus . localizedBaseDir , cacheStatus . uniqueParentDir ) ; LOG . info ( "Doing chmod on localdir :" + localDir ) ; FileUtil . chmod ( localDir . toString ( ) , "ugo+rx" , true ) ; } catch ( InterruptedException e ) { LOG . warn ( "Exception in chmod" + e . toString ( ) ) ; } // update cacheStatus to reflect the newly cached file
cacheStatus . mtime = getTimestamp ( conf , cache ) ; return cacheStatus . localizedLoadPath ; |
public class CmsDriverManager { /** * Updates the current users context dates with the given resource . < p >
* This checks the date information of the resource based on
* { @ link CmsResource # getDateLastModified ( ) } as well as
* { @ link CmsResource # getDateReleased ( ) } and { @ link CmsResource # getDateExpired ( ) } .
* The current users request context is updated with the the " latest " dates found . < p >
* This is required in order to ensure proper setting of < code > " last - modified " < / code > http headers
* and also for expiration of cached elements in the Flex cache .
* Consider the following use case : Page A is generated from resources x , y and z .
* If either x , y or z has an expiration / release date set , then page A must expire at a certain point
* in time . This is ensured by the context date check here . < p >
* @ param dbc the current database context
* @ param resource the resource to get the date information from */
private void updateContextDates ( CmsDbContext dbc , CmsResource resource ) { } } | CmsFlexRequestContextInfo info = dbc . getFlexRequestContextInfo ( ) ; if ( info != null ) { info . updateFromResource ( resource ) ; } |
public class WebApplicationHandlerMBean { public ObjectName [ ] getFilters ( ) { } } | List l = _webappHandler . getFilters ( ) ; return getComponentMBeans ( l . toArray ( ) , _filters ) ; |
public class LottieCompositionFactory { /** * Prefer passing in the json string directly . This method just calls ` toString ( ) ` on your JSONObject .
* If you are loading this animation from the network , just use the response body string instead of
* parsing it first for improved performance . */
@ Deprecated @ WorkerThread public static LottieResult < LottieComposition > fromJsonSync ( JSONObject json , @ Nullable String cacheKey ) { } } | return fromJsonStringSync ( json . toString ( ) , cacheKey ) ; |
public class FileSystemView { /** * Returns an iterator that provides all leaf - level directories in this view .
* @ return leaf - directory iterator */
Iterator < Path > dirIterator ( ) { } } | if ( dataset . getDescriptor ( ) . isPartitioned ( ) ) { return Iterators . transform ( partitionIterator ( ) , new Function < StorageKey , Path > ( ) { @ Override @ edu . umd . cs . findbugs . annotations . SuppressWarnings ( value = "NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE" , justification = "False positive, initialized above as non-null." ) public Path apply ( @ Nullable StorageKey key ) { return new Path ( root , key . getPath ( ) ) ; } } ) ; } else { return Iterators . singletonIterator ( root ) ; } |
public class AbstractAutomaticCache { /** * Returns for given key id the cached object from the cache4Id cache . If
* the cache is NOT initialized , the cache will be initialized .
* @ param _ uuid UUID of searched cached object
* @ return cached object */
@ Override public T get ( final UUID _uuid ) { } } | if ( ! hasEntries ( ) ) { initialize ( AbstractAutomaticCache . class ) ; } return getCache4UUID ( ) . get ( _uuid ) ; |
public class ConditionalFunctions { /** * Returned expression results in NULL if expression1 = expression2 , otherwise returns expression1.
* Returns MISSING or NULL if either input is MISSING or NULL . . */
public static Expression nullIf ( Expression expression1 , Expression expression2 ) { } } | return x ( "NULLIF(" + expression1 . toString ( ) + ", " + expression2 . toString ( ) + ")" ) ; |
public class PythonIterativeStream { /** * A thin wrapper layer over { @ link IterativeStream # closeWith ( org . apache . flink . streaming . api . datastream . DataStream ) }
* < p > Please note that this function works with { @ link PythonDataStream } and thus wherever a DataStream is mentioned in
* the above { @ link IterativeStream # closeWith ( org . apache . flink . streaming . api . datastream . DataStream ) } description ,
* the user may regard it as { @ link PythonDataStream } .
* @ param feedback _ stream { @ link PythonDataStream } that will be used as input to the iteration
* head .
* @ return The feedback stream . */
public PythonDataStream close_with ( PythonDataStream < ? extends DataStream < PyObject > > feedback_stream ) { } } | ( ( IterativeStream < PyObject > ) this . stream ) . closeWith ( feedback_stream . stream ) ; return feedback_stream ; |
public class MobileElement { /** * Method returns central coordinates of an element .
* @ return The instance of the { @ link org . openqa . selenium . Point } */
public Point getCenter ( ) { } } | Point upperLeft = this . getLocation ( ) ; Dimension dimensions = this . getSize ( ) ; return new Point ( upperLeft . getX ( ) + dimensions . getWidth ( ) / 2 , upperLeft . getY ( ) + dimensions . getHeight ( ) / 2 ) ; |
public class AssetFiltersInner { /** * Update an Asset Filter .
* Updates an existing Asset Filter associated with the specified Asset .
* @ param resourceGroupName The name of the resource group within the Azure subscription .
* @ param accountName The Media Services account name .
* @ param assetName The Asset name .
* @ param filterName The Asset Filter name
* @ param parameters The request parameters
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the AssetFilterInner object */
public Observable < AssetFilterInner > updateAsync ( String resourceGroupName , String accountName , String assetName , String filterName , AssetFilterInner parameters ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , accountName , assetName , filterName , parameters ) . map ( new Func1 < ServiceResponse < AssetFilterInner > , AssetFilterInner > ( ) { @ Override public AssetFilterInner call ( ServiceResponse < AssetFilterInner > response ) { return response . body ( ) ; } } ) ; |
public class LdapTemplate { /** * { @ inheritDoc } */
@ Override public void search ( Name base , String filter , NameClassPairCallbackHandler handler ) { } } | SearchControls controls = getDefaultSearchControls ( defaultSearchScope , DONT_RETURN_OBJ_FLAG , ALL_ATTRIBUTES ) ; if ( handler instanceof ContextMapperCallbackHandler ) { assureReturnObjFlagSet ( controls ) ; } search ( base , filter , controls , handler ) ; |
public class PRJUtil { /** * Write a prj file according the SRID code of an input table
* @ param connection database connection
* @ param location input table name
* @ param geomField geometry field name
* @ param fileName path of the prj file
* @ throws SQLException
* @ throws FileNotFoundException */
public static void writePRJ ( Connection connection , TableLocation location , String geomField , File fileName ) throws SQLException , FileNotFoundException { } } | int srid = SFSUtilities . getSRID ( connection , location , geomField ) ; writePRJ ( connection , srid , fileName ) ; |
public class GoogleMapShapeConverter { /** * Add a list of LatLngs to the map
* @ param map google map
* @ param latLngs lat lngs
* @ return multi marker */
public static MultiMarker addLatLngsToMap ( GoogleMap map , MultiLatLng latLngs ) { } } | MultiMarker multiMarker = new MultiMarker ( ) ; for ( LatLng latLng : latLngs . getLatLngs ( ) ) { MarkerOptions markerOptions = new MarkerOptions ( ) ; if ( latLngs . getMarkerOptions ( ) != null ) { markerOptions . icon ( latLngs . getMarkerOptions ( ) . getIcon ( ) ) ; markerOptions . anchor ( latLngs . getMarkerOptions ( ) . getAnchorU ( ) , markerOptions . getAnchorV ( ) ) ; markerOptions . draggable ( latLngs . getMarkerOptions ( ) . isDraggable ( ) ) ; markerOptions . visible ( latLngs . getMarkerOptions ( ) . isVisible ( ) ) ; markerOptions . zIndex ( latLngs . getMarkerOptions ( ) . getZIndex ( ) ) ; } Marker marker = addLatLngToMap ( map , latLng , markerOptions ) ; multiMarker . add ( marker ) ; } return multiMarker ; |
public class Cached { /** * Taken from String Hash , but coded , to ensure consistent across Java versions . Also covers negative case ; */
public int cacheIdx ( String key ) { } } | int h = 0 ; for ( int i = 0 ; i < key . length ( ) ; i ++ ) { h = 31 * h + key . charAt ( i ) ; } if ( h < 0 ) h *= - 1 ; return h % segSize ; |
public class TypeQualifierApplications { /** * Populate a Set of TypeQualifierAnnotations representing directly - applied
* type qualifier annotations on given AnnotatedObject .
* @ param result
* Set of TypeQualifierAnnotations
* @ param o
* an AnnotatedObject
* @ param e
* ElementType representing kind of annotated object */
public static void getDirectApplications ( Set < TypeQualifierAnnotation > result , AnnotatedObject o , ElementType e ) { } } | if ( ! o . getElementType ( ) . equals ( e ) ) { return ; } Collection < AnnotationValue > values = getDirectAnnotation ( o ) ; for ( AnnotationValue v : values ) { constructTypeQualifierAnnotation ( result , v ) ; } |
public class UpdateVersionRequest { /** * < pre >
* A Version containing the updated resource . Only fields set in the field
* mask will be updated .
* < / pre >
* < code > . google . appengine . v1 . Version version = 2 ; < / code > */
public com . google . appengine . v1 . Version getVersion ( ) { } } | return version_ == null ? com . google . appengine . v1 . Version . getDefaultInstance ( ) : version_ ; |
public class PlotTab { /** * This method is called from within the constructor to initialize the form .
* WARNING : Do NOT modify this code . The content of this method is always
* regenerated by the Form Editor . */
@ SuppressWarnings ( "unchecked" ) // < editor - fold defaultstate = " collapsed " desc = " Generated Code " > / / GEN - BEGIN : initComponents
private void initComponents ( ) { } } | jPanel1 = new javax . swing . JPanel ( ) ; jScrollPaneAlgorithms = new javax . swing . JScrollPane ( ) ; jTableAlgoritms = new javax . swing . JTable ( ) ; jScrollPane3 = new javax . swing . JScrollPane ( ) ; jTableStreams = new javax . swing . JTable ( ) ; jTextFieldResultPath = new javax . swing . JTextField ( ) ; jButtonInPath = new javax . swing . JButton ( ) ; jLabel3 = new javax . swing . JLabel ( ) ; jButtonDeletAlgorithm = new javax . swing . JButton ( ) ; jButtonDeleteStream = new javax . swing . JButton ( ) ; jTabbedPane1 = new javax . swing . JTabbedPane ( ) ; jPanel2 = new javax . swing . JPanel ( ) ; jButtonAcept = new javax . swing . JButton ( ) ; jButtonReset = new javax . swing . JButton ( ) ; jScrollPane1 = new javax . swing . JScrollPane ( ) ; jPanel4 = new javax . swing . JPanel ( ) ; jLabel17 = new javax . swing . JLabel ( ) ; jTextFieldxTitle = new javax . swing . JTextField ( ) ; jLabel18 = new javax . swing . JLabel ( ) ; jLabel19 = new javax . swing . JLabel ( ) ; jTextFieldyTitle = new javax . swing . JTextField ( ) ; jLabel20 = new javax . swing . JLabel ( ) ; jComboBoxXColumn = new javax . swing . JComboBox ( ) ; jComboBoxYColumn = new javax . swing . JComboBox ( ) ; jTextFieldTitle = new javax . swing . JTextField ( ) ; jLabel21 = new javax . swing . JLabel ( ) ; jSpinnerWidth = new javax . swing . JSpinner ( ) ; jSpinnerHeight = new javax . swing . JSpinner ( ) ; jLabel22 = new javax . swing . JLabel ( ) ; jLabel23 = new javax . swing . JLabel ( ) ; jComboBoxGrid = new javax . swing . JComboBox ( ) ; jCheckBoxShape = new javax . swing . JCheckBox ( ) ; jLabel2 = new javax . swing . JLabel ( ) ; jPanel3 = new javax . swing . JPanel ( ) ; jButtonAceptGnuP = new javax . swing . JButton ( ) ; jButtonResetGnuP = new javax . swing . JButton ( ) ; jScrollPaneGnuP = new javax . swing . JScrollPane ( ) ; jPanelGnuP = new javax . swing . JPanel ( ) ; jTextFieldGNUPath = new javax . swing . JTextField ( ) ; jLabel1 = new javax . swing . JLabel ( ) ; jButtonGnuoPath = new javax . swing . JButton ( ) ; jComboBoxOutPTypeGnuP = new javax . swing . JComboBox ( ) ; jLabel5 = new javax . swing . JLabel ( ) ; jComboBoxLineStyle = new javax . swing . JComboBox ( ) ; jLabel6 = new javax . swing . JLabel ( ) ; jLabel7 = new javax . swing . JLabel ( ) ; jTextFieldxTitleGnuP = new javax . swing . JTextField ( ) ; jLabel8 = new javax . swing . JLabel ( ) ; jLabel10 = new javax . swing . JLabel ( ) ; jTextFieldyTitleGnuP = new javax . swing . JTextField ( ) ; jLabel11 = new javax . swing . JLabel ( ) ; jSpinnerLineWidth = new javax . swing . JSpinner ( ) ; jSpinnerPlotInterval = new javax . swing . JSpinner ( ) ; jLabel13 = new javax . swing . JLabel ( ) ; jLabel14 = new javax . swing . JLabel ( ) ; jCheckBoxSmooth = new javax . swing . JCheckBox ( ) ; jLabel15 = new javax . swing . JLabel ( ) ; jCheckBoxDeleteScript = new javax . swing . JCheckBox ( ) ; jLabel16 = new javax . swing . JLabel ( ) ; jComboBoxLegendLocation = new javax . swing . JComboBox ( ) ; jLabel24 = new javax . swing . JLabel ( ) ; jComboBoxLegendType = new javax . swing . JComboBox ( ) ; jLabel25 = new javax . swing . JLabel ( ) ; jTextFieldAdcComand = new javax . swing . JTextField ( ) ; jLabel26 = new javax . swing . JLabel ( ) ; jTextFieldAPOptions = new javax . swing . JTextField ( ) ; jLabel27 = new javax . swing . JLabel ( ) ; jComboBoxXColumnGnuP = new javax . swing . JComboBox ( ) ; jComboBoxYColumnGnuP = new javax . swing . JComboBox ( ) ; jPanel1 . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "Configuration" ) ) ; jScrollPaneAlgorithms . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "Algorithm" ) ) ; jTableAlgoritms . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "" ) ) ; jTableAlgoritms . setModel ( new javax . swing . table . DefaultTableModel ( new Object [ ] [ ] { } , new String [ ] { "Algorithm" , "Algorithm ID" } ) ) ; jScrollPaneAlgorithms . setViewportView ( jTableAlgoritms ) ; jScrollPane3 . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "Stream" ) ) ; jTableStreams . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "" ) ) ; jTableStreams . setModel ( new javax . swing . table . DefaultTableModel ( new Object [ ] [ ] { } , new String [ ] { "Stream" , "Stream ID" } ) ) ; jScrollPane3 . setViewportView ( jTableStreams ) ; jButtonInPath . setText ( "Browse" ) ; jButtonInPath . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonInPathActionPerformed ( evt ) ; } } ) ; jLabel3 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel3 . setText ( "Result folder" ) ; jButtonDeletAlgorithm . setText ( "Delete Algorithm" ) ; jButtonDeletAlgorithm . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonDeletAlgorithmActionPerformed ( evt ) ; } } ) ; jButtonDeleteStream . setText ( "Delete Stream" ) ; jButtonDeleteStream . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonDeleteStreamActionPerformed ( evt ) ; } } ) ; javax . swing . GroupLayout jPanel1Layout = new javax . swing . GroupLayout ( jPanel1 ) ; jPanel1 . setLayout ( jPanel1Layout ) ; jPanel1Layout . setHorizontalGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel1Layout . createSequentialGroup ( ) . addGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , jPanel1Layout . createSequentialGroup ( ) . addGap ( 14 , 14 , 14 ) . addComponent ( jLabel3 ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( jTextFieldResultPath ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED ) . addComponent ( jButtonInPath ) ) . addGroup ( jPanel1Layout . createSequentialGroup ( ) . addContainerGap ( ) . addGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jButtonDeletAlgorithm ) . addComponent ( jScrollPaneAlgorithms , javax . swing . GroupLayout . PREFERRED_SIZE , 0 , Short . MAX_VALUE ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED ) . addGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jScrollPane3 , javax . swing . GroupLayout . PREFERRED_SIZE , 0 , Short . MAX_VALUE ) . addGroup ( jPanel1Layout . createSequentialGroup ( ) . addComponent ( jButtonDeleteStream ) . addGap ( 0 , 0 , Short . MAX_VALUE ) ) ) ) ) . addGap ( 16 , 16 , 16 ) ) ) ; jPanel1Layout . setVerticalGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , jPanel1Layout . createSequentialGroup ( ) . addGap ( 23 , 23 , 23 ) . addGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldResultPath , javax . swing . GroupLayout . PREFERRED_SIZE , 23 , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jButtonInPath ) . addComponent ( jLabel3 ) ) . addGap ( 18 , 18 , 18 ) . addGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jScrollPaneAlgorithms , javax . swing . GroupLayout . DEFAULT_SIZE , 89 , Short . MAX_VALUE ) . addComponent ( jScrollPane3 , javax . swing . GroupLayout . PREFERRED_SIZE , 0 , Short . MAX_VALUE ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel1Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jButtonDeleteStream ) . addComponent ( jButtonDeletAlgorithm ) ) ) ) ; jButtonAcept . setText ( "Generate Images" ) ; jButtonAcept . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonAceptActionPerformed ( evt ) ; } } ) ; jButtonReset . setText ( " Reset to Default" ) ; jButtonReset . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonResetActionPerformed ( evt ) ; } } ) ; jScrollPane1 . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "" ) ) ; jScrollPane1 . setHorizontalScrollBarPolicy ( javax . swing . ScrollPaneConstants . HORIZONTAL_SCROLLBAR_NEVER ) ; jPanel4 . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "" ) ) ; jLabel17 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel17 . setText ( "xColumn" ) ; jTextFieldxTitle . setText ( "Instances processed" ) ; jLabel18 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel18 . setText ( "xTitle" ) ; jLabel19 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel19 . setText ( "yColumn" ) ; jTextFieldyTitle . setText ( "% of correctly classified" ) ; jLabel20 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel20 . setText ( "yTitle" ) ; jLabel21 . setText ( "title" ) ; jSpinnerWidth . setValue ( 500 ) ; jSpinnerHeight . setValue ( 300 ) ; jLabel22 . setText ( "width" ) ; jLabel23 . setText ( "height" ) ; jComboBoxGrid . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "White" , "Default" } ) ) ; jCheckBoxShape . setText ( "shapes" ) ; jLabel2 . setText ( "gridColor" ) ; javax . swing . GroupLayout jPanel4Layout = new javax . swing . GroupLayout ( jPanel4 ) ; jPanel4 . setLayout ( jPanel4Layout ) ; jPanel4Layout . setHorizontalGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel4Layout . createSequentialGroup ( ) . addGap ( 67 , 67 , 67 ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING ) . addGroup ( jPanel4Layout . createSequentialGroup ( ) . addGap ( 3 , 3 , 3 ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel17 ) . addComponent ( jLabel21 ) . addComponent ( jLabel18 ) ) . addComponent ( jLabel19 ) . addComponent ( jLabel20 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel22 , javax . swing . GroupLayout . Alignment . TRAILING ) ) . addGap ( 18 , 18 , 18 ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jTextFieldxTitle ) . addComponent ( jComboBoxXColumn , javax . swing . GroupLayout . Alignment . TRAILING , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jTextFieldTitle , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jComboBoxYColumn , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jTextFieldyTitle , javax . swing . GroupLayout . DEFAULT_SIZE , 542 , Short . MAX_VALUE ) . addComponent ( jSpinnerWidth ) ) ) . addGroup ( javax . swing . GroupLayout . Alignment . LEADING , jPanel4Layout . createSequentialGroup ( ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel23 ) . addComponent ( jLabel2 ) ) . addGap ( 18 , 18 , 18 ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel4Layout . createSequentialGroup ( ) . addComponent ( jCheckBoxShape , javax . swing . GroupLayout . PREFERRED_SIZE , 91 , javax . swing . GroupLayout . PREFERRED_SIZE ) . addGap ( 0 , 0 , Short . MAX_VALUE ) ) . addComponent ( jComboBoxGrid , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jSpinnerHeight ) ) ) ) . addGap ( 30 , 30 , 30 ) ) ) ; jPanel4Layout . setVerticalGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel4Layout . createSequentialGroup ( ) . addContainerGap ( ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldTitle , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel21 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxXColumn , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel17 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldxTitle , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel18 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxYColumn , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel19 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldyTitle , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel20 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jSpinnerWidth , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel22 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jLabel23 ) . addComponent ( jSpinnerHeight , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel4Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxGrid , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel2 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( jCheckBoxShape ) . addContainerGap ( 11 , Short . MAX_VALUE ) ) ) ; jScrollPane1 . setViewportView ( jPanel4 ) ; javax . swing . GroupLayout jPanel2Layout = new javax . swing . GroupLayout ( jPanel2 ) ; jPanel2 . setLayout ( jPanel2Layout ) ; jPanel2Layout . setHorizontalGroup ( jPanel2Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel2Layout . createSequentialGroup ( ) . addGap ( 135 , 135 , 135 ) . addComponent ( jButtonAcept ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( jButtonReset ) . addContainerGap ( javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) ) . addComponent ( jScrollPane1 , javax . swing . GroupLayout . Alignment . TRAILING , javax . swing . GroupLayout . DEFAULT_SIZE , 700 , Short . MAX_VALUE ) ) ; jPanel2Layout . setVerticalGroup ( jPanel2Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , jPanel2Layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( jScrollPane1 , javax . swing . GroupLayout . PREFERRED_SIZE , 247 , javax . swing . GroupLayout . PREFERRED_SIZE ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel2Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jButtonAcept ) . addComponent ( jButtonReset ) ) ) ) ; jTabbedPane1 . addTab ( "Charts" , jPanel2 ) ; jButtonAceptGnuP . setText ( "Generate GnuPlot Commands" ) ; jButtonAceptGnuP . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonAceptGnuPActionPerformed ( evt ) ; } } ) ; jButtonResetGnuP . setText ( " Reset to Default" ) ; jButtonResetGnuP . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonResetGnuPActionPerformed ( evt ) ; } } ) ; jScrollPaneGnuP . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "" ) ) ; jScrollPaneGnuP . setHorizontalScrollBarPolicy ( javax . swing . ScrollPaneConstants . HORIZONTAL_SCROLLBAR_NEVER ) ; jPanelGnuP . setBorder ( javax . swing . BorderFactory . createTitledBorder ( "" ) ) ; jPanelGnuP . setPreferredSize ( new java . awt . Dimension ( 400 , 449 ) ) ; jTextFieldGNUPath . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jTextFieldGNUPathActionPerformed ( evt ) ; } } ) ; jLabel1 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel1 . setText ( "gnuplotBinaryPath " ) ; jButtonGnuoPath . setText ( "Browse" ) ; jButtonGnuoPath . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButtonGnuoPathActionPerformed ( evt ) ; } } ) ; jComboBoxOutPTypeGnuP . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "POSTSCRIPT_COLOR" , "EPSLATEX" , "GIF" , "JPEG" , "LATEX" , "PDFCAIRO" , "PNG" , "POSTSCRIPT" , "CANVAS" , "PSLATEX" , "PSTEX" , "PSTRICKS" , "SVG" } ) ) ; jLabel5 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel5 . setText ( "outputType" ) ; jComboBoxLineStyle . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "LINES" , "POINTS" , "LINESPOINTS" , "IMPULSES" , "STEPS" , "FSTEPS" , "HISTEPS" , "DOTS;" } ) ) ; jLabel6 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel6 . setText ( "plotStyle" ) ; jLabel7 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel7 . setText ( "xColumn" ) ; jTextFieldxTitleGnuP . setText ( "Processed instances" ) ; jLabel8 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel8 . setText ( "xTitle" ) ; jLabel10 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel10 . setText ( "yColumn" ) ; jTextFieldyTitleGnuP . setText ( "Accuracy" ) ; jLabel11 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel11 . setText ( "yTitle" ) ; jSpinnerLineWidth . setValue ( 2 ) ; jLabel13 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel13 . setText ( "lineWidth" ) ; jLabel14 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel14 . setText ( "plotInterval" ) ; jLabel15 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel15 . setText ( "smooth" ) ; jLabel16 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel16 . setText ( "deleteScripts" ) ; jComboBoxLegendLocation . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "BOTTOM_CENTER_OUTSIDE" , "TOP_LEFT_INSIDE" , "TOP_CENTER_INSIDE" , "TOP_RIGHT_INSIDE" , "LEFT_INSIDE" , "CENTER_INSIDE" , "RIGHT_INSIDE" , "BOTTOM_LEFT_INSIDE" , "BOTTOM_CENTER_INSIDE" , "BOTTOM_RIGHT_INSIDE" , "TOP_LEFT_OUTSIDE" , "TOP_CENTER_OUTSIDE" , "TOP_RIGHT_OUTSIDE" , "LEFT_OUTSIDE" , "CENTER_OUTSIDE" , "RIGHT_OUTSIDE" , "BOTTOM_LEFT_OUTSIDE" , "BOTTOM_RIGHT_OUTSIDE" } ) ) ; jComboBoxLegendLocation . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jComboBoxLegendLocationActionPerformed ( evt ) ; } } ) ; jLabel24 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel24 . setText ( "legendLocation" ) ; jComboBoxLegendType . setModel ( new javax . swing . DefaultComboBoxModel ( new String [ ] { "NOBOX_HORIZONTAL" , "BOX_VERTICAL" , "BOX_HORIZONTAL" , "NOBOX_VERTICAL" , " " } ) ) ; jLabel25 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel25 . setText ( "legendType" ) ; jLabel26 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel26 . setText ( "additionalCommands" ) ; jLabel27 . setHorizontalAlignment ( javax . swing . SwingConstants . RIGHT ) ; jLabel27 . setText ( "additionalPlotOptions" ) ; javax . swing . GroupLayout jPanelGnuPLayout = new javax . swing . GroupLayout ( jPanelGnuP ) ; jPanelGnuP . setLayout ( jPanelGnuPLayout ) ; jPanelGnuPLayout . setHorizontalGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanelGnuPLayout . createSequentialGroup ( ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanelGnuPLayout . createSequentialGroup ( ) . addGap ( 22 , 22 , 22 ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jLabel5 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel6 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel7 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel8 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel10 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel11 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel1 , javax . swing . GroupLayout . Alignment . TRAILING ) ) ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , jPanelGnuPLayout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( jLabel27 ) ) ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , jPanelGnuPLayout . createSequentialGroup ( ) . addContainerGap ( ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jLabel15 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel13 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel14 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel16 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel24 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel25 , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jLabel26 , javax . swing . GroupLayout . Alignment . TRAILING ) ) ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jTextFieldAPOptions , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jTextFieldAdcComand , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jComboBoxLegendType , javax . swing . GroupLayout . Alignment . TRAILING , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jSpinnerPlotInterval , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jSpinnerLineWidth , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jTextFieldyTitleGnuP , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jTextFieldxTitleGnuP , javax . swing . GroupLayout . Alignment . TRAILING ) . addComponent ( jComboBoxLineStyle , javax . swing . GroupLayout . Alignment . TRAILING , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jComboBoxXColumnGnuP , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jComboBoxYColumnGnuP , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jComboBoxLegendLocation , 0 , 542 , Short . MAX_VALUE ) . addGroup ( jPanelGnuPLayout . createSequentialGroup ( ) . addComponent ( jTextFieldGNUPath ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( jButtonGnuoPath ) ) . addGroup ( jPanelGnuPLayout . createSequentialGroup ( ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jCheckBoxDeleteScript ) . addComponent ( jCheckBoxSmooth ) ) . addGap ( 0 , 0 , Short . MAX_VALUE ) ) . addComponent ( jComboBoxOutPTypeGnuP , javax . swing . GroupLayout . Alignment . TRAILING , 0 , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) ) . addContainerGap ( ) ) ) ; jPanelGnuPLayout . setVerticalGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanelGnuPLayout . createSequentialGroup ( ) . addContainerGap ( ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldGNUPath , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jButtonGnuoPath ) . addComponent ( jLabel1 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxOutPTypeGnuP , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel5 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jComboBoxLineStyle , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel6 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxXColumnGnuP , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel7 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldxTitleGnuP , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel8 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxYColumnGnuP , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel10 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldyTitleGnuP , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel11 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jSpinnerLineWidth , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel13 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jSpinnerPlotInterval , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel14 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jCheckBoxSmooth ) . addComponent ( jLabel15 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jCheckBoxDeleteScript ) . addComponent ( jLabel16 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxLegendLocation , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel24 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jComboBoxLegendType , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel25 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldAdcComand , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel26 ) ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanelGnuPLayout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jTextFieldAPOptions , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addComponent ( jLabel27 ) ) . addGap ( 186 , 186 , 186 ) ) ) ; jScrollPaneGnuP . setViewportView ( jPanelGnuP ) ; javax . swing . GroupLayout jPanel3Layout = new javax . swing . GroupLayout ( jPanel3 ) ; jPanel3 . setLayout ( jPanel3Layout ) ; jPanel3Layout . setHorizontalGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( jPanel3Layout . createSequentialGroup ( ) . addGap ( 128 , 128 , 128 ) . addComponent ( jButtonAceptGnuP ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addComponent ( jButtonResetGnuP ) . addContainerGap ( javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) ) . addComponent ( jScrollPaneGnuP , javax . swing . GroupLayout . DEFAULT_SIZE , 700 , Short . MAX_VALUE ) ) ; jPanel3Layout . setVerticalGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , jPanel3Layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( jScrollPaneGnuP , javax . swing . GroupLayout . PREFERRED_SIZE , 247 , javax . swing . GroupLayout . PREFERRED_SIZE ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . RELATED ) . addGroup ( jPanel3Layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . BASELINE ) . addComponent ( jButtonAceptGnuP ) . addComponent ( jButtonResetGnuP ) ) ) ) ; jTabbedPane1 . addTab ( "GnuPlot" , jPanel3 ) ; javax . swing . GroupLayout layout = new javax . swing . GroupLayout ( this ) ; this . setLayout ( layout ) ; layout . setHorizontalGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( layout . createSequentialGroup ( ) . addContainerGap ( ) . addGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addComponent ( jPanel1 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addComponent ( jTabbedPane1 , javax . swing . GroupLayout . Alignment . TRAILING ) ) . addContainerGap ( ) ) ) ; layout . setVerticalGroup ( layout . createParallelGroup ( javax . swing . GroupLayout . Alignment . LEADING ) . addGroup ( javax . swing . GroupLayout . Alignment . TRAILING , layout . createSequentialGroup ( ) . addContainerGap ( ) . addComponent ( jPanel1 , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , Short . MAX_VALUE ) . addPreferredGap ( javax . swing . LayoutStyle . ComponentPlacement . UNRELATED ) . addComponent ( jTabbedPane1 , javax . swing . GroupLayout . PREFERRED_SIZE , javax . swing . GroupLayout . DEFAULT_SIZE , javax . swing . GroupLayout . PREFERRED_SIZE ) . addGap ( 7 , 7 , 7 ) ) ) ; |
public class TrajectorySplineFitLegacy { /** * Calculates a spline to a trajectory . Attention : The spline is fitted through a rotated version of the trajectory .
* To fit the spline the trajectory is rotated into its main direction . You can access this rotated trajectory by
* { @ link # getRotatedTrajectory ( ) getRotatedTrajectory } .
* @ return The fitted spline */
public PolynomialSplineFunction calculateSpline ( ) { } } | /* * 1 . Calculate the minimum bounding rectangle */
ArrayList < Point2D . Double > points = new ArrayList < Point2D . Double > ( ) ; for ( int i = 0 ; i < t . size ( ) ; i ++ ) { Point2D . Double p = new Point2D . Double ( ) ; p . setLocation ( t . get ( i ) . x , t . get ( i ) . y ) ; points . add ( p ) ; } Point2D . Double [ ] rect = null ; try { rect = RotatingCalipers . getMinimumBoundingRectangle ( points ) ; } catch ( IllegalArgumentException e ) { } catch ( EmptyStackException e ) { } /* * 1.1 Rotate that the major axis is parallel with the xaxis */
Point2D . Double majorDirection = null ; Point2D . Double p1 = rect [ 2 ] ; // top left
Point2D . Double p2 = p1 . distance ( rect [ 1 ] ) > p1 . distance ( rect [ 3 ] ) ? rect [ 1 ] : rect [ 3 ] ; // Point to long side
Point2D . Double p3 = p1 . distance ( rect [ 1 ] ) > p1 . distance ( rect [ 3 ] ) ? rect [ 3 ] : rect [ 1 ] ; // Point to short side
majorDirection = new Point2D . Double ( p2 . x - p1 . x , p2 . y - p1 . y ) ; double width = p1 . distance ( p2 ) ; double inRad = - 1 * Math . atan2 ( majorDirection . y , majorDirection . x ) ; boolean doTransform = ( Math . abs ( Math . abs ( inRad ) - Math . PI ) > 0.001 ) ; if ( doTransform ) { angleRotated = inRad ; for ( int i = 0 ; i < t . size ( ) ; i ++ ) { double x = t . get ( i ) . x ; double y = t . get ( i ) . y ; double newX = x * Math . cos ( inRad ) - y * Math . sin ( inRad ) ; double newY = x * Math . sin ( inRad ) + y * Math . cos ( inRad ) ; rotatedTrajectory . add ( newX , newY , 0 ) ; points . get ( i ) . setLocation ( newX , newY ) ; } for ( int i = 0 ; i < rect . length ; i ++ ) { rect [ i ] . setLocation ( rect [ i ] . x * Math . cos ( inRad ) - rect [ i ] . y * Math . sin ( inRad ) , rect [ i ] . x * Math . sin ( inRad ) + rect [ i ] . y * Math . cos ( inRad ) ) ; } p1 = rect [ 2 ] ; // top left
p2 = p1 . distance ( rect [ 1 ] ) > p1 . distance ( rect [ 3 ] ) ? rect [ 1 ] : rect [ 3 ] ; // Point to long side
p3 = p1 . distance ( rect [ 1 ] ) > p1 . distance ( rect [ 3 ] ) ? rect [ 3 ] : rect [ 1 ] ; // Point to short side
} else { angleRotated = 0 ; rotatedTrajectory = t ; } /* * 2 . Divide the rectangle in n equal segments
* 2.1 Calculate line in main direction
* 2.2 Project the points in onto this line
* 2.3 Calculate the distance between the start of the line and the projected point
* 2.4 Assign point to segment according to distance of ( 2.3) */
List < List < Point2D . Double > > pointsInSegments = null ; boolean allSegmentsContainingAtLeastTwoPoints = true ; do { allSegmentsContainingAtLeastTwoPoints = true ; double segmentWidth = p1 . distance ( p2 ) / nSegments ; pointsInSegments = new ArrayList < List < Point2D . Double > > ( nSegments ) ; for ( int i = 0 ; i < nSegments ; i ++ ) { pointsInSegments . add ( new ArrayList < Point2D . Double > ( ) ) ; } for ( int i = 0 ; i < points . size ( ) ; i ++ ) { Point2D . Double projPoint = projectPointToLine ( p1 , p2 , points . get ( i ) ) ; int index = ( int ) ( p1 . distance ( projPoint ) / segmentWidth ) ; if ( index > ( nSegments - 1 ) ) { index = ( nSegments - 1 ) ; } pointsInSegments . get ( index ) . add ( points . get ( i ) ) ; } for ( int i = 0 ; i < pointsInSegments . size ( ) ; i ++ ) { if ( pointsInSegments . get ( i ) . size ( ) < 2 ) { if ( nSegments > 2 ) { nSegments -- ; i = pointsInSegments . size ( ) ; allSegmentsContainingAtLeastTwoPoints = false ; } } } } while ( allSegmentsContainingAtLeastTwoPoints == false ) ; /* * 3 . Calculate the mean standard deviation over each segment : < s > */
Point2D . Double eMajorP1 = new Point2D . Double ( p1 . x - ( p3 . x - p1 . x ) / 2.0 , p1 . y - ( p3 . y - p1 . y ) / 2.0 ) ; Point2D . Double eMajorP2 = new Point2D . Double ( p2 . x - ( p3 . x - p1 . x ) / 2.0 , p2 . y - ( p3 . y - p1 . y ) / 2.0 ) ; double sumMean = 0 ; int Nsum = 0 ; for ( int i = 0 ; i < nSegments ; i ++ ) { StandardDeviation sd = new StandardDeviation ( ) ; double [ ] distances = new double [ pointsInSegments . get ( i ) . size ( ) ] ; for ( int j = 0 ; j < pointsInSegments . get ( i ) . size ( ) ; j ++ ) { int factor = 1 ; if ( isLeft ( eMajorP1 , eMajorP2 , pointsInSegments . get ( i ) . get ( j ) ) ) { factor = - 1 ; } distances [ j ] = factor * distancePointLine ( eMajorP1 , eMajorP2 , pointsInSegments . get ( i ) . get ( j ) ) ; } if ( distances . length > 0 ) { sd . setData ( distances ) ; sumMean += sd . evaluate ( ) ; Nsum ++ ; } } double s = sumMean / Nsum ; if ( s < 0.000000000001 ) { s = width / nSegments ; } /* * 4 . Build a kd - tree */
KDTree < Point2D . Double > kdtree = new KDTree < Point2D . Double > ( 2 ) ; for ( int i = 0 ; i < points . size ( ) ; i ++ ) { try { // To ensure that all points have a different key , add small random number
kdtree . insert ( new double [ ] { points . get ( i ) . x , points . get ( i ) . y } , points . get ( i ) ) ; } catch ( KeySizeException e ) { e . printStackTrace ( ) ; } catch ( KeyDuplicateException e ) { // Do nothing ! It is not important
} } /* * 5 . Using the first point f in trajectory and calculate the center of mass
* of all points around f ( radius : 3 * < s > ) ) */
List < Point2D . Double > near = null ; Point2D . Double first = minDistancePointToLine ( p1 , p3 , points ) ; double r1 = 3 * s ; try { near = kdtree . nearestEuclidean ( new double [ ] { first . x , first . y } , r1 ) ; } catch ( KeySizeException e ) { e . printStackTrace ( ) ; } double cx = 0 ; double cy = 0 ; for ( int i = 0 ; i < near . size ( ) ; i ++ ) { cx += near . get ( i ) . x ; cy += near . get ( i ) . y ; } cx /= near . size ( ) ; cy /= near . size ( ) ; splineSupportPoints = new ArrayList < Point2D . Double > ( ) ; splineSupportPoints . add ( new Point2D . Double ( cx , cy ) ) ; /* * 6 . The second point is determined by finding the center - of - mass of particles in the p / 2 radian
* section of an annulus , r1 < r < 2r1 , that is directed toward the angle with the highest number
* of particles within p / 2 radians .
* 7 . This second point is then used as the center of the annulus for choosing the third point , and the process is repeated ( 6 . & 7 . ) . */
/* * 6.1 Find all points in the annolous */
/* * 6.2 Write each point in a coordinate system centered at the center of the sphere , calculate direction and
* check if it in the allowed bounds */
int nCircleSegments = 100 ; double deltaRad = 2 * Math . PI / nCircleSegments ; boolean stop = false ; int minN = 7 ; double tempr1 = r1 ; double allowedDeltaDirection = 0.5 * Math . PI ; while ( stop == false ) { List < Point2D . Double > nearestr1 = null ; List < Point2D . Double > nearest2xr1 = null ; try { nearestr1 = kdtree . nearestEuclidean ( new double [ ] { splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y } , tempr1 ) ; nearest2xr1 = kdtree . nearestEuclidean ( new double [ ] { splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y } , 2 * tempr1 ) ; } catch ( KeySizeException e ) { // TODO Auto - generated catch block
e . printStackTrace ( ) ; } nearest2xr1 . removeAll ( nearestr1 ) ; double lThreshRad = 0 ; double hThreshRad = Math . PI / 2 ; double stopThresh = 2 * Math . PI ; if ( splineSupportPoints . size ( ) > 1 ) { double directionInRad = Math . atan2 ( splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y - splineSupportPoints . get ( splineSupportPoints . size ( ) - 2 ) . y , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x - splineSupportPoints . get ( splineSupportPoints . size ( ) - 2 ) . x ) + Math . PI ; lThreshRad = directionInRad - allowedDeltaDirection / 2 - Math . PI / 4 ; if ( lThreshRad < 0 ) { lThreshRad = 2 * Math . PI + lThreshRad ; } if ( lThreshRad > 2 * Math . PI ) { lThreshRad = lThreshRad - 2 * Math . PI ; } hThreshRad = directionInRad + allowedDeltaDirection / 2 + Math . PI / 4 ; if ( hThreshRad < 0 ) { hThreshRad = 2 * Math . PI + hThreshRad ; } if ( hThreshRad > 2 * Math . PI ) { hThreshRad = hThreshRad - 2 * Math . PI ; } stopThresh = directionInRad + allowedDeltaDirection / 2 - Math . PI / 4 ; if ( stopThresh > 2 * Math . PI ) { stopThresh = stopThresh - 2 * Math . PI ; } } double newCx = 0 ; double newCy = 0 ; int newCN = 0 ; int candN = 0 ; // Find center with highest density of points
double lastDist = 0 ; double newDist = 0 ; do { lastDist = Math . min ( Math . abs ( lThreshRad - stopThresh ) , 2 * Math . PI - Math . abs ( lThreshRad - stopThresh ) ) ; candN = 0 ; double candCx = 0 ; double candCy = 0 ; for ( int i = 0 ; i < nearest2xr1 . size ( ) ; i ++ ) { Point2D . Double centerOfCircle = splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) ; Vector2d relativeToCircle = new Vector2d ( nearest2xr1 . get ( i ) . x - centerOfCircle . x , nearest2xr1 . get ( i ) . y - centerOfCircle . y ) ; relativeToCircle . normalize ( ) ; double angleInRadians = Math . atan2 ( relativeToCircle . y , relativeToCircle . x ) + Math . PI ; if ( lThreshRad < hThreshRad ) { if ( angleInRadians > lThreshRad && angleInRadians < hThreshRad ) { candCx += nearest2xr1 . get ( i ) . x ; candCy += nearest2xr1 . get ( i ) . y ; candN ++ ; } } else { if ( angleInRadians > lThreshRad || angleInRadians < hThreshRad ) { candCx += nearest2xr1 . get ( i ) . x ; candCy += nearest2xr1 . get ( i ) . y ; candN ++ ; } } } if ( candN > 0 && candN > newCN ) { candCx /= candN ; candCy /= candN ; newCx = candCx ; newCy = candCy ; newCN = candN ; } lThreshRad += deltaRad ; hThreshRad += deltaRad ; if ( lThreshRad > 2 * Math . PI ) { lThreshRad = lThreshRad - 2 * Math . PI ; } if ( hThreshRad > 2 * Math . PI ) { hThreshRad = hThreshRad - 2 * Math . PI ; } newDist = Math . min ( Math . abs ( lThreshRad - stopThresh ) , 2 * Math . PI - Math . abs ( lThreshRad - stopThresh ) ) ; } while ( ( newDist - lastDist ) > 0 ) ; // Check if the new center is valid
if ( splineSupportPoints . size ( ) > 1 ) { double currentDirectionInRad = Math . atan2 ( splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y - splineSupportPoints . get ( splineSupportPoints . size ( ) - 2 ) . y , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x - splineSupportPoints . get ( splineSupportPoints . size ( ) - 2 ) . x ) + Math . PI ; double candDirectionInRad = Math . atan2 ( newCy - splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y , newCx - splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x ) + Math . PI ; double dDir = Math . max ( currentDirectionInRad , candDirectionInRad ) - Math . min ( currentDirectionInRad , candDirectionInRad ) ; if ( dDir > 2 * Math . PI ) { dDir = 2 * Math . PI - dDir ; } if ( dDir > allowedDeltaDirection ) { stop = true ; } } boolean enoughPoints = ( newCN < minN ) ; boolean isNormalRadius = Math . abs ( tempr1 - r1 ) < Math . pow ( 10 , - 18 ) ; boolean isExtendedRadius = Math . abs ( tempr1 - 3 * r1 ) < Math . pow ( 10 , - 18 ) ; if ( enoughPoints && isNormalRadius ) { // Not enough points , extend search radius
tempr1 = 3 * r1 ; } else if ( enoughPoints && isExtendedRadius ) { // Despite radius extension : Not enough points !
stop = true ; } else if ( stop == false ) { splineSupportPoints . add ( new Point2D . Double ( newCx , newCy ) ) ; tempr1 = r1 ; } } // Sort
Collections . sort ( splineSupportPoints , new Comparator < Point2D . Double > ( ) { public int compare ( Point2D . Double o1 , Point2D . Double o2 ) { if ( o1 . x < o2 . x ) { return - 1 ; } if ( o1 . x > o2 . x ) { return 1 ; } return 0 ; } } ) ; // Add endpoints
if ( splineSupportPoints . size ( ) > 1 ) { Vector2d start = new Vector2d ( splineSupportPoints . get ( 0 ) . x - splineSupportPoints . get ( 1 ) . x , splineSupportPoints . get ( 0 ) . y - splineSupportPoints . get ( 1 ) . y ) ; start . normalize ( ) ; start . scale ( r1 * 8 ) ; splineSupportPoints . add ( 0 , new Point2D . Double ( splineSupportPoints . get ( 0 ) . x + start . x , splineSupportPoints . get ( 0 ) . y + start . y ) ) ; Vector2d end = new Vector2d ( splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x - splineSupportPoints . get ( splineSupportPoints . size ( ) - 2 ) . x , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y - splineSupportPoints . get ( splineSupportPoints . size ( ) - 2 ) . y ) ; end . normalize ( ) ; end . scale ( r1 * 6 ) ; splineSupportPoints . add ( new Point2D . Double ( splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x + end . x , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y + end . y ) ) ; } else { Vector2d majordir = new Vector2d ( - 1 , 0 ) ; majordir . normalize ( ) ; majordir . scale ( r1 * 8 ) ; splineSupportPoints . add ( 0 , new Point2D . Double ( splineSupportPoints . get ( 0 ) . x + majordir . x , splineSupportPoints . get ( 0 ) . y + majordir . y ) ) ; majordir . scale ( - 1 ) ; splineSupportPoints . add ( new Point2D . Double ( splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . x + majordir . x , splineSupportPoints . get ( splineSupportPoints . size ( ) - 1 ) . y + majordir . y ) ) ; } // Interpolate spline
double [ ] supX = new double [ splineSupportPoints . size ( ) ] ; double [ ] supY = new double [ splineSupportPoints . size ( ) ] ; for ( int i = 0 ; i < splineSupportPoints . size ( ) ; i ++ ) { supX [ i ] = splineSupportPoints . get ( i ) . x ; supY [ i ] = splineSupportPoints . get ( i ) . y ; } SplineInterpolator sIinter = new SplineInterpolator ( ) ; spline = sIinter . interpolate ( supX , supY ) ; return spline ; |
public class WSX509TrustManager { /** * Increment the trailing number on the alias value until one is found that
* does not currently exist in the input store .
* @ param jKeyStore
* @ param alias
* @ return String
* @ throws KeyStoreException */
private String incrementAlias ( KeyStore jKeyStore , String alias ) throws KeyStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "incrementAlias: " + alias ) ; int num = 0 ; String base ; int index = alias . lastIndexOf ( '_' ) ; if ( - 1 == index ) { // no underscore found
base = alias + '_' ; } else if ( index == ( alias . length ( ) - 1 ) ) { // alias ends with underscore
base = alias ; } else { // alias ends with _ X where X might be a number . . .
try { ++ index ; // jump past the underscore
num = Integer . parseInt ( alias . substring ( index ) ) ; base = alias . substring ( 0 , index ) ; } catch ( NumberFormatException nfe ) { // not a number
base = alias + '_' ; } } String newAlias = base + Integer . toString ( ++ num ) ; while ( jKeyStore . containsAlias ( newAlias ) ) { newAlias = base + Integer . toString ( ++ num ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "incrementAlias: " + newAlias ) ; return newAlias ; |
public class BELUtilities { /** * Returns a hash map of type { @ code K , V } optimized to trade memory
* efficiency for CPU time .
* Use constrained hash maps when the capacity of a hash map is known to be
* greater than sixteen ( the default initial capacity ) and the addition of
* elements beyond the map ' s capacity will not occur . The hash map
* implementation will automatically adjust the size to the next nearest
* power of two .
* @ param < K > Formal type parameter key
* @ param < V > Formal type parameter value
* @ param s Initial hash map capacity
* @ return Hash map of type { @ code K , V } */
public static < K , V > HashMap < K , V > constrainedHashMap ( final int s ) { } } | return new HashMap < K , V > ( s , 1.0F ) ; |
public class TempFile { /** * Deletes the underlying temp file immediately .
* Subsequent calls will not delete the temp file , even if another file has the same path .
* If already deleted , has no effect . */
public void delete ( ) throws IOException { } } | File f = tempFile ; if ( f != null ) { FileUtils . delete ( f ) ; tempFile = null ; } |
public class JCDiagnostic { /** * where */
@ Deprecated public static DiagnosticFormatter < JCDiagnostic > getFragmentFormatter ( ) { } } | if ( fragmentFormatter == null ) { fragmentFormatter = new BasicDiagnosticFormatter ( JavacMessages . getDefaultMessages ( ) ) ; } return fragmentFormatter ; |
public class Document { /** * Loads the contents from an XML text
* A sanity check is performed , which is not too strict :
* A valid document must contain one node exactly
* and may furthermore contain instruction - and comment - tags .
* @ param xmlInput
* @ throws ParseException if the XML document can not be parsed */
public void parse ( String xmlInput , boolean strict ) throws ParseException { } } | if ( xmlInput == null ) { throw new IllegalArgumentException ( "input can not be null" ) ; } ArrayList splitContents = split ( xmlInput , interpreteAsXHTML , true ) ; build ( splitContents , interpreteAsXHTML ) ; int nodeCount = 0 ; ArrayList contentsToRemove = new ArrayList ( ) ; Iterator i = contents . iterator ( ) ; while ( i . hasNext ( ) ) { Object element = i . next ( ) ; if ( element instanceof Node ) { nodeCount ++ ; } else if ( element instanceof Tag ) { Tag tag = ( Tag ) element ; if ( ! ( tag . getType ( ) == Tag . INSTRUCTION_TAG || tag . getType ( ) == Tag . COMMENT_TAG ) ) { throw new ParseException ( "document contains invalid element: " + StringSupport . condenseWhitespace ( StringSupport . trim ( element . toString ( ) , 20 , "..." ) ) ) ; } } else { if ( element . toString ( ) . trim ( ) . length ( ) > 0 ) { // TODO if strict throw new ParseException ( " document contains invalid element : " + StringSupport . condenseWhitespace ( StringSupport . trim ( element . toString ( ) , 20 , " . . . " ) ) ) ;
contentsToRemove . add ( element ) ; } } if ( nodeCount > 1 ) { throw new ParseException ( "document contains more than 1 node: " + StringSupport . condenseWhitespace ( StringSupport . trim ( element . toString ( ) , 20 , "..." ) ) ) ; } } i = contentsToRemove . iterator ( ) ; while ( i . hasNext ( ) ) { contents . remove ( i . next ( ) ) ; } |
public class RestletUtilSesameRealm { /** * Finds the roles mapped to a given user .
* @ param user
* The user .
* @ return The roles found . */
public Set < Role > findRoles ( final User user ) { } } | final Set < Role > result = new HashSet < Role > ( ) ; for ( final RoleMapping mapping : this . getRoleMappings ( ) ) { final Object source = mapping . getSource ( ) ; if ( ( user != null ) && user . equals ( source ) ) { // TODO : Fix this hardcoding when Restlet implements equals for Role objects again
RestletUtilRole standardRole = this . getRoleByName ( mapping . getTarget ( ) . getName ( ) ) ; if ( standardRole != null ) { result . add ( standardRole . getRole ( ) ) ; } else { result . add ( mapping . getTarget ( ) ) ; } } } return result ; |
public class IDLProxyObject { /** * Put .
* @ param fullField the full field
* @ param field the field
* @ param value the value
* @ param object the object
* @ return the IDL proxy object */
private IDLProxyObject put ( String fullField , String field , Object value , Object object ) { } } | return doSetFieldValue ( fullField , field , value , object , this . cached , this . cachedFields ) ; |
public class Log { /** * Foward pass : y _ i = log ( x _ i ) */
@ Override public Tensor forward ( ) { } } | Tensor x = modInX . getOutput ( ) ; y = new Tensor ( x ) ; // copy
y . log ( ) ; return y ; |
public class ProjectiveStructureFromHomographies { /** * < p > Solves for camera matrices and scene structure . < / p >
* Homographies from view i to 0 : < br >
* x [ 0 ] = H * x [ i ]
* @ param homographies _ view0 _ to _ viewI ( Input ) Homographies matching pixels from view i to view 0.
* @ param observations ( Input ) Observed features in each view , except view 0 . Indexes of points must be from 0 to totalFeatures - 1
* @ param totalFeatures ( Input ) total number of features being solved for . Uses to sanity check input
* @ return true if successful or false if it failed */
public boolean proccess ( List < DMatrixRMaj > homographies_view0_to_viewI , List < List < PointIndex2D_F64 > > observations , int totalFeatures ) { } } | if ( homographies_view0_to_viewI . size ( ) != observations . size ( ) ) { throw new IllegalArgumentException ( "Number of homographies and observations do not match" ) ; } LowLevelMultiViewOps . computeNormalizationLL ( ( List ) observations , N ) ; // Apply normalization to homographies
this . homographies = homographies_view0_to_viewI ; filterPointsOnPlaneAtInfinity ( homographies , observations , totalFeatures ) ; // compute some internal working variables and determine if there are enough observations to compute a
// solution
computeConstants ( homographies_view0_to_viewI , filtered , totalFeatures ) ; // Solve the problem
constructLinearSystem ( homographies , filtered ) ; if ( ! svd . decompose ( A ) ) return false ; // get null vector . camera matrices and scene structure are extracted from B as requested
SingularOps_DDRM . nullVector ( svd , true , B ) ; return true ; |
public class DataWriterBuilder { /** * Tell the writer the destination to write to .
* @ param destination destination to write to
* @ return this { @ link DataWriterBuilder } instance */
public DataWriterBuilder < S , D > writeTo ( Destination destination ) { } } | this . destination = destination ; log . debug ( "For destination: {}" , destination ) ; return this ; |
public class WsocHttpSessionListener { /** * ( non - Javadoc )
* @ see javax . servlet . http . HttpSessionListener # sessionDestroyed ( javax . servlet . http . HttpSessionEvent ) */
@ Override public void sessionDestroyed ( HttpSessionEvent event ) { } } | String id = event . getSession ( ) . getId ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "HttpSession destroyed: HttpSession ID: " + event . getSession ( ) . getId ( ) ) ; } // close the websocket session from here if the websocket session was secure .
if ( endpointManager != null ) { endpointManager . httpSessionExpired ( id ) ; } |
public class DescribeHostReservationsResult { /** * Details about the reservation ' s configuration .
* @ param hostReservationSet
* Details about the reservation ' s configuration . */
public void setHostReservationSet ( java . util . Collection < HostReservation > hostReservationSet ) { } } | if ( hostReservationSet == null ) { this . hostReservationSet = null ; return ; } this . hostReservationSet = new com . amazonaws . internal . SdkInternalList < HostReservation > ( hostReservationSet ) ; |
public class CfgParser { /** * Compute the distribution over CFG entries , the parse root , and the
* children , conditioned on the provided terminals and assuming the provided
* distributions over the root node . */
public CfgParseChart parseMarginal ( List < ? > terminals , Factor rootDist , boolean useSumProduct ) { } } | return marginal ( createParseChart ( terminals , useSumProduct ) , terminals , rootDist ) ; |
public class ODatabasePoolAbstract { /** * Closes all the databases . */
public void close ( ) { } } | for ( Entry < String , OResourcePool < String , DB > > pool : pools . entrySet ( ) ) { for ( DB db : pool . getValue ( ) . getResources ( ) ) { pool . getValue ( ) . close ( ) ; try { OLogManager . instance ( ) . debug ( this , "Closing pooled database '%s'..." , db . getName ( ) ) ; ( ( ODatabasePooled ) db ) . forceClose ( ) ; OLogManager . instance ( ) . debug ( this , "OK" , db . getName ( ) ) ; } catch ( Exception e ) { OLogManager . instance ( ) . debug ( this , "Error: %d" , e . toString ( ) ) ; } } } |
public class BackendBucketClient { /** * Retrieves the list of BackendBucket resources available to the specified project .
* < p > Sample code :
* < pre > < code >
* try ( BackendBucketClient backendBucketClient = BackendBucketClient . create ( ) ) {
* ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ;
* for ( BackendBucket element : backendBucketClient . listBackendBuckets ( project . toString ( ) ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param project Project ID for this request .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final ListBackendBucketsPagedResponse listBackendBuckets ( String project ) { } } | ListBackendBucketsHttpRequest request = ListBackendBucketsHttpRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return listBackendBuckets ( request ) ; |
public class PutLifecyclePolicyRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PutLifecyclePolicyRequest putLifecyclePolicyRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( putLifecyclePolicyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putLifecyclePolicyRequest . getRegistryId ( ) , REGISTRYID_BINDING ) ; protocolMarshaller . marshall ( putLifecyclePolicyRequest . getRepositoryName ( ) , REPOSITORYNAME_BINDING ) ; protocolMarshaller . marshall ( putLifecyclePolicyRequest . getLifecyclePolicyText ( ) , LIFECYCLEPOLICYTEXT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ResourceManager { /** * registers all ResourceIDs for the ResourceBuilders
* @ param resourceBuilder an instance of ResourceBuilder */
private void registerResourceIDsForResourceBuilder ( ResourceBuilderModel resourceBuilder ) { } } | List < ? extends ResourceModel > resources = resourceBuilder . announceResources ( ) ; if ( resources == null ) return ; resources . stream ( ) . map ( this :: getRegisteredListForResource ) . forEach ( list -> list . add ( resourceBuilder ) ) ; |
public class MainFrame { /** * GEN - LAST : event _ btLaunchMouseExited */
private void cbDisableTimeoutActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ cbDisableTimeoutActionPerformed
{ } } | // GEN - HEADEREND : event _ cbDisableTimeoutActionPerformed
if ( serviceWorker != null ) { serviceWorker . setTimeoutDisabled ( cbDisableTimeout . isSelected ( ) ) ; } |
public class JNDIEnvironmentRefBindingHelper { /** * Update a ComponentNameSpaceConfiguration object with processed binding
* and extension metadata .
* @ param compNSConfig the configuration to update
* @ param allBindings the map of all bindings
* @ param envEntryValues the env - entry value bindings map
* @ param resRefList the resource - ref binding and extension list */
public static void setAllBndAndExt ( ComponentNameSpaceConfiguration compNSConfig , Map < JNDIEnvironmentRefType , Map < String , String > > allBindings , Map < String , String > envEntryValues , ResourceRefConfigList resRefList ) { } } | for ( JNDIEnvironmentRefType refType : JNDIEnvironmentRefType . VALUES ) { if ( refType . getBindingElementName ( ) != null ) { compNSConfig . setJNDIEnvironmentRefBindings ( refType . getType ( ) , allBindings . get ( refType ) ) ; } } compNSConfig . setEnvEntryValues ( envEntryValues ) ; compNSConfig . setResourceRefConfigList ( resRefList ) ; |
public class ReflectionUtils { /** * Extract the last generic type from the passed class . For example
* < tt > public Class MyClass implements FilterClass & lt ; A , B & gt ; , SomeOtherClass & lt ; C & gt ; < / tt > will return { @ code B } .
* @ param clazz the class to extract from
* @ param filterClass the class of the generic type we ' re looking for
* @ return the last generic type from the interfaces of the passed class , filtered by the passed filter class */
public static Class < ? > getLastGenericClassType ( Class clazz , Class filterClass ) { } } | Type type = getGenericClassType ( clazz , filterClass ) ; if ( type instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) type ; if ( filterClass . isAssignableFrom ( ( Class ) pType . getRawType ( ) ) ) { Type [ ] actualTypes = pType . getActualTypeArguments ( ) ; if ( actualTypes . length > 0 && actualTypes [ actualTypes . length - 1 ] instanceof Class ) { return ( Class ) actualTypes [ actualTypes . length - 1 ] ; } } } return null ; |
public class ProcessStarter { /** * < p > Executes the given command as if it had been executed from the command line of the host OS
* ( cmd . exe on windows , / bin / sh on * nix ) and calls the provided handler with the newly created process .
* < p > < b > NOTE : < / b > In gosu , you should take advantage of the block - to - interface coercion provided and pass
* blocks in as the handler . See the examples below . < / p >
* @ param handler the process handler for this process . */
public void processWithHandler ( ProcessHandler handler ) { } } | Process process = null ; try { process = startImpl ( ) ; ShellProcess shellProcess = new ShellProcess ( process ) ; handler . run ( shellProcess ) ; try { process . exitValue ( ) ; } catch ( IllegalThreadStateException e ) { // Process not yet dead so kill
process . destroy ( ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } finally { if ( process != null ) { // close all three streams .
try { process . getErrorStream ( ) . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { process . getInputStream ( ) . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } try { process . getOutputStream ( ) . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } |
public class KeyVaultClientBaseImpl { /** * List keys in the specified vault .
* Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key . The LIST operation is applicable to all key types , however only the base key identifier , attributes , and tags are provided in the response . Individual versions of a key are not listed in the response . This operation requires the keys / list permission .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the PagedList & lt ; KeyItem & gt ; object wrapped in { @ link ServiceResponse } if successful . */
public Observable < ServiceResponse < Page < KeyItem > > > getKeysNextSinglePageAsync ( final String nextPageLink ) { } } | if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . getKeysNext ( nextUrl , this . acceptLanguage ( ) , this . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Page < KeyItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < KeyItem > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < PageImpl < KeyItem > > result = getKeysNextDelegate ( response ) ; return Observable . just ( new ServiceResponse < Page < KeyItem > > ( result . body ( ) , result . response ( ) ) ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class BranchFilterModule { /** * Process map for branch replication . */
protected void processMap ( final URI map ) { } } | assert ! map . isAbsolute ( ) ; this . map = map ; currentFile = job . tempDirURI . resolve ( map ) ; // parse
logger . info ( "Processing " + currentFile ) ; final Document doc ; try { logger . debug ( "Reading " + currentFile ) ; doc = builder . parse ( new InputSource ( currentFile . toString ( ) ) ) ; } catch ( final SAXException | IOException e ) { logger . error ( "Failed to parse " + currentFile , e ) ; return ; } logger . debug ( "Split branches and generate copy-to" ) ; splitBranches ( doc . getDocumentElement ( ) , Branch . EMPTY ) ; logger . debug ( "Filter map" ) ; filterBranches ( doc . getDocumentElement ( ) ) ; logger . debug ( "Rewrite duplicate topic references" ) ; rewriteDuplicates ( doc . getDocumentElement ( ) ) ; logger . debug ( "Filter topics and generate copies" ) ; generateCopies ( doc . getDocumentElement ( ) , Collections . emptyList ( ) ) ; logger . debug ( "Filter existing topics" ) ; filterTopics ( doc . getDocumentElement ( ) , Collections . emptyList ( ) ) ; logger . debug ( "Writing " + currentFile ) ; Result result = null ; try { Transformer serializer = TransformerFactory . newInstance ( ) . newTransformer ( ) ; result = new StreamResult ( currentFile . toString ( ) ) ; serializer . transform ( new DOMSource ( doc ) , result ) ; } catch ( final TransformerConfigurationException | TransformerFactoryConfigurationError e ) { throw new RuntimeException ( e ) ; } catch ( final TransformerException e ) { logger . error ( "Failed to serialize " + map . toString ( ) + ": " + e . getMessage ( ) , e ) ; } finally { try { close ( result ) ; } catch ( final IOException e ) { logger . error ( "Failed to close result stream for " + map . toString ( ) + ": " + e . getMessage ( ) , e ) ; } } |
public class DefaultFetchFilter { /** * Tells whether or not the given URI is excluded .
* @ param uri the URI to check
* @ return { @ code true } if the URI is excluded , { @ code false } otherwise . */
private boolean isExcluded ( String uri ) { } } | if ( excludeList == null || excludeList . isEmpty ( ) ) { return false ; } for ( String ex : excludeList ) { if ( uri . matches ( ex ) ) { return true ; } } return false ; |
public class DatasourceResourceProvider { /** * release datasource connection
* @ param dc
* @ param autoCommit */
void release ( DatasourceConnection dc ) { } } | if ( dc != null ) { try { dc . getConnection ( ) . commit ( ) ; dc . getConnection ( ) . setAutoCommit ( true ) ; dc . getConnection ( ) . setTransactionIsolation ( Connection . TRANSACTION_NONE ) ; } catch ( SQLException e ) { } getManager ( ) . releaseConnection ( ThreadLocalPageContext . get ( ) , dc ) ; } |
public class AfterBeanDiscoveryImpl { /** * Bean and observer registration is delayed until after all { @ link AfterBeanDiscovery } observers are notified . */
private void finish ( ) { } } | try { GlobalEnablementBuilder globalEnablementBuilder = getBeanManager ( ) . getServices ( ) . get ( GlobalEnablementBuilder . class ) ; for ( BeanRegistration registration : additionalBeans ) { processBeanRegistration ( registration , globalEnablementBuilder ) ; } for ( ObserverRegistration registration : additionalObservers ) { processObserverRegistration ( registration ) ; } } catch ( Exception e ) { throw new DefinitionException ( e ) ; } |
public class Requests { /** * Create new request with method and url */
public static RequestBuilder newRequest ( String method , String url ) { } } | return new RequestBuilder ( ) . method ( method ) . url ( url ) ; |
public class BaseBuilder { /** * Iterates through all of the build steps and uses reflection call the specified method on either the builder itself or
* the component being built . Also calls { @ link # postProcess ( Object ) } and then { @ link # validate ( Object ) } .
* @ return the newly built component instance , never < code > null < / code > . */
public T build ( ) { } } | T obj = createInstance ( ) ; try { for ( Step step : steps ) { if ( step . isBuilderMethodCall ( ) ) { callMethod ( this , step ) ; } else { callMethod ( obj , step ) ; } } } catch ( Exception e ) { throw new Siren4JRuntimeException ( e ) ; } postProcess ( obj ) ; validate ( obj ) ; return obj ; |
public class SetSystemPropertiesMojo { /** * { @ inheritDoc } */
public void execute ( ) throws MojoExecutionException , MojoFailureException { } } | if ( properties . isEmpty ( ) ) { getLog ( ) . debug ( "No system properties found" ) ; return ; } getLog ( ) . debug ( "Setting system properties:" ) ; for ( Enumeration < ? > propertyNames = properties . propertyNames ( ) ; propertyNames . hasMoreElements ( ) ; ) { String propertyName = propertyNames . nextElement ( ) . toString ( ) ; String propertyValue = properties . getProperty ( propertyName ) ; getLog ( ) . debug ( "- " + propertyName + " = " + propertyValue ) ; System . setProperty ( propertyName , propertyValue ) ; } int count = properties . size ( ) ; getLog ( ) . info ( "Set " + count + " system " + ( count > 1 ? "properties" : "property" ) ) ; |
public class AbstractWALDAO { /** * This method is called if recovery from the WAL file ( partially ) failed an
* analysis might be needed . */
final void _maintainWALFileAfterProcessing ( @ Nonnull @ Nonempty final String sWALFilename ) { } } | ValueEnforcer . notEmpty ( sWALFilename , "WALFilename" ) ; final File aWALFile = m_aIO . getFile ( sWALFilename ) ; final File aNewFile = new File ( aWALFile . getParentFile ( ) , aWALFile . getName ( ) + "." + PDTFactory . getCurrentMillis ( ) + ".bup" ) ; if ( FileOperationManager . INSTANCE . renameFile ( aWALFile , aNewFile ) . isFailure ( ) ) { if ( LOGGER . isErrorEnabled ( ) ) LOGGER . error ( "Failed to rename WAL file '" + aWALFile . getAbsolutePath ( ) + "' to '" + aNewFile . getAbsolutePath ( ) + "'" ) ; } else { if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Maintained WAL file '" + aWALFile . getAbsolutePath ( ) + "' as '" + aNewFile . getAbsolutePath ( ) + "' for debugging purposes" ) ; } |
public class DatabaseTableMeta { /** * 初始化的时候dump一下表结构 */
private boolean dumpTableMeta ( MysqlConnection connection , final CanalEventFilter filter ) { } } | try { ResultSetPacket packet = connection . query ( "show databases" ) ; List < String > schemas = new ArrayList < String > ( ) ; for ( String schema : packet . getFieldValues ( ) ) { schemas . add ( schema ) ; } for ( String schema : schemas ) { // filter views
packet = connection . query ( "show full tables from `" + schema + "` where Table_type = 'BASE TABLE'" ) ; List < String > tables = new ArrayList < String > ( ) ; for ( String table : packet . getFieldValues ( ) ) { if ( "BASE TABLE" . equalsIgnoreCase ( table ) ) { continue ; } String fullName = schema + "." + table ; if ( blackFilter == null || ! blackFilter . filter ( fullName ) ) { if ( filter == null || filter . filter ( fullName ) ) { tables . add ( table ) ; } } } if ( tables . isEmpty ( ) ) { continue ; } StringBuilder sql = new StringBuilder ( ) ; for ( String table : tables ) { sql . append ( "show create table `" + schema + "`.`" + table + "`;" ) ; } List < ResultSetPacket > packets = connection . queryMulti ( sql . toString ( ) ) ; for ( ResultSetPacket onePacket : packets ) { if ( onePacket . getFieldValues ( ) . size ( ) > 1 ) { String oneTableCreateSql = onePacket . getFieldValues ( ) . get ( 1 ) ; memoryTableMeta . apply ( INIT_POSITION , schema , oneTableCreateSql , null ) ; } } } return true ; } catch ( IOException e ) { throw new CanalParseException ( e ) ; } |
public class SLF4JLoggerImpl { /** * Log an exception ( throwable ) at the TRACE level with an accompanying message . If the exception is null , then this method
* calls { @ link # trace ( String , Object . . . ) } .
* @ param t the exception ( throwable ) to log
* @ param message the message accompanying the exception
* @ param params the parameter values that are to replace the variables in the format string */
@ Override public void trace ( Throwable t , String message , Object ... params ) { } } | if ( ! isTraceEnabled ( ) ) return ; if ( t == null ) { this . trace ( message , params ) ; return ; } if ( message == null ) { logger . trace ( null , t ) ; return ; } logger . trace ( StringUtil . createString ( message , params ) , t ) ; |
public class WebcamDiscoveryService { /** * Stop discovery service . */
public void stop ( ) { } } | // return if not running
if ( ! running . compareAndSet ( true , false ) ) { return ; } try { runner . join ( ) ; } catch ( InterruptedException e ) { throw new WebcamException ( "Joint interrupted" ) ; } LOG . debug ( "Discovery service has been stopped" ) ; runner = null ; |
public class SimpleSipServlet { /** * { @ inheritDoc } */
protected void doBye ( SipServletRequest request ) throws ServletException , IOException { } } | if ( logger . isInfoEnabled ( ) ) { logger . info ( "Got BYE request:\n" + request ) ; } SipServletResponse sipServletResponse = request . createResponse ( 200 ) ; sipServletResponse . send ( ) ; RTSPStack rtsp = ( RTSPStack ) request . getSession ( ) . getAttribute ( "rtsp" ) ; try { rtsp . sendTeardown ( ) ; Thread . sleep ( 1000 ) ; rtsp . destroy ( ) ; } catch ( Exception e ) { logger . error ( "Problem cleaning up RTSP stack" , e ) ; } |
public class RouterMiddleware { /** * Adds the < code > interceptor < / code > to the list of interceptors that will matches the specified
* < code > paths < / code > .
* @ param interceptor the interceptor object to be added .
* @ param paths the paths in which this interceptor will be invoked , an empty array to respond to all paths . */
public void addInterceptor ( Interceptor interceptor , String ... paths ) { } } | Preconditions . notNull ( interceptor , "no interceptor provided" ) ; interceptors . add ( new InterceptorEntry ( interceptor , paths ) ) ; |
public class ByteBufferOutputStream { /** * Write current content to the passed byte array . The copied elements are
* removed from this streams buffer .
* @ param aBuf
* Byte array to write to . May not be < code > null < / code > .
* @ param nOfs
* Offset to start writing . Must be & ge ; 0.
* @ param nLen
* Number of bytes to copy . Must be & ge ; 0.
* @ param bCompactBuffer
* < code > true < / code > to compact the buffer afterwards ,
* < code > false < / code > otherwise . */
public void writeTo ( @ Nonnull final byte [ ] aBuf , @ Nonnegative final int nOfs , @ Nonnegative final int nLen , final boolean bCompactBuffer ) { } } | ValueEnforcer . isArrayOfsLen ( aBuf , nOfs , nLen ) ; m_aBuffer . flip ( ) ; m_aBuffer . get ( aBuf , nOfs , nLen ) ; if ( bCompactBuffer ) m_aBuffer . compact ( ) ; |
public class FixedJitterBuffer { /** * Accepts specified packet
* @ param packet the packet to accept */
@ Override public void write ( RtpPacket packet , RTPFormat format ) { } } | // checking format
if ( format == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "No format specified. Packet dropped!" ) ; } return ; } boolean locked = false ; try { locked = this . lock . tryLock ( ) || this . lock . tryLock ( 5 , TimeUnit . MILLISECONDS ) ; if ( locked ) { safeWrite ( packet , format ) ; } } catch ( InterruptedException e ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Could not aquire write lock for jitter buffer. Dropped packet." ) ; } } finally { if ( locked ) { this . lock . unlock ( ) ; } } |
public class DefaultASTValidateableHelper { /** * Retrieves a Map describing all of the properties which need to be constrained for the class
* represented by classNode . The keys in the Map will be property names and the values are the
* type of the corresponding property .
* @ param classNode the class to inspect
* @ return a Map describing all of the properties which need to be constrained */
protected Map < String , ClassNode > getPropertiesToEnsureConstraintsFor ( final ClassNode classNode ) { } } | final Map < String , ClassNode > fieldsToConstrain = new HashMap < String , ClassNode > ( ) ; final List < FieldNode > allFields = classNode . getFields ( ) ; for ( final FieldNode field : allFields ) { if ( ! field . isStatic ( ) ) { final PropertyNode property = classNode . getProperty ( field . getName ( ) ) ; if ( property != null ) { fieldsToConstrain . put ( field . getName ( ) , field . getType ( ) ) ; } } } final Map < String , MethodNode > declaredMethodsMap = classNode . getDeclaredMethodsMap ( ) ; for ( Entry < String , MethodNode > methodEntry : declaredMethodsMap . entrySet ( ) ) { final MethodNode value = methodEntry . getValue ( ) ; if ( ! value . isStatic ( ) && value . isPublic ( ) && classNode . equals ( value . getDeclaringClass ( ) ) && value . getLineNumber ( ) > 0 ) { Parameter [ ] parameters = value . getParameters ( ) ; if ( parameters == null || parameters . length == 0 ) { final String methodName = value . getName ( ) ; if ( methodName . startsWith ( "get" ) ) { final ClassNode returnType = value . getReturnType ( ) ; final String restOfMethodName = methodName . substring ( 3 ) ; final String propertyName = GrailsNameUtils . getPropertyName ( restOfMethodName ) ; fieldsToConstrain . put ( propertyName , returnType ) ; } } } } final ClassNode superClass = classNode . getSuperClass ( ) ; if ( ! superClass . equals ( new ClassNode ( Object . class ) ) ) { fieldsToConstrain . putAll ( getPropertiesToEnsureConstraintsFor ( superClass ) ) ; } return fieldsToConstrain ; |
public class FragmentHelper { /** * / / / / / Others / / / / / / / */
@ Override public void executeOnUIThread ( Runnable runnable ) { } } | Activity activity = fragment . getActivity ( ) ; if ( activity != null && ! activity . isDestroyed ( ) ) { activity . runOnUiThread ( new SafeExecuteWrapperRunnable ( fragment , runnable ) ) ; } |
public class NFVORequestor { /** * Returns a KeyAgent with which requests regarding Keys can be sent to the NFVO .
* @ return a KeyAgent */
public synchronized ServiceAgent getServiceAgent ( ) { } } | if ( this . keyAgent == null ) { if ( isService ) { this . serviceAgent = new ServiceAgent ( this . serviceName , this . projectId , this . sslEnabled , this . nfvoIp , this . nfvoPort , this . version , this . serviceKey ) ; } else { this . serviceAgent = new ServiceAgent ( this . username , this . password , this . projectId , this . sslEnabled , this . nfvoIp , this . nfvoPort , this . version ) ; } } return this . serviceAgent ; |
public class Scte35SpliceInsertScheduleActionSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Scte35SpliceInsertScheduleActionSettings scte35SpliceInsertScheduleActionSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( scte35SpliceInsertScheduleActionSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( scte35SpliceInsertScheduleActionSettings . getDuration ( ) , DURATION_BINDING ) ; protocolMarshaller . marshall ( scte35SpliceInsertScheduleActionSettings . getSpliceEventId ( ) , SPLICEEVENTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class AbstractAjcMojo { /** * Parameter which indicates an XML file containing AspectJ weaving instructions .
* Assigning this plugin parameter adds the < code > - xmlConfigured < / code > option to ajc .
* @ param xmlConfigured an XML file containing AspectJ weaving instructions . */
public void setXmlConfigured ( final File xmlConfigured ) { } } | try { final String path = xmlConfigured . getCanonicalPath ( ) ; if ( ! xmlConfigured . exists ( ) ) { getLog ( ) . warn ( "xmlConfigured parameter invalid. [" + path + "] does not exist." ) ; } else if ( ! path . trim ( ) . toLowerCase ( ) . endsWith ( ".xml" ) ) { getLog ( ) . warn ( "xmlConfigured parameter invalid. XML file name must end in .xml" ) ; } else { this . xmlConfigured = xmlConfigured ; } } catch ( Exception e ) { getLog ( ) . error ( "Exception setting xmlConfigured option" , e ) ; } |
public class DomHelpers { /** * If any child of el has prefix as prefix , remove it . drop all namespace
* decls on the way . If we find an element with a different prefix , go
* crazy .
* @ param el
* @ param prefix
* @ throws MarshalException */
private static void removePrefixFromChildren ( Element el , String prefix ) throws MarshalException { } } | NodeList nl = el . getChildNodes ( ) ; String localPrefix = null ; for ( int i = 0 ; i < nl . getLength ( ) ; i ++ ) { Node n = nl . item ( i ) ; if ( n . getNodeType ( ) != Node . ELEMENT_NODE ) { continue ; } localPrefix = n . getPrefix ( ) ; if ( localPrefix != null && localPrefix . length ( ) > 0 ) { if ( ! localPrefix . equals ( prefix ) ) { IfmapJLog . warn ( "Extended Identifier: Multiple namespaces in extended identifer used." + "IfmapJ thinks this is not a wise idea. Sorry!" ) ; throw new MarshalException ( "Extended Identifier: Multiple namespaces in extended identifer used." + "IfmapJ thinks this is not a wise idea. Sorry!" ) ; } n . setPrefix ( null ) ; } removePrefixFromChildren ( ( Element ) n , prefix ) ; dropNamespaceDecls ( ( Element ) n ) ; } |
public class AdditionalRequestHeadersInterceptor { /** * Gets the header values list for a given header .
* If the header doesn ' t have any values , an empty list will be returned .
* @ param headerName the name of the header
* @ return the list of values for the header */
private List < String > getHeaderValues ( String headerName ) { } } | if ( additionalHttpHeaders . get ( headerName ) == null ) { additionalHttpHeaders . put ( headerName , new ArrayList < String > ( ) ) ; } return additionalHttpHeaders . get ( headerName ) ; |
public class BosClient { /** * Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets .
* List results are < i > always < / i > returned in lexicographic ( alphabetical ) order .
* @ param bucketName The name of the Bos bucket to list .
* @ param prefix An optional parameter restricting the response to keys beginning with the specified prefix .
* Use prefixes to separate a bucket into different sets of keys , similar to how a file system
* organizes files into directories .
* @ return ListObjectsResponse containing a listing of the objects in the specified bucket , along with any
* other associated information , such as common prefixes ( if a delimiter was specified ) , the original
* request parameters , etc . */
public ListObjectsResponse listObjects ( String bucketName , String prefix ) { } } | return this . listObjects ( new ListObjectsRequest ( bucketName , prefix ) ) ; |
public class ObjectFactory { /** * Create an instance of { @ link Project . Layouts . Layout . Columns . Column } */
public Project . Layouts . Layout . Columns . Column createProjectLayoutsLayoutColumnsColumn ( ) { } } | return new Project . Layouts . Layout . Columns . Column ( ) ; |
public class JavaDecrypt { /** * des解密
* @ param code { @ link String }
* @ return { @ link String }
* @ throws InvalidKeyException 异常
* @ throws NoSuchAlgorithmException 异常
* @ throws NoSuchPaddingException 异常
* @ throws UnsupportedEncodingException 异常
* @ throws IllegalBlockSizeException 异常
* @ throws BadPaddingException 异常 */
public static String des ( String code ) throws InvalidKeyException , NoSuchAlgorithmException , NoSuchPaddingException , UnsupportedEncodingException , IllegalBlockSizeException , BadPaddingException { } } | return JavaEncrypt . decryptDES ( code , "DES" ) ; |
public class ChannelManager { /** * Unregisters the given task from the channel manager .
* @ param vertexId the ID of the task to be unregistered
* @ param task the task to be unregistered */
public void unregister ( ExecutionVertexID vertexId , Task task ) { } } | final Environment environment = task . getEnvironment ( ) ; // destroy and remove OUTPUT channels from registered channels and cache
for ( ChannelID id : environment . getOutputChannelIDs ( ) ) { Channel channel = this . channels . remove ( id ) ; if ( channel != null ) { channel . destroy ( ) ; } this . receiverCache . remove ( channel ) ; } // destroy and remove INPUT channels from registered channels and cache
for ( ChannelID id : environment . getInputChannelIDs ( ) ) { Channel channel = this . channels . remove ( id ) ; if ( channel != null ) { channel . destroy ( ) ; } this . receiverCache . remove ( channel ) ; } // clear and remove INPUT side buffer pools
for ( GateID id : environment . getInputGateIDs ( ) ) { LocalBufferPoolOwner bufferPool = this . localBuffersPools . remove ( id ) ; if ( bufferPool != null ) { bufferPool . clearLocalBufferPool ( ) ; } } // clear and remove OUTPUT side buffer pool
LocalBufferPoolOwner bufferPool = this . localBuffersPools . remove ( vertexId ) ; if ( bufferPool != null ) { bufferPool . clearLocalBufferPool ( ) ; } // the number of channels per buffers has changed after unregistering the task
// = > redistribute the number of designated buffers of the registered local buffer pools
redistributeBuffers ( ) ; |
public class Configuration { /** * Register a typeName to Class mapping
* @ param typeName SQL type name
* @ param clazz java type */
public void registerType ( String typeName , Class < ? > clazz ) { } } | typeToName . put ( typeName . toLowerCase ( ) , clazz ) ; |
public class VarProperties { /** * private static final Pattern p = Pattern . compile ( " \ \ $ \ \ { . + \ \ } " ) ; */
public String getProperty ( String key ) { } } | String vorher = super . getProperty ( key ) ; String nachher = null ; while ( vorher != null && ! vorher . equals ( nachher = doReplacements ( vorher ) ) ) { vorher = nachher ; } return nachher ; |
public class RunInstancesExample { /** * Run some new ec2 instances .
* @ param imageId
* AMI for running new instances from
* @ param runCount
* count of instances to run
* @ return a list of started instances */
public static List < Instance > runInstances ( final String imageId , final int runCount ) { } } | // pass any credentials as aws - mock does not authenticate them at all
AWSCredentials credentials = new BasicAWSCredentials ( "foo" , "bar" ) ; AmazonEC2Client amazonEC2Client = new AmazonEC2Client ( credentials ) ; // the mock endpoint for ec2 which runs on your computer
String ec2Endpoint = "http://localhost:8000/aws-mock/ec2-endpoint/" ; amazonEC2Client . setEndpoint ( ec2Endpoint ) ; // instance type
String instanceType = "m1.large" ; // run 10 instances
RunInstancesRequest request = new RunInstancesRequest ( ) ; final int minRunCount = runCount ; final int maxRunCount = runCount ; request . withImageId ( imageId ) . withInstanceType ( instanceType ) . withMinCount ( minRunCount ) . withMaxCount ( maxRunCount ) ; RunInstancesResult result = amazonEC2Client . runInstances ( request ) ; return result . getReservation ( ) . getInstances ( ) ; |
public class AlluxioWorkerExecutor { /** * Starts the Alluxio worker executor .
* @ param args command - line arguments */
public static void main ( String [ ] args ) throws Exception { } } | MesosExecutorDriver driver = new MesosExecutorDriver ( new AlluxioWorkerExecutor ( ) ) ; System . exit ( driver . run ( ) == Protos . Status . DRIVER_STOPPED ? 0 : 1 ) ; |
public class JacocoReportPublisher { /** * TODO only collect the jacoco report if unit tests have run
* @ param context
* @ param mavenSpyLogsElt maven spy report . WARNING experimental structure for the moment , subject to change .
* @ throws IOException
* @ throws InterruptedException */
@ Override public void process ( @ Nonnull StepContext context , @ Nonnull Element mavenSpyLogsElt ) throws IOException , InterruptedException { } } | TaskListener listener = context . get ( TaskListener . class ) ; FilePath workspace = context . get ( FilePath . class ) ; Run run = context . get ( Run . class ) ; Launcher launcher = context . get ( Launcher . class ) ; List < Element > jacocoPrepareAgentEvents = XmlUtils . getExecutionEventsByPlugin ( mavenSpyLogsElt , "org.jacoco" , "jacoco-maven-plugin" , "prepare-agent" , "MojoSucceeded" , "MojoFailed" ) ; if ( jacocoPrepareAgentEvents . isEmpty ( ) ) { LOGGER . log ( Level . FINE , "No org.jacoco:jacoco-maven-plugin:prepare-agent execution found" ) ; return ; } else if ( jacocoPrepareAgentEvents . size ( ) > 1 ) { // JENKINS - 54139
if ( LOGGER . isLoggable ( Level . FINE ) ) listener . getLogger ( ) . print ( "[withMaven - Jacoco] More than 1 Maven module (" + jacocoPrepareAgentEvents . size ( ) + ") generated a Jacoco code coverage report, " + "skip automatic collect of Jacoco reports as the Jenkins Jacoco report is not designed to render multiple reports per build" ) ; return ; } try { Class . forName ( "hudson.plugins.jacoco.JacocoPublisher" ) ; } catch ( ClassNotFoundException e ) { listener . getLogger ( ) . print ( "[withMaven] Jenkins " ) ; listener . hyperlink ( "https://wiki.jenkins.io/display/JENKINS/JaCoCo+Plugin" , "JaCoCo Plugin" ) ; listener . getLogger ( ) . println ( " not found, don't display org.jacoco:jacoco-maven-plugin:findbugs results in pipeline screen." ) ; return ; } for ( Element jacocoPrepareAgentEvent : jacocoPrepareAgentEvents ) { Element buildElement = XmlUtils . getUniqueChildElementOrNull ( jacocoPrepareAgentEvent , "project" , "build" ) ; if ( buildElement == null ) { if ( LOGGER . isLoggable ( Level . FINE ) ) LOGGER . log ( Level . FINE , "Ignore execution event with missing 'build' child:" + XmlUtils . toString ( jacocoPrepareAgentEvent ) ) ; continue ; } Element pluginElt = XmlUtils . getUniqueChildElement ( jacocoPrepareAgentEvent , "plugin" ) ; Element destFileElt = XmlUtils . getUniqueChildElementOrNull ( pluginElt , "destFile" ) ; Element projectElt = XmlUtils . getUniqueChildElement ( jacocoPrepareAgentEvent , "project" ) ; MavenArtifact mavenArtifact = XmlUtils . newMavenArtifact ( projectElt ) ; MavenSpyLogProcessor . PluginInvocation pluginInvocation = XmlUtils . newPluginInvocation ( pluginElt ) ; if ( destFileElt == null ) { listener . getLogger ( ) . println ( "[withMaven] No <destFile> element found for <plugin> in " + XmlUtils . toString ( jacocoPrepareAgentEvent ) ) ; continue ; } String destFile = destFileElt . getTextContent ( ) . trim ( ) ; if ( destFile . equals ( "${jacoco.destFile}" ) ) { destFile = "${project.build.directory}/jacoco.exec" ; String projectBuildDirectory = XmlUtils . getProjectBuildDirectory ( projectElt ) ; if ( projectBuildDirectory == null || projectBuildDirectory . isEmpty ( ) ) { listener . getLogger ( ) . println ( "[withMaven] '${project.build.directory}' found for <project> in " + XmlUtils . toString ( jacocoPrepareAgentEvent ) ) ; continue ; } destFile = destFile . replace ( "${project.build.directory}" , projectBuildDirectory ) ; } else if ( destFile . contains ( "${project.build.directory}" ) ) { String projectBuildDirectory = XmlUtils . getProjectBuildDirectory ( projectElt ) ; if ( projectBuildDirectory == null || projectBuildDirectory . isEmpty ( ) ) { listener . getLogger ( ) . println ( "[withMaven] '${project.build.directory}' found for <project> in " + XmlUtils . toString ( jacocoPrepareAgentEvent ) ) ; continue ; } destFile = destFile . replace ( "${project.build.directory}" , projectBuildDirectory ) ; } else if ( destFile . contains ( "${basedir}" ) ) { String baseDir = projectElt . getAttribute ( "baseDir" ) ; if ( baseDir . isEmpty ( ) ) { listener . getLogger ( ) . println ( "[withMaven] '${basedir}' found for <project> in " + XmlUtils . toString ( jacocoPrepareAgentEvent ) ) ; continue ; } destFile = destFile . replace ( "${basedir}" , baseDir ) ; } destFile = XmlUtils . getPathInWorkspace ( destFile , workspace ) ; String sourceDirectory = buildElement . getAttribute ( "sourceDirectory" ) ; String classesDirectory = buildElement . getAttribute ( "directory" ) + "/classes" ; String sourceDirectoryRelativePath = XmlUtils . getPathInWorkspace ( sourceDirectory , workspace ) ; String classesDirectoryRelativePath = XmlUtils . getPathInWorkspace ( classesDirectory , workspace ) ; listener . getLogger ( ) . println ( "[withMaven] jacocoPublisher - Archive JaCoCo analysis results for Maven artifact " + mavenArtifact . toString ( ) + " generated by " + pluginInvocation + ": execFile: " + destFile + ", sources: " + sourceDirectoryRelativePath + ", classes: " + classesDirectoryRelativePath ) ; JacocoPublisher jacocoPublisher = new JacocoPublisher ( ) ; jacocoPublisher . setExecPattern ( destFile ) ; jacocoPublisher . setSourcePattern ( sourceDirectoryRelativePath ) ; jacocoPublisher . setClassPattern ( classesDirectoryRelativePath ) ; try { jacocoPublisher . perform ( run , workspace , launcher , listener ) ; } catch ( Exception e ) { listener . error ( "[withMaven] jacocoPublisher - Silently ignore exception archiving JaCoCo results for Maven artifact " + mavenArtifact . toString ( ) + " generated by " + pluginInvocation + ": " + e ) ; LOGGER . log ( Level . WARNING , "Exception processing " + XmlUtils . toString ( jacocoPrepareAgentEvent ) , e ) ; } } |
public class CmsAttributeHandler { /** * Sets the warning message for the given value index . < p >
* @ param valueIndex the value index
* @ param message the warning message
* @ param tabbedPanel the forms tabbed panel if available */
public void setWarningMessage ( int valueIndex , String message , CmsTabbedPanel < ? > tabbedPanel ) { } } | if ( ! m_attributeValueViews . isEmpty ( ) ) { FlowPanel parent = ( FlowPanel ) m_attributeValueViews . get ( 0 ) . getParent ( ) ; CmsAttributeValueView valueView = ( CmsAttributeValueView ) parent . getWidget ( valueIndex ) ; valueView . setWarningMessage ( message ) ; if ( tabbedPanel != null ) { int tabIndex = tabbedPanel . getTabIndex ( valueView . getElement ( ) ) ; if ( tabIndex > - 1 ) { Widget tab = tabbedPanel . getTabWidget ( tabIndex ) ; tab . setTitle ( "This tab has warnings." ) ; tab . getParent ( ) . addStyleName ( I_CmsLayoutBundle . INSTANCE . form ( ) . hasWarning ( ) ) ; } } } |
public class RemoveUnusedCode { /** * Strip as many unreferenced args off the end of the function declaration as possible . We start
* from the end of the function declaration because removing parameters from the middle of the
* param list could mess up the interpretation of parameters being sent over by any function
* calls .
* @ param argList list of function ' s arguments
* @ param fparamScope */
private void maybeRemoveUnusedTrailingParameters ( Node argList , Scope fparamScope ) { } } | Node lastArg ; while ( ( lastArg = argList . getLastChild ( ) ) != null ) { Node lValue = lastArg ; if ( lastArg . isDefaultValue ( ) ) { lValue = lastArg . getFirstChild ( ) ; if ( NodeUtil . mayHaveSideEffects ( lastArg . getLastChild ( ) , compiler ) ) { break ; } } if ( lValue . isRest ( ) ) { lValue = lValue . getFirstChild ( ) ; } if ( lValue . isDestructuringPattern ( ) ) { if ( lValue . hasChildren ( ) ) { // TODO ( johnlenz ) : handle the case where there are no assignments .
break ; } else { // Remove empty destructuring patterns and their associated object literal assignment
// if it exists and if the right hand side does not have side effects . Note , a
// destructuring pattern with a " leftover " property key as in { a : { } } is not considered
// empty in this case !
NodeUtil . deleteNode ( lastArg , compiler ) ; continue ; } } VarInfo varInfo = getVarInfo ( getVarForNameNode ( lValue , fparamScope ) ) ; if ( varInfo . isRemovable ( ) ) { NodeUtil . deleteNode ( lastArg , compiler ) ; } else { break ; } } |
public class FieldAnnotation { /** * Is the instruction a write of a field ?
* @ param ins
* the Instruction to check
* @ param cpg
* ConstantPoolGen of the method containing the instruction
* @ return the Field if instruction is a write of a field , null otherwise */
public static FieldAnnotation isWrite ( Instruction ins , ConstantPoolGen cpg ) { } } | if ( ins instanceof PUTFIELD || ins instanceof PUTSTATIC ) { FieldInstruction fins = ( FieldInstruction ) ins ; String className = fins . getClassName ( cpg ) ; return new FieldAnnotation ( className , fins . getName ( cpg ) , fins . getSignature ( cpg ) , fins instanceof PUTSTATIC ) ; } else { return null ; } |
public class ResponseValidator { /** * validate a given response content object with status code " 200 " and media content type " application / json "
* uri , httpMethod , JSON _ MEDIA _ TYPE ( " 200 " ) , DEFAULT _ MEDIA _ TYPE ( " application / json " ) is to locate the schema to validate
* @ param responseContent response content needs to be validated
* @ param uri original uri of the request
* @ param httpMethod eg . " put " or " get "
* @ return Status */
public Status validateResponseContent ( Object responseContent , String uri , String httpMethod ) { } } | return validateResponseContent ( responseContent , uri , httpMethod , GOOD_STATUS_CODE ) ; |
public class MatrixFunctions { /** * Applies the < i > cube root < / i > function element wise on this
* matrix . Note that this is an in - place operation .
* @ see MatrixFunctions # cbrt ( DoubleMatrix )
* @ return this matrix */
public static DoubleMatrix cbrti ( DoubleMatrix x ) { } } | /* # mapfct ( ' Math . cbrt ' ) # */
// RJPP - BEGIN - - - - -
for ( int i = 0 ; i < x . length ; i ++ ) x . put ( i , ( double ) Math . cbrt ( x . get ( i ) ) ) ; return x ; // RJPP - END - - - - - |
public class Control { /** * This method retrieves the minimum value this control will accept .
* If this control is a string control , this method returns the minimum string
* size that can be set on this control .
* @ return the minimum value or the smallest string size
* @ throws StateException if this control has been released and must not be used anymore .
* @ throws UnsupportedMethod if this control is of type { @ link V4L4JConstants # CTRL _ TYPE _ LONG } */
public int getMinValue ( ) { } } | if ( type == V4L4JConstants . CTRL_TYPE_LONG ) throw new UnsupportedMethod ( "This control is a long control and does not support calls to getMinValue()" ) ; synchronized ( state ) { if ( state . isNotReleased ( ) ) return min ; else throw new StateException ( "This control has been released and must not be used" ) ; } |
public class BandedAligner { /** * Classical Banded Alignment .
* Both sequences must be highly similar .
* Align 2 sequence completely ( i . e . while first sequence will be aligned against whole second sequence ) .
* @ param scoring scoring system
* @ param seq1 first sequence
* @ param seq2 second sequence
* @ param offset1 offset in first sequence
* @ param length1 length of first sequence ' s part to be aligned
* @ param offset2 offset in second sequence
* @ param length2 length of second sequence ' s part to be aligned
* @ param width width of banded alignment matrix . In other terms max allowed number of indels */
public static Alignment < NucleotideSequence > alignGlobal ( final AlignmentScoring < NucleotideSequence > scoring , final NucleotideSequence seq1 , final NucleotideSequence seq2 , final int offset1 , final int length1 , final int offset2 , final int length2 , final int width ) { } } | if ( scoring instanceof AffineGapAlignmentScoring ) return BandedAffineAligner . align ( ( AffineGapAlignmentScoring < NucleotideSequence > ) scoring , seq1 , seq2 , offset1 , length1 , offset2 , length2 , width ) ; else return BandedLinearAligner . align ( ( LinearGapAlignmentScoring < NucleotideSequence > ) scoring , seq1 , seq2 , offset1 , length1 , offset2 , length2 , width ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcFlowFitting ( ) { } } | if ( ifcFlowFittingEClass == null ) { ifcFlowFittingEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 242 ) ; } return ifcFlowFittingEClass ; |
public class Crypto { /** * Returns an ASCII string that can be used for encrypting / decrypting
* data with the AES - 128 algorithm . The given seed < strong > does not < / strong >
* guarantee the same result for subsequent invocations .
* @ param seed A string to seed the generator with .
* @ return A unique ASCII string that can be used as an AES - 128 key , or null . */
public static String generateAes128KeyWithSeed ( String seed ) { } } | String returnKey = null ; try { SecureRandom rand = SecureRandom . getInstance ( "SHA1PRNG" ) ; byte [ ] salt = new byte [ 16 ] ; rand . nextBytes ( salt ) ; PBEKeySpec password = new PBEKeySpec ( seed . toCharArray ( ) , salt , 1000 , 128 ) ; SecretKeyFactory factory = SecretKeyFactory . getInstance ( "PBKDF2WithHmacSHA1" ) ; PBEKey key = ( PBEKey ) factory . generateSecret ( password ) ; SecretKey secretKey = new SecretKeySpec ( key . getEncoded ( ) , "AES" ) ; StringBuffer keyBuffer = new StringBuffer ( ) ; for ( byte b : secretKey . getEncoded ( ) ) { int i = Integer . parseInt ( String . format ( "%d" , b ) ) ; int j = ( Math . abs ( i ) % 54 ) + 40 ; // A chunk of the ASCII table .
// Clean up a few characters that could be problematic in JSON
// or a query parameter . Others should be URL encoded by the user .
switch ( j ) { case 47 : // Replace ' / ' with ' ! ' .
j = 33 ; break ; case 61 : // Replace ' = ' with ' z ' .
j = 122 ; case 92 : // Replace ' \ ' with ' # ' .
j = 35 ; break ; } keyBuffer . append ( ( char ) j ) ; } returnKey = keyBuffer . toString ( ) ; } catch ( InvalidKeySpecException e ) { log . error ( "Could not find desired key specificatio." ) ; log . debug ( e . toString ( ) ) ; } catch ( NoSuchAlgorithmException e ) { log . error ( "Could not find encryption algorithm." ) ; log . debug ( e . toString ( ) ) ; } return returnKey ; |
public class BinarySearch { /** * Checks that { @ code fromIndex } and { @ code toIndex } are in the range and
* throws an appropriate exception , if they aren ' t . */
private static void rangeCheck ( int length , int fromIndex , int toIndex ) { } } | if ( fromIndex > toIndex ) { throw new IllegalArgumentException ( "fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")" ) ; } if ( fromIndex < 0 ) { throw new ArrayIndexOutOfBoundsException ( fromIndex ) ; } if ( toIndex > length ) { throw new ArrayIndexOutOfBoundsException ( toIndex ) ; } |
public class AVLGroupTree { /** * Add the provided centroid to the tree . */
public void add ( double centroid , int count , List < Double > data ) { } } | this . centroid = centroid ; this . count = count ; this . data = data ; tree . add ( ) ; |
public class CmsLinkManager { /** * Calculates a relative URI from " fromUri " to " toUri " ,
* both URI must be absolute . < p >
* @ param fromUri the URI to start
* @ param toUri the URI to calculate a relative path to
* @ return a relative URI from " fromUri " to " toUri " */
public static String getRelativeUri ( String fromUri , String toUri ) { } } | StringBuffer result = new StringBuffer ( ) ; int pos = 0 ; while ( true ) { int i = fromUri . indexOf ( '/' , pos ) ; int j = toUri . indexOf ( '/' , pos ) ; if ( ( i == - 1 ) || ( i != j ) || ! fromUri . regionMatches ( pos , toUri , pos , i - pos ) ) { break ; } pos = i + 1 ; } // count hops up from here to the common ancestor
for ( int i = fromUri . indexOf ( '/' , pos ) ; i > 0 ; i = fromUri . indexOf ( '/' , i + 1 ) ) { result . append ( "../" ) ; } // append path down from common ancestor to there
result . append ( toUri . substring ( pos ) ) ; if ( result . length ( ) == 0 ) { // special case : relative link to the parent folder from a file in that folder
result . append ( "./" ) ; } return result . toString ( ) ; |
public class AbstractIoSession { /** * TODO Add method documentation */
public final void increaseWrittenBytes ( int increment , long currentTime ) { } } | if ( increment <= 0 ) { return ; } writtenBytes += increment ; lastWriteTime = currentTime ; idleCountForBoth . set ( 0 ) ; idleCountForWrite . set ( 0 ) ; if ( getService ( ) instanceof AbstractIoService ) { getService ( ) . getStatistics ( ) . increaseWrittenBytes ( increment , currentTime ) ; } increaseScheduledWriteBytes ( - increment ) ; |
public class PackedDecimal { /** * Setzt die Anzahl der Nachkommastellen .
* @ param n z . B . 0 , falls keine Nachkommastelle gesetzt sein soll
* @ param mode Rundungs - Mode
* @ return eine neue { @ link PackedDecimal } */
public PackedDecimal setScale ( int n , RoundingMode mode ) { } } | BigDecimal result = toBigDecimal ( ) . setScale ( n , mode ) ; return PackedDecimal . valueOf ( result ) ; |
public class AbstractRemoveTask { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . cache . xalist . Task # commitStage1 ( com . ibm . ws . sib . msgstore . Transaction ) */
public final void commitInternal ( final PersistentTransaction transaction ) throws SevereMessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "commitInternal" , transaction ) ; getLink ( ) . commitRemove ( transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commitInternal" ) ; |
public class QueryExecutionContextMarshaller { /** * Marshall the given parameter object . */
public void marshall ( QueryExecutionContext queryExecutionContext , ProtocolMarshaller protocolMarshaller ) { } } | if ( queryExecutionContext == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( queryExecutionContext . getDatabase ( ) , DATABASE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class BaseNCodec { /** * Calculates the amount of space needed to encode the supplied array .
* @ param pArray byte [ ] array which will later be encoded
* @ return amount of space needed to encoded the supplied array .
* Returns a long since a max - len array will require > Integer . MAX _ VALUE */
public long getEncodedLength ( final byte [ ] pArray ) { } } | // Calculate non - chunked size - rounded up to allow for padding
// cast to long is needed to avoid possibility of overflow
long len = ( ( pArray . length + unencodedBlockSize - 1 ) / unencodedBlockSize ) * ( long ) encodedBlockSize ; if ( lineLength > 0 ) { // We ' re using chunking
// Round up to nearest multiple
len += ( ( len + lineLength - 1 ) / lineLength ) * chunkSeparatorLength ; } return len ; |
public class pqpolicy { /** * Use this API to fetch filtered set of pqpolicy resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static pqpolicy [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | pqpolicy obj = new pqpolicy ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; pqpolicy [ ] response = ( pqpolicy [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class FullTextLinkList { /** * indexed getter for fullTextLinks - gets an indexed value -
* @ generated
* @ param i index in the array to get
* @ return value of the element at index i */
public FullTextLink getFullTextLinks ( int i ) { } } | if ( FullTextLinkList_Type . featOkTst && ( ( FullTextLinkList_Type ) jcasType ) . casFeat_fullTextLinks == null ) jcasType . jcas . throwFeatMissing ( "fullTextLinks" , "de.julielab.jules.types.FullTextLinkList" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) , i ) ; return ( FullTextLink ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FullTextLinkList_Type ) jcasType ) . casFeatCode_fullTextLinks ) , i ) ) ) ; |
public class WeakObjectRegistry { /** * Registers an object in the meta model if it is not already registered .
* @ param object
* The object to register .
* @ return The id of the object . It doesn ' t matter if the object was just registered or already known . */
public UUID registerIfUnknown ( final Object object ) { } } | final Optional < UUID > id = getId ( object ) ; if ( ! id . isPresent ( ) ) { return registerObject ( object ) ; } return id . get ( ) ; |
public class Graph { /** * Function that checks whether a Graph is a valid Graph ,
* as defined by the given { @ link GraphValidator } .
* @ return true if the Graph is valid . */
public Boolean validate ( GraphValidator < K , VV , EV > validator ) throws Exception { } } | return validator . validate ( this ) ; |
public class JDKLoggingRouter { /** * Calls the { @ link Logger } for the given clazz .
* @ param logLevel the log level
* @ param message the to be logged message
* @ param clazz the originating class */
@ Override public void logMessage ( LogLevel logLevel , String message , Class clazz , String methodName ) { } } | Logger logger = Logger . getLogger ( clazz . getName ( ) ) ; logger . logp ( convertToJDK14Level ( logLevel ) , clazz . getName ( ) , methodName , message ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.