SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Bug Cor052

Replace all placeholder words (written with underscores) by their suitable counterparts in the context of your Bug.

Inspired by

Original Description

“Not enough arguments are passed to satisfy a placeholder in the format string. A runtime exception will occur when this statement is executed.” – 2013-12-02

Detailed Description

It is about When we have some format specified but actually arguments are not there.

Sample Problem Scenario

Add here a minimal example where the problem occurs. It should be possible to use this code for testing our analysis: <code Java> package javaSample.bugCor052;

public class FormatStringReferencesMissingArgument {

public static void main (String[] args){

				 
	 System.out.printf("%d");
	 System.out.printf("%s");
	 System.out.printf("%f");
	 }

} </Code>

Sample Fix

Add here one or more options to fix the above problem could that could be used for testing our transformation(s): <code Java> package javaSample.bugCor052;

public class FormatStringReferencesMissingArgument {

public static void main (String[] args){

 
	 System.out.printf("%d",1234); 
	 System.out.printf("%s","hello");
	 System.out.printf("%f",1.2);
	 }

} </Code>

Evaluation Results

Benchmark project Precision Recall
FB JT Delta FB JT Delta
Project … …% …% …% …% …% …%
Project … …% …% …% …% …% …%

FB = FindBugs, JT = JTransformer, Delta = JTransformer - FindBugs

teaching/labs/mdse/2013/bug_descriptions/jt-bug-cor052.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2023