    public ProjectExperienceForm(final String studentID) {
        super("Adding your project experience here");

        // 创建标题标签，设置字体和尺寸，居中对齐
        titleLabel = new JLabel("Adding your project experience here");
        titleLabel.setFont(new Font("Helvetica", Font.BOLD, 20));
        titleLabel.setHorizontalAlignment(JLabel.CENTER);

        // 创建项目名称输入框，设置大小和位置
        projectNameField = new JTextField(20);
        projectNameField.setHorizontalAlignment(JTextField.CENTER);
        projectNameField.setPreferredSize(new Dimension(200, 30));

        // 创建项目时间输入框，设置大小和位置
        projectTimeField = new JTextField(20);
        projectTimeField.setHorizontalAlignment(JTextField.CENTER);
        projectTimeField.setPreferredSize(new Dimension(200, 30));

        // 创建项目内容文本框，设置大小和位置
        projectContentArea = new JTextArea(5, 20);
        projectContentArea.setLineWrap(true);
        projectContentArea.setWrapStyleWord(true);
        JScrollPane scrollPane = new JScrollPane(projectContentArea);

        // 创建提交按钮，设置大小和位置
        submitButton = new JButton("Submit");
        submitButton.setPreferredSize(new Dimension(200, 30));

        // 创建返回按钮，设置大小和位置
        backButton = new JButton("Back");
        backButton.setPreferredSize(new Dimension(200, 30));

        // 创建面板，将组件添加到面板上
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(10, 10, 10, 10);

        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 2;
        panel.add(titleLabel, gbc);

        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        panel.add(new JLabel("Project Name:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 1;
        panel.add(projectNameField, gbc);

        gbc.gridx = 0;
        gbc.gridy = 2;
        panel.add(new JLabel("Project Time:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 2;
        panel.add(projectTimeField, gbc);

        gbc.gridx = 0;
        gbc.gridy = 3;
        panel.add(new JLabel("Project Content:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 3;
        panel.add(scrollPane, gbc);

        gbc.gridx = 0;
        gbc.gridy = 4;
        gbc.gridwidth = 1;
        panel.add(submitButton, gbc);

        gbc.gridx = 1;
        gbc.gridy = 4;
        panel.add(backButton, gbc);

        // 清空所有输入框内容
        submitButton.addActionListener(e -> {
            // 获取输入框中的信息
            String projectName = projectNameField.getText();
            String projectTime = projectTimeField.getText();
            String projectContent = projectContentArea.getText();

            // 将项目信息写入StudentProject.csv中
            Student s = DB.getStudent(studentID);
            List<Project> projs;
            if (s != null) {
                projs = s.getProjs();
                projs.add(new Project(projectName, projectTime, projectContent));
                s.setProjs(projs);
                DB.updateStudent(s);

                projectNameField.setText("");
                projectTimeField.setText("");
                projectContentArea.setText("");
                JOptionPane.showMessageDialog(null, "Project submitted successfully!");
            }
        });
        backButton.addActionListener(e -> {
            dispose();
            new StudentProjectApp(studentID);
        });

        // 将面板添加到窗口上
        add(panel);
        pack();
        setLocationRelativeTo(null);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public ProjectExperienceForm(final String studentID) {

        super("Adding your project experience here");
        this.studentID = studentID;

        // 创建标题标签，设置字体和尺寸，居中对齐
        titleLabel = new JLabel("Adding your project experience here");
        titleLabel.setFont(new Font("Helvetica", Font.BOLD, 20));
        titleLabel.setHorizontalAlignment(JLabel.CENTER);

        // 创建项目名称输入框，设置大小和位置
        projectNameField = new JTextField(20);
        projectNameField.setHorizontalAlignment(JTextField.CENTER);
        projectNameField.setPreferredSize(new Dimension(200, 30));

        // 创建项目时间输入框，设置大小和位置
        projectTimeField = new JTextField(20);
        projectTimeField.setHorizontalAlignment(JTextField.CENTER);
        projectTimeField.setPreferredSize(new Dimension(200, 30));

        // 创建项目内容文本框，设置大小和位置
        projectContentArea = new JTextArea(5, 20);
        projectContentArea.setLineWrap(true);
        projectContentArea.setWrapStyleWord(true);
        JScrollPane scrollPane = new JScrollPane(projectContentArea);

        // 创建提交按钮，设置大小和位置
        submitButton = new JButton("Submit");
        submitButton.setPreferredSize(new Dimension(200, 30));

        // 创建返回按钮，设置大小和位置
        backButton = new JButton("Back");
        backButton.setPreferredSize(new Dimension(200, 30));

        // 创建面板，将组件添加到面板上
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(10, 10, 10, 10);

        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 2;
        panel.add(titleLabel, gbc);

        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        panel.add(new JLabel("Project Name:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 1;
        panel.add(projectNameField, gbc);

        gbc.gridx = 0;
        gbc.gridy = 2;
        panel.add(new JLabel("Project Time:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 2;
        panel.add(projectTimeField, gbc);

        gbc.gridx = 0;
        gbc.gridy = 3;
        panel.add(new JLabel("Project Content:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 3;
        panel.add(scrollPane, gbc);

        gbc.gridx = 0;
        gbc.gridy = 4;
        gbc.gridwidth = 1;
        panel.add(submitButton, gbc);

        gbc.gridx = 1;
        gbc.gridy = 4;
        panel.add(backButton, gbc);

        // 将面板添加到窗口上
        add(panel);
        pack();
        setLocationRelativeTo(null);
        setVisible(true);

        // 清空所有输入框内容
        submitButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                // 获取输入框中的信息
                String projectName = projectNameField.getText();
                String projectTime = projectTimeField.getText();
                String projectContent = projectContentArea.getText();
                // 从StudentInfo.csv中获取学生姓名和学号
                String studentName = "";
                String student_ID = " ";

                // 将项目信息写入StudentProject.csv中
                Student s = DB.getStudent(studentID);
                List<Project> projs = null;
                if (s != null) {
                    projs = s.getProjs();
                    projs.add(new Project(projectName, projectTime, projectContent));
                    s.setProjs(projs);
                    DB.updateStudent(s);

                    projectNameField.setText("");
                    projectTimeField.setText("");
                    projectContentArea.setText("");
                    JOptionPane.showMessageDialog(null, "Project submitted successfully!");
                }
            }

        });
        backButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                new StudentProjectApp(studentID);

            }
        });

        // 将面板添加到窗口上
        add(panel);
        pack();
        setLocationRelativeTo(null);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

Replace Anonymous With Lambda cn.edu.bupt.ProjectExperienceForm.ProjectExperienceForm.addActionListener.new ActionListener with e -> {String projectName=projectNameField.getText(); in method public ProjectExperienceForm(studentID String) from class cn.edu.bupt.ProjectExperienceForm


    public StudentHonorApp(String studentID) {
        this.honors = new ArrayList<>();
//        readProjects();
        Student s = DB.getStudent(studentID);
        if (s != null) {
            List<Honor> honor = s.getHonors();
            // 将projs转为ArrayList<String[]>
            for (Honor h : honor) {
                String[] s_honor = new String[2];
                s_honor[0] = h.getHonor_name();
                s_honor[1] = h.getHonor_time();

                honors.add(s_honor);
            }
        }

        // 创建主面板
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());

        // 创建返回按钮和添加按钮
        JButton backButton = new JButton("Back");
        backButton.addActionListener(e -> {
            dispose();
            new LearningJourneyApp(studentID);
        });
        JButton addButton = new JButton("Add New");
        addButton.addActionListener(e -> {
            dispose();
            new StudentHonorForm(studentID);
        });
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
        buttonPanel.add(backButton);
        buttonPanel.add(addButton);
        mainPanel.add(buttonPanel, BorderLayout.NORTH);

        // 创建项目按钮面板
        JPanel projectPanel = new JPanel();
        projectPanel.setLayout(new BoxLayout(projectPanel, BoxLayout.Y_AXIS));

        // 创建每个项目的按钮
        for (String[] project : honors) {

            JButton projectButton = new JButton(project[0] + " " + project[1]);
            projectButton.setPreferredSize(new Dimension(550, 50));
            projectButton.setMaximumSize(new Dimension(Short.MAX_VALUE, 50));
            projectButton.setAlignmentX(Component.CENTER_ALIGNMENT);

            // 创建项目按钮的监听器
            projectButton.addActionListener(e -> {
                // 创建新的项目详情面板
                JPanel projectDetailPanel = new JPanel();
                projectDetailPanel.setLayout(new BoxLayout(projectDetailPanel, BoxLayout.Y_AXIS));

                // 添加项目详情信息
                projectDetailPanel.add(new JLabel("Honor Name: " + project[0]));
                projectDetailPanel.add(new JLabel("Honor Time: " + project[1]));
//                    projectDetailPanel.add(new JLabel("Project Description: " + project[2]));

                // 添加返回按钮
                JButton backButton1 = new JButton("Back");
                backButton1.addActionListener(e1 -> {
                    mainPanel.setVisible(true);
                    projectDetailPanel.setVisible(false);
                });
                projectDetailPanel.add(backButton1);

                JButton deleteButton = new JButton("Delete");
                deleteButton.addActionListener(e12 -> {
                    int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this honor?", "Delete honor", JOptionPane.YES_NO_OPTION);
                    if (result == JOptionPane.YES_OPTION) {
                        System.out.println("success");
                        DB.deleteHonor(project[0], project[1]);
                        new StudentHonorApp(studentID);
                        dispose();
                    }
                });
                projectDetailPanel.add(deleteButton);
                // 显示项目详情面板
                mainPanel.setVisible(false);
                projectDetailPanel.setVisible(true);
                getContentPane().add(projectDetailPanel, BorderLayout.CENTER);
            });

            projectPanel.add(projectButton);
        }

        // 添加项目面板到主面板
        mainPanel.add(projectPanel, BorderLayout.CENTER);
        getContentPane().add(mainPanel);

        setTitle("Student Honors");
        setSize(600, 400);
        setLocationRelativeTo(null);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public StudentHonorApp(String studentID) {
        this.studentID = studentID;
        this.honors = new ArrayList<>();
//        readProjects();
        Student s = DB.getStudent(studentID);
        if (s != null) {
            List<Honor> honor = s.getHonors();
            // 将projs转为ArrayList<String[]>
            for (Honor h : honor) {
                String[] s_honor = new String[2];
                s_honor[0] = h.getHonor_name();
                s_honor[1] = h.getHonor_time();

                honors.add(s_honor);
            }
        }

        // 创建主面板
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());

        // 创建返回按钮和添加按钮
        JButton backButton = new JButton("Back");
        backButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                new LearningJourneyApp(studentID);
            }
        });
        JButton addButton = new JButton("Add New");
        addButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                new StudentHonorForm(studentID);
            }
        });
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
        buttonPanel.add(backButton);
        buttonPanel.add(addButton);
        mainPanel.add(buttonPanel, BorderLayout.NORTH);

        // 创建项目按钮面板
        JPanel projectPanel = new JPanel();
        projectPanel.setLayout(new BoxLayout(projectPanel, BoxLayout.Y_AXIS));

        // 创建每个项目的按钮
        for (String[] project : honors) {

            JButton projectButton = new JButton(project[0] + " " + project[1]);
            projectButton.setPreferredSize(new Dimension(550, 50));
            projectButton.setMaximumSize(new Dimension(Short.MAX_VALUE, 50));
            projectButton.setAlignmentX(Component.CENTER_ALIGNMENT);

            // 创建项目按钮的监听器
            projectButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // 创建新的项目详情面板
                    JPanel projectDetailPanel = new JPanel();
                    projectDetailPanel.setLayout(new BoxLayout(projectDetailPanel, BoxLayout.Y_AXIS));

                    // 添加项目详情信息
                    projectDetailPanel.add(new JLabel("Honor Name: " + project[0]));
                    projectDetailPanel.add(new JLabel("Honor Time: " + project[1]));
//                    projectDetailPanel.add(new JLabel("Project Description: " + project[2]));

                    // 添加返回按钮
                    JButton backButton = new JButton("Back");
                    backButton.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            mainPanel.setVisible(true);
                            projectDetailPanel.setVisible(false);
                        }
                    });
                    projectDetailPanel.add(backButton);

                    JButton deleteButton = new JButton("Delete");
                    deleteButton.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this honor?", "Delete honor", JOptionPane.YES_NO_OPTION);
                            if (result == JOptionPane.YES_OPTION) {
                                System.out.println("success");
                                DB.deleteHonor(project[0], project[1]);
                                writeProjects();
                                new StudentHonorApp(studentID);
                                dispose();
                            }
                        }
                    });
                    projectDetailPanel.add(deleteButton);
                    // 显示项目详情面板
                    mainPanel.setVisible(false);
                    projectDetailPanel.setVisible(true);
                    getContentPane().add(projectDetailPanel, BorderLayout.CENTER);
                }
            });

            projectPanel.add(projectButton);
        }

        // 添加项目面板到主面板
        mainPanel.add(projectPanel, BorderLayout.CENTER);
        getContentPane().add(mainPanel);

        setTitle("Student Honors");
        setSize(600, 400);
        setLocationRelativeTo(null);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

Replace Anonymous With Lambda cn.edu.bupt.StudentHonorApp.StudentHonorApp.addActionListener.new ActionListener with e -> {JPanel projectDetailPanel=new JPanel(); in method public StudentHonorApp(studentID String) from class cn.edu.bupt.StudentHonorApp


    public StudentHonorForm(final String studentID) {
        super("Adding your project experience here");

        // 创建标题标签，设置字体和尺寸，居中对齐
        titleLabel = new JLabel("Adding your project experience here");
        titleLabel.setFont(new Font("Helvetica", Font.BOLD, 20));
        titleLabel.setHorizontalAlignment(JLabel.CENTER);

        // 创建项目时间输入框，设置大小和位置
        projectTimeField = new JTextField(20);
        projectTimeField.setHorizontalAlignment(JTextField.CENTER);
        projectTimeField.setPreferredSize(new Dimension(200, 30));

        // 创建项目内容文本框，设置大小和位置
        projectContentArea = new JTextArea(5, 20);
        projectContentArea.setLineWrap(true);
        projectContentArea.setWrapStyleWord(true);
        JScrollPane scrollPane = new JScrollPane(projectContentArea);

        // 创建提交按钮，设置大小和位置
        submitButton = new JButton("Submit");
        submitButton.setPreferredSize(new Dimension(200, 30));

        // 创建返回按钮，设置大小和位置
        backButton = new JButton("Back");
        backButton.setPreferredSize(new Dimension(200, 30));

        // 创建面板，将组件添加到面板上
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(10, 10, 10, 10);

        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 2;
        panel.add(titleLabel, gbc);

        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        panel.add(new JLabel("Project Time:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 1;
        panel.add(projectTimeField, gbc);

        gbc.gridx = 0;
        gbc.gridy = 2;
        panel.add(new JLabel("Project Content:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 2;
        panel.add(scrollPane, gbc);

        gbc.gridx = 0;
        gbc.gridy = 3;
        gbc.gridwidth = 1;
        panel.add(submitButton, gbc);

        gbc.gridx = 1;
        gbc.gridy = 3;
        panel.add(backButton, gbc);

        // 清空所有输入框内容
        submitButton.addActionListener(e -> {
            // 获取输入框中的信息
            String honorTime = projectTimeField.getText();
            String honorContent = projectContentArea.getText();

            // 将项目信息写入StudentProject.csv中
            Student s = DB.getStudent(studentID);
            List<Honor> s_honor;
            if (s != null) {
                s_honor = s.getHonors();
                s_honor.add(new Honor(honorTime, honorContent));
                s.setHonors(s_honor);
                DB.updateStudent(s);

                projectTimeField.setText("");
                projectContentArea.setText("");
                JOptionPane.showMessageDialog(null, "Project submitted successfully!");
            }
        });
        backButton.addActionListener(e -> {
            dispose();
            new StudentHonorApp(studentID);
        });

        // 将面板添加到窗口上
        add(panel);
        pack();
        setLocationRelativeTo(null);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public StudentHonorForm(final String studentID) {

        super("Adding your project experience here");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.studentID = studentID;
        // 创建标题标签，设置字体和尺寸，居中对齐
        titleLabel = new JLabel("Adding your project experience here");
        titleLabel.setFont(new Font("Helvetica", Font.BOLD, 20));
        titleLabel.setHorizontalAlignment(JLabel.CENTER);

        // 创建项目时间输入框，设置大小和位置
        projectTimeField = new JTextField(20);
        projectTimeField.setHorizontalAlignment(JTextField.CENTER);
        projectTimeField.setPreferredSize(new Dimension(200, 30));

        // 创建项目内容文本框，设置大小和位置
        projectContentArea = new JTextArea(5, 20);
        projectContentArea.setLineWrap(true);
        projectContentArea.setWrapStyleWord(true);
        JScrollPane scrollPane = new JScrollPane(projectContentArea);

        // 创建提交按钮，设置大小和位置
        submitButton = new JButton("Submit");
        submitButton.setPreferredSize(new Dimension(200, 30));

        // 创建返回按钮，设置大小和位置
        backButton = new JButton("Back");
        backButton.setPreferredSize(new Dimension(200, 30));

        // 创建面板，将组件添加到面板上
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(10, 10, 10, 10);

        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 2;
        panel.add(titleLabel, gbc);

        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 1;
        panel.add(new JLabel("Project Time:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 1;
        panel.add(projectTimeField, gbc);

        gbc.gridx = 0;
        gbc.gridy = 2;
        panel.add(new JLabel("Project Content:"), gbc);

        gbc.gridx = 1;
        gbc.gridy = 2;
        panel.add(scrollPane, gbc);

        gbc.gridx = 0;
        gbc.gridy = 3;
        gbc.gridwidth = 1;
        panel.add(submitButton, gbc);

        gbc.gridx = 1;
        gbc.gridy = 3;
        panel.add(backButton, gbc);

        // 清空所有输入框内容
        submitButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                // 获取输入框中的信息
                String honorTime = projectTimeField.getText();
                String honorContent = projectContentArea.getText();
                // 从StudentInfo.csv中获取学生姓名和学号
                String studentName = "";
                String student_ID = " ";

                // 将项目信息写入StudentProject.csv中
                Student s = DB.getStudent(studentID);
                List<Honor> s_honor = null;
                if (s != null) {
                    s_honor = s.getHonors();
                    s_honor.add(new Honor(honorTime, honorContent));
                    s.setHonors(s_honor);
                    DB.updateStudent(s);

                    projectTimeField.setText("");
                    projectContentArea.setText("");
                    JOptionPane.showMessageDialog(null, "Project submitted successfully!");
                }
            }

        });
        backButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                new StudentHonorApp(studentID);

            }
        });

        // 将面板添加到窗口上
        add(panel);
        pack();
        setLocationRelativeTo(null);
        setVisible(true);

    }

Replace Anonymous With Lambda cn.edu.bupt.StudentHonorForm.StudentHonorForm.addActionListener.new ActionListener with e -> {String honorTime=projectTimeField.getText(); in method public StudentHonorForm(studentID String) from class cn.edu.bupt.StudentHonorForm


    public StudentProjectApp(String studentID) {
        ArrayList<String[]> projects = new ArrayList<>();
        Student s = DB.getStudent(studentID);
        if (s != null) {
            List<Project> projs = s.getProjs();
            // 将projs转为ArrayList<String[]>
            for (Project p : projs) {
                String[] project = new String[3];
                project[0] = p.getProj_name();
                project[1] = p.getProj_time();
                project[2] = p.getDescribe();
                projects.add(project);
            }
        }

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Student Projects");
        setSize(600, 400);
        setLocationRelativeTo(null);

        // 创建主面板
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());

        // 创建返回按钮和添加按钮
        JButton backButton = new JButton("Back");
        backButton.addActionListener(e -> {
            dispose();
            new LearningJourneyApp(studentID);
        });
        JButton addButton = new JButton("Add New");
        addButton.addActionListener(e -> {
            dispose();
            new ProjectExperienceForm(studentID);
        });
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
        buttonPanel.add(backButton);
        buttonPanel.add(addButton);
        mainPanel.add(buttonPanel, BorderLayout.NORTH);

        // 创建项目按钮面板
        JPanel projectPanel = new JPanel();
        projectPanel.setLayout(new BoxLayout(projectPanel, BoxLayout.Y_AXIS));

        // 创建每个项目的按钮
        for (String[] project : projects) {

            JButton projectButton = new JButton(project[1] + " " + project[2]);
            projectButton.setPreferredSize(new Dimension(550, 50));
            projectButton.setMaximumSize(new Dimension(Short.MAX_VALUE, 50));
            projectButton.setAlignmentX(Component.CENTER_ALIGNMENT);

            // 创建项目按钮的监听器
            projectButton.addActionListener(e -> {
                // 创建新的项目详情面板
                JPanel projectDetailPanel = new JPanel();
                projectDetailPanel.setLayout(new BoxLayout(projectDetailPanel, BoxLayout.Y_AXIS));

                // 添加项目详情信息
                projectDetailPanel.add(new JLabel("Project Name: " + project[0]));
                projectDetailPanel.add(new JLabel("Project Time: " + project[1]));
                projectDetailPanel.add(new JLabel("Project Description: " + project[2]));

                // 添加返回按钮
                JButton backButton1 = new JButton("Back");
                backButton1.addActionListener(e1 -> {
                    mainPanel.setVisible(true);
                    projectDetailPanel.setVisible(false);
                });
                projectDetailPanel.add(backButton1);

                // 添加删除按钮
                JButton deleteButton = new JButton("Delete");
                deleteButton.addActionListener(e12 -> {
                    int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this project?", "Delete Project", JOptionPane.YES_NO_OPTION);
                    if (result == JOptionPane.YES_OPTION) {
                        System.out.println("success");
                        DB.deleteProject(project[0], project[1]);
                        new StudentProjectApp(studentID);
                        dispose();
                    }
                });
                projectDetailPanel.add(deleteButton);

                // 显示项目详情面板
                mainPanel.setVisible(false);
                projectDetailPanel.setVisible(true);
                getContentPane().add(projectDetailPanel, BorderLayout.CENTER);
            });

            projectPanel.add(projectButton);
        }

        // 添加项目面板到主面板
        mainPanel.add(projectPanel, BorderLayout.CENTER);

        getContentPane().add(mainPanel);
        setVisible(true);
    }

    public StudentProjectApp(String studentID) {
        this.studentID = studentID;
        this.projects = new ArrayList<>();
//        readProjects();
        Student s = DB.getStudent(studentID);
        if (s != null) {
            List<Project> projs = s.getProjs();
            // 将projs转为ArrayList<String[]>
            for (Project p : projs) {
                String[] project = new String[3];
                project[0] = p.getProj_name();
                project[1] = p.getProj_time();
                project[2] = p.getDescribe();
                projects.add(project);
            }
        }

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Student Projects");
        setSize(600, 400);
        setLocationRelativeTo(null);

        // 创建主面板
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());

        // 创建返回按钮和添加按钮
        JButton backButton = new JButton("Back");
        backButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                new LearningJourneyApp(studentID);
            }
        });
        JButton addButton = new JButton("Add New");
        addButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
                new ProjectExperienceForm(studentID);
            }
        });
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
        buttonPanel.add(backButton);
        buttonPanel.add(addButton);
        mainPanel.add(buttonPanel, BorderLayout.NORTH);

        // 创建项目按钮面板
        JPanel projectPanel = new JPanel();
        projectPanel.setLayout(new BoxLayout(projectPanel, BoxLayout.Y_AXIS));

        // 创建每个项目的按钮
        for (String[] project : projects) {

            JButton projectButton = new JButton(project[1] + " " + project[2]);
            projectButton.setPreferredSize(new Dimension(550, 50));
            projectButton.setMaximumSize(new Dimension(Short.MAX_VALUE, 50));
            projectButton.setAlignmentX(Component.CENTER_ALIGNMENT);

            // 创建项目按钮的监听器
            projectButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // 创建新的项目详情面板
                    JPanel projectDetailPanel = new JPanel();
                    projectDetailPanel.setLayout(new BoxLayout(projectDetailPanel, BoxLayout.Y_AXIS));

                    // 添加项目详情信息
                    projectDetailPanel.add(new JLabel("Project Name: " + project[0]));
                    projectDetailPanel.add(new JLabel("Project Time: " + project[1]));
                    projectDetailPanel.add(new JLabel("Project Description: " + project[2]));

                    // 添加返回按钮
                    JButton backButton = new JButton("Back");
                    backButton.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            mainPanel.setVisible(true);
                            projectDetailPanel.setVisible(false);
                        }
                    });
                    projectDetailPanel.add(backButton);

                    // 添加删除按钮
                    JButton deleteButton = new JButton("Delete");
                    deleteButton.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete this project?", "Delete Project", JOptionPane.YES_NO_OPTION);
                            if (result == JOptionPane.YES_OPTION) {
                                System.out.println("success");
                                DB.deleteProject(project[0], project[1]);
                                writeProjects();
                                new StudentProjectApp(studentID);
                                dispose();
                            }
                        }
                    });
                    projectDetailPanel.add(deleteButton);

                    // 显示项目详情面板
                    mainPanel.setVisible(false);
                    projectDetailPanel.setVisible(true);
                    getContentPane().add(projectDetailPanel, BorderLayout.CENTER);
                }
            });

            projectPanel.add(projectButton);
        }

        // 添加项目面板到主面板
        mainPanel.add(projectPanel, BorderLayout.CENTER);

        getContentPane().add(mainPanel);
        setVisible(true);
    }

Replace Anonymous With Lambda cn.edu.bupt.StudentProjectApp.StudentProjectApp.addActionListener.new ActionListener with e -> {JPanel projectDetailPanel=new JPanel(); in method public StudentProjectApp(studentID String) from class cn.edu.bupt.StudentProjectApp


    public static void sortByCount(Map map){
        System.out.println("\n Статистика по количеству уникальных слов (сортировка по количеству): \n");
        List<Map.Entry<String, Item>> sorted = new LinkedList<Map.Entry<String, Item>>(map.entrySet());
        sorted.sort((a, b) -> (b.getValue().count - a.getValue().count));
        for ( Map.Entry<String, Item> sort : sorted )
            System.out.println(sort.getKey() + " - " + sort.getValue().count);
    }

    public static void sortByCount(Map map){
        System.out.println("\n Статистика по количеству уникальных слов (сортировка по количеству): \n");
        List<Map.Entry<String, Item>> sorted = new LinkedList<Map.Entry<String, Item>>(map.entrySet());
        Collections.sort(sorted, new Comparator<Map.Entry<String, Item>>() {
            public int compare(Map.Entry<String, Item> a, Map.Entry<String, Item> b) {
                return ( b.getValue().count - a.getValue().count );
            }
        });
        for ( Map.Entry<String, Item> sort : sorted )
            System.out.println(sort.getKey() + " - " + sort.getValue().count);
    }

Replace Anonymous With Lambda test.ParseHTML.sortByCount.sort.new Comparator<Map.Entry<String,Item>> with (a, b) -> (b.getValue().count - a.getValue().count) in method public sortByCount(map Map) : void from class test.ParseHTML


    private void undoTurn() {
        if (history.size() == 0) {
            LOG.info("No historical commands");
            return;
        }
        int turnChangeCounter = 0;
        // A list of commands to undo
        LinkedList<Command> cmdList = new LinkedList<>();
        boolean turnStartFound = false;
        while (!turnStartFound) {
            // the first `TurnChangeCommand` and `DiceCommand` cannot be undone.
            if (history.size() == 2 || turnChangeCounter == 3) {
                turnStartFound = true;
            } else if (history.peekLast() instanceof TurnChangeCommand) {
                if (++turnChangeCounter < 3) {
                    Command lastCmd = history.removeLast();
                    cmdList.add(lastCmd);
                }
            } else {
                Command lastCmd = history.removeLast();
                cmdList.add(lastCmd);
            }
        }

        for (Object object : cmdList) {
            Command cmd = (Command) object;
            cmd.undo();
        }
    }

    private void undoTurn() {
        if (history.size() == 0) {
            LOG.info("No historical commands");
            return;
        }
        int turnChangeCounter = 0;
        // A list of commands to undo
        Queue cmdList = new LinkedList<Command>();
        boolean turnStartFound = false;
        while (!turnStartFound) {
            // the first `TurnChangeCommand` and `DiceCommand` cannot be undone.
            if (history.size() == 2 || turnChangeCounter == 3) {
                turnStartFound = true;
            } else if (history.peekLast() instanceof TurnChangeCommand) {
                if (++turnChangeCounter < 3) {
                    Command lastCmd = history.removeLast();
                    cmdList.add(lastCmd);
                }
            } else {
                Command lastCmd = history.removeLast();
                cmdList.add(lastCmd);
            }
        }

        for (Object object : cmdList) {
            Command cmd = (Command) object;
            cmd.undo();
        }
    }

Replace Generic With Diamond LinkedList<Command> with LinkedList<> in method private undoTurn() : void from class grp.oozmakappa.monsterclash.model.command.CommandManager


    public void loadBoard() {
        Rectangle cards;
        int row = 0;
        int column = 0;

        avatar.setFill(user.getAvatarRec().getFill());
        mainC.setText(String.valueOf(selectedDeck.getMainDeckCards().size()));
        sideC.setText(String.valueOf(selectedDeck.getSideDeckCards().size()));
        owner.setText(user.getUsername());
        dName.setText(deck[0]);
        if (selectedDeck.getName().equals(user.getActiveDeck().getName()))
            setActiveBtn.setVisible(false);
        for (String name : selectedDeck.getMainDeckCards()) {
            Card card = Card.make(name);
            cards = card;
            cards.setHeight(85);
            cards.setWidth(68);
            Rectangle finalCards = cards;

            cards.setOnMouseClicked(me -> {
                selectedCard.setFill(finalCards.getFill());
                selected = card;
                selectedCardDescription.setText(selected.getCardProperties());
                removeBtn.setVisible(true);
                isMain = true;
            });
            cards.setOnMouseEntered(me -> {
                glowCardEffect(finalCards);
            });
            cards.setOnMouseExited(me -> {
                undoGlowEffect(finalCards);
            });
            card.setSizes(false);
            cards.setFill(card.getRectangle().getFill());
            mainBoard.add(cards, row, column);
            row++;
            if (row == 10) {
                row = 0;
                column++;
            }
        }
        row = 0;
        column = 0;
        for (String name : selectedDeck.getSideDeckCards()) {
            Card card = Card.make(name);
            cards = new Rectangle();
            cards.setHeight(90);
            cards.setWidth(65);
            Rectangle finalCards = cards;
            cards.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {

                    selectedCard.setFill(finalCards.getFill());
                    selected = card;
                    selectedCardDescription.setText(selected.getCardProperties());
                    removeBtn.setVisible(true);
                    isMain = false;
                }
            });
            cards.setOnMouseEntered(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    finalCards.setCursor(Cursor.HAND);
                    int depth = 70;  //Setting the uniform variable for the glow width and height

                    DropShadow borderGlow = new DropShadow();
                    borderGlow.setOffsetY(0f);
                    borderGlow.setOffsetX(0f);
                    borderGlow.setColor(Color.GOLD);
                    borderGlow.setWidth(depth);
                    borderGlow.setHeight(depth);

                    finalCards.setEffect(borderGlow);
                }
            });
            cards.setOnMouseExited(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    undoGlowEffect(finalCards);
                }
            });
            assert card != null;
            card.setSizes(false);
            cards.setFill(card.getRectangle().getFill());
            sideBoard.add(cards, row, column);
            row++;
            if (row == 10) {
                row = 0;
                column++;
            }
        }
    }

    public void loadBoard() {
        Rectangle cards;
        int row = 0;
        int column = 0;

        avatar.setFill(user.getAvatarRec().getFill());
        mainC.setText(String.valueOf(selectedDeck.getMainDeckCards().size()));
        sideC.setText(String.valueOf(selectedDeck.getSideDeckCards().size()));
        owner.setText(user.getUsername());
        dName.setText(deck[0]);
        if (selectedDeck.getName().equals(user.getActiveDeck().getName()))
            setActiveBtn.setVisible(false);
        for (String name : selectedDeck.getMainDeckCards()) {
            Card card = Card.getCardByName(name);
            cards = new Rectangle();
            cards.setHeight(85);
            cards.setWidth(68);
            Rectangle finalCards = cards;

            cards.setOnMouseClicked(me -> {
                selectedCard.setFill(finalCards.getFill());
                selected = getCardByRectangle(finalCards);
                selectedCardDescription.setText(selected.getCardProperties());
                removeBtn.setVisible(true);
                isMain = true;
            });
            cards.setOnMouseEntered(me -> {
                glowCardEffect(finalCards);
            });
            cards.setOnMouseExited(me -> {
                undoGlowEffect(finalCards);
            });
            assert card != null;
            card.setSizes(false);
            cards.setFill(card.getRectangle().getFill());
            mainBoard.add(cards, row, column);
            row++;
            if (row == 10) {
                row = 0;
                column++;
            }
        }
        row = 0;
        column = 0;
        for (String name : selectedDeck.getSideDeckCards()) {
            Card card = Card.getCardByName(name);
            cards = new Rectangle();
            cards.setHeight(90);
            cards.setWidth(65);
            Rectangle finalCards = cards;
            cards.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {

                    selectedCard.setFill(finalCards.getFill());
                    selected = getCardByRectangle(finalCards);
                    selectedCardDescription.setText(selected.getCardProperties());
                    removeBtn.setVisible(true);
                    isMain = false;
                }
            });
            cards.setOnMouseEntered(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    finalCards.setCursor(Cursor.HAND);
                    int depth = 70;  //Setting the uniform variable for the glow width and height

                    DropShadow borderGlow = new DropShadow();
                    borderGlow.setOffsetY(0f);
                    borderGlow.setOffsetX(0f);
                    borderGlow.setColor(Color.GOLD);
                    borderGlow.setWidth(depth);
                    borderGlow.setHeight(depth);

                    finalCards.setEffect(borderGlow);
                }
            });
            cards.setOnMouseExited(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    undoGlowEffect(finalCards);
                }
            });
            assert card != null;
            card.setSizes(false);
            cards.setFill(card.getRectangle().getFill());
            sideBoard.add(cards, row, column);
            row++;
            if (row == 10) {
                row = 0;
                column++;
            }
        }
    }

Replace Anonymous With Lambda graphicview.EditDeck.loadBoard.setOnMouseClicked.new EventHandler<MouseEvent> with me -> {selectedCard.setFill(finalCards.getFill()); in method public loadBoard() : void from class graphicview.EditDeck


    public static void makeAllSpells() {
        new AdvancedRitualArt();
        new ChangeOfHeart();
        new DarkHole();
        new HarpiesFeatherDuster();
        new MessengerOfPeace();
        new MonsterReborn();
        new MysticalSpaceTyphoon();
        new PotOfGreed();
        new Raigeki();
        new RingOfDefense();
        new SpellAbsorption();
        new SupplySquad();
        new SwordsOfRevealingLight();
        new Terraforming();
        new TwinTwisters();
        new BlackPendant();
        new MagnumShield();
        new SwordOfDarkDestruction();
        new UnitedWeStand();
        new ClosedForest();
        new FieldSpell("Umiiruka", "Increase the ATK of all WATER monsters by 500 points and decrease " +
                "their DEF by 400 points.", new HashMap<>() {{
            put(Monster.MonsterType.AQUA, 500);
        }},
                new HashMap<>() {{
                    put(Monster.MonsterType.AQUA, -400);
                }});
        new FieldSpell("Forest", "All Insect, Beast, Plant, and Beast-Warrior monsters on the field gain 200 ATK/DEF.",
                new HashMap<>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }},
                new HashMap<>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }});
        new FieldSpell("Yami", "All Fiend and Spellcaster monsters on the field gain 200 ATK/DEF, also " +
                "all Fairy monsters on the field lose 200 ATK/DEF.",
                new HashMap<>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }},
                new HashMap<>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }});
    }

    public static void makeAllSpells() {
        new AdvancedRitualArt();
        new ChangeOfHeart();
        new DarkHole();
        new HarpiesFeatherDuster();
        new MessengerOfPeace();
        new MonsterReborn();
        new MysticalSpaceTyphoon();
        new PotOfGreed();
        new Raigeki();
        new RingOfDefense();
        new SpellAbsorption();
        new SupplySquad();
        new SwordsOfRevealingLight();
        new Terraforming();
        new TwinTwisters();
        new BlackPendant();
        new MagnumShield();
        new SwordOfDarkDestruction();
        new UnitedWeStand();
        new ClosedForest();
        new FieldSpell("Umiiruka", "Increase the ATK of all WATER monsters by 500 points and decrease " +
                "their DEF by 400 points.", new HashMap<Monster.MonsterType, Integer>() {{
            put(Monster.MonsterType.AQUA, 500);
        }},
                new HashMap<>() {{
                    put(Monster.MonsterType.AQUA, -400);
                }});
        new FieldSpell("Forest", "All Insect, Beast, Plant, and Beast-Warrior monsters on the field gain 200 ATK/DEF.",
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }},
                new HashMap<>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }});
        new FieldSpell("Yami", "All Fiend and Spellcaster monsters on the field gain 200 ATK/DEF, also " +
                "all Fairy monsters on the field lose 200 ATK/DEF.",
                new HashMap<>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }},
                new HashMap<>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }});
    }

Replace Generic With Diamond FieldSpell with FieldSpell in method public makeAllSpells() : void from class controller.UpdateStatus


    public static void makeAllSpells() {
        new AdvancedRitualArt();
        new ChangeOfHeart();
        new DarkHole();
        new HarpiesFeatherDuster();
        new MessengerOfPeace();
        new MonsterReborn();
        new MysticalSpaceTyphoon();
        new PotOfGreed();
        new Raigeki();
        new RingOfDefense();
        new SpellAbsorption();
        new SupplySquad();
        new SwordsOfRevealingLight();
        new Terraforming();
        new TwinTwisters();
        new BlackPendant();
        new MagnumShield();
        new SwordOfDarkDestruction();
        new UnitedWeStand();
        new ClosedForest();
        new FieldSpell("Umiiruka", "Increase the ATK of all WATER monsters by 500 points and decrease " +
                "their DEF by 400 points.", new HashMap<Monster.MonsterType, Integer>() {{
            put(Monster.MonsterType.AQUA, 500);
        }},
                new HashMap<>() {{
                    put(Monster.MonsterType.AQUA, -400);
                }});
        new FieldSpell("Forest", "All Insect, Beast, Plant, and Beast-Warrior monsters on the field gain 200 ATK/DEF.",
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }},
                new HashMap<>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }});
        new FieldSpell("Yami", "All Fiend and Spellcaster monsters on the field gain 200 ATK/DEF, also " +
                "all Fairy monsters on the field lose 200 ATK/DEF.",
                new HashMap<>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }},
                new HashMap<>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }});
    }

    public static void makeAllSpells() {
        new AdvancedRitualArt();
        new ChangeOfHeart();
        new DarkHole();
        new HarpiesFeatherDuster();
        new MessengerOfPeace();
        new MonsterReborn();
        new MysticalSpaceTyphoon();
        new PotOfGreed();
        new Raigeki();
        new RingOfDefense();
        new SpellAbsorption();
        new SupplySquad();
        new SwordsOfRevealingLight();
        new Terraforming();
        new TwinTwisters();
        new BlackPendant();
        new MagnumShield();
        new SwordOfDarkDestruction();
        new UnitedWeStand();
        new ClosedForest();
        new FieldSpell("Umiiruka", "Increase the ATK of all WATER monsters by 500 points and decrease " +
                "their DEF by 400 points.", new HashMap<Monster.MonsterType, Integer>() {{
            put(Monster.MonsterType.AQUA, 500);
        }},
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.AQUA, -400);
                }});
        new FieldSpell("Forest", "All Insect, Beast, Plant, and Beast-Warrior monsters on the field gain 200 ATK/DEF.",
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }},
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.BEAST, 200);
                    put(Monster.MonsterType.BEAST_WARRIOR, 200);
                    put(Monster.MonsterType.INSECT, 200);
                }});
        new FieldSpell("Yami", "All Fiend and Spellcaster monsters on the field gain 200 ATK/DEF, also " +
                "all Fairy monsters on the field lose 200 ATK/DEF.",
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }},
                new HashMap<Monster.MonsterType, Integer>() {{
                    put(Monster.MonsterType.FIEND, 200);
                    put(Monster.MonsterType.SPELL_CASTER, 200);
                    put(Monster.MonsterType.FAIRY, -200);
                }});
    }


    public static String signUp(String username, String password, String nickname) {
        if (User.getUserByUsername(username) != null)
            return "user with username " + username + " already exists";
        if (User.getUserByNickname(nickname) != null)
            return "user with nickname " + nickname + " already exists";
        if (!User.getPasswordWeakness(password).equals("strong")) return User.getPasswordWeakness(password);
        new User(username, password, nickname, 100000, 0, new ArrayList<>(), new ArrayList<>(), null);
        return "user created successfully!";
    }

    public static String signUp(String username, String password, String nickname) {
        if (User.getUserByUsername(username) != null)
            return "user with username " + username + " already exists";
        if (User.getUserByNickname(nickname) != null)
            return "user with nickname " + nickname + " already exists";
        if (!User.getPasswordWeakness(password).equals("strong")) return User.getPasswordWeakness(password);
        new User(username, password, nickname, 100000, 0, new ArrayList<String>(), new ArrayList<String>(), null);
        return "user created successfully!";
    }

Replace Generic With Diamond User with User in method public signUp(username String, password String, nickname String) : String from class controller.Login


Replace Anonymous With Lambda Engine.Main.main.start.new Thread.new Runnable with () -> {while(!glfwWindowShouldClose(window)){for(int x=(int)(camPos.x - WORLD_SIZE); x < camPos.x; x++){for(int z=(int)(camPos.z); z < (camPos.z + WORLD_SIZE); z++){if(!usedPos.contains(new Vec3(x,0,z))){entityList.add(new Entity(textureModel,new Vec3(x,0,z),0,0,0,1f)); in method public main(args String[]) : void from class Engine.Main


    public ClientGUI(InetSocketAddress serverAddress, int clientPort, String APP_NAME) {
        super(APP_NAME);
        this.serverAddress = serverAddress;
        this.clientPort = clientPort;
        this.wbName = DEFAULT_WB_NAME;
        this.userName = DEFAULT_USER_NAME;
        setState(ClientState.NONE);
        setTitle(wbName);
        activeUsers = new ArrayList<>();
        guiConstructors();
        setMngButtonListeners();

    }

    public ClientGUI(InetSocketAddress serverAddress, int clientPort, String APP_NAME) {
        super(APP_NAME);
        this.serverAddress = serverAddress;
        this.clientPort = clientPort;
        this.wbName = DEFAULT_WB_NAME;
        this.userName = DEFAULT_USER_NAME;
        setState(ClientState.NONE);
        setTitle(wbName);
        activeUsers = new ArrayList<String>();
        guiConstructors();
        setMngButtonListeners();

    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public ClientGUI(serverAddress InetSocketAddress, clientPort int, APP_NAME String) from class client.ClientGUI


                @Override
                public void run() {
                  SwingUtilities.invokeLater(() -> {selectRange(currentPage, referenceInfo);});
                }

                @Override
                public void run() {
                  SwingUtilities.invokeLater(new Runnable() {

                    @Override
                    public void run() {
                      selectRange(currentPage, referenceInfo);
                    }
                  });
                }

Replace Anonymous With Lambda com.oxygenxml.ditareferences.tree.references.incoming.IncomingReferencesPanel.openFileAndSelectReference.schedule.new TimerTask.run.invokeLater.new Runnable with () -> {selectRange(currentPage,referenceInfo); in method public run() : void from class com.oxygenxml.ditareferences.tree.references.incoming.IncomingReferencesPanel.openFileAndSelectReference.schedule.new TimerTask


      @Override
      public void run() {
        try {
          SwingUtilities.invokeAndWait(() -> {

            if (inProgress) {
              loadingLabel.setText(translator.getTranslation(Tags.LOADING));
              // Display pending panel.
              cards.show(IncomingReferencesPanel.this, LOADING_ID);
            } else {
              // Display the result
              cards.show(IncomingReferencesPanel.this, ReferenceType.INCOMING.toString());
            }

          });
        } catch(Exception e) {
          logger.error(e, e);
        }
      }};

      @Override
      public void run() {
        try {
          SwingUtilities.invokeAndWait(new Runnable() {

            @Override
            public void run() {

              if (inProgress) {
                loadingLabel.setText(translator.getTranslation(Tags.LOADING));
                // Display pending panel.
                cards.show(IncomingReferencesPanel.this, LOADING_ID);
              } else {
                // Display the result
                cards.show(IncomingReferencesPanel.this, ReferenceType.INCOMING.toString());
              }

            }
          });
        } catch(Exception e) {
          logger.error(e, e);
        }
      }};

Replace Anonymous With Lambda com.oxygenxml.ditareferences.tree.references.incoming.IncomingReferencesPanel.updateInProgressStatus.new TimerTask.run.invokeAndWait.new Runnable with () -> {if(inProgress){loadingLabel.setText(translator.getTranslation(Tags.LOADING)); in method public run() : void from class com.oxygenxml.ditareferences.tree.references.incoming.IncomingReferencesPanel.updateInProgressStatus.new TimerTask


	/**
	 * Construct the ReferencesTree.
	 *
	 * @param pluginWorkspaceAccess The pluginWorkspaceAccess
	 * @param keysProvider          The Map with the current DITA Map keys
	 * @param translator            The translator
	 */
	public OutgoingReferencesTree(StandalonePluginWorkspace pluginWorkspaceAccess, KeysProvider keysProvider,
			Translator translator) {

		this.setRootVisible(false);
		this.setShowsRootHandles(true);
		this.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
		this.pluginWorkspaceAccess = pluginWorkspaceAccess;

		// set transferHandler to copy text of references node
		this.setTransferHandler(new RefNodeTransferHandler());

		// set cellRenderer for ReferencesTree
		this.setCellRenderer(new ReferencesTreeCellRenderer(pluginWorkspaceAccess.getImageUtilities(), translator, keysProvider));

		// install toolTips on JTree.
		ToolTipManager.sharedInstance().registerComponent(this);

		// install selection listener
		this.refTreeSelectionListener = new ReferencesTreeSelectionListener(this);
		this.getSelectionModel().addTreeSelectionListener(this.refTreeSelectionListener);

		// install caret listener for textPage and check if current page corresponds
		this.textPageCaretListener = new TextPageReferencesTreeCaretListener(
				() -> {
					if(editorAccess != null) {
						if (editorAccess.getCurrentPage() instanceof WSXMLTextEditorPage) {
							return (WSXMLTextEditorPage) editorAccess.getCurrentPage();
						}
					}

					return null;
				},
				this,
				this.refTreeSelectionListener);

		// install caret listener for authorPage and check if current page corresponds
		this.authorPageCaretListener = new AuthorPageReferencesTreeCaretListener(
				() -> {
					if(editorAccess != null) {
						if (editorAccess.getCurrentPage() instanceof WSAuthorEditorPage) {
							return (WSAuthorEditorPage) editorAccess.getCurrentPage();
						}
					}

					return null;
				},
				this,
				this.refTreeSelectionListener);

		// popUp Menu for Leaf Nodes
		this.refMouseAdapter = new ReferencesMouseAdapter(this, this.pluginWorkspaceAccess, keysProvider, translator);
		this.addMouseListener(this.refMouseAdapter);

		// Key Adapter for Leaf Nodes when Enter Key is pressed
		this.enterKeyAdapter = new ReferencesKeyAdapter(this, this.pluginWorkspaceAccess, keysProvider, translator);
		this.addKeyListener(this.enterKeyAdapter);

		// add Hierarchy Listener when side-view is not hidden
		this.addHierarchyListener(e -> {
    	if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
    		boolean oldShowing = OutgoingReferencesTree.this.isShowing;
    		OutgoingReferencesTree.this.isShowing = isShowing();
    		if (isShowing && !oldShowing) {
    			refreshReferenceTreeInternal(editorAccess);
    		} else if (!isShowing) {
    			refreshReferenceTreeInternal(null);
    		}
    	}
    });
	}

	/**
	 * Construct the ReferencesTree.
	 *
	 * @param pluginWorkspaceAccess The pluginWorkspaceAccess
	 * @param keysProvider          The Map with the current DITA Map keys
	 * @param translator            The translator
	 */
	public OutgoingReferencesTree(StandalonePluginWorkspace pluginWorkspaceAccess, KeysProvider keysProvider,
			Translator translator) {

		this.setRootVisible(false);
		this.setShowsRootHandles(true);
		this.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
		this.pluginWorkspaceAccess = pluginWorkspaceAccess;

		// set transferHandler to copy text of references node
		this.setTransferHandler(new RefNodeTransferHandler());

		// set cellRenderer for ReferencesTree
		this.setCellRenderer(new ReferencesTreeCellRenderer(pluginWorkspaceAccess.getImageUtilities(), translator, keysProvider));

		// install toolTips on JTree.
		ToolTipManager.sharedInstance().registerComponent(this);

		// install selection listener
		this.refTreeSelectionListener = new ReferencesTreeSelectionListener(this);
		this.getSelectionModel().addTreeSelectionListener(this.refTreeSelectionListener);

		// install caret listener for textPage and check if current page corresponds
		this.textPageCaretListener = new TextPageReferencesTreeCaretListener(
				() -> {
					if(editorAccess != null) {
						if (editorAccess.getCurrentPage() instanceof WSXMLTextEditorPage) {
							return (WSXMLTextEditorPage) editorAccess.getCurrentPage();
						}
					}

					return null;
				},
				this,
				this.refTreeSelectionListener);

		// install caret listener for authorPage and check if current page corresponds
		this.authorPageCaretListener = new AuthorPageReferencesTreeCaretListener(
				() -> {
					if(editorAccess != null) {
						if (editorAccess.getCurrentPage() instanceof WSAuthorEditorPage) {
							return (WSAuthorEditorPage) editorAccess.getCurrentPage();
						}
					}

					return null;
				},
				this,
				this.refTreeSelectionListener);

		// popUp Menu for Leaf Nodes
		this.refMouseAdapter = new ReferencesMouseAdapter(this, this.pluginWorkspaceAccess, keysProvider, translator);
		this.addMouseListener(this.refMouseAdapter);

		// Key Adapter for Leaf Nodes when Enter Key is pressed
		this.enterKeyAdapter = new ReferencesKeyAdapter(this, this.pluginWorkspaceAccess, keysProvider, translator);
		this.addKeyListener(this.enterKeyAdapter);

		// add Hierarchy Listener when side-view is not hidden
		this.addHierarchyListener(new HierarchyListener() {

			@Override
			public void hierarchyChanged(HierarchyEvent e) {
				if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
					boolean oldShowing = OutgoingReferencesTree.this.isShowing;
					OutgoingReferencesTree.this.isShowing = isShowing();
					if (isShowing && !oldShowing) {
						refreshReferenceTreeInternal(editorAccess);
					} else if (!isShowing) {
						refreshReferenceTreeInternal(null);
					}
				}
			}
		});
	}

Replace Anonymous With Lambda com.oxygenxml.ditareferences.tree.references.outgoing.OutgoingReferencesTree.OutgoingReferencesTree.addHierarchyListener.new HierarchyListener with e -> {if((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0){boolean oldShowing=OutgoingReferencesTree.this.isShowing; in method public OutgoingReferencesTree(pluginWorkspaceAccess StandalonePluginWorkspace, keysProvider KeysProvider, translator Translator) from class com.oxygenxml.ditareferences.tree.references.outgoing.OutgoingReferencesTree


	@Override
	protected List<NodeRange> collect(WSEditorPage page) throws XPathException {
		WSXMLTextEditorPage textPage = (WSXMLTextEditorPage) page;
		List<NodeRange> ranges = new ArrayList<>();

		Object[] referenceNodes = textPage.evaluateXPath(ALL_REFS_XPATH_EXPRESSION);
		WSXMLTextNodeRange[] referenceTextNodeRanges = textPage
				.findElementsByXPath(ALL_REFS_XPATH_EXPRESSION);

		// get all pairs (Element, its corresponding NodeRange)
		if (referenceNodes != null) {
			for (int i = 0; i < referenceNodes.length; i++) {
				Element currentElement = (Element) referenceNodes[i];
				NodeRange refRange = new TextPageNodeRange(currentElement, referenceTextNodeRanges[i]);
				ranges.add(refRange);
			}
		}

		return ranges;
	}

	@Override
	protected List<NodeRange> collect(WSEditorPage page) throws XPathException {
		WSXMLTextEditorPage textPage = (WSXMLTextEditorPage) page;
		List<NodeRange> ranges = new ArrayList<NodeRange>();

		Object[] referenceNodes = textPage.evaluateXPath(ALL_REFS_XPATH_EXPRESSION);
		WSXMLTextNodeRange[] referenceTextNodeRanges = textPage
				.findElementsByXPath(ALL_REFS_XPATH_EXPRESSION);

		// get all pairs (Element, its corresponding NodeRange)
		if (referenceNodes != null) {
			for (int i = 0; i < referenceNodes.length; i++) {
				Element currentElement = (Element) referenceNodes[i];
				NodeRange refRange = new TextPageNodeRange(currentElement, referenceTextNodeRanges[i]);
				ranges.add(refRange);
			}
		}

		return ranges;
	}

Replace Generic With Diamond ArrayList<NodeRange> with ArrayList<> in method protected collect(page WSEditorPage) : List<NodeRange> from class com.oxygenxml.ditareferences.workspace.textpage.TextReferencesCollector


	 /**
	   * Get the list of related links from all the relationship tables defined in the DITA Maps.
	   * @param originatorURL The topic for which we are searching for outgoing links.
	   *
	   * @return The list of related links from all the relationship tables defined in the DITA Maps.
	   *
	   * @since 22
	   */
	public static List<RelLink> getRelatedLinksFromReltable(URL originatorURL){
		List<RelLink> links = new ArrayList<>();
		try {
			links.add(new RelLinkImpl(
					new File("test/source1.dita").toURI().toURL(),
					new File("test/target1.dita").toURI().toURL(), null, null, new File("test/defLocation1.dita").toURI().toURL()));

			links.add(new RelLinkImpl(
					new File("test/source2.dita").toURI().toURL(),
					new File("test/target2.dita").toURI().toURL(), null, null, new File("test/defLocation2.dita").toURI().toURL()));

			links.add(new RelLinkImpl(
					new File("test/source1.dita").toURI().toURL(),
					new URL("http://www.google.com"), "html", "external", new File("test/defLocation3.dita").toURI().toURL()));
		} catch (MalformedURLException e) {

		}
		return links;
	}

	 /**
	   * Get the list of related links from all the relationship tables defined in the DITA Maps.
	   * @param originatorURL The topic for which we are searching for outgoing links.
	   *
	   * @return The list of related links from all the relationship tables defined in the DITA Maps.
	   *
	   * @since 22
	   */
	public static List<RelLink> getRelatedLinksFromReltable(URL originatorURL){
		List<RelLink> links = new ArrayList<RelLink>();
		try {
			links.add(new RelLinkImpl(
					new File("test/source1.dita").toURI().toURL(),
					new File("test/target1.dita").toURI().toURL(), null, null, new File("test/defLocation1.dita").toURI().toURL()));

			links.add(new RelLinkImpl(
					new File("test/source2.dita").toURI().toURL(),
					new File("test/target2.dita").toURI().toURL(), null, null, new File("test/defLocation2.dita").toURI().toURL()));

			links.add(new RelLinkImpl(
					new File("test/source1.dita").toURI().toURL(),
					new URL("http://www.google.com"), "html", "external", new File("test/defLocation3.dita").toURI().toURL()));
		} catch (MalformedURLException e) {

		}
		return links;
	}

Replace Generic With Diamond ArrayList<RelLink> with ArrayList<> in method public getRelatedLinksFromReltable(originatorURL URL) : List<RelLink> from class ro.sync.ecss.dita.DITAAccessForTests


	@Override
	protected List<NodeRange> collect(WSEditorPage page) throws XPathException {
		WSAuthorEditorPage authorEditorPage = (WSAuthorEditorPage) page;
		List<NodeRange> ranges = new ArrayList<>();

		try {
			AuthorNode[] referenceAuthorNodeRanges = authorEditorPage.getDocumentController()
					.findNodesByXPath(ALL_REFS_XPATH_EXPRESSION, false, false, false);

			// add all Author NodeRanges found by XPath evaluation
			for (int i = 0; i < referenceAuthorNodeRanges.length; i++) {
				NodeRange refRange = new AuthorPageNodeRange((AuthorElement) referenceAuthorNodeRanges[i]);
				ranges.add(refRange);
			}
		} catch (AuthorOperationException e) {
			throw new XPathException(e.getMessage(), e);
		}

		return ranges;
	}

	@Override
	protected List<NodeRange> collect(WSEditorPage page) throws XPathException {
		WSAuthorEditorPage authorEditorPage = (WSAuthorEditorPage) page;
		List<NodeRange> ranges = new ArrayList<NodeRange>();

		try {
			AuthorNode[] referenceAuthorNodeRanges = authorEditorPage.getDocumentController()
					.findNodesByXPath(ALL_REFS_XPATH_EXPRESSION, false, false, false);

			// add all Author NodeRanges found by XPath evaluation
			for (int i = 0; i < referenceAuthorNodeRanges.length; i++) {
				NodeRange refRange = new AuthorPageNodeRange((AuthorElement) referenceAuthorNodeRanges[i]);
				ranges.add(refRange);
			}
		} catch (AuthorOperationException e) {
			throw new XPathException(e.getMessage(), e);
		}

		return ranges;
	}

Replace Generic With Diamond ArrayList<NodeRange> with ArrayList<> in method protected collect(page WSEditorPage) : List<NodeRange> from class com.oxygenxml.ditareferences.workspace.authorpage.AuthorReferencesCollector


	/**
	 * Let the application start.
	 */
	@Override
	public void applicationStarted(final StandalonePluginWorkspace pluginWorkspaceAccess) {
		this.pluginWorkspaceAccess = pluginWorkspaceAccess;
		this.refTree = new ReferencesTree(pluginWorkspaceAccess, keysProvider, translator);

		pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {

			@Override
			public boolean editorAboutToBeOpenedVeto(URL editorLocation) {
				return true;
			}

			/**
			 * Update the referencesTree when a DITA editor is opened.
			 */
			@Override
			public void editorOpened(URL editorLocation) {
				updateTreeTimer.setRepeats(false);
				WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation,
						PluginWorkspace.MAIN_EDITING_AREA);
				if (editorAccess != null) {
					if (EditorPageConstants.PAGE_TEXT.equals(editorAccess.getCurrentPageID())) {
						// update listener for TextPage when editor opened in Text Mode
						updateTreeTimer.restart();
						WSTextEditorPage textPage = (WSTextEditorPage) editorAccess.getCurrentPage();
						textPage.getDocument().addDocumentListener(textPageDocumentListener);

					} else if (EditorPageConstants.PAGE_AUTHOR.equals(editorAccess.getCurrentPageID())) {
						// update listener for AuthorPage when editor opened in Author Mode
						updateTreeTimer.restart();
						WSAuthorEditorPage authorPage = (WSAuthorEditorPage) editorAccess.getCurrentPage();
						authorPage.getDocumentController().addAuthorListener(authorPageListener);

					} else {
						updateTreeTimer.restart();
					}
				}
			}

			@Override
			public void editorClosed(URL editorLocation) {
				// An edited XML document has been closed.
			}

			@Override
			public boolean editorAboutToBeClosed(URL editorLocation) {
				return true;
			}

			@Override
			public void editorRelocated(URL previousEditorLocation, URL newEditorLocation) {
				// The editor was relocated (Save as was called).
			}

			/**
			 * Update the RefrencesTree when page changes with coalescing.
			 */
			@Override
			public void editorPageChanged(URL editorLocation) {
				updateTreeTimer.setRepeats(false);
				WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation,
						PluginWorkspace.MAIN_EDITING_AREA);
				if (editorAccess != null) {
					if (EditorPageConstants.PAGE_TEXT.equals(editorAccess.getCurrentPageID())) {
						updateTreeTimer.restart();
						WSTextEditorPage textPage = (WSTextEditorPage) editorAccess.getCurrentPage();

						// update the textPage Listener
						textPage.getDocument().removeDocumentListener(textPageDocumentListener);
						textPage.getDocument().addDocumentListener(textPageDocumentListener);

					} else if (EditorPageConstants.PAGE_AUTHOR.equals(editorAccess.getCurrentPageID())) {
						updateTreeTimer.restart();
						WSAuthorEditorPage authorPage = (WSAuthorEditorPage) editorAccess.getCurrentPage();

						// update the authorPage Listener
						authorPage.getDocumentController().removeAuthorListener(authorPageListener);
						authorPage.getDocumentController().addAuthorListener(authorPageListener);

					} else {
						updateTreeTimer.restart();
					}
				}
			}

			@Override
			public void editorSelected(URL editorLocation) {
				bindTreeWithEditor(editorLocation);
			}

			@Override
			public void editorActivated(URL editorLocation) {
				bindTreeWithEditor(editorLocation);
			}

		}, StandalonePluginWorkspace.MAIN_EDITING_AREA);

		/**
		 * Add Icon, Title and ScrollPane for side-view. ScrollPane should let the whole
		 * part of node text to be painted in the Layout without adding extra "...".
		 */
		pluginWorkspaceAccess.addViewComponentCustomizer(viewInfo -> {
			if ("DITAReferencesWorkspaceAccessID".equals(viewInfo.getViewID())) {

				JScrollPane scrollPane = new JScrollPane(refTree);
				scrollPane.addComponentListener(new ComponentAdapter() {
					@Override
					public void componentResized(ComponentEvent e) {
						SwingUtilities.invokeLater(() -> {
							// remember the selected path
							TreePath selectionPath = refTree.getSelectionPath();
							((DefaultTreeModel) refTree.getModel())
									.nodeStructureChanged((TreeNode) refTree.getModel().getRoot());

							// expand all rows with same selected path after side-view scrolled
							refTree.expandAllRows();
							refTree.setSelectionPath(selectionPath);
						});

					}
				});
				// set side-view ScrollPane
				viewInfo.setComponent(scrollPane);

				// set side-view Title
				viewInfo.setTitle(translator.getTranslation(Tags.DITA_REFERENCES));

				// set side-view Icon
				ImageIcon ditaReferencesIcon = new ImageIcon(
						getClass().getClassLoader().getResource("images/RefreshReferences16_dark.png"));

				viewInfo.setIcon(ditaReferencesIcon);
			}
		});
	}

	/**
	 * Let the application start.
	 */
	@Override
	public void applicationStarted(final StandalonePluginWorkspace pluginWorkspaceAccess) {
		this.pluginWorkspaceAccess = pluginWorkspaceAccess;
		this.refTree = new ReferencesTree(pluginWorkspaceAccess, keysProvider, translator);

		pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {

			@Override
			public boolean editorAboutToBeOpenedVeto(URL editorLocation) {
				return true;
			}

			/**
			 * Update the referencesTree when a DITA editor is opened.
			 */
			@Override
			public void editorOpened(URL editorLocation) {
				updateTreeTimer.setRepeats(false);
				WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation,
						PluginWorkspace.MAIN_EDITING_AREA);
				if (editorAccess != null) {
					if (EditorPageConstants.PAGE_TEXT.equals(editorAccess.getCurrentPageID())) {
						// update listener for TextPage when editor opened in Text Mode
						updateTreeTimer.restart();
						WSTextEditorPage textPage = (WSTextEditorPage) editorAccess.getCurrentPage();
						textPage.getDocument().addDocumentListener(textPageDocumentListener);

					} else if (EditorPageConstants.PAGE_AUTHOR.equals(editorAccess.getCurrentPageID())) {
						// update listener for AuthorPage when editor opened in Author Mode
						updateTreeTimer.restart();
						WSAuthorEditorPage authorPage = (WSAuthorEditorPage) editorAccess.getCurrentPage();
						authorPage.getDocumentController().addAuthorListener(authorPageListener);

					} else {
						updateTreeTimer.restart();
					}
				}
			}

			@Override
			public void editorClosed(URL editorLocation) {
			}

			@Override
			public boolean editorAboutToBeClosed(URL editorLocation) {
				return true;
			}

			@Override
			public void editorRelocated(URL previousEditorLocation, URL newEditorLocation) {
			}

			/**
			 * Update the RefrencesTree when page changes with coalescing.
			 */
			@Override
			public void editorPageChanged(URL editorLocation) {
				updateTreeTimer.setRepeats(false);
				WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation,
						PluginWorkspace.MAIN_EDITING_AREA);
				if (editorAccess != null) {
					if (EditorPageConstants.PAGE_TEXT.equals(editorAccess.getCurrentPageID())) {
						updateTreeTimer.restart();
						WSTextEditorPage textPage = (WSTextEditorPage) editorAccess.getCurrentPage();

						// update the textPage Listener
						textPage.getDocument().removeDocumentListener(textPageDocumentListener);
						textPage.getDocument().addDocumentListener(textPageDocumentListener);

					} else if (EditorPageConstants.PAGE_AUTHOR.equals(editorAccess.getCurrentPageID())) {
						updateTreeTimer.restart();
						WSAuthorEditorPage authorPage = (WSAuthorEditorPage) editorAccess.getCurrentPage();

						// update the authorPage Listener
						authorPage.getDocumentController().removeAuthorListener(authorPageListener);
						authorPage.getDocumentController().addAuthorListener(authorPageListener);

					} else {
						updateTreeTimer.restart();
					}
				}
			}

			@Override
			public void editorSelected(URL editorLocation) {
				bindTreeWithEditor(editorLocation);
			}

			@Override
			public void editorActivated(URL editorLocation) {
				bindTreeWithEditor(editorLocation);
			}

		}, StandalonePluginWorkspace.MAIN_EDITING_AREA);

		/**
		 * Add Icon, Title and ScrollPane for side-view. ScrollPane should let the whole
		 * part of node text to be painted in the Layout without adding extra "...".
		 */
		pluginWorkspaceAccess.addViewComponentCustomizer(new ViewComponentCustomizer() {
			@Override
			public void customizeView(ViewInfo viewInfo) {
				if ("DITAReferencesWorkspaceAccessID".equals(viewInfo.getViewID())) {

					JScrollPane scrollPane = new JScrollPane(refTree);
					scrollPane.addComponentListener(new ComponentAdapter() {
						@Override
						public void componentResized(ComponentEvent e) {
							SwingUtilities.invokeLater(() -> {
								// remember the selected path
								TreePath selectionPath = refTree.getSelectionPath();
								((DefaultTreeModel) refTree.getModel())
										.nodeStructureChanged((TreeNode) refTree.getModel().getRoot());

								// expand all rows with same selected path after side-view scrolled
								refTree.expandAllRows();
								refTree.setSelectionPath(selectionPath);
							});

						}
					});
					// set side-view ScrollPane
					viewInfo.setComponent(scrollPane);

					// set side-view Title
					viewInfo.setTitle(translator.getTranslation(Tags.DITA_REFERENCES));

					// set side-view Icon
					ImageIcon DITAReferencesIcon = new ImageIcon(
							getClass().getClassLoader().getResource("images/RefreshReferences16_dark.png"));

					viewInfo.setIcon(DITAReferencesIcon);
				}
			}
		});
	}

Replace Anonymous With Lambda com.oxygenxml.ditareferences.workspace.DITAReferencesWorkspaceAccessPluginExtension.applicationStarted.addViewComponentCustomizer.new ViewComponentCustomizer with viewInfo -> {if("DITAReferencesWorkspaceAccessID".equals(viewInfo.getViewID())){JScrollPane scrollPane=new JScrollPane(refTree); in method public applicationStarted(pluginWorkspaceAccess StandalonePluginWorkspace) : void from class com.oxygenxml.ditareferences.workspace.DITAReferencesWorkspaceAccessPluginExtension


/**
     * @param obj         The possibly null object containing location or reference
     *                    information that can be used in creating an object.
     * @param name        The name of this object relative to nameCtx, or
     *                    null if no name is specified.
     * @param nameCtx     The context relative to which the name parameter
     *                    is specified, or null if name is relative to the
     *                    default initial context.
     * @param environment The possibly null environment that is used in creating the
     *                    object.
     * @return The object created; null if an object cannot be created.
     * @see NamingManager#getObjectInstance
     * @see NamingManager#getURLContext
     */
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        if (!(obj instanceof Reference)) return null;
        Reference ref = (Reference) obj;
        if (!"javax.sql.DataSource".equals(ref.getClassName())) return null;

        //1:try to lookup transactionManager if configured
        TransactionManager tm = null;
        String tmJndiName = getConfigValue(ref, CONFIG_TM_JNDI);
        if (isNotBlank(tmJndiName) && nameCtx != null) {
            tm = (TransactionManager) nameCtx.lookup(tmJndiName);
        }

        //2:create config instance
        BeeDataSourceConfig config = new BeeDataSourceConfig();
        //3:get all properties set methods
        Map<String, Method> setMethodMap = getClassSetMethodMap(config.getClass());
        //4:create properties to collect config value
        Map<String, Object> setValueMap = new HashMap<>(setMethodMap.size());
        //5:loop to find out properties config value by set methods
        for (String propertyName : setMethodMap.keySet()) {
            String configVal = getConfigValue(ref, propertyName);
            if (isBlank(configVal)) continue;
            setValueMap.put(propertyName, configVal);
        }
        //6:inject found config value to ds config object
        setPropertiesValue(config, setMethodMap, setValueMap);

        //7:try to find 'connectProperties' config value and put to ds config object
        config.addConnectProperty(getConfigValue(ref, CONFIG_CONNECT_PROP));
        String connectPropertiesCount = getConfigValue(ref, CONFIG_CONNECT_PROP_SIZE);
        if (isNotBlank(connectPropertiesCount)) {
            int count = Integer.parseInt(connectPropertiesCount.trim());
            for (int i = 1; i <= count; i++)
                config.addConnectProperty(getConfigValue(ref, CONFIG_CONNECT_PROP_KEY_PREFIX + i));
        }

        //8:try to load sql exception fatal code and fatal state
        String sqlExceptionCode = getConfigValue(ref, CONFIG_SQL_EXCEPTION_CODE);
        String sqlExceptionState = getConfigValue(ref, CONFIG_SQL_EXCEPTION_STATE);
        if (isNotBlank(sqlExceptionCode)) {
            for (String code : sqlExceptionCode.trim().split(",")) {
                try {
                    config.addSqlExceptionCode(Integer.parseInt(code));
                } catch (NumberFormatException e) {
                    throw new BeeDataSourceConfigException(code + " is not valid error code");
                }
            }
        }
        if (isNotBlank(sqlExceptionState)) {
            for (String state : sqlExceptionState.trim().split(",")) {
                config.addSqlExceptionState(state);
            }
        }

        //9:create dataSource by config
        BeeDataSource ds = new BeeDataSource(config);
        return (tm != null) ? new BeeJtaDataSource(ds, tm) : ds;
    }

/**
     * @param obj         The possibly null object containing location or reference
     *                    information that can be used in creating an object.
     * @param name        The name of this object relative to nameCtx, or
     *                    null if no name is specified.
     * @param nameCtx     The context relative to which the name parameter
     *                    is specified, or null if name is relative to the
     *                    default initial context.
     * @param environment The possibly null environment that is used in creating the
     *                    object.
     * @return The object created; null if an object cannot be created.
     * @see NamingManager#getObjectInstance
     * @see NamingManager#getURLContext
     */
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        if (!(obj instanceof Reference)) return null;
        Reference ref = (Reference) obj;
        if (!"javax.sql.DataSource".equals(ref.getClassName())) return null;

        //1:try to lookup transactionManager if configured
        TransactionManager tm = null;
        String tmJndiName = getConfigValue(ref, CONFIG_TM_JNDI);
        if (isNotBlank(tmJndiName) && nameCtx != null) {
            tm = (TransactionManager) nameCtx.lookup(tmJndiName);
        }

        //2:create config instance
        BeeDataSourceConfig config = new BeeDataSourceConfig();
        //3:get all properties set methods
        Map<String, Method> setMethodMap = getClassSetMethodMap(config.getClass());
        //4:create properties to collect config value
        Map<String, Object> setValueMap = new HashMap<String, Object>(setMethodMap.size());
        //5:loop to find out properties config value by set methods
        for (String propertyName : setMethodMap.keySet()) {
            String configVal = getConfigValue(ref, propertyName);
            if (isBlank(configVal)) continue;
            setValueMap.put(propertyName, configVal);
        }
        //6:inject found config value to ds config object
        setPropertiesValue(config, setMethodMap, setValueMap);

        //7:try to find 'connectProperties' config value and put to ds config object
        config.addConnectProperty(getConfigValue(ref, CONFIG_CONNECT_PROP));
        String connectPropertiesCount = getConfigValue(ref, CONFIG_CONNECT_PROP_SIZE);
        if (isNotBlank(connectPropertiesCount)) {
            int count = Integer.parseInt(connectPropertiesCount.trim());
            for (int i = 1; i <= count; i++)
                config.addConnectProperty(getConfigValue(ref, CONFIG_CONNECT_PROP_KEY_PREFIX + i));
        }

        //8:try to load sql exception fatal code and fatal state
        String sqlExceptionCode = getConfigValue(ref, CONFIG_SQL_EXCEPTION_CODE);
        String sqlExceptionState = getConfigValue(ref, CONFIG_SQL_EXCEPTION_STATE);
        if (isNotBlank(sqlExceptionCode)) {
            for (String code : sqlExceptionCode.trim().split(",")) {
                try {
                    config.addSqlExceptionCode(Integer.parseInt(code));
                } catch (NumberFormatException e) {
                    throw new BeeDataSourceConfigException(code + " is not valid error code");
                }
            }
        }
        if (isNotBlank(sqlExceptionState)) {
            for (String state : sqlExceptionState.trim().split(",")) {
                config.addSqlExceptionState(state);
            }
        }

        //9:create dataSource by config
        BeeDataSource ds = new BeeDataSource(config);
        return (tm != null) ? new BeeJtaDataSource(ds, tm) : ds;
    }

Replace Generic With Diamond HashMap<String,Object> with HashMap<> in method public getObjectInstance(obj Object, name Name, nameCtx Context, environment Hashtable<?,?>) : Object from class org.stone.beecp.BeeDataSourceFactory


    /**
     * find-out all set methods and put to map with method names,for example:
     * method:setMaxActive, map.put('MaxActive',method)
     *
     * @param beanClass set methods owner
     * @return methods map
     */
    public static Map<String, Method> getClassSetMethodMap(Class beanClass) {
        Method[] methods = beanClass.getMethods();
        HashMap<String, Method> methodMap = new LinkedHashMap<>(methods.length);
        for (Method method : methods) {
            String methodName = method.getName();
            if (method.getParameterTypes().length == 1 && methodName.startsWith("set") && methodName.length() > 3)
                methodMap.put(methodName.substring(3), method);
        }
        return methodMap;
    }

    /**
     * find-out all set methods and put to map with method names,for example:
     * method:setMaxActive, map.put('MaxActive',method)
     *
     * @param beanClass set methods owner
     * @return methods map
     */
    public static Map<String, Method> getClassSetMethodMap(Class beanClass) {
        Method[] methods = beanClass.getMethods();
        HashMap<String, Method> methodMap = new LinkedHashMap<String, Method>(methods.length);
        for (Method method : methods) {
            String methodName = method.getName();
            if (method.getParameterTypes().length == 1 && methodName.startsWith("set") && methodName.length() > 3)
                methodMap.put(methodName.substring(3), method);
        }
        return methodMap;
    }

Replace Generic With Diamond LinkedHashMap<String,Method> with LinkedHashMap<> in method public getClassSetMethodMap(beanClass Class) : Map<String,Method> from class org.stone.beecp.pool.ConnectionPoolStatics


        protected WeakReference<Borrower> initialValue() {
            return new WeakReference<>(new Borrower());
        }

        protected WeakReference<Borrower> initialValue() {
            return new WeakReference<Borrower>(new Borrower());
        }

Replace Generic With Diamond WeakReference<Borrower> with WeakReference<> in method protected initialValue() : WeakReference<Borrower> from class org.stone.beecp.pool.FastConnectionPool.BorrowerThreadLocal


    void setOpenResultSet(ProxyResultSetBase r) {//call by ProxyResultSetBase.constructor
        switch (this.resultOpenCode) {
            case Statement.CLOSE_CURRENT_RESULT: {
                if (this.curRe != null && !this.curRe.isClosed) oclose(this.curRe);
                break;
            }
            case Statement.KEEP_CURRENT_RESULT: {
                if (this.curRe != null && !this.curRe.isClosed) {
                    if (this.results == null) this.results = new ArrayList<>(1);
                    this.results.add(this.curRe);
                }
                break;
            }
            case Statement.CLOSE_ALL_RESULTS: {
                if (this.curRe != null && !this.curRe.isClosed)
                    oclose(this.curRe);
                if (this.results != null) {
                    for (ProxyResultSetBase openRe : this.results)
                        if (!openRe.isClosed) oclose(openRe);
                    this.results.clear();
                }
                break;
            }
            default:
                break;
        }
        curRe = r;
    }

    void setOpenResultSet(ProxyResultSetBase r) {//call by ProxyResultSetBase.constructor
        switch (this.resultOpenCode) {
            case Statement.CLOSE_CURRENT_RESULT: {
                if (this.curRe != null && !this.curRe.isClosed) oclose(this.curRe);
                break;
            }
            case Statement.KEEP_CURRENT_RESULT: {
                if (this.curRe != null && !this.curRe.isClosed) {
                    if (this.results == null) this.results = new ArrayList<ProxyResultSetBase>(1);
                    this.results.add(this.curRe);
                }
                break;
            }
            case Statement.CLOSE_ALL_RESULTS: {
                if (this.curRe != null && !this.curRe.isClosed)
                    oclose(this.curRe);
                if (this.results != null) {
                    for (ProxyResultSetBase openRe : this.results)
                        if (!openRe.isClosed) oclose(openRe);
                    this.results.clear();
                }
                break;
            }
            default:
                break;
        }
        curRe = r;
    }

Replace Generic With Diamond ArrayList<ProxyResultSetBase> with ArrayList<> in method package setOpenResultSet(r ProxyResultSetBase) : void from class org.stone.beecp.pool.ProxyStatementBase