Skip to content

Commit

Permalink
Cleanup deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed Apr 7, 2023
1 parent 994277c commit 603302d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void validateArtifacts()
throws MojoFailureException
{
// check unique of types and classifiers
Set<String> extensionClassifiers = new HashSet<String>();
Set<String> extensionClassifiers = new HashSet<>();
for ( Artifact artifact : artifacts )
{
String extensionClassifier = artifact.getType() + ":" + artifact.getClassifier();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private int getNextPortNumber()
assert minPortNumber != null;

List<Integer> reservedPorts = getReservedPorts();
int nextPort = -1;
int nextPort;
if ( reservedPorts.isEmpty() )
{
nextPort = minPortNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,28 @@ public void execute()
String[] bits = this.locale.split( "[,_]" );
if ( bits.length == 1 )
{
locale = new Locale( bits[0].trim() );
locale = new Locale.Builder()
.setLanguage(bits[0].trim())
.build();
}
else if ( bits.length == 2 )
{
locale = new Locale( bits[0].trim(), bits[1].trim() );
locale = new Locale.Builder()
.setLanguage(bits[0].trim())
.setRegion(bits[1].trim())
.build();
}
else if ( bits.length == 3 )
{
locale = new Locale( bits[0].trim(), bits[1].trim(), bits[2].trim() );
locale = new Locale.Builder()
.setLanguage(bits[0].trim())
.setRegion(bits[1].trim())
.setVariant(bits[2].trim())
.build();
}
else
{
throw new MojoExecutionException( "expecting language,country,variant but got more than three parts" );
throw new MojoExecutionException( "expecting language,region,variant but got more than three parts" );
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public int getPatch()
@Override
public String getAsOSGiVersion()
{
StringBuffer osgiVersion = new StringBuffer();
StringBuilder osgiVersion = new StringBuilder();
osgiVersion.append( this.getMajor() );
osgiVersion.append( "." + this.getMinor() );
osgiVersion.append( "." + this.getPatch() );
Expand Down

0 comments on commit 603302d

Please sign in to comment.