diff options
author | Stefan Seelmann <mail@stefan-seelmann.de> | 2021-05-16 15:43:22 +0300 |
---|---|---|
committer | Stefan Seelmann <mail@stefan-seelmann.de> | 2021-05-16 15:43:22 +0300 |
commit | 738bc78cbb8b1f9a32008b2924d23accc3cc6f2a (patch) | |
tree | b80a1f9ef1f838a2b0fa1fbac7ad2032d46f9289 /plugins | |
parent | ab7433beccac0665d446daf39111f674f9d1d834 (diff) |
DIRSTUDIO-1273, DIRSTUDIO-1276: Fix illegal reflective access and fix logs views with Java 16+
Diffstat (limited to 'plugins')
5 files changed, 137 insertions, 181 deletions
diff --git a/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/ILdapLogger.java b/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/ILdapLogger.java index d9adcbb73..8d561864e 100644 --- a/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/ILdapLogger.java +++ b/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/ILdapLogger.java @@ -35,6 +35,7 @@ import org.apache.directory.api.util.Strings; import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod; import org.apache.directory.studio.connection.core.io.StudioLdapException; import org.apache.directory.studio.connection.core.io.api.StudioSearchResult; +import org.eclipse.core.runtime.Platform; /** @@ -223,13 +224,13 @@ public interface ILdapLogger { Set<String> maskedAttributes = new HashSet<String>(); - String maskedAttributeString = ConnectionCorePlugin.getDefault().getPluginPreferences().getString( - ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_MASKED_ATTRIBUTES ); + String maskedAttributeString = Platform.getPreferencesService().getString( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_MASKED_ATTRIBUTES, "", null ); String[] splitted = maskedAttributeString.split( "," ); //$NON-NLS-1$ for ( String s : splitted ) { - maskedAttributes.add( Strings.toLowerCase( s ) ); + maskedAttributes.add( Strings.toLowerCaseAscii( s ) ); } return maskedAttributes; diff --git a/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifModificationLogger.java b/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifModificationLogger.java index 3d8895de4..c0c6c706e 100644 --- a/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifModificationLogger.java +++ b/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifModificationLogger.java @@ -23,14 +23,15 @@ package org.apache.directory.studio.connection.core.io.api; import java.io.File; import java.io.IOException; -import java.lang.reflect.Field; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.StringJoiner; import java.util.logging.FileHandler; import java.util.logging.Formatter; import java.util.logging.Handler; @@ -70,8 +71,9 @@ import org.apache.directory.studio.ldifparser.model.lines.LdifModSpecSepLine; import org.apache.directory.studio.ldifparser.model.lines.LdifNewrdnLine; import org.apache.directory.studio.ldifparser.model.lines.LdifNewsuperiorLine; import org.apache.directory.studio.ldifparser.model.lines.LdifSepLine; -import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; -import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; /** @@ -97,52 +99,48 @@ public class LdifModificationLogger implements ILdapLogger /** The loggers. */ private Map<String, Logger> loggers = new HashMap<String, Logger>(); - /** * Creates a new instance of LdifModificationLogger. */ public LdifModificationLogger() { - ConnectionCorePlugin.getDefault().getPluginPreferences().addPropertyChangeListener( - new IPropertyChangeListener() + IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode( ConnectionCoreConstants.PLUGIN_ID ); + prefs.addPreferenceChangeListener( event -> { + if ( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_COUNT.equals( event.getKey() ) + || ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_SIZE.equals( event.getKey() ) ) { - public void propertyChange( PropertyChangeEvent event ) + // dispose all loggers/handlers + for ( Logger logger : loggers.values() ) { - if ( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_COUNT.equals( event.getProperty() ) - || ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_SIZE.equals( event.getProperty() ) ) + for ( Handler handler : logger.getHandlers() ) { - // dispose all loggers/handlers - for ( Logger logger : loggers.values() ) - { - for ( Handler handler : logger.getHandlers() ) - { - handler.close(); - } - } + handler.close(); + } + } - // delete files with index greater than new file count - for ( FileHandler fh : fileHandlers.values() ) + // delete files with index greater than new file count + Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager().getConnections(); + for ( Connection connection : connections ) + { + try + { + File[] logFiles = getLogFiles( connection ); + for ( int i = getFileCount(); i < logFiles.length; i++ ) { - try - { - File[] logFiles = getLogFiles( fh ); - for ( int i = getFileCount(); i < logFiles.length; i++ ) - { - if ( logFiles[i] != null && logFiles[i].exists() ) - { - logFiles[i].delete(); - } - } - } - catch ( Exception e ) + if ( logFiles[i] != null && logFiles[i].exists() ) { + logFiles[i].delete(); } } - - loggers.clear(); + } + catch ( Exception e ) + { } } - } ); + + loggers.clear(); + } + } ); } @@ -214,28 +212,26 @@ public class LdifModificationLogger implements ILdapLogger if ( loggers.containsKey( id ) ) { - Logger logger = loggers.get( id ); + StringJoiner lines = new StringJoiner( "" ); DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT ); df.setTimeZone( ConnectionCoreConstants.UTC_TIME_ZONE ); if ( ex != null ) { - logger.log( Level.ALL, LdifCommentLine + lines.add( LdifCommentLine .create( "#!RESULT ERROR" ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ } else { - logger.log( Level.ALL, LdifCommentLine + lines.add( LdifCommentLine .create( "#!RESULT OK" ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ } - logger - .log( - Level.ALL, - LdifCommentLine - .create( "#!CONNECTION ldap://" + connection.getHost() + ":" + connection.getPort() ) //$NON-NLS-1$//$NON-NLS-2$ - .toFormattedString( LdifFormatParameters.DEFAULT ) ); - logger.log( Level.ALL, LdifCommentLine + lines.add( + LdifCommentLine + .create( "#!CONNECTION ldap://" + connection.getHost() + ":" + connection.getPort() ) //$NON-NLS-1$//$NON-NLS-2$ + .toFormattedString( LdifFormatParameters.DEFAULT ) ); + lines.add( LdifCommentLine .create( "#!DATE " + df.format( new Date() ) ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ if ( ex != null ) @@ -244,10 +240,12 @@ public class LdifModificationLogger implements ILdapLogger errorComment = errorComment.replaceAll( "\r", " " ); //$NON-NLS-1$ //$NON-NLS-2$ errorComment = errorComment.replaceAll( "\n", " " ); //$NON-NLS-1$ //$NON-NLS-2$ LdifCommentLine errorCommentLine = LdifCommentLine.create( errorComment ); - logger.log( Level.ALL, errorCommentLine.toFormattedString( LdifFormatParameters.DEFAULT ) ); + lines.add( errorCommentLine.toFormattedString( LdifFormatParameters.DEFAULT ) ); } - logger.log( Level.ALL, text ); + lines.add( text ); + Logger logger = loggers.get( id ); + logger.log( Level.ALL, lines.toString() ); } } @@ -255,7 +253,8 @@ public class LdifModificationLogger implements ILdapLogger /** * {@inheritDoc} */ - public void logChangetypeAdd( Connection connection, final Entry entry, final Control[] controls, StudioLdapException ex ) + public void logChangetypeAdd( Connection connection, final Entry entry, final Control[] controls, + StudioLdapException ex ) { if ( !isModificationLogEnabled() ) { @@ -271,7 +270,7 @@ public class LdifModificationLogger implements ILdapLogger String attributeName = attribute.getUpId(); for ( Value value : attribute ) { - if ( maskedAttributes.contains( Strings.toLowerCase( attributeName ) ) ) + if ( maskedAttributes.contains( Strings.toLowerCaseAscii( attributeName ) ) ) { record.addAttrVal( LdifAttrValLine.create( attributeName, "**********" ) ); //$NON-NLS-1$ } @@ -351,7 +350,7 @@ public class LdifModificationLogger implements ILdapLogger } for ( Value value : item.getAttribute() ) { - if ( maskedAttributes.contains( Strings.toLowerCase( attributeName ) ) ) + if ( maskedAttributes.contains( Strings.toLowerCaseAscii( attributeName ) ) ) { modSpec.addAttrVal( LdifAttrValLine.create( attributeName, "**********" ) ); //$NON-NLS-1$ } @@ -411,7 +410,7 @@ public class LdifModificationLogger implements ILdapLogger * @param record the recored * @param controls the controls */ - private static void addControlLines( LdifChangeRecord record,Control[] controls ) + private static void addControlLines( LdifChangeRecord record, Control[] controls ) { if ( controls != null ) { @@ -447,7 +446,7 @@ public class LdifModificationLogger implements ILdapLogger try { - return getLogFiles( fileHandlers.get( id ) ); + return getLogFiles( connection ); } catch ( Exception e ) { @@ -462,51 +461,30 @@ public class LdifModificationLogger implements ILdapLogger * @param fileHandler the file handler * * @return the log files - * - * @throws Exception the exception */ - private static File[] getLogFiles( FileHandler fileHandler ) throws Exception + private static File[] getLogFiles( Connection connection ) { - Field field = getFieldFromClass( "java.util.logging.FileHandler", "files" ); //$NON-NLS-1$ //$NON-NLS-2$ - field.setAccessible( true ); - File[] files = ( File[] ) field.get( fileHandler ); + String logfileNamePattern = ConnectionManager.getModificationLogFileName( connection ); + File file = new File( logfileNamePattern ); + String pattern = file.getName().replace( "%u", "\\d+" ).replace( "%g", "\\d+" ); + File dir = file.getParentFile(); + File[] files = dir.listFiles( ( d, f ) -> { + return f.matches( pattern ); + } ); + Arrays.sort( files ); return files; } /** - * Gets the field from class. - * - * @param className the class name - * @param fieldName the field name - * - * @return the field from class - * - * @throws Exception the exception - */ - private static Field getFieldFromClass( String className, String fieldName ) throws Exception - { - Class<?> clazz = Class.forName( className ); - Field[] fields = clazz.getDeclaredFields(); - - for ( int i = 0; i < fields.length; i++ ) - { - if ( fields[i].getName().equals( fieldName ) ) - return fields[i]; - } - return null; - } - - - /** * Checks if modification log is enabled. * * @return true, if modification log is enabled */ private boolean isModificationLogEnabled() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getBoolean( - ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE ); + return Platform.getPreferencesService().getBoolean( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE, true, null ); } @@ -517,8 +495,8 @@ public class LdifModificationLogger implements ILdapLogger */ private int getFileCount() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getInt( - ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_COUNT ); + return Platform.getPreferencesService().getInt( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_COUNT, 10, null ); } @@ -529,8 +507,8 @@ public class LdifModificationLogger implements ILdapLogger */ private int getFileSizeInKb() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getInt( - ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_SIZE ); + return Platform.getPreferencesService().getInt( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_FILE_SIZE, 100, null ); } diff --git a/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifSearchLogger.java b/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifSearchLogger.java index 241adb764..f20e04895 100644 --- a/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifSearchLogger.java +++ b/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/LdifSearchLogger.java @@ -23,15 +23,16 @@ package org.apache.directory.studio.connection.core.io.api; import java.io.File; import java.io.IOException; -import java.lang.reflect.Field; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.StringJoiner; import java.util.logging.FileHandler; import java.util.logging.Formatter; import java.util.logging.Handler; @@ -65,8 +66,9 @@ import org.apache.directory.studio.ldifparser.model.lines.LdifCommentLine; import org.apache.directory.studio.ldifparser.model.lines.LdifDnLine; import org.apache.directory.studio.ldifparser.model.lines.LdifLineBase; import org.apache.directory.studio.ldifparser.model.lines.LdifSepLine; -import org.eclipse.core.runtime.Preferences.IPropertyChangeListener; -import org.eclipse.core.runtime.Preferences.PropertyChangeEvent; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; /** @@ -92,52 +94,48 @@ public class LdifSearchLogger implements ILdapLogger /** The loggers. */ private Map<String, Logger> loggers = new HashMap<String, Logger>(); - /** * Creates a new instance of LdifSearchLogger. */ public LdifSearchLogger() { - ConnectionCorePlugin.getDefault().getPluginPreferences().addPropertyChangeListener( - new IPropertyChangeListener() + IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode( ConnectionCoreConstants.PLUGIN_ID ); + prefs.addPreferenceChangeListener( event -> { + if ( ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_COUNT.equals( event.getKey() ) + || ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_SIZE.equals( event.getKey() ) ) { - public void propertyChange( PropertyChangeEvent event ) + // dispose all loggers/handlers + for ( Logger logger : loggers.values() ) { - if ( ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_COUNT.equals( event.getProperty() ) - || ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_SIZE.equals( event.getProperty() ) ) + for ( Handler handler : logger.getHandlers() ) { - // dispose all loggers/handlers - for ( Logger logger : loggers.values() ) - { - for ( Handler handler : logger.getHandlers() ) - { - handler.close(); - } - } + handler.close(); + } + } - // delete files with index greater than new file count - for ( FileHandler fh : fileHandlers.values() ) + // delete files with index greater than new file count + Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager().getConnections(); + for ( Connection connection : connections ) + { + try + { + File[] logFiles = getLogFiles( connection ); + for ( int i = getFileCount(); i < logFiles.length; i++ ) { - try - { - File[] logFiles = getLogFiles( fh ); - for ( int i = getFileCount(); i < logFiles.length; i++ ) - { - if ( logFiles[i] != null && logFiles[i].exists() ) - { - logFiles[i].delete(); - } - } - } - catch ( Exception e ) + if ( logFiles[i] != null && logFiles[i].exists() ) { + logFiles[i].delete(); } } - - loggers.clear(); + } + catch ( Exception e ) + { } } - } ); + + loggers.clear(); + } + } ); } @@ -209,29 +207,27 @@ public class LdifSearchLogger implements ILdapLogger if ( loggers.containsKey( id ) ) { - Logger logger = loggers.get( id ); + StringJoiner lines = new StringJoiner( "" ); DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT ); df.setTimeZone( ConnectionCoreConstants.UTC_TIME_ZONE ); if ( ex != null ) { - logger.log( Level.ALL, LdifCommentLine - .create( "#!" + type + " ERROR" ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ //$NON-NLS-2$ + lines.add( LdifCommentLine.create( "#!" + type + " ERROR" ) //$NON-NLS-1$//$NON-NLS-2$ + .toFormattedString( LdifFormatParameters.DEFAULT ) ); } else { - logger.log( Level.ALL, LdifCommentLine - .create( "#!" + type + " OK" ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ //$NON-NLS-2$ + lines.add( LdifCommentLine.create( "#!" + type + " OK" ) //$NON-NLS-1$ //$NON-NLS-2$ + .toFormattedString( LdifFormatParameters.DEFAULT ) ); } - logger - .log( - Level.ALL, - LdifCommentLine - .create( "#!CONNECTION ldap://" + connection.getHost() + ":" + connection.getPort() ) //$NON-NLS-1$//$NON-NLS-2$ - .toFormattedString( LdifFormatParameters.DEFAULT ) ); - logger.log( Level.ALL, LdifCommentLine - .create( "#!DATE " + df.format( new Date() ) ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ + lines.add( + LdifCommentLine + .create( "#!CONNECTION ldap://" + connection.getHost() + ":" + connection.getPort() ) //$NON-NLS-1$//$NON-NLS-2$ + .toFormattedString( LdifFormatParameters.DEFAULT ) ); + lines.add( LdifCommentLine.create( "#!DATE " + df.format( new Date() ) ) //$NON-NLS-1$ + .toFormattedString( LdifFormatParameters.DEFAULT ) ); if ( ex != null ) { @@ -239,10 +235,12 @@ public class LdifSearchLogger implements ILdapLogger errorComment = errorComment.replaceAll( "\r", " " ); //$NON-NLS-1$ //$NON-NLS-2$ errorComment = errorComment.replaceAll( "\n", " " ); //$NON-NLS-1$ //$NON-NLS-2$ LdifCommentLine errorCommentLine = LdifCommentLine.create( errorComment ); - logger.log( Level.ALL, errorCommentLine.toFormattedString( LdifFormatParameters.DEFAULT ) ); + lines.add( errorCommentLine.toFormattedString( LdifFormatParameters.DEFAULT ) ); } - logger.log( Level.ALL, text ); + lines.add( text ); + Logger logger = loggers.get( id ); + logger.log( Level.ALL, lines.toString() ); } } @@ -334,7 +332,7 @@ public class LdifSearchLogger implements ILdapLogger String attributeName = attribute.getUpId(); for ( Value value : attribute ) { - if ( maskedAttributes.contains( Strings.toLowerCase( attributeName ) ) ) + if ( maskedAttributes.contains( Strings.toLowerCaseAscii( attributeName ) ) ) { record.addAttrVal( LdifAttrValLine.create( attributeName, "**********" ) ); //$NON-NLS-1$ } @@ -431,7 +429,7 @@ public class LdifSearchLogger implements ILdapLogger try { - return getLogFiles( fileHandlers.get( id ) ); + return getLogFiles( connection ); } catch ( Exception e ) { @@ -446,51 +444,30 @@ public class LdifSearchLogger implements ILdapLogger * @param fileHandler the file handler * * @return the log files - * - * @throws Exception the exception */ - private static File[] getLogFiles( FileHandler fileHandler ) throws Exception + private static File[] getLogFiles( Connection connection ) { - Field field = getFieldFromClass( "java.util.logging.FileHandler", "files" ); //$NON-NLS-1$ //$NON-NLS-2$ - field.setAccessible( true ); - File[] files = ( File[] ) field.get( fileHandler ); + String logfileNamePattern = ConnectionManager.getSearchLogFileName( connection ); + File file = new File( logfileNamePattern ); + String pattern = file.getName().replace( "%u", "\\d+" ).replace( "%g", "\\d+" ); + File dir = file.getParentFile(); + File[] files = dir.listFiles( ( d, f ) -> { + return f.matches( pattern ); + } ); + Arrays.sort( files ); return files; } /** - * Gets the field from class. - * - * @param className the class name - * @param fieldName the field name - * - * @return the field from class - * - * @throws Exception the exception - */ - private static Field getFieldFromClass( String className, String fieldName ) throws Exception - { - Class<?> clazz = Class.forName( className ); - Field[] fields = clazz.getDeclaredFields(); - - for ( int i = 0; i < fields.length; i++ ) - { - if ( fields[i].getName().equals( fieldName ) ) - return fields[i]; - } - return null; - } - - - /** * Checks if search request log is enabled. * * @return true, if search request log is enabled */ private boolean isSearchRequestLogEnabled() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getBoolean( - ConnectionCoreConstants.PREFERENCE_SEARCHREQUESTLOGS_ENABLE ); + return Platform.getPreferencesService().getBoolean( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_SEARCHREQUESTLOGS_ENABLE, true, null ); } @@ -501,8 +478,8 @@ public class LdifSearchLogger implements ILdapLogger */ private boolean isSearchResultEntryLogEnabled() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getBoolean( - ConnectionCoreConstants.PREFERENCE_SEARCHRESULTENTRYLOGS_ENABLE ); + return Platform.getPreferencesService().getBoolean( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_SEARCHRESULTENTRYLOGS_ENABLE, false, null ); } @@ -513,8 +490,8 @@ public class LdifSearchLogger implements ILdapLogger */ private int getFileCount() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getInt( - ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_COUNT ); + return Platform.getPreferencesService().getInt( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_COUNT, 10, null ); } @@ -525,8 +502,8 @@ public class LdifSearchLogger implements ILdapLogger */ private int getFileSizeInKb() { - return ConnectionCorePlugin.getDefault().getPluginPreferences().getInt( - ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_SIZE ); + return Platform.getPreferencesService().getInt( ConnectionCoreConstants.PLUGIN_ID, + ConnectionCoreConstants.PREFERENCE_SEARCHLOGS_FILE_SIZE, 100, null ); } diff --git a/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ClearAction.java b/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ClearAction.java index ba18adaba..f6086c516 100644 --- a/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ClearAction.java +++ b/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ClearAction.java @@ -96,8 +96,8 @@ public class ClearAction extends BrowserAction Messages.getString( "ClearAction.Delete" ), Messages.getString( "ClearAction.DeleteAllLogFiles" ) ) ) //$NON-NLS-1$ //$NON-NLS-2$
{
view.getUniversalListener().clearInput();
+ new RefreshAction( view ).run();
}
-
}
diff --git a/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/searchlogs/ClearAction.java b/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/searchlogs/ClearAction.java index bac29d736..296acb471 100644 --- a/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/searchlogs/ClearAction.java +++ b/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/searchlogs/ClearAction.java @@ -97,8 +97,8 @@ public class ClearAction extends BrowserAction Messages.getString( "ClearAction.Delete" ), Messages.getString( "ClearAction.DeleteAllLogFiles" ) ) ) //$NON-NLS-1$ //$NON-NLS-2$
{
view.getUniversalListener().clearInput();
+ new RefreshAction( view ).run();
}
-
}
|