Skip to content

Commit

Permalink
feat(objectionary#1574): fix qulice suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Dec 22, 2022
1 parent 9ea1f2f commit 28e4338
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,7 @@ public void exec() throws IOException {
*/
@SuppressWarnings({"PMD.AvoidCatchingGenericException", "PMD.ExceptionAsFlowControl"})
private void parse(final Tojo tojo) throws IOException {
String first;
try {
first = tojo.get(AssembleMojo.ATTR_EO);
} catch (final Exception ex) {
Logger.error(this, "Failed to parse %s: %[exception]s", tojo, ex);
throw ex;
}
final Path source = Paths.get(first);
final Path source = Paths.get(tojo.get(AssembleMojo.ATTR_EO));
final String name = tojo.get(Tojos.KEY);
final Footprint footprint;
if (tojo.exists(AssembleMojo.ATTR_HASH)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2016-2022 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.eolang.maven;

import com.yegor256.tojos.Tojo;
Expand Down Expand Up @@ -26,7 +49,10 @@
*/
class CatalogsConcurrencyTest {

final static int CORES = Runtime.getRuntime().availableProcessors();
/**
* Number of cores on the running system.
*/
private static final int CORES = Runtime.getRuntime().availableProcessors();

@Disabled
@Test
Expand All @@ -35,17 +61,22 @@ void readsFromTojosConcurrently(@TempDir final Path tmp) {
MatcherAssert.assertThat(
new SumOf(
new Threads<>(
CORES,
IntStream.range(0, CORES)
CatalogsConcurrencyTest.CORES,
IntStream.range(0, CatalogsConcurrencyTest.CORES)
.mapToObj(i -> tojos.add(UUID.randomUUID().toString()))
.map(CatalogsConcurrencyTest::task)
.collect(Collectors.toList())
)
),
Matchers.equalTo(CORES)
Matchers.equalTo(CatalogsConcurrencyTest.CORES)
);
}

/**
* Task to be executed in parallel.
* @param tojo Tojo
* @return Scalar
*/
private static Scalar<Integer> task(final Tojo tojo) {
return () -> {
final String uuid = "uuid";
Expand All @@ -57,6 +88,4 @@ private static Scalar<Integer> task(final Tojo tojo) {
return 1;
};
}


}
}

0 comments on commit 28e4338

Please sign in to comment.