Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Use of Java asserts in ECJ
  • From: "Sankaran, Srikanth" <srikanth.sankaran@xxxxxxxxxxxxx>
  • Date: Fri, 19 Apr 2024 11:04:21 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=advantest.com; dmarc=pass action=none header.from=advantest.com; dkim=pass header.d=advantest.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yY+wzNGJ8jEY7+U2F2vhb5Q4fMEqGx2C8cebGugfAhY=; b=dTggcuUKJE7mwGinluDRBNKXGrGvrP02aZFotrSrGlYymP8fcENNn/S1xl3/ML/dKMl6HspAW5xOKefnhenyX4DstWPvSIMLIPlDcov1KARFeo3WpGs1XvoVfhCwB1NRCY0kyrmdWh/C3Lob5oQoWPniml/rxkOTrKloPMImFDfJkCgEAolvXmHliyxCbpb3BLbUc/xhjiCNc+tvuykxH/sRUkPLbR3TLLxpZb929F29EmevbiZ+et6fySnR+vNz0uDKY+VoPViJK72mQwz/X9tv0Q53WVpVA4h6Qvpe56qYhWZjYdQY/pDK2+KnXX0D4lWzwcUn5rnN/HoJSNH6rQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PJU5P3/b2kcc13R1BRyb3rYPADXIiusTRYAtu+s4T+ehQXM+3e3M3AbpLb9BVoGsbGh/gUGyO28C15CFMfoEEo6U7eeBinpoQkBg8AxwDmbZfKjOdw8BsnYuMWhADDdD7IaK50s4F4WVzpSk6N0tCYVhushXha/4fQsNnzOIqcRrUkNElW/pdBswkzUsLmWE00MYmtY8qftr/pzt2SnFX8jbySp71QZCDwKAgC2YcFO+/cSioe7dPdhquOjrkMKCFfTaojfTIr7hPof52v+1e7dZleC0avP+ZVELqAy7TL0W3+Ssj2Uqsd1s8N69G2zIiyU/rvXCt4YeaaUdIYu+RQ==
  • Delivered-to: jdt-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jdt-dev/>
  • List-help: <mailto:jdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jdt-dev>, <mailto:jdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jdt-dev>, <mailto:jdt-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdqSSFfU5fJAFpF7TGCmGIRrfjeuwg==
  • Thread-topic: Use of Java asserts in ECJ

I wholeheartedly support adding lots of sanity checks via assertions, but not via Java assert statement, but using the pattern

 

if (42 != 42) {

    throw new AssertionError("Something is fishy!");

}

 

These two tickets:

 

https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1835 and

https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2366

 

are due to bad asserts but Java assertions don’t checked unless IDE is involved with -vmArgs -ea

 

Thanks

Srikanth

 

 


Back to the top