auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCarsDepth() throws IOException, AggregationException { LatLonRect bbox = new LatLonRect(new LatLonPointImmutable(-44.5, 114), new LatLonPointImmutable(-44.5, 114)); CalendarDateRange timeRange = CalendarDateRange.of(CalendarDate.parseISOformat("gregorian", "2009-01-01T00:00:00"), CalendarDate.parseISOformat("gregorian", "2009-12-26T00:00:00")); NumberRange verticalSubset = new NumberRange(50,100); AggregationOverrides overrides = AggregationOverridesReader.load( resourcePath("au/org/emii/aggregator/CARStemplate.xml")); try (NetcdfAggregator netcdfAggregator = new NetcdfAggregator( outputFile, overrides, null, bbox, verticalSubset, timeRange )) { netcdfAggregator.add(resourcePath("au/org/emii/aggregator/CARSWeeklySubset.nc")); } assertNetcdfFileEqualsCdl(resourcePath("au/org/emii/aggregator/cars_weekly_expected.cdl"), outputFile); }

Target:
public void testCarsDepth() throws IOException, AggregationException { LatLonRect bbox = new LatLonRect(new LatLonPointImmutable(-44.5, 114), new LatLonPointImmutable(-44.5, 114)); NumberRange verticalSubset = new NumberRange(50,100); AggregationOverrides overrides = AggregationOverridesReader.load( resourcePath("au/org/emii/aggregator/CARStemplate.xml")); try (NetcdfAggregator netcdfAggregator = new NetcdfAggregator( outputFile, overrides, null, bbox, verticalSubset, null )) { netcdfAggregator.add(resourcePath("au/org/emii/aggregator/CARSWeeklySubset.nc")); } assertNetcdfFileEqualsCdl(resourcePath("au/org/emii/aggregator/cars_weekly_expected.cdl"), outputFile); }
Source:
protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RasNode node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { Collection<WorkerSlot> topologyUsedSlots = oneExecutorPerWorker ? node.getUsedSlots(td.getId()) : Collections.emptySet(); for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (node.wouldFit(ws, exec, td, getOneExecutorPerWorker(), getOneComponentPerWorker())) { return ws; } } } } return null; }

Target:
protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RasNode node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } return null; }
Source:
public ConfigurationNode getNode(Locale locale) { if (this.root == null) { throw new IllegalStateException("Tried to read SimpleConfigTranslationDictionary before it was loaded."); } return this.root.getNode(locale.toString()); }

Target:
public ConfigurationNode getNode(Locale locale) { checkState(this.root != null, "Tried to read SimpleConfigTranslationDictionary before it was loaded."); return this.root.getNode(locale.toString()); }
Source:
private Type transformState(Type state) { String result = state.toFullString(); try { result = TransformationHelper.transform(service, function, sourceFormat, state.toFullString()); } catch (TransformationException e) { logger.debug("Could not transform state '{}' with function '{}' and format '{}'", state, function, sourceFormat); } StringType resultType = new StringType(result); logger.debug("Transformed '{}' into '{}'", state, resultType); return resultType; }

Target:
private Type transformState(Type state) { String result = state.toFullString(); try { result = TransformationHelper.transform(service, function, sourceFormat, state.toFullString()); } catch (TransformationException e) { logger.warn("Could not transform state '{}' with function '{}' and format '{}'", state, function, sourceFormat); } StringType resultType = new StringType(result); logger.debug("Transformed '{}' into '{}'", state, resultType); return resultType; }
Source:
public List<Document> getClientDocuments(String clientId) throws MambuApiException { if (clientId == null || clientId.trim().isEmpty()) { throw new IllegalArgumentException("ClientId ID must not be null or empty"); } return DocumentsService.getDocuments(mambuAPIService, CLIENTS, clientId); }

Target:
public List<Document> getClientDocuments(String clientId) throws MambuApiException { if (clientId == null || clientId.trim().isEmpty()) { throw new IllegalArgumentException("ClientId ID must not be null or empty"); } return new DocumentsService(mambuAPIService).getDocuments(CLIENTS, clientId); }
Source:
private void updateDurationHistogram(long duration) { if (isClientEventExchangeWithoutAffinityChange()) return; MetricRegistry mreg = cctx.kernalContext().metric().registry(GridMetricManager.SYS_METRICS); HistogramMetric durationHistogram = (HistogramMetric)mreg.findMetric(CACHE_OPERATIONS_BLOCKED_DURATION_HISTOGRAM); durationHistogram.value(duration); }

Target:
private void updateDurationHistogram(long duration) { cctx.exchange().durationHistogram().value(duration); if (changedAffinity()) cctx.exchange().blockingDurationHistogram().value(duration); }
Source:
@Override public int hashCode() { return Objects.hash(schemaName, tblName); }

Target:
@Override public int hashCode() { int res = schemaName.hashCode(); res = 31 * res + tblName.hashCode(); return res; }
Source:
public void processMutablePointerEvent(PublicKeyHash writer, MaybeMultihash existingRoot, MaybeMultihash newRoot) { if (existingRoot.equals(newRoot)) return; Stat current = currentView.get(writer); if (current == null) throw new IllegalStateException("Unknown writer key hash: " + writer); if (! newRoot.isPresent()) { current.update(MaybeMultihash.empty(), Collections.emptySet(), 0); return; } try { synchronized (current) { long changeInStorage = dht.getChangeInContainedSize(current.target, newRoot.get(), current.directRetainedStorage).get(); Set<PublicKeyHash> updatedOwned = WriterData.getWriterData(writer, newRoot, dht).get().props.ownedKeys; for (PublicKeyHash owned : updatedOwned) { currentView.computeIfAbsent(owned, k -> new Stat(current.owner, MaybeMultihash.empty(), 0, Collections.emptySet())); } while (true) { Long currentUsage = usage.get(current.owner); boolean casSucceeded = usage.replace(current.owner, currentUsage, currentUsage + changeInStorage); if (casSucceeded) break; } current.update(newRoot, updatedOwned, current.directRetainedStorage + changeInStorage); } } catch (Exception e) { e.printStackTrace(); } }

Target:
public void processMutablePointerEvent(PublicKeyHash writer, MaybeMultihash existingRoot, MaybeMultihash newRoot) { if (existingRoot.equals(newRoot)) return; Stat current = currentView.get(writer); if (current == null) throw new IllegalStateException("Unknown writer key hash: " + writer); if (! newRoot.isPresent()) { current.update(MaybeMultihash.empty(), Collections.emptySet(), 0); if (existingRoot.isPresent()) { try { Set<PublicKeyHash> updatedOwned = WriterData.getWriterData(writer, newRoot, dht).get().props.ownedKeys; processRemovedOwnedKeys(updatedOwned); } catch (Exception e) { e.printStackTrace(); } } return; } try { synchronized (current) { long changeInStorage = dht.getChangeInContainedSize(current.target, newRoot.get()).get(); Set<PublicKeyHash> updatedOwned = WriterData.getWriterData(writer, newRoot, dht).get().props.ownedKeys; for (PublicKeyHash owned : updatedOwned) { currentView.computeIfAbsent(owned, k -> new Stat(current.owner, MaybeMultihash.empty(), 0, Collections.emptySet())); } Usage currentUsage = usage.get(current.owner); currentUsage.addUsage(changeInStorage); HashSet<PublicKeyHash> removedChildren = new HashSet<>(current.getOwnedKeys()); removedChildren.removeAll(updatedOwned); processRemovedOwnedKeys(removedChildren); current.update(newRoot, updatedOwned, current.directRetainedStorage + changeInStorage); } } catch (Exception e) { e.printStackTrace(); } }
Source:
public void testCreateFileOnInternalMountDirWithSameDirTreeExistInFallback() throws Exception { Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/user1/hive/warehouse/partition-0", new Path(targetTestRoot.toString()).toUri()); Path dir1 = new Path(targetTestRoot, "fallbackDir/user1/hive/warehouse/partition-0"); fsTarget.mkdirs(dir1); Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); ConfigUtil.addLinkFallback(conf, fallbackTarget.toUri()); try (FileSystem vfs = FileSystem.get(viewFsDefaultClusterUri, conf)) { Path p = new Path("/user1/hive/warehouse/test.file"); Path test = Path.mergePaths(fallbackTarget, p); assertFalse(fsTarget.exists(test)); assertTrue(fsTarget.exists(test.getParent())); vfs.createNewFile(p); assertTrue(fsTarget.exists(test)); } }

Target:
public void testCreateFileOnInternalMountDirWithSameDirTreeExistInFallback() throws Exception { Configuration conf = new Configuration(); ConfigUtil.addLink(conf, "/user1/hive/warehouse/partition-0", new Path(targetTestRoot.toString()).toUri()); Path fallbackTarget = new Path(targetTestRoot, "fallbackDir"); Path dir1 = new Path(fallbackTarget, "user1/hive/warehouse/partition-0"); fsTarget.mkdirs(dir1); ConfigUtil.addLinkFallback(conf, fallbackTarget.toUri()); try (FileSystem vfs = FileSystem.get(viewFsDefaultClusterUri, conf)) { Path vfsTestFile = new Path("/user1/hive/warehouse/test.file"); Path testFileInFallback = Path.mergePaths(fallbackTarget, vfsTestFile); assertFalse(fsTarget.exists(testFileInFallback)); assertTrue(fsTarget.exists(testFileInFallback.getParent())); vfs.create(vfsTestFile).close(); assertTrue(fsTarget.exists(testFileInFallback)); } }
Source:
public Collection<Property<?, ?>> getPropertiesFor(final PropertyHolder holder) { final ImmutableList.Builder<Property<?, ?>> builder = ImmutableList.builder(); if (this.tempRegistry != null) { final Set<Class<? extends Property<?, ?>>> used = new ReferenceOpenHashSet<>(); for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.tempRegistry.delegateMap.entrySet()) { used.add(entry.getKey()); entry.getValue().getFor(holder).ifPresent(builder::add); } for (final Map.Entry<Class<? extends Property<?, ?>>, List<PropertyStore<?>>> entry : this.tempRegistry.propertyStoreMap.entrySet()) { if (!used.contains(entry.getKey())) { used.add(entry.getKey()); final ImmutableList.Builder<PropertyStore<?>> propertyStoreBuilder = ImmutableList.builder(); entry.getValue().sort(Constants.Functional.PROPERTY_STORE_COMPARATOR); propertyStoreBuilder.addAll(entry.getValue()); final PropertyStoreDelegate<?> delegate = new PropertyStoreDelegate(propertyStoreBuilder.build()); this.tempRegistry.delegateMap.put(entry.getKey(), delegate); delegate.getFor(holder).ifPresent(builder::add); } } return builder.build(); } for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.delegateMap.entrySet()) { entry.getValue().getFor(holder).ifPresent(builder::add); } return builder.build(); }

Target:
public Collection<Property<?, ?>> getPropertiesFor(final PropertyHolder holder) { final ImmutableList.Builder<Property<?, ?>> builder = ImmutableList.builder(); if (this.tempRegistry != null) { final Set<Class<? extends Property<?, ?>>> used = new HashSet<>(); for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.tempRegistry.delegateMap.entrySet()) { used.add(entry.getKey()); entry.getValue().getFor(holder).ifPresent(builder::add); } for (final Map.Entry<Class<? extends Property<?, ?>>, List<PropertyStore<?>>> entry : this.tempRegistry.propertyStoreMap.entrySet()) { if (!used.contains(entry.getKey())) { used.add(entry.getKey()); final ImmutableList.Builder<PropertyStore<?>> propertyStoreBuilder = ImmutableList.builder(); entry.getValue().sort(Constants.Functional.PROPERTY_STORE_COMPARATOR); propertyStoreBuilder.addAll(entry.getValue()); final PropertyStoreDelegate<?> delegate = new PropertyStoreDelegate(propertyStoreBuilder.build()); this.tempRegistry.delegateMap.put(entry.getKey(), delegate); delegate.getFor(holder).ifPresent(builder::add); } } return builder.build(); } for (final Map.Entry<Class<? extends Property<?, ?>>, PropertyStoreDelegate<?>> entry : this.delegateMap.entrySet()) { entry.getValue().getFor(holder).ifPresent(builder::add); } return builder.build(); }
Source:
public void onNext(final CompletedTask task) { final byte[] retBytes = task.get(); if (retBytes == null) { return; } final String filePath = filePathList.get(fileCounter.get()); final int retCnt = Integer.parseInt(new String(retBytes, StandardCharsets.UTF_8)); lineCounter.addAndGet(retCnt); LOG.log(Level.FINE, "Number of lines counted by {0} for a file {1} is {2}", new Object[]{task.getId(), filePath, retCnt}); final int completedTaskCnt = completedTaskCounter.incrementAndGet(); LOG.log(Level.FINER, "Completed tasks: ({0} / {1})", new Object[]{completedTaskCnt, contextList.size()}); if (completedTaskCnt == contextList.size()) { System.out.println(String.format("Total Line Count in %s : %d", filePath, lineCounter.get())); if (tryToLoadNextFile()) { contextList.forEach(ActiveContext::close); } } }

Target:
public void onNext(final CompletedTask task) { final byte[] retBytes = task.get(); if (retBytes == null) { return; } final int currFileIdx = fileCounter.get() - 1; final String filePath = filePathList.get(currFileIdx); final int retCnt = Integer.parseInt(new String(retBytes, StandardCharsets.UTF_8)); lineCounter.addAndGet(retCnt); LOG.log(Level.FINE, "Number of lines counted by {0} for a file {1} is {2}", new Object[]{task.getId(), filePath, retCnt}); final int completedTaskCnt = completedTaskCounter.incrementAndGet(); LOG.log(Level.FINER, "Completed tasks: ({0} / {1})", new Object[]{completedTaskCnt, contextList.size()}); if (completedTaskCnt == contextList.size()) { System.out.println(String.format("Total Line Count in %s : %d", filePath, lineCounter.get())); if (loadNextFile()) { reset(); } else { contextList.forEach(ActiveContext::close); } } }
Source:
protected List<String> getTokens() { List<String> tokenIds = null; try { List<String> allAliases = aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME); tokenIds = allAliases.stream() .filter(a -> a.contains(TOKEN_MAX_LIFETIME_POSTFIX)) .map(a -> a.substring(0, a.indexOf(TOKEN_MAX_LIFETIME_POSTFIX))) .collect(Collectors.toList()); } catch (AliasServiceException e) { e.printStackTrace(); } return (tokenIds != null ? tokenIds : Collections.emptyList()); }

Target:
protected List<String> getTokens() { List<String> tokenIds = null; try { List<String> allAliases = aliasService.getAliasesForCluster(AliasService.NO_CLUSTER_NAME); tokenIds = allAliases.stream() .filter(a -> a.contains(TOKEN_MAX_LIFETIME_POSTFIX)) .map(a -> a.substring(0, a.indexOf(TOKEN_MAX_LIFETIME_POSTFIX))) .collect(Collectors.toList()); } catch (AliasServiceException e) { log.errorAccessingTokenState(e); } return (tokenIds != null ? tokenIds : Collections.emptyList()); }
Source:
private String getBearerToken(AnypointCredential credentials) { if (isBlank(bearerToken)) { switch (credentials.credentialType()) { case user: Credentials creds = (Credentials) credentials; bearerToken = authenticationServiceClient.getBearerToken(creds); case token: bearerToken = ((AnypointToken) credentials).getToken(); } } return bearerToken; }

Target:
private String getBearerToken(AnypointCredential credentials) { if (isBlank(bearerToken)) { switch (credentials.credentialType()) { case user: Credentials creds = (Credentials) credentials; bearerToken = authenticationServiceClient.getBearerToken(creds); break; case token: bearerToken = ((AnypointToken) credentials).getToken(); break; } } return bearerToken; }
Source:
public Response toolsIndexGet(SecurityContext securityContext) { if (!config.getEsConfiguration().getHostname().isEmpty()) { List<Entry> published = getPublished(); try (RestClient restClient = RestClient .builder(new HttpHost(config.getEsConfiguration().getHostname(), config.getEsConfiguration().getPort(), "http")) .build()) { try { restClient.performRequest("DELETE", "/tools"); } catch (Exception e) { LOG.warn("Could not delete previous elastic search Tools index, not an issue if this is cold start", e); } try { restClient.performRequest("DELETE", "/workflows"); } catch (Exception e) { LOG.warn("Could not delete previous elastic search Workflows index, not an issue if this is cold start", e); } URL urlTools = Resources.getResource("queries/mapping_tool.json"); String textTools = Resources.toString(urlTools, StandardCharsets.UTF_8); HttpEntity mappingEntityTools = new NStringEntity(textTools, ContentType.APPLICATION_JSON); URL urlWorkflows = Resources.getResource("queries/mapping_workflow.json"); String textWorkflows = Resources.toString(urlWorkflows, StandardCharsets.UTF_8); HttpEntity mappingEntityWorkflows = new NStringEntity(textWorkflows, ContentType.APPLICATION_JSON); restClient.performRequest("PUT", "/tools", Collections.emptyMap(), mappingEntityTools); restClient.performRequest("PUT", "/workflows", Collections.emptyMap(), mappingEntityWorkflows); if (!published.isEmpty()) { publicStateManager.bulkUpsert(published); } } catch (IOException e) { LOG.error("Could not create elastic search index", e); throw new CustomWebApplicationException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } return Response.ok().entity(published.size()).build(); } return Response.ok().entity(0).build(); }

Target:
public Response toolsIndexGet(SecurityContext securityContext) { if (!config.getEsConfiguration().getHostname().isEmpty()) { List<Entry> published = getPublished(); try (RestClient restClient = RestClient .builder(new HttpHost(config.getEsConfiguration().getHostname(), config.getEsConfiguration().getPort(), "http")) .build()) { deleteIndex(restClient, "tools"); deleteIndex(restClient, "workflows"); URL urlTools = Resources.getResource("queries/mapping_tool.json"); String textTools = Resources.toString(urlTools, StandardCharsets.UTF_8); HttpEntity mappingEntityTools = new NStringEntity(textTools, ContentType.APPLICATION_JSON); URL urlWorkflows = Resources.getResource("queries/mapping_workflow.json"); String textWorkflows = Resources.toString(urlWorkflows, StandardCharsets.UTF_8); HttpEntity mappingEntityWorkflows = new NStringEntity(textWorkflows, ContentType.APPLICATION_JSON); restClient.performRequest("PUT", "/tools", Collections.emptyMap(), mappingEntityTools); restClient.performRequest("PUT", "/workflows", Collections.emptyMap(), mappingEntityWorkflows); if (!published.isEmpty()) { publicStateManager.bulkUpsert(published); } } catch (IOException e) { LOG.error("Could not create elastic search index", e); throw new CustomWebApplicationException(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } return Response.ok().entity(published.size()).build(); } return Response.ok().entity(0).build(); }
Source:
public void setLevel(Level level) { }

Target:
public void setLevel(Level level) { this.level = level; }
Source:
public void testIterationStartedWithResize1() { int resizeLimitation = OffHeapConcurrentMap.INITIAL_SIZE - (OffHeapConcurrentMap.INITIAL_SIZE >> 2); WrappedByteArray valueByteArray = new WrappedByteArray(new byte[] { 0, 1, 2, 3, 4, 5 }); for (int i = 0; i < resizeLimitation - 1; ++i) { putInMap(map, valueByteArray); } Iterator<InternalCacheEntry<WrappedBytes, WrappedBytes>> iterator = map.values().iterator(); AssertJUnit.assertTrue(iterator.hasNext()); Assert.assertNotNull(iterator.next()); int entriesFound = 1; putInMap(map, valueByteArray); while (iterator.hasNext()) { Assert.assertNotNull(iterator.next()); entriesFound++; } if (entriesFound != resizeLimitation && entriesFound != resizeLimitation - 1) { AssertJUnit.fail("Iterator returned incorrect number expect " + resizeLimitation + " or " + (resizeLimitation - 1) + ", but got " + entriesFound); } }

Target:
public void testIterationStartedWithResize1() { Set<WrappedBytes> expectedKeys = insertUpToResizeLimitation(); Set<WrappedBytes> results = new HashSet<>(); Iterator<InternalCacheEntry<WrappedBytes, WrappedBytes>> iterator = map.values().iterator(); assertTrue(iterator.hasNext()); assertTrue(results.add(iterator.next().getKey())); putInMap(map, valueByteArray); while (iterator.hasNext()) { assertTrue(results.add(iterator.next().getKey())); } for (WrappedBytes expected : expectedKeys) { assertTrue("Results didn't contain: " + expected, results.contains(expected)); } }
Source:
private void handleBadgeResetPN(Bundle data) { if (data != null && data.containsKey(PUSH_ARG_NOTE_ID)) { removeNotificationWithNoteIdFromSystemBar(this, data); if (sActiveNotificationsMap.size() > 0) { rebuildAndUpdateNotificationsOnSystemBar(data); } } if (data == null || !data.containsKey(PUSH_ARG_NOTE_ID)) { return; } EventBus.getDefault().post(new NotificationEvents.NotificationsChanged()); }

Target:
private void handleBadgeResetPN(Bundle data) { if (data == null || !data.containsKey(PUSH_ARG_NOTE_ID)) { return; } removeNotificationWithNoteIdFromSystemBar(this, data); if (sActiveNotificationsMap.size() > 0) { rebuildAndUpdateNotificationsOnSystemBar(data); } EventBus.getDefault().post(new NotificationEvents.NotificationsChanged()); }
Source:
private void assertEmptyCommit(String projectName, String... refs) throws RepositoryNotFoundException, IOException { Repository repo = git.openRepository(new Project.NameKey(projectName)); RevWalk rw = new RevWalk(repo); try { for (String ref : refs) { RevCommit commit = rw.lookupCommit(repo.getRef(ref).getObjectId()); rw.parseBody(commit); assertEquals("Initial empty repository\n", commit.getFullMessage()); } } finally { rw.release(); repo.close(); } }

Target:
private void assertEmptyCommit(String projectName, String... refs) throws RepositoryNotFoundException, IOException { Repository repo = git.openRepository(new Project.NameKey(projectName)); RevWalk rw = new RevWalk(repo); TreeWalk tw = new TreeWalk(repo); try { for (String ref : refs) { RevCommit commit = rw.lookupCommit(repo.getRef(ref).getObjectId()); rw.parseBody(commit); tw.addTree(commit.getTree()); assertFalse("ref " + ref + " has non empty commit", tw.next()); tw.reset(); } } finally { tw.release(); rw.release(); repo.close(); } }
Source:
public DelimitedStreamReader(InputStream stream, Charset charset, int bufferSize) { this.inputStream = stream; this.charset = charset; this.strBuffer = new byte[bufferSize * 2]; buffer = new byte[bufferSize]; offset = 0; end = 0; }

Target:
public DelimitedStreamReader(InputStream stream, Charset charset, int bufferSize) { Preconditions.checkArgument(bufferSize > 0); this.inputStream = Preconditions.checkNotNull(stream); this.charset = Preconditions.checkNotNull(charset); this.strBuffer = new byte[bufferSize * 2]; buffer = new byte[bufferSize]; offset = 0; end = 0; }
Source:
public boolean shouldAlertUpgrade(ArrayList<RpmVersion> isos, Version hostOs) { boolean alert = false; for (RpmVersion iso: isos) { if (iso.compareTo(hostOs) > 0) { alert = true; break; } } return alert; }

Target:
public boolean shouldAlertUpgrade(ArrayList<RpmVersion> isos, Version hostOs) { boolean alert = false; for (RpmVersion iso: isos) { if (iso.getMajor() == hostOs.getMajor() && iso.compareTo(hostOs) != 0) { alert = true; break; } } return alert; }
Source:
private static void setupHdfs(String hadoopPrefix, String testDir, int numMappers, int numPerMapper) throws IllegalArgumentException, IOException { Configuration config = new Configuration(); config.addResource(new Path(hadoopPrefix+"/conf/core-site.xml")); config.addResource(new Path(hadoopPrefix+"/conf/hdfs-site.xml")); try (FileSystem hdfs = FileSystem.get(config)) { String inputDir = testDir + "/input"; hdfs.mkdirs(new Path(inputDir)); FSDataOutputStream fos = hdfs.create(new Path(inputDir + "/data")); for (int i = 0; i < numMappers; i++) { fos.writeUTF(Integer.toString(numPerMapper) + "\n"); } fos.close(); } }

Target:
private static void setupHdfs(String hadoopPrefix, String testDir, int numMappers, int numPerMapper) throws IllegalArgumentException, IOException { Configuration config = new Configuration(); config.addResource(new Path(hadoopPrefix+"/conf/core-site.xml")); config.addResource(new Path(hadoopPrefix+"/conf/hdfs-site.xml")); @SuppressWarnings("resource") FileSystem hdfs = FileSystem.get(config); String inputDir = testDir+"/input"; hdfs.mkdirs(new Path(inputDir)); try (FSDataOutputStream fos = hdfs.create(new Path(inputDir + "/data"))) { for (int i = 0; i < numMappers; i++) { fos.writeUTF(Integer.toString(numPerMapper) + "\n"); } } }
Source:
private List<Entry> verifyFlowResponse(CompletableFuture<Event> response) throws OdataMetadataEntityNotFoundException, OdataMetadataFieldsException, OdataMetadataResourceNotFound, OdataMetadataFormatException, ODataInvalidFlowResponseException, ClientErrorException { try { CoreEvent event; event = (CoreEvent) response.get(); OdataMetadataManager metadataManager = getMetadataManager(); EntityDefinition entityDefinition = metadataManager.getEntityByName(entity); List<Entry> entries; String payload = CoreEventUtils.getPayloadAsString(event); if(payload != null || payload != "") { entries = Helper.transformJsonToEntryList(payload); } else { throw new ODataInvalidFlowResponseException("The payload of the response should be a valid json."); } int entryNumber = 1; for (Entry entry : entries) { if (entry.getProperties().entrySet().size() > entityDefinition.getProperties().size()) throw new ODataInvalidFlowResponseException("There are absent properties in flow response (entry #" + (entryNumber++) + ")"); for (String propertyName : entry.getProperties().keySet()) { EntityDefinitionProperty entityDefinitionProperty = entityDefinition.findPropertyDefinition(propertyName); if (entityDefinitionProperty == null) throw new ODataInvalidFlowResponseException("Property '" + propertyName + "' was not expected for entity '" + entityDefinition.getName() + "'"); } } return entries; } catch (InterruptedException | ExecutionException e) { throw new ODataInvalidFlowResponseException(e.getMessage()); } }

Target:
private List<Entry> verifyFlowResponse(CompletableFuture<Event> response) throws OdataMetadataEntityNotFoundException, OdataMetadataFieldsException, OdataMetadataResourceNotFound, OdataMetadataFormatException, ODataInvalidFlowResponseException, ClientErrorException { try { CoreEvent event; event = (CoreEvent) response.get(); OdataMetadataManager metadataManager = getMetadataManager(); EntityDefinition entityDefinition = metadataManager.getEntityByName(entity); List<Entry> entries; String payload = CoreEventUtils.getPayloadAsString(event); if(payload == null || payload == "") throw new ODataInvalidFlowResponseException("The payload of the response should be a valid json."); entries = Helper.transformJsonToEntryList(payload); int entryNumber = 1; for (Entry entry : entries) { if (entry.getProperties().entrySet().size() > entityDefinition.getProperties().size()) throw new ODataInvalidFlowResponseException("There are absent properties in flow response (entry #" + (entryNumber++) + ")"); for (String propertyName : entry.getProperties().keySet()) { EntityDefinitionProperty entityDefinitionProperty = entityDefinition.findPropertyDefinition(propertyName); if (entityDefinitionProperty == null) throw new ODataInvalidFlowResponseException("Property '" + propertyName + "' was not expected for entity '" + entityDefinition.getName() + "'"); } } return entries; } catch (InterruptedException | ExecutionException e) { throw new ODataInvalidFlowResponseException(e.getMessage()); } }
Source:
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { DeleteExpiredDataAction.Request request; if (restRequest.hasContent()) { request = DeleteExpiredDataAction.Request.PARSER.apply(restRequest.contentParser(), null); } else { request = new DeleteExpiredDataAction.Request(); String perSecondParam = restRequest.param(DeleteExpiredDataAction.Request.REQUESTS_PER_SECOND.getPreferredName()); if (perSecondParam != null) { try { request.setRequestsPerSecond(Float.parseFloat(perSecondParam)); } catch (NumberFormatException e) { throw new IllegalArgumentException("Failed to parse float parameter [" + DeleteExpiredDataAction.Request.REQUESTS_PER_SECOND.getPreferredName() + "] with value [" + perSecondParam + "]", e); } } String timeoutParam = restRequest.param(DeleteExpiredDataAction.Request.TIMEOUT.getPreferredName()); if (timeoutParam != null) { request.setTimeout(restRequest.paramAsTime(timeoutParam, null)); } } String jobId = restRequest.param(Fields.JOB_ID.getPreferredName()); if (Strings.isNullOrEmpty(jobId) == false) { request.setJobId(jobId); } return channel -> client.execute(DeleteExpiredDataAction.INSTANCE, request, new RestToXContentListener<>(channel)); }

Target:
protected RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { DeleteExpiredDataAction.Request request; if (restRequest.hasContent()) { request = DeleteExpiredDataAction.Request.PARSER.apply(restRequest.contentParser(), null); } else { request = new DeleteExpiredDataAction.Request(); String perSecondParam = restRequest.param(DeleteExpiredDataAction.Request.REQUESTS_PER_SECOND.getPreferredName()); if (perSecondParam != null) { try { request.setRequestsPerSecond(Float.parseFloat(perSecondParam)); } catch (NumberFormatException e) { throw new IllegalArgumentException("Failed to parse float parameter [" + DeleteExpiredDataAction.Request.REQUESTS_PER_SECOND.getPreferredName() + "] with value [" + perSecondParam + "]", e); } } String timeoutParam = restRequest.param(DeleteExpiredDataAction.Request.TIMEOUT.getPreferredName()); if (timeoutParam != null) { request.setTimeout(restRequest.paramAsTime(timeoutParam, null)); } } String jobId = restRequest.param(Job.ID.getPreferredName()); if (Strings.isNullOrEmpty(jobId) == false) { request.setJobId(jobId); } return channel -> client.execute(DeleteExpiredDataAction.INSTANCE, request, new RestToXContentListener<>(channel)); }
Source:
private static TableDefinition partitionedTableWithVariablePartitionsDefinition() { String tableName = "partitioned_table_with_too_many_partitions"; String createTableDdl = "CREATE TABLE %NAME%(col INT) " + "PARTITIONED BY (part_col INT) " + "STORED AS ORC"; return HiveTableDefinition.builder(tableName) .setCreateTableDDLTemplate(createTableDdl) .setNoData() .build(); }

Target:
private static TableDefinition partitionedTableWithVariablePartitionsDefinition() { String createTableDdl = "CREATE TABLE %NAME%(col INT) " + "PARTITIONED BY (part_col INT) " + "STORED AS ORC"; return HiveTableDefinition.builder(PARTITIONED_TABLE_WITH_VARIABLE_PARTITIONS) .setCreateTableDDLTemplate(createTableDdl) .setNoData() .build(); }
Source:
public synchronized boolean isCovered(IResource resource, int depth) { IPath fullPath = resource.getFullPath(); for (Object element : deepFolders) { IResource deepFolder = (IResource) element; if (deepFolder.getFullPath().isPrefixOf(fullPath)) { return true; } } if (resource.getType() == IResource.FILE) { return (shallowFolders.contains(resource.getParent()) || files.contains(resource)); } switch (depth) { case IResource.DEPTH_ONE: return (shallowFolders.contains(resource)); case IResource.DEPTH_ZERO: return (shallowFolders.contains(resource.getParent()) || zeroFolders.contains(resource)); } return false; }

Target:
public synchronized boolean isCovered(IResource resource, int depth) { IPath fullPath = resource.getFullPath(); for (IResource deepFolder : deepFolders) { if (deepFolder.getFullPath().isPrefixOf(fullPath)) { return true; } } if (resource.getType() == IResource.FILE) { return (shallowFolders.contains(resource.getParent()) || files.contains(resource)); } switch (depth) { case IResource.DEPTH_ONE: return (shallowFolders.contains(resource)); case IResource.DEPTH_ZERO: return (shallowFolders.contains(resource.getParent()) || zeroFolders.contains(resource)); } return false; }
Source:
void setBackgroundColor (long context, long handle, GdkRGBA rgba) { if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { String cssRGBA = rgba != null ? display.gtk_rgba_to_css_string (rgba) : "rgba(0,0,0,0)"; background = rgba; String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "notebook header" : "GtkNotebook"; String css = name + " {background-color: " + cssRGBA + ";}"; System.out.println(css); cssBackground = css; String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND); gtk_css_provider_load_from_css (context, finalCss); } else { OS.gtk_widget_override_background_color (handle, OS.GTK_STATE_FLAG_NORMAL, rgba); } }

Target:
void setBackgroundColor (long context, long handle, GdkRGBA rgba) { if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { String cssRGBA = rgba != null ? display.gtk_rgba_to_css_string (rgba) : "rgba(0,0,0,0)"; background = rgba; String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "notebook header" : "GtkNotebook"; String css = name + " {background-color: " + cssRGBA + ";}"; cssBackground = css; String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND); gtk_css_provider_load_from_css (context, finalCss); } else { OS.gtk_widget_override_background_color (handle, OS.GTK_STATE_FLAG_NORMAL, rgba); } }
Source:
public void scenario1() throws IOException { final String testObj = ingestObj("/rest/webacl_box1"); final String acl1 = ingestAcl("fedoraAdmin", "/acls/01/acl.ttl", "/acls/01/authorization.ttl"); linkToAcl(testObj, acl1); final String aclLink = Link.fromUri(acl1).rel("acl").build().toString(); logger.debug("Anonymous can't read"); final HttpGet request = getObjMethod(testObj.replace(serverAddress, "")); assertEquals(HttpStatus.SC_FORBIDDEN, getStatus(request)); logger.debug("Can username 'smith123' read " + testObj); setAuth(request, "smith123"); try (final CloseableHttpResponse response = execute(request)) { assertEquals(HttpStatus.SC_OK, getStatus(response)); final Optional<String> header = Arrays.asList(response.getHeaders("Link")).stream().map(Header::getValue) .filter(aclLink::equals).findFirst(); assertTrue("Missing Link header", header.isPresent()); } logger.debug("Can username 'smith123' read a child of {}", testObj); final String childObj = ingestObj("/rest/webacl_box1/child"); final HttpGet getReq = getObjMethod(childObj.replace(serverAddress, "")); setAuth(getReq, "smith123"); try (final CloseableHttpResponse response = execute(getReq)) { assertEquals(HttpStatus.SC_OK, getStatus(response)); final Optional<String> header = Arrays.asList(response.getHeaders("Link")).stream().map(Header::getValue) .filter(aclLink::equals).findFirst(); assertTrue("Missing Link header to ACL on parent", header.isPresent()); } }

Target:
public void scenario1() throws IOException { final String testObj = ingestObj("/rest/webacl_box1"); final String acl1 = ingestAcl("fedoraAdmin", "/acls/01/acl.ttl", "/acls/01/authorization.ttl"); linkToAcl(testObj, acl1); final String aclLink = Link.fromUri(acl1).rel("acl").build().toString(); final HttpGet request = getObjMethod(testObj.replace(serverAddress, "")); assertEquals("Anonymous can read " + testObj, HttpStatus.SC_FORBIDDEN, getStatus(request)); setAuth(request, "smith123"); try (final CloseableHttpResponse response = execute(request)) { assertEquals("User 'smith123' can't read" + testObj, HttpStatus.SC_OK, getStatus(response)); final Optional<String> header = stream(response.getHeaders("Link")).map(Header::getValue) .filter(aclLink::equals).findFirst(); assertTrue("Missing Link header", header.isPresent()); } final String childObj = ingestObj("/rest/webacl_box1/child"); final HttpGet getReq = getObjMethod(childObj.replace(serverAddress, "")); setAuth(getReq, "smith123"); try (final CloseableHttpResponse response = execute(getReq)) { assertEquals("User 'smith123' can't read child of " + testObj, HttpStatus.SC_OK, getStatus(response)); final Optional<String> header = stream(response.getHeaders("Link")).map(Header::getValue) .filter(aclLink::equals).findFirst(); assertTrue("Missing Link header to ACL on parent", header.isPresent()); } }
Source:
public void handle_missing_node() throws Exception { doThrow(new NodeCommandException("Exception Message", new IOException())).when(eslintBridgeServerMock).startServerLazily(any()); AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class); EslintBasedRulesSensor eslintBasedRulesSensor = new EslintBasedRulesSensor(checkFactory(ESLINT_BASED_RULE), eslintBridgeServerMock, analysisWarnings); eslintBasedRulesSensor.execute(context); assertThat(logTester.logs(LoggerLevel.ERROR)).contains("Exception Message"); verify(analysisWarnings).addUnique("Some eslint-based rules were not executed. Exception Message"); }

Target:
public void handle_missing_node() throws Exception { doThrow(new NodeCommandException("Exception Message", new IOException())).when(eslintBridgeServerMock).startServerLazily(any()); AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class); EslintBasedRulesSensor eslintBasedRulesSensor = new EslintBasedRulesSensor(checkFactory(ESLINT_BASED_RULE), eslintBridgeServerMock, analysisWarnings); eslintBasedRulesSensor.execute(context); assertThat(logTester.logs(LoggerLevel.ERROR)).contains("Exception Message"); verify(analysisWarnings).addUnique("Eslint-based rules were not executed. Exception Message"); }
Source:
protected URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException { File target = map(sum1, sum2); File parent = target.getParentFile(); parent.mkdirs(); try { File tmp = File.createTempFile(target.getName(),"tmp", parent); try { RemoteOutputStream o = new RemoteOutputStream(new FileOutputStream(tmp)); try { LOGGER.log(Level.FINE, String.format("Retrieving jar file %16X%16X",sum1,sum2)); getJarLoader(channel).writeJarTo(sum1, sum2, o); } finally { o.close(); } tmp.renameTo(target); if (target.exists()) { Checksum expected = new Checksum(sum1, sum2); Checksum actual = Checksum.forFile(target); if (!expected.equals(actual)) { throw new IOException("Checksum of retrieved jar doesn't match: " + target); } return target.toURI().toURL(); } throw new IOException("Unable to create "+target+" from "+tmp); } finally { tmp.delete(); } } catch (IOException e) { throw (IOException)new IOException("Failed to write to "+target).initCause(e); } }

Target:
protected URL retrieve(Channel channel, long sum1, long sum2) throws IOException, InterruptedException { File target = map(sum1, sum2); File parent = target.getParentFile(); if (target.exists()) { LOGGER.fine(String.format("Jar file already exists: %16X%16X", sum1, sum2)); return target.toURI().toURL(); } parent.mkdirs(); try { File tmp = File.createTempFile(target.getName(),"tmp", parent); try { RemoteOutputStream o = new RemoteOutputStream(new FileOutputStream(tmp)); try { LOGGER.log(Level.FINE, String.format("Retrieving jar file %16X%16X",sum1,sum2)); getJarLoader(channel).writeJarTo(sum1, sum2, o); } finally { o.close(); } Checksum expected = new Checksum(sum1, sum2); Checksum actual = Checksum.forFile(tmp); if (!expected.equals(actual)) { throw new IOException(String.format( "Incorrect checksum of retrieved jar: %s\nExpected: %s\nActual: %s", tmp.getAbsolutePath(), expected, actual)); } if (!tmp.renameTo(target)) { if (!target.exists()) { throw new IOException("Unable to create " + target + " from " + tmp); } actual = Checksum.forFile(target); if (!expected.equals(actual)) { throw new IOException(String.format( "Incorrect checksum of jar: %s\nExpected: %s\nActual: %s", target.getAbsolutePath(), expected, actual)); } } return target.toURI().toURL(); } finally { tmp.delete(); } } catch (IOException e) { throw (IOException)new IOException("Failed to write to "+target).initCause(e); } }
Source:
private SearchOptions parseFilters(String filterJson) { if (filterJson != null && StringUtils.isNotEmpty(filterJson) && !filterJson.equals("{}")) { try { JsonObject jsonObject = (JsonObject) new JsonParser().parse(filterJson); String name = (jsonObject.get(NAME) != null) ? jsonObject.get(NAME).getAsString() : EMPTY_STRING; String email = (jsonObject.get(EMAIL) != null) ? jsonObject.get(EMAIL).getAsString() : EMPTY_STRING; String phone = (jsonObject.get(PHONE) != null) ? jsonObject.get(PHONE).getAsString() : EMPTY_STRING; return SearchOptions.builder().name(name).email(email).phone(phone).build(); } catch (JsonSyntaxException e) { LOGGER.error("Cannot read filters from json", e); } } return SearchOptions.builder().name(EMPTY_STRING).email(EMPTY_STRING).phone(EMPTY_STRING).build(); }

Target:
private SearchOptions parseFilters(String filterJson) { if (StringUtils.isNotEmpty(filterJson) && !filterJson.equals(EMPTY_JSON)) { try { JsonObject jsonObject = (JsonObject) new JsonParser().parse(filterJson); String name = getValueFromJsonObjectByMemberName(jsonObject, NAME); String email = getValueFromJsonObjectByMemberName(jsonObject, EMAIL); String phone = getValueFromJsonObjectByMemberName(jsonObject, PHONE); return SearchOptions.builder().name(name).email(email).phone(phone).build(); } catch (JsonSyntaxException e) { LOGGER.error("Cannot read filters from json", e); } } return SearchOptions.builder().name(StringUtils.EMPTY).email(StringUtils.EMPTY).phone(StringUtils.EMPTY).build(); }
Source:
public static MergeSourceViewer extractMergeSourceViewer(ICompareNavigator aNavigator, boolean aIsLeftPane) { if (aNavigator instanceof CompareEditorInputNavigator) { final Object[] panes = ((CompareEditorInputNavigator) aNavigator).getPanes(); for (Object pane : panes) { if (pane instanceof CompareContentViewerSwitchingPane) { Viewer viewer = ((CompareContentViewerSwitchingPane) pane).getViewer(); if (viewer instanceof TextMergeViewer) { TextMergeViewer textViewer = (TextMergeViewer) viewer; Class textViewerClass = textViewer.getClass(); if (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)) { do { textViewerClass = textViewerClass.getSuperclass(); if (textViewerClass.getName().equals(DEFAULT_OBJECT_CLASS_NAME)) { break; } } while (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)); } try { Field field; if (aIsLeftPane) { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_LEFT); } else { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_RIGHT); } field.setAccessible(true); MergeSourceViewer sourceViewer = (MergeSourceViewer) field.get(textViewer); return sourceViewer; } catch (SecurityException e) { } catch (NoSuchFieldException e) { } catch (IllegalArgumentException e) { } catch (IllegalAccessException e) { } } } } } return null; }

Target:
public static MergeSourceViewer extractMergeSourceViewer(ICompareNavigator aNavigator, boolean aIsLeftPane) { if (aNavigator instanceof CompareEditorInputNavigator) { final Object[] panes = ((CompareEditorInputNavigator) aNavigator).getPanes(); for (Object pane : panes) { if (pane instanceof CompareContentViewerSwitchingPane) { Viewer viewer = ((CompareContentViewerSwitchingPane) pane).getViewer(); if (viewer instanceof TextMergeViewer) { TextMergeViewer textViewer = (TextMergeViewer) viewer; Class textViewerClass = textViewer.getClass(); if (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)) { do { textViewerClass = textViewerClass.getSuperclass(); if (textViewerClass.getName().equals(DEFAULT_OBJECT_CLASS_NAME)) { break; } } while (!textViewerClass.getName().equals(COMPARE_EDITOR_TEXT_CLASS_NAME)); } try { Field field; if (aIsLeftPane) { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_LEFT); } else { field = textViewerClass.getDeclaredField(COMPARE_EDITOR_TEXT_FIELD_RIGHT); } field.setAccessible(true); MergeSourceViewer sourceViewer = (MergeSourceViewer) field.get(textViewer); return sourceViewer; } catch (SecurityException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } catch (NoSuchFieldException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } catch (IllegalArgumentException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } catch (IllegalAccessException e) { StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, "Exception raised: " + e.toString())); } } } } } return null; }
Source:
public static NodeProperty<Node> mkNodeProperty(int number) { switch (number) { case 1: return new NodePropertyOne(); case 2: return new NodePropertyOne(); case 3: return new NodePropertyOne(); default: throw new IllegalArgumentException("Need 1, 2 or 3: Got " + number); } }

Target:
public static NodeProperty<Node> mkNodeProperty(int number) { switch (number) { case 1: return new NodePropertyOne(); case 2: return new NodePropertyTwo(); case 3: return new NodePropertyThree(); default: throw new IllegalArgumentException("Need 1, 2 or 3: Got " + number); } }
Source:
public void testCommentContentToken() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IllegalTokenCheck.class); checkConfig.addAttribute("tokens", "COMMENT_CONTENT"); final String path = getPath("InputIllegalTokens.java"); final String lineSeparator; if (new FileText(new File(path), StandardCharsets.UTF_8.name()) .getFullText().chars().anyMatch(character -> character == '\r')) { lineSeparator = "\r\n"; } else { lineSeparator = "\n"; } final String[] expected = { "3:3: " + getCheckMessage(MSG_KEY, JavadocUtil.escapeAllControlChars( "*" + lineSeparator + " * Test for illegal tokens" + lineSeparator + " ")), "31:29: " + getCheckMessage(MSG_KEY, JavadocUtil.escapeAllControlChars( " some comment href" + lineSeparator)), "35:28: " + getCheckMessage(MSG_KEY, JavadocUtil.escapeAllControlChars( " some a href" + lineSeparator)), }; verify(checkConfig, path, expected); }

Target:
public void testCommentContentToken() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IllegalTokenCheck.class); checkConfig.addAttribute("tokens", "COMMENT_CONTENT"); final String path = getPath("InputIllegalTokens.java"); final String lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); final String[] expected = { "3:3: " + getCheckMessage(MSG_KEY, JavadocUtil.escapeAllControlChars( "*" + lineSeparator + " * Test for illegal tokens" + lineSeparator + " ")), "31:29: " + getCheckMessage(MSG_KEY, JavadocUtil.escapeAllControlChars( " some comment href" + lineSeparator)), "35:28: " + getCheckMessage(MSG_KEY, JavadocUtil.escapeAllControlChars( " some a href" + lineSeparator)), }; verify(checkConfig, path, expected); }