Join GitHub today
Each UCOSP participant is asked to log all the steps they take as they make progress through the semester. This includes difficulties they faced (getting set up, understanding how to model in Umple, using UmpleOnline, code that is difficult to figure out, and development tools that are hard to figure out, or don't seem to work properly). The more log entries added the more we can better get a grip on the usability issues with Umple, and the more we can help future new contributors come up to speed.
Please record entries in reverse chronological order
2018-11-9 ~ 2018-11-10
I have added type checking for all primitives -- integer, float, double, character, boolean, time and date.
I have fixed the bug Tim mentioned on 2018-11-3. I am considering to move forward to the second step -- type checking for input.
Tim finds my fix does not work for the Accident example. A message with the following information appeared:
Strong offset case occurred in show_element.php on line 179 Uninitialized strong offset: 41 in show_element.php on line 183
I keep doing the first step. It looks good for the Airline example.
After some tests, I realize that the first step has not been finished yet. My fix cannot deal with complex classes.
2018-10-28 ~ 2018-10-29
Finished the first step of fixing issue 535 -- make the output of each object look nice. I will work on the second step -- check the type of every input on this week.
Fix issue 1176
2018-10-20 ~ 2018-10-21
After comparing the compiling process on Windows with that on Ubuntu, I found something wrong in the method "translateLineToUmple" of cruise.umple/src/Compiler.ump. It does not deal well with the path name on Windows. After this fix, there are no failures in CompilerErrorOutputTest and RuntimeErrorOutputTest on my own PC. I am waiting for Tim to activate the error output tests to see whether there are any failing test cases in Appveyor.
Keep working on issue 1176. Dug into the changed files of PR 1167. I found that the program doesn't call any of changed methods/functions of PR 1167 when compiling erroneous umple code on Windows. It is tricky to figure out where the problem is.
I tried to find something to do with line end (like System.lineSeparator), but I failed to find something wrong. So I traced back to the command "java -jar umple.jar -c- ..." itself, wanting to figure out the whole process of executing this command. It takes a while. I plan to ask Tim why he thinks the bug on Windows perhaps has something to do with line end.
Tried to find the bug related to issue #1176. The error messages generated by "java -jar umple.jar -c- ..." vary from system to system. For example, if I compile umple/testbed/test/cruise/compiler/src/Abstract_Method.ump, on Ubuntu, the error message is
Warning 1008 on line 6 of file 'Abstract_Method.ump': Method syntax could not be processed. It has been considered as Extra Code Abstract_Method.ump:6: error: abstract methods cannot have a body abstract void foo () ^ 1 error
On Windows, the error message is
Warning 1008 on line 6 of file 'Abstract_Method.ump': Method syntax could not be processed. It has been considered as Extra Code D:\project\umple\umple\build\..\testbed\test\cruise\compiler\src\..\src-gen-umple\AbstractMethod.java:33: error: abstract methods cannot have a body abstract void foo () ^ 1 error
The difference is that on Ubuntu the compiler points out the error in original umple file, while on Windows the compiler points out the error in the generated java file. Tim suggests that there is something to do with line end.
Fixed issue #1056
Tim thinks the different behaviors of my system and Appveyor may be due to my Chinese localization of Java. However, the outcome does not change after I run a full build on Windows of English system. I am not familiar with Appveyor. But I doubt the different behaviors are due to the system difference and configuration difference between my local system and Appveyor.
Furthermore, I almost fixed issue 1056. I make Ctrl+A still toggle attributes and Ctrl-Shift+A select all text on non-mac computers. This modification will ensure that the bindings still work in the same way on mac and popup labels remain consistent. Since I don't have a mac and Ctrl+A is a public shortcut to toggle attributes on both mac and non-mac, I am not sure whether it will change the bindings for mac if I make Ctrl+A select all text on non-mac machines. Thus, I am asking Tim if I can make Ctrl-Shift+A select all text on non-mac computers.
I pulled the branch "Java11AndIssue1176". Oddly enough, I see 16 failures in CompilerErrorOutputTests which is different from the actual behavior of Appveyor, 6 failures in RuntimeErrorOutputTests. Based on the 16 failures in CompilerErrorOutputTests, I guess the program does not compare the compiler error messages with the expected error messages. Instead, it just outputs the compiler error messages and terminates the tests with failure.
I installed Ubuntu on my virtual machine and set up the development environment completely, including UmpleOnline. The performance of the virtual machine is quite good (finish a quick build within 40 seconds)! From next week, I will read the code related to UmpleOnline and start fixing issue #535.
My new laptop arrived!
Partially fixed issue #1176 and did a pull request.
2018-09-20 ~ 2018-09-23 Code Sprint
With the generous help of Tim, I figured out how to compile, or do a quick build and where my problem is. The issue (#487) is because the super code generator does not distinguish primitives from objects well. The issue was fixed by modifying and adding some logic to distinguish primitives from objects. Then I was assigned issue #535. It is labeled hard. I will try my best. Since Gloria and Geniya found it really difficult to set up UmpleOnline on Windows, I am waiting for my new laptop and planning to install Ubuntu and work on Ubuntu.
Today, I worked on issue #487. I tested the behavior of UmpleOnline when I input an ordinary "if" statement and a guard in a state machine. The generated code is good when I input an ordinary "if" statement. The problem is related to guard. Here are test cases and results for a guard (On the left of "->" is the original umple code. Generated Java code is on the right hand side):
If a and b are strings,
1. a.equals(b) -> getA().equals(getB()) --Right 2. a == b -> getA().equals(getB()) --Wrong 3. getA().equals(b) -> getA().equals(getB()) --Right 4. getA() == b -> getA().equals(getB()) --Wrong
If a and b are boolean variables,
a == b -> getA()==getB() --Right getA() == b -> getA()==getB() --Right a == getB() -> getA()==getB() --Right getA() == getB() -> getA().equals(getB()) --Wrong a == false -> getA()==false --Right getA() == false -> getA().equals(false) --Wrong false == a -> false==getA() --Right false == getA() -> false.equals(getA()) --Wrong
I looked for patterns in the output. I found if we compare 2 objects, the generator will generate ".equals()" no matter whether we use ".equals()" or "==". If we compare 2 boolean variables, the behavior is complex.
If the boolean variables are both declared in the class, it will generate "==". If the boolean variables are both in the "getSomething()" format, it will generate ".equals()". If one of them is declared in the class, it will generate "==". If we compare a declared boolean variable with "false", it will generate "==". If we compare a boolean method with "false", it will generate ".equals()".
It seems that the generated code is good only if at least one of the stuff we compare is a declared variable. If both of them are functions, "true", "false", undeclared variables, it will generate bad code.
Today I solved some failures I encountered on 2018-09-08. At first, I thought the failures are due to incompatible version of my Java jdk. But after I reinstalled jdk1.8.0_65 (I used jdk1.8.0_144 previously), the problem still existed. Then I check the failure information provided by Junit. I found: The failure of "CompilerErrorOutputTests" is because of
java.lang.ExceptionInInitializerError at cruise.compiler.CompilerErrorOutputTests.AbstractMethodTest(CompilerErrorOutputTests.java:80) Caused by: java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at cruise.compiler.CompilerErrorUtil.<clinit>(CompilerErrorUtil.java:15)
The failure of "RuntimeErrorOutputTests" is because of
java.lang.ExceptionInInitializerError at cruise.runtime.RuntimeErrorOutputTests.InMain(RuntimeErrorOutputTests.java:10) Caused by: java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at cruise.runtime.RuntimeErrorUtil.<clinit>(RuntimeErrorUtil.java:17)
Then I opened
RuntimeErrorUtil.java. Line 15 of
CompilerErrorUtil.java and Line 17 of
RuntimeErrorUtil.java both use
replaceAll("/", File.separator). Since my operating system is Windows 10, File.operator is "\", while on Linux, File.operator is "/". This use of
replaceAll method is erroneous. After I replaced
replace, The failure of "RuntimeErrorOutputTests" disappeared. However, the failure of CompilerErrorOutputTests still existed.
But the failure information changed, it is due to some errors of the generated Java code in
SomePath\umple\testbed\test\cruise\compiler\src-gen-umple. I will work on the errors tomorrow!
Today I continued the setting up process. Cloned the project from github and built the project. Unfortunately, I encountered some failures.
When I ran the full build: "ant -Dmyenv=wlocal", it said "BUILD SUCCESSFUL" but there indeed existed some failing test cases on the terminal:
testJava: [echo] Running JAVA tests via junit [junit] WARNING: multiple versions of ant detected in path for junit [junit] jar:file:/D:/project/umple/dist/libs/core/ant.jar!/org/apache/tools/ant/Project.class [junit] and jar:file:/C:/ProgramData/chocolatey/lib/ant/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/Project.class [junit] TEST cruise.compiler.CompilerErrorOutputTests FAILED [junit] TEST cruise.runtime.RuntimeErrorOutputTests FAILED [junit] Tests FAILED
But other steps went well. I skipped Step 2d (Setting up local UmpleOnline). I installed the Eclipse IDE for Java EE, the Umple plugin, the IvyDE plugin. I found a mistake on the instruction page (https://github.com/umple/umple/wiki/InstallEclipsePlugin) when I was installing the Umple plugin at Step 2. I think
"PREREQUISITE: Eclipse Modeling tools running"
"PREREQUISITE: Eclipse IDE running".
After the installation, I imported the working copy project and it runs. Tomorrow I will attempt to set up local UmpleOnline and study the architecture of Umple.
Once I received the email from Timothy, I started to use UmpleOnline. I consulted the manual and knew a little about the syntax of Umple and how it works. Then I finished the first few steps of setting up -- installed PHP 5.6.17, Ruby 2.1.9, Ant 1.10.5 and git 2.18.0.