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.

audit use of `instanceof DirectoryFileSource`

See original GitHub issue

There were a number of places #4622 did:

-            if (module.isCodeModule()) {
+            if (module.getResources() instanceof DirectoryFileSource) {

because isCodeModule is not a method in gestalt-v7.

These call sites need to be audited to see if that is a suitable replacement.

  • What is it they need to know about the module?
  • Does the replacement work in all situations? if module is checked out as source, if it’s a jar in cachedModules, if it’s in a release bundle, etc.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
keturncommented, May 16, 2021

I would think that a ModuleManager should ideally be capable to filter modules it manages based on some categories… Maybe that would be a useful (and more understandable) alternative to add if not present yet?

100% agree with you on this; that’s the sort of thing I was thinking in that “trying to restrain self from going on ModuleManager tangent” comment a bit ago.

1reaction
jdrueckertcommented, May 14, 2021

Occurrence in WorldGeneratorManager.java:

  • WorldGenManager is refreshed for instance on saving the world gen config
  • on refreshing, for every module in the registrythat is present as source code we try to resolve it, load the environment and get all world generators using the RegisterWorldGenerator.class annotation to add valid world generators to a list with generator information

Like with the metrics, the intent here might’ve been to skip asset-only modules as they won’t have annotations to scan.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java instanceof Operator - Baeldung
instanceof is a binary operator we use to test if an object is of a given type. The result of the operation is...
Read more >
The performance impact of using instanceof in Java
class implementation. I used jmh to run the benchmark with 100 warmup calls, 1000 iterations under measuring, and with 10 forks. So each...
Read more >
Java “instanceOf”: Why And How To Avoid It In Code - Armedia
The java “instanceof” operator is used to test whether the object is an instance of the specified type (class or subclass or interface)....
Read more >
3 Pattern Matching for the instanceof Operator
Pattern matching involves testing whether an object has a particular structure, then extracting data from that object if there's a match.
Read more >
instanceof - JavaScript - MDN Web Docs
instanceof. The instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object....
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