Bug 1024290

Summary: Creating repositories with special characters causes Nullpointer exceptions
Product: [Retired] JBoss BRMS Platform 6 Reporter: Patrick Steiner <psteiner>
Component: Business CentralAssignee: Jan <jschatte>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Locker <jlocker>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0.0CC: kverlaen, mbaluch
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Build Name: 13464, Getting Started Guide-6-Beta-1 Build Date: 28-10-2013 13:46:10 Topic ID: 22536-547897 [Latest]
Last Closed: 2014-08-06 20:18:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Patrick Steiner 2013-10-29 10:43:56 UTC
Title: Nullpointer exception

Describe the issue:
when creating a new repository, the repository-name is not allowed to have special characters. I tried "RedHat_Demo" as a name and received the exception. Same applies for other names with "_". I have not tested other special characters.

Suggestions for improvement:
Forms validation before sending the request to create a repo to the backend?


Additional information:11:38:00,754 ERROR [org.kie.kieora.io.BatchIndex] (Thread-92) Index fails. [@git://localhost:9418/Reward_Demo]: java.lang.NullPointerException
	at org.kie.kieora.io.KObjectUtil$3.getKey(KObjectUtil.java:116) [kieora-commons-io-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.kieora.io.KObjectUtil$3.getId(KObjectUtil.java:96) [kieora-commons-io-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.kieora.backend.lucene.LuceneIndexEngine.index(LuceneIndexEngine.java:71) [kieora-backend-lucene-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.kieora.io.BatchIndex$3.visitFile(BatchIndex.java:92) [kieora-commons-io-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.kieora.io.BatchIndex$3.visitFile(BatchIndex.java:77) [kieora-commons-io-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.commons.java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:63) [kie-nio2-api-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.commons.java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:85) [kie-nio2-api-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.commons.java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:44) [kie-nio2-api-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.commons.java.nio.file.Files.walkFileTree(Files.java:909) [kie-nio2-api-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.commons.java.nio.file.Files.walkFileTree(Files.java:928) [kie-nio2-api-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.kieora.io.BatchIndex.run(BatchIndex.java:77) [kieora-commons-io-6.0.0-redhat-5.jar:6.0.0-redhat-5]
	at org.kie.kieora.io.BatchIndex$1.run(BatchIndex.java:60) [kieora-commons-io-6.0.0-redhat-5.jar:6.0.0-redhat-5]

Comment 2 Kris Verlaenen 2013-10-30 13:54:53 UTC
Pedro, might be able to assign this one to someone from your team?

Comment 4 Jan 2013-11-01 01:08:16 UTC
A validation control to avoid any offending characters or combination thereof has been implemented. By offending we mean any non-alphanumeric character except for '.' and '-'. The latter can occur, but only inside the name and not consecutively. 
If any of these characters or combination thereof is present it/they will be dropped, OR replaced by a legal character (e.g. 'ç'/'Ç' --> 'c'/'C'), and an alternative repository name will be suggested to the user, who can then accept to continue creating/cloning the repository, or cancel the operation.

As an example, if a user were to enter - hypothetically speaking - the following name "..-.m"y-t@ës#t'.re{p'od..-.-B'.--..+-_--ç-..f-n:a;m,e--.-", then the suggested name would become "my-test.repodBcf-name" .

Implemented in uberfire:

master: http://github.com/droolsjbpm/uberfire/commit/60d32a31c

0.3.x: http://github.com/droolsjbpm/uberfire/commit/3a9f7a7e9