Background: I am doing the unit test in ECLIPSE 2021-06 (4.20.0) on method findDetailResult() in StartProcessing class. When I am doing testFindDetailResult() in testStartProcessing, I am testing the findDetailResult() to find the result of std1. Steps to Reproduce: 1. Run the package with testHall_Admission 2. Run the method “void testFindDetailResult” in testStartProcessing class Actual result: The system output the error message of “java.lang.NullPointerException: Cannot invoke “HallAdmissionSystem.Application.equals(object)” because “this.admisionList[i] is null”” while the method was being run. Expected result: I expected the system to output the details of the object “std1”.
I just tried to run this test, I also got the same error. I did briefly go through the code, I am not sure about the problems. It seems like involved the whole set of process objects. This may take time to fix. I will pass it to the developer to solve this error.
I just checked the problems, seem like the storage of object have problems. And the problem seems triggered chain reactions. Plus, the code is messy, it is hard for me to know which sections have problems as the applications object, hall and queue are stored all over the place. It made the code hard to read. I recommend we rewrite the whole process section.
As now the progress is tight, redoing the major function may be risky and cause the project setback. Are you sure we are not able to maintain the current structure or code to solve the error? Is it a must to rewrite the whole section of the code?
According to the current code, now have “StartProcess”, “ProcessData” and “Result”. Their role is unclear and the ArrayLists are all over the place. So when we carry out the process functions, the calling of object and data storage is unclear which made debugging and function expansion hard to carry out. So if we do it now, can help the current debugging and future functions expansions.
Ok, understand the situation. I approve the rewrite of the Process Sections. Please finish this function rewrite as soon as possible.
I just finished the update the code and uploaded it to GitHub. Solution: =============== I have removed class “StartProcess”, “ProcessData” and “Result” and replaced them with “ProcessApplication”, “ProcessInformation” and “ProcessResult”. “ProcessApplication” will store all the initial applications, “ProcessInformation” will store all the process queue and “ProcessResult” will store the final result.