Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion OSLC4Net_SDK/Examples/OSLC4Net.Client.Samples/ETMSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async Task RunAsync(string webContextUrl, string user, string passwd, string pro
//Get the Creation Factory URL for test cases so that we can create a test case
String testcaseCreation = await client.LookupCreationFactoryAsync(
serviceProviderUrl, OSLCConstants.OSLC_QM_V2,
testcase.GetRdfTypes()[0].ToString()).ConfigureAwait(false);
testcase.Types.First().ToString()).ConfigureAwait(false);

//Create the test case
HttpResponseMessage creationResponse = await client.CreateResourceRawAsync(
Expand Down
4 changes: 2 additions & 2 deletions OSLC4Net_SDK/Examples/OSLC4Net.Client.Samples/EWMSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public async Task RunScenarioAsync(string webContextUrl, string user, string pas
//Get the Creation Factory URL for change requests so that we can create one
String changeRequestCreation = await client.LookupCreationFactoryAsync(
serviceProviderUrl, OSLCConstants.OSLC_CM_V2,
changeRequest.GetRdfTypes()[0].ToString()).ConfigureAwait(false);
changeRequest.Types.First().ToString()).ConfigureAwait(false);

//Create the change request
HttpResponseMessage creationResponse = await client.CreateResourceRawAsync(
Expand Down Expand Up @@ -271,7 +271,7 @@ protected override void PrintResourceInfo(ChangeRequest cr)
string creationFactoryUrl = await client.LookupCreationFactoryAsync(
serviceProviderUrl,
OSLCConstants.OSLC_CM_V2,
changeRequest.GetRdfTypes()[0].ToString()).ConfigureAwait(false);
changeRequest.Types.First().ToString()).ConfigureAwait(false);

if (string.IsNullOrEmpty(creationFactoryUrl))
{
Expand Down
4 changes: 2 additions & 2 deletions OSLC4Net_SDK/OSLC4Net.ChangeManagement/ChangeRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public Uri GetInstanceShape()
[Obsolete]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("This relationship is loosely coupled and has no specific meaning.")]
Expand Down Expand Up @@ -716,7 +716,7 @@ public void SetModified(DateTime? modified)
[Obsolete]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetRelatedChangeRequests(Link[] relatedChangeRequests)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}
Comment on lines 147 to 151
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo in [Obsolete] message: "User" → "Use".

The obsolete attribute messages on lines 147 and 212 say "User GetTypes()..." and "User SetTypes()..." — should be "Use". This same typo is repeated across all resource files in this PR (AutomationPlan, AutomationRequest, AutomationResult, ParameterInstance, QmResource, and both ChangeRequest files).

Proposed fix (this file)
-    [Obsolete("User GetTypes() or .Types instead")]
+    [Obsolete("Use GetTypes() or .Types instead")]
     public Uri[] GetRdfTypes()
-    [Obsolete("User SetTypes() or .Types instead")]
+    [Obsolete("Use SetTypes() or .Types instead")]
     public void SetRdfTypes(Uri[] rdfTypes)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}
[Obsolete("Use GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return Types.ToArray();
}
🤖 Prompt for AI Agents
In `@OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/ArchitectureLinkType.cs` around
lines 147 - 151, The Obsolete attribute messages contain a typo: change "User"
to "Use" in the Obsolete strings for the methods such as GetRdfTypes (method
name GetRdfTypes) and SetRdfTypes (method name SetRdfTypes) in
ArchitectureLinkType.cs and the corresponding obsolete attributes in other
resource files (AutomationPlan, AutomationRequest, AutomationResult,
ParameterInstance, QmResource, and both ChangeRequest files); update each
Obsolete("User GetTypes() or .Types instead") and Obsolete("User SetTypes() or
.Types instead") to Obsolete("Use GetTypes() or .Types instead") and
Obsolete("Use SetTypes() or .Types instead") respectively so the message reads
correctly.


[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -212,7 +212,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetServiceProvider(Uri serviceProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}
Comment on lines 147 to 151
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

rg -n '"User [GS]etTypes' --type=cs

Repository: OSLC/oslc4net

Length of output: 2210


Fix typo in [Obsolete] messages: "User" → "Use".

Multiple resource files contain the typo "User GetTypes() or .Types instead" and "User SetTypes() or .Types instead" in their [Obsolete] attributes. The correct phrasing should use "Use" instead of "User".

This appears in 9 resource files with 18 total occurrences (2 per file):

  • AutomationRequest.cs (lines 163, 306)
  • ParameterInstance.cs (lines 95, 130)
  • RequirementBase.cs (lines 390, 611)
  • QmResource.cs (lines 90, 136)
  • AutomationResult.cs (lines 173, 363)
  • ChangeRequest.cs (lines 341, 696)
  • AutomationPlan.cs (lines 153, 245)
  • ArchitectureResource.cs (lines 147, 236)
  • ArchitectureLinkType.cs (lines 147, 212)
🤖 Prompt for AI Agents
In `@OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/ArchitectureResource.cs` around
lines 147 - 151, Replace the typo "User" with "Use" in the Obsolete attribute
messages across the resource classes; specifically update the Obsolete strings
on methods/properties like GetRdfTypes (returns Types.ToArray()), any
SetRdfTypes/SetTypes variants, and the corresponding GetTypes()/SetTypes()
messages so they read "Use GetTypes() or .Types instead" and "Use SetTypes() or
.Types instead" respectively; apply this change in the listed resource files and
the two occurrences per file (e.g., GetRdfTypes/GetTypes and
SetRdfTypes/SetTypes in AutomationRequest, ParameterInstance, RequirementBase,
QmResource, AutomationResult, ChangeRequest, AutomationPlan,
ArchitectureResource, ArchitectureLinkType).


[OslcDescription("A short string representation for the type, example 'Defect'.")]
Expand Down Expand Up @@ -236,7 +236,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
Comment on lines 236 to +239
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Same typo in the setter's [Obsolete] message.

"User SetTypes() or .Types instead""Use SetTypes() or .Types instead".

🤖 Prompt for AI Agents
In `@OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/ArchitectureResource.cs` around
lines 236 - 239, The Obsolete attribute message on the SetRdfTypes method has a
typo; update the attribute string on the SetRdfTypes method in
ArchitectureResource (the [Obsolete("User SetTypes() or .Types instead")]
decoration) to read "Use SetTypes() or .Types instead" so the guidance
references "Use" not "User" while keeping the same target methods/properties
(SetTypes and Types).

}

public void SetDctermsTypes(string[] dctermsTypes)
Expand Down
4 changes: 2 additions & 2 deletions OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/AutomationPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -245,7 +245,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetServiceProvider(Uri serviceProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -306,7 +306,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetServiceProvider(Uri serviceProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -363,7 +363,7 @@ public void setModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void setServiceProvider(Uri serviceProvider)
Expand Down
4 changes: 2 additions & 2 deletions OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/ChangeRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("This relationship is loosely coupled and has no specific meaning.")]
Expand Down Expand Up @@ -696,7 +696,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetRelatedChangeRequests(Link[] relatedChangeRequests)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -130,7 +130,7 @@ public void SetInstanceShape(Uri instanceShape)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetServiceProvider(Uri serviceProvider)
Expand Down
4 changes: 2 additions & 2 deletions OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/QmResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Uri GetInstanceShape()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}

[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -136,7 +136,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetServiceProvider(Uri serviceProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public Uri[] GetCreators()
[Obsolete("User GetTypes() or .Types instead")]
public Uri[] GetRdfTypes()
{
return GetTypes().ToArray();
return Types.ToArray();
}
Comment on lines 390 to 394
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Same "User" → "Use" typo as in other resource files.

🤖 Prompt for AI Agents
In `@OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/RequirementBase.cs` around lines
390 - 394, The Obsolete attribute on the RequirementBase.GetRdfTypes() method
contains a typo ("User" should be "Use"); update the attribute string on
GetRdfTypes() to read "[Obsolete(\"Use GetTypes() or .Types instead\")]" so the
message is correct and consistent with other resource files.


[OslcDescription("The scope of a resource is a Uri for the resource's OSLC Service Provider.")]
Expand Down Expand Up @@ -611,7 +611,7 @@ public void SetModified(DateTime? modified)
[Obsolete("User SetTypes() or .Types instead")]
public void SetRdfTypes(Uri[] rdfTypes)
{
SetTypes(rdfTypes);
Types = rdfTypes;
}

public void SetServiceProvider(Uri? serviceProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ private static void HandleExtendedProperties(Type resourceType,
IExtendedResource extendedResource,
IDictionary<string, object>? properties)
{
foreach (var type in extendedResource.GetTypes())
foreach (var type in extendedResource.Types)
{
var propertyName = type.ToString();

Expand Down Expand Up @@ -1433,7 +1433,7 @@ private static void HandleExtendedValue(Type objType,
nestedResource = graph.CreateBlankNode();
}

foreach (var type in any.GetTypes())
foreach (var type in any.Types)
{
var propertyName = type.ToString();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*******************************************************************************
* Copyright (c) 2012 IBM Corporation.
* Copyright (c) 2025 Andrii Berezovskyi and OSLC4Net contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
*
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/
using System.Reflection;
using OSLC4Net.Core.Attribute;
using OSLC4Net.Core.Model;
namespace OSLC4Net.Core.Exceptions;
public class OslcCoreInvalidOccursException(
Type resourceType,
MethodInfo method,
OslcOccurs oslcOccurs) : OslcCoreApplicationException(
$"OSLC1003: Invalid occurs annotation {OccursExtension.ToString(oslcOccurs.value)} for method {method.Name} of class {resourceType.Name}")
{
public Type ResourceType { get; } = resourceType;
public MethodInfo Method { get; } = method;
public OslcOccurs OslcOccurs { get; } = oslcOccurs;
}
/*******************************************************************************
* Copyright (c) 2012 IBM Corporation.
* Copyright (c) 2025 Andrii Berezovskyi and OSLC4Net contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
*
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/

using System.Reflection;
using OSLC4Net.Core.Attribute;
using OSLC4Net.Core.Model;

namespace OSLC4Net.Core.Exceptions;

public class OslcCoreInvalidOccursException(
Type resourceType,
MemberInfo method,
OslcOccurs oslcOccurs) : OslcCoreApplicationException(
$"OSLC1003: Invalid occurs annotation {OccursExtension.ToString(oslcOccurs.value)} for method {method.Name} of class {resourceType.Name}")
{
public Type ResourceType { get; } = resourceType;
public MemberInfo Method { get; } = method;
public OslcOccurs OslcOccurs { get; } = oslcOccurs;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace OSLC4Net.Core.Exceptions;
/// </summary>
public class OslcCoreInvalidPropertyTypeException(
Type resourceType,
MethodInfo method,
MemberInfo method,
Type returnType) : OslcCoreApplicationException(
$"OSLC1005: Invalid property type {returnType.Name} returned by method {method.Name} of class {resourceType.Name}")
{
public Type ResourceType { get; } = resourceType;
public MethodInfo Method { get; } = method;
public MemberInfo Method { get; } = method;
public Type ReturnType { get; } = returnType;
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*******************************************************************************
* Copyright (c) 2012 IBM Corporation.
* Copyright (c) 2025 Andrii Berezovskyi and OSLC4Net contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
*
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/
using System.Reflection;
using OSLC4Net.Core.Model;
namespace OSLC4Net.Core.Exceptions;
public class OslcCoreInvalidRepresentationException(
Type resourceType,
MethodInfo method,
Representation representation) : OslcCoreApplicationException(
$"OSLC1006: Invalid representation {RepresentationExtension.ToString(representation)} defined for method {method.Name} of class {resourceType.Name}")
{
public Type ResourceType { get; } = resourceType;
public MethodInfo Method { get; } = method;
public Representation Representation { get; } = representation;
}
/*******************************************************************************
* Copyright (c) 2012 IBM Corporation.
* Copyright (c) 2025 Andrii Berezovskyi and OSLC4Net contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
*
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/

using System.Reflection;
using OSLC4Net.Core.Model;

namespace OSLC4Net.Core.Exceptions;

public class OslcCoreInvalidRepresentationException(
Type resourceType,
MemberInfo method,
Representation representation) : OslcCoreApplicationException(
$"OSLC1006: Invalid representation {RepresentationExtension.ToString(representation)} defined for method {method.Name} of class {resourceType.Name}")
{
public Type ResourceType { get; } = resourceType;
public MemberInfo Method { get; } = method;
public Representation Representation { get; } = representation;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace OSLC4Net.Core.Exceptions;

public class OslcCoreInvalidValueTypeException(
Type resourceType,
MethodInfo method,
MemberInfo method,
ValueType valueType) : OslcCoreApplicationException(
$"OSLC1007: Invalid value type {ValueTypeExtension.ToString(valueType)} defined for method {method.Name} of class {resourceType.Name}")
{
public Type ResourceType { get; } = resourceType;
public MethodInfo Method { get; } = method;
public MemberInfo Method { get; } = method;
public ValueType ValueType { get; } = valueType;
}
Loading
Loading