Skip to content

Commit f3f239f

Browse files
authored
docs: convert javadoc to xml (#318)
* docs: convert javadoc to xml * docs: address copilot comments
1 parent 06ddfbe commit f3f239f

25 files changed

Lines changed: 392 additions & 453 deletions

csharp/PhoneNumbers.Test/TestAreaCodeMap.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919

2020
namespace PhoneNumbers.Test
2121
{
22-
/**
23-
* Unittests for AreaCodeMap.java
24-
*
25-
* @author Shaopeng Jia
26-
*/
22+
/// <summary>
23+
/// Unittests for AreaCodeMap.java
24+
/// </summary>
25+
/// <remarks>Author: Shaopeng Jia</remarks>
2726
[Collection("TestMetadataTestCase")]
2827
public class TestAreaCodeMap
2928
{

csharp/PhoneNumbers.Test/TestAsYouTypeFormatter.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
namespace PhoneNumbers.Test
2020
{
21-
/**
22-
* Unit tests for AsYouTypeFormatter.java
23-
*
24-
* Note that these tests use the test metadata, not the normal metadata file, so should not be used
25-
* for regression test purposes - these tests are illustrative only and test functionality.
26-
*
27-
* @author Shaopeng Jia
28-
*/
21+
/// <summary>
22+
/// Unit tests for AsYouTypeFormatter.java
23+
///
24+
/// Note that these tests use the test metadata, not the normal metadata file, so should not be used
25+
/// for regression test purposes - these tests are illustrative only and test functionality.
26+
/// </summary>
27+
/// <remarks>Author: Shaopeng Jia</remarks>
2928
[Collection("TestMetadataTestCase")]
3029
public class TestAsYouTypeFormatter
3130
{

csharp/PhoneNumbers.Test/TestExampleNumbers.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ public class TestExampleNumbers
2626
private readonly List<PhoneNumber> invalidCases = new List<PhoneNumber>();
2727
private readonly List<PhoneNumber> wrongTypeCases = new List<PhoneNumber>();
2828

29-
/**
30-
* @param exampleNumberRequestedType type we are requesting an example number for
31-
* @param possibleExpectedTypes acceptable types that this number should match, such as
32-
* FIXED_LINE and FIXED_LINE_OR_MOBILE for a fixed line example number.
33-
*/
29+
/// <summary>
30+
/// </summary>
31+
/// <param name="exampleNumberRequestedType">type we are requesting an example number for</param>
32+
/// <param name="possibleExpectedTypes">acceptable types that this number should match, such as FIXED_LINE and FIXED_LINE_OR_MOBILE for a fixed line example number.</param>
3433
private void CheckNumbersValidAndCorrectType(PhoneNumberType exampleNumberRequestedType,
3534
HashSet<PhoneNumberType> possibleExpectedTypes)
3635
{

csharp/PhoneNumbers.Test/TestMappingFileProvider.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919

2020
namespace PhoneNumbers.Test
2121
{
22-
/**
23-
* Unittests for MappingFileProvider.java
24-
*
25-
* @author Shaopeng Jia
26-
*/
22+
/// <summary>
23+
/// Unittests for MappingFileProvider.java
24+
/// </summary>
25+
/// <remarks>Author: Shaopeng Jia</remarks>
2726
[Collection("TestMetadataTestCase")]
2827
public class TestMappingFileProvider
2928
{

csharp/PhoneNumbers.Test/TestMedataManager.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818

1919
namespace PhoneNumbers.Test
2020
{
21-
/**
22-
* Some basic tests to check that the phone number metadata can be correctly loaded.
23-
*
24-
* @author Lara Rennie
25-
*/
21+
/// <summary>
22+
/// Some basic tests to check that the phone number metadata can be correctly loaded.
23+
/// </summary>
24+
/// <remarks>Author: Lara Rennie</remarks>
2625
public class TestMedataManager
2726
{
2827
[Fact]

csharp/PhoneNumbers.Test/TestMetadataFilter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ namespace PhoneNumbers.Test
2323
{
2424

2525

26-
/**
27-
* Unit tests for {@link MetadataFilter}.
28-
*/
26+
/// <summary>
27+
/// Unit tests for <see cref="MetadataFilter"/>.
28+
/// </summary>
2929
public class MetadataFilterTest
3030
{
3131
private const string ID = "AM";

csharp/PhoneNumbers.Test/TestMetadataTestCase.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* Copyright (C) 2012 The Libphonenumber Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,15 +16,15 @@
1616

1717
namespace PhoneNumbers.Test
1818
{
19-
/**
20-
* Root class for PhoneNumberUtil tests that depend on the test metadata file.
21-
* <p>
22-
* Note since tests that extend this class do not use the normal metadata file, they should not be
23-
* used for regression test purposes.
24-
*
25-
* @author Shaopeng Jia
26-
* @author Lara Rennie
27-
*/
19+
/// <summary>
20+
/// Root class for PhoneNumberUtil tests that depend on the test metadata file.
21+
/// <para>
22+
/// Note since tests that extend this class do not use the normal metadata file, they should not be
23+
/// used for regression test purposes.
24+
/// </para>
25+
/// </summary>
26+
/// <remarks>Author: Shaopeng Jia</remarks>
27+
/// <remarks>Author: Lara Rennie</remarks>
2828
public class TestMetadataTestCase
2929
{
3030
public static readonly PhoneNumberUtil PhoneUtil = new PhoneNumberUtil("PhoneNumberMetadataForTesting.xml", typeof(TestMetadataTestCase).Assembly);

csharp/PhoneNumbers.Test/TestNumberFormat.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace PhoneNumbers.Test
44
{
5-
/**
6-
* Tests derived from https://github.com/google/libphonenumber/blob/master/java/libphonenumber/test/com/google/i18n/phonenumbers/PhonenumberTest.java
7-
*/
5+
/// <summary>
6+
/// Tests derived from https://github.com/google/libphonenumber/blob/master/java/libphonenumber/test/com/google/i18n/phonenumbers/PhonenumberTest.java
7+
/// </summary>
88
public class TestNumberFormat
99
{
1010
[Fact]

csharp/PhoneNumbers.Test/TestPhoneNumberMatch.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public void TestValueTypeSemantics()
3737
Assert.Equal("1 800 234 45 67", match1.RawString);
3838
}
3939

40-
/**
41-
* Tests the value type semantics for matches with a null number.
42-
*/
40+
/// <summary>
41+
/// Tests the value type semantics for matches with a null number.
42+
/// </summary>
4343
[Fact]
4444
public void TestIllegalArguments()
4545
{

csharp/PhoneNumbers.Test/TestPhoneNumberMatcher.cs

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ public void TestFindInterspersedWithSpace()
192192
DoTestFindInContext("0 3 3 3 1 6 0 0 5", "NZ");
193193
}
194194

195-
/**
196-
* Test matching behavior when starting in the middle of a phone number.
197-
*/
195+
/// <summary>
196+
/// Test matching behavior when starting in the middle of a phone number.
197+
/// </summary>
198198
[Fact]
199199
public void TestIntermediateParsePositions()
200200
{
@@ -403,9 +403,9 @@ public void TestDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace()
403403
Assert.True(HasNoMatches(phoneUtil.FindNumbers(text, region)));
404404
}
405405

406-
/**
407-
* Strings with number-like things that shouldn't be found under any level.
408-
*/
406+
/// <summary>
407+
/// Strings with number-like things that shouldn't be found under any level.
408+
/// </summary>
409409
private static readonly NumberTest[] ImpossibleCases =
410410
{
411411
new NumberTest("12345", "US"),
@@ -423,9 +423,9 @@ public void TestDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace()
423423
new NumberTest("20120102 08:00", RegionCode.US)
424424
};
425425

426-
/**
427-
* Strings with number-like things that should only be found under "possible".
428-
*/
426+
/// <summary>
427+
/// Strings with number-like things that should only be found under "possible".
428+
/// </summary>
429429
private static readonly NumberTest[] PossibleOnlyCases =
430430
{
431431
// US numbers cannot start with 7 in the test metadata to be valid.
@@ -437,10 +437,10 @@ public void TestDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace()
437437
new NumberTest("(20) 3346 1234", RegionCode.GB) // Non-optional NP omitted
438438
};
439439

440-
/**
441-
* Strings with number-like things that should only be found up to and including the "valid"
442-
* leniency level.
443-
*/
440+
/// <summary>
441+
/// Strings with number-like things that should only be found up to and including the "valid"
442+
/// leniency level.
443+
/// </summary>
444444
private static readonly NumberTest[] ValidCases =
445445
{
446446
new NumberTest("65 02 53 00 00", "US"),
@@ -464,10 +464,10 @@ public void TestDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace()
464464
new NumberTest("0 3 0 -3 2 23 12 34", RegionCode.DE)
465465
};
466466

467-
/**
468-
* Strings with number-like things that should only be found up to and including the
469-
* "strict_grouping" leniency level.
470-
*/
467+
/// <summary>
468+
/// Strings with number-like things that should only be found up to and including the
469+
/// "strict_grouping" leniency level.
470+
/// </summary>
471471
private static readonly NumberTest[] StrictGroupingCases =
472472
{
473473
new NumberTest("(415) 6667777", "US"),
@@ -482,9 +482,9 @@ public void TestDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace()
482482
new NumberTest("0 900-1 123123", RegionCode.DE)
483483
};
484484

485-
/**
486-
* Strings with number-like things that should be found at all levels.
487-
*/
485+
/// <summary>
486+
/// Strings with number-like things that should be found at all levels.
487+
/// </summary>
488488
private static readonly NumberTest[] ExactGroupingCases = {
489489
new NumberTest("\uFF14\uFF11\uFF15\uFF16\uFF16\uFF16\uFF17\uFF17\uFF17\uFF17", "US"),
490490
new NumberTest("\uFF14\uFF11\uFF15-\uFF16\uFF16\uFF16-\uFF17\uFF17\uFF17\uFF17", "US"),
@@ -634,13 +634,13 @@ private void DoTestNumberNonMatchesForLeniency(List<NumberTest> testCases,
634634
Assert.Equal(0, matchFoundCount);
635635
}
636636

637-
/**
638-
* Helper method which tests the contexts provided and ensures that:
639-
* -- if isValid is true, they all find a test number inserted in the middle when leniency of
640-
* matching is set to VALID; else no test number should be extracted at that leniency level
641-
* -- if isPossible is true, they all find a test number inserted in the middle when leniency of
642-
* matching is set to POSSIBLE; else no test number should be extracted at that leniency level
643-
*/
637+
/// <summary>
638+
/// Helper method which tests the contexts provided and ensures that:
639+
/// -- if isValid is true, they all find a test number inserted in the middle when leniency of
640+
/// matching is set to VALID; else no test number should be extracted at that leniency level
641+
/// -- if isPossible is true, they all find a test number inserted in the middle when leniency of
642+
/// matching is set to POSSIBLE; else no test number should be extracted at that leniency level
643+
/// </summary>
644644
private void FindMatchesInContexts(List<NumberContext> contexts, bool isValid,
645645
bool isPossible, string region, string number)
646646
{
@@ -673,9 +673,9 @@ private void FindMatchesInContexts(List<NumberContext> contexts, bool isValid,
673673
}
674674
}
675675

676-
/**
677-
* Variant of FindMatchesInContexts that uses a default number and region.
678-
*/
676+
/// <summary>
677+
/// Variant of FindMatchesInContexts that uses a default number and region.
678+
/// </summary>
679679
private void FindMatchesInContexts(List<NumberContext> contexts, bool isValid, bool isPossible)
680680
{
681681
const string region = "US";
@@ -861,10 +861,10 @@ public void TestSingleIteration()
861861
iterator.Dispose();
862862
}
863863

864-
/**
865-
* Asserts that another number can be found in {@code text} starting at {@code index}, and that
866-
* its corresponding range is {@code [start, end)}.
867-
*/
864+
/// <summary>
865+
/// Asserts that another number can be found in <c>text</c> starting at <c>index</c>, and that
866+
/// its corresponding range is <c>[start, end)</c>.
867+
/// </summary>
868868
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
869869
private void AssertEqualRange(string text, int index, int start, int end)
870870
{
@@ -879,12 +879,11 @@ private void AssertEqualRange(string text, int index, int start, int end)
879879
matches.Dispose();
880880
}
881881

882-
/**
883-
* Tests numbers found by {@link PhoneNumberUtil#FindNumbers(CharSequence, String)} in various
884-
* textual contexts.
885-
*
886-
* @param number the number to test and the corresponding region code to use
887-
*/
882+
/// <summary>
883+
/// Tests numbers found by <see cref="PhoneNumberUtil.FindNumbers(string, string)"/> in various
884+
/// textual contexts.
885+
/// </summary>
886+
/// <param name="number">the number to test and the corresponding region code to use</param>
888887
#if NET6_0_OR_GREATER
889888
private void DoTestFindInContext(string number, string? defaultCountry)
890889
#else
@@ -938,9 +937,9 @@ private void FindPossibleInContext(string number, string defaultCountry)
938937
DoTestInContext(number, defaultCountry, contextPairs, PhoneNumberUtil.Leniency.POSSIBLE);
939938
}
940939

941-
/**
942-
* Tests valid numbers in contexts that fail for {@link Leniency#POSSIBLE}.
943-
*/
940+
/// <summary>
941+
/// Tests valid numbers in contexts that fail for <see cref="PhoneNumberUtil.Leniency.POSSIBLE"/>.
942+
/// </summary>
944943
#if NET6_0_OR_GREATER
945944
private void FindValidInContext(string number, string? defaultCountry)
946945
#else
@@ -987,10 +986,10 @@ private void DoTestInContext(string number, string defaultCountry, List<NumberCo
987986
}
988987
}
989988

990-
/**
991-
* Exhaustively searches for phone numbers from each index within {@code text} to test that
992-
* finding matches always terminates.
993-
*/
989+
/// <summary>
990+
/// Exhaustively searches for phone numbers from each index within <c>text</c> to test that
991+
/// finding matches always terminates.
992+
/// </summary>
994993
#if NET6_0_OR_GREATER
995994
private void EnsureTermination(string text, string? defaultCountry, PhoneNumberUtil.Leniency leniency)
996995
#else
@@ -1013,18 +1012,18 @@ private IEnumerable<PhoneNumberMatch> FindNumbersForLeniency(
10131012
return phoneUtil.FindNumbers(text, defaultCountry, leniency, long.MaxValue);
10141013
}
10151014

1016-
/**
1017-
* Returns true if there were no matches found.
1018-
*/
1015+
/// <summary>
1016+
/// Returns true if there were no matches found.
1017+
/// </summary>
10191018
private bool HasNoMatches(IEnumerable<PhoneNumberMatch> iterable)
10201019
{
10211020
return !iterable.GetEnumerator().MoveNext();
10221021
}
10231022

1024-
/**
1025-
* Small class that holds the context of the number we are testing against. The test will
1026-
* insert the phone number to be found between leadingText and trailingText.
1027-
*/
1023+
/// <summary>
1024+
/// Small class that holds the context of the number we are testing against. The test will
1025+
/// insert the phone number to be found between leadingText and trailingText.
1026+
/// </summary>
10281027
private class NumberContext
10291028
{
10301029
public readonly string LeadingText;
@@ -1037,9 +1036,9 @@ public NumberContext(string leadingText, string trailingText)
10371036
}
10381037
}
10391038

1040-
/**
1041-
* Small class that holds the number we want to test and the region for which it should be valid.
1042-
*/
1039+
/// <summary>
1040+
/// Small class that holds the number we want to test and the region for which it should be valid.
1041+
/// </summary>
10431042
private class NumberTest
10441043
{
10451044
public readonly string RawString;

0 commit comments

Comments
 (0)