Method, system and equipment for automatically detecting jar package reference correctness and storage medium
By automatically detecting the correctness of jar package references, the problems of class loss and undefined methods caused by incomplete version management of IBE jar packages are solved, and efficient jar package upgrades and software stability guarantees are achieved.
Patent Information
- Application Number
- CN202411855774.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, the IBE jar package version management is not perfect, which leads to the software development system being easily encountered problems such as class loss and undefined methods during the upgrade process, affecting the stability and reliability of the software.
By obtaining all classes, methods and attributes in the archive file of the Java core runtime library, and assembling them with the jar file to be verified and the classes, methods and attributes and the classes, methods and attributes to be verified, it automatically detects whether all classes, methods and attributes to be verified in the jar file to be in the full set, and automatically detects the correctness of jar package references.
It realizes automatic detection of the correctness of jar package references, avoids the complexity and high professional requirements of manual inspection, greatly improves the efficiency of IBE client upgrade, and ensures the stability and reliability of the software.
Smart Images

Figure CN119847902A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of software development, and in particular to a method, system, device and storage medium for automatically detecting the correctness of jar package references. Background Art
[0002] During the development of the software development system, the realization of the air ticket business functions is widely dependent on the call of the IBE service. The IBE service provides its functions by publishing the SDK package. The SDK package is a client developed in Java language and compiled into a jar file. However, the jar version management of IBE is not perfect and relies on manual merging of class files for upgrading. Every time the software development system receives the merged IBE jar package, it needs to define the internal version number and detect the correctness of the jar. This leads to many problems such as class loss and undefined methods caused by jar version changes in actual development, which seriously affects the overall stability and reliability of the software.
[0003] Currently, after receiving a new IBE jar package, the software development system uses a file comparison tool to manually compare the old and new versions of the jar package files. For files with differences, they need to be decompiled to compare the business logic and confirm whether there are problems such as missing classes and undefined methods. This method is not only inefficient, but also requires extremely high professional capabilities from the reviewers, who need to carefully review every change and make professional judgments. Therefore, developing an automated jar package detection mechanism that can automatically verify the correctness of class and method references is of great significance for improving the efficiency of software development and ensuring the stability and reliability of software. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, system, device and storage medium for automatically detecting the correctness of jar package references, so as to solve or alleviate one or more of the above technical problems in the prior art.
[0005] According to one aspect of the present disclosure, a method for automatically detecting the correctness of a jar package reference is provided, comprising:
[0006] Get all classes, methods and properties under the archive file of the Java core runtime library;
[0007] Get the jar file to be verified and all classes, methods and properties called by the jar file to be verified;
[0008] Assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set;
[0009] Determine whether all classes, methods and properties called by the jar file to be verified are in the complete set, and automatically detect the correctness of the jar package reference based on the judgment result.
[0010] In one possible implementation, obtaining all classes, methods, and properties under the archive file of the Java core runtime library includes:
[0011] Get the full path to the archive file for the current Java core runtime library.
[0012] In a possible implementation, obtaining the full path of the archive file of the current Java core runtime library includes:
[0013] Get the JDK installation path and file separator of the current operating system by reading the current operating system variables;
[0014] Based on the JDK installation path and file separator, concatenate the full path of the archive file of the Java core runtime library.
[0015] In one possible implementation, obtaining all classes, methods, and properties in an archive file of a Java core runtime library includes:
[0016] Calling a Java file processing class, traversing the archive file of the Java core runtime library, and parsing out all class files in the archive file of the Java core runtime library;
[0017] Based on the complete path of the archive file of the Java core runtime library, each class file in the archive file of the Java core runtime library is parsed through the ASM framework to obtain all classes, methods and attributes defined in the archive file of the Java core runtime library;
[0018] All classes, methods and properties defined in the archive file of the Java core runtime library are saved into a Java collection object.
[0019] In a possible implementation, obtaining the jar file to be verified and all classes, methods, and properties called by the jar file to be verified includes:
[0020] Pass in the path of the jar file to be verified through parameters;
[0021] Call the Java file processing class, traverse the jar file to be verified, and parse out all class files in the jar file to be verified;
[0022] Based on the path of the jar file to be verified, parse each class file in the jar package to be verified through the ASM framework to obtain the jar package to be verified itself and all classes, methods and properties called by the jar file to be verified;
[0023] The jar package to be verified and all classes, methods and properties called by the jar file to be verified are saved in a Java collection object.
[0024] In one possible implementation, the archive file of the Java core runtime library, the jar file to be verified, and all classes, methods, and properties called by the jar file to be verified are assembled into a complete set including:
[0025] Assemble the archive file of the Java core runtime library, the jar file to be verified, and all classes called by the jar file to be verified into a complete set of classes;
[0026] Assemble all the methods under the archive file of the Java core runtime library, the jar file to be verified, and the methods called by the jar file to be verified into a complete set of methods;
[0027] Assemble all attributes under the archive file of the Java core runtime library, the jar file to be verified, and all attributes called by the jar file to be verified into a complete set of attributes.
[0028] In a possible implementation, determining whether all classes, methods, and attributes called by the jar file to be verified are in the full set, and automatically detecting the correctness of the jar package reference based on the determination result includes:
[0029] Determine whether all classes called by the jar file to be verified are in the full set of classes, and output classes that are not included in the full set of classes;
[0030] Determine whether all methods called by the jar file to be verified are in the method set. If all methods called by the jar file to be verified are not in the method set, determine whether there are corresponding methods in the parent class and output the methods not included in the parent class.
[0031] Determine whether all the attributes called by the jar file to be verified are in the full set of attributes. If all the attributes called by the jar file to be verified are not in the full set of attributes, determine whether there are corresponding attributes in the parent class and output the attributes not included in the parent class.
[0032] Loop through the classes, methods, and property collection objects of the verification output, and print each object to the console or output it to the corresponding result file for troubleshooting.
[0033] According to one aspect of the present disclosure, a system for automatically detecting the correctness of a jar package reference is provided, comprising:
[0034] A first acquisition unit is used to acquire all classes, methods and properties in the archive file of the Java core runtime library;
[0035] The second acquisition unit is used to acquire the jar file to be verified and all classes, methods and properties called by the jar file to be verified;
[0036] An assembly unit is used to assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set;
[0037] The detection unit is used to determine whether all classes, methods and attributes called by the jar file to be verified are in the full set, and automatically detect the correctness of the jar package reference based on the judgment result.
[0038] According to one aspect of the present disclosure, there is provided a device, comprising:
[0039] Processor and memory;
[0040] The memory is used to store a computer program, and the processor calls the computer program stored in the memory to execute any of the above methods for automatically detecting the correctness of jar package references.
[0041] According to one aspect of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the processor is enabled to execute any of the above-mentioned methods for automatically detecting the correctness of jar package references.
[0042] The present disclosure has the following beneficial effects: the present disclosure can quickly find out incorrect referenced classes, methods, and properties by automatically checking jar packages, avoiding the complex process and high professional requirements of manual jar package checking, and greatly improving the IBE client upgrade efficiency.
[0043] The details of one or more embodiments of the present application are presented in the following drawings and descriptions. Other features and advantages of the present application will become apparent from the accompanying drawings. It should be understood that the above general description and the detailed descriptions below are only exemplary and explanatory and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0045] Figure 1 is a flow chart of a method for automatically detecting the correctness of jar package references of this exemplary embodiment;
[0046] Figure 2 is a schematic diagram of the main automatic detection process of this exemplary embodiment;
[0047] Figure 3 It is a schematic diagram of the method and attribute verification process of this exemplary embodiment;
[0048] Figure 4 is a block diagram of a system for automatically detecting the correctness of jar package references of the present exemplary embodiment;
[0049] Figure 5 It is a schematic structural diagram of a device of this exemplary embodiment. DETAILED DESCRIPTION
[0050] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0051] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware units or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0052] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0053] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example.
[0054] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or sub-modules is not necessarily limited to those steps or sub-modules explicitly listed, but may include other steps or sub-modules not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0055] Terminology explanation:
[0056] 1. IBE: IBE (Internet Booking Engine) is an open platform technology based on the Internet. It provides various user application systems with access to China Travel Information's traditional booking business system.
[0057] 2. Jar: Java Archive (jar) file is a packaging and deployment form of Java program, which contains compiled Java class files, resource files and related metadata information, etc. It is the basic component for running Java application.
[0058] 3. Class file: In the Java programming environment, a .class file is a binary file generated after the Java source code file (.java file) is compiled. Each .class file corresponds to a class or interface in the source code and follows the bytecode specification of the Java Virtual Machine (JVM).
[0059] 4. ASM: ASM is a Java bytecode manipulation framework that allows you to dynamically generate or modify Java classes without changing the semantics of the bytecode. It provides a flexible and efficient way to manipulate bytecodes and can be used for many purposes, including bytecode enhancement, AOP (aspect-oriented programming), decompilation, code generation, etc.
[0060] 5. rt.jar: rt.jar is a key file in the Java Runtime Environment (JRE), which contains the core classes and resource files in the Java standard library. These class libraries provide basic functions of the Java programming language, such as the collection framework, I / O operations, network communication, multi-threading support, etc. The full name of rt.jar is "RunTime core Java ARchive", which is an archive file of the Java core runtime library, usually located in the lib directory of JRE.
[0061] 6. JDK: Java Development Kit (JDK) is a set of tools provided by Oracle Corporation for developing Java applications. It includes the Java Virtual Machine (JVM), the Java Runtime Environment (JRE), and a set of development tools. JDK is designed for developers and provides tools such as the compiler (javac), debugger (jdb), document generation tool (javadoc), and a large number of libraries and documents.
[0062] The hardware and software environment required for the operation of the entire system of this disclosure is as follows:
[0063] Operating system: Linux, Windows, Mac.
[0064] Development language: java.
[0065] Operating environment: JDK8
[0066] Figure 1 is a flow chart of a method for automatically detecting the correctness of jar package references in this exemplary embodiment. Figure 1 As shown, an exemplary embodiment of the present disclosure provides a method for automatically detecting the correctness of a jar package reference, comprising:
[0067] Get all classes, methods and properties under the archive file of the Java core runtime library;
[0068] Get the jar file to be verified and all classes, methods and properties called by the jar file to be verified;
[0069] Assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set;
[0070] Determine whether all classes, methods and properties called by the jar file to be verified are in the complete set, and automatically detect the correctness of the jar package reference based on the judgment result.
[0071] This embodiment aims to solve the problems of complex manual inspection of jar packages, high professional requirements, and automatic inspection of jar packages to see whether there are missing classes or undefined methods.
[0072] Specifically, get all classes, methods, and properties under the archive file of the Java core runtime library including:
[0073] Get the full path to the archive file for the current Java core runtime library.
[0074] Specifically, obtaining the full path to the archive file of the current Java core runtime library includes:
[0075] Get the JDK installation path and file separator of the current operating system by reading the current operating system variables;
[0076] Based on the JDK installation path and file separator, concatenate the full path of the archive file of the Java core runtime library.
[0077] In order to reduce the input of parameters, this embodiment obtains the JDK installation path of the current operating system (assigns the variable jdkPath) by reading the current operating system variable java.home, and then obtains the file separator of the current operating system through the java.io.File.separator property, and finally splices the complete path of rt.jar through jdkPath+File.separator+"lib"+File.separator+"rt.jar".
[0078] Specifically, all classes, methods, and properties under the archive file of the Java core runtime library are obtained, including:
[0079] Calling a Java file processing class, traversing the archive file of the Java core runtime library, and parsing out all class files in the archive file of the Java core runtime library;
[0080] Based on the complete path of the archive file of the Java core runtime library, each class file in the archive file of the Java core runtime library is parsed through the ASM framework to obtain all classes, methods and attributes defined in the archive file of the Java core runtime library;
[0081] All classes, methods and properties defined in the archive file of the Java core runtime library are saved into a Java collection object.
[0082] This embodiment parses all files of rt.jar through the java.util.jar.jarFile class, traverses all files to find all .class files. Then, each .class file is parsed through the bytecode enhancement of the ASM framework (version 9.2), thereby obtaining all classes, methods, and attributes defined in rt.jar, and saving these classes, methods, and attributes to the Java collection object java.util.Set. Set can ensure that the saved objects are not repeated, thereby improving performance.
[0083] Specifically, obtaining the jar file to be verified and all classes, methods, and properties called by the jar file to be verified includes:
[0084] Pass in the path of the jar file to be verified through parameters;
[0085] Call the Java file processing class, traverse the jar file to be verified, and parse out all class files in the jar file to be verified;
[0086] Based on the path of the jar file to be verified, parse each class file in the jar package to be verified through the ASM framework to obtain the jar package to be verified itself and all classes, methods and properties called by the jar file to be verified;
[0087] The jar package to be verified and all classes, methods and properties called by the jar file to be verified are saved in a Java collection object.
[0088] After the path of the jar package to be verified is passed in through a parameter, the present embodiment also parses all the files of the jar package through the java.util.jar.jarFile class, and traverses all the files to find all the .class files. Then, each .class file is parsed through the ASM framework. Here, it is necessary not only to parse out the classes, methods, and attributes contained in itself, but also to parse out the called classes, methods, and attributes (it is necessary to ignore the classes, methods, and attributes under the "com.sun.", "java.", "javax.", "org.ietf.jgss.", "org.omg.", "org.w3c.dom.", "org.xml.sax.", "sun." package paths, because the references under these package paths are all methods that come with the operating environment JDK and do not need to be verified), and then these classes, methods, and attributes are also saved in the Java collection object java.util.Set.
[0089] Specifically, the archive file of the Java core runtime library, the jar file to be verified, and all classes, methods, and properties called by the jar file to be verified are assembled into a complete set including:
[0090] Assemble the archive file of the Java core runtime library, the jar file to be verified, and all classes called by the jar file to be verified into a complete set of classes;
[0091] Assemble all the methods under the archive file of the Java core runtime library, the jar file to be verified, and the methods called by the jar file to be verified into a complete set of methods;
[0092] Assemble all attributes under the archive file of the Java core runtime library, the jar file to be verified, and all attributes called by the jar file to be verified into a complete set of attributes.
[0093] Specifically, judging whether all classes, methods and attributes called by the jar file to be verified are in the full set, and automatically detecting the correctness of the jar package reference based on the judgment result includes:
[0094] Determine whether all classes called by the jar file to be verified are in the full set of classes, and output classes that are not included in the full set of classes;
[0095] Determine whether all methods called by the jar file to be verified are in the method set. If all methods called by the jar file to be verified are not in the method set, determine whether there are corresponding methods in the parent class and output the methods not included in the parent class.
[0096] Determine whether all the attributes called by the jar file to be verified are in the full set of attributes. If all the attributes called by the jar file to be verified are not in the full set of attributes, determine whether there are corresponding attributes in the parent class and output the attributes not included in the parent class.
[0097] Loop through the classes, methods, and property collection objects of the verification output, and print each object to the console or output it to the corresponding result file for troubleshooting.
[0098] In this embodiment, it is determined whether all classes, methods, and properties called by the jar file to be verified are in the generated full set. Here, the calling class verification only needs to determine whether it is in the full set. If it exists, the verification passes. If it does not exist, it is directly retained in the final set of failed classes to be output. However, for methods and properties, it is necessary to determine whether the parent class has corresponding methods and properties. If the parent class has corresponding methods and properties, it is also correctly referenced. If the parent class does not have corresponding methods and properties, it is necessary to search for the parent class's parent class until there is no parent class. The specific verification process is as follows: Figure 3 The method and attribute verification process shown in the figure. Finally, the classes, methods, and attributes that fail the verification are uniformly retained in the collection object Set.
[0099] Loop through the classes, methods, and property collection objects that fail the verification, and print each object to the console or output it to the corresponding result file for troubleshooting.
[0100] Example:
[0101] Get the path of rt.jar under the current JDK, such as: C:\Program Files\Java\jdk1.8.121\jre\lib\rt.jar.
[0102] Use the ASM framework to parse all files in C:\Program Files\Java\jdk1.8.121\jre\lib\rt.jar, obtain all classes, methods, and properties, and put them into a custom object JarInfo named rtJar. The process of parsing all classes, methods, and properties of rt.jar is as follows:
[0103] The path of the jar package to be verified (such as G:\repository\com\travelsky\ibe\ibe-client\1.0.89\ibe-client-1.0.89.jar) is passed into the system. The system parses the jar package to be verified according to the path, and puts all the classes, methods, attributes contained in it and the called classes, methods, and attributes into the custom object JarInfo named checkJar.
[0104] Assemble all classes of the rtJar object and the checkJar object to be checked into a complete set Set <string>allClass, all methods are Set <string>allMethods, all properties are Set <string>allFileds.
[0105] Determine whether all classes called by the checkJar object are in allClass, and put the classes that are not found into Set <string>notFindClassSet. Determine whether all methods called by the checkJar object are in allMethods. If not, it is necessary to find out whether there is a corresponding method in the parent class. If the parent class does not have a corresponding method, it is necessary to find the parent class of the parent class until there is no parent class. Then put the unfound methods into Set. <string>notFindMethodSet. Determine whether all the attributes called by the checkJar object are in allFileds. If not, you need to find out whether there is a corresponding attribute in the parent class. If the parent class does not have a corresponding attribute, you need to find the parent class of the parent class until there is no parent class. Put the attributes that are not found into Set <string>notFindFieldSet.
[0106] Loop through notFindClassSet to print out the classes that were not found, loop through notFindMethodSet to print out the methods that were not found, and loop through notFindFieldSet to print out the properties that were not found.
[0107] In summary, in the process of software development system development, the realization of air ticket business functions widely depends on the call of IBE service, so the correctness of IBE client SDK is crucial to the software development system. By automatically checking the jar package, the wrong reference class, method, and attribute can be quickly found, allowing the software development system to avoid the complex process of manual jar package inspection and high professional requirements. The upgrade efficiency of IBE client is greatly improved.
[0108] Figure 4 is a block diagram of a system for automatically detecting the correctness of jar package references in this exemplary embodiment. Figure 4 As shown, an exemplary embodiment of the present disclosure provides a system for automatically detecting the correctness of jar package references, including:
[0109] A first acquisition unit is used to acquire all classes, methods and properties in the archive file of the Java core runtime library;
[0110] The second acquisition unit is used to acquire the jar file to be verified and all classes, methods and properties called by the jar file to be verified;
[0111] An assembly unit is used to assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set;
[0112] The detection unit is used to determine whether all classes, methods and attributes called by the jar file to be verified are in the full set, and automatically detect the correctness of the jar package reference based on the judgment result.
[0113] Figure 5 Schematic diagram of the structure of a device of this exemplary embodiment. Figure 5 As shown, corresponding to the method for automatically detecting the correctness of jar package references provided above, the present disclosure also provides a device. Since the embodiment of the device is similar to the above method embodiment, the description is relatively simple. Please refer to the description of the above method embodiment for relevant details. The device described below is only schematic. The device may include: a processor 1, a memory 2, a communication bus (i.e., the above device bus) and a search engine, wherein the processor 1 and the memory 2 communicate with each other through the communication bus and communicate with the outside through the communication interface. The processor 1 can call the logic instructions in the memory 2 to execute the method for automatically detecting the correctness of jar package references.
[0114] In addition, the logic instructions in the above-mentioned memory 2 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: a storage chip, a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.
[0115] On the other hand, an embodiment of the present disclosure further provides a processor-readable storage medium, on which a computer program 3 is stored. When the computer program 3 is executed by the processor 1, the method for automatically detecting the correctness of jar package references provided in the above embodiments is implemented.
[0116] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor 1, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0117] The above are only preferred implementations of the present disclosure, and the protection scope of the present disclosure is not limited to the above embodiments. All technical solutions under the concept of the present disclosure belong to the protection scope of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present disclosure should be regarded as the protection scope of the present disclosure.< / string> < / string> < / string> < / string> < / string> < / string>
Claims
1. A method for automatically detecting the correctness of jar package references, characterized in that: include: Get all classes, methods and properties under the archive file of the Java core runtime library; Get the jar file to be verified and all classes, methods and properties called by the jar file to be verified; Assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set; It is determined whether all classes, methods and properties called by the jar file to be verified are in the complete set, and the correctness of the jar package reference is automatically detected based on the determination result.
2. The method for automatically detecting the correctness of jar package references according to claim 1 is characterized in that: Get all the classes, methods, and properties under the archive file of the Java core runtime library, including: Get the full path to the archive file for the current Java core runtime library.
3. The method for automatically detecting the correctness of jar package references according to claim 2 is characterized in that: Get the full path to the archive file of the current Java core runtime library: Get the JDK installation path and file separator of the current operating system by reading the current operating system variables; Based on the JDK installation path and file separator, concatenate the full path of the archive file of the Java core runtime library.
4. The method for automatically detecting the correctness of jar package references according to claim 2 or 3, characterized in that: Get all classes, methods, and properties under the archive file of the Java core runtime library including: Calling a Java file processing class, traversing the archive file of the Java core runtime library, and parsing out all class files in the archive file of the Java core runtime library; Based on the complete path of the archive file of the Java core runtime library, each class file in the archive file of the Java core runtime library is parsed through the ASM framework to obtain all classes, methods and attributes defined in the archive file of the Java core runtime library; All classes, methods and properties defined in the archive file of the Java core runtime library are saved into a Java collection object.
5. The method for automatically detecting the correctness of jar package references according to claim 1 is characterized in that: Get the jar file to be verified and all classes, methods and properties called by the jar file to be verified, including: Pass in the path of the jar file to be verified through parameters; Call the Java file processing class, traverse the jar file to be verified, and parse out all class files in the jar file to be verified; Based on the path of the jar file to be verified, each class file in the jar package to be verified is parsed through the ASM framework to obtain the jar package to be verified itself and all classes, methods and properties called by the jar file to be verified; The jar package to be verified and all classes, methods and properties called by the jar file to be verified are saved in a Java collection object.
6. The method for automatically detecting the correctness of jar package references according to claim 1 is characterized in that: Assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set including: Assemble the archive file of the Java core runtime library, the jar file to be verified, and all classes called by the jar file to be verified into a complete set of classes; Assemble all the methods under the archive file of the Java core runtime library, the jar file to be verified, and the methods called by the jar file to be verified into a complete set of methods; Assemble all attributes under the archive file of the Java core runtime library, the jar file to be verified, and all attributes called by the jar file to be verified into a complete set of attributes.
7. The method for automatically detecting the correctness of jar package references according to claim 6 is characterized in that: Determine whether all classes, methods, and attributes called by the jar file to be verified are in the full set, and automatically detect the correctness of the jar package reference based on the judgment result, including: Determine whether all classes called by the jar file to be verified are in the full set of classes, and output classes that are not included in the full set of classes; Determine whether all methods called by the jar file to be verified are in the method set. If all methods called by the jar file to be verified are not in the method set, determine whether there are corresponding methods in the parent class and output the methods not included in the parent class. Determine whether all the attributes called by the jar file to be verified are in the full set of attributes. If all the attributes called by the jar file to be verified are not in the full set of attributes, determine whether there are corresponding attributes in the parent class and output the attributes not included in the parent class. Loop through the classes, methods, and property collection objects of the verification output, and print each object to the console or output it to the corresponding result file for troubleshooting.
8. A system for automatically detecting the correctness of jar package references, characterized in that: include: A first acquisition unit is used to acquire all classes, methods and properties in the archive file of the Java core runtime library; The second acquisition unit is used to acquire the jar file to be verified and all classes, methods and properties called by the jar file to be verified; An assembly unit is used to assemble all the classes, methods and properties under the archive file of the Java core runtime library, the jar file to be verified, and the jar file to be verified into a complete set; The detection unit is used to determine whether all classes, methods and attributes called by the jar file to be verified are in the full set, and automatically detect the correctness of the jar package reference based on the judgment result.
9. A device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor calls the computer program stored in the memory to execute the method for automatically detecting the correctness of jar package references as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is enabled to execute the method for automatically detecting the correctness of jar package references as described in any one of claims 1 to 7.