KKitForma.

Language

EnglishEnglishTürkçeTurkishDeutschGermanTool unavailable · open catalogEspañolSpanishTool unavailable · open catalogFrançaisFrenchTool unavailable · open catalogPortuguêsPortugueseTool unavailable · open catalogItalianoItalianTool unavailable · open catalogNederlandsDutchTool unavailable · open catalogPolskiPolishTool unavailable · open catalogРусскийRussianTool unavailable · open catalogУкраїнськаUkrainianTool unavailable · open catalogSvenskaSwedishTool unavailable · open catalogNorskNorwegianTool unavailable · open catalogDanskDanishTool unavailable · open catalogSuomiFinnishTool unavailable · open catalogČeštinaCzechTool unavailable · open catalogRomânăRomanianTool unavailable · open catalogΕλληνικάGreekTool unavailable · open catalogالعربيةArabicTool unavailable · open catalogעבריתHebrewTool unavailable · open catalogفارسیPersianTool unavailable · open catalogاردوUrduTool unavailable · open catalogहिन्दीHindiTool unavailable · open catalogবাংলাBengaliTool unavailable · open catalogதமிழ்TamilTool unavailable · open catalogతెలుగుTeluguTool unavailable · open catalogमराठीMarathiTool unavailable · open catalogગુજરાતીGujaratiTool unavailable · open catalog简体中文Chinese SimplifiedTool unavailable · open catalog繁體中文Chinese TraditionalTool unavailable · open catalog日本語JapaneseTool unavailable · open catalog한국어KoreanTool unavailable · open catalogTiếng ViệtVietnameseTool unavailable · open catalogไทยThaiTool unavailable · open catalogBahasa IndonesiaIndonesianTool unavailable · open catalogBahasa MelayuMalayTool unavailable · open catalogFilipinoFilipinoTool unavailable · open catalogKiswahiliSwahiliTool unavailable · open catalogAfrikaansAfrikaansTool unavailable · open catalogMagyarHungarianTool unavailable · open catalogБългарскиBulgarianTool unavailable · open catalogHrvatskiCroatianTool unavailable · open catalogSrpskiSerbianTool unavailable · open catalogSlovenčinaSlovakTool unavailable · open catalogSlovenščinaSlovenianTool unavailable · open catalogLietuviųLithuanianTool unavailable · open catalogLatviešuLatvianTool unavailable · open catalogEestiEstonianTool unavailable · open catalogCatalàCatalanTool unavailable · open catalogEuskaraBasqueTool unavailable · open catalog
← All topics and search

Java & JVM

Java language, JVM behavior, dependencies and application diagnostics.

75 troubleshooting guides · Page 2 / 4

  1. Why does Optional.orElse call my expensive fallback even when a value exists?

    A method argument is evaluated before the method can choose whether to use it. A fallback expression can therefore perform work that its result does not need.

  2. How can Optional.get failures become meaningful domain errors instead of generic exceptions?

    An empty result is part of the lookup contract. Calling get without handling absence moves that decision into a generic runtime failure.

  3. Why does a literal dollar sign in Java regex replacement cause a group-reference error?

    A replacement string has its own syntax; escaping the search pattern does not escape the replacement. Treat the two inputs independently.

  4. Why does Java split discard empty fields at the end of a record?

    The default split behavior may discard trailing empty tokens. That changes a fixed-column record even though the separators are still present in the input.

  5. Why does lowercasing a technical identifier change when Java runs with a Turkish locale?

    Human-language casing and protocol normalization are different tasks. The process default locale can make an apparently harmless transformation environment-dependent.

  6. How do I make a Java text file round-trip with a defined encoding?

    Bytes become characters only through an encoding agreement. Fix the boundary explicitly instead of repairing mojibake after it enters the application.

  7. Why can Java substring cut an emoji in half even when the length check passes?

    A UTF-16 code unit is not always a complete Unicode character. A user-visible symbol may be even more complex than a single code point.

  8. Why does repeatedly reading Files.lines eventually exhaust open file handles?

    A lazily read stream may still own an open file. Completing a terminal operation does not replace the resource owner’s close obligation.

  9. Why does Scanner.nextLine return empty immediately after nextInt?

    Token-oriented reading and line-oriented reading leave the input cursor at different boundaries. The remaining end of the current line may be empty.

  10. Where did the close failure go when Java try-with-resources also throws from the body?

    There can be two failures from one operation: the main work and cleanup. Preserving the primary failure does not mean cleanup succeeded.

  11. Does Path.normalize make a user-selected relative path safe inside a directory?

    Lexical cleanup is not a complete filesystem authorization check. A path can remain outside the allowed tree or traverse a symbolic link.

  12. How do I distinguish a missing Java class from a class whose initialization failed earlier?

    A later class-loading error may hide an earlier initialization failure. Find the first error in the process lifetime before adding another dependency.

  13. Why does Java compile successfully but throw NoSuchMethodError at runtime?

    The caller may have compiled against a different binary API from the class actually loaded in production. This is not the same as a source method-name typo.

  14. Which Java installation matters when UnsupportedClassVersionError appears only on the server?

    The class file was produced for a runtime level that the executing JVM cannot accept. Your editor’s selected JDK is not proof of the server’s runtime.

  15. Why does converting a classpath resource URL to File work in the IDE but fail in a JAR?

    A packaged resource is not necessarily a standalone filesystem file. A URL inside an archive has a different access contract.

  16. Why does a Java date formatter print next year for a late-December date?

    Calendar years and week-based years diverge near some year boundaries. A pattern copied from another library may select the wrong concept.

  17. How do I reject February 30 instead of letting Java adjust an invalid date?

    A parser’s resolving policy can accept, adjust or reject combinations of date fields. A successful parse is only meaningful relative to that policy.

  18. Why does a local appointment time change when I attach a time zone?

    A wall-clock time does not uniquely identify an instant during every timezone transition. Some local times are skipped and others occur twice.

  19. Why should a Java worker not ignore InterruptedException and continue normally?

    An interrupt is often a cooperative request to stop waiting or stop work. Swallowing it can defeat executor shutdown or request cancellation.

  20. Why must a Java condition wait recheck its predicate after waking?

    A wakeup is permission to check shared state again, not proof that the desired condition is now true. Another worker may have consumed the available work.

  21. Why does volatile int still lose increments under concurrent Java workers?

    Visibility of an individual value is not atomicity of a read-modify-write sequence. Increment needs both properties when updates overlap.

  22. Why does containsKey followed by put race even on ConcurrentHashMap?

    Thread-safe individual methods do not make a sequence of methods one atomic decision. Another caller can act between the check and insertion.

  23. How can a pooled Java thread accidentally reuse the previous request’s ThreadLocal context?

    A pool reuses threads after a request ends. Thread-local state follows that thread, not the logical request that originally supplied it.

  24. Why does thenApply return a nested CompletableFuture instead of the final asynchronous result?

    The callback itself returns another asynchronous stage, so ordinary mapping preserves that stage as a value. The caller then observes two completion levels.

Ask your own question · Sign in to post questions and answers.