question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Treat primitives and their autoboxed types as one and the same

See original GitHub issue

Following on from this comment:

I think we should treat Integer and int as one type.

Each instance of a primitive and its respective autoboxed type should count as the same type. For example:

public String doSomething(int id, Integer other);

We should coalesce int and Integer into a single type for analyses, so our metrics should calculate the total parameter types (both input and output) for this method as 2 instead of 3.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
yegor256commented, Feb 5, 2018

@llorllale @amihaiemil how about we create one more layer between skeleton.xml and LCOM.xsl, which will include a number of XSL stylesheets. One stylesheet will merge/coalesce types. Another one will remove ctors. Another one will remove static methods, and so on. That will help us get rid of code duplication inside XSL and will make the entire architecture composable: we can use certain XSL layers or ignore them. WDYT?

1reaction
yegor256commented, Feb 12, 2018

@llorllale @amihaiemil I fixed the puzzle in #166 and removed it from the source code. Now we have XSL layers. We have just two of them: for removal of ctors and remove of static methods. If you need more, feel free to report bugs/tickets.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java: Understanding Primitive Types and Wrapper Objects
Introduced in Java 5.0, Autoboxing is the automatic conversion of primitive types to their corresponding object wrapper classes.
Read more >
Autoboxing and Unboxing in Java
In Java, primitive data types are treated differently so do there comes the introduction of wrapper classes where two components play a role ......
Read more >
When to use primitive and when reference types in Java
In which case should you use primitive types( int ) or reference types ( Integer )? ... Autoboxing will turn "1", "2", "3"...
Read more >
How To Use Autoboxing and Unboxing in Java Programming
Primitive types are simple atomic, and their corresponding wrapper classes are heavy. Also, any conversion, even an automatic one, always needs ...
Read more >
Autoboxing and Unboxing
Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found