Skip to content

Commit 686164f

Browse files
authored
ref: Rename variables. (#209)
1 parent ed63ae8 commit 686164f

File tree

3 files changed

+36
-34
lines changed

3 files changed

+36
-34
lines changed

src/main/java/org/ice4j/ice/Agent.java

+13-12
Original file line numberDiff line numberDiff line change
@@ -1466,44 +1466,45 @@ public boolean isControlling()
14661466

14671467
/**
14681468
* Returns the local <tt>LocalCandidate</tt> with the specified
1469-
* <tt>localAddress</tt> if it belongs to any of this {@link Agent}'s
1469+
* <tt>address</tt> if it belongs to any of this {@link Agent}'s
14701470
* streams or <tt>null</tt> if it doesn't.
14711471
*
1472-
* @param localAddress the {@link TransportAddress} we are looking for.
1472+
* @param address the {@link TransportAddress} we are looking for.
14731473
*
14741474
* @return the local <tt>LocalCandidate</tt> with the specified
1475-
* <tt>localAddress</tt> if it belongs to any of this {@link Agent}'s
1475+
* <tt>address</tt> if it belongs to any of this {@link Agent}'s
14761476
* streams or <tt>null</tt> if it doesn't.
14771477
*/
1478-
public LocalCandidate findLocalCandidate(TransportAddress localAddress)
1478+
public LocalCandidate findLocalCandidate(TransportAddress address)
14791479
{
1480-
return findLocalCandidate(localAddress, null);
1480+
return findLocalCandidate(address, null);
14811481
}
14821482

14831483
/**
14841484
* Returns the local <tt>LocalCandidate</tt> with the specified
1485-
* <tt>localAddress</tt> if it belongs to any of this {@link Agent}'s
1485+
* <tt>address</tt> if it belongs to any of this {@link Agent}'s
14861486
* streams or <tt>null</tt> if it doesn't. If {@code base} is also specified,
14871487
* tries to find a candidate whose base matches {@code base}.
14881488
*
1489-
* @param localAddress the {@link TransportAddress} we are looking for.
1489+
* @param address the {@link TransportAddress} we are looking for.
14901490
* @param base an optional base to match.
14911491
*
14921492
* @return the local <tt>LocalCandidate</tt> with the specified
1493-
* <tt>localAddress</tt> if it belongs to any of this {@link Agent}'s
1493+
* <tt>address</tt> if it belongs to any of this {@link Agent}'s
14941494
* streams or <tt>null</tt> if it doesn't.
14951495
*/
14961496
public LocalCandidate findLocalCandidate(
1497-
TransportAddress localAddress,
1497+
TransportAddress address,
14981498
LocalCandidate base)
14991499
{
15001500
for (IceMediaStream stream : mediaStreams.values())
15011501
{
1502-
LocalCandidate cnd = stream.findLocalCandidate(localAddress, base);
1502+
LocalCandidate localCandidate
1503+
= stream.findLocalCandidate(address, base);
15031504

1504-
if (cnd != null)
1505+
if (localCandidate != null)
15051506
{
1506-
return cnd;
1507+
return localCandidate;
15071508
}
15081509
}
15091510
return null;

src/main/java/org/ice4j/ice/Component.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -925,41 +925,41 @@ public LocalCandidate findLocalCandidate(TransportAddress localAddress)
925925

926926
/**
927927
* Returns the local <tt>LocalCandidate</tt> with the specified
928-
* <tt>localAddress</tt> if it belongs to this component or <tt>null</tt>
928+
* <tt>address</tt> if it belongs to this component or <tt>null</tt>
929929
* if it doesn't. If {@code base} is also specified, tries to find a
930930
* candidate whose base matches {@code base}.
931931
*
932-
* @param localAddress the {@link TransportAddress} we are looking for.
932+
* @param address the {@link TransportAddress} we are looking for.
933933
* @param base an optional base to match.
934934
*
935935
* @return the local <tt>LocalCandidate</tt> with the specified
936-
* <tt>localAddress</tt> if it belongs to this component or <tt>null</tt>
936+
* <tt>address</tt> if it belongs to this component or <tt>null</tt>
937937
* if it doesn't.
938938
*/
939-
public LocalCandidate findLocalCandidate(TransportAddress localAddress, LocalCandidate base)
939+
public LocalCandidate findLocalCandidate(TransportAddress address, LocalCandidate base)
940940
{
941-
for (LocalCandidate localCnd : localCandidates)
941+
for (LocalCandidate localCandidate : localCandidates)
942942
{
943-
if (localCnd.getTransportAddress().equals(localAddress))
943+
if (localCandidate.getTransportAddress().equals(address))
944944
{
945-
if (base == null || base.equals(localCnd.getBase()))
945+
if (base == null || base.equals(localCandidate.getBase()))
946946
{
947-
return localCnd;
947+
return localCandidate;
948948
}
949949
}
950950
}
951951
// In case the above loop failed to find a result because `base` was
952952
// specified, fallback to the original behavior and return the first
953-
// candidate matching `localAddress` regardless of `base`.
954-
for (LocalCandidate localCnd : localCandidates)
953+
// candidate matching `address` regardless of `base`.
954+
for (LocalCandidate localCandidate : localCandidates)
955955
{
956-
if (localCnd.getTransportAddress().equals(localAddress))
956+
if (localCandidate.getTransportAddress().equals(address))
957957
{
958958
logger.warn("Returning a candidate matching the address, "
959959
+ "while no candidates match both address ("
960-
+ localAddress + ") and base (" + base +"): " + localCnd
961-
+ " with base " + localCnd.getBase());
962-
return localCnd;
960+
+ address + ") and base (" + base +"): " + localCandidate
961+
+ " with base " + localCandidate.getBase());
962+
return localCandidate;
963963
}
964964
}
965965

src/main/java/org/ice4j/ice/IceMediaStream.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -507,26 +507,27 @@ protected void setMaxCheckListSize(int nSize)
507507

508508
/**
509509
* Returns the local <tt>LocalCandidate</tt> with the specified
510-
* <tt>localAddress</tt> if it belongs to any of this stream's components
510+
* <tt>address</tt> if it belongs to any of this stream's components
511511
* or <tt>null</tt> otherwise. If {@code base} is also specified, tries to
512512
* find a candidate whose base matches {@code base}.
513513
*
514-
* @param localAddress the {@link TransportAddress} we are looking for.
514+
* @param address the {@link TransportAddress} we are looking for.
515515
* @param base an optional base to match.
516516
*
517517
* @return the local <tt>LocalCandidate</tt> with the specified
518-
* <tt>localAddress</tt> if it belongs to any of this stream's components
518+
* <tt>address</tt> if it belongs to any of this stream's components
519519
* or <tt>null</tt> otherwise.
520520
*/
521-
public LocalCandidate findLocalCandidate(TransportAddress localAddress, LocalCandidate base)
521+
public LocalCandidate findLocalCandidate(TransportAddress address, LocalCandidate base)
522522
{
523-
for (Component cmp : components.values())
523+
for (Component component : components.values())
524524
{
525-
LocalCandidate cnd = cmp.findLocalCandidate(localAddress, base);
525+
LocalCandidate localCandidate
526+
= component.findLocalCandidate(address, base);
526527

527-
if (cnd != null)
528+
if (localCandidate != null)
528529
{
529-
return cnd;
530+
return localCandidate;
530531
}
531532
}
532533

0 commit comments

Comments
 (0)