Отладчик Eclipse не работает (пропускать точки останова отключено) - PullRequest
2 голосов
/ 28 мая 2020

Я впервые запускаю отладчик для проверки значений моего двоичного дерева поиска, но, похоже, он пропускает весь отладчик, и у него есть странная стрелка рядом с синей точкой. Кстати, пропуск всех точек останова отключен, я в этом убедился.

Это короткий GIF-файл, в котором я запускаю программу https://gyazo.com/e236c1bd75ac746bf9982871ca847233

Добавлены другие мои класс

public class BinaryTree<T extends Comparable<T>> {

private class Node{

    private T data;
    private Node left;
    private Node right;

    // left and right child do not have to nessary exist
    public Node ( T data) {
        this.data = data;
        this.left = null;
        this.right = null; 
    }}

    private Node root;
    private int count = 0;

    public void add( T data) {
        if ( isEmpty()) {
            root = new Node(data);
            count++;
        }
        else {
            insert(data, root);
            count++;
        }
    }

    public boolean isEmpty() {  
        return root == null;
    }

    public T getRoot()  {
        if ( root.data == null) {
            System.out.println("Root is empty");
            return null;
        }
        else {
        return  root.data;
    }}

    /*
     * Checking if the data is larger or lesser than the parent's data
     * If the data is smaller than the parent's data, node.left is created 
     * If the data is bigger than the parent's data, node.right is created
     */
    private void insert( T data, Node node) {

        /*
         * If 1st obj is less than the 2nd obj return a neg
         * if 1st obj is more than the 2nd obj return a pos
         * if equal return 0
         */
        int compare = data.compareTo(node.data);
        if ( compare < 1 ){
            if (node.left == null ) {
                node.left = new Node(data);

            }

        // make node.left if it is filled   
            else {
                insert(data, node.left);
            }
        }

        else {
            if ( node.right == null) {
                node.right = new Node(data);
            }
            else {
                insert( data, node.right);
            }
        }
    }

    public int getSize() {
        return count;
    }

    private void removeInner( T data, Node node ) {

    Node temp;
    while ( node.data!=data) {
        int compare = data.compareTo(node.data);

        if ( compare < 1 ){
            node = node.left;
        }
        // make node.left if it is filled   
        if ( compare > 1 ){
            node = node.right;
            }

        if ( compare == 0) {
            node = null;
        }


        }


    }

}

enter image description here

1 Ответ

1 голос
/ 28 мая 2020

У вас есть одна или несколько так называемых триггерных точек s (украшенных T) где-то еще, из которых нужно нажать первым, чтобы активировать другие обычные точки останова. Это видно по обычной точке останова в строке 9 , украшенной перечеркнутым T.

Решение: удалите или деактивируйте все триггерные точки (те, которые отмечены T) , например, в представлении Точки останова .

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...