mbien commented on issue #6076:
URL: https://github.com/apache/netbeans/issues/6076#issuecomment-1596588677

   @maryam-yousefi-Canada It would be good to know if there are more corrupted 
properties files in your config. Could you run this utility which scans all 
property files of your netbeans configs for invalid code points?
   
   You can simply paste it into a maven project and run it on JDK 11+, thanks!
   
   ```java
   import java.io.IOException;
   import java.nio.file.Files;
   import java.nio.file.Path;
   import java.util.stream.Stream;
   
   public class NbConfigScanner {
   
       public static void main(String[] args) throws IOException {
           System.out.println(Runtime.version());
           Path path = 
Path.of("C:\\Users\\myousefi\\AppData\\Roaming\\NetBeans");
           try (Stream<Path> configs = Files.list(path)) {
               configs.filter(Files::isDirectory)
                      .sorted()
                      .forEach(NbConfigScanner::check);
           }
       }
   
       private static void check(Path config) {
           System.out.println("checking: "+config);
           try (Stream<Path> stream = Files.walk(config)) {
               stream.filter(path -> 
path.getFileName().toString().endsWith(".properties"))
                     .forEach(path -> {
                           try {
                               if (Files.readString(path).indexOf('\u0000') != 
-1) {
                                   System.out.println("WARNING: "+path+" 
contains invalid code points");
                               }
                           } catch (IOException ex) {
                               ex.printStackTrace();
                           }
                     });
           } catch (IOException ex) {
               ex.printStackTrace();
           }
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to