Skip to content

Commit 01a0d6e

Browse files
authored
#281 fix hints and warnings (#281)
* #281 fix hints and warnings * #281 simplify type names
1 parent edd722b commit 01a0d6e

File tree

120 files changed

+503
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+503
-503
lines changed

src/log4net/Appender/AdoNetAppender.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ namespace log4net.Appender;
4444
/// <para>
4545
/// Records are written into the database either using a prepared
4646
/// statement or a stored procedure. The <see cref="CommandType"/> property
47-
/// is set to <see cref="System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify a prepared statement
48-
/// or to <see cref="System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify a stored
47+
/// is set to <see cref="CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify a prepared statement
48+
/// or to <see cref="CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify a stored
4949
/// procedure.
5050
/// </para>
5151
/// <para>
@@ -254,14 +254,14 @@ public AdoNetAppender()
254254
/// </value>
255255
/// <remarks>
256256
/// <para>
257-
/// This value may be either <see cref="System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify
257+
/// This value may be either <see cref="CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify
258258
/// that the <see cref="CommandText"/> is a prepared statement to execute,
259-
/// or <see cref="System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify that the
259+
/// or <see cref="CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify that the
260260
/// <see cref="CommandText"/> property is the name of a stored procedure
261261
/// to execute.
262262
/// </para>
263263
/// <para>
264-
/// The default value is <see cref="System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>).
264+
/// The default value is <see cref="CommandType.Text"/> (<c>System.Data.CommandType.Text</c>).
265265
/// </para>
266266
/// </remarks>
267267
public CommandType CommandType { get; set; }
@@ -270,8 +270,8 @@ public AdoNetAppender()
270270
/// Should transactions be used to insert logging events in the database.
271271
/// </summary>
272272
/// <value>
273-
/// <c>true</c> if transactions should be used to insert logging events in
274-
/// the database, otherwise <c>false</c>. The default value is <c>true</c>.
273+
/// <see langword="true"/> if transactions should be used to insert logging events in
274+
/// the database, otherwise <see langword="false"/>. The default value is <see langword="true"/>.
275275
/// </value>
276276
/// <remarks>
277277
/// <para>
@@ -306,8 +306,8 @@ public AdoNetAppender()
306306
/// Should this appender try to reconnect to the database on error.
307307
/// </summary>
308308
/// <value>
309-
/// <c>true</c> if the appender should try to reconnect to the database after an
310-
/// error has occurred, otherwise <c>false</c>. The default value is <c>false</c>,
309+
/// <see langword="true"/> if the appender should try to reconnect to the database after an
310+
/// error has occurred, otherwise <see langword="false"/>. The default value is <see langword="false"/>,
311311
/// i.e. not to try to reconnect.
312312
/// </value>
313313
/// <remarks>
@@ -317,7 +317,7 @@ public AdoNetAppender()
317317
/// </para>
318318
/// <para>
319319
/// To force the appender to attempt to reconnect to the database set this
320-
/// property to <c>true</c>.
320+
/// property to <see langword="true"/>.
321321
/// </para>
322322
/// <note>
323323
/// When the appender attempts to connect to the database there may be a
@@ -458,7 +458,7 @@ protected override void SendBuffer(LoggingEvent[] events)
458458
/// <param name="events">The array of events to insert into the database.</param>
459459
/// <remarks>
460460
/// <para>
461-
/// The transaction argument can be <c>null</c> if the appender has been
461+
/// The transaction argument can be <see langword="null"/> if the appender has been
462462
/// configured not to use transactions. See <see cref="UseTransactions"/>
463463
/// property for more information.
464464
/// </para>
@@ -550,7 +550,7 @@ protected virtual void Prepare(IDbCommand dbCmd)
550550
/// more control over the format of the database statement.
551551
/// </remarks>
552552
/// <returns>
553-
/// Text that can be passed to a <see cref="System.Data.IDbCommand"/>.
553+
/// Text that can be passed to a <see cref="IDbCommand"/>.
554554
/// </returns>
555555
protected virtual string GetLogStatement(LoggingEvent logEvent)
556556
{
@@ -742,7 +742,7 @@ private void DisposeConnection()
742742
/// <remarks>
743743
/// <para>
744744
/// This class provides the basic database parameter properties
745-
/// as defined by the <see cref="System.Data.IDbDataParameter"/> interface.
745+
/// as defined by the <see cref="IDbDataParameter"/> interface.
746746
/// </para>
747747
/// <para>This type can be subclassed to provide database specific
748748
/// functionality. The two methods that are called externally are

src/log4net/Appender/AppenderSkeleton.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public abstract class AppenderSkeleton : IAppender, IBulkAppender, IOptionHandle
5959
/// </summary>
6060
/// <remarks>
6161
/// <para>
62-
/// If this appender has not been closed then the <c>Finalize</c> method
62+
/// If this appender has not been closed then the <see cref="Finalize"/> method
6363
/// will call <see cref="Close"/>.
6464
/// </para>
6565
/// </remarks>
@@ -236,7 +236,7 @@ public void Close()
236236
/// <item>
237237
/// <description>
238238
/// Calls <see cref="PreAppendCheck()"/> and checks that
239-
/// it returns <c>true</c>.</description>
239+
/// it returns <see langword="true"/>.</description>
240240
/// </item>
241241
/// </list>
242242
/// </para>
@@ -318,7 +318,7 @@ public void DoAppend(LoggingEvent loggingEvent)
318318
/// <item>
319319
/// <description>
320320
/// Calls <see cref="PreAppendCheck()"/> and checks that
321-
/// it returns <c>true</c>.</description>
321+
/// it returns <see langword="true"/>.</description>
322322
/// </item>
323323
/// </list>
324324
/// </para>
@@ -383,7 +383,7 @@ public void DoAppend(LoggingEvent[] loggingEvents)
383383
/// Test if the logging event should we output by this appender
384384
/// </summary>
385385
/// <param name="loggingEvent">the event to test</param>
386-
/// <returns><c>true</c> if the event should be output, <c>false</c> if the event should be ignored</returns>
386+
/// <returns><see langword="true"/> if the event should be output, <see langword="false"/> if the event should be ignored</returns>
387387
/// <remarks>
388388
/// <para>
389389
/// This method checks the logging event against the threshold level set
@@ -482,8 +482,8 @@ public virtual void AddFilter(IFilter filter)
482482
/// </summary>
483483
/// <param name="level"><see cref="Level"/> to test against.</param>
484484
/// <returns>
485-
/// <c>true</c> if the <paramref name="level"/> meets the <see cref="Threshold"/>
486-
/// requirements of this appender. A null level always maps to <c>true</c>,
485+
/// <see langword="true"/> if the <paramref name="level"/> meets the <see cref="Threshold"/>
486+
/// requirements of this appender. A null level always maps to <see langword="true"/>,
487487
/// the equivalent of <see cref="Level.All"/>.
488488
/// </returns>
489489
protected virtual bool IsAsSevereAsThreshold(Level? level) => level is null || level >= Threshold;
@@ -587,7 +587,7 @@ protected virtual void Append(IEnumerable<LoggingEvent> loggingEvents)
587587
/// this base class if it is overridden.
588588
/// </para>
589589
/// </remarks>
590-
/// <returns><c>true</c> if the call to <see cref="Append(LoggingEvent)"/> should proceed.</returns>
590+
/// <returns><see langword="true"/> if the call to <see cref="Append(LoggingEvent)"/> should proceed.</returns>
591591
protected virtual bool PreAppendCheck()
592592
{
593593
if ((Layout is null) && RequiresLayout)
@@ -698,14 +698,14 @@ protected void RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent)
698698
/// <para>
699699
/// In the rather exceptional case, where the appender
700700
/// implementation admits a layout but can also work without it,
701-
/// then the appender should return <c>true</c>.
701+
/// then the appender should return <see langword="true"/>.
702702
/// </para>
703703
/// <para>
704-
/// This default implementation always returns <c>false</c>.
704+
/// This default implementation always returns <see langword="false"/>.
705705
/// </para>
706706
/// </remarks>
707707
/// <returns>
708-
/// <c>true</c> if the appender requires a layout object, otherwise <c>false</c>.
708+
/// <see langword="true"/> if the appender requires a layout object, otherwise <see langword="false"/>.
709709
/// </returns>
710710
protected virtual bool RequiresLayout => false;
711711

@@ -715,7 +715,7 @@ protected void RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent)
715715
/// <remarks>
716716
/// This implementation doesn't flush anything and always returns true
717717
/// </remarks>
718-
/// <returns><c>True</c> if all logging events were flushed successfully, else <c>false</c>.</returns>
718+
/// <returns><see langword="true"/> if all logging events were flushed successfully, else <see langword="false"/>.</returns>
719719
public virtual bool Flush(int millisecondsTimeout) => true;
720720

721721
/// <summary>

src/log4net/Appender/BufferingAppenderSkeleton.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace log4net.Appender;
5656
/// The buffering appender can be configured in a <see cref="Lossy"/> mode.
5757
/// By default the appender is NOT lossy. When the buffer is full all
5858
/// the buffered events are sent with <see cref="SendBuffer(LoggingEvent[])"/>.
59-
/// If the <see cref="Lossy"/> property is set to <c>true</c> then the
59+
/// If the <see cref="Lossy"/> property is set to <see langword="true"/> then the
6060
/// buffer will not be sent when it is full, and new events arriving
6161
/// in the appender will overwrite the oldest event in the buffer.
6262
/// In lossy mode the buffer will only be sent when the <see cref="Evaluator"/>
@@ -87,7 +87,7 @@ protected BufferingAppenderSkeleton() : this(true)
8787
/// Initializes a new instance of the <see cref="BufferingAppenderSkeleton" /> class.
8888
/// </summary>
8989
/// <param name="eventMustBeFixed">the events passed through this appender must be
90-
/// fixed by the time that they arrive in the derived class' <c>SendBuffer</c> method.</param>
90+
/// fixed by the time that they arrive in the derived class' <see cref="SendBuffer"/> method.</param>
9191
/// <remarks>
9292
/// <para>
9393
/// Protected constructor to allow subclassing.
@@ -107,18 +107,18 @@ protected BufferingAppenderSkeleton(bool eventMustBeFixed)
107107
/// Gets or sets a value that indicates whether the appender is lossy.
108108
/// </summary>
109109
/// <value>
110-
/// <c>true</c> if the appender is lossy, otherwise <c>false</c>. The default is <c>false</c>.
110+
/// <see langword="true"/> if the appender is lossy, otherwise <see langword="false"/>. The default is <see langword="false"/>.
111111
/// </value>
112112
/// <remarks>
113113
/// <para>
114114
/// This appender uses a buffer to store logging events before
115115
/// delivering them. A triggering event causes the whole buffer
116116
/// to be sent to the remote sink. If the buffer overruns before
117117
/// a triggering event then logging events could be lost. Set
118-
/// <see cref="Lossy"/> to <c>false</c> to prevent logging events
118+
/// <see cref="Lossy"/> to <see langword="false"/> to prevent logging events
119119
/// from being lost.
120120
/// </para>
121-
/// <para>If <see cref="Lossy"/> is set to <c>true</c> then an
121+
/// <para>If <see cref="Lossy"/> is set to <see langword="true"/> then an
122122
/// <see cref="Evaluator"/> must be specified.</para>
123123
/// </remarks>
124124
public bool Lossy { get; set; }
@@ -162,7 +162,7 @@ protected BufferingAppenderSkeleton(bool eventMustBeFixed)
162162
/// appender. If the evaluator triggers then the current buffer will
163163
/// immediately be sent (see <see cref="SendBuffer(LoggingEvent[])"/>).
164164
/// </para>
165-
/// <para>If <see cref="Lossy"/> is set to <c>true</c> then an
165+
/// <para>If <see cref="Lossy"/> is set to <see langword="true"/> then an
166166
/// <see cref="Evaluator"/> must be specified.</para>
167167
/// </remarks>
168168
public ITriggeringEventEvaluator? Evaluator { get; set; }
@@ -202,7 +202,7 @@ protected BufferingAppenderSkeleton(bool eventMustBeFixed)
202202
/// Flushes any buffered log data.
203203
/// </summary>
204204
/// <param name="millisecondsTimeout">The maximum time to wait for logging events to be flushed.</param>
205-
/// <returns><c>True</c> if all logging events were flushed successfully, else <c>false</c>.</returns>
205+
/// <returns><see langword="true"/> if all logging events were flushed successfully, else <see langword="false"/>.</returns>
206206
public override bool Flush(int millisecondsTimeout)
207207
{
208208
Flush();
@@ -226,21 +226,21 @@ public override bool Flush(int millisecondsTimeout)
226226
/// <summary>
227227
/// Flush the currently buffered events
228228
/// </summary>
229-
/// <param name="flushLossyBuffer">set to <c>true</c> to flush the buffer of lossy events</param>
229+
/// <param name="flushLossyBuffer">set to <see langword="true"/> to flush the buffer of lossy events</param>
230230
/// <remarks>
231231
/// <para>
232232
/// Flushes events that have been buffered. If <paramref name="flushLossyBuffer" /> is
233-
/// <c>false</c> then events will only be flushed if this buffer is non-lossy mode.
233+
/// <see langword="false"/> then events will only be flushed if this buffer is non-lossy mode.
234234
/// </para>
235235
/// <para>
236236
/// If the appender is buffering in <see cref="Lossy"/> mode then the contents
237-
/// of the buffer will only be flushed if <paramref name="flushLossyBuffer" /> is <c>true</c>.
237+
/// of the buffer will only be flushed if <paramref name="flushLossyBuffer" /> is <see langword="true"/>.
238238
/// In this case the contents of the buffer will be tested against the
239239
/// <see cref="LossyEvaluator"/> and if triggering will be output. All other buffered
240240
/// events will be discarded.
241241
/// </para>
242242
/// <para>
243-
/// If <paramref name="flushLossyBuffer" /> is <c>true</c> then the buffer will always
243+
/// If <paramref name="flushLossyBuffer" /> is <see langword="true"/> then the buffer will always
244244
/// be emptied by calling this method.
245245
/// </para>
246246
/// </remarks>
@@ -262,7 +262,7 @@ public virtual void Flush(bool flushLossyBuffer)
262262
{
263263
// Test the contents of the buffer against the lossy evaluator
264264
LoggingEvent[] bufferedEvents = _cyclicBuffer.PopAll();
265-
var filteredEvents = new List<LoggingEvent>(bufferedEvents.Length);
265+
List<LoggingEvent> filteredEvents = new(bufferedEvents.Length);
266266

267267
foreach (LoggingEvent loggingEvent in bufferedEvents)
268268
{

src/log4net/Appender/BufferingForwardingAppender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public virtual AppenderCollection Appenders
138138
/// </summary>
139139
/// <param name="name">The name of the appender to lookup.</param>
140140
/// <returns>
141-
/// The appender with the specified name, or <c>null</c>.
141+
/// The appender with the specified name, or <see langword="null"/>.
142142
/// </returns>
143143
public virtual IAppender? GetAppender(string? name)
144144
{

src/log4net/Appender/ColoredConsoleAppender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public virtual string Target
181181
public void AddMapping(LevelColors mapping) => _levelMapping.Add(mapping);
182182

183183
/// <summary>
184-
/// This method is called by the <see cref="AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
184+
/// This method is called by the <see cref="AppenderSkeleton.DoAppend(LoggingEvent)"/> method.
185185
/// </summary>
186186
/// <param name="loggingEvent">The event to log.</param>
187187
/// <remarks>

src/log4net/Appender/DebugAppender.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class DebugAppender : AppenderSkeleton
4848
/// </summary>
4949
/// <remarks>
5050
/// <para>The default behavior is to flush at the end of each
51-
/// write. If the option is set to<c>false</c>, then the underlying
51+
/// write. If the option is set to<see langword="false"/>, then the underlying
5252
/// stream can defer writing to physical medium to a later time.
5353
/// </para>
5454
/// <para>
@@ -67,7 +67,7 @@ public class DebugAppender : AppenderSkeleton
6767
/// </summary>
6868
/// <remarks>
6969
/// <para>
70-
/// Defaults to a <see cref="Layout.PatternLayout"/> with %logger as the pattern which will use the logger name of the current
70+
/// Defaults to a <see cref="PatternLayout"/> with %logger as the pattern which will use the logger name of the current
7171
/// <see cref="LoggingEvent"/> as the category parameter.
7272
/// </para>
7373
/// </remarks>
@@ -77,7 +77,7 @@ public class DebugAppender : AppenderSkeleton
7777
/// Flushes any buffered log data.
7878
/// </summary>
7979
/// <param name="millisecondsTimeout">The maximum time to wait for logging events to be flushed.</param>
80-
/// <returns><c>True</c> if all logging events were flushed successfully, else <c>false</c>.</returns>
80+
/// <returns><see langword="true"/> if all logging events were flushed successfully, else <see langword="false"/>.</returns>
8181
public override bool Flush(int millisecondsTimeout)
8282
{
8383
// Nothing to do if ImmediateFlush is true
@@ -99,7 +99,7 @@ public override bool Flush(int millisecondsTimeout)
9999
/// <remarks>
100100
/// <para>
101101
/// Writes the logging event to the <see cref="System.Diagnostics.Debug"/> system.
102-
/// If <see cref="ImmediateFlush"/> is <c>true</c> then the <see cref="System.Diagnostics.Debug.Flush"/>
102+
/// If <see cref="ImmediateFlush"/> is <see langword="true"/> then the <see cref="System.Diagnostics.Debug.Flush"/>
103103
/// is called.
104104
/// </para>
105105
/// </remarks>

src/log4net/Appender/EventLogAppender.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ namespace log4net.Appender;
4242
/// on the <see cref="LoggingEvent"/>.
4343
/// </para>
4444
/// <para>
45-
/// The <c>Category</c> of the event log entry can be
46-
/// set using the <c>Category</c> property (<see cref="LoggingEvent.Properties"/>)
45+
/// The <see cref="Category"/> of the event log entry can be
46+
/// set using the <see cref="Category"/> property (<see cref="LoggingEvent.Properties"/>)
4747
/// on the <see cref="LoggingEvent"/>.
4848
/// </para>
4949
/// <para>
@@ -174,7 +174,7 @@ public EventLogAppender()
174174
public SecurityContext? SecurityContext { get; set; }
175175

176176
/// <summary>
177-
/// Gets or sets the <c>EventId</c> to use unless one is explicitly specified via the <c>LoggingEvent</c>'s properties.
177+
/// Gets or sets the <see cref="EventId"/> to use unless one is explicitly specified via the <c>LoggingEvent</c>'s properties.
178178
/// </summary>
179179
/// <remarks>
180180
/// <para>
@@ -188,12 +188,12 @@ public EventLogAppender()
188188

189189

190190
/// <summary>
191-
/// Gets or sets the <c>Category</c> to use unless one is explicitly specified via the <c>LoggingEvent</c>'s properties.
191+
/// Gets or sets the <see cref="Category"/> to use unless one is explicitly specified via the <c>LoggingEvent</c>'s properties.
192192
/// </summary>
193193
/// <remarks>
194194
/// <para>
195-
/// The <c>Category</c> of the event log entry will normally be
196-
/// set using the <c>Category</c> property (<see cref="LoggingEvent.Properties"/>)
195+
/// The <see cref="Category"/> of the event log entry will normally be
196+
/// set using the <see cref="Category"/> property (<see cref="LoggingEvent.Properties"/>)
197197
/// on the <see cref="LoggingEvent"/>.
198198
/// This property provides the fallback value which defaults to 0.
199199
/// </para>
@@ -287,7 +287,7 @@ public override void ActivateOptions()
287287
/// </summary>
288288
private static void CreateEventSource(string source, string logName, string machineName)
289289
{
290-
var eventSourceCreationData = new EventSourceCreationData(source, logName)
290+
EventSourceCreationData eventSourceCreationData = new(source, logName)
291291
{
292292
MachineName = machineName
293293
};
@@ -402,7 +402,7 @@ protected override void Append(LoggingEvent loggingEvent)
402402
/// <summary>
403403
/// This appender requires a <see cref="Layout"/> to be set.
404404
/// </summary>
405-
/// <value><c>true</c></value>
405+
/// <value><see langword="true"/></value>
406406
protected override bool RequiresLayout => true;
407407

408408
/// <summary>

src/log4net/Appender/ForwardingAppender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public virtual AppenderCollection Appenders
128128
/// </summary>
129129
/// <param name="name">The name of the appender to lookup.</param>
130130
/// <returns>
131-
/// The appender with the specified name, or <c>null</c>.
131+
/// The appender with the specified name, or <see langword="null"/>.
132132
/// </returns>
133133
/// <remarks>
134134
/// <para>

0 commit comments

Comments
 (0)