From 5219102458648109f61b9f2986ffa10e82350b08 Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Tue, 7 Oct 2025 19:53:11 +0200 Subject: [PATCH] [java-inspection] IJ-CR-177592 IDEA-375813 It seems dataflow join works wrong for branching with division by zero - fix naming GitOrigin-RevId: 66fb80af4c9c5e69285eb62845265cc06f9718be --- .../resources/messages/InspectionGadgetsBundle.properties | 2 +- .../com/siyeh/igtest/numeric/divide_by_zero/DivideByZero.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties b/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties index 6cfc593056cc..a6c1e91ffd38 100644 --- a/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties +++ b/java/java-analysis-impl/resources/messages/InspectionGadgetsBundle.properties @@ -848,7 +848,7 @@ inspection.lossy.conversion.compound.assignment.display.name=Implicit cast from comparison.of.short.and.char.problem.descriptor=Equality comparison #ref of short and char values #loc big.decimal.equals.problem.descriptor=#ref() between BigDecimal values should probably be 'compareTo()' #loc divide.by.zero.problem.descriptor=Division by zero #loc -divide.by.zero.problem.may.descriptor=Maybe division by zero #loc +divide.by.zero.problem.may.descriptor=Possible division by zero #loc divide.by.zero.problem.may.option=Report conditional divide-by-zero divide.by.zero.problem.may.option.description=Highlights divisions that can become zero in some execution branches divide.by.zero.problem.may.option.disabled=Don't suggest conditional divide-by-zero problems diff --git a/java/java-tests/testData/ig/com/siyeh/igtest/numeric/divide_by_zero/DivideByZero.java b/java/java-tests/testData/ig/com/siyeh/igtest/numeric/divide_by_zero/DivideByZero.java index 6bdfcf99521e..7ab0ae3f6abe 100644 --- a/java/java-tests/testData/ig/com/siyeh/igtest/numeric/divide_by_zero/DivideByZero.java +++ b/java/java-tests/testData/ig/com/siyeh/igtest/numeric/divide_by_zero/DivideByZero.java @@ -58,12 +58,12 @@ public class DivideByZero { void testMayBe(String[] args) { int x = 0; if (args.length==1) x = 100; - System.out.println(10 / x); + System.out.println(10 / x); } void testMayBe2(String[] args) { int x = 0; if (args.length==1) x = 1; - System.out.println(10 / x); + System.out.println(10 / x); } } \ No newline at end of file