auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deleteAllCoursesCascade(List<InstructorAttributes> instructorList) { Assumption.assertNotNull("Supplied parameter was null", instructorList); List<String> recoveryCourseIdList = new ArrayList<>(); for (InstructorAttributes instructor : instructorList) { if (coursesDb.getCourse(instructor.courseId).isCourseDeleted()) { recoveryCourseIdList.add(instructor.courseId); } } for (String courseId : recoveryCourseIdList) { studentsLogic.deleteStudentsForCourse(courseId); instructorsLogic.deleteInstructorsForCourse(courseId); feedbackSessionsLogic.deleteFeedbackSessionsForCourseCascade(courseId); coursesDb.deleteCourse(courseId); } }

Target:
public void deleteAllCoursesCascade(List<InstructorAttributes> instructorList) { Assumption.assertNotNull("Supplied parameter was null", instructorList); List<String> recoveryCourseIdList = instructorList.stream() .filter(instructor -> coursesDb.getCourse(instructor.courseId).isCourseDeleted()) .map(InstructorAttributes::getCourseId) .collect(Collectors.toList()); for (String courseId : recoveryCourseIdList) { deleteCourseCascade(courseId); } }
Source:
public MiscOkResponse(String content) { super("\\"); this.content = content; }

Target:
public MiscOkResponse(String content) { super(URL); this.content = content; }
Source:
public boolean isSyncCommand(String command) { Vector<Entry> entries = this.getEntriesForCommand(command); return entries.size() == 1 && entries.elementAt(0) instanceof SyncEntry; }

Target:
public boolean isSyncCommand(String command) { Vector<Entry> entries = this.getEntriesForCommand(command); return entries.size() == 1 && entries.elementAt(0).isSync(); }
Source:
public boolean isConnectionValid( Connection connection, int timeout ) throws SQLException { if (jdbcDriverInfo().jdbcMajorVersion() >= 4) { return connection.isValid(timeout); } String query = checkConnectionQuery(); if (query != null) { try (Statement statement = connection.createStatement()) { boolean hasResultSet = statement.execute(query); if (hasResultSet) { statement.getResultSet().close(); } } } return true; }

Target:
public boolean isConnectionValid( Connection connection, int timeout ) throws SQLException { if (jdbcDriverInfo().jdbcMajorVersion() >= 4) { return connection.isValid(timeout); } String query = checkConnectionQuery(); if (query != null) { try (Statement statement = connection.createStatement()) { if (statement.execute(query)) { try (ResultSet rs = statement.getResultSet()) { } } } } return true; }
Source:
protected final void processAnnotationOnClass(MethodMetadata data, Class<?> targetType) { Arrays.stream(targetType.getAnnotations()) .forEach(annotation -> classAnnotationProcessors .getOrDefault(annotation.annotationType(), ClassAnnotationProcessor.DO_NOTHING) .process(annotation, data)); }

Target:
protected final void processAnnotationOnClass(MethodMetadata data, Class<?> targetType) { Arrays.stream(targetType.getAnnotations()) .forEach(annotation -> classAnnotationProcessors.stream() .filter(processor -> processor.test(annotation)) .forEach(processor -> processor.process(annotation, data))); }
Source:
private void resolveDeltas(DeltaVisit visit, final int type, ObjectTypeAndSize info, ProgressMonitor progress) throws IOException { do { progress.update(1); info = openDatabase(visit.delta, info); switch (info.type) { case Constants.OBJ_OFS_DELTA: case Constants.OBJ_REF_DELTA: break; default: throw new IOException(MessageFormat.format( JGitText.get().unknownObjectType, info.type)); } visit.data = BinaryDelta.apply(visit.parent.data, inflateAndReturn(Source.DATABASE, info.size)); if (!checkCRC(visit.delta.crc)) throw new IOException(MessageFormat.format( JGitText.get().corruptionDetectedReReadingAt, visit.delta.position)); objectDigest.update(Constants.encodedTypeString(type)); objectDigest.update((byte) ' '); objectDigest.update(Constants.encodeASCII(visit.data.length)); objectDigest.update((byte) 0); objectDigest.update(visit.data); tempObjectId.fromRaw(objectDigest.digest(), 0); verifySafeObject(tempObjectId, type, visit.data, visit.data.length); PackedObjectInfo oe; oe = newInfo(tempObjectId, visit.delta, visit.parent.id); oe.setOffset(visit.delta.position); onInflatedObjectData(oe, type, visit.data); addObjectAndTrack(oe); visit.id = oe; visit.nextChild = firstChildOf(oe); visit = visit.next(); } while (visit != null); }

Target:
private void resolveDeltas(DeltaVisit visit, final int type, ObjectTypeAndSize info, ProgressMonitor progress) throws IOException { do { progress.update(1); info = openDatabase(visit.delta, info); switch (info.type) { case Constants.OBJ_OFS_DELTA: case Constants.OBJ_REF_DELTA: break; default: throw new IOException(MessageFormat.format( JGitText.get().unknownObjectType, info.type)); } byte[] delta = inflateAndReturn(Source.DATABASE, info.size); checkIfTooLarge(BinaryDelta.getResultSize(delta)); visit.data = BinaryDelta.apply(visit.parent.data, delta); delta = null; if (!checkCRC(visit.delta.crc)) throw new IOException(MessageFormat.format( JGitText.get().corruptionDetectedReReadingAt, visit.delta.position)); objectDigest.update(Constants.encodedTypeString(type)); objectDigest.update((byte) ' '); objectDigest.update(Constants.encodeASCII(visit.data.length)); objectDigest.update((byte) 0); objectDigest.update(visit.data); tempObjectId.fromRaw(objectDigest.digest(), 0); verifySafeObject(tempObjectId, type, visit.data); PackedObjectInfo oe; oe = newInfo(tempObjectId, visit.delta, visit.parent.id); oe.setOffset(visit.delta.position); onInflatedObjectData(oe, type, visit.data); addObjectAndTrack(oe); visit.id = oe; visit.nextChild = firstChildOf(oe); visit = visit.next(); } while (visit != null); }
Source:
public void registerIn(final ActionRegistry registry) { registry.register(ValueChangedCommand.class, new CommandHandler<ValueChangedCommand>() { @Override public void handleCommand(final ValueChangedCommand command, final List response) { final ServerAttribute attribute = getServerModelStore().findAttributeById(command.getAttributeId()); if (attribute != null) { if (! Objects.equals(attribute.getValue(), command.getOldValue())) { LOG.debug("S: updating attribute with id '{}' to new value '{}' even though its old command value '{}' does not conform to the old value of '{}'. Client overrules server.", command.getAttributeId(), command.getNewValue(), command.getOldValue(), attribute.getValue()); } attribute.silently(new Runnable() { @Override public void run() { attribute.setValue(command.getNewValue()); } }); } else { LOG.info("S: cannot find attribute with id '{}' to change value from '{}' to '{}'.", command.getAttributeId(), command.getOldValue(), command.getNewValue()); } } }); }

Target:
public void registerIn(final ActionRegistry registry) { registry.register(ValueChangedCommand.class, new CommandHandler<ValueChangedCommand>() { @Override public void handleCommand(final ValueChangedCommand command, final List response) { final ServerAttribute attribute = getServerModelStore().findAttributeById(command.getAttributeId()); if (attribute != null) { if (! Objects.equals(attribute.getValue(), command.getOldValue())) { LOG.warn("S: updating attribute with id '{}' to new value '{}' even though its old command value '{}' does not conform to the old value of '{}'. Client overrules server.", command.getAttributeId(), command.getNewValue(), command.getOldValue(), attribute.getValue()); } attribute.silently(new Runnable() { @Override public void run() { attribute.setValue(command.getNewValue()); } }); } else { LOG.error("S: cannot find attribute with id '{}' to change value from '{}' to '{}'.", command.getAttributeId(), command.getOldValue(), command.getNewValue()); } } }); }
Source:
public void clearHost(VDS host) { synchronized (this) { if (!resourcesByHost.containsKey(host.getId())) { return; } log.debug("Clearing pending resources for host {}", host.getId()); resourcesByHost.compute(host.getId(), (hostId, resources) -> { for (PendingResource resource : resources) { resourcesByVm.computeIfPresent(resource.getVm(), (vmId, vmResources) -> { vmResources.remove(resource); return vmResources; }); pendingResources.remove(resource); } resources.clear(); return resources; }); } notifyHostManagers(host.getId()); }

Target:
public void clearHost(VDS host) { synchronized (this) { if (!resourcesByHost.containsKey(host.getId())) { return; } log.debug("Clearing pending resources for host {}", host.getId()); resourcesByHost.compute(host.getId(), (hostId, resources) -> { for (PendingResource resource : resources) { removeFromSetMap(resourcesByVm, resource.getVm(), resource); pendingResources.remove(resource); } resources.clear(); return resources; }); } notifyHostManagers(host.getId()); }
Source:
void schedule(final Project.NameKey project, final String ref, final URIish uri) { try { boolean visible = threadScoper.scope(new Callable<Boolean>(){ @Override public Boolean call() throws NoSuchProjectException { return controlFor(project).isVisible(); } }).call(); if (!visible) { return; } } catch (NoSuchProjectException err) { ReplicationQueue.log.error(String.format( "source project %s not available", project), err); return; } catch (Exception e) { throw Throwables.propagate(e); } if (!replicatePermissions) { PushOne e; synchronized (pending) { e = pending.get(uri); } if (e == null) { Repository git; try { git = gitManager.openRepository(project); } catch (IOException err) { ReplicationQueue.log.error(String.format( "source project %s not available", project), err); return; } try { Ref head = git.getRef(Constants.HEAD); if (head != null && head.isSymbolic() && GitRepositoryManager.REF_CONFIG.equals(head.getLeaf().getName())) { return; } } catch (IOException err) { ReplicationQueue.log.error(String.format( "cannot check type of project %s", project), err); return; } finally { git.close(); } } } synchronized (inflight) { synchronized (pending) { PushOne e = inflight.get(uri); if (e != null) { } e = pending.get(uri); if (e == null) { e = opFactory.create(project, uri); pool.schedule(e, delay, TimeUnit.SECONDS); pending.put(uri, e); } e.addRef(ref); } } }

Target:
void schedule(final Project.NameKey project, final String ref, final URIish uri) { try { boolean visible = threadScoper.scope(new Callable<Boolean>(){ @Override public Boolean call() throws NoSuchProjectException { return controlFor(project).isVisible(); } }).call(); if (!visible) { return; } } catch (NoSuchProjectException err) { ReplicationQueue.log.error(String.format( "source project %s not available", project), err); return; } catch (Exception e) { throw Throwables.propagate(e); } if (!replicatePermissions) { PushOne e; synchronized (stateLock) { e = pending.get(uri); } if (e == null) { Repository git; try { git = gitManager.openRepository(project); } catch (IOException err) { ReplicationQueue.log.error(String.format( "source project %s not available", project), err); return; } try { Ref head = git.getRef(Constants.HEAD); if (head != null && head.isSymbolic() && GitRepositoryManager.REF_CONFIG.equals(head.getLeaf().getName())) { return; } } catch (IOException err) { ReplicationQueue.log.error(String.format( "cannot check type of project %s", project), err); return; } finally { git.close(); } } } synchronized (stateLock) { PushOne e = pending.get(uri); if (e == null) { e = opFactory.create(project, uri); pool.schedule(e, delay, TimeUnit.SECONDS); pending.put(uri, e); } e.addRef(ref); } }
Source:
private void addTermAndAncestors(Term t, Observations o) { try { int id = this.boqa.getTermIndex(t); o.observations[id] = true; this.boqa.activateAncestors(id, o.observations); } catch (NullPointerException e) { this.logger.warn(String.format( "Unable to find the boqa index of '%s'.", t)); } }

Target:
private boolean addTermAndAncestors(Term t, Observations o) { try { int id = this.boqa.getTermIndex(t); o.observations[id] = true; this.boqa.activateAncestors(id, o.observations); } catch (Exception e) { this.logger.warn("Unable to find the boqa index of [{}].", t); return false; } return true; }
Source:
Mono<Void> downloadToFile(String filePath, BlobRange range, Integer blockSize, ReliableDownloadOptions options, BlobAccessConditions accessConditions, boolean rangeGetContentMD5, Context context) { if (blockSize != null && (blockSize < 0 || blockSize > BLOB_MAX_DOWNLOAD_BLOCK_SIZE)) { throw logger.logExceptionAsError(new IllegalArgumentException("Block size should not exceed 100MB")); } return Mono.using(() -> downloadToFileResourceSupplier(filePath), channel -> Mono.justOrEmpty(range) .switchIfEmpty(getFullBlobRange(accessConditions)) .flatMapMany(rg -> Flux.fromIterable(sliceBlobRange(rg, blockSize))) .flatMap(chunk -> this.download(chunk, accessConditions, rangeGetContentMD5, context) .subscribeOn(Schedulers.elastic()) .flatMap(dar -> FluxUtil.writeFile(dar.body(options), channel, chunk.offset() - (range == null ? 0 : range.offset())))) .then(), this::downloadToFileCleanup); }

Target:
Mono<Void> downloadToFile(String filePath, BlobRange range, Integer blockSize, ReliableDownloadOptions options, BlobAccessConditions accessConditions, boolean rangeGetContentMD5, Context context) { if (blockSize != null) { Utility.assertInBounds("blockSize", blockSize, 0, BLOB_MAX_DOWNLOAD_BLOCK_SIZE); } return Mono.using(() -> downloadToFileResourceSupplier(filePath), channel -> Mono.justOrEmpty(range) .switchIfEmpty(getFullBlobRange(accessConditions)) .flatMapMany(rg -> Flux.fromIterable(sliceBlobRange(rg, blockSize))) .flatMap(chunk -> this.download(chunk, accessConditions, rangeGetContentMD5, context) .subscribeOn(Schedulers.elastic()) .flatMap(dar -> FluxUtil.writeFile(dar.body(options), channel, chunk.offset() - (range == null ? 0 : range.offset())))) .then(), this::downloadToFileCleanup); }
Source:
public void test_stats_collection() throws Exception { sendManagementCallToCollectStats("GetCounter", "InexistingRate", "AllCacheGetCount"); Cache<String, String> cache1 = cacheManager.getCache("cache-1", String.class, String.class); cache1.put("key1", "val"); cache1.put("key2", "val"); cache1.get("key1"); cache1.get("key2"); ContextualStatistics[] stats = waitForNextStats(); System.out.println(Arrays.toString(stats)); assertThat(stats.length, equalTo(1)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(Counter.class, "GetCounter").getValue(), equalTo(2L)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(CounterHistory.class, "AllCacheGetCount").getValue().length, equalTo(0)); cache1.get("key1"); cache1.get("key2"); stats = waitForNextStats(); System.out.println(Arrays.toString(stats)); assertThat(stats.length, equalTo(1)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(Counter.class, "GetCounter").getValue(), equalTo(4L)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(CounterHistory.class, "AllCacheGetCount").getValue().length, equalTo(1)); assertThat(stats[0].getStatistic(CounterHistory.class, "AllCacheGetCount").getValue()[0].getValue(), equalTo(4L)); }

Target:
public void test_stats_collection() throws Exception { sendManagementCallToCollectStats("GetCounter", "InexistingRate", "AllCacheGetCount"); Cache<String, String> cache1 = cacheManager.getCache("cache-1", String.class, String.class); cache1.put("key1", "val"); cache1.put("key2", "val"); cache1.get("key1"); cache1.get("key2"); ContextualStatistics[] stats = waitForNextStats(); assertThat(stats.length, equalTo(1)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(Counter.class, "GetCounter").getValue(), equalTo(2L)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(CounterHistory.class, "AllCacheGetCount").getValue().length, equalTo(0)); cache1.get("key1"); cache1.get("key2"); stats = waitForNextStats(); assertThat(stats.length, equalTo(1)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(Counter.class, "GetCounter").getValue(), equalTo(4L)); assertThat(stats[0].getContext().get("cacheName"), equalTo("cache-1")); assertThat(stats[0].getStatistic(CounterHistory.class, "AllCacheGetCount").getValue().length, equalTo(1)); assertThat(stats[0].getStatistic(CounterHistory.class, "AllCacheGetCount").getValue()[0].getValue(), equalTo(4L)); }
Source:
public RPropUpdater() { this(DFLT_LEARNING_RATE, DFLT_INIT_UPDATE, DFLT_ACCELERATION_RATE, DFLT_DEACCELERATION_RATE); }

Target:
public RPropUpdater() { this(DFLT_INIT_UPDATE, DFLT_ACCELERATION_RATE, DFLT_DEACCELERATION_RATE); }
Source:
public void visitJavadocToken(DetailNode ast) { String firstSentence = getFirstSentence(ast); final int endOfSentence = firstSentence.lastIndexOf(period); boolean temp = true; if (period.equals(PERIOD)) { temp = checkPeriodAtEnd(ast); } if (endOfSentence == -1 && temp) { if (!firstSentence.trim().startsWith(INHERIT_DOC)) { log(ast.getLineNumber(), MSG_SUMMARY_FIRST_SENTENCE); } } else { if(endOfSentence != -1) { firstSentence = firstSentence.substring(0, endOfSentence); if (containsForbiddenFragment(firstSentence)) { log(ast.getLineNumber(), MSG_SUMMARY_JAVADOC); } } } }

Target:
public void visitJavadocToken(DetailNode ast) { String firstSentence = getFirstSentence(ast); final int endOfSentence = firstSentence.lastIndexOf(period); final String summaryDoc = getSummarySentence(ast); if (summaryDoc.isEmpty()) { log(ast.getLineNumber(), MSG_SUMMARY_JAVADOC_MISSING); } else if (!period.isEmpty() && !summaryDoc.contains(period) && !summaryDoc.equals(INHERIT_DOC)) { log(ast.getLineNumber(), MSG_SUMMARY_FIRST_SENTENCE); } if (endOfSentence != -1) { firstSentence = firstSentence.substring(0, endOfSentence); if (containsForbiddenFragment(firstSentence)) { log(ast.getLineNumber(), MSG_SUMMARY_JAVADOC); } } }
Source:
private synchronized StreamObserver<RpcRequestProto> getRpcHandler(String location, String systemId) { if (!Strings.isNullOrEmpty(systemId)) { return rpcHandlerByMinionId.get(systemId); } Collection<StreamObserver<RpcRequestProto>> streamObservers = rpcHandlerByLocation.get(location); if (streamObservers.isEmpty()) { return null; } Iterator<StreamObserver<RpcRequestProto>> iterator = rpcHandlerIteratorMap.get(streamObservers); if (iterator == null) { iterator = Iterables.cycle(streamObservers).iterator(); rpcHandlerIteratorMap.put(streamObservers, iterator); } return iterator.next(); }

Target:
public synchronized StreamObserver<RpcRequestProto> getRpcHandler(String location, String systemId) { if (!Strings.isNullOrEmpty(systemId)) { return rpcHandlerByMinionId.get(systemId); } Iterator<StreamObserver<RpcRequestProto>> iterator = rpcHandlerIteratorMap.get(location); if (iterator == null) { return null; } return iterator.next(); }
Source:
public void testWithCacheWithNoViolation() throws Exception { final Checker checker = new Checker(); final PackageObjectFactory factory = new PackageObjectFactory( new HashSet<>(), Thread.currentThread().getContextClassLoader()); checker.setModuleFactory(factory); checker.configure(createCheckConfig(TranslationCheck.class)); final File cacheFile = temporaryFolder.newFile(); checker.setCacheFile(cacheFile.getPath()); checker.setupChild(createCheckConfig(TranslationCheck.class)); final File file = temporaryFolder.newFile("file.java"); final List<File> files = new ArrayList<>(); files.add(file); checker.process(files); final Properties cache = new Properties(); cache.load(Files.newBufferedReader(cacheFile.toPath())); assertTrue(cache.isEmpty()); }

Target:
public void testWithCacheWithNoViolation() throws Exception { final Checker checker = new Checker(); final PackageObjectFactory factory = new PackageObjectFactory( new HashSet<>(), Thread.currentThread().getContextClassLoader()); checker.setModuleFactory(factory); checker.configure(createCheckConfig(TranslationCheck.class)); final File cacheFile = temporaryFolder.newFile(); checker.setCacheFile(cacheFile.getPath()); checker.setupChild(createCheckConfig(TranslationCheck.class)); final File tmpFile = temporaryFolder.newFile("file.java"); final List<File> files = new ArrayList<>(1); files.add(tmpFile); checker.process(files); checker.destroy(); final Properties cache = new Properties(); cache.load(Files.newBufferedReader(cacheFile.toPath())); final int expectedNumberOfObjectsInCache = 2; assertEquals(expectedNumberOfObjectsInCache, cache.size()); final String expectedConfigHash = "68EE3C3B4593FD8D86159C670C504542E20C6FA0"; assertEquals(expectedConfigHash, cache.getProperty(PropertyCacheFile.CONFIG_HASH_KEY)); assertNotNull(cache.getProperty(tmpFile.getPath())); }
Source:
public TreeDataProcessor() { super(Keys.TREE_TYPE, input -> input.getItem() == ItemTypes.PLANKS || input.getItem() == ItemTypes.LEAVES || input.getItem() == ItemTypes.LEAVES2 || input.getItem() == ItemTypes.LOG || input.getItem() == ItemTypes.LOG2 || input.getItem() == ItemTypes.SAPLING || input.getItem() == ItemTypes.WOODEN_SLAB || input.getItem() == ItemTypes.BOAT || input.getItem() == ItemTypes.ACACIA_BOAT || input.getItem() == ItemTypes.BIRCH_BOAT || input.getItem() == ItemTypes.DARK_OAK_BOAT || input.getItem() == ItemTypes.JUNGLE_BOAT || input.getItem() == ItemTypes.SPRUCE_BOAT); }

Target:
public TreeDataProcessor() { super(Keys.TREE_TYPE, input -> input.getItem() == ItemTypes.PLANKS || input.getItem() == ItemTypes.LEAVES || input.getItem() == ItemTypes.LEAVES2 || input.getItem() == ItemTypes.LOG || input.getItem() == ItemTypes.LOG2 || input.getItem() == ItemTypes.SAPLING || input.getItem() == ItemTypes.WOODEN_SLAB || boatMapping.containsKey((ItemType) input.getItem())); }
Source:
protected List<String> getTablesToDropConstraints() { return null; }

Target:
protected List<String> getTablesToDropConstraints() { return new ArrayList<>(); }
Source:
private ColumnStatistics(Estimate nullsFraction, List<RangeColumnStatistics> rangeColumnStatistics) { this.nullsFraction = requireNonNull(nullsFraction, "nullsFraction can not be null"); requireNonNull(rangeColumnStatistics, "rangeColumnStatistics can not be null"); if (rangeColumnStatistics.size() > 1) { throw new IllegalArgumentException("Statistics for multiple ranges are not supported"); } if (rangeColumnStatistics.isEmpty()) { rangeColumnStatistics = SINGLE_UNKNOWN_RANGE_STATISTICS; } if (nullsFraction.isValueUnknown() ^ rangeColumnStatistics.get(0).getFraction().isValueUnknown()) { throw new IllegalArgumentException("All or none fraction/nullsFraction must be set"); } this.rangeColumnStatistics = unmodifiableList(rangeColumnStatistics); }

Target:
private ColumnStatistics(Estimate nullsFraction, List<RangeColumnStatistics> rangeColumnStatistics) { this.nullsFraction = requireNonNull(nullsFraction, "nullsFraction can not be null"); requireNonNull(rangeColumnStatistics, "rangeColumnStatistics can not be null"); if (!rangeColumnStatistics.stream().allMatch(Objects::nonNull)) { throw new NullPointerException("elements of rangeColumnStatistics can not be null"); } if (rangeColumnStatistics.size() > 1) { throw new IllegalArgumentException("Statistics for multiple ranges are not supported"); } if (rangeColumnStatistics.isEmpty()) { rangeColumnStatistics = SINGLE_UNKNOWN_RANGE_STATISTICS; } if (nullsFraction.isValueUnknown() != rangeColumnStatistics.get(0).getFraction().isValueUnknown()) { throw new IllegalArgumentException("All or none fraction/nullsFraction must be set"); } this.rangeColumnStatistics = unmodifiableList(new ArrayList<>(rangeColumnStatistics)); }
Source:
private ExecutingPlan(final Plan plan, final DolphinDriver dolphinDriver) { this.pendingTaskSubmissions = new ConcurrentHashMap<>(); this.planEvaluatorIds = new ArrayList<>(plan.getEvaluatorsToAdd()); this.activeContexts = new ArrayList<>(); this.planEvaluatorIdsToContexts = new ConcurrentHashMap<>(); this.runningTasks = new ConcurrentHashMap<>(); this.activeContextLatch = new CountDownLatch(plan.getEvaluatorsToAdd().size()); this.dataTransferLatch = new CountDownLatch(plan.getTransferSteps().size()); this.moveLatch = new CountDownLatch(plan.getTransferSteps().size()); this.runningTaskLatch = new CountDownLatch(plan.getEvaluatorsToAdd().size()); this.synchronizedExecutionLatch = new CountDownLatch(1); this.dolphinDriver = dolphinDriver; }

Target:
private ExecutingPlan(final Plan plan, final DolphinDriver dolphinDriver) { this.pendingTaskSubmissions = new ConcurrentHashMap<>(); this.planEvaluatorIds = new ArrayList<>(plan.getEvaluatorsToAdd()); this.activeContexts = new ArrayList<>(plan.getEvaluatorsToAdd().size()); this.planEvaluatorIdsToContexts = new ConcurrentHashMap<>(); this.runningTasks = new ConcurrentHashMap<>(); this.activeContextLatch = new CountDownLatch(plan.getEvaluatorsToAdd().size()); this.dataTransferLatch = new CountDownLatch(plan.getTransferSteps().size()); this.moveLatch = new CountDownLatch(plan.getTransferSteps().size()); this.runningTaskLatch = new CountDownLatch(plan.getEvaluatorsToAdd().size()); this.synchronizedExecutionLatch = new CountDownLatch(1); this.dolphinDriver = dolphinDriver; }
Source:
public void testSeDeSchema() { final Map<String, String> options = getAllOptions(); String schemaRegistryUrl = options.get(DebeziumAvroFormatFactory.IDENTIFIER + "." + RegistryAvroOptions.SCHEMA_REGISTRY_URL.key()); String schemaRegistrySubject = options.get(DebeziumAvroFormatFactory.IDENTIFIER + "." + RegistryAvroOptions.SCHEMA_REGISTRY_SUBJECT.key()); final DebeziumAvroDeserializationSchema expectedDeser = new DebeziumAvroDeserializationSchema( ROW_TYPE, InternalTypeInfo.of(ROW_TYPE), schemaRegistryUrl); final DynamicTableSource actualSource = createTableSource(options); assert actualSource instanceof TestDynamicTableFactory.DynamicTableSourceMock; TestDynamicTableFactory.DynamicTableSourceMock scanSourceMock = (TestDynamicTableFactory.DynamicTableSourceMock) actualSource; DeserializationSchema<RowData> actualDeser = scanSourceMock.valueFormat .createRuntimeDecoder( ScanRuntimeProviderContext.INSTANCE, SCHEMA.toRowDataType()); assertEquals(expectedDeser, actualDeser); final DebeziumAvroSerializationSchema expectedSer = new DebeziumAvroSerializationSchema( ROW_TYPE, schemaRegistryUrl, schemaRegistrySubject ); final DynamicTableSink actualSink = createTableSink(options); assert actualSink instanceof TestDynamicTableFactory.DynamicTableSinkMock; TestDynamicTableFactory.DynamicTableSinkMock sinkMock = (TestDynamicTableFactory.DynamicTableSinkMock) actualSink; SerializationSchema<RowData> actualSer = sinkMock.valueFormat .createRuntimeEncoder( new SinkRuntimeProviderContext(false), SCHEMA.toRowDataType()); Assert.assertEquals(expectedSer, actualSer); }

Target:
public void testSeDeSchema() { final Map<String, String> options = getAllOptions(); DebeziumAvroDeserializationSchema expectedDeser = new DebeziumAvroDeserializationSchema( ROW_TYPE, InternalTypeInfo.of(ROW_TYPE), REGISTRY_URL); DeserializationSchema<RowData> actualDeser = createDeserializationSchema(options); assertEquals(expectedDeser, actualDeser); DebeziumAvroSerializationSchema expectedSer = new DebeziumAvroSerializationSchema( ROW_TYPE, REGISTRY_URL, SUBJECT ); SerializationSchema<RowData> actualSer = createSerializationSchema(options); Assert.assertEquals(expectedSer, actualSer); }
Source:
public int hashCode() { int result; long temp; temp = Double.doubleToLongBits(resolution); result = (int) (temp ^ (temp >>> 32)); return result; }

Target:
public int hashCode() { return new Double(resolution).hashCode(); }
Source:
public Page<Launcher> getLaunchersWithSchedules(Pageable pageable) { Iterable<Launcher> allLaunchers = this.launcherRepository.findAll(); List<Launcher> launchers = new ArrayList<>(); Iterator<Launcher> launcherIterator = allLaunchers.iterator(); while(launcherIterator.hasNext()) { Launcher launcher = launcherIterator.next(); if (launcher.getScheduler() != null) { launchers.add(launcher); } } return new PageImpl(launchers, pageable, launchers.size()) ; }

Target:
public Page<Launcher> getLaunchersWithSchedules(Pageable pageable) { Iterable<Launcher> allLaunchers = this.launcherRepository.findAll(); List<Launcher> launchers = new ArrayList<>(); Iterator<Launcher> launcherIterator = allLaunchers.iterator(); while(launcherIterator.hasNext()) { Launcher launcher = launcherIterator.next(); if (launcher.getScheduler() != null) { launchers.add(launcher); } } return new PageImpl<>(launchers, pageable, launchers.size()) ; }
Source:
public void threadDump() { System.out.println("Performing thread dump"); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true); Arrays.stream(threadInfos).forEach(System.out::println); }

Target:
public void threadDump() { if(doThreadDump) { System.out.println("Performing thread dump"); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true); Arrays.stream(threadInfos).forEach(System.out::println); } }
Source:
public void testRemoveModel() throws ExecutionException, InterruptedException { final String repoId = "dummy1/dummy1"; MultiModel models = new MultiModel(new Preferences(true)); models.queuePendingRepository(repoId); RepoIO testIO = new RepoIO(true, false); testIO.openRepository(repoId).thenApply(models::addPending); TestUtils.delay(3); assertEquals(true, models.getModelById(repoId).isPresent()); models.removeRepoModelById(repoId); TestUtils.delay(3); assertEquals(false, models.getModelById(repoId).isPresent()); }

Target:
public void testRemoveModel() throws ExecutionException, InterruptedException { final String repoId = "dummy1/dummy1"; MultiModel models = new MultiModel(new Preferences(true)); models.queuePendingRepository(repoId); RepoIO testIO = new RepoIO(true, false); testIO.openRepository(repoId).thenApply(models::addPending).get(); assertEquals(true, models.getModelById(repoId).isPresent()); models.removeRepoModelById(repoId); assertEquals(false, models.getModelById(repoId).isPresent()); }
Source:
private void qos(Network network, VdsNetworkInterface iface, NetworkQoS expectedQos, boolean hostNetworkQosSupported) { configRule.mockConfigValue(ConfigValues.HostNetworkQosSupported, version, hostNetworkQosSupported); SetupNetworksVdsCommandParameters parameters = new SetupNetworksVdsCommandParameters(Guid.newGuid(), Collections.singletonList(network), Collections.<String> emptyList(), Collections.<VdsNetworkInterface> emptyList(), Collections.<String> emptySet(), Collections.singletonList(iface)); createCommand(parameters).execute(); verifyMethodPassedToHost(); Map<String, Object> networkStruct = assertNeworkWasSent(network); NetworkQosMapper qosMapper = new NetworkQosMapper(networkStruct, VdsProperties.HOST_QOS_INBOUND, VdsProperties.HOST_QOS_OUTBOUND); NetworkQoS deserialize = qosMapper.deserialize(); if (deserialize != null) { deserialize.setId(expectedQos.getId()); } assertEquals(expectedQos, deserialize); }

Target:
private void qos(Network network, VdsNetworkInterface iface, NetworkQoS expectedQos, boolean hostNetworkQosSupported) { configRule.mockConfigValue(ConfigValues.HostNetworkQosSupported, version, hostNetworkQosSupported); SetupNetworksVdsCommandParameters parameters = new SetupNetworksVdsCommandParameters(Guid.newGuid(), Collections.singletonList(network), Collections.<String> emptyList(), Collections.<VdsNetworkInterface> emptyList(), Collections.<String> emptySet(), Collections.singletonList(iface)); createCommand(parameters).execute(); verifyMethodPassedToHost(); Map<String, Object> networkStruct = assertNeworkWasSent(network); NetworkQosMapper qosMapper = new NetworkQosMapper(networkStruct, VdsProperties.HOST_QOS_INBOUND, VdsProperties.HOST_QOS_OUTBOUND); NetworkQoS deserialize = qosMapper.deserialize(); assertTrue((expectedQos == null && deserialize == null) || expectedQos.equalValues(deserialize)); }
Source:
@Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); startGridsMultiThreaded(SRVS); client.set(true); Ignite client1 = startClientGrid(SRVS); assertTrue(client1.configuration().isClientMode()); client.set(true); Ignite client2 = startClientGrid(SRVS + 1); assertTrue(client2.configuration().isClientMode()); client2.createNearCache(TX_CACHE1, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>())); client2.createNearCache(TX_CACHE2, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>())); client2.createNearCache(ATOMIC_CACHE, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>())); }

Target:
@Override protected void beforeTestsStarted() throws Exception { super.beforeTestsStarted(); startGridsMultiThreaded(SRVS); Ignite client1 = startClientGrid(SRVS); assertTrue(client1.configuration().isClientMode()); Ignite client2 = startClientGrid(SRVS + 1); assertTrue(client2.configuration().isClientMode()); client2.createNearCache(TX_CACHE1, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>())); client2.createNearCache(TX_CACHE2, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>())); client2.createNearCache(ATOMIC_CACHE, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>())); }
Source:
public void loadState() { String currentFolder = UIFactory.getFileDialogPersistence().getProperty(id+":folder"); if(currentFolder!=null) { setCurrentDirectory(new File(currentFolder)); } String currentFilter = UIFactory.getFileDialogPersistence().getProperty(id+":filter"); if(currentFilter!=null) { if(!setCurrentFilter(Integer.valueOf(currentFilter))) { if(getFileChooser().isAcceptAllFileFilterUsed()) { getFileChooser().setFileFilter(getFileChooser().getAcceptAllFileFilter()); } } } }

Target:
public void loadState() { String currentFolder = UIFactory.getFileDialogPersistence().getProperty(id+":folder"); if(currentFolder!=null) { setCurrentDirectory(new File(currentFolder)); } String currentFilter = UIFactory.getFileDialogPersistence().getProperty(id+":filter"); if(currentFilter!=null && !setCurrentFilter(Integer.valueOf(currentFilter))) { if(getFileChooser().isAcceptAllFileFilterUsed()) { getFileChooser().setFileFilter(getFileChooser().getAcceptAllFileFilter()); } } }
Source:
public IndexReader select( IndexReader[] instances, IndexQuery... predicates ) { if ( predicates.length > 1 ) { return instances[LUCENE]; } IndexQuery predicate = predicates[0]; if ( predicate instanceof IndexQuery.ExactPredicate ) { IndexQuery.ExactPredicate exactPredicate = (IndexQuery.ExactPredicate) predicate; return select( instances, exactPredicate.value() ); } if ( predicate instanceof IndexQuery.RangePredicate ) { switch ( predicate.valueGroup() ) { case GEOMETRY: return instances[SPATIAL]; case DATE: case LOCAL_DATE_TIME: case ZONED_DATE_TIME: case LOCAL_TIME: case ZONED_TIME: case DURATION: return instances[TEMPORAL]; default: } } if ( predicate instanceof IndexQuery.ExistsPredicate ) { return null; } return instances[LUCENE]; }

Target:
public IndexReader select( IndexReader[] instances, IndexQuery... predicates ) { if ( predicates.length > 1 ) { return instances[LUCENE]; } IndexQuery predicate = predicates[0]; if ( predicate instanceof ExactPredicate ) { ExactPredicate exactPredicate = (ExactPredicate) predicate; return select( instances, exactPredicate.value() ); } if ( predicate instanceof RangePredicate ) { switch ( predicate.valueGroup() ) { case GEOMETRY: return instances[SPATIAL]; case DATE: case LOCAL_DATE_TIME: case ZONED_DATE_TIME: case LOCAL_TIME: case ZONED_TIME: case DURATION: return instances[TEMPORAL]; default: } } if ( predicate instanceof ExistsPredicate ) { return null; } return instances[LUCENE]; }
Source:
public void check(final IProgressMonitor monitor) { if (null != monitor) { monitor.subTask("Validate 'build.properties' file for architecture '" + architectureFile.getName() + "'."); } final IBuildModel buildModel = ProjectManagementService.getPluginBuild(project); if (null != buildModel) { boolean containsProfile = false; final String profilePath = architectureFile.getProjectRelativePath().toString(); final IBuild build = buildModel.getBuild(); final IBuildEntry buildEntry = build.getEntry(IBuildEntry.BIN_INCLUDES); final String[] tokens = buildEntry.getTokens(); for (int i = 0; i < tokens.length && !containsProfile; i++) { containsProfile = profilePath.startsWith(tokens[i]); } if (!containsProfile) { final IFile buildPropertiesFile = ProjectManagementService.getBuildFile(project); MarkersService.createMarker( buildPropertiesFile, ArchitecturePluginValidationConstants.ARCHITECTURE_PLUGIN_VALIDATION_TYPE, "The build does not contains entry for file '" + profilePath + "'", IMarker.SEVERITY_ERROR); } } if (null != monitor) { monitor.worked(1); } }

Target:
public void check(final IProgressMonitor monitor) { if (null != monitor) { monitor.subTask("Validate 'build.properties' file for architecture '" + architectureFile.getName() + "'."); } final IBuildModel buildModel = ProjectManagementService.getPluginBuild(project); if (null != buildModel) { boolean containsProfile = false; final String profilePath = architectureFile.getProjectRelativePath().toString(); final IBuild build = buildModel.getBuild(); final IBuildEntry buildEntry = build.getEntry(IBuildEntry.BIN_INCLUDES); final String[] tokens = buildEntry.getTokens(); for (int i = 0; i < tokens.length && !containsProfile; i++) { containsProfile = profilePath.startsWith(tokens[i]); } if (!containsProfile) { final IFile buildPropertiesFile = ProjectManagementService.getBuildFile(project); MarkersService.createMarker( buildPropertiesFile, ArchitecturePluginValidationConstants.ARCHITECTURE_PLUGIN_VALIDATION_TYPE, "The build does not contains entry for file '" + profilePath + "'.", IMarker.SEVERITY_ERROR); } } if (null != monitor) { monitor.worked(1); } }
Source:
private static PsiElement[] tryGetProperty(HaxeMethodDeclaration method) { final HaxeMethodModel methodModel = method.getModel(); final HaxeClassModel declaringClass = methodModel.getDeclaringClass(); final String methodName = method.getName(); HaxeMemberModel classField = null; if (StringUtils.startsWith(methodName, GETTER_PREFIX)) { classField = declaringClass.getField(methodName.substring(GETTER_PREFIX.length())); } else if (StringUtils.startsWith(methodName, SETTER_PREFIX)) { classField = declaringClass.getField(methodName.substring(GETTER_PREFIX.length())); } return classField == null ? null : new PsiElement[]{classField.getBasePsi()}; }

Target:
private static PsiElement[] tryGetProperty(HaxeMethodDeclaration method) { final HaxeMethodModel methodModel = method.getModel(); final HaxeClassModel declaringClass = methodModel.getDeclaringClass(); final String methodName = method.getName(); HaxeMemberModel classField = null; if (StringUtils.startsWith(methodName, GETTER_PREFIX)) { classField = declaringClass.getField(methodName.substring(GETTER_PREFIX.length())); } else if (StringUtils.startsWith(methodName, SETTER_PREFIX)) { classField = declaringClass.getField(methodName.substring(SETTER_PREFIX.length())); } return classField == null ? null : new PsiElement[]{classField.getBasePsi()}; }
Source:
public void handleDelete(ActionParameters params) throws ActionException { params.requireAdminUser(); final int id = params.getRequiredParamInt(PARAM_ID); final MaplayerGroup theme = oskariMapLayerGroupService.find(id); final List<Integer> maplayerIds = oskariMapLayerGroupService.findMaplayersByGroup(id); if(!maplayerIds.isEmpty()) { throw new ActionParamsException("Maplayers linked to theme", JSONHelper.createJSONObject("code", "not_empty")); } oskariMapLayerGroupService.delete(id); ResponseHelper.writeResponse(params, theme.getAsJSON()); }

Target:
public void handleDelete(ActionParameters params) throws ActionException { params.requireAdminUser(); final int id = params.getRequiredParamInt(PARAM_ID); final MaplayerGroup maplayerGroup = oskariMapLayerGroupService.find(id); final List<Integer> maplayerIds = oskariMapLayerGroupService.findMaplayersByGroup(id); if(!maplayerIds.isEmpty()) { throw new ActionParamsException("Maplayers linked to maplayer group", JSONHelper.createJSONObject("code", "not_empty")); } oskariMapLayerGroupService.delete(id); ResponseHelper.writeResponse(params, maplayerGroup.getAsJSON()); }
Source:
private String addAppKeyToJson(String jsonString, ParamsMap params) { if (params == null) return jsonString; String appKey = params.get(APPLICATION_KEY); if (appKey == null || appKey.length() == 0) return jsonString; final String appKeyStart = "{\"" + APPLICATION_KEY + "\":\""; final String appKeyEnd = "\", "; final String appKeyString = appKeyStart.concat(appKey).concat(appKeyEnd); final int beginIndex = jsonString.indexOf("{"); final String jsonWithAppKey = appKeyString.concat(jsonString.substring(beginIndex + 1)); return jsonWithAppKey; }

Target:
private String addAppKeyToJson(String jsonString, ParamsMap params) { if (params == null) { return jsonString; } String appKey = params.get(APPLICATION_KEY); if (appKey == null || appKey.length() == 0) { return jsonString; } final String appKeyString = "\"" + APPLICATION_KEY + "\":\"" + appKey + "\", "; if (jsonString == null || jsonString.length() == 0) { return "{" + appKeyString.replace(',', '}'); } int jsonLength = jsonString.length(); int appKeyLength = appKeyString.length(); StringBuffer jsonWithAppKey = new StringBuffer(jsonLength + appKeyLength + 16); jsonWithAppKey.append(jsonString); final int position = jsonWithAppKey.indexOf("{"); jsonWithAppKey.insert(position + 1, appKeyString); return jsonWithAppKey.toString(); }
Source:
public boolean isFlowRunning(int projectId, String flowId) { boolean isRunning = false; isRunning = isRunning || isFlowRunningHelper(projectId, flowId, queuedFlowMap.values()); isRunning = isRunning || isFlowRunningHelper(projectId, flowId, runningFlows.values()); return false; }

Target:
public boolean isFlowRunning(int projectId, String flowId) { boolean isRunning = false; isRunning = isRunning || isFlowRunningHelper(projectId, flowId, queuedFlows.getAllEntries()); isRunning = isRunning || isFlowRunningHelper(projectId, flowId, runningFlows.values()); return isRunning; }
Source:
public Optional<Map<String, String>> getMetadataMap() { return Optional.empty(); }

Target:
public Map<String, String> getMetadataMap() { return Collections.emptyMap(); }
Source:
public List<AgentInfo> getAllLocalWithFullInfo() { Map<String, AgentInfo> agentInfoMap = createLocalAgentMap(); Set<AgentIdentity> allAttachedAgents = getAgentManager().getAllAttachedAgents(); List<AgentInfo> agentList = new ArrayList<>(allAttachedAgents.size()); for (AgentIdentity eachAgentIdentity : allAttachedAgents) { AgentControllerIdentityImplementation agentControllerIdentity = cast(eachAgentIdentity); agentList.add(createAgentInfo(agentControllerIdentity, agentInfoMap)); } return agentList; }

Target:
public List<AgentInfo> getAllLocalWithFullInfo() { Map<String, AgentInfo> agentInfoMap = createLocalAgentMap(); return getAgentManager().getAllAttachedAgents() .stream() .map(identity -> createAgentInfo(cast(identity), agentInfoMap)) .collect(toList()); }
Source:
protected void start() { if (log.isDebugEnabled()) log.debug("Starting feed for {}", this, entity); if (activated!=null && activated.booleanValue()) { throw new IllegalStateException(String.format("Attempt to start feed %s of entity %s when already running", this, entity)); } activated = true; preStart(); synchronized (poller) { if (active==null || active.booleanValue()) { poller.start(); } } }

Target:
protected void start() { if (log.isDebugEnabled()) log.debug("Starting feed for {}", this, entity); if (activated) { throw new IllegalStateException(String.format("Attempt to start feed %s of entity %s when already running", this, entity)); } activated = true; preStart(); synchronized (pollerStateMutex) { if (!suspended) { poller.start(); } } }
Source:
public ArrayMutableBlockBuffer(Vector3i start, Vector3i size) { this(size.getX() * size.getY() * size.getZ() > LOCAL_PALETTE_THRESHOLD ? new BimapPalette() : GlobalPalette.instance, start, size); }

Target:
public ArrayMutableBlockBuffer(Vector3i start, Vector3i size) { this(size.getX() * size.getY() * size.getZ() > SMALL_AREA_THRESHOLD ? new BimapPalette() : GlobalPalette.instance, start, size); }
Source:
public void HubsTest001_verifyMosaicSliderShowsImagesOnHover(HubName hubName) { HomePageObject home = new HomePageObject(driver); HubBasePageObject hub = home.openHub(hubName, wikiCorporateURL); hub.verifyMosaicSliderImages(); hub.mosaicSliderHoverOverImage(4); String currentLargeImageDescription = hub .mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(3); hub.mosaicSliderVerifyLargeImageDescriptionNotEquals(currentLargeImageDescription); currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(2); hub.mosaicSliderVerifyLargeImageDescriptionNotEquals(currentLargeImageDescription); currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(1); hub.mosaicSliderVerifyLargeImageDescriptionNotEquals(currentLargeImageDescription); currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(0); hub.mosaicSliderVerifyLargeImageDescriptionNotEquals(currentLargeImageDescription); }

Target:
public void HubsTest001_verifyMosaicSliderShowsImagesOnHover(HubName hubName) { HomePageObject home = new HomePageObject(driver); HubBasePageObject hub = home.openHubByUrl(hubName, wikiCorporateURL); hub.verifyMosaicSliderImages(); hub.mosaicSliderHoverOverImage(4); String currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(3); hub.mosaicSliderVerifyLargeImageDescriptionDifferent(currentLargeImageDescription); currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(2); hub.mosaicSliderVerifyLargeImageDescriptionDifferent(currentLargeImageDescription); currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(1); hub.mosaicSliderVerifyLargeImageDescriptionDifferent(currentLargeImageDescription); currentLargeImageDescription = hub.mosaicSliderGetCurrentLargeImageDescription(); hub.mosaicSliderHoverOverImage(0); hub.mosaicSliderVerifyLargeImageDescriptionDifferent(currentLargeImageDescription); }
Source:
public void start(ComponentContext context) { super.start(context); List<RedirectResolverDescriptor> descriptors = getDescriptors(XP_REDIRECT_RESOLVER); if (!descriptors.isEmpty()) { RedirectResolverDescriptor descriptor = descriptors.get(descriptors.size() - 1); try { redirectResolver = descriptor.klass.newInstance(); } catch (ReflectiveOperationException e) { getLog().error(e); } } }

Target:
public void start(ComponentContext context) { super.start(context); List<RedirectResolverDescriptor> descriptors = getDescriptors(XP_REDIRECT_RESOLVER); if (!descriptors.isEmpty()) { RedirectResolverDescriptor descriptor = descriptors.get(descriptors.size() - 1); try { redirectResolver = descriptor.klass.getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { getLog().error(e,e); } } if (redirectResolver == null) { redirectResolver = new DefaultRedirectResolver(); } }
Source:
private Map getApplicationPropertiesMap() { new Exception("trace").printStackTrace(); ApplicationProperties appMap = getApplicationProperties(); Map map = null; if (appMap != null) { map = appMap.getValue(); } if (map == null) { return Collections.emptyMap(); } else { return map; } }

Target:
private Map getApplicationPropertiesMap() { ApplicationProperties appMap = getApplicationProperties(); Map map = null; if (appMap != null) { map = appMap.getValue(); } if (map == null) { return Collections.emptyMap(); } else { return map; } }
Source:
public String getLabel() { return viewpoint.getLabel(); }

Target:
public String getLabel() { return new IdentifiedElementQuery(viewpoint).getLabel(); }