http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/PipelineBroadcastReduceDriverAndTasks/PipelinedSlaveTask.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/PipelineBroadcastReduceDriverAndTasks/PipelinedSlaveTask.cs b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/PipelineBroadcastReduceDriverAndTasks/PipelinedSlaveTask.cs index 84cd3ec..975a131 100644 --- a/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/PipelineBroadcastReduceDriverAndTasks/PipelinedSlaveTask.cs +++ b/lang/cs/Org.Apache.REEF.Network.Examples/GroupCommunication/PipelineBroadcastReduceDriverAndTasks/PipelinedSlaveTask.cs @@ -75,6 +75,7 @@ namespace Org.Apache.REEF.Network.Examples.GroupCommunication.PipelineBroadcastR } broadcastTime.Start(); + // Receive n from Master Task int[] intVec = _broadcastReceiver.Receive(); broadcastTime.Stop();
http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network.Tests/GroupCommunication/GroupCommunicationTreeTopologyTests.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network.Tests/GroupCommunication/GroupCommunicationTreeTopologyTests.cs b/lang/cs/Org.Apache.REEF.Network.Tests/GroupCommunication/GroupCommunicationTreeTopologyTests.cs index 5a114e4..fe91616 100644 --- a/lang/cs/Org.Apache.REEF.Network.Tests/GroupCommunication/GroupCommunicationTreeTopologyTests.cs +++ b/lang/cs/Org.Apache.REEF.Network.Tests/GroupCommunication/GroupCommunicationTreeTopologyTests.cs @@ -181,7 +181,6 @@ namespace Org.Apache.REEF.Network.Tests.GroupCommunication Assert.Equal(value3, receiver9.Receive()); } - [Fact] public void TestBroadcastReduceOperators() { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network.Tests/NetworkService/StreamingNetworkServiceTests.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network.Tests/NetworkService/StreamingNetworkServiceTests.cs b/lang/cs/Org.Apache.REEF.Network.Tests/NetworkService/StreamingNetworkServiceTests.cs index 5ef23f2..574068a 100644 --- a/lang/cs/Org.Apache.REEF.Network.Tests/NetworkService/StreamingNetworkServiceTests.cs +++ b/lang/cs/Org.Apache.REEF.Network.Tests/NetworkService/StreamingNetworkServiceTests.cs @@ -300,6 +300,7 @@ namespace Org.Apache.REEF.Network.Tests.NetworkService await writer.WriteStringAsync(obj.Value2, token); } } + /// <summary> /// The observer to handle incoming messages for string /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Driver/IGroupCommDriver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Driver/IGroupCommDriver.cs b/lang/cs/Org.Apache.REEF.Network/Group/Driver/IGroupCommDriver.cs index 71b47b6..4dcf7c1 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Driver/IGroupCommDriver.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Driver/IGroupCommDriver.cs @@ -35,7 +35,6 @@ namespace Org.Apache.REEF.Network.Group.Driver ICommunicationGroupDriver DefaultGroup { get; } - /// <summary> /// Create a new CommunicationGroup with the given name and number of tasks/operators. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/CommunicationGroupDriver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/CommunicationGroupDriver.cs b/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/CommunicationGroupDriver.cs index 9ebdf84..31f59d8 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/CommunicationGroupDriver.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/CommunicationGroupDriver.cs @@ -30,7 +30,6 @@ using Org.Apache.REEF.Tang.Interface; using Org.Apache.REEF.Tang.Util; using Org.Apache.REEF.Utilities.Logging; - namespace Org.Apache.REEF.Network.Group.Driver.Impl { /// <summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/GroupCommDriver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/GroupCommDriver.cs b/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/GroupCommDriver.cs index 5bf0848..7f34651 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/GroupCommDriver.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Driver/Impl/GroupCommDriver.cs @@ -59,7 +59,6 @@ namespace Org.Apache.REEF.Network.Group.Driver.Impl private readonly Dictionary<string, ICommunicationGroupDriver> _commGroups; private readonly AvroConfigurationSerializer _configSerializer; - /// <summary> /// Create a new GroupCommunicationDriver object. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Operators/IOperatorSpec.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Operators/IOperatorSpec.cs b/lang/cs/Org.Apache.REEF.Network/Group/Operators/IOperatorSpec.cs index cabbea2..d3d35a9 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Operators/IOperatorSpec.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Operators/IOperatorSpec.cs @@ -25,7 +25,7 @@ namespace Org.Apache.REEF.Network.Group.Operators /// <summary> /// The specification used to define Broadcast Operators. /// </summary> - // TODO[REEF-842] Act on the obsoletes + //// TODO[REEF-842] Act on the obsoletes public interface IOperatorSpec { [Obsolete("Deprecated in 0.14, please use Configuration instead.")] http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastOperatorSpec.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastOperatorSpec.cs b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastOperatorSpec.cs index c3652c9..33c0af6 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastOperatorSpec.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastOperatorSpec.cs @@ -54,6 +54,7 @@ namespace Org.Apache.REEF.Network.Group.Operators.Impl get { return Configuration; } private set { Configuration = value; } } + /// <summary> /// Returns the Configuration for Codec, ReduceFunction and DataConverter /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastReceiver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastReceiver.cs b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastReceiver.cs index f908ec8..aa82298 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastReceiver.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/BroadcastReceiver.cs @@ -109,7 +109,8 @@ namespace Org.Apache.REEF.Network.Group.Operators.Impl } messageList.Add(message); - } while (!message.IsLast); + } + while (!message.IsLast); return PipelineDataConverter.FullMessage(messageList); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceOperatorSpec.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceOperatorSpec.cs b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceOperatorSpec.cs index 5383b7d..8f35fc4 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceOperatorSpec.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceOperatorSpec.cs @@ -55,7 +55,8 @@ namespace Org.Apache.REEF.Network.Group.Operators.Impl /// Returns the Configuration for Codec, ReduceFunction and DataConverter /// </summary> [Obsolete("Deprecated in 0.14, please use Configuration instead.")] - public IConfiguration Configiration { + public IConfiguration Configiration + { get { return Configuration; } private set { Configuration = value; } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceReceiver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceReceiver.cs b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceReceiver.cs index be8632a..6075e4a 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceReceiver.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Operators/Impl/ReduceReceiver.cs @@ -116,7 +116,8 @@ namespace Org.Apache.REEF.Network.Group.Operators.Impl { message = _topology.ReceiveFromChildren(_pipelinedReduceFunc); messageList.Add(message); - } while (!message.IsLast); + } + while (!message.IsLast); return PipelineDataConverter.FullMessage(messageList); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/IPipelineDataConverter.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/IPipelineDataConverter.cs b/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/IPipelineDataConverter.cs index 46fc3f3..bcbcec9 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/IPipelineDataConverter.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/IPipelineDataConverter.cs @@ -24,13 +24,12 @@ using Org.Apache.REEF.Tang.Interface; namespace Org.Apache.REEF.Network.Group.Pipelining { - /// <summary> /// User specified class to convert the message to be communicated in to pipelining /// amenable data and vice-versa /// </summary> /// <typeparam name="T">The message type</typeparam> - // [DefaultImplementation(typeof(DefaultPipelineDataConverter<>))] + //// [DefaultImplementation(typeof(DefaultPipelineDataConverter<>))] public interface IPipelineDataConverter<T> { /// <summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/Impl/DefaultPipelineDataConverter.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/Impl/DefaultPipelineDataConverter.cs b/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/Impl/DefaultPipelineDataConverter.cs index fb0e5ad..9f9d2ed 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/Impl/DefaultPipelineDataConverter.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Pipelining/Impl/DefaultPipelineDataConverter.cs @@ -22,10 +22,8 @@ using Org.Apache.REEF.Tang.Implementations.Tang; using Org.Apache.REEF.Tang.Interface; using Org.Apache.REEF.Tang.Annotations; - namespace Org.Apache.REEF.Network.Group.Pipelining.Impl { - /// <summary> /// Default IPipelineDataConverter implementation /// This basically is a non-pipelined implementation that just packs the whole message in one single PipelineMessage http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/CommunicationGroupNetworkObserver.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/CommunicationGroupNetworkObserver.cs b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/CommunicationGroupNetworkObserver.cs index c3989a9..643095d 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/CommunicationGroupNetworkObserver.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/CommunicationGroupNetworkObserver.cs @@ -100,7 +100,6 @@ namespace Org.Apache.REEF.Network.Group.Task.Impl Exceptions.Throw(new ApplicationException("No handler registered yet with the operator name: " + operatorName), LOGGER); } return handler; - } public void OnError(Exception error) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/NodeStruct.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/NodeStruct.cs b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/NodeStruct.cs index 00fa9a5..835d251 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/NodeStruct.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/NodeStruct.cs @@ -23,7 +23,6 @@ using Org.Apache.REEF.Network.Group.Driver.Impl; namespace Org.Apache.REEF.Network.Group.Task.Impl { - /// <summary> /// Stores all incoming messages sent by a particular Task. /// Writable version http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs index 4ac38c4..b3a33f8 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs @@ -406,7 +406,6 @@ namespace Org.Apache.REEF.Network.Group.Task.Impl } return new NodeStruct<T>[] { potentialNode }; - } catch (OperationCanceledException) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Network/Group/Topology/TaskNode.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Topology/TaskNode.cs b/lang/cs/Org.Apache.REEF.Network/Group/Topology/TaskNode.cs index fe010a8..95c84a6 100644 --- a/lang/cs/Org.Apache.REEF.Network/Group/Topology/TaskNode.cs +++ b/lang/cs/Org.Apache.REEF.Network/Group/Topology/TaskNode.cs @@ -76,7 +76,8 @@ namespace Org.Apache.REEF.Network.Group.Topology _children.Add(child); } - public int GetNumberOfChildren() { + public int GetNumberOfChildren() + { return _children.Count; } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Examples/CheckChild.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Examples/CheckChild.cs b/lang/cs/Org.Apache.REEF.Tang.Examples/CheckChild.cs index db4a170..14e459d 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Examples/CheckChild.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Examples/CheckChild.cs @@ -28,6 +28,8 @@ namespace Org.Apache.REEF.Tang.Examples public class CheckChildImpl : CheckChildIface { [Inject] - public CheckChildImpl() { } + public CheckChildImpl() + { + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Examples/ForksInjectorInConstructor.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Examples/ForksInjectorInConstructor.cs b/lang/cs/Org.Apache.REEF.Tang.Examples/ForksInjectorInConstructor.cs index 0b9a4ef..a583736 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Examples/ForksInjectorInConstructor.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Examples/ForksInjectorInConstructor.cs @@ -47,7 +47,7 @@ namespace Org.Apache.REEF.Tang.Examples public ForksInjectorInConstructor(IInjector i) { ICsConfigurationBuilder cb = TangFactory.GetTang().NewConfigurationBuilder(new string[] { @"Org.Apache.REEF.Tang.Examples" }); - // cb.BindImplementation(Number.class, typeof(Int32)); + //// cb.BindImplementation(Number.class, typeof(Int32)); i.ForkInjector(cb.Build()); } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Examples/SimpleConstructors.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Examples/SimpleConstructors.cs b/lang/cs/Org.Apache.REEF.Tang.Examples/SimpleConstructors.cs index dd8c176..50efd96 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Examples/SimpleConstructors.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Examples/SimpleConstructors.cs @@ -38,6 +38,5 @@ namespace Org.Apache.REEF.Tang.Examples public SimpleConstructors(int x, String y) { } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Examples/TestClasses.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Examples/TestClasses.cs b/lang/cs/Org.Apache.REEF.Tang.Examples/TestClasses.cs index d67ccfd..75e76bc 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Examples/TestClasses.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Examples/TestClasses.cs @@ -23,14 +23,15 @@ namespace Org.Apache.REEF.Tang.Examples { public interface A { - } public class B : A { public class B1 { - public class B2 { } + public class B2 + { + } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Examples/Timer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Examples/Timer.cs b/lang/cs/Org.Apache.REEF.Tang.Examples/Timer.cs index e1ffe9d..3b12608 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Examples/Timer.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Examples/Timer.cs @@ -26,7 +26,9 @@ namespace Org.Apache.REEF.Tang.Examples public class Timer { [NamedParameter("Number of seconds to sleep", "sec", "10")] - public class Seconds : Name<Int32> { } + public class Seconds : Name<Int32> + { + } private readonly int seconds; [Inject] http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Examples/TweetExample.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Examples/TweetExample.cs b/lang/cs/Org.Apache.REEF.Tang.Examples/TweetExample.cs index fab15e1..ff1b066 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Examples/TweetExample.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Examples/TweetExample.cs @@ -35,7 +35,8 @@ namespace Org.Apache.REEF.Tang.Examples public class MockTweetFactory : ITweetFactory { [Inject] - public MockTweetFactory() { + public MockTweetFactory() + { } public String GetTweet() @@ -57,6 +58,7 @@ namespace Org.Apache.REEF.Tang.Examples { throw new ArgumentException("Unknown recipient"); } + // success! } } @@ -68,7 +70,9 @@ namespace Org.Apache.REEF.Tang.Examples readonly long phoneNumber; [NamedParameter(Documentation = "Phone number", ShortName = "number", DefaultValue = "1800")] - public class PhoneNumber : Name<long> { } + public class PhoneNumber : Name<long> + { + } [Inject] public Tweeter(ITweetFactory tw, ISMS sms, [Parameter(typeof(PhoneNumber))] long phoneNumber) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs index fa64ff1..593e736 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestClassHierarchy.cs @@ -74,7 +74,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy } catch (NameResolutionException) { - } Assert.True(msg == null, msg); } @@ -108,7 +107,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy } catch (NameResolutionException) { - } Assert.True(msg == null, msg); } @@ -128,7 +126,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy IClassNode timerClassNode = (IClassNode)ns.GetNode(typeof(Timer).AssemblyQualifiedName); INode secondNode = ns.GetNode(typeof(Timer.Seconds).AssemblyQualifiedName); Assert.Equal(secondNode.GetFullName(), ReflectionUtilities.GetAssemblyQualifiedName(typeof(Timer.Seconds))); - } [Fact] @@ -310,7 +307,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy "class org.apache.reef.tang.implementation.BadName defines a default class Int32 with a type that does not extend of its target's type string"); } - [Fact] public void TestNameCantBindWrongSubclassOfArgumentAsDefault() { @@ -437,7 +433,8 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy } [NamedParameter] - class GenericTorture1 : Name<ISet<string>> { + class GenericTorture1 : Name<ISet<string>> + { } [NamedParameter] class GenericTorture2 : Name<ISet<ISet<string>>> @@ -454,7 +451,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy public interface MyInterface<T> { - } public class RepeatConstructorArg @@ -513,7 +509,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy } public class LeafRepeatedConstructorArgClasses { - public static class A { public class AA @@ -571,7 +566,8 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy } } - class UnannotatedName : Name<string> { + class UnannotatedName : Name<string> + { } interface I1 http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestParameterParser.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestParameterParser.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestParameterParser.cs index 1ab5384..6ece3b3 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestParameterParser.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Tests/ClassHierarchy/TestParameterParser.cs @@ -34,7 +34,6 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy { var parser = new ParameterParser(); Int32 o = (Int32)parser.Parse(typeof(Int32), "4"); - } [Fact] @@ -240,15 +239,22 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy class Foo { public readonly string s; - public Foo(string s) { this.s = s; } + public Foo(string s) + { + this.s = s; + } } class Bar : Foo { - public Bar(string s) : base(s) { } + public Bar(string s) : base(s) + { + } } [NamedParameter] - class SomeNamedFoo : Name<Foo> { } + class SomeNamedFoo : Name<Foo> + { + } class ILikeBars { @@ -278,8 +284,14 @@ namespace Org.Apache.REEF.Tang.Tests.ClassHierarchy [Inject] public TypeParser(String s) { - if (s.Equals("a")) { instance = new ParseTypeA(); } - if (s.Equals("b")) { instance = new ParseTypeB(); } + if (s.Equals("a")) + { + instance = new ParseTypeA(); + } + if (s.Equals("b")) + { + instance = new ParseTypeB(); + } } public ParseableType NewInstance() http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs index d6093e6..a101bbc 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Configuration/TestConfiguration.cs @@ -241,7 +241,6 @@ namespace Org.Apache.REEF.Tang.Tests.Configuration tweeter.sendMessage(); } - [Fact] public void TestTweetConfigWithAvroThroughFile() { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Tests/SmokeTest/RootImplementation.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/SmokeTest/RootImplementation.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/SmokeTest/RootImplementation.cs index 90cf89b..4ff0dbf 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Tests/SmokeTest/RootImplementation.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Tests/SmokeTest/RootImplementation.cs @@ -31,7 +31,7 @@ namespace Org.Apache.REEF.Tang.Tests.SmokeTest private readonly InjectableClass injectableClass; private readonly SetOfImplementations setOfImplementations; private readonly SetOfBaseTypes setOfBaseTypes; - // private readonly ListOfBaseTypes listOfBaseTypes; // TODO: to recover once Avro NuGet support it + //// private readonly ListOfBaseTypes listOfBaseTypes; // TODO: to recover once Avro NuGet support it private readonly CyclicDependency cyclicDependency; [Inject] @@ -43,7 +43,7 @@ namespace Org.Apache.REEF.Tang.Tests.SmokeTest InjectableClass injectableClass, SetOfImplementations setOfImplementations, SetOfBaseTypes setOfBaseTypes, - // ListOfBaseTypes listOfBaseTypes, // TODO: to recover once Avro NuGet support it + //// ListOfBaseTypes listOfBaseTypes, // TODO: to recover once Avro NuGet support it CyclicDependency cyclicDependency) { this.requiredString = requiredString; @@ -54,7 +54,7 @@ namespace Org.Apache.REEF.Tang.Tests.SmokeTest this.injectableClass = injectableClass; this.setOfImplementations = setOfImplementations; this.setOfBaseTypes = setOfBaseTypes; - // this.listOfBaseTypes = listOfBaseTypes; // TODO: to recover once Avro NuGet support it + //// this.listOfBaseTypes = listOfBaseTypes; // TODO: to recover once Avro NuGet support it this.cyclicDependency = cyclicDependency; } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestLegacyConstructors.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestLegacyConstructors.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestLegacyConstructors.cs index e495888..12fae62 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestLegacyConstructors.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestLegacyConstructors.cs @@ -43,7 +43,7 @@ namespace Org.Apache.REEF.Tang.Tests.Tang constructorArg.Add(ReflectionUtilities.GetAssemblyQualifiedName(typeof(int))); constructorArg.Add(ReflectionUtilities.GetAssemblyQualifiedName(typeof(string))); cb.RegisterLegacyConstructor(ReflectionUtilities.GetAssemblyQualifiedName(typeof(LegacyConstructor)), constructorArg); - // cb.Bind(typeof(LegacyConstructor), typeof(LegacyConstructor)); + //// cb.Bind(typeof(LegacyConstructor), typeof(LegacyConstructor)); cb.BindImplementation(GenericType<LegacyConstructor>.Class, GenericType<LegacyConstructor>.Class); IInjector i = tang.NewInjector(cb.Build()); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestTang.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestTang.cs b/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestTang.cs index e749380..f0bb98e 100644 --- a/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestTang.cs +++ b/lang/cs/Org.Apache.REEF.Tang.Tests/Tang/TestTang.cs @@ -81,7 +81,6 @@ namespace Org.Apache.REEF.Tang.Tests.Tang } catch (InjectionException) { - } Assert.IsNull(obj); } @@ -141,7 +140,6 @@ namespace Org.Apache.REEF.Tang.Tests.Tang Assert.IsNotNull(o); } - [TestMethod] public void TestRepeatedNamedArgs() { @@ -392,7 +390,7 @@ namespace Org.Apache.REEF.Tang.Tests.Tang { IInjector i = TangFactory.GetTang().NewInjector(); var ii = (InjectInjector)i.GetInstance(typeof(InjectInjector)); - // Assert.IsTrue(ii.i is IInjector); + //// Assert.IsTrue(ii.i is IInjector); Assert.AreNotSame(i, ii.i); } @@ -524,7 +522,8 @@ namespace Org.Apache.REEF.Tang.Tests.Tang { i.GetInstance<Fail>(); Assert.Fail("Injecting Fail should not have worked!"); - } catch (InjectionException) + } + catch (InjectionException) { i.GetInstance<Pass>(); } @@ -876,13 +875,19 @@ namespace Org.Apache.REEF.Tang.Tests.Tang public float f; [NamedParameter] - public class TCInt : Name<Int32> { } + public class TCInt : Name<Int32> + { + } [NamedParameter] - public class TCString : Name<string> { } + public class TCString : Name<string> + { + } [NamedParameter] - public class TCFloat : Name<float> { } + public class TCFloat : Name<float> + { + } [Inject] public ThreeConstructors([Parameter(typeof(TCInt))] int i, [Parameter(typeof(TCString))] string s) @@ -917,11 +922,14 @@ namespace Org.Apache.REEF.Tang.Tests.Tang public string s; [NamedParameter] - public class TCInt : Name<Int32> { } + public class TCInt : Name<Int32> + { + } [NamedParameter] - public class TCString : Name<string> { } - + public class TCString : Name<string> + { + } [Inject] public TwoConstructors([Parameter(typeof(TCInt))] int i, [Parameter(typeof(TCString))] string s) @@ -938,21 +946,31 @@ namespace Org.Apache.REEF.Tang.Tests.Tang } } - interface SMC { } + interface SMC + { + } class SingletonMultiConst : SMC { [NamedParameter] - public class A : Name<string> { } + public class A : Name<string> + { + } [NamedParameter] - public class B : Name<string> { } + public class B : Name<string> + { + } [Inject] - public SingletonMultiConst([Parameter(typeof(A))] String a) { } + public SingletonMultiConst([Parameter(typeof(A))] String a) + { + } [Inject] - public SingletonMultiConst([Parameter(typeof(A))] string a, [Parameter(typeof(B))] string b) { } + public SingletonMultiConst([Parameter(typeof(A))] string a, [Parameter(typeof(B))] string b) + { + } } internal class ABCName @@ -966,25 +984,25 @@ namespace Org.Apache.REEF.Tang.Tests.Tang { } - // [NamedParameter(DefaultClass = typeof(XAA))] - // public class XNameDA : Name<X<BB>> - // { - // } + //// [NamedParameter(DefaultClass = typeof(XAA))] + //// public class XNameDA : Name<X<BB>> + //// { + //// } [NamedParameter(DefaultClass = typeof(XBB))] public class XNameDB : Name<X<BB>> { } - // [NamedParameter(DefaultClass = typeof(XCC))] - // public class XNameDC : Name<X<BB>> - // { - // } + //// [NamedParameter(DefaultClass = typeof(XCC))] + //// public class XNameDC : Name<X<BB>> + //// { + //// } - // [NamedParameter(DefaultClass = typeof(XCC))] - // public class XNameDAA : Name<XBB> - // { - // } + //// [NamedParameter(DefaultClass = typeof(XCC))] + //// public class XNameDAA : Name<XBB> + //// { + //// } [NamedParameter(DefaultClass = typeof(XXBB))] public class XNameDDAA : Name<XBB> @@ -1053,8 +1071,8 @@ namespace Org.Apache.REEF.Tang.Tests.Tang } } - interface Bottle<Y> { - + interface Bottle<Y> + { } class WaterBottle : Bottle<Water> { @@ -1062,77 +1080,116 @@ namespace Org.Apache.REEF.Tang.Tests.Tang class GasCan : Bottle<Gas> { } - class Water { } - class Gas { } + class Water + { + } + class Gas + { + } [NamedParameter(DefaultClass = typeof(GasCan))] - class WaterBottleName : Name<Bottle<Water>> { } + class WaterBottleName : Name<Bottle<Water>> + { + } - interface IEventHandler<T> { } + interface IEventHandler<T> + { + } class MyEventHandler<T> : IEventHandler<T> { [Inject] - MyEventHandler() { } + MyEventHandler() + { + } } [DefaultImplementation(typeof(MyEventHandler<Foo>))] - interface MyEventHandlerIface : IEventHandler<Foo> { } + interface MyEventHandlerIface : IEventHandler<Foo> + { + } [NamedParameter(DefaultClass = typeof(MyEventHandler<Foo>))] - class FooEventHandler : Name<IEventHandler<Foo>> { } + class FooEventHandler : Name<IEventHandler<Foo>> + { + } internal class Foo : Name<String> { } - interface SomeIface { } + interface SomeIface + { + } + [NamedParameter(DefaultClass = typeof(MyEventHandler<SomeIface>))] - class IfaceEventHandler : Name<IEventHandler<SomeIface>> { } + class IfaceEventHandler : Name<IEventHandler<SomeIface>> + { + } class AH { [Inject] - AH() { } + AH() + { + } } class BH { [Inject] - BH() { } + BH() + { + } } [DefaultImplementation(typeof(AHandlerImpl))] - interface IAHandler : IEventHandler<AH> { } + interface IAHandler : IEventHandler<AH> + { + } [DefaultImplementation(typeof(BHandlerImpl))] - interface IBHandler : IEventHandler<BH> { } + interface IBHandler : IEventHandler<BH> + { + } class AHandlerImpl : IAHandler { [Inject] - public AHandlerImpl() { } + public AHandlerImpl() + { + } } class BHandlerImpl : IBHandler { [Inject] - public BHandlerImpl() { } + public BHandlerImpl() + { + } } class WantSomeHandlers { [Inject] - WantSomeHandlers(IAHandler a, IBHandler b) { } + WantSomeHandlers(IAHandler a, IBHandler b) + { + } } class WantSomeFutureHandlers { [Inject] - WantSomeFutureHandlers(IInjectionFuture<IAHandler> a, IInjectionFuture<IBHandler> b) { } + WantSomeFutureHandlers(IInjectionFuture<IAHandler> a, IInjectionFuture<IBHandler> b) + { + } } [NamedParameter(DefaultClass = typeof(AHandlerImpl))] - class AHandlerName : Name<IEventHandler<AH>> { } + class AHandlerName : Name<IEventHandler<AH>> + { + } [NamedParameter(DefaultClass = typeof(BHandlerImpl))] - class BHandlerName : Name<IEventHandler<BH>> { } + class BHandlerName : Name<IEventHandler<BH>> + { + } class WantSomeFutureHandlersName { @@ -1163,35 +1220,41 @@ namespace Org.Apache.REEF.Tang.Tests.Tang abstract class MultiLayer { - } class MiddleLayer : MultiLayer { - [Inject] - public MiddleLayer() { } + [Inject] + public MiddleLayer() + { + } } class LowerLayer : MiddleLayer { - [Inject] - public LowerLayer() { } + [Inject] + public LowerLayer() + { + } } interface IMultiLayer { - } class MiddleLayerImpl : IMultiLayer { [Inject] - public MiddleLayerImpl() { } + public MiddleLayerImpl() + { + } } class LowerLayerImpl : MiddleLayerImpl { [Inject] - public LowerLayerImpl() { } + public LowerLayerImpl() + { + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Annotations/DefaultImplementation.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Annotations/DefaultImplementation.cs b/lang/cs/Org.Apache.REEF.Tang/Annotations/DefaultImplementation.cs index 44b23f0..359d5b6 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Annotations/DefaultImplementation.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Annotations/DefaultImplementation.cs @@ -35,6 +35,5 @@ namespace Org.Apache.REEF.Tang.Annotations Name = n; Value = val; } - } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Annotations/Inject.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Annotations/Inject.cs b/lang/cs/Org.Apache.REEF.Tang/Annotations/Inject.cs index 21d26e6..c35ce28 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Annotations/Inject.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Annotations/Inject.cs @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -namespace Org.Apache.REEF.Tang.Annotations + +namespace Org.Apache.REEF.Tang.Annotations { /// <summary> /// InjectAttribute http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Annotations/Name.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Annotations/Name.cs b/lang/cs/Org.Apache.REEF.Tang/Annotations/Name.cs index 4526755..45cd42c 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Annotations/Name.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Annotations/Name.cs @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -namespace Org.Apache.REEF.Tang.Annotations + +namespace Org.Apache.REEF.Tang.Annotations { /// <summary> /// Base class for named parameters http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationFile.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationFile.cs b/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationFile.cs index ae8f66e..9840718 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationFile.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationFile.cs @@ -67,7 +67,6 @@ namespace Org.Apache.REEF.Tang.Formats return t.FullName; } - private static string GetFullName(string name) { try @@ -79,7 +78,6 @@ namespace Org.Apache.REEF.Tang.Formats { Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Warning, LOGGER); return name; // if name is not a type, return as it was - } } @@ -121,7 +119,6 @@ namespace Org.Apache.REEF.Tang.Formats l.Add(GetFullName(cn) + Escape('=' + ConfigurationBuilderImpl.INIT + '(' + sb.ToString() + ')')); } - IEnumerator bs = conf.GetBoundSets(); while (bs.MoveNext()) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationModuleBuilder.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationModuleBuilder.cs b/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationModuleBuilder.cs index 47e1179..7476781 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationModuleBuilder.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Formats/ConfigurationModuleBuilder.cs @@ -172,7 +172,7 @@ namespace Org.Apache.REEF.Tang.Formats c.reqUsed.AddAll(d.Builder.reqUsed); c.optUsed.AddAll(d.Builder.optUsed); c.SetOpts.AddAll(d.Builder.SetOpts); - // c.ListOpts.AddAll(d.Builder.ListOpts); + //// c.ListOpts.AddAll(d.Builder.ListOpts); c.Map.AddAll(d.Builder.Map); c.FreeImpls.AddAll(d.Builder.FreeImpls); c.FreeParams.AddAll(d.Builder.FreeParams); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AbstractNode.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AbstractNode.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AbstractNode.cs index f6b9c06..8228130 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AbstractNode.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AbstractNode.cs @@ -94,21 +94,35 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy public override bool Equals(Object o) { - if (o == null) return false; - if (o == this) return true; + if (o == null) + { + return false; + } + if (o == this) + { + return true; + } AbstractNode n = (AbstractNode)o; bool parentsEqual; - if (n.parent == this.parent) { + if (n.parent == this.parent) + { parentsEqual = true; - } else if (n.parent == null) { + } + else if (n.parent == null) + { parentsEqual = false; - } else if (this.parent == null) { + } + else if (this.parent == null) + { parentsEqual = false; - } else { + } + else + { parentsEqual = n.parent.Equals(this.parent); } - if (!parentsEqual) { + if (!parentsEqual) + { return false; } return fullName.Equals(n.fullName); http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AvroClassHierarchy.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AvroClassHierarchy.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AvroClassHierarchy.cs index 134bdbe..70dc67f 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AvroClassHierarchy.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/AvroClassHierarchy.cs @@ -154,7 +154,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy var ex = new IllegalStateException("When reading protocol buffer node " + n + " refers to non-existent implementation:" + impl); Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); - } catch (InvalidCastException e) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassHierarchyImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassHierarchyImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassHierarchyImpl.cs index 8e2ff59..a07cd37 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassHierarchyImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassHierarchyImpl.cs @@ -47,7 +47,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy // alias is indexed by language, for each language, a mapping between alias and corresponding name kept in a Dictionary private readonly IDictionary<string, IDictionary<string, string>> _aliasLookupTable = new Dictionary<string, IDictionary<string, string>>(); - public ParameterParser Parameterparser = new ParameterParser(); public ClassHierarchyImpl(string file) : this(new string[] { file }, new Type[0]) @@ -265,7 +264,8 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy } INamedParameterNode np = NodeFactory.CreateNamedParameterNode(parent, type, argType); - if (Parameterparser.CanParse(ReflectionUtilities.GetAssemblyQualifiedName(argType))) { + if (Parameterparser.CanParse(ReflectionUtilities.GetAssemblyQualifiedName(argType))) + { if (type.GetCustomAttribute<NamedParameterAttribute>().DefaultClass != null) { var e = new ClassHierarchyException("Named parameter " + ReflectionUtilities.GetAssemblyQualifiedName(type) + " defines default implementation for parsable type " + ReflectionUtilities.GetAssemblyQualifiedName(argType)); @@ -312,7 +312,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(e, LOGGER); } shortNames.Add(shortName, np); - } return np; } @@ -340,7 +339,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy } } } - } return null; } @@ -366,9 +364,8 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy } } return null; - // throw new NameResolutionException(t.FullName, sb.ToString()); + //// throw new NameResolutionException(t.FullName, sb.ToString()); } - } return current; } @@ -480,7 +477,10 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy public IClassHierarchy Merge(IClassHierarchy ch) { - if (this == ch) { return this; } + if (this == ch) + { + return this; + } if (!(ch is ClassHierarchyImpl)) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassNodeImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassNodeImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassNodeImpl.cs index 759ecc4..b19a94b 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassNodeImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ClassNodeImpl.cs @@ -46,7 +46,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy String defaultImplementation) : base(parent, simpleName, fullName) { - this.unit = unit; this.injectable = injectable; this.externalConstructor = externalConstructor; http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorArgImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorArgImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorArgImpl.cs index 052f0e1..b8eb385 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorArgImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorArgImpl.cs @@ -88,7 +88,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy return false; } return name.Equals(arg.name); - } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorDefImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorDefImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorDefImpl.cs index 61d17df..5c0506e 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorDefImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ConstructorDefImpl.cs @@ -106,10 +106,14 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy break; } } + // If not, then argument j from def is not in our list. Return false. if (found == false) + { return false; + } } + // Everything in def's arg list is in ours. Do we have at least one extra // argument? return GetArgs().Count > def.GetArgs().Count; @@ -142,7 +146,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy { i++; } - } return true; } @@ -196,7 +199,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy { return true; } - } return false; } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/NodeFactory.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/NodeFactory.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/NodeFactory.cs index bfb2a79..525e4f0 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/NodeFactory.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/NodeFactory.cs @@ -45,8 +45,9 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy var unit = null != clazz.GetCustomAttribute<UnitAttribute>(); string simpleName = ReflectionUtilities.GetName(clazz); string fullName = ReflectionUtilities.GetAssemblyQualifiedName(clazz); - // bool isStatic = true; // clazz.IsSealed && clazz.IsAbstract; always true in C# for Java static class - // bool injectable = true; // always true in C# + + //// bool isStatic = true; // clazz.IsSealed && clazz.IsAbstract; always true in C# for Java static class + //// bool injectable = true; // always true in C# bool isAssignableFromExternalConstructor = ReflectionUtilities.IsAssignableFromIgnoreGeneric(typeof(IExternalConstructor<>), clazz); @@ -88,7 +89,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy } } allConstructors.Add(constructorDef); - } string defaultImplementation = null; @@ -175,7 +175,8 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy { Type setRawArgType = ReflectionUtilities.GetInterfaceTarget(typeof(ISet<>), argClass); bool isSet = setRawArgType != null; - if (isSet) { + if (isSet) + { argClass = setRawArgType; } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/PackageNodeImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/PackageNodeImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/PackageNodeImpl.cs index 3721438..90578e5 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/PackageNodeImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/PackageNodeImpl.cs @@ -39,7 +39,8 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy * children into account. Therefore, we use the full name as the key when * we insert nodes into the root. */ - public override void Add(INode n) { + public override void Add(INode n) + { children.Add(n.GetFullName(), n); } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ParameterParser.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ParameterParser.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ParameterParser.cs index 4e750dc..35531b6 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ParameterParser.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/ClassHierarchy/ParameterParser.cs @@ -62,7 +62,6 @@ namespace Org.Apache.REEF.Tang.Implementations.ClassHierarchy parsers.Add(ReflectionUtilities.GetAssemblyQualifiedName(clazz), c); } - public void MergeIn(ParameterParser p) { foreach (string s in p.parsers.Keys) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/ConfigurationBuilderImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/ConfigurationBuilderImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/ConfigurationBuilderImpl.cs index e64118e..27c3a24 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/ConfigurationBuilderImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/ConfigurationBuilderImpl.cs @@ -68,7 +68,8 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration public ConfigurationBuilderImpl(ConfigurationBuilderImpl t) { this.ClassHierarchy = t.GetClassHierarchy(); - try { + try + { AddConfiguration(t.GetClassHierarchy(), t); } catch (BindException e) @@ -146,18 +147,20 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration foreach (KeyValuePair<INamedParameterNode, object> e in builder.BoundSetEntries) { - String name = ((INamedParameterNode)e.Key).GetFullName(); - if (e.Value is INode) - { + String name = ((INamedParameterNode)e.Key).GetFullName(); + if (e.Value is INode) + { BindSetEntry(name, (INode)e.Value); - } - else if (e.Value is string) - { + } + else if (e.Value is string) + { BindSetEntry(name, (string)e.Value); - } else { - var ex = new IllegalStateException(string.Format(CultureInfo.CurrentCulture, "The value {0} set to the named parameter {1} is illegel.", e.Value, name)); - Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); - } + } + else + { + var ex = new IllegalStateException(string.Format(CultureInfo.CurrentCulture, "The value {0} set to the named parameter {1} is illegel.", e.Value, name)); + Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); + } } foreach (var p in builder.BoundLists) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/CsConfigurationBuilderImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/CsConfigurationBuilderImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/CsConfigurationBuilderImpl.cs index 6698006..ae2bf17 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/CsConfigurationBuilderImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/Configuration/CsConfigurationBuilderImpl.cs @@ -184,7 +184,8 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration return ((ICsInternalConfigurationBuilder)this).BindConstructor(typeof(T), typeof(U)); } - // public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, String value) throws BindException; + //// public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, String value) throws BindException; + /// <summary> /// Binds a string value to a named parameter of ISet. /// </summary> @@ -199,7 +200,8 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration return ((ICsInternalConfigurationBuilder)this).BindSetEntry(typeof(U), value); } - // public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, Class<? extends T> impl) throws BindException; + //// public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, Class<? extends T> impl) throws BindException; + /// <summary> /// Binds an implementation of T to a named parameter of ISet of T. /// </summary> @@ -310,7 +312,8 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration return this; } - // public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, String value) throws BindException; + //// public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, String value) throws BindException; + /// <summary> /// Binds a string value to to a named parameter of ISet entry /// </summary> @@ -335,12 +338,13 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration var ex = new BindException("BindSetEntry got a NamedParameter that takes a " + setType + "; expected Set<...>"); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); } - // Type valType = ReflectionUtilities.getInterfaceTarget(Set.class, setType); + //// Type valType = ReflectionUtilities.getInterfaceTarget(Set.class, setType); BindSetEntry((INamedParameterNode)n, value); return this; } - // public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, Class<? extends T> impl) throws BindException; + //// public <T> void bindSetEntry(Class<? extends Name<Set<T>>> iface, Class<? extends T> impl) throws BindException; + /// <summary> /// Binds an implementation to a named parameter of ISet entry. /// </summary> @@ -370,7 +374,7 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration Type valType = ReflectionUtilities.GetInterfaceTarget(typeof(ISet<>), setType); if (!valType.IsAssignableFrom(impl)) - // if (!ReflectionUtilities.GetRawClass(valType).IsAssignableFrom(impl)) + //// if (!ReflectionUtilities.GetRawClass(valType).IsAssignableFrom(impl)) { var ex = new BindException("BindSetEntry got implementation " + impl + " that is incompatible with expected type " + valType); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); @@ -401,7 +405,8 @@ namespace Org.Apache.REEF.Tang.Implementations.Configuration return this; } - // public <T> void bindConstructor(Class<T> c, Class<? extends ExternalConstructor<? extends T>> v) throws BindException; + //// public <T> void bindConstructor(Class<T> c, Class<? extends ExternalConstructor<? extends T>> v) throws BindException; + /// <summary> /// Binds an external constructor. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Constructor.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Constructor.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Constructor.cs index a8a90a5..a1f1704 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Constructor.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Constructor.cs @@ -136,7 +136,6 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan public override string ToAmbiguousInjectString() { - if (!isAmbiguous) { var ex = new ArgumentException(GetNode().GetFullName() + " is NOT ambiguous."); @@ -168,7 +167,8 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan if (ip.IsInfeasibleLeaf()) { leaves.Add(ip); - } else + } + else { return ip.ToInfeasibleInjectString(); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionFuture.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionFuture.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionFuture.cs index 22b260c..54f068b 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionFuture.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionFuture.cs @@ -24,7 +24,6 @@ using Org.Apache.REEF.Tang.Util; namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan { - public interface IInjectionFuture<out T> { T Get(); @@ -74,7 +73,10 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan public T Get() { - if (instance != null) return instance; + if (instance != null) + { + return instance; + } lock (injector) { T t; @@ -94,6 +96,5 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan return t; } } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionPlan.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionPlan.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionPlan.cs index baf4502..8c97739 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionPlan.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectionPlan.cs @@ -62,7 +62,7 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan abstract public bool IsInjectable(); - // abstract public bool HasFutureDependency(); + //// abstract public bool HasFutureDependency(); protected void pad(StringBuilder sb, int n) { @@ -169,12 +169,10 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan public abstract bool IsInfeasibleLeaf(); public abstract string ToShallowString(); - } public class BuildingInjectionPlan : InjectionPlan { - public BuildingInjectionPlan(INode node) : base(node) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectorImpl.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectorImpl.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectorImpl.cs index 30c9cdf..ab18fec 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectorImpl.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/InjectorImpl.cs @@ -46,7 +46,6 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan static readonly InjectionPlan BUILDING = new BuildingInjectionPlan(null); // TODO anonymous class - private bool concurrentModificationGuard = false; private void AssertNotConcurrent() @@ -223,10 +222,10 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan } Type t = classHierarchy.ClassForName(typeOfSet); + // MakeGenericType(t = int: MonotonicHashSet<> -> MonotonicHashSet<int> // Get constructor: MonotonicHashSet<int> -> public MonotonicHashSet<int>() { ... } // Invoke: public MonotonicHashSet<int> -> new MonotonicHashSet<int>() - object ret = typeof(MonotonicHashSet<>).MakeGenericType(t).GetConstructor(new Type[] { }).Invoke(new object[] { }); // (this, classHierarchy.ClassForName(fut.GetNode().GetFullName())); MethodInfo mf = ret.GetType().GetMethod("Add"); @@ -279,7 +278,7 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan private object GetCachedInstance(IClassNode cn) { if (cn.GetFullName().Equals(ReflectionUtilities.GetAssemblyQualifiedName(typeof(IInjector)))) - // if (cn.GetFullName().Equals(ReflectionUtilities.NonGenericFullName(typeof(IInjector)))) + //// if (cn.GetFullName().Equals(ReflectionUtilities.NonGenericFullName(typeof(IInjector)))) { return this.ForkInjector(); // TODO: We should be insisting on injection futures here! .forkInjector(); } @@ -315,8 +314,9 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan } ConstructorInfo cons = clazz.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, parameterTypes, null); - // TODO - // cons.setAccessible(true); + + //// TODO + //// cons.setAccessible(true); if (cons == null) { @@ -393,7 +393,6 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan { ip = new CsInstance(np, instance); } - } else if (n is IClassNode) { @@ -589,6 +588,7 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan liveIndices.Add(i); } } + // Now, do an all-by-all comparison, removing indices that are dominated // by others. int k = -1; @@ -622,7 +622,6 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan return sub_ips; } - private InjectionPlan WrapInjectionPlans(IClassNode infeasibleNode, List<InjectionPlan> list, bool forceAmbiguous, int selectedIndex) { @@ -982,12 +981,15 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan { IClassNode cn = (IClassNode)n; object old = GetCachedInstance(cn); - if (old != null) { + if (old != null) + { Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new BindException("Attempt to re-bind instance. Old value was " + old + " new value is " + o), LOGGER); } instances.Add(cn, o); - } else { + } + else + { Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("Expected Class but got " + c + " (probably a named parameter)."), LOGGER); } @@ -1087,7 +1089,6 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan public InjectionPlan GetInjectionPlan(string name) { return GetInjectionPlan(this.classHierarchy.GetNode(name)); - } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Subplan.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Subplan.cs b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Subplan.cs index e06030e..5cb41c9 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Subplan.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Implementations/InjectionPlan/Subplan.cs @@ -231,6 +231,5 @@ namespace Org.Apache.REEF.Tang.Implementations.InjectionPlan { return false; } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Interface/ICsClassHierarchy.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Interface/ICsClassHierarchy.cs b/lang/cs/Org.Apache.REEF.Tang/Interface/ICsClassHierarchy.cs index 661f48e..f298525 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Interface/ICsClassHierarchy.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Interface/ICsClassHierarchy.cs @@ -28,7 +28,5 @@ namespace Org.Apache.REEF.Tang.Interface Type ClassForName(string name); object Parse(INamedParameterNode name, string value); object ParseDefaultValue(INamedParameterNode name); - - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Interface/IExternalConstructor.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Interface/IExternalConstructor.cs b/lang/cs/Org.Apache.REEF.Tang/Interface/IExternalConstructor.cs index 86efd1f..53fca26 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Interface/IExternalConstructor.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Interface/IExternalConstructor.cs @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ - + namespace Org.Apache.REEF.Tang.Interface { public interface IExternalConstructor<out T> { T NewInstance(); } -} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs index 27ae514..31cfd34 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferClassHierarchy.cs @@ -40,7 +40,6 @@ namespace Org.Apache.REEF.Tang.Protobuf private readonly IDictionary<string, INode> lookupTable = new Dictionary<string, INode>(); private readonly IDictionary<string, IDictionary<string, string>> _aliasLookupTable = new Dictionary<string, IDictionary<string, string>>(); - public static void Serialize(string fileName, IClassHierarchy classHierarchy) { Org.Apache.REEF.Tang.Protobuf.Node node = Serialize(classHierarchy); @@ -274,6 +273,7 @@ namespace Org.Apache.REEF.Tang.Protobuf { Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(new ArgumentException("Expected a package node. Got: " + root), LOGGER); } + // Register all the classes. foreach (Org.Apache.REEF.Tang.Protobuf.Node child in root.children) { @@ -377,7 +377,6 @@ namespace Org.Apache.REEF.Tang.Protobuf { IConstructorDef def = ParseConstructorDef(other, false); allConstructors.Add(def); - } IConstructorDef[] dummy = new ConstructorDefImpl[0]; @@ -436,7 +435,6 @@ namespace Org.Apache.REEF.Tang.Protobuf var ex = new IllegalStateException("When reading protocol buffer node " + n + " refers to non-existent implementation:" + impl); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); - } catch (InvalidCastException e) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs index 0719a0d..7652e4b 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Protobuf/ProtocolBufferInjectionPlan.cs @@ -73,7 +73,6 @@ namespace Org.Apache.REEF.Tang.Protobuf plan.name = fullName; plan.instance = instance; return plan; - } public static void Serialize(string fileName, Org.Apache.REEF.Tang.Implementations.InjectionPlan.InjectionPlan ip) @@ -109,7 +108,6 @@ namespace Org.Apache.REEF.Tang.Protobuf subPlans[i] = Serialize(args[i]); } return NewSubplan(ip.GetNode().GetFullName(), sp.GetSelectedIndex(), subPlans.ToList<Org.Apache.REEF.Tang.Protobuf.InjectionPlan>()); - } if (ip is CsInstance) { http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Types/IConstructorArg.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Types/IConstructorArg.cs b/lang/cs/Org.Apache.REEF.Tang/Types/IConstructorArg.cs index d77b139..31f09c4 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Types/IConstructorArg.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Types/IConstructorArg.cs @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - + namespace Org.Apache.REEF.Tang.Types { public interface IConstructorArg http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Types/IPackageNode.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Types/IPackageNode.cs b/lang/cs/Org.Apache.REEF.Tang/Types/IPackageNode.cs index 873f511..463291f 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Types/IPackageNode.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Types/IPackageNode.cs @@ -16,9 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -namespace Org.Apache.REEF.Tang.Types + +namespace Org.Apache.REEF.Tang.Types { public interface IPackageNode : INode { } -} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Util/AssemblyLoader.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Util/AssemblyLoader.cs b/lang/cs/Org.Apache.REEF.Tang/Util/AssemblyLoader.cs index 156f297..c0faf59 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Util/AssemblyLoader.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Util/AssemblyLoader.cs @@ -65,7 +65,9 @@ namespace Org.Apache.REEF.Tang.Util { t = a.GetType(name); if (t != null) + { break; + } } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs b/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs index a5356c9..b70f48f 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Util/ReflectionUtilities.cs @@ -180,7 +180,7 @@ namespace Org.Apache.REEF.Tang.Util public static IEnumerable<Type> ClassAndAncestorsExcludeSelf(Type c) { List<Type> workQueue = new List<Type>(); - // workQueue.Add(c); // including itself + //// workQueue.Add(c); // including itself foreach (Type t in c.GetInterfaces()) { @@ -275,7 +275,7 @@ namespace Org.Apache.REEF.Tang.Util //// && Number.class.isAssignableFrom(from)) { ////return sizeof.get(from) <= sizeof.get(to); return to.IsAssignableFrom(from); - // return IsAssignableFromIgnoreGeneric(to, from); + //// return IsAssignableFromIgnoreGeneric(to, from); } /// <summary> @@ -367,7 +367,9 @@ namespace Org.Apache.REEF.Tang.Util { t = a.GetType(name); if (t != null) + { break; + } } } if (t == null) @@ -453,7 +455,6 @@ namespace Org.Apache.REEF.Tang.Util var ex = new ClassHierarchyException("Named parameter " + GetName(type) + " implements " + "multiple interfaces. It is only allowed to implement Name<T>"); Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Throw(ex, LOGGER); - } else if (intfs.Length == 0 || !IsName(intfs[0])) { @@ -497,9 +498,13 @@ namespace Org.Apache.REEF.Tang.Util public static IEnumerable<Type> GetInterfaces(Type type, bool includeInherited) { if (includeInherited || type.BaseType == null) + { return type.GetInterfaces(); + } else + { return type.GetInterfaces().Except(type.BaseType.GetInterfaces()); + } } // Here is a more elaborate hack to test for anonymous type: http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Tang/Util/SetValuedKey.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Tang/Util/SetValuedKey.cs b/lang/cs/Org.Apache.REEF.Tang/Util/SetValuedKey.cs index 35580a8..c9ff5f9 100644 --- a/lang/cs/Org.Apache.REEF.Tang/Util/SetValuedKey.cs +++ b/lang/cs/Org.Apache.REEF.Tang/Util/SetValuedKey.cs @@ -49,7 +49,10 @@ namespace Org.Apache.REEF.Tang.Util public override bool Equals(Object o) { SetValuedKey other = (SetValuedKey)o; - if (other.key.Count != this.key.Count) { return false; } + if (other.key.Count != this.key.Count) + { + return false; + } for (int i = 0; i < this.key.Count; i++) { if (this.key[i].Equals(other.key[i])) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake.Tests/StreamingTransportTest.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake.Tests/StreamingTransportTest.cs b/lang/cs/Org.Apache.REEF.Wake.Tests/StreamingTransportTest.cs index 440333e..8e11e69 100644 --- a/lang/cs/Org.Apache.REEF.Wake.Tests/StreamingTransportTest.cs +++ b/lang/cs/Org.Apache.REEF.Wake.Tests/StreamingTransportTest.cs @@ -85,7 +85,6 @@ namespace Org.Apache.REEF.Wake.Tests [Fact] public void TestStreamingTransportSenderStage() { - IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, 0); List<string> events = new List<string>(); @@ -160,7 +159,6 @@ namespace Org.Apache.REEF.Wake.Tests } Assert.Equal(numEventsExpected, events.Count); - } private static ITcpPortProvider GetTcpProvider(int portRangeStart, int portRangeEnd) http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake.Tests/TransportTest.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake.Tests/TransportTest.cs b/lang/cs/Org.Apache.REEF.Wake.Tests/TransportTest.cs index ce3438c..3cbed74 100644 --- a/lang/cs/Org.Apache.REEF.Wake.Tests/TransportTest.cs +++ b/lang/cs/Org.Apache.REEF.Wake.Tests/TransportTest.cs @@ -43,7 +43,6 @@ namespace Org.Apache.REEF.Wake.Tests BlockingCollection<string> queue = new BlockingCollection<string>(); List<string> events = new List<string>(); - IPEndPoint endpoint = new IPEndPoint(_localIpAddress, 0); var remoteHandler = Observer.Create<TransportEvent<string>>(tEvent => queue.Add(tEvent.Data)); @@ -207,7 +206,6 @@ namespace Org.Apache.REEF.Wake.Tests } } - private static ITcpPortProvider GetTcpProvider(int portRangeStart, int portRangeEnd) { var configuration = TangFactory.GetTang().NewConfigurationBuilder() @@ -217,6 +215,5 @@ namespace Org.Apache.REEF.Wake.Tests .Build(); return TangFactory.GetTang().NewInjector(configuration).GetInstance<ITcpPortProvider>(); } - } } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs b/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs index 28f182c..36e5919 100644 --- a/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs +++ b/lang/cs/Org.Apache.REEF.Wake/Examples/P2p/Pull2Push.cs @@ -81,6 +81,7 @@ namespace Org.Apache.REEF.Wake.Examples.P2p { // Add the source to the end of the queue again. _sources.Enqueue(nextSource); + // Send the message. Note that this may block depending on the underlying EventHandler. _output.OnNext(message); } http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake/Remote/IDataReader.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/IDataReader.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/IDataReader.cs index 8c78a89..3dd2c73 100644 --- a/lang/cs/Org.Apache.REEF.Wake/Remote/IDataReader.cs +++ b/lang/cs/Org.Apache.REEF.Wake/Remote/IDataReader.cs @@ -132,7 +132,6 @@ namespace Org.Apache.REEF.Wake.Remote /// <returns>Task handler that reads string</returns> Task<string> ReadStringAsync(CancellationToken token); - /// <summary> /// Reads data in to the buffer asynchronously /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake/Remote/IRemoteManagerFactory.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/IRemoteManagerFactory.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/IRemoteManagerFactory.cs index 36a1adc..21f88dc 100644 --- a/lang/cs/Org.Apache.REEF.Wake/Remote/IRemoteManagerFactory.cs +++ b/lang/cs/Org.Apache.REEF.Wake/Remote/IRemoteManagerFactory.cs @@ -46,7 +46,6 @@ namespace Org.Apache.REEF.Wake.Remote /// <param name="codec">The codec used for serializing messages</param> IRemoteManager<T> GetInstance<T>(IPAddress localAddress, ICodec<T> codec); - /// <summary> /// Constructs a DefaultRemoteManager. Does not listen for incoming messages. /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/StreamingTransportServer.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/StreamingTransportServer.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/StreamingTransportServer.cs index a2456f5..8f1e5e3 100644 --- a/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/StreamingTransportServer.cs +++ b/lang/cs/Org.Apache.REEF.Wake/Remote/Impl/StreamingTransportServer.cs @@ -113,7 +113,6 @@ namespace Org.Apache.REEF.Wake.Remote.Impl String.Format("Listening on {0}", _listener.LocalEndpoint.ToString())); } - /// <summary> /// Close the TransportServer and all open connections /// </summary> http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake/Remote/TcpPortProvider.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake/Remote/TcpPortProvider.cs b/lang/cs/Org.Apache.REEF.Wake/Remote/TcpPortProvider.cs index 8d0e8ba..04061a5 100644 --- a/lang/cs/Org.Apache.REEF.Wake/Remote/TcpPortProvider.cs +++ b/lang/cs/Org.Apache.REEF.Wake/Remote/TcpPortProvider.cs @@ -107,5 +107,4 @@ namespace Org.Apache.REEF.Wake.Remote } } } - } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/reef/blob/9cdd62d9/lang/cs/Org.Apache.REEF.Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs ---------------------------------------------------------------------- diff --git a/lang/cs/Org.Apache.REEF.Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs b/lang/cs/Org.Apache.REEF.Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs index f6fd482..48e9c42 100644 --- a/lang/cs/Org.Apache.REEF.Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs +++ b/lang/cs/Org.Apache.REEF.Wake/Util/LimitedConcurrencyLevelTaskScheduler.cs @@ -168,15 +168,18 @@ namespace Org.Apache.REEF.Wake.Util --_delegatesQueuedOrRunning; break; } + // Get the next item from the queue item = _tasks.First.Value; _tasks.RemoveFirst(); } + // Execute the task we pulled out of the queue base.TryExecuteTask(item); } } - // We're done processing items on the current thread + + // We're done processing items on the current thread finally { _currentThreadIsProcessingItems = false;
