task_type stringclasses 4
values | code_task stringclasses 15
values | start_line int64 4 1.79k | end_line int64 4 1.8k | before stringlengths 79 76.1k | between stringlengths 17 806 | after stringlengths 2 72.6k | reason_categories_output stringlengths 2 2.24k | horizon_categories_output stringlengths 83 3.99k ⌀ | reason_freq_analysis stringclasses 150
values | horizon_freq_analysis stringlengths 23 185 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|
infilling_java | CounterTester | 76 | 77 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' return myWord.compareTo(w.myWord);', ' }'] | [" // If the counts are not equal, subtract the count of the current word from the count of the word 'w'", ' return w.myCount - myCount;', ' }', '}', '', '', '/**', ' * This class is used to count occurences of words (strings) in a corpus. Used by', ' * the IndexedDocumentCollection class to find the most frequ... | [{'reason_category': 'If Body', 'usage_line': 76}, {'reason_category': 'If Body', 'usage_line': 77}] | Global_Variable 'myWord' used at line 76 is defined at line 13 and has a Long-Range dependency.
Variable 'w' used at line 76 is defined at line 72 and has a Short-Range dependency. | {'If Body': 2} | {'Global_Variable Long-Range': 1, 'Variable Short-Range': 1} |
infilling_java | CounterTester | 79 | 80 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' return w.myCount - myCount;', ' }'] | ['}', '', '', '/**', ' * This class is used to count occurences of words (strings) in a corpus. Used by', ' * the IndexedDocumentCollection class to find the most frequent words in the corpus.', ' */', '', 'class WordCounter {', ' ', " // this is the map that holds (for each word) the number of times we've seen it... | [] | Variable 'w' used at line 79 is defined at line 72 and has a Short-Range dependency.
Global_Variable 'myCount' used at line 79 is defined at line 14 and has a Long-Range dependency. | {} | {'Variable Short-Range': 1, 'Global_Variable Long-Range': 1} |
infilling_java | CounterTester | 107 | 111 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' ones.remove (addMe);', ' WordWrapper temp = new WordWrapper (addMe, 1, extractedWords.size ());', ' wordsIHaveSeen.put(addMe, temp);', ' extractedWords.add (temp);', ' }'] | ['', ' // first check to see if the word is alredy in wordsIHaveSeen', ' if (wordsIHaveSeen.containsKey (addMe)) {', ' // if it is, then remove and increment its count', ' WordWrapper temp = wordsIHaveSeen.get (addMe);', ' temp.incCount ();', '', ' // find the slot that we go to in the extract... | [{'reason_category': 'If Body', 'usage_line': 107}, {'reason_category': 'If Body', 'usage_line': 108}, {'reason_category': 'If Body', 'usage_line': 109}, {'reason_category': 'If Body', 'usage_line': 110}, {'reason_category': 'If Body', 'usage_line': 111}] | Global_Variable 'ones' used at line 107 is defined at line 94 and has a Medium-Range dependency.
Variable 'addMe' used at line 107 is defined at line 105 and has a Short-Range dependency.
Class 'WordWrapper' used at line 108 is defined at line 11 and has a Long-Range dependency.
Variable 'addMe' used at line 108 is def... | {'If Body': 5} | {'Global_Variable Medium-Range': 4, 'Variable Short-Range': 5, 'Class Long-Range': 1} |
infilling_java | CounterTester | 116 | 117 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' WordWrapper temp = wordsIHaveSeen.get (addMe);', ' temp.incCount ();'] | ['', ' // find the slot that we go to in the extractedWords list', " // by sorting the 'extractedWords' list in ascending order", ' for (int i = temp.getPos () - 1; i >= 0 && ', ' extractedWords.get (i).compareTo (extractedWords.get (i + 1)) > 0; i--) {', ' temp = extractedWords.get (i + 1)... | [{'reason_category': 'If Body', 'usage_line': 116}, {'reason_category': 'If Body', 'usage_line': 117}] | Class 'WordWrapper' used at line 116 is defined at line 11 and has a Long-Range dependency.
Global_Variable 'wordsIHaveSeen' used at line 116 is defined at line 93 and has a Medium-Range dependency.
Variable 'addMe' used at line 116 is defined at line 105 and has a Medium-Range dependency.
Variable 'temp' used at line ... | {'If Body': 2} | {'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Variable Medium-Range': 1, 'Variable Short-Range': 1} |
infilling_java | CounterTester | 153 | 153 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' return s;'] | [' which++;', ' }', ' return null;', ' } else {', ' // If k is less than the size of the extractedWords list,', ' // return the kth most frequent word from extractedWords', ' return extractedWords.get (k).extractWord ();', ' }', ' }', '}', '/**', ' * A JUnit test case class.', ' *... | [{'reason_category': 'If Body', 'usage_line': 153}, {'reason_category': 'Loop Body', 'usage_line': 153}] | Variable 's' used at line 153 is defined at line 151 and has a Short-Range dependency. | {'If Body': 1, 'Loop Body': 1} | {'Variable Short-Range': 1} |
infilling_java | CounterTester | 152 | 155 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' if (which == k)', ' return s;', ' which++;', ' }'] | [' return null;', ' } else {', ' // If k is less than the size of the extractedWords list,', ' // return the kth most frequent word from extractedWords', ' return extractedWords.get (k).extractWord ();', ' }', ' }', '}', '/**', ' * A JUnit test case class.', ' * Every method starting with the... | [{'reason_category': 'Loop Body', 'usage_line': 152}, {'reason_category': 'If Body', 'usage_line': 152}, {'reason_category': 'If Condition', 'usage_line': 152}, {'reason_category': 'If Body', 'usage_line': 153}, {'reason_category': 'Loop Body', 'usage_line': 153}, {'reason_category': 'If Body', 'usage_line': 154}, {'re... | Variable 'which' used at line 152 is defined at line 150 and has a Short-Range dependency.
Variable 'k' used at line 152 is defined at line 146 and has a Short-Range dependency.
Variable 's' used at line 153 is defined at line 151 and has a Short-Range dependency.
Variable 'which' used at line 154 is defined at line 15... | {'Loop Body': 4, 'If Body': 4, 'If Condition': 1} | {'Variable Short-Range': 4} |
infilling_java | CounterTester | 150 | 156 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' int which = extractedWords.size ();', ' for (String s : ones.navigableKeySet ()) {', ' if (which == k)', ' return s;', ' which++;', ' }', ' return null;'] | [' } else {', ' // If k is less than the size of the extractedWords list,', ' // return the kth most frequent word from extractedWords', ' return extractedWords.get (k).extractWord ();', ' }', ' }', '}', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be c... | [{'reason_category': 'If Body', 'usage_line': 150}, {'reason_category': 'If Body', 'usage_line': 151}, {'reason_category': 'Define Stop Criteria', 'usage_line': 151}, {'reason_category': 'Loop Body', 'usage_line': 152}, {'reason_category': 'If Body', 'usage_line': 152}, {'reason_category': 'If Condition', 'usage_line':... | Global_Variable 'extractedWords' used at line 150 is defined at line 97 and has a Long-Range dependency.
Global_Variable 'ones' used at line 151 is defined at line 94 and has a Long-Range dependency.
Variable 'which' used at line 152 is defined at line 150 and has a Short-Range dependency.
Variable 'k' used at line 152... | {'If Body': 7, 'Define Stop Criteria': 1, 'Loop Body': 4, 'If Condition': 1} | {'Global_Variable Long-Range': 2, 'Variable Short-Range': 4} |
infilling_java | CounterTester | 160 | 161 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' return extractedWords.get (k).extractWord ();', ' }'] | [' }', '}', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', 'public class CounterTester extends TestCase {', '', ' /**', ' * File object to read words from, with buffering.', ' */', ' private FileReader file ... | [{'reason_category': 'Else Reasoning', 'usage_line': 160}, {'reason_category': 'Else Reasoning', 'usage_line': 161}] | Global_Variable 'extractedWords' used at line 160 is defined at line 97 and has a Long-Range dependency.
Variable 'k' used at line 160 is defined at line 146 and has a Medium-Range dependency.
Function 'extractWord' used at line 160 is defined at line 30 and has a Long-Range dependency. | {'Else Reasoning': 2} | {'Global_Variable Long-Range': 1, 'Variable Medium-Range': 1, 'Function Long-Range': 1} |
infilling_java | CounterTester | 183 | 185 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' file.close();', ' file = null;', ' }'] | [' if (reader != null) {', ' reader.close();', ' reader = null;', ' }', ' } catch (Exception e) {', ' System.err.println("Problem closing file");', ' System.err.println(e);', ' e.printStackTrace();', ' }', ' }', '', ' /**', ' * Close files no matter what happens in the t... | [{'reason_category': 'If Body', 'usage_line': 183}, {'reason_category': 'If Body', 'usage_line': 184}, {'reason_category': 'If Body', 'usage_line': 185}] | Global_Variable 'file' used at line 183 is defined at line 174 and has a Short-Range dependency.
Global_Variable 'file' used at line 184 is defined at line 174 and has a Short-Range dependency. | {'If Body': 3} | {'Global_Variable Short-Range': 2} |
infilling_java | CounterTester | 187 | 189 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' reader.close();', ' reader = null;', ' }'] | [' } catch (Exception e) {', ' System.err.println("Problem closing file");', ' System.err.println(e);', ' e.printStackTrace();', ' }', ' }', '', ' /**', ' * Close files no matter what happens in the test.', ' */', ' protected void tearDown () {', ' closeFiles();', ' }', '', ' /**', ' ... | [{'reason_category': 'If Body', 'usage_line': 187}, {'reason_category': 'If Body', 'usage_line': 188}, {'reason_category': 'If Body', 'usage_line': 189}] | Global_Variable 'reader' used at line 187 is defined at line 175 and has a Medium-Range dependency.
Global_Variable 'reader' used at line 188 is defined at line 175 and has a Medium-Range dependency. | {'If Body': 3} | {'Global_Variable Medium-Range': 2} |
infilling_java | CounterTester | 182 | 189 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' if (file != null) {', ' file.close();', ' file = null;', ' }', ' if (reader != null) {', ' reader.close();', ' reader = null;', ' }'] | [' } catch (Exception e) {', ' System.err.println("Problem closing file");', ' System.err.println(e);', ' e.printStackTrace();', ' }', ' }', '', ' /**', ' * Close files no matter what happens in the test.', ' */', ' protected void tearDown () {', ' closeFiles();', ' }', '', ' /**', ' ... | [{'reason_category': 'If Condition', 'usage_line': 182}, {'reason_category': 'If Body', 'usage_line': 183}, {'reason_category': 'If Body', 'usage_line': 184}, {'reason_category': 'If Body', 'usage_line': 185}, {'reason_category': 'If Condition', 'usage_line': 186}, {'reason_category': 'If Body', 'usage_line': 187}, {'r... | Global_Variable 'file' used at line 182 is defined at line 174 and has a Short-Range dependency.
Global_Variable 'file' used at line 183 is defined at line 174 and has a Short-Range dependency.
Global_Variable 'file' used at line 184 is defined at line 174 and has a Short-Range dependency.
Global_Variable 'reader' used... | {'If Condition': 2, 'If Body': 6} | {'Global_Variable Short-Range': 3, 'Global_Variable Medium-Range': 3} |
infilling_java | CounterTester | 201 | 202 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' closeFiles();', ' }'] | ['', ' /**', ' * Open file and set up readers.', ' *', ' * @param fileName name of file to open', ' * */', ' private void openFile(String fileName) {', ' try {', ' file = new FileReader(fileName);', ' reader = new BufferedReader(file);', ' } catch (Exception e) {', ' System.err.format(... | [] | Function 'closeFiles' used at line 201 is defined at line 180 and has a Medium-Range dependency. | {} | {'Function Medium-Range': 1} |
infilling_java | CounterTester | 211 | 212 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' file = new FileReader(fileName);', ' reader = new BufferedReader(file);'] | [' } catch (Exception e) {', ' System.err.format("Problem opening %s file\\n", fileName);', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Read the next numWords from the file.', ' *', ' * @param counter word counter to update', ' * @par... | [] | Variable 'fileName' used at line 211 is defined at line 209 and has a Short-Range dependency.
Global_Variable 'file' used at line 211 is defined at line 174 and has a Long-Range dependency.
Global_Variable 'file' used at line 212 is defined at line 211 and has a Short-Range dependency.
Global_Variable 'reader' used at ... | {} | {'Variable Short-Range': 1, 'Global_Variable Long-Range': 2, 'Global_Variable Short-Range': 1} |
infilling_java | CounterTester | 231 | 231 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' System.out.print (".");'] | [' String word = reader.readLine();', ' if (word == null) {', ' return;', ' }', " // Insert 'word' into the counter.", ' counter.insert(word);', ' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' ... | [{'reason_category': 'If Body', 'usage_line': 231}, {'reason_category': 'Loop Body', 'usage_line': 231}] | null | {'If Body': 1, 'Loop Body': 1} | null |
infilling_java | CounterTester | 234 | 235 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' return;', ' }'] | [" // Insert 'word' into the counter.", ' counter.insert(word);', ' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Read the next numWords from the... | [{'reason_category': 'If Body', 'usage_line': 234}, {'reason_category': 'Loop Body', 'usage_line': 234}, {'reason_category': 'if Body', 'usage_line': 235}, {'reason_category': 'Loop Body', 'usage_line': 235}] | null | {'If Body': 1, 'Loop Body': 2} | null |
infilling_java | CounterTester | 230 | 238 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' if (i % 100000 == 0)', ' System.out.print (".");', ' String word = reader.readLine();', ' if (word == null) {', ' return;', ' }', " // Insert 'word' into the counter.", ' counter.insert(word);', ' }'] | [' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Read the next numWords from the file, mixing with queries', ' *', ' * @param counter word counter to update', ' *... | [{'reason_category': 'Loop Body', 'usage_line': 230}, {'reason_category': 'If Condition', 'usage_line': 230}, {'reason_category': 'If Body', 'usage_line': 231}, {'reason_category': 'Loop Body', 'usage_line': 231}, {'reason_category': 'Loop Body', 'usage_line': 232}, {'reason_category': 'If Condition', 'usage_line': 233... | Variable 'i' used at line 230 is defined at line 229 and has a Short-Range dependency.
Global_Variable 'reader' used at line 232 is defined at line 175 and has a Long-Range dependency.
Variable 'word' used at line 233 is defined at line 232 and has a Short-Range dependency.
Variable 'counter' used at line 237 is define... | {'Loop Body': 9, 'If Condition': 2, 'If Body': 2} | {'Variable Short-Range': 4, 'Global_Variable Long-Range': 1} |
infilling_java | CounterTester | 260 | 261 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' return;', ' }'] | [' counter.insert(word);', '', ' // If the current iteration number is a multiple of 10 and greater than 100,000, perform a query of the kth most frequent word.', ' if (i % 10 == 0 && i > 100000) {', ' String myStr = counter.getKthMostFrequent(j++);', ' }', '', ' // rest j on... | [{'reason_category': 'Loop Body', 'usage_line': 260}, {'reason_category': 'If Body', 'usage_line': 260}, {'reason_category': 'Loop Body', 'usage_line': 261}, {'reason_category': 'If Body', 'usage_line': 261}] | null | {'Loop Body': 2, 'If Body': 2} | null |
infilling_java | CounterTester | 266 | 267 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' String myStr = counter.getKthMostFrequent(j++);', ' }'] | ['', ' // rest j once we get to 100', ' if (j == 100)', ' j = 0;', ' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Check that a sequence... | [{'reason_category': 'Loop Body', 'usage_line': 266}, {'reason_category': 'If Body', 'usage_line': 266}, {'reason_category': 'Loop Body', 'usage_line': 267}, {'reason_category': 'If Body', 'usage_line': 267}] | Variable 'counter' used at line 266 is defined at line 253 and has a Medium-Range dependency.
Variable 'j' used at line 266 is defined at line 255 and has a Medium-Range dependency. | {'Loop Body': 2, 'If Body': 2} | {'Variable Medium-Range': 2} |
infilling_java | CounterTester | 271 | 271 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' j = 0;'] | [' }', ' } catch (Exception e) {', ' System.err.println("Problem reading file");', ' System.err.println(e);', ' e.printStackTrace();', ' fail();', ' }', ' }', '', ' /**', ' * Check that a sequence of words starts at the "start"th most', ' * frequent word.', ' *', ' * @param coun... | [{'reason_category': 'Loop Body', 'usage_line': 271}, {'reason_category': 'If Body', 'usage_line': 271}] | Variable 'j' used at line 271 is defined at line 255 and has a Medium-Range dependency. | {'Loop Body': 1, 'If Body': 1} | {'Variable Medium-Range': 1} |
infilling_java | CounterTester | 445 | 446 | ['import junit.framework.TestCase;', 'import java.io.*;', 'import java.util.HashMap;', 'import java.util.TreeMap;', 'import java.util.ArrayList;', '', '/**', ' * This silly little class wraps String, int pairs so they can be sorted.', ' * Used by the WordCounter class.', ' */', 'class WordWrapper implements Comparable ... | [' counter.getKthMostFrequent(i);', ' }'] | [' }', '', ' public void testSpeed() {', ' System.out.println("\\nMixing adding data with finding top k");', ' WordCounter counter = new WordCounter();', ' openFile("allWordsBig");', ' readWordsMixed (counter, 6000000);', ' String [] expected = {"the", "edu", "to", "of", "and",', ' ... | [{'reason_category': 'Loop Body', 'usage_line': 445}, {'reason_category': 'Loop Body', 'usage_line': 446}] | Function 'WordCounter.getKthMostFrequent' used at line 445 is defined at line 146 and has a Long-Range dependency.
Variable 'i' used at line 445 is defined at line 444 and has a Short-Range dependency. | {'Loop Body': 2} | {'Function Long-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 217 | 219 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' maxDist = myList.get (i).distance;', ' badIndex = i;', ' }'] | [' }', ' ', ' myList.remove (badIndex);', ' }', ' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.dist... | [{'reason_category': 'If Body', 'usage_line': 217}, {'reason_category': 'Loop Body', 'usage_line': 217}, {'reason_category': 'If Body', 'usage_line': 218}, {'reason_category': 'Loop Body', 'usage_line': 218}, {'reason_category': 'If Body', 'usage_line': 219}, {'reason_category': 'Loop Body', 'usage_line': 219}] | Global_Variable 'myList' used at line 217 is defined at line 186 and has a Long-Range dependency.
Variable 'i' used at line 217 is defined at line 215 and has a Short-Range dependency.
Variable 'distance' used at line 217 is defined at line 208 and has a Short-Range dependency.
Variable 'maxDist' used at line 217 is de... | {'If Body': 3, 'Loop Body': 3} | {'Global_Variable Long-Range': 1, 'Variable Short-Range': 5} |
infilling_java | MTreeTester | 216 | 220 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (myList.get (i).distance > maxDist) {', ' maxDist = myList.get (i).distance;', ' badIndex = i;', ' }', ' }'] | [' ', ' myList.remove (badIndex);', ' }', ' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.distance = dist... | [{'reason_category': 'If Condition', 'usage_line': 216}, {'reason_category': 'If Body', 'usage_line': 216}, {'reason_category': 'Loop Body', 'usage_line': 216}, {'reason_category': 'If Body', 'usage_line': 217}, {'reason_category': 'Loop Body', 'usage_line': 217}, {'reason_category': 'If Body', 'usage_line': 218}, {'re... | Global_Variable 'myList' used at line 216 is defined at line 186 and has a Medium-Range dependency.
Variable 'i' used at line 216 is defined at line 215 and has a Short-Range dependency.
Variable 'distance' used at line 216 is defined at line 208 and has a Short-Range dependency.
Variable 'maxDist' used at line 216 is ... | {'If Condition': 1, 'If Body': 6, 'Loop Body': 4} | {'Global_Variable Medium-Range': 1, 'Variable Short-Range': 8, 'Global_Variable Long-Range': 1} |
infilling_java | MTreeTester | 213 | 223 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' int badIndex = 0;', ' double maxDist = 0.0;', ' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > maxDist) {', ' maxDist = myList.get (i).distance;', ' badIndex = i;', ' }', ' }', ' ', ' myList.remove (badIndex);', ' }'] | [' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.distance = distance;', ' myList.add (newOne); ', ' }', '... | [{'reason_category': 'If Body', 'usage_line': 213}, {'reason_category': 'If Body', 'usage_line': 214}, {'reason_category': 'If Body', 'usage_line': 215}, {'reason_category': 'Define Stop Criteria', 'usage_line': 215}, {'reason_category': 'If Condition', 'usage_line': 216}, {'reason_category': 'If Body', 'usage_line': 2... | Variable 'i' used at line 215 is defined at line 215 and has a Short-Range dependency.
Global_Variable 'myList' used at line 215 is defined at line 186 and has a Medium-Range dependency.
Global_Variable 'myList' used at line 216 is defined at line 186 and has a Medium-Range dependency.
Variable 'i' used at line 216 is ... | {'If Body': 12, 'Define Stop Criteria': 1, 'If Condition': 1, 'Loop Body': 4} | {'Variable Short-Range': 10, 'Global_Variable Medium-Range': 2, 'Global_Variable Long-Range': 2} |
infilling_java | MTreeTester | 229 | 233 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.distance = distance;', ' myList.add (newOne); ', ' }'] | [' ', ' // if we are full, reset the max distance', ' if (myList.size () == maxCount) {', ' large = 0.0;', ' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > large) {', ' large = myList.get (i).distance;', ' }', ' }', ' }', ' ', ' }', ' ... | [{'reason_category': 'If Body', 'usage_line': 229}, {'reason_category': 'If Body', 'usage_line': 230}, {'reason_category': 'If Body', 'usage_line': 231}, {'reason_category': 'If Body', 'usage_line': 232}, {'reason_category': 'If Body', 'usage_line': 233}] | Class 'Wrapper' used at line 229 is defined at line 180 and has a Long-Range dependency.
Class 'DataWrapper' used at line 230 is defined at line 429 and has a Long-Range dependency.
Variable 'key' used at line 230 is defined at line 208 and has a Medium-Range dependency.
Variable 'data' used at line 230 is defined at l... | {'If Body': 5} | {'Class Long-Range': 2, 'Variable Medium-Range': 3, 'Variable Short-Range': 3, 'Global_Variable Long-Range': 1} |
infilling_java | MTreeTester | 240 | 241 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' large = myList.get (i).distance;', ' }'] | [' }', ' }', ' ', ' }', ' ', ' // extracts the contents of the queue', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> done () {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' for (int i = 0; i... | [{'reason_category': 'Loop Body', 'usage_line': 240}, {'reason_category': 'If Body', 'usage_line': 240}, {'reason_category': 'Loop Body', 'usage_line': 241}, {'reason_category': 'If Body', 'usage_line': 241}] | Global_Variable 'myList' used at line 240 is defined at line 186 and has a Long-Range dependency.
Variable 'i' used at line 240 is defined at line 238 and has a Short-Range dependency.
Variable 'distance' used at line 240 is defined at line 208 and has a Long-Range dependency.
Global_Variable 'large' used at line 240 i... | {'Loop Body': 2, 'If Body': 2} | {'Global_Variable Long-Range': 1, 'Variable Short-Range': 1, 'Variable Long-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 239 | 242 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (myList.get (i).distance > large) {', ' large = myList.get (i).distance;', ' }', ' }'] | [' }', ' ', ' }', ' ', ' // extracts the contents of the queue', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> done () {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' for (int i = 0; i < myList.s... | [{'reason_category': 'If Body', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line': 239}, {'reason_category': 'If Condition', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line': 240}, {'reason_category': 'If Body', 'usage_line': 240}, {'reason_category': 'Loop Body', 'usage_line': 241}, {'... | Global_Variable 'myList' used at line 239 is defined at line 186 and has a Long-Range dependency.
Variable 'i' used at line 239 is defined at line 238 and has a Short-Range dependency.
Variable 'distance' used at line 239 is defined at line 208 and has a Long-Range dependency.
Global_Variable 'large' used at line 239 i... | {'If Body': 4, 'Loop Body': 4, 'If Condition': 1} | {'Global_Variable Long-Range': 2, 'Variable Short-Range': 2, 'Variable Long-Range': 2, 'Global_Variable Short-Range': 2} |
infilling_java | MTreeTester | 238 | 243 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > large) {', ' large = myList.get (i).distance;', ' }', ' }', ' }'] | [' ', ' }', ' ', ' // extracts the contents of the queue', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> done () {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' for (int i = 0; i < myList.size (); i... | [{'reason_category': 'If Body', 'usage_line': 238}, {'reason_category': 'Define Stop Criteria', 'usage_line': 238}, {'reason_category': 'If Body', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line': 239}, {'reason_category': 'If Condition', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line... | Variable 'i' used at line 238 is defined at line 238 and has a Short-Range dependency.
Global_Variable 'myList' used at line 238 is defined at line 186 and has a Long-Range dependency.
Global_Variable 'myList' used at line 239 is defined at line 186 and has a Long-Range dependency.
Variable 'i' used at line 239 is defi... | {'If Body': 6, 'Define Stop Criteria': 1, 'Loop Body': 4, 'If Condition': 1} | {'Variable Short-Range': 3, 'Global_Variable Long-Range': 3, 'Variable Long-Range': 2, 'Global_Variable Short-Range': 2} |
infilling_java | MTreeTester | 252 | 253 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' returnVal.add (myList.get (i).myData); ', ' }'] | [' ', ' return returnVal;', ' }', ' ', '}', '', '// this is a sphere in a particular metric space', 'class SphereABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>> implements', ' IObjectInMetricSpaceABCD <PointInMetricSpace> {', '', ' // the center of the sphere and its radius', ' pri... | [{'reason_category': 'Loop Body', 'usage_line': 252}, {'reason_category': 'Loop Body', 'usage_line': 253}] | Variable 'returnVal' used at line 252 is defined at line 250 and has a Short-Range dependency.
Global_Variable 'myList' used at line 252 is defined at line 186 and has a Long-Range dependency.
Variable 'i' used at line 252 is defined at line 251 and has a Short-Range dependency. | {'Loop Body': 2} | {'Variable Short-Range': 2, 'Global_Variable Long-Range': 1} |
infilling_java | MTreeTester | 251 | 256 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' for (int i = 0; i < myList.size (); i++) {', ' returnVal.add (myList.get (i).myData); ', ' }', ' ', ' return returnVal;', ' }'] | [' ', '}', '', '// this is a sphere in a particular metric space', 'class SphereABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>> implements', ' IObjectInMetricSpaceABCD <PointInMetricSpace> {', '', ' // the center of the sphere and its radius', ' private PointInMetricSpace center;', ' pri... | [{'reason_category': 'Define Stop Criteria', 'usage_line': 251}, {'reason_category': 'Loop Body', 'usage_line': 252}, {'reason_category': 'Loop Body', 'usage_line': 253}] | Variable 'i' used at line 251 is defined at line 251 and has a Short-Range dependency.
Global_Variable 'myList' used at line 251 is defined at line 186 and has a Long-Range dependency.
Variable 'returnVal' used at line 252 is defined at line 250 and has a Short-Range dependency.
Global_Variable 'myList' used at line 25... | {'Define Stop Criteria': 1, 'Loop Body': 2} | {'Variable Short-Range': 4, 'Global_Variable Long-Range': 2} |
infilling_java | MTreeTester | 270 | 272 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' center = centerIn;', ' radius = radiusIn;', ' }'] | [' ', ' // increase the size of the sphere so it contains the object swallowMe', ' public void swallow (IObjectInMetricSpaceABCD <PointInMetricSpace> swallowMe) {', ' ', ' // see if we need to increase the radius to swallow this guy', ' double dist = swallowMe.maxDistanceTo (center);', ' if (dist > rad... | [] | Variable 'centerIn' used at line 270 is defined at line 269 and has a Short-Range dependency.
Global_Variable 'center' used at line 270 is defined at line 265 and has a Short-Range dependency.
Variable 'radiusIn' used at line 271 is defined at line 269 and has a Short-Range dependency.
Global_Variable 'radius' used at ... | {} | {'Variable Short-Range': 2, 'Global_Variable Short-Range': 2} |
infilling_java | MTreeTester | 280 | 281 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' radius = dist;', ' }'] | [' ', ' // check to see if a sphere intersects another sphere', ' public boolean intersects (SphereABCD <PointInMetricSpace> me) {', ' return (me.center.getDistance (center) <= me.radius + radius);', ' }', ' ', ' // check to see if the sphere contains a point', ' public boolean contains (PointInMetricSpace ch... | [{'reason_category': 'If Body', 'usage_line': 280}, {'reason_category': 'If Body', 'usage_line': 281}] | Variable 'dist' used at line 280 is defined at line 278 and has a Short-Range dependency.
Global_Variable 'radius' used at line 280 is defined at line 266 and has a Medium-Range dependency. | {'If Body': 2} | {'Variable Short-Range': 1, 'Global_Variable Medium-Range': 1} |
infilling_java | MTreeTester | 285 | 286 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return (me.center.getDistance (center) <= me.radius + radius);', ' }'] | [' ', ' // check to see if the sphere contains a point', ' public boolean contains (PointInMetricSpace checkMe) {', ' return (checkMe.getDistance (center) <= radius);', ' }', ' ', ' public PointInMetricSpace getPointInInterior () {', ' return center; ', ' }', ' ', ' public double maxDistanceTo (PointInMe... | [] | Global_Variable 'center' used at line 285 is defined at line 265 and has a Medium-Range dependency.
Variable 'me' used at line 285 is defined at line 284 and has a Short-Range dependency.
Global_Variable 'radius' used at line 285 is defined at line 266 and has a Medium-Range dependency. | {} | {'Global_Variable Medium-Range': 2, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 290 | 291 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return (checkMe.getDistance (center) <= radius);', ' }'] | [' ', ' public PointInMetricSpace getPointInInterior () {', ' return center; ', ' }', ' ', ' public double maxDistanceTo (PointInMetricSpace checkMe) {', ' return radius + checkMe.getDistance (center); ', ' }', '}', '', '', '', 'class OneDimPoint implements IPointInMetricSpace <OneDimPoint> {', ' ', ' // t... | [] | Variable 'checkMe' used at line 290 is defined at line 289 and has a Short-Range dependency.
Global_Variable 'center' used at line 290 is defined at line 265 and has a Medium-Range dependency.
Global_Variable 'radius' used at line 290 is defined at line 266 and has a Medium-Range dependency. | {} | {'Variable Short-Range': 1, 'Global_Variable Medium-Range': 2} |
infilling_java | MTreeTester | 311 | 312 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' value = new Double (makeFromMe);', ' }'] | [' ', ' // get the distance to another point', ' public double getDistance (OneDimPoint toMe) {', ' if (value > toMe.value)', ' return value - toMe.value;', ' else', ' return toMe.value - value;', ' }', ' ', '}', '', 'class MultiDimPoint implements IPointInMetricSpace <MultiDimPoint> {', ' ', ' //... | [] | Variable 'makeFromMe' used at line 311 is defined at line 310 and has a Short-Range dependency.
Global_Variable 'value' used at line 311 is defined at line 307 and has a Short-Range dependency. | {} | {'Variable Short-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 317 | 317 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return value - toMe.value;'] | [' else', ' return toMe.value - value;', ' }', ' ', '}', '', 'class MultiDimPoint implements IPointInMetricSpace <MultiDimPoint> {', ' ', ' // this is the point in a multidimensional space', ' IDoubleVector me;', ' ', ' // make this out of an IDoubleVector', ' public MultiDimPoint (IDoubleVector useMe) {... | [{'reason_category': 'If Body', 'usage_line': 317}] | Global_Variable 'value' used at line 317 is defined at line 307 and has a Short-Range dependency.
Variable 'toMe' used at line 317 is defined at line 315 and has a Short-Range dependency. | {'If Body': 1} | {'Global_Variable Short-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 319 | 319 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return toMe.value - value;'] | [' }', ' ', '}', '', 'class MultiDimPoint implements IPointInMetricSpace <MultiDimPoint> {', ' ', ' // this is the point in a multidimensional space', ' IDoubleVector me;', ' ', ' // make this out of an IDoubleVector', ' public MultiDimPoint (IDoubleVector useMe) {', ' me = useMe;', ' }', ' ', ' // get the... | [{'reason_category': 'Else Reasoning', 'usage_line': 319}] | Variable 'toMe' used at line 319 is defined at line 315 and has a Short-Range dependency.
Global_Variable 'value' used at line 319 is defined at line 307 and has a Medium-Range dependency. | {'Else Reasoning': 1} | {'Variable Short-Range': 1, 'Global_Variable Medium-Range': 1} |
infilling_java | MTreeTester | 316 | 322 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (value > toMe.value)', ' return value - toMe.value;', ' else', ' return toMe.value - value;', ' }', ' ', '}'] | ['', 'class MultiDimPoint implements IPointInMetricSpace <MultiDimPoint> {', ' ', ' // this is the point in a multidimensional space', ' IDoubleVector me;', ' ', ' // make this out of an IDoubleVector', ' public MultiDimPoint (IDoubleVector useMe) {', ' me = useMe;', ' }', ' ', ' // get the Euclidean distanc... | [{'reason_category': 'If Condition', 'usage_line': 316}, {'reason_category': 'If Body', 'usage_line': 317}, {'reason_category': 'Else Reasoning', 'usage_line': 318}, {'reason_category': 'Else Reasoning', 'usage_line': 319}, {'reason_category': 'Else Reasoning', 'usage_line': 320}] | Global_Variable 'value' used at line 316 is defined at line 307 and has a Short-Range dependency.
Variable 'toMe' used at line 316 is defined at line 315 and has a Short-Range dependency.
Global_Variable 'value' used at line 317 is defined at line 307 and has a Short-Range dependency.
Variable 'toMe' used at line 317 i... | {'If Condition': 1, 'If Body': 1, 'Else Reasoning': 3} | {'Global_Variable Short-Range': 2, 'Variable Short-Range': 3, 'Global_Variable Medium-Range': 1} |
infilling_java | MTreeTester | 331 | 332 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' me = useMe;', ' }'] | [' ', ' // get the Euclidean distance to another point', ' public double getDistance (MultiDimPoint toMe) {', ' double distance = 0.0;', ' try {', ' for (int i = 0; i < me.getLength (); i++) {', ' double diff = me.getItem (i) - toMe.me.getItem (i);', ' diff *= diff;', ' distance += di... | [] | Variable 'useMe' used at line 331 is defined at line 330 and has a Short-Range dependency.
Global_Variable 'me' used at line 331 is defined at line 327 and has a Short-Range dependency. | {} | {'Variable Short-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 339 | 342 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' double diff = me.getItem (i) - toMe.me.getItem (i);', ' diff *= diff;', ' distance += diff;', ' }'] | [' } catch (OutOfBoundsException e) {', ' throw new IndexOutOfBoundsException ("Can\'t compare two MultiDimPoint objects with different dimensionality!"); ', ' }', ' return Math.sqrt(distance);', ' }', ' ', '}', '// this is a leaf node', 'class LeafMTreeNodeABCD <PointInMetricSpace extends IPointInMet... | [{'reason_category': 'Loop Body', 'usage_line': 339}, {'reason_category': 'Loop Body', 'usage_line': 340}, {'reason_category': 'Loop Body', 'usage_line': 341}, {'reason_category': 'Loop Body', 'usage_line': 342}] | Global_Variable 'me' used at line 339 is defined at line 327 and has a Medium-Range dependency.
Variable 'i' used at line 339 is defined at line 338 and has a Short-Range dependency.
Variable 'diff' used at line 340 is defined at line 339 and has a Short-Range dependency.
Variable 'diff' used at line 341 is defined at ... | {'Loop Body': 4} | {'Global_Variable Medium-Range': 1, 'Variable Short-Range': 4} |
infilling_java | MTreeTester | 359 | 360 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' myData = myDataIn; ', ' }'] | [' ', ' // constructor that creates an empty node', ' public LeafMTreeNodeABCD () {', ' myData = new ChrisMetricDataListABCD <PointInMetricSpace, PointABCD <PointInMetricSpace>, DataType> (); ', ' }', ' ', ' // get the sphere that bounds this node', ' public SphereABCD <PointInMetricSpace> getBoundingSphere (... | [] | Variable 'myDataIn' used at line 359 is defined at line 358 and has a Short-Range dependency.
Global_Variable 'myData' used at line 359 is defined at line 355 and has a Short-Range dependency. | {} | {'Variable Short-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 364 | 365 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' myData = new ChrisMetricDataListABCD <PointInMetricSpace, PointABCD <PointInMetricSpace>, DataType> (); ', ' }'] | [' ', ' // get the sphere that bounds this node', ' public SphereABCD <PointInMetricSpace> getBoundingSphere () {', ' return myData.getBoundingSphere (); ', ' }', ' ', ' public IMTreeNodeABCD <PointInMetricSpace, DataType> insert (PointInMetricSpace keyToAdd, DataType dataToAdd) {', ' ', ' // just add i... | [] | Class 'ChrisMetricDataListABCD' used at line 364 is defined at line 616 and has a Long-Range dependency.
Global_Variable 'myData' used at line 364 is defined at line 355 and has a Short-Range dependency. | {} | {'Class Long-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 369 | 370 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return myData.getBoundingSphere (); ', ' }'] | [' ', ' public IMTreeNodeABCD <PointInMetricSpace, DataType> insert (PointInMetricSpace keyToAdd, DataType dataToAdd) {', ' ', ' // just add in the new data', ' myData.add (new PointABCD <PointInMetricSpace> (keyToAdd), dataToAdd);', ' ', ' // if we exceed the max size, then split and create a new node... | [] | Global_Variable 'myData' used at line 369 is defined at line 355 and has a Medium-Range dependency. | {} | {'Global_Variable Medium-Range': 1} |
infilling_java | MTreeTester | 379 | 382 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' IMetricDataListABCD <PointInMetricSpace, PointABCD <PointInMetricSpace>, DataType> newOne = myData.splitInTwo ();', ' LeafMTreeNodeABCD <PointInMetricSpace, DataType> returnVal = new LeafMTreeNodeABCD <PointInMetricSpace, DataType> (newOne);', ' return returnVal;', ' }'] | [' ', ' // otherwise, we return a null to indcate that a split did not occur', ' return null;', ' }', ' ', ' public void findKClosest (PointInMetricSpace query, PQueueABCD <PointInMetricSpace, DataType> myQ) {', ' for (int i = 0; i < myData.size (); i++) {', ' SphereABCD <PointInMetricSpace> mySpher... | [{'reason_category': 'If Body', 'usage_line': 379}, {'reason_category': 'If Body', 'usage_line': 380}, {'reason_category': 'If Body', 'usage_line': 381}, {'reason_category': 'If Body', 'usage_line': 382}] | Class 'PointABCD' used at line 379 is defined at line 157 and has a Long-Range dependency.
Global_Variable 'myData' used at line 379 is defined at line 355 and has a Medium-Range dependency.
Class 'LeafMTreeNodeABCD' used at line 380 is defined at line 351 and has a Medium-Range dependency.
Variable 'newOne' used at li... | {'If Body': 4} | {'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Class Medium-Range': 1, 'Variable Short-Range': 2} |
infilling_java | MTreeTester | 392 | 394 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' myQ.insert (myData.get (i).getKey ().getPointInInterior (), myData.get (i).getData (), ', ' query.getDistance (myData.get (i).getKey ().getPointInInterior ()));', ' }'] | [' }', ' }', ' ', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (SphereABCD <PointInMetricSpace> query) {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' ', ' // just search thru ever... | [{'reason_category': 'Loop Body', 'usage_line': 392}, {'reason_category': 'If Body', 'usage_line': 392}, {'reason_category': 'Loop Body', 'usage_line': 393}, {'reason_category': 'If Body', 'usage_line': 393}, {'reason_category': 'Loop Body', 'usage_line': 394}, {'reason_category': 'If Body', 'usage_line': 394}] | Variable 'myQ' used at line 392 is defined at line 388 and has a Short-Range dependency.
Global_Variable 'myData' used at line 392 is defined at line 355 and has a Long-Range dependency.
Variable 'i' used at line 392 is defined at line 389 and has a Short-Range dependency.
Function 'getKey' used at line 392 is defined ... | {'Loop Body': 3, 'If Body': 3} | {'Variable Short-Range': 4, 'Global_Variable Long-Range': 2, 'Function Long-Range': 5} |
infilling_java | MTreeTester | 391 | 395 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (mySphere.contains (myData.get (i).getKey ().getPointInInterior ())) {', ' myQ.insert (myData.get (i).getKey ().getPointInInterior (), myData.get (i).getData (), ', ' query.getDistance (myData.get (i).getKey ().getPointInInterior ()));', ' }', ' }'] | [' }', ' ', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (SphereABCD <PointInMetricSpace> query) {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' ', ' // just search thru every entry a... | [{'reason_category': 'Loop Body', 'usage_line': 391}, {'reason_category': 'If Condition', 'usage_line': 391}, {'reason_category': 'Loop Body', 'usage_line': 392}, {'reason_category': 'If Body', 'usage_line': 392}, {'reason_category': 'Loop Body', 'usage_line': 393}, {'reason_category': 'If Body', 'usage_line': 393}, {'... | Function 'SphereABCD.contains' used at line 391 is defined at line 289 and has a Long-Range dependency.
Global_Variable 'myData' used at line 391 is defined at line 355 and has a Long-Range dependency.
Variable 'i' used at line 391 is defined at line 389 and has a Short-Range dependency.
Function 'getKey' used at line ... | {'Loop Body': 5, 'If Condition': 1, 'If Body': 3} | {'Function Long-Range': 8, 'Global_Variable Long-Range': 3, 'Variable Short-Range': 5} |
infilling_java | MTreeTester | 405 | 406 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' returnVal.add (new DataWrapper <PointInMetricSpace, DataType> (myData.get (i).getKey ().getPointInInterior (), myData.get (i).getData ()));', ' }'] | [' }', ' ', ' return returnVal;', ' }', ' ', ' public int depth () {', ' return 1; ', ' }', '', ' // this is the max number of entries in the node', ' private static int maxSize;', ' ', ' // and a getter and setter', ' public static void setMaxSize (int toMe) {', ' maxSize = toMe; ', ' }', ' ... | [{'reason_category': 'Loop Body', 'usage_line': 405}, {'reason_category': 'If Body', 'usage_line': 405}, {'reason_category': 'Loop Body', 'usage_line': 406}, {'reason_category': 'If Body', 'usage_line': 406}] | Variable 'returnVal' used at line 405 is defined at line 400 and has a Short-Range dependency.
Class 'DataWrapper' used at line 405 is defined at line 429 and has a Medium-Range dependency.
Global_Variable 'myData' used at line 405 is defined at line 355 and has a Long-Range dependency.
Variable 'i' used at line 405 is... | {'Loop Body': 2, 'If Body': 2} | {'Variable Short-Range': 2, 'Class Medium-Range': 1, 'Global_Variable Long-Range': 1, 'Function Long-Range': 3} |
infilling_java | MTreeTester | 404 | 407 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (query.contains (myData.get (i).getKey ().getPointInInterior ())) {', ' returnVal.add (new DataWrapper <PointInMetricSpace, DataType> (myData.get (i).getKey ().getPointInInterior (), myData.get (i).getData ()));', ' }', ' }'] | [' ', ' return returnVal;', ' }', ' ', ' public int depth () {', ' return 1; ', ' }', '', ' // this is the max number of entries in the node', ' private static int maxSize;', ' ', ' // and a getter and setter', ' public static void setMaxSize (int toMe) {', ' maxSize = toMe; ', ' }', ' public st... | [{'reason_category': 'Loop Body', 'usage_line': 404}, {'reason_category': 'If Condition', 'usage_line': 404}, {'reason_category': 'Loop Body', 'usage_line': 405}, {'reason_category': 'If Body', 'usage_line': 405}, {'reason_category': 'Loop Body', 'usage_line': 406}, {'reason_category': 'If Body', 'usage_line': 406}, {'... | Variable 'query' used at line 404 is defined at line 398 and has a Short-Range dependency.
Global_Variable 'myData' used at line 404 is defined at line 355 and has a Long-Range dependency.
Variable 'i' used at line 404 is defined at line 403 and has a Short-Range dependency.
Function 'getKey' used at line 404 is define... | {'Loop Body': 4, 'If Condition': 1, 'If Body': 2} | {'Variable Short-Range': 4, 'Global_Variable Long-Range': 2, 'Function Long-Range': 5, 'Class Medium-Range': 1} |
infilling_java | MTreeTester | 435 | 437 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' key = keyIn;', ' data = dataIn;', ' }'] | [' ', ' public Key getKey () {', ' return key;', ' }', ' ', ' public Data getData () {', ' return data;', ' }', '}', '', '', '// this is an internal node', 'class InternalMTreeNodeABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, DataType>', ' implements IMTreeNodeABCD <PointInMetr... | [] | Variable 'keyIn' used at line 435 is defined at line 434 and has a Short-Range dependency.
Global_Variable 'key' used at line 435 is defined at line 431 and has a Short-Range dependency.
Variable 'dataIn' used at line 436 is defined at line 434 and has a Short-Range dependency.
Global_Variable 'data' used at line 436 i... | {} | {'Variable Short-Range': 2, 'Global_Variable Short-Range': 2} |
infilling_java | MTreeTester | 440 | 441 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return key;', ' }'] | [' ', ' public Data getData () {', ' return data;', ' }', '}', '', '', '// this is an internal node', 'class InternalMTreeNodeABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, DataType>', ' implements IMTreeNodeABCD <PointInMetricSpace, DataType> {', ' ', ' // this holds all of the dat... | [] | Global_Variable 'key' used at line 440 is defined at line 431 and has a Short-Range dependency. | {} | {'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 444 | 446 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return data;', ' }', '}'] | ['', '', '// this is an internal node', 'class InternalMTreeNodeABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, DataType>', ' implements IMTreeNodeABCD <PointInMetricSpace, DataType> {', ' ', ' // this holds all of the data in the leaf node', ' private IMetricDataListABCD <PointInMetricSp... | [] | Global_Variable 'data' used at line 444 is defined at line 432 and has a Medium-Range dependency. | {} | {'Global_Variable Medium-Range': 1} |
infilling_java | MTreeTester | 486 | 488 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' bestDist = newDist;', ' bestIndex = i;', ' }'] | [' }', ' ', ' // do the recursive insert', ' IMTreeNodeABCD <PointInMetricSpace, DataType> newRef = myData.get (bestIndex).getData ().insert (keyToAdd, dataToAdd);', ' ', ' // if we got something back, then there was a split, so add the new node into our list', ' if (newRef != null) {', ' myDa... | [{'reason_category': 'Loop Body', 'usage_line': 486}, {'reason_category': 'If Body', 'usage_line': 486}, {'reason_category': 'Loop Body', 'usage_line': 487}, {'reason_category': 'If Body', 'usage_line': 487}, {'reason_category': 'Loop Body', 'usage_line': 488}, {'reason_category': 'If Body', 'usage_line': 488}] | Variable 'newDist' used at line 486 is defined at line 484 and has a Short-Range dependency.
Variable 'bestDist' used at line 486 is defined at line 480 and has a Short-Range dependency.
Variable 'i' used at line 487 is defined at line 482 and has a Short-Range dependency.
Variable 'bestIndex' used at line 487 is defin... | {'Loop Body': 3, 'If Body': 3} | {'Variable Short-Range': 4} |
infilling_java | MTreeTester | 485 | 489 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (newDist < bestDist) {', ' bestDist = newDist;', ' bestIndex = i;', ' }', ' }'] | [' ', ' // do the recursive insert', ' IMTreeNodeABCD <PointInMetricSpace, DataType> newRef = myData.get (bestIndex).getData ().insert (keyToAdd, dataToAdd);', ' ', ' // if we got something back, then there was a split, so add the new node into our list', ' if (newRef != null) {', ' myData.add (n... | [{'reason_category': 'If Condition', 'usage_line': 485}, {'reason_category': 'Loop Body', 'usage_line': 485}, {'reason_category': 'Loop Body', 'usage_line': 486}, {'reason_category': 'If Body', 'usage_line': 486}, {'reason_category': 'Loop Body', 'usage_line': 487}, {'reason_category': 'If Body', 'usage_line': 487}, {'... | Variable 'newDist' used at line 485 is defined at line 484 and has a Short-Range dependency.
Variable 'bestDist' used at line 485 is defined at line 480 and has a Short-Range dependency.
Variable 'newDist' used at line 486 is defined at line 484 and has a Short-Range dependency.
Variable 'bestDist' used at line 486 is ... | {'If Condition': 1, 'Loop Body': 5, 'If Body': 3} | {'Variable Short-Range': 6} |
infilling_java | MTreeTester | 496 | 497 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' myData.add (newRef.getBoundingSphere (), newRef);', ' }'] | [' ', ' // if we exceed the max size, then split and create a new node', ' if (myData.size () > getMaxSize ()) {', ' IMetricDataListABCD <PointInMetricSpace, SphereABCD <PointInMetricSpace>, IMTreeNodeABCD <PointInMetricSpace, DataType>> newOne = myData.splitInTwo ();', ' InternalMTreeNodeABCD <Poi... | [{'reason_category': 'If Body', 'usage_line': 496}] | Global_Variable 'myData' used at line 496 is defined at line 454 and has a Long-Range dependency.
Variable 'newRef' used at line 496 is defined at line 492 and has a Short-Range dependency. | {'If Body': 1} | {'Global_Variable Long-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 501 | 504 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' IMetricDataListABCD <PointInMetricSpace, SphereABCD <PointInMetricSpace>, IMTreeNodeABCD <PointInMetricSpace, DataType>> newOne = myData.splitInTwo ();', ' InternalMTreeNodeABCD <PointInMetricSpace, DataType> returnVal = new InternalMTreeNodeABCD <PointInMetricSpace, DataType> (newOne);', ' return ... | [' ', ' // otherwise, we return a null to indcate that a split did not occur', ' return null;', ' }', ' ', ' public void findKClosest (PointInMetricSpace query, PQueueABCD <PointInMetricSpace, DataType> myQ) {', ' for (int i = 0; i < myData.size (); i++) {', ' SphereABCD <PointInMetricSpace> mySpher... | [{'reason_category': 'If Body', 'usage_line': 501}, {'reason_category': 'If Body', 'usage_line': 502}, {'reason_category': 'If Body', 'usage_line': 503}, {'reason_category': 'If Body', 'usage_line': 504}] | Class 'SphereABCD' used at line 501 is defined at line 261 and has a Long-Range dependency.
Global_Variable 'myData' used at line 501 is defined at line 454 and has a Long-Range dependency.
Class 'InternalMTreeNodeABCD' used at line 502 is defined at line 450 and has a Long-Range dependency.
Variable 'newOne' used at l... | {'If Body': 4} | {'Class Long-Range': 2, 'Global_Variable Long-Range': 1, 'Variable Short-Range': 2} |
infilling_java | MTreeTester | 514 | 515 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' myData.get (i).getData ().findKClosest (query, myQ);', ' }'] | [' }', ' }', ' ', ' // from the interface', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (SphereABCD <PointInMetricSpace> query) {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' ', ' ... | [{'reason_category': 'Loop Body', 'usage_line': 514}, {'reason_category': 'If Body', 'usage_line': 514}, {'reason_category': 'Loop Body', 'usage_line': 515}, {'reason_category': 'If Body', 'usage_line': 515}] | Global_Variable 'myData' used at line 514 is defined at line 454 and has a Long-Range dependency.
Variable 'i' used at line 514 is defined at line 511 and has a Short-Range dependency.
Function 'getData' used at line 514 is defined at line 443 and has a Long-Range dependency.
Function 'findKClosest' used at line 514 is... | {'Loop Body': 2, 'If Body': 2} | {'Global_Variable Long-Range': 1, 'Variable Short-Range': 3, 'Function Long-Range': 1, 'Function Short-Range': 1} |
infilling_java | MTreeTester | 513 | 516 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (mySphere.intersects (myData.get (i).getKey ())) {', ' myData.get (i).getData ().findKClosest (query, myQ);', ' }', ' }'] | [' }', ' ', ' // from the interface', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (SphereABCD <PointInMetricSpace> query) {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' ', ' // jus... | [{'reason_category': 'Loop Body', 'usage_line': 513}, {'reason_category': 'If Condition', 'usage_line': 513}, {'reason_category': 'Loop Body', 'usage_line': 514}, {'reason_category': 'If Body', 'usage_line': 514}, {'reason_category': 'Loop Body', 'usage_line': 515}, {'reason_category': 'If Body', 'usage_line': 515}, {'... | Function 'SphereABCD.intersects' used at line 513 is defined at line 284 and has a Long-Range dependency.
Global_Variable 'myData' used at line 513 is defined at line 454 and has a Long-Range dependency.
Variable 'i' used at line 513 is defined at line 511 and has a Short-Range dependency.
Function 'getKey' used at lin... | {'Loop Body': 4, 'If Condition': 1, 'If Body': 2} | {'Function Long-Range': 3, 'Global_Variable Long-Range': 2, 'Variable Short-Range': 4, 'Function Short-Range': 1} |
infilling_java | MTreeTester | 511 | 517 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' for (int i = 0; i < myData.size (); i++) {', ' SphereABCD <PointInMetricSpace> mySphere = new SphereABCD <PointInMetricSpace> (query, myQ.getDist ());', ' if (mySphere.intersects (myData.get (i).getKey ())) {', ' myData.get (i).getData ().findKClosest (query, myQ);', ' }', ' }', ' }'] | [' ', ' // from the interface', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (SphereABCD <PointInMetricSpace> query) {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' ', ' // just searc... | [{'reason_category': 'Define Stop Criteria', 'usage_line': 511}, {'reason_category': 'Loop Body', 'usage_line': 512}, {'reason_category': 'Loop Body', 'usage_line': 513}, {'reason_category': 'If Condition', 'usage_line': 513}, {'reason_category': 'Loop Body', 'usage_line': 514}, {'reason_category': 'If Body', 'usage_li... | Variable 'i' used at line 511 is defined at line 511 and has a Short-Range dependency.
Global_Variable 'myData' used at line 511 is defined at line 454 and has a Long-Range dependency.
Class 'SphereABCD' used at line 512 is defined at line 261 and has a Long-Range dependency.
Variable 'query' used at line 512 is define... | {'Define Stop Criteria': 1, 'Loop Body': 5, 'If Condition': 1, 'If Body': 2} | {'Variable Short-Range': 7, 'Global_Variable Long-Range': 3, 'Class Long-Range': 1, 'Function Long-Range': 3, 'Function Short-Range': 1} |
infilling_java | MTreeTester | 527 | 528 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' returnVal.addAll (myData.get (i).getData ().find (query));', ' }'] | [' }', ' ', ' return returnVal;', ' }', ' ', ' public int depth () {', ' return myData.get (0).getData ().depth () + 1; ', ' }', ' ', ' // this is the max number of entries in the node', ' private static int maxSize;', ' ', ' // and a getter and setter', ' public static void setMaxSize (int toMe) ... | [{'reason_category': 'Loop Body', 'usage_line': 527}, {'reason_category': 'If Body', 'usage_line': 527}, {'reason_category': 'Loop Body', 'usage_line': 528}, {'reason_category': 'If Body', 'usage_line': 528}] | Variable 'returnVal' used at line 527 is defined at line 522 and has a Short-Range dependency.
Global_Variable 'myData' used at line 527 is defined at line 454 and has a Long-Range dependency.
Variable 'i' used at line 527 is defined at line 525 and has a Short-Range dependency.
Function 'getData' used at line 527 is d... | {'Loop Body': 2, 'If Body': 2} | {'Variable Short-Range': 3, 'Global_Variable Long-Range': 1, 'Function Long-Range': 1, 'Function Short-Range': 1} |
infilling_java | MTreeTester | 526 | 529 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (query.intersects (myData.get (i).getKey ())) {', ' returnVal.addAll (myData.get (i).getData ().find (query));', ' }', ' }'] | [' ', ' return returnVal;', ' }', ' ', ' public int depth () {', ' return myData.get (0).getData ().depth () + 1; ', ' }', ' ', ' // this is the max number of entries in the node', ' private static int maxSize;', ' ', ' // and a getter and setter', ' public static void setMaxSize (int toMe) {', ' ... | [{'reason_category': 'Loop Body', 'usage_line': 526}, {'reason_category': 'If Condition', 'usage_line': 526}, {'reason_category': 'Loop Body', 'usage_line': 527}, {'reason_category': 'If Body', 'usage_line': 527}, {'reason_category': 'Loop Body', 'usage_line': 528}, {'reason_category': 'If Body', 'usage_line': 528}, {'... | Variable 'query' used at line 526 is defined at line 520 and has a Short-Range dependency.
Global_Variable 'myData' used at line 526 is defined at line 454 and has a Long-Range dependency.
Variable 'i' used at line 526 is defined at line 525 and has a Short-Range dependency.
Function 'getKey' used at line 526 is define... | {'Loop Body': 4, 'If Condition': 1, 'If Body': 2} | {'Variable Short-Range': 5, 'Global_Variable Long-Range': 2, 'Function Long-Range': 2, 'Function Short-Range': 1} |
infilling_java | MTreeTester | 535 | 536 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return myData.get (0).getData ().depth () + 1; ', ' }'] | [' ', ' // this is the max number of entries in the node', ' private static int maxSize;', ' ', ' // and a getter and setter', ' public static void setMaxSize (int toMe) {', ' maxSize = toMe; ', ' }', ' public static int getMaxSize () {', ' return maxSize;', ' }', '}', '', 'abstract class AMetricDataLis... | [] | Global_Variable 'myData' used at line 535 is defined at line 454 and has a Long-Range dependency.
Function 'getData' used at line 535 is defined at line 443 and has a Long-Range dependency.
Function 'depth' used at line 535 is defined at line 534 and has a Short-Range dependency. | {} | {'Global_Variable Long-Range': 1, 'Function Long-Range': 1, 'Function Short-Range': 1} |
infilling_java | MTreeTester | 543 | 544 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' maxSize = toMe; ', ' }'] | [' public static int getMaxSize () {', ' return maxSize;', ' }', '}', '', 'abstract class AMetricDataListABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, ', ' KeyType extends IObjectInMetricSpaceABCD <PointInMetricSpace>, DataType> implements IMetricDataListABCD <PointInMetricSpace,KeyTy... | [] | Variable 'toMe' used at line 543 is defined at line 542 and has a Short-Range dependency.
Global_Variable 'maxSize' used at line 543 is defined at line 539 and has a Short-Range dependency. | {} | {'Variable Short-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 546 | 547 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return maxSize;', ' }'] | ['}', '', 'abstract class AMetricDataListABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, ', ' KeyType extends IObjectInMetricSpaceABCD <PointInMetricSpace>, DataType> implements IMetricDataListABCD <PointInMetricSpace,KeyType, DataType> {', '', ' // this is the data that is actually stored ... | [] | Global_Variable 'maxSize' used at line 546 is defined at line 539 and has a Short-Range dependency. | {} | {'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 565 | 565 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return myData.size (); '] | [' else', ' return 0;', ' }', ' ', ' public DataWrapper <KeyType, DataType> get (int pos) {', ' return myData.get (pos);', ' }', ' ', ' public void replaceKey (int pos, KeyType keyToAdd) {', ' DataWrapper <KeyType, DataType> temp = myData.remove (pos);', ' DataWrapper <KeyType, DataType> newOne = ... | [{'reason_category': 'If Body', 'usage_line': 565}] | Global_Variable 'myData' used at line 565 is defined at line 554 and has a Medium-Range dependency. | {'If Body': 1} | {'Global_Variable Medium-Range': 1} |
infilling_java | MTreeTester | 567 | 567 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return 0;'] | [' }', ' ', ' public DataWrapper <KeyType, DataType> get (int pos) {', ' return myData.get (pos);', ' }', ' ', ' public void replaceKey (int pos, KeyType keyToAdd) {', ' DataWrapper <KeyType, DataType> temp = myData.remove (pos);', ' DataWrapper <KeyType, DataType> newOne = new DataWrapper <KeyType, DataT... | [{'reason_category': 'Else Reasoning', 'usage_line': 567}] | null | {'Else Reasoning': 1} | null |
infilling_java | MTreeTester | 571 | 572 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return myData.get (pos);', ' }'] | [' ', ' public void replaceKey (int pos, KeyType keyToAdd) {', ' DataWrapper <KeyType, DataType> temp = myData.remove (pos);', ' DataWrapper <KeyType, DataType> newOne = new DataWrapper <KeyType, DataType> (keyToAdd, temp.getData ());', ' myData.add (pos, newOne);', ' }', ' ', ' public void add (KeyType ke... | [] | Global_Variable 'myData' used at line 571 is defined at line 554 and has a Medium-Range dependency.
Variable 'pos' used at line 571 is defined at line 570 and has a Short-Range dependency. | {} | {'Global_Variable Medium-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 584 | 587 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' PointInMetricSpace myCentroid = keyToAdd.getPointInInterior ();', ' myBoundingSphere = new SphereABCD <PointInMetricSpace> (myCentroid, keyToAdd.maxDistanceTo (myCentroid));', ' myData = new ArrayList <DataWrapper <KeyType, DataType>> ();', ' '] | [' // otherwise, extend the sphere if needed', ' } else {', ' myBoundingSphere.swallow (keyToAdd);', ' }', ' ', ' // add the data', ' myData.add (new DataWrapper <KeyType, DataType> (keyToAdd, dataToAdd));', ' }', ' ', ' // we want to potentially allow many implementations of the splitting lal... | [{'reason_category': 'If Body', 'usage_line': 584}, {'reason_category': 'If Body', 'usage_line': 585}, {'reason_category': 'If Body', 'usage_line': 586}, {'reason_category': 'If Body', 'usage_line': 587}] | Variable 'keyToAdd' used at line 584 is defined at line 580 and has a Short-Range dependency.
Class 'SphereABCD' used at line 585 is defined at line 261 and has a Long-Range dependency.
Variable 'myCentroid' used at line 585 is defined at line 584 and has a Short-Range dependency.
Variable 'keyToAdd' used at line 585 i... | {'If Body': 4} | {'Variable Short-Range': 3, 'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Global_Variable Long-Range': 1} |
infilling_java | MTreeTester | 590 | 591 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' myBoundingSphere.swallow (keyToAdd);', ' }'] | [' ', ' // add the data', ' myData.add (new DataWrapper <KeyType, DataType> (keyToAdd, dataToAdd));', ' }', ' ', ' // we want to potentially allow many implementations of the splitting lalgorithm', ' abstract public IMetricDataListABCD <PointInMetricSpace, KeyType, DataType> splitInTwo ();', ' ', ' // th... | [{'reason_category': 'Else Reasoning', 'usage_line': 590}, {'reason_category': 'Else Reasoning', 'usage_line': 591}] | Global_Variable 'myBoundingSphere' used at line 590 is defined at line 585 and has a Short-Range dependency.
Variable 'keyToAdd' used at line 590 is defined at line 580 and has a Short-Range dependency. | {'Else Reasoning': 2} | {'Global_Variable Short-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 602 | 603 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return myData;', ' }'] | [' ', ' // this is here so the splitting algorithm can modify the list and the sphere', ' protected void replaceGuts (AMetricDataListABCD <PointInMetricSpace, KeyType, DataType> withMe) {', ' myData = withMe.myData;', ' myBoundingSphere = withMe.myBoundingSphere;', ' }', ' ', '}', '', '// this is a particu... | [] | Global_Variable 'myData' used at line 602 is defined at line 554 and has a Long-Range dependency. | {} | {'Global_Variable Long-Range': 1} |
infilling_java | MTreeTester | 637 | 640 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' maxDist = curDist;', ' bestI = i;', ' bestJ = j;', ' }'] | [' }', ' }', ' ', ' // now, we have the best two points; those are seeds for the clustering', ' DataWrapper <KeyType, DataType> pointOne = myData.remove (bestI);', ' DataWrapper <KeyType, DataType> pointTwo = myData.remove (bestJ - 1);', ' ', ' // these are the two new lists', ' AMetricData... | [{'reason_category': 'Loop Body', 'usage_line': 637}, {'reason_category': 'If Body', 'usage_line': 637}, {'reason_category': 'Loop Body', 'usage_line': 638}, {'reason_category': 'If Body', 'usage_line': 638}, {'reason_category': 'Loop Body', 'usage_line': 639}, {'reason_category': 'If Body', 'usage_line': 639}, {'reaso... | Variable 'curDist' used at line 637 is defined at line 633 and has a Short-Range dependency.
Variable 'maxDist' used at line 637 is defined at line 624 and has a Medium-Range dependency.
Variable 'i' used at line 638 is defined at line 625 and has a Medium-Range dependency.
Variable 'bestI' used at line 638 is defined ... | {'Loop Body': 4, 'If Body': 4} | {'Variable Short-Range': 1, 'Variable Medium-Range': 5} |
infilling_java | MTreeTester | 665 | 669 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (myData.get (i).getKey ().getPointInInterior ().getDistance (pointOne.getKey ().getPointInInterior ()) < bestDist) {', ' bestDist = myData.get (i).getKey ().getPointInInterior ().getDistance (pointOne.getKey ().getPointInInterior ());', ' bestIndex = i;', ' }', ' }'] | [' ', ' // and add the best in', ' listOne.add (myData.get (bestIndex).getKey (), myData.get (bestIndex).getData ());', ' myData.remove (bestIndex);', ' ', ' // break if no more data', ' if (myData.size () == 0)', ' break;', ' ', ' // loop thru all of the candid... | [{'reason_category': 'Loop Body', 'usage_line': 665}, {'reason_category': 'If Condition', 'usage_line': 665}, {'reason_category': 'Loop Body', 'usage_line': 666}, {'reason_category': 'If Body', 'usage_line': 666}, {'reason_category': 'Loop Body', 'usage_line': 667}, {'reason_category': 'If Body', 'usage_line': 667}, {'... | Variable 'myData' used at line 665 is defined at line 622 and has a Long-Range dependency.
Variable 'i' used at line 665 is defined at line 664 and has a Short-Range dependency.
Function 'getKey' used at line 665 is defined at line 439 and has a Long-Range dependency.
Function 'getPointInInterior' used at line 665 is d... | {'Loop Body': 5, 'If Condition': 1, 'If Body': 3} | {'Variable Long-Range': 2, 'Variable Short-Range': 6, 'Function Long-Range': 6, 'Variable Medium-Range': 2} |
infilling_java | MTreeTester | 683 | 685 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' bestDist = myData.get (i).getKey ().getPointInInterior ().getDistance (pointTwo.getKey ().getPointInInterior ());', ' bestIndex = i;', ' }'] | [' }', ' ', ' // and add the best in', ' listTwo.add (myData.get (bestIndex).getKey (), myData.get (bestIndex).getData ());', ' myData.remove (bestIndex);', ' }', ' ', ' // now we replace our own guts with the first list', ' replaceGuts (listOne);', ' ', ' // and return the ot... | [{'reason_category': 'Loop Body', 'usage_line': 683}, {'reason_category': 'If Body', 'usage_line': 683}, {'reason_category': 'Loop Body', 'usage_line': 684}, {'reason_category': 'If Body', 'usage_line': 684}, {'reason_category': 'Loop Body', 'usage_line': 685}, {'reason_category': 'If Body', 'usage_line': 685}] | Variable 'myData' used at line 683 is defined at line 622 and has a Long-Range dependency.
Variable 'i' used at line 683 is defined at line 681 and has a Short-Range dependency.
Function 'getKey' used at line 683 is defined at line 439 and has a Long-Range dependency.
Function 'getPointInInterior' used at line 683 is d... | {'Loop Body': 3, 'If Body': 3} | {'Variable Long-Range': 2, 'Variable Short-Range': 3, 'Function Long-Range': 3, 'Variable Medium-Range': 1} |
infilling_java | MTreeTester | 682 | 686 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' if (myData.get (i).getKey ().getPointInInterior ().getDistance (pointTwo.getKey ().getPointInInterior ()) < bestDist) {', ' bestDist = myData.get (i).getKey ().getPointInInterior ().getDistance (pointTwo.getKey ().getPointInInterior ());', ' bestIndex = i;', ' }', ' }'] | [' ', ' // and add the best in', ' listTwo.add (myData.get (bestIndex).getKey (), myData.get (bestIndex).getData ());', ' myData.remove (bestIndex);', ' }', ' ', ' // now we replace our own guts with the first list', ' replaceGuts (listOne);', ' ', ' // and return the other list', ... | [{'reason_category': 'Loop Body', 'usage_line': 682}, {'reason_category': 'If Condition', 'usage_line': 682}, {'reason_category': 'Loop Body', 'usage_line': 683}, {'reason_category': 'If Body', 'usage_line': 683}, {'reason_category': 'Loop Body', 'usage_line': 684}, {'reason_category': 'If Body', 'usage_line': 684}, {'... | Variable 'myData' used at line 682 is defined at line 622 and has a Long-Range dependency.
Variable 'i' used at line 682 is defined at line 681 and has a Short-Range dependency.
Function 'getKey' used at line 682 is defined at line 439 and has a Long-Range dependency.
Function 'getPointInInterior' used at line 682 is d... | {'Loop Body': 5, 'If Condition': 1, 'If Body': 3} | {'Variable Long-Range': 4, 'Variable Short-Range': 5, 'Function Long-Range': 6, 'Variable Medium-Range': 1} |
infilling_java | MTreeTester | 731 | 734 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' InternalMTreeNodeABCD.setMaxSize (intNodeSize);', ' LeafMTreeNodeABCD.setMaxSize (leafNodeSize);', ' root = new LeafMTreeNodeABCD <PointInMetricSpace, DataType> ();', ' }'] | [' ', ' // insert a new key/data pair into the map', ' public void insert (PointInMetricSpace keyToAdd, DataType dataToAdd) {', ' ', ' // insert the new data point', ' IMTreeNodeABCD <PointInMetricSpace, DataType> res = root.insert (keyToAdd, dataToAdd);', ' ', ' // if we got back a root split, then c... | [] | Function 'InternalMTreeNodeABCD.setMaxSize' used at line 731 is defined at line 542 and has a Long-Range dependency.
Variable 'intNodeSize' used at line 731 is defined at line 730 and has a Short-Range dependency.
Function 'LeafMTreeNodeABCD.setMaxSize' used at line 732 is defined at line 420 and has a Long-Range depen... | {} | {'Function Long-Range': 2, 'Variable Short-Range': 2, 'Class Long-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 744 | 745 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' root = new InternalMTreeNodeABCD <PointInMetricSpace, DataType> (root, res);', ' }'] | [' }', ' ', ' // find all of the key/data pairs in the map that fall within a particular distance of query point', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (PointInMetricSpace query, double distance) {', ' return root.find (new SphereABCD <PointInMetricSpace> (query, distance)); ', ' ... | [{'reason_category': 'If Body', 'usage_line': 744}, {'reason_category': 'If Body', 'usage_line': 745}] | Class 'InternalMTreeNodeABCD' used at line 744 is defined at line 450 and has a Long-Range dependency.
Global_Variable 'root' used at line 744 is defined at line 727 and has a Medium-Range dependency.
Variable 'res' used at line 744 is defined at line 740 and has a Short-Range dependency. | {'If Body': 2} | {'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 750 | 751 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return root.find (new SphereABCD <PointInMetricSpace> (query, distance)); ', ' }'] | [' ', ' // find the k closest key/data pairs in the map to a particular query point', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> findKClosest (PointInMetricSpace query, int k) {', ' PQueueABCD <PointInMetricSpace, DataType> myQ = new PQueueABCD <PointInMetricSpace, DataType> (k);', ' root.... | [] | Global_Variable 'root' used at line 750 is defined at line 727 and has a Medium-Range dependency.
Class 'SphereABCD' used at line 750 is defined at line 261 and has a Long-Range dependency.
Variable 'query' used at line 750 is defined at line 749 and has a Short-Range dependency.
Variable 'distance' used at line 750 is... | {} | {'Global_Variable Medium-Range': 1, 'Class Long-Range': 1, 'Variable Short-Range': 2} |
infilling_java | MTreeTester | 755 | 758 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' PQueueABCD <PointInMetricSpace, DataType> myQ = new PQueueABCD <PointInMetricSpace, DataType> (k);', ' root.findKClosest (query, myQ);', ' return myQ.done ();', ' }'] | [' ', ' // get the depth', ' public int depth () {', ' return root.depth (); ', ' }', '}', '', '// this implements a map from a set of keys of type PointInMetricSpace to a set of data of type DataType', 'class SCMTree <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, DataType> implements IMTr... | [] | Class 'PQueueABCD' used at line 755 is defined at line 177 and has a Long-Range dependency.
Variable 'k' used at line 755 is defined at line 754 and has a Short-Range dependency.
Global_Variable 'root' used at line 756 is defined at line 727 and has a Medium-Range dependency.
Variable 'query' used at line 756 is define... | {} | {'Class Long-Range': 1, 'Variable Short-Range': 3, 'Global_Variable Medium-Range': 1, 'Function Long-Range': 1} |
infilling_java | MTreeTester | 762 | 763 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return root.depth (); ', ' }'] | ['}', '', '// this implements a map from a set of keys of type PointInMetricSpace to a set of data of type DataType', 'class SCMTree <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, DataType> implements IMTree <PointInMetricSpace, DataType> {', ' ', ' // this is the actual tree', ' private IMTree... | [] | Global_Variable 'root' used at line 762 is defined at line 727 and has a Long-Range dependency. | {} | {'Global_Variable Long-Range': 1} |
infilling_java | MTreeTester | 774 | 777 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' InternalMTreeNodeABCD.setMaxSize (intNodeSize);', ' LeafMTreeNodeABCD.setMaxSize (leafNodeSize);', ' root = new LeafMTreeNodeABCD <PointInMetricSpace, DataType> ();', ' }'] | [' ', ' // insert a new key/data pair into the map', ' public void insert (PointInMetricSpace keyToAdd, DataType dataToAdd) {', ' ', ' // insert the new data point', ' IMTreeNodeABCD <PointInMetricSpace, DataType> res = root.insert (keyToAdd, dataToAdd);', ' ', ' // if we got back a root split, then c... | [] | Function 'InternalMTreeNodeABCD.setMaxSize' used at line 774 is defined at line 542 and has a Long-Range dependency.
Variable 'intNodeSize' used at line 774 is defined at line 773 and has a Short-Range dependency.
Function 'LeafMTreeNodeABCD.setMaxSize' used at line 775 is defined at line 420 and has a Long-Range depen... | {} | {'Function Long-Range': 2, 'Variable Short-Range': 2, 'Class Long-Range': 1, 'Global_Variable Short-Range': 1} |
infilling_java | MTreeTester | 787 | 788 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' root = new InternalMTreeNodeABCD <PointInMetricSpace, DataType> (root, res);', ' }'] | [' }', ' ', ' // find all of the key/data pairs in the map that fall within a particular distance of query point', ' public ArrayList <DataWrapper <PointInMetricSpace, DataType>> find (PointInMetricSpace query, double distance) {', ' return root.find (new SphereABCD <PointInMetricSpace> (query, distance)); ', ' ... | [{'reason_category': 'If Body', 'usage_line': 787}, {'reason_category': 'If Body', 'usage_line': 788}] | Class 'InternalMTreeNodeABCD' used at line 787 is defined at line 450 and has a Long-Range dependency.
Global_Variable 'root' used at line 787 is defined at line 770 and has a Medium-Range dependency.
Variable 'res' used at line 787 is defined at line 783 and has a Short-Range dependency. | {'If Body': 2} | {'Class Long-Range': 1, 'Global_Variable Medium-Range': 1, 'Variable Short-Range': 1} |
infilling_java | MTreeTester | 805 | 806 | ['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in... | [' return root.depth (); ', ' }'] | ['}', '', '', '/**', ' * A JUnit test case class.', ' * Every method starting with the word "test" will be called when running', ' * the test with JUnit.', ' */', '', 'public class MTreeTester extends TestCase {', ' ', ' // compare two lists of strings to see if the contents are the same', ' private boolean compareS... | [] | Global_Variable 'root' used at line 805 is defined at line 770 and has a Long-Range dependency. | {} | {'Global_Variable Long-Range': 1} |
infilling_java | FactorizationTester | 38 | 40 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' resultStream.format ("Can\'t factorize a number less than 1");', ' return;', ' }'] | [' if (numToFactorize > maxNumberToFactorize) {', ' resultStream.format ("%d is too large to factorize", numToFactorize);', ' return;', ' }', ' ', ' // Now get ready to print the factorization', ' resultStream.format ("Prime factorization of %d is: ", numToFactorize);', ' ', ' // our basic... | [{'reason_category': 'If Body', 'usage_line': 38}, {'reason_category': 'If Body', 'usage_line': 39}, {'reason_category': 'If Body', 'usage_line': 40}] | Global_Variable 'resultStream' used at line 38 is defined at line 27 and has a Medium-Range dependency. | {'If Body': 3} | {'Global_Variable Medium-Range': 1} |
infilling_java | FactorizationTester | 63 | 83 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' if (numToFactorize % allPrimes[curPosInAllPrimes] == 0) {', ' ', ' // if it\'s the first one, we don\'t need to print a "x"', ' // print the factor & reset the firstOne flag', ' if (firstOne) {', ' resultStream.format ("%d", allPrimes[curPosInAllPrimes]);', ' firstO... | [' ', ' // if we never printed any factors, then display the number itself', ' if (firstOne) {', ' resultStream.format ("%d", numToFactorize);', " // Otherwsie print the factors connected by 'x'", ' } else if (numToFactorize > 1) {', ' resultStream.format (" x %d", numToFactorize);', ' }', '... | [{'reason_category': 'Loop Body', 'usage_line': 63}, {'reason_category': 'If Condition', 'usage_line': 63}, {'reason_category': 'Loop Body', 'usage_line': 64}, {'reason_category': 'If Body', 'usage_line': 64}, {'reason_category': 'Loop Body', 'usage_line': 65}, {'reason_category': 'If Body', 'usage_line': 65}, {'reason... | Variable 'numToFactorize' used at line 63 is defined at line 34 and has a Medium-Range dependency.
Global_Variable 'allPrimes' used at line 63 is defined at line 21 and has a Long-Range dependency.
Variable 'curPosInAllPrimes' used at line 63 is defined at line 54 and has a Short-Range dependency.
Variable 'firstOne' u... | {'Loop Body': 21, 'If Condition': 2, 'If Body': 14, 'Else Reasoning': 6} | {'Variable Medium-Range': 6, 'Global_Variable Long-Range': 6, 'Variable Short-Range': 2, 'Variable Long-Range': 1} |
infilling_java | FactorizationTester | 68 | 69 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' resultStream.format ("%d", allPrimes[curPosInAllPrimes]);', ' firstOne = false;'] | [' ', ' // otherwise, print the factor pre-pended with an "x"', ' } else {', ' resultStream.format (" x %d", allPrimes[curPosInAllPrimes]);', ' }', ' ', ' // remove that prime factor from the target', ' numToFactorize /= allPrimes[curPosInAllPrimes];', ' ... | [{'reason_category': 'Loop Body', 'usage_line': 68}, {'reason_category': 'If Body', 'usage_line': 68}, {'reason_category': 'Loop Body', 'usage_line': 69}, {'reason_category': 'If Body', 'usage_line': 69}] | Global_Variable 'resultStream' used at line 68 is defined at line 27 and has a Long-Range dependency.
Global_Variable 'allPrimes' used at line 68 is defined at line 21 and has a Long-Range dependency.
Variable 'curPosInAllPrimes' used at line 68 is defined at line 54 and has a Medium-Range dependency.
Variable 'firstOn... | {'Loop Body': 2, 'If Body': 2} | {'Global_Variable Long-Range': 2, 'Variable Medium-Range': 2} |
infilling_java | FactorizationTester | 73 | 74 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' resultStream.format (" x %d", allPrimes[curPosInAllPrimes]);', ' }'] | [' ', ' // remove that prime factor from the target', ' numToFactorize /= allPrimes[curPosInAllPrimes];', ' ', ' // if the current prime does not divde evenly, try the next one', ' } else {', ' curPosInAllPrimes++;', ' }', ' }', ' ', ' // if we never printed an... | [{'reason_category': 'Loop Body', 'usage_line': 73}, {'reason_category': 'If Body', 'usage_line': 73}, {'reason_category': 'Else Reasoning', 'usage_line': 73}, {'reason_category': 'Loop Body', 'usage_line': 74}, {'reason_category': 'If Body', 'usage_line': 74}, {'reason_category': 'Else Reasoning', 'usage_line': 74}] | Global_Variable 'resultStream' used at line 73 is defined at line 27 and has a Long-Range dependency.
Global_Variable 'allPrimes' used at line 73 is defined at line 21 and has a Long-Range dependency.
Variable 'curPosInAllPrimes' used at line 73 is defined at line 54 and has a Medium-Range dependency. | {'Loop Body': 2, 'If Body': 2, 'Else Reasoning': 2} | {'Global_Variable Long-Range': 2, 'Variable Medium-Range': 1} |
infilling_java | FactorizationTester | 81 | 82 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' curPosInAllPrimes++;', ' }'] | [' }', ' ', ' // if we never printed any factors, then display the number itself', ' if (firstOne) {', ' resultStream.format ("%d", numToFactorize);', " // Otherwsie print the factors connected by 'x'", ' } else if (numToFactorize > 1) {', ' resultStream.format (" x %d", numToFactorize);', '... | [{'reason_category': 'Loop Body', 'usage_line': 81}, {'reason_category': 'Else Reasoning', 'usage_line': 81}, {'reason_category': 'Loop Body', 'usage_line': 82}, {'reason_category': 'Else Reasoning', 'usage_line': 82}] | Variable 'curPosInAllPrimes' used at line 81 is defined at line 54 and has a Medium-Range dependency. | {'Loop Body': 2, 'Else Reasoning': 2} | {'Variable Medium-Range': 1} |
infilling_java | FactorizationTester | 87 | 87 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' resultStream.format ("%d", numToFactorize);'] | [" // Otherwsie print the factors connected by 'x'", ' } else if (numToFactorize > 1) {', ' resultStream.format (" x %d", numToFactorize);', ' }', ' }', ' ', ' ', ' /**', ' * This is the constructor. What it does is to fill the array allPrimes with all', ' * of the prime numbers from 2 through sq... | [{'reason_category': 'If Body', 'usage_line': 87}] | Global_Variable 'resultStream' used at line 87 is defined at line 27 and has a Long-Range dependency.
Variable 'numToFactorize' used at line 87 is defined at line 77 and has a Short-Range dependency. | {'If Body': 1} | {'Global_Variable Long-Range': 1, 'Variable Short-Range': 1} |
infilling_java | FactorizationTester | 90 | 91 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' resultStream.format (" x %d", numToFactorize);', ' }'] | [' }', ' ', ' ', ' /**', ' * This is the constructor. What it does is to fill the array allPrimes with all', ' * of the prime numbers from 2 through sqrt(maxNumberToFactorize). This array of primes', ' * can then subsequently be used by the printPrimeFactorization method to actually', ' * compute the prim... | [{'reason_category': 'Else Reasoning', 'usage_line': 90}, {'reason_category': 'Else Reasoning', 'usage_line': 91}] | Global_Variable 'resultStream' used at line 90 is defined at line 27 and has a Long-Range dependency.
Variable 'numToFactorize' used at line 90 is defined at line 77 and has a Medium-Range dependency. | {'Else Reasoning': 2} | {'Global_Variable Long-Range': 1, 'Variable Medium-Range': 1} |
infilling_java | FactorizationTester | 123 | 124 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' allPrimes[i] = i + 2;', ' }'] | [' ', ' // now we keep removing numbers from the list until we have only primes', ' while (numIntsInList > numPrimes) {', ' ', ' // curPos tells us the last slot that has a "good" (still possibly prime) value.', ' int curPos = numPrimes + 1;', ' ', ' // the front of the list is a prime.... | [{'reason_category': 'Loop Body', 'usage_line': 123}, {'reason_category': 'Loop Body', 'usage_line': 124}] | Variable 'i' used at line 123 is defined at line 122 and has a Short-Range dependency.
Global_Variable 'allPrimes' used at line 123 is defined at line 112 and has a Medium-Range dependency. | {'Loop Body': 2} | {'Variable Short-Range': 1, 'Global_Variable Medium-Range': 1} |
infilling_java | FactorizationTester | 135 | 141 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' // if the dude at position i is not a multiple of the current prime, then', " // we keep him; otherwise, he'll be lost", ' if (allPrimes[i] % allPrimes[numPrimes] != 0) {', ' allPrimes[curPos] = allPrimes[i];', ' curPos++;', ' }', ' }'] | [' ', ' // the number of ints in the list is now equal to the last slot we wrote a value to', ' numIntsInList = curPos;', ' ', ' // and the guy at the front of the list is now considered a prime', ' numPrimes++;', ' ', ' }', ' }', ' ', '', '}', '', '/**', ' * A JUnit test case cl... | [{'reason_category': 'Loop Body', 'usage_line': 135}, {'reason_category': 'Loop Body', 'usage_line': 136}, {'reason_category': 'Loop Body', 'usage_line': 137}, {'reason_category': 'If Condition', 'usage_line': 137}, {'reason_category': 'Loop Body', 'usage_line': 138}, {'reason_category': 'If Body', 'usage_line': 138}, ... | Global_Variable 'allPrimes' used at line 137 is defined at line 112 and has a Medium-Range dependency.
Variable 'i' used at line 137 is defined at line 133 and has a Short-Range dependency.
Global_Variable 'numPrimes' used at line 137 is defined at line 118 and has a Medium-Range dependency.
Global_Variable 'allPrimes'... | {'Loop Body': 7, 'If Condition': 1, 'If Body': 3} | {'Global_Variable Medium-Range': 3, 'Variable Short-Range': 4} |
infilling_java | FactorizationTester | 137 | 141 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' if (allPrimes[i] % allPrimes[numPrimes] != 0) {', ' allPrimes[curPos] = allPrimes[i];', ' curPos++;', ' }', ' }'] | [' ', ' // the number of ints in the list is now equal to the last slot we wrote a value to', ' numIntsInList = curPos;', ' ', ' // and the guy at the front of the list is now considered a prime', ' numPrimes++;', ' ', ' }', ' }', ' ', '', '}', '', '/**', ' * A JUnit test case cl... | [{'reason_category': 'Loop Body', 'usage_line': 137}, {'reason_category': 'If Condition', 'usage_line': 137}, {'reason_category': 'Loop Body', 'usage_line': 138}, {'reason_category': 'If Body', 'usage_line': 138}, {'reason_category': 'Loop Body', 'usage_line': 139}, {'reason_category': 'If Body', 'usage_line': 139}, {'... | Global_Variable 'allPrimes' used at line 137 is defined at line 112 and has a Medium-Range dependency.
Variable 'i' used at line 137 is defined at line 133 and has a Short-Range dependency.
Global_Variable 'numPrimes' used at line 137 is defined at line 118 and has a Medium-Range dependency.
Global_Variable 'allPrimes'... | {'Loop Body': 5, 'If Condition': 1, 'If Body': 3} | {'Global_Variable Medium-Range': 3, 'Variable Short-Range': 4} |
infilling_java | FactorizationTester | 138 | 140 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' allPrimes[curPos] = allPrimes[i];', ' curPos++;', ' }'] | [' }', ' ', ' // the number of ints in the list is now equal to the last slot we wrote a value to', ' numIntsInList = curPos;', ' ', ' // and the guy at the front of the list is now considered a prime', ' numPrimes++;', ' ', ' }', ' }', ' ', '', '}', '', '/**', ' * A JUnit t... | [{'reason_category': 'Loop Body', 'usage_line': 138}, {'reason_category': 'If Body', 'usage_line': 138}, {'reason_category': 'Loop Body', 'usage_line': 139}, {'reason_category': 'If Body', 'usage_line': 139}, {'reason_category': 'Loop Body', 'usage_line': 140}, {'reason_category': 'If Body', 'usage_line': 140}] | Global_Variable 'allPrimes' used at line 138 is defined at line 112 and has a Medium-Range dependency.
Variable 'i' used at line 138 is defined at line 133 and has a Short-Range dependency.
Variable 'curPos' used at line 138 is defined at line 130 and has a Short-Range dependency.
Variable 'curPos' used at line 139 is ... | {'Loop Body': 3, 'If Body': 3} | {'Global_Variable Medium-Range': 1, 'Variable Short-Range': 3} |
infilling_java | FactorizationTester | 176 | 178 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' result = new ByteArrayOutputStream();', ' outputStream = new PrintStream(result);', ' } '] | [' ', ' /**', ' * Print a nice message about each test.', ' */', ' private void printInfo(String description, String expected, String actual) {', ' System.out.format ("\\n%s\\n", description);', ' System.out.format ("output:\\t%s\\n", actual);', ' System.out.format ("correct:\\t%s\\n", expected);', ' }... | [] | Global_Variable 'result' used at line 176 is defined at line 165 and has a Medium-Range dependency.
Global_Variable 'result' used at line 177 is defined at line 176 and has a Short-Range dependency.
Global_Variable 'outputStream' used at line 177 is defined at line 170 and has a Short-Range dependency. | {} | {'Global_Variable Medium-Range': 1, 'Global_Variable Short-Range': 2} |
infilling_java | FactorizationTester | 210 | 219 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (7);', '', ' // Print Results', ' String expected = new String("Prime factorization of 7 is: 7");', ' printInfo("Factorizing 7 using max 100", expected, result.toString());', '',... | ['', ' // Test the factorization of 5', ' public void test100MaxFactorize5() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (5);', '', ' // Print Results', ' String expected = new String("Prim... | [] | Class 'PrimeFactorizer' used at line 210 is defined at line 12 and has a Long-Range dependency.
Global_Variable 'outputStream' used at line 210 is defined at line 170 and has a Long-Range dependency.
Function 'PrimeFactorizer.printPrimeFactorization' used at line 211 is defined at line 34 and has a Long-Range dependenc... | {} | {'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2} |
infilling_java | FactorizationTester | 224 | 233 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (5);', '', ' // Print Results', ' String expected = new String("Prime factorization of 5 is: 5");', ' printInfo("Factorizing 5 using max 100", expected, result.toString());', '',... | [' ', ' // Test the factorization of 30', ' public void test100MaxFactorize30() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (30);', '', ' // Print Results', ' String expected = new String... | [] | Class 'PrimeFactorizer' used at line 224 is defined at line 12 and has a Long-Range dependency.
Global_Variable 'outputStream' used at line 224 is defined at line 170 and has a Long-Range dependency.
Function 'PrimeFactorizer.printPrimeFactorization' used at line 225 is defined at line 34 and has a Long-Range dependenc... | {} | {'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2} |
infilling_java | FactorizationTester | 321 | 330 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' PrimeFactorizer myFactorizerMax100 = new PrimeFactorizer(100, outputStream);', ' myFactorizerMax100.printPrimeFactorization (97);', '', ' // Print Results', ' String expected = new String("Prime factorization of 97 is: 97");', ' printInfo("Factorizing 97 using max 100", expected, result.toString());',... | ['', ' // Test the factorization of 34534', ' // factorize numbers up to 100000000', ' public void test100000000MaxFactorize34534() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization ... | [] | Class 'PrimeFactorizer' used at line 321 is defined at line 12 and has a Long-Range dependency.
Global_Variable 'outputStream' used at line 321 is defined at line 170 and has a Long-Range dependency.
Function 'PrimeFactorizer.printPrimeFactorization' used at line 322 is defined at line 34 and has a Long-Range dependenc... | {} | {'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2} |
infilling_java | FactorizationTester | 336 | 345 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (34534);', '', ' // Print Results', ' String expected = new String("Prime factorization of 34534 is: 2 x 31 x 557");', ' printInfo("Factorizing 34534 using max ... | ['', ' // Test the factorization of 4339', ' // factorize numbers up to 100000000', ' public void test100000000MaxFactorize4339() {', ' // Factorize the number', ' PrimeFactorizer myFactorizerMax100000000 = new PrimeFactorizer(100000000, outputStream);', ' myFactorizerMax100000000.printPrimeFactorization (4... | [] | Class 'PrimeFactorizer' used at line 336 is defined at line 12 and has a Long-Range dependency.
Global_Variable 'outputStream' used at line 336 is defined at line 170 and has a Long-Range dependency.
Function 'PrimeFactorizer.printPrimeFactorization' used at line 337 is defined at line 34 and has a Long-Range dependenc... | {} | {'Class Long-Range': 1, 'Global_Variable Long-Range': 3, 'Function Long-Range': 2, 'Variable Short-Range': 2} |
infilling_java | FactorizationTester | 449 | 455 | ['import junit.framework.TestCase;', 'import java.io.ByteArrayOutputStream;', 'import java.io.PrintStream;', 'import java.lang.Math;', '', '/**', ' * This class implements a relatively simple algorithm for computing', ' * (and printing) the prime factors of a number. At initialization,', ' * a list of primes is comput... | [' myFactorizerMax100000000000.printPrimeFactorization (i);', ' if (i == 38845248344L) {', ' // Compare the Prime factorization of 38845248344 to the expected result', ' String expected = new String("Prime factorization of 38845248344 is: 2 x 2 x 2 x 7 x 693665149"); ', ' assertEquals (ex... | [' ', ' // if we make it here, we pass the test', ' assertTrue (true);', ' }', ' ', '}'] | [{'reason_category': 'Loop Body', 'usage_line': 449}, {'reason_category': 'Loop Body', 'usage_line': 450}, {'reason_category': 'If Condition', 'usage_line': 450}, {'reason_category': 'If Body', 'usage_line': 451}, {'reason_category': 'Loop Body', 'usage_line': 451}, {'reason_category': 'Loop Body', 'usage_line': 452}, ... | Function 'PrimeFactorizer.printPrimeFactorization' used at line 449 is defined at line 34 and has a Long-Range dependency.
Variable 'i' used at line 449 is defined at line 448 and has a Short-Range dependency.
Variable 'i' used at line 450 is defined at line 448 and has a Short-Range dependency.
Variable 'expected' use... | {'Loop Body': 7, 'If Condition': 1, 'If Body': 4} | {'Function Long-Range': 1, 'Variable Short-Range': 3, 'Global_Variable Long-Range': 1} |
infilling_java | RNGTester | 146 | 148 | ['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r... | [' seedValue = mySeed;', ' rng = new Random(seedValue);', ' }'] | [' ', ' /**', ' * Return the next double value between 0.0 and 1.0', ' */', ' public double next() {', ' return rng.nextDouble();', ' }', ' ', ' /**', ' * Reset the PRNG to the original seed', ' */', ' public void startOver() {', ' rng.setSeed(seedValue);', ' }', '}', '', '', 'class Multinomial ex... | [] | Variable 'mySeed' used at line 146 is defined at line 145 and has a Short-Range dependency.
Global_Variable 'seedValue' used at line 146 is defined at line 139 and has a Short-Range dependency.
Library 'Random' used at line 147 is defined at line 5 and has a Long-Range dependency.
Global_Variable 'seedValue' used at li... | {} | {'Variable Short-Range': 1, 'Global_Variable Short-Range': 3, 'Library Long-Range': 1} |
infilling_java | RNGTester | 153 | 155 | ['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r... | [' public double next() {', ' return rng.nextDouble();', ' }'] | [' ', ' /**', ' * Reset the PRNG to the original seed', ' */', ' public void startOver() {', ' rng.setSeed(seedValue);', ' }', '}', '', '', 'class Multinomial extends ARandomGenerationAlgorithm <IDoubleVector> {', ' ', ' /**', ' * Parameters', ' */', ' private MultinomialParam params;', '', ' public ... | [] | Function 'next' used at line 153 is defined at line 18 and has a Long-Range dependency.
Global_Variable 'rng' used at line 154 is defined at line 140 and has a Medium-Range dependency. | {} | {'Function Long-Range': 1, 'Global_Variable Medium-Range': 1} |
infilling_java | RNGTester | 160 | 162 | ['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r... | [' public void startOver() {', ' rng.setSeed(seedValue);', ' }'] | ['}', '', '', 'class Multinomial extends ARandomGenerationAlgorithm <IDoubleVector> {', ' ', ' /**', ' * Parameters', ' */', ' private MultinomialParam params;', '', ' public Multinomial (long mySeed, MultinomialParam myParams) {', ' super(mySeed);', ' params = myParams;', ' }', ' ', ' public Multinomi... | [] | Function 'startOver' used at line 160 is defined at line 23 and has a Long-Range dependency.
Global_Variable 'rng' used at line 161 is defined at line 140 and has a Medium-Range dependency.
Global_Variable 'seedValue' used at line 161 is defined at line 139 and has a Medium-Range dependency. | {} | {'Function Long-Range': 1, 'Global_Variable Medium-Range': 2} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.