auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean checkForChangedDerivedProducts(Pool pool, Pool existingPool, Map<String, Product> changedProducts) { boolean productsChanged = false; if (pool.getDerivedProduct() != null) { productsChanged = !pool.getDerivedProduct().getId() .equals(existingPool.getDerivedProduct().getId()); productsChanged |= (changedProducts != null && changedProducts.containsKey(pool.getDerivedProduct().getId())); } if (productsChanged) { if (pool.getDerivedProduct() != null) { existingPool.setDerivedProduct(pool.getDerivedProduct()); } } else { if (pool.getDerivedProduct() == null && existingPool.getDerivedProduct() != null) { existingPool.setDerivedProduct(null); productsChanged = true; } } return productsChanged; }

Target:
private boolean checkForChangedDerivedProducts(Pool pool, Pool existingPool, Map<String, Product> changedProducts) { boolean dpChanged = false; Product existingDerived = existingPool.getDerivedProduct(); Product incomingDerived = pool.getDerivedProduct(); if (incomingDerived != null) { dpChanged = (existingDerived == null) || (existingDerived.getId() != null && !existingDerived.getId().equals(incomingDerived.getId())) || (changedProducts != null && changedProducts.containsKey(existingDerived.getId())); } else { dpChanged = existingDerived != null; } if (dpChanged) { existingPool.setDerivedProduct(incomingDerived); } return dpChanged; }
Source:
public void testGetStudies() { String url = "/v2/studies?species=mmusculus&assembly=grcm38&pageNumber=0&pageSize=2"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<VariantStudySummary> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantStudySummaryList']", new TypeRef<List<VariantStudySummary>>() { }); System.out.println(response.getBody()); assertEquals("studyId1", variantList.get(0).getStudyId()); assertEquals("studyName1", variantList.get(0).getStudyName()); assertEquals("studyId2", variantList.get(1).getStudyId()); assertEquals("studyName2", variantList.get(1).getStudyName()); }

Target:
public void testGetStudies() { String url = "/v2/studies?species=mmusculus&assembly=grcm38&pageNumber=0&pageSize=2"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<VariantStudySummary> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantStudySummaryList']", new TypeRef<List<VariantStudySummary>>() { }); assertEquals("studyId1", variantList.get(0).getStudyId()); assertEquals("studyName1", variantList.get(0).getStudyName()); assertEquals("studyId2", variantList.get(1).getStudyId()); assertEquals("studyName2", variantList.get(1).getStudyName()); }
Source:
public EventTypeControllerTest() throws Exception { final EventTypeController controller = new EventTypeController(eventTypeRepository, topicRepository, partitionResolver, enrichment, featureToggleService); final MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(objectMapper); mockMvc = standaloneSetup(controller).setMessageConverters(new StringHttpMessageConverter(), jackson2HttpMessageConverter).build(); doReturn(false).when(featureToggleService).isFeatureEnabled(any(FeatureToggleService.Feature.class)); }

Target:
public EventTypeControllerTest() throws Exception { final EventTypeController controller = new EventTypeController(eventTypeRepository, topicRepository, partitionResolver, enrichment, featureToggleService, uuid); Mockito.doReturn(randomUUID).when(uuid).randomUUID(); final MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(objectMapper); mockMvc = standaloneSetup(controller).setMessageConverters(new StringHttpMessageConverter(), jackson2HttpMessageConverter).build(); doReturn(false).when(featureToggleService).isFeatureEnabled(any()); }
Source:
private void replicateLedgerFragment(LedgerHandle lh, final LedgerFragment ledgerFragment, final Map<Integer, BookieSocketAddress> targetBookieAddresses) throws InterruptedException, BKException { CompletableFuture<Void> result = new CompletableFuture<>(); ResultCallBack resultCallBack = new ResultCallBack(result); SingleFragmentCallback cb = new SingleFragmentCallback( resultCallBack, lh, ledgerFragment.getFirstEntryId(), getReplacedBookiesMap(ledgerFragment, targetBookieAddresses)); Set<BookieSocketAddress> targetBookieSet = Sets.newHashSet(); targetBookieSet.addAll(targetBookieAddresses.values()); asyncRecoverLedgerFragment(lh, ledgerFragment, cb, targetBookieSet); try { SyncCallbackUtils.waitForResult(result); } catch (BKException err) { throw BKException.create(bkc.getReturnRc(err.getCode())); } }

Target:
private void replicateLedgerFragment(LedgerHandle lh, final LedgerFragment ledgerFragment, final Map<Integer, BookieSocketAddress> targetBookieAddresses) throws InterruptedException, BKException { CompletableFuture<Void> result = new CompletableFuture<>(); ResultCallBack resultCallBack = new ResultCallBack(result); SingleFragmentCallback cb = new SingleFragmentCallback( resultCallBack, lh, ledgerFragment.getFirstEntryId(), getReplacementBookiesMap(ledgerFragment, targetBookieAddresses)); Set<BookieSocketAddress> targetBookieSet = Sets.newHashSet(); targetBookieSet.addAll(targetBookieAddresses.values()); asyncRecoverLedgerFragment(lh, ledgerFragment, cb, targetBookieSet); try { SyncCallbackUtils.waitForResult(result); } catch (BKException err) { throw BKException.create(bkc.getReturnRc(err.getCode())); } }
Source:
public void filter(ContainerRequestContext requestContext) throws IOException { String operation = requestContext.getMethod() + " /" + requestContext.getUriInfo().getPath(); String traceId = requestContext.getHeaderString(TraceHttpHeaders.TRACE_ID); String spanId = requestContext.getHeaderString(TraceHttpHeaders.SPAN_ID); if (Strings.isNullOrEmpty(traceId)) { Tracer.initTrace(Optional.<Boolean>absent(), Tracers.randomId()); Tracer.startSpan(operation); } else { Tracer.initTrace(hasSampledHeader(requestContext), traceId); if (spanId == null) { Tracer.startSpan(operation); } else { Tracer.startSpan(operation, spanId); } } Tracer.addEvent(Events.serverReceive(System.currentTimeMillis(), TimeUnit.MILLISECONDS)); MDC.put(MDC_KEY, Tracer.getTraceId()); requestContext.setProperty("com.palantir.remoting1.traceId", Tracer.getTraceId()); }

Target:
public void filter(ContainerRequestContext requestContext) throws IOException { String operation = requestContext.getMethod() + " /" + requestContext.getUriInfo().getPath(); String traceId = requestContext.getHeaderString(TraceHttpHeaders.TRACE_ID); String spanId = requestContext.getHeaderString(TraceHttpHeaders.SPAN_ID); if (Strings.isNullOrEmpty(traceId)) { Tracer.initTrace(Optional.<Boolean>absent(), Tracers.randomId()); Tracer.startSpan(operation, SpanType.SERVER_INCOMING); } else { Tracer.initTrace(hasSampledHeader(requestContext), traceId); if (spanId == null) { Tracer.startSpan(operation, SpanType.SERVER_INCOMING); } else { Tracer.startSpan(operation, spanId, SpanType.SERVER_INCOMING); } } MDC.put(MDC_KEY, Tracer.getTraceId()); requestContext.setProperty("com.palantir.remoting1.traceId", Tracer.getTraceId()); }
Source:
public void shouldCompactIfVacuumWasNeverPerformedAndTheDbTimeIsLessThanCompactInterval() throws Exception { SqlConnection sqlConnection = setUpSqlConnection(null, COMPACT_INTERVAL_MILLIS / SMALL_POSITIVE_FACTOR); assertThatVacuumWasPerformed(sqlConnection, true); }

Target:
public void shouldCompactIfVacuumWasNeverPerformedAndTheDbTimeIsLessThanCompactInterval() throws Exception { SqlConnection sqlConnection = setUpSqlConnection(null, COMPACT_INTERVAL_MILLIS / SMALL_POSITIVE_FACTOR); assertThatVacuumWasPerformed(sqlConnection); }
Source:
public <TInput> void accept(GenericFeedRangeVisitor<TInput> visitor, TInput input) { if (visitor == null) { throw new NullPointerException("visitor"); } visitor.visit(this, input); }

Target:
public <TInput> void accept(GenericFeedRangeVisitor<TInput> visitor, TInput input) { checkNotNull(visitor, "Argument 'visitor' must not be null"); visitor.visit(this, input); }
Source:
public static List<TradeCurrency> getAllRevolutCurrencies() { ArrayList<TradeCurrency> currencies = new ArrayList<>(Arrays.asList( new FiatCurrency("AED"), new FiatCurrency("AUD"), new FiatCurrency("BGN"), new FiatCurrency("CAD"), new FiatCurrency("CHF"), new FiatCurrency("CZK"), new FiatCurrency("DKK"), new FiatCurrency("EUR"), new FiatCurrency("GBP"), new FiatCurrency("HKD"), new FiatCurrency("HRK"), new FiatCurrency("HUF"), new FiatCurrency("HUF"), new FiatCurrency("ILS"), new FiatCurrency("INR"), new FiatCurrency("ISK"), new FiatCurrency("JPY"), new FiatCurrency("JPY"), new FiatCurrency("MAD"), new FiatCurrency("MXN"), new FiatCurrency("NOK"), new FiatCurrency("NZD"), new FiatCurrency("PLN"), new FiatCurrency("QAR"), new FiatCurrency("RON"), new FiatCurrency("RSD"), new FiatCurrency("RUB"), new FiatCurrency("SAR"), new FiatCurrency("SEK"), new FiatCurrency("SGD"), new FiatCurrency("THB"), new FiatCurrency("TRY"), new FiatCurrency("USD"), new FiatCurrency("ZAR") )); currencies.sort(Comparator.comparing(TradeCurrency::getCode)); return currencies; }

Target:
public static List<TradeCurrency> getAllRevolutCurrencies() { ArrayList<TradeCurrency> currencies = new ArrayList<>(Arrays.asList( new FiatCurrency("AED"), new FiatCurrency("AUD"), new FiatCurrency("BGN"), new FiatCurrency("CAD"), new FiatCurrency("CHF"), new FiatCurrency("CZK"), new FiatCurrency("DKK"), new FiatCurrency("EUR"), new FiatCurrency("GBP"), new FiatCurrency("HKD"), new FiatCurrency("HRK"), new FiatCurrency("HUF"), new FiatCurrency("ILS"), new FiatCurrency("ISK"), new FiatCurrency("JPY"), new FiatCurrency("MAD"), new FiatCurrency("MXN"), new FiatCurrency("NOK"), new FiatCurrency("NZD"), new FiatCurrency("PLN"), new FiatCurrency("QAR"), new FiatCurrency("RON"), new FiatCurrency("RSD"), new FiatCurrency("RUB"), new FiatCurrency("SAR"), new FiatCurrency("SEK"), new FiatCurrency("SGD"), new FiatCurrency("THB"), new FiatCurrency("TRY"), new FiatCurrency("USD"), new FiatCurrency("ZAR") )); currencies.sort(Comparator.comparing(TradeCurrency::getCode)); return currencies; }
Source:
public void testRuleEndPortWhenNotEqual() { assert !ruleEndPort(50).apply(ruleRef); }

Target:
public void testRuleEndPortWhenNotEqual() { assertTrue(!ruleEndPort(50).apply(ruleRef), "expected end port not to be 50 for " + ruleRef); }
Source:
default boolean updateTaskExecutionState(TaskExecutionState taskExecutionState) { return updateTaskExecutionState(TaskExecutionStateWrapper.createFrom(taskExecutionState)); }

Target:
default boolean updateTaskExecutionState(TaskExecutionState taskExecutionState) { return updateTaskExecutionState(new TaskExecutionStateTransition(taskExecutionState)); }
Source:
private long openSharedGroupOrFail(Durability durability, byte[] key) { int i = 0; long start = System.nanoTime(); RuntimeException lastError = null; while (TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS) < INCREMENTAL_BACKOFF_LIMIT_MS) { try { long nativePtr = createNativeWithImplicitTransactions(nativeReplicationPtr, durability.value, key); if (i > 0) { RealmLog.w("IncompatibleLockFile was detected. Error was resolved after " + i + " retries"); } return nativePtr; } catch (IncompatibleLockFileException e) { i++; lastError = e; try { Thread.sleep(getSleepTime(i)); RealmLog.d("Waiting for another process to release the Realm file: " + path); } catch (InterruptedException ignored) { RealmLog.d("Waiting for Realm to open interrupted: " + path); } } } throw new RealmError("Could not open the Realm file: " + lastError.getMessage()); }

Target:
private long openSharedGroupOrFail(Durability durability, byte[] key) { int i = 0; final long start = System.nanoTime(); RuntimeException lastError = null; while (TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS) < INCREMENTAL_BACKOFF_LIMIT_MS) { try { long nativePtr = createNativeWithImplicitTransactions(nativeReplicationPtr, durability.value, key); if (i > 0) { RealmLog.w("IncompatibleLockFile was detected. Error was resolved after " + i + " retries"); } return nativePtr; } catch (IncompatibleLockFileException e) { i++; lastError = e; try { Thread.sleep(getSleepTime(i)); RealmLog.d("Waiting for another process to release the Realm file: " + path); } catch (InterruptedException ignored) { RealmLog.d("Waiting for Realm to open interrupted: " + path); } } } throw new RealmError("Could not open the Realm file: " + lastError.getMessage()); }
Source:
private static Object[] parametersForVarargs(Class<?>[] parameterTypes, Object[] parameters) { int fixedLen = parameterTypes.length - 1; Class<?> componentType = parameterTypes[fixedLen].getComponentType(); assert componentType != null; int arrayLength = parameters.length - fixedLen; if (arrayLength >= 0) { if (arrayLength == 1 && parameterTypes[fixedLen].isInstance(parameters[fixedLen])) { return parameters; } else { Object array = DefaultTypeTransformation.castToVargsArray(parameters, arrayLength, parameterTypes[fixedLen]); Object[] parameters2 = new Object[fixedLen + 1]; System.arraycopy(parameters, 0, parameters2, 0, fixedLen); parameters2[fixedLen] = array; return parameters2; } } else { return parameters; } }

Target:
private static Object[] parametersForVarargs(Class<?>[] parameterTypes, Object[] parameters) { int fixedLen = parameterTypes.length - 1; Class<?> componentType = parameterTypes[fixedLen].getComponentType(); assert componentType != null; if (componentType.isPrimitive()) { componentType = ClassUtils.primitiveToWrapper(componentType); } int arrayLength = parameters.length - fixedLen; if (arrayLength >= 0) { if (arrayLength == 1 && parameterTypes[fixedLen].isInstance(parameters[fixedLen])) { return parameters; } else if ((arrayLength > 0 && componentType.isInstance(parameters[fixedLen])) || arrayLength == 0) { Object array = DefaultTypeTransformation.castToVargsArray(parameters, fixedLen, parameterTypes[fixedLen]); Object[] parameters2 = new Object[fixedLen + 1]; System.arraycopy(parameters, 0, parameters2, 0, fixedLen); parameters2[fixedLen] = array; return parameters2; } } return parameters; }
Source:
public static String toTypeString(TypeMirror type) { if ( type.getKind() == TypeKind.ARRAY ) { final TypeMirror typeMirror = ( (ArrayType) type ).getComponentType(); final List<? extends AnnotationMirror> annotationMirrors = typeMirror.getAnnotationMirrors(); if ( !annotationMirrors.isEmpty() ) { String typeName = typeMirror.toString(); if ( typeName.startsWith( "(" ) && typeName.endsWith( ")" ) ) { int seperator = typeName.indexOf( ":: " ); if ( seperator != -1 ) { return typeName.substring( seperator + 3, typeName.length() - 1 ) + "[]"; } } } } if ( type.getKind().isPrimitive() ) { return PRIMITIVES.get( type.getKind() ); } return type.toString(); }

Target:
public static String toTypeString(TypeMirror type) { if ( type.getKind().isPrimitive() ) { return PRIMITIVES.get( type.getKind() ); } return type.toString(); }
Source:
private Venue adapt(VenueDTO dto) { List<VenueName> nameInformation = Lists.newArrayList(); for (VenueNameDTO duple : dto.venueNames) { nameInformation.add(new VenueName(duple.name, new Language(duple.language))); } return new Venue(new VenueGroup(dto.group), new VenueType(dto.type), nameInformation); }

Target:
private Venue adapt(VenueDTO dto) { List<VenueName> names = Lists.newArrayList(); for (VenueNameDTO duple : dto.venueNames) { names.add(new VenueName(duple.name, new Language(duple.language))); } return new Venue(new VenueGroup(dto.group), new VenueType(dto.type), names); }
Source:
public void overwriteEnrichmentTags() { uploadEnrichmentTagOverwriter.overwriteEnrichmentTags(); verify(enrichmentTagRepository).deleteAll(); verify(uploadEnrichmentTagCopier).copyUploadedEnrichmentTags(); verify(uploadEnrichmentTagRepository, never()).deleteAll(); verifyNoMoreInteractions(enrichmentTagRepository, uploadEnrichmentTagCopier); }

Target:
public void overwriteEnrichmentTags() { uploadEnrichmentTagOverwriter.overwriteEnrichmentTags(); verify(enrichmentTagRepository).deleteAll(); verify(uploadEnrichmentTagCopier).copyUploadedEnrichmentTags(); verifyZeroInteractions(uploadEnrichmentTagRepository); verifyNoMoreInteractions(enrichmentTagRepository, uploadEnrichmentTagCopier); }
Source:
public static IfStatement ifDefined(Name var,Statement...s) { StringBuffer b=new StringBuffer(64); for(int i=0;i<var.length();i++) { } return new IfStatement(new SimpleExpression(buildNotUndefined(var)),s); }

Target:
public static IfStatement ifDefined(Name var,Statement...s) { return new IfStatement(new SimpleExpression(buildNotUndefined(var)),s); }
Source:
protected void bindValidityChecks(ActionsViewTable viewTable, Button btnGetValidityErrors, Button btnGenerateScript, Button btnSaveParam) { this.viewTable = viewTable; this.btnGetValidityErrors = btnGetValidityErrors; this.btnGenerateScript = btnGenerateScript; this.btnSaveParam = btnSaveParam; this.scriptGeneratorModel.getScriptGeneratorTable().removePropertyChangeListener(ACTIONS_PROPERTY, actionChangeListener); this.scriptGeneratorModel.getScriptGeneratorTable().addPropertyChangeListener(ACTIONS_PROPERTY, actionChangeListener); this.scriptGeneratorModel.removePropertyChangeListener(VALIDITY_ERROR_MESSAGE_PROPERTY, actionChangeListener); this.scriptGeneratorModel.addPropertyChangeListener(VALIDITY_ERROR_MESSAGE_PROPERTY, actionChangeListener); this.scriptGeneratorModel.removePropertyChangeListener(GENERATED_SCRIPT_FILEPATH_PROPERTY, generatedScriptListener); this.scriptGeneratorModel.addPropertyChangeListener(GENERATED_SCRIPT_FILEPATH_PROPERTY, generatedScriptListener); this.scriptGeneratorModel.removePropertyChangeListener(GENERATED_DATA_EXCHANGE_FILEPATH_PROPERTY, generatedDataExchangeFileListener); this.scriptGeneratorModel.addPropertyChangeListener(GENERATED_DATA_EXCHANGE_FILEPATH_PROPERTY, generatedDataExchangeFileListener); this.scriptGeneratorModel.removePropertyChangeListener("data files", loadDataFileListener); this.scriptGeneratorModel.addPropertyChangeListener("data files", loadDataFileListener); this.scriptGeneratorModel.removePropertyChangeListener("unsupported version",unsupportedFileVersionListener); this.scriptGeneratorModel.addPropertyChangeListener("unsupported version", unsupportedFileVersionListener); this.scriptGeneratorModel.removePropertyChangeListener("Script definition not matched", evt->{ MessageDialog.openError(Display.getDefault().getActiveShell(), "ERROR", CONFIG_NOT_MATCHED_ERROR); }); this.scriptGeneratorModel.addPropertyChangeListener("Script definition not matched", evt->{ MessageDialog.openError(Display.getDefault().getActiveShell(), "ERROR", CONFIG_NOT_MATCHED_ERROR); }); }

Target:
protected void bindValidityChecks(ActionsViewTable viewTable, Button btnGetValidityErrors, Button btnGenerateScript, Button btnSaveParam) { this.viewTable = viewTable; this.btnGetValidityErrors = btnGetValidityErrors; this.btnGenerateScript = btnGenerateScript; this.btnSaveParam = btnSaveParam; this.scriptGeneratorModel.getScriptGeneratorTable().removePropertyChangeListener(ACTIONS_PROPERTY, actionChangeListener); this.scriptGeneratorModel.getScriptGeneratorTable().addPropertyChangeListener(ACTIONS_PROPERTY, actionChangeListener); this.scriptGeneratorModel.removePropertyChangeListener(VALIDITY_ERROR_MESSAGE_PROPERTY, actionChangeListener); this.scriptGeneratorModel.addPropertyChangeListener(VALIDITY_ERROR_MESSAGE_PROPERTY, actionChangeListener); }
Source:
public void showScoreAndAmmo() { addText("Ammo: "+ screenController.getShark().getAmmo() +" Score: " + Highscores.getInstance().getScore(), TEXT_SCALE_SIZE_SMALL, Position.upperCornerPosition()); }

Target:
private void showScoreAndAmmo() { addText("Ammo: "+ screenController.getShark().getAmmo() +" Score: " + Highscores.getInstance().getScore(), TEXT_SCALE_SIZE_SMALL, Position.upperCornerPosition()); }
Source:
BitmapBuilder findObjects(Set<? extends ObjectId> start, BitmapBuilder seen, boolean ignoreMissingStart) throws MissingObjectException, IncorrectObjectTypeException, IOException { final BitmapBuilder bitmapResult = bitmapIndex.newBitmapBuilder(); for (ObjectId obj : start) { Bitmap bitmap = bitmapIndex.getBitmap(obj); if (bitmap != null) bitmapResult.or(bitmap); } boolean marked = false; for (ObjectId obj : start) { try { if (!bitmapResult.contains(obj)) { walker.markStart(walker.parseAny(obj)); marked = true; } } catch (MissingObjectException e) { if (ignoreMissingStart) continue; throw e; } } if (marked) { if (seen == null) { walker.setRevFilter(new AddToBitmapFilter(bitmapResult)); } else { walker.setRevFilter( new AddUnseenToBitmapFilter(seen, bitmapResult)); } try { while (walker.next() != null) { pm.update(1); countOfBitmapIndexMisses++; } RevObject ro; while ((ro = walker.nextObject()) != null) { bitmapResult.addObject(ro, ro.getType()); pm.update(1); } } catch (MissingObjectException e) { if (!ignoreMissingStart) { throw e; } } } return bitmapResult; }

Target:
BitmapBuilder findObjects(Set<? extends ObjectId> start, BitmapBuilder seen, boolean ignoreMissingStart) throws MissingObjectException, IncorrectObjectTypeException, IOException { final BitmapBuilder bitmapResult = bitmapIndex.newBitmapBuilder(); for (ObjectId obj : start) { Bitmap bitmap = bitmapIndex.getBitmap(obj); if (bitmap != null) bitmapResult.or(bitmap); } boolean marked = false; for (ObjectId obj : start) { try { if (!bitmapResult.contains(obj)) { walker.markStart(walker.parseAny(obj)); marked = true; } } catch (MissingObjectException e) { if (ignoreMissingStart) continue; throw e; } } if (marked) { if (seen == null) { walker.setRevFilter(new AddToBitmapFilter(bitmapResult)); } else { walker.setRevFilter( new AddUnseenToBitmapFilter(seen, bitmapResult)); } while (next(walker, ignoreMissingStart) != null) { pm.update(1); countOfBitmapIndexMisses++; } RevObject ro; while ((ro = nextObject(walker, ignoreMissingStart)) != null) { bitmapResult.addObject(ro, ro.getType()); pm.update(1); } } return bitmapResult; }
Source:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, CANCELLING, ""); }

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, CANCELLING, EMPTY_VALUE); }
Source:
private RemoteATCommandResponsePacket createPacket(int frameId, ATCommandStatus status, XBee16BitAddress addr16, XBee64BitAddress addr64, String ni, XBee16BitAddress parentAddr, byte role, byte rssi) { byte[] value = new byte[2 + 8 + ni.length() + 1 + 2 + 1 + 1 + 2 + 2 + 4 + 1 ]; byte[] profile = new byte[]{(byte)0xC1, 0x05}; byte[] manufacturer = new byte[]{0x10, 0x1E}; byte[] dd = new byte[]{0x00, 0x03, 0x00, 0x00}; System.arraycopy(addr16.getValue(), 0, value, 0, 2); System.arraycopy(addr64.getValue(), 0, value, 2, 8); System.arraycopy(ni.getBytes(), 0, value, 10, ni.length()); value[10 + ni.length()] = 0x00; System.arraycopy(parentAddr.getValue(), 0, value, 11 + ni.length(), 2); value[13 + ni.length()] = role; value[14 + ni.length()] = 0x00; System.arraycopy(profile, 0, value, 15 + ni.length(), 2); System.arraycopy(manufacturer, 0, value, 17 + ni.length(), 2); System.arraycopy(dd, 0, value, 19 + ni.length(), 4); value[13 + ni.length()] = rssi; return new RemoteATCommandResponsePacket(frameId, addr64, addr16, "ND", status, value); }

Target:
private ATCommandResponsePacket createPacket(int frameId, ATCommandStatus status, XBee16BitAddress addr16, XBee64BitAddress addr64, String ni, XBee16BitAddress parentAddr, byte role, byte rssi) { byte[] value = new byte[2 + 8 + ni.length() + 1 + 2 + 1 + 1 + 2 + 2 + 4 + 1 ]; byte[] profile = new byte[]{(byte)0xC1, 0x05}; byte[] manufacturer = new byte[]{0x10, 0x1E}; byte[] dd = new byte[]{0x00, 0x03, 0x00, 0x00}; System.arraycopy(addr16.getValue(), 0, value, 0, 2); System.arraycopy(addr64.getValue(), 0, value, 2, 8); System.arraycopy(ni.getBytes(), 0, value, 10, ni.length()); value[10 + ni.length()] = 0x00; System.arraycopy(parentAddr.getValue(), 0, value, 11 + ni.length(), 2); value[13 + ni.length()] = role; value[14 + ni.length()] = 0x00; System.arraycopy(profile, 0, value, 15 + ni.length(), 2); System.arraycopy(manufacturer, 0, value, 17 + ni.length(), 2); System.arraycopy(dd, 0, value, 19 + ni.length(), 4); value[13 + ni.length()] = rssi; return new ATCommandResponsePacket(frameId, status, "ND", value); }
Source:
public void changeCurrentEdge(int amount) { currentEdge += amount; }

Target:
public void changeCurrentEdge(int amount) { currentEdge = Math.max(currentEdge + amount, 0); }
Source:
public void handle(GlowSession session, UseItemMessage message) { GlowPlayer player = session.getPlayer(); ItemStack holding = player.getInventory().getItem(message.getEquipmentSlot()); if (!InventoryUtil.isEmpty(holding)) { ItemType type = ItemTable.instance().getItem(holding.getType()); if (type != null) { if (type.getContext() == Context.AIR || type.getContext() == Context.ANY) { type.rightClickAir(player, holding); } else { if ((holding.getType() == Material.WATER_BUCKET || holding.getType() == Material.LAVA_BUCKET) && player.getGameMode() != GameMode.CREATIVE) { holding.setType(Material.BUCKET); } } } if (holding.getAmount() <= 0) { holding = InventoryUtil.createEmptyStack(); } player.getInventory().setItem(message.getEquipmentSlot(), holding); } }

Target:
public void handle(GlowSession session, UseItemMessage message) { GlowPlayer player = session.getPlayer(); ItemStack holding = InventoryUtil .itemOrEmpty(player.getInventory().getItem(message.getEquipmentSlot())); PlayerInteractEvent event = EventFactory .onPlayerInteract(player, Action.RIGHT_CLICK_AIR, message.getEquipmentSlot()); if (event.useItemInHand() == null || event.useItemInHand() == Event.Result.DENY) { return; } if (!InventoryUtil.isEmpty(holding)) { ItemType type = ItemTable.instance().getItem(holding.getType()); if (type != null) { if (type.getContext() == Context.AIR || type.getContext() == Context.ANY) { type.rightClickAir(player, holding); } else { if ((holding.getType() == Material.WATER_BUCKET || holding.getType() == Material.LAVA_BUCKET) && player.getGameMode() != GameMode.CREATIVE) { holding.setType(Material.BUCKET); } } } if (holding.getAmount() <= 0) { holding = InventoryUtil.createEmptyStack(); } player.getInventory().setItem(message.getEquipmentSlot(), holding); } }
Source:
public Method getJavaMethod() { if (this.javaMethod == null) { Preconditions.notEmpty(getJavaMethods(), "No method with name: " + this.methodName); Preconditions.condition(getJavaMethods().size() == 1, "Multiple methods with name: " + this.methodName); this.javaMethod = getJavaMethods().get(0); } return this.javaMethod; }

Target:
public Method getJavaMethod() { if (this.javaMethod == null) { if (StringUtils.isNotBlank(this.methodParameterTypes)) { this.javaMethod = ReflectionUtils.findMethod(getJavaClass(), this.methodName, this.methodParameterTypes).orElseThrow( () -> new PreconditionViolationException(String.format( "Could not find method with name [%s] and parameter types [%s] in class [%s].", this.methodName, this.methodParameterTypes, getJavaClass().getName()))); } else { this.javaMethod = ReflectionUtils.findMethod(getJavaClass(), this.methodName).orElseThrow( () -> new PreconditionViolationException( String.format("Could not find method with name [%s] in class [%s].", this.methodName, getJavaClass().getName()))); } } return this.javaMethod; }
Source:
public void start(ServiceProvider<Service> serviceProvider) { addDefaultSerializerIfNoneRegistered(serializers, Serializable.class, (Class) CompactJavaSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Long.class, LongSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Integer.class, IntegerSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Float.class, FloatSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Double.class, DoubleSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Character.class, CharSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, String.class, StringSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, byte[].class, ByteArraySerializer.class); }

Target:
public void start(ServiceProvider<Service> serviceProvider) { addDefaultSerializerIfNoneRegistered(serializers, Serializable.class, CompactJavaSerializer.<Serializable>asTypedSerializer()); addDefaultSerializerIfNoneRegistered(serializers, Long.class, LongSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Integer.class, IntegerSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Float.class, FloatSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Double.class, DoubleSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, Character.class, CharSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, String.class, StringSerializer.class); addDefaultSerializerIfNoneRegistered(serializers, byte[].class, ByteArraySerializer.class); }
Source:
static String getDesc(ConfigurationKey key) { try { Field field = ConfigurationKey.class.getDeclaredField(key.toString()); if (field != null && field.isEnumConstant()) { Description description = field.getAnnotation(Description.class); if (description == null) { return null; } return description.value(); } } catch (Exception e) { } return null; }

Target:
static String getDesc(ConfigurationKey key) { try { Field field = ConfigurationKey.class.getDeclaredField(key.toString()); if (field != null && field.isEnumConstant()) { Description description = field.getAnnotation(Description.class); if (description == null) { return null; } return description.value(); } } catch (NoSuchFieldException | SecurityException | NullPointerException ignored) { } return null; }
Source:
public UpdateRequest process(UpdateRequest request) throws PluginExecutionException, StopProcessingException { Map<String, ShareableMetacardImpl> previous = getPreviousShareableMetacards(request); request .getUpdates() .stream() .map(Map.Entry::getValue) .filter(ShareableMetacardImpl::canShare) .map(ShareableMetacardImpl::from) .filter(shareableMC -> StringUtils.isEmpty(shareableMC.getOwner())) .forEach(shareableMC -> shareableMC.setOwner(previous.get(shareableMC.getId()).getOwner())); return request; }

Target:
public UpdateRequest process(UpdateRequest request) throws PluginExecutionException, StopProcessingException { request .getUpdates() .stream() .map(Map.Entry::getValue) .filter(ShareableMetacardImpl::canShare) .map(ShareableMetacardImpl::createOrThrow) .filter(shareableMetacard -> StringUtils.isEmpty(shareableMetacard.getOwner())) .forEach( shareableMetacard -> copyOwner( getPreviousShareableMetacards(request).get(shareableMetacard.getId()), shareableMetacard)); return request; }
Source:
private void recreateZKConnection() { try { zk.close(); } catch (InterruptedException e) { LOG.error("Error closing ZK connection : " + e); } finally { try { createNewZKConnection(); } catch (IOException e) { LOG.error("Error creating new ZK COnnection for agent: " + e); } } }

Target:
private void recreateZKConnection() { try { zk.close(); } catch (InterruptedException e) { LOG.error("Error closing ZK connection : ", e); } finally { try { createNewZKConnection(); } catch (IOException e) { LOG.error("Error creating new ZK COnnection for agent: ", e); } } }
Source:
public void define(Context context) { NewRepository repository = context.createRepository(CheckList.REPOSITORY_KEY, Php.KEY).setName(REPOSITORY_NAME); Set<Class> checkClasses = ImmutableSet.<Class>builder() .addAll(CheckList.getChecks()) .addAll(CheckList.getPhpIniChecks()) .build(); new AnnotationBasedRulesDefinition(repository, Php.KEY).addRuleClasses(false, checkClasses); repository.done(); }

Target:
public void define(Context context) { NewRepository repository = context.createRepository(CheckList.REPOSITORY_KEY, Php.KEY).setName(REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, Php.KEY).addRuleClasses(false, CheckList.getAllChecks()); for (NewRule rule : repository.rules()) { String metadataKey = rule.key(); rule.setInternalKey(metadataKey); rule.setHtmlDescription(readRuleDefinitionResource(metadataKey + ".html")); addMetadata(rule, metadataKey); } repository.done(); }
Source:
protected static String toCamelCase(String originalName) { String[] words = originalName.split("-"); StringBuilder nameBuilder = new StringBuilder(originalName.length()); nameBuilder.append(words[0]); for (int i = 1; i < words.length; i++) { nameBuilder.append(words[i].substring(0, 1).toUpperCase()); nameBuilder.append(words[i].substring(1)); } return nameBuilder.toString(); }

Target:
protected static String toCamelCase(String originalName) { String[] words = originalName.split("-+"); StringBuilder nameBuilder = new StringBuilder(originalName.length()); for (int i = 0; i < words.length; i++) { if (nameBuilder.length() == 0) { nameBuilder.append(words[i]); } else { nameBuilder.append(words[i].substring(0, 1).toUpperCase()); nameBuilder.append(words[i].substring(1)); } } return nameBuilder.toString(); }
Source:
protected IStatus run(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); try { register(root); List<Container> childrenPath = walkDirectory(subMonitor.split(50)); registerWatchService(childrenPath, subMonitor.split(50)); } catch (IOException e) { return new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, e.getMessage(), e); } catch (OperationCanceledException e) { return new Status(IStatus.CANCEL, ResourcesPlugin.PI_RESOURCES, e.getMessage(), e); } catch (CoreException e) { return new Status(e.getStatus().getSeverity(), ResourcesPlugin.PI_RESOURCES, e.getMessage(), e); } return Status.OK_STATUS; }

Target:
protected IStatus run(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); try { if (register(root)) { List<Container> childrenPath = walkDirectory(subMonitor.split(50)); registerWatchService(childrenPath, subMonitor.split(50)); } else { monitor.setCanceled(true); return Status.CANCEL_STATUS; } } catch (IOException e) { return new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, e.getMessage(), e); } catch (CoreException e) { return new Status(e.getStatus().getSeverity(), ResourcesPlugin.PI_RESOURCES, e.getMessage(), e); } return Status.OK_STATUS; }
Source:
private TablePopulationRequirements getMVInfoMessage(Table table, MaterializedViewInfo mv) { TablePopulationRequirements retval; if (! mv.getIssafewithnonemptysources()) { String viewName = mv.getTypeName(); String sourceName = mv.getParent().getTypeName(); String errorMessage = createViewDisallowedMessage(viewName, sourceName); retval = new TablePopulationRequirements(viewName); retval.setErrorMessage(errorMessage); if ( ! m_newTables.contains(sourceName)) { retval.addTableName(sourceName); } return retval; } return null; }

Target:
private TablePopulationRequirements getMVInfoMessage(Table table, MaterializedViewInfo mv) { TablePopulationRequirements retval; if (! mv.getIssafewithnonemptysources()) { String viewName = mv.getTypeName(); String sourceName = mv.getParent().getTypeName(); String errorMessage = createViewDisallowedMessage(viewName, sourceName); retval = new TablePopulationRequirements(viewName); retval.setErrorMessage(errorMessage); retval.addTableName(sourceName); return retval; } return null; }
Source:
public void rowKeyIsSetInRequest() throws IOException { Get get = makeValidGet(dataHelper.randomData(PREFIX_DATA)); Query query = Query.create(TABLE_ID); getAdapter.adapt(get, throwingReadHooks, query); ByteString adaptedRowKey = query.toProto(requestContext).getRows().getRowKeys(0); Assert.assertEquals( new String(get.getRow(), StandardCharsets.UTF_8), adaptedRowKey.toStringUtf8()); }

Target:
public void rowKeyIsSetInRequest() throws IOException { Get get = makeValidGet(dataHelper.randomData(PREFIX_DATA)); getAdapter.adapt(get, throwingReadHooks, query); ByteString adaptedRowKey = query.toProto(requestContext).getRows().getRowKeys(0); Assert.assertEquals( new String(get.getRow(), StandardCharsets.UTF_8), adaptedRowKey.toStringUtf8()); }
Source:
public String ac_psu_remove_pool_$_1(Args args) { if(Glob.isGlob(args.argv(0))) { Glob glob = new Glob(args.argv(0)); List<String> names = getPools(glob.toPattern()).stream().map((Pool pool) -> pool.getName()).collect(Collectors.toList()); for(String name : names) removePool(name); } else removePool(args.argv(0)); return ""; }

Target:
public String ac_psu_create_linkGroup_$_1(Args args) { createLinkGroup(args.argv(0), args.hasOption("reset")); return ""; }
Source:
private static Value buildPortInfo( OutputPortInfo portInfo, Set< String > referredTypesSet ) { Value result = Value.create(); result.setFirstChild( PortInfoType.NAME, portInfo.id() ); if( portInfo.location() != null ) { result.setFirstChild( PortInfoType.LOCATION, portInfo.location().toString() ); } if( portInfo.protocol() != null ) { result.setFirstChild( PortInfoType.PROTOCOL, portInfo.protocol().toString() ); } if( portInfo.getDocumentation() != null ) { result.setFirstChild( PortInfoType.DOCUMENTATION, portInfo.getDocumentation() ); } ValueVector interfaces = result.getChildren( PortInfoType.INTERFACE ); portInfo.getInterfaceList().forEach( i -> interfaces.add( buildInterfaceInfo( i, referredTypesSet ) ) ); return result; }

Target:
private static Value buildPortInfo( OutputPortInfo portInfo, Set< String > referredTypesSet ) { Value result = Value.create(); result.setFirstChild( PortInfoType.NAME, portInfo.id() ); if( portInfo.location() != null ) { result.setFirstChild( PortInfoType.LOCATION, portInfo.location().toString() ); } if( portInfo.protocol() != null ) { result.setFirstChild( PortInfoType.PROTOCOL, portInfo.protocolId() ); } if( portInfo.getDocumentation() != null ) { result.setFirstChild( PortInfoType.DOCUMENTATION, portInfo.getDocumentation() ); } ValueVector interfaces = result.getChildren( PortInfoType.INTERFACE ); portInfo.getInterfaceList().forEach( i -> interfaces.add( buildInterfaceInfo( i, referredTypesSet ) ) ); return result; }
Source:
private void checkThisEObjectInCompletion(EObject element, final String expectedType) { IInterpreterContext interContext = SiriusInterpreterContextFactory.createInterpreterContext(element, preconditionAttribute); ContentContext context = new ContentContext("[/]", 1, interContext); List<ContentProposal> contentProposals = acceleoPrososalProvider.getProposals(acceleoIntepreter, context); ContentProposal contentProposal = Iterables.find(contentProposals, new Predicate<ContentProposal>() { @Override public boolean apply(ContentProposal input) { return input.getProposal().equals("thisEObject"); } }, null); assertNotNull("The 'thisEObject' is not found", contentProposal); assertEquals(contentProposal.getDisplay(), "thisEObject:" + expectedType); }

Target:
private void checkThisEObjectInCompletion(EObject element, final String expectedType) { IInterpreterContext interContext = SiriusInterpreterContextFactory.createInterpreterContext(element, preconditionAttribute); ContentContext context = new ContentContext("[/]", 1, interContext); List<ContentProposal> contentProposals = acceleoPrososalProvider.getProposals(acceleoIntepreter, context); ContentProposal contentProposal = Iterables.find(contentProposals, new Predicate<ContentProposal>() { @Override public boolean apply(ContentProposal input) { return input.getProposal().equals("thisEObject"); } }, null); assertNotNull("The 'thisEObject' is not found", contentProposal); assertEquals("thisEObject:" + expectedType, contentProposal.getDisplay()); }
Source:
public static Class<? extends Comparable> valuesType(@Nullable String type) { if (type == null) { return String.class; } else if ("string".equals(type)) { return String.class; } else if ("int".equals(type)) { return Integer.class; } else if ("long".equals(type)) { return Long.class; } throw new ValidationException("Not a valid provided type: " + type); }

Target:
public static Class<? extends Comparable> valuesType(@Nullable String type) { if (type == null) { return String.class; } else if (STRING_TYPE.equals(type)) { return String.class; } else if (INT_TYPE.equals(type)) { return Integer.class; } else if (LONG_TYPE.equals(type)) { return Long.class; } throw new ValidationException("Not a valid provided type: " + type); }
Source:
public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); if (listener!=null) { listener.omDismissed(); } }

Target:
public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); if (listener!=null) { listener.onDismissed(); } }
Source:
public boolean onSingleTapConfirmed(MotionEvent e) { if (mMapView.getCallout().isShowing()) { mMapView.getCallout().dismiss(); } if (graphicsOverlay.getGraphics().size() > 0) { if (graphicsOverlay.getGraphics().get(0).isSelected()) { isPinSelected = false; graphicsOverlay.getGraphics().get(0).setSelected(false); } } final android.graphics.Point screenPoint = new android.graphics.Point((int) e.getX(), (int) e.getY()); final ListenableFuture<List<Graphic>> identifyGraphic = mMapView.identifyGraphicsOverlayAsync(graphicsOverlay, screenPoint, 1.0, 1); identifyGraphic.addDoneListener(new Runnable() { @Override public void run() { try { List<Graphic> graphic = identifyGraphic.get(); int identifyResultSize = graphic.size(); if (!graphic.isEmpty()) { if (!isPinSelected) { isPinSelected = true; graphic.get(0).setSelected(true); Toast.makeText(getApplicationContext(), getString(R.string.reverse_geocode_message), Toast.LENGTH_SHORT).show(); mMapView.setOnTouchListener(new DragTouchListemer(getApplicationContext(), mMapView)); } mCalloutContent.setText(mGraphicPointAddress); mCallout = mMapView.getCallout(); mCallout.setContent(mCalloutContent); mCallout.setLocation(mGraphicPoint); mCallout.show(); } } catch (InterruptedException | ExecutionException ie) { ie.printStackTrace(); } } }); return super.onSingleTapConfirmed(e); }

Target:
public boolean onSingleTapConfirmed(MotionEvent e) { if (mMapView.getCallout().isShowing()) { mMapView.getCallout().dismiss(); } if (graphicsOverlay.getGraphics().size() > 0) { if (graphicsOverlay.getGraphics().get(0).isSelected()) { isPinSelected = false; graphicsOverlay.getGraphics().get(0).setSelected(false); } } final android.graphics.Point screenPoint = new android.graphics.Point((int) e.getX(), (int) e.getY()); final ListenableFuture<List<Graphic>> identifyGraphic = mMapView.identifyGraphicsOverlayAsync(graphicsOverlay, screenPoint, 1.0, 1); identifyGraphic.addDoneListener(new Runnable() { @Override public void run() { try { List<Graphic> graphic = identifyGraphic.get(); if (!graphic.isEmpty()) { if (!isPinSelected) { isPinSelected = true; graphic.get(0).setSelected(true); Toast.makeText(getApplicationContext(), getString(R.string.reverse_geocode_message), Toast.LENGTH_SHORT).show(); mMapView.setOnTouchListener(new DragTouchListener(getApplicationContext(), mMapView)); } mCalloutContent.setText(mGraphicPointAddress); mCallout = mMapView.getCallout(); mCallout.setContent(mCalloutContent); mCallout.setLocation(mGraphicPoint); mCallout.show(); } } catch (InterruptedException | ExecutionException ie) { ie.printStackTrace(); } } }); return super.onSingleTapConfirmed(e); }
Source:
public void onEventMainThread(@NonNull ProfilePhotoUpdatedEvent event) { if (!environment.getConfig().isTabsLayoutEnabled() || !environment.getConfig().isUserProfilesEnabled()) { return; } final ImageView profileImage = toolbarCallbacks.getProfileView(); if (event.getUsername().equalsIgnoreCase(profile.username)) { if (null == event.getUri()) { Glide.with(this) .load(R.drawable.profile_photo_placeholder) .into(profileImage); } else { Glide.with(this) .load(event.getUri()) .skipMemoryCache(true) .diskCacheStrategy(DiskCacheStrategy.NONE) .into(profileImage); } } }

Target:
public void onEventMainThread(@NonNull ProfilePhotoUpdatedEvent event) { if (!environment.getConfig().isTabsLayoutEnabled() || !environment.getConfig().isUserProfilesEnabled()) { return; } final ImageView profileImage = toolbarCallbacks.getProfileView(); if (event.getUsername().equalsIgnoreCase(profile.username)) { UserProfileUtils.loadProfileImage(getContext(), event, profileImage); } }
Source:
public static Map getStatusMap(String message, int code) { Map resultMap = new HashMap(); Map statusMap = new HashMap(); statusMap.put("message", message); statusMap.put("code", Integer.valueOf(code)); resultMap.put("status", statusMap); return resultMap; }

Target:
public static Map getStatusMap(String message, int code) { Map<String, Object> resultMap = new HashMap(); Map<String, Object> statusMap = new HashMap(); statusMap.put("message", message); statusMap.put("code", Integer.valueOf(code)); resultMap.put("status", statusMap); return resultMap; }
Source:
public Bndrun init(File runFile, String task, File workingDir) throws Exception { if (!runFile.exists()) { logger.error("Could not find bnd run file {}", runFile); return null; } String bndrun = getNamePart(runFile); File temporaryDir = workingDir.toPath() .resolve("tmp") .resolve(task) .resolve(bndrun) .toFile(); File cnf = new File(temporaryDir, Workspace.CNFDIR); aQute.lib.io.IO.mkdirs(cnf); Bndrun run = Bndrun.createBndrun(null, runFile); run.setBase(temporaryDir); Workspace workspace = run.getWorkspace(); workspace.setBuildDir(cnf); workspace.setOffline(session.getSettings() .isOffline()); workspace.addBasicPlugin(getFileSetRepository()); run.setParent(getProcessor(workspace)); for (RepositoryPlugin repo : workspace.getRepositories()) { repo.list(null); } setRunrequiresFromProjectArtifact(run); setEEfromBuild(run); run.getProperties() .put(BndrunContainer.class.getName(), this); return run; }

Target:
public Bndrun init(File runFile, String task, File workingDir) throws Exception { if (!runFile.exists()) { logger.error("Could not find bnd run file {}", runFile); return null; } String bndrun = getNamePart(runFile); File temporaryDir = workingDir.toPath() .resolve("tmp") .resolve(task) .resolve(bndrun) .toFile(); File cnf = new File(temporaryDir, Workspace.CNFDIR); aQute.lib.io.IO.mkdirs(cnf); Bndrun run = Bndrun.createBndrun(null, runFile); run.setBase(temporaryDir); Workspace workspace = run.getWorkspace(); workspace.setBase(temporaryDir); workspace.setBuildDir(cnf); workspace.setOffline(session.getSettings() .isOffline()); run.setParent(getProcessor(workspace)); run.getInfo(workspace); setRunrequiresFromProjectArtifact(run); setEEfromBuild(run); run.addBasicPlugin(this); return run; }
Source:
public StreamableMessageSource<TrackedEventMessage<?>> getMessageSource() { return messageSource; }

Target:
public StreamableMessageSource<? extends TrackedEventMessage<?>> getMessageSource() { return messageSource; }