Skip to content

Commit

Permalink
Added check on OriginRootPath to avoid unintelligible error (#434)
Browse files Browse the repository at this point in the history
* Added check on OriginRootPath to avoid unintelligible error

* Fix new() replacement
  • Loading branch information
masesdevelopers authored Jun 3, 2024
1 parent d7a1b75 commit e28f217
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/net/JNetReflector/InternalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ public static string WhereClauses(this Class entry, bool usedInGenerics, bool ca
var bounds = sbBounds.ToString();
if (!string.IsNullOrEmpty(bounds))
{
if (hasNew) bounds += AllPackageClasses.WHERE_CLAUSE_NEW;
bounds = bounds.Substring(0, bounds.LastIndexOf(", "));
if (hasNew) bounds += AllPackageClasses.WHERE_CLAUSE_NEW;
sbWhere.AppendFormat(AllPackageClasses.WHERE_CLAUSE, typeParameter.Name, bounds);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/net/JNetReflector/InternalMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static void Reflect()
{
AnalyzeNamespaces();
}
else throw new ArgumentException("At least one of ClassesToAnaylyze, NamespacesToParse or OriginRootPath must be set");
else throw new ArgumentException("At least one of ClassesToAnaylyze, JarsToAnalyze or ModulesToParse must be set");
w.Stop();

if (JNetReflectorCore.JarsToAnalyze != null)
Expand All @@ -123,6 +123,8 @@ public static void Reflect()

public static void AnalyzeJars()
{
if (string.IsNullOrWhiteSpace(JNetReflectorCore.OriginRootPath)) throw new ArgumentException($"OriginRootPath shall be set when the tool shall manage JAR reflection");

List<string> jarNames = new List<string>(JNetReflectorCore.JarsToAnalyze.Select((o) => Path.Combine(JNetReflectorCore.OriginRootPath, o)));
for (int i = 0; i < jarNames.Count; i++)
{
Expand Down

0 comments on commit e28f217

Please sign in to comment.