<commit_before>/*
 * Copyright (C) 2012 Bosch Software Innovations GmbH. All rights reserved.
 */

package org.sourcepit.b2.model.builder.util;

import static com.google.common.base.Strings.isNullOrEmpty;

import javax.inject.Named;

import org.sourcepit.b2.model.module.AbstractModule;
import org.sourcepit.common.utils.props.PropertiesSource;

@Named
public class DefaultModuleIdDerivator implements ModuleIdDerivator
{
   public String deriveModuleId(AbstractModule module, PropertiesSource properties)
   {
      final String groupId = properties.get("project.groupId");
      if (!isNullOrEmpty(groupId))
      {
         final String artifactId = properties.get("project.artifactId");
         if (!isNullOrEmpty(artifactId))
         {
            return beautify(resolveSymbolicName(groupId, artifactId));<commit_msg>Prefer "module.id" property<commit_after>/*
 * Copyright (C) 2012 Bosch Software Innovations GmbH. All rights reserved.
 */

package org.sourcepit.b2.model.builder.util;

import static com.google.common.base.Strings.isNullOrEmpty;

import javax.inject.Named;

import org.sourcepit.b2.model.module.AbstractModule;
import org.sourcepit.common.utils.props.PropertiesSource;

@Named
public class DefaultModuleIdDerivator implements ModuleIdDerivator
{
   public String deriveModuleId(AbstractModule module, PropertiesSource properties)
   {
      final String moduleId = properties.get("module.id");
      if (!isNullOrEmpty(moduleId))
      {
         return moduleId;
      }
      
      final String groupId = properties.get("project.groupId");
      if (!isNullOrEmpty(groupId))
      {
         final String artifactId = properties.get("project.artifactId");
         if (!isNullOrEmpty(artifactId))
         {
            return beautify(resolveSymbolicName(groupId, artifactId));
{'fraction_non_alphanumeric': 0.09789823008849557, 'fraction_numerical': 0.00663716814159292, 'mean_word_length': 3.902439024390244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2021052', 'n_tokens_mistral': 523, 'n_tokens_neox': 494, 'n_words': 107}