36 Commits
Author SHA1 Message Date
Jan Kotas 447cb03399 Delete unnecessary abstraction from stubbed out SecurityElement (#27474)
The stubbed out SecurityElement implementation does not support extensibility that ISecurityElementFactory was designed for.

Signed-off-by: dotnet-bot <[email protected]>
2019-10-29 23:34:11 +01:00
Jan Kotas 64c3405594 Cleanup memory copy helpers (dotnet/coreclr#27307)
- Merge RuntimeImports that has just a few FCalls into Buffer.
- Delete assembly implementation of memcpy for ARM. The implementation was outdated and it was used only on Windows ARM and only for fraction of memcpy callsites.
- Delete unnecessary PInvoke into SysStringLen. We have a managed equivalent on System.Runtime.InteropServices.Marshal.
- Delete large amount of redundant code between SecureString.Windows.cs and SecureString.Unix.cs, and switch SecureString to use Spans
- Fold null check into IsWin32Atom

Signed-off-by: dotnet-bot <[email protected]>
2019-10-22 09:46:29 -04:00
Stephen Toub 670738b55f Use const internally in corelib for Environment.NewLine (#27013)
Signed-off-by: dotnet-bot <[email protected]>
2019-10-05 14:09:54 +02:00
Stephen Toub c256e409c9 More Corelib cleanup (dotnet/coreclr#26872)
* Remove unnecessary asserts

* Make several classes static

* Use is instead of as+null check

* Use T? instead of Nullable<T>

* more static classes

* Mark locals as const

* Merge declaration and initialization of some variables

* Remove unnecessary casts

* Remove unnecessary "unsafe"s

* Simplify several lambda expressions

* Remove redundant parentheses

* Remove redundant '== true'

* Remove redundant empty lines

* Simplify boolean comparison with '== false'

* Replace if-statement with return statement

* Use while for infinite loop

* Add static to all partial static class declarations

* Use ++/-- operator instead of assignment

* Use string.IsNullOrEmpty

* Use coalesce expression

* Simplify lazy initialization

* Use coalese expression

* Join string expressions

* Use regular string literal instead of verbatim string literal

* Optimize StringBuilder.Append calls

* Remove redundant assignment

* Remove unnecessary unsafe context

* Merge processor directives

* Use String.Equals instead of String.Compare

* Use Debug.Fail instead of Debug.Assert(false

* Remove Attribute suffix

* Use predefined type

* Use compound assignment

* Use while statement to create an infinite loop

* Remove redundant base ctor call

* Avoid using catch (Exception)

* Remove empty regions

* Span comparison to null

* Avoid unnecessary boxing of value type

* Expression is always equal to 'true'

* Remove unused method

* update coalesce assignment

* fix unsafe

* fix redundant parens

* Fix whitespace errors introduced

Signed-off-by: dotnet-bot <[email protected]>
2019-09-25 20:13:47 +02:00
Dotnet-GitSync-Bot 381c187df9 Mirror changes from mono/coreclr (#16713)
* Remove stale SuppressMessage attributes (dotnet/coreclr#26501)

Signed-off-by: dotnet-bot <[email protected]>

* Use null coalescing assignment operator in more places

There's currently no auto-fix for this, so the fixes were done manually.

Signed-off-by: dotnet-bot <[email protected]>

* Fix IDE0026 (use expression-bodied members for indexers)

Signed-off-by: dotnet-bot <[email protected]>
2019-09-06 15:58:38 -04:00
Stephen ToubandAdam Sitnik ff7dd88cfa Use expression-bodied members in more places (dotnet/coreclr#26500)
* Fix IDE0027 (use expression body for accessors)

* Fix IDE0023 / IDE0024 (use expression body for operators)

* Apply suggestions from code review

Co-Authored-By: Adam Sitnik <[email protected]>

Signed-off-by: dotnet-bot <[email protected]>
2019-09-05 10:46:55 +02:00
Stephen Toub f5a1fa4744 Fix IDE0034 (simplify default expression)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-22 20:21:18 +02:00
Stephen Toub 5f38497e19 Remove unused usings from Corlib (dotnet/coreclr#26250)
* Fix IDE0065 (misplaced using)

* Fix IDE0005 (remove unnecessary usings)

Signed-off-by: dotnet-bot <[email protected]>
2019-08-20 19:45:30 +02:00
Stephen Toub c48dd0608d Fix IDE0025 (use expression body for properties)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub c8eb6972b5 Fix IDE0060 (unused parameter)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub 20adb69c73 Fix IDE0008 (use explicit type instead of var)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-18 07:01:54 +02:00
Stephen Toub d82bc555c9 Contribute to IDE0019 (use pattern matching) and IDE0066 (use switch expression)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-13 21:35:04 +02:00
Stephen Toub 86a0ad2f88 Fix FxCop warning CA1823 (unused fields)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub 442e9ad144 Fix StyleCop warning SA1206 (modifer ordering)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-09 16:23:42 +02:00
Stephen Toub da2c1cde97 Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 23:44:46 +02:00
Stephen Toub c189afd4f5 Delete PROJECTN ifdefs from Corelib (dotnet/coreclr#26058)
Signed-off-by: dotnet-bot <[email protected]>
2019-08-08 10:10:47 +02:00
Marek Safar ad3150a5c5 Convert PermissionSet NIE to PlatformNotSupportedException (#25114)
Signed-off-by: dotnet-bot <[email protected]>
2019-06-13 08:49:27 +02:00
Santiago Fernandez Madero 355d611e94 Address nullable feedback for System.Runtime and System.Runtime.Extensions (#25017)
* Address last nullable feedback from System.Runtime

* Address nullable feedback for System.Runtime.Extensions

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-06-07 23:17:51 +02:00
Stephen Toub 0130eaecb8 Fix netstandard build for nullable annotations
Signed-off-by: dotnet-bot <[email protected]>
2019-05-13 22:49:30 -07:00
Stephen Toub b31b703b89 Turn on nullability for all of Corelib (dotnet/coreclr#24497)
* Enable nullable at the project level

* Remove `#nullable enable` from individual files

Removes `#nullable enable` from almost all .cs files in System.Private.CoreLib. I left it only in the ~30 files (out of ~1480 that had it) that are mirrored to corefx, that are built into projects by corefx that don't yet set NullableContextOptions at the project level, and that use nullable annotations; otherwise, they'd break the corefx build.

Signed-off-by: dotnet-bot <[email protected]>
2019-05-10 10:51:17 +02:00
Krzysztof Wicher c8b4fc18c3 Nullable: System.Collections remainder (non-generic) (dotnet/coreclr#24326)
* Nullable: System.Collections remainder (non-generic)

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Santiago Fernandez Madero 8f883a789f Nullable: Comparers, Dictionary and Friends (dotnet/coreclr#23971)
* Nullable: Comparers, Dictionary and Friends

* Add object constraint to Dictionary

* Fix warning from new compiler and annotating dictionary

* PR Feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-05-02 20:34:11 +02:00
Stephen Toub f1901501e8 Nullable: Runtime serialization, COM, Vector, remaining IO, and other (#23895)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:42:05 +00:00
Stephen Toub 3418f9c1f8 Nullable: System (most of it) (dotnet/coreclr#23774)
* Nullable: shared\System (most of it)

And some other things it touches.

* Nullable: src\System (most of it)

* Address PR feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-22 16:32:38 +00:00
Krzysztof Wicher 0ff89565f5 Nullable: shared/System/Security (dotnet/coreclr#23623)
* Nullable: shared/System/Security

* fix windows

* address feedback

* IIIIdentity.Identity?

* apply feedback

Signed-off-by: dotnet-bot <[email protected]>
2019-04-09 13:28:15 -07:00
Krzysztof Wicher b7140b3a9e PermissionSet: follow netfx more in order to avoid workarounds with nullable (#23637)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-02 08:54:54 +02:00
Krzysztof Wicher 9bbfc63c4c Change PermissionSet.SyncRoot to return this instead of null (#23631)
Signed-off-by: dotnet-bot <[email protected]>
2019-04-02 08:36:39 +02:00
Nick Schonning 4b2c08e01b typo: Double word "are" (dotnet/corefx#36275)
Signed-off-by: dotnet-bot <[email protected]>
2019-03-25 09:44:44 +01:00
Michal Strehovsky 90bdd5da71 Fix missed RelocatedType annotation
[tfs-changeset: 1735855]

Signed-off-by: dotnet-bot <[email protected]>
2019-03-13 15:58:58 +01:00
Stephen Toub 6d8df4e7f3 Clean up some string.Format usage (dotnet/coreclr#23025)
* Clean up some string.Format usage

Mainly changes some string.Format usage to be SR.Format when working with resource strings.  Also cleans up a few asserts that were using string.Format.

* Address PR feedback and clean up src

* Address more feedback

* Update src/System.Private.CoreLib/shared/System/Type.Enum.cs

Thanks.

Co-Authored-By: stephentoub <[email protected]>
Signed-off-by: dotnet-bot <[email protected]>
2019-03-07 00:42:25 +01:00
Filip Navara d14b15f502 Move Thread to shared CoreLib (dotnet/coreclr#22744)
* Move Thread to shared CoreLib

* Remove all local variables from Thread in shared code

* Remove duplicate checks

* Port back CoreRT changes needed for shared code

* Fix missing culture initialization in ThreadStart()

* Adjust for shared WaitHandle

Signed-off-by: dotnet-bot <[email protected]>
2019-02-28 22:41:40 +01:00
Dotnet-GitSync-Bot 2b4bff1956 Mirror changes from mono/coreclr (#13192)
This PR contains mirrored changes from mono/coreclr


**Please REBASE this PR when merging**

 cc @grant-d
2019-02-26 23:59:38 +01:00
Filip Navara 5d36e4b2a7 Move Thread to shared CoreLib (dotnet/corefx#35462)
Signed-off-by: dotnet-bot <[email protected]>
2019-02-21 10:00:54 +01:00
Dotnet-GitSync-Bot f932a50d51 Mirror changes from mono/coreclr (#12635)
* Move Marshal::ZeroFree* to shared partition (dotnet/coreclr#22230)

* Move Marshal::ZeroFree* to shared partition

* Add managed version of SysStringByteLen

Signed-off-by: dotnet-bot <[email protected]>

* Remove duplicated code
2019-01-27 08:47:05 +01:00
Jan Kotas 1bd557004e Delete redundant S.R.InteropServices.PInvokeMap and S.R.InteropServices.PInvokeMarshal (#21831)
Signed-off-by: dotnet-bot <[email protected]>
2019-01-07 09:42:38 +01:00
dotnet bot ccd7b52ca8 Add System.Private.CoreLib shared sources (#12162)
Taken from corefx commit 5956ad35864352b38c53aa8c2d1ce012c96b168d. Subsequent updates will happen via a mirroring bot.
2018-12-20 18:51:17 +01:00