Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ConstructorParamShouldMatchPropNames analyzer #4877

Draft
wants to merge 64 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3dedbb2
Add ConstructorParamShouldMatchPropNames analyzer
psxvoid Feb 11, 2021
6dc3ef9
Fix - remove unused package reference
psxvoid Feb 24, 2021
6b71577
Fix json-ctor order in well-known-names
psxvoid Feb 24, 2021
52360bb
Fix code alignment in tests
psxvoid Feb 25, 2021
d9308a4
Mark the diagnostic as non-fx-cop-ported
psxvoid Feb 25, 2021
700c4ac
Add missing msbuild autogenerated assets
psxvoid Feb 25, 2021
d3769d6
Fix - remove unused package reference, part 2
psxvoid Feb 25, 2021
5c82803
Update rule's message
psxvoid Feb 25, 2021
43ad9b1
Rollback unrelated analyzer to the original state
psxvoid Feb 25, 2021
41d44b2
Update the description message for the analyzer
psxvoid Feb 26, 2021
e3db946
Fix misplaced comma and update the message
psxvoid Feb 26, 2021
e9bc939
Fix incorrect helper test method name prefix
psxvoid Feb 26, 2021
481f5ed
Update the message title with the recommended one
psxvoid Feb 26, 2021
93c0429
Use net50 references instead netstandard20 in tests
psxvoid Feb 26, 2021
3efee13
Replace IsJsonCtor extension-method with private method
psxvoid Feb 26, 2021
2b49119
Rename the analyzer - add "field" in its name
psxvoid Feb 26, 2021
c2051bf
Remove unused using in tests
psxvoid Feb 26, 2021
e9aa041
Replace banned-API with non-banned in tests
psxvoid Feb 27, 2021
9579d93
Add a code fix provider, partially tested with C#
psxvoid Feb 27, 2021
5a62547
[POC] Verify tuple assignment is working with CA1071
psxvoid Mar 1, 2021
33dccdd
Revert "[POC] Verify tuple assignment is working with CA1071"
psxvoid Mar 1, 2021
57437ba
Add C# tests for classes with fields and props
psxvoid Mar 1, 2021
727423b
Add VB tests for classes with fields and props
psxvoid Mar 1, 2021
6c83c6e
The analyzer - ensure bound properties are public
psxvoid Mar 3, 2021
2482c4c
Fix minor dis-alignment in tests
psxvoid Mar 3, 2021
d4bec8b
Fix tuple assignment reference not detected
psxvoid Mar 4, 2021
9089e0a
Simplify member reference retrieval
psxvoid Mar 4, 2021
5aff394
Merge reference symbol null and static checks
psxvoid Mar 4, 2021
5fba883
Rename local variable in member reference retrival
psxvoid Mar 4, 2021
cd373f6
Add tuple assignment test for records
psxvoid Mar 4, 2021
1fb8c27
Analyzer - group tests for records below tests for classes
psxvoid Mar 7, 2021
da07af5
Analyzer - sort tests for classes
psxvoid Mar 7, 2021
0c3e2a9
Analyzer - ensure bound fields are public
psxvoid Mar 7, 2021
2309cb0
Fix parameter alignment in analyzer tests
psxvoid Mar 7, 2021
7285658
Analyzer - add tests for private fields with JsonInclude
psxvoid Mar 8, 2021
52dce8e
Analyzer - add tests with JsonPropertyName
psxvoid Mar 8, 2021
c603b66
Analyzer - report unreferenced params (no messages)
psxvoid Mar 8, 2021
afb760a
Analyzer - add messages for unreferenced parameters
psxvoid Mar 8, 2021
4d30c8f
Analyzer - free unused parameter set on symbol-end
psxvoid Mar 8, 2021
641721d
Analyzer - sort methods by visibility and logically
psxvoid Mar 8, 2021
65ea1ad
Analyzer - fix reversed words match (should not)
psxvoid Mar 9, 2021
defb3c2
Analyzer - add regions, cleanup and organize tests
psxvoid Mar 9, 2021
d4345d5
Analyzer - simplify return in ShouldAnalyzerMethod
psxvoid Mar 9, 2021
2008be6
Analyzer - simplify supported members matching
psxvoid Mar 9, 2021
c0687c6
Add TODO - referenced members are not static diagnostic
psxvoid Mar 9, 2021
313bdfd
Analyzer - format compilation start action registration
psxvoid Mar 9, 2021
fa0fd41
Analyzer - merge name match logic into a single method
psxvoid Mar 9, 2021
4d4a1ec
Add "key" postfix to diagnostic parameter keys
psxvoid Mar 9, 2021
e059159
Analyzer - remove unused parameter analysis
psxvoid Jun 23, 2021
a95f803
Analyzer - init using scoped context variable
psxvoid Jun 23, 2021
1e62744
Analyzer - fix build: invalid whitespace in tests
psxvoid Jun 23, 2021
1e1d382
Analyzer - inline ExportFixProvider and Shared attributes
psxvoid Jun 28, 2021
9a727e4
Revert "Analyzer - inline ExportFixProvider and Shared attributes"
psxvoid Jun 28, 2021
8dacfcb
Fixer - inline ExportFixProvider and Shared attributes (fixed)
psxvoid Jun 28, 2021
ab492ca
Analyzer - use single diagnostic rule per analyzer
psxvoid Jun 28, 2021
b1deb98
CodeFix - make bound field public (no message, not aligned)
psxvoid Jul 8, 2021
2008bfe
Analyzer - remove unreferenced parameter diagnostic reason
psxvoid Jul 8, 2021
194c3a2
Analyzer - fix broken tests due to additional diagnostic location
psxvoid Jul 13, 2021
a487621
CodeFix - add tests for single private property
psxvoid Jul 13, 2021
f38390d
CodeFix - add tests for multiple private fields and props
psxvoid Jul 13, 2021
051d067
Analyzer - use "Add" instead of "SetItem"
psxvoid Jul 27, 2021
f86bf43
Analyzer - init jsonConstructorAttribute symbol using out var
psxvoid Jul 27, 2021
35b2346
Analyzer - Use ContainingType.Name instead of ToDisplayString
psxvoid Jul 27, 2021
aafe0de
Analyzer - Remove parentheses from lambda param while passing context
psxvoid Jul 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
; Please do not edit this file manually, it should only be updated through code fix application.
### New Rules
Rule ID | Category | Severity | Notes
--------|----------|----------|-------
CA1071 | Design | Warning | ConstructorParametersShouldMatchPropertyNamesAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1071)
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ private bool ShouldAnalyzeMethod(
}

// Ignore primary constructor (body-less) of positional records.
// TODO: I have to handle a similar situation
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To Do: remove

if (IsPositionalRecordPrimaryConstructor(method))
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1519,4 +1519,16 @@
<value>and all other platforms</value>
<comment>This call site is reachable on: 'windows' 10.0.2000 and later, and all other platforms</comment>
</data>
<data name="ConstructorParameterShouldMatchFieldName" xml:space="preserve">
<value>In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</value>
</data>
<data name="ConstructorParameterShouldMatchPropertyName" xml:space="preserve">
<value>In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</value>
</data>
<data name="ConstructorParametersShouldMatchPropertyNamesDescription" xml:space="preserve">
<value>Constructor parameters should match referenced property or field names.</value>
</data>
<data name="ConstructorParametersShouldMatchPropertyNamesTitle" xml:space="preserve">
<value>Constructor parameters should match referenced property and field names</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Analyzer.Utilities;
using Analyzer.Utilities.Extensions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;

namespace Microsoft.NetCore.Analyzers.Runtime
{
/// <summary>
/// CA1071: Constructor parameters should match property and field names
/// </summary>
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
public sealed class ConstructorParametersShouldMatchPropertyNamesAnalyzer : DiagnosticAnalyzer
{
internal const string RuleId = "CA1071";

private static readonly LocalizableString s_localizableTitle = new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ConstructorParametersShouldMatchPropertyNamesTitle), MicrosoftNetCoreAnalyzersResources.ResourceManager, typeof(MicrosoftNetCoreAnalyzersResources));

private static readonly LocalizableString s_localizableMessageProperty = new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ConstructorParameterShouldMatchPropertyName), MicrosoftNetCoreAnalyzersResources.ResourceManager, typeof(MicrosoftNetCoreAnalyzersResources));
private static readonly LocalizableString s_localizableMessageField = new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ConstructorParameterShouldMatchFieldName), MicrosoftNetCoreAnalyzersResources.ResourceManager, typeof(MicrosoftNetCoreAnalyzersResources));
private static readonly LocalizableString s_localizableDescription = new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ConstructorParametersShouldMatchPropertyNamesDescription), MicrosoftNetCoreAnalyzersResources.ResourceManager, typeof(MicrosoftNetCoreAnalyzersResources));

internal static DiagnosticDescriptor PropertyRule = DiagnosticDescriptorHelper.Create(RuleId,
s_localizableTitle,
s_localizableMessageProperty,
DiagnosticCategory.Design,
RuleLevel.BuildWarning,
description: s_localizableDescription,
isPortedFxCopRule: true,
isDataflowRule: false);
internal static DiagnosticDescriptor FieldRule = DiagnosticDescriptorHelper.Create(RuleId,
s_localizableTitle,
s_localizableMessageField,
DiagnosticCategory.Design,
RuleLevel.BuildWarning,
description: s_localizableDescription,
isPortedFxCopRule: true,
isDataflowRule: false);

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(PropertyRule, FieldRule);

public override void Initialize(AnalysisContext context)
{
context.EnableConcurrentExecution();
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);

context.RegisterCompilationStartAction(
(compilationStartContext) =>
{
INamedTypeSymbol? jsonConstructorAttributeNamedSymbol = compilationStartContext.Compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemTextJsonSerializationJsonConstructorAttribute);
if (jsonConstructorAttributeNamedSymbol == null)
{
return;
}

var paramAnalyzer = new ParameterAnalyzer(jsonConstructorAttributeNamedSymbol);

compilationStartContext.RegisterOperationBlockStartAction(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we need to analyze each operation block for checking a constructor, probably better to register symbol action for named types RegisterSymbolAction(AnalyzeSymbol, SymbolKind.NamedType) which would be fired for each symbol (type) declaration, from SymbolAnalysisContext you can access the symbol declared and get all constructors using INamedTypeSymbol.InstanceConstructors then could check if there is any constructor having [JsonConstructor] attribute.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried it before using the current approach. The idea was to reduce the overall amount of checks/calls the analyzer should do before matching a correct type (to have as low an impact on the performance as possible). I thought that RegisterOperationBlockStartAction in combination with RegisterOperationAction + OperationKind.ParameterReference may be more performant than checking every SymbolKind.NamedType. But I might be wrong because I haven't measured the performance yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to reduce the overall amount of checks/calls the analyzer should do before matching a correct type (to have as low an impact on the performance as possible)

Thanks, that was my concert too, by my understanding operation, OperationBlockStartAction will be fired for each method definition, by accounting that methods are included within a type and a type could have many methods i guess there will be more methods than types (i.e NamedType). So i assume action registered by RegisterSymbolAction(AnalyzeSymbol, SymbolKind.NamedType) will be fired less than action registered with RegisterOperationBlockStartAction(...) therefore less checks will be performed, but i might wrong CC @mavasani

RegisterOperationBlockStartAction in combination with RegisterOperationAction + OperationKind.ParameterReference may be more performant than checking every SymbolKind.NamedType

I am not sure if it is counted as a combination of actions, i would assume first OperationBlockStartAction will be fired for each method block where your initial checks will be made then RegisterOperationAction + OperationKind.ParameterReference will be fired.

Instead with the RegisterSymbolAction you will not need to register any more action, everything you need to check come with the resulting NamedTypeSymbol

(startOperationBlockContext) =>
{
if (startOperationBlockContext.OwningSymbol is IMethodSymbol method
&& !paramAnalyzer.ShouldAnalyzeMethod(method))
{
return;
}

startOperationBlockContext.RegisterOperationAction(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will not need to register another action as you can access all parameters from the IMethodSymbol constructor object obtained above

context => ParameterAnalyzer.AnalyzeOperationAndReport(context),
OperationKind.ParameterReference);
});
});
}

private sealed class ParameterAnalyzer
{
private readonly INamedTypeSymbol _jsonConstructorAttributeInfoType;

public ParameterAnalyzer(INamedTypeSymbol jsonConstructorAttributeInfoType)
{
_jsonConstructorAttributeInfoType = jsonConstructorAttributeInfoType;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one method is using the field. I personally prefer this being as a static class with jsonConstructorAttributeType being passed to the only method needs it.


public static void AnalyzeOperationAndReport(OperationAnalysisContext context)
{
var operation = (IParameterReferenceOperation)context.Operation;

if (operation.Parent is not IAssignmentOperation assignment)
Copy link
Member

@Youssef1313 Youssef1313 Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely to fail for tuple assignments (deconstruction assignment) like (_x, _y) = (x, y);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether I've completely got your point, but it seems that tuple assignment works fine with it, see the following commit: [POC] Verify tuple assignment is working with CA1071

Field names you've mentioned do not match parameter names, JsonConstructor will throw a runtime exception. That's why diagnostic must still be reported anyway for this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psxvoid The tests in that commit are no diagnostic tests. I meant to confirm that diagnostic cases are working correctly for tuple assignments.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sorry, it doesn't work with tuple assignments. I'll come back to it a bit later.

Copy link
Author

@psxvoid psxvoid Mar 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Though, I'm not sure whether it's possible in VB.

{
return;
}

IParameterSymbol param = operation.Parameter;
ISymbol? referencedSymbol = assignment.Target.GetReferencedMemberOrLocalOrParameter();

if (referencedSymbol == null)
{
return;
}

var field = referencedSymbol as IFieldSymbol;
var prop = referencedSymbol as IPropertySymbol;

if (field == null && prop == null)
{
return;
}

// Only process instance fields and properties
if (referencedSymbol.IsStatic)
{
return;
}
Copy link
Member

@Youssef1313 Youssef1313 Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be combined with the null check above as follows if (referencedSymbol is not { IsStatic: false }) (or if (referencedSymbol is null || referencedSymbol.IsStatic))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


if (IsSupportedField(field) && !IsParamMatchFieldName(param, field))
{
context.ReportDiagnostic(
param.CreateDiagnostic(
FieldRule,
param.ContainingType.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
param.Name,
field.Name));
}

if (IsSupportedProp(prop) && !IsParamMatchPropName(param, prop))
{
context.ReportDiagnostic(
param.CreateDiagnostic(
PropertyRule,
param.ContainingType.ToDisplayString(SymbolDisplayFormats.ShortSymbolDisplayFormat),
param.Name,
prop.Name));
}
}

private static bool IsSupportedProp([NotNullWhen(true)] IPropertySymbol? prop)
{
if (prop == null)
{
return false;
}

return true;
}

private static bool IsSupportedField([NotNullWhen(true)] IFieldSymbol? field)
{
if (field == null)
{
return false;
}

return true;
}

private static bool IsParamMatchFieldName(IParameterSymbol param, IFieldSymbol field)
{
var paramWords = WordParser.Parse(param.Name, WordParserOptions.SplitCompoundWords);
var fieldWords = WordParser.Parse(field.Name, WordParserOptions.SplitCompoundWords).ToImmutableArray();

return paramWords.All(x => WordParser.ContainsWord(x, WordParserOptions.SplitCompoundWords, fieldWords));
}

private static bool IsParamMatchPropName(IParameterSymbol param, IPropertySymbol prop)
{
var paramWords = WordParser.Parse(param.Name, WordParserOptions.SplitCompoundWords);
var propWords = WordParser.Parse(prop.Name, WordParserOptions.SplitCompoundWords).ToImmutableArray();

return paramWords.All(x => WordParser.ContainsWord(x, WordParserOptions.SplitCompoundWords, propWords));
}

public bool ShouldAnalyzeMethod(IMethodSymbol method)
{
// We only care about constructors with parameters.
if (method.Parameters.IsEmpty)
{
return false;
}

// We only care about constructors that are marked with JsonConstructor attribute.
if (!method.IsJsonConstructor(_jsonConstructorAttributeInfoType))
{
return false;
}

return true;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ public sealed class SerializationRulesDiagnosticAnalyzer : DiagnosticAnalyzer
// Implement serialization constructors
internal const string RuleCA2229Id = "CA2229";

#region Diagnostic Descriptor Definitions
private static readonly LocalizableString s_localizableTitleCA2229 =
new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ImplementSerializationConstructorsTitle),
MicrosoftNetCoreAnalyzersResources.ResourceManager, typeof(MicrosoftNetCoreAnalyzersResources));
new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ImplementSerializationConstructorsTitle),
MicrosoftNetCoreAnalyzersResources.ResourceManager, typeof(MicrosoftNetCoreAnalyzersResources));

private static readonly LocalizableString s_localizableDescriptionCA2229 =
new LocalizableResourceString(nameof(MicrosoftNetCoreAnalyzersResources.ImplementSerializationConstructorsDescription),
Expand Down Expand Up @@ -101,6 +102,9 @@ public sealed class SerializationRulesDiagnosticAnalyzer : DiagnosticAnalyzer

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(RuleCA2229Default, RuleCA2229Sealed, RuleCA2229Unsealed, RuleCA2235, RuleCA2237);

#endregion

#region Public Methods
public override void Initialize(AnalysisContext context)
{
context.EnableConcurrentExecution();
Expand Down Expand Up @@ -146,6 +150,10 @@ public override void Initialize(AnalysisContext context)
});
}

#endregion

#region Private Classes

private sealed class SymbolAnalyzer
{
private readonly INamedTypeSymbol _iserializableTypeSymbol;
Expand Down Expand Up @@ -297,5 +305,7 @@ private bool IsSerializable(ITypeSymbol type)
};
}
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,26 @@
<target state="translated">, </target>
<note>Separator used for separating list of platform names: {API} is only supported on: {‘windows’, ‘browser’, ‘linux’}</note>
</trans-unit>
<trans-unit id="ConstructorParameterShouldMatchFieldName">
<source>In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</source>
<target state="new">In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParameterShouldMatchPropertyName">
<source>In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</source>
<target state="new">In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParametersShouldMatchPropertyNamesDescription">
<source>Constructor parameters should match referenced property or field names.</source>
<target state="new">Constructor parameters should match referenced property or field names.</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParametersShouldMatchPropertyNamesTitle">
<source>Constructor parameters should match referenced property and field names</source>
<target state="new">Constructor parameters should match referenced property and field names</target>
<note />
</trans-unit>
<trans-unit id="DataSetDataTableInDeserializableObjectGraphMessage">
<source>When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}</source>
<target state="translated">Při deserializaci nedůvěryhodného vstupu není deserializace objektu {0} bezpečná. Objekt {1} je buď objektem {0}, nebo je z tohoto objektu odvozený.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,26 @@
<target state="translated">, </target>
<note>Separator used for separating list of platform names: {API} is only supported on: {‘windows’, ‘browser’, ‘linux’}</note>
</trans-unit>
<trans-unit id="ConstructorParameterShouldMatchFieldName">
<source>In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</source>
<target state="new">In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParameterShouldMatchPropertyName">
<source>In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</source>
<target state="new">In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParametersShouldMatchPropertyNamesDescription">
<source>Constructor parameters should match referenced property or field names.</source>
<target state="new">Constructor parameters should match referenced property or field names.</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParametersShouldMatchPropertyNamesTitle">
<source>Constructor parameters should match referenced property and field names</source>
<target state="new">Constructor parameters should match referenced property and field names</target>
<note />
</trans-unit>
<trans-unit id="DataSetDataTableInDeserializableObjectGraphMessage">
<source>When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}</source>
<target state="translated">Beim Deserialisieren einer nicht vertrauenswürdigen Eingabe ist die Deserialisierung eines {0}-Objekts unsicher. "{1}" ist entweder "{0}" oder davon abgeleitet.</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,26 @@
<target state="translated">, </target>
<note>Separator used for separating list of platform names: {API} is only supported on: {‘windows’, ‘browser’, ‘linux’}</note>
</trans-unit>
<trans-unit id="ConstructorParameterShouldMatchFieldName">
<source>In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</source>
<target state="new">In the constructor of '{0}', change the name of parameter '{1}', to match the referenced field '{2}'</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParameterShouldMatchPropertyName">
<source>In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</source>
<target state="new">In the constructor of '{0}', change the name of parameter '{1}' to match the referenced property '{2}'</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParametersShouldMatchPropertyNamesDescription">
<source>Constructor parameters should match referenced property or field names.</source>
<target state="new">Constructor parameters should match referenced property or field names.</target>
<note />
</trans-unit>
<trans-unit id="ConstructorParametersShouldMatchPropertyNamesTitle">
<source>Constructor parameters should match referenced property and field names</source>
<target state="new">Constructor parameters should match referenced property and field names</target>
<note />
</trans-unit>
<trans-unit id="DataSetDataTableInDeserializableObjectGraphMessage">
<source>When deserializing untrusted input, deserializing a {0} object is insecure. '{1}' either is or derives from {0}</source>
<target state="translated">Cuando se deserializa una entrada que no es de confianza, no es segura la deserialización de un objeto {0}. "{1}" es {0} o se deriva de este.</target>
Expand Down
Loading