小编Sco*_*oZA的帖子

堆栈溢出异常,没有递归

我遇到堆栈溢出异常的问题,但我不知道是什么导致异常被抛出.我正在使用一个类库,其中包含我需要的所有方法和对象,并从控制台应用程序运行它.

任何帮助将不胜感激,因为这是一个任务的一部分,将在几个小时内到期.

这是我的代码:

TrafficIncidentNotificationRadiusCalculator类

namespace TrafficIncident
{
public class TrafficIncidentNotificationRadiusCalculator
{
    public double meters;
    public double CONFIGURED_NOTIFICATION_RADIUS
    {
        get { return CONFIGURED_NOTIFICATION_RADIUS; }
        set { CONFIGURED_NOTIFICATION_RADIUS = meters; }
    }

    public List<string> GetNotificationRecipientsList(List<User> users, List<UserLocationUpdate> userLocation, TrafficIncidentReport report)
    {
        int i = 0;
        List<string> userNotificationIds = new List<string>();
        while (i < userLocation.Count)
        {
            UserLocationUpdate userLoc = userLocation.ElementAt(i);
            userNotificationIds.Add(userLoc.userNotificationId);
            Console.WriteLine(userNotificationIds.ElementAt(i));
            i++;
        } 
        return userNotificationIds;
    }
}
}
Run Code Online (Sandbox Code Playgroud)

TrafficIncidentReport类

namespace TrafficIncident
{
public class TrafficIncidentReport
{
    public double[] incidentLocation;

    public double latitude …
Run Code Online (Sandbox Code Playgroud)

c# stack-overflow class-library console-application

-2
推荐指数
1
解决办法
121
查看次数