Skip to content

Conversation

willschellhornrv
Copy link
Contributor

No description provided.

@rv-jenkins
Copy link

Can one of the admins verify this patch?

1 similar comment
@rv-jenkins
Copy link

Can one of the admins verify this patch?

@xiaohe27
Copy link
Contributor

@willschellhornrv Thanks for this patch. But in order to reject the invalid names. It is better to use the regex like "[a-zA-Z_][A-Za-z0-9_]*"

@willschellhornrv
Copy link
Contributor Author

Yes this works. I think a user should be able to create a file with a single number as a name though.
What do you think about the regex [A-Za-z0-9_]+ ?

@xiaohe27
Copy link
Contributor

@willschellhornrv Well, the problem of using single number as file name is: currently, the name of the mop file is being used to infer the aspect name; therefore, an additional check of file name is performed to prevent the generation of invalid class name.
E.G. suppose you have a mop file "0.mop" and let us use the regex you just suggested, then the .aj file should be generated successfully, but it wouldn't compile because the lines "class 0RuntimeMonitor ..." and "public aspect 0MonitorAspect ..." result in compile time error...
You can have a try. I know the user might want to get more flexibility, but in order to make the naming convention more predictable, we'd better compromise a bit, right?

xiaohe27 added a commit that referenced this pull request Jul 11, 2015
…ssue

parse MOP files with underscores in file names
@xiaohe27 xiaohe27 merged commit 9d51681 into master Jul 11, 2015
@xiaohe27 xiaohe27 deleted the Underscore_parsing_issue branch July 11, 2015 12:02
@owolabileg
Copy link
Contributor

Thanks @xiaohe27, @willschellhornrv

I suggest to fully document this (and any other) restriction(s) on .mop file names in at least three places?:

  1. In the code comments right before the areValidNames in JavaMOPMain.java
  2. In the error message, of the areValidNames method, so that non-members of our team know why their .mop file names are not being accepted
  3. In the README inside the property-db repository where we store our properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants