auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void ensureJupiterExtensionApisAreComposable() { List<Class<?>> extensionApis = ReflectionUtils.findAllClassesInPackage(Extension.class.getPackage().getName(), this::isExtensionApi, name -> true); List<Method> expectedMethods = extensionApis.stream() .map(Class::getDeclaredMethods) .flatMap(Arrays::stream) .collect(toList()); List<String> expectedMethodSignatures = expectedMethods.stream() .map(this::methodSignature) .filter(name -> !name.contains("jacoco")) .sorted() .collect(toList()); List<String> expectedMethodNames = expectedMethods.stream() .map(Method::getName) .filter(name -> !name.contains("jacoco")) .sorted() .collect(toList()); Object dynamicKitchenSinkExtension = Proxy.newProxyInstance(getClass().getClassLoader(), extensionApis.toArray(new Class<?>[0]), (proxy, method, args) -> null); List<Method> actualMethods = Arrays.stream(dynamicKitchenSinkExtension.getClass().getDeclaredMethods()) .collect(toList()); List<String> actualMethodSignatures = actualMethods.stream() .map(this::methodSignature) .distinct() .sorted() .collect(toList()); List<String> actualMethodNames = actualMethods.stream() .map(Method::getName) .distinct() .sorted() .collect(toList()); actualMethodSignatures.remove("equals(Object)"); actualMethodSignatures.remove("hashCode()"); actualMethodSignatures.remove("toString()"); actualMethodNames.remove("equals"); actualMethodNames.remove("hashCode"); actualMethodNames.remove("toString"); assertLinesMatch(expectedMethodSignatures, actualMethodSignatures); assertLinesMatch(expectedMethodNames, actualMethodNames); }

Target:
void ensureJupiterExtensionApisAreComposable() { List<Class<?>> extensionApis = ReflectionUtils.findAllClassesInPackage(Extension.class.getPackage().getName(), this::isExtensionApi, name -> true); List<Method> expectedMethods = extensionApis.stream() .map(Class::getDeclaredMethods) .flatMap(Arrays::stream) .collect(toList()); List<String> expectedMethodSignatures = expectedMethods.stream() .map(this::methodSignature) .sorted() .collect(toList()); List<String> expectedMethodNames = expectedMethods.stream() .map(Method::getName) .sorted() .collect(toList()); Object dynamicKitchenSinkExtension = Proxy.newProxyInstance(getClass().getClassLoader(), extensionApis.toArray(new Class<?>[extensionApis.size()]), (proxy, method, args) -> null); List<Method> actualMethods = Arrays.stream(dynamicKitchenSinkExtension.getClass().getDeclaredMethods()) .collect(toList()); List<String> actualMethodSignatures = actualMethods.stream() .map(this::methodSignature) .distinct() .sorted() .collect(toList()); List<String> actualMethodNames = actualMethods.stream() .map(Method::getName) .distinct() .sorted() .collect(toList()); actualMethodSignatures.remove("equals(Object)"); actualMethodSignatures.remove("hashCode()"); actualMethodSignatures.remove("toString()"); actualMethodNames.remove("equals"); actualMethodNames.remove("hashCode"); actualMethodNames.remove("toString"); assertAll( () -> assertThat(actualMethodSignatures).isEqualTo(expectedMethodSignatures), () -> assertThat(actualMethodNames).isEqualTo(expectedMethodNames) ); }
Source:
private static List<USReceiptItem> toReceiptItems(FormField<?> fieldValueItems) { List<FormField<?>> fieldValueArray = (List<FormField<?>>) fieldValueItems.getFieldValue(); List<USReceiptItem> receiptItemList = new ArrayList<>(); FormField<String> name = null; FormField<Float> quantity = null; FormField<Float> price = null; FormField<Float> totalPrice = null; USReceiptItem receiptItem = null; for (FormField<?> eachFieldValue : fieldValueArray) { Map<String, FormField<?>> objectValue = ((Map<String, FormField<?>>) (eachFieldValue.getFieldValue())); for (Map.Entry<String, FormField<?>> entry : objectValue.entrySet()) { String key = entry.getKey(); if (QUANTITY.toString().equals(key)) { quantity = (FormField<Float>) entry.getValue(); } else if (NAME.toString().equals(key)) { name = (FormField<String>) entry.getValue(); } else if (PRICE.toString().equals(key)) { price = (FormField<Float>) entry.getValue(); } else if (TOTAL_PRICE.toString().equals(key)) { totalPrice = (FormField<Float>) entry.getValue(); } receiptItem = new USReceiptItem(name, quantity, price, totalPrice); } receiptItemList.add(receiptItem); } return receiptItemList; }

Target:
private static List<USReceiptItem> toReceiptItems(FormField<?> fieldValueItems) { List<FormField<?>> fieldValueArray = (List<FormField<?>>) fieldValueItems.getFieldValue(); List<USReceiptItem> receiptItemList = null; for (FormField<?> eachFieldValue : fieldValueArray) { receiptItemList = new ArrayList<>(); Map<String, FormField<?>> objectValue = ((Map<String, FormField<?>>) (eachFieldValue.getFieldValue())); FormField<String> name = null; FormField<Float> quantity = null; FormField<Float> price = null; FormField<Float> totalPrice = null; for (Map.Entry<String, FormField<?>> entry : objectValue.entrySet()) { String key = entry.getKey(); if (QUANTITY.toString().equals(key)) { quantity = (FormField<Float>) entry.getValue(); } else if (NAME.toString().equals(key)) { name = (FormField<String>) entry.getValue(); } else if (PRICE.toString().equals(key)) { price = (FormField<Float>) entry.getValue(); } else if (TOTAL_PRICE.toString().equals(key)) { totalPrice = (FormField<Float>) entry.getValue(); } } receiptItemList.add(new USReceiptItem(name, quantity, price, totalPrice)); } return receiptItemList; }
Source:
public void neighborBlockRead() { int[] vector = new int[3]; World world = coordinate.world(); neighborOpaque = 0; neighborWrapable = 0; for (Direction direction : Direction.values()) { BlockPos.MutableBlockPos pos = coordinate.pos; vector[0] = pos.getX(); vector[1] = pos.getY(); vector[2] = pos.getZ(); direction.applyTo(vector, 1); Block b = world.getBlockState(pos).getBlock(); neighborOpaque |= 1 << direction.getInt(); if (isBlockWrappable(b, world, coordonate.x, coordonate.y, coordonate.z)) neighborWrapable |= 1 << direction.getInt(); } }

Target:
public void neighborBlockRead() { int[] vector = new int[3]; World world = coordinate.world(); neighborOpaque = 0; neighborWrapable = 0; for (Direction direction : Direction.values()) { BlockPos.MutableBlockPos pos = coordinate.pos; vector[0] = pos.getX(); vector[1] = pos.getY(); vector[2] = pos.getZ(); direction.applyTo(vector, 1); Block b = world.getBlockState(pos).getBlock(); neighborOpaque |= 1 << direction.getInt(); if (isBlockWrappable(b, world, pos) neighborWrapable |= 1 << direction.getInt(); } }
Source:
private List<Guid> findVmViolatingPositiveAg(AffinityGroup affinityGroup, Map<Guid, Guid> vmToHost) { Map<Guid, List<Guid>> hostCount = new HashMap<>(); for (Guid vm : affinityGroup.getEntityIds()) { Guid host = vmToHost.get(vm); if (host == null) { continue; } if (hostCount.containsKey(host)) { hostCount.get(host).add(vm); } else { hostCount.put(host, new ArrayList<>()); hostCount.get(host).add(vm); } } Guid host = chooseCandidateHostForMigration(hostCount); if (host == null) { return Collections.EMPTY_LIST; } return hostCount.get(host); }

Target:
private List<Guid> findVmViolatingPositiveAg(AffinityGroup affinityGroup, Map<Guid, Guid> vmToHost) { Map<Guid, List<Guid>> hostCount = new HashMap<>(); for (Guid vm : affinityGroup.getEntityIds()) { Guid host = vmToHost.get(vm); if (host == null) { continue; } if (hostCount.containsKey(host)) { hostCount.get(host).add(vm); } else { hostCount.put(host, new ArrayList<>()); hostCount.get(host).add(vm); } } Guid host = chooseCandidateHostForMigration(hostCount); if (host == null) { return Collections.emptyList(); } return hostCount.get(host); }
Source:
public void flushIfNeeded(FlushPredicate flushPredicate) { flushIfNeeded(flushPredicate, null); }

Target:
public synchronized void flushIfNeeded(FlushPredicate flushPredicate) { Iterator<Entry<String, FileState>> iterator = FileWritingMessageHandler.this.fileStates.entrySet().iterator(); while (iterator.hasNext()) { Entry<String, FileState> entry = iterator.next(); FileState state = entry.getValue(); if (flushPredicate.shouldFlush(entry.getKey(), state.lastWrite)) { iterator.remove(); state.close(); } } }
Source:
public OneOriginContainer propagate () { long startTimeMillis = System.currentTimeMillis(); perIterationTravelTimes = new int[nIterations]; perIterationPaths = calculateComponents ? new Path[nIterations] : null; int startTarget = 0; int endTarget = nTargets; if (request instanceof RegionalTask && ((RegionalTask) request).oneToOne) { String originId = ((RegionalTask) request).id; if (originId != null) { startTarget = ((FreeFormPointSet) linkedTargets.get(0).pointSet).getIndexForFeature(originId); endTarget = 1; } else { LOG.error("One-to-one travel time analysis requested, but no matched origin-destination pair found."); } } for (int targetIdx = startTarget; targetIdx < endTarget; targetIdx++) { Arrays.fill(perIterationTravelTimes, nonTransitTravelTimesToTargets[targetIdx]); if (perIterationPaths != null) { Arrays.fill(perIterationPaths, null); } propagateTransit(targetIdx); PathScorer pathScorer = null; if (calculateComponents) { pathScorer = new PathScorer(perIterationPaths, perIterationTravelTimes); } int[] percentilesMinutes = travelTimeReducer.extractTravelTimesAndRecord(targetIdx, perIterationTravelTimes); if (calculateComponents) { Set<Path> selectedPaths = pathScorer.getTopPaths(pathWriter.nPathsPerTarget, percentilesMinutes[0] * SECONDS_PER_MINUTE); pathWriter.recordPathsForTarget(selectedPaths); } } LOG.info("Propagating iterations from stops to target points took {}s", nIterations, nStops, endTarget, (System.currentTimeMillis() - startTimeMillis) / 1000d ); if (pathWriter != null) { pathWriter.finishAndStorePaths(); } targets = null; return travelTimeReducer.finish(); }

Target:
public OneOriginResult propagate () { long startTimeMillis = System.currentTimeMillis(); perIterationTravelTimes = new int[nIterations]; perIterationPaths = calculateComponents ? new Path[nIterations] : null; int startTarget = 0; int endTarget = nTargets; if (oneToOne) { startTarget = ((RegionalTask) request).taskId; endTarget = startTarget + 1; } for (int targetIdx = startTarget; targetIdx < endTarget; targetIdx++) { Arrays.fill(perIterationTravelTimes, nonTransitTravelTimesToTargets[targetIdx]); if (perIterationPaths != null) { Arrays.fill(perIterationPaths, null); } propagateTransit(targetIdx); PathScorer pathScorer = null; if (calculateComponents) { pathScorer = new PathScorer(perIterationPaths, perIterationTravelTimes); } int targetToWrite = oneToOne ? 0 : targetIdx; int[] percentilesMinutes = travelTimeReducer.extractTravelTimesAndRecord(targetToWrite, perIterationTravelTimes); if (calculateComponents) { Set<Path> selectedPaths = pathScorer.getTopPaths(pathWriter.nPathsPerTarget, percentilesMinutes[0] * SECONDS_PER_MINUTE); pathWriter.recordPathsForTarget(selectedPaths); } } LOG.info("Propagating iterations from stops to target points took {}s", nIterations, nStops, endTarget - startTarget, (System.currentTimeMillis() - startTimeMillis) / 1000d ); if (pathWriter != null) { pathWriter.finishAndStorePaths(); } targets = null; return travelTimeReducer.finish(); }
Source:
protected void updatePlayer1Button(GameContainer container, StateBasedGame game) throws SlickException { if (controller.isAreaClicked(mouseOverOnePlayer, input)) { Game singleplayerGame = controller.createSingleplayerGame(container, game); final GameState gameState = new GameState(singleplayerGame); game.addState(gameState); game.getState(States.GameState).init(container, game); resources.stopTitleScreen(); game.enterState(States.GameState); Game.LOGGER .log(LogSeverity.DEBUG, "StartMenu", "User starts a single player game"); } }

Target:
protected void updatePlayer1Button(GameContainer container, StateBasedGame game) throws SlickException { if (controller.isAreaClicked(mouseOverOnePlayer, input)) { Game singleplayerGame = controller.createSingleplayerGame(container, game); enterGameState(container, game, singleplayerGame); Game.LOGGER .log(LogSeverity.DEBUG, "StartMenu", "User starts a single player game"); } }
Source:
public String getText(Object element) { if (element instanceof IBreakpointManager) { return "Breakpoint Manager"; } return super.getText(element); }

Target:
public String getText(Object element) { if (element instanceof IBreakpointManager) { return "Breakpoints"; } return super.getText(element); }
Source:
public FieldManager(EntityConfiguration entityConfiguration, EntityManager entityManager) { this.entityConfiguration = entityConfiguration; this.entityManager = entityManager; if (entityManager != null) { Set<EntityType<?>> managedEntities = entityManager.getMetamodel().getEntities(); for (EntityType managedEntity : managedEntities) { classes.add(managedEntity.getJavaType()); } } }

Target:
public FieldManager(EntityConfiguration entityConfiguration, EntityManager entityManager) { this.entityConfiguration = entityConfiguration; this.entityManager = entityManager; if (entityManager != null) { Set<EntityType<?>> managedEntities = entityManager.getMetamodel().getEntities(); for (EntityType managedEntity : managedEntities) { managedEntityClasses.add(managedEntity.getJavaType()); } } }
Source:
public void alterPartitionAndStats(List<String> partVals, SharedCache sharedCache, long writeId, Map<String,String> parameters, List<ColumnStatisticsObj> colStatsObjs) { try { tableLock.writeLock().lock(); PartitionWrapper partitionWrapper = partitionCache.get(CacheUtils.buildPartitionCacheKey(partVals)); if (partitionWrapper != null) { Partition newPart = partitionWrapper.getPartition(); newPart.setParameters(parameters); newPart.setWriteId(writeId); removePartition(partVals, sharedCache); cachePartition(newPart, sharedCache); updatePartitionColStats(partVals, colStatsObjs); } } finally { tableLock.writeLock().unlock(); } }

Target:
public void alterPartitionAndStats(List<String> partVals, SharedCache sharedCache, long writeId, Map<String,String> parameters, List<ColumnStatisticsObj> colStatsObjs) { try { tableLock.writeLock().lock(); PartitionWrapper partitionWrapper = partitionCache.get(CacheUtils.buildPartitionCacheKey(partVals)); if (partitionWrapper == null) { LOG.info("Partition " + partVals + " is missing from cache. Cannot update the partition stats in cache."); return; } Partition newPart = partitionWrapper.getPartition(); newPart.setParameters(parameters); newPart.setWriteId(writeId); removePartition(partVals, sharedCache); cachePartition(newPart, sharedCache); updatePartitionColStats(partVals, colStatsObjs); } finally { tableLock.writeLock().unlock(); } }
Source:
void shouldLoadAllowOnlySuccessOnManualApprovalType() throws Exception { String content = config( "<pipelines group=\"first\">" + "<pipeline name=\"pipeline\">" + " <materials>" + " <hg url=\"/hgrepo\"/>" + " </materials>" + " <stage name=\"mingle\">" + " <approval type=\"manual\" allowOnlyOnSuccess=\"true\" /> " + " <jobs>" + " <job name=\"functional\">" + " </job>" + " </jobs>" + " </stage>" + "</pipeline>" + "</pipelines>", 126); CruiseConfig config = xmlLoader.loadConfigHolder(content).config; Approval approval = config .getPipelineConfigByName(new CaseInsensitiveString("pipeline")) .getStage("mingle") .getApproval(); assertThat(approval.getType()).isEqualTo("manual"); assertThat(approval.isAllowOnlyOnSuccess()).isEqualTo(true); }

Target:
void shouldLoadAllowOnlySuccessOnManualApprovalType() throws Exception { Approval approval = xmlLoader.fromXmlPartial("<approval type=\"manual\" allowOnlyOnSuccess=\"true\" />", Approval.class); assertThat(approval.getType()).isEqualTo("manual"); assertThat(approval.isAllowOnlyOnSuccess()).isEqualTo(true); }
Source:
public void testList_CLI() throws Exception { String result = CLIGitCommand.execute("git branch -v", db); assertEquals("* master 9c58deb Initial commit\r\n", result); }

Target:
public void testList_CLI() throws Exception { assertEquals("* master 9c58deb Initial commit", execute("git branch -v")[0]); }
Source:
private void createResourceControls(Composite parent, DataBindingContext dbc) { resourceKindLabel = new Label(parent, SWT.None); applyAlignData(SWT.FILL, SWT.CENTER, resourceKindLabel); resourceText = new Text(parent, SWT.BORDER | SWT.READ_ONLY); applyGridData(2, 1, SWT.FILL, SWT.CENTER, true, false, resourceText); }

Target:
private void createResourceControls(Composite parent, DataBindingContext dbc) { resourceKindLabel = new Label(parent, SWT.None); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(resourceKindLabel); resourceText = new Text(parent, SWT.BORDER | SWT.READ_ONLY); GridDataFactory.fillDefaults().span(2,1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(resourceText); }
Source:
public void delete(Field field, User user) throws DotDataException, DotSecurityException { ContentTypeAPI tapi = APILocator.getContentTypeAPI(user); ContentType type = tapi.find(field.contentTypeId()); perAPI.checkPermission(type, PermissionLevel.PUBLISH, user); Structure structure = new StructureTransformer(type).asStructure(); com.dotmarketing.portlets.structure.model.Field legacyField = new LegacyFieldTransformer(field).asOldField(); HibernateUtil.startTransaction(); if (!(field instanceof CategoryField) && !(field instanceof ConstantField) && !(field instanceof HiddenField) && !(field instanceof LineDividerField) && !(field instanceof TabDividerField) && !(field instanceof RelationshipsTabField) && !(field instanceof PermissionTabField) && !(field instanceof HostFolderField) && structure != null ) { this.conAPI.cleanField(structure, legacyField, this.userAPI.getSystemUser(), false); } fac.delete(field); HibernateUtil.commitTransaction(); CacheLocator.getContentTypeCache().remove(structure); StructureServices.removeStructureFile(structure); if (field instanceof HostFolderField) { try { this.conAPI.cleanHostField(structure, this.userAPI.getSystemUser(), false); } catch(DotMappingException e) { } this.perAPI.resetChildrenPermissionReferences(structure); } conAPI.reindex(structure); ContentletServices.removeContentletFile(structure); ContentletMapServices.removeContentletMapFile(structure); }

Target:
public void delete(Field field, User user) throws DotDataException, DotSecurityException { LocalTransaction.wrapReturn(() -> { ContentTypeAPI tapi = APILocator.getContentTypeAPI(user); ContentType type = tapi.find(field.contentTypeId()); perAPI.checkPermission(type, PermissionLevel.PUBLISH, user); Structure structure = new StructureTransformer(type).asStructure(); com.dotmarketing.portlets.structure.model.Field legacyField = new LegacyFieldTransformer(field).asOldField(); if (!(field instanceof CategoryField) && !(field instanceof ConstantField) && !(field instanceof HiddenField) && !(field instanceof LineDividerField) && !(field instanceof TabDividerField) && !(field instanceof RelationshipsTabField) && !(field instanceof PermissionTabField) && !(field instanceof HostFolderField) && structure != null ) { this.conAPI.cleanField(structure, legacyField, this.userAPI.getSystemUser(), false); } fac.delete(field); CacheLocator.getContentTypeCache().remove(structure); StructureServices.removeStructureFile(structure); if (field instanceof HostFolderField) { try { this.conAPI.cleanHostField(structure, this.userAPI.getSystemUser(), false); } catch(DotMappingException e) this.perAPI.resetChildrenPermissionReferences(structure); } conAPI.reindex(structure); ContentletServices.removeContentletFile(structure); ContentletMapServices.removeContentletMapFile(structure); return null; }); }
Source:
public boolean update(final Identifier queryId, final Identifier operatorId, final OperatorState state) { final Map<Identifier, OperatorState> queryState = queryStateMap.get(queryId); if (queryState != null) { queryState.put(operatorId, state); queryStateMap.put(queryId, queryState); return true; } else { return false; } }

Target:
public boolean update(final Identifier queryId, final Identifier operatorId, final OperatorState state) { final Map<Identifier, OperatorState> queryState = queryStateMap.get(queryId); if (queryState == null) { return false; } return queryState.replace(operatorId, state) != null ? true : false; }
Source:
public void should_log_and_drop_events_on_overflow() throws InterruptedException { MemoryAppender logs = new MemoryAppender(); Logger logger = Logger.getLogger(EventDebouncer.class); Level originalLoggerLevel = logger.getLevel(); logger.setLevel(Level.WARN); logger.addAppender(logs); try { EventDebouncer<MockEvent> debouncer = new EventDebouncer<MockEvent>("test", executor, callback, 100, 10005); debouncer.start(); List<MockEvent> events = new ArrayList<MockEvent>(); for (int i = 0; i < 10004; i++) { MockEvent event = new MockEvent(i); events.add(event); debouncer.eventReceived(event); } callback.awaitEvents(10000); assertThat(callback.getEvents()).isEqualTo(events.subList(0, 10000)); assertThat(logs.get()).containsOnlyOnce("test debouncer enqueued more than 10000 events, rejecting new events."); } finally { logger.removeAppender(logs); logger.setLevel(originalLoggerLevel); } }

Target:
public void should_log_and_drop_events_on_overflow() throws InterruptedException { MemoryAppender logs = new MemoryAppender(); Logger logger = Logger.getLogger(EventDebouncer.class); Level originalLoggerLevel = logger.getLevel(); logger.setLevel(Level.WARN); logger.addAppender(logs); try { EventDebouncer<MockEvent> debouncer = new EventDebouncer<MockEvent>("test", executor, callback, 100, 15, 10); debouncer.start(); List<MockEvent> events = new ArrayList<MockEvent>(); for (int i = 0; i < 14; i++) { MockEvent event = new MockEvent(i); events.add(event); debouncer.eventReceived(event); } callback.awaitEvents(10); assertThat(callback.getEvents()).isEqualTo(events.subList(0, 10)); assertThat(logs.get()).containsOnlyOnce("test debouncer enqueued more than 10 events, rejecting new events."); } finally { logger.removeAppender(logs); logger.setLevel(originalLoggerLevel); } }
Source:
public List<HashShuffleIntermediate> close(ExecutionBlockId ebId) throws IOException { Map<Integer, PartitionAppenderMeta> partitionAppenderMap = null; synchronized (appenderMap) { partitionAppenderMap = appenderMap.remove(ebId); } if (partitionAppenderMap == null) { LOG.info("Close HashShuffleAppender:" + ebId + ", not a hash shuffle"); return null; } List<HashShuffleIntermediate> interimEntries = new ArrayList<HashShuffleIntermediate>(); for (PartitionAppenderMeta eachMeta : partitionAppenderMap.values()) { try { eachMeta.appender.close(); HashShuffleIntermediate intermediate = new HashShuffleIntermediate(eachMeta.partId, eachMeta.appender.getOffset(), eachMeta.appender.getPages(), eachMeta.appender.getMergedTupleIndexes()); interimEntries.add(intermediate); } catch (IOException e) { LOG.error(e.getMessage(), e); throw e; } } LOG.info("Close HashShuffleAppender:" + ebId + ", intermediates=" + interimEntries.size()); return interimEntries; }

Target:
public List<HashShuffleIntermediate> close(ExecutionBlockId ebId) throws IOException { Map<Integer, PartitionAppenderMeta> partitionAppenderMap = null; synchronized (appenderMap) { partitionAppenderMap = appenderMap.remove(ebId); } if (partitionAppenderMap == null) { LOG.info("Close HashShuffleAppender:" + ebId + ", not a hash shuffle"); return null; } List<HashShuffleIntermediate> intermediateEntries = new ArrayList<HashShuffleIntermediate>(); for (PartitionAppenderMeta eachMeta : partitionAppenderMap.values()) { try { eachMeta.appender.close(); HashShuffleIntermediate intermediate = new HashShuffleIntermediate(eachMeta.partId, eachMeta.appender.getOffset(), eachMeta.appender.getPages(), eachMeta.appender.getMergedTupleIndexes()); intermediateEntries.add(intermediate); } catch (IOException e) { LOG.error(e.getMessage(), e); throw e; } } LOG.info("Close HashShuffleAppender:" + ebId + ", intermediates=" + intermediateEntries.size()); return intermediateEntries; }
Source:
public static void setFilterNumberByFilterOutRatio(ModelConfig modelConfig,List<ColumnConfig> columnConfigList){ if(modelConfig.getVarSelectFilterNum()>0){ return; } int[] inputOutputIndex = DTrainUtils.getInputOutputCandidateCounts(columnConfigList); log.info("inputOutputIndex:"+inputOutputIndex[0]+" "+inputOutputIndex[1]+" "+inputOutputIndex[2]); int inputNodeCount = inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0]; log.info("inputNodeCount:"+inputNodeCount); Float filterOutRatio = modelConfig.getVarSelect().getFilterOutRatio(); int targetCnt = (int) (inputNodeCount * (1.0f - filterOutRatio)); log.info("target_num:"+targetCnt); modelConfig.getVarSelect().setFilterNum(targetCnt); }

Target:
public static void setFilterNumberByFilterOutRatio(ModelConfig modelConfig,List<ColumnConfig> columnConfigList){ if(modelConfig.getVarSelectFilterNum()>0){ return; } int[] inputOutputIndex = DTrainUtils.getInputOutputCandidateCounts(columnConfigList); int inputNodeCount = inputOutputIndex[0] == 0 ? inputOutputIndex[2] : inputOutputIndex[0]; Float filterOutRatio = modelConfig.getVarSelect().getFilterOutRatio(); int targetCnt = (int) (inputNodeCount * (1.0f - filterOutRatio)); modelConfig.getVarSelect().setFilterNum(targetCnt); }
Source:
public List<RichMember> convertMembersToRichMembersWithAttributes(PerunSession sess, Group group, Resource resource, List<RichMember> richMembers, List<AttributeDefinition> attrsDef) throws InternalErrorException, MemberResourceMismatchException { List<String> attrNames = new ArrayList<>(); for(AttributeDefinition attributeDefinition: attrsDef) { attrNames.add(attributeDefinition.getName()); } for (RichMember richMember: richMembers) { List<Attribute> userAttributes = new ArrayList<>(); List<Attribute> memberAttributes = new ArrayList<>(); List<Attribute> attributes = getPerunBl().getAttributesManagerBl().getAttributes(sess, group, resource, richMember, attrNames, true); for(Attribute attribute: attributes) { if(attribute.getName().startsWith(AttributesManager.NS_USER_ATTR)) userAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_USER_FACILITY_ATTR)) userAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_MEMBER_ATTR)) memberAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_MEMBER_RESOURCE_ATTR)) memberAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_MEMBER_GROUP_ATTR)) memberAttributes.add(attribute); else { throw new InternalErrorException(attribute + " is not from user or member namespace (member-resource, user-facility, member-group included)!"); } } richMember.setUserAttributes(userAttributes); richMember.setMemberAttributes(memberAttributes); } return richMembers; }

Target:
public List<RichMember> convertMembersToRichMembersWithAttributes(PerunSession sess, Group group, Resource resource, List<RichMember> richMembers, List<AttributeDefinition> attrsDef) throws InternalErrorException, MemberResourceMismatchException, GroupResourceMismatchException { List<String> attrNames = new ArrayList<>(); for(AttributeDefinition attributeDefinition: attrsDef) { attrNames.add(attributeDefinition.getName()); } for (RichMember richMember: richMembers) { List<Attribute> userAttributes = new ArrayList<>(); List<Attribute> memberAttributes = new ArrayList<>(); List<Attribute> attributes = getPerunBl().getAttributesManagerBl().getAttributes(sess, group, resource, richMember, attrNames, true); for(Attribute attribute: attributes) { if(attribute.getName().startsWith(AttributesManager.NS_USER_ATTR)) userAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_USER_FACILITY_ATTR)) userAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_MEMBER_ATTR)) memberAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_MEMBER_RESOURCE_ATTR)) memberAttributes.add(attribute); else if(attribute.getName().startsWith(AttributesManager.NS_MEMBER_GROUP_ATTR)) memberAttributes.add(attribute); else { throw new InternalErrorException(attribute + " is not from user or member namespace (member-resource, user-facility, member-group included)!"); } } richMember.setUserAttributes(userAttributes); richMember.setMemberAttributes(memberAttributes); } return richMembers; }
Source:
public static RunDto asDto(Run from) { RunDto dto = new RunDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setAlias(from.getAlias()); if (from.getHealth() != null) { dto.setStatus(from.getHealth().getKey()); } else { dto.setStatus(""); } if (from.getLastUpdated() != null) { dto.setLastModified(getDateAsString(from.getLastUpdated())); } if (from.getSequencerReference() != null) { dto.setPlatformType(from.getSequencerReference().getPlatform().getPlatformType().getKey()); } else { dto.setPlatformType(""); } if (from.getStartDate() != null) { dto.setStartDate(getDateAsString(from.getStartDate())); } else { dto.setStartDate(""); } if (from.getCompletionDate() != null) { dto.setEndDate(getDateAsString(from.getStartDate())); } if (from.getSequencingParameters() != null) { dto.setParameters(asDto(from.getSequencingParameters())); } else { SequencingParametersDto parametersDto = new SequencingParametersDto(); parametersDto.setId(-1L); parametersDto.setName("(None)"); dto.setParameters(parametersDto); } return dto; }

Target:
public static RunDto asDto(Run from) { RunDto dto = new RunDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setAlias(from.getAlias()); if (from.getHealth() != null) { dto.setStatus(from.getHealth().getKey()); } else { dto.setStatus(""); } if (from.getLastUpdated() != null) { dto.setLastModified(getDateAsString(from.getLastUpdated())); } if (from.getSequencerReference() != null) { dto.setPlatformType(from.getSequencerReference().getPlatform().getPlatformType().getKey()); } else { dto.setPlatformType(""); } if (from.getStartDate() != null) { dto.setStartDate(getDateAsString(from.getStartDate())); } else { dto.setStartDate(""); } if (from.getCompletionDate() != null) { dto.setEndDate(getDateAsString(from.getCompletionDate())); } if (from.getSequencingParameters() != null) { dto.setParameters(asDto(from.getSequencingParameters())); } else { SequencingParametersDto parametersDto = new SequencingParametersDto(); parametersDto.setId(-1L); parametersDto.setName("(None)"); dto.setParameters(parametersDto); } return dto; }
Source:
public boolean endsWith(Bytes suffix) { int startOffset = this.length - suffix.length; for (int i = startOffset; i < this.length; i++) { if (this.byteAt(i) != suffix.byteAt(i - startOffset)) return false; } return true; }

Target:
public boolean endsWith(Bytes suffix) { Objects.requireNonNull(suffix, "endsWith(Bytes suffix) cannot have null parameter"); int startOffset = this.length - suffix.length; if (startOffset < 0) { return false; } else { int end = startOffset + this.offset + suffix.length; for (int i = startOffset + this.offset, j = suffix.offset; i < end; i++, j++) { if (this.data[i] != suffix.data[j]) { return false; } } } return true; }
Source:
public SiteModel getSelectedSite() { if (getActivity() instanceof WPMainActivity) { WPMainActivity mainActivity = (WPMainActivity) getActivity(); mainActivity.getSelectedSite(); } return null; }

Target:
public SiteModel getSelectedSite() { if (getActivity() instanceof WPMainActivity) { WPMainActivity mainActivity = (WPMainActivity) getActivity(); return mainActivity.getSelectedSite(); } return null; }
Source:
public void handleError(ClientHttpResponse response) throws IOException { GdcError error = null; try { error = gdcErrorExtractor.extractData(response); } catch (RestClientException | IOException ignored) { } final String requestId = response.getHeaders().getFirst(GDC_REQUEST_ID_HEADER); throw new GoodDataRestException(response.getRawStatusCode(), requestId, response.getStatusText(), error); }

Target:
public void handleError(ClientHttpResponse response) { GdcError error = null; try { error = gdcErrorExtractor.extractData(response); } catch (RestClientException | IOException ignored) { } final String requestId = response.getHeaders().getFirst(GDC_REQUEST_ID_HEADER); int statusCode; try { statusCode = response.getRawStatusCode(); } catch (IOException e) { statusCode = 0; } String statusText; try { statusText = response.getStatusText(); } catch (IOException e) { statusText = null; } throw new GoodDataRestException(statusCode, requestId, statusText, error); }
Source:
public void connect() throws Exception { if (channel.getClusterName() != null && !clusterName.equals(channel.getClusterName())) { throw new ConnectionFailedException("Already joined cluster: " + channel.getClusterName()); } channel.setReceiver(this); channel.connect(clusterName); broadCastMembership(); Address localAddress = channel.getAddress(); String localName = channel.getName(localAddress); SimpleMember<Address> localMember = new SimpleMember<>(localName, localAddress, true, null); members.put(localAddress, localMember); consistentHash.updateAndGet(ch -> ch.with(localMember, loadFactor, commandFilter)); }

Target:
public void connect() throws Exception { if (channel.getClusterName() != null && !clusterName.equals(channel.getClusterName())) { throw new ConnectionFailedException("Already joined cluster: " + channel.getClusterName()); } channel.setReceiver(this); channel.connect(clusterName); broadCastMembership(); Address localAddress = channel.getAddress(); String localName = channel.getName(localAddress); SimpleMember<Address> localMember = new SimpleMember<>(localName, localAddress, LOCAL_MEMBER, null); members.put(localAddress, localMember); consistentHash.updateAndGet(ch -> ch.with(localMember, loadFactor, commandFilter)); }
Source:
public PointSetTimes eval (TravelTimeFunction travelTimeForVertex, int offstreetTravelSpeedMillimetersPerSecond) { int[] travelTimes = new int[edges.length]; EdgeStore.Edge edge = streetLayer.edgeStore.getCursor(); for (int i = 0; i < edges.length; i++) { if (edges[i] < 0) { travelTimes[i] = Integer.MAX_VALUE; continue; } edge.seek(edges[i]); int time0 = travelTimeForVertex.getTravelTime(edge.getFromVertex()); int time1 = travelTimeForVertex.getTravelTime(edge.getToVertex()); int scaledLinkDist = distancesToEdge_mm[i] > CELL_SIZE*1000 ? distancesToEdge_mm[i] + OFFROAD_PENALTY * (distancesToEdge_mm[i] - CELL_SIZE * 1000) : distancesToEdge_mm[i]; if (scaledLinkDist > MAX_OFFSTREET_WALK_METERS * 1000 || scaledLinkDist < 0 || scaledLinkDist + distances0_mm[i] < 0){ time0 = Integer.MAX_VALUE; } if (scaledLinkDist > MAX_OFFSTREET_WALK_METERS*1000 || scaledLinkDist < 0 || scaledLinkDist + distances1_mm[i] < 0){ time1 = Integer.MAX_VALUE; } if (time0 != Integer.MAX_VALUE) { time0 += (distances0_mm[i] + scaledLinkDist) / offstreetTravelSpeedMillimetersPerSecond; } if (time1 != Integer.MAX_VALUE) { time1 += (distances1_mm[i] + scaledLinkDist) / offstreetTravelSpeedMillimetersPerSecond; } travelTimes[i] = time0 < time1 ? time0 : time1; } return new PointSetTimes (pointSet, travelTimes); }

Target:
public PointSetTimes eval (TravelTimeFunction travelTimeForVertex, int offstreetTravelSpeedMillimetersPerSecond) { int[] travelTimes = new int[edges.length]; EdgeStore.Edge edge = streetLayer.edgeStore.getCursor(); for (int i = 0; i < edges.length; i++) { if (edges[i] < 0) { travelTimes[i] = Integer.MAX_VALUE; continue; } edge.seek(edges[i]); int time0 = travelTimeForVertex.getTravelTime(edge.getFromVertex()); int time1 = travelTimeForVertex.getTravelTime(edge.getToVertex()); if (time0 != Integer.MAX_VALUE) { time0 += (distances0_mm[i]) / offstreetTravelSpeedMillimetersPerSecond; } if (time1 != Integer.MAX_VALUE) { time1 += (distances1_mm[i]) / offstreetTravelSpeedMillimetersPerSecond; } travelTimes[i] = time0 < time1 ? time0 : time1; } return new PointSetTimes (pointSet, travelTimes); }
Source:
public void setup() throws Exception { File rootDirectory = StoreTestUtils.createTempDirectory("ambry"); File indexFile = new File(rootDirectory.getAbsolutePath()); for (File c : indexFile.listFiles()) { c.delete(); } ScheduledExecutorService scheduler = Utils.newScheduler(1, false); Log log = new Log(rootDirectory.getAbsolutePath(), 10000, 10000, new StoreMetrics(rootDirectory.getAbsolutePath(), new MetricRegistry())); Properties props = new Properties(); props.setProperty("store.data.flush.interval.seconds", "3600"); props.setProperty("store.deleted.message.retention.days", "1"); props.setProperty("store.index.max.number.of.inmem.elements", "2"); props.setProperty("store.hard.delete.bytes.per.sec", "40"); StoreConfig config = new StoreConfig(new VerifiableProperties(props)); StoreKeyFactory factory = Utils.getObj("com.github.ambry.store.MockIdFactory"); time = new MockTime(SystemTime.getInstance().milliseconds()); helper = new HardDeleteTestHelper(0, 200); index = new MockIndex(rootDirectory.getAbsolutePath(), scheduler, log, config, factory, helper, time); helper.setIndex(index, log); index.setHardDeleteRunningStatus(true); }

Target:
public void setup() throws Exception { File rootDirectory = StoreTestUtils.createTempDirectory("ambry"); File indexFile = new File(rootDirectory.getAbsolutePath()); for (File c : indexFile.listFiles()) { c.delete(); } scheduler = Utils.newScheduler(1, false); log = new Log(rootDirectory.getAbsolutePath(), 10000, 10000, new StoreMetrics(rootDirectory.getAbsolutePath(), new MetricRegistry())); Properties props = new Properties(); props.setProperty("store.data.flush.interval.seconds", "3600"); props.setProperty("store.deleted.message.retention.days", "1"); props.setProperty("store.index.max.number.of.inmem.elements", "2"); props.setProperty("store.hard.delete.bytes.per.sec", "40"); StoreConfig config = new StoreConfig(new VerifiableProperties(props)); StoreKeyFactory factory = Utils.getObj("com.github.ambry.store.MockIdFactory"); time = new MockTime(SystemTime.getInstance().milliseconds()); helper = new HardDeleteTestHelper(0, 200); index = new MockIndex(rootDirectory.getAbsolutePath(), scheduler, log, config, factory, helper, time, UUID.randomUUID()); helper.setIndex(index, log); index.setHardDeleteRunningStatus(true); }
Source:
protected boolean check(Supplier<DesiredCapabilities> serverCapabilitiesSupplier, Supplier<Capabilities> clientCapabilitiesSupplier, BiPredicate<By, Class<? extends WebElement>> filter, By by, Class<? extends WebElement> clazz) { AppiumServiceBuilder builder = new AppiumServiceBuilder() .withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js")) .withCapabilities(serverCapabilitiesSupplier.get()); driver = new AppiumDriver<>(builder, clientCapabilitiesSupplier.get()); return filter.test(by, clazz); }

Target:
protected boolean check(Supplier<DesiredCapabilities> serverCapabilitiesSupplier, Supplier<Capabilities> clientCapabilitiesSupplier, BiPredicate<By, Class<? extends WebElement>> filter, By by, Class<? extends WebElement> clazz) { AppiumServiceBuilder builder = new AppiumServiceBuilder() .withCapabilities(serverCapabilitiesSupplier.get()); driver = new AppiumDriver<>(builder, clientCapabilitiesSupplier.get()); return filter.test(by, clazz); }
Source:
public int read() throws IOException { if (this.bytesRead == this.length) { return -1; } try { if (this.streamBytesRead == 0 || this.chunkPos == this.chunkBody.length) { if (this.streamBytesRead != this.streamSize) { int chunkSize = CHUNK_SIZE; if (this.streamBytesRead + chunkSize > this.streamSize) { chunkSize = this.streamSize - this.streamBytesRead; } if (readChunk(chunkSize) < 0) { return -1; } this.streamBytesRead += chunkSize; } else { byte[] chunk = new byte[0]; createChunkBody(chunk); } } this.bytesRead++; return this.chunkBody[this.chunkPos++] & 0xFF; } catch (NoSuchAlgorithmException | InvalidKeyException | InsufficientDataException | InternalException e) { throw new IOException(e.getCause()); } }

Target:
public int read() throws IOException { if (this.bytesRead == this.length) { return -1; } try { if (this.streamBytesRead == 0 || this.chunkPos == this.chunkBody.length) { if (this.streamBytesRead != this.streamSize) { int chunkSize = CHUNK_SIZE; if (this.streamBytesRead + chunkSize > this.streamSize) { chunkSize = this.streamSize - this.streamBytesRead; } if (readChunk(chunkSize) < 0) { return -1; } this.streamBytesRead += chunkSize; } else { byte[] chunk = new byte[0]; createChunkBody(chunk); } } this.bytesRead++; int value = this.chunkBody[this.chunkPos] & 0xFF; this.chunkPos++; return value; } catch (NoSuchAlgorithmException | InvalidKeyException | InsufficientDataException | InternalException e) { throw new IOException(e.getCause()); } }
Source:
List<String> foo() { Object obj; Object o1 = (List<String>) foo(); Object o2 = (List<? extends String>) foo(); Object o3 = (List<? super String>) foo(); String s1 = (String) obj; String s2 = (String) s1; A a = (A) new B(); A[][] as = (A[][]) new B[1][1]; B b; fun(b); fun((A) b); List<B> bees = new java.util.ArrayList<B>(); java.util.List<A> aaas = (java.util.List) bees; C c = new C((A)null); foo((List<List<A>>) (List<?>) foo2()); obj = (Unknown<String>) unknown; String[] stringList = (String[]) list.toArray(new String[0]); }

Target:
List<String> foo() { Object obj; Object o1 = (List<String>) foo(); Object o2 = (List<? extends String>) foo(); Object o3 = (List<? super String>) foo(); String s1 = (String) obj; String s2 = (String) s1; A a = (A) new B(); A[][] as = (A[][]) new B[1][1]; B b; fun(b); fun((B) b); fun((A) b); funBParameter((A) b); List<B> bees = new java.util.ArrayList<B>(); java.util.List<A> aaas = (java.util.List) bees; C c = new C((A) null); C c2 = new C((B) b); foo((List<List<A>>) (List<?>) foo2()); obj = (Unknown<String>) unknown; String[] stringList = (String[]) list.toArray(new String[0]); }
Source:
public void collectionProcessComplete() throws AnalysisEngineProcessException { if (out != null) { IOUtils.closeQuietly(out); } try { Train.main(new String[] { tempData.toString(), targetLocation.toString() }); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }

Target:
public void collectionProcessComplete() throws AnalysisEngineProcessException { try { Train.main(new String[] { tempData.toString(), targetLocation.toString() }); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }
Source:
public void testHeaderSkip() throws Exception { String []myOptions = { "-f" + path_csv, "--reportdir=" + reportDir, "--maxerrors=50", "--user=", "--password=", "--port=", "--separator=,", "--quotechar=\"", "--skip=2", "--escape=\\", "--limitrows=100", "--header", "BlAh" }; String currentTime = new TimestampType().toString(); String []myData = { "1 ,1,1,11111111,first,1.10,1.11,"+currentTime+",POINT(1 1),\"POLYGON((0 0, 1 0, 0 1, 0 0))\"", "2,2,2,222222,second,3.30,NULL,"+currentTime+",POINT(2 2),\"POLYGON((0 0, 2 0, 0 2, 0 0))\"", "clm_integer,clm_tinyint,clm_smallint,clm_bigint,clm_string,clm_decimal,clm_float,clm_timestamp,clm_point,clm_geography", "3,3,3,333333, third ,NULL, 3.33,"+currentTime+",POINT(3 3),\"POLYGON((0 0, 3 0, 0 3, 0 0))\"", "4,4,4,444444, NULL ,4.40 ,4.44,"+currentTime+",POINT(4 4),\"POLYGON((0 0, 4 0, 0 4, 0 0))\"", "5,5,5,5555555, \"abcde\"g, 5.50, 5.55,"+currentTime+",POINT(5 5),\"POLYGON((0 0, 5 0, 0 5, 0 0))\"", "6,6,NULL,666666, sixth, 6.60, 6.66,"+currentTime+",POINT(6 6),\"POLYGON((0 0, 6 0, 0 6, 0 0))\"", "7,NULL,7,7777777, seventh, 7.70, 7.77,"+currentTime+",POINT(7 7),\"POLYGON((0 0, 7 0, 0 7, 0 0))\"", "11, 1,1,\"1,000\",first,1.10,1.11,"+currentTime+",POINT(1 1),\"POLYGON((0 0, 8 0, 0 8, 0 0))\"", }; int invalidLineCnt = 0; int validLineCnt = 6; test_Interface(myOptions, myData, invalidLineCnt, validLineCnt ); }

Target:
public void testHeaderSkip() throws Exception { String []myOptions = { "-f" + path_csv, "--reportdir=" + reportDir, "--maxerrors=50", "--user=", "--password=", "--port=", "--separator=,", "--quotechar=\"", "--skip=2", "--escape=\\", "--limitrows=100", "--header", "BlAh" }; String currentTime = new TimestampType().toString(); String []myData = { "clm_integer,clm_tinyint,clm_smallint,clm_bigint,clm_string,clm_decimal,clm_float,clm_timestamp,clm_point,clm_geography", "1 ,1,1,11111111,first,1.10,1.11,"+currentTime+",POINT(1 1),\"POLYGON((0 0, 1 0, 0 1, 0 0))\"", "2,2,2,222222,second,3.30,NULL,"+currentTime+",POINT(2 2),\"POLYGON((0 0, 2 0, 0 2, 0 0))\"", "3,3,3,333333, third ,NULL, 3.33,"+currentTime+",POINT(3 3),\"POLYGON((0 0, 3 0, 0 3, 0 0))\"", "4,4,4,444444, NULL ,4.40 ,4.44,"+currentTime+",POINT(4 4),\"POLYGON((0 0, 4 0, 0 4, 0 0))\"", "5,5,5,5555555, \"abcde\"g, 5.50, 5.55,"+currentTime+",POINT(5 5),\"POLYGON((0 0, 5 0, 0 5, 0 0))\"", "6,6,NULL,666666, sixth, 6.60, 6.66,"+currentTime+",POINT(6 6),\"POLYGON((0 0, 6 0, 0 6, 0 0))\"", "7,NULL,7,7777777, seventh, 7.70, 7.77,"+currentTime+",POINT(7 7),\"POLYGON((0 0, 7 0, 0 7, 0 0))\"", "11, 1,1,\"1,000\",first,1.10,1.11,"+currentTime+",POINT(1 1),\"POLYGON((0 0, 8 0, 0 8, 0 0))\"", }; int invalidLineCnt = 0; int validLineCnt = 6; test_Interface(myOptions, myData, invalidLineCnt, validLineCnt ); }
Source:
public ResponseEntity<String> create(@RequestHeader final String authorization, @RequestBody String user) throws IOException, MessagingException { User parsedUser = mapper.readValue(user, User.class); Optional<String> email = RegistrationHelper.extractSendToEmail(parsedUser); if (!email.isPresent()) { LOGGER.log(Level.WARNING, "No primary email found!"); return new ResponseEntity<>("{\"error\":\"No primary email found!\"}", HttpStatus.BAD_REQUEST); } String activationToken = UUID.randomUUID().toString(); parsedUser = createUserForRegistration(parsedUser, activationToken); HttpClientRequestResult saveUserResponse = saveUser(parsedUser, authorization); if (saveUserResponse.getStatusCode() != HttpStatus.CREATED.value()) { LOGGER.log(Level.WARNING, "Problems creating user for registration"); return new ResponseEntity<>("{\"error\":\"Problems creating user for registration\"}", HttpStatus.valueOf(saveUserResponse.getStatusCode())); } User createdUser = mapper.readValue(saveUserResponse.getBody(), User.class); try { sendActivationMail(email.get(), createdUser, activationToken); } catch (OsiamException e) { return new ResponseEntity<>("{\"error\":\"Problems creating user for registration\"}", HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<>(saveUserResponse.getBody(), HttpStatus.OK); }

Target:
public ResponseEntity<String> create(@RequestHeader final String authorization, @RequestBody String user) throws IOException, MessagingException { User parsedUser = mapper.readValue(user, User.class); Optional<String> email = RegistrationHelper.extractSendToEmail(parsedUser); if (!email.isPresent()) { LOGGER.log(Level.WARNING, "Could not register user. No email of user " + parsedUser.getUserName() + " found!"); return new ResponseEntity<>("{\"error\":\"Could not register user. No email of user " + parsedUser.getUserName() + " found!\"}", HttpStatus.BAD_REQUEST); } String activationToken = UUID.randomUUID().toString(); parsedUser = createUserForRegistration(parsedUser, activationToken); HttpClientRequestResult saveUserResponse = saveUser(parsedUser, authorization); if (saveUserResponse.getStatusCode() != HttpStatus.CREATED.value()) { LOGGER.log(Level.WARNING, "Problems creating user for registration"); return new ResponseEntity<>("{\"error\":\"Problems creating user for registration\"}", HttpStatus.valueOf(saveUserResponse.getStatusCode())); } User createdUser = mapper.readValue(saveUserResponse.getBody(), User.class); try { sendActivationMail(email.get(), createdUser, activationToken); } catch (OsiamException e) { return new ResponseEntity<>("{\"error\":\"Problems creating user for registration: \"" + e.getMessage() + "}", HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<>(saveUserResponse.getBody(), HttpStatus.OK); }
Source:
public Tree ARRAY_ASSIGNMENT_PATTERN_ELEMENT() { return b.<Tree>nonterminal(PHPLexicalGrammar.ARRAY_ASSIGNMENT_PATTERN_ELEMENT) .is( b.firstOf( f.arrayAssignmentPatternElement( b.optional( f.newTuple6( EXPRESSION(), b.token(DOUBLEARROW))), VARIABLE_IDENTIFIER()), ARRAY_ASSIGNMENT_PATTERN())); }

Target:
public Tree ARRAY_ASSIGNMENT_PATTERN_ELEMENT() { return b.<Tree>nonterminal(PHPLexicalGrammar.ARRAY_ASSIGNMENT_PATTERN_ELEMENT) .is( b.firstOf( f.arrayAssignmentPatternElement( b.optional( f.newTuple6( EXPRESSION(), b.token(DOUBLEARROW))), MEMBER_EXPRESSION()), ARRAY_ASSIGNMENT_PATTERN())); }