auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void adjustSequencesDueToFailedBatch(ProducerBatch batch) { if (!topicPartitionBookkeeper.contains(batch.topicPartition) || !hasProducerIdAndEpoch(batch.producerId(), batch.producerEpoch())) return; log.debug("producerId: {}, send to partition failed fatally. Reducing future sequence numbers by {}", batch.producerId(), batch.topicPartition, batch.recordCount); int currentSequence = sequenceNumber(batch.topicPartition); currentSequence -= batch.recordCount; if (currentSequence < 0) throw new IllegalStateException("Sequence number for partition " + batch.topicPartition + " is going to become negative: " + currentSequence); setNextSequence(batch.topicPartition, currentSequence); topicPartitionBookkeeper.getPartition(batch.topicPartition).resetSequenceNumbers(inFlightBatch -> { if (inFlightBatch.baseSequence() < batch.baseSequence()) return; int newSequence = inFlightBatch.baseSequence() - batch.recordCount; if (newSequence < 0) throw new IllegalStateException("Sequence number for batch with sequence " + inFlightBatch.baseSequence() + " for partition " + batch.topicPartition + " is going to become negative: " + newSequence); log.info("Resetting sequence number of batch with current sequence for partition to {}", inFlightBatch.baseSequence(), batch.topicPartition, newSequence); inFlightBatch.resetProducerState(new ProducerIdAndEpoch(inFlightBatch.producerId(), inFlightBatch.producerEpoch()), newSequence, inFlightBatch.isTransactional()); }); }

Target:
private void adjustSequencesDueToFailedBatch(ProducerBatch batch) { if (!topicPartitionBookkeeper.contains(batch.topicPartition)) return; log.debug("producerId: {}, send to partition failed fatally. Reducing future sequence numbers by {}", batch.producerId(), batch.topicPartition, batch.recordCount); int currentSequence = sequenceNumber(batch.topicPartition); currentSequence -= batch.recordCount; if (currentSequence < 0) throw new IllegalStateException("Sequence number for partition " + batch.topicPartition + " is going to become negative: " + currentSequence); setNextSequence(batch.topicPartition, currentSequence); topicPartitionBookkeeper.getPartition(batch.topicPartition).resetSequenceNumbers(inFlightBatch -> { if (inFlightBatch.baseSequence() < batch.baseSequence()) return; int newSequence = inFlightBatch.baseSequence() - batch.recordCount; if (newSequence < 0) throw new IllegalStateException("Sequence number for batch with sequence " + inFlightBatch.baseSequence() + " for partition " + batch.topicPartition + " is going to become negative: " + newSequence); log.info("Resetting sequence number of batch with current sequence for partition to {}", inFlightBatch.baseSequence(), batch.topicPartition, newSequence); inFlightBatch.resetProducerState(new ProducerIdAndEpoch(inFlightBatch.producerId(), inFlightBatch.producerEpoch()), newSequence, inFlightBatch.isTransactional()); }); }
Source:
public String asSummaryString() { Map<String, Object> params = new LinkedHashMap<>(); params.put("identifier", viewIdentifier); params.put("IfExists", ifExists); params.put("isTemporary", isTemporary); return OperationUtils.formatWithChildren( "DROP VIEW", params, Collections.emptyList(), Operation::asSummaryString); }

Target:
public String asSummaryString() { Map<String, Object> params = new LinkedHashMap<>(); params.put("identifier", viewIdentifier); params.put("ifExists", ifExists); params.put("isTemporary", isTemporary); return OperationUtils.formatWithChildren( "DROP VIEW", params, Collections.emptyList(), Operation::asSummaryString); }
Source:
public BlurredAmbientOcclusionNode(Context context) { displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); Config config = context.get(Config.class); RenderingConfig renderingConfig = config.getRendering(); renderingConfig.subscribe(RenderingConfig.SSAO, this); requiresCondition(renderingConfig::isSsao); addDesiredStateChange(new EnableMaterial(SSAO_BLURRED_MATERIAL)); ssaoBlurredMaterial = getMaterial(SSAO_BLURRED_MATERIAL); requiresFBO(new FBOConfig(SSAO_FBO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); requiresFBO(new FBOConfig(SSAO_BLURRED_FBO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(SSAO_BLURRED_FBO, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(SSAO_BLURRED_FBO, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); addDesiredStateChange(new SetInputTextureFromFBO(TEXTURE_SLOT_0, SSAO_FBO, ColorTexture, displayResolutionDependentFBOs, SSAO_BLURRED_MATERIAL, "tex")); }

Target:
public BlurredAmbientOcclusionNode(Context context) { super(context); RenderingConfig renderingConfig = context.get(Config.class).getRendering(); renderingConfig.subscribe(RenderingConfig.SSAO, this); requiresCondition(renderingConfig::isSsao); addDesiredStateChange(new EnableMaterial(SSAO_BLURRED_MATERIAL)); ssaoBlurredMaterial = getMaterial(SSAO_BLURRED_MATERIAL); displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); requiresFBO(new FBOConfig(SSAO_FBO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); requiresFBO(new FBOConfig(SSAO_BLURRED_FBO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); addDesiredStateChange(new BindFBO(SSAO_BLURRED_FBO, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(SSAO_BLURRED_FBO, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); addDesiredStateChange(new SetInputTextureFromFBO(TEXTURE_SLOT_0, SSAO_FBO, ColorTexture, displayResolutionDependentFBOs, SSAO_BLURRED_MATERIAL, "tex")); }
Source:
private boolean checkOpenShiftHealth(IServer server, int timeout) throws OpenShiftNotReadyPollingException { ServiceManagerEnvironment adb = ServiceManagerEnvironment.getOrLoadServiceManagerEnvironment(server, true); if( adb == null ) { return false; } boolean returnVal = false; String url = "https://" + adb.getOpenShiftHost() + ":" + adb.getOpenShiftPort() + "/healthz/ready"; try { HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(); con.setRequestMethod("HEAD"); con.setConnectTimeout(timeout); con.setReadTimeout(timeout); int response = con.getResponseCode(); con.disconnect(); returnVal = response == HttpURLConnection.HTTP_OK; } catch(MalformedURLException murle) { CDKCoreActivator.pluginLog().logError(murle.getMessage(), murle); returnVal = false; } catch(IOException ioe) { returnVal = false; } if( returnVal == false ) { throw new OpenShiftNotReadyPollingException(CDKCoreActivator.statusFactory().errorStatus(CDKCoreActivator.PLUGIN_ID, "The CDK VM is up and running, but OpenShift is unreachable at url " + url, null, OpenShiftNotReadyPollingException.OPENSHIFT_UNREACHABLE_CODE)); } return returnVal; }

Target:
private boolean checkOpenShiftHealth(IServer server, int timeout) throws OpenShiftNotReadyPollingException { ServiceManagerEnvironment adb = ServiceManagerEnvironment.getOrLoadServiceManagerEnvironment(server, true); if( adb == null ) { return false; } String url = adb.getOpenShiftHost() + ":" + adb.getOpenShiftPort() + "/healthz/ready"; return checkOpenShiftHealth(url, timeout); }
Source:
static SecurityTrade parseTrade(CsvRow row, TradeInfo info, CsvInfoResolver resolver) { String securityIdScheme = row.findValue(SECURITY_ID_SCHEME_FIELD).orElse(DEFAULT_SECURITY_SCHEME); String securityIdValue = row.getValue(SECURITY_ID_FIELD); SecurityId securityId = SecurityId.of(securityIdScheme, securityIdValue); Optional<Double> quantityOpt = row.findValue(QUANTITY_FIELD).map(s -> LoaderUtils.parseDouble(s)); double price = LoaderUtils.parseDouble(row.getValue(PRICE_FIELD)); if (quantityOpt.isPresent()) { return SecurityTrade.of(info, securityId, quantityOpt.get(), price); } double longQuantity = parseQuantity(row, LONG_QUANTITY_FIELD); double shortQuantity = parseQuantity(row, SHORT_QUANTITY_FIELD); double quantity = longQuantity - shortQuantity; return SecurityTrade.of(info, securityId, quantity, price); }

Target:
static SecurityTrade parseTrade(CsvRow row, TradeInfo info, CsvInfoResolver resolver) { String securityIdScheme = row.findValue(SECURITY_ID_SCHEME_FIELD).orElse(DEFAULT_SECURITY_SCHEME); String securityIdValue = row.getValue(SECURITY_ID_FIELD); SecurityId securityId = SecurityId.of(securityIdScheme, securityIdValue); double price = LoaderUtils.parseDouble(row.getValue(PRICE_FIELD)); DoublesPair quantity = parseQuantity(row); return SecurityTrade.of(info, securityId, quantity.getFirst() - quantity.getSecond(), price); }
Source:
public void visitNode(Tree node) { String value = ((LiteralTree) node).value().replaceAll("\\\\\\\\u", "\\\\z"); value = value.substring(1, value.length() - 1); if (value.isEmpty()) { return; } Matcher matcher = UNICODE_ESCAPED_CHAR.matcher(value); List<String> matches = getAllMatches(matcher); if (!matches.isEmpty()) { boolean notOnlyUnicodeEscaped = !matcher.replaceAll("").isEmpty(); if (notOnlyUnicodeEscaped && Iterables.any(matches, IS_PRINTABLE_ESCAPED_UNICODE)) { addIssue(node, "Remove this Unicode escape sequence and use the character instead."); } } }

Target:
public void visitNode(Tree node) { String value = LiteralUtils.trimQuotes(((LiteralTree) node).value()); if (value.isEmpty()) { return; } Matcher matcher = UNICODE_ESCAPED_CHAR.matcher(value.replaceAll("\\\\\\\\u", "\\\\z")); List<String> matches = getAllMatches(matcher); if (!matches.isEmpty()) { boolean notOnlyUnicodeEscaped = !matcher.replaceAll("").isEmpty(); if (notOnlyUnicodeEscaped && Iterables.any(matches, IS_PRINTABLE_ESCAPED_UNICODE)) { addIssue(node, "Remove this Unicode escape sequence and use the character instead."); } } }
Source:
public void testServerToNodeMetadata() { server.enqueue( new MockResponse().setBody(stringFromResource("/compute/server.json")) ); Server serverObject = api.serverApi().get("mock"); NodeMetadata expected = fnNodeMetadata.apply(serverObject); assertNotNull(expected); NodeMetadata actual = new NodeMetadataBuilder() .group("docker001") .ids(serverObject.id()) .name(serverObject.name()) .backendStatus("AVAILABLE") .status(NodeMetadata.Status.RUNNING) .hardware(new HardwareBuilder() .ids("cpu=4,ram=4096,disk=40") .name("cpu=4,ram=4096,disk=40") .ram((int) serverObject.hardware().ram()) .processor(new Processor(serverObject.hardware().coresPerProcessor(), 1d)) .hypervisor("kvm") .volume(new VolumeBuilder() .bootDevice(true) .size(40f) .id("c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1") .durable(true) .type(Volume.Type.LOCAL) .build()) .build()) .operatingSystem(new OperatingSystem.Builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build()) .location(new LocationBuilder() .id("usa") .description("us") .scope(LocationScope.REGION) .metadata(ImmutableMap.<String, Object>of( "version", "10", "state", "AVAILABLE")) .parent(new LocationBuilder() .id("de") .description("Germany") .scope(LocationScope.PROVIDER) .build()) .build()) .publicAddresses(ImmutableList.<String>of("173.252.120.6")) .build(); assertEquals(actual, expected); }

Target:
public void testServerToNodeMetadata() { server.enqueue( new MockResponse().setBody(stringFromResource("/compute/server.json")) ); Server serverObject = api.serverApi().get("mock"); NodeMetadata expected = fnNodeMetadata.apply(serverObject); assertNotNull(expected); NodeMetadata actual = new NodeMetadataBuilder() .group("docker001") .ids(serverObject.id()) .name(serverObject.name()) .backendStatus("AVAILABLE") .status(NodeMetadata.Status.RUNNING) .hardware(new HardwareBuilder() .ids("cpu=4,ram=4096,disk=40") .name("cpu=4,ram=4096,disk=40") .ram((int) serverObject.hardware().ram()) .processor(new Processor(serverObject.hardware().coresPerProcessor(), 1d)) .hypervisor("kvm") .volume(new VolumeBuilder() .bootDevice(true) .size(40f) .id("c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1") .durable(true) .type(Volume.Type.LOCAL) .build()) .build()) .operatingSystem(new OperatingSystem.Builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build()) .location(new LocationBuilder() .id("908DC2072407C94C8054610AD5A53B8C") .description("us") .scope(LocationScope.REGION) .metadata(ImmutableMap.<String, Object>of( "version", "10", "state", "AVAILABLE")) .parent(new LocationBuilder() .id("de") .description("Germany") .scope(LocationScope.PROVIDER) .build()) .build()) .publicAddresses(ImmutableList.<String>of("173.252.120.6")) .build(); assertEquals(actual, expected); }
Source:
private void performDiskUpdate(final boolean unlockImage) { final Disk diskToUpdate = getDiskDao().get(getParameters().getDiskId()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { getVmStaticDAO().incrementDbGeneration(getVm().getId()); updateSnapshotIdOnShareableChange(diskToUpdate, getNewDisk()); clearAddressOnInterfaceChange(diskToUpdate, getNewDisk()); diskToUpdate.setBoot(getNewDisk().isBoot()); diskToUpdate.setDiskInterface(getNewDisk().getDiskInterface()); diskToUpdate.setPropagateErrors(getNewDisk().getPropagateErrors()); diskToUpdate.setWipeAfterDelete(getNewDisk().isWipeAfterDelete()); diskToUpdate.setDiskAlias(getNewDisk().getDiskAlias()); diskToUpdate.setDiskDescription(getNewDisk().getDiskDescription()); diskToUpdate.setShareable(getNewDisk().isShareable()); getBaseDiskDao().update(diskToUpdate); if (diskToUpdate.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) diskToUpdate; diskImage.setQuotaId(getQuotaId()); if (unlockImage && diskImage.getImageStatus() == ImageStatus.LOCKED) { diskImage.setImageStatus(ImageStatus.OK); } getImageDao().update(diskImage.getImage()); } updateVmDisksAndDevice(); setSucceeded(true); return null; } private void clearAddressOnInterfaceChange(Disk diskToUpdate, Disk diskWithUserChanges) { if (diskToUpdate.getDiskInterface() != diskWithUserChanges.getDiskInterface()) { getVmDeviceDao().clearDeviceAddress(getVmDeviceDao().get(new VmDeviceId(diskToUpdate.getId(), getVmId())) .getDeviceId()); } } }); }

Target:
private void performDiskUpdate(final boolean unlockImage) { final Disk disk = getDiskDao().get(getParameters().getDiskId()); applyUserChanges(disk); TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Object runInTransaction() { getVmStaticDAO().incrementDbGeneration(getVm().getId()); clearAddressOnInterfaceChange(disk, getNewDisk()); getBaseDiskDao().update(disk); if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { DiskImage diskImage = (DiskImage) disk; diskImage.setQuotaId(getQuotaId()); if (unlockImage && diskImage.getImageStatus() == ImageStatus.LOCKED) { diskImage.setImageStatus(ImageStatus.OK); } getImageDao().update(diskImage.getImage()); } updateVmDisksAndDevice(); setSucceeded(true); return null; } private void clearAddressOnInterfaceChange(Disk diskToUpdate, Disk diskWithUserChanges) { if (diskToUpdate.getDiskInterface() != diskWithUserChanges.getDiskInterface()) { getVmDeviceDao().clearDeviceAddress(getVmDeviceDao().get(new VmDeviceId(diskToUpdate.getId(), getVmId())) .getDeviceId()); } } }); }
Source:
public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkNotNull(key, NULL_BIFUNCTION_IS_NOT_ALLOWED); if (SerializationUtil.isClassStaticAndSerializable(remappingFunction)) { BiFunctionExecutingEntryProcessor<K, V> ep = new BiFunctionExecutingEntryProcessor<>(remappingFunction); return executeOnKeyInternal(key, ep); } else { return computeIfPresentLocally(key, remappingFunction); } }

Target:
public V computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) { checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED); checkNotNull(key, NULL_BIFUNCTION_IS_NOT_ALLOWED); return computeIfPresentLocally(key, remappingFunction); }
Source:
public void shouldNotSeeFilteredEntries() throws Exception { IndexEntryUpdate<SchemaIndexDescriptor>[] updates = layoutUtil.someUpdatesNoDuplicateValues(); processAll( updates ); layoutUtil.sort( updates ); IndexReader reader = accessor.newReader(); NodeValueIterator iter = new NodeValueIterator(); IndexQuery.ExactPredicate filter = IndexQuery.exact( 0, updates[1].values()[0].asObjectCopy() ); IndexQuery rangeQuery = layoutUtil.rangeQuery( valueOf( updates[0] ), true, valueOf( updates[2] ), true ); IndexProgressor.NodeValueClient filterClient = filterClient( iter, filter ); reader.query( filterClient, IndexOrder.NONE, rangeQuery ); assertTrue( iter.hasNext() ); assertEquals( entityIdOf( updates[1] ), iter.next() ); assertFalse( iter.hasNext() ); }

Target:
public void shouldNotSeeFilteredEntries() throws Exception { IndexEntryUpdate<SchemaIndexDescriptor>[] updates = layoutUtil.someUpdatesNoDuplicateValues(); processAll( updates ); layoutUtil.sort( updates ); IndexReader reader = accessor.newReader(); NodeValueIterator iter = new NodeValueIterator(); IndexQuery.ExactPredicate filter = IndexQuery.exact( 0, valueOf( updates[1]) ); IndexQuery rangeQuery = layoutUtil.rangeQuery( valueOf( updates[0] ), true, valueOf( updates[2] ), true ); IndexProgressor.NodeValueClient filterClient = filterClient( iter, filter ); reader.query( filterClient, IndexOrder.NONE, rangeQuery ); assertTrue( iter.hasNext() ); assertEquals( entityIdOf( updates[1] ), iter.next() ); assertFalse( iter.hasNext() ); }
Source:
protected Object convertSingleValue(Object value) { if (value instanceof ByteBuffer) { ByteBuffer byteBufferValue = (ByteBuffer) value; byte[] bytesValue = new byte[byteBufferValue.remaining()]; byteBufferValue.get(bytesValue); return bytesValue; } if (value instanceof Number) { return value; } return value.toString(); }

Target:
protected Object convertSingleValue(Object value) { if (value instanceof ByteBuffer) { ByteBuffer byteBufferValue = (ByteBuffer) value; byte[] bytesValue = new byte[byteBufferValue.remaining()]; byteBufferValue.get(bytesValue); return bytesValue; } if (value instanceof Number || value instanceof byte[]) { return value; } return value.toString(); }
Source:
private long conferenceAge() { if(sid != null){ final ConferenceDetailRecordsDao dao = storage.getConferenceDetailRecordsDao(); ConferenceDetailRecord cdr = dao.getConferenceDetailRecord(sid); if(cdr == null){ if(logger.isDebugEnabled()) logger.debug(String.format("Conference cdr is null for sid: %s", sid)); }else{ return DateTime.now().getMillis()-cdr.getDateCreated().getMillis(); } } return 0; }

Target:
private long conferenceAge() { if(sid != null){ final ConferenceDetailRecordsDao dao = storage.getConferenceDetailRecordsDao(); ConferenceDetailRecord cdr = dao.getConferenceDetailRecord(sid); if(cdr == null){ logger.warning(String.format("Conference cdr is null for sid: %s", sid)); }else{ return DateTime.now().getMillis()-cdr.getDateCreated().getMillis(); } } return 0; }
Source:
public static LocalTimeValue truncate( TemporalUnit unit, TemporalValue input, MapValue fields, Supplier<ZoneId> defaultZone ) { LocalTime localTime = input.getLocalTimePart(); LocalTime truncatedLT; try { truncatedLT = localTime.truncatedTo( unit ); } catch ( UnsupportedTemporalTypeException e ) { throw new UnsupportedTemporalUnitException( e.getMessage() ); } if ( fields.size() == 0 ) { return localTime( truncatedLT ); } else { Map<String,AnyValue> updatedFields = fields.getMapCopy(); truncatedLT = updateFieldMapWithConflictingSubseconds( updatedFields, unit, truncatedLT ); if ( updatedFields.size() == 0 ) { return localTime( truncatedLT ); } updatedFields.put( "time", localTime( truncatedLT ) ); return build( VirtualValues.map( updatedFields ), defaultZone ); } }

Target:
public static LocalTimeValue truncate( TemporalUnit unit, TemporalValue input, MapValue fields, Supplier<ZoneId> defaultZone ) { LocalTime localTime = input.getLocalTimePart(); LocalTime truncatedLT; try { truncatedLT = localTime.truncatedTo( unit ); } catch ( UnsupportedTemporalTypeException e ) { throw new UnsupportedTemporalUnitException( e.getMessage(), e ); } if ( fields.size() == 0 ) { return localTime( truncatedLT ); } else { Map<String,AnyValue> updatedFields = fields.getMapCopy(); truncatedLT = updateFieldMapWithConflictingSubseconds( updatedFields, unit, truncatedLT ); if ( updatedFields.size() == 0 ) { return localTime( truncatedLT ); } updatedFields.put( "time", localTime( truncatedLT ) ); return build( VirtualValues.map( updatedFields ), defaultZone ); } }
Source:
public void initializeVisualizer() { fEventListener = new MulticoreVisualizerEventListener(this); m_cpuCoreContextsCache = new ArrayList<IDMContext>(); m_visualizerInstanceId = getViewer().getView().getViewSite().getSecondaryId(); if (m_visualizerInstanceId == null) { m_visualizerInstanceId = "0"; } initializePersistentParameters(); }

Target:
public void initializeVisualizer() { fEventListener = new MulticoreVisualizerEventListener(this); m_cpuCoreContextsCache = new ArrayList<IDMContext>(); m_visualizerInstanceId = getViewer().getView().getViewSite().getSecondaryId(); if (m_visualizerInstanceId == null) { m_visualizerInstanceId = "0"; } initializePersistentParameters(m_visualizerInstanceId); }
Source:
public Attributes getAttributes() { if (attrs != null) return attrs; if (attributesNodeProvider == null) { throw new IllegalStateException( "The tree walk should have one AttributesNodeProvider set in order to compute the git attributes."); } WorkingTreeIterator workingTreeIterator = getCurrentTreeNode( WorkingTreeIterator.class); DirCacheIterator dirCacheIterator = getCurrentTreeNode( DirCacheIterator.class); CanonicalTreeParser other = getCurrentTreeNode( CanonicalTreeParser.class); if (workingTreeIterator == null && dirCacheIterator == null && other == null) { return new Attributes(); } String path = currentHead.getEntryPathString(); final boolean isDir = FileMode.TREE.equals(currentHead.mode); Attributes attributes = new Attributes(); try { if (macroExpander == null) { AttributesNode globalNode = attributesNodeProvider .getGlobalAttributesNode(); AttributesNode infoNode = attributesNodeProvider .getInfoAttributesNode(); AttributesNode rootNode = getRootAttributesNode(); macroExpander = new MacroExpander(globalNode, infoNode, rootNode); } macroExpander.mergeInfoAttributes(path, isDir, attributes); getPerDirectoryEntryAttributes(path, isDir, operationType, workingTreeIterator, dirCacheIterator, other, attributes); macroExpander.mergeGlobalAttributes(path, isDir, attributes); } catch (IOException e) { throw new JGitInternalException("Error while parsing attributes", e); } for (Attribute a : attributes.getAll()) { if (a.getState() == State.UNSPECIFIED) attributes.remove(a.getKey()); } return attributes; }

Target:
public Attributes getAttributes() { if (attrs != null) return attrs; if (attributesNodeProvider == null) { throw new IllegalStateException( "The tree walk should have one AttributesNodeProvider set in order to compute the git attributes."); } try { if (macroExpander == null) { macroExpander = new MacroExpander(this); } attrs = macroExpander.getAttributes(); return attrs; } catch (IOException e) { throw new JGitInternalException("Error while parsing attributes", e); } }
Source:
public void dropTopic(String destinationUri) { String topicName = URI.create(destinationUri).getPath(); AdminUtils.deleteTopic(new ZkClient(_zkAddress), topicName); }

Target:
public void dropTopic(String destinationUri) { Objects.requireNonNull(destinationUri, "destinationuri should not null"); String topicName = URI.create(destinationUri).getPath(); try { if(AdminUtils.topicExists(_zkClient, topicName)) { AdminUtils.deleteTopic(_zkClient, topicName); } else { LOG.warn(String.format("Trying to delete topic %s that doesn't exist", topicName)); } } catch(Throwable e) { LOG.error(String.format("Deleting topic %s failed with exception %s", topicName, e)); throw e; } }
Source:
private static void addOptions(Tad target, Enum<?>[] values) { final List<Option> options = target.getOption(); for (Enum<?> value : values) { Toption option = new Toption(); option.setLabel(value.name()); option.setValue(value.name()); options.add(option); } }

Target:
private static void addOptions(Tad target, Enum<?>[] values) { final List<Option> options = target.getOption(); for (Enum<?> value : values) { final String name = value.name(); final Toption option = new Toption(); option.setLabel(name); option.setValue(name); options.add(option); } }
Source:
public Map<MentionedActorReference, List<String>> groupAnchorsByUserReference(List<MacroBlock> mentions) { Map<MentionedActorReference, List<String>> ret = new HashMap<>(); for (MacroBlock block : mentions) { String userReference = block.getParameter(REFERENCE_PARAM_NAME); ret.merge(new MentionedActorReference(userReference, block.getParameter(TYPE_PARAM_NAME)), new ArrayList<>(singletonList(block.getParameter(ANCHORID_PARAM_NAME))), (l1, l2) -> { l1.addAll(l2); return l1; }); } return ret; }

Target:
public Map<MentionedActorReference, List<String>> groupAnchorsByUserReference(List<MacroBlock> mentions) { Map<MentionedActorReference, List<String>> ret = new HashMap<>(); for (MacroBlock block : mentions) { String userReference = block.getParameter(REFERENCE_PARAM_NAME); String type = Optional.ofNullable(block.getParameter(TYPE_PARAM_NAME)).orElse(USER_MENTION_TYPE); ret.merge(new MentionedActorReference(userReference, type), new ArrayList<>(singletonList(block.getParameter(ANCHORID_PARAM_NAME))), (l1, l2) -> { l1.addAll(l2); return l1; }); } return ret; }
Source:
public static Object[][] testPositiveByteValues() { final List<Byte> positiveByteTests = IOTestCases.byteTests() .stream() .filter(b -> b >= 0) .collect(Collectors.toList()); final List<Byte> shuffled = new ArrayList<>(positiveByteTests); Collections.shuffle(shuffled); return new Object[][]{ {positiveByteTests}, {shuffled} }; }

Target:
public static Object[][] testPositiveByteValues() { final List<Byte> positiveByteTests = IOTestCases.byteTests() .stream() .filter(b -> b >= 0) .collect(Collectors.toList()); final List<Byte> shuffled = new ArrayList<>(positiveByteTests); Collections.shuffle(shuffled, RANDOM); return new Object[][]{ {positiveByteTests}, {shuffled} }; }
Source:
public InstrumentedInterceptor(MetricRegistry registry, String name) { informational = registry.meter(MetricRegistry.name(name, "response", "code", "1xx")); successful = registry.meter(MetricRegistry.name(name, "response", "code", "2xx")); redirection = registry.meter(MetricRegistry.name(name, "response", "code", "3xx")); clientError = registry.meter(MetricRegistry.name(name, "response", "code", "4xx")); serverError = registry.meter(MetricRegistry.name(name, "response", "code", "5xx")); other = registry.meter(MetricRegistry.name(name, "response", "code", "other")); }

Target:
InstrumentedInterceptor(MetricRegistry registry, String name) { informational = registry.meter(MetricRegistry.name(name, "response", "family", "informational")); successful = registry.meter(MetricRegistry.name(name, "response", "family", "successful")); redirection = registry.meter(MetricRegistry.name(name, "response", "family", "redirection")); clientError = registry.meter(MetricRegistry.name(name, "response", "family", "client-error")); serverError = registry.meter(MetricRegistry.name(name, "response", "family", "server-error")); other = registry.meter(MetricRegistry.name(name, "response", "family", "other")); }
Source:
protected void setUp() throws Exception { super.setUp(); File origRepo = getTestFile( "target/test-classes/test-repo-git" ); File testRepo = getTestFile( "target/test-classes/test-repo-git-test" ); FileUtils.deleteDirectory( testRepo ); FileUtils.copyDirectoryStructure( origRepo, testRepo ); repository = "scm:git:file://" + testRepo.toURI().getPath(); }

Target:
protected void setUp() throws Exception { super.setUp(); File origRepo = getTestFile( "target/test-classes/test-repo-git" ); File testRepo = getTestFile( "target/test-classes/test-repo-git-test" ); FileUtils.deleteDirectory( testRepo ); FileUtils.copyDirectoryStructure( origRepo, testRepo ); repository = "scm:git:" + testRepo.toPath().toUri(); }
Source:
private List<ERepositoryObjectType> getAllMetaDataType() { List<ERepositoryObjectType> list = new ArrayList<ERepositoryObjectType>(); list.add(ERepositoryObjectType.METADATA_CONNECTIONS); list.add(ERepositoryObjectType.METADATA_FILE_FTP); list.add(ERepositoryObjectType.METADATA_LDAP_SCHEMA); list.add(ERepositoryObjectType.METADATA_MDMCONNECTION); list.add(ERepositoryObjectType.METADATA_SAPCONNECTIONS); list.add(ERepositoryObjectType.METADATA_SAPCONNECTIONS); if (GlobalServiceRegister.getDefault().isServiceRegistered(INOSQLService.class)) { INOSQLService nosqlService = (INOSQLService) GlobalServiceRegister.getDefault().getService(INOSQLService.class); if (nosqlService != null) { list.add(nosqlService.getNOSQLRepositoryType()); } } return list; }

Target:
private List<ERepositoryObjectType> getAllMetaDataType() { List<ERepositoryObjectType> list = new ArrayList<ERepositoryObjectType>(); list.add(ERepositoryObjectType.METADATA_CONNECTIONS); list.add(ERepositoryObjectType.METADATA_FILE_FTP); list.add(ERepositoryObjectType.METADATA_LDAP_SCHEMA); list.add(ERepositoryObjectType.METADATA_MDMCONNECTION); list.add(ERepositoryObjectType.METADATA_SAPCONNECTIONS); if (GlobalServiceRegister.getDefault().isServiceRegistered(INOSQLService.class)) { INOSQLService nosqlService = (INOSQLService) GlobalServiceRegister.getDefault().getService(INOSQLService.class); if (nosqlService != null) { list.add(nosqlService.getNOSQLRepositoryType()); } } return list; }
Source:
public BoardPanel(BoardSize boardSize, SquareConfig squareConfig, Function<BoardCoordinate, Set<BoardCoordinate>> getMovesCallback) { super(false); mSquareConfig = squareConfig; mGetMovesCallback = getMovesCallback; mBoardSize = boardSize; mSquareLabels = new ArrayList<>(boardSize.width * boardSize.height); GridLayout gridLayout = new GridLayout(mBoardSize.height + 1, mBoardSize.width + 2); setLayout(gridLayout); createGrid(gridLayout); }

Target:
public BoardPanel(BoardSize boardSize, SquareConfig squareConfig, Function<BoardCoordinate, Set<BoardCoordinate>> getMovesCallback) { super(false); mSquareConfig = squareConfig; mGetMovesCallback = getMovesCallback; mBoardSize = boardSize; mTotalBoardSize = BoardSize.withDimensions(mBoardSize.width + HORIZONTAL_PADDING, mBoardSize.height + VERTICAL_PADDING); mSquareLabels = new ArrayList<>(boardSize.width * boardSize.height); GridLayout gridLayout = new GridLayout(mTotalBoardSize.height, mTotalBoardSize.width); setLayout(gridLayout); createGrid(gridLayout); }
Source:
protected Handler createAppServlet(Server server, JerseyEnvironment jersey, ObjectMapper objectMapper, Validator validator, MutableServletContextHandler handler, @Nullable Servlet jerseyContainer, MetricRegistry metricRegistry) { configureSessionsAndSecurity(handler, server); handler.addFilter(AllowedMethodsFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)) .setInitParameter(AllowedMethodsFilter.ALLOWED_METHODS_PARAM, Joiner.on(',').join(allowedMethods)); handler.addFilter(ThreadNameFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); serverPush.addFilter(handler); if (jerseyContainer != null) { if (jerseyRootPath.isPresent()) { String urlPattern = jerseyRootPath.get(); if (!urlPattern.endsWith("*") && !urlPattern.endsWith("/")) { urlPattern += "/"; } if (!urlPattern.endsWith("*")) { urlPattern += "*"; } jersey.setUrlPattern(urlPattern); } jersey.register(new JacksonMessageBodyProvider(objectMapper)); jersey.register(new HibernateValidationFeature(validator)); if (registerDefaultExceptionMappers == null || registerDefaultExceptionMappers) { jersey.register(new LoggingExceptionMapper<Throwable>() { }); jersey.register(new JerseyViolationExceptionMapper()); jersey.register(new JsonProcessingExceptionMapper()); jersey.register(new EarlyEofExceptionMapper()); } handler.addServlet(new NonblockingServletHolder(jerseyContainer), jersey.getUrlPattern()); } final InstrumentedHandler instrumented = new InstrumentedHandler(metricRegistry); instrumented.setServer(server); instrumented.setHandler(handler); return instrumented; }

Target:
protected Handler createAppServlet(Server server, JerseyEnvironment jersey, ObjectMapper objectMapper, Validator validator, MutableServletContextHandler handler, @Nullable Servlet jerseyContainer, MetricRegistry metricRegistry) { configureSessionsAndSecurity(handler, server); handler.addFilter(AllowedMethodsFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)) .setInitParameter(AllowedMethodsFilter.ALLOWED_METHODS_PARAM, Joiner.on(',').join(allowedMethods)); handler.addFilter(ThreadNameFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); serverPush.addFilter(handler); if (jerseyContainer != null) { if (jerseyRootPath.isPresent()) { jersey.setUrlPattern(jerseyRootPath.get()); } jersey.register(new JacksonMessageBodyProvider(objectMapper)); jersey.register(new HibernateValidationFeature(validator)); if (registerDefaultExceptionMappers == null || registerDefaultExceptionMappers) { jersey.register(new LoggingExceptionMapper<Throwable>() { }); jersey.register(new JerseyViolationExceptionMapper()); jersey.register(new JsonProcessingExceptionMapper()); jersey.register(new EarlyEofExceptionMapper()); } handler.addServlet(new NonblockingServletHolder(jerseyContainer), jersey.getUrlPattern()); } final InstrumentedHandler instrumented = new InstrumentedHandler(metricRegistry); instrumented.setServer(server); instrumented.setHandler(handler); return instrumented; }
Source:
public RepositoryDTO fetchInstallableApplications() { try { final List<CategoryDTO> categoryDTOs = new ArrayList<>(); Resource[] resources = resourceResolver.getResources(packagePath + "/*"); for (Resource resource : resources) { final CategoryDTO category = buildCategory(resource.getFilename()); if (!category.getApplications().isEmpty()) { categoryDTOs.add(category); } } Collections.sort(categoryDTOs, Comparator.comparing(CategoryDTO::getName)); final RepositoryDTO.Builder repositoryDTOBuilder = new RepositoryDTO.Builder() .withName("classpath repository").withCategories(categoryDTOs); return repositoryDTOBuilder.build(); } catch (IOException e) { LOGGER.warn("Error while reading resource directory", e); return null; } }

Target:
public RepositoryDTO fetchInstallableApplications() { try { final List<CategoryDTO> categoryDTOs = new ArrayList<>(); Resource[] resources = resourceResolver.getResources(packagePath + "/*"); for (Resource resource : resources) { final CategoryDTO category = buildCategory(resource.getFilename()); if (!category.getApplications().isEmpty()) { categoryDTOs.add(category); } } Collections.sort(categoryDTOs, Comparator.comparing(CategoryDTO::getName)); final RepositoryDTO.Builder repositoryDTOBuilder = new RepositoryDTO.Builder() .withName("classpath repository").withCategories(categoryDTOs); return repositoryDTOBuilder.build(); } catch (IOException e) { LOGGER.warn("Error while reading resource directory", e); return new RepositoryDTO.Builder().build(); } }
Source:
private void readChannelsByNames(final KuraResponsePayload respPayload, final String assetPid, final String channelName) { requireNonNull(respPayload, message.respPayloadNonNull()); requireNonNull(assetPid, message.assetPidNonNull()); requireNonNull(channelName, message.channelIdNonNull()); final String channelDelim = "#"; Set<String> channelIds = null; if (channelName.contains(channelDelim)) { channelIds = CollectionUtil.newHashSet(Arrays.asList(channelName.split(channelDelim))); channelIds.removeAll(Collections.singleton("")); } final Asset asset = this.assets.get(assetPid); final AssetConfiguration configuration = asset.getAssetConfiguration(); final Map<String, Channel> assetConfiguredChannels = configuration.getAssetChannels(); final Set<String> channelNamesToRead = CollectionUtil.newHashSet(); if (channelIds == null) { channelNamesToRead.add(channelName); } else { for (final String chName : channelIds) { channelNamesToRead.add(chName); } } if (assetConfiguredChannels != null) { List<AssetRecord> assetRecords = null; try { assetRecords = asset.read(channelNamesToRead); } catch (final KuraException e) { logger.warn(message.connectionException() + e); respPayload.addMetric(message.errorMessage(), message.connectionException()); } if (assetRecords != null) { this.prepareResponse(respPayload, assetRecords); } } }

Target:
private void readChannelsByNames(final KuraResponsePayload respPayload, final String assetPid, final String channelName) { requireNonNull(respPayload, message.respPayloadNonNull()); requireNonNull(assetPid, message.assetPidNonNull()); requireNonNull(channelName, message.channelNameNonNull()); final String channelDelim = "#"; Set<String> channelNames = null; if (channelName.contains(channelDelim)) { channelNames = CollectionUtil.newHashSet(Arrays.asList(channelName.split(channelDelim))); channelNames.removeAll(Collections.singleton("")); } final Asset asset = this.assets.get(assetPid); final AssetConfiguration configuration = asset.getAssetConfiguration(); final Map<String, Channel> assetConfiguredChannels = configuration.getAssetChannels(); final Set<String> channelNamesToRead = CollectionUtil.newHashSet(); if (channelNames == null) { channelNamesToRead.add(channelName); } else { for (final String chName : channelNames) { channelNamesToRead.add(chName); } } if (assetConfiguredChannels != null) { List<AssetRecord> assetRecords = null; try { assetRecords = asset.read(channelNamesToRead); } catch (final KuraException e) { logger.warn(message.connectionException() + e); respPayload.addMetric(message.errorMessage(), message.connectionException()); } if (assetRecords != null) { this.prepareResponse(respPayload, assetRecords); } } }
Source:
public int run() { boolean hasRequired = false; if (helpCommands.isEmpty()) { console.info( "\nUsage: [options] [command] [command options]", programName); console.info("\n Options:\n"); for (ParameterDescription param : jc.getParameters()) { hasRequired = printOption(console, param) || hasRequired; } if (hasRequired) { console.info("\n * = required"); } console.info("\n Commands:\n"); for (String command : jc.getCommands().keySet()) { console.info(" {}\n\t{}", command, jc.getCommandDescription(command)); } console.info("\n Examples:"); console.info("\n # print information for create\n help create", programName); console.info("\n See '{} help <command>' for more information on a " + "specific command.", programName); } else { for (String cmd : helpCommands) { JCommander commander = jc.getCommands().get(cmd); if (commander == null) { console.error("Unknown command: {}", cmd); return 1; } console.info("\nUsage: [general options] [command options]", new Object[] { programName, cmd, commander.getMainParameterDescription()}); console.info("\n Description:"); console.info("\n {}", jc.getCommandDescription(cmd)); if (!commander.getParameters().isEmpty()) { console.info("\n Command options:\n"); for (ParameterDescription param : commander.getParameters()) { hasRequired = printOption(console, param) || hasRequired; } if (hasRequired) { console.info("\n * = required"); } } List<String> examples = ((Command) commander.getObjects().get(0)).getExamples(); if (examples != null) { console.info("\n Examples:"); for (String example : examples) { if (example.startsWith("#")) { console.info("\n {}", example); } else { console.info(" {}", new Object[] {programName, cmd, example}); } } } console.info(""); } } return 0; }

Target:
public int run() { if (helpCommands.isEmpty()) { printGenericHelp(); } else { for (String cmd : helpCommands) { JCommander commander = jc.getCommands().get(cmd); if (commander == null) { console.error("\nUnknown command: {}\n", cmd); printGenericHelp(); return 1; } boolean hasRequired = false; console.info("\nUsage: [general options] [command options]", new Object[] { programName, cmd, commander.getMainParameterDescription()}); console.info("\n Description:"); console.info("\n {}", jc.getCommandDescription(cmd)); if (!commander.getParameters().isEmpty()) { console.info("\n Command options:\n"); for (ParameterDescription param : commander.getParameters()) { hasRequired = printOption(console, param) || hasRequired; } if (hasRequired) { console.info("\n * = required"); } } List<String> examples = ((Command) commander.getObjects().get(0)).getExamples(); if (examples != null) { console.info("\n Examples:"); for (String example : examples) { if (example.startsWith("#")) { console.info("\n {}", example); } else { console.info(" {}", new Object[] {programName, cmd, example}); } } } console.info(""); } } return 0; }
Source:
public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( getClass() != obj.getClass() ) return false; RegistrationId other = (RegistrationId) obj; if ( department == null ) { if ( other.department != null ) return false; } else if ( !department.equals( other.department ) ) return false; if ( studentId != other.studentId ) return false; return true; }

Target:
public boolean equals(Object obj) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } RegistrationId other = (RegistrationId) obj; if ( department == null ) { if ( other.department != null ) { return false; } } else if ( !department.equals( other.department ) ) { return false; } return studentId == other.studentId; }
Source:
public void onEvent(BrokerEvent event) { if (!workspaceId.equals(event.getRuntimeId().getWorkspaceId())) { return; } switch (event.getStatus()) { case DONE: List<ChePlugin> tooling = event.getTooling(); if (tooling != null) { finishFuture.complete(tooling); } else { finishFuture.completeExceptionally( new InternalInfrastructureException( format( "Plugin brokering process for workspace `%s` is finished but plugins list is missing", workspaceId))); } break; case FAILED: finishFuture.completeExceptionally( new InfrastructureException( format( "Plugin broking process for workspace %s failed with error: %s", workspaceId, event.getError()))); break; case STARTED: default: } }

Target:
public void onEvent(BrokerEvent event) { if (event.getRuntimeId() == null || !workspaceId.equals(event.getRuntimeId().getWorkspaceId())) { return; } switch (event.getStatus()) { case DONE: List<ChePlugin> tooling = event.getTooling(); if (tooling != null) { finishFuture.complete(tooling); } else { finishFuture.completeExceptionally( new InternalInfrastructureException( format( "Plugin brokering process for workspace `%s` is finished but plugins list is missing", workspaceId))); } break; case FAILED: finishFuture.completeExceptionally( new InfrastructureException( format( "Plugin broking process for workspace %s failed with error: %s", workspaceId, event.getError()))); break; case STARTED: default: } }
Source:
public void onItemClick(int position){ switch (position) { case IMPORTANT_TO_ME: startActivity(new Intent(getApplicationContext(), BehaviorProgressActivity.class)); break; case MY_PRIORITIES: startActivity(new Intent(getApplicationContext(), MyPrioritiesActivity.class)); break; case MYSELF: startActivity(new Intent(getApplicationContext(), UserProfileActivity.class)); break; case MY_PRIVACY: break; case SETTINGS: Intent intent = new Intent(getApplicationContext(), SettingsActivity.class); startActivityForResult(intent, Constants.SETTINGS_REQUEST_CODE); break; case TOUR: startActivity(new Intent(getApplicationContext(), TourActivity.class)); break; case DRAWER_COUNT: break; } mDrawerLayout.closeDrawers(); }

Target:
public void onItemClick(int position){ switch (position) { case IMPORTANT_TO_ME: startActivity(new Intent(getApplicationContext(), BehaviorProgressActivity.class)); break; case MY_PRIORITIES: startActivity(new Intent(getApplicationContext(), MyPrioritiesActivity.class)); break; case MYSELF: startActivity(new Intent(getApplicationContext(), UserProfileActivity.class)); break; case MY_PRIVACY: startActivity(new Intent(getApplicationContext(), PrivacyActivity.class)); break; case SETTINGS: Intent intent = new Intent(getApplicationContext(), SettingsActivity.class); startActivityForResult(intent, Constants.SETTINGS_REQUEST_CODE); break; case TOUR: startActivity(new Intent(getApplicationContext(), TourActivity.class)); break; case DRAWER_COUNT: break; } mDrawerLayout.closeDrawers(); }
Source:
private boolean isLockable(StudyEventDefinitionBean sed, StudyEventDAO sedao, EventCRFDAO ecdao, ItemDataDAO iddao) { ArrayList events = (ArrayList) sedao.findAllByDefinition(sed.getId()); for (int j = 0; j < events.size(); j++) { StudyEventBean event = (StudyEventBean) events.get(j); if ((event.getRemoved()!=null && event.getRemoved()) || (event.getArchived()!=null && event.getArchived())) { return false; } ArrayList eventCRFs = ecdao.findAllByStudyEvent(event); for (int k = 0; k < eventCRFs.size(); k++) { EventCRFBean eventCRF = (EventCRFBean) eventCRFs.get(k); if ((eventCRF.getRemoved()!=null && eventCRF.getRemoved()) || (eventCRF.getArchived()!=null && eventCRF.getArchived())) { return false; } ArrayList itemDatas = iddao.findAllByEventCRFId(eventCRF.getId()); for (int a = 0; a < itemDatas.size(); a++) { ItemDataBean item = (ItemDataBean) itemDatas.get(a); if (!(item.getStatus().equals(Status.UNAVAILABLE) || item.getStatus().equals(Status.DELETED))) { return false; } } } } return true; }

Target:
private boolean isLockable(StudyEventDefinitionBean sed, StudyEventDAO sedao, EventCRFDAO ecdao, ItemDataDAO iddao) { ArrayList events = (ArrayList) sedao.findAllByDefinition(sed.getId()); for (int j = 0; j < events.size(); j++) { StudyEventBean event = (StudyEventBean) events.get(j); if ( BooleanUtils.isTrue(event.getRemoved()) || BooleanUtils.isTrue(event.getArchived())) { return false; } ArrayList eventCRFs = ecdao.findAllByStudyEvent(event); for (int k = 0; k < eventCRFs.size(); k++) { EventCRFBean eventCRF = (EventCRFBean) eventCRFs.get(k); if (BooleanUtils.isTrue(eventCRF.getRemoved()) || BooleanUtils.isTrue(eventCRF.getArchived())) { return false; } ArrayList itemDatas = iddao.findAllByEventCRFId(eventCRF.getId()); for (int a = 0; a < itemDatas.size(); a++) { ItemDataBean item = (ItemDataBean) itemDatas.get(a); if (!(item.getStatus().equals(Status.UNAVAILABLE) || item.getStatus().equals(Status.DELETED))) { return false; } } } } return true; }
Source:
@Override protected void handleException(Throwable t) { super.handleException(t); server.abort("Unrecoverable exception while closing " + this.regionInfo.getRegionNameAsString(), t); }

Target:
@Override protected void handleException(Throwable t) { server.abort("Unrecoverable exception while closing " + this.regionInfo.getRegionNameAsString(), t); }
Source:
public void judgmentReindexingJob_ONLY_SC_JUDGMENTS() throws Exception { JobParameters jobParameters = new JobParameters(ImmutableMap.of("sourceCode", new JobParameter(SourceCode.SUPREME_COURT.name()))); JobExecution jobExecution = jobLauncher.run(judgmentReindexingJob, jobParameters); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, SUPREME_COURT_JUDGMENTS_COUNT); solrJudgmentsServer.commit(); assertAllMarkedAsIndexed(); assertAllInIndex(SUPREME_COURT_JUDGMENTS_COUNT); }

Target:
public void judgmentReindexingJob_ONLY_SC_JUDGMENTS() throws Exception { JobParameters jobParameters = new JobParameters(ImmutableMap.of("sourceCode", new JobParameter(SourceCode.SUPREME_COURT.name()))); JobExecution jobExecution = jobLauncher.run(judgmentReindexingJob, jobParameters); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, SUPREME_COURT_JUDGMENTS_COUNT); assertAllMarkedAsIndexed(); assertAllInIndex(SUPREME_COURT_JUDGMENTS_COUNT); assertAllInIndexIsOfType(SUPREME_COURT_JUDGMENTS_COUNT, CourtType.SUPREME); }
Source:
private void store() throws IOException { byte[] serialized = state.toCbor().serialize(); System.out.println("Writing "+ serialized.length +" bytes to "+ statePath); Files.write( statePath, serialized, StandardOpenOption.CREATE); }

Target:
private synchronized void store() throws IOException { byte[] serialized = state.toCbor().serialize(); System.out.println("Writing "+ serialized.length +" bytes to "+ statePath); Files.write( statePath, serialized, StandardOpenOption.CREATE); }