Skip to content

Short desc of the bug #142

@sheng143998

Description

@sheng143998
Image Image

AutoCp Plugin Generates Illegal Java Package Names

Bug Description

The AutoCp plugin generates Java package names containing illegal characters such as Chinese characters and spaces, causing Java compilation errors.

Steps to Reproduce

  1. Use AutoCp plugin to create a new Luogu problem file
  2. Problem name is "P4310 绝世好题" (contains Chinese characters and spaces)
  3. Plugin automatically generates package name: "绝世好题"
  4. Generated Java file contains illegal package declaration: package 绝世好题;

Expected Behavior

Generated package names should comply with Java package naming conventions:

  • Should only contain letters, numbers, underscores, and dots
  • Should not contain Chinese characters, spaces, or special characters
  • Should automatically filter or replace illegal characters

Actual Behavior

// Currently generated illegal package name:
package 绝世好题;

// Causes compilation error: illegal character: '?'

<!-- Failed to upload "屏幕截图 2025-09-28 213029.png" -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions