auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private synchronized CorfuGuid getCorrectedTimestamp() { long currentTimestamp = System.currentTimeMillis(); if (currentTimestamp == previousTimestamp) { resolutionCorrection++; if (resolutionCorrection > CorfuGuid.MAX_CORRECTION) { while (currentTimestamp == previousTimestamp) { currentTimestamp = System.currentTimeMillis(); } resolutionCorrection = 0; } } else { resolutionCorrection = 0; } if (currentTimestamp < previousTimestamp) { driftCorrection++; if (driftCorrection > CorfuGuid.MAX_CORRECTION) { log.info("updateInstanceId: Time went backward too many times "+ " timestamp={} previousTimestamp={} correction={} instanceId={}", currentTimestamp, previousTimestamp, driftCorrection, instanceId); driftCorrection = 0; updateInstanceId(); } } else if (driftCorrection > 0 && currentTimestamp > previousTimestamp) { CorfuGuid currentTs = new CorfuGuid(currentTimestamp, 0, 0, 0); CorfuGuid previousTs = new CorfuGuid(previousTimestamp, driftCorrection, 0, 0); if (currentTs.getLong() > previousTs.getLong()) { driftCorrection = 0; } } previousTimestamp = currentTimestamp; return new CorfuGuid(currentTimestamp, driftCorrection, resolutionCorrection, instanceId); }

Target:
private synchronized CorfuGuid getCorrectedTimestamp() { long currentTimestamp = System.currentTimeMillis(); if (currentTimestamp == previousTimestamp) { resolutionCorrection++; if (resolutionCorrection > CorfuGuid.MAX_CORRECTION) { while (currentTimestamp == previousTimestamp) { currentTimestamp = System.currentTimeMillis(); } resolutionCorrection = 0; } } else { resolutionCorrection = 0; } if (currentTimestamp < previousTimestamp) { driftCorrection++; if (driftCorrection > CorfuGuid.MAX_CORRECTION) { log.info("updateInstanceId: Time went backward too many times "+ " timestamp={} previousTimestamp={} correction={} instanceId={}", currentTimestamp, previousTimestamp, driftCorrection, instanceId); driftCorrection = 0; updateInstanceId(); } } previousTimestamp = currentTimestamp; return new CorfuGuid(currentTimestamp, driftCorrection, resolutionCorrection, instanceId); }
Source:
public Iterable<Language> languages() { final RtJson rtJson = new RtJson( this.request.uri() .path("/languages") .back() ); final JsonObject json; try { json = rtJson.fetch(); } catch (final IOException ex) { throw new IllegalStateException(ex); } final List<Language> languages = new ArrayList<Language>(json.size()); for (final Map.Entry<String, JsonValue> value : json.entrySet()) { final String name = value.getKey(); languages.add( new RtLanguage( name, json.getJsonNumber(name).longValue() ) ); } return languages; }

Target:
public Iterable<Language> languages() throws IOException { final RtJson json = new RtJson( this.request.uri() .path("/languages") .back() ); final JsonObject object = json.fetch(); final List<Language> languages = new ArrayList<Language>(object.size()); for (final Map.Entry<String, JsonValue> value : object.entrySet()) { final String name = value.getKey(); languages.add( new RtLanguage( name, object.getJsonNumber(name).longValue() ) ); } return languages; }
Source:
public final void run() { CloseableRestResponse response = artifactResolver.get(url); IOUtils.closeQuietly(response); }

Target:
public final void run() { CloseableRestResponse response = artifactResolver.get(url); ResourceCloser.close(response, LOGGER); }
Source:
public MethodRule methodRule1() { return new Increment(); }

Target:
public Increment methodRule1() { return new Increment(); }
Source:
private boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { if (rel0.rowType.getFieldCount() != rel1.rowType.getFieldCount()) { return litmus.fail("Mismatch for column count: [{}]", Pair.of(rel0, rel1)); } for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel1.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail("Mismatch for column type: [{}]", Pair.of(rel0, rel1)); } } return litmus.succeed(); }

Target:
static boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { if (rel0.rowType.getFieldCount() != rel1.rowType.getFieldCount()) { return litmus.fail("Mismatch for column count: [{}]", Pair.of(rel0, rel1)); } for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel1.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail("Mismatch for column type: [{}]", Pair.of(rel0, rel1)); } } return litmus.succeed(); }
Source:
public void edit(final NetworkAttachmentModel object) { driver.edit(object); qosWidget.edit(object.getQosModel()); enableDisableByBootProtocol(object); object.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { NetworkAttachmentModel model = (NetworkAttachmentModel) sender; String propertyName = args.propertyName; if ("BootProtocolsAvailable".equals(propertyName)) { enableDisableByBootProtocol(model); } } }); if (object.getIsToSync().getIsChangable()) { isToSyncInfo.setVisible(true); } customPropertiesTab.setVisible(object.getCustomPropertiesModel().getIsAvailable()); customPropertiesWidget.edit(object.getCustomPropertiesModel()); customPropertiesLabel.setEnabled(object.getCustomPropertiesModel().getIsChangable()); dnsConfigurationTab.setVisible(true); dnsConfigurationWidget.edit(object.getDnsConfigurationModel()); }

Target:
public void edit(final NetworkAttachmentModel object) { driver.edit(object); qosWidget.edit(object.getQosModel()); enableDisableByBootProtocol(object); object.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { NetworkAttachmentModel model = (NetworkAttachmentModel) sender; String propertyName = args.propertyName; if ("BootProtocolsAvailable".equals(propertyName)) { enableDisableByBootProtocol(model); } } }); if (object.getIsToSync().getIsChangable()) { isToSyncInfo.setVisible(true); } customPropertiesTab.setVisible(object.getCustomPropertiesModel().getIsAvailable()); customPropertiesWidget.edit(object.getCustomPropertiesModel()); customPropertiesLabel.setEnabled(object.getCustomPropertiesModel().getIsChangable()); dnsConfigurationWidget.edit(object.getDnsConfigurationModel()); }
Source:
public String resolveExpressions( final String value, final String... activeProfileIds ) { if ( !containsExpression( value ) ) { return value; } List<String> prefixs = new ArrayList<>(); prefixs.add( PrefixAwareRecursionInterceptor.DEFAULT_START_TOKEN ); PrefixAwareRecursionInterceptor ri = new PrefixAwareRecursionInterceptor( prefixs ); return resolveExpressions( value, ri, activeProfileIds ); }

Target:
public String resolveExpressions( final String value, final String... activeProfileIds ) { if ( !containsExpression( value ) ) { return value; } return resolveExpressions( value, null, activeProfileIds ); }
Source:
protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg) { try { if (logger.isDebugEnabled()) { logger.debug( "Discarded inbound message that reached at the tail of the pipeline {}. Channel : {}. " + "Please check your pipeline configuration.", msg, ctx.pipeline().names(), ctx.channel()); } } finally { ReferenceCountUtil.release(msg); } }

Target:
protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg) { onUnhandledInboundMessage(msg); if (logger.isDebugEnabled()) { logger.debug("Discarded message pipeline : {}. Channel : {}.", ctx.pipeline().names(), ctx.channel()); } }
Source:
private IssuesRecorder enableCheckStyle(final FreeStyleProject job, boolean setRunAlways) { IssuesRecorder publisher = new IssuesRecorder(); publisher.setEnabledForFailure(setRunAlways); publisher.setTools( Collections.singletonList(new ToolConfiguration("**/checkstyle-result.xml", new CheckStyle()))); job.getPublishersList().add(publisher); return publisher; }

Target:
final private IssuesRecorder enableCheckStyle(final FreeStyleProject job, boolean setRunAlways) { IssuesRecorder publisher = new IssuesRecorder(); publisher.setEnabledForFailure(setRunAlways); publisher.setTools( Collections.singletonList(new ToolConfiguration("**/*issues.txt", new CheckStyle()))); job.getPublishersList().add(publisher); return publisher; }
Source:
private RelDataType getRowType(RelDataTypeFactory typeFactory, CatalogBaseTable catalogBaseTable, boolean isStreamingMode) { final FlinkTypeFactory flinkTypeFactory = (FlinkTypeFactory) typeFactory; TableSchema tableSchema = catalogBaseTable.getSchema(); final DataType[] fieldDataTypes = tableSchema.getFieldDataTypes(); if (!isStreamingMode && catalogBaseTable instanceof ConnectorCatalogTable && ((ConnectorCatalogTable) catalogBaseTable).getTableSource().isPresent()) { for (int i = 0; i < fieldDataTypes.length; i++) { LogicalType lt = fieldDataTypes[i].getLogicalType(); if (lt instanceof TimestampType && (((TimestampType) lt).getKind() == TimestampKind.PROCTIME || ((TimestampType) lt).getKind() == TimestampKind.ROWTIME)) { int precision = ((TimestampType) lt).getPrecision(); fieldDataTypes[i] = DataTypes.TIMESTAMP(precision); } } } Optional<TableSource> sourceOpt = findAndCreateTableSource(new TableConfig().getConfiguration()); if (tableSchema.getTableColumns().stream().noneMatch(TableColumn::isGenerated) && tableSchema.getWatermarkSpecs().isEmpty() && sourceOpt.isPresent()) { TableSource source = sourceOpt.get(); if ((source instanceof DefinedProctimeAttribute && ((DefinedProctimeAttribute) source).getProctimeAttribute() != null) || (source instanceof DefinedRowtimeAttributes && ((DefinedRowtimeAttributes) source).getRowtimeAttributeDescriptors() != null && !((DefinedRowtimeAttributes) source).getRowtimeAttributeDescriptors().isEmpty())) { tableSchema = ConnectorCatalogTable.calculateSourceSchema(source, !isStreamingMode); } } return TableSourceUtil.getSourceRowType(flinkTypeFactory, tableSchema, scala.Option.empty(), isStreamingMode); }

Target:
private RelDataType getRowType(RelDataTypeFactory typeFactory, CatalogBaseTable catalogBaseTable, boolean isStreamingMode) { final FlinkTypeFactory flinkTypeFactory = (FlinkTypeFactory) typeFactory; TableSchema tableSchema = catalogBaseTable.getSchema(); final DataType[] fieldDataTypes = tableSchema.getFieldDataTypes(); if (!isStreamingMode && catalogBaseTable instanceof ConnectorCatalogTable && ((ConnectorCatalogTable) catalogBaseTable).getTableSource().isPresent()) { for (int i = 0; i < fieldDataTypes.length; i++) { LogicalType lt = fieldDataTypes[i].getLogicalType(); if (lt instanceof TimestampType && (((TimestampType) lt).getKind() == TimestampKind.PROCTIME || ((TimestampType) lt).getKind() == TimestampKind.ROWTIME)) { int precision = ((TimestampType) lt).getPrecision(); fieldDataTypes[i] = DataTypes.TIMESTAMP(precision); } } } Optional<TableSource<?>> sourceOpt = findAndCreateTableSource(); if (isStreamingMode && tableSchema.getTableColumns().stream().noneMatch(TableColumn::isGenerated) && tableSchema.getWatermarkSpecs().isEmpty() && sourceOpt.isPresent()) { TableSource<?> source = sourceOpt.get(); if (TableSourceValidation.hasProctimeAttribute(source) || TableSourceValidation.hasRowtimeAttribute(source)) { tableSchema = ConnectorCatalogTable.calculateSourceSchema(source, false); } } return TableSourceUtil.getSourceRowType(flinkTypeFactory, tableSchema, scala.Option.empty(), isStreamingMode); }
Source:
private DataGeneratorFactory createDataGeneratorFactory() { DataGeneratorFactoryBuilder builder = new DataGeneratorFactoryBuilder(getContext(), dataFormat.getGeneratorFormat()); if(charset == null || charset.trim().isEmpty()) { charset = "UTF-8"; } builder.setCharset(Charset.forName(charset)); switch(dataFormat) { case JSON: builder.setMode(jsonMode); break; case DELIMITED: builder.setMode(csvFileFormat); builder.setMode(csvHeader); builder.setConfig(DelimitedDataGeneratorFactory.REPLACE_NEWLINES_KEY, csvReplaceNewLines); break; case TEXT: builder.setConfig(TextDataGeneratorFactory.FIELD_PATH_KEY, textFieldPath); builder.setConfig(TextDataGeneratorFactory.EMPTY_LINE_IF_NULL_KEY, textEmptyLineIfNull); break; case SDC_JSON: break; case AVRO: builder.setConfig(AvroDataGeneratorFactory.SCHEMA_KEY, avroSchema); break; case XML: default: throw new IllegalStateException(Utils.format("Unknown date format error :{}")); } return builder.build(); }

Target:
private DataGeneratorFactory createDataGeneratorFactory() { DataGeneratorFactoryBuilder builder = new DataGeneratorFactoryBuilder(getContext(), dataFormat.getGeneratorFormat()); if(charset == null || charset.trim().isEmpty()) { charset = "UTF-8"; } builder.setCharset(Charset.forName(charset)); switch(dataFormat) { case JSON: builder.setMode(jsonMode); break; case DELIMITED: builder.setMode(csvFileFormat); builder.setMode(csvHeader); builder.setConfig(DelimitedDataGeneratorFactory.REPLACE_NEWLINES_KEY, csvReplaceNewLines); break; case TEXT: builder.setConfig(TextDataGeneratorFactory.FIELD_PATH_KEY, textFieldPath); builder.setConfig(TextDataGeneratorFactory.EMPTY_LINE_IF_NULL_KEY, textEmptyLineIfNull); break; case SDC_JSON: break; case AVRO: builder.setConfig(AvroDataGeneratorFactory.SCHEMA_KEY, avroSchema); break; case XML: default: throw new IllegalStateException(Utils.format("Unknown data format: {}", dataFormat)); } return builder.build(); }
Source:
public IReviewItemSet createModel(IReview review, PatchSetDetail patchSetDetail) { PatchSet patchSet = patchSetDetail.getPatchSet(); IReviewItemSet itemSet = IReviewsFactory.INSTANCE.createReviewItemSet(); itemSet.setName(NLS.bind("Patch Set {0}", patchSet.getPatchSetId())); itemSet.setCreationDate(patchSet.getCreatedOn()); itemSet.setId(Integer.toString(patchSet.getPatchSetId())); itemSet.setReference(patchSet.getRefName()); itemSet.setRevision(patchSet.getRevision().get()); review.getSets().add(itemSet); return itemSet; }

Target:
public IReviewItemSet createModel(IReview review, PatchSetDetail patchSetDetail) { PatchSet patchSet = patchSetDetail.getPatchSet(); IReviewItemSet itemSet = IReviewsFactory.INSTANCE.createReviewItemSet(); itemSet.setName(NLS.bind("Patch Set {0}", patchSet.getPatchSetId())); itemSet.setCreationDate(patchSet.getCreatedOn()); itemSet.setId(patchSet.getPatchSetId() + ""); itemSet.setReference(patchSet.getRefName()); itemSet.setRevision(patchSet.getRevision().get()); review.getSets().add(itemSet); return itemSet; }
Source:
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return null; int sqlType = getSQLType(columnIndex); if (isBinary(columnIndex) && sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]); if (obj == null) return null; if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte) { return BigDecimal.valueOf(((Number) obj).longValue(), scale); } return toBigDecimal(trimMoney(String.valueOf(obj)), scale); } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastBigDecimal(columnIndex); } catch (NumberFormatException ex) { } } return toBigDecimal( getFixedString(columnIndex), scale ); }

Target:
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return null; if (isBinary(columnIndex)) { int sqlType = getSQLType(columnIndex); if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]); if (obj == null) return null; if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte) { return BigDecimal.valueOf(((Number) obj).longValue(), scale); } return toBigDecimal(trimMoney(String.valueOf(obj)), scale); } } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastBigDecimal(columnIndex); } catch (NumberFormatException ex) { } } return toBigDecimal( getFixedString(columnIndex), scale ); }
Source:
void removeNonExistingSystemEntityTypes() { List<String> removedSystemEntityIds = dataService .findAll(ENTITY_TYPE_META_DATA, EntityType.class) .filter(EntityTypeUtils::isSystemEntity) .filter(this::isNotExists) .map(EntityType::getId) .collect(toList()); dataService.getMeta().deleteEntityTypes(removedSystemEntityIds); removedSystemEntityIds.forEach( entityTypeId -> mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityTypeId))); }

Target:
void removeNonExistingSystemEntityTypes() { List<String> removedSystemEntityIds = new ArrayList<>(); dataService .getRepository(ENTITY_TYPE_META_DATA, EntityType.class) .forEachBatched( new Fetch().field(ID).field(PACKAGE), entityTypes -> entityTypes.stream() .filter(EntityTypeUtils::isSystemEntity) .filter(this::isNotExists) .map(EntityType::getId) .forEach(removedSystemEntityIds::add), 1000); dataService.getMeta().deleteEntityTypes(removedSystemEntityIds); removedSystemEntityIds.forEach( entityTypeId -> mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityTypeId))); }
Source:
public ProcessInstance from(org.activiti.engine.runtime.ProcessInstance internalProcessInstance) { ProcessInstanceImpl processInstance = new ProcessInstanceImpl(); processInstance.setId(internalProcessInstance.getId()); processInstance.setName(internalProcessInstance.getName()); processInstance.setDescription(internalProcessInstance.getDescription()); processInstance.setProcessDefinitionId(internalProcessInstance.getProcessDefinitionId()); processInstance.setInitiator(internalProcessInstance.getStartUserId()); processInstance.setStartDate(internalProcessInstance.getStartTime()); processInstance.setProcessDefinitionKey(internalProcessInstance.getProcessDefinitionKey()); processInstance.setBusinessKey(internalProcessInstance.getBusinessKey()); processInstance.setStatus(calculateStatus(internalProcessInstance)); processInstance.setProcessDefinitionVersion(internalProcessInstance.getProcessDefinitionVersion()); if(internalProcessInstance.getSuperExecutionId()!=null && ExecutionEntity.class.isInstance(internalProcessInstance)) { ExecutionEntity executionEntity = ExecutionEntity.class.cast(internalProcessInstance); if (Context.getCommandContext()==null) { ProcessEngineConfigurationImpl impl = (ProcessEngineConfigurationImpl) ProcessEngines.getDefaultProcessEngine().getProcessEngineConfiguration(); impl.getCommandExecutor().execute(new Command<Void> () { @Override public Void execute(CommandContext commandContext) { Optional.ofNullable(executionEntity.getSuperExecution()) .ifPresent(superExecution -> processInstance.setParentId(superExecution.getProcessInstanceId())); return null; }}); } else { Optional.ofNullable(executionEntity.getSuperExecution()) .ifPresent(superExecution -> processInstance.setParentId(superExecution.getProcessInstanceId())); } } return processInstance; }

Target:
public ProcessInstance from(org.activiti.engine.runtime.ProcessInstance internalProcessInstance) { ProcessInstanceImpl processInstance = new ProcessInstanceImpl(); processInstance.setId(internalProcessInstance.getId()); processInstance.setParentId(internalProcessInstance.getParentProcessInstanceId()); processInstance.setName(internalProcessInstance.getName()); processInstance.setDescription(internalProcessInstance.getDescription()); processInstance.setProcessDefinitionId(internalProcessInstance.getProcessDefinitionId()); processInstance.setProcessDefinitionKey(internalProcessInstance.getProcessDefinitionKey()); processInstance.setProcessDefinitionVersion(internalProcessInstance.getProcessDefinitionVersion()); processInstance.setInitiator(internalProcessInstance.getStartUserId()); processInstance.setStartDate(internalProcessInstance.getStartTime()); processInstance.setProcessDefinitionKey(internalProcessInstance.getProcessDefinitionKey()); processInstance.setBusinessKey(internalProcessInstance.getBusinessKey()); processInstance.setStatus(calculateStatus(internalProcessInstance)); processInstance.setProcessDefinitionVersion(internalProcessInstance.getProcessDefinitionVersion()); return processInstance; }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: navigateUp = true; prepareToFinish(); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; default: return super.onOptionsItemSelected(item); } return true; }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: prepareToFinish(true); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; default: return super.onOptionsItemSelected(item); } return true; }
Source:
DocumentReference getOrGenerateUserDocRef(String accountName) { accountName = Strings.nullToEmpty(accountName); if (accountName.isEmpty()) { accountName = RandomStringUtils.randomAlphanumeric(12); } DocumentReference userDocRef = resolveUserDocRef(accountName); while (modelAccess.exists(userDocRef)) { userDocRef = new DocumentReference(RandomStringUtils.randomAlphanumeric(12), getUserSpaceRef()); } return userDocRef; }

Target:
synchronized DocumentReference getOrGenerateUserDocRef(String accountName) { accountName = Strings.nullToEmpty(accountName); if (accountName.isEmpty()) { accountName = RandomStringUtils.randomAlphanumeric(12); } DocumentReference userDocRef = resolveUserDocRef(accountName); while (modelAccess.exists(userDocRef)) { userDocRef = new DocumentReference(RandomStringUtils.randomAlphanumeric(12), getUserSpaceRef()); } return userDocRef; }
Source:
public O compute1(final I input) { if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } Interval inputInterval = ops().filter().paddingIntervalCentered(input, paddedDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }

Target:
public O compute1(final I input) { if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } Interval inputInterval = paddingIntervalCentered.compute2(input, paddedDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }
Source:
private boolean updateCacheTopology(String cacheName, CacheTopology cacheTopology, Address sender, LocalCacheStatus cacheStatus) { synchronized (runningCaches) { if (!sender.equals(transport.getCoordinator())) { log.debugf("Ignoring topology %d from old coordinator %s", cacheTopology.getTopologyId(), sender); return false; } else { log.debugf("Updating local topology for cache %s: %s", cacheName, cacheTopology); cacheStatus.setCurrentTopology(cacheTopology); } } return true; }

Target:
private boolean updateCacheTopology(String cacheName, CacheTopology cacheTopology, Address sender, LocalCacheStatus cacheStatus) { synchronized (runningCaches) { if (!sender.equals(transport.getCoordinator())) { log.debugf("Ignoring topology %d from old coordinator %s", cacheTopology.getTopologyId(), sender); return false; } } log.debugf("Updating local topology for cache %s: %s", cacheName, cacheTopology); cacheStatus.setCurrentTopology(cacheTopology); return true; }
Source:
private boolean isAcceptableType(Env env, JavaType arg, JavaType formal, boolean autoboxing) { if(arg.isTagged(JavaType.DEFERRED)) { List<JavaType> samMethodArgs = findSamMethodArgs(formal); AbstractTypedTree tree = ((DeferredType) arg).tree(); if (tree.is(Tree.Kind.METHOD_REFERENCE)) { return validMethodReference(env, (MethodReferenceTree) tree, samMethodArgs); } return !tree.is(Tree.Kind.LAMBDA_EXPRESSION) || ((LambdaExpressionTree) tree).parameters().size() == samMethodArgs.size(); } if(formal.isTagged(JavaType.TYPEVAR) && !arg.isTagged(JavaType.TYPEVAR)) { return subtypeOfTypeVar(arg, (TypeVariableJavaType) formal); } if (formal.isArray() && arg.isArray()) { return isAcceptableType(env, ((ArrayJavaType) arg).elementType(), ((ArrayJavaType) formal).elementType(), autoboxing); } if (arg.isParameterized() || formal.isParameterized() || isWilcardType(arg) || isWilcardType(formal)) { return callWithRawType(arg, formal) || types.isSubtype(arg, formal) || isAcceptableByAutoboxing(arg, formal.erasure()); } return types.isSubtype(arg.erasure(), formal.erasure()) || (autoboxing && isAcceptableByAutoboxing(arg, formal.erasure())); }

Target:
private boolean isAcceptableType(Env env, JavaType arg, JavaType formal, boolean autoboxing) { if(arg.isTagged(JavaType.DEFERRED)) { List<JavaType> samMethodArgs = findSamMethodArgs(formal); AbstractTypedTree tree = ((DeferredType) arg).tree(); if (tree.is(Tree.Kind.METHOD_REFERENCE)) { return validMethodReference(env, (MethodReferenceTree) tree, formal, samMethodArgs); } return !tree.is(Tree.Kind.LAMBDA_EXPRESSION) || ((LambdaExpressionTree) tree).parameters().size() == samMethodArgs.size(); } if(formal.isTagged(JavaType.TYPEVAR) && !arg.isTagged(JavaType.TYPEVAR)) { return subtypeOfTypeVar(arg, (TypeVariableJavaType) formal); } if (formal.isArray() && arg.isArray()) { return isAcceptableType(env, ((ArrayJavaType) arg).elementType(), ((ArrayJavaType) formal).elementType(), autoboxing); } if (arg.isParameterized() || formal.isParameterized() || isWilcardType(arg) || isWilcardType(formal)) { return callWithRawType(arg, formal) || types.isSubtype(arg, formal) || isAcceptableByAutoboxing(arg, formal.erasure()); } return types.isSubtype(arg.erasure(), formal.erasure()) || (autoboxing && isAcceptableByAutoboxing(arg, formal.erasure())); }
Source:
public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) { if ( resolve( context, base, method ) ) { throw new ValidationException( "Invalid property" ); } Object returnValue = null; if ( base instanceof FormatterWrapper ) { returnValue = evaluateFormatExpression( context, base, method, paramTypes, params ); } return returnValue; }

Target:
public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) { if ( resolve( context, base, method ) ) { throw new ValidationException( "Invalid property" ); } Object returnValue = null; if ( base instanceof FormatterWrapper ) { returnValue = evaluateFormatExpression( context, method, params ); } return returnValue; }
Source:
protected GlusterGeoRepSessionDetails getSessionDetails(Map<String, Object> innerMap, GlusterGeoRepSession session) { GlusterGeoRepSessionDetails details = new GlusterGeoRepSessionDetails(); details.setSessionId(session.getId()); Guid masterNodeGlusterId; if(innerMap.containsKey(MASTER_NODE_UUID)) { masterNodeGlusterId = new Guid(innerMap.get(MASTER_NODE_UUID).toString()); } else { log.error("Host Node Id is not available"); return null; } String masterBrickDir = (innerMap.containsKey(MASTER_BRICK)) ? innerMap.get(MASTER_BRICK).toString() : null; GlusterServer glusterServer = getDbUtils().getServerByUuid(masterNodeGlusterId); if (glusterServer != null) { GlusterBrickEntity brick = getDbUtils().getGlusterBrickByServerUuidAndBrickDir(glusterServer.getId(), masterBrickDir); if (brick != null) { details.setMasterBrickId(brick.getId()); } } if (details.getMasterBrickId() == null) { log.errorFormat("Brick information could not be retrieved for gluster host id %1 and brick dir %2", masterNodeGlusterId, masterBrickDir); } String slave = innerMap.containsKey(SLAVE) ? innerMap.get(SLAVE).toString() : null; String[] slaveSplit = (slave != null) ? slave.split("([://]+)") : null; if (slaveSplit != null && slaveSplit.length >= 2) { details.setSlaveHostName(slaveSplit[slaveSplit.length -2]); } details.setStatus(GeoRepSessionStatus.from((String)innerMap.get(STATUS))); details.setCrawlStatus(GeoRepCrawlStatus.from((String)innerMap.get(CRAWL_STATUS))); details.setCheckPointStatus((String)innerMap.get(CHECK_POINT_STATUS)); return details; }

Target:
protected GlusterGeoRepSessionDetails getSessionDetails(Map<String, Object> innerMap, GlusterGeoRepSession session) { GlusterGeoRepSessionDetails details = new GlusterGeoRepSessionDetails(); details.setSessionId(session.getId()); Guid masterNodeGlusterId; if (innerMap.containsKey(MASTER_NODE_UUID)) { masterNodeGlusterId = new Guid(innerMap.get(MASTER_NODE_UUID).toString()); } else { log.error("Master node uuid is not available"); return null; } String masterBrickDir = (innerMap.containsKey(MASTER_BRICK)) ? innerMap.get(MASTER_BRICK).toString() : null; GlusterServer glusterServer = getDbUtils().getServerByUuid(masterNodeGlusterId); if (glusterServer != null) { GlusterBrickEntity brick = getDbUtils().getGlusterBrickByServerUuidAndBrickDir(glusterServer.getId(), masterBrickDir); if (brick != null) { details.setMasterBrickId(brick.getId()); } } if (details.getMasterBrickId() == null) { log.errorFormat("Brick information could not be retrieved for gluster host id %1 and brick dir %2", masterNodeGlusterId, masterBrickDir); } String slave = innerMap.containsKey(SLAVE) ? innerMap.get(SLAVE).toString() : null; String[] slaveSplit = (slave != null) ? slave.split("([://]+)") : null; if (slaveSplit != null && slaveSplit.length >= 2) { details.setSlaveHostName(slaveSplit[slaveSplit.length - 2]); } details.setStatus(GeoRepSessionStatus.from((String) innerMap.get(STATUS))); details.setCrawlStatus(GeoRepCrawlStatus.from((String) innerMap.get(CRAWL_STATUS))); details.setCheckPointStatus((String) innerMap.get(CHECK_POINT_STATUS)); return details; }
Source:
private String getMetadataContainerElement() { if (isInlineMacro) { return "span"; } else { return "div"; } }

Target:
private String getMetadataContainerElement() { if (getBlockState().isInLine()) { return "span"; } else { return "div"; } }
Source:
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) { List<ResolvedMethodDeclaration> candidateMethods = typeDeclaration.getDeclaredMethods().stream() .filter(m -> m.getName().equals(name)) .filter(m -> !staticOnly || m.isStatic()) .collect(Collectors.toList()); if (!Object.class.getCanonicalName().equals(typeDeclaration.getQualifiedName())) { for (ResolvedReferenceType ancestor : typeDeclaration.getAncestors(true)) { if (typeDeclaration != ancestor.getTypeDeclaration()) { candidateMethods.addAll(ancestor.getAllMethodsVisibleToInheritors() .stream() .filter(m -> m.getName().equals(name)) .collect(Collectors.toList())); SymbolReference<ResolvedMethodDeclaration> res = MethodResolutionLogic .solveMethodInType(ancestor.getTypeDeclaration(), name, argumentsTypes, staticOnly); if (res.isSolved()) { candidateMethods.add(res.getCorrespondingDeclaration()); } } } } if (candidateMethods.isEmpty()) { Optional<CompilationUnitContext> cu = findCompilationUnitContext(); if (cu.isPresent()) { SymbolReference<ResolvedMethodDeclaration> parentSolution = cu.get().solveMethod(name, argumentsTypes, staticOnly); if (parentSolution.isSolved()) { candidateMethods.add(parentSolution.getCorrespondingDeclaration()); } } } if (candidateMethods.isEmpty() && typeDeclaration.isInterface()) { SymbolReference<ResolvedMethodDeclaration> res = MethodResolutionLogic.solveMethodInType(new ReflectionClassDeclaration(Object.class, typeSolver), name, argumentsTypes, false); if (res.isSolved()) { candidateMethods.add(res.getCorrespondingDeclaration()); } } return MethodResolutionLogic.findMostApplicable(candidateMethods, name, argumentsTypes, typeSolver); }

Target:
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) { List<ResolvedMethodDeclaration> candidateMethods = typeDeclaration.getDeclaredMethods().stream() .filter(m -> m.getName().equals(name)) .filter(m -> !staticOnly || m.isStatic()) .collect(Collectors.toList()); if (!Object.class.getCanonicalName().equals(typeDeclaration.getQualifiedName())) { for (ResolvedReferenceType ancestor : typeDeclaration.getAncestors(true)) { if (typeDeclaration != ancestor.getTypeDeclaration()) { candidateMethods.addAll(ancestor.getAllMethodsVisibleToInheritors() .stream() .filter(m -> m.getName().equals(name)) .collect(Collectors.toList())); SymbolReference<ResolvedMethodDeclaration> res = MethodResolutionLogic .solveMethodInType(ancestor.getTypeDeclaration(), name, argumentsTypes, staticOnly); if (res.isSolved()) { candidateMethods.add(res.getCorrespondingDeclaration()); } } } } if (candidateMethods.isEmpty() && typeDeclaration.isInterface()) { SymbolReference<ResolvedMethodDeclaration> res = MethodResolutionLogic.solveMethodInType(new ReflectionClassDeclaration(Object.class, typeSolver), name, argumentsTypes, false); if (res.isSolved()) { candidateMethods.add(res.getCorrespondingDeclaration()); } } return MethodResolutionLogic.findMostApplicable(candidateMethods, name, argumentsTypes, typeSolver); }
Source:
public void start() throws CandybeanException { ChromeOptions chromeOptions = new ChromeOptions(); String chromeDriverLogPath = candybean.config.getPathValue("browser.chrome.driver.log.path"); logger.info("chromeDriverLogPath: " + chromeDriverLogPath); chromeOptions.addArguments("--log-path=" + chromeDriverLogPath); String chromeDriverPath = candybean.config.getPathValue("browser.chrome.driver.path"); if("true".equals(candybean.config.getPathValue("parallel.enabled")) && Integer.parseInt(candybean.config.getPathValue("parallel.threads")) > 1) { chromeDriverPath = chromeDriverPath.replaceAll("$", "_" + Thread.currentThread().getName()); } logger.info("chromeDriverPath: " + chromeDriverPath); if(StringUtils.isEmpty(chromeDriverPath) || !new File(chromeDriverPath).exists()){ String error = "Unable to find chrome browser driver from the specified location ("+chromeDriverPath+") in the configuration file! \n" + "Please add a configuration to the candybean config file for key \"browser.chrome.driver.path\" " + "that indicates the absolute or relative location the driver."; logger.severe(error); throw new CandybeanException(error); }else{ System.setProperty("webdriver.chrome.driver", chromeDriverPath); logger.info("Instantiating Chrome with:\n log path:" + chromeDriverLogPath + "\n driver path: " + chromeDriverPath); super.wd = ThreadGuard.protect(new ChromeDriver(chromeOptions)); super.start(); } }

Target:
public void start() throws CandybeanException { ChromeOptions chromeOptions = new ChromeOptions(); String chromeDriverLogPath = candybean.config.getPathValue("browser.chrome.driver.log.path"); logger.info("chromeDriverLogPath: " + chromeDriverLogPath); chromeOptions.addArguments("--log-path=" + chromeDriverLogPath); String chromeDriverPath = candybean.config.getPathValue("browser.chrome.driver.path"); validateChromeDriverExist(chromeDriverPath); if("true".equals(candybean.config.getPathValue("parallel.enabled"))) { String originalChromePath = chromeDriverPath; if(OSValidator.isWindows()) { chromeDriverPath = chromeDriverPath.replaceAll("(.*)(\\.exe)", "$1_" + Thread.currentThread().getName() + "$2"); } else { chromeDriverPath = chromeDriverPath.replaceAll("$", "_" + Thread.currentThread().getName()); } if(!new File(chromeDriverPath).exists()) { try { FileUtils.copyFile(new File(originalChromePath), new File(chromeDriverPath)); if(!OSValidator.isWindows()) { Runtime.getRuntime().exec("chmod u+x " + chromeDriverPath); } } catch(IOException e) { String error = "Cannot duplicate a new chromedriver for parallelization"; logger.severe(error); throw new CandybeanException(error); } } } logger.info("chromeDriverPath: " + chromeDriverPath); System.setProperty("webdriver.chrome.driver", chromeDriverPath); logger.info("Instantiating Chrome with:\n log path:"+ chromeDriverLogPath + "\n driver path: " + chromeDriverPath); super.wd = ThreadGuard.protect(new ChromeDriver(chromeOptions)); super.start(); }
Source:
public VdcReturnValueBase ExecuteAction() { _actionState = CommandActionState.EXECUTE; String tempVar = getDescription(); getReturnValue().setDescription((tempVar != null) ? tempVar : getReturnValue().getDescription()); setActionMessageParameters(); boolean actionAllowed = false; Step validatingStep = ExecutionHandler.addStep(executionContext, StepEnum.VALIDATING, null); try { try { actionAllowed = acquireLock() && (getReturnValue().getCanDoAction() || InternalCanDoAction()); } finally { ExecutionHandler.endStep(executionContext, validatingStep, actionAllowed); } if (actionAllowed) { getReturnValue().setCanDoAction(true); getReturnValue().setIsSyncronious(true); getParameters().setTaskStartTime(System.currentTimeMillis()); Execute(); } else { getReturnValue().setCanDoAction(false); } } finally { freeLock(); } return getReturnValue(); }

Target:
public VdcReturnValueBase ExecuteAction() { _actionState = CommandActionState.EXECUTE; String tempVar = getDescription(); getReturnValue().setDescription((tempVar != null) ? tempVar : getReturnValue().getDescription()); setActionMessageParameters(); boolean actionAllowed = false; Step validatingStep = ExecutionHandler.addStep(executionContext, StepEnum.VALIDATING, null); try { actionAllowed = acquireLock() && (getReturnValue().getCanDoAction() || InternalCanDoAction()); ExecutionHandler.endStep(executionContext, validatingStep, actionAllowed); if (actionAllowed) { getReturnValue().setCanDoAction(true); getReturnValue().setIsSyncronious(true); getParameters().setTaskStartTime(System.currentTimeMillis()); Execute(); } else { getReturnValue().setCanDoAction(false); } } finally { freeLock(); } return getReturnValue(); }
Source:
private Collection<AsyncQuery> updateAsyncQueryCollection(FilterExpression filterExpression, UpdateQuery updateFunction) { log.debug("updateAsyncQueryCollection"); Collection<AsyncQuery> asyncQueryList = null; try { asyncQueryList = (Collection<AsyncQuery>) executeInTransaction(dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQuery.class) .filterExpression(filterExpression) .build(); Iterable<Object> loaded = tx.loadObjects(asyncQueryCollection, scope); Iterator<Object> itr = loaded.iterator(); while (itr.hasNext()) { AsyncQuery query = (AsyncQuery) itr.next(); updateFunction.update(query); tx.save(query, scope); } return loaded; }); } catch (Exception e) { log.error("Exception: {}", e); } return asyncQueryList; }

Target:
private Collection<AsyncQuery> updateAsyncQueryCollection(FilterExpression filterExpression, UpdateQuery updateFunction) { log.debug("updateAsyncQueryCollection"); Collection<AsyncQuery> asyncQueryList = null; asyncQueryList = (Collection<AsyncQuery>) executeInTransaction(dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQuery.class) .filterExpression(filterExpression) .build(); Iterable<Object> loaded = tx.loadObjects(asyncQueryCollection, scope); Iterator<Object> itr = loaded.iterator(); while (itr.hasNext()) { AsyncQuery query = (AsyncQuery) itr.next(); updateFunction.update(query); tx.save(query, scope); } return loaded; }); return asyncQueryList; }
Source:
private void readArchive(ZipFile zipFile) throws IOException { Enumeration<? extends ZipEntry> zipEnums = zipFile.entries(); while (zipEnums.hasMoreElements()) { ZipEntry entry = zipEnums.nextElement(); if (!entry.isDirectory()) { if (defaultsConf == null && entry.getName().equals("defaults.yaml")) { try (InputStream in = zipFile.getInputStream(entry); InputStreamReader isr = new InputStreamReader(in)) { defaultsConf = (Map<String, Object>) yaml.load(isr); } } if (stormConf == null && entry.getName().equals("storm.yaml")) { try (InputStream in = zipFile.getInputStream(entry); InputStreamReader isr = new InputStreamReader(in)) { stormConf = (Map<String, Object>) yaml.load(isr); } } } } }

Target:
private void readArchive(ZipFile zipFile) throws IOException { Enumeration<? extends ZipEntry> zipEnums = zipFile.entries(); while (zipEnums.hasMoreElements()) { ZipEntry entry = zipEnums.nextElement(); if (!entry.isDirectory()) { if (defaultsConf == null && entry.getName().equals("defaults.yaml")) { try (InputStreamReader isr = new InputStreamReader(zipFile.getInputStream(entry))) { defaultsConf = (Map<String, Object>) yaml.load(isr); } } if (stormConf == null && entry.getName().equals("storm.yaml")) { try (InputStreamReader isr = new InputStreamReader(zipFile.getInputStream(entry))) { stormConf = (Map<String, Object>) yaml.load(isr); } } } } }
Source:
private static void printUsage() { final HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(HELP_WIDTH); formatter.printHelp(String.format("java %s [options] -c <config.xml> file...", Main.class.getName()), buildOptionsExcludeHidden()); }

Target:
private static void printUsage() { final HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(HELP_WIDTH); formatter.printHelp(String.format("java %s [options] -c <config.xml> file...", Main.class.getName()), buildOptions()); }
Source:
public String validateFields() { if (this.isEmptyField(FIELD_STRING)) { return Constant.messages.getString("brk.brkpoint.error.nostr"); } if (Match.regex.equals(this.strToMatch(this.getStringValue(FIELD_MATCH)))) { try { Pattern.compile(this.getStringValue(FIELD_STRING)); } catch (Exception e) { return Constant.messages.getString("brk.brkpoint.error.regex"); } } return null; if(FIELD_STRING.contains("#")==true){ return Constant.messages.getString("brk.brkpoint.edit.title"); } }

Target:
public String validateFields() { if (this.isEmptyField(FIELD_STRING)) { return Constant.messages.getString("brk.brkpoint.error.nostr"); } if (Match.regex.equals(this.strToMatch(this.getStringValue(FIELD_MATCH)))) { try { Pattern.compile(this.getStringValue(FIELD_STRING)); } catch (Exception e) { return Constant.messages.getString("brk.brkpoint.error.regex"); } } if (this.getStringValue(FIELD_STRING).contains("#") && Location.url.equals(this.strToLoc(this.getStringValue(FIELD_LOCATION))) && Match.contains.equals(this.strToMatch(this.getStringValue(FIELD_MATCH)))) { return Constant.messages.getString("brk.brkpoint.warn.urlfragment"); } return null; }
Source:
public void synchronizeLocalDatabase() { if (!checkCurrentConnection()) { return; } List<BibEntry> localEntries = bibDatabase.getEntries(); Map<Integer, Integer> idVersionMap = dbmsProcessor.getSharedIDVersionMapping(); removeNotSharedEntries(localEntries, idVersionMap.keySet()); List<Integer> entriesToDrag = new ArrayList<>(); for (Map.Entry<Integer, Integer> idVersionEntry : idVersionMap.entrySet()) { boolean match = false; for (BibEntry localEntry : localEntries) { if (idVersionEntry.getKey() == localEntry.getSharedBibEntryData().getSharedID()) { match = true; if (idVersionEntry.getValue() > localEntry.getSharedBibEntryData().getVersion()) { Optional<BibEntry> sharedEntry = dbmsProcessor.getSharedEntry(idVersionEntry.getKey()); if (sharedEntry.isPresent()) { localEntry.setType(sharedEntry.get().getType(), EntryEventSource.SHARED); localEntry.getSharedBibEntryData() .setVersion(sharedEntry.get().getSharedBibEntryData().getVersion()); for (Field field : sharedEntry.get().getFields()) { Optional<String> sharedFieldValue = sharedEntry.get().getField(field); if (sharedFieldValue.isPresent()) { localEntry.setField(field, sharedFieldValue.get(), EntryEventSource.SHARED); } } Set<Field> redundantLocalEntryFields = localEntry.getFields(); redundantLocalEntryFields.removeAll(sharedEntry.get().getFields()); for (Field redundantField : redundantLocalEntryFields) { localEntry.clearField(redundantField, EntryEventSource.SHARED); } } } } } if (!match) { entriesToDrag.add(idVersionEntry.getKey()); } } for (BibEntry bibEntry : dbmsProcessor.getSharedEntries(entriesToDrag)) { bibDatabase.insertEntry(bibEntry, EntryEventSource.SHARED); } }

Target:
public void synchronizeLocalDatabase() { if (!checkCurrentConnection()) { return; } List<BibEntry> localEntries = bibDatabase.getEntries(); Map<Integer, Integer> idVersionMap = dbmsProcessor.getSharedIDVersionMapping(); removeNotSharedEntries(localEntries, idVersionMap.keySet()); List<Integer> entriesToDrag = new ArrayList<>(); for (Map.Entry<Integer, Integer> idVersionEntry : idVersionMap.entrySet()) { boolean match = false; for (BibEntry localEntry : localEntries) { if (idVersionEntry.getKey() == localEntry.getSharedBibEntryData().getSharedID()) { match = true; if (idVersionEntry.getValue() > localEntry.getSharedBibEntryData().getVersion()) { Optional<BibEntry> sharedEntry = dbmsProcessor.getSharedEntry(idVersionEntry.getKey()); if (sharedEntry.isPresent()) { localEntry.setType(sharedEntry.get().getType(), EntryEventSource.SHARED); localEntry.getSharedBibEntryData() .setVersion(sharedEntry.get().getSharedBibEntryData().getVersion()); sharedEntry.get().getFieldMap().forEach( (field, value) -> localEntry.setField(field, value, EntryEventSource.SHARED) ); localEntry.getFields().stream() .filter(field -> !sharedEntry.get().hasField(field)) .forEach( field -> localEntry.clearField(field, EntryEventSource.SHARED) ); } } } } if (!match) { entriesToDrag.add(idVersionEntry.getKey()); } } for (BibEntry bibEntry : dbmsProcessor.getSharedEntries(entriesToDrag)) { bibDatabase.insertEntry(bibEntry, EntryEventSource.SHARED); } }
Source:
protected DeleteImageGroupVDSCommandParameters buildDeleteMemoryImageParams(List<Guid> guids) { return Injector.get(PostDeleteActionHandler.class).fixParameters( new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(2), isPostZero(), false)); }

Target:
protected DeleteImageGroupVDSCommandParameters buildDeleteMemoryImageParams(List<Guid> guids) { return postDeleteActionHandler.fixParameters( new DeleteImageGroupVDSCommandParameters(guids.get(1), guids.get(0), guids.get(2), isPostZero(), false)); }